From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vasily Khoruzhick Date: Wed, 17 Oct 2018 08:37:57 -0700 Subject: [U-Boot] [PATCH v2 5/5] sunxi: DT: add support for Pinebook In-Reply-To: <3532355.rzLINJdYBj@jernej-laptop> References: <20181017050932.11138-1-anarsoul@gmail.com> <14001149.4A3ChbTZfQ@anarsoul-thinkpad> <3532355.rzLINJdYBj@jernej-laptop> Message-ID: <4340504.98VJRAjsj5@anarsoul-thinkpad> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de On Wednesday, October 17, 2018 8:22:51 AM PDT Jernej =C5=A0krabec wrote: > Hi! >=20 > Dne sreda, 17. oktober 2018 ob 17:13:42 CEST je Vasily Khoruzhick=20 napisal(a): > > On Tuesday, October 16, 2018 10:09:32 PM PDT Vasily Khoruzhick wrote: > > > Pinebook is a laptop produced by Pine64, with USB-connected keyboard, > > > USB-connected touchpad and an eDP LCD panel connected via a RGB-eDP > > > bridge from Analogix. > > >=20 > > > Signed-off-by: Vasily Khoruzhick > >=20 > > +CC Jernej > >=20 > > > --- > > >=20 > > > arch/arm/dts/Makefile | 3 +- > > > arch/arm/dts/sun50i-a64-pinebook.dts | 306 +++++++++++++++++++++++++= ++ > > > configs/pinebook_defconfig | 27 +++ > > > 3 files changed, 335 insertions(+), 1 deletion(-) > > > create mode 100644 arch/arm/dts/sun50i-a64-pinebook.dts > > > create mode 100644 configs/pinebook_defconfig > > >=20 > > > diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile > > > index dfe9335a04..ccb93f1e46 100644 > > > --- a/arch/arm/dts/Makefile > > > +++ b/arch/arm/dts/Makefile > > > @@ -404,7 +404,8 @@ dtb-$(CONFIG_MACH_SUN50I) +=3D \ > > >=20 > > > sun50i-a64-orangepi-win.dtb \ > > > sun50i-a64-pine64-plus.dtb \ > > > sun50i-a64-pine64.dtb \ > > >=20 > > > - sun50i-a64-sopine-baseboard.dtb > > > + sun50i-a64-sopine-baseboard.dtb \ > > > + sun50i-a64-pinebook.dtb > > >=20 > > > dtb-$(CONFIG_MACH_SUN9I) +=3D \ > > > =20 > > > sun9i-a80-optimus.dtb \ > > > sun9i-a80-cubieboard4.dtb \ > > >=20 > > > diff --git a/arch/arm/dts/sun50i-a64-pinebook.dts > > > b/arch/arm/dts/sun50i-a64-pinebook.dts new file mode 100644 > > > index 0000000000..5d111fab64 > > > --- /dev/null > > > +++ b/arch/arm/dts/sun50i-a64-pinebook.dts > > > @@ -0,0 +1,306 @@ > > > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) > > > +/* > > > + * Copyright (C) 2017 Icenowy Zheng > > > + * Copyright (C) 2018 Vasily Khoruzhick > > > + * > > > + */ > > > + > > > +/dts-v1/; > > > + > > > +#include "sun50i-a64.dtsi" > > > + > > > +#include > > > +#include > > > +#include > > > + > > > +/ { > > > + model =3D "Pinebook"; > > > + compatible =3D "pine64,pinebook", "allwinner,sun50i-a64"; > > > + > > > + aliases { > > > + serial0 =3D &uart0; > > > + ethernet0 =3D &rtl8723cs; > > > + }; > > > + > > > + vdd_bl: regulator at 0 { > > > + compatible =3D "regulator-fixed"; > > > + regulator-name =3D "bl-3v3"; > > > + regulator-min-microvolt =3D <3300000>; > > > + regulator-max-microvolt =3D <3300000>; > > > + gpio =3D <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */ > > > + enable-active-high; > > > + }; > > > + > > > + backlight: backlight { > > > + compatible =3D "pwm-backlight"; > > > + pwms =3D <&pwm 0 50000 0>; > > > + brightness-levels =3D <0 5 10 15 20 30 40 55 70 85 100>; > > > + default-brightness-level =3D <2>; > > > + enable-gpios =3D <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */ > > > + power-supply =3D <&vdd_bl>; > > > + }; > > > + > > > + chosen { > > > + stdout-path =3D "serial0:115200n8"; > > > + > > > + framebuffer-lcd { > > > + panel-supply =3D <®_dc1sw>; > > > + dvdd25-supply =3D <®_dldo2>; > > > + dvdd12-supply =3D <®_fldo1>; > > > + }; > > > + }; > > > + > > > + gpio_keys { > > > + compatible =3D "gpio-keys"; > > > + > > > + lid_switch { > > > + label =3D "Lid Switch"; > > > + gpios =3D <&r_pio 0 12 GPIO_ACTIVE_LOW>; /* PL12 */ > > > + linux,input-type =3D ; > > > + linux,code =3D ; > > > + linux,can-disable; > > > + wakeup-source; > > > + }; > > > + }; > > > + > > > + reg_vcc3v3: vcc3v3 { > > > + compatible =3D "regulator-fixed"; > > > + regulator-name =3D "vcc3v3"; > > > + regulator-min-microvolt =3D <3300000>; > > > + regulator-max-microvolt =3D <3300000>; > > > + }; > > > + > > > + wifi_pwrseq: wifi_pwrseq { > > > + compatible =3D "mmc-pwrseq-simple"; > > > + reset-gpios =3D <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */ > > > + }; > > > + > > > + speaker_amp: speaker_amp { > > > + compatible =3D "simple-audio-amplifier"; > > > + enable-gpios =3D <&pio 7 7 GPIO_ACTIVE_HIGH>; > > > + }; > > > +}; > > > + > > > +&ehci0 { > > > + phys =3D <&usbphy 0>; > > > + phy-names =3D "usb"; > > > + status =3D "okay"; > > > +}; > > > + > > > +&ehci1 { > > > + status =3D "okay"; > > > +}; > > > + > > > +&mmc0 { > > > + pinctrl-names =3D "default"; > > > + pinctrl-0 =3D <&mmc0_pins>; > > > + vmmc-supply =3D <®_dcdc1>; > > > + cd-gpios =3D <&pio 5 6 GPIO_ACTIVE_HIGH>; > > > + cd-inverted; > > > + disable-wp; > > > + bus-width =3D <4>; > > > + status =3D "okay"; > > > +}; > > > + > > > +&mmc1 { > > > + pinctrl-names =3D "default"; > > > + pinctrl-0 =3D <&mmc1_pins>; > > > + vmmc-supply =3D <®_dldo4>; > > > + vqmmc-supply =3D <®_eldo1>; > > > + mmc-pwrseq =3D <&wifi_pwrseq>; > > > + bus-width =3D <4>; > > > + non-removable; > > > + status =3D "okay"; > > > + > > > + rtl8723cs: wifi at 1 { > > > + reg =3D <1>; > > > + }; > > > +}; > > > + > > > +&mmc2 { > > > + pinctrl-names =3D "default"; > > > + pinctrl-0 =3D <&mmc2_pins>; > > > + vmmc-supply =3D <®_dcdc1>; > > > + vqmmc-supply =3D <®_eldo1>; > > > + bus-width =3D <8>; > > > + non-removable; > > > + cap-mmc-hw-reset; > > > + mmc-hs200-1_8v; > > > + status =3D "okay"; > > > +}; > > > + > > > +&ohci0 { > > > + phys =3D <&usbphy 0>; > > > + phy-names =3D "usb"; > > > + status =3D "okay"; > > > +}; > > > + > > > +&ohci1 { > > > + status =3D "okay"; > > > +}; > > > + > > > +&pwm { > > > + status =3D "okay"; > > > +}; > > > + > > > +&r_rsb { > > > + status =3D "okay"; > > > + > > > + axp803: pmic at 3a3 { > > > + compatible =3D "x-powers,axp803"; > > > + reg =3D <0x3a3>; > > > + interrupt-parent =3D <&r_intc>; > > > + interrupts =3D <0 IRQ_TYPE_LEVEL_LOW>; > > > + }; > > > +}; > > > + > > > +/* The ANX6345 eDP-bridge is on r_i2c */ > > > +&r_i2c { > > > + clock-frequency =3D <100000>; > > > + pinctrl-names =3D "default"; > > > + pinctrl-0 =3D <&r_i2c_pins_a>; > > > + status =3D "okay"; > > > + anx6345: edp-bridge at 38 { > > > + compatible =3D "analogix,anx6345"; > > > + reg =3D <0x38>; > > > + reset-gpios =3D <&pio 3 24 GPIO_ACTIVE_LOW>; /* PD24 */ > > > + status =3D "okay"; > > > + }; >=20 > Given that this node is currently U-Boot specific, wouldn't be better to > leave sun50i-a64-pinebook.dts as it is in Linux and add additional > sun50i-a64- pinebook-u-boot.dts with U-Boot specific nodes as it is alrea= dy > done with a lot of other DT files? >=20 > That way there is less chance to mistakenly left out something when synci= ng > DT files from Linux. Sounds good, will do in v3. >=20 > Best regards, > Jernej >=20 > > > +}; > > > + > > > +#include "axp803.dtsi" > > > + > > > +®_aldo1 { > > > + regulator-min-microvolt =3D <2800000>; > > > + regulator-max-microvolt =3D <2800000>; > > > + regulator-name =3D "vcc-csi"; > > > +}; > > > + > > > +®_aldo2 { > > > + regulator-always-on; > > > + regulator-min-microvolt =3D <1800000>; > > > + regulator-max-microvolt =3D <3300000>; > > > + regulator-name =3D "vcc-pl"; > > > +}; > > > + > > > +®_aldo3 { > > > + regulator-always-on; > > > + regulator-min-microvolt =3D <2700000>; > > > + regulator-max-microvolt =3D <3300000>; > > > + regulator-name =3D "vcc-pll-avcc"; > > > +}; > > > + > > > +®_dc1sw { > > > + regulator-name =3D "vcc-lcd"; > > > +}; > > > + > > > +®_dcdc1 { > > > + regulator-always-on; > > > + regulator-min-microvolt =3D <3300000>; > > > + regulator-max-microvolt =3D <3300000>; > > > + regulator-name =3D "vcc-3v3"; > > > +}; > > > + > > > +®_dcdc2 { > > > + regulator-always-on; > > > + regulator-min-microvolt =3D <1000000>; > > > + regulator-max-microvolt =3D <1300000>; > > > + regulator-name =3D "vdd-cpux"; > > > +}; > > > + > > > +/* DCDC3 is polyphased with DCDC2 */ > > > + > > > +®_dcdc5 { > > > + regulator-always-on; > > > + regulator-min-microvolt =3D <1200000>; > > > + regulator-max-microvolt =3D <1200000>; > > > + regulator-name =3D "vcc-dram"; > > > +}; > > > + > > > +®_dcdc6 { > > > + regulator-always-on; > > > + regulator-min-microvolt =3D <1100000>; > > > + regulator-max-microvolt =3D <1100000>; > > > + regulator-name =3D "vdd-sys"; > > > +}; > > > + > > > +®_dldo1 { > > > + regulator-min-microvolt =3D <3300000>; > > > + regulator-max-microvolt =3D <3300000>; > > > + regulator-name =3D "vcc-hdmi"; > > > +}; > > > + > > > +®_dldo2 { > > > + regulator-min-microvolt =3D <2500000>; > > > + regulator-max-microvolt =3D <2500000>; > > > + regulator-name =3D "vcc-edp"; > > > +}; > > > + > > > +®_dldo3 { > > > + regulator-min-microvolt =3D <3300000>; > > > + regulator-max-microvolt =3D <3300000>; > > > + regulator-name =3D "avdd-csi"; > > > +}; > > > + > > > +®_dldo4 { > > > + regulator-min-microvolt =3D <3300000>; > > > + regulator-max-microvolt =3D <3300000>; > > > + regulator-name =3D "vcc-wifi"; > > > +}; > > > + > > > +®_eldo1 { > > > + regulator-always-on; > > > + regulator-min-microvolt =3D <1800000>; > > > + regulator-max-microvolt =3D <1800000>; > > > + regulator-name =3D "cpvdd"; > > > +}; > > > + > > > +®_eldo3 { > > > + regulator-min-microvolt =3D <1800000>; > > > + regulator-max-microvolt =3D <1800000>; > > > + regulator-name =3D "vdd-1v8-csi"; > > > +}; > > > + > > > +®_fldo1 { > > > + regulator-min-microvolt =3D <1200000>; > > > + regulator-max-microvolt =3D <1200000>; > > > + regulator-name =3D "vcc-1v2-hsic"; > > > +}; > > > + > > > +®_fldo2 { > > > + regulator-always-on; > > > + regulator-min-microvolt =3D <1100000>; > > > + regulator-max-microvolt =3D <1100000>; > > > + regulator-name =3D "vdd-cpus"; > > > +}; > > > + > > > +®_ldo_io0 { > > > + regulator-min-microvolt =3D <3300000>; > > > + regulator-max-microvolt =3D <3300000>; > > > + regulator-name =3D "vcc-usb"; > > > + status =3D "okay"; > > > +}; > > > + > > > +®_rtc_ldo { > > > + regulator-name =3D "vcc-rtc"; > > > +}; > > > + > > > +&simplefb_hdmi { > > > + vcc-hdmi-supply =3D <®_dldo1>; > > > +}; > > > + > > > +&uart0 { > > > + pinctrl-names =3D "default"; > > > + pinctrl-0 =3D <&uart0_pins_a>; > > > + status =3D "okay"; > > > +}; > > > + > > > +&usb_otg { > > > + dr_mode =3D "host"; > > > +}; > > > + > > > +&usbphy { > > > + usb0_vbus-supply =3D <®_ldo_io0>; > > > + usb1_vbus-supply =3D <®_ldo_io0>; > > > + status =3D "okay"; > > > +}; > > > diff --git a/configs/pinebook_defconfig b/configs/pinebook_defconfig > > > new file mode 100644 > > > index 0000000000..f5190d96d2 > > > --- /dev/null > > > +++ b/configs/pinebook_defconfig > > > @@ -0,0 +1,27 @@ > > > +CONFIG_ARM=3Dy > > > +CONFIG_ARCH_SUNXI=3Dy > > > +CONFIG_SPL=3Dy > > > +CONFIG_MACH_SUN50I=3Dy > > > +CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=3Dy > > > +CONFIG_SUNXI_DRAM_LPDDR3_STOCK=3Dy > > > +CONFIG_DRAM_CLK=3D552 > > > +CONFIG_DRAM_ZQ=3D3881949 > > > +CONFIG_MMC_SUNXI_SLOT_EXTRA=3D2 > > > +CONFIG_R_I2C_ENABLE=3Dy > > > +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set > > > +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set > > > +# CONFIG_SPL_LEGACY_IMAGE_SUPPORT is not set > > > +# CONFIG_CMD_FLASH is not set > > > +# CONFIG_SPL_DOS_PARTITION is not set > > > +# CONFIG_SPL_EFI_PARTITION is not set > > > +CONFIG_DEFAULT_DEVICE_TREE=3D"sun50i-a64-pinebook" > > > +# CONFIG_MMC_VERBOSE is not set > > > +CONFIG_DM_REGULATOR=3Dy > > > +CONFIG_DM_REGULATOR_FIXED=3Dy > > > +CONFIG_DM_PWM=3Dy > > > +CONFIG_PWM_SUNXI=3Dy > > > +CONFIG_USB_EHCI_HCD=3Dy > > > +CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=3Dy > > > +# CONFIG_USB_GADGET is not set > > > +CONFIG_VIDEO_BRIDGE=3Dy > > > +CONFIG_VIDEO_BRIDGE_ANALOGIX_ANX6345=3Dy