summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2018-09-11sandbox: Add serial testPatrice Chotard1-0/+14
Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-09-11serial: stm32: Replace setparity by setconfigPatrice Chotard1-6/+15
Replace stm32_serial_setparity by stm32_serial_setconfig which allows to set serial bits number, parity and stop bits number. Only parity setting is implemented. 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>
2018-09-11dm: serial: Replace setparity by setconfigPatrice Chotard1-0/+16
Replace setparity by more generic setconfig ops to allow uart parity, bits word length and stop bits number change. Adds SERIAL_GET_PARITY/BITS/STOP macros. 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>
2018-09-11serial: protect access to serial rx bufferPatrick Delaunay1-0/+3
Add test to avoid access to rx buffer when this buffer is empty. In this case directly call getc() function to avoid issue when tstc() is not called. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-09-10mtd: nand: denali: fix unaligned cache operations on ARMv7 SoCsMasahiro Yamada1-0/+4
If the OOB size is not multiple of the cache line size, the ARMv7 cache operation still prints "Misaligned operation at range". => nand info Device 0: nand0, sector size 256 KiB Page size 4096 b OOB size 224 b Erase size 262144 b subpagesize 4096 b options 0x00104200 bbt options 0x00060000 => nand dump 0 CACHE: Misaligned operation at range [9fb15280, 9fb16360] CACHE: Misaligned operation at range [9fb15280, 9fb16360] CACHE: Misaligned operation at range [9fb15280, 9fb16360] CACHE: Misaligned operation at range [9fb15280, 9fb16360] ... The cache flushing operations won't happen in this case to cover all of the range to fix this by making sure we have things aligned. Reported-by: Marek Vasut <marex@denx.de> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> [trini: Reword the commit message to be clear this is a direct problem rather than just a warning]
2018-09-05Merge branch 'master' of git://git.denx.de/u-boot-imxTom Rini1-1/+1
2018-09-04watchdog: mx25: use the imx_watchdog driver for mx25Martin Kaiser1-1/+1
The existing imx_watchdog driver is compatible with mx25 chipsets. Add a WDOG1_BASE_ADDR define for the base address and enable the driver in watchdog's Makefile. To use the driver, a board must define CONFIG_IMX_WATCHDOG and CONFIG_HW_WATCHDOG. This fixes an issue when booting an mx25 chip via usb/serial. In this case, the boot rom will always enable the watchdog. If u-boot is running in interactive mode and the watchdog is not serviced, the system is rebooted when the watchdog expires. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
2018-08-30Merge branch 'master' of git://git.denx.de/u-boot-shTom Rini2-2/+2
2018-08-30mmc: renesas-sdhi: Use priv directlyMarek Vasut1-1/+1
The dev_get_priv(dev) is used twice in the probe function. Replace the second invocation with priv variable. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2018-08-29usb: dwc2: Add reset ctrl to driverLey Foon Tan1-0/+37
Add code to reset all reset signals as in usb DT node. A reset property is an optional feature, so only print out a warning and do not fail if a reset property is not present. If a reset property is discovered, then use it to deassert, thus bringing the IP out of reset. Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
2018-08-28pci: rmobile: Filter out device 1 and 2Marek Vasut1-1/+1
Only PCI device 1 and 2 is populated on the R-Car Gen2 internal PCIe controller. Ignore all other devices. This fix prevents a duplication of OHCI controller response on slot 0 and 1. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2018-08-28usb: ehci: Add PHY support to ehci-pciMarek Vasut1-4/+27
Add support for operating a PHY attached to ehci-pci. There are systems where the EHCI controller is internally wired to a PCI bus and has a PHY connected to it as well, ie. the R-Car Gen2. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2018-08-28usb: ehci: Make the PHY handling genericMarek Vasut3-53/+74
Pull out the EHCI PHY functions into the ehci-hcd.c to let other EHCI drivers use them. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2018-08-24Merge branch 'master' of git://git.denx.de/u-boot-socfpgaTom Rini3-0/+98
2018-08-24Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini6-511/+173
2018-08-24timer: dw-apb: Add Designware APB timer driverMarek Vasut3-0/+98
Add timer driver for the Designware APB Timer IP. This is present for example on the Altera SoCFPGA chips. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Chin Liang See <chin.liang.see@intel.com> Cc: Dinh Nguyen <dinguyen@kernel.org> Cc: Ley Foon Tan <ley.foon.tan@intel.com>
2018-08-23usb: musb-new: Call musb_platform_exit from musb_stopJagan Teki1-0/+1
musb stop is musb core call during unregister or shutting down gadget or host musb. For graceful exit add musb_platform_exit on musb_stop so-that it can exit the musb platform driver as well. Tested-by: Chen-Yu Tsai <wens@csie.org> # A33-OlinuXino Tested-by: Jagan Teki <jagan@amarulasolutions.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2018-08-23usb: musb-new: sunxi: Add proper musb exit supportJagan Teki1-21/+28
musb have platform ops to do proper graceful exit, so add the exit call and move musb platform exit code instead of keeping it in driver remove. This make proper shutdown of musb where .remove will call disable, exit serially via musb_stop. Tested-by: Chen-Yu Tsai <wens@csie.org> # A33-OlinuXino Tested-by: Jagan Teki <jagan@amarulasolutions.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2018-08-23musb-new: sunxi: Access ahb_reset0_cfg via ccm offsetJagan Teki1-12/+28
reset0 is not available for sun4i, 5i and 7i so access the reset0 offset from ccm via driver data for relevant Allwinner SoC. this will eventually drop the existing ifdef for SUN6I. Tested-by: Chen-Yu Tsai <wens@csie.org> # A33-OlinuXino Tested-by: Jagan Teki <jagan@amarulasolutions.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2018-08-23usb: musb-new: sunxi: Allocate struct phy in privateJagan Teki1-13/+11
Allocate struct phy in private structure instead of allocating locally and assign it to a pointer. This eventually fix miss alignment phy which is used in another functions. Tested-by: Chen-Yu Tsai <wens@csie.org> # A33-OlinuXino Tested-by: Jagan Teki <jagan@amarulasolutions.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2018-08-23usb: musb-new: Fix improper musb host pointerJagan Teki3-11/+15
When MUSB is operating in peripheral mode, probe registering musb core using musb_register which intern return int value for validation. so there is no scope to preserve struct musb pointer but the same can be used in .remove musb_stop. So fix this by return musb_register with struct musb pointer. Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Purna Chandra Mandal <purna.mandal@microchip.com> Tested-by: Chen-Yu Tsai <wens@csie.org> # A33-OlinuXino Tested-by: Jagan Teki <jagan@amarulasolutions.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2018-08-21device: expose the functions used to remove and unbind children of a deviceJean-Jacques Hiblot1-19/+11
Also add a 'drv' parameter to filter the children to remove/unbind. Exporting those functions is a preparatory work for the addition of the bind/unbind commands. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-08-21dm: convert device_get_global_by_of_offset() to device_get_global_by_ofnode()Jean-Jacques Hiblot1-6/+13
Also add device_find_global_by_ofnode() that also find a device based on the OF node, but doesn't probe the device. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-08-21dm: print the index of the device when dumping the dm treeJean-Jacques Hiblot1-6/+10
Command "dm tree" dumps the devices with class, driver, name information. Add the index of the device in the class too, because the information is useful for the bind/unbind commands. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-21uclass: Add dev_get_uclass_index() to get the uclass/index of a deviceJean-Jacques Hiblot1-0/+21
This function is the reciprocal of uclass_find_device(). It will be used to print the index information in dm tree dump. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-08-21usb: gadget: Add bcdDevice for the DWC3 USB Gadget ControllerJean-Jacques Hiblot1-0/+2
Add an entry in usb_gadget_controller_number() for the DWC3 gadget controller. Without it, it is not possible to bind the USB Ethernet driver. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-08-21usb: musb-new: omap2430: Enable DM_USB and OF supportAdam Ford1-1/+149
With upcoming changes that require CONFIG_BLK, this broke USB Mass Storage on the OMAP3 boards because if CONFIG_BLK is enabled, it assumes that DM_USB is enabled, but it wasn't yet available on omap3 and omap4 boards. This patch converts the OMAP2430 MUSB glue to support DM_USB and extracts the necessary information based on the device tree. It's based on the ti-musb driver, but there are enough significant differences in both the architecture and device tree entires between am33xx and OMAP3/OMAP4, that I think it makes sense to continue to keep the separate. Per doc/driver-model/usb-info.txt, the USB gadget stuff hasn't migrated to DM_USB yet, so this only supports USB Host for now. Users wanting USB Gadgets will need to disable DM_USB and leave it the old way for now. Signed-off-by: Adam Ford <aford173@gmail.com>
2018-08-21usb: musb-new: omap2430: Remove dead codeAdam Ford1-512/+0
A bunch of code was encapsulated in #ifdef's whether or not it is building or for U-Boot. Since this code is always building for U-Boot, this patch removes the dead code. Signed-off-by: Adam Ford <aford173@gmail.com>
2018-08-20Merge branch 'master' of git://git.denx.de/u-boot-sunxiTom Rini1-4/+4
2018-08-20Merge git://git.denx.de/u-boot-x86Tom Rini1-11/+16
2018-08-20x86: tsc: Try hardware calibration firstBin Meng1-11/+16
At present if TSC frequency is provided in the device tree, it takes precedence over hardware calibration result. This swaps the order to try hardware calibration first and uses device tree as last resort. This can be helpful when a generic dts (eg: coreboot/efi payload) is supposed to work on as many hardware as possible, including emulators like QEMU where TSC hardware calibration sometimes fails. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2018-08-20drivers: regulator: fixed: add u-boot, off-on-delay-usPeng Fan1-0/+6
Add u-boot,off-on-delay-us for fixed regulator. Depends on board design, the gpio regulator sometimes connects with a big capacitance. When need to off, then on the regulator, if there is no enough delay, the voltage does not drop to 0, so introduce this property to handle such case. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-08-17Convert CONFIG_SYS_I2C_DAVINCI to KconfigAdam Ford1-0/+6
This converts the following to Kconfig: CONFIG_SYS_I2C_DAVINCI Signed-off-by: Adam Ford <aford173@gmail.com>
2018-08-17Convert CONFIG_TWL4030_LED et al to KconfigAdam Ford2-0/+10
This converts the following to Kconfig: CONFIG_TWL4030_LED CONFIG_TWL4030_INPUT This also removes dead references to: CONFIG_TWL4030_KEYPAD Signed-off-by: Adam Ford <aford173@gmail.com>
2018-08-17Convert CONFIG_VIDEO_OMAP3 to KconfigAdam Ford1-0/+6
This converts the following to Kconfig: CONFIG_VIDEO_OMAP3 Signed-off-by: Adam Ford <aford173@gmail.com>
2018-08-17Add BOOTCOUNT_BOOTLIMIT to set reboot limitAlex Kiernan1-0/+8
Add ability to set environment bootlimit from Kconfig Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-08-17Convert CONFIG_MII et al to KconfigAdam Ford1-0/+10
This converts the following to Kconfig: CONFIG_MII CONFIG_DRIVER_TI_EMAC Signed-off-by: Adam Ford <aford173@gmail.com> Acked-by: Jagan Teki <jagan@amarulasolutions.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2018-08-17kconfig: fix typo 'parition'Simon Goldschmidt1-1/+1
Replaced misspelled words "parition"/"paritioning" (missing 't') in two Kconfig files by correct words "partition"/"partitioning" Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-08-17Merge branch 'master' of git://git.denx.de/u-boot-shTom Rini4-1/+200
2018-08-17Merge branch 'master' of git://git.denx.de/u-boot-socfpgaTom Rini7-9/+554
2018-08-14phy: rcar: Add R-Car Gen2 PHY driverMarek Vasut3-0/+199
Add a PHY driver for the R-Car Gen2 which allows configuring the mux connected to the EHCI controllers and USBHS controller. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2018-08-14phy: Fix off-by-one error when parsing DT PHY bindingsMarek Vasut1-1/+1
The code fails to copy the last PHY phandle argument, so it is missing from the adjusted phandle args and the consumer cannot use it to determine what the PHY should do. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Patrice Chotard <patrice.chotard@st.com>
2018-08-13mmc: socfpga: Add clock framework supportMarek Vasut1-9/+31
Add support for fetching the clock frequency both using the legacy method in case clock framework is disabled as well as via the clock framework if it is enabled. This allows for migration to the clock framework on platforms which supports it while not breaking legacy platforms. That said, the legacy method must be removed eventually. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Chin Liang See <chin.liang.see@intel.com> Cc: Dinh Nguyen <dinguyen@kernel.org> Cc: Ley Foon Tan <ley.foon.tan@intel.com>
2018-08-13clk: socfpga: Add initial Arria10 clock driverMarek Vasut3-0/+371
Add clock driver for the Arria10, which allows reading the clock frequency from all the clock described in the DT. The driver also allows enabling and disabling the clock. Reconfiguring frequency is not supported thus far. Since the DT bindings for the SoCFPGA clock are massively misdesigned and the handoff DT adds additional incorrectly described entries to the DT, the driver contains workarounds which attempt to rectify all of those problems. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Chin Liang See <chin.liang.see@intel.com> Cc: Dinh Nguyen <dinguyen@kernel.org> Cc: Ley Foon Tan <ley.foon.tan@intel.com>
2018-08-13net: designware: socfpga: Add Arria10 extrasMarek Vasut3-0/+152
Add wrapper around the designware MAC driver to handle the SoCFPGA specific configuration bits. On Arria10, this is configuration of syscon phy_intf. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Chin Liang See <chin.liang.see@intel.com> Cc: Dinh Nguyen <dinguyen@kernel.org> Cc: Ley Foon Tan <ley.foon.tan@intel.com> Cc: Joe Hershberger <joe.hershberger@ni.com>
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-12Merge branch 'agust@denx.de' of git://git.denx.de/u-boot-stagingTom Rini6-1/+497