
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