blob: d44ca3a0df5826e2a479d0e6d08fc21a674d296a [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001# SPDX-License-Identifier: GPL-2.0+
Stefan Roese93e6bf42014-10-22 12:13:17 +02002#
Stefan Roese05b17652016-05-17 15:00:30 +02003# Copyright (C) 2014-2016 Stefan Roese <sr@denx.de>
Stefan Roese93e6bf42014-10-22 12:13:17 +02004
Stefan Roese05b17652016-05-17 15:00:30 +02005ifdef CONFIG_ARM64
6
7obj-$(CONFIG_ARMADA_3700) += armada3700/
Stefan Roesecb410332016-05-25 08:13:45 +02008obj-$(CONFIG_ARMADA_8K) += armada8k/
Chris Packhameaab4612022-11-05 17:23:59 +13009obj-$(CONFIG_ALLEYCAT_5) += alleycat5/
Stefan Roesecb410332016-05-25 08:13:45 +020010obj-y += arm64-common.o
Stefan Roese05b17652016-05-17 15:00:30 +020011
12else # CONFIG_ARM64
13
Trevor Woernerbb7ab072020-05-06 08:02:40 -040014ifdef CONFIG_ARCH_KIRKWOOD
Stefan Roese42e5aab2015-04-25 06:29:46 +020015
16obj-y = dram.o
17obj-y += gpio.o
Chris Packham968856c2019-03-13 20:47:03 +130018obj-y += mbus.o
Michael Walle2e9151e2022-08-17 21:37:50 +020019
Trevor Woernerbb7ab072020-05-06 08:02:40 -040020else # CONFIG_ARCH_KIRKWOOD
Stefan Roese42e5aab2015-04-25 06:29:46 +020021
Stefan Roese93e6bf42014-10-22 12:13:17 +020022obj-y = cpu.o
Stefan Roese42e5aab2015-04-25 06:29:46 +020023obj-y += dram.o
Pali Roháraaed3282022-05-06 11:05:14 +020024obj-y += lowlevel.o
Stefan Roesef3345e62015-08-06 14:43:13 +020025ifndef CONFIG_SPL_BUILD
Stefan Roese479f9af2016-02-10 07:23:00 +010026obj-$(CONFIG_ARMADA_375) += ../../../drivers/ddr/marvell/axp/xor.o
Stefan Roeseeb083e52015-12-21 13:56:33 +010027obj-$(CONFIG_ARMADA_38X) += ../../../drivers/ddr/marvell/a38x/xor.o
28obj-$(CONFIG_ARMADA_XP) += ../../../drivers/ddr/marvell/axp/xor.o
Chris Packhama8f845e2019-04-11 22:22:50 +120029obj-$(CONFIG_ARMADA_MSYS) += ../../../drivers/ddr/marvell/axp/xor.o
Pali Rohár70d9bee2022-02-23 14:15:45 +010030
Marek Behún1c657bc2024-04-04 09:50:58 +020031obj-$(CONFIG_ARMADA_32BIT_SYSCON_RESET) += system-controller.o
Marek Behúna6ed6092024-04-04 09:50:57 +020032
Pali Rohár70d9bee2022-02-23 14:15:45 +010033ifdef CONFIG_ARMADA_38X
Mario Six10d14492017-01-11 16:01:00 +010034obj-$(CONFIG_MVEBU_EFUSE) += efuse.o
Pali Rohár70d9bee2022-02-23 14:15:45 +010035endif
Baruch Siachea3d9de2018-06-18 21:56:25 +030036
37extra-y += kwbimage.cfg
38
Simon Glass95bd2622023-02-01 13:19:20 -070039ifneq ($(CONFIG_ARMADA_XP),)
Pali Rohár8f3dcb82022-01-12 18:20:44 +010040 KWB_REPLACE += CPU
41 KWB_CFG_CPU = SHEEVA
Simon Glasse2119672023-02-01 13:19:21 -070042else ifneq ($(CONFIG_ARMADA_375)$(CONFIG_ARMADA_38X),)
Pali Rohár8f3dcb82022-01-12 18:20:44 +010043 KWB_REPLACE += CPU
44 KWB_CFG_CPU = A9
45endif
46
Pali Roháre29a0072022-01-12 18:20:45 +010047KWB_REPLACE += LOAD_ADDRESS
48KWB_CFG_LOAD_ADDRESS = $(CONFIG_SPL_TEXT_BASE)
49
Baruch Siachea3d9de2018-06-18 21:56:25 +030050KWB_REPLACE += BOOT_FROM
51ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI),)
52 KWB_CFG_BOOT_FROM=spi
53endif
Pali Rohár5c5cf602023-01-10 22:55:21 +010054ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_NAND),)
55 KWB_CFG_BOOT_FROM=nand
56endif
Baruch Siachea3d9de2018-06-18 21:56:25 +030057ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC),)
58 KWB_CFG_BOOT_FROM=sdio
59endif
Baruch Siachb936a272019-05-16 13:03:58 +030060ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SATA),)
61 KWB_CFG_BOOT_FROM=sata
62endif
Pali Rohárea876902023-01-10 23:09:15 +010063ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_PEX),)
64 KWB_CFG_BOOT_FROM=pex
65endif
Baruch Siachb35c4472018-06-18 21:56:26 +030066ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_UART),)
67 KWB_CFG_BOOT_FROM=uart
68endif
Baruch Siachea3d9de2018-06-18 21:56:25 +030069
Pali Rohár5c5cf602023-01-10 22:55:21 +010070ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_NAND),)
71KWB_REPLACE += NAND_PAGE_SIZE NAND_BLKSZ NAND_BADBLK_LOCATION
72KWB_CFG_NAND_PAGE_SIZE = $(CONFIG_SYS_NAND_PAGE_SIZE)
73KWB_CFG_NAND_BLKSZ = $(CONFIG_SYS_NAND_BLOCK_SIZE)
74KWB_CFG_NAND_BADBLK_LOCATION = $(CONFIG_MVEBU_SPL_NAND_BADBLK_LOCATION)
75endif
76
Pali Rohár7085f822023-03-29 21:25:58 +020077ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SATA),)
78KWB_REPLACE += SATA_BLKSZ
79KWB_CFG_SATA_BLKSZ = $(CONFIG_MVEBU_SPL_SATA_BLKSZ)
80endif
81
Baruch Siachea3d9de2018-06-18 21:56:25 +030082ifneq ($(CONFIG_SECURED_MODE_IMAGE),)
83KWB_REPLACE += CSK_INDEX
84KWB_CFG_CSK_INDEX = $(CONFIG_SECURED_MODE_CSK_INDEX)
85
86KWB_REPLACE += SEC_BOOT_DEV
Chris Packhameecbd462022-05-29 11:13:16 +120087ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI),)
88 KWB_CFG_SEC_BOOT_DEV=0x34
89endif
90ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC),)
91 KWB_CFG_SEC_BOOT_DEV=0x31
92endif
Baruch Siachea3d9de2018-06-18 21:56:25 +030093
94KWB_REPLACE += SEC_FUSE_DUMP
95KWB_CFG_SEC_FUSE_DUMP = a38x
96endif
97
Pali Rohárb938acc2022-01-12 18:20:47 +010098ifdef CONFIG_ARMADA_38X
99# BootROM output is by default enabled on pre-A38x and disabled on A38x
100# DEBUG flag on A38x for non-UART boot source only enable BootROM output and nothing more
101KWB_REPLACE += DEBUG
102KWB_CFG_DEBUG = 1
103endif
104
Pali Rohár8add2b42022-01-12 18:20:39 +0100105quiet_cmd_kwbcfg = KWBCFG $@
Pali Roháre29a0072022-01-12 18:20:45 +0100106cmd_kwbcfg = sed -ne '$(foreach V,$(KWB_REPLACE),s/\#@$(V)/$(V) $(KWB_CFG_$(V))/;)p' \
Pali Rohár8add2b42022-01-12 18:20:39 +0100107 <$< >$(dir $@)$(@F)
108
Bin Mengdf4019a2019-10-28 07:25:01 -0700109$(obj)/kwbimage.cfg: $(src)/kwbimage.cfg.in include/autoconf.mk \
Baruch Siachea3d9de2018-06-18 21:56:25 +0300110 include/config/auto.conf
Pali Rohár8add2b42022-01-12 18:20:39 +0100111 $(call cmd,kwbcfg)
Baruch Siachea3d9de2018-06-18 21:56:25 +0300112
Stefan Roese05b17652016-05-17 15:00:30 +0200113endif # CONFIG_SPL_BUILD
Stefan Roese42e5aab2015-04-25 06:29:46 +0200114obj-y += gpio.o
115obj-y += mbus.o
Stefan Roesee463bf32015-01-19 11:33:42 +0100116obj-$(CONFIG_SPL_BUILD) += spl.o
117obj-$(CONFIG_SPL_BUILD) += lowlevel_spl.o
Stefan Roese42e5aab2015-04-25 06:29:46 +0200118
Stefan Roeseeb083e52015-12-21 13:56:33 +0100119obj-$(CONFIG_ARMADA_38X) += serdes/a38x/
120obj-$(CONFIG_ARMADA_XP) += serdes/axp/
Stefan Roesee5c5aa92015-04-20 09:28:12 +0200121
Trevor Woernerbb7ab072020-05-06 08:02:40 -0400122endif # CONFIG_ARCH_KIRKWOOD
Stefan Roese05b17652016-05-17 15:00:30 +0200123endif # CONFIG_ARM64