[PATCH 3/3] am335x: Enable SPL_OF_CONTROL

Tom Rini trini at konsulko.com
Sat Sep 11 14:57:33 CEST 2021


It has long been known that we need to enable SPL_OF_CONTROL on this
platform, as some included drivers do not function correctly without it,
but were also stuck due to size constraints.  Resolve this problem by:

- Updating the generic board.c file to use CONFIG_IS_ENABLED(USB_ETHER)
  to distinguish between SPL and full U-Boot.
- Disable SPL_ETH support as the CPSW driver (and related PHY/etc) are
  were we need SPL_OF_CONTROL support, but cannot due to size constraints.
- Update the documentation on how to enable this mode and recommend what
  to remove in order to fit within size constraints.

Cc: Simon Glass <sjg at chromium.org>
Signed-off-by: Tom Rini <trini at konsulko.com>
---
 arch/arm/mach-omap2/am33xx/board.c |  2 +-
 configs/am335x_evm_defconfig       |  2 +-
 doc/board/ti/am335x_evm.rst        | 10 ++++++++++
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c
index d390f2e1f3e8..db268b1381e7 100644
--- a/arch/arm/mach-omap2/am33xx/board.c
+++ b/arch/arm/mach-omap2/am33xx/board.c
@@ -338,7 +338,7 @@ int arch_misc_init(void)
 	if (ret || !dev)
 		return ret;
 
-#if defined(CONFIG_DM_ETH) && defined(CONFIG_USB_ETHER)
+#if defined(CONFIG_DM_ETH) && CONFIG_IS_ENABLED(USB_ETHER)
 	ret = usb_ether_init();
 	if (ret) {
 		pr_err("USB ether init failed\n");
diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
index ef8de5999e0d..d497ca8d96ba 100644
--- a/configs/am335x_evm_defconfig
+++ b/configs/am335x_evm_defconfig
@@ -14,7 +14,6 @@ CONFIG_LOGLEVEL=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL_FIT_IMAGE_TINY=y
-CONFIG_SPL_ETH=y
 # CONFIG_SPL_FS_EXT4 is not set
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_MUSB_NEW=y
@@ -37,6 +36,7 @@ CONFIG_MTDIDS_DEFAULT="nand0=nand.0"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),1m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.file-system)"
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_LIST="am335x-evm am335x-bone am335x-sancloud-bbe am335x-boneblack am335x-evmsk am335x-bonegreen am335x-icev2 am335x-pocketbeagle"
 CONFIG_ENV_OVERWRITE=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
diff --git a/doc/board/ti/am335x_evm.rst b/doc/board/ti/am335x_evm.rst
index a90f32da7aea..55315e0ad79b 100644
--- a/doc/board/ti/am335x_evm.rst
+++ b/doc/board/ti/am335x_evm.rst
@@ -86,6 +86,16 @@ Step-2: Flashing NAND via MMC/SD
 Step-3: Set BOOTSEL pin to select NAND boot, and POR the device.
 	The device should boot from images flashed on NAND device.
 
+Ethernet Boot
+-------------
+
+The AM335x SoC supports booting from CPSW ethernet.  This feature is not
+enabled in U-Boot by default.  In order to support this ``CONFIG_SPL_ETH``
+needs to be enabled and in order to have U-Boot fit within size constraints you
+will need to disable some other functionality.  Disabling
+``CONFIG_SPL_USB_GADGET`` and ``CONFIG_SPL_MUSB_NEW`` is recommended as this is
+used to provide SPL support via USB networking instead, which is unlikely to be
+used in the same design.
 
 Falcon Mode
 -----------
-- 
2.17.1



More information about the U-Boot mailing list