summaryrefslogtreecommitdiff
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* fastboot: Fix parameter types in _fb_nand_writeAlex Kiernan2018-05-301-1/+1
| | | | | | | | | | | | | | | | | | Compiling on a 64 bit target the arguments to _fb_nand_write are incompatible: drivers/fastboot/fb_nand.c: In function ‘_fb_nand_write’: drivers/fastboot/fb_nand.c:101:42: warning: passing argument 3 of ‘nand_write_skip_bad’ from incompatible pointer type [-Wincompatible-pointer-types] return nand_write_skip_bad(mtd, offset, &length, written, ^ In file included from drivers/fastboot/fb_nand.c:16:0: include/nand.h:107:5: note: expected ‘size_t * {aka long unsigned int *}’ but argument is of type ‘unsigned int *’ int nand_write_skip_bad(struct mtd_info *mtd, loff_t offset, size_t *length, ^~~~~~~~~~~~~~~~~~~ Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* fastboot: Remove FIXME for CONFIG_FASTBOOT_...NAMEAlex Kiernan2018-05-301-13/+0
| | | | | | | | | | CONFIG_FASTBOOT_GPT_NAME and CONFIG_FASTBOOT_MBR_NAME are always defined by Kconfig if you're compiling this code, so remove these redundant defaults. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* fastboot: Add missing newlinesAlex Kiernan2018-05-301-14/+14
| | | | | | | | Add newlines so we format our output correctly. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Jocelyn Bohr <bohr@google.com>
* fastboot: Correct dependencies in FASTBOOT_FLASHAlex Kiernan2018-05-303-26/+13
| | | | | | | | | | | | | | | | Ensure that when selecting FASTBOOT_FLASH you end up with a buildable configuration. Prior to this you could select NAND without MTDPARTS and end up with an image which (surprisingly) excluded NAND. Also fix dependencies on FASTBOOT_GPT_NAME/FASTBOOT_MBR_NAME which require you have EFI_PARTITION/DOS_PARTITION enabled. Delete redundant FASTBOOT_FLASH_NAND_DEV from Kconfig - it was only ever used as a guard and the value was ignored in all cases, we're using FASTBOOT_FLASH_NAND as the guard now. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
* fastboot: Extract fastboot_okay/fail to fb_common.cAlex Kiernan2018-05-304-16/+64
| | | | | | | | | | | | Add drivers/fastboot/fb_common.c, where fastboot_okay/fail are implemented so we can call them from a non-USB implementation. Introduce fastboot_response which takes varargs parameters so we can use it to generate formatted response strings. Refactor fastboot_okay/fail to use it. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
* fastboot: Refactor fastboot_okay/fail to take responseAlex Kiernan2018-05-303-75/+77
| | | | | | | | | Add the response string as a parameter to fastboot_okay/fail, instead of modifying a global, to match the contract expected by the AOSP U-Boot code. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
* fastboot: Move fastboot to drivers/fastbootAlex Kiernan2018-05-306-0/+772
| | | | | | | | | | | | | | Separate CMD_FASTBOOT from FASTBOOT and move code and configuration to drivers/fastboot. Switch dependencies on FASTBOOT to USB_FUNCTION_FASTBOOT as anyone who wants FASTBOOT before this series wants USB_FUNCTION_FASTBOOT. Split USB_FUNCTION_FASTBOOT from FASTBOOT so they retain their existing behaviour. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* gadget: f_thor: Fix memory leaks of usb request and its bufferSeung-Woo Kim2018-05-301-33/+32
| | | | | | | There are memory leaks of usb request and its buffer for ep0, in_ep, and out ep. Fix memory leaks of usb request and its buffer. Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
* rockchip: xhci: remove DTS parsing for PHY (which is unused)Philipp Tomsich2018-05-301-16/+0
| | | | | | | | | | | | The xhci wrapper-driver for Rockchip searches the DTS to find its child node compatbile with 'rockchip,rk3399-usb3-phy' to retrieve the base-address of the PHY. However, this is currently broken (and always has been), returning NULL. However, the (wrongly) retrieved base-address is never used. We thus remove this code for now. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
* usb: xhci: Handle endianness in xhci_set_configuration()Bin Meng2018-05-301-1/+1
| | | | | | | | In xhci_set_configuration(), 'Context Entries' field in the slot context was cleared with mask LAST_CTX_MASK, but it should have taken the endianness into consideration. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
* usb: xhci: Fix config fail of FS hub behind a HS hub with MTTBin Meng2018-05-301-1/+8
| | | | | | | | | | | | | | | | If a full speed hub connects to a high speed hub which supports MTT, the MTT field of its slot context will be set to 1 when xHCI driver setups an xHCI virtual device in xhci_setup_addressable_virt_dev(). Once usb core fetch its hub descriptor, and need to update the xHC's internal data structures for the device, the HUB field of its slot context will be set to 1 too, meanwhile MTT is also set before, this will cause configure endpoint command fail. In the case, we should clear MTT to 0 for full speed hub according to section 6.2.2. This keeps in sync with Linux kernel commit: 096b110: usb: xhci: fix config fail of FS hub behind a HS hub with MTT Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
* usb: xhci: Initialize dev_state to 0 in the input slot contextBin Meng2018-05-301-0/+1
| | | | | | | | | | | Per xHCI spec chapter 6.2.2 table 6-7, as input, software shall initialize the dev_state field to '0'. Though this does not seem to cause any issue with most xHC implementations, let's do this to conform with the spec. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Marek Vasut <marek.vasut@gmail.com> Tested-by: Matthias Blankertz <matthias.blankertz@cetitec.com>
* usb: xhci: Set accurate add context flags when updating hub attributesBin Meng2018-05-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | If a USB 3.0 hub is plugged into the root port of the xHC, the xHCI driver will issue a 'Configure Endpoint' command to the xHC for it to update its internal data structure for this hub device. The hub attributes are in the slot context so we need tell xHC to update the slot context by setting the add context flags of the input control context to only cover the slot context. At present the add context flags is or'ed with the slot context bit, but it should really be accurately set to the slot context, as the variable that holds the value of the add context flags comes from whatever was set in the last command execution, which may contain additional contexts that 'Configure Endpoint' command should not touch. Some xHC implementations like x86 don't complain such, but it was observed on Renesas RCar Gen3 platform that the RCar xHC complains with a 'TRB error' completion codes as the response. Reported-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Marek Vasut <marek.vasut@gmail.com> Tested-by: Matthias Blankertz <matthias.blankertz@cetitec.com>
* usb: xhci-rcar: deregister before deactivating clockMatthias Blankertz2018-05-301-1/+4
| | | | | | | | | During the execution of xhci_deregister xHCI registers are accessed. If the clock is already deactivated when xhci_deregister is called this can lead to undefined behavior. Change the order to deregister the device before deactivating the clock. Signed-off-by: Matthias Blankertz <matthias.blankertz@cetitec.com>
* mmc: stm32_sdmmc2: Fix stm32_sdmmc2_start_cmd()Patrice Chotard2018-05-261-2/+2
| | | | | | | SDMMC_CMD_CPSMEN bit is wrongly check and set in SDMMC_ARG register instead of SDMMC_CMD register. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* stm32mp1: add FUSE command supportPatrick Delaunay2018-05-263-0/+126
| | | | | | | | Add support of fuse command (read/write/program/sense) on bank 0 to access to BSEC SAFMEM (4096 OTP bits). Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* serial: stm32: Add setparity supportPatrick Delaunay2018-05-262-2/+51
| | | | | | | Add possibility to update the serial parity used. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* serial: stm32: Fix bits defines namePatrice Chotard2018-05-262-10/+10
| | | | | | | | | Rename USART_ISR_FLAG_xxx bits to USART_ISR_xxx bits and USART_ICR_OREF to USART_ICR_ORECF in order to match datasheets. Sort defines by descendant order. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* serial: stm32: Add debug uart supportPatrick Delaunay2018-05-262-22/+92
| | | | | | | | | Add support for early debug printf, before the availability of driver model and device tree support. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* ram: stm32_sdram: Adds stm32f429-disco fixes for HardFault at bootingRadoslaw Pietrzyk2018-05-261-13/+24
| | | | | | | | | - adds reading FMC swap setting from DTB to SDRAM driver - sets FMC swap for stm32f429-disco board - changes ram start address to 0x90000000 Signed-off-by: Radoslaw Pietrzyk <radoslaw.pietrzyk@gmail.com> Acked-by: Patrice Chotard <patrice.chotard@st.com>
* serial: serial_msm: added pinmux & configRamon Fried2018-05-261-6/+18
| | | | | | | | | Serial port configuration was missing from previous implementation. It only worked because it was preconfigured by LK. This patch configures the uart for 115200 8N1. It also configures the pin mux for uart pins using DT bindings. Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
* serial: serial_msm: initialize uart only before relocationRamon Fried2018-05-261-0/+4
| | | | | | | | The uart is already initialized prior to relocation, reinitialization after relocation is unnecessary. Signed-off-by: Ramon Fried <ramon.fried@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* serial: serial_msm: fail probe if settings clocks failsRamon Fried2018-05-261-2/+4
| | | | | | | | | | Failure to set the clocks will causes data abort exception when trying to write to AHB uart registers. This patch ensures that we don't touch these registers if clock setting failed. Signed-off-by: Ramon Fried <ramon.fried@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* PCI: autoconfig: Don't allocate 64-bit addresses to 32-bit only resourcesTuomas Tynkkynen2018-05-263-5/+13
| | | | | | | | | | Currently, if we happen to allocate an address requiring 64 bits to a device only supporting 32-bit BARs, the address eventually gets silently truncated to 32 bits. Avoid this by adding a new flag to pciauto_region_allocate() to bail out in such situations. Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Reviewed-by: Simon Glass <sjg@chromium.org>
* PCI: Add newlines to debug prints in pci_auto_common.cTuomas Tynkkynen2018-05-261-2/+2
| | | | | | | | All of the debug output from this file is squished to one line. Fix it. Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Reviewed-by: Simon Glass <sjg@chromium.org>
* PCI: dm: Ignore 64-bit memory regions if CONFIG_SYS_PCI_64BIT not setTuomas Tynkkynen2018-05-261-0/+7
| | | | | | | | | | | | | | | | | Currently, qemu_arm_defconfig and qemu_arm64_defconfig only work with the 'highmem=off' parameter passed to QEMU's virt machine. The reason is that when 'highmem' is not disabled, QEMU appends 64-bit a memory resource to the PCI controller's regions property in DT in addition to the 32-bit PCI memory window in low memory. And the current DT parsing code picks the last (thus the 64-bit one) memory resource, whose address eventually gets silently truncated to 32 bits because CONFIG_SYS_PCI_64BIT is not set, which obviously causes PCI to break. Avoid this problem by ignoring memory regions whose addresses are above the 32-bit boundary when CONFIG_SYS_PCI_64BIT is not set. Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Reviewed-by: Simon Glass <sjg@chromium.org>
* tpm: add a Sandbox TPMv2.x driverMiquel Raynal2018-05-253-1/+636
| | | | | | | | | This driver can emulate all the basic functionalities of a TPMv2.x chip and should behave like them during regular testing. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* tpm2: tis_spi: add the possibility to reset the chip with a gpioMiquel Raynal2018-05-251-0/+16
| | | | | | | | On some designs, the reset line could not be connected to the SoC reset line, in this case, request the GPIO and ensure the chip gets reset. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* tpm: add support for TPMv2.x SPI modulesMiquel Raynal2018-05-253-0/+675
| | | | | | | | | Add the tpm2_tis_spi driver that should support any TPMv2 compliant (SPI) module. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* tpm: prepare support for TPMv2.x commandsMiquel Raynal2018-05-251-0/+2
| | | | | | | | | | | | Choice between v1 and v2 compliant functions is done with the configuration. Create the various files that will receive TPMv2-only code on the same scheme as for the TPMv1 code. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* tpm: disociate TPMv1.x specific and generic codeMiquel Raynal2018-05-258-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are no changes in this commit but a new organization of the code as follow. * cmd/ directory: > move existing code from cmd/tpm.c in cmd/tpm-common.c > move specific code in cmd/tpm-v1.c > create a specific header file with generic definitions for commands only called cmd/tpm-user-utils.h * lib/ directory: > move existing code from lib/tpm.c in lib/tpm-common.c > move specific code in lib/tpm-v1.c > create a specific header file with generic definitions for the library itself called lib/tpm-utils.h * include/ directory: > move existing code from include/tpm.h in include/tpm-common.h > move specific code in include/tpm-v1.h Code designated as 'common' is compiled if TPM are used. Code designated as 'specific' is compiled only if the right specification has been selected. All files include tpm-common.h. Files in cmd/ include tpm-user-utils.h. Files in lib/ include tpm-utils.h. Depending on the specification, files may include either (not both) tpm-v1.h or tpm-v2.h. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Tom Rini <trini@konsulko.com> [trini: Fix a few more cases of tpm.h -> tpm-v1.h, some Kconfig logic] Signed-off-by: Tom Rini <trini@konsulko.com>
* tpm: prepare introduction of TPMv2.x support in KconfigMiquel Raynal2018-05-251-11/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | Because both major revisions are not compatible at all, let's make them mutually exclusive in Kconfig. This way we will be sure, when using a command or a library function that it is supported by the right revision. Current drivers are currently prefixed by "tpm_", we will prefix TPMv2.x files by "tpm2_" to make the distinction without moving everything. The Kconfig menu about TPM drivers is now divided into two sections, one for each specification. Compliant drivers with one specification will only show up if this specification _only_ has been selected, otherwise a comment is displayed. Once a driver is selected by the user, it selects automatically a boolean value, that is needed in order to activate the TPM commands. Selecting the TPM commands will automatically select the right command/library files. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com> [trini: Rework deps as TPM_V1 and TPM_V2 depend on TPM, drop TPM_DRIVER_SELECTED] Signed-off-by: Tom Rini <trini@konsulko.com>
* tpm: add Revision ID field in the chip structureMiquel Raynal2018-05-251-0/+1
| | | | | | | | | | | | | | | TPM are shipped with a few read-only register from which we can retrieve for instance: - vendor ID - product ID - revision ID Product and vendor ID share the same register and are already referenced in the tpm_chip structure. Add the revision ID entry which is missing. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* Merge tag 'arc-uart-updates-for-2018.07-rc1' of git://git.denx.de/u-boot-arcTom Rini2018-05-242-0/+42
|\ | | | | | | | | | | | | | | | | | | Add support for DEBUG_UART on ARC devboards This required us to do 2 things: 1) Insert a call to debug_uart_init() in early boot code 2) Convert serial_arc to Kconfig Once both items above are done we just patched defconfigs.
| * serial/serial_arc: Implement debug serialAlexey Brodkin2018-05-242-0/+35
| | | | | | | | Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
| * serial: Convert ARC_SERIAL to KconfigAlexey Brodkin2018-05-241-0/+7
| | | | | | | | | | | | | | One step closer to completely Kconfig-driven target configuration in U-Boot :) Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
* | Merge tag 'signed-rpi-next' of git://github.com/agraf/u-bootTom Rini2018-05-241-218/+47
|\ \ | |/ |/| | | | | | | | | | | | | Patch queue for rpi - 2018-05-24 Some minor fixes for the Raspberry Pi: - Fix SD writes on new sdhost controller - Sanitize default load addresses, allowing for better payload placement
| * mmc: Unirqify bcm2835_sdhost and fix writesAlexander Graf2018-05-231-218/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The bcm2835 sdhost driver has a problem with "write multiple" commands. It seems to boil down to the fact that the controller dislikes its FIFO to get drained at the end of a block when a write multiple blocks command is in flight. The easy fix is to simply get rid of all the IRQ driven logic and make the driver push as much data into the FIFO as it can. That way we never drain and we never run into the problem. Reported-by: Jan Leonhardt <jan@cyberdesigner.net> Signed-off-by: Alexander Graf <agraf@suse.de>
* | i2c: Drop CONFIG_SH_SH7734_I2CTuomas Tynkkynen2018-05-232-377/+0
| | | | | | | | | | | | | | | | Last user of this driver went away in May 2017 in commit eb5ba3aefdf0f6c ("i2c: Drop use of CONFIG_I2C_HARD"). Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com> Acked-by: Heiko Schocher <hs@denx.de>
* | i2c: Drop CONFIG_TSI108_I2CTuomas Tynkkynen2018-05-232-276/+0
| | | | | | | | | | | | | | | | Last user of this driver went away in June 2015 in commit d928664f4101e24 ("powerpc: 74xx_7xx: remove 74xx_7xx cpu support") Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com> Acked-by: Heiko Schocher <hs@denx.de>
* | net: Drop CONFIG_TSI108_ETHTuomas Tynkkynen2018-05-232-1016/+0
| | | | | | | | | | | | | | Last user of this driver went away in June 2015 in commit d928664f4101e24 ("powerpc: 74xx_7xx: remove 74xx_7xx cpu support") Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
* | clk: at91: clk-h32mx: replace dm_warn with dev_dbgEugen Hristev2018-05-231-1/+1
| | | | | | | | | | | | | | | | dm_warn is too noisy, replace with dev_dbg for less noise. Based on original work by Wenyou Yang Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
* | Convert CONFIG_SUPPORT_EMMC_RPMB to KconfigAlex Kiernan2018-05-231-0/+7
|/ | | | | | | Convert CONFIG_SUPPORT_EMMC_RPMB to Kconfig. Split the command handling from the underlying support and expose this through CMD_MMC_RPMB. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
* SPDX: Fixup SPDX tags in a few new filesTom Rini2018-05-202-3/+2
| | | | Signed-off-by: Tom Rini <trini@konsulko.com>
* Merge branch 'master' of git://git.denx.de/u-boot-shTom Rini2018-05-203-227/+294
|\
| * i2c: rcar_i2c: Add DM and DT capable I2C driverMarek Vasut2018-05-203-0/+360
| | | | | | | | | | | | | | | | | | Add derivative of the rcar_i2c driver which is capable of probing itself from DM and uses DT. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Heiko Schocher <hs@denx.de> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
| * i2c: rcar_i2c: Remove the driverMarek Vasut2018-05-202-293/+0
| | | | | | | | | | | | | | | | | | Remove the rcar_i2c driver, since it's no longer used by any board and will be superseded by a DM and DT capable variant. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Heiko Schocher <hs@denx.de> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
* | Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini2018-05-2017-45/+744
|\ \
| * | drivers: usb: dwc3: remove devm_zalloc from linux_compactMugunthan V N2018-05-184-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | devm_zalloc() is already defined in dm/device.h header, so devm_zalloc can be removed from linux_compact.h beader file. Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
| * | usb: xhci: zynqmp: Remove support for !DM_USBMichal Simek2018-05-182-46/+1
| | | | | | | | | | | | | | | | | | | | | | | | Switch to DM_USB was done and there is no need to keep !DM_USB code in tree. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>