[PATCH 00/20] arm: Initial support for Analog Devices SC5xx boards

ADSP-SC5xx is a series of ARM-based DSPs. This comprises the armv7 based SC57x, SC58x and SC594 series, and the armv8 based SC598.
This patch series includes configurations, init code, and minimal DTs to enable Analog Devices' evaluation boards for these SoCs to boot through SPL and into U-Boot Proper, as well as devicetree schemas for the added DTs.
This patch series depends on ("arm: Add Analog Devices SC5xx Machine Type") (https://lists.denx.de/pipermail/u-boot/2024-April/552043.html)
Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com --- Oliver Gaskell (20): arm: dts: Support SC573-EZKIT arm: dts: Support SC584-EZKIT arm: dts: Support SC589-MINI arm: dts: Support SC589-EZKIT arm: dts: Support SC594-SOM-EZKIT arm: dts: Support SC594-SOM-EZLITE arm: dts: Support SC598-SOM-EZKIT arm: dts: Support SC598-SOM-EZLITE dt-bindings: arm: Add SC5xx Series binding dt-bindings: clock: Add SC5xx clock tree bindings dt-bindings: timer: Add SC5xx Timer bindings arm: mach-sc5xx: clean up Kconfig arm: SC598-SOM-EZKIT initial support arm: SC598-SOM-EZLITE initial support arm: SC594-SOM-EZKIT initial support arm: SC594-SOM-EZLITE initial support arm: SC584-EZKIT initial support arm: SC589-EZKIT initial support arm: SC589-MINI initial support arm: SC573-EZKIT initial support
MAINTAINERS | 7 + arch/arm/Kconfig | 14 ++ arch/arm/dts/Makefile | 9 + arch/arm/dts/sc573-ezkit.dts | 13 ++ arch/arm/dts/sc57x.dtsi | 21 +++ arch/arm/dts/sc584-ezkit.dts | 13 ++ arch/arm/dts/sc589-ezkit.dts | 13 ++ arch/arm/dts/sc589-mini.dts | 13 ++ arch/arm/dts/sc58x.dtsi | 23 +++ arch/arm/dts/sc594-som-ezkit.dts | 13 ++ arch/arm/dts/sc594-som-ezlite.dts | 13 ++ arch/arm/dts/sc594-som.dtsi | 19 +++ arch/arm/dts/sc598-som-ezkit.dts | 13 ++ arch/arm/dts/sc598-som-ezlite.dts | 13 ++ arch/arm/dts/sc598-som.dtsi | 31 ++++ arch/arm/dts/sc5xx.dtsi | 54 ++++++ arch/arm/mach-sc5xx/Kconfig | 134 ++++++++++++--- arch/arm/mach-sc5xx/Makefile | 4 + arch/arm/mach-sc5xx/sc57x-spl.c | 26 +++ arch/arm/mach-sc5xx/sc58x-spl.c | 26 +++ arch/arm/mach-sc5xx/sc59x-spl.c | 26 +++ arch/arm/mach-sc5xx/sc59x_64-spl.c | 26 +++ arch/arm/mach-sc5xx/sc59x_64.c | 25 +++ arch/arm/mach-sc5xx/soc.c | 44 +++++ board/adi/sc573-ezkit/Kconfig | 160 ++++++++++++++++++ board/adi/sc573-ezkit/sc573-ezkit.env | 13 ++ board/adi/sc584-ezkit/Kconfig | 160 ++++++++++++++++++ board/adi/sc584-ezkit/sc584-ezkit.env | 13 ++ board/adi/sc589-ezkit/Kconfig | 160 ++++++++++++++++++ board/adi/sc589-ezkit/sc589-ezkit.env | 13 ++ board/adi/sc589-mini/Kconfig | 160 ++++++++++++++++++ board/adi/sc589-mini/sc589-mini.env | 13 ++ board/adi/sc594-som-ezkit/Kconfig | 181 +++++++++++++++++++++ board/adi/sc594-som-ezkit/sc594-som-ezkit.env | 13 ++ board/adi/sc594-som-ezlite/Kconfig | 181 +++++++++++++++++++++ board/adi/sc594-som-ezlite/sc594-som-ezlite.env | 13 ++ board/adi/sc598-som-ezkit/Kconfig | 150 +++++++++++++++++ board/adi/sc598-som-ezkit/sc598-som-ezkit.env | 13 ++ board/adi/sc598-som-ezlite/Kconfig | 150 +++++++++++++++++ board/adi/sc598-som-ezlite/sc598-som-ezlite.env | 13 ++ doc/device-tree-bindings/arm/adi/adi,sc5xx.yaml | 46 ++++++ .../clock/adi,sc5xx-clocks.yaml | 112 +++++++++++++ .../timer/adi,sc5xx-gptimer.yaml | 42 +++++ include/configs/sc573-ezkit.h | 18 ++ include/configs/sc584-ezkit.h | 18 ++ include/configs/sc589.h | 19 +++ include/configs/sc594-som.h | 19 +++ include/configs/sc598-som.h | 23 +++ 48 files changed, 2274 insertions(+), 22 deletions(-) --- base-commit: 34377bc0b0dc446853c7831efaccef8b50c22841 change-id: 20240821-sc5xx-upstreaming-patches-c048ba9f979a
Best regards,

From: Oliver Gaskell Oliver.Gaskell@analog.com
Adds minimal device tree for Analog Devices' SC573-EZKIT board and common files for the SC57x/SC5xx family.
This also adds all sc5* devicetrees to ARM SC5XX in MAINTAINERS, and adds the ADSP Linux mailing list as the list for ARM SC5XX.
Co-developed-by: Greg Malysa greg.malysa@timesys.com Co-developed-by: Nathan Barrett-Morrison nathan.morrison@timesys.com Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com --- MAINTAINERS | 2 ++ arch/arm/dts/Makefile | 2 ++ arch/arm/dts/sc573-ezkit.dts | 13 +++++++++++ arch/arm/dts/sc57x.dtsi | 21 +++++++++++++++++ arch/arm/dts/sc5xx.dtsi | 54 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 92 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS index a6e47e8a21..0640d56991 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -601,8 +601,10 @@ M: Ian Roberts ian.roberts@timesys.com M: Vasileios Bimpikas vasileios.bimpikas@analog.com M: Utsav Agarwal utsav.agarwal@analog.com M: Arturs Artamonovs arturs.artamonovs@analog.com +L: adsp-linux@analog.com S: Supported T: git https://github.com/analogdevicesinc/lnxdsp-u-boot +F: arch/arm/dts/sc5* F: arch/arm/include/asm/arch-adi/ F: arch/arm/mach-sc5xx/ F: drivers/clk/adi/ diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index a4d95c8306..8fa56cc9f4 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -1275,6 +1275,8 @@ dtb-$(CONFIG_TARGET_IMX8MM_CL_IOT_GATE_OPTEE) += imx8mm-cl-iot-gate-optee.dtb \ imx8mm-cl-iot-gate-ied-tpm0.dtbo \ imx8mm-cl-iot-gate-ied-tpm1.dtbo
+dtb-$(CONFIG_TARGET_SC573_EZKIT) += sc573-ezkit.dtb + ifneq ($(CONFIG_TARGET_IMX8MP_RSB3720A1_4G)$(CONFIG_TARGET_IMX8MP_RSB3720A1_6G),) dtb-y += imx8mp-rsb3720-a1.dtb endif diff --git a/arch/arm/dts/sc573-ezkit.dts b/arch/arm/dts/sc573-ezkit.dts new file mode 100644 index 0000000000..0dc2962618 --- /dev/null +++ b/arch/arm/dts/sc573-ezkit.dts @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +/dts-v1/; + +#include "sc57x.dtsi" + +/ { + model = "ADI SC573-EZKIT"; + compatible = "adi,sc573-ezkit", "adi,sc57x"; +}; diff --git a/arch/arm/dts/sc57x.dtsi b/arch/arm/dts/sc57x.dtsi new file mode 100644 index 0000000000..ddfcae8d19 --- /dev/null +++ b/arch/arm/dts/sc57x.dtsi @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#include "sc5xx.dtsi" + +/ { + gic: interrupt-controller@310b2000 { + compatible = "arm,cortex-a5-gic"; + #interrupt-cells = <3>; + #address-cells = <0>; + interrupt-controller; + reg = <0x310B2000 0x1000>, + <0x310B4000 0x100>; + }; +}; + +&timer0 { + clocks = <&clk ADSP_SC57X_CLK_CGU0_SCLK0>; +}; diff --git a/arch/arm/dts/sc5xx.dtsi b/arch/arm/dts/sc5xx.dtsi new file mode 100644 index 0000000000..3f440dac29 --- /dev/null +++ b/arch/arm/dts/sc5xx.dtsi @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#include <dt-bindings/interrupt-controller/arm-gic.h> +#include <dt-bindings/clock/adi-sc5xx-clock.h> + +/ { + #address-cells = <1>; + #size-cells = <1>; + + clocks { + sys_clkin0: sys_clkin0 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <25000000>; + bootph-all; + }; + + sys_clkin1: sys_clkin1 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <25000000>; + bootph-all; + }; + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + device_type = "soc"; + ranges; + bootph-all; + + timer0: timer@31018000 { + compatible = "adi,sc5xx-gptimer"; + reg = <0x31018004 0x100>, + <0x31018060 0x100>; + status = "okay"; + bootph-all; + }; + + clk: clocks@3108d000 { + reg = <0x3108d000 0x1000>; + #clock-cells = <1>; + clocks = <&sys_clkin0>, <&sys_clkin1>; + clock-names = "sys_clkin0", "sys_clkin1"; + status = "okay"; + bootph-all; + }; + }; +};

From: Oliver Gaskell Oliver.Gaskell@analog.com
Add minimal device tree for Analog Devices' SC584-EZKIT board, and common files for the SC58x family.
This patch depends on Patch 01, for sc5xx.dtsi.
Co-developed-by: Greg Malysa greg.malysa@timesys.com Co-developed-by: Trevor Woerner twoerner@gmail.com Co-developed-by: Nathan Barrett-Morrison nathan.morrison@timesys.com Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com --- arch/arm/dts/Makefile | 1 + arch/arm/dts/sc584-ezkit.dts | 13 +++++++++++++ arch/arm/dts/sc58x.dtsi | 23 +++++++++++++++++++++++ 3 files changed, 37 insertions(+)
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 8fa56cc9f4..5b87c8972f 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -1276,6 +1276,7 @@ dtb-$(CONFIG_TARGET_IMX8MM_CL_IOT_GATE_OPTEE) += imx8mm-cl-iot-gate-optee.dtb \ imx8mm-cl-iot-gate-ied-tpm1.dtbo
dtb-$(CONFIG_TARGET_SC573_EZKIT) += sc573-ezkit.dtb +dtb-$(CONFIG_TARGET_SC584_EZKIT) += sc584-ezkit.dtb
ifneq ($(CONFIG_TARGET_IMX8MP_RSB3720A1_4G)$(CONFIG_TARGET_IMX8MP_RSB3720A1_6G),) dtb-y += imx8mp-rsb3720-a1.dtb diff --git a/arch/arm/dts/sc584-ezkit.dts b/arch/arm/dts/sc584-ezkit.dts new file mode 100644 index 0000000000..4ec6bcfb65 --- /dev/null +++ b/arch/arm/dts/sc584-ezkit.dts @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +/dts-v1/; + +#include "sc58x.dtsi" + +/ { + model = "ADI SC584-EZKIT"; + compatible = "adi,sc584-ezkit", "adi,sc58x"; +}; diff --git a/arch/arm/dts/sc58x.dtsi b/arch/arm/dts/sc58x.dtsi new file mode 100644 index 0000000000..66145315ab --- /dev/null +++ b/arch/arm/dts/sc58x.dtsi @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#include "sc5xx.dtsi" + +/ { + gic: interrupt-controller@310b2000 { + compatible = "arm,cortex-a5-gic"; + #interrupt-cells = <3>; + #address-cells = <0>; + interrupt-controller; + reg = <0x310B2000 0x1000>, + <0x310B4000 0x100>; + }; +}; + +&timer0 { + reg = <0x31001004 0x100>, + <0x31001060 0x100>; + clocks = <&clk ADSP_SC58X_CLK_CGU0_SCLK0>; +};

From: Oliver Gaskell Oliver.Gaskell@analog.com
Add minimal device tree for Analog Devices' SC589-MINI board.
This patch depends on Patches 01 and 02, for sc5xx.dtsi and sc58x.dtsi.
Co-developed-by: Greg Malysa greg.malysa@timesys.com Co-developed-by: Trevor Woerner twoerner@gmail.com Co-developed-by: Nathan Barrett-Morrison nathan.morrison@timesys.com Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com --- arch/arm/dts/Makefile | 1 + arch/arm/dts/sc589-mini.dts | 13 +++++++++++++ 2 files changed, 14 insertions(+)
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 5b87c8972f..34c7ede8cb 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -1277,6 +1277,7 @@ dtb-$(CONFIG_TARGET_IMX8MM_CL_IOT_GATE_OPTEE) += imx8mm-cl-iot-gate-optee.dtb \
dtb-$(CONFIG_TARGET_SC573_EZKIT) += sc573-ezkit.dtb dtb-$(CONFIG_TARGET_SC584_EZKIT) += sc584-ezkit.dtb +dtb-$(CONFIG_TARGET_SC589_MINI) += sc589-mini.dtb
ifneq ($(CONFIG_TARGET_IMX8MP_RSB3720A1_4G)$(CONFIG_TARGET_IMX8MP_RSB3720A1_6G),) dtb-y += imx8mp-rsb3720-a1.dtb diff --git a/arch/arm/dts/sc589-mini.dts b/arch/arm/dts/sc589-mini.dts new file mode 100644 index 0000000000..605f7a17bf --- /dev/null +++ b/arch/arm/dts/sc589-mini.dts @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +/dts-v1/; + +#include "sc58x.dtsi" + +/ { + model = "ADI SC598-MINI"; + compatible = "adi,sc589-mini", "adi,sc58x"; +};

From: Oliver Gaskell Oliver.Gaskell@analog.com
Add minimal device tree for Analog Devices' SC589-EZKIT board.
This patch depends on Patches 01 and 02, for sc5xx.dtsi and sc58x.dtsi.
Co-developed-by: Greg Malysa greg.malysa@timesys.com Co-developed-by: Trevor Woerner twoerner@gmail.com Co-developed-by: Nathan Barrett-Morrison nathan.morrison@timesys.com Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com --- arch/arm/dts/Makefile | 1 + arch/arm/dts/sc589-ezkit.dts | 13 +++++++++++++ 2 files changed, 14 insertions(+)
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 34c7ede8cb..321ac82a29 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -1278,6 +1278,7 @@ dtb-$(CONFIG_TARGET_IMX8MM_CL_IOT_GATE_OPTEE) += imx8mm-cl-iot-gate-optee.dtb \ dtb-$(CONFIG_TARGET_SC573_EZKIT) += sc573-ezkit.dtb dtb-$(CONFIG_TARGET_SC584_EZKIT) += sc584-ezkit.dtb dtb-$(CONFIG_TARGET_SC589_MINI) += sc589-mini.dtb +dtb-$(CONFIG_TARGET_SC589_EZKIT) += sc589-ezkit.dtb
ifneq ($(CONFIG_TARGET_IMX8MP_RSB3720A1_4G)$(CONFIG_TARGET_IMX8MP_RSB3720A1_6G),) dtb-y += imx8mp-rsb3720-a1.dtb diff --git a/arch/arm/dts/sc589-ezkit.dts b/arch/arm/dts/sc589-ezkit.dts new file mode 100644 index 0000000000..8a1c0ce086 --- /dev/null +++ b/arch/arm/dts/sc589-ezkit.dts @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +/dts-v1/; + +#include "sc58x.dtsi" + +/ { + model = "ADI SC589-EZKIT"; + compatible = "adi,sc589-ezkit", "adi,sc58x"; +};

From: Oliver Gaskell Oliver.Gaskell@analog.com
Add minimal device tree for Analog Devices' SC594-SOM-EZKIT board, and the SC594 SoM.
This patch depends on patch 01, for sc5xx.dtsi.
Co-developed-by: Greg Malysa greg.malysa@timesys.com Co-developed-by: Nathan Barrett-Morrison nathan.morrison@timesys.com Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com --- arch/arm/dts/Makefile | 1 + arch/arm/dts/sc594-som-ezkit.dts | 13 +++++++++++++ arch/arm/dts/sc594-som.dtsi | 19 +++++++++++++++++++ 3 files changed, 33 insertions(+)
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 321ac82a29..25c236039b 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -1279,6 +1279,7 @@ dtb-$(CONFIG_TARGET_SC573_EZKIT) += sc573-ezkit.dtb dtb-$(CONFIG_TARGET_SC584_EZKIT) += sc584-ezkit.dtb dtb-$(CONFIG_TARGET_SC589_MINI) += sc589-mini.dtb dtb-$(CONFIG_TARGET_SC589_EZKIT) += sc589-ezkit.dtb +dtb-$(CONFIG_TARGET_SC594_SOM_EZKIT) += sc594-som-ezkit.dtb
ifneq ($(CONFIG_TARGET_IMX8MP_RSB3720A1_4G)$(CONFIG_TARGET_IMX8MP_RSB3720A1_6G),) dtb-y += imx8mp-rsb3720-a1.dtb diff --git a/arch/arm/dts/sc594-som-ezkit.dts b/arch/arm/dts/sc594-som-ezkit.dts new file mode 100644 index 0000000000..e744a3a4ed --- /dev/null +++ b/arch/arm/dts/sc594-som-ezkit.dts @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +/dts-v1/; + +#include "sc594-som.dtsi" + +/ { + model = "ADI SC594-SOM-EZKIT"; + compatible = "adi,sc594-som-ezkit", "adi,sc59x"; +}; diff --git a/arch/arm/dts/sc594-som.dtsi b/arch/arm/dts/sc594-som.dtsi new file mode 100644 index 0000000000..e15473f8e8 --- /dev/null +++ b/arch/arm/dts/sc594-som.dtsi @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +/dts-v1/; + +#include "sc5xx.dtsi" + +&timer0 { + clocks = <&clk ADSP_SC594_CLK_CGU0_SCLK0>; +}; + +&clk { + compatible = "adi,sc594-clocks"; + reg = <0x3108d000 0x1000>, + <0x3108e000 0x1000>, + <0x3108f000 0x1000>; +};

From: Oliver Gaskell Oliver.Gaskell@analog.com
Add minimal device tree for Analog Devices' SC594-SOM-EZLITE board.
This patch depends on Patches 01 and 05, for sc5xx.dtsi and sc594-som.dtsi respectively.
Co-developed-by: Greg Malysa greg.malysa@timesys.com Co-developed-by: Nathan Barrett-Morrison nathan.morrison@timesys.com Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com --- arch/arm/dts/Makefile | 1 + arch/arm/dts/sc594-som-ezlite.dts | 13 +++++++++++++ 2 files changed, 14 insertions(+)
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 25c236039b..0c9984232b 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -1280,6 +1280,7 @@ dtb-$(CONFIG_TARGET_SC584_EZKIT) += sc584-ezkit.dtb dtb-$(CONFIG_TARGET_SC589_MINI) += sc589-mini.dtb dtb-$(CONFIG_TARGET_SC589_EZKIT) += sc589-ezkit.dtb dtb-$(CONFIG_TARGET_SC594_SOM_EZKIT) += sc594-som-ezkit.dtb +dtb-$(CONFIG_TARGET_SC594_SOM_EZLITE) += sc594-som-ezlite.dtb
ifneq ($(CONFIG_TARGET_IMX8MP_RSB3720A1_4G)$(CONFIG_TARGET_IMX8MP_RSB3720A1_6G),) dtb-y += imx8mp-rsb3720-a1.dtb diff --git a/arch/arm/dts/sc594-som-ezlite.dts b/arch/arm/dts/sc594-som-ezlite.dts new file mode 100644 index 0000000000..7d81b40fe8 --- /dev/null +++ b/arch/arm/dts/sc594-som-ezlite.dts @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +/dts-v1/; + +#include "sc594-som.dtsi" + +/ { + model = "ADI SC594-SOM-EZLITE"; + compatible = "adi,sc594-som-ezlite", "adi,sc59x"; +};

From: Oliver Gaskell Oliver.Gaskell@analog.com
Add minimal device tree for Analog Devices' SC598-SOM-EZKIT board, and the SC598 SoM.
This patch depends on patch 01, for sc5xx.dtsi.
Co-developed-by: Greg Malysa greg.malysa@timesys.com Co-developed-by: Nathan Barrett-Morrison nathan.morrison@timesys.com Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com --- arch/arm/dts/Makefile | 1 + arch/arm/dts/sc598-som-ezkit.dts | 13 +++++++++++++ arch/arm/dts/sc598-som.dtsi | 31 +++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+)
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 0c9984232b..6b0a762bce 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -1281,6 +1281,7 @@ dtb-$(CONFIG_TARGET_SC589_MINI) += sc589-mini.dtb dtb-$(CONFIG_TARGET_SC589_EZKIT) += sc589-ezkit.dtb dtb-$(CONFIG_TARGET_SC594_SOM_EZKIT) += sc594-som-ezkit.dtb dtb-$(CONFIG_TARGET_SC594_SOM_EZLITE) += sc594-som-ezlite.dtb +dtb-$(CONFIG_TARGET_SC598_SOM_EZKIT) += sc598-som-ezkit.dtb
ifneq ($(CONFIG_TARGET_IMX8MP_RSB3720A1_4G)$(CONFIG_TARGET_IMX8MP_RSB3720A1_6G),) dtb-y += imx8mp-rsb3720-a1.dtb diff --git a/arch/arm/dts/sc598-som-ezkit.dts b/arch/arm/dts/sc598-som-ezkit.dts new file mode 100644 index 0000000000..7289e4d1d5 --- /dev/null +++ b/arch/arm/dts/sc598-som-ezkit.dts @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +/dts-v1/; + +#include "sc598-som.dtsi" + +/ { + model = "ADI SC598-SOM-EZKIT"; + compatible = "adi,sc598-som-ezkit", "adi,sc59x-64"; +}; diff --git a/arch/arm/dts/sc598-som.dtsi b/arch/arm/dts/sc598-som.dtsi new file mode 100644 index 0000000000..8bcc8bb8f1 --- /dev/null +++ b/arch/arm/dts/sc598-som.dtsi @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +/dts-v1/; + +#include "sc5xx.dtsi" + +/ { + gic: interrupt-controller@31200000 { + compatible = "arm,gic-v3"; + #interrupt-cells = <3>; + interrupt-controller; + reg = <0x31200000 0x40000>, /* GIC Dist */ + <0x31240000 0x40000>; /* GICR */ + }; +}; + +&clk { + compatible = "adi,sc598-clocks"; + reg = <0x3108d000 0x1000>, + <0x3108e000 0x1000>, + <0x3108f000 0x1000>, + <0x310a9000 0x1000>; + reg-names = "cgu0", "cgu1", "cdu", "pll3"; +}; + +&timer0 { + clocks = <&clk ADSP_SC598_CLK_CGU0_SCLK0>; +};

From: Oliver Gaskell Oliver.Gaskell@analog.com
Add minimal device tree for Analog Devices' SC598-SOM-EZLITE board.
This patch depends on Patches 01 and 07, for sc5xx.dtsi and sc598-som.dtsi respectively.
Co-developed-by: Greg Malysa greg.malysa@timesys.com Co-developed-by: Nathan Barrett-Morrison nathan.morrison@timesys.com Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com --- arch/arm/dts/Makefile | 1 + arch/arm/dts/sc598-som-ezlite.dts | 13 +++++++++++++ 2 files changed, 14 insertions(+)
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 6b0a762bce..9395feeede 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -1282,6 +1282,7 @@ dtb-$(CONFIG_TARGET_SC589_EZKIT) += sc589-ezkit.dtb dtb-$(CONFIG_TARGET_SC594_SOM_EZKIT) += sc594-som-ezkit.dtb dtb-$(CONFIG_TARGET_SC594_SOM_EZLITE) += sc594-som-ezlite.dtb dtb-$(CONFIG_TARGET_SC598_SOM_EZKIT) += sc598-som-ezkit.dtb +dtb-$(CONFIG_TARGET_SC598_SOM_EZLITE) += sc598-som-ezlite.dtb
ifneq ($(CONFIG_TARGET_IMX8MP_RSB3720A1_4G)$(CONFIG_TARGET_IMX8MP_RSB3720A1_6G),) dtb-y += imx8mp-rsb3720-a1.dtb diff --git a/arch/arm/dts/sc598-som-ezlite.dts b/arch/arm/dts/sc598-som-ezlite.dts new file mode 100644 index 0000000000..fa23b30f86 --- /dev/null +++ b/arch/arm/dts/sc598-som-ezlite.dts @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +/dts-v1/; + +#include "sc598-som.dtsi" + +/ { + model = "ADI SC598-SOM-EZLITE"; + compatible = "adi,sc598-som-ezlite", "adi,sc59x-64"; +};

From: Oliver Gaskell Oliver.Gaskell@analog.com
Add devicetree schema for Analog Devices SC5xx series SoCs.
Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com --- MAINTAINERS | 1 + doc/device-tree-bindings/arm/adi/adi,sc5xx.yaml | 46 +++++++++++++++++++++++++ 2 files changed, 47 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS index 0640d56991..c283e09901 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -607,6 +607,7 @@ T: git https://github.com/analogdevicesinc/lnxdsp-u-boot F: arch/arm/dts/sc5* F: arch/arm/include/asm/arch-adi/ F: arch/arm/mach-sc5xx/ +F: doc/device-tree-bindings/arm/adi/adi,sc5xx.yaml F: drivers/clk/adi/ F: drivers/serial/serial_adi_uart4.c F: drivers/timer/adi_sc5xx_timer.c diff --git a/doc/device-tree-bindings/arm/adi/adi,sc5xx.yaml b/doc/device-tree-bindings/arm/adi/adi,sc5xx.yaml new file mode 100644 index 0000000000..2d08d75667 --- /dev/null +++ b/doc/device-tree-bindings/arm/adi/adi,sc5xx.yaml @@ -0,0 +1,46 @@ +# SPDX-License-Identifier: (GPL-2.0+) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/adi/adi,sc5xx.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Analog Devices SC5XX ARM-based SoCs + +maintainers: + - Vasileios Bimpikas vasileios.bimpikas@analog.com + - Utsav Agarwal utsav.agarwal@analog.com + - Arturs Artamonovs arturs.artamonovs@analog.com + +properties: + $nodename: + const: '/' + compatible: + oneOf: + - description: SC57X Series Boards + items: + - const: adi,sc573-ezkit + - const: adi,sc57x + + - description: SC58X Series Boards + items: + - enum: + - adi,sc584-ezkit + - adi,sc589-ezkit + - adi,sc589-mini + - const: adi,sc58x + + - description: SC59X Series 32-bit Boards + items: + - enum: + - adi,sc594-som-ezkit + - adi,sc594-som-ezlite + - const: adi,sc59x + + - description: SC59X Series 64-bit Boards + items: + - enum: + - adi,sc598-som-ezkit + - adi,sc598-som-ezlite + - const: adi,sc59x-64 + +additionalProperties: true \ No newline at end of file

From: Oliver Gaskell Oliver.Gaskell@analog.com
Add devicetree schema for the clock tree on Analog Devices SC5xx series SoCs.
Co-developed-by: Nathan Barrett-Morrison nathan.morrison@timesys.com Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com --- MAINTAINERS | 1 + .../clock/adi,sc5xx-clocks.yaml | 112 +++++++++++++++++++++ 2 files changed, 113 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS index c283e09901..d5f79097a1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -608,6 +608,7 @@ F: arch/arm/dts/sc5* F: arch/arm/include/asm/arch-adi/ F: arch/arm/mach-sc5xx/ F: doc/device-tree-bindings/arm/adi/adi,sc5xx.yaml +F: doc/device-tree-bindings/clock/adi,sc5xx-clocks.yaml F: drivers/clk/adi/ F: drivers/serial/serial_adi_uart4.c F: drivers/timer/adi_sc5xx_timer.c diff --git a/doc/device-tree-bindings/clock/adi,sc5xx-clocks.yaml b/doc/device-tree-bindings/clock/adi,sc5xx-clocks.yaml new file mode 100644 index 0000000000..9bbd5467a0 --- /dev/null +++ b/doc/device-tree-bindings/clock/adi,sc5xx-clocks.yaml @@ -0,0 +1,112 @@ +# SPDX-License-Identifier: (GPL-2.0+) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/adi,sc5xx-clocks.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Clock Tree Drivers for Analog Devices SC5XX Processors + +maintainers: + - Vasileios Bimpikas vasileios.bimpikas@analog.com + - Utsav Agarwal utsav.agarwal@analog.com + - Arturs Artamonovs arturs.artamonovs@analog.com + +description: | + These drivers read in the processors CDU (clock distribution unit) + and CGU (clock generation unit) values to determine various clock + rates + +properties: + compatible: + enum: + - adi,sc5xx-clocks # Any + - adi,sc57x-clocks # 32-Bit SC573 processor + - adi,sc58x-clocks # 32-Bit SC584, SC589 processors + - adi,sc594-clocks # 32-Bit SC594 processor + - adi,sc598-clocks # 64-Bit SC598 processor + + '#clock-cells': + const: 1 + + reg: + minItems: 3 + maxItems: 4 + + reg-names: + description: + String reference names for the reg property + minItems: 3 + maxItems: 4 + + clocks: + description: + Specifies the CLKIN0 and CLKIN1 reference clock(s) from which the + output frequencies are derived via CDU+CGU + minItems: 2 + maxItems: 2 + + clock-names: + description: + String reference names for CLKIN0 and CLKIN1 + minItems: 2 + maxItems: 2 + +required: + - compatible + - reg + - clocks + - '#clock-cells' + - clock-names + +additionalProperties: false + +examples: + - | + clk0: clocks@3108d000 { + compatible = "adi,sc57x-clocks"; + reg = <0x3108d000 0x1000>, + <0x3108e000 0x1000>, + <0x3108f000 0x1000>; + #clock-cells = <1>; + clocks = <&sys_clkin0>, <&sys_clkin1>; + clock-names = "sys_clkin0", "sys_clkin1"; + status = "okay"; + }; + + - | + clk1: clocks@3108d000 { + compatible = "adi,sc58x-clocks"; + reg = <0x3108d000 0x1000>, + <0x3108e000 0x1000>, + <0x3108f000 0x1000>; + #clock-cells = <1>; + clocks = <&sys_clkin0>, <&sys_clkin1>; + clock-names = "sys_clkin0", "sys_clkin1"; + status = "okay"; + }; + + - | + clk2: clocks@3108d000 { + compatible = "adi,sc594-clocks"; + reg = <0x3108d000 0x1000>, + <0x3108e000 0x1000>, + <0x3108f000 0x1000>; + #clock-cells = <1>; + clocks = <&sys_clkin0>, <&sys_clkin1>; + clock-names = "sys_clkin0", "sys_clkin1"; + status = "okay"; + }; + + - | + clk3: clocks@3108d000 { + compatible = "adi,sc598-clocks"; + reg = <0x3108d000 0x1000>, + <0x3108e000 0x1000>, + <0x3108f000 0x1000>, + <0x310a9000 0x1000>; + #clock-cells = <1>; + clocks = <&sys_clkin0>, <&sys_clkin1>; + clock-names = "sys_clkin0", "sys_clkin1"; + status = "okay"; + }; +

From: Oliver Gaskell Oliver.Gaskell@analog.com
Add devicetree schema for the timer peripheral on Analog Devices SC5xx series SoCs.
Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com --- MAINTAINERS | 1 + .../timer/adi,sc5xx-gptimer.yaml | 42 ++++++++++++++++++++++ 2 files changed, 43 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS index d5f79097a1..823bb5ad92 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -609,6 +609,7 @@ F: arch/arm/include/asm/arch-adi/ F: arch/arm/mach-sc5xx/ F: doc/device-tree-bindings/arm/adi/adi,sc5xx.yaml F: doc/device-tree-bindings/clock/adi,sc5xx-clocks.yaml +F: doc/device-tree-bindings/timer/adi,sc5xx-gptimer.yaml F: drivers/clk/adi/ F: drivers/serial/serial_adi_uart4.c F: drivers/timer/adi_sc5xx_timer.c diff --git a/doc/device-tree-bindings/timer/adi,sc5xx-gptimer.yaml b/doc/device-tree-bindings/timer/adi,sc5xx-gptimer.yaml new file mode 100644 index 0000000000..5e313af6fe --- /dev/null +++ b/doc/device-tree-bindings/timer/adi,sc5xx-gptimer.yaml @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: (GPL-2.0+) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/timer/adi,sc5xx-gptimer.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Analog Devices SC5XX Series SoC Timer Peripherals + +maintainers: + - Vasileios Bimpikas vasileios.bimpikas@analog.com + - Utsav Agarwal utsav.agarwal@analog.com + - Arturs Artamonovs arturs.artamonovs@analog.com + +properties: + compatible: + const: adi,sc5xx-gptimer + + reg: + minItems: 2 + maxItems: 2 + + clocks: + minItems: 1 + maxItems: 1 + +required: + - compatible + - reg + - clocks + +additionalProperties: false + +examples: + - | + timer0: timer@31018000 { + compatible = "adi,sc5xx-gptimer"; + reg = <0x31018004 0x100>, + <0x31018060 0x100>; + status = "okay"; + bootph-all; + }; +

From: Oliver Gaskell Oliver.Gaskell@analog.com
Moves common options between all SC5xx series boards to the ARCH_SC5XX option instead of duplicating them.
Also, it was possible to select multiple of the SoC support options. Given a U-Boot binary can only support a single platform, this moves the SoC selection to a `choice`, making them mutually exclusive.
Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com --- arch/arm/Kconfig | 8 ++++++++ arch/arm/mach-sc5xx/Kconfig | 31 +++++++++++-------------------- 2 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index ba0359fed5..69decaa591 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1868,6 +1868,14 @@ config TARGET_LS1046AFRWY
config ARCH_SC5XX bool "Analog Devices SC5XX-processor family" + select SPL + select SUPPORT_SPL + select PANIC_HANG + select DM + select SPL_DM + select DM_SERIAL + select TIMER + select ADI_SC5XX_TIMER
config TARGET_SL28 bool "Support sl28" diff --git a/arch/arm/mach-sc5xx/Kconfig b/arch/arm/mach-sc5xx/Kconfig index 3846b4fd5b..d99b02b574 100644 --- a/arch/arm/mach-sc5xx/Kconfig +++ b/arch/arm/mach-sc5xx/Kconfig @@ -13,47 +13,38 @@
if ARCH_SC5XX
+choice + prompt "SC5xx SoC Select" + help + Selects which series of Analog Devices SC5xx chips to support. + config SC57X - bool - select SUPPORT_SPL + bool "SC57x series" select CPU_V7A - select PANIC_HANG select COMMON_CLK_ADI_SC57X - select TIMER - select ADI_SC5XX_TIMER
config SC58X - bool - select SUPPORT_SPL + bool "SC58x series" select CPU_V7A - select PANIC_HANG select COMMON_CLK_ADI_SC58X - select TIMER - select ADI_SC5XX_TIMER
config SC59X - bool - select SUPPORT_SPL + bool "SC59x 32-bit series" select CPU_V7A - select PANIC_HANG select COMMON_CLK_ADI_SC594 - select TIMER - select ADI_SC5XX_TIMER select NOP_PHY
config SC59X_64 - bool - select SUPPORT_SPL - select PANIC_HANG + bool "SC59x 64-bit series" select MMC_SDHCI_ADMA_FORCE_32BIT select ARM64 - select DM - select DM_SERIAL select COMMON_CLK_ADI_SC598 select GICV3 select GIC_600_CLEAR_RDPD select NOP_PHY
+endchoice + config SC_BOOT_MODE int "SC5XX boot mode select" default 1

On Wed, Aug 28, 2024 at 11:02:20AM +0100, Oliver Gaskell wrote:
Moves common options between all SC5xx series boards to the ARCH_SC5XX option instead of duplicating them.
Also, it was possible to select multiple of the SoC support options. Given a U-Boot binary can only support a single platform, this moves the SoC selection to a `choice`, making them mutually exclusive.
Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com
arch/arm/Kconfig | 8 ++++++++ arch/arm/mach-sc5xx/Kconfig | 31 +++++++++++-------------------- 2 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index ba0359fed5..69decaa591 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1868,6 +1868,14 @@ config TARGET_LS1046AFRWY
config ARCH_SC5XX bool "Analog Devices SC5XX-processor family"
- select SPL
- select SUPPORT_SPL
- select PANIC_HANG
- select DM
- select SPL_DM
- select DM_SERIAL
- select TIMER
- select ADI_SC5XX_TIMER
This should be sorted. It's not required but it makes adding more things later easier. And yes, there's many unsorted examples. This applies throughout the series.

From: Oliver Gaskell Oliver.Gaskell@analog.com
Adds support for Analog Devices' SC598-SOM-EZKIT board. Includes: - CONFIG options common to all SC5xx SoCs - SoC specific configs in mach-sc5xx/Kconfig - Memory Map for SPL - Necessary board-specific init functions - Board-specific Kconfig and environment in board/adi/ - Memory configuration
Co-developed-by: Greg Malysa greg.malysa@timesys.com Co-developed-by: Nathan Barrett-Morrison nathan.morrison@timesys.com Co-developed-by: Trevor Woerner twoerner@gmail.com Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com --- MAINTAINERS | 2 + arch/arm/Kconfig | 6 ++ arch/arm/mach-sc5xx/Kconfig | 40 ++++++- arch/arm/mach-sc5xx/Makefile | 1 + arch/arm/mach-sc5xx/sc59x_64-spl.c | 26 +++++ arch/arm/mach-sc5xx/sc59x_64.c | 25 +++++ arch/arm/mach-sc5xx/soc.c | 25 +++++ board/adi/sc598-som-ezkit/Kconfig | 150 ++++++++++++++++++++++++++ board/adi/sc598-som-ezkit/sc598-som-ezkit.env | 13 +++ include/configs/sc598-som.h | 23 ++++ 10 files changed, 310 insertions(+), 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS index 823bb5ad92..5f945ec335 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -607,12 +607,14 @@ T: git https://github.com/analogdevicesinc/lnxdsp-u-boot F: arch/arm/dts/sc5* F: arch/arm/include/asm/arch-adi/ F: arch/arm/mach-sc5xx/ +F: board/adi/ F: doc/device-tree-bindings/arm/adi/adi,sc5xx.yaml F: doc/device-tree-bindings/clock/adi,sc5xx-clocks.yaml F: doc/device-tree-bindings/timer/adi,sc5xx-gptimer.yaml F: drivers/clk/adi/ F: drivers/serial/serial_adi_uart4.c F: drivers/timer/adi_sc5xx_timer.c +F: include/configs/sc5* F: include/env/adi/
ARM SNAPDRAGON diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 69decaa591..a3e8ebe0b1 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1870,7 +1870,13 @@ config ARCH_SC5XX bool "Analog Devices SC5XX-processor family" select SPL select SUPPORT_SPL + select SPL_SKIP_LOWLEVEL_INIT + select SPL_LIBGENERIC_SUPPORT + select SPL_LIBCOMMON_SUPPORT + select SPL_BOOTROM_SUPPORT + select SPL_DM_SEQ_ALIAS select PANIC_HANG + select HAS_CUSTOM_SYS_INIT_SP_ADDR select DM select SPL_DM select DM_SERIAL diff --git a/arch/arm/mach-sc5xx/Kconfig b/arch/arm/mach-sc5xx/Kconfig index d99b02b574..cd3c7011f4 100644 --- a/arch/arm/mach-sc5xx/Kconfig +++ b/arch/arm/mach-sc5xx/Kconfig @@ -41,10 +41,31 @@ config SC59X_64 select COMMON_CLK_ADI_SC598 select GICV3 select GIC_600_CLEAR_RDPD - select NOP_PHY + select GICV3_SUPPORT_GIC600 + select NOP_PHY if PHY + +endchoice + +if SC59X_64 + +choice + prompt "SC59x 64-bit board select" + +config TARGET_SC598_SOM_EZKIT + bool + prompt "SC598-SOM with SOMCRR-EZKIT" + select ADI_CARRIER_SOMCRR_EZKIT
endchoice
+endif + +config ADI_IMAGE + string "ADI fitImage type" + help + The image built by the ADI ADSP Linux build system. + Is one of tiny, minimal, full. + config SC_BOOT_MODE int "SC5XX boot mode select" default 1 @@ -84,10 +105,25 @@ config SC_BOOT_OSPI_SSEL This is the OSPI chip select number to use for booting, Y in the expression `sf probe X:Y`
+config SYS_BOOTM_LEN + hex + default 0x1800000 + config SYS_FLASH_BASE hex default 0x60000000
+config SYS_MALLOC_F_LEN + default 0x14000 + +config SYS_LOAD_ADDR + hex + default 0x0 + +config SYS_MALLOC_LEN + hex + default 1048576 + config UART_CONSOLE int default 0 @@ -463,4 +499,6 @@ config PINCTRL_ADI bool default y
+source "board/adi/sc598-som-ezkit/Kconfig" + endif diff --git a/arch/arm/mach-sc5xx/Makefile b/arch/arm/mach-sc5xx/Makefile index eeb56c078b..0955c509a5 100644 --- a/arch/arm/mach-sc5xx/Makefile +++ b/arch/arm/mach-sc5xx/Makefile @@ -14,6 +14,7 @@ obj-$(CONFIG_SC57X) += sc57x.o obj-$(CONFIG_SC58X) += sc58x.o obj-$(CONFIG_SC59X) += sc59x.o obj-$(CONFIG_SC59X_64) += sc59x_64.o +obj-$(CONFIG_SC59X_64) += sc59x_64-spl.o
obj-$(CONFIG_SPL_BUILD) += spl.o obj-$(CONFIG_SYSCON) += rcu.o diff --git a/arch/arm/mach-sc5xx/sc59x_64-spl.c b/arch/arm/mach-sc5xx/sc59x_64-spl.c new file mode 100644 index 0000000000..ae8c860cfe --- /dev/null +++ b/arch/arm/mach-sc5xx/sc59x_64-spl.c @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#include <asm/arch-adi/sc5xx/spl.h> + +// Table 47-14 in SC598 hardware reference manual +const struct adi_boot_args adi_rom_boot_args[] = { + // JTAG/no boot + [0] = {0, 0, 0}, + // SPI master, used for qspi as well + [1] = {0x60040000, 0x00040000, 0x00000207}, + // SPI slave + [2] = {0, 0, 0x00000212}, + // UART slave + [3] = {0, 0, 0x00000013}, + // Linkport slave + [4] = {0, 0, 0x00000014}, + // OSPI master + [5] = {0x60040000, 0, 0x00000008}, + // eMMC + [6] = {0x201, 0, 0x86009}, + // reserved, also no boot + [7] = {0, 0, 0} +}; diff --git a/arch/arm/mach-sc5xx/sc59x_64.c b/arch/arm/mach-sc5xx/sc59x_64.c index 82537bf196..001747f223 100644 --- a/arch/arm/mach-sc5xx/sc59x_64.c +++ b/arch/arm/mach-sc5xx/sc59x_64.c @@ -9,6 +9,7 @@ */
#include <asm/io.h> +#include <asm/armv8/mmu.h> #include <asm/arch-adi/sc5xx/sc5xx.h> #include <asm/arch-adi/sc5xx/spl.h>
@@ -24,6 +25,30 @@ #define BITM_SCB5_SPI2_OSPI_REMAP_REMAP 0x00000003 #define ENUM_SCB5_SPI2_OSPI_REMAP_OSPI0 0x00000001
+static struct mm_region sc598_mem_map[] = { + { + /* Peripherals */ + .virt = 0x0UL, + .phys = 0x0UL, + .size = 0x80000000UL, + .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | + PTE_BLOCK_NON_SHARE | + PTE_BLOCK_PXN | PTE_BLOCK_UXN + }, { + /* DDR */ + .virt = 0x80000000UL, + .phys = 0x80000000UL, + .size = 0x40000000UL, + .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | + PTE_BLOCK_INNER_SHARE + }, { + /* List terminator */ + 0, + } +}; + +struct mm_region *mem_map = sc598_mem_map; + adi_rom_boot_fn adi_rom_boot = (adi_rom_boot_fn)0x000000e4;
void sc5xx_enable_rgmii(void) diff --git a/arch/arm/mach-sc5xx/soc.c b/arch/arm/mach-sc5xx/soc.c index 8f13127a66..714b214bf6 100644 --- a/arch/arm/mach-sc5xx/soc.c +++ b/arch/arm/mach-sc5xx/soc.c @@ -172,6 +172,31 @@ void fixup_dp83867_phy(struct phy_device *phydev) phy_write(phydev, MDIO_DEVAD_NONE, 0, 0x3100); }
+extern char __bss_start, __bss_end; + +void bss_clear(void) +{ + #ifdef CONFIG_SC59X_64 + u32 *to = (void *)&__bss_start; + int i, sz; + + sz = &__bss_end - &__bss_start; + for (i = 0; i < sz; i += 4) + *to++ = 0; + #endif +} + +int board_early_init_f(void) +{ + bss_clear(); + return 0; +} + +int board_init(void) +{ + return 0; +} + int dram_init(void) { gd->ram_size = CFG_SYS_SDRAM_SIZE; diff --git a/board/adi/sc598-som-ezkit/Kconfig b/board/adi/sc598-som-ezkit/Kconfig new file mode 100644 index 0000000000..3d9b378d37 --- /dev/null +++ b/board/adi/sc598-som-ezkit/Kconfig @@ -0,0 +1,150 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# (C) Copyright 2024 - Analog Devices, Inc. + +if TARGET_SC598_SOM_EZKIT + +config SYS_VENDOR + default "adi" + +config LDR_CPU + default "ADSP-SC598-0.0" + +config SYS_BOARD + default "sc598-som-ezkit" + +config SYS_CONFIG_NAME + default "sc598-som" + +config DEFAULT_DEVICE_TREE + default "sc598-som-ezkit" + +config SPL_MAX_SIZE + default 0x30000 # 256KB + +config ADI_IMAGE + default "minimal" + +config NR_DRAM_BANKS + default 1 + +config SPL_BSS_START_ADDR + hex + default 0x200B0000 + +config SPL_BSS_MAX_SIZE + hex + default 0x10000 # 64K + +config SYS_SPL_MALLOC_START + hex + default 0x200C0000 + +config SYS_SPL_MALLOC_SIZE + hex + default 0x10000 # 64K + +config SPL_STACK + hex + default 0x200E4000 + +config SPL_STACK_SIZE + hex + default 0x14000 # 64K + +config TEXT_BASE + hex + default 0x96000000 + +config CUSTOM_SYS_INIT_SP_ADDR + hex + default 0x96000000 + +config SYS_LOAD_ADDR + hex + default 0x0 + +# SPL + +config SPL_TEXT_BASE + default 0x20080000 + +config SPL_PAYLOAD_ARGS_ADDR + hex + default 0x99000000 + +config SPL_OF_LIBFDT_ASSUME_MASK + hex + default 0x0 + +# SPI Flash + +config SF_DEFAULT_BUS + default 2 + +config SF_DEFAULT_CS + default 1 + +config SF_DEFAULT_SPEED + default 10000000 + +# Clock Configs + +config CGU0_DF_DIV + default 0 + +config CGU0_VCO_MULT + default 80 + +config CGU0_CCLK_DIV + default 2 + +config CGU0_SCLK_DIV + default 4 + +config CGU0_SCLK0_DIV + default 4 + +config CGU0_SCLK1_DIV + default 2 + +config CGU0_DCLK_DIV + default 3 + +config CGU0_OCLK_DIV + default 8 + +config CGU0_DIV_S1SELEX + default 6 + +config CGU1_VCO_MULT + default 72 + +config CGU1_DF_DIV + default 0 + +config CGU1_CCLK_DIV + default 16 + +config CGU1_SCLK_DIV + default 8 + +config CGU1_SCLK0_DIV + default 4 + +config CGU1_SCLK1_DIV + default 2 + +config CGU1_DCLK_DIV + default 18 + +config CGU1_OCLK_DIV + default 16 + +config CGU1_DIV_S0SELEX + default 36 + +config CGU1_DIV_S1SELEX + default 90 + +endif diff --git a/board/adi/sc598-som-ezkit/sc598-som-ezkit.env b/board/adi/sc598-som-ezkit/sc598-som-ezkit.env new file mode 100644 index 0000000000..242436c160 --- /dev/null +++ b/board/adi/sc598-som-ezkit/sc598-som-ezkit.env @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later+ */ + +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#include <env/adi/adi_boot.env> + +adi_stage2_offset=0x40000 +adi_image_offset=0x01a0000 +adi_rfs_offset=0x1020000 +loadaddr=0x90000000 +jffs2file=adsp-sc5xx-__stringify(CONFIG_ADI_IMAGE)-adsp-sc598-som-ezkit.jffs2 diff --git a/include/configs/sc598-som.h b/include/configs/sc598-som.h new file mode 100644 index 0000000000..964c694bbe --- /dev/null +++ b/include/configs/sc598-som.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#ifndef __CONFIG_SC598_SOM_H +#define __CONFIG_SC598_SOM_H + +/* + * Memory Settings + */ +#define MEM_IS43TR16512BL +#define MEM_ISSI_4Gb_DDR3_800MHZ +#define MEM_DMC0 + +#define CFG_SYS_SDRAM_BASE 0x90000000 +#define CFG_SYS_SDRAM_SIZE 0x0e000000 + +/* GIC */ +#define GICD_BASE 0x31200000 +#define GICR_BASE 0x31240000 + +#endif

On Wed, Aug 28, 2024 at 11:02:21AM +0100, Oliver Gaskell wrote:
Adds support for Analog Devices' SC598-SOM-EZKIT board. Includes:
- CONFIG options common to all SC5xx SoCs
- SoC specific configs in mach-sc5xx/Kconfig
- Memory Map for SPL
- Necessary board-specific init functions
- Board-specific Kconfig and environment in board/adi/
- Memory configuration
Co-developed-by: Greg Malysa greg.malysa@timesys.com Co-developed-by: Nathan Barrett-Morrison nathan.morrison@timesys.com Co-developed-by: Trevor Woerner twoerner@gmail.com Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com
[snip]
- #ifdef CONFIG_SC59X_64
- u32 *to = (void *)&__bss_start;
- int i, sz;
- sz = &__bss_end - &__bss_start;
- for (i = 0; i < sz; i += 4)
*to++ = 0;
- #endif
No leading spaces on '#' and use if (IS_ENABLED(CONFIG...)) {} when possible.
+config SPL_BSS_START_ADDR
- hex
- default 0x200B0000
You don't need "hex" here and elsewhere. For many of these, if we have a list of defaults in the main Kconfig which has that option, please add yours there as well. This too applies to the rest of the series, thanks!

From: Oliver Gaskell Oliver.Gaskell@analog.com
Adds support for Analog Devices' SC598-SOM-EZLITE board. Includes: - Board specific configs in mach-sc5xx/Kconfig - Board-specific Kconfig and environment in board/adi/
Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com --- arch/arm/mach-sc5xx/Kconfig | 6 + board/adi/sc598-som-ezlite/Kconfig | 150 ++++++++++++++++++++++++ board/adi/sc598-som-ezlite/sc598-som-ezlite.env | 13 ++ 3 files changed, 169 insertions(+)
diff --git a/arch/arm/mach-sc5xx/Kconfig b/arch/arm/mach-sc5xx/Kconfig index cd3c7011f4..b3a17036e7 100644 --- a/arch/arm/mach-sc5xx/Kconfig +++ b/arch/arm/mach-sc5xx/Kconfig @@ -51,6 +51,11 @@ if SC59X_64 choice prompt "SC59x 64-bit board select"
+config TARGET_SC598_SOM_EZLITE + bool + prompt "SC598-SOM with SOMCRR-EZLITE" + select ADI_CARRIER_SOMCRR_EZLITE + config TARGET_SC598_SOM_EZKIT bool prompt "SC598-SOM with SOMCRR-EZKIT" @@ -500,5 +505,6 @@ config PINCTRL_ADI default y
source "board/adi/sc598-som-ezkit/Kconfig" +source "board/adi/sc598-som-ezlite/Kconfig"
endif diff --git a/board/adi/sc598-som-ezlite/Kconfig b/board/adi/sc598-som-ezlite/Kconfig new file mode 100644 index 0000000000..0dbb89cde5 --- /dev/null +++ b/board/adi/sc598-som-ezlite/Kconfig @@ -0,0 +1,150 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# (C) Copyright 2024 - Analog Devices, Inc. + +if TARGET_SC598_SOM_EZLITE + +config SYS_VENDOR + default "adi" + +config LDR_CPU + default "ADSP-SC598-0.0" + +config SYS_BOARD + default "sc598-som-ezlite" + +config SYS_CONFIG_NAME + default "sc598-som" + +config DEFAULT_DEVICE_TREE + default "sc598-som-ezlite" + +config SPL_MAX_SIZE + default 0x30000 # 256KB + +config ADI_IMAGE + default "minimal" + +config NR_DRAM_BANKS + default 1 + +config SPL_BSS_START_ADDR + hex + default 0x200B0000 + +config SPL_BSS_MAX_SIZE + hex + default 0x10000 # 64K + +config SYS_SPL_MALLOC_START + hex + default 0x200C0000 + +config SYS_SPL_MALLOC_SIZE + hex + default 0x10000 # 64K + +config SPL_STACK + hex + default 0x200E4000 + +config SPL_STACK_SIZE + hex + default 0x14000 # 64K + +config TEXT_BASE + hex + default 0x96000000 + +config CUSTOM_SYS_INIT_SP_ADDR + hex + default 0x96000000 + +config SYS_LOAD_ADDR + hex + default 0x0 + +# SPL + +config SPL_TEXT_BASE + default 0x20080000 + +config SPL_PAYLOAD_ARGS_ADDR + hex + default 0x99000000 + +config SPL_OF_LIBFDT_ASSUME_MASK + hex + default 0x0 + +# SPI Flash + +config SF_DEFAULT_BUS + default 2 + +config SF_DEFAULT_CS + default 1 + +config SF_DEFAULT_SPEED + default 10000000 + +# Clock Configs + +config CGU0_DF_DIV + default 0 + +config CGU0_VCO_MULT + default 80 + +config CGU0_CCLK_DIV + default 2 + +config CGU0_SCLK_DIV + default 4 + +config CGU0_SCLK0_DIV + default 4 + +config CGU0_SCLK1_DIV + default 2 + +config CGU0_DCLK_DIV + default 3 + +config CGU0_OCLK_DIV + default 8 + +config CGU0_DIV_S1SELEX + default 6 + +config CGU1_VCO_MULT + default 72 + +config CGU1_DF_DIV + default 0 + +config CGU1_CCLK_DIV + default 16 + +config CGU1_SCLK_DIV + default 8 + +config CGU1_SCLK0_DIV + default 4 + +config CGU1_SCLK1_DIV + default 2 + +config CGU1_DCLK_DIV + default 18 + +config CGU1_OCLK_DIV + default 16 + +config CGU1_DIV_S0SELEX + default 36 + +config CGU1_DIV_S1SELEX + default 90 + +endif diff --git a/board/adi/sc598-som-ezlite/sc598-som-ezlite.env b/board/adi/sc598-som-ezlite/sc598-som-ezlite.env new file mode 100644 index 0000000000..036c9ae759 --- /dev/null +++ b/board/adi/sc598-som-ezlite/sc598-som-ezlite.env @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later+ */ + +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#include <env/adi/adi_boot.env> + +adi_stage2_offset=0x40000 +adi_image_offset=0x01a0000 +adi_rfs_offset=0x1020000 +loadaddr=0x90000000 +jffs2file=adsp-sc5xx-__stringify(CONFIG_ADI_IMAGE)-adsp-sc598-som-ezlite.jffs2

From: Oliver Gaskell Oliver.Gaskell@analog.com
Adds support for Analog Devices' SC594-SOM-EZKIT board. Includes: - SoC specific configs in mach-sc5xx/Kconfig - Memory Map for SPL - Necessary board-specific init functions - Board-specific Kconfig and environment in board/adi/ - Memory configuration
Co-developed-by: Greg Malysa greg.malysa@timesys.com Co-developed-by: Trevor Woerner twoerner@gmail.com Co-developed-by: Nathan Barrett-Morrison nathan.morrison@timesys.com Co-developed-by: Ian Roberts ian.roberts@timesys.com Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com --- arch/arm/mach-sc5xx/Kconfig | 17 ++- arch/arm/mach-sc5xx/Makefile | 1 + arch/arm/mach-sc5xx/sc59x-spl.c | 26 ++++ board/adi/sc594-som-ezkit/Kconfig | 181 ++++++++++++++++++++++++++ board/adi/sc594-som-ezkit/sc594-som-ezkit.env | 13 ++ include/configs/sc594-som.h | 19 +++ 6 files changed, 256 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-sc5xx/Kconfig b/arch/arm/mach-sc5xx/Kconfig index b3a17036e7..fd7029974b 100644 --- a/arch/arm/mach-sc5xx/Kconfig +++ b/arch/arm/mach-sc5xx/Kconfig @@ -32,7 +32,7 @@ config SC59X bool "SC59x 32-bit series" select CPU_V7A select COMMON_CLK_ADI_SC594 - select NOP_PHY + select NOP_PHY if PHY
config SC59X_64 bool "SC59x 64-bit series" @@ -46,6 +46,20 @@ config SC59X_64
endchoice
+if SC59X + +choice + prompt "SC59x 32-bit board select" + +config TARGET_SC594_SOM_EZKIT + bool + prompt "SC594-SOM with SOMCRR-EZKIT" + select ADI_CARRIER_SOMCRR_EZKIT + +endchoice + +endif + if SC59X_64
choice @@ -506,5 +520,6 @@ config PINCTRL_ADI
source "board/adi/sc598-som-ezkit/Kconfig" source "board/adi/sc598-som-ezlite/Kconfig" +source "board/adi/sc594-som-ezkit/Kconfig"
endif diff --git a/arch/arm/mach-sc5xx/Makefile b/arch/arm/mach-sc5xx/Makefile index 0955c509a5..a8079b6120 100644 --- a/arch/arm/mach-sc5xx/Makefile +++ b/arch/arm/mach-sc5xx/Makefile @@ -13,6 +13,7 @@ obj-y += soc.o init/ obj-$(CONFIG_SC57X) += sc57x.o obj-$(CONFIG_SC58X) += sc58x.o obj-$(CONFIG_SC59X) += sc59x.o +obj-$(CONFIG_SC59X) += sc59x-spl.o obj-$(CONFIG_SC59X_64) += sc59x_64.o obj-$(CONFIG_SC59X_64) += sc59x_64-spl.o
diff --git a/arch/arm/mach-sc5xx/sc59x-spl.c b/arch/arm/mach-sc5xx/sc59x-spl.c new file mode 100644 index 0000000000..c8fc25fe7c --- /dev/null +++ b/arch/arm/mach-sc5xx/sc59x-spl.c @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#include <asm/arch-adi/sc5xx/spl.h> + +// Table 45-14 in sc594 HRM +const struct adi_boot_args adi_rom_boot_args[] = { + // JTAG/no boot + [0] = {0, 0, 0}, + // SPI master, used for qspi as well + [1] = {0x60040000, 0x00040000, 0x20620247}, + // SPI slave + [2] = {0, 0, 0x00000212}, + // UART slave + [3] = {0, 0, 0x00000013}, + // Linkport slave + [4] = {0, 0, 0x00000014}, + // OSPI master + [5] = {0x60040000, 0, 0x00000008}, + // reserved, no boot + [6] = {0, 0, 0}, + // reserved, also no boot + [7] = {0, 0, 0} +}; diff --git a/board/adi/sc594-som-ezkit/Kconfig b/board/adi/sc594-som-ezkit/Kconfig new file mode 100644 index 0000000000..09e22141d4 --- /dev/null +++ b/board/adi/sc594-som-ezkit/Kconfig @@ -0,0 +1,181 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# (C) Copyright 2024 - Analog Devices, Inc. + +if TARGET_SC594_SOM_EZKIT + +config SYS_VENDOR + default "adi" + +config LDR_CPU + default "ADSP-SC594-0.0" + +config SYS_BOARD + default "sc594-som-ezkit" + +config SYS_CONFIG_NAME + default "sc594-som" + +config DEFAULT_DEVICE_TREE + default "sc594-som-ezkit" + +config SPL_MAX_SIZE + default 0x30000 # 256KB + +config ADI_IMAGE + default "minimal" + +config SPL_BSS_START_ADDR + hex + default 0x200B0000 + +config SPL_BSS_MAX_SIZE + hex + default 0x10000 # 64K + +config SYS_SPL_MALLOC_START + hex + default 0x200C0000 + +config SYS_SPL_MALLOC_SIZE + hex + default 0x10000 # 64K + +config SPL_STACK + hex + default 0x200E4000 + +config SPL_STACK_SIZE + hex + default 0x14000 # 64K + +config TEXT_BASE + hex + default 0xB2200000 + +config CUSTOM_SYS_INIT_SP_ADDR + hex + default 0xA003f000 + +config SYS_LOAD_ADDR + hex + default 0x0 + +# SPL + +config SPL_TEXT_BASE + hex + default 0x20080000 + +config SPL_PAYLOAD_ARGS_ADDR + hex + default 0xA0000000 + +config SPL_OF_LIBFDT_ASSUME_MASK + hex + default 0x0 + +# SPI Flash + +config SF_DEFAULT_BUS + default 2 + +config SF_DEFAULT_CS + default 1 + +config SF_DEFAULT_SPEED + default 10000000 + +# Clocks + +config CGU0_DF_DIV + default 0 + +config CGU0_VCO_MULT + default 80 + +config CGU0_CCLK_DIV + default 2 + +config CGU0_SCLK_DIV + default 4 + +config CGU0_SCLK0_DIV + default 4 + +config CGU0_SCLK1_DIV + default 2 + +config CGU0_DCLK_DIV + default 2 + +config CGU0_OCLK_DIV + default 16 + +config CGU0_DIV_S1SELEX + default 6 + +config CGU1_VCO_MULT + default 64 + +config CGU1_DF_DIV + default 0 + +config CGU1_CCLK_DIV + default 2 + +config CGU1_SCLK_DIV + default 4 + +config CGU1_SCLK0_DIV + default 4 + +config CGU1_SCLK1_DIV + default 2 + +config CGU1_DCLK_DIV + default 2 + +config CGU1_OCLK_DIV + default 16 + +config CGU1_DIV_S1SELEX + default 6 + +config CDU0_CLKO0 + default 1 + +config CDU0_CLKO1 + default 1 + +config CDU0_CLKO2 + default 1 + +config CDU0_CLKO3 + default 3 + +config CDU0_CLKO4 + default 3 + +config CDU0_CLKO5 + default 1 + +config CDU0_CLKO6 + default 1 + +config CDU0_CLKO7 + default 1 + +config CDU0_CLKO8 + default 3 + +config CDU0_CLKO9 + default 1 + +config CDU0_CLKO10 + default 1 + +config CDU0_CLKO12 + default 1 + +endif diff --git a/board/adi/sc594-som-ezkit/sc594-som-ezkit.env b/board/adi/sc594-som-ezkit/sc594-som-ezkit.env new file mode 100644 index 0000000000..83d6b457a0 --- /dev/null +++ b/board/adi/sc594-som-ezkit/sc594-som-ezkit.env @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later+ */ + +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#include <env/adi/adi_boot.env> + +adi_stage2_offset=0x40000 +adi_image_offset=0x0120000 +adi_rfs_offset=0x1020000 +loadaddr=0xA2000000 +jffs2file=adsp-sc5xx-__stringify(CONFIG_ADI_IMAGE)-adsp-sc594-som-ezkit.jffs2 diff --git a/include/configs/sc594-som.h b/include/configs/sc594-som.h new file mode 100644 index 0000000000..ba9b0cdb0c --- /dev/null +++ b/include/configs/sc594-som.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#ifndef __CONFIG_SC594_SOM_H +#define __CONFIG_SC594_SOM_H + +/* + * Memory Settings + */ +#define MEM_IS43TR16512BL +#define MEM_ISSI_8Gb_DDR3_800MHZ +#define MEM_DMC0 + +#define CFG_SYS_SDRAM_BASE 0xA0000000 +#define CFG_SYS_SDRAM_SIZE 0x20000000 + +#endif

From: Oliver Gaskell Oliver.Gaskell@analog.com
Adds support for Analog Devices' SC594-SOM-EZLITE board. Includes: - Board specific configs in mach-sc5xx/Kconfig - Board-specific Kconfig and environment in board/adi/
Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com --- arch/arm/mach-sc5xx/Kconfig | 6 + board/adi/sc594-som-ezlite/Kconfig | 181 ++++++++++++++++++++++++ board/adi/sc594-som-ezlite/sc594-som-ezlite.env | 13 ++ 3 files changed, 200 insertions(+)
diff --git a/arch/arm/mach-sc5xx/Kconfig b/arch/arm/mach-sc5xx/Kconfig index fd7029974b..89bc60d6a5 100644 --- a/arch/arm/mach-sc5xx/Kconfig +++ b/arch/arm/mach-sc5xx/Kconfig @@ -51,6 +51,11 @@ if SC59X choice prompt "SC59x 32-bit board select"
+config TARGET_SC594_SOM_EZLITE + bool + prompt "SC594-SOM with SOMCRR-EZLITE" + select ADI_CARRIER_SOMCRR_EZLITE + config TARGET_SC594_SOM_EZKIT bool prompt "SC594-SOM with SOMCRR-EZKIT" @@ -521,5 +526,6 @@ config PINCTRL_ADI source "board/adi/sc598-som-ezkit/Kconfig" source "board/adi/sc598-som-ezlite/Kconfig" source "board/adi/sc594-som-ezkit/Kconfig" +source "board/adi/sc594-som-ezlite/Kconfig"
endif diff --git a/board/adi/sc594-som-ezlite/Kconfig b/board/adi/sc594-som-ezlite/Kconfig new file mode 100644 index 0000000000..fb6a8235a1 --- /dev/null +++ b/board/adi/sc594-som-ezlite/Kconfig @@ -0,0 +1,181 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# (C) Copyright 2024 - Analog Devices, Inc. + +if TARGET_SC594_SOM_EZLITE + +config SYS_VENDOR + default "adi" + +config LDR_CPU + default "ADSP-SC594-0.0" + +config SYS_BOARD + default "sc594-som-ezlite" + +config SYS_CONFIG_NAME + default "sc594-som" + +config DEFAULT_DEVICE_TREE + default "sc594-som-ezlite" + +config SPL_MAX_SIZE + default 0x30000 # 256KB + +config ADI_IMAGE + default "minimal" + +config SPL_BSS_START_ADDR + hex + default 0x200B0000 + +config SPL_BSS_MAX_SIZE + hex + default 0x10000 # 64K + +config SYS_SPL_MALLOC_START + hex + default 0x200C0000 + +config SYS_SPL_MALLOC_SIZE + hex + default 0x10000 # 64K + +config SPL_STACK + hex + default 0x200E4000 + +config SPL_STACK_SIZE + hex + default 0x14000 # 64K + +config TEXT_BASE + hex + default 0xB2200000 + +config CUSTOM_SYS_INIT_SP_ADDR + hex + default 0x8203f000 + +config SYS_LOAD_ADDR + hex + default 0x0 + +# SPL + +config SPL_TEXT_BASE + hex + default 0x20080000 + +config SPL_PAYLOAD_ARGS_ADDR + hex + default 0x80000000 + +config SPL_OF_LIBFDT_ASSUME_MASK + hex + default 0x0 + +# SPI Flash + +config SF_DEFAULT_BUS + default 2 + +config SF_DEFAULT_CS + default 1 + +config SF_DEFAULT_SPEED + default 10000000 + +# Clocks + +config CGU0_DF_DIV + default 0 + +config CGU0_VCO_MULT + default 80 + +config CGU0_CCLK_DIV + default 2 + +config CGU0_SCLK_DIV + default 4 + +config CGU0_SCLK0_DIV + default 4 + +config CGU0_SCLK1_DIV + default 2 + +config CGU0_DCLK_DIV + default 2 + +config CGU0_OCLK_DIV + default 16 + +config CGU0_DIV_S1SELEX + default 6 + +config CGU1_VCO_MULT + default 64 + +config CGU1_DF_DIV + default 0 + +config CGU1_CCLK_DIV + default 2 + +config CGU1_SCLK_DIV + default 4 + +config CGU1_SCLK0_DIV + default 4 + +config CGU1_SCLK1_DIV + default 2 + +config CGU1_DCLK_DIV + default 2 + +config CGU1_OCLK_DIV + default 16 + +config CGU1_DIV_S1SELEX + default 6 + +config CDU0_CLKO0 + default 1 + +config CDU0_CLKO1 + default 1 + +config CDU0_CLKO2 + default 1 + +config CDU0_CLKO3 + default 3 + +config CDU0_CLKO4 + default 3 + +config CDU0_CLKO5 + default 1 + +config CDU0_CLKO6 + default 1 + +config CDU0_CLKO7 + default 1 + +config CDU0_CLKO8 + default 3 + +config CDU0_CLKO9 + default 1 + +config CDU0_CLKO10 + default 1 + +config CDU0_CLKO12 + default 1 + +endif diff --git a/board/adi/sc594-som-ezlite/sc594-som-ezlite.env b/board/adi/sc594-som-ezlite/sc594-som-ezlite.env new file mode 100644 index 0000000000..152e1f14fd --- /dev/null +++ b/board/adi/sc594-som-ezlite/sc594-som-ezlite.env @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later+ */ + +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#include <env/adi/adi_boot.env> + +adi_stage2_offset=0x40000 +adi_image_offset=0x0120000 +adi_rfs_offset=0x1020000 +loadaddr=0xA2000000 +jffs2file=adsp-sc5xx-__stringify(CONFIG_ADI_IMAGE)-adsp-sc594-som-ezlite.jffs2

From: Oliver Gaskell Oliver.Gaskell@analog.com
Adds support for Analog Devices' SC584-EZKIT board. Includes: - SoC specific configs in mach-sc5xx/Kconfig - Memory Map for SPL - Necessary board-specific init functions - Board-specific Kconfig and environment in board/adi/ - Memory configuration
Co-developed-by: Greg Malysa greg.malysa@timesys.com Co-developed-by: Trevor Woerner twoerner@gmail.com Co-developed-by: Nathan Barrett-Morrison nathan.morrison@timesys.com Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com --- arch/arm/mach-sc5xx/Kconfig | 15 ++++ arch/arm/mach-sc5xx/Makefile | 1 + arch/arm/mach-sc5xx/sc58x-spl.c | 26 ++++++ arch/arm/mach-sc5xx/soc.c | 19 ++++ board/adi/sc584-ezkit/Kconfig | 160 ++++++++++++++++++++++++++++++++++ board/adi/sc584-ezkit/sc584-ezkit.env | 13 +++ include/configs/sc584-ezkit.h | 18 ++++ 7 files changed, 252 insertions(+)
diff --git a/arch/arm/mach-sc5xx/Kconfig b/arch/arm/mach-sc5xx/Kconfig index 89bc60d6a5..c75262bee4 100644 --- a/arch/arm/mach-sc5xx/Kconfig +++ b/arch/arm/mach-sc5xx/Kconfig @@ -46,6 +46,20 @@ config SC59X_64
endchoice
+if SC58X + +choice + prompt "SC58x board select" + +config TARGET_SC584_EZKIT + bool + prompt "SC584-EZKIT" + select ADI_USE_DDR2 + +endchoice + +endif + if SC59X
choice @@ -527,5 +541,6 @@ source "board/adi/sc598-som-ezkit/Kconfig" source "board/adi/sc598-som-ezlite/Kconfig" source "board/adi/sc594-som-ezkit/Kconfig" source "board/adi/sc594-som-ezlite/Kconfig" +source "board/adi/sc584-ezkit/Kconfig"
endif diff --git a/arch/arm/mach-sc5xx/Makefile b/arch/arm/mach-sc5xx/Makefile index a8079b6120..9a00a430b4 100644 --- a/arch/arm/mach-sc5xx/Makefile +++ b/arch/arm/mach-sc5xx/Makefile @@ -12,6 +12,7 @@ obj-y += soc.o init/
obj-$(CONFIG_SC57X) += sc57x.o obj-$(CONFIG_SC58X) += sc58x.o +obj-$(CONFIG_SC58X) += sc58x-spl.o obj-$(CONFIG_SC59X) += sc59x.o obj-$(CONFIG_SC59X) += sc59x-spl.o obj-$(CONFIG_SC59X_64) += sc59x_64.o diff --git a/arch/arm/mach-sc5xx/sc58x-spl.c b/arch/arm/mach-sc5xx/sc58x-spl.c new file mode 100644 index 0000000000..ae809f09e5 --- /dev/null +++ b/arch/arm/mach-sc5xx/sc58x-spl.c @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#include <asm/arch-adi/sc5xx/spl.h> + +// Table 53-13 in SC58x HRM +const struct adi_boot_args adi_rom_boot_args[] = { + // JTAG/no boot + [0] = {0, 0, 0}, + // SPI master, used for qspi as well + [1] = {0x60020000, 0x00040000, 0x00010207}, + // SPI slave + [2] = {0, 0, 0x00000212}, + // reserved, no boot + [3] = {0, 0, 0}, + // reserved, no boot + [4] = {0, 0, 0}, + // reserved, also no boot + [5] = {0, 0, 0}, + // Linkport slave + [6] = {0, 0, 0x00000014}, + // UART slave + [7] = {0, 0, 0x00000013}, +}; diff --git a/arch/arm/mach-sc5xx/soc.c b/arch/arm/mach-sc5xx/soc.c index 714b214bf6..9f2e66d729 100644 --- a/arch/arm/mach-sc5xx/soc.c +++ b/arch/arm/mach-sc5xx/soc.c @@ -173,6 +173,9 @@ void fixup_dp83867_phy(struct phy_device *phydev) }
extern char __bss_start, __bss_end; +#if defined(CONFIG_SC58X) +extern char __rel_dyn_start, __rel_dyn_end; +#endif
void bss_clear(void) { @@ -181,6 +184,22 @@ void bss_clear(void) int i, sz;
sz = &__bss_end - &__bss_start; + for (i = 0; i < sz; i += 4) + *to++ = 0; + #elif defined(CONFIG_SC58X) + u32 bss_start = (u32)&__bss_start; + u32 bss_end = (u32)&__bss_end; + u32 rel_dyn_end = (u32)&__rel_dyn_end; + u32 *to; + + if (rel_dyn_end >= bss_start && rel_dyn_end <= bss_end) + to = (u32 *)rel_dyn_end; + else + to = (u32 *)bss_start; + + int i, sz; + + sz = bss_end - (u32)to; for (i = 0; i < sz; i += 4) *to++ = 0; #endif diff --git a/board/adi/sc584-ezkit/Kconfig b/board/adi/sc584-ezkit/Kconfig new file mode 100644 index 0000000000..f0c6bad663 --- /dev/null +++ b/board/adi/sc584-ezkit/Kconfig @@ -0,0 +1,160 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# (C) Copyright 2024 - Analog Devices, Inc. + +if TARGET_SC584_EZKIT + +config SYS_VENDOR + default "adi" + +config LDR_CPU + default "ADSP-SC584-0.1" + +config SYS_BOARD + default "sc584-ezkit" + +config SYS_CONFIG_NAME + default "sc584-ezkit" + +config DEFAULT_DEVICE_TREE + default "sc584-ezkit" + +config SPL_MAX_SIZE + default 0x20000 # 128KB + +config ADI_IMAGE + default "tiny" + +config SPL_BSS_START_ADDR + hex + default 0x20080000 + +config SPL_BSS_MAX_SIZE + hex + default 0x10000 # 64K + +config SYS_SPL_MALLOC_START + hex + default 0x20090000 + +config SYS_SPL_MALLOC_SIZE + hex + default 0x10000 # 64K + +config SPL_STACK + hex + default 0x200B0000 + +config SPL_STACK_SIZE + hex + default 0x10000 # 64K + +config TEXT_BASE + hex + default 0x89200000 + +config CUSTOM_SYS_INIT_SP_ADDR + hex + default 0x8903f000 + +config SYS_LOAD_ADDR + hex + default 0x0 + +# SPL + +config SPL_TEXT_BASE + default 0x20080000 + +# SPI Flash + +config SF_DEFAULT_BUS + default 2 + +config SF_DEFAULT_CS + default 1 + +config SF_DEFAULT_SPEED + default 5000000 + +# Clocks + +config CGU0_DF_DIV + default 0 + +config CGU0_VCO_MULT + default 18 + +config CGU0_CCLK_DIV + default 1 + +config CGU0_SCLK_DIV + default 2 + +config CGU0_SCLK0_DIV + default 2 + +config CGU0_SCLK1_DIV + default 2 + +config CGU0_DCLK_DIV + default 2 + +config CGU0_OCLK_DIV + default 3 + +config CGU1_VCO_MULT + default 5 + +config CGU1_DF_DIV + default 0 + +config CGU1_CCLK_DIV + default 1 + +config CGU1_SCLK_DIV + default 2 + +config CGU1_SCLK0_DIV + default 2 + +config CGU1_SCLK1_DIV + default 2 + +config CGU1_DCLK_DIV + default 2 + +config CGU1_OCLK_DIV + default 3 + +config CDU0_CLKO0 + default 1 + +config CDU0_CLKO1 + default 1 + +config CDU0_CLKO2 + default 1 + +config CDU0_CLKO3 + default 1 + +config CDU0_CLKO4 + default 1 + +config CDU0_CLKO5 + default 1 + +config CDU0_CLKO6 + default 1 + +config CDU0_CLKO7 + default 5 + +config CDU0_CLKO8 + default 1 + +config CDU0_CLKO9 + default 1 + +endif diff --git a/board/adi/sc584-ezkit/sc584-ezkit.env b/board/adi/sc584-ezkit/sc584-ezkit.env new file mode 100644 index 0000000000..af9a9e01bc --- /dev/null +++ b/board/adi/sc584-ezkit/sc584-ezkit.env @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later+ */ + +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#include <env/adi/adi_boot.env> + +adi_stage2_offset=0x20000 +adi_image_offset=0xE0000 +adi_rfs_offset=0x6E0000 +loadaddr=0x89300000 +jffs2file=adsp-sc5xx-__stringify(CONFIG_ADI_IMAGE)-adsp-sc584-ezkit.jffs2 diff --git a/include/configs/sc584-ezkit.h b/include/configs/sc584-ezkit.h new file mode 100644 index 0000000000..905836cc2c --- /dev/null +++ b/include/configs/sc584-ezkit.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#ifndef __CONFIG_SC584_EZKIT_H +#define __CONFIG_SC584_EZKIT_H + +/* + * Memory Settings + */ +#define MEM_MT47H128M16RT +#define MEM_DMC0 + +#define CFG_SYS_SDRAM_BASE 0x89000000 +#define CFG_SYS_SDRAM_SIZE 0x7000000 + +#endif

From: Oliver Gaskell Oliver.Gaskell@analog.com
Adds support for Analog Devices' SC589-EZKIT board. Includes: - Board specific configs in mach-sc5xx/Kconfig - Board-specific Kconfig and environment in board/adi/ - Memory configuration
Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com --- arch/arm/mach-sc5xx/Kconfig | 5 ++ board/adi/sc589-ezkit/Kconfig | 160 ++++++++++++++++++++++++++++++++++ board/adi/sc589-ezkit/sc589-ezkit.env | 13 +++ include/configs/sc589.h | 19 ++++ 4 files changed, 197 insertions(+)
diff --git a/arch/arm/mach-sc5xx/Kconfig b/arch/arm/mach-sc5xx/Kconfig index c75262bee4..bbeb7c68b8 100644 --- a/arch/arm/mach-sc5xx/Kconfig +++ b/arch/arm/mach-sc5xx/Kconfig @@ -56,6 +56,10 @@ config TARGET_SC584_EZKIT prompt "SC584-EZKIT" select ADI_USE_DDR2
+config TARGET_SC589_EZKIT + bool + prompt "SC589-EZKIT" + endchoice
endif @@ -541,6 +545,7 @@ source "board/adi/sc598-som-ezkit/Kconfig" source "board/adi/sc598-som-ezlite/Kconfig" source "board/adi/sc594-som-ezkit/Kconfig" source "board/adi/sc594-som-ezlite/Kconfig" +source "board/adi/sc589-ezkit/Kconfig" source "board/adi/sc584-ezkit/Kconfig"
endif diff --git a/board/adi/sc589-ezkit/Kconfig b/board/adi/sc589-ezkit/Kconfig new file mode 100644 index 0000000000..a1ff59ef04 --- /dev/null +++ b/board/adi/sc589-ezkit/Kconfig @@ -0,0 +1,160 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# (C) Copyright 2024 - Analog Devices, Inc. + +if TARGET_SC589_EZKIT + +config SYS_VENDOR + default "adi" + +config LDR_CPU + default "ADSP-SC589-0.1" + +config SYS_BOARD + default "sc589-ezkit" + +config SYS_CONFIG_NAME + default "sc589" + +config DEFAULT_DEVICE_TREE + default "sc589-ezkit" + +config SPL_MAX_SIZE + default 0x20000 # 128KB + +config ADI_IMAGE + default "tiny" + +config SPL_BSS_START_ADDR + hex + default 0x20080000 + +config SPL_BSS_MAX_SIZE + hex + default 0x10000 # 64K + +config SYS_SPL_MALLOC_START + hex + default 0x20090000 + +config SYS_SPL_MALLOC_SIZE + hex + default 0x10000 # 64K + +config SPL_STACK + hex + default 0x200B0000 + +config SPL_STACK_SIZE + hex + default 0x10000 # 64K + +config TEXT_BASE + hex + default 0xC2200000 + +config CUSTOM_SYS_INIT_SP_ADDR + hex + default 0xC203f000 + +config SYS_LOAD_ADDR + hex + default 0x0 + +# SPL + +config SPL_TEXT_BASE + default 0x20080000 + +# SPI Flash + +config SF_DEFAULT_BUS + default 2 + +config SF_DEFAULT_CS + default 1 + +config SF_DEFAULT_SPEED + default 10000000 + +# Clocks + +config CGU0_DF_DIV + default 0 + +config CGU0_VCO_MULT + default 18 + +config CGU0_CCLK_DIV + default 1 + +config CGU0_SCLK_DIV + default 2 + +config CGU0_SCLK0_DIV + default 2 + +config CGU0_SCLK1_DIV + default 2 + +config CGU0_DCLK_DIV + default 1 + +config CGU0_OCLK_DIV + default 3 + +config CGU1_VCO_MULT + default 5 + +config CGU1_DF_DIV + default 0 + +config CGU1_CCLK_DIV + default 1 + +config CGU1_SCLK_DIV + default 2 + +config CGU1_SCLK0_DIV + default 2 + +config CGU1_SCLK1_DIV + default 2 + +config CGU1_DCLK_DIV + default 2 + +config CGU1_OCLK_DIV + default 3 + +config CDU0_CLKO0 + default 1 + +config CDU0_CLKO1 + default 1 + +config CDU0_CLKO2 + default 1 + +config CDU0_CLKO3 + default 1 + +config CDU0_CLKO4 + default 1 + +config CDU0_CLKO5 + default 1 + +config CDU0_CLKO6 + default 1 + +config CDU0_CLKO7 + default 5 + +config CDU0_CLKO8 + default 1 + +config CDU0_CLKO9 + default 1 + +endif diff --git a/board/adi/sc589-ezkit/sc589-ezkit.env b/board/adi/sc589-ezkit/sc589-ezkit.env new file mode 100644 index 0000000000..34b924992a --- /dev/null +++ b/board/adi/sc589-ezkit/sc589-ezkit.env @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later+ */ + +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#include <env/adi/adi_boot.env> + +adi_stage2_offset=0x20000 +adi_image_offset=0xE0000 +adi_rfs_offset=0x6E0000 +loadaddr=0xC3000000 +jffs2file=adsp-sc5xx-__stringify(CONFIG_ADI_IMAGE)-adsp-sc589-ezkit.jffs2 diff --git a/include/configs/sc589.h b/include/configs/sc589.h new file mode 100644 index 0000000000..137c80be8e --- /dev/null +++ b/include/configs/sc589.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#ifndef __CONFIG_SC589_H +#define __CONFIG_SC589_H + +/* + * Memory Settings + */ +#define MEM_MT41K128M16JT +#define MEM_DMC0 +#define MEM_DMC1 + +#define CFG_SYS_SDRAM_BASE 0xC2000000 +#define CFG_SYS_SDRAM_SIZE 0xe000000 + +#endif

From: Oliver Gaskell Oliver.Gaskell@analog.com
Adds support for Analog Devices' SC589-MINI board. Includes: - Board specific configs in mach-sc5xx/Kconfig - Board-specific Kconfig and environment in board/adi/
Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com --- arch/arm/mach-sc5xx/Kconfig | 5 ++ board/adi/sc589-mini/Kconfig | 160 ++++++++++++++++++++++++++++++++++++ board/adi/sc589-mini/sc589-mini.env | 13 +++ 3 files changed, 178 insertions(+)
diff --git a/arch/arm/mach-sc5xx/Kconfig b/arch/arm/mach-sc5xx/Kconfig index bbeb7c68b8..d9cf38a3b5 100644 --- a/arch/arm/mach-sc5xx/Kconfig +++ b/arch/arm/mach-sc5xx/Kconfig @@ -56,6 +56,10 @@ config TARGET_SC584_EZKIT prompt "SC584-EZKIT" select ADI_USE_DDR2
+config TARGET_SC589_MINI + bool + prompt "SC589-MINI" + config TARGET_SC589_EZKIT bool prompt "SC589-EZKIT" @@ -546,6 +550,7 @@ source "board/adi/sc598-som-ezlite/Kconfig" source "board/adi/sc594-som-ezkit/Kconfig" source "board/adi/sc594-som-ezlite/Kconfig" source "board/adi/sc589-ezkit/Kconfig" +source "board/adi/sc589-mini/Kconfig" source "board/adi/sc584-ezkit/Kconfig"
endif diff --git a/board/adi/sc589-mini/Kconfig b/board/adi/sc589-mini/Kconfig new file mode 100644 index 0000000000..0bc981bd39 --- /dev/null +++ b/board/adi/sc589-mini/Kconfig @@ -0,0 +1,160 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# (C) Copyright 2024 - Analog Devices, Inc. + +if TARGET_SC589_MINI + +config SYS_VENDOR + default "adi" + +config LDR_CPU + default "ADSP-SC589-0.1" + +config SYS_BOARD + default "sc589-mini" + +config SYS_CONFIG_NAME + default "sc589" + +config DEFAULT_DEVICE_TREE + default "sc589-mini" + +config SPL_MAX_SIZE + default 0x20000 # 128KB + +config ADI_IMAGE + default "minimal" + +config SPL_BSS_START_ADDR + hex + default 0x20080000 + +config SPL_BSS_MAX_SIZE + hex + default 0x10000 # 64K + +config SYS_SPL_MALLOC_START + hex + default 0x20090000 + +config SYS_SPL_MALLOC_SIZE + hex + default 0x10000 # 64K + +config SPL_STACK + hex + default 0x200B0000 + +config SPL_STACK_SIZE + hex + default 0x10000 # 64K + +config TEXT_BASE + hex + default 0xC2200000 + +config CUSTOM_SYS_INIT_SP_ADDR + hex + default 0xC203f000 + +config SYS_LOAD_ADDR + hex + default 0x0 + +# SPL + +config SPL_TEXT_BASE + default 0x20080000 + +# SPI Flash + +config SF_DEFAULT_BUS + default 2 + +config SF_DEFAULT_CS + default 1 + +config SF_DEFAULT_SPEED + default 5000000 + +# Clocks + +config CGU0_DF_DIV + default 0 + +config CGU0_VCO_MULT + default 18 + +config CGU0_CCLK_DIV + default 1 + +config CGU0_SCLK_DIV + default 2 + +config CGU0_SCLK0_DIV + default 2 + +config CGU0_SCLK1_DIV + default 2 + +config CGU0_DCLK_DIV + default 1 + +config CGU0_OCLK_DIV + default 3 + +config CGU1_VCO_MULT + default 5 + +config CGU1_DF_DIV + default 0 + +config CGU1_CCLK_DIV + default 1 + +config CGU1_SCLK_DIV + default 2 + +config CGU1_SCLK0_DIV + default 2 + +config CGU1_SCLK1_DIV + default 2 + +config CGU1_DCLK_DIV + default 2 + +config CGU1_OCLK_DIV + default 3 + +config CDU0_CLKO0 + default 1 + +config CDU0_CLKO1 + default 1 + +config CDU0_CLKO2 + default 1 + +config CDU0_CLKO3 + default 1 + +config CDU0_CLKO4 + default 1 + +config CDU0_CLKO5 + default 1 + +config CDU0_CLKO6 + default 1 + +config CDU0_CLKO7 + default 5 + +config CDU0_CLKO8 + default 1 + +config CDU0_CLKO9 + default 1 + +endif diff --git a/board/adi/sc589-mini/sc589-mini.env b/board/adi/sc589-mini/sc589-mini.env new file mode 100644 index 0000000000..0f3f0bd28e --- /dev/null +++ b/board/adi/sc589-mini/sc589-mini.env @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later+ */ + +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#include <env/adi/adi_boot.env> + +adi_stage2_offset=0x20000 +adi_image_offset=0xE0000 +adi_rfs_offset=0x8E0000 +loadaddr=0xC3000000 +jffs2file=adsp-sc5xx-__stringify(CONFIG_ADI_IMAGE)-adsp-sc589-mini.jffs2

From: Oliver Gaskell Oliver.Gaskell@analog.com
Adds support for Analog Devices' SC573-EZKIT board. Includes: - SoC specific configs in mach-sc5xx/Kconfig - Memory Map for SPL - Necessary board-specific init functions - Board-specific Kconfig and environment in board/adi/ - Memory configuration
Co-developed-by: Greg Malysa greg.malysa@timesys.com Co-developed-by: Nathan Barrett-Morrison nathan.morrison@timesys.com Signed-off-by: Oliver Gaskell Oliver.Gaskell@analog.com --- arch/arm/mach-sc5xx/Kconfig | 9 ++ arch/arm/mach-sc5xx/Makefile | 1 + arch/arm/mach-sc5xx/sc57x-spl.c | 26 ++++++ arch/arm/mach-sc5xx/soc.c | 4 +- board/adi/sc573-ezkit/Kconfig | 160 ++++++++++++++++++++++++++++++++++ board/adi/sc573-ezkit/sc573-ezkit.env | 13 +++ include/configs/sc573-ezkit.h | 18 ++++ 7 files changed, 229 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-sc5xx/Kconfig b/arch/arm/mach-sc5xx/Kconfig index d9cf38a3b5..9b26342bc3 100644 --- a/arch/arm/mach-sc5xx/Kconfig +++ b/arch/arm/mach-sc5xx/Kconfig @@ -22,6 +22,7 @@ config SC57X bool "SC57x series" select CPU_V7A select COMMON_CLK_ADI_SC57X + select TARGET_SC573_EZKIT
config SC58X bool "SC58x series" @@ -46,6 +47,13 @@ config SC59X_64
endchoice
+if SC57X + +config TARGET_SC573_EZKIT + bool "Support SC573-EZKIT" + +endif + if SC58X
choice @@ -552,5 +560,6 @@ source "board/adi/sc594-som-ezlite/Kconfig" source "board/adi/sc589-ezkit/Kconfig" source "board/adi/sc589-mini/Kconfig" source "board/adi/sc584-ezkit/Kconfig" +source "board/adi/sc573-ezkit/Kconfig"
endif diff --git a/arch/arm/mach-sc5xx/Makefile b/arch/arm/mach-sc5xx/Makefile index 9a00a430b4..cac768ba56 100644 --- a/arch/arm/mach-sc5xx/Makefile +++ b/arch/arm/mach-sc5xx/Makefile @@ -11,6 +11,7 @@ obj-y += soc.o init/
obj-$(CONFIG_SC57X) += sc57x.o +obj-$(CONFIG_SC57X) += sc57x-spl.o obj-$(CONFIG_SC58X) += sc58x.o obj-$(CONFIG_SC58X) += sc58x-spl.o obj-$(CONFIG_SC59X) += sc59x.o diff --git a/arch/arm/mach-sc5xx/sc57x-spl.c b/arch/arm/mach-sc5xx/sc57x-spl.c new file mode 100644 index 0000000000..28380b89b4 --- /dev/null +++ b/arch/arm/mach-sc5xx/sc57x-spl.c @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#include <asm/arch-adi/sc5xx/spl.h> + +// Table 45-16 in SC573 HRM +const struct adi_boot_args adi_rom_boot_args[] = { + // JTAG/no boot + [0] = {0, 0, 0}, + // SPI master, used for qspi as well + [1] = {0x60020000, 0x00040000, 0x00010207}, + // SPI slave + [2] = {0, 0, 0x00000212}, + // UART slave + [3] = {0, 0, 0x00000013}, + // Linkport slave + [4] = {0, 0, 0x00000014}, + // reserved, no boot + [5] = {0, 0, 0}, + // reserved, no boot + [6] = {0, 0, 0}, + // reserved, also no boot + [7] = {0, 0, 0} +}; diff --git a/arch/arm/mach-sc5xx/soc.c b/arch/arm/mach-sc5xx/soc.c index 9f2e66d729..4976243fb9 100644 --- a/arch/arm/mach-sc5xx/soc.c +++ b/arch/arm/mach-sc5xx/soc.c @@ -173,7 +173,7 @@ void fixup_dp83867_phy(struct phy_device *phydev) }
extern char __bss_start, __bss_end; -#if defined(CONFIG_SC58X) +#if defined(CONFIG_SC57X) || defined(CONFIG_SC58X) extern char __rel_dyn_start, __rel_dyn_end; #endif
@@ -186,7 +186,7 @@ void bss_clear(void) sz = &__bss_end - &__bss_start; for (i = 0; i < sz; i += 4) *to++ = 0; - #elif defined(CONFIG_SC58X) + #elif defined(CONFIG_SC57X) || defined(CONFIG_SC58X) u32 bss_start = (u32)&__bss_start; u32 bss_end = (u32)&__bss_end; u32 rel_dyn_end = (u32)&__rel_dyn_end; diff --git a/board/adi/sc573-ezkit/Kconfig b/board/adi/sc573-ezkit/Kconfig new file mode 100644 index 0000000000..91da4f1e05 --- /dev/null +++ b/board/adi/sc573-ezkit/Kconfig @@ -0,0 +1,160 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# (C) Copyright 2024 - Analog Devices, Inc. + +if TARGET_SC573_EZKIT + +config SYS_VENDOR + default "adi" + +config SYS_BOARD + default "sc573-ezkit" + +config SYS_CONFIG_NAME + default "sc573-ezkit" + +config LDR_CPU + default "ADSP-SC573-0.0" + +config DEFAULT_DEVICE_TREE + default "sc573-ezkit" + +config SPL_MAX_SIZE + default 0x20000 # 128KB + +config ADI_IMAGE + default "tiny" + +config SPL_BSS_START_ADDR + hex + default 0x200A0000 + +config SPL_BSS_MAX_SIZE + hex + default 0x10000 # 64K + +config SYS_SPL_MALLOC_START + hex + default 0x200B0000 + +config SYS_SPL_MALLOC_SIZE + hex + default 0x10000 # 64K + +config SPL_STACK + hex + default 0x200D0000 + +config SPL_STACK_SIZE + hex + default 0x10000 # 64K + +config TEXT_BASE + hex + default 0x82200000 + +config CUSTOM_SYS_INIT_SP_ADDR + hex + default 0x8203f000 + +config SYS_LOAD_ADDR + hex + default 0x0 + +# SPL + +config SPL_TEXT_BASE + default 0x20080000 + +# SPI Flash + +config SF_DEFAULT_BUS + default 2 + +config SF_DEFAULT_CS + default 1 + +config SF_DEFAULT_SPEED + default 10000000 + +# Clocks + +config CGU0_DF_DIV + default 0 + +config CGU0_VCO_MULT + default 18 + +config CGU0_CCLK_DIV + default 1 + +config CGU0_SCLK_DIV + default 2 + +config CGU0_SCLK0_DIV + default 2 + +config CGU0_SCLK1_DIV + default 2 + +config CGU0_DCLK_DIV + default 2 + +config CGU0_OCLK_DIV + default 3 + +config CGU1_VCO_MULT + default 5 + +config CGU1_DF_DIV + default 0 + +config CGU1_CCLK_DIV + default 1 + +config CGU1_SCLK_DIV + default 2 + +config CGU1_SCLK0_DIV + default 2 + +config CGU1_SCLK1_DIV + default 2 + +config CGU1_DCLK_DIV + default 2 + +config CGU1_OCLK_DIV + default 3 + +config CDU0_CLKO0 + default 1 + +config CDU0_CLKO1 + default 1 + +config CDU0_CLKO2 + default 1 + +config CDU0_CLKO3 + default 1 + +config CDU0_CLKO4 + default 1 + +config CDU0_CLKO5 + default 1 + +config CDU0_CLKO6 + default 1 + +config CDU0_CLKO7 + default 5 + +config CDU0_CLKO8 + default 1 + +config CDU0_CLKO9 + default 1 + +endif diff --git a/board/adi/sc573-ezkit/sc573-ezkit.env b/board/adi/sc573-ezkit/sc573-ezkit.env new file mode 100644 index 0000000000..26f7b6cb79 --- /dev/null +++ b/board/adi/sc573-ezkit/sc573-ezkit.env @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later+ */ + +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#include <env/adi/adi_boot.env> + +adi_stage2_offset=0x20000 +adi_image_offset=0xE0000 +adi_rfs_offset=0x6E0000 +loadaddr=0x83000000 +jffs2file=adsp-sc5xx-__stringify(CONFIG_ADI_IMAGE)-adsp-sc573-ezkit.jffs2 diff --git a/include/configs/sc573-ezkit.h b/include/configs/sc573-ezkit.h new file mode 100644 index 0000000000..42e42f8150 --- /dev/null +++ b/include/configs/sc573-ezkit.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#ifndef __CONFIG_SC573_EZKIT_H +#define __CONFIG_SC573_EZKIT_H + +/* + * Memory Settings + */ +#define MEM_MT41K128M16JT +#define MEM_DMC0 + +#define CFG_SYS_SDRAM_BASE 0x82000000 +#define CFG_SYS_SDRAM_SIZE 0xe000000 + +#endif

On Wed, Aug 28, 2024 at 11:02:08AM +0100, Oliver Gaskell via B4 Relay wrote:
ADSP-SC5xx is a series of ARM-based DSPs. This comprises the armv7 based SC57x, SC58x and SC594 series, and the armv8 based SC598.
This patch series includes configurations, init code, and minimal DTs to enable Analog Devices' evaluation boards for these SoCs to boot through SPL and into U-Boot Proper, as well as devicetree schemas for the added DTs.
This patch series depends on ("arm: Add Analog Devices SC5xx Machine Type") (https://lists.denx.de/pipermail/u-boot/2024-April/552043.html)
Since that series has been merged since early May, what is this series based on top of? It should be based on top of current (or close enough to not matter) -next. Also, has everything been passed through checkpatch.pl and the results looked at? Thanks.

-----Original Message----- From: Tom Rini trini@konsulko.com Sent: Thursday, August 29, 2024 3:52 PM To: Gaskell, Oliver Oliver.Gaskell@analog.com Cc: Nathan Barrett-Morrison nathan.morrison@timesys.com; Greg Malysa greg.malysa@timesys.com; Ian Roberts ian.roberts@timesys.com; Bimpikas, Vasileios Vasileios.Bimpikas@analog.com; Agarwal, Utsav Utsav.Agarwal@analog.com; Artamonovs, Arturs Arturs.Artamonovs@analog.com; Rayagonda Kokatanur rayagonda.kokatanur@broadcom.com; u-boot@lists.denx.de; Linux Factory adsp-linux@analog.com; Trevor Woerner twoerner@gmail.com Subject: Re: [PATCH 00/20] arm: Initial support for Analog Devices SC5xx boards
[External]
On Wed, Aug 28, 2024 at 11:02:08AM +0100, Oliver Gaskell via B4 Relay wrote:
ADSP-SC5xx is a series of ARM-based DSPs. This comprises the armv7 based SC57x, SC58x and SC594 series, and the armv8 based SC598.
This patch series includes configurations, init code, and minimal DTs to enable Analog Devices' evaluation boards for these SoCs to boot through SPL and into U-Boot Proper, as well as devicetree schemas for the added DTs.
This patch series depends on ("arm: Add Analog Devices SC5xx Machine Type") (https://lists.denx.de/pipermail/u-boot/2024-April/552043.html)
Since that series has been merged since early May, what is this series based on top of? It should be based on top of current (or close enough to not matter) -next. Also, has everything been passed through checkpatch.pl and the results looked at? Thanks.
I made it on top of -rc1, just tested and I think it applies cleanly to -rc3 and next. Wasn't sure on the policy re. patch series dependencies so just wanted to be 100% sure that was clear.
It has been run through checkpatch, there's a few warnings that I think are OK. Only warning I missed is about the Co-developed-by tags not having matching Signed-off-by tags - if this is an issue I can make a v2 that fixes this.
-- Tom
Thanks, Oliver

On Thu, Aug 29, 2024 at 03:06:31PM +0000, Gaskell, Oliver wrote:
-----Original Message----- From: Tom Rini trini@konsulko.com Sent: Thursday, August 29, 2024 3:52 PM To: Gaskell, Oliver Oliver.Gaskell@analog.com Cc: Nathan Barrett-Morrison nathan.morrison@timesys.com; Greg Malysa greg.malysa@timesys.com; Ian Roberts ian.roberts@timesys.com; Bimpikas, Vasileios Vasileios.Bimpikas@analog.com; Agarwal, Utsav Utsav.Agarwal@analog.com; Artamonovs, Arturs Arturs.Artamonovs@analog.com; Rayagonda Kokatanur rayagonda.kokatanur@broadcom.com; u-boot@lists.denx.de; Linux Factory adsp-linux@analog.com; Trevor Woerner twoerner@gmail.com Subject: Re: [PATCH 00/20] arm: Initial support for Analog Devices SC5xx boards
[External]
On Wed, Aug 28, 2024 at 11:02:08AM +0100, Oliver Gaskell via B4 Relay wrote:
ADSP-SC5xx is a series of ARM-based DSPs. This comprises the armv7 based SC57x, SC58x and SC594 series, and the armv8 based SC598.
This patch series includes configurations, init code, and minimal DTs to enable Analog Devices' evaluation boards for these SoCs to boot through SPL and into U-Boot Proper, as well as devicetree schemas for the added DTs.
This patch series depends on ("arm: Add Analog Devices SC5xx Machine Type") (https://lists.denx.de/pipermail/u-boot/2024-April/552043.html)
Since that series has been merged since early May, what is this series based on top of? It should be based on top of current (or close enough to not matter) -next. Also, has everything been passed through checkpatch.pl and the results looked at? Thanks.
I made it on top of -rc1, just tested and I think it applies cleanly to -rc3 and next. Wasn't sure on the policy re. patch series dependencies so just wanted to be 100% sure that was clear.
It has been run through checkpatch, there's a few warnings that I think are OK. Only warning I missed is about the Co-developed-by tags not having matching Signed-off-by tags - if this is an issue I can make a v2 that fixes this.
OK, thanks for elaborating. I forget, what is the plan to upstream these dts files?

-----Original Message----- From: Tom Rini trini@konsulko.com Sent: Thursday, August 29, 2024 4:18 PM To: Gaskell, Oliver Oliver.Gaskell@analog.com Cc: Nathan Barrett-Morrison nathan.morrison@timesys.com; Greg Malysa greg.malysa@timesys.com; Ian Roberts ian.roberts@timesys.com; Bimpikas, Vasileios Vasileios.Bimpikas@analog.com; Agarwal, Utsav Utsav.Agarwal@analog.com; Artamonovs, Arturs Arturs.Artamonovs@analog.com; Rayagonda Kokatanur rayagonda.kokatanur@broadcom.com; u-boot@lists.denx.de; Linux Factory adsp-linux@analog.com; Trevor Woerner twoerner@gmail.com Subject: Re: [PATCH 00/20] arm: Initial support for Analog Devices SC5xx boards
[External]
On Thu, Aug 29, 2024 at 03:06:31PM +0000, Gaskell, Oliver wrote:
-----Original Message----- From: Tom Rini trini@konsulko.com Sent: Thursday, August 29, 2024 3:52 PM To: Gaskell, Oliver Oliver.Gaskell@analog.com Cc: Nathan Barrett-Morrison nathan.morrison@timesys.com; Greg Malysa greg.malysa@timesys.com; Ian Roberts ian.roberts@timesys.com; Bimpikas, Vasileios Vasileios.Bimpikas@analog.com; Agarwal, Utsav Utsav.Agarwal@analog.com; Artamonovs, Arturs Arturs.Artamonovs@analog.com; Rayagonda Kokatanur rayagonda.kokatanur@broadcom.com; u-boot@lists.denx.de; Linux
Factory
adsp-linux@analog.com; Trevor Woerner twoerner@gmail.com Subject: Re: [PATCH 00/20] arm: Initial support for Analog Devices
SC5xx
boards
[External]
On Wed, Aug 28, 2024 at 11:02:08AM +0100, Oliver Gaskell via B4 Relay wrote:
ADSP-SC5xx is a series of ARM-based DSPs. This comprises the armv7 based SC57x, SC58x and SC594 series, and
the
armv8 based SC598.
This patch series includes configurations, init code, and minimal
DTs
to enable Analog Devices' evaluation boards for these SoCs to boot through SPL and into U-Boot Proper, as well as devicetree schemas
for
the added DTs.
This patch series depends on ("arm: Add Analog Devices SC5xx Machine Type") (https://lists.denx.de/pipermail/u-boot/2024-
April/552043.html)
Since that series has been merged since early May, what is this series based on top of? It should be based on top of current (or close enough to not matter) -next. Also, has everything been passed through checkpatch.pl and the results looked at? Thanks.
I made it on top of -rc1, just tested and I think it applies cleanly to -rc3 and next. Wasn't sure on the policy re. patch series
dependencies
so just wanted to be 100% sure that was clear.
It has been run through checkpatch, there's a few warnings that I think are OK. Only warning I missed is about the Co-developed-by tags not having matching Signed-off-by tags - if this is an issue I can make a v2 that fixes this.
OK, thanks for elaborating. I forget, what is the plan to upstream these dts files?
We're currently in the process of upstreaming support for a single platform (SC598) to Linux, and others will likely follow, so we'd like to have the minimal device trees in this patch series in U-Boot for now so it's possible to boot the boards from source. As and when the devicetrees are in Linux, we will remove them and enable OF_UPSTREAM for the relevant boards.
Thanks, Oliver

On Thu, Aug 29, 2024 at 03:50:56PM +0000, Gaskell, Oliver wrote:
-----Original Message----- From: Tom Rini trini@konsulko.com Sent: Thursday, August 29, 2024 4:18 PM To: Gaskell, Oliver Oliver.Gaskell@analog.com Cc: Nathan Barrett-Morrison nathan.morrison@timesys.com; Greg Malysa greg.malysa@timesys.com; Ian Roberts ian.roberts@timesys.com; Bimpikas, Vasileios Vasileios.Bimpikas@analog.com; Agarwal, Utsav Utsav.Agarwal@analog.com; Artamonovs, Arturs Arturs.Artamonovs@analog.com; Rayagonda Kokatanur rayagonda.kokatanur@broadcom.com; u-boot@lists.denx.de; Linux Factory adsp-linux@analog.com; Trevor Woerner twoerner@gmail.com Subject: Re: [PATCH 00/20] arm: Initial support for Analog Devices SC5xx boards
[External]
On Thu, Aug 29, 2024 at 03:06:31PM +0000, Gaskell, Oliver wrote:
-----Original Message----- From: Tom Rini trini@konsulko.com Sent: Thursday, August 29, 2024 3:52 PM To: Gaskell, Oliver Oliver.Gaskell@analog.com Cc: Nathan Barrett-Morrison nathan.morrison@timesys.com; Greg Malysa greg.malysa@timesys.com; Ian Roberts ian.roberts@timesys.com; Bimpikas, Vasileios Vasileios.Bimpikas@analog.com; Agarwal, Utsav Utsav.Agarwal@analog.com; Artamonovs, Arturs Arturs.Artamonovs@analog.com; Rayagonda Kokatanur rayagonda.kokatanur@broadcom.com; u-boot@lists.denx.de; Linux
Factory
adsp-linux@analog.com; Trevor Woerner twoerner@gmail.com Subject: Re: [PATCH 00/20] arm: Initial support for Analog Devices
SC5xx
boards
[External]
On Wed, Aug 28, 2024 at 11:02:08AM +0100, Oliver Gaskell via B4 Relay wrote:
ADSP-SC5xx is a series of ARM-based DSPs. This comprises the armv7 based SC57x, SC58x and SC594 series, and
the
armv8 based SC598.
This patch series includes configurations, init code, and minimal
DTs
to enable Analog Devices' evaluation boards for these SoCs to boot through SPL and into U-Boot Proper, as well as devicetree schemas
for
the added DTs.
This patch series depends on ("arm: Add Analog Devices SC5xx Machine Type") (https://lists.denx.de/pipermail/u-boot/2024-
April/552043.html)
Since that series has been merged since early May, what is this series based on top of? It should be based on top of current (or close enough to not matter) -next. Also, has everything been passed through checkpatch.pl and the results looked at? Thanks.
I made it on top of -rc1, just tested and I think it applies cleanly to -rc3 and next. Wasn't sure on the policy re. patch series
dependencies
so just wanted to be 100% sure that was clear.
It has been run through checkpatch, there's a few warnings that I think are OK. Only warning I missed is about the Co-developed-by tags not having matching Signed-off-by tags - if this is an issue I can make a v2 that fixes this.
OK, thanks for elaborating. I forget, what is the plan to upstream these dts files?
We're currently in the process of upstreaming support for a single platform (SC598) to Linux, and others will likely follow, so we'd like to have the minimal device trees in this patch series in U-Boot for now so it's possible to boot the boards from source. As and when the devicetrees are in Linux, we will remove them and enable OF_UPSTREAM for the relevant boards.
OK, thanks.
participants (3)
-
Gaskell, Oliver
-
Oliver Gaskell via B4 Relay
-
Tom Rini