Skip to contentSkip to conversation

arm64: dts: amlogic: Add clock and EMMC for T7

PATCH In review Ronald Claveau 3 participants 5 messages Feb 18

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 6/7 arm64: dts: amlogic: Add clock and EMMC for T7

Add fixed clock and EMMC support for Amlogic T7 SoC family dtsi.

---
 arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 137 +++++++++++++++++++-
 1 file changed, 134 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +134 -3
index 6510068bcff9..e5932eb3db2b 100644
@@ -3,6 +3,8 @@
  * Copyright (c) 2019 Amlogic, Inc. All rights reserved.
  */
 
+#include <dt-bindings/clock/amlogic,t7-peripherals-clkc.h>
+#include <dt-bindings/clock/amlogic,t7-pll-clkc.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/power/amlogic,t7-pwrc.h>
 #include "amlogic-t7-reset.h"
@@ -208,12 +210,14 @@ soc {
 		ranges;
 
 		gic: interrupt-controller@fff01000 {
-			compatible = "arm,gic-400";
+			compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic";
 			#interrupt-cells = <3>;
 			#address-cells = <0>;
 			interrupt-controller;
 			reg = <0x0 0xfff01000 0 0x1000>,
-			      <0x0 0xfff02000 0 0x0100>;
+				  <0x0 0xfff02000 0 0x2000>,
+				  <0x0 0xfff04000 0 0x2000>,
+				  <0x0 0xfff06000 0 0x2000>;
 			interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_HIGH)>;
 		};
 
@@ -224,6 +228,24 @@ apb4: bus@fe000000 {
 			#size-cells = <2>;
 			ranges = <0x0 0x0 0x0 0xfe000000 0x0 0x480000>;
 
+			clkc: clock-controller@0 {
+				compatible = "amlogic,t7-peripherals-clkc";
+				reg = <0x0 0x0 0x0 0x49c>;
+				#clock-cells = <1>;
+				clocks = <&xtal>,
+						 <&fpll CLKID_FDIV2>,
+						 <&fpll CLKID_FDIV2P5>,
+						 <&fpll CLKID_FDIV3>,
+						 <&fpll CLKID_FDIV4>,
+						 <&fpll CLKID_FDIV5>,
+						 <&hifi_pll CLKID_HIFI_PLL>,
+						 <&mpll CLKID_MPLL2>,
+						 <&mpll CLKID_MPLL3>,
+						 <&gp0_pll CLKID_GP0_PLL>;
+				clock-names = "xtal", "fdiv2", "fdiv2p5", "fdiv3", "fdiv4",
+							  "fdiv5", "hifi", "mpll2", "mpll3", "gp0";
+			};
+
 			reset: reset-controller@2000 {
 				compatible = "amlogic,t7-reset";
 				reg = <0x0 0x2000 0x0 0x98>;
@@ -250,6 +272,68 @@ gpio: bank@4000 {
 					#gpio-cells = <2>;
 					gpio-ranges = <&periphs_pinctrl 0 0 157>;
 				};
+
+				emmc_ctrl_pins: emmc-ctrl {
+					mux-0 {
+						groups = "emmc_cmd";
+						function = "emmc";
+						bias-pull-up;
+						drive-strength-microamp = <4000>;
+					};
+
+					mux-1 {
+						groups = "emmc_clk";
+						function = "emmc";
+						bias-disable;
+						drive-strength-microamp = <4000>;
+					};
+				};
+
+				emmc_data_4b_pins: emmc-data-4b {
+					mux-0 {
+						groups = "emmc_nand_d0",
+								 "emmc_nand_d1",
+								 "emmc_nand_d2",
+								 "emmc_nand_d3";
+						function = "emmc";
+						bias-pull-up;
+						drive-strength-microamp = <4000>;
+					};
+				};
+
+				emmc_data_8b_pins: emmc-data-8b {
+					mux-0 {
+						groups = "emmc_nand_d0",
+								 "emmc_nand_d1",
+								 "emmc_nand_d2",
+								 "emmc_nand_d3",
+								 "emmc_nand_d4",
+								 "emmc_nand_d5",
+								 "emmc_nand_d6",
+								 "emmc_nand_d7";
+						function = "emmc";
+						bias-pull-up;
+						drive-strength-microamp = <4000>;
+					};
+				};
+
+				emmc_ds_pins: emmc-ds {
+					mux {
+						groups = "emmc_nand_ds";
+						function = "emmc";
+						bias-pull-down;
+						drive-strength-microamp = <4000>;
+					};
+				};
+
+				emmc_clk_gate_pins: emmc_clk_gate {
+					mux {
+						groups = "GPIOB_8";
+						function = "gpio_periphs";
+						bias-pull-down;
+						drive-strength-microamp = <4000>;
+					};
+				};
 			};
 
 			gpio_intc: interrupt-controller@4080 {
@@ -262,8 +346,40 @@ gpio_intc: interrupt-controller@4080 {
 					<10 11 12 13 14 15 16 17 18 19 20 21>;
 			};
 
+			fpll: clock-controller@8040 {
+				compatible = "amlogic,t7-fpll";
+				reg = <0x0 0x8040 0x0 0x20>;
+				#clock-cells = <1>;
+				clocks = <&xtal>;
+				clock-names = "xtal";
+			};
+
+			gp0_pll: clock-controller@8080 {
+				compatible = "amlogic,t7-gp0-pll";
+				reg = <0x0 0x8080 0x0 0x20>;
+				#clock-cells = <1>;
+				clocks = <&xtal>;
+				clock-names = "in0";
+			};
+
+			hifi_pll: clock-controller@8100 {
+				compatible = "amlogic,t7-hifi-pll";
+				reg = <0x0 0x8100 0x0 0x20>;
+				#clock-cells = <1>;
+				clocks = <&xtal>;
+				clock-names = "in0";
+			};
+
+			mpll: clock-controller@8180 {
+				compatible = "amlogic,t7-mpll";
+				reg = <0x0 0x8180 0x0 0x20>;
+				#clock-cells = <1>;
+				clocks = <&fpll CLKID_FPLL_DCO>;
+				clock-names = "in0";
+			};
+
 			uart_a: serial@78000 {
-				compatible = "amlogic,t7-uart", "amlogic,meson-s4-uart";
+				compatible = "amlogic,meson-s4-uart";
 				reg = <0x0 0x78000 0x0 0x18>;
 				interrupts = <GIC_SPI 168 IRQ_TYPE_EDGE_RISING>;
 				status = "disabled";
@@ -276,6 +392,21 @@ sec_ao: ao-secure@10220 {
 				reg = <0x0 0x10220 0x0 0x140>;
 				amlogic,has-chip-id;
 			};
+
+			sd_emmc_c: mmc@8c000{
+				compatible = "amlogic,meson-axg-mmc";
+				reg = <0x0 0x8c000 0x0 0x800>;
+				interrupts = <GIC_SPI 178 IRQ_TYPE_EDGE_RISING>;
+				status = "disabled";
+				clocks = <&clkc CLKID_SYS_SD_EMMC_C>,
+						 <&clkc CLKID_SD_EMMC_C>,
+						 <&gp0_pll CLKID_GP0_PLL>;
+				clock-names = "core", "clkin0", "clkin1";
+				assigned-clocks = <&clkc CLKID_SD_EMMC_C_SEL>;
+				assigned-clock-parents = <&xtal>;
+				no-sdio;
+				no-sd;
+			};
 		};
 
 	};
Signature · 1 line
2.49.0
#1 lore raw
Quoted 21 lines · Ronald Claveau

Add fixed clock and EMMC support for Amlogic T7 SoC family dtsi.

---
 arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 137 +++++++++++++++++++-
 1 file changed, 134 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +2 -0
index 6510068bcff9..e5932eb3db2b 100644
@@ -3,6 +3,8 @@
  * Copyright (c) 2019 Amlogic, Inc. All rights reserved.
  */
 
+#include <dt-bindings/clock/amlogic,t7-peripherals-clkc.h>
+#include <dt-bindings/clock/amlogic,t7-pll-clkc.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/power/amlogic,t7-pwrc.h>
 #include "amlogic-t7-reset.h"

arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi soc { · line 213

Quoted 5 lines
arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +1 -1
@@ -208,12 +210,14 @@ soc {
 		ranges;
 
 		gic: interrupt-controller@fff01000 {
-			compatible = "arm,gic-400";
+			compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic";

I don't get how this is related to "Add fixed clock".

arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi soc { · line 220

Quoted 8 lines
arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +3 -1
 			#interrupt-cells = <3>;
 			#address-cells = <0>;
 			interrupt-controller;
 			reg = <0x0 0xfff01000 0 0x1000>,
-			      <0x0 0xfff02000 0 0x0100>;
+				  <0x0 0xfff02000 0 0x2000>,
+				  <0x0 0xfff04000 0 0x2000>,
+				  <0x0 0xfff06000 0 0x2000>;

Neither this really.

...

arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi sec_ao: ao-secure@10220 { · line 397

Quoted 3 lines
arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +3 -0
+
+			sd_emmc_c: mmc@8c000{
+				compatible = "amlogic,meson-axg-mmc";

Compatible says axg, DTS says T7, so something does not feel right.

Best regards,
Krzysztof

#2 lore raw
Quoted 41 lines · Krzysztof Kozlowski
Quoted 21 lines · Ronald Claveau

Add fixed clock and EMMC support for Amlogic T7 SoC family dtsi.

---
 arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 137 +++++++++++++++++++-
 1 file changed, 134 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +2 -0
index 6510068bcff9..e5932eb3db2b 100644
@@ -3,6 +3,8 @@
  * Copyright (c) 2019 Amlogic, Inc. All rights reserved.
  */
 
+#include <dt-bindings/clock/amlogic,t7-peripherals-clkc.h>
+#include <dt-bindings/clock/amlogic,t7-pll-clkc.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/power/amlogic,t7-pwrc.h>
 #include "amlogic-t7-reset.h"

arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi soc { · line 213

Quoted 5 lines
arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +1 -1
@@ -208,12 +210,14 @@ soc {
 		ranges;
 
 		gic: interrupt-controller@fff01000 {
-			compatible = "arm,gic-400";
+			compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic";

I don't get how this is related to "Add fixed clock".

arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi soc { · line 220

Quoted 8 lines
arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +3 -1
 			#interrupt-cells = <3>;
 			#address-cells = <0>;
 			interrupt-controller;
 			reg = <0x0 0xfff01000 0 0x1000>,
-			      <0x0 0xfff02000 0 0x0100>;
+				  <0x0 0xfff02000 0 0x2000>,
+				  <0x0 0xfff04000 0 0x2000>,
+				  <0x0 0xfff06000 0 0x2000>;

Neither this really.

Quoted 2 lines

...

You right, I will send a different patch to address that specific issue, and I will remove it here for v2.

Quoted 6 lines

arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi sec_ao: ao-secure@10220 { · line 397

Quoted 3 lines
arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +3 -0
+
+			sd_emmc_c: mmc@8c000{
+				compatible = "amlogic,meson-axg-mmc";

Compatible says axg, DTS says T7, so something does not feel right.

The SOC family is T7, but the emmc is fully compatible with this same axg code.
I did the same as used in meson-g12-common.dtsi or meson-s4.dtsi, which use the same compatible.

Best Regards,
Ronald

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic

#3 lore raw
Quoted 11 lines · Ronald Claveau
Quoted 6 lines

arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi sec_ao: ao-secure@10220 { · line 397

Quoted 3 lines
arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +3 -0
+
+			sd_emmc_c: mmc@8c000{
+				compatible = "amlogic,meson-axg-mmc";

Compatible says axg, DTS says T7, so something does not feel right.

The SOC family is T7, but the emmc is fully compatible with this same axg code.
I did the same as used in meson-g12-common.dtsi or meson-s4.dtsi, which use the same compatible.

You still should have a dedicated front compatible (needs documenting in the binding) expressing full compatibility.

Best regards,
Krzysztof

#4 lore raw
Quoted 8 lines · Krzysztof Kozlowski
Quoted 7 lines · Ronald Claveau
Quoted 6 lines

arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi sec_ao: ao-secure@10220 { · line 397

Quoted 3 lines
arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +3 -0
+
+			sd_emmc_c: mmc@8c000{
+				compatible = "amlogic,meson-axg-mmc";

Compatible says axg, DTS says T7, so something does not feel right.

Quoted 8 lines
Quoted 4 lines

The SOC family is T7, but the emmc is fully compatible with this same axg code.
I did the same as used in meson-g12-common.dtsi or meson-s4.dtsi, which use the same compatible.

You still should have a dedicated front compatible (needs documenting in the binding) expressing full compatibility.

ok, I will use something like that:

compatible = "amlogic,t7-mmc", "amlogic,meson-axg-mmc";

Best regards,
Ronald