aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2018-08-13tpm: sandbox: fix wrong assignment with a simplificationMiquel Raynal1-26/+26
The recv variable in sandbox_tpm2_fill_buf() is a pointer on a pointer of a char array. It means accessing *recv is the char array pointer itself while **recv is the first character of that array. There is no need for such indirection here, so simplify the code. Simplifying things will make the last assignment right: "*recv = NULL" is now correct. The issue has been found by the following Coverity Scan report: CID 183371: Incorrect expression (UNUSED_VALUE) Assigning value "4UL" to "*recv" here, but that stored value is overwritten before it can be used. 232 *recv += sizeof(rc); 233 234 /* Add trailing \0 */ 235 *recv = NULL; While at simplifying things, use '\0' instead of NULL when adding an empty char at the end of the buffer. Reported-by: Tom Rini <trini@konsulko.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-13tpm: sandbox: fix wrong check on pcr_mapMiquel Raynal1-3/+3
The second check on pcr_map in sandbox_tpm2_xfer() is wrong. It should check for pcr_map not being empty. Instead, it is a pure copy/paste of the first check which is redundant. This has been found thanks to a Coverity Scan report: CID 183370: Memory - illegal accesses (UNINIT) Using uninitialized value "pcr_index". put_unaligned_be32(tpm->pcr_extensions[pcr_index], recv); This is because pcr_index is initialized only if the user input is correct, ie. at least one valid bit is set in pcr_map. Fix the second check and also initialize pcr_index to 0 (which is harmless in case of error) to make Coverity Scan happy. Reported-by: Tom Rini <trini@konsulko.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-13clk: at91: utmi: add timeout for utmi lockEugen Hristev1-1/+6
In case the slow clock is not properly configured, the UTMI clock cannot lock the PLL, because UPLLCOUNT will "wait X slow clock cycles". In this case U-boot will loop indefinitely. Added a timeout in this case, to start U-boot even if UTMI clock is not enabled, so the user can use different media if needed, or investigate. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2018-08-13Merge git://git.denx.de/u-boot-fsl-qoriqTom Rini5-41/+89
2018-08-11Merge branch 'agust@denx.de' of git://git.denx.de/u-boot-stagingTom Rini6-1/+497
2018-08-11Merge branch 'master' of git://git.denx.de/u-boot-videoTom Rini15-21/+3784
2018-08-11misc: Add gdsys_ioep driverMario Six4-0/+353
Add driver for the IHS IO endpoint on IHS FPGAs. Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-08-11test: Add tests for misc uclassMario Six2-1/+134
Add a set of tests for the misc uclass. Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-11misc: uclass: Add enable/disable functionMario Six1-0/+10
Add generic enable/disable function to the misc uclass. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-08-11video_display: Add Xilinx LogiCore DP TXMario Six6-0/+3099
Add a driver for the Xilinx LogiCORE DisplayPort IP core, which is a pure DP transmitter core for Xiling FPGA (no display capabilities). Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-08-11video: Sort Makefile entriesMario Six1-21/+21
The entries of Makefiles should be sorted, which is not the case in the video driver Makefile. Sort the entries alphabetically as far as this makes sense. Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-08-11axi: Add AXI sandbox driver and simple emulatorMario Six5-0/+295
Add test infrastructure and tests for the AXI uclass. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-08-11axi: Add ihs_axi driverMario Six3-0/+306
Add a driver for the gdsys IHS AXI bus used on IHS FPGAs. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-08-11drivers: Add AXI uclassMario Six5-0/+63
Add a uclass for AXI (Advanced eXtensible Interface) busses, and a driver for the gdsys IHS AXI bus on IHS FPGAs. Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-10drivers: serial: document on_baudrate()Heinrich Schuchardt1-0/+8
Add parameter description. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2018-08-10mtd: nand: fsl_ifc: Fix handling of bitflips in erased pagesDarwin Dingel1-30/+39
This is a fix made for the fsl_ifc_nand driver on linux kernel by Pavel Machek and is applied to uboot. It is currently on applied on linux-mtd. https://patchwork.kernel.org/patch/9758117/ IFC always raises ECC errors on erased pages. It is only ignored when the buffer is checked for all 0xFF by is_blank(). The problem is a single bitflip will cause is_blank() and then mtd_read to fail. The fix makes use of nand_check_erased_ecc_chunk() to check for empty pages instead of is_blank(). This also makes sure that reads are made at ECC page size granularity to get a proper bitflip count. If the number of bitflips does not exceed the ECC strength, the page is considered empty and the bitflips will be corrected when data is sent to the higher layers (e.g. ubi). Signed-off-by: Darwin Dingel <darwin.dingel@alliedtelesis.co.nz> Cc: Pavel Machek <pavel@denx.de> Cc: Scott Wood <oss@buserror.net> Acked-by: Pavel Machek <pavel@denx.de> [Kurt: Replaced dev_err by printf due to compiler warnings] Tested-by: Kurt Kanzenbach <kurt@linutronix.de> Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de> Reviewed-by: York Sun <york.sun@nxp.com>
2018-08-10armv8: ls1046a: add icid setup for qman portalsLaurentiu Tudor1-4/+39
Add support for ICID setting of qman portals and the required device tree fixups. Also fix an endiness issue in portal setup code. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
2018-08-10misc: fsl_portals: setup QMAN_BAR{E} also on ARM platformsLaurentiu Tudor1-2/+0
QMAN_BAR{E} register setup was disabled on ARM platforms, however the register does need to be set. Enable the code also on ARMs and fix the CONFIG_SYS_QMAN_MEM_PHYS define to the correct value so that the newly enabled code works. Reviewed-by: Bharat Bhushan <bharat.bhushan@nxp.com> Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
2018-08-10dm: led: move default state support in led uclassPatrick Delaunay2-8/+30
This patch save common LED property "default-state" value in post bind of LED uclass. The configuration for this default state is only performed when led_default_state() is called; It can be called in your board_init() or it could added in init_sequence_r[] in future. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2018-08-10Revert "dm: led: auto probe() LEDs with "default-state""Patrick Delaunay1-9/+0
This reverts commit bc882f5d5c7b4d6ed5e927bf838863af43c786e7. because this patch adds the probe of LED driver during the binding phasis. It is not allowed in driver model because the drivers (clock, pincontrol) needed by the LED driver can be also probed before the binding of all the device and it is a source of problems. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2018-08-10Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini3-30/+245
2018-08-09Merge git://git.denx.de/u-boot-dmTom Rini5-25/+232
2018-08-08Merge branch 'master' of git://git.denx.de/u-boot-mipsTom Rini4-11/+40
2018-08-08dfu: Provide more verbose error messageSam Protsenko1-0/+1
It might be useful for user to see some human-readable root cause message in addition to "configuration failed" message, so that the issue can be fixed quickly. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
2018-08-08dfu: Fix memory leak in dfu_init_env_entities()Sam Protsenko1-3/+4
In case of error in dfu_init_env_entities(), env_bkp will leak. Fix it by providing single return path. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
2018-08-08dfu: Fix data abort in dfu_free_entities()Sam Protsenko1-1/+1
Commit 5d8fae79163e ("dfu: avoid memory leak") brings a regression which described below. This patch is effectively reverting that commit, adding corresponding comment to avoid such regressions in future. In case of error in dfu_config_entities(), it frees "dfu" array, which leads to "data abort" in dfu_free_entities(), which tries to free the same array (and even tries to access it from linked list first). The issue occurs e.g. when partition table on device does not match $dfu_alt_info layout: => dfu 0 mmc 1 Couldn't find part #2 on mmc device #1 DFU entities configuration failed! data abort To fix this issue, do not free "dfu" array in dfu_config_entities(). It will be freed later in dfu_free_entities(). Tested on BeagleBone Black (where this regression was originally found). Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
2018-08-08usb: rockchip: on K_FW_LBA_WRITE_10 remove magic block size of 512 bytesAlberto Panizzo1-18/+21
As well as in K_FW_LBA_READ_10 and K_FW_LBA_ERASE_10 take device's block size from f_rkusb->desc->blksz instead of the fixed 512 bytes. Keep original behaviour of retry probing assigned block device on every host request to manage late SDCard plugs. Signed-off-by: Alberto Panizzo <alberto@amarulasolutions.com>
2018-08-08usb: rockchip: fix printing csw debug infoAlberto Panizzo1-1/+1
Workstation tool was happy while console on device were printing random numbers.. Signed-off-by: Alberto Panizzo <alberto@amarulasolutions.com>
2018-08-08usb: rockchip: be quiet on serial port while transferring dataAlberto Panizzo1-2/+2
While downloading or uploading megabytes of data we had thousands of printf in console like: transfer 0x10000 bytes done OR Uploading 0x1000 bytes This because transfers are chunked and there is no way on target side to know the overall transfer size (to print one string per overall transfer). All these prints on serial console do slow down significantly the transfer and does not offer a significant information to the developer: rkdeveloptool and Rockchip original tool do use small chunks read/writes on big transfers. This allows on workstation to print percentage of transfer complete and as well offers to developer the information about: transfer is running OK. On error, either the percentage will stop or an error will be shown on workstation console. Signed-off-by: Alberto Panizzo <alberto@amarulasolutions.com>
2018-08-08usb: rockchip: implement K_FW_LBA_ERASE_10 commandAlberto Panizzo1-0/+48
This command is part of the write partition sequence performed by rkdeveloptool: one partition is first completely erased and than wrote. Signed-off-by: Alberto Panizzo <alberto@amarulasolutions.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08usb: rockchip: implement K_FW_LBA_READ_10 commandAlberto Panizzo1-1/+103
This patch implement reading blocks form selected device with LBA addressing. Corresponding command on workstation is: rkdeveloptool rl <start_blk> <blk_cnt> <file> While we support reading more than one blocks per K_FW_LBA_READ_10 request, rkdeveloptool and original rockchip tool do perform chunk reads limiting the maximum size per chunk far lower than max int values. Signed-off-by: Alberto Panizzo <alberto@amarulasolutions.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08usb: rockchip: implement skeleton for K_FW_GET_CHIP_VER commandAlberto Panizzo1-1/+43
Chip Version is a string saved in BOOTROM address space Little Endian. Ex for rk3288: 0x33323041 0x32303134 0x30383133 0x56323030 which brings: 320A20140813V200 Note that memory version do invert MSB/LSB so printing the char buffer would show: A02341023180002V Signed-off-by: Alberto Panizzo <alberto@amarulasolutions.com>
2018-08-08usb: rockchip: fix command failed on host side due to missing dataAlberto Panizzo1-2/+20
Two consecutive rockusb_tx_write without waiting for request complete do results in transfer reset of first request and thus no or incomplete data transfer. This because rockusb_tx_write do use just one USB request to keep serialization. So calls like: rockusb_tx_write_str(emmc_id); rockusb_tx_write_csw(cbw->tag, cbw->data_transfer_length, CSW_GOOD); was succeeding only when DEBUG was defined because the time spent printing debug info was enough for transfer to complete. This patch fixes the issue adding a simple request complete handler called rockusb_tx_write_csw to be set as complete handler of in_req when sending back simple payload + CSW replies to commands. This new handler will always send CSW_GOOD replies because in case of error the command callback itself must send back an error CSW as unique reply to command. This patch fixes execution of: $ rkdeveloptool rfi when DEBUG is not defined. Signed-off-by: Alberto Panizzo <alberto@amarulasolutions.com>
2018-08-08gadget: f_thor: fix hang-up with ctrl-cSeung-Woo Kim1-2/+2
After the commit 6aae84769a0b ("gadget: f_thor: Fix memory leaks of usb request and its buffer"), there is hang-up with ctrl-c in some udc. It is because req of out_ep is freed before out_ep is disabled. Fix hang-up with ctrl-c by disabling ep before free req of the ep. Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2018-08-08fsl/mc: Limit the ethernet name to ETH_NAME_LENPankaj Bansal2-5/+5
The ethernet name should be within the ETH_NAME_LEN, as this is the buffer space allocated to ethernet name. Otherwise, this causes buffer overflow. Reported-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
2018-08-08FSL PCI: Configure PCIe reference ratioJoakim Tjernlund1-0/+6
Most FSL PCIe controllers expects 333 MHz PCI reference clock. This clock is derived from the CCB but in many cases the ref. clock is not 333 MHz and a divisor needs to be configured. This adds PEX_CCB_DIV #define which can be defined for each type of CPU/platform. Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com> Reviewed-by: York Sun <york.sun@nxp.com>
2018-08-08test: dm: pci: Add cases for finding PCI capability APIsBin Meng1-0/+21
Add several PCI capability and extended capability ID registers in the swap_case driver, so that we can add test case for dm_pci_find_capability() and dm_pci_find_ext_capability(). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08dm: pci: Add APIs to find capability and extended capabilityBin Meng1-0/+68
This introduces two new APIs dm_pci_find_capability() and dm_pci_find_ext_capability() to get PCI capability address and PCI express extended capability address for a given PCI device. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08pci: sandbox: emul: Rename priv structureBin Meng1-4/+4
We have "struct sandbox_pci_priv" in pci_sandbox driver. To avoid confusion, rename the emul's priv to "struct sandbox_pci_emul_priv". Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08pci: sandbox: swap_case: Declare dynamic driver matchingBin Meng1-0/+7
This adds a U_BOOT_PCI_DEVICE() declaration to the swap_case driver. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08pci: sandbox: Support dynamically binding device driverBin Meng2-10/+82
At present all emulated sandbox pci devices must be present in the device tree in order to be used. The real world pci uclass driver supports pci device driver matching, and we should add such support on sandbox too. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08dm: pci: Assign correct driver data when binding a driverBin Meng1-1/+1
The correct driver data comes from the matching 'id' instead of 'find_id' in pci_find_and_bind_driver(). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08pci: sandbox: emul: Fix the call to pci_bus_find_devfn()Bin Meng1-1/+1
With the newly added test cases for PCI configuration access, we get: => ut dm pci_busdev Test: dm_test_pci_busdev: pci.c test/dm/pci.c:49, dm_test_pci_busdev(): SANDBOX_PCI_VENDOR_ID == vendor: Expected 4660, got 65535 Test: dm_test_pci_busdev: pci.c (flat tree) test/dm/pci.c:49, dm_test_pci_busdev(): SANDBOX_PCI_VENDOR_ID == vendor: Expected 4660, got 65535 Failures: 2 The bug only shows up when bus number is not equal to zero. This is caused by the plain find_devfn parameter is passed to function call pci_bus_find_devfn(), inside which find_devfn is compared to devfn in the device's pplat structure. However pplat->devfn does not carry the bus number. Fix this by passing find_devfn with bus number masked. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08pci: sandbox: swap_case: Preserve space indicator bit in BAR registersBin Meng1-3/+5
With the newly added testing of more than one device, we get: => ut dm pci_swapcase Test: dm_test_pci_swapcase: pci.c test/dm/pci.c:88, dm_test_pci_swapcase(): "tHIS IS A tESt" = ptr: Expected "tHIS IS A tESt", got "this is a test" Test: dm_test_pci_swapcase: pci.c (flat tree) test/dm/pci.c:88, dm_test_pci_swapcase(): "tHIS IS A tESt" = ptr: Expected "tHIS IS A tESt", got "this is a test" Failures: 2 The failure only happens on the 2nd swap_case device on the PCI bus. The case passes on the 1st device. It turns out the swap_case driver does not emulate bit#0 in BAR registers as a read-only bit. This corrects the implementation. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08dm: pci: Fix scanning multi-function deviceBin Meng1-0/+2
The flag to control whether to scan multi-function device during enumeration should be cleared at the beginning of each iteration if the device's function number equals to zero. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08dm: pci: Extract vendor/device id in child_post_bind()Bin Meng1-6/+5
Currently only devfn is extracted in child_post_bind(). Now that we have the live-tree version API to look up PCI vendor and device id from the compatible string, let's extract and save them too. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08dm: core: Add ofnode function to read PCI vendor and device idBin Meng1-0/+36
We don't have the live-tree version of fdtdec_get_pci_vendev(). This adds the API. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08bcm6838: add initial supportPhilippe Reynes1-0/+33
This adds the initial support of the Broadcom BCM6838 SoC familly, only cpu, dram, uart and leds are supported. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2018-08-08bmips: ram: add an option to force the size of the ramPhilippe Reynes1-1/+7
This adds an option to force the size of the ram, and avoid the detection of ram size. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2018-08-08mips: au1x00: Remove support for these SoCsTom Rini2-10/+0
The only platform left for the AU1x00 SoCs was the pb1x00 platform, an apparent clone of the dbau1x00 platform. As pb1x00 had no listed maintainer I am assuming that it is also orphaned. Remove this platform and then remove the unused SoC support. Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>