soc: amlogic: Add Meson6/8/8b SoC Information driver
Subsystems (2)
Martin Blumenstingl
reviewercover soc: amlogic: Add Meson6/8/8b SoC Information driver
The 32-bit Amlogic SoC have some registers which contain some information the SoC's major and version, as well as a "major version".
This patchset adds support for this register decoding and exposing with the SoC bus infrastructure, with dt-bindings and DT node.
This is inspired by Neil's Meson GX socinfo driver, see [0]
All information was taken from Amlogic's 3.10 GPL kernel sources because the public S805 datasheet from Hardkernel does not contain any relevant information for these register blocks.
[0] http://lists.infradead.org/pipermail/linux-amlogic/2017-June/004187.html
Martin Blumenstingl (3):
dt-bindings: Amlogic: add documentation for the SoC info register
areas
soc: amlogic: Add Meson6/Meson8/Meson8b/Meson8m2 SoC Information
driver
ARM: dts: meson: add SoC information nodes
.../devicetree/bindings/arm/amlogic/analog-top.txt | 20 +++ .../devicetree/bindings/arm/amlogic/assist.txt | 17 ++ .../devicetree/bindings/arm/amlogic/bootrom.txt | 17 ++ arch/arm/boot/dts/meson.dtsi | 10 ++ arch/arm/boot/dts/meson8.dtsi | 5 + arch/arm/boot/dts/meson8b.dtsi | 5 + drivers/soc/amlogic/Kconfig | 10 ++ drivers/soc/amlogic/Makefile | 1 + drivers/soc/amlogic/meson-mx-socinfo.c | 175 +++++++++++++++++++++ 9 files changed, 260 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/amlogic/analog-top.txt create mode 100644 Documentation/devicetree/bindings/arm/amlogic/assist.txt create mode 100644 Documentation/devicetree/bindings/arm/amlogic/bootrom.txt create mode 100644 drivers/soc/amlogic/meson-mx-socinfo.c
Signature · 1 line
2.14.1
Martin Blumenstingl
reviewerPATCH 1/3 dt-bindings: Amlogic: add documentation for the SoC info register areas
There are three register areas which contain information about the SoC version and revision:
- the assist registers contain the SoC's "major version" which encodes the SoC generation and part number. this is available on Meson6, Meson8 and Meson8b SoCs.
- the bootrom register contains at least the SoCs "misc version". this is avilable on Meson6, Meson8 and Meson8b
- the analog top registers contain information about the SoC revision. this is only available on Meson8 and Meson8b
Not much else is currently known about these registers.
--- .../devicetree/bindings/arm/amlogic/analog-top.txt | 20 ++++++++++++++++++++ .../devicetree/bindings/arm/amlogic/assist.txt | 17 +++++++++++++++++ .../devicetree/bindings/arm/amlogic/bootrom.txt | 17 +++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/amlogic/analog-top.txt create mode 100644 Documentation/devicetree/bindings/arm/amlogic/assist.txt create mode 100644 Documentation/devicetree/bindings/arm/amlogic/bootrom.txt
Documentation/devicetree/bindings/arm/amlogic/analog-top.txt new file +20 -0
@@ -0,0 +1,20 @@ +Amlogic Meson8 and Meson8b "analog top" registers: +-------------------------------------------------- + +The analog top registers contain information about the so-called +"metal revision" (which encodes the "minor version") of the SoC. + +Required properties: +- reg: the register range of the analog top registers +- compatible: depending on the SoC this should be one of: + - "amlogic,meson8-analog-top" + - "amlogic,meson8b-analog-top" + along with "syscon" + + +Example: + + analog_top: analog-top at 81a8 { + compatible = "amlogic,meson8-analog-top", "syscon"; + reg = <0x81a8 0x14>; + };
Documentation/devicetree/bindings/arm/amlogic/assist.txt new file +17 -0
@@ -0,0 +1,17 @@ +Amlogic Meson6/Meson8/Meson8b assist registers: +----------------------------------------------- + +The assist registers contain basic information about the SoC, +for example the encoded SoC part number. + +Required properties: +- reg: the register range of the assist registers +- compatible: should be "amlogic,meson-mx-assist" along with "syscon" + + +Example: + + assist: assist at 7c00 { + compatible = "amlogic,meson-mx-assist", "syscon"; + reg = <0x7c00 0x200>; + };
Documentation/devicetree/bindings/arm/amlogic/bootrom.txt new file +17 -0
@@ -0,0 +1,17 @@ +Amlogic Meson6/Meson8/Meson8b bootrom: +-------------------------------------- + +The bootrom register area can be used to access SoC specific +information, such as the "misc version". + +Required properties: +- reg: the register range of the bootrom registers +- compatible: should be "amlogic,meson-mx-bootrom" along with "syscon" + + +Example: + + bootrom: bootrom at d9040000 { + compatible = "amlogic,meson-mx-bootrom", "syscon"; + reg = <0xd9040000 0x10000>; + };
Signature · 1 line
2.14.1
Rob Herring
maintainerPATCH 1/3 dt-bindings: Amlogic: add documentation for the SoC info register areas
Quoted 13 lines · Martin Blumenstingl
There are three register areas which contain information about the SoC version and revision:
- the assist registers contain the SoC's "major version" which encodes the SoC generation and part number. this is available on Meson6, Meson8 and Meson8b SoCs.
- the bootrom register contains at least the SoCs "misc version". this is avilable on Meson6, Meson8 and Meson8b
- the analog top registers contain information about the SoC revision. this is only available on Meson8 and Meson8bNot much else is currently known about these registers.
Signed-off-by Martin Blumenstingl <[email protected]>
Quoted 8 lines
--- .../devicetree/bindings/arm/amlogic/analog-top.txt | 20 ++++++++++++++++++++ .../devicetree/bindings/arm/amlogic/assist.txt | 17 +++++++++++++++++ .../devicetree/bindings/arm/amlogic/bootrom.txt | 17 +++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/amlogic/analog-top.txt create mode 100644 Documentation/devicetree/bindings/arm/amlogic/assist.txt create mode 100644 Documentation/devicetree/bindings/arm/amlogic/bootrom.txt
Martin Blumenstingl
reviewerPATCH 2/3 soc: amlogic: Add Meson6/Meson8/Meson8b/Meson8m2 SoC Information driver
In reply to Martin BlumenstinglAmlogic SoCs have an information register which contains the SoC type and revision information.
This patchs adds support for decoding those registers and exposing the resulting information via the SoC bus infrastructure.
--- drivers/soc/amlogic/Kconfig | 10 ++ drivers/soc/amlogic/Makefile | 1 + drivers/soc/amlogic/meson-mx-socinfo.c | 175 +++++++++++++++++++++++++++++++++ 3 files changed, 186 insertions(+) create mode 100644 drivers/soc/amlogic/meson-mx-socinfo.c
drivers/soc/amlogic/Kconfig +10 -0
@@ -9,4 +9,14 @@ config MESON_GX_SOCINFO Say yes to support decoding of Amlogic Meson GX SoC family information about the type, package and version. +config MESON_MX_SOCINFO + bool "Amlogic Meson MX SoC Information driver" + depends on ARCH_MESON || COMPILE_TEST + default ARCH_MESON + select SOC_BUS + help + Say yes to support decoding of Amlogic Meson6, Meson8, + Meson8b and Meson8m2 SoC family information about the type + and version. + endmenu
drivers/soc/amlogic/Makefile +1 -0
@@ -1 +1,2 @@ obj-$(CONFIG_MESON_GX_SOCINFO) += meson-gx-socinfo.o +obj-$(CONFIG_MESON_MX_SOCINFO) += meson-mx-socinfo.o
drivers/soc/amlogic/meson-mx-socinfo.c new file +175 -0
175 lines not on this page · raw message
Signature · 1 line
2.14.1
Martin Blumenstingl
reviewerPATCH 3/3 ARM: dts: meson: add SoC information nodes
In reply to Martin BlumenstinglThe SoC type and version information is encoded in different register blocks.
The SoC type information is part of the "assist" registers. The misc version information is part of the "bootrom" registers. On Meson8, Meson8b and Meson8m2 there is additionally information about the minor version. This information is stored in the "analog top" registers.
Add the nodes for these register blocks so we can decode the SoC type and version information.
--- arch/arm/boot/dts/meson.dtsi | 10 ++++++++++ arch/arm/boot/dts/meson8.dtsi | 5 +++++ arch/arm/boot/dts/meson8b.dtsi | 5 +++++ 3 files changed, 20 insertions(+)
arch/arm/boot/dts/meson.dtsi +10 -0
@@ -80,6 +80,11 @@ #size-cells = <1>; ranges = <0x0 0xc1100000 0x200000>; + assist: assist at 7c00 { + compatible = "amlogic,meson-mx-assist", "syscon"; + reg = <0x7c00 0x200>; + }; + hwrng: rng at 8100 { compatible = "amlogic,meson-rng"; reg = <0x8100 0x8>;
@@ -261,5 +266,10 @@ #size-cells = <1>; ranges = <0 0xd9000000 0x20000>; }; + + bootrom: bootrom at d9040000 { + compatible = "amlogic,meson-mx-bootrom", "syscon"; + reg = <0xd9040000 0x10000>; + }; }; }; /* end of / */
arch/arm/boot/dts/meson8.dtsi +5 -0
@@ -271,6 +271,11 @@ reg = <0x8000 0x4>, <0x4000 0x460>; }; + analog_top: analog-top at 81a8 { + compatible = "amlogic,meson8-analog-top", "syscon"; + reg = <0x81a8 0x14>; + }; + pwm_ef: pwm at 86c0 { compatible = "amlogic,meson8-pwm", "amlogic,meson8b-pwm"; reg = <0x86c0 0x10>;
arch/arm/boot/dts/meson8b.dtsi +5 -0
@@ -223,6 +223,11 @@ #reset-cells = <1>; }; + analog_top: analog-top at 81a8 { + compatible = "amlogic,meson8b-analog-top", "syscon"; + reg = <0x81a8 0x14>; + }; + pwm_ef: pwm at 86c0 { compatible = "amlogic,meson8b-pwm"; reg = <0x86c0 0x10>;
Signature · 1 line
2.14.1
cover soc: amlogic: Add Meson6/8/8b SoC Information driver
In reply to Martin BlumenstinglQuoted 12 lines · Martin Blumenstingl
The 32-bit Amlogic SoC have some registers which contain some information the SoC's major and version, as well as a "major version".
This patchset adds support for this register decoding and exposing with the SoC bus infrastructure, with dt-bindings and DT node.This is inspired by Neil's Meson GX socinfo driver, see [0]
All information was taken from Amlogic's 3.10 GPL kernel sources because the public S805 datasheet from Hardkernel does not contain any relevant information for these register blocks.
Quoted 5 lines
[0] http://lists.infradead.org/pipermail/linux-amlogic/2017-June/004187.html
Martin Blumenstingl (3):
dt-bindings: Amlogic: add documentation for the SoC info register
areas
Applied to v4.15/dt
Quoted 2 lines
soc: amlogic: Add Meson6/Meson8/Meson8b/Meson8m2 SoC Information
driver
Applied to v4.15/drivers
Quoted 1 line
ARM: dts: meson: add SoC information nodes
Applied to v4.15/dt
Thanks,
Kevin