From 42826664e4452304bdadc909d7c5f791d4abc552 Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Fri, 10 May 2024 15:21:24 -0500 Subject: [PATCH] arm: mach-k3: Move code specific to a SoC into that SoC's directory Each SoC now has a directory in mach-k3, let's move the SoC specific files into their respective directories. Signed-off-by: Andrew Davis --- arch/arm/mach-k3/Makefile | 24 ++++++--------------- arch/arm/mach-k3/am62ax/Makefile | 7 ++++++ arch/arm/mach-k3/{ => am62ax}/am62a7_fdt.c | 3 ++- arch/arm/mach-k3/{ => am62ax}/am62a7_init.c | 5 +++-- arch/arm/mach-k3/am62px/Makefile | 6 ++++++ arch/arm/mach-k3/{ => am62px}/am62p5_init.c | 5 +++-- arch/arm/mach-k3/am62x/Makefile | 3 +++ arch/arm/mach-k3/{ => am62x}/am625_fdt.c | 3 ++- arch/arm/mach-k3/{ => am62x}/am625_init.c | 5 +++-- arch/arm/mach-k3/am64x/Makefile | 2 ++ arch/arm/mach-k3/{ => am64x}/am642_init.c | 5 +++-- arch/arm/mach-k3/am65x/Makefile | 7 ++++++ arch/arm/mach-k3/{ => am65x}/am654_fdt.c | 3 ++- arch/arm/mach-k3/{ => am65x}/am654_init.c | 5 +++-- arch/arm/mach-k3/j721e/Makefile | 7 ++++++ arch/arm/mach-k3/{ => j721e}/j721e_fdt.c | 3 ++- arch/arm/mach-k3/{ => j721e}/j721e_init.c | 5 +++-- arch/arm/mach-k3/j721s2/Makefile | 7 ++++++ arch/arm/mach-k3/{ => j721s2}/j721s2_fdt.c | 3 ++- arch/arm/mach-k3/{ => j721s2}/j721s2_init.c | 5 +++-- arch/arm/mach-k3/j784s4/Makefile | 7 ++++++ arch/arm/mach-k3/{ => j784s4}/j784s4_fdt.c | 3 ++- arch/arm/mach-k3/{ => j784s4}/j784s4_init.c | 5 +++-- 23 files changed, 88 insertions(+), 40 deletions(-) create mode 100644 arch/arm/mach-k3/am62ax/Makefile rename arch/arm/mach-k3/{ => am62ax}/am62a7_fdt.c (93%) rename arch/arm/mach-k3/{ => am62ax}/am62a7_init.c (99%) create mode 100644 arch/arm/mach-k3/am62px/Makefile rename arch/arm/mach-k3/{ => am62px}/am62p5_init.c (99%) rename arch/arm/mach-k3/{ => am62x}/am625_fdt.c (98%) rename arch/arm/mach-k3/{ => am62x}/am625_init.c (99%) rename arch/arm/mach-k3/{ => am64x}/am642_init.c (99%) create mode 100644 arch/arm/mach-k3/am65x/Makefile rename arch/arm/mach-k3/{ => am65x}/am654_fdt.c (88%) rename arch/arm/mach-k3/{ => am65x}/am654_init.c (99%) create mode 100644 arch/arm/mach-k3/j721e/Makefile rename arch/arm/mach-k3/{ => j721e}/j721e_fdt.c (88%) rename arch/arm/mach-k3/{ => j721e}/j721e_init.c (99%) create mode 100644 arch/arm/mach-k3/j721s2/Makefile rename arch/arm/mach-k3/{ => j721s2}/j721s2_fdt.c (88%) rename arch/arm/mach-k3/{ => j721s2}/j721s2_init.c (99%) create mode 100644 arch/arm/mach-k3/j784s4/Makefile rename arch/arm/mach-k3/{ => j784s4}/j784s4_fdt.c (92%) rename arch/arm/mach-k3/{ => j784s4}/j784s4_init.c (99%) diff --git a/arch/arm/mach-k3/Makefile b/arch/arm/mach-k3/Makefile index 3101f57d32..2b3ebd5c53 100644 --- a/arch/arm/mach-k3/Makefile +++ b/arch/arm/mach-k3/Makefile @@ -6,24 +6,12 @@ obj-$(CONFIG_ARM64) += arm64/ obj-$(CONFIG_CPU_V7R) += r5/ obj-$(CONFIG_OF_LIBFDT) += common_fdt.o -ifeq ($(CONFIG_OF_LIBFDT)$(CONFIG_OF_SYSTEM_SETUP),yy) -obj-$(CONFIG_SOC_K3_AM654) += am654_fdt.o -obj-$(CONFIG_SOC_K3_J721E) += j721e_fdt.o -obj-$(CONFIG_SOC_K3_J721S2) += j721s2_fdt.o -obj-$(CONFIG_SOC_K3_AM625) += am625_fdt.o -obj-$(CONFIG_SOC_K3_AM62A7) += am62a7_fdt.o -obj-$(CONFIG_SOC_K3_J784S4) += j784s4_fdt.o -endif -ifeq ($(CONFIG_SPL_BUILD),y) -obj-$(CONFIG_SOC_K3_AM654) += am654_init.o -obj-$(CONFIG_SOC_K3_J721E) += j721e_init.o -obj-$(CONFIG_SOC_K3_J721S2) += j721s2_init.o -obj-$(CONFIG_SOC_K3_AM642) += am642_init.o -obj-$(CONFIG_SOC_K3_AM625) += am625_init.o -obj-$(CONFIG_SOC_K3_AM62A7) += am62a7_init.o -obj-$(CONFIG_SOC_K3_J784S4) += j784s4_init.o -obj-$(CONFIG_SOC_K3_AM62P5) += am62p5_init.o -endif obj-y += common.o security.o +obj-$(CONFIG_SOC_K3_AM62A7) += am62ax/ +obj-$(CONFIG_SOC_K3_AM62P5) += am62px/ obj-$(CONFIG_SOC_K3_AM625) += am62x/ obj-$(CONFIG_SOC_K3_AM642) += am64x/ +obj-$(CONFIG_SOC_K3_AM654) += am65x/ +obj-$(CONFIG_SOC_K3_J721E) += j721e/ +obj-$(CONFIG_SOC_K3_J721S2) += j721s2/ +obj-$(CONFIG_SOC_K3_J784S4) += j784s4/ diff --git a/arch/arm/mach-k3/am62ax/Makefile b/arch/arm/mach-k3/am62ax/Makefile new file mode 100644 index 0000000000..1717ca343d --- /dev/null +++ b/arch/arm/mach-k3/am62ax/Makefile @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/ +# Andrew Davis + +obj-$(CONFIG_OF_SYSTEM_SETUP) += am62a7_fdt.o +obj-$(CONFIG_SPL_BUILD) += am62a7_init.o diff --git a/arch/arm/mach-k3/am62a7_fdt.c b/arch/arm/mach-k3/am62ax/am62a7_fdt.c similarity index 93% rename from arch/arm/mach-k3/am62a7_fdt.c rename to arch/arm/mach-k3/am62ax/am62a7_fdt.c index d67f012a5d..7f764ab36b 100644 --- a/arch/arm/mach-k3/am62a7_fdt.c +++ b/arch/arm/mach-k3/am62ax/am62a7_fdt.c @@ -4,9 +4,10 @@ */ #include -#include "common_fdt.h" #include +#include "../common_fdt.h" + int ft_system_setup(void *blob, struct bd_info *bd) { fdt_fixup_reserved(blob, "tfa", CONFIG_K3_ATF_LOAD_ADDR, 0x80000); diff --git a/arch/arm/mach-k3/am62a7_init.c b/arch/arm/mach-k3/am62ax/am62a7_init.c similarity index 99% rename from arch/arm/mach-k3/am62a7_init.c rename to arch/arm/mach-k3/am62ax/am62a7_init.c index 658828cf75..0f62f39075 100644 --- a/arch/arm/mach-k3/am62a7_init.c +++ b/arch/arm/mach-k3/am62ax/am62a7_init.c @@ -8,12 +8,13 @@ #include #include #include -#include "sysfw-loader.h" -#include "common.h" #include #include #include +#include "../sysfw-loader.h" +#include "../common.h" + struct fwl_data cbass_main_fwls[] = { { "FSS_DAT_REG3", 7, 8 }, }; diff --git a/arch/arm/mach-k3/am62px/Makefile b/arch/arm/mach-k3/am62px/Makefile new file mode 100644 index 0000000000..5902862b29 --- /dev/null +++ b/arch/arm/mach-k3/am62px/Makefile @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/ +# Andrew Davis + +obj-$(CONFIG_SPL_BUILD) += am62p5_init.o diff --git a/arch/arm/mach-k3/am62p5_init.c b/arch/arm/mach-k3/am62px/am62p5_init.c similarity index 99% rename from arch/arm/mach-k3/am62p5_init.c rename to arch/arm/mach-k3/am62px/am62p5_init.c index aab99aa0c9..34ed01cd78 100644 --- a/arch/arm/mach-k3/am62p5_init.c +++ b/arch/arm/mach-k3/am62px/am62p5_init.c @@ -8,12 +8,13 @@ #include #include #include -#include "sysfw-loader.h" -#include "common.h" #include #include #include +#include "../sysfw-loader.h" +#include "../common.h" + struct fwl_data cbass_main_fwls[] = { { "FSS_DAT_REG3", 7, 8 }, }; diff --git a/arch/arm/mach-k3/am62x/Makefile b/arch/arm/mach-k3/am62x/Makefile index acf09c3426..8494cdda48 100644 --- a/arch/arm/mach-k3/am62x/Makefile +++ b/arch/arm/mach-k3/am62x/Makefile @@ -1,2 +1,5 @@ # SPDX-License-Identifier: GPL-2.0+ + +obj-$(CONFIG_OF_SYSTEM_SETUP) += am625_fdt.o +obj-$(CONFIG_SPL_BUILD) += am625_init.o obj-y += boot.o diff --git a/arch/arm/mach-k3/am625_fdt.c b/arch/arm/mach-k3/am62x/am625_fdt.c similarity index 98% rename from arch/arm/mach-k3/am625_fdt.c rename to arch/arm/mach-k3/am62x/am625_fdt.c index c56adef13b..8fe200a423 100644 --- a/arch/arm/mach-k3/am625_fdt.c +++ b/arch/arm/mach-k3/am62x/am625_fdt.c @@ -4,9 +4,10 @@ */ #include -#include "common_fdt.h" #include +#include "../common_fdt.h" + static void fdt_fixup_cores_nodes_am625(void *blob, int core_nr) { char node_path[32]; diff --git a/arch/arm/mach-k3/am625_init.c b/arch/arm/mach-k3/am62x/am625_init.c similarity index 99% rename from arch/arm/mach-k3/am625_init.c rename to arch/arm/mach-k3/am62x/am625_init.c index 668f9a51ef..ed8d24e043 100644 --- a/arch/arm/mach-k3/am625_init.c +++ b/arch/arm/mach-k3/am62x/am625_init.c @@ -9,13 +9,14 @@ #include #include #include -#include "sysfw-loader.h" -#include "common.h" #include #include #include #include +#include "../sysfw-loader.h" +#include "../common.h" + #define RTC_BASE_ADDRESS 0x2b1f0000 #define REG_K3RTC_S_CNT_LSW (RTC_BASE_ADDRESS + 0x18) #define REG_K3RTC_KICK0 (RTC_BASE_ADDRESS + 0x70) diff --git a/arch/arm/mach-k3/am64x/Makefile b/arch/arm/mach-k3/am64x/Makefile index acf09c3426..d0b286276c 100644 --- a/arch/arm/mach-k3/am64x/Makefile +++ b/arch/arm/mach-k3/am64x/Makefile @@ -1,2 +1,4 @@ # SPDX-License-Identifier: GPL-2.0+ + +obj-$(CONFIG_SPL_BUILD) += am642_init.o obj-y += boot.o diff --git a/arch/arm/mach-k3/am642_init.c b/arch/arm/mach-k3/am64x/am642_init.c similarity index 99% rename from arch/arm/mach-k3/am642_init.c rename to arch/arm/mach-k3/am64x/am642_init.c index f341b4f367..41812b7dbf 100644 --- a/arch/arm/mach-k3/am642_init.c +++ b/arch/arm/mach-k3/am64x/am642_init.c @@ -11,8 +11,6 @@ #include #include #include -#include "sysfw-loader.h" -#include "common.h" #include #include #include @@ -21,6 +19,9 @@ #include #include +#include "../sysfw-loader.h" +#include "../common.h" + #define CTRLMMR_MCU_RST_CTRL 0x04518170 #define CTRLMMR_MCU_RST_SRC (MCU_CTRL_MMR0_BASE + 0x18178) diff --git a/arch/arm/mach-k3/am65x/Makefile b/arch/arm/mach-k3/am65x/Makefile new file mode 100644 index 0000000000..20d5f1d3bf --- /dev/null +++ b/arch/arm/mach-k3/am65x/Makefile @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/ +# Andrew Davis + +obj-$(CONFIG_OF_SYSTEM_SETUP) += am654_fdt.o +obj-$(CONFIG_SPL_BUILD) += am654_init.o diff --git a/arch/arm/mach-k3/am654_fdt.c b/arch/arm/mach-k3/am65x/am654_fdt.c similarity index 88% rename from arch/arm/mach-k3/am654_fdt.c rename to arch/arm/mach-k3/am65x/am654_fdt.c index 652fe8d32b..bcb15208be 100644 --- a/arch/arm/mach-k3/am654_fdt.c +++ b/arch/arm/mach-k3/am65x/am654_fdt.c @@ -3,9 +3,10 @@ * Copyright 2023 Toradex - https://www.toradex.com/ */ -#include "common_fdt.h" #include +#include "../common_fdt.h" + int ft_system_setup(void *blob, struct bd_info *bd) { return fdt_fixup_msmc_ram_k3(blob); diff --git a/arch/arm/mach-k3/am654_init.c b/arch/arm/mach-k3/am65x/am654_init.c similarity index 99% rename from arch/arm/mach-k3/am654_init.c rename to arch/arm/mach-k3/am65x/am654_init.c index 7c2a143ed1..a4f038029d 100644 --- a/arch/arm/mach-k3/am654_init.c +++ b/arch/arm/mach-k3/am65x/am654_init.c @@ -12,8 +12,6 @@ #include #include #include -#include "sysfw-loader.h" -#include "common.h" #include #include #include @@ -22,6 +20,9 @@ #include #include +#include "../sysfw-loader.h" +#include "../common.h" + DECLARE_GLOBAL_DATA_PTR; #ifdef CONFIG_K3_LOAD_SYSFW diff --git a/arch/arm/mach-k3/j721e/Makefile b/arch/arm/mach-k3/j721e/Makefile new file mode 100644 index 0000000000..982b88db57 --- /dev/null +++ b/arch/arm/mach-k3/j721e/Makefile @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/ +# Andrew Davis + +obj-$(CONFIG_OF_SYSTEM_SETUP) += j721e_fdt.o +obj-$(CONFIG_SPL_BUILD) += j721e_init.o diff --git a/arch/arm/mach-k3/j721e_fdt.c b/arch/arm/mach-k3/j721e/j721e_fdt.c similarity index 88% rename from arch/arm/mach-k3/j721e_fdt.c rename to arch/arm/mach-k3/j721e/j721e_fdt.c index 652fe8d32b..bcb15208be 100644 --- a/arch/arm/mach-k3/j721e_fdt.c +++ b/arch/arm/mach-k3/j721e/j721e_fdt.c @@ -3,9 +3,10 @@ * Copyright 2023 Toradex - https://www.toradex.com/ */ -#include "common_fdt.h" #include +#include "../common_fdt.h" + int ft_system_setup(void *blob, struct bd_info *bd) { return fdt_fixup_msmc_ram_k3(blob); diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e/j721e_init.c similarity index 99% rename from arch/arm/mach-k3/j721e_init.c rename to arch/arm/mach-k3/j721e/j721e_init.c index 7ee9b75de4..c2024f2500 100644 --- a/arch/arm/mach-k3/j721e_init.c +++ b/arch/arm/mach-k3/j721e/j721e_init.c @@ -11,8 +11,6 @@ #include #include #include -#include "sysfw-loader.h" -#include "common.h" #include #include #include @@ -22,6 +20,9 @@ #include #include +#include "../sysfw-loader.h" +#include "../common.h" + #ifdef CONFIG_K3_LOAD_SYSFW struct fwl_data cbass_hc_cfg0_fwls[] = { #if defined(CONFIG_TARGET_J721E_R5_EVM) diff --git a/arch/arm/mach-k3/j721s2/Makefile b/arch/arm/mach-k3/j721s2/Makefile new file mode 100644 index 0000000000..ceef68297c --- /dev/null +++ b/arch/arm/mach-k3/j721s2/Makefile @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/ +# Andrew Davis + +obj-$(CONFIG_OF_SYSTEM_SETUP) += j721s2_fdt.o +obj-$(CONFIG_SPL_BUILD) += j721s2_init.o diff --git a/arch/arm/mach-k3/j721s2_fdt.c b/arch/arm/mach-k3/j721s2/j721s2_fdt.c similarity index 88% rename from arch/arm/mach-k3/j721s2_fdt.c rename to arch/arm/mach-k3/j721s2/j721s2_fdt.c index 652fe8d32b..bcb15208be 100644 --- a/arch/arm/mach-k3/j721s2_fdt.c +++ b/arch/arm/mach-k3/j721s2/j721s2_fdt.c @@ -3,9 +3,10 @@ * Copyright 2023 Toradex - https://www.toradex.com/ */ -#include "common_fdt.h" #include +#include "../common_fdt.h" + int ft_system_setup(void *blob, struct bd_info *bd) { return fdt_fixup_msmc_ram_k3(blob); diff --git a/arch/arm/mach-k3/j721s2_init.c b/arch/arm/mach-k3/j721s2/j721s2_init.c similarity index 99% rename from arch/arm/mach-k3/j721s2_init.c rename to arch/arm/mach-k3/j721s2/j721s2_init.c index 3374889558..fe9766e9b4 100644 --- a/arch/arm/mach-k3/j721s2_init.c +++ b/arch/arm/mach-k3/j721s2/j721s2_init.c @@ -11,8 +11,6 @@ #include #include #include -#include "sysfw-loader.h" -#include "common.h" #include #include #include @@ -21,6 +19,9 @@ #include #include +#include "../sysfw-loader.h" +#include "../common.h" + struct fwl_data cbass_hc_cfg0_fwls[] = { { "PCIE0_CFG", 2577, 7 }, { "EMMC8SS0_CFG", 2579, 4 }, diff --git a/arch/arm/mach-k3/j784s4/Makefile b/arch/arm/mach-k3/j784s4/Makefile new file mode 100644 index 0000000000..6d1841e3f9 --- /dev/null +++ b/arch/arm/mach-k3/j784s4/Makefile @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/ +# Andrew Davis + +obj-$(CONFIG_OF_SYSTEM_SETUP) += j784s4_fdt.o +obj-$(CONFIG_SPL_BUILD) += j784s4_init.o diff --git a/arch/arm/mach-k3/j784s4_fdt.c b/arch/arm/mach-k3/j784s4/j784s4_fdt.c similarity index 92% rename from arch/arm/mach-k3/j784s4_fdt.c rename to arch/arm/mach-k3/j784s4/j784s4_fdt.c index d05ed8b991..e127509705 100644 --- a/arch/arm/mach-k3/j784s4_fdt.c +++ b/arch/arm/mach-k3/j784s4/j784s4_fdt.c @@ -6,9 +6,10 @@ * Apurva Nandan */ -#include "common_fdt.h" #include +#include "../common_fdt.h" + int ft_system_setup(void *blob, struct bd_info *bd) { return fdt_fixup_msmc_ram_k3(blob); diff --git a/arch/arm/mach-k3/j784s4_init.c b/arch/arm/mach-k3/j784s4/j784s4_init.c similarity index 99% rename from arch/arm/mach-k3/j784s4_init.c rename to arch/arm/mach-k3/j784s4/j784s4_init.c index ae4420362d..1ce13e0f49 100644 --- a/arch/arm/mach-k3/j784s4_init.c +++ b/arch/arm/mach-k3/j784s4/j784s4_init.c @@ -11,8 +11,6 @@ #include #include #include -#include "sysfw-loader.h" -#include "common.h" #include #include #include @@ -20,6 +18,9 @@ #include #include +#include "../sysfw-loader.h" +#include "../common.h" + #define J784S4_MAX_DDR_CONTROLLERS 4 struct fwl_data infra_cbass0_fwls[] = { -- 2.39.5