blob: 1b451889d242440ca9e5f44d4fbc99045588ce35 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001# SPDX-License-Identifier: GPL-2.0+
Stefan Roese41e5ee52014-10-22 12:13:17 +02002#
Stefan Roesef61aefc2016-05-17 15:00:30 +02003# Copyright (C) 2014-2016 Stefan Roese <sr@denx.de>
Stefan Roese41e5ee52014-10-22 12:13:17 +02004
Stefan Roesef61aefc2016-05-17 15:00:30 +02005ifdef CONFIG_ARM64
6
7obj-$(CONFIG_ARMADA_3700) += armada3700/
Stefan Roese21b29fc2016-05-25 08:13:45 +02008obj-$(CONFIG_ARMADA_8K) += armada8k/
9obj-y += arm64-common.o
Stefan Roesef61aefc2016-05-17 15:00:30 +020010
11else # CONFIG_ARM64
12
Trevor Woernerbb0fb4c2020-05-06 08:02:40 -040013ifdef CONFIG_ARCH_KIRKWOOD
Stefan Roesed0787652015-04-25 06:29:46 +020014
15obj-y = dram.o
16obj-y += gpio.o
Chris Packham8ef078b2019-03-13 20:47:03 +130017obj-y += mbus.o
Stefan Roesed0787652015-04-25 06:29:46 +020018obj-y += timer.o
19
Trevor Woernerbb0fb4c2020-05-06 08:02:40 -040020else # CONFIG_ARCH_KIRKWOOD
Stefan Roesed0787652015-04-25 06:29:46 +020021
Stefan Roese41e5ee52014-10-22 12:13:17 +020022obj-y = cpu.o
Stefan Roesed0787652015-04-25 06:29:46 +020023obj-y += dram.o
Pali Rohár35e29e82021-12-21 12:20:18 +010024obj-$(CONFIG_DM_RESET) += system-controller.o
Stefan Roese0ceb2da2015-08-06 14:43:13 +020025ifndef CONFIG_SPL_BUILD
Stefan Roese09e89ab2016-02-10 07:23:00 +010026obj-$(CONFIG_ARMADA_375) += ../../../drivers/ddr/marvell/axp/xor.o
Stefan Roese81e33f42015-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 Packham0d0df462019-04-11 22:22:50 +120029obj-$(CONFIG_ARMADA_MSYS) += ../../../drivers/ddr/marvell/axp/xor.o
Pali Rohár10154b82022-02-23 14:15:45 +010030
31ifdef CONFIG_ARMADA_38X
Mario Sixa1b6b0a2017-01-11 16:01:00 +010032obj-$(CONFIG_MVEBU_EFUSE) += efuse.o
Pali Rohár10154b82022-02-23 14:15:45 +010033endif
Baruch Siachca1a4c82018-06-18 21:56:25 +030034
35extra-y += kwbimage.cfg
36
Pali Rohár29c6a9c2022-01-12 18:20:44 +010037ifneq ($(CONFIG_ARMADA_370)$(CONFIG_ARMADA_XP),)
38 KWB_REPLACE += CPU
39 KWB_CFG_CPU = SHEEVA
40else ifneq ($(CONFIG_ARMADA_375)$(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X),)
41 KWB_REPLACE += CPU
42 KWB_CFG_CPU = A9
43endif
44
Pali Rohára2b1db42022-01-12 18:20:45 +010045KWB_REPLACE += LOAD_ADDRESS
46KWB_CFG_LOAD_ADDRESS = $(CONFIG_SPL_TEXT_BASE)
47
Baruch Siachca1a4c82018-06-18 21:56:25 +030048KWB_REPLACE += BOOT_FROM
49ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI),)
50 KWB_CFG_BOOT_FROM=spi
51endif
52ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC),)
53 KWB_CFG_BOOT_FROM=sdio
54endif
Baruch Siach22c65452019-05-16 13:03:58 +030055ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SATA),)
56 KWB_CFG_BOOT_FROM=sata
57endif
Baruch Siach72c4e672018-06-18 21:56:26 +030058ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_UART),)
59 KWB_CFG_BOOT_FROM=uart
60endif
Baruch Siachca1a4c82018-06-18 21:56:25 +030061
62ifneq ($(CONFIG_SECURED_MODE_IMAGE),)
63KWB_REPLACE += CSK_INDEX
64KWB_CFG_CSK_INDEX = $(CONFIG_SECURED_MODE_CSK_INDEX)
65
66KWB_REPLACE += SEC_BOOT_DEV
67KWB_CFG_SEC_BOOT_DEV=$(patsubst "%",%, \
68 $(if $(findstring BOOT_SPI_NOR_FLASH,$(CONFIG_SPL_BOOT_DEVICE)),0x34) \
69 $(if $(findstring BOOT_SDIO_MMC_CARD,$(CONFIG_SPL_BOOT_DEVICE)),0x31) \
70 )
71
72KWB_REPLACE += SEC_FUSE_DUMP
73KWB_CFG_SEC_FUSE_DUMP = a38x
74endif
75
Pali Rohár18d85d62022-01-12 18:20:47 +010076ifdef CONFIG_ARMADA_38X
77# BootROM output is by default enabled on pre-A38x and disabled on A38x
78# DEBUG flag on A38x for non-UART boot source only enable BootROM output and nothing more
79KWB_REPLACE += DEBUG
80KWB_CFG_DEBUG = 1
81endif
82
Pali Rohár6329d442022-01-12 18:20:39 +010083quiet_cmd_kwbcfg = KWBCFG $@
Pali Rohára2b1db42022-01-12 18:20:45 +010084cmd_kwbcfg = sed -ne '$(foreach V,$(KWB_REPLACE),s/\#@$(V)/$(V) $(KWB_CFG_$(V))/;)p' \
Pali Rohár6329d442022-01-12 18:20:39 +010085 <$< >$(dir $@)$(@F)
86
Bin Meng6cdd1772019-10-28 07:25:01 -070087$(obj)/kwbimage.cfg: $(src)/kwbimage.cfg.in include/autoconf.mk \
Baruch Siachca1a4c82018-06-18 21:56:25 +030088 include/config/auto.conf
Pali Rohár6329d442022-01-12 18:20:39 +010089 $(call cmd,kwbcfg)
Baruch Siachca1a4c82018-06-18 21:56:25 +030090
Stefan Roesef61aefc2016-05-17 15:00:30 +020091endif # CONFIG_SPL_BUILD
Stefan Roesed0787652015-04-25 06:29:46 +020092obj-y += gpio.o
93obj-y += mbus.o
94obj-y += timer.o
Stefan Roeseb0f80b92015-01-19 11:33:42 +010095obj-$(CONFIG_SPL_BUILD) += spl.o
96obj-$(CONFIG_SPL_BUILD) += lowlevel_spl.o
Stefan Roesed0787652015-04-25 06:29:46 +020097
Stefan Roese81e33f42015-12-21 13:56:33 +010098obj-$(CONFIG_ARMADA_38X) += serdes/a38x/
99obj-$(CONFIG_ARMADA_XP) += serdes/axp/
Stefan Roese29b103c2015-04-20 09:28:12 +0200100
Trevor Woernerbb0fb4c2020-05-06 08:02:40 -0400101endif # CONFIG_ARCH_KIRKWOOD
Stefan Roesef61aefc2016-05-17 15:00:30 +0200102endif # CONFIG_ARM64