Skip to contentSkip to conversation

arm64: Allwinner A64 support

PATCH Applied Andre Przywara 5 participants 16 messages Aug 8, 2016 – Aug 24, 2016

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

v4 cover arm64: Allwinner A64 support

This is a new attempt on proper upstream Allwinner A64 support. It builds on the bits that have already been merged (arm64 architecture support and the pinctrl driver), and mostly completes it with some DT files.

I chose a new approach on the clock system:
- For the basic PLL clocks we go with fixed-clocks now, as Allwinner recommends fixed frequencies for those anyway. I am not sure whether we should express the dependencies between those clocks as fixed-factor clocks or not.
- The clock gates are left as in the previous post, so using a flexible, DT driver based on the existing simple-gates.c. There are ways to get away without it, but those approaches are more hideous and I still consider this approach pretty clean.
- Any other clock is expected to be handled by firmware using the SCPI protocol (which ARM's Juno board uses as well). While this is not the most flexible and all-encompassing interface, it fits the bill for our clocks for now and enjoys upstream support on the Linux side already, so there are no patches needed on this front.
I will send RFC patches demonstrating this just after this series.

This series focusses on the basic peripherals. The MMC support, which was part of former revisions of this series, is dropped for now as the current driver lacks some bits to properly support the enhanced A64 MMC controller, which becomes evident when trying to use it on an eMMC device. There are patches floating around to tackle this, but this workd shouldn't delay upstreaming the basic bits first.

This series has been tested (with an initrd) on the Pine64 and BananaPi M64 boards.

As Maxime's latest post uses a completely different clock system, I wanted to put this forward as a simpler and more sustainable approach to tackle the tricky Allwinner CCU subsystem. I am happy to collaborate and to find the right way (TM) to support this (and future!) SoCs.

Any comments are welcome!

Cheers,
Andre.

Changelog v3..v4:
- add proper Kconfig bits to build the pinctrl driver
- adapt Maxime's approach of avoiding pine64-common.dtsi
- add PMU DT node
- use fixed-clocks for basic PLL clocks
- use clock names based on manual (periph0 & friends)
- move clocks out of their own subnode into a separate file
- add .dts for BananaPi-M64 (thanks to Nora Lee for a sample board)

Andre Przywara (7):
arm64: sunxi: Kconfig: add essential pinctrl driver
DT: clk: sunxi: add binding doc for the multi-bus-gates clock
clk: sunxi: add generic multi-parent bus clock gates driver
of: add vendor prefix for Pine64
arm64: dts: add Allwinner A64 SoC .dtsi
arm64: dts: add Pine64 support
arm64: dts: add BananaPi M64 support

 Documentation/devicetree/bindings/arm/sunxi.txt    |   1 +
 Documentation/devicetree/bindings/clock/sunxi.txt  |   7 +
 .../devicetree/bindings/vendor-prefixes.txt        |   1 +
 arch/arm64/Kconfig.platforms                       |   2 +
 arch/arm64/boot/dts/Makefile                       |   1 +
 arch/arm64/boot/dts/allwinner/Makefile             |   6 +
 .../boot/dts/allwinner/sun50i-a64-bananapi-m64.dts |  74 ++++
 .../boot/dts/allwinner/sun50i-a64-clocks.dtsi      | 140 ++++++++
 .../boot/dts/allwinner/sun50i-a64-pine64-plus.dts  |  48 +++
 .../arm64/boot/dts/allwinner/sun50i-a64-pine64.dts |  74 ++++
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi      | 398 +++++++++++++++++++++
 drivers/clk/sunxi/Makefile                         |   1 +
 drivers/clk/sunxi/clk-multi-gates.c                | 105 ++++++
 13 files changed, 858 insertions(+)
 create mode 100644 arch/arm64/boot/dts/allwinner/Makefile
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-clocks.dtsi
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
 create mode 100644 drivers/clk/sunxi/clk-multi-gates.c
Signature · 1 line
2.9.0
#1 lore raw

PATCH v4 1/7 arm64: sunxi: Kconfig: add essential pinctrl driver

The pinctrl driver is essential for the Allwinner SoCs to work. Add the driver's config symbol to the Kconfig entry to always compile it in. We can't use the arm approach to make the _driver's_ Kconfig symbol def_bool, because we lack the MACH_* symbols in arm64. That line was in the original pinctrl driver patch, but got removed to avoid the dependency on the Kconfig patch [1].
Also add the general PINCTRL symbol, which isn't selected automatically for the same reason.

[1]: http://lists.infradead.org/pipermail/linux-arm-kernel/2016-March/414086.html

---
 arch/arm64/Kconfig.platforms | 2 ++
 1 file changed, 2 insertions(+)
arch/arm64/Kconfig.platforms +2 -0
index bb2616b..e3dc1a4 100644
@@ -3,6 +3,8 @@ menu "Platform selection"
 config ARCH_SUNXI
 	bool "Allwinner sunxi 64-bit SoC Family"
 	select GENERIC_IRQ_CHIP
+	select PINCTRL
+	select PINCTRL_SUN50I_A64
 	help
 	  This enables support for Allwinner sunxi based SoCs like the A64.
 
Signature · 1 line
2.9.0
#2 lore raw

Re: [PATCH v4 1/7] arm64: sunxi: Kconfig: add essential pinctrl driver

Quoted 9 lines · Andre Przywara

The pinctrl driver is essential for the Allwinner SoCs to work. Add the driver's config symbol to the Kconfig entry to always compile it in. We can't use the arm approach to make the _driver's_ Kconfig symbol def_bool, because we lack the MACH_* symbols in arm64. That line was in the original pinctrl driver patch, but got removed to avoid the dependency on the Kconfig patch [1].
Also add the general PINCTRL symbol, which isn't selected automatically for the same reason.

Quoted 4 lines

[1]: http://lists.infradead.org/pipermail/linux-arm-kernel/2016-March/414086.html

Applied, thanks

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160823/509e835d/attachment.sig>
#3 lore raw

PATCH v4 2/7 DT: clk: sunxi: add binding doc for the multi-bus-gates clock

In reply to Andre Przywara

Recent Allwinner SoCs introduced a bus gates clock which can have different parents for individual gates, even within a single register. For the time being we encoded this relation in the driver. This commit specifies a new binding which allows to encode this in the DT by using a child node for each parent clock used. This allows to specify any kind of relation efficiently and also keeps the very same kernel driver for all SoCs at the same time.

---
 Documentation/devicetree/bindings/clock/sunxi.txt | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/clock/sunxi.txt +7 -0
index 8f7619d..7d4197e 100644
@@ -87,6 +87,8 @@ Required properties:
 	"allwinner,sun9i-a80-usb-phy-clk" - for usb phy gates + resets on A80
 	"allwinner,sun4i-a10-ve-clk" - for the Video Engine clock
 	"allwinner,sun6i-a31-display-clk" - for the display clocks
+	"allwinner,sunxi-multi-bus-gates-clk" - for the multi-parent bus gates
+	"allwinner,sun50i-a64-bus-gates-clk" - for the bus gates on A64
 
 Required properties for all clocks:
 - reg : shall be the control register address for the clock.
@@ -127,6 +129,11 @@ For "allwinner,sun6i-a31-pll6-clk", there are 2 outputs. The first output
 is the normal PLL6 output, or "pll6". The second output is rate doubled
 PLL6, or "pll6x2".
 
+The "allwinner,sunxi-multi-bus-gates-clk" holds the actual clocks in
+child nodes, where each one specifies the parent clock that the particular
+gates are depending from. The child nodes each follow the common clock
+binding as described in this document.
+
 The "allwinner,*-mmc-clk" clocks have three different outputs: the
 main clock, with the ID 0, and the output and sample clocks, with the
 IDs 1 and 2, respectively.
Signature · 1 line
2.9.0
#4 lore raw

PATCH v4 3/7 clk: sunxi: add generic multi-parent bus clock gates driver

In reply to Andre Przywara

The Allwinner H3 SoC introduced bus clock gates with potentially different parents per clock gate register. The H3 driver chose to hardcode the actual parent clock relation in the code.
Add a new driver (which has the potential to drive the H3 and also the simple clock gates as well) which uses the power of DT to describe this relationship in an elegant and flexible way.
Using one subnode for every parent clock we get away with a single DT compatible match, which can be used as a fallback value in the actual DTs without the need to add specific compatible strings to the code. This avoids adding a new driver or function for every new SoC.

---
 drivers/clk/sunxi/Makefile          |   1 +
 drivers/clk/sunxi/clk-multi-gates.c | 105 ++++++++++++++++++++++++++++++++++++
 2 files changed, 106 insertions(+)
 create mode 100644 drivers/clk/sunxi/clk-multi-gates.c
drivers/clk/sunxi/Makefile +1 -0
index 39d2044..caf2bf6 100644
@@ -14,6 +14,7 @@ obj-y += clk-simple-gates.o
 obj-y += clk-sun4i-display.o
 obj-y += clk-sun4i-pll3.o
 obj-y += clk-sun4i-tcon-ch1.o
+obj-y += clk-multi-gates.o
 obj-y += clk-sun8i-bus-gates.o
 obj-y += clk-sun8i-mbus.o
 obj-y += clk-sun9i-core.o
drivers/clk/sunxi/clk-multi-gates.c new file +105 -0

105 lines not on this page · raw message

Signature · 1 line
2.9.0
#5 lore raw

Re: [PATCH v4 3/7] clk: sunxi: add generic multi-parent bus clock gates driver

Quoted 10 lines · On Mon, 8 Aug 2016 18:21:45 +0100 Andre Przywara <[email protected]>…

The Allwinner H3 SoC introduced bus clock gates with potentially different parents per clock gate register. The H3 driver chose to hardcode the actual parent clock relation in the code.
Add a new driver (which has the potential to drive the H3 and also the simple clock gates as well) which uses the power of DT to describe this relationship in an elegant and flexible way.
Using one subnode for every parent clock we get away with a single DT compatible match, which can be used as a fallback value in the actual DTs without the need to add specific compatible strings to the code. This avoids adding a new driver or function for every new SoC.

The 'parent's of the bus gates are of no interest.
They are supposed to be (no clear documentation) apb1, apb2, ahb1 and ahb2, but, as you well noticed in the patch 5/7, these clocks are fixed and have no gate. Some of them are parents of real clocks, but they don't bring anything to the bus gates of the other clocks.

As I wrote previously, the simplest is to ungate/gate the clocks in both the bus and clock registers on clk_prepare/unprepare. Then, your 'multi-bus-gates' would be simply a generic 'multi-gates'.

Signature · 2 lines
Ken ar c'henta?	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/
#6 lore raw

Re: [linux-sunxi] Re: [PATCH v4 3/7] clk: sunxi: add generic multi-parent bus clock gates driver

Quoted 14 lines · Jean-Francois Moine
Quoted 10 lines · On Mon, 8 Aug 2016 18:21:45 +0100 Andre Przywara <[email protected]>…

The Allwinner H3 SoC introduced bus clock gates with potentially different parents per clock gate register. The H3 driver chose to hardcode the actual parent clock relation in the code.
Add a new driver (which has the potential to drive the H3 and also the simple clock gates as well) which uses the power of DT to describe this relationship in an elegant and flexible way.
Using one subnode for every parent clock we get away with a single DT compatible match, which can be used as a fallback value in the actual DTs without the need to add specific compatible strings to the code. This avoids adding a new driver or function for every new SoC.

Quoted 5 lines

The 'parent's of the bus gates are of no interest.
They are supposed to be (no clear documentation) apb1, apb2, ahb1 and ahb2, but, as you well noticed in the patch 5/7, these clocks are fixed and have no gate. Some of them are parents of real clocks, but they don't bring anything to the bus gates of the other clocks.

Yes they are. Some devices, such as UARTs and I2C controllers, need to get the clock rate of the gate and calculate the proper internal divider.

Quoted 3 lines

As I wrote previously, the simplest is to ungate/gate the clocks in both the bus and clock registers on clk_prepare/unprepare. Then, your 'multi-bus-gates' would be simply a generic 'multi-gates'.

This is somewhat misleading. What "clock" registers are you referring to? There are no "bus" registers. The reason we call them "bus clock gates" is because they are mashed together, instead of having clearly separated registers for each AHB/APB bus.

And if you want just a generic clock gates driver, we already have the "simple-gates" driver.

Regards
ChenYu

#7 lore raw

Re: [linux-sunxi] Re: [PATCH v4 3/7] clk: sunxi: add generic multi-parent bus clock gates driver

Quoted 9 lines · On Tue, 9 Aug 2016 18:02:47 +0800 Chen-Yu Tsai <[email protected]> wrote:
Quoted 5 lines

The 'parent's of the bus gates are of no interest.
They are supposed to be (no clear documentation) apb1, apb2, ahb1 and ahb2, but, as you well noticed in the patch 5/7, these clocks are fixed and have no gate. Some of them are parents of real clocks, but they don't bring anything to the bus gates of the other clocks.

Yes they are. Some devices, such as UARTs and I2C controllers, need to get the clock rate of the gate and calculate the proper internal divider.

You are right, the clocks of some subsystems have only a gate, but these are exceptions.

Look at an ordinary clock, say the mmc0 of the H3.
There is a "bus" gate (see below) in the CCU register 0x60, bit 8, and the "clock" gate in the CCU register 0x88, bit 31.

The 'simple-gates' says that the "bus gate" is child of ahb1 (in all sunxi versions, the one prior to 'simple-gate', in the 'simple-gate', in 'sunxi-ng', and now in Andr?'s patch).

But, where do you see a hardware relation between the mmc0 clock and the ahb1 clock?

Quoted 11 lines
Quoted 3 lines

As I wrote previously, the simplest is to ungate/gate the clocks in both the bus and clock registers on clk_prepare/unprepare. Then, your 'multi-bus-gates' would be simply a generic 'multi-gates'.

This is somewhat misleading. What "clock" registers are you referring to? There are no "bus" registers. The reason we call them "bus clock gates" is because they are mashed together, instead of having clearly separated registers for each AHB/APB bus.

And if you want just a generic clock gates driver, we already have the "simple-gates" driver.

Maybe I used the wrong words.

The "clock" register is the one which defines the parameters of the clock (parents, mul/div factors, gate). For the H3 mmc0, it is the CCU register 0x60.

The "bus" register is one of the so-called "Bus Clock Gating Register"s. For the H3 mmc0, it is the CCU register 0x88.

Signature · 2 lines
Ken ar c'henta?	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/
#8 lore raw

Re: [PATCH v4 3/7] clk: sunxi: add generic multi-parent bus clock gates driver

In reply to Andre Przywara
Quoted 11 lines · Andre Przywara

The Allwinner H3 SoC introduced bus clock gates with potentially different parents per clock gate register. The H3 driver chose to hardcode the actual parent clock relation in the code.
Add a new driver (which has the potential to drive the H3 and also the simple clock gates as well) which uses the power of DT to describe this relationship in an elegant and flexible way.
Using one subnode for every parent clock we get away with a single DT compatible match, which can be used as a fallback value in the actual DTs without the need to add specific compatible strings to the code. This avoids adding a new driver or function for every new SoC.

Quoted 5 lines
---
 drivers/clk/sunxi/Makefile          |   1 +
 drivers/clk/sunxi/clk-multi-gates.c | 105 ++++++++++++++++++++++++++++++++++++

Aside from my initial objections (that I still have), drivers/clk/sunxi is in maintainance-only mode, we won't merge any new drivers there.

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160823/16609d16/attachment.sig>
#9 lore raw

PATCH v4 4/7 of: add vendor prefix for Pine64

In reply to Andre Przywara
---
 Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
index 1992aa9..492f92c 100644
@@ -199,6 +199,7 @@ parade	Parade Technologies Inc.
 pericom	Pericom Technology Inc.
 phytec	PHYTEC Messtechnik GmbH
 picochip	Picochip Ltd
+pine64	Pine64
 plathome	Plat'Home Co., Ltd.
 plda	PLDA
 pixcir  PIXCIR MICROELECTRONICS Co., Ltd
Signature · 1 line
2.9.0
#10 lore raw

PATCH v4 5/7 arm64: dts: add Allwinner A64 SoC .dtsi

In reply to Andre Przywara

The Allwinner A64 SoC is a low-cost chip with 4 ARM Cortex-A53 cores and the typical tablet / TV box peripherals.
The SoC is based on the (32-bit) Allwinner H3 chip, sharing most of the peripherals and the memory map.
Although the cores are proper 64-bit ones, the whole SoC is actually limited to 4GB (including all the supported DRAM), so we use 32-bit address and size cells. This has the nice feature of us being able to reuse the DT for 32-bit kernels as well.
This .dtsi lists the hardware that we support so far.

---
Hi,

I dropped Rob's previous ACK, as there were quite some changes.

Cheers,
Andre.

 Documentation/devicetree/bindings/arm/sunxi.txt    |   1 +
 .../boot/dts/allwinner/sun50i-a64-clocks.dtsi      | 140 ++++++++
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi      | 398 +++++++++++++++++++++
 3 files changed, 539 insertions(+)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-clocks.dtsi
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
Documentation/devicetree/bindings/arm/sunxi.txt +1 -0
index 7e79fcc..7e59d8b 100644
@@ -14,3 +14,4 @@ using one of the following compatible strings:
   allwinner,sun8i-a83t
   allwinner,sun8i-h3
   allwinner,sun9i-a80
+  allwinner,sun50i-a64
arch/arm64/boot/dts/allwinner/sun50i-a64-clocks.dtsi new file +140 -0

140 lines not on this page · raw message

arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi new file +398 -0

398 lines not on this page · raw message

Signature · 1 line
2.9.0
maintainer
#11 lore raw

Re: [PATCH v4 5/7] arm64: dts: add Allwinner A64 SoC .dtsi

Quoted 41 lines · Andre Przywara

The Allwinner A64 SoC is a low-cost chip with 4 ARM Cortex-A53 cores and the typical tablet / TV box peripherals.
The SoC is based on the (32-bit) Allwinner H3 chip, sharing most of the peripherals and the memory map.
Although the cores are proper 64-bit ones, the whole SoC is actually limited to 4GB (including all the supported DRAM), so we use 32-bit address and size cells. This has the nice feature of us being able to reuse the DT for 32-bit kernels as well.
This .dtsi lists the hardware that we support so far.

---
Hi,

I dropped Rob's previous ACK, as there were quite some changes.

Cheers,
Andre.

 Documentation/devicetree/bindings/arm/sunxi.txt    |   1 +
 .../boot/dts/allwinner/sun50i-a64-clocks.dtsi      | 140 ++++++++
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi      | 398 +++++++++++++++++++++
 3 files changed, 539 insertions(+)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-clocks.dtsi
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
Documentation/devicetree/bindings/arm/sunxi.txt +1 -0
index 7e79fcc..7e59d8b 100644
@@ -14,3 +14,4 @@ using one of the following compatible strings:
   allwinner,sun8i-a83t
   allwinner,sun8i-h3
   allwinner,sun9i-a80
+  allwinner,sun50i-a64
arch/arm64/boot/dts/allwinner/sun50i-a64-clocks.dtsi new file +0 -0
new file mode 100644
index 0000000..9bfcd41

arch/arm64/boot/dts/allwinner/sun50i-a64-clocks.dtsi line 10

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-clocks.dtsi new file +10 -0
@@ -0,0 +1,140 @@
+/*
+ * Allwinner A64 clocks
+ *
+ * Copyright (c) 2016 ARM Ltd
+ *
+ * This file is licensed under a dual GPLv2 or BSD license.
+ *
+ */
+
+	osc24M: osc24M_clk {

Drop the '_' in the node names here and throughout.

Rob

#12 lore raw

Re: [PATCH v4 5/7] arm64: dts: add Allwinner A64 SoC .dtsi

In reply to Andre Przywara

Hi,

arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 96

Quoted 11 lines · Andre Przywara
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi new file +11 -0
+	pmu {
+			compatible = "arm,cortex-a53-pmu", "arm,armv8-pmuv3";
+			interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-affinity = <&cpu0>,
+					     <&cpu1>,
+					     <&cpu2>,
+					     <&cpu3>;
+	};

The indentation looks off.

Quoted 177 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi new file +177 -0
+
+	psci {
+		compatible = "arm,psci-0.2";
+		method = "smc";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x40000000 0>;
+	};
+
+	gic: interrupt-controller at 1c81000 {
+		compatible = "arm,gic-400";
+		interrupt-controller;
+		#interrupt-cells = <3>;
+		#address-cells = <0>;
+
+		reg = <0x01c81000 0x1000>,
+		      <0x01c82000 0x2000>,
+		      <0x01c84000 0x2000>,
+		      <0x01c86000 0x2000>;
+		interrupts = <GIC_PPI 9
+		      (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
+	};
+
+	timer {
+		compatible = "arm,armv8-timer";
+		interrupts = <GIC_PPI 13
+			(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>,
+			     <GIC_PPI 14
+			(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>,
+			     <GIC_PPI 11
+			(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>,
+			     <GIC_PPI 10
+			(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
+	};
+
+	/include/ "sun50i-a64-clocks.dtsi"
+
+	soc {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		pio: pinctrl at 1c20800 {
+			compatible = "allwinner,sun50i-a64-pinctrl";
+			reg = <0x01c20800 0x400>;
+			interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&bus_gates 69>;
+			gpio-controller;
+			#gpio-cells = <3>;
+			interrupt-controller;
+			#interrupt-cells = <2>;
+
+			uart0_pins_a: uart0 at 0 {
+				allwinner,pins = "PB8", "PB9";
+				allwinner,function = "uart0";
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
+
+			uart0_pins_b: uart0 at 1 {
+				allwinner,pins = "PF2", "PF3";
+				allwinner,function = "uart0";
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
+
+			uart1_2pins: uart1_2 at 0 {
+				allwinner,pins = "PG6", "PG7";
+				allwinner,function = "uart1";
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
+
+			uart1_4pins: uart1_4 at 0 {
+				allwinner,pins = "PG6", "PG7", "PG8", "PG9";
+				allwinner,function = "uart1";
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
+
+			uart2_2pins: uart2_2 at 0 {
+				allwinner,pins = "PB0", "PB1";
+				allwinner,function = "uart2";
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
+
+			uart2_4pins: uart2_4 at 0 {
+				allwinner,pins = "PB0", "PB1", "PB2", "PB3";
+				allwinner,function = "uart2";
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
+
+			uart3_pins_a: uart3 at 0 {
+				allwinner,pins = "PD0", "PD1";
+				allwinner,function = "uart3";
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
+
+			uart3_2pins_b: uart3_2 at 1 {
+				allwinner,pins = "PH4", "PH5";
+				allwinner,function = "uart3";
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
+
+			uart3_4pins_b: uart3_4 at 1 {
+				allwinner,pins = "PH4", "PH5", "PH6", "PH7";
+				allwinner,function = "uart3";
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
+
+			uart4_2pins: uart4_2 at 0 {
+				allwinner,pins = "PD2", "PD3";
+				allwinner,function = "uart4";
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
+
+			uart4_4pins: uart4_4 at 0 {
+				allwinner,pins = "PD2", "PD3", "PD4", "PD5";
+				allwinner,function = "uart4";
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
+
+			mmc0_pins: mmc0 at 0 {
+				allwinner,pins = "PF0", "PF1", "PF2", "PF3",
+						 "PF4", "PF5";
+				allwinner,function = "mmc0";
+				allwinner,drive = <SUN4I_PINCTRL_30_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
+
+			mmc0_default_cd_pin: mmc0_cd_pin at 0 {
+				allwinner,pins = "PF6";
+				allwinner,function = "gpio_in";
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+			};
+
+			mmc1_pins: mmc1 at 0 {
+				allwinner,pins = "PG0", "PG1", "PG2", "PG3",
+						 "PG4", "PG5";
+				allwinner,function = "mmc1";
+				allwinner,drive = <SUN4I_PINCTRL_30_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
+
+			mmc2_pins: mmc2 at 0 {
+				allwinner,pins = "PC1", "PC5", "PC6", "PC8",
+						 "PC9", "PC10", "PC11", "PC12",
+						 "PC13", "PC14", "PC15", "PC16";
+				allwinner,function = "mmc2";
+				allwinner,drive = <SUN4I_PINCTRL_30_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
+
+			i2c0_pins: i2c0_pins {
+				allwinner,pins = "PH0", "PH1";
+				allwinner,function = "i2c0";
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
+
+			i2c1_pins: i2c1_pins {
+				allwinner,pins = "PH2", "PH3";
+				allwinner,function = "i2c1";
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;

arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 283

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi new file +10 -0
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
+
+			i2c2_pins: i2c2_pins {
+				allwinner,pins = "PE14", "PE15";
+				allwinner,function = "i2c2";
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
+		};

Our policy is that we only add the pinctrl nodes that we actually use in boards to avoid bloating the DT with unused nodes.

Thanks,
Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160823/216b15bb/attachment.sig>
#13 lore raw

PATCH v4 6/7 arm64: dts: add Pine64 support

In reply to Andre Przywara

The Pine64 is a cost-efficient development board based on the Allwinner A64 SoC.
There are three models: the basic version with Fast Ethernet and 512 MB of DRAM (Pine64) and two Pine64+ versions, which both feature Gigabit Ethernet and additional connectors for touchscreens and a camera. Or as my son put it: "Those are smaller and these are missing." ;-)
The two Pine64+ models just differ in the amount of DRAM (1GB vs. 2GB). Since U-Boot will figure out the right size for us and patches the DT accordingly we just need to provide one DT for the Pine64+.

[Maxime: Removed the common DTSI and include directly the pine64 DTS]
---
 arch/arm64/boot/dts/Makefile                       |  1 +
 arch/arm64/boot/dts/allwinner/Makefile             |  5 ++
 .../boot/dts/allwinner/sun50i-a64-pine64-plus.dts  | 48 ++++++++++++++
 .../arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 74 ++++++++++++++++++++++
 4 files changed, 128 insertions(+)
 create mode 100644 arch/arm64/boot/dts/allwinner/Makefile
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
arch/arm64/boot/dts/Makefile +1 -0
index 6e199c9..ddcbf5a 100644
@@ -1,4 +1,5 @@
 dts-dirs += al
+dts-dirs += allwinner
 dts-dirs += altera
 dts-dirs += amd
 dts-dirs += amlogic
arch/arm64/boot/dts/allwinner/Makefile new file +5 -0
new file mode 100644
index 0000000..1e29a5a
@@ -0,0 +1,5 @@
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb
+
+always		:= $(dtb-y)
+subdir-y	:= $(dts-dirs)
+clean-files	:= *.dtb
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts new file +48 -0

48 lines not on this page · raw message

arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts new file +74 -0

74 lines not on this page · raw message

Signature · 1 line
2.9.0
#14 lore raw

Re: [PATCH v4 6/7] arm64: dts: add Pine64 support

Hi,

Quoted 152 lines · Andre Przywara

The Pine64 is a cost-efficient development board based on the Allwinner A64 SoC.
There are three models: the basic version with Fast Ethernet and 512 MB of DRAM (Pine64) and two Pine64+ versions, which both feature Gigabit Ethernet and additional connectors for touchscreens and a camera. Or as my son put it: "Those are smaller and these are missing." ;-)
The two Pine64+ models just differ in the amount of DRAM (1GB vs. 2GB). Since U-Boot will figure out the right size for us and patches the DT accordingly we just need to provide one DT for the Pine64+.

[Maxime: Removed the common DTSI and include directly the pine64 DTS]
---
 arch/arm64/boot/dts/Makefile                       |  1 +
 arch/arm64/boot/dts/allwinner/Makefile             |  5 ++
 .../boot/dts/allwinner/sun50i-a64-pine64-plus.dts  | 48 ++++++++++++++
 .../arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 74 ++++++++++++++++++++++
 4 files changed, 128 insertions(+)
 create mode 100644 arch/arm64/boot/dts/allwinner/Makefile
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
arch/arm64/boot/dts/Makefile +1 -0
index 6e199c9..ddcbf5a 100644
@@ -1,4 +1,5 @@
 dts-dirs += al
+dts-dirs += allwinner
 dts-dirs += altera
 dts-dirs += amd
 dts-dirs += amlogic
arch/arm64/boot/dts/allwinner/Makefile new file +5 -0
new file mode 100644
index 0000000..1e29a5a
@@ -0,0 +1,5 @@
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb
+
+always		:= $(dtb-y)
+subdir-y	:= $(dts-dirs)
+clean-files	:= *.dtb
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts new file +48 -0
new file mode 100644
index 0000000..e369e83
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2016 ARM Ltd.
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This library is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This library is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "sun50i-a64-pine64.dts"
+
+/ {
+	model = "Pine64+";
+	compatible = "pine64,pine64-plus", "allwinner,sun50i-a64";
+};
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts new file +47 -0
new file mode 100644
index 0000000..077a56f
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2016 ARM Ltd.
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This library is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This library is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+
+#include "sun50i-a64.dtsi"
+
+/ {

arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts line 57

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts new file +10 -0
+	model = "Pine64";
+	compatible = "pine64,pine64", "allwinner,sun50i-a64";
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	memory {
+		reg = <0x40000000 0x20000000>;
+	};

Isn't that wrong on some Pine64, and filled by U-Boot anyway?

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160824/e07be3b7/attachment.sig>
#15 lore raw

PATCH v4 7/7 arm64: dts: add BananaPi M64 support

In reply to Andre Przywara

The BananaPi M64 is a single board computer with an Allwinner A64 SoC. In addition to the usual suspects it contains Gigabit Ethernet, 2GB RAM, an eMMC and a WiFi chip (which are not yet supported by this patch).

---
 arch/arm64/boot/dts/allwinner/Makefile             |  1 +
 .../boot/dts/allwinner/sun50i-a64-bananapi-m64.dts | 74 ++++++++++++++++++++++
 2 files changed, 75 insertions(+)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
arch/arm64/boot/dts/allwinner/Makefile +1 -0
index 1e29a5a..51ecb04 100644
@@ -1,4 +1,5 @@
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-bananapi-m64.dtb
 
 always		:= $(dtb-y)
 subdir-y	:= $(dts-dirs)
arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts new file +74 -0

74 lines not on this page · raw message

Signature · 1 line
2.9.0