mvebu: select boot device at SoC level
authorBaruch Siach <baruch@tkos.co.il>
Mon, 18 Jun 2018 18:56:25 +0000 (21:56 +0300)
committerStefan Roese <sr@denx.de>
Mon, 6 Aug 2018 12:07:23 +0000 (14:07 +0200)
Move the gdsys Controlcenter DC specific build time kwbimage.cfg
generation code into the mach-mvebu/ directory to be shared by all 32bit
mvebu platforms.

Remove board specific kwbimage.cfg files, and use the generated one
instead. These files are all identical, with two exceptions. Clearfog
and Helios4 use the sdio boot device, whereas all others use spi. Update
the defconfigs for the exceptional boards to generate the same
kwbimage.cfg as before.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Stefan Roese <sr@denx.de>
19 files changed:
arch/arm/mach-mvebu/.gitignore [new file with mode: 0644]
arch/arm/mach-mvebu/Makefile
arch/arm/mach-mvebu/include/mach/config.h
arch/arm/mach-mvebu/kwbimage.cfg.in [new file with mode: 0644]
board/CZ.NIC/turris_omnia/kwbimage.cfg [deleted file]
board/Marvell/db-88f6720/kwbimage.cfg [deleted file]
board/Marvell/db-88f6820-amc/kwbimage.cfg [deleted file]
board/Marvell/db-88f6820-gp/kwbimage.cfg [deleted file]
board/Marvell/db-mv784mp-gp/kwbimage.cfg [deleted file]
board/Synology/ds414/kwbimage.cfg [deleted file]
board/gdsys/a38x/.gitignore [deleted file]
board/gdsys/a38x/Makefile
board/gdsys/a38x/kwbimage.cfg.in [deleted file]
board/kobol/helios4/kwbimage.cfg [deleted file]
board/maxbcm/kwbimage.cfg [deleted file]
board/solidrun/clearfog/kwbimage.cfg [deleted file]
board/theadorable/kwbimage.cfg [deleted file]
configs/clearfog_defconfig
configs/helios4_defconfig

diff --git a/arch/arm/mach-mvebu/.gitignore b/arch/arm/mach-mvebu/.gitignore
new file mode 100644 (file)
index 0000000..775b934
--- /dev/null
@@ -0,0 +1 @@
+kwbimage.cfg
index ade7b870646f9cc8bbbde70fe4c7ff8e2875b587..d907fac3752d449028316c74f72fd17dff99849c 100644 (file)
@@ -25,6 +25,36 @@ obj-$(CONFIG_ARMADA_375) += ../../../drivers/ddr/marvell/axp/xor.o
 obj-$(CONFIG_ARMADA_38X) += ../../../drivers/ddr/marvell/a38x/xor.o
 obj-$(CONFIG_ARMADA_XP) += ../../../drivers/ddr/marvell/axp/xor.o
 obj-$(CONFIG_MVEBU_EFUSE) += efuse.o
+
+extra-y += kwbimage.cfg
+
+KWB_REPLACE += BOOT_FROM
+ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI),)
+       KWB_CFG_BOOT_FROM=spi
+endif
+ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC),)
+       KWB_CFG_BOOT_FROM=sdio
+endif
+
+ifneq ($(CONFIG_SECURED_MODE_IMAGE),)
+KWB_REPLACE += CSK_INDEX
+KWB_CFG_CSK_INDEX = $(CONFIG_SECURED_MODE_CSK_INDEX)
+
+KWB_REPLACE += SEC_BOOT_DEV
+KWB_CFG_SEC_BOOT_DEV=$(patsubst "%",%, \
+       $(if $(findstring BOOT_SPI_NOR_FLASH,$(CONFIG_SPL_BOOT_DEVICE)),0x34) \
+       $(if $(findstring BOOT_SDIO_MMC_CARD,$(CONFIG_SPL_BOOT_DEVICE)),0x31) \
+       )
+
+KWB_REPLACE += SEC_FUSE_DUMP
+KWB_CFG_SEC_FUSE_DUMP = a38x
+endif
+
+$(src)/kwbimage.cfg: $(src)/kwbimage.cfg.in include/autoconf.mk \
+               include/config/auto.conf
+       $(Q)sed -ne '$(foreach V,$(KWB_REPLACE),s/^#@$(V)/$(V) $(KWB_CFG_$(V))/;)p' \
+       <$< >$(dir $<)$(@F)
+
 endif # CONFIG_SPL_BUILD
 obj-y  += gpio.o
 obj-y  += mbus.o
index 2acfd3314a68374826b10421e7d5496fa218d970..9f51411e43f1597efbc87986c5658df73213dce7 100644 (file)
 #endif
 
 /*
- * By default kwbimage.cfg from board specific folder is used
+ * By default the generated mvebu kwbimage.cfg is used
  * If for some board, different configuration file need to be used,
  * CONFIG_SYS_KWD_CONFIG should be defined in board specific header file
  */
 #ifndef CONFIG_SYS_KWD_CONFIG
-#define        CONFIG_SYS_KWD_CONFIG   $(CONFIG_BOARDDIR)/kwbimage.cfg
+#define        CONFIG_SYS_KWD_CONFIG   arch/arm/mach-mvebu/kwbimage.cfg
 #endif /* CONFIG_SYS_KWD_CONFIG */
 
 /* Add target to build it automatically upon "make" */
diff --git a/arch/arm/mach-mvebu/kwbimage.cfg.in b/arch/arm/mach-mvebu/kwbimage.cfg.in
new file mode 100644 (file)
index 0000000..72e67d7
--- /dev/null
@@ -0,0 +1,12 @@
+#
+# Copyright (C) 2014 Stefan Roese <sr@denx.de>
+#
+
+# Armada 38x uses version 1 image format
+VERSION                1
+
+# Boot Media configurations
+#@BOOT_FROM
+
+# Binary Header (bin_hdr) with DDR3 training code
+BINARY spl/u-boot-spl.bin 0000005b 00000068
diff --git a/board/CZ.NIC/turris_omnia/kwbimage.cfg b/board/CZ.NIC/turris_omnia/kwbimage.cfg
deleted file mode 100644 (file)
index 1f748db..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Copyright (C) 2014 Stefan Roese <sr@denx.de>
-#
-
-# Armada XP uses version 1 image format
-VERSION                1
-
-# Boot Media configurations
-BOOT_FROM      spi
-
-# Binary Header (bin_hdr) with DDR3 training code
-BINARY spl/u-boot-spl-dtb.bin 0000005b 00000068
diff --git a/board/Marvell/db-88f6720/kwbimage.cfg b/board/Marvell/db-88f6720/kwbimage.cfg
deleted file mode 100644 (file)
index 1f748db..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Copyright (C) 2014 Stefan Roese <sr@denx.de>
-#
-
-# Armada XP uses version 1 image format
-VERSION                1
-
-# Boot Media configurations
-BOOT_FROM      spi
-
-# Binary Header (bin_hdr) with DDR3 training code
-BINARY spl/u-boot-spl-dtb.bin 0000005b 00000068
diff --git a/board/Marvell/db-88f6820-amc/kwbimage.cfg b/board/Marvell/db-88f6820-amc/kwbimage.cfg
deleted file mode 100644 (file)
index 1f748db..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Copyright (C) 2014 Stefan Roese <sr@denx.de>
-#
-
-# Armada XP uses version 1 image format
-VERSION                1
-
-# Boot Media configurations
-BOOT_FROM      spi
-
-# Binary Header (bin_hdr) with DDR3 training code
-BINARY spl/u-boot-spl-dtb.bin 0000005b 00000068
diff --git a/board/Marvell/db-88f6820-gp/kwbimage.cfg b/board/Marvell/db-88f6820-gp/kwbimage.cfg
deleted file mode 100644 (file)
index 1f748db..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Copyright (C) 2014 Stefan Roese <sr@denx.de>
-#
-
-# Armada XP uses version 1 image format
-VERSION                1
-
-# Boot Media configurations
-BOOT_FROM      spi
-
-# Binary Header (bin_hdr) with DDR3 training code
-BINARY spl/u-boot-spl-dtb.bin 0000005b 00000068
diff --git a/board/Marvell/db-mv784mp-gp/kwbimage.cfg b/board/Marvell/db-mv784mp-gp/kwbimage.cfg
deleted file mode 100644 (file)
index 1f748db..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Copyright (C) 2014 Stefan Roese <sr@denx.de>
-#
-
-# Armada XP uses version 1 image format
-VERSION                1
-
-# Boot Media configurations
-BOOT_FROM      spi
-
-# Binary Header (bin_hdr) with DDR3 training code
-BINARY spl/u-boot-spl-dtb.bin 0000005b 00000068
diff --git a/board/Synology/ds414/kwbimage.cfg b/board/Synology/ds414/kwbimage.cfg
deleted file mode 100644 (file)
index 1f748db..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Copyright (C) 2014 Stefan Roese <sr@denx.de>
-#
-
-# Armada XP uses version 1 image format
-VERSION                1
-
-# Boot Media configurations
-BOOT_FROM      spi
-
-# Binary Header (bin_hdr) with DDR3 training code
-BINARY spl/u-boot-spl-dtb.bin 0000005b 00000068
diff --git a/board/gdsys/a38x/.gitignore b/board/gdsys/a38x/.gitignore
deleted file mode 100644 (file)
index 775b934..0000000
+++ /dev/null
@@ -1 +0,0 @@
-kwbimage.cfg
index 18ecbe5e79799451df462993a2742fde77a11d71..32fffab467beaee4098c0d9269f0c96d3622ac9a 100644 (file)
@@ -7,36 +7,5 @@
 obj-$(CONFIG_TARGET_CONTROLCENTERDC) += controlcenterdc.o hre.o spl.o keyprogram.o dt_helpers.o
 
 ifeq ($(CONFIG_SPL_BUILD),)
-
 obj-$(CONFIG_TARGET_CONTROLCENTERDC) += hydra.o ihs_phys.o
-
-extra-$(CONFIG_TARGET_CONTROLCENTERDC) += kwbimage.cfg
-
-KWB_REPLACE += BOOT_FROM
-ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI),)
-       KWB_CFG_BOOT_FROM=spi
-endif
-ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC),)
-       KWB_CFG_BOOT_FROM=sdio
-endif
-
-ifneq ($(CONFIG_SECURED_MODE_IMAGE),)
-KWB_REPLACE += CSK_INDEX
-KWB_CFG_CSK_INDEX = $(CONFIG_SECURED_MODE_CSK_INDEX)
-
-KWB_REPLACE += SEC_BOOT_DEV
-KWB_CFG_SEC_BOOT_DEV=$(patsubst "%",%, \
-       $(if $(findstring BOOT_SPI_NOR_FLASH,$(CONFIG_SPL_BOOT_DEVICE)),0x34) \
-       $(if $(findstring BOOT_SDIO_MMC_CARD,$(CONFIG_SPL_BOOT_DEVICE)),0x31) \
-       )
-
-KWB_REPLACE += SEC_FUSE_DUMP
-KWB_CFG_SEC_FUSE_DUMP = a38x
-endif
-
-$(src)/kwbimage.cfg: $(src)/kwbimage.cfg.in include/autoconf.mk \
-               include/config/auto.conf
-       $(Q)sed -ne '$(foreach V,$(KWB_REPLACE),s/^#@$(V)/$(V) $(KWB_CFG_$(V))/;)p' \
-       <$< >$(dir $<)$(@F)
-
 endif
diff --git a/board/gdsys/a38x/kwbimage.cfg.in b/board/gdsys/a38x/kwbimage.cfg.in
deleted file mode 100644 (file)
index 72e67d7..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Copyright (C) 2014 Stefan Roese <sr@denx.de>
-#
-
-# Armada 38x uses version 1 image format
-VERSION                1
-
-# Boot Media configurations
-#@BOOT_FROM
-
-# Binary Header (bin_hdr) with DDR3 training code
-BINARY spl/u-boot-spl.bin 0000005b 00000068
diff --git a/board/kobol/helios4/kwbimage.cfg b/board/kobol/helios4/kwbimage.cfg
deleted file mode 100644 (file)
index 035063b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0+
-#
-# Copyright (C) 2015 Stefan Roese <sr@denx.de>
-#
-
-# Armada 38x use version 1 image format
-VERSION                1
-
-# Boot Media configurations
-BOOT_FROM      sdio
-
-# Binary Header (bin_hdr) with DDR3 training code
-BINARY spl/u-boot-spl-dtb.bin 0000005b 00000068
diff --git a/board/maxbcm/kwbimage.cfg b/board/maxbcm/kwbimage.cfg
deleted file mode 100644 (file)
index 1f748db..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Copyright (C) 2014 Stefan Roese <sr@denx.de>
-#
-
-# Armada XP uses version 1 image format
-VERSION                1
-
-# Boot Media configurations
-BOOT_FROM      spi
-
-# Binary Header (bin_hdr) with DDR3 training code
-BINARY spl/u-boot-spl-dtb.bin 0000005b 00000068
diff --git a/board/solidrun/clearfog/kwbimage.cfg b/board/solidrun/clearfog/kwbimage.cfg
deleted file mode 100644 (file)
index f41d25a..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Copyright (C) 2015 Stefan Roese <sr@denx.de>
-#
-
-# Armada 38x use version 1 image format
-VERSION                1
-
-# Boot Media configurations
-BOOT_FROM      sdio
-
-# Binary Header (bin_hdr) with DDR3 training code
-BINARY spl/u-boot-spl-dtb.bin 0000005b 00000068
diff --git a/board/theadorable/kwbimage.cfg b/board/theadorable/kwbimage.cfg
deleted file mode 100644 (file)
index 4f3b7b2..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Copyright (C) 2015-2016 Stefan Roese <sr@denx.de>
-#
-
-# Armada XP uses version 1 image format
-VERSION                1
-
-# Boot Media configurations
-BOOT_FROM      spi
-
-# Binary Header (bin_hdr) with DDR3 training code
-BINARY spl/u-boot-spl-dtb.bin 0000005b 00000068
index 7a9ee510171b0ac53b283b3aec0feaccc89b727c..2164e20a3f0810ebcce567b3b02ff7a765dacd79 100644 (file)
@@ -6,12 +6,12 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_CLEARFOG=y
+CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BASE=0xd0012000
 CONFIG_DEBUG_UART_CLOCK=250000000
-CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_DEFAULT_DEVICE_TREE="armada-388-clearfog"
 CONFIG_DEBUG_UART=y
 CONFIG_DISTRO_DEFAULTS=y
index 441b3752d1ab5cce31d470ae9d1f514dfc2b2483..f1eddaff5daf17807b2b7317e3bff9403f4a56c5 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_HELIOS4=y
+CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y