Commit graph

25838 commits

Author SHA1 Message Date
Simon Glass
6995f2c8be common: Move autoprobe out to board init
Rather than doing autoprobe within the driver model code, move it out to
the board-init code. This makes it clear that it is a separate step from
binding devices.

For now this is always done twice, before and after relocation, but we
should discuss whether it might be possible to drop the post-relocation
probe.

For boards with SPL, the autoprobe is still done there as well.

Note that with this change, autoprobe happens after the
EVT_DM_POST_INIT_R/F events are sent, rather than before.

Link: https://lore.kernel.org/u-boot/20240626235717.272219-1-marex@denx.de/

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-14 11:42:51 -06:00
Simon Glass
21dd873572 dm: core: Simplify dm_probe_devices()
There is no point in checking the pre_reloc flag, since devices not
marked as pre-reloc will not have been bound, so won't exist yet.

There doesn't seem to be any point in checking if the device has a
valid devicetree node either, so drop that too.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-14 11:42:51 -06:00
Tom Rini
4eb937058f AMD/Xilinx changes for v2025.04-rc1 v2
Versal:
 - Enable dfu support for SPI with multiboot
 
 ZynqMP:
 - Align multiboot reg description
 - DT syncups
 - Wire missing DTs in defconfig
 - Kria: Remove usb hub initialization via commands
 - Kria: Update DP reset in psu_init
 
 AMD/Xilinx:
 - Enable SPI_STACKED_PARALLEL configs
 
 SPI/ZYNQMP_GQSPI:
 - Update debug message to use log_debug()
 
 RTC:
 - Enable ZYNQMP_RTC for Versal SOCs
 -----BEGIN PGP SIGNATURE-----
 
 iF0EABECAB0WIQQbPNTMvXmYlBPRwx7KSWXLKUoMIQUCZ4Z24gAKCRDKSWXLKUoM
 IeDBAJwM1BhEn/+ahKhYmKwt7NshAG4oBgCgj6ji+7uGNAiCMPSC5FpYt5Y+M5k=
 =6GRU
 -----END PGP SIGNATURE-----

Merge tag 'xilinx-for-v2025.04-rc1-v2' of https://source.denx.de/u-boot/custodians/u-boot-microblaze

AMD/Xilinx changes for v2025.04-rc1 v2

Versal:
- Enable dfu support for SPI with multiboot

ZynqMP:
- Align multiboot reg description
- DT syncups
- Wire missing DTs in defconfig
- Kria: Remove usb hub initialization via commands
- Kria: Update DP reset in psu_init

AMD/Xilinx:
- Enable SPI_STACKED_PARALLEL configs

SPI/ZYNQMP_GQSPI:
- Update debug message to use log_debug()

RTC:
- Enable ZYNQMP_RTC for Versal SOCs
2025-01-14 09:36:06 -06:00
Vincent Fazio
3a2bf24a85 rtc: zynqmp: allow on Versal architectures
Allow the ZyncMP RTC driver to be enabled on Versal architectures.

Also, require DM_RTC since the driver uses the RTC driver model.

Signed-off-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20250114135812.2605618-1-vfazio@xes-inc.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-01-14 15:34:51 +01:00
Ibai Erkiaga
f039cde1e2 zynqmp_gqspi: update to log_debug
Update recent parallel memory support code to move to log_debug instead
of debug as per logging in U-Boot documentation

Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@amd.com>
Link: https://lore.kernel.org/r/20250107145110.2855213-1-ibai.erkiaga-elorza@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-01-14 08:33:31 +01:00
Udit Kumar
b9fe3ec8a2 power: pmic: tps65941: Fix TI TPS65224 PMIC compatiable
Fix compatiable name for TPS65224 PMIC as defined in
dts/upstream/Bindings/mfd/ti,tps6594.yaml bindings.

Fixes: 1468fbba6d55("power: pmic: tps65941: Add TI TPS65224 PMIC")
Signed-off-by: Udit Kumar <u-kumar1@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2025-01-14 07:44:51 +09:00
Shree Ramamoorthy
7e261a05a5 power: replace magic numbers with macros
Replace magic numbers in buckval2votl() & buckvolt2val() with macros to
help with clarity and correlate what the numbers correspond to in the
TPS65219 datasheet.

Signed-off-by: Shree Ramamoorthy <s-ramamoorthy@ti.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2025-01-14 07:44:42 +09:00
Shree Ramamoorthy
eda65fa42b power: regulator: replace printf() with pr_err()
Replace printf() with pr_err() because pr_err() has a uniform print format
and takes into consideration the log levels supported.

Signed-off-by: Shree Ramamoorthy <s-ramamoorthy@ti.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2025-01-14 07:44:30 +09:00
Tom Rini
6a0db9ee03 Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-usb
- ehci-mx5/ehci-mx6 driver improvements
2025-01-13 08:25:00 -06:00
Marek Vasut
801b5fafd3 usb: ehci-mx6: Add i.MX95 support
i.MX95 uses the same USB IP as i.MX8MM. It can then reuse the ehci-mx6
driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2025-01-13 04:39:05 +01:00
Tom Rini
bc157bb666 Merge tag 'u-boot-rockchip-20250110' of https://source.denx.de/u-boot/custodians/u-boot-rockchip
CI: https://source.denx.de/u-boot/custodians/u-boot-rockchip/-/pipelines/24129

- Add boards:
	rk3566: FriendlyARM NanoPi R3S
	rk3588s: Radxa ROCK 5C,
	rk3588: Khadas Edge2
- Migrate to OF_UPSTREAM:
	rk3066a/rk3188;
	rk3288: tinker, miqi, firefly;
- Migrate to TPL: rk3399 kevin and bob;
2025-01-10 18:56:22 -06:00
Jonas Karlman
c63eae2817 rockchip: clk: rk3288: Drop use of SCLK_MAC_PLL
The SCLK_MAC_PLL id is not exported or referenced upstream. It is also
not referenced in vendor U-Boot or vendor kernel 4.4, 4.19, 5.10 or 6.1.

Relax the check for parent id SCLK_MAC_PLL when using internal clock
source for gmac to allow use of clock/rk3288-cru.h from dts/upstream.

All in-tree and upstream rk3288 DTs use an external clock as parent,
so no functional change to boards is expected with this change.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:09 -06:00
Tom Rini
121e62e8af Merge https://source.denx.de/u-boot/custodians/u-boot-watchdog
- rti: support SPL (or re-start) (Alexander)
- rti: drop hack manipulating WDT clock rate (Alexander)
2025-01-09 15:25:36 -06:00
Marek Vasut
addcb09fd5 usb: ehci-mx6: Use regulator_set_enable_if_allowed
With the commit 4fcba5d556 ("regulator: implement basic reference
counter") the return value of regulator_set_enable may be EALREADY or
EBUSY for fixed/gpio regulators.

Change to use the more relaxed regulator_set_enable_if_allowed to
continue if regulator already was enabled or disabled.

Based on 335799b725 ("usb: dwc2: Use regulator_set_enable_if_allowed")

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2025-01-09 21:09:05 +01:00
Marek Vasut
b20c51bc45 usb: ehci-mx5: Use regulator_set_enable_if_allowed
With the commit 4fcba5d556 ("regulator: implement basic reference
counter") the return value of regulator_set_enable may be EALREADY or
EBUSY for fixed/gpio regulators.

Change to use the more relaxed regulator_set_enable_if_allowed to
continue if regulator already was enabled or disabled.

Based on 335799b725 ("usb: dwc2: Use regulator_set_enable_if_allowed")

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2025-01-09 21:09:05 +01:00
Tom Rini
3bfd12008b Merge branch 'next' 2025-01-08 14:19:22 -06:00
Alexander Sverdlin
5964f24f15 watchdog: rti: drop hack manipulating WDT clock rate
The hack itself seems to be copied from Linux rti_wdt.c, but the WDT reset
principle is different in U-Boot. While Linux relies on correct frequencies
and timers and doesn't check the actual WDT counter value U-Boot driver
seems to be more robust: it does compare RTIDWDCNTR vs RTIDWDPRLD.

Now the root cause of the original motivation to manipulate the clock rate
is said to be understood and fixed in Linux commit cae58516534e
("watchdog: rti_wdt: Set min_hw_heartbeat_ms to accommodate a safety margin")
which simultaneously removed the hack itself.

While is fix part of the mentioned patch is neither applicable nor requried
for the U-Boot driver just drop the hack setting WDT clock rate to 90% of
the real rate. This has a nice effect that the WDT timeout is now as
requested and not 10% shorter.

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2025-01-07 10:29:58 +01:00
Alexander Sverdlin
5b5124e3d5 watchdog: rti: support SPL (or re-start)
If the RTI watchdog has been enabled in SPL, enabling it in U-Boot proper
fails because it can only be enabled once in HW and never stopped. This
however leads to a situation that wdt_cyclic() watchdog trigger is not
being started any longer and the WDT fires at some point.

Allow for WDT re-start by not bailing out if the [previously] configured
period matches the one to be configured.

Enabling in [A53] SPL has been tested on AM62x-based HW (where [A53] SPL is
responsible for loading R5 DM firmware and not this driver).

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2025-01-07 10:29:58 +01:00
Frank Sae
da53e03290 net: phy: Add driver for Motorcomm YT8521S Gigabit ethernet phy
Add driver for Motorcomm YT8521S Gigabit ethernet phy.

Signed-off-by: Frank Sae <Frank.Sae@motor-comm.com>
2025-01-01 14:40:04 -06:00
Frank Sae
1b45d980f4 net: phy: Add driver for Motorcomm YT8531S Gigabit ethernet phy
Add driver for Motorcomm YT8531S Gigabit ethernet phy.

Signed-off-by: Frank Sae <Frank.Sae@motor-comm.com>
2025-01-01 14:40:03 -06:00
Markus Gothe
3912611cd1 Bitbanging MDIO driver for DM framework.
Linux DTS compatible MDIO bitbanging driver.
Both clause 22 and clause 45 MDIO supported and validated.

Heavily based on the Linux drivers (more or less the same code base).

Signed-off-by: Markus Gothe <markus.gothe@genexis.eu>
2025-01-01 14:35:54 -06:00
Rufus Segar
c5cda4ae4a Revert "net: phy: marvell 88e151x: Fix handling of bare RGMII interface type"
This reverts commit 431be621c6.

Section 3.3 of Reduced Gigabit Media Independent Interface (RGMII)
Version 2.0 (4/1/2002) details that a PHYs using a ~2ns internal delay
are referred to as RGMII-ID. This internal delay is optional.

Page 147-148 of the Marvell Doc. No. MV-S107146-U0 Rev. F details
timings of the RX/TX delays. We see that with the TX/RX_CLK delay
enabled, our RX/TX_CTL signal is shifted w.r.t CLK to reflect the delay
added.

In 431be62 there is no timing difference between RGMII and RGMII-ID, and
so programmers wanting to explicitly set their PHY to RGMII will find
that delay added anyway. This could throw off timing if that internal
delay is undesired.

We should be handling all 4 possible RGMII cases of PHY_INTERFACE_MODE:
RGMII, RGMII_ID, RGMII_TXID, and RGMII_RXID. Reverting 431be62
implements this.

See also m88e1111_config_init_rgmii_delays in the equivalent driver in
Linux (drivers/net/phy/marvell.c), which does not set these delays in
RGMII mode.

68e6eca was tested out on an 88E1512 PHY in RGMII-ID mode. This
reversion has been tested by myself on an 88E1518 in RGMII-ID mode. This
patch affects boards using this driver in "rgmii" mode, as the internal
delay will no longer be enabled. Namely kikwood-nsa310s.

Signed-off-by: Rufus Segar <rhs@riseup.net>
2025-01-01 14:35:54 -06:00
Tom Rini
43cae09eab Merge patch series "Fix OSPI boot for J722S"
Prasanth Babu Mantena <p-mantena@ti.com> says:

This series fixes OSPI boot for J722S. It contains fixes for DMSC
communication, R5 regmap for ospi and dma specific overrides for ospi.

Test log: https://gist.github.com/PrasanthBabuMantena/ad469dd09ab7263f85f87dadda46c86d

Link: https://lore.kernel.org/r/20241218131341.2073823-1-p-mantena@ti.com
2024-12-31 17:55:03 -06:00
Manorit Chawdhry
998e00cfce drivers: firmware: ti_sci: Add DM_FLAG_PRE_RELOC to driver
Currently the driver relies on bootph flag to probe it during PRE_RELOC
stage but with the upcoming cleanup of v6.13, we don't have the bootph
property in the parent nodes anymore and ti_sci driver being one of the
parent nodes required during SPL stage would end up hampering the probe
model [0].

Add DM_FLAG_PRE_RELOC to ti_sci driver for mitigating this issue.

[0]: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/21

Suggested-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
2024-12-31 17:55:02 -06:00
Vaishnav Achath
f5da5b1db7 mailbox: k3-sec-proxy: Add DM to DMSC communication thread for J722S
J722S R5 SPL uses sec-proxy threads 28 and 29 for communication with
TIFS. Mark these as valid threads in the driver.

https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/j722s/sec_proxy.html

Signed-off-by: Vaishnav Achath <vaishnav.a@ti.com>
Signed-off-by: Prasanth Babu Mantena <p-mantena@ti.com>
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
2024-12-31 15:24:26 -06:00
Tom Rini
9df4458918 Merge patch series "Cumulative fixes and updates for MediaTek ethernet driver"
Weijie Gao <weijie.gao@mediatek.com> says:

This patch series contains fixes and updates for mtk_eth driver.

Link: https://lore.kernel.org/r/cover.1734406967.git.weijie.gao@mediatek.com
2024-12-31 10:59:06 -06:00
Weijie Gao
c949686e55 net: mediatek: fix usability with wget command
The wget command currently cannot work correctly with mtk_eth driver.
This patch fixed this by increase DMA ring size and invalidate ring data
after use.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2024-12-31 10:58:52 -06:00
Weijie Gao
b9dfb5636b net: mediatek: don't enable GDMA cpu bridge unconditionally for NETSYSv3
Enable GDMA cpu bridge only when 10Gb interface is enabled for GMAC other
than GMAC0, or when MT7988 internal switch is used.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2024-12-31 10:58:52 -06:00
Weijie Gao
5ac929fd1a net: mediatek: make sgmii/usxgmii optional
Not all platforms supports sgmii and/or usxgmii. So we add Kconfig
options for these features and enable them only for supported
platforms.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2024-12-31 10:58:52 -06:00
Weijie Gao
ad0c47109e net: mediatek: add support for 10GBASE-R
This patch adds support for 10GBASE-R interface mode

Signed-off-by: Bo-Cun Chen <bc-bocun.chen@mediatek.com>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2024-12-31 10:58:52 -06:00
Weijie Gao
d8d7e56654 net: mediatek: fix gmac2 usability for mt7629
MT7629 need extra setting for gmac2 to work. So additional
capability is added for mt7629 to handle this case.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2024-12-31 10:58:52 -06:00
Weijie Gao
82f05bc488 net: mediatek: fix sgmii selection for mt7622
Unlike other platforms, mt7622 has only one SGMII and it can be
attached to either gmac1 or gmac2. So the register field of the
sgmii selection differs from other platforms as newer platforms can
control each sgmii individually.

This patch adds a new capability for mt7622 to handle this case.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2024-12-31 10:58:52 -06:00
Weijie Gao
7562da9454 net: mediatek: correct register name of ethsys syscfg1
The SYSCFG0 should be SYSCFG1 according to the programming guide.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2024-12-31 10:58:52 -06:00
Weijie Gao
0d4d8e6f47 net: mediatek: use correct register field for SGMII speed selection
The register field for SGMII speed selection is a 2-bit field with
value 0 for 1Gbps and 1 for 2.5Gbps (2/3 are reserved).
So it's necessary to set both bits instead of just setting/clearing
only the lower bit.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2024-12-31 10:58:52 -06:00
Weijie Gao
6e45549f4d clk: mediatek: mt7629: fix parent clock of some top clock muxes
According to the mt7629 programming guide, the CLK_TOP_F10M_REF_SEL
shares the same parent selection with CLK_TOP_IRRX_SEL, while the
present parent selection for CLK_TOP_F10M_REF_SEL is actually used
for CLK_TOP_SGMII_REF_1_SEL.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2024-12-31 10:58:52 -06:00
Tom Rini
c6fd2a1c29 Prepare v2025.01-rc6
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmdzbjIACgkQFHw5/5Y0
 tyxMlQv+J4Lg70J+a+uwMi6pnx1GTfJ/9RGUWmM94HyfN19TTqSR54oGRc5CT12V
 LlxuWwI7xsIgWnTeSDIcXhAeQ/D7E7X8Hwd0fjE2Vezz/sGlFG2zPl61cbqBlABO
 +27MBu8Eq+hd9IuC068AO6JICyayOOoyKF71JtLHhFqPX2EDgNTrfatZEM6+tRsr
 sfnxNZOlPQJjdifEUYajejh+MTLqD5tbnMmlNv/CJMApYzkW5GPnIV9d5Ctndtum
 vVlRAkxHYLTCu9qyVgU3IaUWP62O2wVwuYINt1XA5pelOCZaa821y6PEPablYMo0
 7yNuQyIxqzAU5F1ZFySNSmW6IvSTksgen+0iUDsCR+0YBWI+teii39bDbwnwzlHB
 s0wgcepy4QItkAHtUQ0L5pCbLzQ0dKWFNW/NkIusfa0AKhN2jzcBgvYzPNomrglN
 yV+r9pCDUK27C7Bmmjf0Uv7tZrwkjaYnfcpE4gzYPPSEqG1AClTQ+S1WWmzXeWYX
 MTxT2ScO
 =j4Pi
 -----END PGP SIGNATURE-----

Merge tag 'v2025.01-rc6' into next

Prepare v2025.01-rc6
2024-12-31 08:08:59 -06:00
Prasanth Babu Mantena
e7713a7882 dma: ti: k3-udma: Fix BCDMA probe by adding check for MMR_RFLOW
RFLOW config related MMR does not exist incase of BCDMA.
Add check to bypass the RFLOW MMR extraction.
Without this, the probe sequence fails checking for
the MMR_RFLOW region, which is valid only for packet based
DMA and obselete for BCDMA.

Fixes: 5abb694d60 ("dma: ti: k3-udma: Add support for native configuration of chan/flow")
Signed-off-by: Prasanth Babu Mantena <p-mantena@ti.com>
Tested-by: Jonathan Humphreys <j-humphreys@ti.com>
2024-12-31 07:53:17 -06:00
Tom Rini
ad09ccf7fe Merge patch series "Misc. PowerPC MPC83xx fixes/cleanups"
J. Neuschäfer <j.ne@posteo.net> says:

This patchset contains a few small fixes/cleanups for the MPC83xx
platform.

Link: https://lore.kernel.org/r/20241220-mpc83xx-misc-v2-0-ff4c17ee5fa4@posteo.net
2024-12-30 15:55:33 -06:00
J. Neuschäfer
8803745428 gpio: mpc8xxx: Preserve pre-init state of outputs
The mpc8xxx_gpio driver contains a workaround for certain chips
where the previously written state of outputs cannot be read back
from the GPIO data (GPDAT) register (MPC8572/MPC8536). This workaround
consists of tracking the state of GPDAT in a "shadow register" (i.e. a
software variable). The shadow register is initialized to zero.

This results in a problem w.r.t. outputs that are configured to a
high (1) state before U-Boot runs, but not touched by U-Boot itself:
Due to the zero-initialization, these GPIOs end up being set to zero,
the first time that any other output is set.

To avoid such issues initialize the GPDAT shadow register to the value
previously held by any outputs, if possible. On MPC8572/MPC8536 this
should make no difference, i.e. the shadow register should be
initialized to zero on these chips.

This patch has been tested on a MPC8314E-based board.

Reviewed-by: Sinan Akman <sinan@writeme.com>
Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
2024-12-30 15:55:27 -06:00
J. Neuschäfer
deb26b6c29 powerpc: mpc83xx: Fix timer value calculation
TBU and TBL are specified as two 32-bit registers that form a 64-bit
value, but the calculation only shifted TBU by 16 bits.

Fix this by actually shifting 32 bits.

Reviewed-by: Sinan Akman <sinan@writeme.com>
Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
2024-12-30 15:55:27 -06:00
Jim Liu
787d389350 gpio: npcm: Add persist feature to sgpio module
Base on GPIO hog to support sgpio persist enable feature.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
2024-12-30 15:55:01 -06:00
Venkatesh Yadav Abbarapu
9bb02f7f45 mtd: spi-nor: Fix the spi_nor_read() when config SPI_STACKED_PARALLEL is enabled
Update the spi_nor_read() function based on the config SPI_FLASH_BAR
and update the length and bank calculation by spliting the memory of
16MB size banks only when the address width is 3byte.
Fix the read issue for 4byte address width by passing the entire
length to the read function.

Fixes: 5d40b3d384 ("mtd: spi-nor: Add parallel and stacked memories support")
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
2024-12-30 08:20:15 -06:00
Marek Vasut
678f7c8f56 net: rswitch: Implement C22 to C45 access
Add support for mapping C22 register access to C45-only PHYs.
This is mainly useful for 'mii info' command, which performs
C22 only access to determine PHY ID and link state and does
not work well with this driver so far.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-12-29 16:55:32 +01:00
Marek Vasut
8bdc76b2c9 net: rswitch: Add PHY C22 access support
Implement C22 PHY access support in addition to C45 PHY access
support which is already present. This is used for PHYs which
do not support C45 access or which are C22 only.

The C22 access can be recognized when devad is set to -1 or
0xffffffff hex, which also matches MDIO_DEVAD_NONE macro. Test
for this special devad value and if it is set this way, perform
C22 access, otherwise perform C45 access.

Based on work by LUU HOAI <hoai.luu.ub@renesas.com>

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-12-29 16:55:32 +01:00
Marek Vasut
c3f0977ee6 net: rswitch: Fold MPSM C45 setting into rswitch_mii_access_c45()
The Set Station Management Mode : Clause 45 setting of MFF bit in MPSM
register can be done in rswitch_mii_access_c45() once, instead of this
being done before each rswitch_mii_access_c45() call. Deduplicate the
bit setting into rswitch_mii_access_c45(). No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-12-29 16:55:32 +01:00
Marek Vasut
b35ebf4fee net: rswitch: Simplify code using clrsetbits_le32()
Use clrsetbits_le32() to make this complicated construct simpler.
No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-12-29 16:55:32 +01:00
Marek Vasut
da5d84ebc5 net: rswitch: Fix up macro indent
Update the macro indent, replace multiple spaces with tabs proper.
No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-12-29 16:55:32 +01:00
Marek Vasut
58fe39b624 net: rswitch: Replace enum rswitch_reg with plain macros
Replace enum rswitch_reg with plain #define REGISTER OFFSET macros.
The enum rswitch_reg was not referenced anywhere, so there was no
benefit of keeping it around. Include register block labels. Turn
all register offsets into lowercase hex values. No functional change.

Rename EATDQDC to EATDQDCR, GWTRC to GWTRCR, GWDCC to GWDCCR, FWPC0
to FWPC, FWPBFC to FWPBFCR, FWPBFCSDC to FWPBFCSDCR because there
are both register names which used to be part of this enum and also
macros with the same name, each used for slightly different purpose.
Make sure there is no collission.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-12-29 16:55:32 +01:00
Marek Vasut
5769328fab remoteproc: renesas: Add Renesas R-Car Gen4 remote processor driver
Add R-Car Gen4 APMU controller remoteproc driver capable of starting
the Cortex-R52 cores in Renesas R8A779G0 V4H/V4M SoC. The APMU IP is
in fact a power management unit capable of additional operations, but
those are not used by U-Boot so far.

This requires slight adjustment to the SPL entry point code, as that
is being executed on the Cortex-R52 #0 and the Cortex-R52 #0 enters an
endless loop once it starts the rest of the SPL on Cortex-A76 core.
The endless loop now checks for content of APMU CRBARP registers and
tests whether valid VLD_BARP and BAREN_VALID bits are set, if so, the
Cortex-R52 core exits the endless loop and jumps to address started
in CRBARP[31:18] register in ARM mode, which is a trampoline code to
jump to the final entry point.

The trampoline code is in place to avoid limitation of CRBARP[31:18]
address field, which limits the core start address to memory addresses
aligned to 0x40000 or 256 kiB . The trampoline is placed at 0x40000
aligned address and jumps to the final entry point, which can be at
an address with arbitrary alignment at instruction granularity.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-12-29 16:55:31 +01:00
Marek Vasut
7366aacf8e ram: renesas: Add Renesas R-Car Gen4 DBSC5 driver
Add Renesas R-Car Gen4 DBSC5 DRAM controller driver. This driver is currently
capable of bringing LPDDR5 DRAM on Renesas R-Car V4H Whitehawk board. Further
boards can be supported by supplying board specific DRAM configuration data
via dbsc5_get_board_data(). Support for R-Car V4M is not implemented, however
the driver is already mostly prepared to support this SoC.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-12-29 16:55:31 +01:00