Commit ca1a4c863232ddc6bc2463569dedfefe992ff418

Authored by Baruch Siach
Committed by Stefan Roese
1 parent ad105f5f86

mvebu: select boot device at SoC level

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>

Showing 19 changed files with 47 additions and 168 deletions Side-by-side Diff

arch/arm/mach-mvebu/.gitignore
  1 +kwbimage.cfg
arch/arm/mach-mvebu/Makefile
... ... @@ -25,6 +25,36 @@
25 25 obj-$(CONFIG_ARMADA_38X) += ../../../drivers/ddr/marvell/a38x/xor.o
26 26 obj-$(CONFIG_ARMADA_XP) += ../../../drivers/ddr/marvell/axp/xor.o
27 27 obj-$(CONFIG_MVEBU_EFUSE) += efuse.o
  28 +
  29 +extra-y += kwbimage.cfg
  30 +
  31 +KWB_REPLACE += BOOT_FROM
  32 +ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI),)
  33 + KWB_CFG_BOOT_FROM=spi
  34 +endif
  35 +ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC),)
  36 + KWB_CFG_BOOT_FROM=sdio
  37 +endif
  38 +
  39 +ifneq ($(CONFIG_SECURED_MODE_IMAGE),)
  40 +KWB_REPLACE += CSK_INDEX
  41 +KWB_CFG_CSK_INDEX = $(CONFIG_SECURED_MODE_CSK_INDEX)
  42 +
  43 +KWB_REPLACE += SEC_BOOT_DEV
  44 +KWB_CFG_SEC_BOOT_DEV=$(patsubst "%",%, \
  45 + $(if $(findstring BOOT_SPI_NOR_FLASH,$(CONFIG_SPL_BOOT_DEVICE)),0x34) \
  46 + $(if $(findstring BOOT_SDIO_MMC_CARD,$(CONFIG_SPL_BOOT_DEVICE)),0x31) \
  47 + )
  48 +
  49 +KWB_REPLACE += SEC_FUSE_DUMP
  50 +KWB_CFG_SEC_FUSE_DUMP = a38x
  51 +endif
  52 +
  53 +$(src)/kwbimage.cfg: $(src)/kwbimage.cfg.in include/autoconf.mk \
  54 + include/config/auto.conf
  55 + $(Q)sed -ne '$(foreach V,$(KWB_REPLACE),s/^#@$(V)/$(V) $(KWB_CFG_$(V))/;)p' \
  56 + <$< >$(dir $<)$(@F)
  57 +
28 58 endif # CONFIG_SPL_BUILD
29 59 obj-y += gpio.o
30 60 obj-y += mbus.o
arch/arm/mach-mvebu/include/mach/config.h
... ... @@ -32,12 +32,12 @@
32 32 #endif
33 33  
34 34 /*
35   - * By default kwbimage.cfg from board specific folder is used
  35 + * By default the generated mvebu kwbimage.cfg is used
36 36 * If for some board, different configuration file need to be used,
37 37 * CONFIG_SYS_KWD_CONFIG should be defined in board specific header file
38 38 */
39 39 #ifndef CONFIG_SYS_KWD_CONFIG
40   -#define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage.cfg
  40 +#define CONFIG_SYS_KWD_CONFIG arch/arm/mach-mvebu/kwbimage.cfg
41 41 #endif /* CONFIG_SYS_KWD_CONFIG */
42 42  
43 43 /* Add target to build it automatically upon "make" */
arch/arm/mach-mvebu/kwbimage.cfg.in
  1 +#
  2 +# Copyright (C) 2014 Stefan Roese <sr@denx.de>
  3 +#
  4 +
  5 +# Armada 38x uses version 1 image format
  6 +VERSION 1
  7 +
  8 +# Boot Media configurations
  9 +#@BOOT_FROM
  10 +
  11 +# Binary Header (bin_hdr) with DDR3 training code
  12 +BINARY spl/u-boot-spl.bin 0000005b 00000068
board/CZ.NIC/turris_omnia/kwbimage.cfg
1   -#
2   -# Copyright (C) 2014 Stefan Roese <sr@denx.de>
3   -#
4   -
5   -# Armada XP uses version 1 image format
6   -VERSION 1
7   -
8   -# Boot Media configurations
9   -BOOT_FROM spi
10   -
11   -# Binary Header (bin_hdr) with DDR3 training code
12   -BINARY spl/u-boot-spl-dtb.bin 0000005b 00000068
board/Marvell/db-88f6720/kwbimage.cfg
1   -#
2   -# Copyright (C) 2014 Stefan Roese <sr@denx.de>
3   -#
4   -
5   -# Armada XP uses version 1 image format
6   -VERSION 1
7   -
8   -# Boot Media configurations
9   -BOOT_FROM spi
10   -
11   -# Binary Header (bin_hdr) with DDR3 training code
12   -BINARY spl/u-boot-spl-dtb.bin 0000005b 00000068
board/Marvell/db-88f6820-amc/kwbimage.cfg
1   -#
2   -# Copyright (C) 2014 Stefan Roese <sr@denx.de>
3   -#
4   -
5   -# Armada XP uses version 1 image format
6   -VERSION 1
7   -
8   -# Boot Media configurations
9   -BOOT_FROM spi
10   -
11   -# Binary Header (bin_hdr) with DDR3 training code
12   -BINARY spl/u-boot-spl-dtb.bin 0000005b 00000068
board/Marvell/db-88f6820-gp/kwbimage.cfg
1   -#
2   -# Copyright (C) 2014 Stefan Roese <sr@denx.de>
3   -#
4   -
5   -# Armada XP uses version 1 image format
6   -VERSION 1
7   -
8   -# Boot Media configurations
9   -BOOT_FROM spi
10   -
11   -# Binary Header (bin_hdr) with DDR3 training code
12   -BINARY spl/u-boot-spl-dtb.bin 0000005b 00000068
board/Marvell/db-mv784mp-gp/kwbimage.cfg
1   -#
2   -# Copyright (C) 2014 Stefan Roese <sr@denx.de>
3   -#
4   -
5   -# Armada XP uses version 1 image format
6   -VERSION 1
7   -
8   -# Boot Media configurations
9   -BOOT_FROM spi
10   -
11   -# Binary Header (bin_hdr) with DDR3 training code
12   -BINARY spl/u-boot-spl-dtb.bin 0000005b 00000068
board/Synology/ds414/kwbimage.cfg
1   -#
2   -# Copyright (C) 2014 Stefan Roese <sr@denx.de>
3   -#
4   -
5   -# Armada XP uses version 1 image format
6   -VERSION 1
7   -
8   -# Boot Media configurations
9   -BOOT_FROM spi
10   -
11   -# Binary Header (bin_hdr) with DDR3 training code
12   -BINARY spl/u-boot-spl-dtb.bin 0000005b 00000068
board/gdsys/a38x/.gitignore
1   -kwbimage.cfg
board/gdsys/a38x/Makefile
... ... @@ -7,37 +7,6 @@
7 7 obj-$(CONFIG_TARGET_CONTROLCENTERDC) += controlcenterdc.o hre.o spl.o keyprogram.o dt_helpers.o
8 8  
9 9 ifeq ($(CONFIG_SPL_BUILD),)
10   -
11 10 obj-$(CONFIG_TARGET_CONTROLCENTERDC) += hydra.o ihs_phys.o
12   -
13   -extra-$(CONFIG_TARGET_CONTROLCENTERDC) += kwbimage.cfg
14   -
15   -KWB_REPLACE += BOOT_FROM
16   -ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI),)
17   - KWB_CFG_BOOT_FROM=spi
18   -endif
19   -ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC),)
20   - KWB_CFG_BOOT_FROM=sdio
21   -endif
22   -
23   -ifneq ($(CONFIG_SECURED_MODE_IMAGE),)
24   -KWB_REPLACE += CSK_INDEX
25   -KWB_CFG_CSK_INDEX = $(CONFIG_SECURED_MODE_CSK_INDEX)
26   -
27   -KWB_REPLACE += SEC_BOOT_DEV
28   -KWB_CFG_SEC_BOOT_DEV=$(patsubst "%",%, \
29   - $(if $(findstring BOOT_SPI_NOR_FLASH,$(CONFIG_SPL_BOOT_DEVICE)),0x34) \
30   - $(if $(findstring BOOT_SDIO_MMC_CARD,$(CONFIG_SPL_BOOT_DEVICE)),0x31) \
31   - )
32   -
33   -KWB_REPLACE += SEC_FUSE_DUMP
34   -KWB_CFG_SEC_FUSE_DUMP = a38x
35   -endif
36   -
37   -$(src)/kwbimage.cfg: $(src)/kwbimage.cfg.in include/autoconf.mk \
38   - include/config/auto.conf
39   - $(Q)sed -ne '$(foreach V,$(KWB_REPLACE),s/^#@$(V)/$(V) $(KWB_CFG_$(V))/;)p' \
40   - <$< >$(dir $<)$(@F)
41   -
42 11 endif
board/gdsys/a38x/kwbimage.cfg.in
1   -#
2   -# Copyright (C) 2014 Stefan Roese <sr@denx.de>
3   -#
4   -
5   -# Armada 38x uses version 1 image format
6   -VERSION 1
7   -
8   -# Boot Media configurations
9   -#@BOOT_FROM
10   -
11   -# Binary Header (bin_hdr) with DDR3 training code
12   -BINARY spl/u-boot-spl.bin 0000005b 00000068
board/kobol/helios4/kwbimage.cfg
1   -# SPDX-License-Identifier: GPL-2.0+
2   -#
3   -# Copyright (C) 2015 Stefan Roese <sr@denx.de>
4   -#
5   -
6   -# Armada 38x use version 1 image format
7   -VERSION 1
8   -
9   -# Boot Media configurations
10   -BOOT_FROM sdio
11   -
12   -# Binary Header (bin_hdr) with DDR3 training code
13   -BINARY spl/u-boot-spl-dtb.bin 0000005b 00000068
board/maxbcm/kwbimage.cfg
1   -#
2   -# Copyright (C) 2014 Stefan Roese <sr@denx.de>
3   -#
4   -
5   -# Armada XP uses version 1 image format
6   -VERSION 1
7   -
8   -# Boot Media configurations
9   -BOOT_FROM spi
10   -
11   -# Binary Header (bin_hdr) with DDR3 training code
12   -BINARY spl/u-boot-spl-dtb.bin 0000005b 00000068
board/solidrun/clearfog/kwbimage.cfg
1   -#
2   -# Copyright (C) 2015 Stefan Roese <sr@denx.de>
3   -#
4   -
5   -# Armada 38x use version 1 image format
6   -VERSION 1
7   -
8   -# Boot Media configurations
9   -BOOT_FROM sdio
10   -
11   -# Binary Header (bin_hdr) with DDR3 training code
12   -BINARY spl/u-boot-spl-dtb.bin 0000005b 00000068
board/theadorable/kwbimage.cfg
1   -#
2   -# Copyright (C) 2015-2016 Stefan Roese <sr@denx.de>
3   -#
4   -
5   -# Armada XP uses version 1 image format
6   -VERSION 1
7   -
8   -# Boot Media configurations
9   -BOOT_FROM spi
10   -
11   -# Binary Header (bin_hdr) with DDR3 training code
12   -BINARY spl/u-boot-spl-dtb.bin 0000005b 00000068
configs/clearfog_defconfig
... ... @@ -6,12 +6,12 @@
6 6 CONFIG_SPL_LIBGENERIC_SUPPORT=y
7 7 CONFIG_SYS_MALLOC_F_LEN=0x2000
8 8 CONFIG_TARGET_CLEARFOG=y
  9 +CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC=y
9 10 CONFIG_SPL_MMC_SUPPORT=y
10 11 CONFIG_SPL_SERIAL_SUPPORT=y
11 12 CONFIG_SPL=y
12 13 CONFIG_DEBUG_UART_BASE=0xd0012000
13 14 CONFIG_DEBUG_UART_CLOCK=250000000
14   -CONFIG_SPL_LIBDISK_SUPPORT=y
15 15 CONFIG_DEFAULT_DEVICE_TREE="armada-388-clearfog"
16 16 CONFIG_DEBUG_UART=y
17 17 CONFIG_DISTRO_DEFAULTS=y
configs/helios4_defconfig
... ... @@ -5,6 +5,7 @@
5 5 CONFIG_SPL_LIBGENERIC_SUPPORT=y
6 6 CONFIG_SYS_MALLOC_F_LEN=0x2000
7 7 CONFIG_TARGET_HELIOS4=y
  8 +CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC=y
8 9 CONFIG_SPL_MMC_SUPPORT=y
9 10 CONFIG_SPL_SERIAL_SUPPORT=y
10 11 CONFIG_SPL=y