blob: 0584ed2be5b418c381271173be93afb02ee9b048 [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/
Chris Packham7d7bb992022-11-05 17:23:59 +13009obj-$(CONFIG_ALLEYCAT_5) += alleycat5/
Stefan Roese21b29fc2016-05-25 08:13:45 +020010obj-y += arm64-common.o
Stefan Roesef61aefc2016-05-17 15:00:30 +020011
12else # CONFIG_ARM64
13
Trevor Woernerbb0fb4c2020-05-06 08:02:40 -040014ifdef CONFIG_ARCH_KIRKWOOD
Stefan Roesed0787652015-04-25 06:29:46 +020015
16obj-y = dram.o
17obj-y += gpio.o
Chris Packham8ef078b2019-03-13 20:47:03 +130018obj-y += mbus.o
Michael Walle78c9b852022-08-17 21:37:50 +020019
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ár5bb2c552022-05-06 11:05:14 +020024obj-y += lowlevel.o
Pali Rohár35e29e82021-12-21 12:20:18 +010025obj-$(CONFIG_DM_RESET) += system-controller.o
Stefan Roese0ceb2da2015-08-06 14:43:13 +020026ifndef CONFIG_SPL_BUILD
Stefan Roese09e89ab2016-02-10 07:23:00 +010027obj-$(CONFIG_ARMADA_375) += ../../../drivers/ddr/marvell/axp/xor.o
Stefan Roese81e33f42015-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 Packham0d0df462019-04-11 22:22:50 +120030obj-$(CONFIG_ARMADA_MSYS) += ../../../drivers/ddr/marvell/axp/xor.o
Pali Rohár10154b82022-02-23 14:15:45 +010031
32ifdef CONFIG_ARMADA_38X
Mario Sixa1b6b0a2017-01-11 16:01:00 +010033obj-$(CONFIG_MVEBU_EFUSE) += efuse.o
Pali Rohár10154b82022-02-23 14:15:45 +010034endif
Baruch Siachca1a4c82018-06-18 21:56:25 +030035
36extra-y += kwbimage.cfg
37
Simon Glass86dfdae2023-02-01 13:19:20 -070038ifneq ($(CONFIG_ARMADA_XP),)
Pali Rohár29c6a9c2022-01-12 18:20:44 +010039 KWB_REPLACE += CPU
40 KWB_CFG_CPU = SHEEVA
Simon Glassfaed0582023-02-01 13:19:21 -070041else ifneq ($(CONFIG_ARMADA_375)$(CONFIG_ARMADA_38X),)
Pali Rohár29c6a9c2022-01-12 18:20:44 +010042 KWB_REPLACE += CPU
43 KWB_CFG_CPU = A9
44endif
45
Pali Rohára2b1db42022-01-12 18:20:45 +010046KWB_REPLACE += LOAD_ADDRESS
47KWB_CFG_LOAD_ADDRESS = $(CONFIG_SPL_TEXT_BASE)
48
Baruch Siachca1a4c82018-06-18 21:56:25 +030049KWB_REPLACE += BOOT_FROM
50ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI),)
51 KWB_CFG_BOOT_FROM=spi
52endif
Pali Rohár67bd6152023-01-10 22:55:21 +010053ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_NAND),)
54 KWB_CFG_BOOT_FROM=nand
55endif
Baruch Siachca1a4c82018-06-18 21:56:25 +030056ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC),)
57 KWB_CFG_BOOT_FROM=sdio
58endif
Baruch Siach22c65452019-05-16 13:03:58 +030059ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SATA),)
60 KWB_CFG_BOOT_FROM=sata
61endif
Pali Rohár50afad52023-01-10 23:09:15 +010062ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_PEX),)
63 KWB_CFG_BOOT_FROM=pex
64endif
Baruch Siach72c4e672018-06-18 21:56:26 +030065ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_UART),)
66 KWB_CFG_BOOT_FROM=uart
67endif
Baruch Siachca1a4c82018-06-18 21:56:25 +030068
Pali Rohár67bd6152023-01-10 22:55:21 +010069ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_NAND),)
70KWB_REPLACE += NAND_PAGE_SIZE NAND_BLKSZ NAND_BADBLK_LOCATION
71KWB_CFG_NAND_PAGE_SIZE = $(CONFIG_SYS_NAND_PAGE_SIZE)
72KWB_CFG_NAND_BLKSZ = $(CONFIG_SYS_NAND_BLOCK_SIZE)
73KWB_CFG_NAND_BADBLK_LOCATION = $(CONFIG_MVEBU_SPL_NAND_BADBLK_LOCATION)
74endif
75
Pali Rohárc62af152023-03-29 21:25:58 +020076ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SATA),)
77KWB_REPLACE += SATA_BLKSZ
78KWB_CFG_SATA_BLKSZ = $(CONFIG_MVEBU_SPL_SATA_BLKSZ)
79endif
80
Baruch Siachca1a4c82018-06-18 21:56:25 +030081ifneq ($(CONFIG_SECURED_MODE_IMAGE),)
82KWB_REPLACE += CSK_INDEX
83KWB_CFG_CSK_INDEX = $(CONFIG_SECURED_MODE_CSK_INDEX)
84
85KWB_REPLACE += SEC_BOOT_DEV
Chris Packhambfbd62f2022-05-29 11:13:16 +120086ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI),)
87 KWB_CFG_SEC_BOOT_DEV=0x34
88endif
89ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC),)
90 KWB_CFG_SEC_BOOT_DEV=0x31
91endif
Baruch Siachca1a4c82018-06-18 21:56:25 +030092
93KWB_REPLACE += SEC_FUSE_DUMP
94KWB_CFG_SEC_FUSE_DUMP = a38x
95endif
96
Pali Rohár18d85d62022-01-12 18:20:47 +010097ifdef CONFIG_ARMADA_38X
98# BootROM output is by default enabled on pre-A38x and disabled on A38x
99# DEBUG flag on A38x for non-UART boot source only enable BootROM output and nothing more
100KWB_REPLACE += DEBUG
101KWB_CFG_DEBUG = 1
102endif
103
Pali Rohár6329d442022-01-12 18:20:39 +0100104quiet_cmd_kwbcfg = KWBCFG $@
Pali Rohára2b1db42022-01-12 18:20:45 +0100105cmd_kwbcfg = sed -ne '$(foreach V,$(KWB_REPLACE),s/\#@$(V)/$(V) $(KWB_CFG_$(V))/;)p' \
Pali Rohár6329d442022-01-12 18:20:39 +0100106 <$< >$(dir $@)$(@F)
107
Bin Meng6cdd1772019-10-28 07:25:01 -0700108$(obj)/kwbimage.cfg: $(src)/kwbimage.cfg.in include/autoconf.mk \
Baruch Siachca1a4c82018-06-18 21:56:25 +0300109 include/config/auto.conf
Pali Rohár6329d442022-01-12 18:20:39 +0100110 $(call cmd,kwbcfg)
Baruch Siachca1a4c82018-06-18 21:56:25 +0300111
Stefan Roesef61aefc2016-05-17 15:00:30 +0200112endif # CONFIG_SPL_BUILD
Stefan Roesed0787652015-04-25 06:29:46 +0200113obj-y += gpio.o
114obj-y += mbus.o
Stefan Roeseb0f80b92015-01-19 11:33:42 +0100115obj-$(CONFIG_SPL_BUILD) += spl.o
116obj-$(CONFIG_SPL_BUILD) += lowlevel_spl.o
Stefan Roesed0787652015-04-25 06:29:46 +0200117
Stefan Roese81e33f42015-12-21 13:56:33 +0100118obj-$(CONFIG_ARMADA_38X) += serdes/a38x/
119obj-$(CONFIG_ARMADA_XP) += serdes/axp/
Stefan Roese29b103c2015-04-20 09:28:12 +0200120
Trevor Woernerbb0fb4c2020-05-06 08:02:40 -0400121endif # CONFIG_ARCH_KIRKWOOD
Stefan Roesef61aefc2016-05-17 15:00:30 +0200122endif # CONFIG_ARM64