arm: Add Analog Devices SC5xx Machine Type
Subsystems (4)
v2 cover arm: Add Analog Devices SC5xx Machine Type
This series adds support for the ADI SC5xx machine type and includes two core drivers that are required for being able to boot any board--a UART driver, the gptimer driver which is used as a clock reference (CNTVCNT is not supported on the armv7 sc5xx SoCs) and the clock tree driver. Our corresponding Linux support relies on u-boot configuring the clocks correctly before booting, so it is not possible to boot any board without the CGU/CDU configuration happening here. There are also no board files, device trees, or defconfigs included here, but some common definitions that will be used to build board files currently are. The sc5xx SoCs themselves include many armv7 families (sc57x, sc58x, and sc594) all using an ARM Cortex-A5, and one armv8 family (sc598) indended to be a drop-in replacement for the SC594 in terms of peripherals, with a Cortex-A55 instead.
Some of the configuration code in dmcinit and clkinit is quite scary and causes a lot of checkpatch violations. It is modified from code initially provided by ADI, but it has not been fully rewritten. There's a question of how important it is to clean up this code--it has some quality violations, but it has been in use (including in production) for over two years and is known to work for performing the low level SoC initialization, while a rewrite might introduce timing or sequence bugs that could take a significant amount of time to detect in the future.
Thank you!
Changes in v2:
- Removed MACH_TYPE constants and any references to setting the MACH_TYPE as it is not used by this platform
- Removed additional compiler flags from config.mk
- Converted to text env. Each board is expected to provide a text env and #include env/adi/adi_boot.env if it wants to use the reference ADI boot flow
- Some further cleanup on use of Kconfigs--some per board settings affecting dmcinit and clkinit have been converted to Kconfigs instead of config header constants
- Converted some #ifdef blocks into soc-specific functions with common functionality in soc.c, such as configuring SECUREC0, 1, and 2.
- Reviewed #include usage and pruned unnecessary files
- Passes gitlab CI run locally
- Added gptimer driver to this series because a minimal system can't boot without it
Greg Malysa (1):
drivers: timer: Add in driver support for ADI SC5XX-family GP timer
peripheral
Nathan Barrett-Morrison (3):
arch: arm: Add Analog Devices SC5xx machine type
drivers: clk: adi: Add in SC5XX-family clock driver
drivers: serial: Add in UART for ADI SC5XX-family processors
MAINTAINERS | 16 + arch/arm/Kconfig | 5 + arch/arm/Makefile | 1 + arch/arm/include/asm/arch-adi/sc5xx/sc5xx.h | 39 + arch/arm/include/asm/arch-adi/sc5xx/soc.h | 18 + arch/arm/include/asm/arch-adi/sc5xx/spl.h | 43 + arch/arm/mach-sc5xx/Kconfig | 475 +++++++++ arch/arm/mach-sc5xx/Makefile | 19 + arch/arm/mach-sc5xx/config.mk | 16 + arch/arm/mach-sc5xx/init/Makefile | 11 + arch/arm/mach-sc5xx/init/clkinit.c | 558 +++++++++++ arch/arm/mach-sc5xx/init/clkinit.h | 18 + arch/arm/mach-sc5xx/init/dmcinit.c | 954 +++++++++++++++++++ arch/arm/mach-sc5xx/init/dmcinit.h | 31 + arch/arm/mach-sc5xx/init/mem/is43tr16512bl.h | 62 ++ arch/arm/mach-sc5xx/init/mem/mt41k128m16jt.h | 50 + arch/arm/mach-sc5xx/init/mem/mt41k512m16ha.h | 50 + arch/arm/mach-sc5xx/init/mem/mt47h128m16rt.h | 49 + arch/arm/mach-sc5xx/rcu.c | 22 + arch/arm/mach-sc5xx/sc57x.c | 32 + arch/arm/mach-sc5xx/sc58x.c | 32 + arch/arm/mach-sc5xx/sc59x.c | 43 + arch/arm/mach-sc5xx/sc59x_64.c | 97 ++ arch/arm/mach-sc5xx/soc.c | 179 ++++ arch/arm/mach-sc5xx/spl.c | 102 ++ drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 1 + drivers/clk/adi/Kconfig | 83 ++ drivers/clk/adi/Makefile | 16 + drivers/clk/adi/clk-adi-pll.c | 93 ++ drivers/clk/adi/clk-adi-sc57x.c | 206 ++++ drivers/clk/adi/clk-adi-sc58x.c | 222 +++++ drivers/clk/adi/clk-adi-sc594.c | 231 +++++ drivers/clk/adi/clk-adi-sc598.c | 308 ++++++ drivers/clk/adi/clk-shared.c | 48 + drivers/clk/adi/clk.h | 123 +++ drivers/serial/Makefile | 1 + drivers/serial/serial_adi_uart4.c | 225 +++++ drivers/timer/Kconfig | 8 + drivers/timer/Makefile | 1 + drivers/timer/adi_sc5xx_timer.c | 145 +++ include/dt-bindings/clock/adi-sc5xx-clock.h | 271 ++++++ include/env/adi/adi_boot.env | 122 +++ 43 files changed, 5027 insertions(+) create mode 100644 arch/arm/include/asm/arch-adi/sc5xx/sc5xx.h create mode 100644 arch/arm/include/asm/arch-adi/sc5xx/soc.h create mode 100644 arch/arm/include/asm/arch-adi/sc5xx/spl.h create mode 100644 arch/arm/mach-sc5xx/Kconfig create mode 100644 arch/arm/mach-sc5xx/Makefile create mode 100644 arch/arm/mach-sc5xx/config.mk create mode 100644 arch/arm/mach-sc5xx/init/Makefile create mode 100644 arch/arm/mach-sc5xx/init/clkinit.c create mode 100644 arch/arm/mach-sc5xx/init/clkinit.h create mode 100644 arch/arm/mach-sc5xx/init/dmcinit.c create mode 100644 arch/arm/mach-sc5xx/init/dmcinit.h create mode 100644 arch/arm/mach-sc5xx/init/mem/is43tr16512bl.h create mode 100644 arch/arm/mach-sc5xx/init/mem/mt41k128m16jt.h create mode 100644 arch/arm/mach-sc5xx/init/mem/mt41k512m16ha.h create mode 100644 arch/arm/mach-sc5xx/init/mem/mt47h128m16rt.h create mode 100644 arch/arm/mach-sc5xx/rcu.c create mode 100644 arch/arm/mach-sc5xx/sc57x.c create mode 100644 arch/arm/mach-sc5xx/sc58x.c create mode 100644 arch/arm/mach-sc5xx/sc59x.c create mode 100644 arch/arm/mach-sc5xx/sc59x_64.c create mode 100644 arch/arm/mach-sc5xx/soc.c create mode 100644 arch/arm/mach-sc5xx/spl.c create mode 100644 drivers/clk/adi/Kconfig create mode 100644 drivers/clk/adi/Makefile create mode 100644 drivers/clk/adi/clk-adi-pll.c create mode 100644 drivers/clk/adi/clk-adi-sc57x.c create mode 100644 drivers/clk/adi/clk-adi-sc58x.c create mode 100644 drivers/clk/adi/clk-adi-sc594.c create mode 100644 drivers/clk/adi/clk-adi-sc598.c create mode 100644 drivers/clk/adi/clk-shared.c create mode 100644 drivers/clk/adi/clk.h create mode 100644 drivers/serial/serial_adi_uart4.c create mode 100644 drivers/timer/adi_sc5xx_timer.c create mode 100644 include/dt-bindings/clock/adi-sc5xx-clock.h create mode 100644 include/env/adi/adi_boot.env
Signature · 1 line
2.43.2
PATCH v2 1/4 arch: arm: Add Analog Devices SC5xx machine type
From: Nathan Barrett-Morrison <[email protected]>
Add support for the SC5xx machine type from Analog Devices. This includes support for the SC57x, SC58x, SC59x, and SC59x-64 SoCs, which have many common features such as common ADI IP blocks, and SHARC DSP cores. This commit introduces core functionality required for all boards using an SC5xx SoC, such as:
- SPL configuration
- Required CPU hooks such as reset
- Boot ROM interaction to load the stage 2 bootloader in the reference configuration. Other options are possible but not officially supported at this time
- SoC-common configuration expected to be reused by all boards
- Early initialization for system clocks and DDR controller
---
Changes in v2:
- Removed MACH_TYPE constants and any references to setting the MACH_TYPE as it is not used by this platform
- Removed additional compiler flags from config.mk
- Converted to text env. Each board is expected to provide a text env and #include env/adi/adi_boot.env if it wants to use the reference ADI boot flow
- Some further cleanup on use of Kconfigs--some per board settings affecting dmcinit and clkinit have been converted to Kconfigs instead of config header constants
- Reviewed #include usage and pruned unnecessary files
- Passes gitlab CI run locally
--- MAINTAINERS | 13 + arch/arm/Kconfig | 5 + arch/arm/Makefile | 1 + arch/arm/include/asm/arch-adi/sc5xx/sc5xx.h | 39 + arch/arm/include/asm/arch-adi/sc5xx/soc.h | 18 + arch/arm/include/asm/arch-adi/sc5xx/spl.h | 43 + arch/arm/mach-sc5xx/Kconfig | 475 +++++++++ arch/arm/mach-sc5xx/Makefile | 19 + arch/arm/mach-sc5xx/config.mk | 16 + arch/arm/mach-sc5xx/init/Makefile | 11 + arch/arm/mach-sc5xx/init/clkinit.c | 558 +++++++++++ arch/arm/mach-sc5xx/init/clkinit.h | 18 + arch/arm/mach-sc5xx/init/dmcinit.c | 954 +++++++++++++++++++ arch/arm/mach-sc5xx/init/dmcinit.h | 31 + arch/arm/mach-sc5xx/init/mem/is43tr16512bl.h | 62 ++ arch/arm/mach-sc5xx/init/mem/mt41k128m16jt.h | 50 + arch/arm/mach-sc5xx/init/mem/mt41k512m16ha.h | 50 + arch/arm/mach-sc5xx/init/mem/mt47h128m16rt.h | 49 + arch/arm/mach-sc5xx/rcu.c | 22 + arch/arm/mach-sc5xx/sc57x.c | 32 + arch/arm/mach-sc5xx/sc58x.c | 32 + arch/arm/mach-sc5xx/sc59x.c | 43 + arch/arm/mach-sc5xx/sc59x_64.c | 97 ++ arch/arm/mach-sc5xx/soc.c | 179 ++++ arch/arm/mach-sc5xx/spl.c | 102 ++ include/env/adi/adi_boot.env | 122 +++ 26 files changed, 3041 insertions(+) create mode 100644 arch/arm/include/asm/arch-adi/sc5xx/sc5xx.h create mode 100644 arch/arm/include/asm/arch-adi/sc5xx/soc.h create mode 100644 arch/arm/include/asm/arch-adi/sc5xx/spl.h create mode 100644 arch/arm/mach-sc5xx/Kconfig create mode 100644 arch/arm/mach-sc5xx/Makefile create mode 100644 arch/arm/mach-sc5xx/config.mk create mode 100644 arch/arm/mach-sc5xx/init/Makefile create mode 100644 arch/arm/mach-sc5xx/init/clkinit.c create mode 100644 arch/arm/mach-sc5xx/init/clkinit.h create mode 100644 arch/arm/mach-sc5xx/init/dmcinit.c create mode 100644 arch/arm/mach-sc5xx/init/dmcinit.h create mode 100644 arch/arm/mach-sc5xx/init/mem/is43tr16512bl.h create mode 100644 arch/arm/mach-sc5xx/init/mem/mt41k128m16jt.h create mode 100644 arch/arm/mach-sc5xx/init/mem/mt41k512m16ha.h create mode 100644 arch/arm/mach-sc5xx/init/mem/mt47h128m16rt.h create mode 100644 arch/arm/mach-sc5xx/rcu.c create mode 100644 arch/arm/mach-sc5xx/sc57x.c create mode 100644 arch/arm/mach-sc5xx/sc58x.c create mode 100644 arch/arm/mach-sc5xx/sc59x.c create mode 100644 arch/arm/mach-sc5xx/sc59x_64.c create mode 100644 arch/arm/mach-sc5xx/soc.c create mode 100644 arch/arm/mach-sc5xx/spl.c create mode 100644 include/env/adi/adi_boot.env
MAINTAINERS +13 -0
@@ -598,6 +598,19 @@ R: Marc Murphy <[email protected]> S: Supported F: arch/arm/dts/am335x-sancloud* +ARM SC5XX +M: Nathan Barrett-Morrison <[email protected]> +M: Greg Malysa <[email protected]> +M: Ian Roberts <[email protected]> +M: Vasileios Bimpikas <[email protected]> +M: Utsav Agarwal <[email protected]> +M: Arturs Artamonovs <[email protected]> +S: Supported +T: git https://github.com/analogdevicesinc/lnxdsp-u-boot +F: arch/arm/include/asm/arch-adi/ +F: arch/arm/mach-sc5xx/ +F: include/env/adi/ + ARM SNAPDRAGON M: Caleb Connolly <[email protected]> M: Neil Armstrong <[email protected]>
arch/arm/Kconfig +5 -0
@@ -1843,6 +1843,9 @@ config TARGET_LS1046AFRWY development platform that supports the QorIQ LS1046A Layerscape Architecture processor. +config ARCH_SC5XX + bool "Analog Devices SC5XX-processor family" + config TARGET_SL28 bool "Support sl28" select ARCH_LS1028A
@@ -2276,6 +2279,8 @@ source "arch/arm/mach-rockchip/Kconfig" source "arch/arm/mach-s5pc1xx/Kconfig" +source "arch/arm/mach-sc5xx/Kconfig" + source "arch/arm/mach-snapdragon/Kconfig" source "arch/arm/mach-socfpga/Kconfig"
arch/arm/Makefile +1 -0
@@ -78,6 +78,7 @@ machine-$(CONFIG_ARCH_OWL) += owl machine-$(CONFIG_ARCH_RENESAS) += renesas machine-$(CONFIG_ARCH_ROCKCHIP) += rockchip machine-$(CONFIG_ARCH_S5PC1XX) += s5pc1xx +machine-$(CONFIG_ARCH_SC5XX) += sc5xx machine-$(CONFIG_ARCH_SNAPDRAGON) += snapdragon machine-$(CONFIG_ARCH_SOCFPGA) += socfpga machine-$(CONFIG_ARCH_STM32) += stm32
arch/arm/include/asm/arch-adi/sc5xx/sc5xx.h new file +39 -0
@@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* +* (C) Copyright 2022 - Analog Devices, Inc. +* +* Written and/or maintained by Timesys Corporation +* +* Contact: Nathan Barrett-Morrison <[email protected]> +* Contact: Greg Malysa <[email protected]> +*/ +#ifndef ARCH_ADI_SC5XX_SC5XX_H +#define ARCH_ADI_SC5XX_SC5XX_H + +#include <linux/types.h> + +#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
arch/arm/include/asm/arch-adi/sc5xx/soc.h new file +18 -0
@@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* +* (C) Copyright 2022 - Analog Devices, Inc. +* +* Written and/or maintained by Timesys Corporation +* +* Contact: Nathan Barrett-Morrison <[email protected]> +* Contact: Greg Malysa <[email protected]> +*/ + +#ifndef BOARD_ADI_COMMON_SOC_H +#define BOARD_ADI_COMMON_SOC_H + +#include <phy.h> + +void fixup_dp83867_phy (struct phy_device *phydev); + +#endif
arch/arm/include/asm/arch-adi/sc5xx/spl.h new file +43 -0
43 lines not on this page · raw message
arch/arm/mach-sc5xx/Kconfig new file +475 -0
475 lines not on this page · raw message
arch/arm/mach-sc5xx/Makefile new file +19 -0
@@ -0,0 +1,19 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# (C) Copyright 2022 - Analog Devices, Inc. +# +# Written and/or maintained by Timesys Corporation +# +# Contact: Nathan Barrett-Morrison <[email protected]> +# Contact: Greg Malysa <[email protected]> +# + +obj-y += soc.o init/ + +obj-$(CONFIG_SC57X) += sc57x.o +obj-$(CONFIG_SC58X) += sc58x.o +obj-$(CONFIG_SC59X) += sc59x.o +obj-$(CONFIG_SC59X_64) += sc59x_64.o + +obj-$(CONFIG_SPL_BUILD) += spl.o +obj-$(CONFIG_SYSCON) += rcu.o
arch/arm/mach-sc5xx/config.mk new file +16 -0
@@ -0,0 +1,16 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# (C) Copyright 2022 - Analog Devices, Inc. +# +# Written and/or maintained by Timesys Corporation +# +# Contact: Nathan Barrett-Morrison <[email protected]> +# Contact: Greg Malysa <[email protected]> +# + +ifdef CONFIG_SPL_BUILD +INPUTS-y += $(obj)/u-boot-spl.ldr +endif + +LDR_FLAGS += --bcode=$(CONFIG_SC_BOOT_MODE) +LDR_FLAGS += --use-vmas
arch/arm/mach-sc5xx/init/Makefile new file +11 -0
@@ -0,0 +1,11 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# (C) Copyright 2022 - Analog Devices, Inc. +# +# Written and/or maintained by Timesys Corporation +# +# Contact: Nathan Barrett-Morrison <[email protected]> +# Contact: Greg Malysa <[email protected]> +# + +obj-y += dmcinit.o clkinit.o
arch/arm/mach-sc5xx/init/clkinit.c new file +558 -0
558 lines not on this page · raw message
arch/arm/mach-sc5xx/init/clkinit.h new file +18 -0
@@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* +* (C) Copyright 2022 - Analog Devices, Inc. +* +* Written and/or maintained by Timesys Corporation +* +* Contact: Nathan Barrett-Morrison <[email protected]> +* Contact: Greg Malysa <[email protected]> +*/ + +#ifndef CLKINIT_H_ +#define CLKINIT_H_ + +void clks_init (void ); + +void dmcdelay (uint32_t delay); + +#endif
arch/arm/mach-sc5xx/init/dmcinit.c new file +954 -0
954 lines not on this page · raw message
arch/arm/mach-sc5xx/init/dmcinit.h new file +31 -0
@@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* +* (C) Copyright 2022 - Analog Devices, Inc. +* +* Written and/or maintained by Timesys Corporation +* +* Contact: Nathan Barrett-Morrison <[email protected]> +* Contact: Greg Malysa <[email protected]> +*/ + +#ifndef DMCINIT_H_ +#define DMCINIT_H_ + +#include <config.h> + +#ifdef MEM_MT41K512M16HA +#include "mem/mt41k512m16ha.h" +#elif defined(MEM_MT41K128M16JT ) +#include "mem/mt41k128m16jt.h" +#elif defined(MEM_MT47H128M16RT ) +#include "mem/mt47h128m16rt.h" +#elif defined(MEM_IS43TR16512BL ) +#include "mem/is43tr16512bl.h" +#else +#error "No DDR part name is defined for this board." +#endif + +void DMC_Config (void ); +void adi_dmc_reset_lanes (bool reset); + +#endif
arch/arm/mach-sc5xx/init/mem/is43tr16512bl.h new file +62 -0
62 lines not on this page · raw message
arch/arm/mach-sc5xx/init/mem/mt41k128m16jt.h new file +50 -0
50 lines not on this page · raw message
arch/arm/mach-sc5xx/init/mem/mt41k512m16ha.h new file +50 -0
50 lines not on this page · raw message
arch/arm/mach-sc5xx/init/mem/mt47h128m16rt.h new file +49 -0
49 lines not on this page · raw message
arch/arm/mach-sc5xx/rcu.c new file +22 -0
@@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* +* (C) Copyright 2024 - Analog Devices, Inc. +* +* Written and/or maintained by Timesys Corporation +* +* Contact: Ian Roberts <[email protected]> +*/ + +#include <dm.h> +#include <syscon.h> + +static const struct udevice_id adi_syscon_ids[] = { + { .compatible ="adi,reset-controller" }, + { } +}; + +U_BOOT_DRIVER (syscon_sc5xx_rcu) = { + .name ="sc5xx_rcu" , + .id =UCLASS_SYSCON , + .of_match = adi_syscon_ids, +};
arch/arm/mach-sc5xx/sc57x.c new file +32 -0
@@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* +* (C) Copyright 2024 - Analog Devices, Inc. +* +* Written and/or maintained by Timesys Corporation +* +* Contact: Nathan Barrett-Morrison <[email protected]> +* Contact: Greg Malysa <[email protected]> +*/ + +#include <asm/io.h> +#include <asm/arch-adi/sc5xx/sc5xx.h> +#include <asm/arch-adi/sc5xx/spl.h> + +#define REG_SPU0_SECUREC0 0x3108B980 +#define REG_PADS0_PCFG0 0x31004404 +#define REG_SPU0_SECUREP_START 0x3108BA00 +#define REG_SPU0_SECUREP_END 0x3108BD24 + +adi_rom_boot_fn adi_rom_boot = (adi_rom_boot_fn )0x000000e1 ; + +void sc5xx_enable_rgmii (void ) +{ +writel ((readl (REG_PADS0_PCFG0 ) |0xc ),REG_PADS0_PCFG0 ); +} + +void sc5xx_soc_init (void ) +{ +sc5xx_enable_ns_sharc_access (REG_SPU0_SECUREC0 ); +sc5xx_disable_spu0 (REG_SPU0_SECUREP_START ,REG_SPU0_SECUREP_END ); +sc5xx_enable_pmu (); +}
arch/arm/mach-sc5xx/sc58x.c new file +32 -0
@@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* +* (C) Copyright 2024 - Analog Devices, Inc. +* +* Written and/or maintained by Timesys Corporation +* +* Contact: Nathan Barrett-Morrison <[email protected]> +* Contact: Greg Malysa <[email protected]> +*/ + +#include <asm/io.h> +#include <asm/arch-adi/sc5xx/sc5xx.h> +#include <asm/arch-adi/sc5xx/spl.h> + +#define REG_SPU0_SECUREC0 0x3108C980 +#define REG_PADS0_PCFG0 0x31004404 +#define REG_SPU0_SECUREP_START 0x3108CA00 +#define REG_SPU0_SECUREP_END 0x3108CCF0 + +adi_rom_boot_fn adi_rom_boot = (adi_rom_boot_fn )0x000000e1 ; + +void sc5xx_enable_rgmii (void ) +{ +writel ((readl (REG_PADS0_PCFG0 ) |0xc ),REG_PADS0_PCFG0 ); +} + +void sc5xx_soc_init (void ) +{ +sc5xx_enable_ns_sharc_access (REG_SPU0_SECUREC0 ); +sc5xx_disable_spu0 (REG_SPU0_SECUREP_START ,REG_SPU0_SECUREP_END ); +sc5xx_enable_pmu (); +}
arch/arm/mach-sc5xx/sc59x.c new file +43 -0
43 lines not on this page · raw message
arch/arm/mach-sc5xx/sc59x_64.c new file +97 -0
97 lines not on this page · raw message
arch/arm/mach-sc5xx/soc.c new file +179 -0
179 lines not on this page · raw message
arch/arm/mach-sc5xx/spl.c new file +102 -0
102 lines not on this page · raw message
include/env/adi/adi_boot.env new file +122 -0
57 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.43.2
Part of the diff is not shown here. View the raw message.
PATCH v2 2/4 drivers: clk: adi: Add in SC5XX-family clock driver
In reply to Greg MalysaFrom: Nathan Barrett-Morrison <[email protected]>
This adds support for the SC5XX clock trees which are required for reading clock speeds on the SoCs. This is largely a port of the same support for Linux, which has not yet been submitted upstream.
---
(no changes since v1)
MAINTAINERS | 1 + drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 1 + drivers/clk/adi/Kconfig | 83 ++++++ drivers/clk/adi/Makefile | 16 + drivers/clk/adi/clk-adi-pll.c | 93 ++++++ drivers/clk/adi/clk-adi-sc57x.c | 206 +++++++++++++ drivers/clk/adi/clk-adi-sc58x.c | 222 ++++++++++++++ drivers/clk/adi/clk-adi-sc594.c | 231 +++++++++++++++ drivers/clk/adi/clk-adi-sc598.c | 308 ++++++++++++++++++++ drivers/clk/adi/clk-shared.c | 48 +++ drivers/clk/adi/clk.h | 123 ++++++++ include/dt-bindings/clock/adi-sc5xx-clock.h | 271 +++++++++++++++++ 13 files changed, 1604 insertions(+) create mode 100644 drivers/clk/adi/Kconfig create mode 100644 drivers/clk/adi/Makefile create mode 100644 drivers/clk/adi/clk-adi-pll.c create mode 100644 drivers/clk/adi/clk-adi-sc57x.c create mode 100644 drivers/clk/adi/clk-adi-sc58x.c create mode 100644 drivers/clk/adi/clk-adi-sc594.c create mode 100644 drivers/clk/adi/clk-adi-sc598.c create mode 100644 drivers/clk/adi/clk-shared.c create mode 100644 drivers/clk/adi/clk.h create mode 100644 include/dt-bindings/clock/adi-sc5xx-clock.h
MAINTAINERS +1 -0
@@ -609,6 +609,7 @@ S: Supported T: git https://github.com/analogdevicesinc/lnxdsp-u-boot F: arch/arm/include/asm/arch-adi/ F: arch/arm/mach-sc5xx/ +F: drivers/clk/adi/ F: include/env/adi/ ARM SNAPDRAGON
drivers/clk/Kconfig +1 -0
@@ -246,6 +246,7 @@ config CLK_ZYNQMP This clock driver adds support for clock realted settings for ZynqMP platform. +source "drivers/clk/adi/Kconfig" source "drivers/clk/analogbits/Kconfig" source "drivers/clk/at91/Kconfig" source "drivers/clk/exynos/Kconfig"
drivers/clk/Makefile +1 -0
@@ -12,6 +12,7 @@ obj-$(CONFIG_$(SPL_TPL_)CLK_CCF) += clk-fixed-factor.o obj-$(CONFIG_$(SPL_TPL_)CLK_COMPOSITE_CCF) += clk-composite.o obj-$(CONFIG_$(SPL_TPL_)CLK_GPIO) += clk-gpio.o +obj-y += adi/ obj-y += analogbits/ obj-y += imx/ obj-$(CONFIG_CLK_JH7110) += starfive/
drivers/clk/adi/Kconfig new file +83 -0
83 lines not on this page · raw message
drivers/clk/adi/Makefile new file +16 -0
@@ -0,0 +1,16 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# (C) Copyright 2022 - Analog Devices, Inc. +# +# Written and/or maintained by Timesys Corporation +# +# Contact: Nathan Barrett-Morrison <[email protected]> +# Contact: Greg Malysa <[email protected]> +# + +obj-$(CONFIG_COMMON_CLK_ADI_SHARED) += clk-shared.o clk-adi-pll.o + +obj-$(CONFIG_COMMON_CLK_ADI_SC594) += clk-adi-sc594.o +obj-$(CONFIG_COMMON_CLK_ADI_SC598) += clk-adi-sc598.o +obj-$(CONFIG_COMMON_CLK_ADI_SC58X) += clk-adi-sc58x.o +obj-$(CONFIG_COMMON_CLK_ADI_SC57X) += clk-adi-sc57x.o
drivers/clk/adi/clk-adi-pll.c new file +93 -0
93 lines not on this page · raw message
drivers/clk/adi/clk-adi-sc57x.c new file +206 -0
206 lines not on this page · raw message
drivers/clk/adi/clk-adi-sc58x.c new file +222 -0
222 lines not on this page · raw message
drivers/clk/adi/clk-adi-sc594.c new file +231 -0
231 lines not on this page · raw message
drivers/clk/adi/clk-adi-sc598.c new file +308 -0
308 lines not on this page · raw message
drivers/clk/adi/clk-shared.c new file +48 -0
48 lines not on this page · raw message
drivers/clk/adi/clk.h new file +123 -0
123 lines not on this page · raw message
include/dt-bindings/clock/adi-sc5xx-clock.h new file +271 -0
271 lines not on this page · raw message
Signature · 1 line
2.43.2
PATCH v2 3/4 drivers: serial: Add in UART for ADI SC5XX-family processors
In reply to Greg MalysaFrom: Nathan Barrett-Morrison <[email protected]>
---
(no changes since v1)
MAINTAINERS | 1 + drivers/serial/Makefile | 1 + drivers/serial/serial_adi_uart4.c | 225 ++++++++++++++++++++++++++++++ 3 files changed, 227 insertions(+) create mode 100644 drivers/serial/serial_adi_uart4.c
MAINTAINERS +1 -0
@@ -610,6 +610,7 @@ T: git https://github.com/analogdevicesinc/lnxdsp-u-boot F: arch/arm/include/asm/arch-adi/ F: arch/arm/mach-sc5xx/ F: drivers/clk/adi/ +F: drivers/serial/serial_adi_uart4.c F: include/env/adi/ ARM SNAPDRAGON
drivers/serial/Makefile +1 -0
@@ -65,3 +65,4 @@ obj-$(CONFIG_S5P4418_PL011_SERIAL) += serial_s5p4418_pl011.o ifndef CONFIG_SPL_BUILD obj-$(CONFIG_USB_TTY) += usbtty.o endif +obj-$(CONFIG_UART4_SERIAL) += serial_adi_uart4.o
drivers/serial/serial_adi_uart4.c new file +225 -0
225 lines not on this page · raw message
Signature · 1 line
2.43.2
PATCH v2 4/4 drivers: timer: Add in driver support for ADI SC5XX-family GP timer peripheral
In reply to Greg Malysa---
Changes in v2:
- Added gptimer driver to this series because a minimal system can't boot without it
--- MAINTAINERS | 1 + drivers/timer/Kconfig | 8 ++ drivers/timer/Makefile | 1 + drivers/timer/adi_sc5xx_timer.c | 145 ++++++++++++++++++++++++++++++++ 4 files changed, 155 insertions(+) create mode 100644 drivers/timer/adi_sc5xx_timer.c
MAINTAINERS +1 -0
@@ -611,6 +611,7 @@ F: arch/arm/include/asm/arch-adi/ F: arch/arm/mach-sc5xx/ F: drivers/clk/adi/ F: drivers/serial/serial_adi_uart4.c +F: drivers/timer/adi_sc5xx_timer.c F: include/env/adi/ ARM SNAPDRAGON
drivers/timer/Kconfig +8 -0
@@ -50,6 +50,14 @@ config TIMER_EARLY use an early timer. These functions must be supported by your timer driver: timer_early_get_count() and timer_early_get_rate(). +config ADI_SC5XX_TIMER + bool "ADI ADSP-SC5xx Timer Support" + depends on TIMER && (SC57X || SC58X || SC59X || SC59X_64) + help + gptimer based timer support on ADI's ADSP-SC5xx platforms. Available + but not required on sc59x-64-based platforms (598 and similar). + Required on 32-bit platforms (sc57x, sc58x, sc594 and earlier). + config ALTERA_TIMER bool "Altera timer support" depends on TIMER
drivers/timer/Makefile +1 -0
@@ -3,6 +3,7 @@ # Copyright (C) 2015 Thomas Chou <[email protected]> obj-y += timer-uclass.o +obj-$(CONFIG_ADI_SC5XX_TIMER) += adi_sc5xx_timer.o obj-$(CONFIG_ALTERA_TIMER) += altera_timer.o obj-$(CONFIG_$(SPL_)ANDES_PLMT_TIMER) += andes_plmt_timer.o obj-$(CONFIG_ARC_TIMER) += arc_timer.o
drivers/timer/adi_sc5xx_timer.c new file +145 -0
145 lines not on this page · raw message
Signature · 1 line
2.43.2
Quoted 14 lines · Greg Malysa
This series adds support for the ADI SC5xx machine type and includes two core drivers that are required for being able to boot any board--a UART driver, the gptimer driver which is used as a clock reference (CNTVCNT is not supported on the armv7 sc5xx SoCs) and the clock tree driver. Our corresponding Linux support relies on u-boot configuring the clocks correctly before booting, so it is not possible to boot any board without the CGU/CDU configuration happening here. There are also no board files, device trees, or defconfigs included here, but some common definitions that will be used to build board files currently are. The sc5xx SoCs themselves include many armv7 families (sc57x, sc58x, and sc594) all using an ARM Cortex-A5, and one armv8 family (sc598) indended to be a drop-in replacement for the SC594 in terms of peripherals, with a Cortex-A55 instead.
Quoted 8 lines
Some of the configuration code in dmcinit and clkinit is quite scary and causes a lot of checkpatch violations. It is modified from code initially provided by ADI, but it has not been fully rewritten. There's a question of how important it is to clean up this code--it has some quality violations, but it has been in use (including in production) for over two years and is known to work for performing the low level SoC initialization, while a rewrite might introduce timing or sequence bugs that could take a significant amount of time to detect in the future.
I gave the series a cursory look, and CI is also happy. I will put this in to the -next branch sometime soon after it opens, thanks.
Signature · 1 line
Tom
Quoted 14 lines · Greg Malysa
This series adds support for the ADI SC5xx machine type and includes two core drivers that are required for being able to boot any board--a UART driver, the gptimer driver which is used as a clock reference (CNTVCNT is not supported on the armv7 sc5xx SoCs) and the clock tree driver. Our corresponding Linux support relies on u-boot configuring the clocks correctly before booting, so it is not possible to boot any board without the CGU/CDU configuration happening here. There are also no board files, device trees, or defconfigs included here, but some common definitions that will be used to build board files currently are. The sc5xx SoCs themselves include many armv7 families (sc57x, sc58x, and sc594) all using an ARM Cortex-A5, and one armv8 family (sc598) indended to be a drop-in replacement for the SC594 in terms of peripherals, with a Cortex-A55 instead.
Quoted 1 line
[...]
Applied to u-boot/next, thanks!
Signature · 1 line
Tom