From 9bb34b4d71afd24ce6eba56cedd36e1464147bf7 Mon Sep 17 00:00:00 2001 From: Ondrej Jirman Date: Mon, 23 Sep 2019 05:55:14 +0200 Subject: [PATCH] sunxi: Add minimal PocketBook Touch Lux 3 support --- arch/arm/dts/Makefile | 1 + .../dts/sun5i-a13-pocketbook-touch-lux-3.dts | 170 ++++++++++++++++++ configs/pocketbook_touch_lux_3_defconfig | 43 +++++ 3 files changed, 214 insertions(+) create mode 100644 arch/arm/dts/sun5i-a13-pocketbook-touch-lux-3.dts create mode 100644 configs/pocketbook_touch_lux_3_defconfig diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index c6710826a0a..3b375a3f33a 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -497,6 +497,7 @@ dtb-$(CONFIG_MACH_SUN5I) += \ sun5i-a13-olinuxino.dtb \ sun5i-a13-olinuxino-micro.dtb \ sun5i-a13-q8-tablet.dtb \ + sun5i-a13-pocketbook-touch-lux-3.dtb \ sun5i-a13-utoo-p66.dtb \ sun5i-gr8-chip-pro.dtb \ sun5i-r8-chip.dtb diff --git a/arch/arm/dts/sun5i-a13-pocketbook-touch-lux-3.dts b/arch/arm/dts/sun5i-a13-pocketbook-touch-lux-3.dts new file mode 100644 index 00000000000..68bc59793c6 --- /dev/null +++ b/arch/arm/dts/sun5i-a13-pocketbook-touch-lux-3.dts @@ -0,0 +1,170 @@ +/* + * Copyright 2019 Ondrej Jirman + */ + +/dts-v1/; +#include "sun5i-a13.dtsi" +#include "sunxi-common-regulators.dtsi" +#include +#include +#include +#include + +/ { + model = "PocketBook Touch Lux 3"; + compatible = "pocketbook,touch-lux-3", "allwinner,sun5i-a13"; + + aliases { + serial0 = &uart1; + }; +/* + backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; + brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; + default-brightness-level = <8>; + }; +*/ + chosen { + stdout-path = "serial0:115200n8"; + }; +}; + +&cpu0 { + cpu-supply = <®_dcdc2>; +}; + +&ehci0 { + status = "okay"; +}; + +&i2c0 { + status = "okay"; + + axp209: pmic@34 { + reg = <0x34>; + interrupts = <0>; + }; +}; + +#include "axp209.dtsi" + +&i2c1 { + status = "okay"; + + pcf8563: rtc@51 { + compatible = "nxp,pcf8563"; + reg = <0x51>; + }; +}; + +&lradc { + vref-supply = <®_ldo2>; + status = "okay"; + + button-200 { + label = "Volume Up"; + linux,code = ; + channel = <0>; + voltage = <200000>; + }; + + button-400 { + label = "Volume Down"; + linux,code = ; + channel = <0>; + voltage = <400000>; + }; +}; + +/* PE4 enable??? */ +&mmc0 { + pinctrl-0 = <&mmc0_pins_a>; + vmmc-supply = <®_vcc3v3>; + bus-width = <4>; + cd-gpios = <&pio 6 0 GPIO_ACTIVE_LOW>; /* PG0 */ + status = "okay"; +}; + +&mmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_4bit_pins_a>; + vmmc-supply = <®_vcc3v3>; + bus-width = <4>; + non-removable; + status = "okay"; +}; + +&otg_sram { + status = "okay"; +}; + +/* +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm0_pin>; + status = "okay"; +}; +*/ + +®_dcdc2 { + regulator-always-on; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1400000>; + regulator-name = "vdd-cpu"; +}; + +®_dcdc3 { + regulator-always-on; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-name = "vdd-int-pll"; +}; + +®_ldo1 { + regulator-name = "vdd-rtc"; +}; + +®_ldo2 { + regulator-always-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "avcc"; +}; + +®_ldo3 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-wifi"; +}; + +®_usb0_vbus { + gpio = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */ + status = "okay"; +}; + +®_usb1_vbus { + gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */ + status = "okay"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins_b>; + status = "okay"; +}; + +&usb_otg { + dr_mode = "otg"; + status = "okay"; +}; + +&usbphy { +// usb0_id_det-gpios = <&pio 6 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PG2 */ +// usb0_vbus_det-gpios = <&pio 6 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; /* PG1 */ + usb0_id_det-gpios = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */ + usb0_vbus_det-gpios = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */ + usb0_vbus-supply = <®_usb0_vbus>; + usb1_vbus-supply = <®_usb1_vbus>; + status = "okay"; +}; diff --git a/configs/pocketbook_touch_lux_3_defconfig b/configs/pocketbook_touch_lux_3_defconfig new file mode 100644 index 00000000000..7cc21875df3 --- /dev/null +++ b/configs/pocketbook_touch_lux_3_defconfig @@ -0,0 +1,43 @@ +CONFIG_ARM=y +CONFIG_ARCH_SUNXI=y +CONFIG_NR_DRAM_BANKS=1 +CONFIG_SPL=y +CONFIG_MACH_SUN5I=y +CONFIG_DRAM_CLK=408 +CONFIG_DRAM_EMR1=0 +CONFIG_MMC0_CD_PIN="PG0" +CONFIG_CONS_INDEX=2 +CONFIG_MMC_SUNXI_SLOT_EXTRA=2 +CONFIG_MMC2_BUS_WIDTH=4 +CONFIG_AXP_GPIO=y +CONFIG_SPL_I2C_SUPPORT=y +CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-pocketbook-touch-lux-3" +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set +# CONFIG_CMD_FLASH is not set +# CONFIG_SPL_DOS_PARTITION is not set +# CONFIG_SPL_EFI_PARTITION is not set +# CONFIG_SUN8I_EMAC is not set +# CONFIG_NET is not set +# CONFIG_DM_ETH is not set +# CONFIG_CMD_NET is not set +# CONFIG_CMD_DHCP is not set +# CONFIG_CMD_PXE is not set +# CONFIG_CMD_NFS is not set +# CONFIG_CMD_MII is not set +# CONFIG_CMD_PING is not set +# CONFIG_DISTRO_DEFAULTS is not set +# CONFIG_VIDEO_SUNXI is not set +# CONFIG_VIDEO_HDMI is not set +# CONFIG_VIDEO is not set +CONFIG_CMD_FAT=y +CONFIG_CMD_FS_GENERIC=y +CONFIG_CMD_PART=y +CONFIG_HUSH_PARSER=y +CONFIG_BOOTDELAY=0 +CONFIG_ISO_PARTITION=y +CONFIG_SYS_CONSOLE_INFO_QUIET=y +CONFIG_CMD_BOOTZ=y +#CONFIG_USB0_VBUS_PIN="PG12" +#CONFIG_USB0_VBUS_DET="PG1" +#CONFIG_USB0_ID_DET="PG2" +