blob: 61eeb9c8c186f691aab84ea5aeef471d2eb0fc59 [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/
9obj-y += arm64-common.o
Stefan Roese05b17652016-05-17 15:00:30 +020010
11else # CONFIG_ARM64
12
Trevor Woernerbb7ab072020-05-06 08:02:40 -040013ifdef CONFIG_ARCH_KIRKWOOD
Stefan Roese42e5aab2015-04-25 06:29:46 +020014
15obj-y = dram.o
16obj-y += gpio.o
Chris Packham968856c2019-03-13 20:47:03 +130017obj-y += mbus.o
Stefan Roese42e5aab2015-04-25 06:29:46 +020018obj-y += timer.o
19
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
Pali Rohár4669df32021-12-21 12:20:18 +010025obj-$(CONFIG_DM_RESET) += system-controller.o
Stefan Roesef3345e62015-08-06 14:43:13 +020026ifndef CONFIG_SPL_BUILD
Stefan Roese479f9af2016-02-10 07:23:00 +010027obj-$(CONFIG_ARMADA_375) += ../../../drivers/ddr/marvell/axp/xor.o
Stefan Roeseeb083e52015-12-21 13:56:33 +010028obj-$(CONFIG_ARMADA_38X) += ../../../drivers/ddr/marvell/a38x/xor.o
29obj-$(CONFIG_ARMADA_XP) += ../../../drivers/ddr/marvell/axp/xor.o
Chris Packhama8f845e2019-04-11 22:22:50 +120030obj-$(CONFIG_ARMADA_MSYS) += ../../../drivers/ddr/marvell/axp/xor.o
Pali Rohár70d9bee2022-02-23 14:15:45 +010031
32ifdef CONFIG_ARMADA_38X
Mario Six10d14492017-01-11 16:01:00 +010033obj-$(CONFIG_MVEBU_EFUSE) += efuse.o
Pali Rohár70d9bee2022-02-23 14:15:45 +010034endif
Baruch Siachea3d9de2018-06-18 21:56:25 +030035
36extra-y += kwbimage.cfg
37
Pali Rohár8f3dcb82022-01-12 18:20:44 +010038ifneq ($(CONFIG_ARMADA_370)$(CONFIG_ARMADA_XP),)
39 KWB_REPLACE += CPU
40 KWB_CFG_CPU = SHEEVA
41else ifneq ($(CONFIG_ARMADA_375)$(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X),)
42 KWB_REPLACE += CPU
43 KWB_CFG_CPU = A9
44endif
45
Pali Roháre29a0072022-01-12 18:20:45 +010046KWB_REPLACE += LOAD_ADDRESS
47KWB_CFG_LOAD_ADDRESS = $(CONFIG_SPL_TEXT_BASE)
48
Baruch Siachea3d9de2018-06-18 21:56:25 +030049KWB_REPLACE += BOOT_FROM
50ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI),)
51 KWB_CFG_BOOT_FROM=spi
52endif
53ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC),)
54 KWB_CFG_BOOT_FROM=sdio
55endif
Baruch Siachb936a272019-05-16 13:03:58 +030056ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SATA),)
57 KWB_CFG_BOOT_FROM=sata
58endif
Baruch Siachb35c4472018-06-18 21:56:26 +030059ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_UART),)
60 KWB_CFG_BOOT_FROM=uart
61endif
Baruch Siachea3d9de2018-06-18 21:56:25 +030062
63ifneq ($(CONFIG_SECURED_MODE_IMAGE),)
64KWB_REPLACE += CSK_INDEX
65KWB_CFG_CSK_INDEX = $(CONFIG_SECURED_MODE_CSK_INDEX)
66
67KWB_REPLACE += SEC_BOOT_DEV
Chris Packhameecbd462022-05-29 11:13:16 +120068ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI),)
69 KWB_CFG_SEC_BOOT_DEV=0x34
70endif
71ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC),)
72 KWB_CFG_SEC_BOOT_DEV=0x31
73endif
Baruch Siachea3d9de2018-06-18 21:56:25 +030074
75KWB_REPLACE += SEC_FUSE_DUMP
76KWB_CFG_SEC_FUSE_DUMP = a38x
77endif
78
Pali Rohárb938acc2022-01-12 18:20:47 +010079ifdef CONFIG_ARMADA_38X
80# BootROM output is by default enabled on pre-A38x and disabled on A38x
81# DEBUG flag on A38x for non-UART boot source only enable BootROM output and nothing more
82KWB_REPLACE += DEBUG
83KWB_CFG_DEBUG = 1
84endif
85
Pali Rohár8add2b42022-01-12 18:20:39 +010086quiet_cmd_kwbcfg = KWBCFG $@
Pali Roháre29a0072022-01-12 18:20:45 +010087cmd_kwbcfg = sed -ne '$(foreach V,$(KWB_REPLACE),s/\#@$(V)/$(V) $(KWB_CFG_$(V))/;)p' \
Pali Rohár8add2b42022-01-12 18:20:39 +010088 <$< >$(dir $@)$(@F)
89
Bin Mengdf4019a2019-10-28 07:25:01 -070090$(obj)/kwbimage.cfg: $(src)/kwbimage.cfg.in include/autoconf.mk \
Baruch Siachea3d9de2018-06-18 21:56:25 +030091 include/config/auto.conf
Pali Rohár8add2b42022-01-12 18:20:39 +010092 $(call cmd,kwbcfg)
Baruch Siachea3d9de2018-06-18 21:56:25 +030093
Stefan Roese05b17652016-05-17 15:00:30 +020094endif # CONFIG_SPL_BUILD
Stefan Roese42e5aab2015-04-25 06:29:46 +020095obj-y += gpio.o
96obj-y += mbus.o
97obj-y += timer.o
Stefan Roesee463bf32015-01-19 11:33:42 +010098obj-$(CONFIG_SPL_BUILD) += spl.o
99obj-$(CONFIG_SPL_BUILD) += lowlevel_spl.o
Stefan Roese42e5aab2015-04-25 06:29:46 +0200100
Stefan Roeseeb083e52015-12-21 13:56:33 +0100101obj-$(CONFIG_ARMADA_38X) += serdes/a38x/
102obj-$(CONFIG_ARMADA_XP) += serdes/axp/
Stefan Roesee5c5aa92015-04-20 09:28:12 +0200103
Trevor Woernerbb7ab072020-05-06 08:02:40 -0400104endif # CONFIG_ARCH_KIRKWOOD
Stefan Roese05b17652016-05-17 15:00:30 +0200105endif # CONFIG_ARM64