]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: kirkwood: pogo_v4: Add Distro boot capability
authorTony Dinh <mibodhi@gmail.com>
Tue, 9 Aug 2022 03:01:34 +0000 (20:01 -0700)
committerStefan Roese <sr@denx.de>
Tue, 23 Aug 2022 08:48:59 +0000 (10:48 +0200)
- Add distro boot to board include file and deconfig file
- Miscellaneous changes:
- Add CONFIG_SUPPORT_PASSING_ATAGS and friends to support legacy
kernel method of booting (e.g. OpenWrt) with appended DTB.
- Add CONFIG_LTO and CONFIG_UBIFS_SILENCE_MSG, and disable some
unused configs to reduce binary size.

Note that this patch is depended on the following patch:
https://patchwork.ozlabs.org/project/uboot/patch/20220807192709.21717-1-pali@kernel.org/

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
configs/pogo_v4_defconfig
include/configs/pogo_v4.h

index c62c88f1b5ac3b83af7978906302642d37cd28fb..748842100e0ad054abf98e7343ae7a375b40fbb2 100644 (file)
@@ -4,6 +4,9 @@ CONFIG_SYS_DCACHE_OFF=y
 CONFIG_ARCH_CPU_INIT=y
 CONFIG_SYS_THUMB_BUILD=y
 CONFIG_ARCH_KIRKWOOD=y
+CONFIG_SUPPORT_PASSING_ATAGS=y
+CONFIG_CMDLINE_TAG=y
+CONFIG_INITRD_TAG=y
 CONFIG_SYS_KWD_CONFIG="board/cloudengines/pogo_v4/kwbimage.cfg"
 CONFIG_SYS_TEXT_BASE=0x600000
 CONFIG_SYS_MALLOC_F_LEN=0x400
@@ -13,23 +16,24 @@ CONFIG_ENV_OFFSET=0xC0000
 CONFIG_DEFAULT_DEVICE_TREE="kirkwood-pogoplug-series-4"
 CONFIG_IDENT_STRING="\nPogoplug V4"
 CONFIG_SYS_LOAD_ADDR=0x800000
+CONFIG_LTO=y
+CONFIG_DISTRO_DEFAULTS=y
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc8012000
 CONFIG_BOOTSTAGE=y
 CONFIG_SHOW_BOOT_PROGRESS=y
 CONFIG_BOOTDELAY=10
-CONFIG_USE_BOOTCOMMAND=y
-CONFIG_BOOTCOMMAND="setenv bootargs ${bootargs_console}; run bootcmd_usb; bootm 0x00800000 0x01100000 0x2c00000"
 CONFIG_USE_PREBOOT=y
 CONFIG_BOARD_LATE_INIT=y
-CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Pogo_V4> "
 CONFIG_SYS_MAXARGS=32
 CONFIG_SYS_PBSIZE=1050
-CONFIG_CMD_BOOTZ=y
 # CONFIG_BOOTM_PLAN9 is not set
 # CONFIG_BOOTM_RTEMS is not set
 # CONFIG_BOOTM_VXWORKS is not set
+# CONFIG_CMD_ELF is not set
+# CONFIG_CMD_IMI is not set
+# CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_MTD=y
@@ -37,22 +41,14 @@ CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_SATA=y
 CONFIG_CMD_USB=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_MII=y
-CONFIG_CMD_PING=y
 CONFIG_CMD_SNTP=y
 CONFIG_CMD_DNS=y
-CONFIG_CMD_EXT2=y
-CONFIG_CMD_EXT4=y
-CONFIG_CMD_FAT=y
-CONFIG_CMD_FS_GENERIC=y
+# CONFIG_CMD_BLOCK_CACHE is not set
 CONFIG_CMD_JFFS2=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_MTDIDS_DEFAULT="nand0=orion_nand"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)"
 CONFIG_CMD_UBI=y
-CONFIG_ISO_PARTITION=y
-CONFIG_EFI_PARTITION=y
 CONFIG_PARTITION_TYPE_GUID=y
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
@@ -62,6 +58,7 @@ CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_NETCONSOLE=y
 CONFIG_SYS_FAULT_ECHO_LINK_DOWN=y
 CONFIG_DM=y
+# CONFIG_DM_WARN is not set
 CONFIG_SATA_MV=y
 CONFIG_SYS_SATA_MAX_DEVICE=1
 CONFIG_LBA48=y
@@ -84,6 +81,6 @@ CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_PCI=y
 CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_STORAGE=y
 CONFIG_JFFS2_LZO=y
 CONFIG_JFFS2_NAND=y
+CONFIG_UBIFS_SILENCE_MSG=y
index 7fff78b7b5d68a4d8f1158c1f173596a6ddfa0d0..b5ce2dd13d08d93674bf78476bb7c3622c42bf52 100644 (file)
  */
 #include "mv-common.h"
 
-/*
- * Default environment variables
- */
+/* Include the common distro boot environment */
+#ifndef CONFIG_SPL_BUILD
+
+#ifdef CONFIG_MMC
+#define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
+#else
+#define BOOT_TARGET_DEVICES_MMC(func)
+#endif
+
+#ifdef CONFIG_SATA
+#define BOOT_TARGET_DEVICES_SATA(func) func(SATA, sata, 0)
+#else
+#define BOOT_TARGET_DEVICES_SATA(func)
+#endif
+
+#ifdef CONFIG_USB_STORAGE
+#define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0)
+#else
+#define BOOT_TARGET_DEVICES_USB(func)
+#endif
+
+#define BOOT_TARGET_DEVICES(func) \
+       BOOT_TARGET_DEVICES_MMC(func) \
+       BOOT_TARGET_DEVICES_USB(func) \
+       BOOT_TARGET_DEVICES_SATA(func) \
+       func(DHCP, dhcp, na)
+
+#define KERNEL_ADDR_R  __stringify(0x800000)
+#define FDT_ADDR_R     __stringify(0x2c00000)
+#define RAMDISK_ADDR_R __stringify(0x01100000)
+#define SCRIPT_ADDR_R  __stringify(0x200000)
+
+#define LOAD_ADDRESS_ENV_SETTINGS \
+       "kernel_addr_r=" KERNEL_ADDR_R "\0" \
+       "fdt_addr_r=" FDT_ADDR_R "\0" \
+       "ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \
+       "scriptaddr=" SCRIPT_ADDR_R "\0"
+
+#include <config_distro_bootcmd.h>
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
-       "dtb_file=/boot/dts/" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
-       "bootargs_console=console=ttyS0,115200\0" \
-       "bootcmd_usb=usb start; load usb 0:1 0x00800000 /boot/uImage; " \
-       "load usb 0:1 0x01100000 /boot/uInitrd; " \
-       "load usb 0:1 0x2c00000 $dtb_file\0"
+       LOAD_ADDRESS_ENV_SETTINGS \
+       "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
+       "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
+       "console=ttyS0,115200\0" \
+       BOOTENV
+#endif /* CONFIG_SPL_BUILD */
 
 /*
  * Ethernet Driver configuration