Skip to contentSkip to conversation

arm64: Add support for Amlogic SM1 SoC Family

RFC In review Neil Armstrong 5 participants 26 messages Jul 1, 2019 – Aug 20, 2019

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

cover arm64: Add support for Amlogic SM1 SoC Family

The new Amlogic SM1 SoC Family is a derivative of the Amlogic G12A SoC Family, with the following changes :
- Cortex-A55 cores instead of A53
- more power domains, including USB & PCIe
- a neural network co-processor (NNA)
- a CSI input and image processor
- some changes in the audio complex, thus not yet enabled
- new clocks, for NNA, CSI and a clock tree for each CPU Core

This serie does not add support for NNA, CSI or DVFS, it only aligns with the current G12A Support.

With thie serie, the SEI610 Board has supported :
- Default-boot CPU frequency
- 4k60 HDMI without audio
- USB3 & USB-C OTG
- Ethernet
- LEDs
- IR
- GPIO Buttons
- eMMC
- SDCard
- SDIO WiFi
- UART Bluetooth

Audio (HDMI, Embedded HP, MIcs), IR Output, & RGB Led would be supported in following patchsets.

Dependencies:
- g12-common.dtsi from the DVFS patchset at [1]

[1] https://patchwork.kernel.org/cover/11025309/

Neil Armstrong (11):
soc: amlogic: meson-gx-socinfo: Add SM1 and S905X3 IDs
dt-bindings: power: amlogic, meson-gx-pwrc: Add SM1 bindings
soc: amlogic: gx-pwrc-vpu: add SM1 support
soc: amlogic: Add support for SM1 power controller
dt-bindings: soc: amlogic: clk-measure: Add SM1 compatible
soc: amlogic: clk-measure: Add support for SM1
dt-bindings: media: meson-ao-cec: add SM1 compatible
media: platform: meson-ao-cec-g12a: add support for SM1
dt-bindings: arm: amlogic: add SM1 bindings
dt-bindings: arm: amlogic: add SEI Robotics SEI610 bindings
arm64: dts: add support for SM1 based SEI Robotics SEI610

 .../devicetree/bindings/arm/amlogic.yaml      |   5 +
 .../bindings/media/meson-ao-cec.txt           |   8 +-
 .../bindings/power/amlogic,meson-gx-pwrc.txt  |  35 ++
 .../bindings/soc/amlogic/clk-measure.txt      |   1 +
 arch/arm64/boot/dts/amlogic/Makefile          |   1 +
 .../boot/dts/amlogic/meson-sm1-sei610.dts     | 329 ++++++++++++++++++
 arch/arm64/boot/dts/amlogic/meson-sm1.dtsi    |  77 ++++
 drivers/media/platform/meson/ao-cec-g12a.c    |  37 +-
 drivers/soc/amlogic/Kconfig                   |  11 +
 drivers/soc/amlogic/Makefile                  |   1 +
 drivers/soc/amlogic/meson-clk-measure.c       | 134 +++++++
 drivers/soc/amlogic/meson-gx-pwrc-vpu.c       | 120 +++++++
 drivers/soc/amlogic/meson-gx-socinfo.c        |   2 +
 drivers/soc/amlogic/meson-sm1-pwrc.c          | 245 +++++++++++++
 include/dt-bindings/power/meson-sm1-power.h   |  15 +
 15 files changed, 1017 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
 create mode 100644 drivers/soc/amlogic/meson-sm1-pwrc.c
 create mode 100644 include/dt-bindings/power/meson-sm1-power.h
Signature · 7 lines
2.21.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#1 lore raw

RFC 1/11 soc: amlogic: meson-gx-socinfo: Add SM1 and S905X3 IDs

Add the SoC IDs for the S905X3 Amlogic SM1 SoC.

---
 drivers/soc/amlogic/meson-gx-socinfo.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/soc/amlogic/meson-gx-socinfo.c +2 -0
index bca34954518e..eb81d391b620 100644
@@ -39,6 +39,7 @@ static const struct meson_gx_soc_id {
 	{ "TXHD", 0x27 },
 	{ "G12A", 0x28 },
 	{ "G12B", 0x29 },
+	{ "SM1", 0x2b },
 };
 
 static const struct meson_gx_package_id {
@@ -65,6 +66,7 @@ static const struct meson_gx_package_id {
 	{ "S905D2", 0x28, 0x10, 0xf0 },
 	{ "S905X2", 0x28, 0x40, 0xf0 },
 	{ "S922X", 0x29, 0x40, 0xf0 },
+	{ "S905X3", 0x2b, 0x50, 0xf0 },
 };
 
 static inline unsigned int socinfo_to_major(u32 socinfo)
Signature · 1 line
2.21.0
reviewer Reviewed-by on v1 1/11
#2 lore raw

Re: [RFC 01/11] soc: amlogic: meson-gx-socinfo: Add SM1 and S905X3 IDs

Quoted 3 lines · Neil Armstrong

Add the SoC IDs for the S905X3 Amlogic SM1 SoC.

Quoted 26 lines
---
 drivers/soc/amlogic/meson-gx-socinfo.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/soc/amlogic/meson-gx-socinfo.c +2 -0
index bca34954518e..eb81d391b620 100644
@@ -39,6 +39,7 @@ static const struct meson_gx_soc_id {
 	{ "TXHD", 0x27 },
 	{ "G12A", 0x28 },
 	{ "G12B", 0x29 },
+	{ "SM1", 0x2b },
 };
 
 static const struct meson_gx_package_id {
@@ -65,6 +66,7 @@ static const struct meson_gx_package_id {
 	{ "S905D2", 0x28, 0x10, 0xf0 },
 	{ "S905X2", 0x28, 0x40, 0xf0 },
 	{ "S922X", 0x29, 0x40, 0xf0 },
+	{ "S905X3", 0x2b, 0x50, 0xf0 },
 };
 
 static inline unsigned int socinfo_to_major(u32 socinfo)
Signature · 1 line
2.21.0
reviewer Reviewed-by on v1 1/11
#3 lore raw

Re: [RFC 01/11] soc: amlogic: meson-gx-socinfo: Add SM1 and S905X3 IDs

In reply to Neil Armstrong
Quoted 4 lines · Neil Armstrong

Add the SoC IDs for the S905X3 Amlogic SM1 SoC.

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

#4 lore raw

RFC 2/11 dt-bindings: power: amlogic, meson-gx-pwrc: Add SM1 bindings

In reply to Neil Armstrong

Add bindings for the Amlogic SM1 Power control:
- the VPU power control compatible
- the general-purpose power controller, controlling the USB, PCIe, NNA and GE2D power domains.

---
 .../bindings/power/amlogic,meson-gx-pwrc.txt  | 35 +++++++++++++++++++
 include/dt-bindings/power/meson-sm1-power.h   | 15 ++++++++
 2 files changed, 50 insertions(+)
 create mode 100644 include/dt-bindings/power/meson-sm1-power.h
Documentation/devicetree/bindings/power/amlogic,meson-gx-pwrc.txt +35 -0
index 0fdc3dd1125e..f0a1e20555bf 100644
@@ -19,6 +19,7 @@ Required properties:
 - compatible: should be one of the following :
 	- "amlogic,meson-gx-pwrc-vpu" for the Meson GX SoCs
 	- "amlogic,meson-g12a-pwrc-vpu" for the Meson G12A SoCs
+	- "amlogic,meson-sm1-pwrc-vpu" for the Meson SM1 SoCs
 - #power-domain-cells: should be 0
 - amlogic,hhi-sysctrl: phandle to the HHI sysctrl node
 - resets: phandles to the reset lines needed for this power demain sequence
@@ -60,4 +61,38 @@ ao_sysctrl: sys-ctrl@0 {
 	};
 };
 
+General Purpose Power Controller
+--------------------------------
 
+The Amlogic SM1 SoCs embeds a General Purpose Power Controller used
+to control the power domain for, at least, the USB PHYs and PCIe
+peripherals.
+
+
+Device Tree Bindings:
+---------------------
+
+Required properties:
+- compatible: should be one of the following :
+	- "amlogic,meson-sm1-pwrc" for the Meson SM1 SoCs
+- #power-domain-cells: should be 0
+- amlogic,hhi-sysctrl: phandle to the HHI sysctrl node
+
+Parent node should have the following properties :
+- compatible: "amlogic,meson-gx-ao-sysctrl", "syscon", "simple-mfd"
+- reg: base address and size of the AO system control register space.
+
+
+Example:
+-------
+
+ao_sysctrl: sys-ctrl@0 {
+	compatible = "amlogic,meson-gx-ao-sysctrl", "syscon", "simple-mfd";
+	reg =  <0x0 0x0 0x0 0x100>;
+
+	pwrc: power-controller {
+		compatible = "amlogic,meson-sm1-pwrc";
+		#power-domain-cells = <1>;
+		amlogic,hhi-sysctrl = <&hhi>;
+	};
+};
include/dt-bindings/power/meson-sm1-power.h new file +15 -0
new file mode 100644
index 000000000000..30e17e4a478e
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: (GPL-2.0+ or MIT) */
+/*
+ * Copyright (c) 2019 BayLibre, SAS
+ * Author: Neil Armstrong <[email protected]>
+ */
+
+#ifndef _DT_BINDINGS_MESON_SM1_POWER_H
+#define _DT_BINDINGS_MESON_SM1_POWER_H
+
+#define PWRC_SM1_NNA_ID		0
+#define PWRC_SM1_USB_ID		1
+#define PWRC_SM1_PCIE_ID	2
+#define PWRC_SM1_GE2D_ID	3
+
+#endif
Signature · 1 line
2.21.0
#5 lore raw

Re: [RFC 02/11] dt-bindings: power: amlogic, meson-gx-pwrc: Add SM1 bindings

Hi Neil,

On Mon, Jul 1, 2019 at 12:48 PM Neil Armstrong <[email protected]> wrote:
[...]

Documentation/devicetree/bindings/power/amlogic,meson-gx-pwrc.txt ao_sysctrl: sys-ctrl@0 { · line 69

Quoted 6 lines
Documentation/devicetree/bindings/power/amlogic,meson-gx-pwrc.txt +5 -0
+General Purpose Power Controller
+--------------------------------
 
+The Amlogic SM1 SoCs embeds a General Purpose Power Controller used
+to control the power domain for, at least, the USB PHYs and PCIe
+peripherals.

AFAIK each binding document should only describe one IP block. this one seems to be new / different

should it get it's own file?
also should it be a .yaml binding?

Quoted 18 lines
Documentation/devicetree/bindings/power/amlogic,meson-gx-pwrc.txt +18 -0
+
+Device Tree Bindings:
+---------------------
+
+Required properties:
+- compatible: should be one of the following :
+       - "amlogic,meson-sm1-pwrc" for the Meson SM1 SoCs
+- #power-domain-cells: should be 0
+- amlogic,hhi-sysctrl: phandle to the HHI sysctrl node
+
+Parent node should have the following properties :
+- compatible: "amlogic,meson-gx-ao-sysctrl", "syscon", "simple-mfd"
+- reg: base address and size of the AO system control register space.
+
+
+Example:
+-------
+

Documentation/devicetree/bindings/power/amlogic,meson-gx-pwrc.txt ao_sysctrl: sys-ctrl@0 { · line 98

Quoted 10 lines
Documentation/devicetree/bindings/power/amlogic,meson-gx-pwrc.txt +10 -0
+ao_sysctrl: sys-ctrl@0 {
+       compatible = "amlogic,meson-gx-ao-sysctrl", "syscon", "simple-mfd";
+       reg =  <0x0 0x0 0x0 0x100>;
+
+       pwrc: power-controller {
+               compatible = "amlogic,meson-sm1-pwrc";
+               #power-domain-cells = <1>;
+               amlogic,hhi-sysctrl = <&hhi>;
+       };
+};

I'm not sure that we want to mix HHI and AO power domains in one driver again back in March I asked a few questions about modelling the power domains and Kevin explained that we can implement them hierarchical:
[0]
unfortunately I didn't have the time to work on this - however, now that we implement a new driver: should we follow this hierarchical approach?

Martin

[0] http://lists.infradead.org/pipermail/linux-amlogic/2019-March/010512.html

maintainer
#6 lore raw

Re: [RFC 02/11] dt-bindings: power: amlogic, meson-gx-pwrc: Add SM1 bindings

Quoted 7 lines · Martin Blumenstingl

Hi Neil,

On Mon, Jul 1, 2019 at 12:48 PM Neil Armstrong <[email protected]> wrote:
[...]

Quoted 3 lines

+General Purpose Power Controller
+--------------------------------

Quoted 8 lines

Documentation/devicetree/bindings/power/amlogic,meson-gx-pwrc.txt ao_sysctrl: sys-ctrl@0 { · line 69

Quoted 3 lines
Documentation/devicetree/bindings/power/amlogic,meson-gx-pwrc.txt +3 -0
+The Amlogic SM1 SoCs embeds a General Purpose Power Controller used
+to control the power domain for, at least, the USB PHYs and PCIe
+peripherals.

AFAIK each binding document should only describe one IP block. this one seems to be new / different

should it get it's own file?
also should it be a .yaml binding?

I don't think this is a new IP block. Comparing across the various (64-bit) SoCs, it seems to be very similar across all SoCs.

Quoted 22 lines
Quoted 22 lines
Documentation/devicetree/bindings/power/amlogic,meson-gx-pwrc.txt +22 -0
+
+Device Tree Bindings:
+---------------------
+
+Required properties:
+- compatible: should be one of the following :
+       - "amlogic,meson-sm1-pwrc" for the Meson SM1 SoCs
+- #power-domain-cells: should be 0
+- amlogic,hhi-sysctrl: phandle to the HHI sysctrl node
+
+Parent node should have the following properties :
+- compatible: "amlogic,meson-gx-ao-sysctrl", "syscon", "simple-mfd"
+- reg: base address and size of the AO system control register space.
+
+
+Example:
+-------
+
+ao_sysctrl: sys-ctrl@0 {
+       compatible = "amlogic,meson-gx-ao-sysctrl", "syscon", "simple-mfd";
+       reg =  <0x0 0x0 0x0 0x100>;
+
Quoted 8 lines

Documentation/devicetree/bindings/power/amlogic,meson-gx-pwrc.txt ao_sysctrl: sys-ctrl@0 { · line 98

Quoted 6 lines
Documentation/devicetree/bindings/power/amlogic,meson-gx-pwrc.txt +6 -0
+       pwrc: power-controller {
+               compatible = "amlogic,meson-sm1-pwrc";
+               #power-domain-cells = <1>;
+               amlogic,hhi-sysctrl = <&hhi>;
+       };
+};

I'm not sure that we want to mix HHI and AO power domains in one driver again

We're not mixing here. These are all EE domains. They just have some control registers in the AO memory region.

Quoted 6 lines

back in March I asked a few questions about modelling the power domains and Kevin explained that we can implement them hierarchical:
[0]
unfortunately I didn't have the time to work on this - however, now that we implement a new driver: should we follow this hierarchical approach?

The more I look at this, I don't think we have a commpelling need to model them hierarchically. The main reason being is that of the 3 top-level domains I listed[0], we can only managing the EE domains in the kernel. It doesn't make sense to model/manage AO domains because, well, they are always-on (AO). The CPU domains are managed my the PSCI firmware, and we don't/won't have any control over that.

For that reason, I think it makes the most sense to have a generic driver that handles all the EE domains.

IMO, the SM1 driver that Neil wrote in patch 4 of this series is 80% there. If we generalize that little more, it can be quite easily used for all the EE domains.

Kevin

[0] http://lists.infradead.org/pipermail/linux-amlogic/2019-March/010512.html

#7 lore raw

Re: [RFC 02/11] dt-bindings: power: amlogic, meson-gx-pwrc: Add SM1 bindings

Hi Kevin,

On Tue, Aug 20, 2019 at 2:06 AM Kevin Hilman <[email protected]> wrote:
[...]

Quoted 13 lines
Quoted 4 lines
Quoted 4 lines
Documentation/devicetree/bindings/power/amlogic,meson-gx-pwrc.txt +4 -0
+ao_sysctrl: sys-ctrl@0 {
+       compatible = "amlogic,meson-gx-ao-sysctrl", "syscon", "simple-mfd";
+       reg =  <0x0 0x0 0x0 0x100>;
+
Quoted 8 lines

Documentation/devicetree/bindings/power/amlogic,meson-gx-pwrc.txt ao_sysctrl: sys-ctrl@0 { · line 98

Quoted 6 lines
Documentation/devicetree/bindings/power/amlogic,meson-gx-pwrc.txt +6 -0
+       pwrc: power-controller {
+               compatible = "amlogic,meson-sm1-pwrc";
+               #power-domain-cells = <1>;
+               amlogic,hhi-sysctrl = <&hhi>;
+       };
+};

I'm not sure that we want to mix HHI and AO power domains in one driver again

Quoted 2 lines

We're not mixing here. These are all EE domains. They just have some control registers in the AO memory region.

looking at patch 04/11 I see what you mean
(I'm describing it in my own words to make sure I got it right) we are controlling the EE power domains with this binding. each power domain has 1 bit in the HHI registers and 2 more bits ("sleep" and "isolation") in the AO region

then it makes sense to describe this together

Quoted 7 lines
Quoted 6 lines

back in March I asked a few questions about modelling the power domains and Kevin explained that we can implement them hierarchical:
[0]
unfortunately I didn't have the time to work on this - however, now that we implement a new driver: should we follow this hierarchical approach?

Quoted 6 lines

The more I look at this, I don't think we have a commpelling need to model them hierarchically. The main reason being is that of the 3 top-level domains I listed[0], we can only managing the EE domains in the kernel. It doesn't make sense to model/manage AO domains because, well, they are always-on (AO). The CPU domains are managed my the PSCI firmware, and we don't/won't have any control over that.

agreed, this is the same for the 32-bit SoCs except that we manage the CPU domains in arch/arm/mach-meson/platsmp.c instead of PSCI firmware (no problem here, I'm just mentioning it to get a complete picture)

Quoted 6 lines

For that reason, I think it makes the most sense to have a generic driver that handles all the EE domains.

IMO, the SM1 driver that Neil wrote in patch 4 of this series is 80% there. If we generalize that little more, it can be quite easily used for all the EE domains.

with your description above I agree.

for the 32-bit SoCs it would be beneficial if the register layout in the bindings was swapped:
- have the power controller as child of HHI
- pass the AO syscon

my main points for this are:
- it seems that for some power domains there are no AO register bits, for example the Ethernet Memory PD (GXBB datasheet [0] section 18.3 on page 48 and Meson8b datasheet [1] section 5.4 on page 17)
- less confusion: if it's a power domain controller for the EE region then it should be located there, even if it has additional bits elsewhere
- (weakest argument though) on the 32-bit SoCs we currently don't have a "big AO syscon" (and I don't see that we actually need it), but we do have a "amlogic,meson8b-pmu", "syscon" binding which covers AO_RTI_GEN_PWR_SLEEP0 (I should probably extend it so it covers AO_RTI_GEN_PWR_ISO0 as well, that just extra 4 bytes)

What do you think?

Martin

[0] https://dn.odroid.com/S905/DataSheet/S905_Public_Datasheet_V1.1.4.pdf
[1] https://dn.odroid.com/S805/Datasheet/S805_Datasheet%20V0.8%2020150126.pdf

#8 lore raw

RFC 3/11 soc: amlogic: gx-pwrc-vpu: add SM1 support

In reply to Neil Armstrong

Add support for the Amlogic SM1 SoCs VPU Power Domain control, it uses a different register for Isolation and a supplementaty register for the domain memories power control.

---
 drivers/soc/amlogic/meson-gx-pwrc-vpu.c | 120 ++++++++++++++++++++++++
 1 file changed, 120 insertions(+)
drivers/soc/amlogic/meson-gx-pwrc-vpu.c +120 -0
index 511b6856225d..fabb2868d09b 100644
@@ -18,6 +18,7 @@
 /* AO Offsets */
 
 #define AO_RTI_GEN_PWR_SLEEP0		(0x3a << 2)
+#define AO_RTI_GEN_PWR_ISO0		(0x3b << 2)
 
 #define GEN_PWR_VPU_HDMI		BIT(8)
 #define GEN_PWR_VPU_HDMI_ISO		BIT(9)
@@ -28,6 +29,8 @@
 #define HHI_VPU_MEM_PD_REG0		(0x41 << 2)
 #define HHI_VPU_MEM_PD_REG1		(0x42 << 2)
 #define HHI_VPU_MEM_PD_REG2		(0x4d << 2)
+#define HHI_VPU_MEM_PD_REG3		(0x43 << 2)
+#define HHI_VPU_MEM_PD_REG4		(0x44 << 2)
 
 struct meson_gx_pwrc_vpu {
 	struct generic_pm_domain genpd;
@@ -125,6 +128,53 @@ static int meson_g12a_pwrc_vpu_power_off(struct generic_pm_domain *genpd)
 	return 0;
 }
 
+static int meson_sm1_pwrc_vpu_power_off(struct generic_pm_domain *genpd)
+{
+	struct meson_gx_pwrc_vpu *pd = genpd_to_pd(genpd);
+	int i;
+
+	regmap_update_bits(pd->regmap_ao, AO_RTI_GEN_PWR_ISO0,
+			   GEN_PWR_VPU_HDMI, GEN_PWR_VPU_HDMI);
+	udelay(20);
+
+	/* Power Down Memories */
+	for (i = 0; i < 32; i += 2) {
+		regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG0,
+				   0x3 << i, 0x3 << i);
+		udelay(5);
+	}
+	for (i = 0; i < 32; i += 2) {
+		regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG1,
+				   0x3 << i, 0x3 << i);
+		udelay(5);
+	}
+	for (i = 0; i < 32; i += 2) {
+		regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG2,
+				   0x3 << i, 0x3 << i);
+		udelay(5);
+	}
+	regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG4,
+				   0x3 << 4, 0x3 << 4);
+	regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG4,
+				   0x7, 0x7);
+	for (i = 8; i < 16; i++) {
+		regmap_update_bits(pd->regmap_hhi, HHI_MEM_PD_REG0,
+				   BIT(i), BIT(i));
+		udelay(5);
+	}
+	udelay(20);
+
+	regmap_update_bits(pd->regmap_ao, AO_RTI_GEN_PWR_SLEEP0,
+			   GEN_PWR_VPU_HDMI, GEN_PWR_VPU_HDMI);
+
+	msleep(20);
+
+	clk_disable_unprepare(pd->vpu_clk);
+	clk_disable_unprepare(pd->vapb_clk);
+
+	return 0;
+}
+
 static int meson_gx_pwrc_vpu_setup_clk(struct meson_gx_pwrc_vpu *pd)
 {
 	int ret;
@@ -242,6 +292,64 @@ static int meson_g12a_pwrc_vpu_power_on(struct generic_pm_domain *genpd)
 	return 0;
 }
 
+static int meson_sm1_pwrc_vpu_power_on(struct generic_pm_domain *genpd)
+{
+	struct meson_gx_pwrc_vpu *pd = genpd_to_pd(genpd);
+	int ret;
+	int i;
+
+	regmap_update_bits(pd->regmap_ao, AO_RTI_GEN_PWR_SLEEP0,
+			   GEN_PWR_VPU_HDMI, 0);
+	udelay(20);
+
+	/* Power Up Memories */
+	for (i = 0; i < 32; i += 2) {
+		regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG0,
+				   0x3 << i, 0);
+		udelay(5);
+	}
+
+	for (i = 0; i < 32; i += 2) {
+		regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG1,
+				   0x3 << i, 0);
+		udelay(5);
+	}
+
+	for (i = 0; i < 32; i += 2) {
+		regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG2,
+				   0x3 << i, 0);
+		udelay(5);
+	}
+
+	regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG4, 0x3 << 4, 0);
+
+	regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG4, 0x7, 0);
+
+	for (i = 8; i < 16; i++) {
+		regmap_update_bits(pd->regmap_hhi, HHI_MEM_PD_REG0,
+				   BIT(i), 0);
+		udelay(5);
+	}
+	udelay(20);
+
+	ret = reset_control_assert(pd->rstc);
+	if (ret)
+		return ret;
+
+	regmap_update_bits(pd->regmap_ao, AO_RTI_GEN_PWR_ISO0,
+			   GEN_PWR_VPU_HDMI, 0);
+
+	ret = reset_control_deassert(pd->rstc);
+	if (ret)
+		return ret;
+
+	ret = meson_gx_pwrc_vpu_setup_clk(pd);
+	if (ret)
+		return ret;
+
+	return 0;
+}
+
 static bool meson_gx_pwrc_vpu_get_power(struct meson_gx_pwrc_vpu *pd)
 {
 	u32 reg;
@@ -267,6 +375,14 @@ static struct meson_gx_pwrc_vpu vpu_hdmi_pd_g12a = {
 	},
 };
 
+static struct meson_gx_pwrc_vpu vpu_hdmi_pd_sm1 = {
+	.genpd = {
+		.name = "vpu_hdmi",
+		.power_off = meson_sm1_pwrc_vpu_power_off,
+		.power_on = meson_sm1_pwrc_vpu_power_on,
+	},
+};
+
 static int meson_gx_pwrc_vpu_probe(struct platform_device *pdev)
 {
 	const struct meson_gx_pwrc_vpu *vpu_pd_match;
@@ -362,6 +478,10 @@ static const struct of_device_id meson_gx_pwrc_vpu_match_table[] = {
 	  .compatible = "amlogic,meson-g12a-pwrc-vpu",
 	  .data = &vpu_hdmi_pd_g12a
 	},
+	{
+	  .compatible = "amlogic,meson-sm1-pwrc-vpu",
+	  .data = &vpu_hdmi_pd_sm1
+	},
 	{ /* sentinel */ }
 };
 
Signature · 1 line
2.21.0
#9 lore raw

RFC 4/11 soc: amlogic: Add support for SM1 power controller

In reply to Neil Armstrong

Add support for the General Purpose Amlogic SM1 Power controller, dedicated to the PCIe, USB, NNA and GE2D Power Domains.

---
 drivers/soc/amlogic/Kconfig          |  11 ++
 drivers/soc/amlogic/Makefile         |   1 +
 drivers/soc/amlogic/meson-sm1-pwrc.c | 245 +++++++++++++++++++++++++++
 3 files changed, 257 insertions(+)
 create mode 100644 drivers/soc/amlogic/meson-sm1-pwrc.c
drivers/soc/amlogic/Kconfig +11 -0
index 5501ad5650b2..596f1afef1a7 100644
@@ -36,6 +36,17 @@ config MESON_GX_PM_DOMAINS
 	  Say yes to expose Amlogic Meson GX Power Domains as
 	  Generic Power Domains.
 
+config MESON_SM1_PM_DOMAINS
+	bool "Amlogic Meson SM1 Power Domains driver"
+	depends on ARCH_MESON || COMPILE_TEST
+	depends on PM && OF
+	default ARCH_MESON
+	select PM_GENERIC_DOMAINS
+	select PM_GENERIC_DOMAINS_OF
+	help
+	  Say yes to expose Amlogic Meson SM1 Power Domains as
+	  Generic Power Domains.
+
 config MESON_MX_SOCINFO
 	bool "Amlogic Meson MX SoC Information driver"
 	depends on ARCH_MESON || COMPILE_TEST
drivers/soc/amlogic/Makefile +1 -0
index bf2d109f61e9..f99935499ee6 100644
@@ -3,3 +3,4 @@ obj-$(CONFIG_MESON_CLK_MEASURE) += meson-clk-measure.o
 obj-$(CONFIG_MESON_GX_SOCINFO) += meson-gx-socinfo.o
 obj-$(CONFIG_MESON_GX_PM_DOMAINS) += meson-gx-pwrc-vpu.o
 obj-$(CONFIG_MESON_MX_SOCINFO) += meson-mx-socinfo.o
+obj-$(CONFIG_MESON_SM1_PM_DOMAINS) += meson-sm1-pwrc.o
drivers/soc/amlogic/meson-sm1-pwrc.c new file +245 -0

245 lines not on this page · raw message

Signature · 1 line
2.21.0
maintainer
#10 lore raw

Re: [RFC 04/11] soc: amlogic: Add support for SM1 power controller

Quoted 4 lines · Neil Armstrong

Add support for the General Purpose Amlogic SM1 Power controller, dedicated to the PCIe, USB, NNA and GE2D Power Domains.

I like this driver in general, but as I look at all the EE power domains for GX, G12 and SM1 they are really very similar. I had started to generalize the gx-pwrc-vpu driver and it ends up looking just like this.

I think this driver could be generalized just a little bit more and then replace the the GX-specific VPU one, and AFAICT, then be used across all the 64-bit SoCs, and be called "meson-pwrc-ee" or something like that...

Quoted 76 lines
---
 drivers/soc/amlogic/Kconfig          |  11 ++
 drivers/soc/amlogic/Makefile         |   1 +
 drivers/soc/amlogic/meson-sm1-pwrc.c | 245 +++++++++++++++++++++++++++
 3 files changed, 257 insertions(+)
 create mode 100644 drivers/soc/amlogic/meson-sm1-pwrc.c
drivers/soc/amlogic/Kconfig +11 -0
index 5501ad5650b2..596f1afef1a7 100644
@@ -36,6 +36,17 @@ config MESON_GX_PM_DOMAINS
 	  Say yes to expose Amlogic Meson GX Power Domains as
 	  Generic Power Domains.
 
+config MESON_SM1_PM_DOMAINS
+	bool "Amlogic Meson SM1 Power Domains driver"
+	depends on ARCH_MESON || COMPILE_TEST
+	depends on PM && OF
+	default ARCH_MESON
+	select PM_GENERIC_DOMAINS
+	select PM_GENERIC_DOMAINS_OF
+	help
+	  Say yes to expose Amlogic Meson SM1 Power Domains as
+	  Generic Power Domains.
+
 config MESON_MX_SOCINFO
 	bool "Amlogic Meson MX SoC Information driver"
 	depends on ARCH_MESON || COMPILE_TEST
drivers/soc/amlogic/Makefile +1 -0
index bf2d109f61e9..f99935499ee6 100644
@@ -3,3 +3,4 @@ obj-$(CONFIG_MESON_CLK_MEASURE) += meson-clk-measure.o
 obj-$(CONFIG_MESON_GX_SOCINFO) += meson-gx-socinfo.o
 obj-$(CONFIG_MESON_GX_PM_DOMAINS) += meson-gx-pwrc-vpu.o
 obj-$(CONFIG_MESON_MX_SOCINFO) += meson-mx-socinfo.o
+obj-$(CONFIG_MESON_SM1_PM_DOMAINS) += meson-sm1-pwrc.o
drivers/soc/amlogic/meson-sm1-pwrc.c new file +32 -0
new file mode 100644
index 000000000000..9ece1d06f417
@@ -0,0 +1,245 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2017 BayLibre, SAS
+ * Author: Neil Armstrong <[email protected]>
+ */
+
+#include <linux/of_address.h>
+#include <linux/platform_device.h>
+#include <linux/pm_domain.h>
+#include <linux/bitfield.h>
+#include <linux/regmap.h>
+#include <linux/mfd/syscon.h>
+#include <linux/of_device.h>
+#include <dt-bindings/power/meson-sm1-power.h>
+
+/* AO Offsets */
+
+#define AO_RTI_GEN_PWR_SLEEP0		(0x3a << 2)
+#define AO_RTI_GEN_PWR_ISO0		(0x3b << 2)
+
+/* HHI Offsets */
+
+#define HHI_MEM_PD_REG0			(0x40 << 2)
+#define HHI_NANOQ_MEM_PD_REG0		(0x46 << 2)
+#define HHI_NANOQ_MEM_PD_REG1		(0x47 << 2)
+
+struct meson_sm1_pwrc;
+
+struct meson_sm1_pwrc_mem_domain {
+	unsigned int reg;
+	unsigned int mask;
+};

drivers/soc/amlogic/meson-sm1-pwrc.c line 42

Quoted 10 lines
drivers/soc/amlogic/meson-sm1-pwrc.c new file +10 -0
+
+struct meson_sm1_pwrc_domain_desc {
+	char *name;
+	unsigned int sleep_reg;
+	unsigned int sleep_bit;
+	unsigned int iso_reg;
+	unsigned int iso_bit;
+	unsigned int mem_pd_count;
+	struct meson_sm1_pwrc_mem_domain *mem_pd;
+};

If you add resets and clocks (using clk bulk like my other proposed patch to gx-pwrc-vpu) then this could be used for VPU also. We could ignore my clk bulk patch and then just deprecate the old driver and use this one for everything.

We would just need SoC-specific tables selected by compatible-string to select the memory pds, and the clocks and resets could (optionaly) come from the DT.

Kevin

#11 lore raw

Re: [RFC 04/11] soc: amlogic: Add support for SM1 power controller

Quoted 10 lines · Kevin Hilman
Quoted 4 lines · Neil Armstrong

Add support for the General Purpose Amlogic SM1 Power controller, dedicated to the PCIe, USB, NNA and GE2D Power Domains.

I like this driver in general, but as I look at all the EE power domains for GX, G12 and SM1 they are really very similar. I had started to generalize the gx-pwrc-vpu driver and it ends up looking just like this.

Yes I developed it to be generic, but when starting to fill up the GXBB/GXL/G12A domains, except the VPU, they only need the PD parts.

Quoted 97 lines

I think this driver could be generalized just a little bit more and then replace the the GX-specific VPU one, and AFAICT, then be used across all the 64-bit SoCs, and be called "meson-pwrc-ee" or something like that...

Quoted 76 lines
---
 drivers/soc/amlogic/Kconfig          |  11 ++
 drivers/soc/amlogic/Makefile         |   1 +
 drivers/soc/amlogic/meson-sm1-pwrc.c | 245 +++++++++++++++++++++++++++
 3 files changed, 257 insertions(+)
 create mode 100644 drivers/soc/amlogic/meson-sm1-pwrc.c
drivers/soc/amlogic/Kconfig +11 -0
index 5501ad5650b2..596f1afef1a7 100644
@@ -36,6 +36,17 @@ config MESON_GX_PM_DOMAINS
 	  Say yes to expose Amlogic Meson GX Power Domains as
 	  Generic Power Domains.
 
+config MESON_SM1_PM_DOMAINS
+	bool "Amlogic Meson SM1 Power Domains driver"
+	depends on ARCH_MESON || COMPILE_TEST
+	depends on PM && OF
+	default ARCH_MESON
+	select PM_GENERIC_DOMAINS
+	select PM_GENERIC_DOMAINS_OF
+	help
+	  Say yes to expose Amlogic Meson SM1 Power Domains as
+	  Generic Power Domains.
+
 config MESON_MX_SOCINFO
 	bool "Amlogic Meson MX SoC Information driver"
 	depends on ARCH_MESON || COMPILE_TEST
drivers/soc/amlogic/Makefile +1 -0
index bf2d109f61e9..f99935499ee6 100644
@@ -3,3 +3,4 @@ obj-$(CONFIG_MESON_CLK_MEASURE) += meson-clk-measure.o
 obj-$(CONFIG_MESON_GX_SOCINFO) += meson-gx-socinfo.o
 obj-$(CONFIG_MESON_GX_PM_DOMAINS) += meson-gx-pwrc-vpu.o
 obj-$(CONFIG_MESON_MX_SOCINFO) += meson-mx-socinfo.o
+obj-$(CONFIG_MESON_SM1_PM_DOMAINS) += meson-sm1-pwrc.o
drivers/soc/amlogic/meson-sm1-pwrc.c new file +32 -0
new file mode 100644
index 000000000000..9ece1d06f417
@@ -0,0 +1,245 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2017 BayLibre, SAS
+ * Author: Neil Armstrong <[email protected]>
+ */
+
+#include <linux/of_address.h>
+#include <linux/platform_device.h>
+#include <linux/pm_domain.h>
+#include <linux/bitfield.h>
+#include <linux/regmap.h>
+#include <linux/mfd/syscon.h>
+#include <linux/of_device.h>
+#include <dt-bindings/power/meson-sm1-power.h>
+
+/* AO Offsets */
+
+#define AO_RTI_GEN_PWR_SLEEP0		(0x3a << 2)
+#define AO_RTI_GEN_PWR_ISO0		(0x3b << 2)
+
+/* HHI Offsets */
+
+#define HHI_MEM_PD_REG0			(0x40 << 2)
+#define HHI_NANOQ_MEM_PD_REG0		(0x46 << 2)
+#define HHI_NANOQ_MEM_PD_REG1		(0x47 << 2)
+
+struct meson_sm1_pwrc;
+
+struct meson_sm1_pwrc_mem_domain {
+	unsigned int reg;
+	unsigned int mask;
+};

drivers/soc/amlogic/meson-sm1-pwrc.c line 42

Quoted 10 lines
drivers/soc/amlogic/meson-sm1-pwrc.c new file +10 -0
+
+struct meson_sm1_pwrc_domain_desc {
+	char *name;
+	unsigned int sleep_reg;
+	unsigned int sleep_bit;
+	unsigned int iso_reg;
+	unsigned int iso_bit;
+	unsigned int mem_pd_count;
+	struct meson_sm1_pwrc_mem_domain *mem_pd;
+};

If you add resets and clocks (using clk bulk like my other proposed patch to gx-pwrc-vpu) then this could be used for VPU also. We could ignore my clk bulk patch and then just deprecate the old driver and use this one for everything.

Quoted 3 lines

We would just need SoC-specific tables selected by compatible-string to select the memory pds, and the clocks and resets could (optionaly) come from the DT.

Could you elaborate ?

Do you mean I should slit out the memory PDs as different compatible ?

Let me try to fit the VPU stuff in it.

Neil

Quoted 3 lines

Kevin

maintainer
#12 lore raw

Re: [RFC 04/11] soc: amlogic: Add support for SM1 power controller

Quoted 112 lines · Neil Armstrong
Quoted 10 lines · Kevin Hilman
Quoted 4 lines · Neil Armstrong

Add support for the General Purpose Amlogic SM1 Power controller, dedicated to the PCIe, USB, NNA and GE2D Power Domains.

I like this driver in general, but as I look at all the EE power domains for GX, G12 and SM1 they are really very similar. I had started to generalize the gx-pwrc-vpu driver and it ends up looking just like this.

Yes I developed it to be generic, but when starting to fill up the GXBB/GXL/G12A domains, except the VPU, they only need the PD parts.

Quoted 97 lines

I think this driver could be generalized just a little bit more and then replace the the GX-specific VPU one, and AFAICT, then be used across all the 64-bit SoCs, and be called "meson-pwrc-ee" or something like that...

Quoted 76 lines
---
 drivers/soc/amlogic/Kconfig          |  11 ++
 drivers/soc/amlogic/Makefile         |   1 +
 drivers/soc/amlogic/meson-sm1-pwrc.c | 245 +++++++++++++++++++++++++++
 3 files changed, 257 insertions(+)
 create mode 100644 drivers/soc/amlogic/meson-sm1-pwrc.c
drivers/soc/amlogic/Kconfig +11 -0
index 5501ad5650b2..596f1afef1a7 100644
@@ -36,6 +36,17 @@ config MESON_GX_PM_DOMAINS
 	  Say yes to expose Amlogic Meson GX Power Domains as
 	  Generic Power Domains.
 
+config MESON_SM1_PM_DOMAINS
+	bool "Amlogic Meson SM1 Power Domains driver"
+	depends on ARCH_MESON || COMPILE_TEST
+	depends on PM && OF
+	default ARCH_MESON
+	select PM_GENERIC_DOMAINS
+	select PM_GENERIC_DOMAINS_OF
+	help
+	  Say yes to expose Amlogic Meson SM1 Power Domains as
+	  Generic Power Domains.
+
 config MESON_MX_SOCINFO
 	bool "Amlogic Meson MX SoC Information driver"
 	depends on ARCH_MESON || COMPILE_TEST
drivers/soc/amlogic/Makefile +1 -0
index bf2d109f61e9..f99935499ee6 100644
@@ -3,3 +3,4 @@ obj-$(CONFIG_MESON_CLK_MEASURE) += meson-clk-measure.o
 obj-$(CONFIG_MESON_GX_SOCINFO) += meson-gx-socinfo.o
 obj-$(CONFIG_MESON_GX_PM_DOMAINS) += meson-gx-pwrc-vpu.o
 obj-$(CONFIG_MESON_MX_SOCINFO) += meson-mx-socinfo.o
+obj-$(CONFIG_MESON_SM1_PM_DOMAINS) += meson-sm1-pwrc.o
drivers/soc/amlogic/meson-sm1-pwrc.c new file +32 -0
new file mode 100644
index 000000000000..9ece1d06f417
@@ -0,0 +1,245 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2017 BayLibre, SAS
+ * Author: Neil Armstrong <[email protected]>
+ */
+
+#include <linux/of_address.h>
+#include <linux/platform_device.h>
+#include <linux/pm_domain.h>
+#include <linux/bitfield.h>
+#include <linux/regmap.h>
+#include <linux/mfd/syscon.h>
+#include <linux/of_device.h>
+#include <dt-bindings/power/meson-sm1-power.h>
+
+/* AO Offsets */
+
+#define AO_RTI_GEN_PWR_SLEEP0		(0x3a << 2)
+#define AO_RTI_GEN_PWR_ISO0		(0x3b << 2)
+
+/* HHI Offsets */
+
+#define HHI_MEM_PD_REG0			(0x40 << 2)
+#define HHI_NANOQ_MEM_PD_REG0		(0x46 << 2)
+#define HHI_NANOQ_MEM_PD_REG1		(0x47 << 2)
+
+struct meson_sm1_pwrc;
+
+struct meson_sm1_pwrc_mem_domain {
+	unsigned int reg;
+	unsigned int mask;
+};

drivers/soc/amlogic/meson-sm1-pwrc.c line 42

Quoted 10 lines
drivers/soc/amlogic/meson-sm1-pwrc.c new file +10 -0
+
+struct meson_sm1_pwrc_domain_desc {
+	char *name;
+	unsigned int sleep_reg;
+	unsigned int sleep_bit;
+	unsigned int iso_reg;
+	unsigned int iso_bit;
+	unsigned int mem_pd_count;
+	struct meson_sm1_pwrc_mem_domain *mem_pd;
+};

If you add resets and clocks (using clk bulk like my other proposed patch to gx-pwrc-vpu) then this could be used for VPU also. We could ignore my clk bulk patch and then just deprecate the old driver and use this one for everything.

Quoted 7 lines
Quoted 3 lines

We would just need SoC-specific tables selected by compatible-string to select the memory pds, and the clocks and resets could (optionaly) come from the DT.

Could you elaborate ?

Do you mean I should slit out the memory PDs as different compatible ?

You currently create all these SoC-specific mem_domain tables. We'll need more of those for the other SoCs, so my suggestion was that, in order to use this across multiple SoCs, you select the set of mem_domain tables based on compatible string.

That was just my first idea. If you have a better idea, I'm open to that too.

Quoted 1 line

Let me try to fit the VPU stuff in it.

Great, thanks!

Kevin

#13 lore raw

RFC 5/11 dt-bindings: soc: amlogic: clk-measure: Add SM1 compatible

In reply to Neil Armstrong

Add the Amlogic SM1 Compatible for the clk-measurer IP.

---
 Documentation/devicetree/bindings/soc/amlogic/clk-measure.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/soc/amlogic/clk-measure.txt +1 -0
index 6bf6b43f8dd8..3dd563cec794 100644
@@ -11,6 +11,7 @@ Required properties:
 			"amlogic,meson8b-clk-measure" for Meson8b SoCs
 			"amlogic,meson-axg-clk-measure" for AXG SoCs
 			"amlogic,meson-g12a-clk-measure" for G12a SoCs
+			"amlogic,meson-sm1-clk-measure" for SM1 SoCs
 - reg: base address and size of the Clock Measurer register space.
 
 Example:
Signature · 1 line
2.21.0
#16 lore raw

RFC 6/11 soc: amlogic: clk-measure: Add support for SM1

In reply to Neil Armstrong

Add the clk-measurer clocks IDs for the Amlogic SM1 SoC family.

---
 drivers/soc/amlogic/meson-clk-measure.c | 134 ++++++++++++++++++++++++
 1 file changed, 134 insertions(+)
drivers/soc/amlogic/meson-clk-measure.c +134 -0
index f09b404b39d3..e32e97613000 100644
@@ -357,6 +357,136 @@ static struct meson_msr_id clk_msr_g12a[CLK_MSR_MAX] = {
 	CLK_MSR_ID(122, "audio_pdm_dclk"),
 };
 
+static struct meson_msr_id clk_msr_sm1[CLK_MSR_MAX] = {
+	CLK_MSR_ID(0, "ring_osc_out_ee_0"),
+	CLK_MSR_ID(1, "ring_osc_out_ee_1"),
+	CLK_MSR_ID(2, "ring_osc_out_ee_2"),
+	CLK_MSR_ID(3, "ring_osc_out_ee_3"),
+	CLK_MSR_ID(4, "gp0_pll"),
+	CLK_MSR_ID(5, "gp1_pll"),
+	CLK_MSR_ID(6, "enci"),
+	CLK_MSR_ID(7, "clk81"),
+	CLK_MSR_ID(8, "encp"),
+	CLK_MSR_ID(9, "encl"),
+	CLK_MSR_ID(10, "vdac"),
+	CLK_MSR_ID(11, "eth_tx"),
+	CLK_MSR_ID(12, "hifi_pll"),
+	CLK_MSR_ID(13, "mod_tcon"),
+	CLK_MSR_ID(14, "fec_0"),
+	CLK_MSR_ID(15, "fec_1"),
+	CLK_MSR_ID(16, "fec_2"),
+	CLK_MSR_ID(17, "sys_pll_div16"),
+	CLK_MSR_ID(18, "sys_cpu_div16"),
+	CLK_MSR_ID(19, "lcd_an_ph2"),
+	CLK_MSR_ID(20, "rtc_osc_out"),
+	CLK_MSR_ID(21, "lcd_an_ph3"),
+	CLK_MSR_ID(22, "eth_phy_ref"),
+	CLK_MSR_ID(23, "mpll_50m"),
+	CLK_MSR_ID(24, "eth_125m"),
+	CLK_MSR_ID(25, "eth_rmii"),
+	CLK_MSR_ID(26, "sc_int"),
+	CLK_MSR_ID(27, "in_mac"),
+	CLK_MSR_ID(28, "sar_adc"),
+	CLK_MSR_ID(29, "pcie_inp"),
+	CLK_MSR_ID(30, "pcie_inn"),
+	CLK_MSR_ID(31, "mpll_test_out"),
+	CLK_MSR_ID(32, "vdec"),
+	CLK_MSR_ID(34, "eth_mpll_50m"),
+	CLK_MSR_ID(35, "mali"),
+	CLK_MSR_ID(36, "hdmi_tx_pixel"),
+	CLK_MSR_ID(37, "cdac"),
+	CLK_MSR_ID(38, "vdin_meas"),
+	CLK_MSR_ID(39, "bt656"),
+	CLK_MSR_ID(40, "arm_ring_osc_out_4"),
+	CLK_MSR_ID(41, "eth_rx_or_rmii"),
+	CLK_MSR_ID(42, "mp0_out"),
+	CLK_MSR_ID(43, "fclk_div5"),
+	CLK_MSR_ID(44, "pwm_b"),
+	CLK_MSR_ID(45, "pwm_a"),
+	CLK_MSR_ID(46, "vpu"),
+	CLK_MSR_ID(47, "ddr_dpll_pt"),
+	CLK_MSR_ID(48, "mp1_out"),
+	CLK_MSR_ID(49, "mp2_out"),
+	CLK_MSR_ID(50, "mp3_out"),
+	CLK_MSR_ID(51, "sd_emmc_c"),
+	CLK_MSR_ID(52, "sd_emmc_b"),
+	CLK_MSR_ID(53, "sd_emmc_a"),
+	CLK_MSR_ID(54, "vpu_clkc"),
+	CLK_MSR_ID(55, "vid_pll_div_out"),
+	CLK_MSR_ID(56, "wave420l_a"),
+	CLK_MSR_ID(57, "wave420l_c"),
+	CLK_MSR_ID(58, "wave420l_b"),
+	CLK_MSR_ID(59, "hcodec"),
+	CLK_MSR_ID(40, "arm_ring_osc_out_5"),
+	CLK_MSR_ID(61, "gpio_msr"),
+	CLK_MSR_ID(62, "hevcb"),
+	CLK_MSR_ID(63, "dsi_meas"),
+	CLK_MSR_ID(64, "spicc_1"),
+	CLK_MSR_ID(65, "spicc_0"),
+	CLK_MSR_ID(66, "vid_lock"),
+	CLK_MSR_ID(67, "dsi_phy"),
+	CLK_MSR_ID(68, "hdcp22_esm"),
+	CLK_MSR_ID(69, "hdcp22_skp"),
+	CLK_MSR_ID(70, "pwm_f"),
+	CLK_MSR_ID(71, "pwm_e"),
+	CLK_MSR_ID(72, "pwm_d"),
+	CLK_MSR_ID(73, "pwm_c"),
+	CLK_MSR_ID(74, "arm_ring_osc_out_6"),
+	CLK_MSR_ID(75, "hevcf"),
+	CLK_MSR_ID(74, "arm_ring_osc_out_7"),
+	CLK_MSR_ID(77, "rng_ring_osc_0"),
+	CLK_MSR_ID(78, "rng_ring_osc_1"),
+	CLK_MSR_ID(79, "rng_ring_osc_2"),
+	CLK_MSR_ID(80, "rng_ring_osc_3"),
+	CLK_MSR_ID(81, "vapb"),
+	CLK_MSR_ID(82, "ge2d"),
+	CLK_MSR_ID(83, "co_rx"),
+	CLK_MSR_ID(84, "co_tx"),
+	CLK_MSR_ID(85, "arm_ring_osc_out_8"),
+	CLK_MSR_ID(86, "arm_ring_osc_out_9"),
+	CLK_MSR_ID(87, "mipi_dsi_phy"),
+	CLK_MSR_ID(88, "cis2_adapt"),
+	CLK_MSR_ID(89, "hdmi_todig"),
+	CLK_MSR_ID(90, "hdmitx_sys"),
+	CLK_MSR_ID(91, "nna_core"),
+	CLK_MSR_ID(92, "nna_axi"),
+	CLK_MSR_ID(93, "vad"),
+	CLK_MSR_ID(94, "eth_phy_rx"),
+	CLK_MSR_ID(95, "eth_phy_pll"),
+	CLK_MSR_ID(96, "vpu_b"),
+	CLK_MSR_ID(97, "cpu_b_tmp"),
+	CLK_MSR_ID(98, "ts"),
+	CLK_MSR_ID(99, "arm_ring_osc_out_10"),
+	CLK_MSR_ID(100, "arm_ring_osc_out_11"),
+	CLK_MSR_ID(101, "arm_ring_osc_out_12"),
+	CLK_MSR_ID(102, "arm_ring_osc_out_13"),
+	CLK_MSR_ID(103, "arm_ring_osc_out_14"),
+	CLK_MSR_ID(104, "arm_ring_osc_out_15"),
+	CLK_MSR_ID(105, "arm_ring_osc_out_16"),
+	CLK_MSR_ID(106, "ephy_test"),
+	CLK_MSR_ID(107, "au_dac_g128x"),
+	CLK_MSR_ID(108, "audio_locker_out"),
+	CLK_MSR_ID(109, "audio_locker_in"),
+	CLK_MSR_ID(110, "audio_tdmout_c_sclk"),
+	CLK_MSR_ID(111, "audio_tdmout_b_sclk"),
+	CLK_MSR_ID(112, "audio_tdmout_a_sclk"),
+	CLK_MSR_ID(113, "audio_tdmin_lb_sclk"),
+	CLK_MSR_ID(114, "audio_tdmin_c_sclk"),
+	CLK_MSR_ID(115, "audio_tdmin_b_sclk"),
+	CLK_MSR_ID(116, "audio_tdmin_a_sclk"),
+	CLK_MSR_ID(117, "audio_resample"),
+	CLK_MSR_ID(118, "audio_pdm_sys"),
+	CLK_MSR_ID(119, "audio_spdifout_b"),
+	CLK_MSR_ID(120, "audio_spdifout"),
+	CLK_MSR_ID(121, "audio_spdifin"),
+	CLK_MSR_ID(122, "audio_pdm_dclk"),
+	CLK_MSR_ID(123, "audio_resampled"),
+	CLK_MSR_ID(124, "earcrx_pll"),
+	CLK_MSR_ID(125, "earcrx_pll_test"),
+	CLK_MSR_ID(126, "csi_phy0"),
+	CLK_MSR_ID(127, "csi2_data"),
+};
+
 static int meson_measure_id(struct meson_msr_id *clk_msr_id,
 			       unsigned int duration)
 {
@@ -545,6 +675,10 @@ static const struct of_device_id meson_msr_match_table[] = {
 		.compatible = "amlogic,meson-g12a-clk-measure",
 		.data = (void *)clk_msr_g12a,
 	},
+	{
+		.compatible = "amlogic,meson-sm1-clk-measure",
+		.data = (void *)clk_msr_sm1,
+	},
 	{ /* sentinel */ }
 };
 
Signature · 1 line
2.21.0
#17 lore raw

Re: [RFC 06/11] soc: amlogic: clk-measure: Add support for SM1

Hi Neil,

Quoted 67 lines · Neil Armstrong

Add the clk-measurer clocks IDs for the Amlogic SM1 SoC family.

---
 drivers/soc/amlogic/meson-clk-measure.c | 134 ++++++++++++++++++++++++
 1 file changed, 134 insertions(+)
drivers/soc/amlogic/meson-clk-measure.c +51 -0
index f09b404b39d3..e32e97613000 100644
@@ -357,6 +357,136 @@ static struct meson_msr_id clk_msr_g12a[CLK_MSR_MAX] = {
        CLK_MSR_ID(122, "audio_pdm_dclk"),
 };
 
+static struct meson_msr_id clk_msr_sm1[CLK_MSR_MAX] = {
+       CLK_MSR_ID(0, "ring_osc_out_ee_0"),
+       CLK_MSR_ID(1, "ring_osc_out_ee_1"),
+       CLK_MSR_ID(2, "ring_osc_out_ee_2"),
+       CLK_MSR_ID(3, "ring_osc_out_ee_3"),
+       CLK_MSR_ID(4, "gp0_pll"),
+       CLK_MSR_ID(5, "gp1_pll"),
+       CLK_MSR_ID(6, "enci"),
+       CLK_MSR_ID(7, "clk81"),
+       CLK_MSR_ID(8, "encp"),
+       CLK_MSR_ID(9, "encl"),
+       CLK_MSR_ID(10, "vdac"),
+       CLK_MSR_ID(11, "eth_tx"),
+       CLK_MSR_ID(12, "hifi_pll"),
+       CLK_MSR_ID(13, "mod_tcon"),
+       CLK_MSR_ID(14, "fec_0"),
+       CLK_MSR_ID(15, "fec_1"),
+       CLK_MSR_ID(16, "fec_2"),
+       CLK_MSR_ID(17, "sys_pll_div16"),
+       CLK_MSR_ID(18, "sys_cpu_div16"),
+       CLK_MSR_ID(19, "lcd_an_ph2"),
+       CLK_MSR_ID(20, "rtc_osc_out"),
+       CLK_MSR_ID(21, "lcd_an_ph3"),
+       CLK_MSR_ID(22, "eth_phy_ref"),
+       CLK_MSR_ID(23, "mpll_50m"),
+       CLK_MSR_ID(24, "eth_125m"),
+       CLK_MSR_ID(25, "eth_rmii"),
+       CLK_MSR_ID(26, "sc_int"),
+       CLK_MSR_ID(27, "in_mac"),
+       CLK_MSR_ID(28, "sar_adc"),
+       CLK_MSR_ID(29, "pcie_inp"),
+       CLK_MSR_ID(30, "pcie_inn"),
+       CLK_MSR_ID(31, "mpll_test_out"),
+       CLK_MSR_ID(32, "vdec"),
+       CLK_MSR_ID(34, "eth_mpll_50m"),
+       CLK_MSR_ID(35, "mali"),
+       CLK_MSR_ID(36, "hdmi_tx_pixel"),
+       CLK_MSR_ID(37, "cdac"),
+       CLK_MSR_ID(38, "vdin_meas"),
+       CLK_MSR_ID(39, "bt656"),
+       CLK_MSR_ID(40, "arm_ring_osc_out_4"),
+       CLK_MSR_ID(41, "eth_rx_or_rmii"),
+       CLK_MSR_ID(42, "mp0_out"),
+       CLK_MSR_ID(43, "fclk_div5"),
+       CLK_MSR_ID(44, "pwm_b"),
+       CLK_MSR_ID(45, "pwm_a"),
+       CLK_MSR_ID(46, "vpu"),
+       CLK_MSR_ID(47, "ddr_dpll_pt"),
+       CLK_MSR_ID(48, "mp1_out"),
+       CLK_MSR_ID(49, "mp2_out"),
+       CLK_MSR_ID(50, "mp3_out"),

drivers/soc/amlogic/meson-clk-measure.c static struct meson_msr_id clk_msr_g12a[CLK_MSR_MAX] = { · line 420

Quoted 10 lines
drivers/soc/amlogic/meson-clk-measure.c +10 -0
+       CLK_MSR_ID(51, "sd_emmc_c"),
+       CLK_MSR_ID(52, "sd_emmc_b"),
+       CLK_MSR_ID(53, "sd_emmc_a"),
+       CLK_MSR_ID(54, "vpu_clkc"),
+       CLK_MSR_ID(55, "vid_pll_div_out"),
+       CLK_MSR_ID(56, "wave420l_a"),
+       CLK_MSR_ID(57, "wave420l_c"),
+       CLK_MSR_ID(58, "wave420l_b"),
+       CLK_MSR_ID(59, "hcodec"),
+       CLK_MSR_ID(40, "arm_ring_osc_out_5"),

is this index 40 or 60?

Quoted 6 lines
drivers/soc/amlogic/meson-clk-measure.c +6 -0
+       CLK_MSR_ID(61, "gpio_msr"),
+       CLK_MSR_ID(62, "hevcb"),
+       CLK_MSR_ID(63, "dsi_meas"),
+       CLK_MSR_ID(64, "spicc_1"),
+       CLK_MSR_ID(65, "spicc_0"),
+       CLK_MSR_ID(66, "vid_lock"),

drivers/soc/amlogic/meson-clk-measure.c static struct meson_msr_id clk_msr_g12a[CLK_MSR_MAX] = { · line 436

Quoted 10 lines
drivers/soc/amlogic/meson-clk-measure.c +10 -0
+       CLK_MSR_ID(67, "dsi_phy"),
+       CLK_MSR_ID(68, "hdcp22_esm"),
+       CLK_MSR_ID(69, "hdcp22_skp"),
+       CLK_MSR_ID(70, "pwm_f"),
+       CLK_MSR_ID(71, "pwm_e"),
+       CLK_MSR_ID(72, "pwm_d"),
+       CLK_MSR_ID(73, "pwm_c"),
+       CLK_MSR_ID(74, "arm_ring_osc_out_6"),
+       CLK_MSR_ID(75, "hevcf"),
+       CLK_MSR_ID(74, "arm_ring_osc_out_7"),

is this index 74 or 76?

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

#18 lore raw

Re: [RFC 06/11] soc: amlogic: clk-measure: Add support for SM1

Quoted 73 lines · Martin Blumenstingl

Hi Neil,

Quoted 70 lines · Neil Armstrong

Add the clk-measurer clocks IDs for the Amlogic SM1 SoC family.

---
 drivers/soc/amlogic/meson-clk-measure.c | 134 ++++++++++++++++++++++++
 1 file changed, 134 insertions(+)
drivers/soc/amlogic/meson-clk-measure.c +54 -0
index f09b404b39d3..e32e97613000 100644
@@ -357,6 +357,136 @@ static struct meson_msr_id clk_msr_g12a[CLK_MSR_MAX] = {
        CLK_MSR_ID(122, "audio_pdm_dclk"),
 };
 
+static struct meson_msr_id clk_msr_sm1[CLK_MSR_MAX] = {
+       CLK_MSR_ID(0, "ring_osc_out_ee_0"),
+       CLK_MSR_ID(1, "ring_osc_out_ee_1"),
+       CLK_MSR_ID(2, "ring_osc_out_ee_2"),
+       CLK_MSR_ID(3, "ring_osc_out_ee_3"),
+       CLK_MSR_ID(4, "gp0_pll"),
+       CLK_MSR_ID(5, "gp1_pll"),
+       CLK_MSR_ID(6, "enci"),
+       CLK_MSR_ID(7, "clk81"),
+       CLK_MSR_ID(8, "encp"),
+       CLK_MSR_ID(9, "encl"),
+       CLK_MSR_ID(10, "vdac"),
+       CLK_MSR_ID(11, "eth_tx"),
+       CLK_MSR_ID(12, "hifi_pll"),
+       CLK_MSR_ID(13, "mod_tcon"),
+       CLK_MSR_ID(14, "fec_0"),
+       CLK_MSR_ID(15, "fec_1"),
+       CLK_MSR_ID(16, "fec_2"),
+       CLK_MSR_ID(17, "sys_pll_div16"),
+       CLK_MSR_ID(18, "sys_cpu_div16"),
+       CLK_MSR_ID(19, "lcd_an_ph2"),
+       CLK_MSR_ID(20, "rtc_osc_out"),
+       CLK_MSR_ID(21, "lcd_an_ph3"),
+       CLK_MSR_ID(22, "eth_phy_ref"),
+       CLK_MSR_ID(23, "mpll_50m"),
+       CLK_MSR_ID(24, "eth_125m"),
+       CLK_MSR_ID(25, "eth_rmii"),
+       CLK_MSR_ID(26, "sc_int"),
+       CLK_MSR_ID(27, "in_mac"),
+       CLK_MSR_ID(28, "sar_adc"),
+       CLK_MSR_ID(29, "pcie_inp"),
+       CLK_MSR_ID(30, "pcie_inn"),
+       CLK_MSR_ID(31, "mpll_test_out"),
+       CLK_MSR_ID(32, "vdec"),
+       CLK_MSR_ID(34, "eth_mpll_50m"),
+       CLK_MSR_ID(35, "mali"),
+       CLK_MSR_ID(36, "hdmi_tx_pixel"),
+       CLK_MSR_ID(37, "cdac"),
+       CLK_MSR_ID(38, "vdin_meas"),
+       CLK_MSR_ID(39, "bt656"),
+       CLK_MSR_ID(40, "arm_ring_osc_out_4"),
+       CLK_MSR_ID(41, "eth_rx_or_rmii"),
+       CLK_MSR_ID(42, "mp0_out"),
+       CLK_MSR_ID(43, "fclk_div5"),
+       CLK_MSR_ID(44, "pwm_b"),
+       CLK_MSR_ID(45, "pwm_a"),
+       CLK_MSR_ID(46, "vpu"),
+       CLK_MSR_ID(47, "ddr_dpll_pt"),
+       CLK_MSR_ID(48, "mp1_out"),
+       CLK_MSR_ID(49, "mp2_out"),
+       CLK_MSR_ID(50, "mp3_out"),
+       CLK_MSR_ID(51, "sd_emmc_c"),
+       CLK_MSR_ID(52, "sd_emmc_b"),
+       CLK_MSR_ID(53, "sd_emmc_a"),
Quoted 8 lines

drivers/soc/amlogic/meson-clk-measure.c static struct meson_msr_id clk_msr_g12a[CLK_MSR_MAX] = { · line 420

Quoted 7 lines
drivers/soc/amlogic/meson-clk-measure.c +7 -0
+       CLK_MSR_ID(54, "vpu_clkc"),
+       CLK_MSR_ID(55, "vid_pll_div_out"),
+       CLK_MSR_ID(56, "wave420l_a"),
+       CLK_MSR_ID(57, "wave420l_c"),
+       CLK_MSR_ID(58, "wave420l_b"),
+       CLK_MSR_ID(59, "hcodec"),
+       CLK_MSR_ID(40, "arm_ring_osc_out_5"),

is this index 40 or 60?

Exact it's 60, thanks for spotting

Quoted 17 lines
Quoted 7 lines
drivers/soc/amlogic/meson-clk-measure.c +6 -0
+       CLK_MSR_ID(61, "gpio_msr"),
+       CLK_MSR_ID(62, "hevcb"),
+       CLK_MSR_ID(63, "dsi_meas"),
+       CLK_MSR_ID(64, "spicc_1"),
+       CLK_MSR_ID(65, "spicc_0"),
+       CLK_MSR_ID(66, "vid_lock"),

drivers/soc/amlogic/meson-clk-measure.c static struct meson_msr_id clk_msr_g12a[CLK_MSR_MAX] = { · line 436

Quoted 10 lines
drivers/soc/amlogic/meson-clk-measure.c +10 -0
+       CLK_MSR_ID(67, "dsi_phy"),
+       CLK_MSR_ID(68, "hdcp22_esm"),
+       CLK_MSR_ID(69, "hdcp22_skp"),
+       CLK_MSR_ID(70, "pwm_f"),
+       CLK_MSR_ID(71, "pwm_e"),
+       CLK_MSR_ID(72, "pwm_d"),
+       CLK_MSR_ID(73, "pwm_c"),
+       CLK_MSR_ID(74, "arm_ring_osc_out_6"),
+       CLK_MSR_ID(75, "hevcf"),
+       CLK_MSR_ID(74, "arm_ring_osc_out_7"),
Quoted 2 lines

is this index 74 or 76?

Exact, it's 76 !

Neil

#19 lore raw

RFC 7/11 dt-bindings: media: meson-ao-cec: add SM1 compatible

In reply to Neil Armstrong

Add AO-CEC compatible string for the Amlogic SM1 SoC family, a derivate of the G12A AO-CECB controller.

---
 Documentation/devicetree/bindings/media/meson-ao-cec.txt | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/media/meson-ao-cec.txt +5 -3
index c67fc41d4aa2..ad92ee41c0dd 100644
@@ -5,10 +5,12 @@ to handle communication between HDMI connected devices over the CEC bus.
 
 Required properties:
   - compatible : value should be following depending on the SoC :
-	For GXBB, GXL, GXM and G12A (AO_CEC_A module) :
+	For GXBB, GXL, GXM, G12A and SM1 (AO_CEC_A module) :
 	"amlogic,meson-gx-ao-cec"
 	For G12A (AO_CEC_B module) :
 	"amlogic,meson-g12a-ao-cec"
+	For SM1 (AO_CEC_B module) :
+	"amlogic,meson-sm1-ao-cec"
 
   - reg : Physical base address of the IP registers and length of memory
 	  mapped region.
@@ -16,9 +18,9 @@ Required properties:
   - interrupts : AO-CEC interrupt number to the CPU.
   - clocks : from common clock binding: handle to AO-CEC clock.
   - clock-names : from common clock binding, must contain :
-		For GXBB, GXL, GXM and G12A (AO_CEC_A module) :
+		For GXBB, GXL, GXM, G12A and SM1 (AO_CEC_A module) :
 		- "core"
-		For G12A (AO_CEC_B module) :
+		For G12A, SM1 (AO_CEC_B module) :
 		- "oscin"
 		corresponding to entry in the clocks property.
   - hdmi-phandle: phandle to the HDMI controller
Signature · 1 line
2.21.0
maintainer Reviewed-by on v1 7/11
#20 lore raw

Re: [RFC 07/11] dt-bindings: media: meson-ao-cec: add SM1 compatible

Quoted 8 lines · Neil Armstrong

Add AO-CEC compatible string for the Amlogic SM1 SoC family, a derivate of the G12A AO-CECB controller.

---
 Documentation/devicetree/bindings/media/meson-ao-cec.txt | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
#21 lore raw

RFC 8/11 media: platform: meson-ao-cec-g12a: add support for SM1

In reply to Neil Armstrong

Add support for the Amlogic SM1 SoC Family to the G12A AO-CECB derivative.

It only adds a single init register.

---
 drivers/media/platform/meson/ao-cec-g12a.c | 37 +++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)
drivers/media/platform/meson/ao-cec-g12a.c +36 -1
index 3620a1e310f5..1c696a126ee8 100644
@@ -121,6 +121,9 @@
 #define CECB_CTRL_TYPE_NEXT	2
 
 #define CECB_CTRL2		0x01
+
+#define CECB_CTRL2_RISE_DEL_MAX	GENMASK(4, 0)
+
 #define CECB_INTR_MASK		0x02
 #define CECB_LADD_LOW		0x05
 #define CECB_LADD_HIGH		0x06
@@ -165,6 +168,11 @@
 
 #define CECB_WAKEUPCTRL		0x31
 
+struct meson_ao_cec_g12a_data {
+	/* Setup the internal CECB_CTRL2 register */
+	bool				ctrl2_setup;
+};
+
 struct meson_ao_cec_g12a_device {
 	struct platform_device		*pdev;
 	struct regmap			*regmap;
@@ -175,6 +183,7 @@ struct meson_ao_cec_g12a_device {
 	struct cec_msg			rx_msg;
 	struct clk			*oscin;
 	struct clk			*core;
+	const struct meson_ao_cec_g12a_data *data;
 };
 
 static const struct regmap_config meson_ao_cec_g12a_regmap_conf = {
@@ -620,6 +629,10 @@ static int meson_ao_cec_g12a_adap_enable(struct cec_adapter *adap, bool enable)
 	regmap_update_bits(ao_cec->regmap, CECB_GEN_CNTL_REG,
 			   CECB_GEN_CNTL_RESET, 0);
 
+	if (ao_cec->data->ctrl2_setup)
+		regmap_write(ao_cec->regmap_cec, CECB_CTRL2,
+			     FIELD_PREP(CECB_CTRL2_RISE_DEL_MAX, 2));
+
 	meson_ao_cec_g12a_irq_setup(ao_cec, true);
 
 	return 0;
@@ -639,6 +652,7 @@ static int meson_ao_cec_g12a_probe(struct platform_device *pdev)
 	void __iomem *base;
 	int ret, irq;
 
+
 	hdmi_dev = cec_notifier_parse_hdmi_phandle(&pdev->dev);
 	if (IS_ERR(hdmi_dev))
 		return PTR_ERR(hdmi_dev);
@@ -647,6 +661,12 @@ static int meson_ao_cec_g12a_probe(struct platform_device *pdev)
 	if (!ao_cec)
 		return -ENOMEM;
 
+	ao_cec->data = of_device_get_match_data(&pdev->dev);
+	if (!ao_cec->data) {
+		dev_err(&pdev->dev, "failed to get match data\n");
+		return -ENODEV;
+	}
+
 	spin_lock_init(&ao_cec->cec_reg_lock);
 	ao_cec->pdev = pdev;
 
@@ -757,8 +777,23 @@ static int meson_ao_cec_g12a_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct meson_ao_cec_g12a_data ao_cec_g12a_data = {
+	.ctrl2_setup = false,
+};
+
+static const struct meson_ao_cec_g12a_data ao_cec_sm1_data = {
+	.ctrl2_setup = true,
+};
+
 static const struct of_device_id meson_ao_cec_g12a_of_match[] = {
-	{ .compatible = "amlogic,meson-g12a-ao-cec", },
+	{
+		.compatible = "amlogic,meson-g12a-ao-cec",
+		.data = &ao_cec_g12a_data,
+	},
+	{
+		.compatible = "amlogic,meson-sm1-ao-cec",
+		.data = &ao_cec_sm1_data,
+	},
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, meson_ao_cec_g12a_of_match);
Signature · 1 line
2.21.0
#22 lore raw

RFC 9/11 dt-bindings: arm: amlogic: add SM1 bindings

In reply to Neil Armstrong

Add bindings for the new Amlogic SM1 SoC Family.

It a derivative of the G12A SoC Family with :
- Cortex-A55 core instead of A53
- more power domains
- a neural network co-processor
- a CSI input and image processor

---
 Documentation/devicetree/bindings/arm/amlogic.yaml | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/arm/amlogic.yaml +3 -0
index 325c6fd3566d..0b419fd0bac2 100644
@@ -141,4 +141,7 @@ properties:
               - hardkernel,odroid-n2
           - const: amlogic,g12b
 
+      - description: Boards with the Amlogic Meson SM1 S905X3 SoC
+        items:
+          - const: amlogic,sm1
 ...
Signature · 1 line
2.21.0
#23 lore raw

RFC 10/11 dt-bindings: arm: amlogic: add SEI Robotics SEI610 bindings

In reply to Neil Armstrong

Add the compatible for the Amlogic SM1 Based SEI610 board.

---
 Documentation/devicetree/bindings/arm/amlogic.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/arm/amlogic.yaml +2 -0
index 0b419fd0bac2..ebf707165d73 100644
@@ -143,5 +143,7 @@ properties:
 
       - description: Boards with the Amlogic Meson SM1 S905X3 SoC
         items:
+          - enum:
+              - seirobotics,sei610
           - const: amlogic,sm1
 ...
Signature · 1 line
2.21.0
#24 lore raw

RFC 11/11 arm64: dts: add support for SM1 based SEI Robotics SEI610

In reply to Neil Armstrong

Add support for the Amlogic SM1 Based SEI610 board.

The SM1 SoC is a derivative of the G12A SoC Family with :
- Cortex-A55 core instead of A53
- more power domains, including USB & PCIe
- a neural network co-processor (NNA)
- a CSI input and image processor
- some changes in the audio complex, thus not yet enabled

The SEI610 board is a derivative of the SEI510 board with :
- removed ADC based touch button, replaced with 3x GPIO buttons
- physical switch disabling on-board MICs
- USB-C port for USB 2.0 OTG
- On-board FTDI USB2SERIAL port for Linux console

---
 arch/arm64/boot/dts/amlogic/Makefile          |   1 +
 .../boot/dts/amlogic/meson-sm1-sei610.dts     | 329 ++++++++++++++++++
 arch/arm64/boot/dts/amlogic/meson-sm1.dtsi    |  77 ++++
 3 files changed, 407 insertions(+)
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
arch/arm64/boot/dts/amlogic/Makefile +1 -0
index 07b861fe5fa5..9a852802a4cc 100644
@@ -32,3 +32,4 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxm-q200.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxm-q201.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxm-rbox-pro.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxm-vega-s96.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-sm1-sei610.dtb
arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts new file +329 -0

329 lines not on this page · raw message

arch/arm64/boot/dts/amlogic/meson-sm1.dtsi new file +77 -0

77 lines not on this page · raw message

Signature · 1 line
2.21.0
#25 lore raw
In reply to Neil Armstrong

He Kevin, Martin,

Quoted 25 lines · Neil Armstrong

The new Amlogic SM1 SoC Family is a derivative of the Amlogic G12A SoC Family, with the following changes :
- Cortex-A55 cores instead of A53
- more power domains, including USB & PCIe
- a neural network co-processor (NNA)
- a CSI input and image processor
- some changes in the audio complex, thus not yet enabled
- new clocks, for NNA, CSI and a clock tree for each CPU Core

This serie does not add support for NNA, CSI or DVFS, it only aligns with the current G12A Support.

With thie serie, the SEI610 Board has supported :
- Default-boot CPU frequency
- 4k60 HDMI without audio
- USB3 & USB-C OTG
- Ethernet
- LEDs
- IR
- GPIO Buttons
- eMMC
- SDCard
- SDIO WiFi
- UART Bluetooth

Quoted 2 lines

Audio (HDMI, Embedded HP, MIcs), IR Output, & RGB Led would be supported in following patchsets.

Following the comments in the power domain patches, I'll respin in 2 distinct patches :
- initial support without USB, Display & power domain updated
- power domain support with USB & Display support

Neil

Quoted 40 lines

Dependencies:
- g12-common.dtsi from the DVFS patchset at [1]

[1] https://patchwork.kernel.org/cover/11025309/

Neil Armstrong (11):
soc: amlogic: meson-gx-socinfo: Add SM1 and S905X3 IDs
dt-bindings: power: amlogic, meson-gx-pwrc: Add SM1 bindings
soc: amlogic: gx-pwrc-vpu: add SM1 support
soc: amlogic: Add support for SM1 power controller
dt-bindings: soc: amlogic: clk-measure: Add SM1 compatible
soc: amlogic: clk-measure: Add support for SM1
dt-bindings: media: meson-ao-cec: add SM1 compatible
media: platform: meson-ao-cec-g12a: add support for SM1
dt-bindings: arm: amlogic: add SM1 bindings
dt-bindings: arm: amlogic: add SEI Robotics SEI610 bindings
arm64: dts: add support for SM1 based SEI Robotics SEI610

 .../devicetree/bindings/arm/amlogic.yaml      |   5 +
 .../bindings/media/meson-ao-cec.txt           |   8 +-
 .../bindings/power/amlogic,meson-gx-pwrc.txt  |  35 ++
 .../bindings/soc/amlogic/clk-measure.txt      |   1 +
 arch/arm64/boot/dts/amlogic/Makefile          |   1 +
 .../boot/dts/amlogic/meson-sm1-sei610.dts     | 329 ++++++++++++++++++
 arch/arm64/boot/dts/amlogic/meson-sm1.dtsi    |  77 ++++
 drivers/media/platform/meson/ao-cec-g12a.c    |  37 +-
 drivers/soc/amlogic/Kconfig                   |  11 +
 drivers/soc/amlogic/Makefile                  |   1 +
 drivers/soc/amlogic/meson-clk-measure.c       | 134 +++++++
 drivers/soc/amlogic/meson-gx-pwrc-vpu.c       | 120 +++++++
 drivers/soc/amlogic/meson-gx-socinfo.c        |   2 +
 drivers/soc/amlogic/meson-sm1-pwrc.c          | 245 +++++++++++++
 include/dt-bindings/power/meson-sm1-power.h   |  15 +
 15 files changed, 1017 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
 create mode 100644 drivers/soc/amlogic/meson-sm1-pwrc.c
 create mode 100644 include/dt-bindings/power/meson-sm1-power.h