From c98bf0533be6479f6b7d973b2419e9c4b7181456 Mon Sep 17 00:00:00 2001 From: Philip Molloy Date: Tue, 24 Mar 2026 10:09:44 +0000 Subject: arm: mach-sc5xx: Align header paths with SYS_SOC convention Define CONFIG_SYS_SOC in the mach-sc5xx Kconfig. Follow the standard U-Boot include path convention by moving the SC5xx SoC headers from arch/arm/include/asm/arch-adi/sc5xx/ to the conventional arch/arm/include/asm/arch-sc5xx/ location. Update includes from to across mach-sc5xx and board files. Signed-off-by: Philip Molloy --- MAINTAINERS | 2 +- arch/arm/include/asm/arch-adi/sc5xx/sc5xx.h | 37 -------------------------- arch/arm/include/asm/arch-adi/sc5xx/soc.h | 16 ----------- arch/arm/include/asm/arch-adi/sc5xx/spl.h | 41 ----------------------------- arch/arm/include/asm/arch-sc5xx/sc5xx.h | 37 ++++++++++++++++++++++++++ arch/arm/include/asm/arch-sc5xx/soc.h | 16 +++++++++++ arch/arm/include/asm/arch-sc5xx/spl.h | 41 +++++++++++++++++++++++++++++ arch/arm/mach-sc5xx/Kconfig | 3 +++ arch/arm/mach-sc5xx/init/clkinit.c | 2 +- arch/arm/mach-sc5xx/init/dmcinit.c | 2 +- arch/arm/mach-sc5xx/sc57x-spl.c | 2 +- arch/arm/mach-sc5xx/sc57x.c | 4 +-- arch/arm/mach-sc5xx/sc58x-spl.c | 2 +- arch/arm/mach-sc5xx/sc58x.c | 4 +-- arch/arm/mach-sc5xx/sc59x-spl.c | 2 +- arch/arm/mach-sc5xx/sc59x.c | 4 +-- arch/arm/mach-sc5xx/sc59x_64-spl.c | 2 +- arch/arm/mach-sc5xx/sc59x_64.c | 4 +-- arch/arm/mach-sc5xx/soc.c | 4 +-- arch/arm/mach-sc5xx/spl.c | 4 +-- board/adi/carriers/somcrr_common.c | 2 +- board/adi/common-sc594-som/sc594-som.c | 4 +-- board/adi/common-sc598-som/sc598-som.c | 4 +-- board/adi/sc573-ezkit/sc573-ezkit.c | 4 +-- board/adi/sc584-ezkit/sc584-ezkit.c | 4 +-- board/adi/sc589-ezkit/sc589-ezkit.c | 4 +-- board/adi/sc589-mini/sc589-mini.c | 4 +-- drivers/net/dwc_eth_qos_adi.c | 2 +- 28 files changed, 130 insertions(+), 127 deletions(-) delete mode 100644 arch/arm/include/asm/arch-adi/sc5xx/sc5xx.h delete mode 100644 arch/arm/include/asm/arch-adi/sc5xx/soc.h delete mode 100644 arch/arm/include/asm/arch-adi/sc5xx/spl.h create mode 100644 arch/arm/include/asm/arch-sc5xx/sc5xx.h create mode 100644 arch/arm/include/asm/arch-sc5xx/soc.h create mode 100644 arch/arm/include/asm/arch-sc5xx/spl.h diff --git a/MAINTAINERS b/MAINTAINERS index 6c596971ae4..78d84e701c6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -640,7 +640,7 @@ L: linux@analog.com S: Supported T: git https://github.com/analogdevicesinc/u-boot F: arch/arm/dts/sc5* -F: arch/arm/include/asm/arch-adi/ +F: arch/arm/include/asm/arch-sc5xx/ F: arch/arm/mach-sc5xx/ F: board/adi/ F: configs/sc5* diff --git a/arch/arm/include/asm/arch-adi/sc5xx/sc5xx.h b/arch/arm/include/asm/arch-adi/sc5xx/sc5xx.h deleted file mode 100644 index c80de67d7ae..00000000000 --- a/arch/arm/include/asm/arch-adi/sc5xx/sc5xx.h +++ /dev/null @@ -1,37 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* - * (C) Copyright 2022 - Analog Devices, Inc. - * - * Written by Timesys Corporation - * - */ -#ifndef ARCH_ADI_SC5XX_SC5XX_H -#define ARCH_ADI_SC5XX_SC5XX_H - -#include - -#define TWI0_CLKDIV 0x31001400 // TWI0 SCL Clock Divider Register -#define TWI1_CLKDIV 0x31001500 // TWI1 SCL Clock Divider Register -#define TWI2_CLKDIV 0x31001600 // TWI2 SCL Clock Divider Register - -const char *sc5xx_get_boot_mode(u32 *bmode); -void sc5xx_enable_rgmii(void); - -void sc5xx_enable_ns_sharc_access(uintptr_t securec0_base); -void sc5xx_disable_spu0(uintptr_t spu0_start, uintptr_t spu0_end); -void sc5xx_enable_pmu(void); - -/** - * Per-SoC init function to be used to initialize hw-specific things. Examples: - * enable PMU on armv7, enable coresight timer on armv8, etc. - */ -void sc5xx_soc_init(void); - -/* - * Reconfigure SPI memory map region for OSPI use. The adi-spi3 driver - * does not use the memory map, while the OSPI driver requires it. Only - * available on sc59x and sc59x-64 - */ -void sc59x_remap_ospi(void); - -#endif diff --git a/arch/arm/include/asm/arch-adi/sc5xx/soc.h b/arch/arm/include/asm/arch-adi/sc5xx/soc.h deleted file mode 100644 index 065d272acab..00000000000 --- a/arch/arm/include/asm/arch-adi/sc5xx/soc.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* - * (C) Copyright 2022 - Analog Devices, Inc. - * - * Written by Timesys Corporation - * - */ - -#ifndef BOARD_ADI_COMMON_SOC_H -#define BOARD_ADI_COMMON_SOC_H - -#include - -void fixup_dp83867_phy(struct phy_device *phydev); - -#endif diff --git a/arch/arm/include/asm/arch-adi/sc5xx/spl.h b/arch/arm/include/asm/arch-adi/sc5xx/spl.h deleted file mode 100644 index 077667daa10..00000000000 --- a/arch/arm/include/asm/arch-adi/sc5xx/spl.h +++ /dev/null @@ -1,41 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* - * (C) Copyright 2022 - Analog Devices, Inc. - * - * Written by Timesys Corporation - * - */ -#ifndef ARCH_ADI_SC5XX_SPL_H -#define ARCH_ADI_SC5XX_SPL_H - -#include - -struct adi_boot_args { - phys_addr_t addr; - u32 flags; - u32 cmd; -}; - -extern u32 bmode; - -/** - * This table stores the arguments to the rom boot function per bootmode, - * and it is populated per SoC in the corresponding SoC support file (sc7x, sc58x, - * and so on). - */ -extern const struct adi_boot_args adi_rom_boot_args[8]; - -/** - * Struct layout for the boot config is also specific to an SoC, so you should - * only access it inside an SoC-specific boot hook function, which will be called - * from the boot rom while going from SPL to proper u-boot - */ -struct ADI_ROM_BOOT_CONFIG; -int32_t adi_rom_boot_hook(struct ADI_ROM_BOOT_CONFIG *cfg, int32_t cause); - -typedef void (*adi_rom_boot_fn)(void *address, uint32_t flags, int32_t count, - void *hook, uint32_t command); - -extern adi_rom_boot_fn adi_rom_boot; - -#endif diff --git a/arch/arm/include/asm/arch-sc5xx/sc5xx.h b/arch/arm/include/asm/arch-sc5xx/sc5xx.h new file mode 100644 index 00000000000..c80de67d7ae --- /dev/null +++ b/arch/arm/include/asm/arch-sc5xx/sc5xx.h @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * (C) Copyright 2022 - Analog Devices, Inc. + * + * Written by Timesys Corporation + * + */ +#ifndef ARCH_ADI_SC5XX_SC5XX_H +#define ARCH_ADI_SC5XX_SC5XX_H + +#include + +#define TWI0_CLKDIV 0x31001400 // TWI0 SCL Clock Divider Register +#define TWI1_CLKDIV 0x31001500 // TWI1 SCL Clock Divider Register +#define TWI2_CLKDIV 0x31001600 // TWI2 SCL Clock Divider Register + +const char *sc5xx_get_boot_mode(u32 *bmode); +void sc5xx_enable_rgmii(void); + +void sc5xx_enable_ns_sharc_access(uintptr_t securec0_base); +void sc5xx_disable_spu0(uintptr_t spu0_start, uintptr_t spu0_end); +void sc5xx_enable_pmu(void); + +/** + * Per-SoC init function to be used to initialize hw-specific things. Examples: + * enable PMU on armv7, enable coresight timer on armv8, etc. + */ +void sc5xx_soc_init(void); + +/* + * Reconfigure SPI memory map region for OSPI use. The adi-spi3 driver + * does not use the memory map, while the OSPI driver requires it. Only + * available on sc59x and sc59x-64 + */ +void sc59x_remap_ospi(void); + +#endif diff --git a/arch/arm/include/asm/arch-sc5xx/soc.h b/arch/arm/include/asm/arch-sc5xx/soc.h new file mode 100644 index 00000000000..065d272acab --- /dev/null +++ b/arch/arm/include/asm/arch-sc5xx/soc.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * (C) Copyright 2022 - Analog Devices, Inc. + * + * Written by Timesys Corporation + * + */ + +#ifndef BOARD_ADI_COMMON_SOC_H +#define BOARD_ADI_COMMON_SOC_H + +#include + +void fixup_dp83867_phy(struct phy_device *phydev); + +#endif diff --git a/arch/arm/include/asm/arch-sc5xx/spl.h b/arch/arm/include/asm/arch-sc5xx/spl.h new file mode 100644 index 00000000000..077667daa10 --- /dev/null +++ b/arch/arm/include/asm/arch-sc5xx/spl.h @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * (C) Copyright 2022 - Analog Devices, Inc. + * + * Written by Timesys Corporation + * + */ +#ifndef ARCH_ADI_SC5XX_SPL_H +#define ARCH_ADI_SC5XX_SPL_H + +#include + +struct adi_boot_args { + phys_addr_t addr; + u32 flags; + u32 cmd; +}; + +extern u32 bmode; + +/** + * This table stores the arguments to the rom boot function per bootmode, + * and it is populated per SoC in the corresponding SoC support file (sc7x, sc58x, + * and so on). + */ +extern const struct adi_boot_args adi_rom_boot_args[8]; + +/** + * Struct layout for the boot config is also specific to an SoC, so you should + * only access it inside an SoC-specific boot hook function, which will be called + * from the boot rom while going from SPL to proper u-boot + */ +struct ADI_ROM_BOOT_CONFIG; +int32_t adi_rom_boot_hook(struct ADI_ROM_BOOT_CONFIG *cfg, int32_t cause); + +typedef void (*adi_rom_boot_fn)(void *address, uint32_t flags, int32_t count, + void *hook, uint32_t command); + +extern adi_rom_boot_fn adi_rom_boot; + +#endif diff --git a/arch/arm/mach-sc5xx/Kconfig b/arch/arm/mach-sc5xx/Kconfig index 774c69091ee..cfa7ed46a82 100644 --- a/arch/arm/mach-sc5xx/Kconfig +++ b/arch/arm/mach-sc5xx/Kconfig @@ -13,6 +13,9 @@ if ARCH_SC5XX config SYS_VENDOR default "adi" +config SYS_SOC + default "sc5xx" + choice prompt "SC5xx SoC Select" help diff --git a/arch/arm/mach-sc5xx/init/clkinit.c b/arch/arm/mach-sc5xx/init/clkinit.c index 3dcba33bd1b..f9c83c6efac 100644 --- a/arch/arm/mach-sc5xx/init/clkinit.c +++ b/arch/arm/mach-sc5xx/init/clkinit.c @@ -6,7 +6,7 @@ * */ -#include +#include #include #include #include "clkinit.h" diff --git a/arch/arm/mach-sc5xx/init/dmcinit.c b/arch/arm/mach-sc5xx/init/dmcinit.c index 2bf2cc53a9f..12052613feb 100644 --- a/arch/arm/mach-sc5xx/init/dmcinit.c +++ b/arch/arm/mach-sc5xx/init/dmcinit.c @@ -7,7 +7,7 @@ */ #include -#include +#include #include #include "clkinit.h" #include "dmcinit.h" diff --git a/arch/arm/mach-sc5xx/sc57x-spl.c b/arch/arm/mach-sc5xx/sc57x-spl.c index 28380b89b48..6084493cf4f 100644 --- a/arch/arm/mach-sc5xx/sc57x-spl.c +++ b/arch/arm/mach-sc5xx/sc57x-spl.c @@ -3,7 +3,7 @@ * (C) Copyright 2024 - Analog Devices, Inc. */ -#include +#include // Table 45-16 in SC573 HRM const struct adi_boot_args adi_rom_boot_args[] = { diff --git a/arch/arm/mach-sc5xx/sc57x.c b/arch/arm/mach-sc5xx/sc57x.c index 02b04cd1b2f..7e58e92b188 100644 --- a/arch/arm/mach-sc5xx/sc57x.c +++ b/arch/arm/mach-sc5xx/sc57x.c @@ -7,8 +7,8 @@ */ #include -#include -#include +#include +#include #define REG_SPU0_SECUREC0 0x3108B980 #define REG_PADS0_PCFG0 0x31004404 diff --git a/arch/arm/mach-sc5xx/sc58x-spl.c b/arch/arm/mach-sc5xx/sc58x-spl.c index ae809f09e55..2582e38ce12 100644 --- a/arch/arm/mach-sc5xx/sc58x-spl.c +++ b/arch/arm/mach-sc5xx/sc58x-spl.c @@ -3,7 +3,7 @@ * (C) Copyright 2024 - Analog Devices, Inc. */ -#include +#include // Table 53-13 in SC58x HRM const struct adi_boot_args adi_rom_boot_args[] = { diff --git a/arch/arm/mach-sc5xx/sc58x.c b/arch/arm/mach-sc5xx/sc58x.c index c981cafd986..dc11df683a8 100644 --- a/arch/arm/mach-sc5xx/sc58x.c +++ b/arch/arm/mach-sc5xx/sc58x.c @@ -7,8 +7,8 @@ */ #include -#include -#include +#include +#include #define REG_SPU0_SECUREC0 0x3108C980 #define REG_PADS0_PCFG0 0x31004404 diff --git a/arch/arm/mach-sc5xx/sc59x-spl.c b/arch/arm/mach-sc5xx/sc59x-spl.c index c8fc25fe7c4..883bdb3c772 100644 --- a/arch/arm/mach-sc5xx/sc59x-spl.c +++ b/arch/arm/mach-sc5xx/sc59x-spl.c @@ -3,7 +3,7 @@ * (C) Copyright 2024 - Analog Devices, Inc. */ -#include +#include // Table 45-14 in sc594 HRM const struct adi_boot_args adi_rom_boot_args[] = { diff --git a/arch/arm/mach-sc5xx/sc59x.c b/arch/arm/mach-sc5xx/sc59x.c index 675f8c7d69a..286f6d52eef 100644 --- a/arch/arm/mach-sc5xx/sc59x.c +++ b/arch/arm/mach-sc5xx/sc59x.c @@ -7,8 +7,8 @@ */ #include -#include -#include +#include +#include #define REG_SPU0_SECUREC0 0x3108B980 #define REG_PADS0_PCFG0 0x31004604 diff --git a/arch/arm/mach-sc5xx/sc59x_64-spl.c b/arch/arm/mach-sc5xx/sc59x_64-spl.c index 3992538133d..500824b5bb9 100644 --- a/arch/arm/mach-sc5xx/sc59x_64-spl.c +++ b/arch/arm/mach-sc5xx/sc59x_64-spl.c @@ -3,7 +3,7 @@ * (C) Copyright 2024 - Analog Devices, Inc. */ -#include +#include // Table 47-14 in SC598 hardware reference manual const struct adi_boot_args adi_rom_boot_args[] = { diff --git a/arch/arm/mach-sc5xx/sc59x_64.c b/arch/arm/mach-sc5xx/sc59x_64.c index a8402075d0a..b9694a48e87 100644 --- a/arch/arm/mach-sc5xx/sc59x_64.c +++ b/arch/arm/mach-sc5xx/sc59x_64.c @@ -8,8 +8,8 @@ #include #include -#include -#include +#include +#include #define REG_TSGENWR0_CNTCR 0x310AE000 #define REG_PADS0_PCFG0 0x31004604 diff --git a/arch/arm/mach-sc5xx/soc.c b/arch/arm/mach-sc5xx/soc.c index cf8ff0dc3af..09978a5cf44 100644 --- a/arch/arm/mach-sc5xx/soc.c +++ b/arch/arm/mach-sc5xx/soc.c @@ -6,8 +6,8 @@ * */ -#include -#include +#include +#include #include #include #include diff --git a/arch/arm/mach-sc5xx/spl.c b/arch/arm/mach-sc5xx/spl.c index c529829420d..94e4a08fa32 100644 --- a/arch/arm/mach-sc5xx/spl.c +++ b/arch/arm/mach-sc5xx/spl.c @@ -7,8 +7,8 @@ */ #include -#include -#include +#include +#include #include "init/clkinit.h" #include "init/dmcinit.h" diff --git a/board/adi/carriers/somcrr_common.c b/board/adi/carriers/somcrr_common.c index 34ae48f31d2..7bd890d6e70 100644 --- a/board/adi/carriers/somcrr_common.c +++ b/board/adi/carriers/somcrr_common.c @@ -3,7 +3,7 @@ * (C) Copyright 2025 - Analog Devices, Inc. */ -#include +#include #include #include "somcrr.h" diff --git a/board/adi/common-sc594-som/sc594-som.c b/board/adi/common-sc594-som/sc594-som.c index aab729fc761..37817c4b062 100644 --- a/board/adi/common-sc594-som/sc594-som.c +++ b/board/adi/common-sc594-som/sc594-som.c @@ -6,8 +6,8 @@ #include #include #include -#include -#include +#include +#include #include "../carriers/somcrr.h" diff --git a/board/adi/common-sc598-som/sc598-som.c b/board/adi/common-sc598-som/sc598-som.c index 96b73520e66..0e1ee828956 100644 --- a/board/adi/common-sc598-som/sc598-som.c +++ b/board/adi/common-sc598-som/sc598-som.c @@ -6,8 +6,8 @@ #include #include #include -#include -#include +#include +#include #include #include "../carriers/somcrr.h" diff --git a/board/adi/sc573-ezkit/sc573-ezkit.c b/board/adi/sc573-ezkit/sc573-ezkit.c index 288c2670761..464142b27a5 100644 --- a/board/adi/sc573-ezkit/sc573-ezkit.c +++ b/board/adi/sc573-ezkit/sc573-ezkit.c @@ -5,8 +5,8 @@ #include #include -#include -#include +#include +#include int board_phy_config(struct phy_device *phydev) { diff --git a/board/adi/sc584-ezkit/sc584-ezkit.c b/board/adi/sc584-ezkit/sc584-ezkit.c index 288c2670761..464142b27a5 100644 --- a/board/adi/sc584-ezkit/sc584-ezkit.c +++ b/board/adi/sc584-ezkit/sc584-ezkit.c @@ -5,8 +5,8 @@ #include #include -#include -#include +#include +#include int board_phy_config(struct phy_device *phydev) { diff --git a/board/adi/sc589-ezkit/sc589-ezkit.c b/board/adi/sc589-ezkit/sc589-ezkit.c index 288c2670761..464142b27a5 100644 --- a/board/adi/sc589-ezkit/sc589-ezkit.c +++ b/board/adi/sc589-ezkit/sc589-ezkit.c @@ -5,8 +5,8 @@ #include #include -#include -#include +#include +#include int board_phy_config(struct phy_device *phydev) { diff --git a/board/adi/sc589-mini/sc589-mini.c b/board/adi/sc589-mini/sc589-mini.c index 288c2670761..464142b27a5 100644 --- a/board/adi/sc589-mini/sc589-mini.c +++ b/board/adi/sc589-mini/sc589-mini.c @@ -5,8 +5,8 @@ #include #include -#include -#include +#include +#include int board_phy_config(struct phy_device *phydev) { diff --git a/drivers/net/dwc_eth_qos_adi.c b/drivers/net/dwc_eth_qos_adi.c index b578225eaad..37db8525b48 100644 --- a/drivers/net/dwc_eth_qos_adi.c +++ b/drivers/net/dwc_eth_qos_adi.c @@ -15,7 +15,7 @@ #include #include -#include +#include #include "dwc_eth_qos.h" -- cgit v1.2.3