platform/kernel/u-boot.git
15 months agomisc: ub251xb: Fix use of CONFIG_IS_ENABLED on DM_REGULATOR
Marek Vasut [Tue, 28 Feb 2023 01:55:18 +0000 (02:55 +0100)]
misc: ub251xb: Fix use of CONFIG_IS_ENABLED on DM_REGULATOR

The DM_REGULATOR symbol has SPL counterpart in:
  drivers/power/regulator/Kconfig:config SPL_DM_REGULATOR
Use CONFIG_IS_ENABLED() macro to match on the correct
variant depending on the build stage.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agoMerge branch 'master_net/phy/prep-cleanup' of https://source.denx.de/u-boot/custodian...
Tom Rini [Fri, 7 Apr 2023 14:51:49 +0000 (10:51 -0400)]
Merge branch 'master_net/phy/prep-cleanup' of https://source.denx.de/u-boot/custodians/u-boot-sh

- PHY framework cleanups

15 months agoMerge branch '2023-04-06-assorted-updates'
Tom Rini [Fri, 7 Apr 2023 14:44:19 +0000 (10:44 -0400)]
Merge branch '2023-04-06-assorted-updates'

- Make use of the semi-formal "fallthrough" mechanism, update env tools
  to use /run for lockfile, add 2048 game (as a way to test console
  changes), update some CONFIG option logic in Kconfig, have lmb command
  show regions in use, remove some duplicate serial code, add
  __gnu_thumb1_case_si code and fix m68k custodian email address.

15 months agophy: Add .set_mode and .set_speed callbacks
Marek Vasut [Sun, 19 Mar 2023 17:09:42 +0000 (18:09 +0100)]
phy: Add .set_mode and .set_speed callbacks

Add two new callbacks matching the Linux ones. The .set_mode is used to set
PHY mode and submode, where mode is either USB, Ethernet, and so on, while
submode is e.g. for Ethernet case RGMII, RMII, and so on. The .set_speed is
used to configure link speed into the PHY. Unlike the existing configure
callback, which is used to pass arbitrary custom information to the PHY,
these two callbacks are used to pass standardized set of information to
the PHY.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
15 months agophy: Fix kerneldoc alignment
Marek Vasut [Sun, 19 Mar 2023 17:09:41 +0000 (18:09 +0100)]
phy: Fix kerneldoc alignment

Insert missing space in front of asterisk to avoid checkpatch warning.
Replace 'beeing' with 'being' as well, to fix another checkpatch warning.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
15 months agophy: Add empty generic_phy_configure() implementation for PHY disabled case
Marek Vasut [Sun, 19 Mar 2023 17:09:40 +0000 (18:09 +0100)]
phy: Add empty generic_phy_configure() implementation for PHY disabled case

In case PHY is not enabled, the generic_phy_configure() implementation is
missing. Add an empty one so that the list of empty functions is complete.

Fixes: f8da8a82c57 ("generic-phy: add configure op")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
15 months agonet: phy: marvell10g: Adapt Marvell 10G PHY driver from Linux
Marek Vasut [Sun, 19 Mar 2023 17:08:10 +0000 (18:08 +0100)]
net: phy: marvell10g: Adapt Marvell 10G PHY driver from Linux

Pull Marvell 10G PHY driver from Linux 6.1.y as of commit
d6d29292640d3 ("net: phy: marvell10g: select host interface configuration")
and heavily adapt to match U-Boot PHY framework. Support for
hwmon is removed as is much other functionality which could
not be tested, this results in much simpler driver which can
only bring the PHY up and set MAC type.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
15 months agonet: phy: Add MDIO PCS 2.5G and 5G speed macros from Linux
Marek Vasut [Sun, 19 Mar 2023 17:08:09 +0000 (18:08 +0100)]
net: phy: Add MDIO PCS 2.5G and 5G speed macros from Linux

Add MDIO PCS 2.5G and 5G speed macros from Linux 5.1.y as of commit
7fd8afa8933a0 ("net: phy: Add generic support for 2.5GBaseT and 5GBaseT")
This is used by the upcoming Marvell 10G PHY driver.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
15 months agonet: phy: Add phy_read_mmd_poll_timeout() from Linux
Marek Vasut [Sun, 19 Mar 2023 17:08:08 +0000 (18:08 +0100)]
net: phy: Add phy_read_mmd_poll_timeout() from Linux

Add phy_read_mmd_poll_timeout() from Linux 5.7.y as of commit
bd971ff0b7392 ("net: phy: introduce phy_read_mmd_poll_timeout macro")
This is used by the upcoming Marvell 10G PHY driver.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
15 months agonet: phy: Add phy_modify_mmd() and phy_modify_mmd_changed() from Linux
Marek Vasut [Sun, 19 Mar 2023 17:08:07 +0000 (18:08 +0100)]
net: phy: Add phy_modify_mmd() and phy_modify_mmd_changed() from Linux

Add phy_modify_mmd()/phy_modify_mmd_changed() from Linux 5.1.y as of commit
b8554d4f7288f ("net: phy: add register modifying helpers returning 1 on change")
This is used by the upcoming Marvell 10G PHY driver.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
15 months agonet: phy: marvell: Import and use marvell_phy.h from Linux
Marek Vasut [Sun, 19 Mar 2023 17:08:06 +0000 (18:08 +0100)]
net: phy: marvell: Import and use marvell_phy.h from Linux

Import marvell_phy.h from Linux 5.14.y as of commit
a5de4be0aaaa6 ("net: phy: marvell10g: fix differentiation of 88X3310 from 88X3340")
and use it in marvell PHY driver instead of current ad-hoc macros.
Two of the PHY IDs are unknown to Linux, 88E1149S and 88E1680, for
those two, only sync the length of the hexadecimal number to 8 digits.

No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
15 months agonet: phy: Synchronize PHY interface modes with Linux
Marek Vasut [Tue, 21 Mar 2023 17:25:54 +0000 (18:25 +0100)]
net: phy: Synchronize PHY interface modes with Linux

Synchronize PHY interface modes with Linux next 6.2.y commit:
0194b64578e90 ("net: phy: improve phy_read_poll_timeout")

Retain LX2160A/LX2162A PHY modes as those are not yet supported
by the Linux kernel, but isolate those with ifdeffery.

Isolate NCSI which are also not supported by Linux kernel. Note
that the ifdeffery cannot be avoided with IS_ENABLED() here due
to compilation of the entire conditional, which would fail in
case NCSI symbols are not available.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
15 months agonet: mvpp2: Replace PHY_INTERFACE_MODE_SFI with 5GBASER/10GBASER/XAUI
Marek Vasut [Tue, 21 Mar 2023 17:25:53 +0000 (18:25 +0100)]
net: mvpp2: Replace PHY_INTERFACE_MODE_SFI with 5GBASER/10GBASER/XAUI

Replace PHY_INTERFACE_MODE_SFI with PHY_INTERFACE_MODE_5GBASER,
PHY_INTERFACE_MODE_10GBASER and PHY_INTERFACE_MODE_XAUI to match
Linux PHY interface modes.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
15 months agonet: mvpp2: Drop PHY_INTERFACE_MODE_SGMII_2500 support
Marek Vasut [Tue, 21 Mar 2023 17:25:52 +0000 (18:25 +0100)]
net: mvpp2: Drop PHY_INTERFACE_MODE_SGMII_2500 support

This mode does not seem to be well defined and used anywhere, remove support for it.
Based on discussion:
- 1000baseX does c37 AN of duplex+pause
- SGMII does AN of duplex+pause+speed, at lower speed bytes are repeated 10x/100x
- 2500baseX does not do AN, or does very different c73 AN
- SGMII 2500 behavior is unclear

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
15 months agonet: phy: Only call phy_init() on systems needing manual relocation
Marek Vasut [Sun, 19 Mar 2023 17:03:17 +0000 (18:03 +0100)]
net: phy: Only call phy_init() on systems needing manual relocation

The phy_init() is now used only to perform manual relocation of PHY
driver callbacks. Wrap it in ifdeffery and only call it on systems
which still require manual relocation, i.e. m68k .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: Re-inline phy_drv_reloc()
Marek Vasut [Sun, 19 Mar 2023 17:03:16 +0000 (18:03 +0100)]
net: phy: Re-inline phy_drv_reloc()

Wrap phy_drv_reloc() back into phy_init() to reduce ifdeffery,
since phy_drv_reloc() is now called only from one call site.
No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: Drop unused phy_register()
Marek Vasut [Sun, 19 Mar 2023 17:03:15 +0000 (18:03 +0100)]
net: phy: Drop unused phy_register()

This function is no longer used, drop it.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: Drop static phy_drivers list
Marek Vasut [Sun, 19 Mar 2023 17:03:14 +0000 (18:03 +0100)]
net: phy: Drop static phy_drivers list

The static phy_drivers list is superseded by linker list of struct phy_drivers
now that all drivers have been converted to the later. Drop the phy_drivers
list as well as list_head from struct phy_driver.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: gen10g: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:03:13 +0000 (18:03 +0100)]
net: phy: gen10g: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: genphy: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:03:12 +0000 (18:03 +0100)]
net: phy: genphy: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: xilinx-gmii2rgmii: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:03:11 +0000 (18:03 +0100)]
net: phy: xilinx-gmii2rgmii: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: ncsi: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:03:10 +0000 (18:03 +0100)]
net: phy: ncsi: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: fixed: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:03:09 +0000 (18:03 +0100)]
net: phy: fixed: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: mscc: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:03:08 +0000 (18:03 +0100)]
net: phy: mscc: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: intel-xway: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:03:07 +0000 (18:03 +0100)]
net: phy: intel-xway: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: xilinx: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:03:06 +0000 (18:03 +0100)]
net: phy: xilinx: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: vitesse: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:03:05 +0000 (18:03 +0100)]
net: phy: vitesse: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: ti: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:03:04 +0000 (18:03 +0100)]
net: phy: ti: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

This particular PHY driver is slightly more spread out across additional
source files. Since the phy_register() calls are no longer necessary, all
the registration calls across those source files is dropped. Furthermore,
the Makefile can now be updated to only compile generic TI PHY support if
matching Kconfig symbol is enabled and the ifdeffery in the generic TI PHY
driver can be dropped.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: teranetics: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:03:03 +0000 (18:03 +0100)]
net: phy: teranetics: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: smsc: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:03:02 +0000 (18:03 +0100)]
net: phy: smsc: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: realtek: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:03:01 +0000 (18:03 +0100)]
net: phy: realtek: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: nxp-tja11xx: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:03:00 +0000 (18:03 +0100)]
net: phy: nxp-tja11xx: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: nxp-c45-tja11xx: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:02:59 +0000 (18:02 +0100)]
net: phy: nxp-c45-tja11xx: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: natsemi: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:02:58 +0000 (18:02 +0100)]
net: phy: natsemi: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: meson-gxl: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:02:57 +0000 (18:02 +0100)]
net: phy: meson-gxl: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: ksz90x1: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:02:56 +0000 (18:02 +0100)]
net: phy: ksz90x1: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: ksz8xxx: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:02:55 +0000 (18:02 +0100)]
net: phy: ksz8xxx: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: marvell: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:02:54 +0000 (18:02 +0100)]
net: phy: marvell: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: lxt: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:02:53 +0000 (18:02 +0100)]
net: phy: lxt: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: et1011c: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:02:52 +0000 (18:02 +0100)]
net: phy: et1011c: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: mv88e61xx: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:02:51 +0000 (18:02 +0100)]
net: phy: mv88e61xx: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: davicom: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:02:50 +0000 (18:02 +0100)]
net: phy: davicom: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: cortina: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:02:49 +0000 (18:02 +0100)]
net: phy: cortina: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: ca_phy: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:02:48 +0000 (18:02 +0100)]
net: phy: ca_phy: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: broadcom: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:02:47 +0000 (18:02 +0100)]
net: phy: broadcom: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: b53: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:02:46 +0000 (18:02 +0100)]
net: phy: b53: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: atheros: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:02:45 +0000 (18:02 +0100)]
net: phy: atheros: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: aquantia: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:02:44 +0000 (18:02 +0100)]
net: phy: aquantia: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: adin: Convert to U_BOOT_PHY_DRIVER()
Marek Vasut [Sun, 19 Mar 2023 17:02:43 +0000 (18:02 +0100)]
net: phy: adin: Convert to U_BOOT_PHY_DRIVER()

Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: Iterate over both registered PHYs and struct phy_driver linker list
Marek Vasut [Sun, 19 Mar 2023 17:02:42 +0000 (18:02 +0100)]
net: phy: Iterate over both registered PHYs and struct phy_driver linker list

Introduce U_BOOT_PHY_DRIVER() macro which is used to add struct phy_driver
into a new linker list section containing all compiled in struct phy_driver
drivers. This is so far empty until PHY drivers are converted over to this
macro.

Iterate over both drivers registered using soon to be legacy phy_register()
as well as drivers in the new linker list when looking up a suitable PHY
driver. This way, PHY drivers can be converted over to the new macro one
driver at a time.

The relocation of callbacks for linker list based drivers now happens in
phy_init() call as the drivers are available at that point in time, and
phy_register() is not called for those drivers.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: Factor manual relocation into separate function
Marek Vasut [Sun, 19 Mar 2023 17:02:41 +0000 (18:02 +0100)]
net: phy: Factor manual relocation into separate function

Create separate function to implement manual relocation of PHY driver
functions and make use of that function. This is a preparatory patch
for introduction of PHY driver definition using linker lists.

No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: teranetics: Staticize PHY driver entries
Marek Vasut [Sun, 19 Mar 2023 17:02:40 +0000 (18:02 +0100)]
net: phy: teranetics: Staticize PHY driver entries

These struct phy_driver ... instances are local to this source code
file, staticize them. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: cortina: Staticize PHY driver entries
Marek Vasut [Sun, 19 Mar 2023 17:02:39 +0000 (18:02 +0100)]
net: phy: cortina: Staticize PHY driver entries

These struct phy_driver ... instances are local to this source code
file, staticize them. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: ca_phy: Staticize PHY driver entries
Marek Vasut [Sun, 19 Mar 2023 17:02:38 +0000 (18:02 +0100)]
net: phy: ca_phy: Staticize PHY driver entries

These struct phy_driver ... instances are local to this source code
file, staticize them. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
15 months agonet: phy: aquantia: Staticize PHY driver entries
Marek Vasut [Sun, 19 Mar 2023 17:02:37 +0000 (18:02 +0100)]
net: phy: aquantia: Staticize PHY driver entries

These struct phy_driver ... instances are local to this source code
file, staticize them. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
15 months agocmd: Add 2048 game
Simon Glass [Tue, 7 Feb 2023 21:33:53 +0000 (14:33 -0700)]
cmd: Add 2048 game

Add the 2048 game, a good demo of ANSI sequences and a way to waste a
little time.

Bring it it from Barebox, modified for code style.

Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agoserial-uclass: drop redundant code in serial_check_stdout()
Rasmus Villemoes [Wed, 29 Mar 2023 07:57:51 +0000 (09:57 +0200)]
serial-uclass: drop redundant code in serial_check_stdout()

As the updated comment says, this is already handled by
fdt_path_offset_namelen() itself.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
15 months agocmd: CONFIG_CMD_SCSI depends on CONFIG_SCSI
Heinrich Schuchardt [Sun, 26 Mar 2023 17:10:38 +0000 (19:10 +0200)]
cmd: CONFIG_CMD_SCSI depends on CONFIG_SCSI

Compiling with CONFIG_CMD_SCSI=y, CONFIG_SCSI results in

    cmd/scsi.c:46: undefined reference to `scsi_scan'

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agoata: don't use SYS_SCSI_MAX_SCSI_ID for SATA
Heinrich Schuchardt [Sun, 26 Mar 2023 16:58:26 +0000 (18:58 +0200)]
ata: don't use SYS_SCSI_MAX_SCSI_ID for SATA

CONFIG_SYS_SCSI_MAX_SCSI_ID is not defined if CONFIG_SCSI=n.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agoata: fix requirements for CONFIG_AHCI_PCI
Heinrich Schuchardt [Sun, 26 Mar 2023 16:58:25 +0000 (18:58 +0200)]
ata: fix requirements for CONFIG_AHCI_PCI

Building with CONFIG_AHCI_PCI=y and CONFIG_SCSI_AHCI=n leads to

    drivers/ata/ahci-pci.o: in function `ahci_pci_probe':
    drivers/ata/ahci-pci.c:21: undefined reference to `ahci_probe_scsi_pci'

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agospi: Kconfig: add dependency on CONFIG_MPC85xx for FSL_ESPI entry
Corentin Guillevic [Fri, 24 Mar 2023 09:54:19 +0000 (10:54 +0100)]
spi: Kconfig: add dependency on CONFIG_MPC85xx for FSL_ESPI entry

The Freescale ESPI driver (CONFIG_FSL_ESPI) relies to the MPC85xx platform
(PowerPC) through arch/powerpc/include/asm/immap_85xx.h. The driver can't
compile on another architecture/platform.

Signed-off-by: Corentin Guillevic <corentin.guillevic@smile.fr>
15 months agodoc: arch: m68k: fix maintainer email
Angelo Dureghello [Tue, 4 Apr 2023 23:19:03 +0000 (01:19 +0200)]
doc: arch: m68k: fix maintainer email

Fix email with currently used address.

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
15 months agoarm: lib: add __gnu_thumb1_case_si
Francis Laniel [Sat, 1 Apr 2023 21:54:39 +0000 (22:54 +0100)]
arm: lib: add __gnu_thumb1_case_si

The assembly for __gnu_thumb1_case_si was taken from upstream gcc and adapted
as width suffix was removed for the add instruction [1].

Signed-off-by: Francis Laniel <francis.laniel@amarulasolutions.com>
Tested-by: Tony Dinh <mibodhi@gmail.com>
[1] https://github.com/gcc-mirror/gcc/blob/4f181f9c7ee3efc509d185fdfda33be9018f1611/libgcc/config/arm/lib1funcs.S#L2156
Acked-by: Pali Rohár <pali@kernel.org>
Acked-by: Tony Dinh <mibodhi@gmail.com>
15 months agocmd/regulator: missing fallthrough in do_dev()
Heinrich Schuchardt [Sat, 1 Apr 2023 08:07:30 +0000 (10:07 +0200)]
cmd/regulator: missing fallthrough in do_dev()

Add missing fallthrough macro.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agocmd: missing fallthrough macro in do_pci()
Heinrich Schuchardt [Sat, 1 Apr 2023 07:43:33 +0000 (09:43 +0200)]
cmd: missing fallthrough macro in do_pci()

Add a missing fallthrough macro to avoid a -Wimplicit-fallthrough warning.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agocmd: convert fallthrough comment.
Heinrich Schuchardt [Sat, 1 Apr 2023 07:14:11 +0000 (09:14 +0200)]
cmd: convert fallthrough comment.

gcc does not understand /* FALL TROUGH */ and emits a warning:

    cmd/date.c: In function â€˜do_date’:
    cmd/date.c:62:20: warning:
    this statement may fall through [-Wimplicit-fallthrough=]
       62 |                 if (strcmp(argv[1],"reset") == 0) {
          |                    ^
    cmd/date.c:102:9: note: here
      102 |         case 1:                 /* get date & time */
          |         ^~~~

Use the fallthrough macro instead.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agolib: missing fallthrough comment in vsnprintf_internal()
Heinrich Schuchardt [Sat, 1 Apr 2023 06:13:42 +0000 (08:13 +0200)]
lib: missing fallthrough comment in vsnprintf_internal()

When a case statement intentionally falls through we should add a comment.
Cf. -Wimplicit-fallthrough

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
15 months agotools: avoid implicit fallthrough in fdt_add_pubkey
Heinrich Schuchardt [Sat, 1 Apr 2023 06:09:34 +0000 (08:09 +0200)]
tools: avoid implicit fallthrough in fdt_add_pubkey

When building with -Wimplicit-fallthrough we get a warning

    tools/fdt_add_pubkey.c:52:25: warning:
    this statement may fall through [-Wimplicit-fallthrough=]
       52 |                         print_help();
          |

Explicitly declare which functions don't return.

Fixes: 30238e99619c ("tools: add fdt_add_pubkey")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agotools: env: use /run to store lockfile
Tim Lee [Fri, 10 Feb 2023 09:05:39 +0000 (17:05 +0800)]
tools: env: use /run to store lockfile

According this issue https://github.com/ppp-project/ppp/issues/339.
Eventually, the dt-utils changed lock directory to fix missing /var/lock
directory error then make dt-utils can run normally.

We also have a similar issue with these two utilities fw_printenv and
fw_setenv will failed when the directory /var/lock is non-existent.

We have a custom linux distribution built with yocto (OpenBMC) that
use systemd and it deprecated the /var/lock directory.
More discussion in systemd/systemd#15668.

Thus, we sync with community's solution for uboot/tools/env utilities:
The current location /var/lock is considered legacy (at least by systemd).
Just use /run to store the lockfile and append the usual .lock suffix.

Tested:
Verified /run/lock is now present and fw_printenv can work in OpenBMC.

Signed-off-by: Tim Lee <timlee660101@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agolmb: add max number of region in lmb_dump_region() output
Patrick Delaunay [Wed, 22 Mar 2023 18:12:26 +0000 (19:12 +0100)]
lmb: add max number of region in lmb_dump_region() output

Add the max number of region in lmb dump; this patch allows to
check the limit for usage of the LMB regions, memory or reserved.

Result on STM32MP157C-DK2:

STM32MP> bdinfo
.....
lmb_dump_all:
 memory.cnt = 0x1 / max = 0x2
 memory[0] [0xc0000000-0xdfffffff], 0x20000000 bytes flags: 0
 reserved.cnt = 0x6 / max = 0x10
 reserved[0] [0x10000000-0x10045fff], 0x00046000 bytes flags: 4
 reserved[1] [0x30000000-0x3003ffff], 0x00040000 bytes flags: 4
 reserved[2] [0x38000000-0x3800ffff], 0x00010000 bytes flags: 4
 reserved[3] [0xd4000000-0xd7ffffff], 0x04000000 bytes flags: 4
 reserved[4] [0xdcae5000-0xdfffffff], 0x0351b000 bytes flags: 0
 reserved[5] [0xddafb5b8-0xdfffffff], 0x02504a48 bytes flags: 0
....

Reported-by: Mark Millard <marklmi@yahoo.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
15 months agolmb: Fix LMB_MEMORY_REGIONS flag usage
Patrick Delaunay [Wed, 22 Mar 2023 18:12:25 +0000 (19:12 +0100)]
lmb: Fix LMB_MEMORY_REGIONS flag usage

Remove test on CONFIG_LMB_MEMORY_REGIONS introduced by commit
7c1860fce4e3 ("lmb: Fix lmb property's defination under struct lmb").

This code in lmb_init() is strange, because if CONFIG_LMB_USE_MAX_REGIONS
and CONFIG_LMB_MEMORY_REGIONS are not defined, the implicit #else is empty
and the required initialization is not done:
lmb->memory.max = ?
lmb->reserved.max = ?

But this setting is not possible:
- CONFIG_LMB_USE_MAX_REGIONS not defined
- CONFIG_LMB_MEMORY_REGIONS not defined
because CONFIG_LMB_MEMORY_REGIONS and CONFIG_LMB_RESERVED_REGIONS are
defined as soon as the CONFIG_LMB_USE_MAX_REGIONS is not defined.

This patch removes this impossible case #elif and I add some
explanation in lmb.h to explain why in the struct lmb {} the lmb
property is defined if CONFIG_LMB_MEMORY_REGIONS is NOT defined.

This patch also removes CONFIG_LMB_XXX dependency on CONFIG_LMB as these
defines are used in API file lmb.h and not only in library file.

Fixes: 5e2548c1d6e03 ("lmb: Fix LMB_MEMORY_REGIONS flag usage")
Reported-by: Mark Millard <marklmi@yahoo.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Acked-by: Michal Simek <michal.simek@amd.com>
15 months agoMerge tag 'fsl-qoriq-2023-4-6' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Thu, 6 Apr 2023 02:19:57 +0000 (22:19 -0400)]
Merge tag 'fsl-qoriq-2023-4-6' of https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq

convert NXP LS1028A RDB and QDS to DM_SERIAL
enable DM_SERIAL for ls1088a
sync serial nodes with linux for lx2160a/ls1088a

15 months agoMerge branch '2023-04-05-blkmap-composable-virtual-block-devices'
Tom Rini [Wed, 5 Apr 2023 22:59:47 +0000 (18:59 -0400)]
Merge branch '2023-04-05-blkmap-composable-virtual-block-devices'

To quote the author:
Block maps are a way of looking at various sources of data through the
lens of a regular block device. It lets you treat devices that are not
block devices, like RAM, as if they were. It also lets you export a
slice of an existing block device, which does not have to correspond to
a partition boundary, as a new block device.

This is primarily useful because U-Boot's filesystem drivers only
operate on block devices, so a block map lets you access filesystems
wherever they might be located.

The implementation is loosely modeled on Linux's "Device Mapper"
subsystem, see the kernel documentation [1] for more information.

The primary use-cases are to access filesystem images stored in RAM, and
within FIT images stored on disk. See doc/usage/blkmap.rst for more
details.

The architecture is pluggable, so adding other types of mappings should
be quite easy.

[1]: https://docs.kernel.org/admin-guide/device-mapper/index.html

15 months agoefi_loader: device_path: support blkmap devices
Tobias Waldekranz [Thu, 16 Feb 2023 15:33:55 +0000 (16:33 +0100)]
efi_loader: device_path: support blkmap devices

Create a distinct EFI device path for each blkmap device.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agodoc: blkmap: Add introduction and examples
Tobias Waldekranz [Thu, 16 Feb 2023 15:33:54 +0000 (16:33 +0100)]
doc: blkmap: Add introduction and examples

Explain block maps by going through two common use-cases.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agotest: blkmap: Add test suite
Tobias Waldekranz [Thu, 16 Feb 2023 15:33:53 +0000 (16:33 +0100)]
test: blkmap: Add test suite

Verify that:

- Block maps can be created and destroyed
- Mappings aren't allowed to overlap
- Multiple mappings can be attached and be read/written from/to

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agocmd: blkmap: Add blkmap command
Tobias Waldekranz [Thu, 16 Feb 2023 15:33:52 +0000 (16:33 +0100)]
cmd: blkmap: Add blkmap command

Add a frontend for the blkmap subsystem. In addition to the common
block device operations, this allows users to create and destroy
devices, and map in memory and slices of other block devices.

With that we support two primary use-cases:

- Being able to "distro boot" from a RAM disk. I.e., from an image
  where the kernel is stored in /boot of some filesystem supported
  by U-Boot.

- Accessing filesystems not located on exact partition boundaries,
  e.g. when a filesystem image is wrapped in an FIT image and stored
  in a disk partition.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agoblk: blkmap: Add linear device mapping support
Tobias Waldekranz [Thu, 16 Feb 2023 15:33:51 +0000 (16:33 +0100)]
blk: blkmap: Add linear device mapping support

Allow a slice of an existing block device to be mapped to a
blkmap. This means that filesystems that are not stored at exact
partition boundaries can be accessed by remapping a slice of the
existing device to a blkmap device.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agoblk: blkmap: Add memory mapping support
Tobias Waldekranz [Thu, 16 Feb 2023 15:33:50 +0000 (16:33 +0100)]
blk: blkmap: Add memory mapping support

Allow a slice of RAM to be mapped to a blkmap. This means that RAM can
now be accessed as if it was a block device, meaning that existing
filesystem drivers can now be used to access ramdisks.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agoblk: blkmap: Add basic infrastructure
Tobias Waldekranz [Thu, 16 Feb 2023 15:33:49 +0000 (16:33 +0100)]
blk: blkmap: Add basic infrastructure

blkmaps are loosely modeled on Linux's device mapper subsystem. The
basic idea is that you can create virtual block devices whose blocks
can be backed by a plethora of sources that are user configurable.

This change just adds the basic infrastructure for creating and
removing blkmap devices. Subsequent changes will extend this to add
support for actual mappings.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agocmd: blk: Allow generic read/write operations to work in sandbox
Tobias Waldekranz [Thu, 16 Feb 2023 15:33:48 +0000 (16:33 +0100)]
cmd: blk: Allow generic read/write operations to work in sandbox

Ensure that the memory destination/source addresses of block
read/write operations are mapped in before access. Currently, this is
only needed on sandbox builds.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agoimage: Fix script execution from FIT images with external data
Tobias Waldekranz [Thu, 16 Feb 2023 15:33:47 +0000 (16:33 +0100)]
image: Fix script execution from FIT images with external data

Update the script loading code to recognize when script data is stored
externally from the FIT metadata (i.e., built with `mkimage -E`).

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agoMerge branch '2023-04-04-android-image-v3-v4-support'
Tom Rini [Wed, 5 Apr 2023 14:40:05 +0000 (10:40 -0400)]
Merge branch '2023-04-04-android-image-v3-v4-support'

To quote the author:
* This is based on Roman Stratiienko's work to support boot image header version 3 and 4.

* This supports the new boot image headers v3, v4 and bootconfig feature.
https://source.android.com/docs/core/architecture/bootloader/boot-image-header
https://source.android.com/docs/core/architecture/bootloader/implementing-bootconfig

- Tested on Amlogic Khadas vim3l, a reference board for Android Open Source Project
  https://www.khadas.com/vim3l

  And on AM625 Texas Instruments board with 5.10 linux kernel

Main changes :
- New partition : vendor boot, with a specific vendor ramdisk
- DTB is stored in the vendor boot partition
- The generic ramdisk is placed after the vendor ramdisk
- Bootconfig feature support

Here is a link to see the related android boot flow changes on KHADAS vim3l as an example:
https://gitlab.baylibre.com/baylibre/amlogic/atv/u-boot/-/commits/souajih/BootImagev4/

15 months agoDockerfile: add mkbootimg tool
Safae Ouajih [Sun, 5 Feb 2023 23:50:21 +0000 (00:50 +0100)]
Dockerfile: add mkbootimg tool

mkbootimg tool is part of the Android project and it is
used to pack Android boot images such as boot image
and vendor_boot image.

Use the following command to run mkbootimg:
$ python3 -m mkbootimg

Add mkbootimg to the docker file

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agotest/py: android: extend abootimg test
Safae Ouajih [Sun, 5 Feb 2023 23:50:20 +0000 (00:50 +0100)]
test/py: android: extend abootimg test

test_abootimg is extended to include the testing of boot images
version 4. For this, boot.img and vendor_boot.img have been
generated using mkbootimg tool with setting the header
version to 4.

This tests:
- Getting the header version using abootimg
- Extracting the load address of the dtb
- Extracting the dtb start address in RAM

Running test:
$ ./test/py/test.py --bd sandbox --build -k test_abootimg

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agodoc: android: add documentation for v3, v4 boot image header
Safae Ouajih [Sun, 5 Feb 2023 23:50:19 +0000 (00:50 +0100)]
doc: android: add documentation for v3, v4 boot image header

Update the Android documentation to describe version 3 and 4 of boot
image header.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: support bootconfig
Safae Ouajih [Sun, 5 Feb 2023 23:50:18 +0000 (00:50 +0100)]
android: boot: support bootconfig

Support Bootconfig feature.
- The bootconfig feature replaces the androidboot.*
  kernel cmdline options.

This was adapted from downstream [1] commit : 7af0a0506d4d ("cuttlefish:
support bootconfig parameters").

Link:[1] https://android.googlesource.com/platform/external/u-boot/

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: support boot image header version 3 and 4
Safae Ouajih [Sun, 5 Feb 2023 23:50:17 +0000 (00:50 +0100)]
android: boot: support boot image header version 3 and 4

Enable the support for boot image header version 3 and 4
using abootimg command.

In order to use version 3 or 4:

1- Vendor boot image address should be given to abootimg cmd.

abootimg addr $1 $vendor_boot_load_addr

2- "ramdisk_addr_r" env variable (ramdisk address) should be set to host
the ramdisk : generic ramdisk + vendor ramdisk

Replace "struct andr_boot_img_hdr_v0*" by "void *" in
some functions since v3 and v4 are now supported as well.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agodrivers: fastboot: zImage flashing is not supported for v3, v4
Safae Ouajih [Sun, 5 Feb 2023 23:50:16 +0000 (00:50 +0100)]
drivers: fastboot: zImage flashing is not supported for v3, v4

With vendor boot image introduced in version 3 and 4 of boot
image header, boot information is located in both boot image
and vendor boot image.

Flashing zImage is not supported for version 3 and 4 since this
requires updating vendor boot image and/or generating a new image.

Print an error message when the boot image header version is
greater than 2.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: update android_image_get_dtb_img_addr to support v3, v4
Safae Ouajih [Sun, 5 Feb 2023 23:50:15 +0000 (00:50 +0100)]
android: boot: update android_image_get_dtb_img_addr to support v3, v4

Add support for boot image version 3 and 4 in
android_image_get_dtb_img_addr().
Since the dtb is now included in vendor_boot image
instead of boot image, extract the dtb address from
vendor_boot image when a v3 or v4 is used.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: support extra command line
Safae Ouajih [Sun, 5 Feb 2023 23:50:14 +0000 (00:50 +0100)]
android: boot: support extra command line

In version 3 and 4 of boot image header, the vendor specific
command line are located in vendor boot image. Thus, use
extra command line to add those cmd to bootargs.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: ramdisk: support vendor ramdisk
Safae Ouajih [Sun, 5 Feb 2023 23:50:13 +0000 (00:50 +0100)]
android: boot: ramdisk: support vendor ramdisk

Version 3 and 4 of boot image header introduced
vendor boot ramdisk: Please check include/android_image.h
for details.

The ramdisk is now split into a generic ramdisk in boot image
and a vendor ramdisk in vendor boot image.

Support the new vendor ramdisk.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: update android_image_get_data to support v3, v4
Safae Ouajih [Sun, 5 Feb 2023 23:50:12 +0000 (00:50 +0100)]
android: boot: update android_image_get_data to support v3, v4

Since boot image header version 3 and 4 introduced vendor boot image,
use the following functions to fill the generic android
structure : andr_image_data:

 - android_boot_image_v3_v4_parse_hdr()
 - android_vendor_boot_image_v3_v4_parse_hdr()

Update android_image_get_data() to support v3 and v4

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: add vendor boot image to prepare for v3, v4 support
Safae Ouajih [Sun, 5 Feb 2023 23:50:11 +0000 (00:50 +0100)]
android: boot: add vendor boot image to prepare for v3, v4 support

Introduce vendor boot image for version 3 and 4 of boot image header.
The vendor boot image will hold extra information about kernel, dtb
and ramdisk.

This is done to prepare for boot image version 3 and 4 support.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: boot image header v3, v4 do not support recovery DTBO
Safae Ouajih [Sun, 5 Feb 2023 23:50:10 +0000 (00:50 +0100)]
android: boot: boot image header v3, v4 do not support recovery DTBO

android_image_get_dtbo() is used to get recovery DTBO via abootimg cmd.
This is not supported in boot image header v3 and v4. Thus, print an
error message when v1,v2 header version are not used.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: content print is not supported for v3, v4 header version
Safae Ouajih [Sun, 5 Feb 2023 23:50:09 +0000 (00:50 +0100)]
android: boot: content print is not supported for v3, v4 header version

Content print is not supported for version 3 and 4 of boot image header.
Thus, only print that content when v2 is used.

Update android_print_contents() to print an error message
when trying to print boot image header version 3 or 4 content.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: move to andr_image_data structure
Safae Ouajih [Sun, 5 Feb 2023 23:50:08 +0000 (00:50 +0100)]
android: boot: move to andr_image_data structure

Move from andr_boot_img_hdr_v0 to andr_image_data
structure to prepare for boot image header
version 3 and 4.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: kcomp: support andr_image_data
Safae Ouajih [Sun, 5 Feb 2023 23:50:07 +0000 (00:50 +0100)]
android: boot: kcomp: support andr_image_data

andr_image_data structure is used as a global representation of
boot image header structure. Introduce this new structure to
support all boot header versions : v0,v1.v2.v3.v4 and to support
v3 and v4 while maitaining support for v0,v1,v2.
The need of using andr_image_data comes from the change of header
structure in both version 3 and 4.

Rework android_image_get_kcomp()  to support this new struct.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: add boot image header v3 and v4 structures
Safae Ouajih [Sun, 5 Feb 2023 23:50:06 +0000 (00:50 +0100)]
android: boot: add boot image header v3 and v4 structures

Add support for v3/v4 boot image format by adding
the following structures:

- andr_boot_img_hdr_v3 : describes boot image header
- andr_vnd_boot_img_hdr : describes vendor boot image header

These definitions have been copied over from the AOSP documentation at
[1] and [2]

Boot arg sizes are taken from [3]:
commit: 35fb6262bc3f (ANDROID: Support for vendor boot)

This also adds documentation for boot image header v3/v4 structure
that was imported from [4], file: include/bootimg/bootimg.h
commit: 8d0922bfb932 (Adding GKI signature in boot.img v4)

Link:[1] https://source.android.com/docs/core/architecture/bootloader/boot-image-header
Link:[2] https://source.android.com/docs/core/architecture/bootloader/partitions/vendor-boot-partitions#vendor-boot-header
Link:[3] https://android.googlesource.com/platform/external/u-boot
Link:[4] https://android.googlesource.com/platform/system/tools/mkbootimg

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: replace android_image_check_header
Safae Ouajih [Sun, 5 Feb 2023 23:50:05 +0000 (00:50 +0100)]
android: boot: replace android_image_check_header

With the new vendor boot image introduced in versions 3 and 4
of boot image header, the header check must be done for both boot
image and vendor boot image. Thus, replace android_image_check_header()
by is_android_boot_image_header() to only refer to boot image header check.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>