]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
ls2080ardb: Convert to distro boot
authorAlexander Graf <agraf@suse.de>
Thu, 17 Nov 2016 00:03:02 +0000 (01:03 +0100)
committerAlexander Graf <agraf@suse.de>
Thu, 17 Nov 2016 13:18:56 +0000 (14:18 +0100)
Most new systems in U-Boot these days make use of the generic "distro"
framework which allows a user to have U-Boot scan for a bootable OS
on all available media types.

This patch extends the LS2080ARDB board to use that framework if the
hard coded NOR flash location does not contain a bootable image.

Signed-off-by: Alexander Graf <agraf@suse.de>
Kconfig
include/configs/ls2080ardb.h

diff --git a/Kconfig b/Kconfig
index 1263d0b612dd0668e0264d08b6cdef70bcb97853..f3a9f73dd0f3fbff3a7335e68f98259afed8bb61 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -56,6 +56,7 @@ config CC_OPTIMIZE_FOR_SIZE
 config DISTRO_DEFAULTS
        bool "Select defaults suitable for booting general purpose Linux distributions"
        default y if ARCH_SUNXI
+       default y if ARCH_LS2080A
        default n
        select CMD_BOOTZ if ARM && !ARM64
        select CMD_BOOTI if ARM64
index b9cb6d38795f39890f53cdfdf1ddea46bb6eeecb..32fa0eb3ee383f285f0837b33f262e8fe1b4a4fd 100644 (file)
@@ -316,10 +316,25 @@ unsigned long get_board_sys_clk(void);
 #define CONFIG_USB_MAX_CONTROLLER_COUNT         2
 #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS      2
 
+#undef CONFIG_CMDLINE_EDITING
+#include <config_distro_defaults.h>
+
+#define BOOT_TARGET_DEVICES(func) \
+       func(USB, usb, 0) \
+       func(MMC, mmc, 0) \
+       func(SCSI, scsi, 0) \
+       func(DHCP, dhcp, na)
+#include <config_distro_bootcmd.h>
+
 /* Initial environment variables */
 #undef CONFIG_EXTRA_ENV_SETTINGS
 #define CONFIG_EXTRA_ENV_SETTINGS              \
        "hwconfig=fsl_ddr:bank_intlv=auto\0"    \
+       "scriptaddr=0x80800000\0"               \
+       "kernel_addr_r=0x81000000\0"            \
+       "pxefile_addr_r=0x81000000\0"           \
+       "fdt_addr_r=0x88000000\0"               \
+       "ramdisk_addr_r=0x89000000\0"           \
        "loadaddr=0x80100000\0"                 \
        "kernel_addr=0x100000\0"                \
        "ramdisk_addr=0x800000\0"               \
@@ -329,8 +344,10 @@ unsigned long get_board_sys_clk(void);
        "kernel_start=0x581100000\0"            \
        "kernel_load=0xa0000000\0"              \
        "kernel_size=0x2800000\0"               \
+       "fdtfile=fsl-ls2080a-rdb.dtb\0"         \
        "mcinitcmd=fsl_mc start mc 0x580300000" \
-       " 0x580800000 \0"
+       " 0x580800000 \0"                       \
+       BOOTENV
 
 #undef CONFIG_BOOTARGS
 #define CONFIG_BOOTARGS                "console=ttyS1,115200 root=/dev/ram0 " \
@@ -338,6 +355,13 @@ unsigned long get_board_sys_clk(void);
                                "ramdisk_size=0x2000000 default_hugepagesz=2m" \
                                " hugepagesz=2m hugepages=256"
 
+#undef CONFIG_BOOTCOMMAND
+/* Try to boot an on-NOR kernel first, then do normal distro boot */
+#define CONFIG_BOOTCOMMAND "run mcinitcmd && fsl_mc lazyapply dpl 0x580700000" \
+                          " && cp.b $kernel_start $kernel_load $kernel_size" \
+                          " && bootm $kernel_load" \
+                          " || run distro_bootcmd"
+
 /* MAC/PHY configuration */
 #ifdef CONFIG_FSL_MC_ENET
 #define CONFIG_PHYLIB_10G