arm64: allwinner: a64: Add initial support for Pinebook
Subsystems (2)
cover arm64: allwinner: a64: Add initial support for Pinebook
This series adds dts for Pinebook with few prerequisites - PWM and R_I2C devices nodes.
Andre Przywara (1):
dts: sunxi: A64: Add PWM controllers
Icenowy Zheng (2):
arm64: allwinner: a64: add R_I2C controller
arm64: dts: allwinner: add support for Pinebook
arch/arm64/boot/dts/allwinner/Makefile | 1 + .../dts/allwinner/sun50i-a64-pinebook.dts | 285 ++++++++++++++++++ arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 45 +++ 3 files changed, 331 insertions(+) create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
Signature · 1 line
2.17.1
PATCH 1/3 arm64: allwinner: a64: add R_I2C controller
From: Icenowy Zheng <[email protected]>
Allwinner A64 has a I2C controller, which is in the R_ MMIO zone and has two groups of pinmuxes on PL bank, so it's called R_I2C.
Add support for this I2C controller and the pinmux which doesn't conflict with RSB.
--- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +17 -0
@@ -46,6 +46,7 @@ #include <dt-bindings/clock/sun8i-r-ccu.h> #include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/reset/sun50i-a64-ccu.h> +#include <dt-bindings/reset/sun8i-r-ccu.h> / { interrupt-parent = <&gic>;
@@ -655,6 +656,17 @@ #reset-cells = <1>; }; + r_i2c: i2c at 1f02400 { + compatible = "allwinner,sun6i-a31-i2c"; + reg = <0x01f02400 0x400>; + interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&r_ccu CLK_APB0_I2C>; + resets = <&r_ccu RST_APB0_I2C>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + r_pio: pinctrl at 1f02c00 { compatible = "allwinner,sun50i-a64-r-pinctrl"; reg = <0x01f02c00 0x400>;
@@ -670,6 +682,11 @@ pins = "PL0", "PL1"; function = "s_rsb"; }; + + r_i2c_pins_a: i2c-a { + pins = "PL8", "PL9"; + function = "s_i2c"; + }; }; r_rsb: rsb at 1f03400 {
Signature · 1 line
2.17.1
PATCH 2/3 dts: sunxi: A64: Add PWM controllers
In reply to Vasily KhoruzhickFrom: Andre Przywara <[email protected]>
The Allwinner A64 SoC features two PWM controllers, which are fully compatible to the one used in the A13 and H3 chips.
Add the nodes for the devices (one for the "normal" PWM, the other for the one in the CPUS domain) and the pins their outputs are connected to.
On the A64 the "normal" PWM is muxed together with one of the MDIO pins used to communicate with the Ethernet PHY, so it won't be usable on many boards. But the Pinebook laptop uses this pin for controlling the LCD backlight.
On Pine64 the CPUS PWM pin however is routed to the "RPi2" header, at the same location as the PWM pin on the RaspberryPi.
[vasily: fixed comment message as requested by Stefan Bruens]
--- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +28 -0
@@ -365,6 +365,11 @@ bias-pull-up; }; + pwm_pin: pwm_pin { + pins = "PD22"; + function = "pwm"; + }; + rmii_pins: rmii_pins { pins = "PD10", "PD11", "PD13", "PD14", "PD17", "PD18", "PD19", "PD20", "PD22", "PD23";
@@ -630,6 +635,15 @@ #interrupt-cells = <3>; }; + pwm: pwm at 1c21400 { + compatible = "allwinner,sun50i-a64-pwm", + "allwinner,sun5i-a13-pwm"; + reg = <0x01c21400 0x400>; + clocks = <&osc24M>; + #pwm-cells = <3>; + status = "disabled"; + }; + rtc: rtc at 1f00000 { compatible = "allwinner,sun6i-a31-rtc"; reg = <0x01f00000 0x54>;
@@ -667,6 +681,15 @@ #size-cells = <0>; }; + r_pwm: pwm at 1f03800 { + compatible = "allwinner,sun50i-a64-pwm", + "allwinner,sun5i-a13-pwm"; + reg = <0x01f03800 0x400>; + clocks = <&osc24M>; + #pwm-cells = <3>; + status = "disabled"; + }; + r_pio: pinctrl at 1f02c00 { compatible = "allwinner,sun50i-a64-r-pinctrl"; reg = <0x01f02c00 0x400>;
@@ -687,6 +710,11 @@ pins = "PL8", "PL9"; function = "s_i2c"; }; + + r_pwm_pin: pwm { + pins = "PL10"; + function = "s_pwm"; + }; }; r_rsb: rsb at 1f03400 {
Signature · 1 line
2.17.1
PATCH 3/3 arm64: dts: allwinner: add support for Pinebook
In reply to Vasily KhoruzhickFrom: Icenowy Zheng <[email protected]>
Pinebook is a A64-based laptop produced by Pine64, with the following peripherals:
USB:
- Two external USB ports (one is directly connected to A64's OTG controller, the other is under a internal hub connected to the host-only controller.)
- USB HID keyboard and touchpad connected to the internal hub.
- USB UVC camera connected to the internal hub.
Power-related:
- A DC IN jack connected to AXP803's DCIN pin.
- A Li-Polymer battery connected to AXP803's battery pins.
Storage:
- An eMMC by Foresee on the main board (in the product revision of the main board it's designed to be switchable).
- An external MicroSD card slot.
Display:
- An eDP LCD panel (1366x768) connected via an ANX6345 RGB-eDP bridge.
- A mini HDMI port.
Misc:
- A Hall sensor designed to detect the status of lid, connected to GPIO PL12.
- A headphone jack connected to the SoC's internal codec.
- A debug UART port muxed with headphone jack.
This commit adds basical support for it.
[vasily: squashed several commits into one, added simplefb node, added usbphy
to ehci0 and ohci0 nodes]
--- arch/arm64/boot/dts/allwinner/Makefile | 1 + .../dts/allwinner/sun50i-a64-pinebook.dts | 285 ++++++++++++++++++ 2 files changed, 286 insertions(+) create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
arch/arm64/boot/dts/allwinner/Makefile +1 -0
@@ -4,6 +4,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-nanopi-a64.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-olinuxino.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-orangepi-win.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinebook.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +285 -0
285 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 1/3 arm64: allwinner: a64: add R_I2C controller
In reply to Vasily KhoruzhickHi,
Quoted 9 lines · Vasily Khoruzhick
From: Icenowy Zheng <[email protected]>
Allwinner A64 has a I2C controller, which is in the R_ MMIO zone and has two groups of pinmuxes on PL bank, so it's called
R_I2C.Add support for this I2C controller and the pinmux which doesn't conflict with RSB.
Signed-off-by Icenowy Zheng <[email protected]>
You should have your SoB there.
Quoted 17 lines
--- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +1
-0@@ -46,6 +46,7 @@ #include <dt-bindings/clock/sun8i-r-ccu.h> #include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/reset/sun50i-a64-ccu.h> +#include <dt-bindings/reset/sun8i-r-ccu.h> / { interrupt-parent = <&gic>;
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 660
Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +2
-0@@ -655,6 +656,17 @@ #reset-cells = <1>; }; + r_i2c: i2c at 1f02400 { + compatible = "allwinner,sun6i-a31-i2c";
You should add an a64 compatible here
Quoted 13 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +9
-0+ reg = <0x01f02400 0x400>; + interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&r_ccu CLK_APB0_I2C>; + resets = <&r_ccu RST_APB0_I2C>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + r_pio: pinctrl at 1f02c00 { compatible = "allwinner,sun50i-a64-r-pinctrl"; reg = <0x01f02c00 0x400>;
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 689
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +5
-0@@ -670,6 +682,11 @@ pins = "PL0", "PL1"; function = "s_rsb"; }; + + r_i2c_pins_a: i2c-a { + pins = "PL8", "PL9"; + function = "s_i2c"; + };
This should be ordered by alphabetical order
If this is the only muxing option, you can also add it to the i2c DT node.
Thanks!
Maxime
Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180601/9823329d/attachment.sig>
PATCH 2/3 dts: sunxi: A64: Add PWM controllers
In reply to Vasily KhoruzhickQuoted 13 lines · Vasily Khoruzhick
From: Andre Przywara <[email protected]>
The Allwinner A64 SoC features two PWM controllers, which are fully compatible to the one used in the A13 and H3 chips.
Add the nodes for the devices (one for the "normal" PWM, the other for the one in the CPUS domain) and the pins their outputs are connected to.
On the A64 the "normal" PWM is muxed together with one of the MDIO pins used to communicate with the Ethernet PHY, so it won't be usable on many boards. But the Pinebook laptop uses this pin for controlling the LCD backlight.
Quoted 8 lines
On Pine64 the CPUS PWM pin however is routed to the "RPi2" header, at the same location as the PWM pin on the RaspberryPi.
[vasily: fixed comment message as requested by Stefan Bruens]
Same thing, you should have your SoB there. And I'm not sure the Tested-by format is valid. This information would be better in the commit log itself.
Quoted 9 lines
--- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+)arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +0
-0
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 372
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +5
-0@@ -365,6 +365,11 @@ bias-pull-up; }; + pwm_pin: pwm_pin { + pins = "PD22"; + function = "pwm"; + }; +
Is there multiple options for that muxing? If not, add it to the PWM node by default.
Quoted 36 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +18
-0rmii_pins: rmii_pins { pins = "PD10", "PD11", "PD13", "PD14", "PD17", "PD18", "PD19", "PD20", "PD22", "PD23";@@ -630,6 +635,15 @@ #interrupt-cells = <3>; }; + pwm: pwm at 1c21400 { + compatible = "allwinner,sun50i-a64-pwm", + "allwinner,sun5i-a13-pwm"; + reg = <0x01c21400 0x400>; + clocks = <&osc24M>; + #pwm-cells = <3>; + status = "disabled"; + }; + rtc: rtc at 1f00000 { compatible = "allwinner,sun6i-a31-rtc"; reg = <0x01f00000 0x54>;@@ -667,6 +681,15 @@ #size-cells = <0>; }; + r_pwm: pwm at 1f03800 { + compatible = "allwinner,sun50i-a64-pwm", + "allwinner,sun5i-a13-pwm"; + reg = <0x01f03800 0x400>; + clocks = <&osc24M>; + #pwm-cells = <3>; + status = "disabled"; + }; + r_pio: pinctrl at 1f02c00 { compatible = "allwinner,sun50i-a64-r-pinctrl"; reg = <0x01f02c00 0x400>;
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 717
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +5
-0@@ -687,6 +710,11 @@ pins = "PL8", "PL9"; function = "s_i2c"; }; + + r_pwm_pin: pwm { + pins = "PL10"; + function = "s_pwm"; + };
Ditto.
Maxime
Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180601/9d17a627/attachment.sig>
PATCH 3/3 arm64: dts: allwinner: add support for Pinebook
In reply to Vasily KhoruzhickQuoted 61 lines · Vasily Khoruzhick
From: Icenowy Zheng <[email protected]>
Pinebook is a A64-based laptop produced by Pine64, with the following peripherals:
USB:
- Two external USB ports (one is directly connected to A64's OTG controller, the other is under a internal hub connected to the host-only controller.)
- USB HID keyboard and touchpad connected to the internal hub.
- USB UVC camera connected to the internal hub.Power-related:
- A DC IN jack connected to AXP803's DCIN pin.
- A Li-Polymer battery connected to AXP803's battery pins.Storage:
- An eMMC by Foresee on the main board (in the product revision of the main board it's designed to be switchable).
- An external MicroSD card slot.Display:
- An eDP LCD panel (1366x768) connected via an ANX6345 RGB-eDP bridge.
- A mini HDMI port.Misc:
- A Hall sensor designed to detect the status of lid, connected to GPIO PL12.
- A headphone jack connected to the SoC's internal codec.
- A debug UART port muxed with headphone jack.This commit adds basical support for it.
[vasily: squashed several commits into one, added simplefb node, added usbphy
to ehci0 and ohci0 nodes]Signed-off-by Icenowy Zheng <[email protected]>Signed-off-by Vasily Khoruzhick <[email protected]>--- arch/arm64/boot/dts/allwinner/Makefile | 1 + .../dts/allwinner/sun50i-a64-pinebook.dts | 285 ++++++++++++++++++ 2 files changed, 286 insertions(+) create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dtsarch/arm64/boot/dts/allwinner/Makefile +1
-0@@ -4,6 +4,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-nanopi-a64.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-olinuxino.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-orangepi-win.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinebook.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtbarch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +0
-0
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts line 5
Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +5
-0@@ -0,0 +1,285 @@ +/* + * Copyright (C) 2017 Icenowy Zheng <[email protected]> + * Copyright (C) 2018 Vasily Khoruzhick <[email protected]> + * + * SPDX-License-Identifier: (GPL-2.0 OR MIT)
The SPDX tag should be the first one.
Quoted 13 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +13
-0+ */ + +/dts-v1/; + +#include "sun50i-a64.dtsi" + +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/input/input.h> +#include <dt-bindings/pwm/pwm.h> + +/ { + model = "Pinebook"; + compatible = "pine64,pinebook", "allwinner,sun50i-a64";
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts line 28
Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +10
-0+ + aliases { + serial0 = &uart0; + ethernet0 = &rtl8723cs; + }; + + backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&pwm 0 50000 0>; + brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
The perceived brightness should be increasing linearly. This usually means that you need an function close to a power of two sequence.
Quoted 108 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +108
-0+ default-brightness-level = <2>; + enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */ + }; + + chosen { + stdout-path = "serial0:115200n8"; + + framebuffer-lcd { + panel-supply = <®_dc1sw>; + dvdd25-supply = <®_dldo2>; + dvdd12-supply = <®_fldo1>; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + + lid_switch { + label = "Lid Switch"; + gpios = <&r_pio 0 12 GPIO_ACTIVE_LOW>; /* PL12 */ + linux,input-type = <EV_SW>; + linux,code = <SW_LID>; + linux,can-disable; + }; + }; + + reg_vcc3v3: vcc3v3 { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + + wifi_pwrseq: wifi_pwrseq { + compatible = "mmc-pwrseq-simple"; + reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */ + }; +}; + +&ehci0 { + phys = <&usbphy 0>; + phy-names = "usb"; + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +&mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>; + vmmc-supply = <®_dcdc1>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; + cd-inverted; + disable-wp; + bus-width = <4>; + status = "okay"; +}; + +&mmc1 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pins>; + vmmc-supply = <®_dldo4>; + vqmmc-supply = <®_eldo1>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; + + rtl8723cs: wifi at 1 { + reg = <1>; + }; +}; + +&mmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_pins>; + vmmc-supply = <®_dcdc1>; + vqmmc-supply = <®_eldo1>; + bus-width = <8>; + non-removable; + cap-mmc-hw-reset; + mmc-hs200-1_8v; + status = "okay"; +}; + +&ohci0 { + phys = <&usbphy 0>; + phy-names = "usb"; + status = "okay"; +}; + +&ohci1 { + status = "okay"; +}; + +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm_pin>; + status = "okay"; +}; + +&r_rsb { + status = "okay"; + + axp803: pmic at 3a3 { + compatible = "x-powers,axp803";
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts line 146
Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +10
-0+ reg = <0x3a3>; + interrupt-parent = <&r_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + }; +}; + +/* The ANX6345 eDP-bridge is on r_i2c. There is no linux (mainline) + * driver for this chip at the moment, the bootloader initializes it. + * However it can be accessed with the i2c-dev driver from user space. + */
The comment format is wrong, and the part after r_i2c, about i2c-dev and the mainline support is not really relevant. The DT describes the hardware, and is used by several different projects that might or might not have i2c-dev, an interface similar, or might have or not a driver for the bridge.
Maxime
Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180601/48c13123/attachment.sig>
PATCH 1/3 arm64: allwinner: a64: add R_I2C controller
In reply to Maxime RipardQuoted 8 lines · Maxime Ripard
Hi,
Quoted 5 lines · Vasily Khoruzhick
From: Icenowy Zheng <[email protected]>
Allwinner A64 has a I2C controller, which is in the R_ MMIO zone and has two groups of pinmuxes on PL bank, so it's called
R_I2C.
Quoted 6 lines
Quoted 4 lines
Add support for this I2C controller and the pinmux which doesn't conflict with RSB.
Signed-off-by Icenowy Zheng <[email protected]>You should have your SoB there.
OK, will do.
Quoted 20 lines
Quoted 20 lines
--- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +1
-0@@ -46,6 +46,7 @@ #include <dt-bindings/clock/sun8i-r-ccu.h> #include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/reset/sun50i-a64-ccu.h> +#include <dt-bindings/reset/sun8i-r-ccu.h> / { interrupt-parent = <&gic>;@@ -655,6 +656,17 @@ #reset-cells = <1>; };
Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 660
Quoted 2 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +2
-0+ r_i2c: i2c at 1f02400 { + compatible = "allwinner,sun6i-a31-i2c";You should add an a64 compatible here
We don't have it for regular i2c, why should I add it here?
Quoted 15 lines
Quoted 15 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +9
-0+ reg = <0x01f02400 0x400>; + interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&r_ccu CLK_APB0_I2C>; + resets = <&r_ccu RST_APB0_I2C>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + r_pio: pinctrl at 1f02c00 { compatible = "allwinner,sun50i-a64-r-pinctrl"; reg = <0x01f02c00 0x400>;@@ -670,6 +682,11 @@ pins = "PL0", "PL1"; function = "s_rsb";
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 689
Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +5
-0}; + + r_i2c_pins_a: i2c-a { + pins = "PL8", "PL9"; + function = "s_i2c"; + };This should be ordered by alphabetical order
OK
Quoted 2 lines
If this is the only muxing option, you can also add it to the i2c DT node.
It's not the only option, but other option conflicts with rsb. Should I still add it to i2c DT node?
Quoted 8 lines
Thanks!
Maxime--
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
PATCH 2/3 dts: sunxi: A64: Add PWM controllers
In reply to Maxime RipardQuoted 19 lines · Maxime Ripard
Quoted 18 lines · Vasily Khoruzhick
From: Andre Przywara <[email protected]>
The Allwinner A64 SoC features two PWM controllers, which are fully compatible to the one used in the A13 and H3 chips.
Add the nodes for the devices (one for the "normal" PWM, the other for the one in the CPUS domain) and the pins their outputs are connected to.
On the A64 the "normal" PWM is muxed together with one of the MDIO pins used to communicate with the Ethernet PHY, so it won't be usable on many boards. But the Pinebook laptop uses this pin for controlling the LCD backlight.
On Pine64 the CPUS PWM pin however is routed to the "RPi2" header, at the same location as the PWM pin on the RaspberryPi.
[vasily: fixed comment message as requested by Stefan Bruens]
Quoted 7 lines
Quoted 3 lines
Same thing, you should have your SoB there. And I'm not sure the Tested-by format is valid. This information would be better in the commit log itself.
OK
Quoted 13 lines
Quoted 13 lines
--- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+)arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +0
-0@@ -365,6 +365,11 @@ bias-pull-up; };
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 372
Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +5
-0+ pwm_pin: pwm_pin { + pins = "PD22"; + function = "pwm"; + }; +Is there multiple options for that muxing? If not, add it to the PWM node by default.
OK
Quoted 39 lines
Quoted 39 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +18
-0rmii_pins: rmii_pins { pins = "PD10", "PD11", "PD13", "PD14", "PD17", "PD18", "PD19", "PD20", "PD22", "PD23";@@ -630,6 +635,15 @@ #interrupt-cells = <3>; }; + pwm: pwm at 1c21400 { + compatible = "allwinner,sun50i-a64-pwm", + "allwinner,sun5i-a13-pwm"; + reg = <0x01c21400 0x400>; + clocks = <&osc24M>; + #pwm-cells = <3>; + status = "disabled"; + }; + rtc: rtc at 1f00000 { compatible = "allwinner,sun6i-a31-rtc"; reg = <0x01f00000 0x54>;@@ -667,6 +681,15 @@ #size-cells = <0>; }; + r_pwm: pwm at 1f03800 { + compatible = "allwinner,sun50i-a64-pwm", + "allwinner,sun5i-a13-pwm"; + reg = <0x01f03800 0x400>; + clocks = <&osc24M>; + #pwm-cells = <3>; + status = "disabled"; + }; + r_pio: pinctrl at 1f02c00 { compatible = "allwinner,sun50i-a64-r-pinctrl"; reg = <0x01f02c00 0x400>;@@ -687,6 +710,11 @@ pins = "PL8", "PL9"; function = "s_i2c";
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 717
Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +5
-0}; + + r_pwm_pin: pwm { + pins = "PL10"; + function = "s_pwm"; + };Ditto.
OK
Quoted 7 lines
Maxime
--
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
PATCH 3/3 arm64: dts: allwinner: add support for Pinebook
In reply to Maxime RipardQuoted 61 lines · Maxime Ripard
Quoted 60 lines · Vasily Khoruzhick
From: Icenowy Zheng <[email protected]>
Pinebook is a A64-based laptop produced by Pine64, with the following peripherals:
USB:
- Two external USB ports (one is directly connected to A64's OTG controller, the other is under a internal hub connected to the host-only controller.)
- USB HID keyboard and touchpad connected to the internal hub.
- USB UVC camera connected to the internal hub.Power-related:
- A DC IN jack connected to AXP803's DCIN pin.
- A Li-Polymer battery connected to AXP803's battery pins.Storage:
- An eMMC by Foresee on the main board (in the product revision of the main board it's designed to be switchable).
- An external MicroSD card slot.Display:
- An eDP LCD panel (1366x768) connected via an ANX6345 RGB-eDP bridge.
- A mini HDMI port.Misc:
- A Hall sensor designed to detect the status of lid, connected to GPIO PL12.
- A headphone jack connected to the SoC's internal codec.
- A debug UART port muxed with headphone jack.This commit adds basical support for it.
[vasily: squashed several commits into one, added simplefb node, added usbphy
to ehci0 and ohci0 nodes]Signed-off-by Icenowy Zheng <[email protected]>Signed-off-by Vasily Khoruzhick <[email protected]>--- arch/arm64/boot/dts/allwinner/Makefile | 1 + .../dts/allwinner/sun50i-a64-pinebook.dts | 285 ++++++++++++++++++ 2 files changed, 286 insertions(+) create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dtsarch/arm64/boot/dts/allwinner/Makefile +1
-0@@ -4,6 +4,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-nanopi-a64.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-olinuxino.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-orangepi-win.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinebook.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtbarch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +0
-0
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts line 5
Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +5
-0@@ -0,0 +1,285 @@ +/* + * Copyright (C) 2017 Icenowy Zheng <[email protected]> + * Copyright (C) 2018 Vasily Khoruzhick <[email protected]> + * + * SPDX-License-Identifier: (GPL-2.0 OR MIT)The SPDX tag should be the first one.
OK, but it's not in number of other dts files, e.g. sun50i-a64-teres-i.dts or sun50i-h5-orangepi-zero-plus.dts
Quoted 18 lines
Quoted 18 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +18
-0+ */ + +/dts-v1/; + +#include "sun50i-a64.dtsi" + +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/input/input.h> +#include <dt-bindings/pwm/pwm.h> + +/ { + model = "Pinebook"; + compatible = "pine64,pinebook", "allwinner,sun50i-a64"; + + aliases { + serial0 = &uart0; + ethernet0 = &rtl8723cs; + };
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts line 28
Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +5
-0+ + backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&pwm 0 50000 0>; + brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;The perceived brightness should be increasing linearly. This usually means that you need an function close to a power of two sequence.
OK, I'll try, but no one complained so far.
Quoted 116 lines
Quoted 116 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +116
-0+ default-brightness-level = <2>; + enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */ + }; + + chosen { + stdout-path = "serial0:115200n8"; + + framebuffer-lcd { + panel-supply = <®_dc1sw>; + dvdd25-supply = <®_dldo2>; + dvdd12-supply = <®_fldo1>; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + + lid_switch { + label = "Lid Switch"; + gpios = <&r_pio 0 12 GPIO_ACTIVE_LOW>; /* PL12 */ + linux,input-type = <EV_SW>; + linux,code = <SW_LID>; + linux,can-disable; + }; + }; + + reg_vcc3v3: vcc3v3 { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + + wifi_pwrseq: wifi_pwrseq { + compatible = "mmc-pwrseq-simple"; + reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */ + }; +}; + +&ehci0 { + phys = <&usbphy 0>; + phy-names = "usb"; + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +&mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>; + vmmc-supply = <®_dcdc1>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; + cd-inverted; + disable-wp; + bus-width = <4>; + status = "okay"; +}; + +&mmc1 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pins>; + vmmc-supply = <®_dldo4>; + vqmmc-supply = <®_eldo1>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; + + rtl8723cs: wifi at 1 { + reg = <1>; + }; +}; + +&mmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_pins>; + vmmc-supply = <®_dcdc1>; + vqmmc-supply = <®_eldo1>; + bus-width = <8>; + non-removable; + cap-mmc-hw-reset; + mmc-hs200-1_8v; + status = "okay"; +}; + +&ohci0 { + phys = <&usbphy 0>; + phy-names = "usb"; + status = "okay"; +}; + +&ohci1 { + status = "okay"; +}; + +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm_pin>; + status = "okay"; +}; + +&r_rsb { + status = "okay"; + + axp803: pmic at 3a3 { + compatible = "x-powers,axp803"; + reg = <0x3a3>; + interrupt-parent = <&r_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + }; +}; + +/* The ANX6345 eDP-bridge is on r_i2c. There is no linux (mainline) + * driver for this chip at the moment, the bootloader initializes it.
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts line 146
Quoted 2 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +2
-0+ * However it can be accessed with the i2c-dev driver from user space. + */The comment format is wrong, and the part after
r_i2c, about i2c-dev and the mainline support is not really relevant. The DT describes the hardware, and is used by several different projects that might or might not have i2c-dev, an interface similar, or might have or not a driver for the bridge.
Comment is identical to sun50i-a64-teres-i.dts (which was merged few months ago).
I'll remove everything but first sentence.
Quoted 7 lines
Maxime
--
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
PATCH 3/3 arm64: dts: allwinner: add support for Pinebook
Quoted 71 lines · Vasily Khoruzhick
Quoted 61 lines · Maxime Ripard
Quoted 60 lines · Vasily Khoruzhick
From: Icenowy Zheng <[email protected]>
Pinebook is a A64-based laptop produced by Pine64, with the following peripherals:
USB:
- Two external USB ports (one is directly connected to A64's OTG controller, the other is under a internal hub connected to the host-only controller.)
- USB HID keyboard and touchpad connected to the internal hub.
- USB UVC camera connected to the internal hub.Power-related:
- A DC IN jack connected to AXP803's DCIN pin.
- A Li-Polymer battery connected to AXP803's battery pins.Storage:
- An eMMC by Foresee on the main board (in the product revision of the main board it's designed to be switchable).
- An external MicroSD card slot.Display:
- An eDP LCD panel (1366x768) connected via an ANX6345 RGB-eDP bridge.
- A mini HDMI port.Misc:
- A Hall sensor designed to detect the status of lid, connected to GPIO PL12.
- A headphone jack connected to the SoC's internal codec.
- A debug UART port muxed with headphone jack.This commit adds basical support for it.
[vasily: squashed several commits into one, added simplefb node, added usbphy
to ehci0 and ohci0 nodes]Signed-off-by Icenowy Zheng <[email protected]>Signed-off-by Vasily Khoruzhick <[email protected]>--- arch/arm64/boot/dts/allwinner/Makefile | 1 + .../dts/allwinner/sun50i-a64-pinebook.dts | 285 ++++++++++++++++++ 2 files changed, 286 insertions(+) create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dtsarch/arm64/boot/dts/allwinner/Makefile +1
-0@@ -4,6 +4,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-nanopi-a64.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-olinuxino.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-orangepi-win.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinebook.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtbarch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +0
-0Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts line 5
Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +5
-0@@ -0,0 +1,285 @@ +/* + * Copyright (C) 2017 Icenowy Zheng <[email protected]> + * Copyright (C) 2018 Vasily Khoruzhick <[email protected]> + * + * SPDX-License-Identifier: (GPL-2.0 OR MIT)The SPDX tag should be the first one.
Quoted 2 lines
OK, but it's not in number of other dts files, e.g.
sun50i-a64-teres-i.dtsorsun50i-h5-orangepi-zero-plus.dts
I guess we'd have to fix it then
Quoted 11 lines
Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts line 146
Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +4
-0+/* The ANX6345 eDP-bridge is on r_i2c. There is no linux (mainline) + * driver for this chip at the moment, the bootloader initializes it. + * However it can be accessed with the i2c-dev driver from user space. + */The comment format is wrong, and the part after
r_i2c, about i2c-dev and the mainline support is not really relevant. The DT describes the hardware, and is used by several different projects that might or might not have i2c-dev, an interface similar, or might have or not a driver for the bridge.
Quoted 3 lines
Comment is identical to
sun50i-a64-teres-i.dts(which was merged few months ago).
I'll remove everything but first sentence.
We don't notice everything unfortunately. Feel free to fix it in the TERES-I DTS as well.
Maxime
Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180604/c568fc46/attachment.sig>
PATCH 1/3 arm64: allwinner: a64: add R_I2C controller
In reply to Vasily KhoruzhickQuoted 20 lines · Vasily Khoruzhick
Quoted 20 lines
Quoted 20 lines
--- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +1
-0@@ -46,6 +46,7 @@ #include <dt-bindings/clock/sun8i-r-ccu.h> #include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/reset/sun50i-a64-ccu.h> +#include <dt-bindings/reset/sun8i-r-ccu.h> / { interrupt-parent = <&gic>;@@ -655,6 +656,17 @@ #reset-cells = <1>; };
Quoted 6 lines
Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 660
Quoted 2 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +2
-0+ r_i2c: i2c at 1f02400 { + compatible = "allwinner,sun6i-a31-i2c";You should add an a64 compatible here
We don't have it for regular i2c, why should I add it here?
We miss some of them. Adding for i2c would make sense too.
Quoted 24 lines
Quoted 15 lines
Quoted 15 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +9
-0+ reg = <0x01f02400 0x400>; + interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&r_ccu CLK_APB0_I2C>; + resets = <&r_ccu RST_APB0_I2C>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + r_pio: pinctrl at 1f02c00 { compatible = "allwinner,sun50i-a64-r-pinctrl"; reg = <0x01f02c00 0x400>;@@ -670,6 +682,11 @@ pins = "PL0", "PL1"; function = "s_rsb";Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 689
Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +5
-0}; + + r_i2c_pins_a: i2c-a { + pins = "PL8", "PL9"; + function = "s_i2c"; + };This should be ordered by alphabetical order
Quoted 7 lines
OK
Quoted 2 lines
If this is the only muxing option, you can also add it to the i2c DT node.
It's not the only option, but other option conflicts with rsb. Should I still add it to i2c DT node?
I guess you can put it there, the muxing will only be enforced if the device is enabled, and there should be only one of RSB or I2C that would be.
Maxime
Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180604/51e52d58/attachment.sig>