aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2022-11-23Merge tag 'u-boot-amlogic-20221122' of ↵WIP/23Nov2022Tom Rini1-0/+70
https://source.denx.de/u-boot/custodians/u-boot-amlogic - Implement setbrg op to meson serial device - Re-add the old PHY reset binding for nanopi-k2
2022-11-22sandbox: check lseek return value in handle_ufi_commandHeinrich Schuchardt1-3/+7
Invoking lseek() may result in an error. Handle it. Addresses-Coverity-ID: 376212 ("Error handling issues (CHECKED_RETURN)") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-11-22arm: amlogic: add setbrg op to serial deviceEdoardo Tomelleri1-0/+70
Implement setbrg in amlogic/meson serial device with driver model similar to how the meson_uart.c driver does it in Linux. Also configure (probe) the serial device with the new reg5 register. Signed-off-by: Edoardo Tomelleri <e.tomell@gmail.com> Link: https://lore.kernel.org/r/20220918161701.572814-1-e.tomell@gmail.com Acked-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2022-11-22Merge tag 'xilinx-for-v2023.01-rc3' of ↵Tom Rini10-32/+109
https://source.denx.de/u-boot/custodians/u-boot-microblaze Xilinx changes for v2023.01-rc3 microblaze: - Enable 32 bit addressing mode for SPIs zynq: - Minor DT fixes (PL clock enabling) zynqmp: - Disable watchdog by default - Remove unused xlnx,eeprom chosen support - Add missing symlink for vck190 SC revB - Use mdio bus with ethernet-phy-id description versal: - Add mini qspi/ospi configuration versal-net: - Add soc driver - Fix Kconfig entry for SOC - Fix loading address location for MINI configuration - Disable LMB for mini configuration net: - Fix ethernet-phy-id usage in the code pinctrl: - Revert high impedance/output enable support timer: - Fix timer relocation for Microblaze - Fix timer wrap in 32bit Xilinx timer driver
2022-11-22spi: cadence-qspi: Fix compilation error in mini u-boot flash resetAshok Reddy Soma1-2/+2
When cadence_qspi_versal_flash_reset() function is called in mini u-boot where there is no firmware support, it is missing defines for macro's BOOT_MODE_POR_0 & BOOT_MODE_POR_1. Remove them and replace with already define macro's which have same values as these. Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com> Link: https://lore.kernel.org/r/20221116141155.14788-3-ashok.reddy.soma@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2022-11-22qspi: versal-net: Add condition for tapdelay registerAshok Reddy Soma1-1/+2
Add CONFIG_ARCH_VERSAL_NET to select tapdelay register for versal-net. Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com> Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/2500dd688214e2ec2d54ed3fabbfee0b1ca861a6.1668613229.git.michal.simek@amd.com
2022-11-22soc: xilinx: versal-net: Add soc_xilinx_versal_net driverMichal Simek3-0/+87
Add soc_xilinx_versal_net driver to identify the family & revision of versal-net SoC. Add Kconfig option CONFIG_SOC_XILINX_VERSAL_NET to enable/disable this driver. To enable this driver by default, add this config to xilinx_versal_net_virt_defconfig file. This driver will be probed using platdata U_BOOT_DEVICE structure which is specified in mach-versal-net/cpu.c. Signed-off-by: Michal Simek <michal.simek@amd.com> Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com> Link: https://lore.kernel.org/r/613d6bcffd9070f62cf348079ed16c120f8fc56f.1668612993.git.michal.simek@amd.com
2022-11-22net: phy: Fix ethernet-phy-id <dot> in the codeMichal Simek1-2/+2
Use dot instead of comma. The fix doesn't affect anything but it is good to be aligned with used pattern. The first is used only for string size calculation and the second change is in the comment. Fixes: db681d4929ca ("net: phy: Add new read ethernet phy id function") Signed-off-by: Michal Simek <michal.simek@amd.com>
2022-11-22timer: xilinx-timer: use timer_conv_64() to fix timer wrap aroundOvidiu Panait1-1/+1
Current xilinx_timer_get_count() implementation does not take into account the periodic 32-bit wrap arounds, as it directly returns the 32-bit counter register value. The roll-overs cause problems in the upper timer layers, as generic timer code expects an incrementing 64-bit value from get_count() to work correctly. Add the missing 64-bit up-conversion to fix random hangs/delays in __udelay(). Fixes: a36d86720f ("microblaze: Convert axi timer to DM driver") Signed-off-by: Ovidiu Panait <ovpanait@gmail.com> Reviewed-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/20221012053656.1492457-3-ovpanait@gmail.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2022-11-22timer-uclass: relocate ops pointers for CONFIG_NEEDS_MANUAL_RELOCOvidiu Panait1-0/+14
Relocate timer_ops pointers when CONFIG_NEEDS_MANUAL_RELOC is enabled. The (gd->flags & GD_FLG_RELOC) check was added to make sure the reloc_done logic works for drivers that use DM_FLAG_PRE_RELOC. Signed-off-by: Ovidiu Panait <ovpanait@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Link: https://lore.kernel.org/r/20221012053656.1492457-2-ovpanait@gmail.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2022-11-22timer-uclass: add timer_get_ops() macroOvidiu Panait1-1/+1
Align timer uclass with the other subsystems and provide a timer_get_ops() convenience macro. Using this instead of the generic device_get_ops() also prevents -Wdiscarded-qualifiers warnings when used with non-const variables. Signed-off-by: Ovidiu Panait <ovpanait@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Link: https://lore.kernel.org/r/20221012053656.1492457-1-ovpanait@gmail.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2022-11-22xilinx: common: Remove zynq_board_read_rom_ethaddr()Venkatesh Yadav Abbarapu1-16/+0
Removing the zynq_board_read_rom_ethaddr() function as xlnx,eeprom is not used anymore. As all board dts to use nvmem alias instead of xlnx,eeprom. Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com> Link: https://lore.kernel.org/r/20221017094818.17996-1-venkatesh.abbarapu@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2022-11-22Revert "pinctrl: zynqmp: Add support for output-enable and bias-high-impedance"Michal Simek1-9/+0
This reverts commit 123462e5e534d6e17b1b7d2006734bbe54b03e0a. On systems with older PMUFW using these pinctrl properties can cause system hang because there is missing feature autodetection. When it is implemented support for these two properties should go back. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/c2900319ea80484f21692997f296269aee701c1f.1665659138.git.michal.simek@amd.com
2022-11-22watchdog: Drop GD_FLG_WDT_READY as it's not used any moreStefan Roese1-1/+0
Since commit c2fd0ca1a822 ("watchdog: Integrate watchdog triggering into the cyclic framework") GD_FLG_WDT_READY has become write-only. This patch now removes this flag completely. The vacant spot in gd_flags is filled with the newly introduced GD_FLG_CYCLIC_RUNNING flag. Suggested-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Signed-off-by: Stefan Roese <sr@denx.de>
2022-11-22watchdog: designware: make reset really optionalQuentin Schulz1-4/+5
Checking for DM_RESET is not enough since not all watchdog implementations use a reset lane. Such is the case for Rockchip implementation for example. Since reset_assert_bulk will only succeed if the resets property exists in the watchdog DT node, it needs to be called only if a reset property is present. This adds a condition on the resets property presence in the watchdog DT node before assuming a reset lane needs to be fetched with reset_assert_bulk, by calling ofnode_read_prop. Cc: Quentin Schulz <foss+uboot@0leil.net> Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2022-11-21usb: gadget: dfu: Fix the unchecked length fieldVenkatesh Yadav Abbarapu1-21/+37
DFU implementation does not bound the length field in USB DFU download setup packets, and it does not verify that the transfer direction. Fixing the length and transfer direction. CVE-2022-2347 Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com> Reviewed-by: Marek Vasut <marex@denx.de>
2022-11-15clk: microchip: mpfs: fix criticality of peripheral clocksConor Dooley1-7/+21
Sync the critical clocks in the U-Boot driver with those marked as critical in Linux. The Linux driver has an explanation of why each clock is considered to be critical, so import that too. Fixes: 2f27c9219e ("clk: Add Microchip PolarFire SoC clock driver") Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com> Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com>
2022-11-15clk: microchip: mpfs: fix periph clk parentageConor Dooley3-38/+42
Not all "periph" clocks are children of the AHB clock, some have the AXI clock as their parent & the mtimer clock is derived from the external reference clock directly. Stop assuming the AHB clock to be the parent of all "periph" clocks and define their correct parents instead. Fixes: 2f27c9219e ("clk: Add Microchip PolarFire SoC clock driver") Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com> Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com> Tested-by: Padmarao Begari <padmarao.begari@microchip.com>
2022-11-15clk: microchip: mpfs: fix reference clock handlingConor Dooley3-1/+149
The original devicetrees for PolarFire SoC messed up & defined the msspll's output as a fixed-frequency, 600 MHz clock & used that as the input for the clock controller node. The msspll is not a fixed frequency clock and later devicetrees handled this properly. Check the devicetree & if it is one of the fixed ones, register the msspll. Otherwise, skip registering it & pass the reference clock directly to the cfg clock registration function so that existing devicetrees are not broken by this change. As the MSS PLL is not a "cfg" or a "periph" clock, add a new driver for it, based on the one in Linux. Fixes: 2f27c9219e ("clk: Add Microchip PolarFire SoC clock driver") Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com> Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com> Tested-by: Padmarao Begari <padmarao.begari@microchip.com>
2022-11-15clk: microchip: mpfs: convert parent rate acquistion to get_get_rate()Conor Dooley5-35/+20
Currently the clock driver for PolarFire SoC takes a very naive approach to the relationship between clocks. It reads the dt to get an input clock, assumes that that is fixed frequency, reads the "clock-frequency" property & uses that to set up both the "cfg" and "periph" clocks. Simplifying for the sake of incremental fixes, the "correct" parentage for the clocks currently supported in U-Boot is that the "cfg" clocks should be children of the fixed frequency clock in the dt. The AHB clock is one of these "cfg" clocks and is the parent of the "periph" clocks. Instead of passing the clock rate of the fixed-frequency clock to the "cfg" and "periph" registration functions and the name of the parents, pass their actual parents & use clk_get_rate() to determine their parents rates. The "periph" clocks are purely gate clocks and should not be reading the AHB clocks registers to determine their rates, as they can simply report the output of clk_get_rate() on their parent. Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com> Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com>
2022-11-14Merge tag 'u-boot-imx-20221114' of ↵Tom Rini5-6/+16
https://gitlab.denx.de/u-boot/custodians/u-boot-imx For 2022.01 ----------- CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/14083 - Fix UART - moved to binman (MX8 boards) - Toradex: sync DTS with Linux - Gateworks: fixes - New boards : MSC SM2S iMX8MP
2022-11-14i2c: i2c-gpio: add newlineSergei Antonov1-1/+1
Add newline at the end of the printed string. Signed-off-by: Sergei Antonov <saproj@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
2022-11-14i2c: microchip: fix erroneous late ack sendConor Dooley1-1/+1
A late ack is currently being sent at the end of a transfer due to incorrect logic in mchp_corei2c_empty_rx(). Currently the Assert Ack bit is being written to the controller's control reg after the last byte has been received, causing it to sent another byte with the ack. Instead, the AA flag should be written to the control register when the penultimate byte is read so it is sent out for the last byte. Reported-by: Andreas Buerkler <andreas.buerkler@enclustra.com> Fixes: 0dc0d1e094 ("i2c: Add Microchip PolarFire SoC I2C driver") Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com> Reviewed-by: Heiko Schocher <hs@denx.de> Removed Tag by hs: Fixes: 0190d48488 ("i2c: microchip: fix ack sending logic")
2022-11-14i2c: microchip: fix ack sending logicConor Dooley1-6/+17
"Master receive mode" was not correctly sending ACKs/NACKs in the interrupt handler. Bring the handling of M_SLAR_ACK, M_RX_DATA_ACKED & M_RX_DATA_NACKED in line with the Linux driver. Fixes: 0dc0d1e094 ("i2c: Add Microchip PolarFire SoC I2C driver") Reported-by: Shravan Chippa <shravan.chippa@microchip.com> Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com> Reviewed-by: Heiko Schocher <hs@denx.de>
2022-11-12Revert "serial: mxc: have putc use the TXFIFO"Fabio Estevam1-1/+1
This reverts commit c7878a0483c59c48a730123bc0f4659fd40921bf. Since commit c7878a0483c5 ("serial: mxc: have putc use the TXFIFO"), serial console corruption can be seen when priting inside board_init(). Revert it to avoid the regression. Reported-by: Tim Harvey <tharvey@gateworks.com> Signed-off-by: Fabio Estevam <festevam@denx.de> Acked-by: Tim Harvey <tharvey@gateworks.com>
2022-11-10global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespaceTom Rini29-84/+84
Migrate all of COFIG_SYS_FSL* to the CFG_SYS namespace. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-11-10global: Migrate CONFIG_SYS_MPC8* symbols to the CFG_SYS namespaceTom Rini15-41/+41
Migrate all of COFIG_SYS_MPC* to the CFG_SYS namespace. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-11-10Convert CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST to KconfigTom Rini1-0/+4
This converts the following to Kconfig: CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-11-10mediatek: Include <linux/sizes.h> where neededTom Rini1-0/+1
These files reference SZ_ macros without including <linux/sizes.h>, correct this. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-11-10Convert CONFIG_SYS_MMC_MAX_BLK_COUNT to KconfigTom Rini1-0/+7
This converts the following to Kconfig: CONFIG_SYS_MMC_MAX_BLK_COUNT Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2022-11-10Convert CONFIG_SYS_MAX_NAND_DEVICE to KconfigTom Rini1-0/+4
This converts the following to Kconfig: CONFIG_SYS_MAX_NAND_DEVICE Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-11-10rtc: Remove unused driversTom Rini5-669/+0
These drivers are not enabled anywhere, remove them. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-11-10Convert CONFIG_SYS_INTERLAKEN et al to KconfigTom Rini1-1/+1
This converts the following to Kconfig: CONFIG_SYS_INTERLAKEN CONFIG_SYS_ISA_IO CONFIG_SYS_ISA_IO_BASE_ADDRESS Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-11-10Convert CONFIG_SYS_I2C_INIT_BOARD to KconfigTom Rini2-31/+0
This converts the following to Kconfig: CONFIG_SYS_I2C_INIT_BOARD Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-11-07dm: blk: Add probe in blk_first_device/blk_next_deviceMichal Suchanek1-24/+22
The description claims that the device is probed but it isn't. Add the device_probe() call. Also consolidate the iteration into one function. Fixes: 8a5cbc065d ("dm: blk: Use uclass_find_first/next_device() in blk_first/next_device()") Signed-off-by: Michal Suchanek <msuchanek@suse.de>
2022-11-07dm: sandbox: Switch over to using the new host uclassSimon Glass2-118/+18
Update the sandbox implementation to use UCLASS_HOST and adjust all the pieces to continue to work: - Update the 'host' command to use the new API - Replace various uses of UCLASS_ROOT with UCLASS_HOST - Disable test_eficonfig since it doesn't work (this should have a unit test to allow this to be debugged) - Update the blk test to use the new API - Drop the old header file Unfortunately it does not seem to be possible to split this change up further. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-11-07dm: sandbox: Create a block driverSimon Glass2-1/+143
Create a block driver for the new HOST uclass. This handles attaching and detaching host files. For now the uclass is not used but this will be plumbed in with future patches. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-11-07dm: sandbox: Create a new HOST uclassSimon Glass2-1/+177
Sandbox supports block devices which can access files on the host machine. At present there is no uclass for this. The devices are attached to the root devic. The block-device type is therefore set to UCLASS_ROOT which is confusing. Block devices should be attached to a 'media' device instead, something which handles access to the actual media and provides the block driver for the block device. Create a new uclass to handle this. It supports two operations, to attach and detach a file on the host machine. For now this is not fully plumbed in. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-11-07dm: blk: Tidy up obtaining a block device from its parentSimon Glass1-11/+15
This function now finds its block-device child by looking for a child device of the correct uclass (UCLASS_BLK). It cannot produce a device of any other type, so drop the superfluous check. Provide a version which does not probe the device, since that is often needed when setting up the device's platdata. Also fix up the function's comment. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-11-07dm: test: Clear the block cache after running a testSimon Glass1-13/+10
Some tests access data in block devices and so cause the cache to fill up. This results in memory being allocated. Some tests check the malloc usage at the beginning and then again at the end, to ensure there is no memory leak caused by the test. The block cache makes this difficult, since the any test may cause entries to be allocated or even freed, if the cache becomes full. It is simpler to clear the block cache after each test. This ensures that it will not introduce noise in tests which check malloc usage. Add the logic to clear the cache, using the existing blkcache_invalidate() function. Drop the duplicate code at the same time. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-11-07dm: sandbox: Drop non-BLK code from host implementationSimon Glass1-102/+0
This is not used anymore. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-11-07drivers: power: pmic: Enable use of rn5t567 PMIC in SPLMartyn Welch2-1/+9
The support added later in this series tweaks the PMIC voltages in the SPL. Enable support for the rn5t567 in SPL builds to allow this to be done cleanly. Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2022-11-07drivers: power: pmic: Add support for rn5t568 PMICMartyn Welch1-0/+1
Add support for the rn5t568 PMIC to the rn5t567 driver. Signed-off-by: Martyn Welch <martyn.welch@collabora.com> Reviewed-by: Jaehoon Chung <j80.chung@samsung.com>
2022-11-07regulator: bd718x7: Only bind children when PMIC_CHILDREN is enabledAdam Ford1-4/+5
If the bd718x7 is required, but PMIC_CHILDREN is disabled, this driver throws a compile error. Fix this by putting the function to bind children into an if-statement checking for PMIC_CHILDREN. Allowing PMIC_CHILDREN to be disabled in SPL saves some space and still permits some read/write functions to access the PMIC in early startup. Signed-off-by: Adam Ford <aford173@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Fabio Estevam <festevam@gmail.com>
2022-11-07pinctrl: mvebu: Add AlleyCat5 supportChris Packham1-1/+1
This uses the same IP block as the Armada-8K SoCs. Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
2022-11-07usb: ehci: ehci-marvell: Support for marvell,ac5-ehciChris Packham2-8/+46
Unlike the other 64-bit mvebu SoCs the AlleyCat5 uses the older ehci block from the 32-bit SoCs. Adapt the ehci-marvell.c driver to cope with the fact that the ac5 does not have the mbus infrastructure the 32-bit SoCs have and ensure USB_EHCI_IS_TDI is selected. Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
2022-11-07net: mvneta: Add support for AlleyCat5Chris Packham2-2/+43
Add support for the AlleyCat5 SoC. This lacks the mbus from the other users of the mvneta.c driver so a new compatible string is needed to allow for a different window configuration. Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
2022-11-03usb: ohci: Use a flexible array member for portstatusSamuel Holland2-14/+1
The struct is only used to overlay the MMIO region, so the behavior is the same. This obsoletes the Kconfig option for the number of ports. Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-03Merge branch '2022-11-02-assorted-updates'Tom Rini10-11/+1130
- Improve arm semihosting, NPCM8xx pinctrl driver, SP804 uclass timer driver (and enable on relevant platforms), pvblock cleanup, eeprom cmd bugfix, add RTI watchdog nodes to k3-am64-main, evb-ast2500 config updates.
2022-11-03Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-riscvTom Rini4-1/+513