Skip to contentSkip to conversation

arm64: Add initial support for Odroid-N2

PATCH Superseded Neil Armstrong 4 participants 11 messages May 21, 2019 – May 22, 2019

Subsystems (2)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 cover arm64: Add initial support for Odroid-N2

This patchset adds basic support for :
- Amlogic G12B, which is very similar to G12A
- The HardKernel Odroid-N2 based on the S922X SoC

The Amlogic G12B SoC is very similar with the G12A SoC, sharing most of the features and architecture, but with these differences :
- The first CPU cluster only has 2xCortex-A53 instead of 4
- G12B has a second cluster of 4xCortex-A73
- Both cluster can achieve 2GHz instead of 1,8GHz for G12A
- CPU Clock architecture is difference, thus needing a different compatible to handle this slight difference
- Supports a MIPI CSI input
- Embeds a Mali-G52 instead of a Mali-G31, but integration is the same

Actual support is done in the same way as for the GXM support, including the G12A dtsi and redefining the CPU clusters.
Unlike GXM, the first cluster is different, thus needing to remove the last 2 cpu nodes of the first cluster.

Dependencies :
- Patch 1, 2 : YAML rewrite of amlogic.txt bindings at [7]
- Patch 3 : None since clock + g12b bindings has been acked

Changes since v2 at [5]:
- sent the clk patches in standalone at [6]
- rewrote the bindings on top of the YAML rewrite at [7]
- Added MMC, SDCard and Network support to Odroid-N2

Changes since v1 at [3]:
- Renamed the g12b cpu clocks like g12a counterparts
- Rebased clock patches on top of Guillaume's Temperature sensor Clock patches at [4]
- Added AO-CEC-B support to N2 DTS

Changes since RFC at [1]:
- Added bindings review tags
- Moved the fclk_div3 CRITICAL flags to the gate
- Removed invalid CRITICAL flags on the cpu clocks

[1] https://lkml.kernel.org/r/[email protected]
[2] https://lkml.kernel.org/r/[email protected]
[3] https://lkml.kernel.org/r/[email protected]
[4] https://lkml.kernel.org/r/[email protected]
[5] https://lkml.kernel.org/r/[email protected]
[6] https://lkml.kernel.org/r/[email protected]
[7] https://lkml.kernel.org/r/[email protected]

Neil Armstrong (3):
dt-bindings: arm: amlogic: add G12B bindings
dt-bindings: arm: amlogic: add Odroid-N2 binding
arm64: dts: meson: Add minimal support for Odroid-N2

 .../devicetree/bindings/arm/amlogic.yaml      |   6 +
 arch/arm64/boot/dts/amlogic/Makefile          |   1 +
 .../boot/dts/amlogic/meson-g12b-odroid-n2.dts | 286 ++++++++++++++++++
 arch/arm64/boot/dts/amlogic/meson-g12b.dtsi   |  82 +++++
 4 files changed, 375 insertions(+)
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-g12b.dtsi
Signature · 1 line
2.21.0
#1 lore raw

PATCH v3 1/3 dt-bindings: arm: amlogic: add G12B bindings

Add compatible for the Amlogic G12B SoC, sharing most of the features and architecture with the G12A SoC.

---
Rob, Martin,

I converted the patch you acked in yaml, I kept the Reviewed-by, is it ok for you ?

Neil

 Documentation/devicetree/bindings/arm/amlogic.yaml | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/arm/amlogic.yaml +4 -0
index 6d5bb493db03..28115dd49f96 100644
@@ -137,4 +137,8 @@ properties:
               - amlogic,u200
           - const: amlogic,g12a
 
+      - description: Boards with the Amlogic Meson G12B S922X SoC
+        items:
+          - const: amlogic,g12b
+
 ...
Signature · 1 line
2.21.0
#2 lore raw

Re: [PATCH v3 1/3] dt-bindings: arm: amlogic: add G12B bindings

Quoted 4 lines · Neil Armstrong

Add compatible for the Amlogic G12B SoC, sharing most of the features and architecture with the G12A SoC.

Quoted 8 lines

---
Rob, Martin,

I converted the patch you acked in yaml, I kept the Reviewed-by, is it ok for you ?

yes, it's fine

#3 lore raw

PATCH v3 2/3 dt-bindings: arm: amlogic: add Odroid-N2 binding

In reply to Neil Armstrong

Add compatible for the Amlogic G12B (S922X) SoC based Odroid-N2 SBC from HardKernel.

---
Rob, Martin,

I converted the patch you acked in yaml, I kept the Reviewed-by, is it ok for you ?

Neil

 Documentation/devicetree/bindings/arm/amlogic.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/arm/amlogic.yaml +2 -0
index 28115dd49f96..f75df4471c0a 100644
@@ -139,6 +139,8 @@ properties:
 
       - description: Boards with the Amlogic Meson G12B S922X SoC
         items:
+          - enum:
+              - hardkernel,odroid-n2
           - const: amlogic,g12b
 
 ...
Signature · 1 line
2.21.0
maintainer
#4 lore raw

Re: [PATCH v3 2/3] dt-bindings: arm: amlogic: add Odroid-N2 binding

Quoted 4 lines · Neil Armstrong

Add compatible for the Amlogic G12B (S922X) SoC based Odroid-N2 SBC from HardKernel.

Quoted 8 lines

---
Rob, Martin,

I converted the patch you acked in yaml, I kept the Reviewed-by, is it ok for you ?

Yes, both look fine.

Rob

#5 lore raw

Re: [PATCH v3 2/3] dt-bindings: arm: amlogic: add Odroid-N2 binding

In reply to Neil Armstrong
Quoted 4 lines · Neil Armstrong

Add compatible for the Amlogic G12B (S922X) SoC based Odroid-N2 SBC from HardKernel.

Quoted 8 lines

---
Rob, Martin,

I converted the patch you acked in yaml, I kept the Reviewed-by, is it ok for you ?

yes, looks fine to me as well

#6 lore raw

PATCH v3 3/3 arm64: dts: meson: Add minimal support for Odroid-N2

In reply to Neil Armstrong

This patch adds basic support for :
- Amlogic G12B, which is very similar to G12A
- The HardKernel Odroid-N2 based on the S922X SoC

The Amlogic G12B SoC is very similar with the G12A SoC, sharing most of the features and architecture, but with these differences :
- The first CPU cluster only has 2xCortex-A53 instead of 4
- G12B has a second cluster of 4xCortex-A73
- Both cluster can achieve 2GHz instead of 1,8GHz for G12A
- CPU Clock architecture is difference, thus needing a different compatible to handle this slight difference
- Supports a MIPI CSI input
- Embeds a Mali-G52 instead of a Mali-G31, but integration is the same

Actual support is done in the same way as for the GXM support, including the G12A dtsi and redefining the CPU clusters.
Unlike GXM, the first cluster is different, thus needing to remove the last 2 cpu nodes of the first cluster.

---
Martin,

I added MMC, SDCard and Network support, so I removed your Reviewed-by.

Neil

 arch/arm64/boot/dts/amlogic/Makefile          |   1 +
 .../boot/dts/amlogic/meson-g12b-odroid-n2.dts | 286 ++++++++++++++++++
 arch/arm64/boot/dts/amlogic/meson-g12b.dtsi   |  82 +++++
 3 files changed, 369 insertions(+)
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-g12b.dtsi
arch/arm64/boot/dts/amlogic/Makefile +1 -0
index e129c03ced14..07b861fe5fa5 100644
@@ -3,6 +3,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-axg-s400.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-g12a-sei510.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-g12a-u200.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-g12a-x96-max.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-g12b-odroid-n2.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-nanopi-k2.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-nexbox-a95x.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-odroidc2.dtb
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts new file +286 -0

286 lines not on this page · raw message

arch/arm64/boot/dts/amlogic/meson-g12b.dtsi new file +82 -0

82 lines not on this page · raw message

Signature · 1 line
2.21.0
#7 lore raw

Re: [PATCH v3 3/3] arm64: dts: meson: Add minimal support for Odroid-N2

On 21/05/2019 16:19, Neil Armstrong wrote:
[...]

arch/arm64/boot/dts/amlogic/meson-g12b.dtsi line 48

Quoted 3 lines
arch/arm64/boot/dts/amlogic/meson-g12b.dtsi new file +3 -0
+		cpu100: cpu@100 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a73", "arm,armv8";

Nit: we've recently tried to eradicate "arm,armv8" as a fallback compatible for real CPUs (although I see there are still a couple of instances that have slipped through).

Robin.

Quoted 35 lines
arch/arm64/boot/dts/amlogic/meson-g12b.dtsi new file +34 -0
+			reg = <0x0 0x100>;
+			enable-method = "psci";
+			next-level-cache = <&l2>;
+		};
+
+		cpu101: cpu@101 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a73", "arm,armv8";
+			reg = <0x0 0x101>;
+			enable-method = "psci";
+			next-level-cache = <&l2>;
+		};
+
+		cpu102: cpu@102 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a73", "arm,armv8";
+			reg = <0x0 0x102>;
+			enable-method = "psci";
+			next-level-cache = <&l2>;
+		};
+
+		cpu103: cpu@103 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a73", "arm,armv8";
+			reg = <0x0 0x103>;
+			enable-method = "psci";
+			next-level-cache = <&l2>;
+		};
+	};
+};
+
+&clkc {
+	compatible = "amlogic,g12b-clkc";
+};
#8 lore raw

Re: [PATCH v3 3/3] arm64: dts: meson: Add minimal support for Odroid-N2

Quoted 7 lines · Robin Murphy

On 21/05/2019 16:19, Neil Armstrong wrote:
[...]

Quoted 3 lines

+        cpu100: cpu@100 {
+            device_type = "cpu";
+            compatible = "arm,cortex-a73", "arm,armv8";

Nit: we've recently tried to eradicate "arm,armv8" as a fallback compatible for real CPUs (although I see there are still a couple of instances that have slipped through).

Thanks for pointing this, I'll remove it.

Neil

Quoted 38 lines

Robin.

Quoted 35 lines

+            reg = <0x0 0x100>;
+            enable-method = "psci";
+            next-level-cache = <&l2>;
+        };

arch/arm64/boot/dts/amlogic/meson-g12b.dtsi new file +30 -0
+
+        cpu101: cpu@101 {
+            device_type = "cpu";
+            compatible = "arm,cortex-a73", "arm,armv8";
+            reg = <0x0 0x101>;
+            enable-method = "psci";
+            next-level-cache = <&l2>;
+        };
+
+        cpu102: cpu@102 {
+            device_type = "cpu";
+            compatible = "arm,cortex-a73", "arm,armv8";
+            reg = <0x0 0x102>;
+            enable-method = "psci";
+            next-level-cache = <&l2>;
+        };
+
+        cpu103: cpu@103 {
+            device_type = "cpu";
+            compatible = "arm,cortex-a73", "arm,armv8";
+            reg = <0x0 0x103>;
+            enable-method = "psci";
+            next-level-cache = <&l2>;
+        };
+    };
+};
+
+&clkc {
+    compatible = "amlogic,g12b-clkc";
+};
reviewer Reviewed-by on v3 3/3
#9 lore raw

Re: [PATCH v3 3/3] arm64: dts: meson: Add minimal support for Odroid-N2

In reply to Neil Armstrong

Hi Neil,

On Tue, May 21, 2019 at 5:20 PM Neil Armstrong <[email protected]> wrote:
[...]

arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts line 122

Quoted 8 lines
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts new file +8 -0
+       hub_5v: regulator-hub_5v {
+               compatible = "regulator-fixed";
+               regulator-name = "HUB_5V";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               vin-supply = <&vcc_5v>;
+
+               gpio = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>;

I missed this in the review of v1:
according to the schematics GPIOH_5 is routed to GL3523 (soldered down USB hub) CHIP_EN signal.
The datasheet [0] mentions that this will "Disable whole chip and keep hub in lowest power state (standby mode)"

do you know if this is a similar case as GPIOH_4 (USB hub reset line, we configure this using a gpio-hog)?

[...]

arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts line 186

Quoted 6 lines

+&ext_mdio {

arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts new file +5 -0
+       external_phy: ethernet-phy@0 {
+               /* Realtek RTL8211F (0x001cc916) */
+               reg = <0>;
+               max-speed = <1000>;
+               eee-broken-1000t;

are we in the same situation that we have on the X96 Max where network dies without eee-broken-1000t?

[...]

Quoted 2 lines

+&usb2_phy0 {
+ phy-supply = <&usb_pwr_en>;

is usb_pwr_en really the phy-supply or is it the vbus-supply of the USB top control block (&usb node)?

if these three questions are answered then you can add my:

Regards
Martin

[0] https://datasheet.lcsc.com/szlcsc/GL3523-OV3S1_C157363.pdf

#10 lore raw

Re: [PATCH v3 3/3] arm64: dts: meson: Add minimal support for Odroid-N2

Quoted 12 lines · Martin Blumenstingl

Hi Neil,

On Tue, May 21, 2019 at 5:20 PM Neil Armstrong <[email protected]> wrote:
[...]

arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts line 122

Quoted 8 lines
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts new file +8 -0
+       hub_5v: regulator-hub_5v {
+               compatible = "regulator-fixed";
+               regulator-name = "HUB_5V";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               vin-supply = <&vcc_5v>;
+
+               gpio = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>;
Quoted 5 lines

I missed this in the review of v1:
according to the schematics GPIOH_5 is routed to GL3523 (soldered down USB hub) CHIP_EN signal.
The datasheet [0] mentions that this will "Disable whole chip and keep hub in lowest power state (standby mode)"

In the v1, we didn't have the schematics, so it was all a wild guess.

Quoted 3 lines

do you know if this is a similar case as GPIOH_4 (USB hub reset line, we configure this using a gpio-hog)?

We have 3 signals for USB :
- GPIOH_5: goes to CHIP_EN to CHIPENABLE to the Hub
- GPIOH_4: goes to RST_N to RESETJ to the Hub
- GPIOH_6: goes to PWREN for the OTG connector PWREN

As you said, the datasheet mentions : "
Disable whole chip and keep hub in lowest power state (standby mode "

I modeled it as a regulator since when enabled it actually enables the power on the USB3 ports using the post-Hub VBUSCTRL signal.

Since I can't model these post-hub power enable signals, I can only model the hub CHIPENABLE as a regulator to handle power. I can't model the hub as a device subnode inside the dwc3 since when CHIPENABLE is low, it won't appear...

We could model it as a Hog, but we won't be able to power down the usb3 ports.

Quoted 10 lines

[...]

arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts line 186

Quoted 6 lines

+&ext_mdio {

arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts new file +5 -0
+       external_phy: ethernet-phy@0 {
+               /* Realtek RTL8211F (0x001cc916) */
+               reg = <0>;
+               max-speed = <1000>;
+               eee-broken-1000t;

are we in the same situation that we have on the X96 Max where network dies without eee-broken-1000t?

I assume, let me run more tests to be sure.

Quoted 6 lines

[...]

Quoted 2 lines

+&usb2_phy0 {
+ phy-supply = <&usb_pwr_en>;

is usb_pwr_en really the phy-supply or is it the vbus-supply of the USB top control block (&usb node)?

You're right, now we have the schematics, it's not the phy supply.

I'll move it to vbus-supply since it's connected to the pwrenable of the otg port.

Quoted 3 lines

if these three questions are answered then you can add my:

I'll ask you to review the next version before !!!

Thanks.
Neil

Quoted 8 lines

Regards
Martin

[0] https://datasheet.lcsc.com/szlcsc/GL3523-OV3S1_C157363.pdf