Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0+ |
Stefan Roese | 93e6bf4 | 2014-10-22 12:13:17 +0200 | [diff] [blame] | 2 | # |
Stefan Roese | 05b1765 | 2016-05-17 15:00:30 +0200 | [diff] [blame] | 3 | # Copyright (C) 2014-2016 Stefan Roese <sr@denx.de> |
Stefan Roese | 93e6bf4 | 2014-10-22 12:13:17 +0200 | [diff] [blame] | 4 | |
Stefan Roese | 05b1765 | 2016-05-17 15:00:30 +0200 | [diff] [blame] | 5 | ifdef CONFIG_ARM64 |
| 6 | |
| 7 | obj-$(CONFIG_ARMADA_3700) += armada3700/ |
Stefan Roese | cb41033 | 2016-05-25 08:13:45 +0200 | [diff] [blame] | 8 | obj-$(CONFIG_ARMADA_8K) += armada8k/ |
| 9 | obj-y += arm64-common.o |
Stefan Roese | 05b1765 | 2016-05-17 15:00:30 +0200 | [diff] [blame] | 10 | |
| 11 | else # CONFIG_ARM64 |
| 12 | |
Trevor Woerner | bb7ab07 | 2020-05-06 08:02:40 -0400 | [diff] [blame] | 13 | ifdef CONFIG_ARCH_KIRKWOOD |
Stefan Roese | 42e5aab | 2015-04-25 06:29:46 +0200 | [diff] [blame] | 14 | |
| 15 | obj-y = dram.o |
| 16 | obj-y += gpio.o |
Chris Packham | 968856c | 2019-03-13 20:47:03 +1300 | [diff] [blame] | 17 | obj-y += mbus.o |
Stefan Roese | 42e5aab | 2015-04-25 06:29:46 +0200 | [diff] [blame] | 18 | obj-y += timer.o |
| 19 | |
Trevor Woerner | bb7ab07 | 2020-05-06 08:02:40 -0400 | [diff] [blame] | 20 | else # CONFIG_ARCH_KIRKWOOD |
Stefan Roese | 42e5aab | 2015-04-25 06:29:46 +0200 | [diff] [blame] | 21 | |
Stefan Roese | 93e6bf4 | 2014-10-22 12:13:17 +0200 | [diff] [blame] | 22 | obj-y = cpu.o |
Stefan Roese | 42e5aab | 2015-04-25 06:29:46 +0200 | [diff] [blame] | 23 | obj-y += dram.o |
Pali Rohár | 4669df3 | 2021-12-21 12:20:18 +0100 | [diff] [blame] | 24 | obj-$(CONFIG_DM_RESET) += system-controller.o |
Stefan Roese | f3345e6 | 2015-08-06 14:43:13 +0200 | [diff] [blame] | 25 | ifndef CONFIG_SPL_BUILD |
Stefan Roese | 479f9af | 2016-02-10 07:23:00 +0100 | [diff] [blame] | 26 | obj-$(CONFIG_ARMADA_375) += ../../../drivers/ddr/marvell/axp/xor.o |
Stefan Roese | eb083e5 | 2015-12-21 13:56:33 +0100 | [diff] [blame] | 27 | obj-$(CONFIG_ARMADA_38X) += ../../../drivers/ddr/marvell/a38x/xor.o |
| 28 | obj-$(CONFIG_ARMADA_XP) += ../../../drivers/ddr/marvell/axp/xor.o |
Chris Packham | a8f845e | 2019-04-11 22:22:50 +1200 | [diff] [blame] | 29 | obj-$(CONFIG_ARMADA_MSYS) += ../../../drivers/ddr/marvell/axp/xor.o |
Mario Six | 10d1449 | 2017-01-11 16:01:00 +0100 | [diff] [blame] | 30 | obj-$(CONFIG_MVEBU_EFUSE) += efuse.o |
Baruch Siach | ea3d9de | 2018-06-18 21:56:25 +0300 | [diff] [blame] | 31 | |
| 32 | extra-y += kwbimage.cfg |
| 33 | |
Pali Rohár | 8f3dcb8 | 2022-01-12 18:20:44 +0100 | [diff] [blame] | 34 | ifneq ($(CONFIG_ARMADA_370)$(CONFIG_ARMADA_XP),) |
| 35 | KWB_REPLACE += CPU |
| 36 | KWB_CFG_CPU = SHEEVA |
| 37 | else ifneq ($(CONFIG_ARMADA_375)$(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X),) |
| 38 | KWB_REPLACE += CPU |
| 39 | KWB_CFG_CPU = A9 |
| 40 | endif |
| 41 | |
Pali Rohár | e29a007 | 2022-01-12 18:20:45 +0100 | [diff] [blame] | 42 | KWB_REPLACE += LOAD_ADDRESS |
| 43 | KWB_CFG_LOAD_ADDRESS = $(CONFIG_SPL_TEXT_BASE) |
| 44 | |
Baruch Siach | ea3d9de | 2018-06-18 21:56:25 +0300 | [diff] [blame] | 45 | KWB_REPLACE += BOOT_FROM |
| 46 | ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI),) |
| 47 | KWB_CFG_BOOT_FROM=spi |
| 48 | endif |
| 49 | ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC),) |
| 50 | KWB_CFG_BOOT_FROM=sdio |
| 51 | endif |
Baruch Siach | b936a27 | 2019-05-16 13:03:58 +0300 | [diff] [blame] | 52 | ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SATA),) |
| 53 | KWB_CFG_BOOT_FROM=sata |
| 54 | endif |
Baruch Siach | b35c447 | 2018-06-18 21:56:26 +0300 | [diff] [blame] | 55 | ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_UART),) |
| 56 | KWB_CFG_BOOT_FROM=uart |
| 57 | endif |
Baruch Siach | ea3d9de | 2018-06-18 21:56:25 +0300 | [diff] [blame] | 58 | |
| 59 | ifneq ($(CONFIG_SECURED_MODE_IMAGE),) |
| 60 | KWB_REPLACE += CSK_INDEX |
| 61 | KWB_CFG_CSK_INDEX = $(CONFIG_SECURED_MODE_CSK_INDEX) |
| 62 | |
| 63 | KWB_REPLACE += SEC_BOOT_DEV |
| 64 | KWB_CFG_SEC_BOOT_DEV=$(patsubst "%",%, \ |
| 65 | $(if $(findstring BOOT_SPI_NOR_FLASH,$(CONFIG_SPL_BOOT_DEVICE)),0x34) \ |
| 66 | $(if $(findstring BOOT_SDIO_MMC_CARD,$(CONFIG_SPL_BOOT_DEVICE)),0x31) \ |
| 67 | ) |
| 68 | |
| 69 | KWB_REPLACE += SEC_FUSE_DUMP |
| 70 | KWB_CFG_SEC_FUSE_DUMP = a38x |
| 71 | endif |
| 72 | |
Pali Rohár | b938acc | 2022-01-12 18:20:47 +0100 | [diff] [blame] | 73 | ifdef CONFIG_ARMADA_38X |
| 74 | # BootROM output is by default enabled on pre-A38x and disabled on A38x |
| 75 | # DEBUG flag on A38x for non-UART boot source only enable BootROM output and nothing more |
| 76 | KWB_REPLACE += DEBUG |
| 77 | KWB_CFG_DEBUG = 1 |
| 78 | endif |
| 79 | |
Pali Rohár | 8add2b4 | 2022-01-12 18:20:39 +0100 | [diff] [blame] | 80 | quiet_cmd_kwbcfg = KWBCFG $@ |
Pali Rohár | e29a007 | 2022-01-12 18:20:45 +0100 | [diff] [blame] | 81 | cmd_kwbcfg = sed -ne '$(foreach V,$(KWB_REPLACE),s/\#@$(V)/$(V) $(KWB_CFG_$(V))/;)p' \ |
Pali Rohár | 8add2b4 | 2022-01-12 18:20:39 +0100 | [diff] [blame] | 82 | <$< >$(dir $@)$(@F) |
| 83 | |
Bin Meng | df4019a | 2019-10-28 07:25:01 -0700 | [diff] [blame] | 84 | $(obj)/kwbimage.cfg: $(src)/kwbimage.cfg.in include/autoconf.mk \ |
Baruch Siach | ea3d9de | 2018-06-18 21:56:25 +0300 | [diff] [blame] | 85 | include/config/auto.conf |
Pali Rohár | 8add2b4 | 2022-01-12 18:20:39 +0100 | [diff] [blame] | 86 | $(call cmd,kwbcfg) |
Baruch Siach | ea3d9de | 2018-06-18 21:56:25 +0300 | [diff] [blame] | 87 | |
Stefan Roese | 05b1765 | 2016-05-17 15:00:30 +0200 | [diff] [blame] | 88 | endif # CONFIG_SPL_BUILD |
Stefan Roese | 42e5aab | 2015-04-25 06:29:46 +0200 | [diff] [blame] | 89 | obj-y += gpio.o |
| 90 | obj-y += mbus.o |
| 91 | obj-y += timer.o |
Stefan Roese | e463bf3 | 2015-01-19 11:33:42 +0100 | [diff] [blame] | 92 | obj-$(CONFIG_SPL_BUILD) += spl.o |
| 93 | obj-$(CONFIG_SPL_BUILD) += lowlevel_spl.o |
Stefan Roese | 42e5aab | 2015-04-25 06:29:46 +0200 | [diff] [blame] | 94 | |
Stefan Roese | eb083e5 | 2015-12-21 13:56:33 +0100 | [diff] [blame] | 95 | obj-$(CONFIG_ARMADA_38X) += serdes/a38x/ |
| 96 | obj-$(CONFIG_ARMADA_XP) += serdes/axp/ |
Stefan Roese | e5c5aa9 | 2015-04-20 09:28:12 +0200 | [diff] [blame] | 97 | |
Trevor Woerner | bb7ab07 | 2020-05-06 08:02:40 -0400 | [diff] [blame] | 98 | endif # CONFIG_ARCH_KIRKWOOD |
Stefan Roese | 05b1765 | 2016-05-17 15:00:30 +0200 | [diff] [blame] | 99 | endif # CONFIG_ARM64 |