Commit f405aa95 authored by Bhushan Shah's avatar Bhushan Shah

Add pinephone dts and config

parent 97c65687
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (C) 2019 Icenowy Zheng <icenowy@aosc.xyz>
*
*/
/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 = "PinePhone";
compatible = "pine64,pinephone", "allwinner,sun50i-a64";
aliases {
serial0 = &uart0;
ethernet0 = &rtl8723cs;
};
backlight: backlight {
compatible = "pwm-backlight";
pwms = <&r_pwm 0 50000 PWM_POLARITY_INVERTED>;
brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
default-brightness-level = <8>;
enable-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 LCD-BL-EN */
};
chosen {
stdout-path = "serial0:115200n8";
};
i2c-csi {
compatible = "i2c-gpio";
sda-gpios = <&pio 4 13 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN|GPIO_PULL_UP)>; /* PE13 */
scl-gpios = <&pio 4 12 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN|GPIO_PULL_UP)>; /* PE12 */
i2c-gpio,delay-us = <5>;
#address-cells = <1>;
#size-cells = <0>;
/* Rear camera */
ov5640: camera@3c {
compatible = "ovti,ov5640";
reg = <0x3c>;
pinctrl-names = "default";
pinctrl-0 = <&csi_mclk_pin>;
clocks = <&ccu CLK_CSI_MCLK>;
clock-names = "xclk";
AVDD-supply = <&reg_dldo3>;
DOVDD-supply = <&reg_aldo1>;
DVDD-supply = <&reg_eldo3>;
reset-gpios = <&pio 3 3 GPIO_ACTIVE_LOW>; /* PD3 */
powerdown-gpios = <&pio 2 0 GPIO_ACTIVE_HIGH>; /* PC0 */
port {
ov5640_ep: endpoint {
remote-endpoint = <&csi_ep>;
bus-width = <8>;
hsync-active = <1>; /* Active high */
vsync-active = <0>; /* Active low */
data-active = <1>; /* Active high */
pclk-sample = <1>; /* Rising */
};
};
};
};
leds {
compatible = "gpio-leds";
blue {
label = "pinephone:blue:user";
gpios = <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */
};
green {
label = "pinephone:green:user";
gpios = <&pio 3 18 GPIO_ACTIVE_HIGH>; /* PD18 */
};
red {
label = "pinephone:red:user";
gpios = <&pio 3 19 GPIO_ACTIVE_HIGH>; /* PD19 */
};
};
reg_3v3_wifi: regulator-3v3-wifi{
compatible = "regulator-fixed";
regulator-name = "vcc-wifi";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
};
reg_vbat_4g: regulator-vbat-4g{
compatible = "regulator-fixed";
regulator-name = "vbat-4g";
regulator-min-microvolt = <3700000>;
regulator-max-microvolt = <3700000>;
gpio = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /* PL7 */
enable-active-high;
};
reg_vcc5v0: regulator-vcc5v0 {
compatible = "regulator-fixed";
regulator-name = "vcc5v0";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
gpio = <&pio 3 8 GPIO_ACTIVE_HIGH>; /* PD8 */
enable-active-high;
};
speaker_amp: audio-amplifier {
compatible = "simple-audio-amplifier";
enable-gpios = <&pio 2 7 GPIO_ACTIVE_HIGH>; /* PC7 */
sound-name-prefix = "Speaker Amp";
};
vibrator {
compatible = "gpio-vibrator";
enable-gpios = <&pio 3 2 GPIO_ACTIVE_HIGH>; /* PD2 */
vcc-supply = <&reg_dcdc1>;
};
wifi_pwrseq: wifi_pwrseq {
compatible = "mmc-pwrseq-simple";
reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
};
};
&codec {
status = "okay";
};
&codec_analog {
hpvcc-supply = <&reg_eldo1>;
status = "okay";
};
&csi {
status = "okay";
port {
#address-cells = <1>;
#size-cells = <0>;
csi_ep: endpoint {
remote-endpoint = <&ov5640_ep>;
bus-width = <8>;
hsync-active = <1>; /* Active high */
vsync-active = <0>; /* Active low */
data-active = <1>; /* Active high */
pclk-sample = <1>; /* Rising */
};
};
};
&dai {
status = "okay";
};
&cpu0 {
cpu-supply = <&reg_dcdc2>;
};
&de {
status = "okay";
};
&dphy {
status = "okay";
};
&dsi {
vcc-dsi-supply = <&reg_dldo1>;
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
panel@0 {
compatible = "xingbangda,xbd599";
reg = <0>;
reset-gpios = <&pio 3 23 GPIO_ACTIVE_LOW>; /* PD23 */
backlight = <&backlight>;
};
};
&ehci0 {
status = "okay";
};
&ehci1 {
status = "okay";
};
&i2c0 {
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pins>;
status = "okay";
touchscreen@5d {
compatible = "goodix,gt917s";
reg = <0x5d>;
interrupt-parent = <&pio>;
interrupts = <7 4 IRQ_TYPE_LEVEL_HIGH>; /* PH4 */
irq-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
reset-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
AVDD28-supply = <&reg_ldo_io0>;
touchscreen-size-x = <720>;
touchscreen-size-y = <1440>;
};
};
&i2c1 {
pinctrl-names = "default";
pinctrl-0 = <&i2c1_pins>;
status = "okay";
lis3mdl@1e {
compatible = "st,lis3mdl-magn";
reg = <0x1e>;
interrupt-parent = <&pio>;
interrupts = <1 1 IRQ_TYPE_LEVEL_HIGH>; /* PB1 */
vdd-supply = <&reg_dldo1>;
};
mpu6050@68 {
compatible = "invensense,mpu6050";
reg = <0x68>;
interrupt-parent = <&pio>;
interrupts = <7 5 IRQ_TYPE_LEVEL_HIGH>; /* PH5 */
};
stk3311@48 {
compatible = "sensortek,stk3311";
reg = <0x48>;
interrupt-parent = <&pio>;
interrupts = <1 0 IRQ_TYPE_LEVEL_HIGH>; /* PB0 */
};
};
&i2c0_pins {
bias-pull-up;
};
&lradc {
vref-supply = <&reg_aldo3>;
status = "okay";
button-200 {
label = "Volume Up";
linux,code = <KEY_VOLUMEUP>;
channel = <0>;
voltage = <200000>;
};
button-400 {
label = "Volume Down";
linux,code = <KEY_VOLUMEDOWN>;
channel = <0>;
voltage = <400000>;
};
};
&mixer1 {
status = "okay";
};
&mmc0 {
pinctrl-names = "default";
pinctrl-0 = <&mmc0_pins>;
vmmc-supply = <&reg_dcdc1>;
cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
disable-wp;
bus-width = <4>;
status = "okay";
};
&mmc1 {
pinctrl-names = "default";
pinctrl-0 = <&mmc1_pins>;
vmmc-supply = <&reg_3v3_wifi>;
vqmmc-supply = <&reg_dldo4>;
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 = <&reg_dcdc1>;
vqmmc-supply = <&reg_dcdc1>;
bus-width = <8>;
non-removable;
cap-mmc-hw-reset;
status = "okay";
};
&ohci0 {
status = "okay";
};
&ohci1 {
status = "okay";
};
&pio {
vcc-pe-supply = <&reg_aldo1>;
vcc-pg-supply = <&reg_dldo4>;
};
&r_pwm {
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>;
};
};
#include "axp803.dtsi"
&ac_power_supply {
status = "okay";
};
&axp_adc {
x-powers,ts-as-gpadc;
};
&battery_power_supply {
status = "okay";
};
&reg_aldo1 {
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
regulator-name = "dovdd-csi";
};
&reg_aldo2 {
regulator-always-on;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
regulator-name = "vcc-pl";
};
&reg_aldo3 {
regulator-always-on;
regulator-min-microvolt = <2700000>;
regulator-max-microvolt = <3300000>;
regulator-name = "vcc-pll-avcc";
};
&reg_dc1sw {
regulator-always-on;
regulator-name = "dc1sw";
};
&reg_dcdc1 {
regulator-always-on;
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-name = "vcc-3v3";
};
&reg_dcdc2 {
regulator-always-on;
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <1300000>;
regulator-name = "vdd-cpux";
};
/* DCDC3 is polyphased with DCDC2 */
&reg_dcdc5 {
regulator-always-on;
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1200000>;
regulator-name = "vcc-dram";
};
&reg_dcdc6 {
regulator-always-on;
regulator-min-microvolt = <1100000>;
regulator-max-microvolt = <1100000>;
regulator-name = "vdd-sys";
};
&reg_dldo1 {
regulator-always-on;
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-name = "vcc-dsi-sensor";
};
&reg_dldo2 {
regulator-always-on;
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-name = "vcc-mipi-io";
};
&reg_dldo3 {
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
regulator-name = "avdd-csi";
};
&reg_dldo4 {
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-name = "vcc-wifi-io";
};
&reg_eldo1 {
regulator-always-on;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-name = "vcc-lpddr";
};
&reg_eldo3 {
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-name = "dvdd-1v8-csi";
};
&reg_fldo1 {
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1200000>;
regulator-name = "vcc-1v2-hsic";
};
&reg_fldo2 {
regulator-always-on;
regulator-min-microvolt = <1100000>;
regulator-max-microvolt = <1100000>;
regulator-name = "vdd-cpus";
};
&reg_ldo_io0 {
regulator-always-on;
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-name = "vcc-lcd";
status = "okay";
};
&reg_ldo_io1 {
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-name = "vcc-1v8-typec";
status = "okay";
};
&reg_rtc_ldo {
regulator-name = "vcc-rtc";
};
&sound {
status = "okay";
simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>;
simple-audio-card,widgets = "Microphone", "Internal Microphone Left",
"Microphone", "Internal Microphone Right",
"Headphone", "Headphone Jack",
"Speaker", "Internal Speaker",
"Speaker", "Internal Earpiece";
simple-audio-card,routing =
"Left DAC", "AIF1 Slot 0 Left",
"Right DAC", "AIF1 Slot 0 Right",
"Speaker Amp INL", "LINEOUT",
"Speaker Amp INR", "LINEOUT",
"Internal Speaker", "Speaker Amp OUTL",
"Internal Speaker", "Speaker Amp OUTR",
"Internal Earpiece", "EARPIECE",
"Headphone Jack", "HP",
"AIF1 Slot 0 Left ADC", "Left ADC",
"AIF1 Slot 0 Right ADC", "Right ADC",
"Internal Microphone Left", "MBIAS",
"MIC1", "Internal Microphone Left",
"Internal Microphone Right", "HBIAS",
"MIC2", "Internal Microphone Right";
};
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pb_pins>;
status = "okay";
};
&uart1 {
pinctrl-names = "default";
pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
status = "okay";
bluetooth {
compatible = "realtek,rtl8723cs-bt";
reset-gpios = <&r_pio 0 4 GPIO_ACTIVE_LOW>; /* PL4 */
device-wake-gpios = <&pio 7 6 GPIO_ACTIVE_LOW>; /* PH6 */
host-wake-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */
firmware-postfix = "pinebook";
};
};
&usb_otg {
dr_mode = "peripheral";
status = "okay";
};
&usb_power_supply {
status = "okay";
};
&usbphy {
usb1_vbus-supply = <&reg_vbat_4g>;
status = "okay";
};
CONFIG_ARM=y
CONFIG_ARCH_SUNXI=y
CONFIG_SPL=y
CONFIG_MACH_SUN50I=y
CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y
CONFIG_SUNXI_DRAM_LPDDR3_STOCK=y
CONFIG_DRAM_CLK=552
CONFIG_DRAM_ZQ=3881949
CONFIG_MMC0_CD_PIN=""
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_SPL_SPI_SUNXI=y
CONFIG_NR_DRAM_BANKS=1
# 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_DEFAULT_DEVICE_TREE="sun50i-a64-pinephone"
CONFIG_SUN8I_EMAC=n
CONFIG_USB_EHCI_HCD=n
CONFIG_USB_OHCI_HCD=n
CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment