summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2023-10-21drivers: spi: spi-sifive.c: Remove cs check for DubheWei Liang Lim1-2/+2
Signed-off-by: Wei Liang Lim <weiliang.lim@starfivetech.com>
2023-10-20drivers: spi: spi-sifive.c: Remove cs check for DubheWei Liang Lim1-1/+1
Signed-off-by: Wei Liang Lim <weiliang.lim@starfivetech.com>
2023-10-20drivers: net: Dubhe GMAC UpdateWei Liang Lim3-2/+28
Signed-off-by: Wei Liang Lim <weiliang.lim@starfivetech.com>
2023-10-19net: dw_eth_qos: Add 64-bit addressingWei Liang Lim1-16/+15
Signed-off-by: Wei Liang Lim <weiliang.lim@starfivetech.com>
2023-10-19drivers: net: dwc_eth_qos.h: Set correct PHY MDIO CR_250_300Wei Liang Lim1-1/+2
Signed-off-by: Wei Liang Lim <weiliang.lim@starfivetech.com>
2023-10-19dubhe: dwc_eth_qos: Fix errors and set the speed to 10M on FPGAWei Liang Lim2-3/+3
Signed-off-by: Wei Liang Lim <weiliang.lim@starfivetech.com>
2023-10-19drivers: net: dwc_eth_qos: Add GMAC support for DubheWei Liang Lim2-0/+314
Signed-off-by: Wei Liang Lim <weiliang.lim@starfivetech.com>
2023-10-19arch: riscv: dubhe: Update Dubhe supportWei Liang Lim4-110/+116
Signed-off-by: Wei Liang Lim <weiliang.lim@starfivetech.com>
2023-10-18Add DDR driver frameworkwoonjiet.chong4-1/+122
Reassign address for SPL STACK to avoid global data being wiped off during mem_malloc_init Remove unused config CONFIG_SPL_LOAD_FIT_ADDRESS Signed-off-by: woonjiet.chong <woonjiet.chong@starfivetech.com>
2023-10-18Enable SPL, OpenSBI and U-Boot proper boot flow for Dubhe FPGAwoonjiet.chong1-0/+2
2023-09-29clk: at91: Fix initializing arraysFrancois Berder2-4/+4
Arrays are not cleared entirely because ARRAY_SIZE returns the number of elements in an array, not the size in bytes. This commit fixes the calls to memset by providing the array size in bytes instead of the number of elements in the array. Signed-off-by: Francois Berder <fberder@outlook.fr>
2023-09-27mtd: nand: raw: atmel: Add error handling when rb-gpios missingAlexander Dahl1-4/+7
Adapt behaviour to Linux kernel driver. The return value of gpio_request_by_name_nodev() was not checked before, and thus in case 'rb-gpios' was missing in DT, rb.type was set to ATMEL_NAND_GPIO_RB nevertheless, leading to output like this for example (on sam9x60-curiosity with the line removed from dts): NAND: Could not find valid ONFI parameter page; aborting device found, Manufacturer ID: 0xc2, Chip ID: 0xdc Macronix NAND 512MiB 3,3V 8-bit 512 MiB, SLC, erase size: 256 KiB, page size: 4096, OOB size: 64 atmel-nand-controller nand-controller: NAND scan failed: -22 Failed to probe nand driver (err = -22) Failed to initialize NAND controller. (error -22) 0 MiB Note: not having that gpio assigned in dts is possible, the driver does not override nand_chip->dev_ready() then and a generic solution is used. Fixes: 6a8dfd57220d ("nand: atmel: Add DM based NAND driver") Signed-off-by: Alexander Dahl <ada@thorsis.com> Reviewed-by: Eugen Hristev <eugen.hristev@collabora.com> Acked-by: Michael Trimarchi <michael@amarulasolutions.com>
2023-09-22drivers: mediatek: Fix error handling in mtk_i2c_do_transferFrancois Berder1-1/+1
Errors were handled only if an I2C transfer timed out and received a NACK which is very unlikely. This commit changes the condition such that errors are handled if an I2C transfer times out or received a NACK. Signed-off-by: Francois Berder <fberder@outlook.fr> Reviewed-by: Heiko Schocher <hs@denx.de>
2023-09-22net: sni_netsec: Add workaround for timeout errorRyosuke Saito1-9/+41
The NETSEC GMAC occasionally falls into a weird state where MAC_REG_DESC_SOFT_RST has never been cleared and shows errors like the below when networking commands are issued: => ping 192.168.1.1 ethernet@522d0000 Waiting for PHY auto negotiation to complete... done netsec_wait_while_busy: timeout Using ethernet@522d0000 device ARP Retry count exceeded; starting again ping failed; host 192.168.1.1 is not alive It happens on not only 'ping' but also 'dhcp', 'tftp' and so on. Luckily, restarting the NETSEC GMAC and trying again seems to fix the problematic state. So first ensure that we haven't entered the state by checking MAC_REG_DESC_SOFT_RST to be cleared; otherwise, restarting NETSEC/PHY and trying again would work as a workaround. Signed-off-by: Ryosuke Saito <ryosuke.saito@linaro.org> Tested-by: Masahisa Kojima <masahisa.kojima@linaro.org>
2023-09-05Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-usbTom Rini1-3/+2
- DWC3 fix on Layerscape
2023-09-05Merge tag 'u-boot-imx-20230905' of ↵Tom Rini1-3/+7
https://gitlab.denx.de/u-boot/custodians/u-boot-imx Fixes for release ----------------- - imx9: fix DRAM calculation - thermal: fixes - fixed for DM, DH and Gateworks boards CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/17639
2023-09-05risc-v: implement DBCN based debug consoleHeinrich Schuchardt2-1/+24
Use the DBCN SBI extension to implement a debug console. Make it the default for S-mode RISC-V. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2023-09-05riscv: allow riscv timer to be instantiated via device treeTorsten Duwe1-2/+26
For the architectural timer on riscv, there already is a defined device tree binding[1]. Allow timer instances to be created from device tree matches, but for now retain the old mechanism, which registers the timer biggy-back with the CPU. [1] linux/Documentation/devicetree/bindings/timer/riscv,timer.yaml Signed-off-by: Torsten Duwe <duwe@suse.de> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2023-09-04thermal: imx_tmu: Increase the polling intervalFabio Estevam1-1/+1
Polling every second to check whether the CPU has cooled down is too frequent. Allow more time for the CPU to cool down by increasing the polling interval to 5 seconds by defaut. This value is used in the absence of the 'polling-delay' devicetree property. Signed-off-by: Fabio Estevam <festevam@denx.de>
2023-09-04thermal: imx_tmu: Fix the temperature unitFabio Estevam1-2/+2
The temperature unit is millidegree Celsius, so divide by 1000 to correctly print the temperature values in Celsius. While at it, also change a typo: "has beyond" to "is beyond". Signed-off-by: Fabio Estevam <festevam@denx.de>
2023-09-04thermal: imx_tmu: Increase the log level for high temperaturesFabio Estevam1-1/+1
dev_info() message is not printed by default. Increase the log level to dev_crit(). This allows the critical messages related to the temperature getting beyong the alert threshold to be displayed. Signed-off-by: Fabio Estevam <festevam@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-09-04thermal: imx_tmu: Fix the polling defaultFabio Estevam1-1/+5
When the 'polling-delay' property is not passed via devicetree, pdata->polling_delay keeps at 0. This causes the imx_tmu driver to get stuck inside the busy while() loop when the CPU temperature is above the alert point. Fix this problem by passing a one second polling interval, which provides a proper delay to let the system to cool down and exit the while() loop when the temperature is below the alert point. Signed-off-by: Fabio Estevam <festevam@denx.de>
2023-09-04usb: dwc3: Fix enabling USB_DR_MODE_HOSTOleksandr Suvorov1-1/+1
The original logic always enables USB_DR_MODE_HOST operation mode in dwc3_layerscape_bind() in u-boot. Prevent choosing USB_DR_MODE_HOST operation mode if USB_HOST is not enabled. Fixes: 2b0b51d0bed ("usb: dwc3: add layerscape support") Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
2023-09-04usb: dwc3: Fix renaming SPL_USB_HOST_SUPPORT to SPL_USB_HOSTOleksandr Suvorov1-3/+2
In the usb/dwc3-layerscape driver the first option should be renamed to the latter as well. Do it. Fix original logic in dwc3_layerscape_bind() - do not enable Fixes: 333e4a621df ("Rename SPL_USB_HOST_SUPPORT to SPL_USB_HOST") Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
2023-08-25phy: phy-imx8mq-usb: clean up clock codeTim Harvey1-21/+17
use CONFIG_IS_ENABLED for clock enable/disable and change printf's to dev_err. Additionlly remove the comment that does not make sense. Signed-off-by: Tim Harvey <tharvey@gateworks.com> Reviewed-by: Marek Vasut <marex@denx.de>
2023-08-25phy: phy-imx8mq-usb: add vbus regulator supportTim Harvey1-3/+36
Add support for enabling and disabling vbus-supply regulator found on several imx8mp boards in the usb3_phy0 and usb3_phy1 nodes. Signed-off-by: Tim Harvey <tharvey@gateworks.com> Reviewed-by: Adam Ford <aford173@gmail.com> Reviewed-by: Marek Vasut <marex@denx.de> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2023-08-25usb: dwc3: Fix remove function if there is no ulpi_reset gpioVenkatesh Yadav Abbarapu1-1/+2
As ulpi_reset gpio is now optional, we need to check it when doing the 'dwc3_generic_remove' function. Check if it is declared before accessing the ulpi_reset. Fixes: 237d1f60b1d ("usb: dwc3: Use the devm_gpiod_get_optional() API for reset gpio") Reported-by: Thomas Nizan <tnizan@witekio.com> Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
2023-08-22dm: event: add EVT_DM_POST_INIT_R event typeChanho Park1-2/+4
This patch introduces EVT_DM_POST_INIT_R event type for handling hooks after relocation. Fixes: 55171aedda88 ("dm: Emit the arch_cpu_init_dm() even only before relocation") Suggested-by: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Chanho Park <chanho61.park@samsung.com> Tested-by: Milan P. Stanić <mps@arvanta.net> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Roland Ruckerbauer <mail@ruabmbua.dev> Tested-by: Roland Ruckerbauer <mail@ruabmbua.dev> Fixed missing event name in event.c: Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-20Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-shTom Rini1-0/+2
2023-08-17arm_ffa: use debug logsAbdellatif El Khlifi4-5/+5
replace info logs with debug logs Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-16serial: stm32: extend TC timeoutValentin Caron1-6/+12
Waiting 150us TC bit couldn't be enough. If TFA lets 16 bits in USART fifo, we has to wait 16 times 87 us (time of 10 bits (1 byte in most use cases) at a baud rate of 115200). Fixes: b4dbc5d65a67 ("serial: stm32: Wait TC bit before performing initialization") Signed-off-by: Valentin Caron <valentin.caron@foss.st.com> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
2023-08-16clk: stm32mp1: remove error for disabled clock in stm32mp1_clk_get_parentPatrick Delaunay1-1/+2
To disabled a clock in clock tree initialization for a mux of STM32MP15, the selected clock source index is set with the latest possible index for the number of bit used. Today this valid configuration cause a error in U-Boot messages, for example with CLK_ETH_DISABLED, when this clock is not needed for the used ETH PHY without crystal: no parents defined for clk id 123 This patch change the level of this message to avoid this trace for valid clock tree. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2023-08-15i2c: mvtwsi: reset controller if stuck in "bus error" stateSam Edwards1-0/+42
The MVTWSI controller can act either as a master or slave device. When acting as a master, the FSM is driven by the CPU. As a slave, the FSM is driven by the bus directly. In what is (apparently) a safety mechanism, if the bus transitions our FSM in any improper way, the FSM goes to a "bus error" state (0x00). I could find no documented or experimental way to get the FSM out of this state, except for a controller reset. Since U-Boot only uses the MVTWSI controller as a bus master, this feature only gets in the way: we do not care what happened on the bus previously as long as the bus is ready for a new transaction. So, when trying to start a new transaction, check for this state and reset the controller if necessary. Note that this should not be confused with the "deblocking" technique (used by the `i2c reset` command), which involves pulsing SCL repeatedly if SDA is found to be held low, in an attempt to force the bus back to an idle state. This patch only resets the controller in case something else had previously upset it, and (in principle) results in no externally-observable change in behavior. Signed-off-by: Sam Edwards <CFSworks@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Heiko Schocher <hs@denx.de>
2023-08-14Merge tag 'u-boot-rockchip-20230814' of ↵Tom Rini5-88/+169
https://source.denx.de/u-boot/custodians/u-boot-rockchip - Add board: rk3568 EmbedFire Lubancat 2 - Fixes for rk3568 clock and pinctrl; - Fixes for rk3308 clock and uart; - rk3328 rock64 updates; - Video fix on veyron board;
2023-08-14pinctrl: rockchip: Fix drive and input schmitt on RK3568Jonas Karlman1-25/+31
On RK3568 most pins have a configurable drive strength of level 0-5 and some pins level 0-11. When rk3568_set_drive is called with a strength value above 7 the drv value written to reg may overflow into the write enable bits, resulting in a bad configuration. This cause e.g. ethernet PHY on Radxa CM3-IO board not to work after drive is configured according to the device tree. Could not get PHY for ethernet@fe010000: addr 0 Level 6-11 can be configured using a second reg for some pins, however the drv value is reused resulting in lower 6 bits being written to reg. Input schmitt is configured in 2-bit fields on RK3568 compared to earlier generation and 2'b10 should be used to enable input schmitt. Change to use regmap_update_bits with a rmask to fix the overflow issue and closer match the linux driver. Bit shift the drv value used for the second reg to configure drive strength level 6-11. Also write correct values for input schmitt setting. Fixes: 1977d746aa54 ("rockchip: rk3568: add rk3568 pinctrl driver") Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-08-14bcm2835: Add simiple-framebuffer for use with fkmsJason Wessel1-0/+3
When the fkms dtb overlay is used only the simple-framebuffer is presented as a usable video display. So, add "simple-framebuffer" compatible to enable video driver bcm2835. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Meng Li <Meng.Li@windriver.com>
2023-08-14video: kconfig: Fix a typo in SPL_VIDEO_REMOVEBin Meng1-1/+1
Add one space between 'before' and 'loading'. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-14video: vidconsole: Fix null dereference of ops->measureBin Meng1-1/+1
At present vidconsole_measure() tests ops->select_font before calling ops->measure, which would result in a null dereference when the console driver provides no ops for measure. Fixes: b828ed7d7929 ("console: Allow measuring the bounding box of text") Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-13clk: renesas: Tear clock controller down last before booting OSMarek Vasut1-0/+2
Once all the other drivers got torn down in preparation for the OS to start, tear down the clock controller last. The clock controller must be torn down last as some of the clock which get turned off might have still been needed during the teardown stage of the other drivers. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Signed-off-by: Tam Nguyen <tam.nguyen.xa@renesas.com> Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
2023-08-12clk: rockchip: rk3308: Support reading UART rate and clock registersMassimo Pegorer1-0/+59
Add support to read RK3308 registers used to configure UART clocks, and thus to get UART rate and baudrate. This fixes clock_get_rate returning error on serial device probing. Moreover, there is no need anymore to use 'clock-frequency' property for UART nodes in *-u-boot.dtsi files for all cases where UART is not inited by U-Boot proper or by SPL o by TPL code but by a preliminary external boot phase (for Rock PI S, UART is inited by external TPL). Signed-off-by: Massimo Pegorer <massimo.pegorer+oss@gmail.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-08-12clk: rockchip: rk3308: Fix ordering between masking and shiftingMassimo Pegorer1-5/+5
As per definitions of masks and shift offsets in cru_rk3308.h, values read from registers must be first masked and then shifted. By the way, this fix is binary invariant, because in all of fixed cases the shift offset is zero. Signed-off-by: Massimo Pegorer <massimo.pegorer+oss@gmail.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-08-12clk: rockchip: rk3568: Add dummy support for GMAC speed clocksJonas Karlman1-0/+4
Pine64 Quartz64 boards DT reference SCLK_GMAC1_RGMII_SPEED in the assigned-clocks property of the gmac1 node. This result in a ENOENT error when driver core tries to set a parent for this clock. The clock speed in rgmii/rmii mode is changed using clk_set_rate of the tx_rx clock and not using clk_set_parent of the speed clock. Add dummy support for SCLK_GMAC1_RGMII_SPEED and similar clocks to clk driver to allow a driver for gmac node to probe. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-08-12clk: rockchip: rk3568: Include UART clocks in SPLJonas Karlman1-3/+3
The clock driver for RK3568 does not include support for UART clocks in SPL. This result in the following message with high enough loglevel. ns16550_serial serial@fe660000: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19 Fix this by including support for UART clocks in SPL. Fixes: 4a262feba3a5 ("rockchip: rk3568: add clock driver") Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Eugen Hristev <eugen.hristev@collabora.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-08-12clk: rockchip: rk3568: Fix mask for clk_cpll_div_25m_divJonas Karlman1-1/+4
The field for clk_cpll_div_25m_div in CRU_CLKSEL_CON81 is 6 bits wide, not 5 bits wide as currently defined in CPLL_25M_DIV_MASK. Fix this and the assert so that CPLL_25M can be assigned a 25 MHz rate. Fixes: 4a262feba3a5 ("rockchip: rk3568: add clock driver") Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-08-12clk: rockchip: rk3568: Fix clk selection in rk3568_pwm_get_clkDamon Ding1-1/+1
Fix use of wrong clk selection for CLK_PWM1 on RK3568. Fixes: 4a262feba3a5 ("rockchip: rk3568: add clock driver") Signed-off-by: Damon Ding <damon.ding@rock-chips.com> Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-08-12video: avoid build failure on veyron boardAlvaro Fernando García1-2/+5
533ad9dc avoided an overflow but causes compilation failure on 32bit boards (eg. veyron speedy) this commit uses div_u64 which has a fallback codepath for 32bit platforms Signed-off-by: Alvaro Fernando García <alvarofernandogarcia@gmail.com> Tested-by: Simon Glass <sjg@chromium.org> # chromebook_jerry Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-08-12pci: rockchip: Release resources on failing probeJonas Karlman1-51/+57
The PCIe driver for RK3399 is affected by a similar issue that was fixed for RK35xx in the commit e04b67a7f4c1 ("pci: pcie_dw_rockchip: release resources on failing probe"). Resources are not released on failing probe, e.g. regulators may be left enabled and the ep-gpio may be left in a requested state. Change to use regulator_set_enable_if_allowed and disable regulators after failure to keep regulator enable count balanced, ep-gpio is also released on regulator failure. Also add support for the vpcie12v-supply, remove unused include and check return value from dev_read_addr_name. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-08-10Merge https://source.denx.de/u-boot/custodians/u-boot-watchdogTom Rini1-19/+21
- cmd: cyclic: Remove duplicate command name in help text (Alexander) - ftwdt010: need to reset watchdog in ftwdt010_wdt_start() (Sergei)
2023-08-10watchdog: ftwdt010: need to reset watchdog in ftwdt010_wdt_start()Sergei Antonov1-19/+21
ftwdt010_wdt_start() has to call ftwdt010_wdt_reset() after setting-up the timeout in the same fashion ftwdt010_wdt_expire_now() does it. Without this patch the "wdt start <ms>" command does not actually start the watchdog timer until the "wdt reset" command is executed. Signed-off-by: Sergei Antonov <saproj@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
2023-08-10pci: plda: Get correct ECAM offset in multiple PCIe RC caseMinda Chen1-2/+3
Get the correct ECAM offset and record the secondary bus number in Multiple RC case. Signed-off-by: Minda Chen <minda.chen@starfivetech.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>