linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] arm64: Initial support for Texas Instruments AM62 Platform
@ 2022-02-08 13:18 Vignesh Raghavendra
  2022-02-08 13:18 ` [PATCH 1/5] soc: ti: k3-socinfo: Add AM62x JTAG ID Vignesh Raghavendra
                   ` (4 more replies)
  0 siblings, 5 replies; 22+ messages in thread
From: Vignesh Raghavendra @ 2022-02-08 13:18 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo, Rob Herring,
	Krzysztof Kozlowski, Santosh Shilimkar
  Cc: linux-arm-kernel, devicetree, linux-kernel

This adds AM62 SoC support.

The AM62 SoC family is the follow on AM335x built on K3 Multicore SoC
architecture platform, providing ultra-low-power modes, dual display,
multi-sensor edge compute, security and other BOM-saving integration.
The AM62 SoC targets broad market to enable applications such as
Industrial HMI, PLC/CNC/Robot control, Medical Equipment, Building
Automation, Appliances and more.

Some highlights of this SoC are:

* Quad-Cortex-A53s (running up to 1.4GHz) in a single cluster.
  Pin-to-pin compatible options for single and quad core are available.
* Cortex-M4F for general-purpose or safety usage.
* Dual display support, providing 24-bit RBG parallel interface and
  OLDI/LVDS-4 Lane x2, up to 200MHz pixel clock support for 2K display
  resolution.
* Selectable GPUsupport, up to 8GFLOPS, providing better user experience
  in 3D graphic display case and Android.
* PRU(Programmable Realtime Unit) support for customized programmable
  interfaces/IOs.
* Integrated Giga-bit Ethernet switch supporting up to a total of two
  external ports (TSN capable).
* 9xUARTs, 5xSPI, 6xI2C, 2xUSB2, 3xCAN-FD, 3x eMMC and SD, GPMC for
  NAND/FPGA connection, OSPI memory controller, 3xMcASP for audio,
  1x CSI-RX-4L for Camera, eCAP/eQEP, ePWM, among other peripherals.
* Dedicated Centralized System Controller for Security, Power, and
  Resource Management.
* Multiple low power modes support, ex: Deep sleep,Standby, MCU-only,
  enabling battery powered system design.

More details can be found in the Technical Reference Manual:
https://www.ti.com/lit/pdf/spruiv7

Log: https://controlc.com/66b0a416

Nishanth Menon (2):
  dt-bindings: arm: ti: Add bindings for AM625 SoC
  arm64: dts: ti: Add support for AM62-SK

Suman Anna (1):
  dt-bindings: pinctrl: k3: Introduce pinmux definitions for AM62

Vignesh Raghavendra (2):
  soc: ti: k3-socinfo: Add AM62x JTAG ID
  arm64: dts: ti: Introduce base support for AM62x SoC

 .../devicetree/bindings/arm/ti/k3.yaml        |   6 +
 arch/arm64/boot/dts/ti/Makefile               |   2 +
 arch/arm64/boot/dts/ti/k3-am62-main.dtsi      | 263 ++++++++++++++++++
 arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi       |  36 +++
 arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi    |  41 +++
 arch/arm64/boot/dts/ti/k3-am62.dtsi           | 104 +++++++
 arch/arm64/boot/dts/ti/k3-am625-sk.dts        | 206 ++++++++++++++
 arch/arm64/boot/dts/ti/k3-am625.dtsi          | 103 +++++++
 drivers/soc/ti/k3-socinfo.c                   |   1 +
 include/dt-bindings/pinctrl/k3.h              |   3 +
 10 files changed, 765 insertions(+)
 create mode 100644 arch/arm64/boot/dts/ti/k3-am62-main.dtsi
 create mode 100644 arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi
 create mode 100644 arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi
 create mode 100644 arch/arm64/boot/dts/ti/k3-am62.dtsi
 create mode 100644 arch/arm64/boot/dts/ti/k3-am625-sk.dts
 create mode 100644 arch/arm64/boot/dts/ti/k3-am625.dtsi

-- 
2.35.1


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/5] soc: ti: k3-socinfo: Add AM62x JTAG ID
  2022-02-08 13:18 [PATCH 0/5] arm64: Initial support for Texas Instruments AM62 Platform Vignesh Raghavendra
@ 2022-02-08 13:18 ` Vignesh Raghavendra
  2022-02-08 13:18 ` [PATCH 2/5] dt-bindings: arm: ti: Add bindings for AM625 SoC Vignesh Raghavendra
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 22+ messages in thread
From: Vignesh Raghavendra @ 2022-02-08 13:18 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo, Rob Herring,
	Krzysztof Kozlowski, Santosh Shilimkar
  Cc: linux-arm-kernel, devicetree, linux-kernel

Add JTAG ID entry to help identify AM62x SoC in kernel.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
---
 drivers/soc/ti/k3-socinfo.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/soc/ti/k3-socinfo.c b/drivers/soc/ti/k3-socinfo.c
index b6b2150aca4e..91f441ee6175 100644
--- a/drivers/soc/ti/k3-socinfo.c
+++ b/drivers/soc/ti/k3-socinfo.c
@@ -42,6 +42,7 @@ static const struct k3_soc_id {
 	{ 0xBB6D, "J7200" },
 	{ 0xBB38, "AM64X" },
 	{ 0xBB75, "J721S2"},
+	{ 0xBB7E, "AM62X" },
 };
 
 static int
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 2/5] dt-bindings: arm: ti: Add bindings for AM625 SoC
  2022-02-08 13:18 [PATCH 0/5] arm64: Initial support for Texas Instruments AM62 Platform Vignesh Raghavendra
  2022-02-08 13:18 ` [PATCH 1/5] soc: ti: k3-socinfo: Add AM62x JTAG ID Vignesh Raghavendra
@ 2022-02-08 13:18 ` Vignesh Raghavendra
  2022-02-08 17:01   ` Krzysztof Kozlowski
  2022-02-11 16:39   ` Rob Herring
  2022-02-08 13:18 ` [PATCH 3/5] dt-bindings: pinctrl: k3: Introduce pinmux definitions for AM62 Vignesh Raghavendra
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 22+ messages in thread
From: Vignesh Raghavendra @ 2022-02-08 13:18 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo, Rob Herring,
	Krzysztof Kozlowski, Santosh Shilimkar
  Cc: linux-arm-kernel, devicetree, linux-kernel

From: Nishanth Menon <nm@ti.com>

The AM62 SoC family is the follow on AM335x built on K3 Multicore SoC
architecture platform, providing ultra-low-power modes, dual display,
multi-sensor edge compute, security and other BOM-saving integration.
The AM62 SoC targets broad market to enable applications such as
Industrial HMI, PLC/CNC/Robot control, Medical Equipment, Building
Automation, Appliances and more.

Some highlights of this SoC are:

* Quad-Cortex-A53s (running up to 1.4GHz) in a single cluster.
  Pin-to-pin compatible options for single and quad core are available.
* Cortex-M4F for general-purpose or safety usage.
* Dual display support, providing 24-bit RBG parallel interface and
  OLDI/LVDS-4 Lane x2, up to 200MHz pixel clock support for 2K display
  resolution.
* Selectable GPUsupport, up to 8GFLOPS, providing better user experience
  in 3D graphic display case and Android.
* PRU(Programmable Realtime Unit) support for customized programmable
  interfaces/IOs.
* Integrated Giga-bit Ethernet switch supporting up to a total of two
  external ports (TSN capable).
* 9xUARTs, 5xSPI, 6xI2C, 2xUSB2, 3xCAN-FD, 3x eMMC and SD, GPMC for
  NAND/FPGA connection, OSPI memory controller, 3xMcASP for audio,
  1x CSI-RX-4L for Camera, eCAP/eQEP, ePWM, among other peripherals.
* Dedicated Centralized System Controller for Security, Power, and
  Resource Management.
* Multiple low power modes support, ex: Deep sleep,Standby, MCU-only,
  enabling battery powered system design.

AM625 is the first device of the family. Add DT bindings for the same.

More details can be found in the Technical Reference Manual:
https://www.ti.com/lit/pdf/spruiv7

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
---
 Documentation/devicetree/bindings/arm/ti/k3.yaml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/ti/k3.yaml b/Documentation/devicetree/bindings/arm/ti/k3.yaml
index b03c10fa2e7a..64f3db3ea9dd 100644
--- a/Documentation/devicetree/bindings/arm/ti/k3.yaml
+++ b/Documentation/devicetree/bindings/arm/ti/k3.yaml
@@ -53,6 +53,12 @@ properties:
               - ti,am642-sk
           - const: ti,am642
 
+      - description: K3 AM625 SoC
+        items:
+          - enum:
+              - ti,am625-sk
+          - const: ti,am625
+
       - description: K3 J721s2 SoC
         items:
           - enum:
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 3/5] dt-bindings: pinctrl: k3: Introduce pinmux definitions for AM62
  2022-02-08 13:18 [PATCH 0/5] arm64: Initial support for Texas Instruments AM62 Platform Vignesh Raghavendra
  2022-02-08 13:18 ` [PATCH 1/5] soc: ti: k3-socinfo: Add AM62x JTAG ID Vignesh Raghavendra
  2022-02-08 13:18 ` [PATCH 2/5] dt-bindings: arm: ti: Add bindings for AM625 SoC Vignesh Raghavendra
@ 2022-02-08 13:18 ` Vignesh Raghavendra
  2022-02-11 16:41   ` Rob Herring
  2022-02-08 13:18 ` [PATCH 4/5] arm64: dts: ti: Introduce base support for AM62x SoC Vignesh Raghavendra
  2022-02-08 13:18 ` [PATCH 5/5] arm64: dts: ti: Add support for AM62-SK Vignesh Raghavendra
  4 siblings, 1 reply; 22+ messages in thread
From: Vignesh Raghavendra @ 2022-02-08 13:18 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo, Rob Herring,
	Krzysztof Kozlowski, Santosh Shilimkar
  Cc: linux-arm-kernel, devicetree, linux-kernel

From: Suman Anna <s-anna@ti.com>

Add pinctrl macros for AM62x SoCs. These macro definitions are similar
to that of previous platforms, but adding new definitions to avoid any
naming confusions in the SoC dts files.

checkpatch insists the following error exists:
ERROR: Macros with complex values should be enclosed in parentheses

However, we do not need parentheses enclosing the values for this
macro as we do intend it to generate two separate values as has been
done for other similar platforms.

Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
---
 include/dt-bindings/pinctrl/k3.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/dt-bindings/pinctrl/k3.h b/include/dt-bindings/pinctrl/k3.h
index 63e038e36ca3..a5204ab91d3e 100644
--- a/include/dt-bindings/pinctrl/k3.h
+++ b/include/dt-bindings/pinctrl/k3.h
@@ -41,4 +41,7 @@
 #define J721S2_IOPAD(pa, val, muxmode)		(((pa) & 0x1fff)) ((val) | (muxmode))
 #define J721S2_WKUP_IOPAD(pa, val, muxmode)	(((pa) & 0x1fff)) ((val) | (muxmode))
 
+#define AM62X_IOPAD(pa, val, muxmode)		(((pa) & 0x1fff)) ((val) | (muxmode))
+#define AM62X_MCU_IOPAD(pa, val, muxmode)	(((pa) & 0x1fff)) ((val) | (muxmode))
+
 #endif
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 4/5] arm64: dts: ti: Introduce base support for AM62x SoC
  2022-02-08 13:18 [PATCH 0/5] arm64: Initial support for Texas Instruments AM62 Platform Vignesh Raghavendra
                   ` (2 preceding siblings ...)
  2022-02-08 13:18 ` [PATCH 3/5] dt-bindings: pinctrl: k3: Introduce pinmux definitions for AM62 Vignesh Raghavendra
@ 2022-02-08 13:18 ` Vignesh Raghavendra
  2022-02-08 17:05   ` Krzysztof Kozlowski
  2022-02-09 19:10   ` Marc Zyngier
  2022-02-08 13:18 ` [PATCH 5/5] arm64: dts: ti: Add support for AM62-SK Vignesh Raghavendra
  4 siblings, 2 replies; 22+ messages in thread
From: Vignesh Raghavendra @ 2022-02-08 13:18 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo, Rob Herring,
	Krzysztof Kozlowski, Santosh Shilimkar
  Cc: linux-arm-kernel, devicetree, linux-kernel

The AM62 SoC family is the follow on AM335x built on K3 Multicore SoC
architecture platform, providing ultra-low-power modes, dual display,
multi-sensor edge compute, security and other BOM-saving integration.
The AM62 SoC targets broad market to enable applications such as
Industrial HMI, PLC/CNC/Robot control, Medical Equipment, Building
Automation, Appliances and more.

Some highlights of this SoC are:

* Quad-Cortex-A53s (running up to 1.4GHz) in a single cluster.
  Pin-to-pin compatible options for single and quad core are available.
* Cortex-M4F for general-purpose or safety usage.
* Dual display support, providing 24-bit RBG parallel interface and
  OLDI/LVDS-4 Lane x2, up to 200MHz pixel clock support for 2K display
  resolution.
* Selectable GPUsupport, up to 8GFLOPS, providing better user experience
  in 3D graphic display case and Android.
* PRU(Programmable Realtime Unit) support for customized programmable
  interfaces/IOs.
* Integrated Giga-bit Ethernet switch supporting up to a total of two
  external ports (TSN capable).
* 9xUARTs, 5xSPI, 6xI2C, 2xUSB2, 3xCAN-FD, 3x eMMC and SD, GPMC for
  NAND/FPGA connection, OSPI memory controller, 3xMcASP for audio,
  1x CSI-RX-4L for Camera, eCAP/eQEP, ePWM, among other peripherals.
* Dedicated Centralized System Controller for Security, Power, and
  Resource Management.
* Multiple low power modes support, ex: Deep sleep,Standby, MCU-only,
  enabling battery powered system design.

This add bare minimum DT describing ARM compute clusters, Main, MCU and
Wakeup domain and interconnects, UARTs and I2Cs to enable booting using
ramdisk.

More details can be found in the Technical Reference Manual:
https://www.ti.com/lit/pdf/spruiv7

Co-developed-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
Co-developed-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
---
 arch/arm64/boot/dts/ti/k3-am62-main.dtsi   | 263 +++++++++++++++++++++
 arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi    |  36 +++
 arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi |  41 ++++
 arch/arm64/boot/dts/ti/k3-am62.dtsi        | 104 ++++++++
 arch/arm64/boot/dts/ti/k3-am625.dtsi       | 103 ++++++++
 5 files changed, 547 insertions(+)
 create mode 100644 arch/arm64/boot/dts/ti/k3-am62-main.dtsi
 create mode 100644 arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi
 create mode 100644 arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi
 create mode 100644 arch/arm64/boot/dts/ti/k3-am62.dtsi
 create mode 100644 arch/arm64/boot/dts/ti/k3-am625.dtsi

diff --git a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
new file mode 100644
index 000000000000..81d6d99ca180
--- /dev/null
+++ b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
@@ -0,0 +1,263 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for AM625 SoC Family Main Domain peripherals
+ *
+ * Copyright (C) 2020-2022 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+&cbass_main {
+	gic500: interrupt-controller@1800000 {
+		compatible = "arm,gic-v3";
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+		#interrupt-cells = <3>;
+		interrupt-controller;
+		reg = <0x00 0x01800000 0x00 0x10000>,	/* GICD */
+		      <0x00 0x01880000 0x00 0xC0000>;	/* GICR */
+		/*
+		 * vcpumntirq:
+		 * virtual CPU interface maintenance interrupt
+		 */
+		interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
+
+		gic_its: msi-controller@1820000 {
+			compatible = "arm,gic-v3-its";
+			reg = <0x00 0x01820000 0x00 0x10000>;
+			socionext,synquacer-pre-its = <0x1000000 0x400000>;
+			msi-controller;
+			#msi-cells = <1>;
+		};
+	};
+
+	main_conf: syscon@100000 {
+		compatible = "syscon", "simple-mfd";
+		reg = <0x00 0x00100000 0x00 0x20000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0x0 0x00 0x00100000 0x20000>;
+	};
+
+	dmss: bus@48000000 {
+		compatible = "simple-mfd";
+		#address-cells = <2>;
+		#size-cells = <2>;
+		dma-ranges;
+		ranges = <0x00 0x48000000 0x00 0x48000000 0x00 0x06400000>;
+
+		ti,sci-dev-id = <25>;
+
+		secure_proxy_main: mailbox@4d000000 {
+			compatible = "ti,am654-secure-proxy";
+			#mbox-cells = <1>;
+			reg-names = "target_data", "rt", "scfg";
+			reg = <0x00 0x4d000000 0x00 0x80000>,
+			      <0x00 0x4a600000 0x00 0x80000>,
+			      <0x00 0x4a400000 0x00 0x80000>;
+			interrupt-names = "rx_012";
+			interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
+		};
+	};
+
+	dmsc: system-controller@44043000 {
+		compatible = "ti,k2g-sci";
+		ti,host-id = <12>;
+		mbox-names = "rx", "tx";
+		mboxes= <&secure_proxy_main 12>,
+			<&secure_proxy_main 13>;
+		reg-names = "debug_messages";
+		reg = <0x00 0x44043000 0x00 0xfe0>;
+
+		k3_pds: power-controller {
+			compatible = "ti,sci-pm-domain";
+			#power-domain-cells = <2>;
+		};
+
+		k3_clks: clock-controller {
+			compatible = "ti,k2g-sci-clk";
+			#clock-cells = <2>;
+		};
+
+		k3_reset: reset-controller {
+			compatible = "ti,sci-reset";
+			#reset-cells = <2>;
+		};
+	};
+
+	main_pmx0: pinctrl@f4000 {
+		compatible = "pinctrl-single";
+		reg = <0x00 0xf4000 0x00 0x2ac>;
+		#pinctrl-cells = <1>;
+		pinctrl-single,register-width = <32>;
+		pinctrl-single,function-mask = <0xffffffff>;
+	};
+
+	main_uart0: serial@2800000 {
+		compatible = "ti,am64-uart", "ti,am654-uart";
+		reg = <0x00 0x02800000 0x00 0x100>;
+		interrupts = <GIC_SPI 178 IRQ_TYPE_LEVEL_HIGH>;
+		power-domains = <&k3_pds 146 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 146 0>;
+		clock-names = "fclk";
+	};
+
+	main_uart1: serial@2810000 {
+		compatible = "ti,am64-uart", "ti,am654-uart";
+		reg = <0x00 0x02810000 0x00 0x100>;
+		interrupts = <GIC_SPI 179 IRQ_TYPE_LEVEL_HIGH>;
+		power-domains = <&k3_pds 152 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 152 0>;
+		clock-names = "fclk";
+	};
+
+	main_uart2: serial@2820000 {
+		compatible = "ti,am64-uart", "ti,am654-uart";
+		reg = <0x00 0x02820000 0x00 0x100>;
+		interrupts = <GIC_SPI 180 IRQ_TYPE_LEVEL_HIGH>;
+		power-domains = <&k3_pds 153 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 153 0>;
+		clock-names = "fclk";
+	};
+
+	main_uart3: serial@2830000 {
+		compatible = "ti,am64-uart", "ti,am654-uart";
+		reg = <0x00 0x02830000 0x00 0x100>;
+		interrupts = <GIC_SPI 181 IRQ_TYPE_LEVEL_HIGH>;
+		power-domains = <&k3_pds 154 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 154 0>;
+		clock-names = "fclk";
+	};
+
+	main_uart4: serial@2840000 {
+		compatible = "ti,am64-uart", "ti,am654-uart";
+		reg = <0x00 0x02840000 0x00 0x100>;
+		interrupts = <GIC_SPI 182 IRQ_TYPE_LEVEL_HIGH>;
+		power-domains = <&k3_pds 155 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 155 0>;
+		clock-names = "fclk";
+	};
+
+	main_uart5: serial@2850000 {
+		compatible = "ti,am64-uart", "ti,am654-uart";
+		reg = <0x00 0x02850000 0x00 0x100>;
+		interrupts = <GIC_SPI 183 IRQ_TYPE_LEVEL_HIGH>;
+		power-domains = <&k3_pds 156 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 156 0>;
+		clock-names = "fclk";
+	};
+
+	main_uart6: serial@2860000 {
+		compatible = "ti,am64-uart", "ti,am654-uart";
+		reg = <0x00 0x02860000 0x00 0x100>;
+		interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
+		power-domains = <&k3_pds 158 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 158 0>;
+		clock-names = "fclk";
+	};
+
+	main_i2c0: i2c@20000000 {
+		compatible = "ti,am64-i2c", "ti,omap4-i2c";
+		reg = <0x00 0x20000000 0x00 0x100>;
+		interrupts = <GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		power-domains = <&k3_pds 102 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 102 2>;
+		clock-names = "fck";
+	};
+
+	main_i2c1: i2c@20010000 {
+		compatible = "ti,am64-i2c", "ti,omap4-i2c";
+		reg = <0x00 0x20010000 0x00 0x100>;
+		interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		power-domains = <&k3_pds 103 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 103 2>;
+		clock-names = "fck";
+	};
+
+	main_i2c2: i2c@20020000 {
+		compatible = "ti,am64-i2c", "ti,omap4-i2c";
+		reg = <0x00 0x20020000 0x00 0x100>;
+		interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		power-domains = <&k3_pds 104 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 104 2>;
+		clock-names = "fck";
+	};
+
+	main_i2c3: i2c@20030000 {
+		compatible = "ti,am64-i2c", "ti,omap4-i2c";
+		reg = <0x00 0x20030000 0x00 0x100>;
+		interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		power-domains = <&k3_pds 105 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 105 2>;
+		clock-names = "fck";
+	};
+
+	main_gpio_intr: interrupt-controller@a00000 {
+		compatible = "ti,sci-intr";
+		reg = <0x00 0x00a00000 0x00 0x800>;
+		ti,intr-trigger-type = <1>;
+		interrupt-controller;
+		interrupt-parent = <&gic500>;
+		#interrupt-cells = <1>;
+		ti,sci = <&dmsc>;
+		ti,sci-dev-id = <3>;
+		ti,interrupt-ranges = <0 32 16>;
+	};
+
+	main_gpio0: gpio@600000 {
+		compatible = "ti,am64-gpio", "ti,keystone-gpio";
+		reg = <0x0 0x00600000 0x0 0x100>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		interrupt-parent = <&main_gpio_intr>;
+		interrupts = <190>, <191>, <192>,
+			     <193>, <194>, <195>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+		ti,ngpio = <87>;
+		ti,davinci-gpio-unbanked = <0>;
+		power-domains = <&k3_pds 77 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 77 0>;
+		clock-names = "gpio";
+	};
+
+	main_gpio1: gpio@601000 {
+		compatible = "ti,am64-gpio", "ti,keystone-gpio";
+		reg = <0x0 0x00601000 0x0 0x100>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		interrupt-parent = <&main_gpio_intr>;
+		interrupts = <180>, <181>, <182>,
+			     <183>, <184>, <185>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+		ti,ngpio = <88>;
+		ti,davinci-gpio-unbanked = <0>;
+		power-domains = <&k3_pds 78 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 78 0>;
+		clock-names = "gpio";
+	};
+
+	hwspinlock: spinlock@2a000000 {
+		compatible = "ti,am64-hwspinlock";
+		reg = <0x00 0x2a000000 0x00 0x1000>;
+		#hwlock-cells = <1>;
+	};
+
+	mailbox0_cluster0: mailbox@29000000 {
+		compatible = "ti,am64-mailbox";
+		reg = <0x00 0x29000000 0x00 0x200>;
+		interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
+		#mbox-cells = <1>;
+		ti,mbox-num-users = <4>;
+		ti,mbox-num-fifos = <16>;
+	};
+};
diff --git a/arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi b/arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi
new file mode 100644
index 000000000000..9d210d55fc71
--- /dev/null
+++ b/arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for AM625 SoC Family MCU Domain peripherals
+ *
+ * Copyright (C) 2020-2022 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+&cbass_mcu {
+	mcu_pmx0: pinctrl@4084000 {
+		compatible = "pinctrl-single";
+		reg = <0x00 0x04084000 0x00 0x88>;
+		#pinctrl-cells = <1>;
+		pinctrl-single,register-width = <32>;
+		pinctrl-single,function-mask = <0xffffffff>;
+	};
+
+	mcu_uart0: serial@4a00000 {
+		compatible = "ti,am64-uart", "ti,am654-uart";
+		reg = <0x00 0x04a00000 0x00 0x100>;
+		interrupts = <GIC_SPI 185 IRQ_TYPE_LEVEL_HIGH>;
+		power-domains = <&k3_pds 149 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 149 0>;
+		clock-names = "fclk";
+	};
+
+	mcu_i2c0: i2c@4900000 {
+		compatible = "ti,am64-i2c", "ti,omap4-i2c";
+		reg = <0x00 0x04900000 0x00 0x100>;
+		interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		power-domains = <&k3_pds 106 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 106 2>;
+		clock-names = "fck";
+	};
+};
diff --git a/arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi b/arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi
new file mode 100644
index 000000000000..4090134676cf
--- /dev/null
+++ b/arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for AM625 SoC Family Wakeup Domain peripherals
+ *
+ * Copyright (C) 2020-2022 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+&cbass_wakeup {
+	wkup_conf: syscon@43000000 {
+		compatible = "syscon", "simple-mfd";
+		reg = <0x00 0x43000000 0x00 0x20000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0x0 0x00 0x43000000 0x20000>;
+
+		chipid: chipid@14 {
+			compatible = "ti,am654-chipid";
+			reg = <0x14 0x4>;
+		};
+	};
+
+	wkup_uart0: serial@2b300000 {
+		compatible = "ti,am64-uart", "ti,am654-uart";
+		reg = <0x00 0x2b300000 0x00 0x100>;
+		interrupts = <GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>;
+		power-domains = <&k3_pds 114 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 114 0>;
+		clock-names = "fclk";
+	};
+
+	wkup_i2c0: i2c@2b200000 {
+		compatible = "ti,am64-i2c", "ti,omap4-i2c";
+		reg = <0x00 0x02b200000 0x00 0x100>;
+		interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		power-domains = <&k3_pds 107 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 107 4>;
+		clock-names = "fck";
+	};
+};
diff --git a/arch/arm64/boot/dts/ti/k3-am62.dtsi b/arch/arm64/boot/dts/ti/k3-am62.dtsi
new file mode 100644
index 000000000000..f1a46be27c37
--- /dev/null
+++ b/arch/arm64/boot/dts/ti/k3-am62.dtsi
@@ -0,0 +1,104 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for AM62 SoC Family
+ *
+ * Copyright (C) 2020-2022 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/pinctrl/k3.h>
+#include <dt-bindings/soc/ti,sci_pm_domain.h>
+
+/ {
+	model = "Texas Instruments K3 AM625 SoC";
+	compatible = "ti,am625";
+	interrupt-parent = <&gic500>;
+	#address-cells = <2>;
+	#size-cells = <2>;
+
+	chosen { };
+
+	firmware {
+		optee {
+			compatible = "linaro,optee-tz";
+			method = "smc";
+		};
+
+		psci: psci {
+			compatible = "arm,psci-1.0";
+			method = "smc";
+		};
+	};
+
+	a53_timer0: timer-cl0-cpu0 {
+		compatible = "arm,armv8-timer";
+		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>, /* cntpsirq */
+			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>, /* cntpnsirq */
+			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>, /* cntvirq */
+			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>; /* cnthpirq */
+	};
+
+	pmu: pmu {
+		compatible = "arm,cortex-a53-pmu";
+		interrupts = <GIC_PPI 7 IRQ_TYPE_LEVEL_HIGH>;
+	};
+
+	cbass_main: bus@f0000 {
+		compatible = "simple-bus";
+		#address-cells = <2>;
+		#size-cells = <2>;
+
+		ranges = <0x00 0x000f0000 0x00 0x000f0000 0x00 0x00030000>, /* Main MMRs */
+			 <0x00 0x30040000 0x00 0x30040000 0x00 0x00080000>, /* PRUSS-M */
+			 <0x00 0x00600000 0x00 0x00600000 0x00 0x00001100>, /* GPIO */
+			 <0x00 0x00703000 0x00 0x00703000 0x00 0x00000200>, /* USB0 debug trace */
+			 <0x00 0x0070C000 0x00 0x0070C000 0x00 0x00000200>, /* USB1 debug trace */
+			 <0x00 0x00a40000 0x00 0x00a40000 0x00 0x00000800>, /* Timesync router */
+			 <0x00 0x0fd00000 0x00 0x0fd00000 0x00 0x00020000>, /* GPU */
+			 <0x00 0x01000000 0x00 0x01000000 0x00 0x01b28400>, /* First peripheral window */
+			 <0x00 0x60000000 0x00 0x60000000 0x00 0x08000000>, /* FSS0 DAT1 */
+			 <0x00 0x70000000 0x00 0x70000000 0x00 0x00010000>, /* OCSRAM */
+			 <0x00 0x08000000 0x00 0x08000000 0x00 0x00200000>, /* Main CPSW */
+			 <0x00 0x0e000000 0x00 0x0e000000 0x00 0x01d20000>, /* Second peripheral window */
+			 <0x00 0x20000000 0x00 0x20000000 0x00 0x0a008000>, /* Third peripheral window */
+			 <0x00 0x30200000 0x00 0x30200000 0x00 0x00010000>, /* DSS */
+			 <0x00 0x43600000 0x00 0x43600000 0x00 0x00010000>, /* sa3 sproxy data */
+			 <0x00 0x44043000 0x00 0x44043000 0x00 0x00000fe0>, /* TI SCI DEBUG */
+			 <0x00 0x44860000 0x00 0x44860000 0x00 0x00040000>, /* sa3 sproxy config */
+			 <0x00 0x48000000 0x00 0x48000000 0x00 0x06400000>, /* DMSS */
+			 <0x00 0x60000000 0x00 0x60000000 0x00 0x08000000>, /* FSS0 DAT1 */
+			 <0x05 0x00000000 0x05 0x00000000 0x01 0x00000000>, /* FSS0 DAT3 */
+			 <0x00 0x31000000 0x00 0x31000000 0x00 0x00050000>, /* USB0 DWC3 Core window */
+			 <0x00 0x31100000 0x00 0x31100000 0x00 0x00050000>, /* USB1 DWC3 Core window */
+			 <0x00 0x30101000 0x00 0x30101000 0x00 0x00010100>, /* CSI window */
+
+			 /* MCU Domain Range */
+			 <0x00 0x04000000 0x00 0x04000000 0x00 0x01ff1400>,
+
+			 /* Wakeup Domain Range */
+			 <0x00 0x2b000000 0x00 0x2b000000 0x00 0x00300400>,
+			 <0x00 0x43000000 0x00 0x43000000 0x00 0x00020000>;
+
+		cbass_mcu: bus@4000000 {
+			compatible = "simple-bus";
+			#address-cells = <2>;
+			#size-cells = <2>;
+			ranges = <0x00 0x04000000 0x00 0x04000000 0x00 0x01ff1400>; /* Peripheral window */
+		};
+
+		cbass_wakeup: bus@2b000000 {
+			compatible = "simple-bus";
+			#address-cells = <2>;
+			#size-cells = <2>;
+			ranges = <0x00 0x2b000000 0x00 0x2b000000 0x00 0x00300400>, /* Peripheral Window */
+				 <0x00 0x43000000 0x00 0x43000000 0x00 0x00020000>;
+		};
+	};
+};
+
+/* Now include the peripherals for each bus segments */
+#include "k3-am62-main.dtsi"
+#include "k3-am62-mcu.dtsi"
+#include "k3-am62-wakeup.dtsi"
diff --git a/arch/arm64/boot/dts/ti/k3-am625.dtsi b/arch/arm64/boot/dts/ti/k3-am625.dtsi
new file mode 100644
index 000000000000..887f31c23fef
--- /dev/null
+++ b/arch/arm64/boot/dts/ti/k3-am625.dtsi
@@ -0,0 +1,103 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for AM625 SoC family in Quad core configuration
+ *
+ * TRM: https://www.ti.com/lit/pdf/spruiv7
+ *
+ * Copyright (C) 2020-2022 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+/dts-v1/;
+
+#include "k3-am62.dtsi"
+
+/ {
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu-map {
+			cluster0: cluster0 {
+				core0 {
+					cpu = <&cpu0>;
+				};
+
+				core1 {
+					cpu = <&cpu1>;
+				};
+
+				core2 {
+					cpu = <&cpu2>;
+				};
+
+				core3 {
+					cpu = <&cpu3>;
+				};
+			};
+		};
+
+		cpu0: cpu@0 {
+			compatible = "arm,cortex-a53";
+			reg = <0x000>;
+			device_type = "cpu";
+			enable-method = "psci";
+			i-cache-size = <0x8000>;
+			i-cache-line-size = <64>;
+			i-cache-sets = <256>;
+			d-cache-size = <0x8000>;
+			d-cache-line-size = <64>;
+			d-cache-sets = <128>;
+			next-level-cache = <&L2_0>;
+		};
+
+		cpu1: cpu@1 {
+			compatible = "arm,cortex-a53";
+			reg = <0x001>;
+			device_type = "cpu";
+			enable-method = "psci";
+			i-cache-size = <0x8000>;
+			i-cache-line-size = <64>;
+			i-cache-sets = <256>;
+			d-cache-size = <0x8000>;
+			d-cache-line-size = <64>;
+			d-cache-sets = <128>;
+			next-level-cache = <&L2_0>;
+		};
+
+		cpu2: cpu@2 {
+			compatible = "arm,cortex-a53";
+			reg = <0x002>;
+			device_type = "cpu";
+			enable-method = "psci";
+			i-cache-size = <0x8000>;
+			i-cache-line-size = <64>;
+			i-cache-sets = <256>;
+			d-cache-size = <0x8000>;
+			d-cache-line-size = <64>;
+			d-cache-sets = <128>;
+			next-level-cache = <&L2_0>;
+		};
+
+		cpu3: cpu@3 {
+			compatible = "arm,cortex-a53";
+			reg = <0x003>;
+			device_type = "cpu";
+			enable-method = "psci";
+			i-cache-size = <0x8000>;
+			i-cache-line-size = <64>;
+			i-cache-sets = <256>;
+			d-cache-size = <0x8000>;
+			d-cache-line-size = <64>;
+			d-cache-sets = <128>;
+			next-level-cache = <&L2_0>;
+		};
+	};
+
+	L2_0: l2-cache0 {
+		compatible = "cache";
+		cache-level = <2>;
+		cache-size = <0x40000>;
+		cache-line-size = <64>;
+		cache-sets = <512>;
+	};
+};
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 5/5] arm64: dts: ti: Add support for AM62-SK
  2022-02-08 13:18 [PATCH 0/5] arm64: Initial support for Texas Instruments AM62 Platform Vignesh Raghavendra
                   ` (3 preceding siblings ...)
  2022-02-08 13:18 ` [PATCH 4/5] arm64: dts: ti: Introduce base support for AM62x SoC Vignesh Raghavendra
@ 2022-02-08 13:18 ` Vignesh Raghavendra
  2022-02-08 17:08   ` Krzysztof Kozlowski
  4 siblings, 1 reply; 22+ messages in thread
From: Vignesh Raghavendra @ 2022-02-08 13:18 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo, Rob Herring,
	Krzysztof Kozlowski, Santosh Shilimkar
  Cc: linux-arm-kernel, devicetree, linux-kernel

From: Nishanth Menon <nm@ti.com>

AM62 StarterKit (SK) board is a low cost, small form factor board
designed for TI’s AM625 SoC. It supports the following interfaces:
* 2 GB DDR4 RAM
* x2 Gigabit Ethernet interfaces capable of working in Switch and MAC mode
* x1 HDMI Port with audio + x1 OLDI/LVDS Display interface for Dual Display
* x1 Headphone Jack
* x1 USB2.0 Hub with two Type A host and x1 USB Type-C DRP Port
* x1 UHS-1 capable µSD card slot
* 2.4/5 GHz WLAN + Bluetooth 4.2 through WL1837
* 512 Mbit OSPI flash
* x4 UART through UART-USB bridge
* XDS110 for onboard JTAG debug using USB
* Temperature sensors, user push buttons and LEDs
* 40-pin User Expansion Connector
* 24-pin header for peripherals in MCU island (I2C, UART, SPI, IO)
* 20-pin header for Programmable Realtime Unit (PRU) IO pins
* 15-pin CSI header

Add basic support for AM62-SK.

Schematics: https://www.ti.com/lit/zip/sprr448

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
---
 arch/arm64/boot/dts/ti/Makefile        |   2 +
 arch/arm64/boot/dts/ti/k3-am625-sk.dts | 206 +++++++++++++++++++++++++
 2 files changed, 208 insertions(+)
 create mode 100644 arch/arm64/boot/dts/ti/k3-am625-sk.dts

diff --git a/arch/arm64/boot/dts/ti/Makefile b/arch/arm64/boot/dts/ti/Makefile
index 90be511bc4d0..02e5d80344d0 100644
--- a/arch/arm64/boot/dts/ti/Makefile
+++ b/arch/arm64/boot/dts/ti/Makefile
@@ -21,3 +21,5 @@ dtb-$(CONFIG_ARCH_K3) += k3-j721s2-common-proc-board.dtb
 
 dtb-$(CONFIG_ARCH_K3) += k3-am642-evm.dtb
 dtb-$(CONFIG_ARCH_K3) += k3-am642-sk.dtb
+
+dtb-$(CONFIG_ARCH_K3) += k3-am625-sk.dtb
diff --git a/arch/arm64/boot/dts/ti/k3-am625-sk.dts b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
new file mode 100644
index 000000000000..9a6ff601f44d
--- /dev/null
+++ b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
@@ -0,0 +1,206 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * AM625 SK: https://www.ti.com/lit/zip/sprr448
+ *
+ * Copyright (C) 2021-2022 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/gpio/gpio.h>
+#include "k3-am625.dtsi"
+
+/ {
+	compatible =  "ti,am625-sk", "ti,am625";
+	model = "Texas Instruments AM625 SK";
+
+	aliases {
+		serial2 = &main_uart0;
+	};
+
+	chosen {
+		stdout-path = "serial2:115200n8";
+		bootargs = "console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000";
+	};
+
+	memory@80000000 {
+		device_type = "memory";
+		/* 2G RAM */
+		reg = <0x00000000 0x80000000 0x00000000 0x80000000>;
+
+	};
+
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		secure_tfa_ddr: tfa@9e780000 {
+			reg = <0x00 0x9e780000 0x00 0x80000>;
+			alignment = <0x1000>;
+			no-map;
+		};
+
+		secure_ddr: optee@9e800000 {
+			reg = <0x00 0x9e800000 0x00 0x01800000>; /* for OP-TEE */
+			alignment = <0x1000>;
+			no-map;
+		};
+
+		wkup_r5fss0_core0_dma_memory_region: r5f-dma-memory@a0000000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0xa0000000 0x00 0x200000>;
+			no-map;
+		};
+	};
+
+	vmain_pd: fixed-regulator-vmain-pd {
+		/* TPS65988 PD CONTROLLER OUTPUT */
+		compatible = "regulator-fixed";
+		regulator-name = "vmain_pd";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
+
+	vcc_5v0: fixedregulator-vcc5v0 {
+		/* Output of LM34936 */
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_5v0";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		vin-supply = <&vmain_pd>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
+
+	vcc_3v3_sys: fixedregulator-vcc-3v3-sys {
+		/* output of LM61460-Q1 */
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_3v3_sys";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&vmain_pd>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&usr_led_pins_default>;
+
+		led-0 {
+			label = "am62-sk:green:heartbeat";
+			gpios = <&main_gpio1 49 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "heartbeat";
+			function = LED_FUNCTION_HEARTBEAT;
+			default-state = "off";
+		};
+	};
+};
+
+&main_pmx0 {
+	main_uart0_pins_default: main-uart0-pins-default {
+		pinctrl-single,pins = <
+			AM62X_IOPAD(0x1c8, PIN_INPUT, 0) /* (D14) UART0_RXD */
+			AM62X_IOPAD(0x1cc, PIN_OUTPUT, 0) /* (E14) UART0_TXD */
+		>;
+	};
+
+	main_i2c0_pins_default: main-i2c0-pins-default {
+		pinctrl-single,pins = <
+			AM62X_IOPAD(0x1e0, PIN_INPUT_PULLUP, 0) /* (B16) I2C0_SCL */
+			AM62X_IOPAD(0x1e4, PIN_INPUT_PULLUP, 0) /* (A16) I2C0_SDA */
+		>;
+	};
+
+	main_i2c1_pins_default: main-i2c1-pins-default {
+		pinctrl-single,pins = <
+			AM62X_IOPAD(0x1e8, PIN_INPUT_PULLUP, 0) /* (B17) I2C1_SCL */
+			AM62X_IOPAD(0x1ec, PIN_INPUT_PULLUP, 0) /* (A17) I2C1_SDA */
+		>;
+	};
+
+	usr_led_pins_default: usr-led-pins-default {
+		pinctrl-single,pins = <
+			AM62X_IOPAD(0x244, PIN_OUTPUT, 7) /* (C17) MMC1_SDWP.GPIO1_49 */
+		>;
+	};
+};
+
+&wkup_uart0 {
+	/* WKUP UART0 is used by DM firmware */
+	status = "reserved";
+};
+
+&mcu_uart0 {
+	status = "disabled";
+};
+
+&main_uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_uart0_pins_default>;
+};
+
+&main_uart1 {
+	/* Main UART1 is used by TIFS firmware */
+	status = "reserved";
+};
+
+&main_uart2 {
+	status = "disabled";
+};
+
+&main_uart3 {
+	status = "disabled";
+};
+
+&main_uart4 {
+	status = "disabled";
+};
+
+&main_uart5 {
+	status = "disabled";
+};
+
+&main_uart6 {
+	status = "disabled";
+};
+
+&mcu_i2c0 {
+	status = "disabled";
+};
+
+&wkup_i2c0 {
+	status = "disabled";
+};
+
+&main_i2c0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_i2c0_pins_default>;
+	clock-frequency = <400000>;
+};
+
+&main_i2c1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_i2c1_pins_default>;
+	clock-frequency = <400000>;
+};
+
+&main_i2c2 {
+	status = "disabled";
+};
+
+&main_i2c3 {
+	status = "disabled";
+};
+
+&mailbox0_cluster0 {
+	mbox_m4_0: mbox-m4-0 {
+		ti,mbox-rx = <0 0 0>;
+		ti,mbox-tx = <1 0 0>;
+	};
+};
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH 2/5] dt-bindings: arm: ti: Add bindings for AM625 SoC
  2022-02-08 13:18 ` [PATCH 2/5] dt-bindings: arm: ti: Add bindings for AM625 SoC Vignesh Raghavendra
@ 2022-02-08 17:01   ` Krzysztof Kozlowski
  2022-02-09 19:04     ` Vignesh Raghavendra
  2022-02-11 16:39   ` Rob Herring
  1 sibling, 1 reply; 22+ messages in thread
From: Krzysztof Kozlowski @ 2022-02-08 17:01 UTC (permalink / raw)
  To: Vignesh Raghavendra, Nishanth Menon, Tero Kristo, Rob Herring,
	Santosh Shilimkar
  Cc: linux-arm-kernel, devicetree, linux-kernel

On 08/02/2022 14:18, Vignesh Raghavendra wrote:
> From: Nishanth Menon <nm@ti.com>
> 
> The AM62 SoC family is the follow on AM335x built on K3 Multicore SoC
> architecture platform, providing ultra-low-power modes, dual display,
> multi-sensor edge compute, security and other BOM-saving integration.
> The AM62 SoC targets broad market to enable applications such as
> Industrial HMI, PLC/CNC/Robot control, Medical Equipment, Building
> Automation, Appliances and more.
> 
> Some highlights of this SoC are:
> 
> * Quad-Cortex-A53s (running up to 1.4GHz) in a single cluster.
>   Pin-to-pin compatible options for single and quad core are available.
> * Cortex-M4F for general-purpose or safety usage.
> * Dual display support, providing 24-bit RBG parallel interface and
>   OLDI/LVDS-4 Lane x2, up to 200MHz pixel clock support for 2K display
>   resolution.
> * Selectable GPUsupport, up to 8GFLOPS, providing better user experience
>   in 3D graphic display case and Android.
> * PRU(Programmable Realtime Unit) support for customized programmable
>   interfaces/IOs.
> * Integrated Giga-bit Ethernet switch supporting up to a total of two
>   external ports (TSN capable).
> * 9xUARTs, 5xSPI, 6xI2C, 2xUSB2, 3xCAN-FD, 3x eMMC and SD, GPMC for
>   NAND/FPGA connection, OSPI memory controller, 3xMcASP for audio,
>   1x CSI-RX-4L for Camera, eCAP/eQEP, ePWM, among other peripherals.
> * Dedicated Centralized System Controller for Security, Power, and
>   Resource Management.
> * Multiple low power modes support, ex: Deep sleep,Standby, MCU-only,
>   enabling battery powered system design.
> 
> AM625 is the first device of the family. Add DT bindings for the same.

Don't paste the same huge commit description in several commits.

> 
> More details can be found in the Technical Reference Manual:
> https://www.ti.com/lit/pdf/spruiv7
> 
> Signed-off-by: Nishanth Menon <nm@ti.com>
> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
> ---
>  Documentation/devicetree/bindings/arm/ti/k3.yaml | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/arm/ti/k3.yaml b/Documentation/devicetree/bindings/arm/ti/k3.yaml
> index b03c10fa2e7a..64f3db3ea9dd 100644
> --- a/Documentation/devicetree/bindings/arm/ti/k3.yaml
> +++ b/Documentation/devicetree/bindings/arm/ti/k3.yaml
> @@ -53,6 +53,12 @@ properties:
>                - ti,am642-sk
>            - const: ti,am642
>  
> +      - description: K3 AM625 SoC
> +        items:
> +          - enum:
> +              - ti,am625-sk
> +          - const: ti,am625

Why keeping it not alphabetically sorted? What sorting did you choose?

> +
>        - description: K3 J721s2 SoC
>          items:
>            - enum:


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 4/5] arm64: dts: ti: Introduce base support for AM62x SoC
  2022-02-08 13:18 ` [PATCH 4/5] arm64: dts: ti: Introduce base support for AM62x SoC Vignesh Raghavendra
@ 2022-02-08 17:05   ` Krzysztof Kozlowski
  2022-02-09 19:04     ` Vignesh Raghavendra
  2022-02-09 19:10   ` Marc Zyngier
  1 sibling, 1 reply; 22+ messages in thread
From: Krzysztof Kozlowski @ 2022-02-08 17:05 UTC (permalink / raw)
  To: Vignesh Raghavendra, Nishanth Menon, Tero Kristo, Rob Herring,
	Santosh Shilimkar
  Cc: linux-arm-kernel, devicetree, linux-kernel

On 08/02/2022 14:18, Vignesh Raghavendra wrote:
> The AM62 SoC family is the follow on AM335x built on K3 Multicore SoC
> architecture platform, providing ultra-low-power modes, dual display,
> multi-sensor edge compute, security and other BOM-saving integration.
> The AM62 SoC targets broad market to enable applications such as
> Industrial HMI, PLC/CNC/Robot control, Medical Equipment, Building
> Automation, Appliances and more.
> 
> Some highlights of this SoC are:
> 
> * Quad-Cortex-A53s (running up to 1.4GHz) in a single cluster.
>   Pin-to-pin compatible options for single and quad core are available.
> * Cortex-M4F for general-purpose or safety usage.
> * Dual display support, providing 24-bit RBG parallel interface and
>   OLDI/LVDS-4 Lane x2, up to 200MHz pixel clock support for 2K display
>   resolution.
> * Selectable GPUsupport, up to 8GFLOPS, providing better user experience
>   in 3D graphic display case and Android.
> * PRU(Programmable Realtime Unit) support for customized programmable
>   interfaces/IOs.
> * Integrated Giga-bit Ethernet switch supporting up to a total of two
>   external ports (TSN capable).
> * 9xUARTs, 5xSPI, 6xI2C, 2xUSB2, 3xCAN-FD, 3x eMMC and SD, GPMC for
>   NAND/FPGA connection, OSPI memory controller, 3xMcASP for audio,
>   1x CSI-RX-4L for Camera, eCAP/eQEP, ePWM, among other peripherals.
> * Dedicated Centralized System Controller for Security, Power, and
>   Resource Management.
> * Multiple low power modes support, ex: Deep sleep,Standby, MCU-only,
>   enabling battery powered system design.
> 
> This add bare minimum DT describing ARM compute clusters, Main, MCU and
> Wakeup domain and interconnects, UARTs and I2Cs to enable booting using
> ramdisk.
> 
> More details can be found in the Technical Reference Manual:
> https://www.ti.com/lit/pdf/spruiv7
> 
> Co-developed-by: Suman Anna <s-anna@ti.com>
> Signed-off-by: Suman Anna <s-anna@ti.com>
> Co-developed-by: Nishanth Menon <nm@ti.com>
> Signed-off-by: Nishanth Menon <nm@ti.com>
> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
> ---
>  arch/arm64/boot/dts/ti/k3-am62-main.dtsi   | 263 +++++++++++++++++++++
>  arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi    |  36 +++
>  arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi |  41 ++++
>  arch/arm64/boot/dts/ti/k3-am62.dtsi        | 104 ++++++++
>  arch/arm64/boot/dts/ti/k3-am625.dtsi       | 103 ++++++++
>  5 files changed, 547 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/ti/k3-am62-main.dtsi
>  create mode 100644 arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi
>  create mode 100644 arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi
>  create mode 100644 arch/arm64/boot/dts/ti/k3-am62.dtsi
>  create mode 100644 arch/arm64/boot/dts/ti/k3-am625.dtsi
> 

(...)

> diff --git a/arch/arm64/boot/dts/ti/k3-am62.dtsi b/arch/arm64/boot/dts/ti/k3-am62.dtsi
> new file mode 100644
> index 000000000000..f1a46be27c37
> --- /dev/null
> +++ b/arch/arm64/boot/dts/ti/k3-am62.dtsi
> @@ -0,0 +1,104 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Device Tree Source for AM62 SoC Family
> + *
> + * Copyright (C) 2020-2022 Texas Instruments Incorporated - https://www.ti.com/
> + */
> +
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/interrupt-controller/irq.h>
> +#include <dt-bindings/interrupt-controller/arm-gic.h>
> +#include <dt-bindings/pinctrl/k3.h>
> +#include <dt-bindings/soc/ti,sci_pm_domain.h>
> +
> +/ {
> +	model = "Texas Instruments K3 AM625 SoC";
> +	compatible = "ti,am625";

This is am625, but the file is am62. Why having the split?

> +	interrupt-parent = <&gic500>;
> +	#address-cells = <2>;
> +	#size-cells = <2>;
> +
> +	chosen { };
> +
> +	firmware {
> +		optee {
> +			compatible = "linaro,optee-tz";
> +			method = "smc";
> +		};
> +
> +		psci: psci {
> +			compatible = "arm,psci-1.0";
> +			method = "smc";
> +		};
> +	};
> +
> +	a53_timer0: timer-cl0-cpu0 {
> +		compatible = "arm,armv8-timer";
> +		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>, /* cntpsirq */
> +			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>, /* cntpnsirq */
> +			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>, /* cntvirq */
> +			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>; /* cnthpirq */
> +	};
> +
> +	pmu: pmu {
> +		compatible = "arm,cortex-a53-pmu";
> +		interrupts = <GIC_PPI 7 IRQ_TYPE_LEVEL_HIGH>;
> +	};
> +
> +	cbass_main: bus@f0000 {
> +		compatible = "simple-bus";
> +		#address-cells = <2>;
> +		#size-cells = <2>;
> +
> +		ranges = <0x00 0x000f0000 0x00 0x000f0000 0x00 0x00030000>, /* Main MMRs */
> +			 <0x00 0x30040000 0x00 0x30040000 0x00 0x00080000>, /* PRUSS-M */
> +			 <0x00 0x00600000 0x00 0x00600000 0x00 0x00001100>, /* GPIO */
> +			 <0x00 0x00703000 0x00 0x00703000 0x00 0x00000200>, /* USB0 debug trace */
> +			 <0x00 0x0070C000 0x00 0x0070C000 0x00 0x00000200>, /* USB1 debug trace */
> +			 <0x00 0x00a40000 0x00 0x00a40000 0x00 0x00000800>, /* Timesync router */
> +			 <0x00 0x0fd00000 0x00 0x0fd00000 0x00 0x00020000>, /* GPU */
> +			 <0x00 0x01000000 0x00 0x01000000 0x00 0x01b28400>, /* First peripheral window */
> +			 <0x00 0x60000000 0x00 0x60000000 0x00 0x08000000>, /* FSS0 DAT1 */
> +			 <0x00 0x70000000 0x00 0x70000000 0x00 0x00010000>, /* OCSRAM */
> +			 <0x00 0x08000000 0x00 0x08000000 0x00 0x00200000>, /* Main CPSW */
> +			 <0x00 0x0e000000 0x00 0x0e000000 0x00 0x01d20000>, /* Second peripheral window */
> +			 <0x00 0x20000000 0x00 0x20000000 0x00 0x0a008000>, /* Third peripheral window */
> +			 <0x00 0x30200000 0x00 0x30200000 0x00 0x00010000>, /* DSS */
> +			 <0x00 0x43600000 0x00 0x43600000 0x00 0x00010000>, /* sa3 sproxy data */
> +			 <0x00 0x44043000 0x00 0x44043000 0x00 0x00000fe0>, /* TI SCI DEBUG */
> +			 <0x00 0x44860000 0x00 0x44860000 0x00 0x00040000>, /* sa3 sproxy config */
> +			 <0x00 0x48000000 0x00 0x48000000 0x00 0x06400000>, /* DMSS */
> +			 <0x00 0x60000000 0x00 0x60000000 0x00 0x08000000>, /* FSS0 DAT1 */
> +			 <0x05 0x00000000 0x05 0x00000000 0x01 0x00000000>, /* FSS0 DAT3 */
> +			 <0x00 0x31000000 0x00 0x31000000 0x00 0x00050000>, /* USB0 DWC3 Core window */
> +			 <0x00 0x31100000 0x00 0x31100000 0x00 0x00050000>, /* USB1 DWC3 Core window */
> +			 <0x00 0x30101000 0x00 0x30101000 0x00 0x00010100>, /* CSI window */
> +
> +			 /* MCU Domain Range */
> +			 <0x00 0x04000000 0x00 0x04000000 0x00 0x01ff1400>,
> +
> +			 /* Wakeup Domain Range */
> +			 <0x00 0x2b000000 0x00 0x2b000000 0x00 0x00300400>,
> +			 <0x00 0x43000000 0x00 0x43000000 0x00 0x00020000>;
> +
> +		cbass_mcu: bus@4000000 {
> +			compatible = "simple-bus";
> +			#address-cells = <2>;
> +			#size-cells = <2>;
> +			ranges = <0x00 0x04000000 0x00 0x04000000 0x00 0x01ff1400>; /* Peripheral window */
> +		};
> +
> +		cbass_wakeup: bus@2b000000 {
> +			compatible = "simple-bus";
> +			#address-cells = <2>;
> +			#size-cells = <2>;
> +			ranges = <0x00 0x2b000000 0x00 0x2b000000 0x00 0x00300400>, /* Peripheral Window */
> +				 <0x00 0x43000000 0x00 0x43000000 0x00 0x00020000>;
> +		};
> +	};
> +};
> +
> +/* Now include the peripherals for each bus segments */
> +#include "k3-am62-main.dtsi"
> +#include "k3-am62-mcu.dtsi"
> +#include "k3-am62-wakeup.dtsi"
> diff --git a/arch/arm64/boot/dts/ti/k3-am625.dtsi b/arch/arm64/boot/dts/ti/k3-am625.dtsi
> new file mode 100644
> index 000000000000..887f31c23fef
> --- /dev/null
> +++ b/arch/arm64/boot/dts/ti/k3-am625.dtsi
> @@ -0,0 +1,103 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Device Tree Source for AM625 SoC family in Quad core configuration
> + *
> + * TRM: https://www.ti.com/lit/pdf/spruiv7
> + *
> + * Copyright (C) 2020-2022 Texas Instruments Incorporated - https://www.ti.com/
> + */
> +
> +/dts-v1/;
> +
> +#include "k3-am62.dtsi"
> +
> +/ {
> +	cpus {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +

This file is not included anywhere, so does it mean that your SoC comes
without the cores and each board designer plugs the cores separately?


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 5/5] arm64: dts: ti: Add support for AM62-SK
  2022-02-08 13:18 ` [PATCH 5/5] arm64: dts: ti: Add support for AM62-SK Vignesh Raghavendra
@ 2022-02-08 17:08   ` Krzysztof Kozlowski
  2022-02-09 19:05     ` Vignesh Raghavendra
  0 siblings, 1 reply; 22+ messages in thread
From: Krzysztof Kozlowski @ 2022-02-08 17:08 UTC (permalink / raw)
  To: Vignesh Raghavendra, Nishanth Menon, Tero Kristo, Rob Herring,
	Santosh Shilimkar
  Cc: linux-arm-kernel, devicetree, linux-kernel

On 08/02/2022 14:18, Vignesh Raghavendra wrote:
> From: Nishanth Menon <nm@ti.com>
> 
> AM62 StarterKit (SK) board is a low cost, small form factor board
> designed for TI’s AM625 SoC. It supports the following interfaces:
> * 2 GB DDR4 RAM
> * x2 Gigabit Ethernet interfaces capable of working in Switch and MAC mode
> * x1 HDMI Port with audio + x1 OLDI/LVDS Display interface for Dual Display
> * x1 Headphone Jack
> * x1 USB2.0 Hub with two Type A host and x1 USB Type-C DRP Port
> * x1 UHS-1 capable µSD card slot
> * 2.4/5 GHz WLAN + Bluetooth 4.2 through WL1837
> * 512 Mbit OSPI flash
> * x4 UART through UART-USB bridge
> * XDS110 for onboard JTAG debug using USB
> * Temperature sensors, user push buttons and LEDs
> * 40-pin User Expansion Connector
> * 24-pin header for peripherals in MCU island (I2C, UART, SPI, IO)
> * 20-pin header for Programmable Realtime Unit (PRU) IO pins
> * 15-pin CSI header
> 
> Add basic support for AM62-SK.
> 
> Schematics: https://www.ti.com/lit/zip/sprr448
> 
> Signed-off-by: Nishanth Menon <nm@ti.com>
> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
> ---
>  arch/arm64/boot/dts/ti/Makefile        |   2 +
>  arch/arm64/boot/dts/ti/k3-am625-sk.dts | 206 +++++++++++++++++++++++++
>  2 files changed, 208 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/ti/k3-am625-sk.dts
> 
> diff --git a/arch/arm64/boot/dts/ti/Makefile b/arch/arm64/boot/dts/ti/Makefile
> index 90be511bc4d0..02e5d80344d0 100644
> --- a/arch/arm64/boot/dts/ti/Makefile
> +++ b/arch/arm64/boot/dts/ti/Makefile
> @@ -21,3 +21,5 @@ dtb-$(CONFIG_ARCH_K3) += k3-j721s2-common-proc-board.dtb
>  
>  dtb-$(CONFIG_ARCH_K3) += k3-am642-evm.dtb
>  dtb-$(CONFIG_ARCH_K3) += k3-am642-sk.dtb
> +
> +dtb-$(CONFIG_ARCH_K3) += k3-am625-sk.dtb
> diff --git a/arch/arm64/boot/dts/ti/k3-am625-sk.dts b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> new file mode 100644
> index 000000000000..9a6ff601f44d
> --- /dev/null
> +++ b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> @@ -0,0 +1,206 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * AM625 SK: https://www.ti.com/lit/zip/sprr448
> + *
> + * Copyright (C) 2021-2022 Texas Instruments Incorporated - https://www.ti.com/
> + */
> +
> +/dts-v1/;
> +
> +#include <dt-bindings/leds/common.h>
> +#include <dt-bindings/gpio/gpio.h>
> +#include "k3-am625.dtsi"
> +
> +/ {
> +	compatible =  "ti,am625-sk", "ti,am625";
> +	model = "Texas Instruments AM625 SK";
> +
> +	aliases {
> +		serial2 = &main_uart0;
> +	};
> +
> +	chosen {
> +		stdout-path = "serial2:115200n8";
> +		bootargs = "console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000";
> +	};
> +
> +	memory@80000000 {
> +		device_type = "memory";
> +		/* 2G RAM */
> +		reg = <0x00000000 0x80000000 0x00000000 0x80000000>;
> +
> +	};
> +
> +	reserved-memory {
> +		#address-cells = <2>;
> +		#size-cells = <2>;
> +		ranges;
> +
> +		secure_tfa_ddr: tfa@9e780000 {
> +			reg = <0x00 0x9e780000 0x00 0x80000>;
> +			alignment = <0x1000>;
> +			no-map;
> +		};
> +
> +		secure_ddr: optee@9e800000 {
> +			reg = <0x00 0x9e800000 0x00 0x01800000>; /* for OP-TEE */
> +			alignment = <0x1000>;
> +			no-map;
> +		};
> +
> +		wkup_r5fss0_core0_dma_memory_region: r5f-dma-memory@a0000000 {
> +			compatible = "shared-dma-pool";
> +			reg = <0x00 0xa0000000 0x00 0x200000>;
> +			no-map;
> +		};
> +	};
> +
> +	vmain_pd: fixed-regulator-vmain-pd {
> +		/* TPS65988 PD CONTROLLER OUTPUT */
> +		compatible = "regulator-fixed";
> +		regulator-name = "vmain_pd";
> +		regulator-min-microvolt = <5000000>;
> +		regulator-max-microvolt = <5000000>;
> +		regulator-always-on;
> +		regulator-boot-on;
> +	};
> +
> +	vcc_5v0: fixedregulator-vcc5v0 {
> +		/* Output of LM34936 */
> +		compatible = "regulator-fixed";
> +		regulator-name = "vcc_5v0";
> +		regulator-min-microvolt = <5000000>;
> +		regulator-max-microvolt = <5000000>;
> +		vin-supply = <&vmain_pd>;
> +		regulator-always-on;
> +		regulator-boot-on;
> +	};
> +
> +	vcc_3v3_sys: fixedregulator-vcc-3v3-sys {

Generic node names (as in DT spec), so regulator-[0-9]. The label and
regulator-name property describe it's user-friendly purpose.

> +		/* output of LM61460-Q1 */
> +		compatible = "regulator-fixed";
> +		regulator-name = "vcc_3v3_sys";
> +		regulator-min-microvolt = <3300000>;
> +		regulator-max-microvolt = <3300000>;
> +		vin-supply = <&vmain_pd>;
> +		regulator-always-on;
> +		regulator-boot-on;
> +	};
> +
> +	leds {
> +		compatible = "gpio-leds";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&usr_led_pins_default>;
> +
> +		led-0 {

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 4/5] arm64: dts: ti: Introduce base support for AM62x SoC
  2022-02-08 17:05   ` Krzysztof Kozlowski
@ 2022-02-09 19:04     ` Vignesh Raghavendra
  2022-02-09 21:36       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 22+ messages in thread
From: Vignesh Raghavendra @ 2022-02-09 19:04 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Nishanth Menon, Tero Kristo, Rob Herring,
	Santosh Shilimkar
  Cc: linux-arm-kernel, devicetree, linux-kernel

Hi Krzysztof,

On 08/02/22 10:35 pm, Krzysztof Kozlowski wrote:
[...]
> 
> (...)
> 
>> diff --git a/arch/arm64/boot/dts/ti/k3-am62.dtsi b/arch/arm64/boot/dts/ti/k3-am62.dtsi
>> new file mode 100644
>> index 000000000000..f1a46be27c37
>> --- /dev/null
>> +++ b/arch/arm64/boot/dts/ti/k3-am62.dtsi
>> @@ -0,0 +1,104 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +/*
>> + * Device Tree Source for AM62 SoC Family
>> + *
>> + * Copyright (C) 2020-2022 Texas Instruments Incorporated - https://www.ti.com/
>> + */
>> +
>> +#include <dt-bindings/gpio/gpio.h>
>> +#include <dt-bindings/interrupt-controller/irq.h>
>> +#include <dt-bindings/interrupt-controller/arm-gic.h>
>> +#include <dt-bindings/pinctrl/k3.h>
>> +#include <dt-bindings/soc/ti,sci_pm_domain.h>
>> +
>> +/ {
>> +	model = "Texas Instruments K3 AM625 SoC";
>> +	compatible = "ti,am625";
> 
> This is am625, but the file is am62. Why having the split?


Hierarchy is:

am62.dtsi:
-> base SoC skeleton ie arch timers and interconnects which is common
across am62xx family of SoCs
 -> includes am62-main.dtsi, am62-mcu.dtsi and am62-wakeup.dtsi
representing 3 domains and peripherals in each of these domain
-> describes all peripherals in the family (except CPU cluster)


am625.dtsi:
-> describes CPU cluster (Quad A53s). Since, am625 is a current superset
device with all peripherals, am625.dtsi includes am62.dtsi completing
SoC definition.
-> individual EVMs using this SoC will just need to include am625.dtsi
thus making things easier for Board and SOM Vendors.


In future:
am62{1-9}{1-9}.dtsi:
-> Includes am625.dtsi
-> Overrides top compatible: ti,am62{1-9}{1-9}
-> disables CPUs and peripherals not present (cutdowns of current SoC).
-> -> individual EVM dts files using this SoC will just need to include
am625.dtsi as starting point, thus making things easier for Board and
SOM Vendors.

Top level compatible is set to "ti,am625.dtsi" which is first device in
family and superset.

Hope this clears up? Will add this to commit msg

> 
>> +	interrupt-parent = <&gic500>;
>> +	#address-cells = <2>;
>> +	#size-cells = <2>;
>> +
>> +	chosen { };
>> +
>> +	firmware {
>> +		optee {
>> +			compatible = "linaro,optee-tz";
>> +			method = "smc";
>> +		};
>> +
>> +		psci: psci {
>> +			compatible = "arm,psci-1.0";
>> +			method = "smc";
>> +		};
>> +	};
>> +
>> +	a53_timer0: timer-cl0-cpu0 {
>> +		compatible = "arm,armv8-timer";
>> +		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>, /* cntpsirq */
>> +			     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>, /* cntpnsirq */
>> +			     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>, /* cntvirq */
>> +			     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>; /* cnthpirq */
>> +	};
>> +
>> +	pmu: pmu {
>> +		compatible = "arm,cortex-a53-pmu";
>> +		interrupts = <GIC_PPI 7 IRQ_TYPE_LEVEL_HIGH>;
>> +	};
>> +
>> +	cbass_main: bus@f0000 {
>> +		compatible = "simple-bus";
>> +		#address-cells = <2>;
>> +		#size-cells = <2>;
>> +
>> +		ranges = <0x00 0x000f0000 0x00 0x000f0000 0x00 0x00030000>, /* Main MMRs */
>> +			 <0x00 0x30040000 0x00 0x30040000 0x00 0x00080000>, /* PRUSS-M */
>> +			 <0x00 0x00600000 0x00 0x00600000 0x00 0x00001100>, /* GPIO */
>> +			 <0x00 0x00703000 0x00 0x00703000 0x00 0x00000200>, /* USB0 debug trace */
>> +			 <0x00 0x0070C000 0x00 0x0070C000 0x00 0x00000200>, /* USB1 debug trace */
>> +			 <0x00 0x00a40000 0x00 0x00a40000 0x00 0x00000800>, /* Timesync router */
>> +			 <0x00 0x0fd00000 0x00 0x0fd00000 0x00 0x00020000>, /* GPU */
>> +			 <0x00 0x01000000 0x00 0x01000000 0x00 0x01b28400>, /* First peripheral window */
>> +			 <0x00 0x60000000 0x00 0x60000000 0x00 0x08000000>, /* FSS0 DAT1 */
>> +			 <0x00 0x70000000 0x00 0x70000000 0x00 0x00010000>, /* OCSRAM */
>> +			 <0x00 0x08000000 0x00 0x08000000 0x00 0x00200000>, /* Main CPSW */
>> +			 <0x00 0x0e000000 0x00 0x0e000000 0x00 0x01d20000>, /* Second peripheral window */
>> +			 <0x00 0x20000000 0x00 0x20000000 0x00 0x0a008000>, /* Third peripheral window */
>> +			 <0x00 0x30200000 0x00 0x30200000 0x00 0x00010000>, /* DSS */
>> +			 <0x00 0x43600000 0x00 0x43600000 0x00 0x00010000>, /* sa3 sproxy data */
>> +			 <0x00 0x44043000 0x00 0x44043000 0x00 0x00000fe0>, /* TI SCI DEBUG */
>> +			 <0x00 0x44860000 0x00 0x44860000 0x00 0x00040000>, /* sa3 sproxy config */
>> +			 <0x00 0x48000000 0x00 0x48000000 0x00 0x06400000>, /* DMSS */
>> +			 <0x00 0x60000000 0x00 0x60000000 0x00 0x08000000>, /* FSS0 DAT1 */
>> +			 <0x05 0x00000000 0x05 0x00000000 0x01 0x00000000>, /* FSS0 DAT3 */
>> +			 <0x00 0x31000000 0x00 0x31000000 0x00 0x00050000>, /* USB0 DWC3 Core window */
>> +			 <0x00 0x31100000 0x00 0x31100000 0x00 0x00050000>, /* USB1 DWC3 Core window */
>> +			 <0x00 0x30101000 0x00 0x30101000 0x00 0x00010100>, /* CSI window */
>> +
>> +			 /* MCU Domain Range */
>> +			 <0x00 0x04000000 0x00 0x04000000 0x00 0x01ff1400>,
>> +
>> +			 /* Wakeup Domain Range */
>> +			 <0x00 0x2b000000 0x00 0x2b000000 0x00 0x00300400>,
>> +			 <0x00 0x43000000 0x00 0x43000000 0x00 0x00020000>;
>> +
>> +		cbass_mcu: bus@4000000 {
>> +			compatible = "simple-bus";
>> +			#address-cells = <2>;
>> +			#size-cells = <2>;
>> +			ranges = <0x00 0x04000000 0x00 0x04000000 0x00 0x01ff1400>; /* Peripheral window */
>> +		};
>> +
>> +		cbass_wakeup: bus@2b000000 {
>> +			compatible = "simple-bus";
>> +			#address-cells = <2>;
>> +			#size-cells = <2>;
>> +			ranges = <0x00 0x2b000000 0x00 0x2b000000 0x00 0x00300400>, /* Peripheral Window */
>> +				 <0x00 0x43000000 0x00 0x43000000 0x00 0x00020000>;
>> +		};
>> +	};
>> +};
>> +
>> +/* Now include the peripherals for each bus segments */
>> +#include "k3-am62-main.dtsi"
>> +#include "k3-am62-mcu.dtsi"
>> +#include "k3-am62-wakeup.dtsi"
>> diff --git a/arch/arm64/boot/dts/ti/k3-am625.dtsi b/arch/arm64/boot/dts/ti/k3-am625.dtsi
>> new file mode 100644
>> index 000000000000..887f31c23fef
>> --- /dev/null
>> +++ b/arch/arm64/boot/dts/ti/k3-am625.dtsi
>> @@ -0,0 +1,103 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +/*
>> + * Device Tree Source for AM625 SoC family in Quad core configuration
>> + *
>> + * TRM: https://www.ti.com/lit/pdf/spruiv7
>> + *
>> + * Copyright (C) 2020-2022 Texas Instruments Incorporated - https://www.ti.com/
>> + */
>> +
>> +/dts-v1/;
>> +
>> +#include "k3-am62.dtsi"
>> +
>> +/ {
>> +	cpus {
>> +		#address-cells = <1>;
>> +		#size-cells = <0>;
>> +
> 
> This file is not included anywhere, so does it mean that your SoC comes
> without the cores and each board designer plugs the cores separately?
> 

Please see above for explanation. File is included in am625-sk.dts (see
5/5).

> 
> Best regards,
> Krzysztof

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 2/5] dt-bindings: arm: ti: Add bindings for AM625 SoC
  2022-02-08 17:01   ` Krzysztof Kozlowski
@ 2022-02-09 19:04     ` Vignesh Raghavendra
  2022-02-09 21:29       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 22+ messages in thread
From: Vignesh Raghavendra @ 2022-02-09 19:04 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Nishanth Menon, Tero Kristo, Rob Herring,
	Santosh Shilimkar
  Cc: linux-arm-kernel, devicetree, linux-kernel



On 08/02/22 10:31 pm, Krzysztof Kozlowski wrote:
> On 08/02/2022 14:18, Vignesh Raghavendra wrote:
>> From: Nishanth Menon <nm@ti.com>
>>
>> The AM62 SoC family is the follow on AM335x built on K3 Multicore SoC
>> architecture platform, providing ultra-low-power modes, dual display,
>> multi-sensor edge compute, security and other BOM-saving integration.
>> The AM62 SoC targets broad market to enable applications such as
>> Industrial HMI, PLC/CNC/Robot control, Medical Equipment, Building
>> Automation, Appliances and more.
>>
>> Some highlights of this SoC are:
>>
>> * Quad-Cortex-A53s (running up to 1.4GHz) in a single cluster.
>>   Pin-to-pin compatible options for single and quad core are available.
>> * Cortex-M4F for general-purpose or safety usage.
>> * Dual display support, providing 24-bit RBG parallel interface and
>>   OLDI/LVDS-4 Lane x2, up to 200MHz pixel clock support for 2K display
>>   resolution.
>> * Selectable GPUsupport, up to 8GFLOPS, providing better user experience
>>   in 3D graphic display case and Android.
>> * PRU(Programmable Realtime Unit) support for customized programmable
>>   interfaces/IOs.
>> * Integrated Giga-bit Ethernet switch supporting up to a total of two
>>   external ports (TSN capable).
>> * 9xUARTs, 5xSPI, 6xI2C, 2xUSB2, 3xCAN-FD, 3x eMMC and SD, GPMC for
>>   NAND/FPGA connection, OSPI memory controller, 3xMcASP for audio,
>>   1x CSI-RX-4L for Camera, eCAP/eQEP, ePWM, among other peripherals.
>> * Dedicated Centralized System Controller for Security, Power, and
>>   Resource Management.
>> * Multiple low power modes support, ex: Deep sleep,Standby, MCU-only,
>>   enabling battery powered system design.
>>
>> AM625 is the first device of the family. Add DT bindings for the same.
> 
> Don't paste the same huge commit description in several commits.

Sorry, I think this is the first commit with full description. I will
probably trim 4/5 at bit

> 
>>
>> More details can be found in the Technical Reference Manual:
>> https://www.ti.com/lit/pdf/spruiv7
>>
>> Signed-off-by: Nishanth Menon <nm@ti.com>
>> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
>> ---
>>  Documentation/devicetree/bindings/arm/ti/k3.yaml | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/arm/ti/k3.yaml b/Documentation/devicetree/bindings/arm/ti/k3.yaml
>> index b03c10fa2e7a..64f3db3ea9dd 100644
>> --- a/Documentation/devicetree/bindings/arm/ti/k3.yaml
>> +++ b/Documentation/devicetree/bindings/arm/ti/k3.yaml
>> @@ -53,6 +53,12 @@ properties:
>>                - ti,am642-sk
>>            - const: ti,am642
>>  
>> +      - description: K3 AM625 SoC
>> +        items:
>> +          - enum:
>> +              - ti,am625-sk
>> +          - const: ti,am625
> 
> Why keeping it not alphabetically sorted? What sorting did you choose?
> 

Above list is not sorted alphabetically, I tried to keep similar SoCs
bunched together. AM625 and AM642 are of same family, hence chose to add
the new entry here.

One alternative is to add it to end of the list (chronologically)?
Or I can add a patch to sort the list alphabetically first and then
introduce new compatible. Please let me know your preference?

>> +
>>        - description: K3 J721s2 SoC
>>          items:
>>            - enum:
> 
> 
> Best regards,
> Krzysztof


Regards
Vignesh

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 5/5] arm64: dts: ti: Add support for AM62-SK
  2022-02-08 17:08   ` Krzysztof Kozlowski
@ 2022-02-09 19:05     ` Vignesh Raghavendra
  0 siblings, 0 replies; 22+ messages in thread
From: Vignesh Raghavendra @ 2022-02-09 19:05 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Nishanth Menon, Tero Kristo, Rob Herring,
	Santosh Shilimkar
  Cc: linux-arm-kernel, devicetree, linux-kernel



On 08/02/22 10:38 pm, Krzysztof Kozlowski wrote:
> On 08/02/2022 14:18, Vignesh Raghavendra wrote:
>> From: Nishanth Menon <nm@ti.com>
>>
[...]
>> +	vmain_pd: fixed-regulator-vmain-pd {
>> +		/* TPS65988 PD CONTROLLER OUTPUT */
>> +		compatible = "regulator-fixed";
>> +		regulator-name = "vmain_pd";
>> +		regulator-min-microvolt = <5000000>;
>> +		regulator-max-microvolt = <5000000>;
>> +		regulator-always-on;
>> +		regulator-boot-on;
>> +	};
>> +
>> +	vcc_5v0: fixedregulator-vcc5v0 {
>> +		/* Output of LM34936 */
>> +		compatible = "regulator-fixed";
>> +		regulator-name = "vcc_5v0";
>> +		regulator-min-microvolt = <5000000>;
>> +		regulator-max-microvolt = <5000000>;
>> +		vin-supply = <&vmain_pd>;
>> +		regulator-always-on;
>> +		regulator-boot-on;
>> +	};
>> +
>> +	vcc_3v3_sys: fixedregulator-vcc-3v3-sys {
> 
> Generic node names (as in DT spec), so regulator-[0-9]. The label and
> regulator-name property describe it's user-friendly purpose.

Ah, yes, missed it, will fix in v2

Thanks for the review!

Regards
Vignesh

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 4/5] arm64: dts: ti: Introduce base support for AM62x SoC
  2022-02-08 13:18 ` [PATCH 4/5] arm64: dts: ti: Introduce base support for AM62x SoC Vignesh Raghavendra
  2022-02-08 17:05   ` Krzysztof Kozlowski
@ 2022-02-09 19:10   ` Marc Zyngier
  2022-02-10 19:34     ` Nishanth Menon
  1 sibling, 1 reply; 22+ messages in thread
From: Marc Zyngier @ 2022-02-09 19:10 UTC (permalink / raw)
  To: Vignesh Raghavendra
  Cc: Nishanth Menon, Tero Kristo, Rob Herring, Krzysztof Kozlowski,
	Santosh Shilimkar, linux-arm-kernel, devicetree, linux-kernel

On 2022-02-08 13:18, Vignesh Raghavendra wrote:
> The AM62 SoC family is the follow on AM335x built on K3 Multicore SoC
> architecture platform, providing ultra-low-power modes, dual display,
> multi-sensor edge compute, security and other BOM-saving integration.
> The AM62 SoC targets broad market to enable applications such as
> Industrial HMI, PLC/CNC/Robot control, Medical Equipment, Building
> Automation, Appliances and more.
> 
> Some highlights of this SoC are:
> 
> * Quad-Cortex-A53s (running up to 1.4GHz) in a single cluster.
>   Pin-to-pin compatible options for single and quad core are available.
> * Cortex-M4F for general-purpose or safety usage.
> * Dual display support, providing 24-bit RBG parallel interface and
>   OLDI/LVDS-4 Lane x2, up to 200MHz pixel clock support for 2K display
>   resolution.
> * Selectable GPUsupport, up to 8GFLOPS, providing better user 
> experience
>   in 3D graphic display case and Android.
> * PRU(Programmable Realtime Unit) support for customized programmable
>   interfaces/IOs.
> * Integrated Giga-bit Ethernet switch supporting up to a total of two
>   external ports (TSN capable).
> * 9xUARTs, 5xSPI, 6xI2C, 2xUSB2, 3xCAN-FD, 3x eMMC and SD, GPMC for
>   NAND/FPGA connection, OSPI memory controller, 3xMcASP for audio,
>   1x CSI-RX-4L for Camera, eCAP/eQEP, ePWM, among other peripherals.
> * Dedicated Centralized System Controller for Security, Power, and
>   Resource Management.
> * Multiple low power modes support, ex: Deep sleep,Standby, MCU-only,
>   enabling battery powered system design.
> 
> This add bare minimum DT describing ARM compute clusters, Main, MCU and
> Wakeup domain and interconnects, UARTs and I2Cs to enable booting using
> ramdisk.
> 
> More details can be found in the Technical Reference Manual:
> https://www.ti.com/lit/pdf/spruiv7
> 
> Co-developed-by: Suman Anna <s-anna@ti.com>
> Signed-off-by: Suman Anna <s-anna@ti.com>
> Co-developed-by: Nishanth Menon <nm@ti.com>
> Signed-off-by: Nishanth Menon <nm@ti.com>
> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
> ---
>  arch/arm64/boot/dts/ti/k3-am62-main.dtsi   | 263 +++++++++++++++++++++
>  arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi    |  36 +++
>  arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi |  41 ++++
>  arch/arm64/boot/dts/ti/k3-am62.dtsi        | 104 ++++++++
>  arch/arm64/boot/dts/ti/k3-am625.dtsi       | 103 ++++++++
>  5 files changed, 547 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/ti/k3-am62-main.dtsi
>  create mode 100644 arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi
>  create mode 100644 arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi
>  create mode 100644 arch/arm64/boot/dts/ti/k3-am62.dtsi
>  create mode 100644 arch/arm64/boot/dts/ti/k3-am625.dtsi
> 
> diff --git a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
> b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
> new file mode 100644
> index 000000000000..81d6d99ca180
> --- /dev/null
> +++ b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
> @@ -0,0 +1,263 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Device Tree Source for AM625 SoC Family Main Domain peripherals
> + *
> + * Copyright (C) 2020-2022 Texas Instruments Incorporated - 
> https://www.ti.com/
> + */
> +
> +&cbass_main {
> +	gic500: interrupt-controller@1800000 {
> +		compatible = "arm,gic-v3";
> +		#address-cells = <2>;
> +		#size-cells = <2>;
> +		ranges;
> +		#interrupt-cells = <3>;
> +		interrupt-controller;
> +		reg = <0x00 0x01800000 0x00 0x10000>,	/* GICD */
> +		      <0x00 0x01880000 0x00 0xC0000>;	/* GICR */

Usual rant: you are missing the GICC, GICH and GICV regions
that are implemented by the CPU. Cortex-A53 implements them
(they are not optional), so please describe them.

> +		/*
> +		 * vcpumntirq:
> +		 * virtual CPU interface maintenance interrupt
> +		 */
> +		interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
> +
> +		gic_its: msi-controller@1820000 {
> +			compatible = "arm,gic-v3-its";
> +			reg = <0x00 0x01820000 0x00 0x10000>;
> +			socionext,synquacer-pre-its = <0x1000000 0x400000>;

The mind boggles...

         M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 2/5] dt-bindings: arm: ti: Add bindings for AM625 SoC
  2022-02-09 19:04     ` Vignesh Raghavendra
@ 2022-02-09 21:29       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2022-02-09 21:29 UTC (permalink / raw)
  To: Vignesh Raghavendra, Nishanth Menon, Tero Kristo, Rob Herring,
	Santosh Shilimkar
  Cc: linux-arm-kernel, devicetree, linux-kernel

On 09/02/2022 20:04, Vignesh Raghavendra wrote:
> 
> 
> On 08/02/22 10:31 pm, Krzysztof Kozlowski wrote:
>> On 08/02/2022 14:18, Vignesh Raghavendra wrote:
>>> From: Nishanth Menon <nm@ti.com>
>>>
>>> The AM62 SoC family is the follow on AM335x built on K3 Multicore SoC
>>> architecture platform, providing ultra-low-power modes, dual display,
>>> multi-sensor edge compute, security and other BOM-saving integration.
>>> The AM62 SoC targets broad market to enable applications such as
>>> Industrial HMI, PLC/CNC/Robot control, Medical Equipment, Building
>>> Automation, Appliances and more.
>>>
>>> Some highlights of this SoC are:
>>>
>>> * Quad-Cortex-A53s (running up to 1.4GHz) in a single cluster.
>>>   Pin-to-pin compatible options for single and quad core are available.
>>> * Cortex-M4F for general-purpose or safety usage.
>>> * Dual display support, providing 24-bit RBG parallel interface and
>>>   OLDI/LVDS-4 Lane x2, up to 200MHz pixel clock support for 2K display
>>>   resolution.
>>> * Selectable GPUsupport, up to 8GFLOPS, providing better user experience
>>>   in 3D graphic display case and Android.
>>> * PRU(Programmable Realtime Unit) support for customized programmable
>>>   interfaces/IOs.
>>> * Integrated Giga-bit Ethernet switch supporting up to a total of two
>>>   external ports (TSN capable).
>>> * 9xUARTs, 5xSPI, 6xI2C, 2xUSB2, 3xCAN-FD, 3x eMMC and SD, GPMC for
>>>   NAND/FPGA connection, OSPI memory controller, 3xMcASP for audio,
>>>   1x CSI-RX-4L for Camera, eCAP/eQEP, ePWM, among other peripherals.
>>> * Dedicated Centralized System Controller for Security, Power, and
>>>   Resource Management.
>>> * Multiple low power modes support, ex: Deep sleep,Standby, MCU-only,
>>>   enabling battery powered system design.
>>>
>>> AM625 is the first device of the family. Add DT bindings for the same.
>>
>> Don't paste the same huge commit description in several commits.
> 
> Sorry, I think this is the first commit with full description. I will
> probably trim 4/5 at bit
> 
>>
>>>
>>> More details can be found in the Technical Reference Manual:
>>> https://www.ti.com/lit/pdf/spruiv7
>>>
>>> Signed-off-by: Nishanth Menon <nm@ti.com>
>>> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
>>> ---
>>>  Documentation/devicetree/bindings/arm/ti/k3.yaml | 6 ++++++
>>>  1 file changed, 6 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/arm/ti/k3.yaml b/Documentation/devicetree/bindings/arm/ti/k3.yaml
>>> index b03c10fa2e7a..64f3db3ea9dd 100644
>>> --- a/Documentation/devicetree/bindings/arm/ti/k3.yaml
>>> +++ b/Documentation/devicetree/bindings/arm/ti/k3.yaml
>>> @@ -53,6 +53,12 @@ properties:
>>>                - ti,am642-sk
>>>            - const: ti,am642
>>>  
>>> +      - description: K3 AM625 SoC
>>> +        items:
>>> +          - enum:
>>> +              - ti,am625-sk
>>> +          - const: ti,am625
>>
>> Why keeping it not alphabetically sorted? What sorting did you choose?
>>
> 
> Above list is not sorted alphabetically, I tried to keep similar SoCs
> bunched together. AM625 and AM642 are of same family, hence chose to add
> the new entry here.

Then maybe it should be before AM642?

> One alternative is to add it to end of the list (chronologically)?
> Or I can add a patch to sort the list alphabetically first and then
> introduce new compatible. Please let me know your preference?

It's not that important, just wondering. I propose to avoid putting at
the end, because this causes conflicts in case of concurrent work. If I
had to choose, I would propose to sort SoCs by name.

Either way is fine - with trimmed commit msg in patch 4 or here:

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 4/5] arm64: dts: ti: Introduce base support for AM62x SoC
  2022-02-09 19:04     ` Vignesh Raghavendra
@ 2022-02-09 21:36       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2022-02-09 21:36 UTC (permalink / raw)
  To: Vignesh Raghavendra, Nishanth Menon, Tero Kristo, Rob Herring,
	Santosh Shilimkar
  Cc: linux-arm-kernel, devicetree, linux-kernel

On 09/02/2022 20:04, Vignesh Raghavendra wrote:
> Hi Krzysztof,
> 
> On 08/02/22 10:35 pm, Krzysztof Kozlowski wrote:
> [...]
>>
>> (...)
>>
>>> diff --git a/arch/arm64/boot/dts/ti/k3-am62.dtsi b/arch/arm64/boot/dts/ti/k3-am62.dtsi
>>> new file mode 100644
>>> index 000000000000..f1a46be27c37
>>> --- /dev/null
>>> +++ b/arch/arm64/boot/dts/ti/k3-am62.dtsi
>>> @@ -0,0 +1,104 @@
>>> +// SPDX-License-Identifier: GPL-2.0
>>> +/*
>>> + * Device Tree Source for AM62 SoC Family
>>> + *
>>> + * Copyright (C) 2020-2022 Texas Instruments Incorporated - https://www.ti.com/
>>> + */
>>> +
>>> +#include <dt-bindings/gpio/gpio.h>
>>> +#include <dt-bindings/interrupt-controller/irq.h>
>>> +#include <dt-bindings/interrupt-controller/arm-gic.h>
>>> +#include <dt-bindings/pinctrl/k3.h>
>>> +#include <dt-bindings/soc/ti,sci_pm_domain.h>
>>> +
>>> +/ {
>>> +	model = "Texas Instruments K3 AM625 SoC";
>>> +	compatible = "ti,am625";
>>
>> This is am625, but the file is am62. Why having the split?
> 
> 
> Hierarchy is:
> 
> am62.dtsi:
> -> base SoC skeleton ie arch timers and interconnects which is common
> across am62xx family of SoCs
>  -> includes am62-main.dtsi, am62-mcu.dtsi and am62-wakeup.dtsi
> representing 3 domains and peripherals in each of these domain
> -> describes all peripherals in the family (except CPU cluster)
> 
> 
> am625.dtsi:
> -> describes CPU cluster (Quad A53s). Since, am625 is a current superset
> device with all peripherals, am625.dtsi includes am62.dtsi completing
> SoC definition.
> -> individual EVMs using this SoC will just need to include am625.dtsi
> thus making things easier for Board and SOM Vendors.
> 
> 
> In future:
> am62{1-9}{1-9}.dtsi:
> -> Includes am625.dtsi
> -> Overrides top compatible: ti,am62{1-9}{1-9}
> -> disables CPUs and peripherals not present (cutdowns of current SoC).
> -> -> individual EVM dts files using this SoC will just need to include
> am625.dtsi as starting point, thus making things easier for Board and
> SOM Vendors.
> 
> Top level compatible is set to "ti,am625.dtsi" which is first device in
> family and superset.
> 
> Hope this clears up? Will add this to commit msg
> 

Hm, if I understand correctly: you might have later some future
am6211.dtsi which includes am625.dtsi and in general is compatible with
am625 but with disabled parts?

It's as bit counter-intuitive - I expect compatible to be extended
instead of overridden. But it looks also ok, if you build entire design
around it.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 4/5] arm64: dts: ti: Introduce base support for AM62x SoC
  2022-02-09 19:10   ` Marc Zyngier
@ 2022-02-10 19:34     ` Nishanth Menon
  2022-02-11 11:33       ` Marc Zyngier
  0 siblings, 1 reply; 22+ messages in thread
From: Nishanth Menon @ 2022-02-10 19:34 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Vignesh Raghavendra, Tero Kristo, Rob Herring,
	Krzysztof Kozlowski, Santosh Shilimkar, linux-arm-kernel,
	devicetree, linux-kernel

On 19:10-20220209, Marc Zyngier wrote:
[...]

> > +&cbass_main {
> > +	gic500: interrupt-controller@1800000 {
> > +		compatible = "arm,gic-v3";
> > +		#address-cells = <2>;
> > +		#size-cells = <2>;
> > +		ranges;
> > +		#interrupt-cells = <3>;
> > +		interrupt-controller;
> > +		reg = <0x00 0x01800000 0x00 0x10000>,	/* GICD */
> > +		      <0x00 0x01880000 0x00 0xC0000>;	/* GICR */
> 
> Usual rant: you are missing the GICC, GICH and GICV regions
> that are implemented by the CPU. Cortex-A53 implements them
> (they are not optional), so please describe them.
> 


-ECONFUSED. TRM for GIC500 refers to just GICD, GICR and ITS range[1].

Same thing is indicated by Generic Interrupt Controller Architecture
Specification[2] See table 1-1 (page 23).

I think you are expecting GICV3's backward compatibility mode (Table 1-2
in page 24), But in K3 architecture, are_option meant for backward
compatibility is set to true (aka no backward compatibility). I think
this did popup sometime back as well (first k3 SoC)[3]. I think the more
clearer description is available in [4].

I believe the argumentation that GICC/H/V is mandatory for A53 if GIC500
is used is not accurate. Please correct me if I am mistaken.


[1] https://developer.arm.com/documentation/ddi0516/e/programmers-model/the-gic-500-register-map?lang=en
[2] https://developer.arm.com/documentation/ihi0069/d
[3] https://patchwork.kernel.org/project/linux-arm-kernel/patch/20180607233853.p7iw7nlxxuyi66og@kahuna/
[4] https://developer.arm.com/documentation/ddi0516/e/functional-description/operation/backwards-compatibility?lang=en

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 4/5] arm64: dts: ti: Introduce base support for AM62x SoC
  2022-02-10 19:34     ` Nishanth Menon
@ 2022-02-11 11:33       ` Marc Zyngier
  2022-02-11 23:55         ` Nishanth Menon
  0 siblings, 1 reply; 22+ messages in thread
From: Marc Zyngier @ 2022-02-11 11:33 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Vignesh Raghavendra, Tero Kristo, Rob Herring,
	Krzysztof Kozlowski, Santosh Shilimkar, linux-arm-kernel,
	devicetree, linux-kernel

On Thu, 10 Feb 2022 19:34:59 +0000,
Nishanth Menon <nm@ti.com> wrote:
> 
> On 19:10-20220209, Marc Zyngier wrote:
> [...]
> 
> > > +&cbass_main {
> > > +	gic500: interrupt-controller@1800000 {
> > > +		compatible = "arm,gic-v3";
> > > +		#address-cells = <2>;
> > > +		#size-cells = <2>;
> > > +		ranges;
> > > +		#interrupt-cells = <3>;
> > > +		interrupt-controller;
> > > +		reg = <0x00 0x01800000 0x00 0x10000>,	/* GICD */
> > > +		      <0x00 0x01880000 0x00 0xC0000>;	/* GICR */
> > 
> > Usual rant: you are missing the GICC, GICH and GICV regions
> > that are implemented by the CPU. Cortex-A53 implements them
> > (they are not optional), so please describe them.
> > 
> 
> 
> -ECONFUSED. TRM for GIC500 refers to just GICD, GICR and ITS range[1].

And I'm not talking about the GIC, but of the CPU interface. The fact
that we describe both in the GIC binding doesn't mean they are
implemented by the same IP block (and the architecture is quite clear
about that).

> Same thing is indicated by Generic Interrupt Controller Architecture
> Specification[2] See table 1-1 (page 23).
> 
> I think you are expecting GICV3's backward compatibility mode (Table 1-2
> in page 24), But in K3 architecture, are_option meant for backward
> compatibility is set to true (aka no backward compatibility). I think
> this did popup sometime back as well (first k3 SoC)[3]. I think the more
> clearer description is available in [4].

No, this description is for the architecture as a whole. ARE being
disabled *int the GIC* doesn't mean it is disabled overall, and the
CPU is free to implement the CPU interface by any mean it wants as
long as it communicates with the GIC using the Stream Protocol.
Cortex-A32, A34, 35, A53, A57, A72 and A73 all implement both the
sysreg and MMIO CPU interfaces. Later ARM CPUs don't. Both can work
with GIC500.

> I believe the argumentation that GICC/H/V is mandatory for A53 if GIC500
> is used is not accurate. Please correct me if I am mistaken.

GIC500 is not involved at all, and A53 always implements both the
system register and MMIO interfaces. See the A53 TRM, chapter 9. The
only way to disable this interface is to assert GICCDISABLE, which
disables the whole of the CPU interface. Given that you have a (more
or less) functional system, it probably isn't the case.

See Table 9-1, which tells you where these registers are as an offset
from PERIPHBASE. Dumping these registers should show you that they are
indeed implemented and not solely a figment of my own imagination.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 2/5] dt-bindings: arm: ti: Add bindings for AM625 SoC
  2022-02-08 13:18 ` [PATCH 2/5] dt-bindings: arm: ti: Add bindings for AM625 SoC Vignesh Raghavendra
  2022-02-08 17:01   ` Krzysztof Kozlowski
@ 2022-02-11 16:39   ` Rob Herring
  1 sibling, 0 replies; 22+ messages in thread
From: Rob Herring @ 2022-02-11 16:39 UTC (permalink / raw)
  To: Vignesh Raghavendra
  Cc: linux-arm-kernel, Krzysztof Kozlowski, Tero Kristo, devicetree,
	Santosh Shilimkar, Nishanth Menon, linux-kernel, Rob Herring

On Tue, 08 Feb 2022 18:48:24 +0530, Vignesh Raghavendra wrote:
> From: Nishanth Menon <nm@ti.com>
> 
> The AM62 SoC family is the follow on AM335x built on K3 Multicore SoC
> architecture platform, providing ultra-low-power modes, dual display,
> multi-sensor edge compute, security and other BOM-saving integration.
> The AM62 SoC targets broad market to enable applications such as
> Industrial HMI, PLC/CNC/Robot control, Medical Equipment, Building
> Automation, Appliances and more.
> 
> Some highlights of this SoC are:
> 
> * Quad-Cortex-A53s (running up to 1.4GHz) in a single cluster.
>   Pin-to-pin compatible options for single and quad core are available.
> * Cortex-M4F for general-purpose or safety usage.
> * Dual display support, providing 24-bit RBG parallel interface and
>   OLDI/LVDS-4 Lane x2, up to 200MHz pixel clock support for 2K display
>   resolution.
> * Selectable GPUsupport, up to 8GFLOPS, providing better user experience
>   in 3D graphic display case and Android.
> * PRU(Programmable Realtime Unit) support for customized programmable
>   interfaces/IOs.
> * Integrated Giga-bit Ethernet switch supporting up to a total of two
>   external ports (TSN capable).
> * 9xUARTs, 5xSPI, 6xI2C, 2xUSB2, 3xCAN-FD, 3x eMMC and SD, GPMC for
>   NAND/FPGA connection, OSPI memory controller, 3xMcASP for audio,
>   1x CSI-RX-4L for Camera, eCAP/eQEP, ePWM, among other peripherals.
> * Dedicated Centralized System Controller for Security, Power, and
>   Resource Management.
> * Multiple low power modes support, ex: Deep sleep,Standby, MCU-only,
>   enabling battery powered system design.
> 
> AM625 is the first device of the family. Add DT bindings for the same.
> 
> More details can be found in the Technical Reference Manual:
> https://www.ti.com/lit/pdf/spruiv7
> 
> Signed-off-by: Nishanth Menon <nm@ti.com>
> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
> ---
>  Documentation/devicetree/bindings/arm/ti/k3.yaml | 6 ++++++
>  1 file changed, 6 insertions(+)
> 

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 3/5] dt-bindings: pinctrl: k3: Introduce pinmux definitions for AM62
  2022-02-08 13:18 ` [PATCH 3/5] dt-bindings: pinctrl: k3: Introduce pinmux definitions for AM62 Vignesh Raghavendra
@ 2022-02-11 16:41   ` Rob Herring
  0 siblings, 0 replies; 22+ messages in thread
From: Rob Herring @ 2022-02-11 16:41 UTC (permalink / raw)
  To: Vignesh Raghavendra
  Cc: devicetree, Krzysztof Kozlowski, linux-arm-kernel, linux-kernel,
	Tero Kristo, Santosh Shilimkar, Nishanth Menon, Rob Herring

On Tue, 08 Feb 2022 18:48:25 +0530, Vignesh Raghavendra wrote:
> From: Suman Anna <s-anna@ti.com>
> 
> Add pinctrl macros for AM62x SoCs. These macro definitions are similar
> to that of previous platforms, but adding new definitions to avoid any
> naming confusions in the SoC dts files.
> 
> checkpatch insists the following error exists:
> ERROR: Macros with complex values should be enclosed in parentheses
> 
> However, we do not need parentheses enclosing the values for this
> macro as we do intend it to generate two separate values as has been
> done for other similar platforms.
> 
> Signed-off-by: Suman Anna <s-anna@ti.com>
> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
> ---
>  include/dt-bindings/pinctrl/k3.h | 3 +++
>  1 file changed, 3 insertions(+)
> 

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 4/5] arm64: dts: ti: Introduce base support for AM62x SoC
  2022-02-11 11:33       ` Marc Zyngier
@ 2022-02-11 23:55         ` Nishanth Menon
  2022-02-12 11:40           ` Marc Zyngier
  0 siblings, 1 reply; 22+ messages in thread
From: Nishanth Menon @ 2022-02-11 23:55 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Vignesh Raghavendra, Tero Kristo, Rob Herring,
	Krzysztof Kozlowski, Santosh Shilimkar, linux-arm-kernel,
	devicetree, linux-kernel

On 11:33-20220211, Marc Zyngier wrote:
> On Thu, 10 Feb 2022 19:34:59 +0000,
> Nishanth Menon <nm@ti.com> wrote:
> > 
> > On 19:10-20220209, Marc Zyngier wrote:
> > [...]
> > 
> > > > +&cbass_main {
> > > > +	gic500: interrupt-controller@1800000 {
> > > > +		compatible = "arm,gic-v3";
> > > > +		#address-cells = <2>;
> > > > +		#size-cells = <2>;
> > > > +		ranges;
> > > > +		#interrupt-cells = <3>;
> > > > +		interrupt-controller;
> > > > +		reg = <0x00 0x01800000 0x00 0x10000>,	/* GICD */
> > > > +		      <0x00 0x01880000 0x00 0xC0000>;	/* GICR */
> > > 
> > > Usual rant: you are missing the GICC, GICH and GICV regions
> > > that are implemented by the CPU. Cortex-A53 implements them
> > > (they are not optional), so please describe them.
> > > 
> > 
> > 
> > -ECONFUSED. TRM for GIC500 refers to just GICD, GICR and ITS range[1].
> 
> And I'm not talking about the GIC, but of the CPU interface. The fact
> that we describe both in the GIC binding doesn't mean they are
> implemented by the same IP block (and the architecture is quite clear
> about that).
> 
> > Same thing is indicated by Generic Interrupt Controller Architecture
> > Specification[2] See table 1-1 (page 23).
> > 
> > I think you are expecting GICV3's backward compatibility mode (Table 1-2
> > in page 24), But in K3 architecture, are_option meant for backward
> > compatibility is set to true (aka no backward compatibility). I think
> > this did popup sometime back as well (first k3 SoC)[3]. I think the more
> > clearer description is available in [4].
> 
> No, this description is for the architecture as a whole. ARE being
> disabled *int the GIC* doesn't mean it is disabled overall, and the
> CPU is free to implement the CPU interface by any mean it wants as
> long as it communicates with the GIC using the Stream Protocol.
> Cortex-A32, A34, 35, A53, A57, A72 and A73 all implement both the
> sysreg and MMIO CPU interfaces. Later ARM CPUs don't. Both can work
> with GIC500.
> 
> > I believe the argumentation that GICC/H/V is mandatory for A53 if GIC500
> > is used is not accurate. Please correct me if I am mistaken.
> 
> GIC500 is not involved at all, and A53 always implements both the
> system register and MMIO interfaces. See the A53 TRM, chapter 9. The
> only way to disable this interface is to assert GICCDISABLE, which
> disables the whole of the CPU interface. Given that you have a (more
> or less) functional system, it probably isn't the case.
> 
> See Table 9-1, which tells you where these registers are as an offset
> from PERIPHBASE. Dumping these registers should show you that they are
> indeed implemented and not solely a figment of my own imagination.

Thanks for explaining.. I don't see this is working in practise.. Let me
know if I am making a mistake in my interpretation.

Quote from our internal integration spec (yep it leaves it to ARM cluster's
use):
""
Note: GIC periphery base tieoff to ARM corepacs for GIC v2 compatibility
requires a dedicated unallocated space to be passed as input to ARM corepac.
The CC internal region 0F00_0000-0x0F03_FFFF is assigned as GIC periphery
base tieoff to the corepac.
When GIC-500 is in v3 mode, and A72 with GICCDISABLE=0 and PERIPHBASE set:
- the CPU interface registers are accessed via ICC* system register.
- the GICC* regions (PERIPHBASE - PERIPHBASE+0x3FFFF) are reserved
  and access will be Read as Zero / Write Ignored.
So any writes/reads to this region would be trapped by ARM corepacs.
""

Anyways, Here is my report. I checked across all K3 devices (a72 and
a53)
AM65x: PERIPH_BASE = 0x6f000000 (a53)
j721e: PERIPH_BASE = 0x6f000000 (a72)
J7200: PERIPH_BASE = 0x6f000000 (a72)
j721s2: PERIPH_BASE = 0x6f000000 (a72)
AM64: PERIPH_BASE = 0x100000000 (a53)
AM62: PERIPH_BASE = 0x100000000 (a53)

(side note: am64/62 needed the 0x6f.. address space for PCIe stuff.. but
the address chosen has nothing in SoC fabric)

Tested at u-boot shell prompt (running at EL2):

If I understood the expectation correctly..I should be seeing offsets
off [1]. Taking 'CPU Interface'/GICC as an example, [2] should be the
registers I should be seeing. aka, at offset 0xfc from PERIPHBASE, i
should see 0x0034443B.

Note: on K3 devices (in the 32bit address space), as in the
description above, we have a null endpoint handler in the bus fabric
that responds with 0x0 for read requests for invalid/reserved addresses.

What I see is 0x0 (and not IIDR) in all the address ranges - which matches ARM
sending that region requests straight down to SoC level and SoC
returning "ignore"..

On AM62, I attached Lauterbach. and tried to look at the addresses: [3]
from cpu view and from bus view.

I also checked from kernel side with devmem to make sure to dump while
kernel GICV3 is active.. I see the same thing as well..

Is there something TFA or someone has to do to "enable" this? I tried
re-reading porting-guide.rst yet again to make sure we have'nt missed
anything.

[1] https://developer.arm.com/documentation/ddi0500/j/Generic-Interrupt-Controller-CPU-Interface/GIC-programmers-model/Memory-map?lang=en
[2] https://developer.arm.com/documentation/ddi0500/j/Generic-Interrupt-Controller-CPU-Interface/GIC-programmers-model/CPU-interface-register-summary
[3] https://pasteboard.co/3O44PAwLeAXz.png


-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 4/5] arm64: dts: ti: Introduce base support for AM62x SoC
  2022-02-11 23:55         ` Nishanth Menon
@ 2022-02-12 11:40           ` Marc Zyngier
  2022-02-15 21:12             ` Nishanth Menon
  0 siblings, 1 reply; 22+ messages in thread
From: Marc Zyngier @ 2022-02-12 11:40 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Vignesh Raghavendra, Tero Kristo, Rob Herring,
	Krzysztof Kozlowski, Santosh Shilimkar, linux-arm-kernel,
	devicetree, linux-kernel

On Fri, 11 Feb 2022 23:55:13 +0000,
Nishanth Menon <nm@ti.com> wrote:
> 
> On 11:33-20220211, Marc Zyngier wrote:
> > On Thu, 10 Feb 2022 19:34:59 +0000,
> > Nishanth Menon <nm@ti.com> wrote:
> > > 
> > > On 19:10-20220209, Marc Zyngier wrote:
> > > [...]
> > > 
> > > > > +&cbass_main {
> > > > > +	gic500: interrupt-controller@1800000 {
> > > > > +		compatible = "arm,gic-v3";
> > > > > +		#address-cells = <2>;
> > > > > +		#size-cells = <2>;
> > > > > +		ranges;
> > > > > +		#interrupt-cells = <3>;
> > > > > +		interrupt-controller;
> > > > > +		reg = <0x00 0x01800000 0x00 0x10000>,	/* GICD */
> > > > > +		      <0x00 0x01880000 0x00 0xC0000>;	/* GICR */
> > > > 
> > > > Usual rant: you are missing the GICC, GICH and GICV regions
> > > > that are implemented by the CPU. Cortex-A53 implements them
> > > > (they are not optional), so please describe them.
> > > > 
> > > 
> > > 
> > > -ECONFUSED. TRM for GIC500 refers to just GICD, GICR and ITS range[1].
> > 
> > And I'm not talking about the GIC, but of the CPU interface. The fact
> > that we describe both in the GIC binding doesn't mean they are
> > implemented by the same IP block (and the architecture is quite clear
> > about that).
> > 
> > > Same thing is indicated by Generic Interrupt Controller Architecture
> > > Specification[2] See table 1-1 (page 23).
> > > 
> > > I think you are expecting GICV3's backward compatibility mode (Table 1-2
> > > in page 24), But in K3 architecture, are_option meant for backward
> > > compatibility is set to true (aka no backward compatibility). I think
> > > this did popup sometime back as well (first k3 SoC)[3]. I think the more
> > > clearer description is available in [4].
> > 
> > No, this description is for the architecture as a whole. ARE being
> > disabled *int the GIC* doesn't mean it is disabled overall, and the
> > CPU is free to implement the CPU interface by any mean it wants as
> > long as it communicates with the GIC using the Stream Protocol.
> > Cortex-A32, A34, 35, A53, A57, A72 and A73 all implement both the
> > sysreg and MMIO CPU interfaces. Later ARM CPUs don't. Both can work
> > with GIC500.
> > 
> > > I believe the argumentation that GICC/H/V is mandatory for A53 if GIC500
> > > is used is not accurate. Please correct me if I am mistaken.
> > 
> > GIC500 is not involved at all, and A53 always implements both the
> > system register and MMIO interfaces. See the A53 TRM, chapter 9. The
> > only way to disable this interface is to assert GICCDISABLE, which
> > disables the whole of the CPU interface. Given that you have a (more
> > or less) functional system, it probably isn't the case.
> > 
> > See Table 9-1, which tells you where these registers are as an offset
> > from PERIPHBASE. Dumping these registers should show you that they are
> > indeed implemented and not solely a figment of my own imagination.
> 
> Thanks for explaining.. I don't see this is working in practise.. Let me
> know if I am making a mistake in my interpretation.
> 
> Quote from our internal integration spec (yep it leaves it to ARM cluster's
> use):
> ""
> Note: GIC periphery base tieoff to ARM corepacs for GIC v2 compatibility
> requires a dedicated unallocated space to be passed as input to ARM corepac.
> The CC internal region 0F00_0000-0x0F03_FFFF is assigned as GIC periphery
> base tieoff to the corepac.
> When GIC-500 is in v3 mode, and A72 with GICCDISABLE=0 and PERIPHBASE set:
> - the CPU interface registers are accessed via ICC* system register.
> - the GICC* regions (PERIPHBASE - PERIPHBASE+0x3FFFF) are reserved
>   and access will be Read as Zero / Write Ignored.
> So any writes/reads to this region would be trapped by ARM corepacs.
> ""

Not sure what the 'corepacs' are (the CPU cluster?). But what I
understand is that accesses to the GIC regions are kept internal to
the 'corepacs', which is exactly what is expected.

> 
> Anyways, Here is my report. I checked across all K3 devices (a72 and
> a53)
> AM65x: PERIPH_BASE = 0x6f000000 (a53)
> j721e: PERIPH_BASE = 0x6f000000 (a72)
> J7200: PERIPH_BASE = 0x6f000000 (a72)
> j721s2: PERIPH_BASE = 0x6f000000 (a72)
> AM64: PERIPH_BASE = 0x100000000 (a53)
> AM62: PERIPH_BASE = 0x100000000 (a53)
> 
> (side note: am64/62 needed the 0x6f.. address space for PCIe stuff.. but
> the address chosen has nothing in SoC fabric)
> 
> Tested at u-boot shell prompt (running at EL2):
> 
> If I understood the expectation correctly..I should be seeing offsets
> off [1]. Taking 'CPU Interface'/GICC as an example, [2] should be the
> registers I should be seeing. aka, at offset 0xfc from PERIPHBASE, i
> should see 0x0034443B.

If ICC_SRE_EL3.SRE is 1, this is more or less expected. You can only
use one or the other at any given time, not both.

The more important thing is that GICV is what we give to a VM running
in compat mode. With HCR_EL2.{AMO,FMO,IMO}={1,1,1} and
ICC_SRE_EL1.SRE==0, the guest can access a MMIO virtual GIC interface,
and the hypervisor does its magic.

> 
> Note: on K3 devices (in the 32bit address space), as in the
> description above, we have a null endpoint handler in the bus fabric
> that responds with 0x0 for read requests for invalid/reserved addresses.
> 
> What I see is 0x0 (and not IIDR) in all the address ranges - which matches ARM
> sending that region requests straight down to SoC level and SoC
> returning "ignore"..
> 
> On AM62, I attached Lauterbach. and tried to look at the addresses: [3]
> from cpu view and from bus view.
> 
> I also checked from kernel side with devmem to make sure to dump while
> kernel GICV3 is active.. I see the same thing as well..
> 
> Is there something TFA or someone has to do to "enable" this? I tried
> re-reading porting-guide.rst yet again to make sure we have'nt missed
> anything.

I expect the SRE settings to control all of this, most of which are
under NS control. You could easily check this by advertising the 3
missing regions in DT, booting an upstream kernel with KVM and boot a
GICv2 guest. KVM will also warn if the DT regions are advertised but
the HW doesn't actually support the MMIO accesses. Feel free to ping
me offline if you need the runs for this,

	M.

-- 
Without deviation from the norm, progress is not possible.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 4/5] arm64: dts: ti: Introduce base support for AM62x SoC
  2022-02-12 11:40           ` Marc Zyngier
@ 2022-02-15 21:12             ` Nishanth Menon
  0 siblings, 0 replies; 22+ messages in thread
From: Nishanth Menon @ 2022-02-15 21:12 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Vignesh Raghavendra, Tero Kristo, Rob Herring,
	Krzysztof Kozlowski, Santosh Shilimkar, linux-arm-kernel,
	devicetree, linux-kernel

On 11:40-20220212, Marc Zyngier wrote:
[...]

> I expect the SRE settings to control all of this, most of which are
> under NS control. You could easily check this by advertising the 3
> missing regions in DT, booting an upstream kernel with KVM and boot a
> GICv2 guest. KVM will also warn if the DT regions are advertised but
> the HW doesn't actually support the MMIO accesses. Feel free to ping
> me offline if you need the runs for this,


Thanks for the offline guidance and clarification. fixup patches for
existing K3 devices posted in [1].

[1] https://lore.kernel.org/all/20220215201008.15235-1-nm@ti.com/

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2022-02-15 21:12 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-08 13:18 [PATCH 0/5] arm64: Initial support for Texas Instruments AM62 Platform Vignesh Raghavendra
2022-02-08 13:18 ` [PATCH 1/5] soc: ti: k3-socinfo: Add AM62x JTAG ID Vignesh Raghavendra
2022-02-08 13:18 ` [PATCH 2/5] dt-bindings: arm: ti: Add bindings for AM625 SoC Vignesh Raghavendra
2022-02-08 17:01   ` Krzysztof Kozlowski
2022-02-09 19:04     ` Vignesh Raghavendra
2022-02-09 21:29       ` Krzysztof Kozlowski
2022-02-11 16:39   ` Rob Herring
2022-02-08 13:18 ` [PATCH 3/5] dt-bindings: pinctrl: k3: Introduce pinmux definitions for AM62 Vignesh Raghavendra
2022-02-11 16:41   ` Rob Herring
2022-02-08 13:18 ` [PATCH 4/5] arm64: dts: ti: Introduce base support for AM62x SoC Vignesh Raghavendra
2022-02-08 17:05   ` Krzysztof Kozlowski
2022-02-09 19:04     ` Vignesh Raghavendra
2022-02-09 21:36       ` Krzysztof Kozlowski
2022-02-09 19:10   ` Marc Zyngier
2022-02-10 19:34     ` Nishanth Menon
2022-02-11 11:33       ` Marc Zyngier
2022-02-11 23:55         ` Nishanth Menon
2022-02-12 11:40           ` Marc Zyngier
2022-02-15 21:12             ` Nishanth Menon
2022-02-08 13:18 ` [PATCH 5/5] arm64: dts: ti: Add support for AM62-SK Vignesh Raghavendra
2022-02-08 17:08   ` Krzysztof Kozlowski
2022-02-09 19:05     ` Vignesh Raghavendra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).