On Thu, May 31, 2018 at 11:29:01PM -0700, Vasily Khoruzhick wrote: > From: Icenowy Zheng > > 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 > Signed-off-by: Vasily Khoruzhick > --- > 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 > > diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile > index 8bebe7da5ed9..a8c6d0c6f2c5 100644 > --- a/arch/arm64/boot/dts/allwinner/Makefile > +++ b/arch/arm64/boot/dts/allwinner/Makefile > @@ -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 > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts > new file mode 100644 > index 000000000000..d952db217702 > --- /dev/null > +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts > @@ -0,0 +1,285 @@ > +/* > + * Copyright (C) 2017 Icenowy Zheng > + * Copyright (C) 2018 Vasily Khoruzhick > + * > + * SPDX-License-Identifier: (GPL-2.0 OR MIT) The SPDX tag should be the first one. > + */ > + > +/dts-v1/; > + > +#include "sun50i-a64.dtsi" > + > +#include > +#include > +#include > + > +/ { > + model = "Pinebook"; > + compatible = "pine64,pinebook", "allwinner,sun50i-a64"; > + > + 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. > + 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 = ; > + linux,code = ; > + 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@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@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. > + * 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 -- Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com