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/ |
Chris Packham | eaab461 | 2022-11-05 17:23:59 +1300 | [diff] [blame] | 9 | obj-$(CONFIG_ALLEYCAT_5) += alleycat5/ |
Stefan Roese | cb41033 | 2016-05-25 08:13:45 +0200 | [diff] [blame] | 10 | obj-y += arm64-common.o |
Stefan Roese | 05b1765 | 2016-05-17 15:00:30 +0200 | [diff] [blame] | 11 | |
| 12 | else # CONFIG_ARM64 |
| 13 | |
Trevor Woerner | bb7ab07 | 2020-05-06 08:02:40 -0400 | [diff] [blame] | 14 | ifdef CONFIG_ARCH_KIRKWOOD |
Stefan Roese | 42e5aab | 2015-04-25 06:29:46 +0200 | [diff] [blame] | 15 | |
| 16 | obj-y = dram.o |
| 17 | obj-y += gpio.o |
Chris Packham | 968856c | 2019-03-13 20:47:03 +1300 | [diff] [blame] | 18 | obj-y += mbus.o |
Michael Walle | 2e9151e | 2022-08-17 21:37:50 +0200 | [diff] [blame] | 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 | aaed328 | 2022-05-06 11:05:14 +0200 | [diff] [blame] | 24 | obj-y += lowlevel.o |
Pali Rohár | 4669df3 | 2021-12-21 12:20:18 +0100 | [diff] [blame] | 25 | obj-$(CONFIG_DM_RESET) += system-controller.o |
Stefan Roese | f3345e6 | 2015-08-06 14:43:13 +0200 | [diff] [blame] | 26 | ifndef CONFIG_SPL_BUILD |
Stefan Roese | 479f9af | 2016-02-10 07:23:00 +0100 | [diff] [blame] | 27 | obj-$(CONFIG_ARMADA_375) += ../../../drivers/ddr/marvell/axp/xor.o |
Stefan Roese | eb083e5 | 2015-12-21 13:56:33 +0100 | [diff] [blame] | 28 | obj-$(CONFIG_ARMADA_38X) += ../../../drivers/ddr/marvell/a38x/xor.o |
| 29 | obj-$(CONFIG_ARMADA_XP) += ../../../drivers/ddr/marvell/axp/xor.o |
Chris Packham | a8f845e | 2019-04-11 22:22:50 +1200 | [diff] [blame] | 30 | obj-$(CONFIG_ARMADA_MSYS) += ../../../drivers/ddr/marvell/axp/xor.o |
Pali Rohár | 70d9bee | 2022-02-23 14:15:45 +0100 | [diff] [blame] | 31 | |
| 32 | ifdef CONFIG_ARMADA_38X |
Mario Six | 10d1449 | 2017-01-11 16:01:00 +0100 | [diff] [blame] | 33 | obj-$(CONFIG_MVEBU_EFUSE) += efuse.o |
Pali Rohár | 70d9bee | 2022-02-23 14:15:45 +0100 | [diff] [blame] | 34 | endif |
Baruch Siach | ea3d9de | 2018-06-18 21:56:25 +0300 | [diff] [blame] | 35 | |
| 36 | extra-y += kwbimage.cfg |
| 37 | |
Simon Glass | 95bd262 | 2023-02-01 13:19:20 -0700 | [diff] [blame] | 38 | ifneq ($(CONFIG_ARMADA_XP),) |
Pali Rohár | 8f3dcb8 | 2022-01-12 18:20:44 +0100 | [diff] [blame] | 39 | KWB_REPLACE += CPU |
| 40 | KWB_CFG_CPU = SHEEVA |
Simon Glass | e211967 | 2023-02-01 13:19:21 -0700 | [diff] [blame] | 41 | else ifneq ($(CONFIG_ARMADA_375)$(CONFIG_ARMADA_38X),) |
Pali Rohár | 8f3dcb8 | 2022-01-12 18:20:44 +0100 | [diff] [blame] | 42 | KWB_REPLACE += CPU |
| 43 | KWB_CFG_CPU = A9 |
| 44 | endif |
| 45 | |
Pali Rohár | e29a007 | 2022-01-12 18:20:45 +0100 | [diff] [blame] | 46 | KWB_REPLACE += LOAD_ADDRESS |
| 47 | KWB_CFG_LOAD_ADDRESS = $(CONFIG_SPL_TEXT_BASE) |
| 48 | |
Baruch Siach | ea3d9de | 2018-06-18 21:56:25 +0300 | [diff] [blame] | 49 | KWB_REPLACE += BOOT_FROM |
| 50 | ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI),) |
| 51 | KWB_CFG_BOOT_FROM=spi |
| 52 | endif |
Pali Rohár | 5c5cf60 | 2023-01-10 22:55:21 +0100 | [diff] [blame] | 53 | ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_NAND),) |
| 54 | KWB_CFG_BOOT_FROM=nand |
| 55 | endif |
Baruch Siach | ea3d9de | 2018-06-18 21:56:25 +0300 | [diff] [blame] | 56 | ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC),) |
| 57 | KWB_CFG_BOOT_FROM=sdio |
| 58 | endif |
Baruch Siach | b936a27 | 2019-05-16 13:03:58 +0300 | [diff] [blame] | 59 | ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SATA),) |
| 60 | KWB_CFG_BOOT_FROM=sata |
| 61 | endif |
Pali Rohár | ea87690 | 2023-01-10 23:09:15 +0100 | [diff] [blame] | 62 | ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_PEX),) |
| 63 | KWB_CFG_BOOT_FROM=pex |
| 64 | endif |
Baruch Siach | b35c447 | 2018-06-18 21:56:26 +0300 | [diff] [blame] | 65 | ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_UART),) |
| 66 | KWB_CFG_BOOT_FROM=uart |
| 67 | endif |
Baruch Siach | ea3d9de | 2018-06-18 21:56:25 +0300 | [diff] [blame] | 68 | |
Pali Rohár | 5c5cf60 | 2023-01-10 22:55:21 +0100 | [diff] [blame] | 69 | ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_NAND),) |
| 70 | KWB_REPLACE += NAND_PAGE_SIZE NAND_BLKSZ NAND_BADBLK_LOCATION |
| 71 | KWB_CFG_NAND_PAGE_SIZE = $(CONFIG_SYS_NAND_PAGE_SIZE) |
| 72 | KWB_CFG_NAND_BLKSZ = $(CONFIG_SYS_NAND_BLOCK_SIZE) |
| 73 | KWB_CFG_NAND_BADBLK_LOCATION = $(CONFIG_MVEBU_SPL_NAND_BADBLK_LOCATION) |
| 74 | endif |
| 75 | |
Pali Rohár | 7085f82 | 2023-03-29 21:25:58 +0200 | [diff] [blame] | 76 | ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SATA),) |
| 77 | KWB_REPLACE += SATA_BLKSZ |
| 78 | KWB_CFG_SATA_BLKSZ = $(CONFIG_MVEBU_SPL_SATA_BLKSZ) |
| 79 | endif |
| 80 | |
Baruch Siach | ea3d9de | 2018-06-18 21:56:25 +0300 | [diff] [blame] | 81 | ifneq ($(CONFIG_SECURED_MODE_IMAGE),) |
| 82 | KWB_REPLACE += CSK_INDEX |
| 83 | KWB_CFG_CSK_INDEX = $(CONFIG_SECURED_MODE_CSK_INDEX) |
| 84 | |
| 85 | KWB_REPLACE += SEC_BOOT_DEV |
Chris Packham | eecbd46 | 2022-05-29 11:13:16 +1200 | [diff] [blame] | 86 | ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI),) |
| 87 | KWB_CFG_SEC_BOOT_DEV=0x34 |
| 88 | endif |
| 89 | ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC),) |
| 90 | KWB_CFG_SEC_BOOT_DEV=0x31 |
| 91 | endif |
Baruch Siach | ea3d9de | 2018-06-18 21:56:25 +0300 | [diff] [blame] | 92 | |
| 93 | KWB_REPLACE += SEC_FUSE_DUMP |
| 94 | KWB_CFG_SEC_FUSE_DUMP = a38x |
| 95 | endif |
| 96 | |
Pali Rohár | b938acc | 2022-01-12 18:20:47 +0100 | [diff] [blame] | 97 | ifdef 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 |
| 100 | KWB_REPLACE += DEBUG |
| 101 | KWB_CFG_DEBUG = 1 |
| 102 | endif |
| 103 | |
Pali Rohár | 8add2b4 | 2022-01-12 18:20:39 +0100 | [diff] [blame] | 104 | quiet_cmd_kwbcfg = KWBCFG $@ |
Pali Rohár | e29a007 | 2022-01-12 18:20:45 +0100 | [diff] [blame] | 105 | 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] | 106 | <$< >$(dir $@)$(@F) |
| 107 | |
Bin Meng | df4019a | 2019-10-28 07:25:01 -0700 | [diff] [blame] | 108 | $(obj)/kwbimage.cfg: $(src)/kwbimage.cfg.in include/autoconf.mk \ |
Baruch Siach | ea3d9de | 2018-06-18 21:56:25 +0300 | [diff] [blame] | 109 | include/config/auto.conf |
Pali Rohár | 8add2b4 | 2022-01-12 18:20:39 +0100 | [diff] [blame] | 110 | $(call cmd,kwbcfg) |
Baruch Siach | ea3d9de | 2018-06-18 21:56:25 +0300 | [diff] [blame] | 111 | |
Stefan Roese | 05b1765 | 2016-05-17 15:00:30 +0200 | [diff] [blame] | 112 | endif # CONFIG_SPL_BUILD |
Stefan Roese | 42e5aab | 2015-04-25 06:29:46 +0200 | [diff] [blame] | 113 | obj-y += gpio.o |
| 114 | obj-y += mbus.o |
Stefan Roese | e463bf3 | 2015-01-19 11:33:42 +0100 | [diff] [blame] | 115 | obj-$(CONFIG_SPL_BUILD) += spl.o |
| 116 | obj-$(CONFIG_SPL_BUILD) += lowlevel_spl.o |
Stefan Roese | 42e5aab | 2015-04-25 06:29:46 +0200 | [diff] [blame] | 117 | |
Stefan Roese | eb083e5 | 2015-12-21 13:56:33 +0100 | [diff] [blame] | 118 | obj-$(CONFIG_ARMADA_38X) += serdes/a38x/ |
| 119 | obj-$(CONFIG_ARMADA_XP) += serdes/axp/ |
Stefan Roese | e5c5aa9 | 2015-04-20 09:28:12 +0200 | [diff] [blame] | 120 | |
Trevor Woerner | bb7ab07 | 2020-05-06 08:02:40 -0400 | [diff] [blame] | 121 | endif # CONFIG_ARCH_KIRKWOOD |
Stefan Roese | 05b1765 | 2016-05-17 15:00:30 +0200 | [diff] [blame] | 122 | endif # CONFIG_ARM64 |