summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2019-01-14dm: Tidy up 'dm tree' output when there are many devicesSimon Glass
At present the 'Index' column assumes there is only one digit. But on some devices (e.g. snow) there are a lot of regulators and GPIO banks. Adjust the output to allow for two digits without messing up the display. Also capatalise the heading to match. Fixes: 5197dafc42 (dm: core: Widen the dump tree to show more of the driver's name.) Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Liviu Dudau <liviu.dudau@foss.arm.com>
2019-01-14mmc: fsl_esdhc: Avoid infinite loop in esdhc_send_cmd_common()Fabio Estevam
The following hang is observed on a Hummingboard 2 MicroSOM i2eX iMX6D - rev 1.3 with no eMMC populated on board: U-Boot SPL 2018.11+gf6206f8587 (Nov 16 2018 - 00:56:34 +0000) Trying to boot from MMC1 U-Boot 2018.11+gf6206f8587 (Nov 16 2018 - 00:56:34 +0000) CPU: Freescale i.MX6D rev1.5 996 MHz (running at 792 MHz) CPU: Extended Commercial temperature grade (-20C to 105C) at 33C Reset cause: POR Board: MX6 HummingBoard2 DRAM: 1 GiB MMC: FSL_SDHC: 0, FSL_SDHC: 1 Loading Environment from MMC... *** Warning - bad CRC, using default environment No panel detected: default to HDMI Display: HDMI (1024x768) In: serial Out: serial Err: serial ---> hangs which is caused by the following infinite loop inside esdhc_send_cmd_common() while (!(esdhc_read32(&regs->irqstat) & flags)) ; Instead of looping forever, provide an exit path so that a timeout error can be propagated in the case irqstat does not report any interrupts, which may happen when no eMMC is populated on board. Reported-by: Ricardo Salveti <rsalveti@rsalveti.net> Signed-off-by: Fabio Estevam <festevam@gmail.com> Tested-by: Peter Robinson <pbrobinson@gmail.com> Tested-by: Ricardo Salveti <rsalveti@rsalveti.net>
2019-01-11Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini
2019-01-11Revert "dm: pinctrl: Prevent (re-)configuring pins when already done before ↵Lukasz Majewski
relocation" This reverts commit a7f4b4b344396590845e6552c82829ef68ef9f89. As reported by Alex Kiernan the above optimization introduces a regression in the below use case where: 1. Device has defined 'u-boot,dm-spl' property (@ eMMC DTS node) 2. The device downloads its MLO/SPL via UART (not eMMC - the eMMC pinmux pins are NOT probed/configured in MLO/SPL). 3. The loaded via UART MLO/SPL wants to load Linux from eMMC. In this case the DM core and pinctrl uclass checks 'u-boot,dm-spl' and don't configure pins (as it thinks that those were initialized in MLO/SPL). As we are very close to release - please revert this commit. Reported-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-01-10dm: usb: gadget: Fix boot breakage on sunxi platformsJean-Jacques Hiblot
Fixes commit 013116243950 ("dm: usb: create a new UCLASS ID for USB gadget devices") The UCLASS_DRIVER for id UCLASS_USB_GADGET_GENERIC needs to be declared even for platforms that do not enable DM_USB_GADGET. Otherwise the driver for their usb peripheral controller fails to bind. Reported-by: Priit Laes <plaes@plaes.org> Reported-by: Jagan Teki <jagan@amarulasolutions.com> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Tested-by: Priit Laes <plaes@plaes.org> Acked-by: Jagan Teki <jagan@openedev.com>
2019-01-10Kconfig: rename CONFIG_SPL_USB_GADGET_SUPPORT as CONFIG_SPL_USB_GADGETJean-Jacques Hiblot
The SPL option for USB gadget should be named after the option for u-boot (CONFIG_USB_GADGET) Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2019-01-10dm: usb: udc: Use SEQ_ALIAS to index the USB gadget portsJean-Jacques Hiblot
dfu, fastbot and other usb gadget commands take the USB port index as a parameter. Currently this index is assigned in the order of the driver bindings. Changing this behavior using the SEQ_ALIAS feature. This option assign to the device a SEQ number based on its alias (if it exists) To use it we must set the DM_UC_FLAG_SEQ_ALIAS flag and follow the existing naming convention: use "usb" for the name of the gadget UCLASS_DRIVER (same as for the UCLASS_USB). If no alias is provided, then the index falls back to the order in which the bindings took place. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reported-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org> Tested-by: Sam Protsenko <semen.protsenko@linaro.org>
2019-01-10Merge branch 'master' of git://git.denx.de/u-boot-sunxiTom Rini
2019-01-10Merge tag 'u-boot-imx-20190110' of git://git.denx.de/u-boot-imxTom Rini
Fixes for 2019.01
2019-01-10mmc: sunxi: Fix mmc clocks for DM_MMCJagan Teki
Existing clock configure code has been followed based on the legacy MMC dt node definitions and it cannot work with recent dts(i) sync from Linux. So, add clock configure code for Allwinner platforms which support DM_MMC and eventually this will drop once CLK support is in Mainline. Fixes: 3c92cca3cda0 ("ARM: dts: sun4i: Update A10 dts(i) files from Linux-v4.18-rc3") Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Tested-by: Priit Laes <plaes@plaes.org> # Gemei G9 A10 Tablet Tested-by: Marek Kraus <gamelasterv2@gmail.com> # A10-OLinuXino-Lime
2019-01-09misc: imx8: scu: use platdata instead of priv dataPeng Fan
priv data has not been allocated when doing bind, so it is wrong to use dev_get_priv in bind call back. Let's switch to use platdata in the driver to fix the issue. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-01-09misc: imx: scu: avoid write null pointerPeng Fan
When boot_dev is true, fill boot device. However the original logic is when boot_dev is false, fill boot device, this will trigger data abort. Also fix sc_misc_get_control when using pointer val. Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-01-09clk: imx8: fix build warningPeng Fan
When build clk driver in spl, met the warning: " drivers/clk/imx/clk-imx8.c:21:25: warning: ‘imx8_clk_names’ defined but not used [-Wunused-variable] static struct imx8_clks imx8_clk_names[] = { ^~~~~~~~~~~~~~ " Fix with wrapping the array with CONFIG_CMD_CLK. Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-01-09usb: xhci-mem: Fix scratchpad array issueYe Li
After updating the value of dev_context_ptrs[0], we should flush this from cache to memory. Otherwise the xhci controller won't use it. Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Marek Vasut <marex@denx.de>
2019-01-09gpio: stm32f7: Fix SPL code sizePatrice Chotard
In order to keep SPL code size below the 32Kb limit, put under CONFIG_SPL_BUILD flag all unused code in SPL. This is needed for stm32f7xx board which are using SPL. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2019-01-09gpio: stm32f7: Fix gpio bank hole managementPatrice Chotard
In case "gpio-ranges" property is not present in device tree, use default value for gpio_count and gpio_range. This fixes an issue on stm32 F7 and H7 boards where "pinmux status -a" command didn't return any pin status due to the fact that both stm32 F7 and H7 board DT doesn't use the gpio-ranges property. Fixes: dbf928dd2634a6("gpio: stm32f7: Add gpio bank holes management") Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2019-01-09mmc: bring back partition init for non-DM MMC driversAndre Przywara
Commit d0851c893706 ("blk: Call part_init() in the post_probe() method") removed the call to part_init() in mmc.c, as this is done by the DM_MMC framework. However Allwinner is (still) relying on a non-DM MMC driver, so we are now missing the implicit partition init, leading to failing MMC accesses due to the missing partition information. Bring the call back just for non-DM MMC driver to fix this regression. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Soeren Moch <smoch@web.de>
2019-01-06rockchip: rk3399: fix missing braces in full pinctrlPhilipp Tomsich
Braces around the error-case for rk3399_pinctrl_set_pin_pupd lead to an unconditional (and unintended) return from the function without it ever setting pin-configurations. Fix it. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-01-03Merge tag 'for-v2019.01' of git://git.denx.de/u-boot-videoTom Rini
TrueType fixes and documentation
2019-01-03Merge tag 'for-master-20190103' of git://git.denx.de/u-boot-rockchipTom Rini
Last-minute fixes for 2019.1: - clamp DRAM size to below 32bit for 32bit targets to support 4GB - fix copyright notice on some Rockchip-contributed files - adjust vdd_log for the RK3399-Q7 to improve stability in some workloads
2019-01-02rockchip: rk3399: Add Kconfig option for full pinctrl driverChristoph Muellner
This patch adds a Kconfig option to enable the full pinctrl driver for the RK3399. This flag needs to be enabed in order to get the features of the full pinctrl driver compiled in (i.e. a .set_state() callback). Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2019-01-02rockchip: rk3399: Add improved pinctrl driver.Christoph Muellner
The current pinctrl driver for the RK3399 has a range of qulity issues. E.g. it only implements the .set_state_simple() callback, it does not parse the available pinctrl information from the DTS (instead uses hardcoded values), is not flexible enough to cover devices without 'interrupt' field in the DTS (e.g. PWM), is not written generic enough to make code reusable among other rockchip SoCs... This patch addresses these issues by reimplementing the whole driver from scratch using the .set_state() callback. The new implementation covers all featurese of the old code (i.e. it supports pinmuxing and pullup/pulldown configuration). This patch has been tested on a RK3399-Q7 SoM (Puma). Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2019-01-02dm: pinctrl: Add pinctrl_decode_pin_config_dm().Christoph Muellner
pinctrl_decode_pin_config_dm() is basically a feature-equivalent implementation of pinctrl_decode_pin_config(), which operates on struct udevice devices and uses the dev_read_*() API. Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2019-01-02power: regulator: Allow PWM regulator to be omitted from SPL.Christoph Muellner
This patch allows to enable the PWM regulator driver independent for U-Boot and SPL. Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2019-01-02rockchip: ram: update license for sdram driverKever Yang
Rockchip may use this sdram copy of source code for both open source and internal project, update the license to use both GPL2.0+ and BSD-3 Clause. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2019-01-02Merge branch 'master' of git://git.denx.de/u-boot-spiTom Rini
2019-01-02mtd: nand: raw: Add Hynix H27UBG8T2BTR id tableNikolai Zhubr
This patch adds Hynix H27UBG8T2BTR id table as part of raw nand, these chips were available in some A20-olinuxino-micro boards. Signed-off-by: Nikolai Zhubr <n-a-zhubr@yandex.ru> [jagan: add proper commit message] Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2019-01-02spi: sun4i: Add rx_buf NULL pointer checkStefan Mavrodiev
Current driver doesn't check if the destination pointer is NULL. This cause the data from the FIFO to be stored inside the internal SDRAM ( address 0 ). The patch add simple check if the destination pointer is NULL. Signed-off-by: Stefan Mavrodiev <stefan@olimex.com> Acked-by: Jagan Teki <jagan@openedev.com> [jagan: fix commit message] Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2019-01-01Merge tag 'u-boot-imx-20190101' of git://www.denx.de/git/u-boot-imxTom Rini
imx for 2019.01 - introduce support for i.MX8M - fix size limit for Vhybrid / pico boards - several board fixes - w1 driver for MX2x / MX5x
2019-01-01nand: vybrid: Extend the vf610 NFC NAND driver to support device tree (and DM)Lukasz Majewski
This commit adds support for device tree and enumeration via device model for the Vybrid's NFC NAND driver. Signed-off-by: Lukasz Majewski <lukma@denx.de>
2019-01-01Kconfig: Add entry for VF610 NAND NFC device tree aware driverLukasz Majewski
This commit provides code to add proper entry to Kconfig to enable support for VF610 device tree aware driver. Signed-off-by: Lukasz Majewski <lukma@denx.de>
2019-01-01nand: vybrid: Use calloc() instead of malloc() to allocate struct nfcLukasz Majewski
Without this change it is possible that Vybrid's NFC driver malloc() call will obtain some memory used (and correctly free'd) by some previous driver (in this case pinctrl for Vybrid). As a result some fields of struct nfc - in out case mtd->_get_device - are "pre initialized" with some random values. On the latter stage of booting, when e.g. somebody calls 'mtdparts default' the "data abort" is observed when __get_mtd_device() function is called. The mtd->_get_device pointer is not NULL and wrong value is referenced. Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Stefan Agner <stefan.agner@toradex.com>
2019-01-01drivers: ddr: introduce DDR driver for i.MX8MPeng Fan
Introduce DDR driver for i.MX8M. The driver will be used by SPL to initialze DDR PHY and DDR Controller. Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-01-01imx: rename mx8m,MX8M to imx8m,IMX8MPeng Fan
Rename mx8m,MX8M to imx8m,IMX8M Signed-off-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Jon Nettleton <jon@solid-run.com>
2019-01-01ARM: vybrid: Provide pinctrl driver for Vybrid (vf610)Lukasz Majewski
This implementation comply with other iMX devices pinctrl drivers already available in U-boot. Signed-off-by: Lukasz Majewski <lukma@denx.de>
2019-01-01w1: Add driver for i.MX bus master controllerMartin Fuzzey
Two variants of controllers are supported: V1 (bitwise only) found in i.MX21, i.MX27, i.MX31, i.MX51 V2 (byte operations) found in i.MX25, i.MX35, i.MX50, i.MX53 Only tested on i.MX53 hardware but in both modes (by modifying the device tree). Signed-off-by: Martin Fuzzey <martin.fuzzey@flowbird.group>
2019-01-01watchdog: imx: add config to disable wdog resetXiaoliang Yang
Add Kconfig option WATCHDOG_RESET_DISABLE to disable watchdog reset in imx_watchdog driver, so that the watchdog will not be fed in u-boot if CONFIG_WATCHDOG_RESET_DISABLE is enabled. Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
2019-01-01watchdog: driver support for fsl-lsch2Xiaoliang Yang
Support watchdog driver for fsl-lsch2. It's disabled in default. If you want to use it, please enable CONFIG_IMX_WATCHDOG. Define CONFIG_WATCHDOG_TIMEOUT_MSECS to set watchdog timeout. Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
2018-12-29clk: uniphier: add NAND 200MHz clockMasahiro Yamada
The Denali NAND controller IP needs three clocks: - clk: controller core clock - clk_x: bus interface clock - ecc_clk: clock at which ECC circuitry is run Currently, only the first one (50MHz) is provided. The rest of the two clock ports must be connected to the 200MHz clock line. Add this. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-12-29mtd: rawnand: denali: fix a race condition when DMA is kickedMasahiro Yamada
Based on Linux commit cf51e4b9c34407bf0c3d9b582b7837e047e1df47 Add the register read-back, commenting why this is necessary. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-12-29mtd: rawnand: denali: optimize timing parameters for data interfaceMasahiro Yamada
Based on Linux commit 1dfac31a5a63ac04a9b5fbc3f5105a586560f191 This commit improves the ->setup_data_interface() hook. The denali_setup_data_interface() needs the frequency of clk_x and the ratio of clk_x / clk. The latter is currently hardcoded in the driver, like this: #define DENALI_CLK_X_MULT 6 The IP datasheet requires that clk_x / clk be 4, 5, or 6. I just chose 6 because it is the most defensive value, but it is not optimal. By getting the clock rate of both "clk" and "clk_x", the driver can compute the timing values more precisely. To not break the existing platforms, the fallback value, 50 MHz is provided. It is true for all upstreamed platforms. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-12-29mtd: rawnand: denali_dt: add more clocks based on IP datasheetMasahiro Yamada
Based on Linux commit 6f1fe97bec349a1fd6c5a8c7c5998d759fe721d5 Currently, denali_dt.c requires a single anonymous clock, but the Denali User's Guide requires three clocks for this IP: - clk: controller core clock - clk_x: bus interface clock - ecc_clk: clock at which ECC circuitry is run This commit supports these named clocks to represent the real hardware. For the backward compatibility, the driver still accepts a single clock just as before. The clk_x_rate is taken from the clock driver again if the named clock "clk_x" is available. This will happen only for future DT, hence the existing DT files are not affected. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-12-28video: Add a default TrueType fontSimon Glass
At present it is possible to enable TrueType support but not include any fonts. This results in a blank display. Select Nimbus as the default font to avoid this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-12-27power: regulator: Return success on attempt to disable an always-on regulatorLokesh Vutla
commit 4f86a724e82c0 ("power: regulator: denied disable on always-on regulator") throws an error when requested to disable an always-on regulator. It is right that an always-on regulator should not be attempted to be disabled. But at the same time regulator framework should not return an error when such request is received. Instead it should just return success without attempting to disable the specified regulator. This is because the requesting driver will not have the idea if the regulator is always-on or not. The requesting driver will always try to enable/disable regulator as per the required flow. So it is upto regulator framework to not break such scenarios. Fixes: 4f86a724e82c0 ("power: regulator: denied disable on always-on regulator") Reported-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Faiz Abbas <faiz_abbas@ti.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2018-12-26phy: Fix u-boot coruption when fixed-phy is usedMichal Simek
When fixed-link phy is used subnode offset is used as phy address. This number is bigger then space allocated for bus structure (allocated via mdio_alloc). bus->phymap[] array has PHY_MAX_ADDR size (32). That's why writing bus->phymap[addr] where addr is < 0 or > PHY_MAX_ADDR is causing write to memory which can caused full U-Boot crash. The patch is checking if address is in correct range. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-12-26dm: pinctrl: Prevent (re-)configuring pins when already done before relocationLukasz Majewski
This commit prevents from re-configuring pins if those were configured before relocation. Some pins - like UART or DDR must be setup before relocation (as they have 'u-boot,dm-pre-reloc' property set in DTS). Without this change, those pins are re-configured after relocation (pre_reloc_only = 0, so we do not "continue"). Such behavior may be a problem for DDR PAD configuration, as they might be already leveled/tuned with original setup). Signed-off-by: Lukasz Majewski <lukma@denx.de>
2018-12-21Merge branch 'master' of git://git.denx.de/u-boot-socfpgaTom Rini
- stratix10 updates
2018-12-21Merge tag 'mips-updates-for-2019.11' of git://git.denx.de/u-boot-mipsTom Rini
- mips: fix some DTC warnings - bmips: bcm6348: add DMA driver - bmips: bcm5348: add ethernet driver - bmips: bcm6368: add ethernet driver - mips: mt76xx: fix DMA problems, disable CONFIG_OF_EMBED - mips: mscc: add support for Microsemi Ocelot and Luton SoCs - mips: mscc: add support for Ocelot and Luton evaluation boards - mips: jz47xx: add basic support for Ingenic JZ4780 SoC - mips: jz47xx: add support for Imgtec Creator CI20 board
2018-12-20arm: socfpga: stratix10: Add Stratix10 FPGA into FPGA device tableAng, Chee Hong
Enable 'fpga' command in u-boot. User will be able to use the FPGA command to program the FPGA on Stratix10 SoC. Signed-off-by: Ang, Chee Hong <chee.hong.ang@intel.com>
2018-12-20arm: socfpga: stratix10: Add Stratix 10 FPGA Reconfiguration DriverAng, Chee Hong
Enable FPGA reconfiguration support for Stratix 10 SoC. Signed-off-by: Ang, Chee Hong <chee.hong.ang@intel.com>