From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andre Heider Date: Tue, 26 Nov 2019 09:16:02 +0100 Subject: [U-Boot] [PATCH v2 4/4] arm64: dts: sun50i: Add support for Orange Pi 3 In-Reply-To: <20191126081602.2264519-1-a.heider@gmail.com> References: <20191126081602.2264519-1-a.heider@gmail.com> Message-ID: <20191126081602.2264519-5-a.heider@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de The dts is taken from kernel tag v5.4. The Bluetooth controller of this device ships with a default adress, use the new CONFIG_FIXUP_BDADDR option to fix it up. Signed-off-by: Andre Heider --- arch/arm/dts/Makefile | 1 + arch/arm/dts/sun50i-h6-orangepi-3.dts | 287 ++++++++++++++++++++++++++ board/sunxi/MAINTAINERS | 5 + configs/orangepi_3_defconfig | 18 ++ 4 files changed, 311 insertions(+) create mode 100644 arch/arm/dts/sun50i-h6-orangepi-3.dts create mode 100644 configs/orangepi_3_defconfig diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index d8846df1bd..5040d4f50d 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -540,6 +540,7 @@ dtb-$(CONFIG_MACH_SUN50I_H5) +=3D \ sun50i-h5-orangepi-zero-plus2.dtb dtb-$(CONFIG_MACH_SUN50I_H6) +=3D \ sun50i-h6-beelink-gs1.dtb \ + sun50i-h6-orangepi-3.dtb \ sun50i-h6-orangepi-lite2.dtb \ sun50i-h6-orangepi-one-plus.dtb \ sun50i-h6-pine-h64.dtb diff --git a/arch/arm/dts/sun50i-h6-orangepi-3.dts b/arch/arm/dts/sun50i-h6= -orangepi-3.dts new file mode 100644 index 0000000000..eb379cd402 --- /dev/null +++ b/arch/arm/dts/sun50i-h6-orangepi-3.dts @@ -0,0 +1,287 @@ +// SPDX-License-Identifier: (GPL-2.0+ or MIT) +/* + * Copyright (C) 2019 Ond=C5=99ej Jirman + */ + +/dts-v1/; + +#include "sun50i-h6.dtsi" + +#include + +/ { + model =3D "OrangePi 3"; + compatible =3D "xunlong,orangepi-3", "allwinner,sun50i-h6"; + + aliases { + serial0 =3D &uart0; + }; + + chosen { + stdout-path =3D "serial0:115200n8"; + }; + + connector { + compatible =3D "hdmi-connector"; + ddc-en-gpios =3D <&pio 7 2 GPIO_ACTIVE_HIGH>; /* PH2 */ + type =3D "a"; + + port { + hdmi_con_in: endpoint { + remote-endpoint =3D <&hdmi_out_con>; + }; + }; + }; + + leds { + compatible =3D "gpio-leds"; + + power { + label =3D "orangepi:red:power"; + gpios =3D <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */ + default-state =3D "on"; + }; + + status { + label =3D "orangepi:green:status"; + gpios =3D <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /* PL7 */ + }; + }; + + reg_vcc5v: vcc5v { + /* board wide 5V supply directly from the DC jack */ + compatible =3D "regulator-fixed"; + regulator-name =3D "vcc-5v"; + regulator-min-microvolt =3D <5000000>; + regulator-max-microvolt =3D <5000000>; + regulator-always-on; + }; + + reg_vcc33_wifi: vcc33-wifi { + /* Always on 3.3V regulator for WiFi and BT */ + compatible =3D "regulator-fixed"; + regulator-name =3D "vcc33-wifi"; + regulator-min-microvolt =3D <3300000>; + regulator-max-microvolt =3D <3300000>; + regulator-always-on; + vin-supply =3D <®_vcc5v>; + }; + + reg_vcc_wifi_io: vcc-wifi-io { + /* Always on 1.8V/300mA regulator for WiFi and BT IO */ + compatible =3D "regulator-fixed"; + regulator-name =3D "vcc-wifi-io"; + regulator-min-microvolt =3D <1800000>; + regulator-max-microvolt =3D <1800000>; + regulator-always-on; + vin-supply =3D <®_vcc33_wifi>; + }; + + wifi_pwrseq: wifi-pwrseq { + compatible =3D "mmc-pwrseq-simple"; + clocks =3D <&rtc 1>; + clock-names =3D "ext_clock"; + reset-gpios =3D <&r_pio 1 3 GPIO_ACTIVE_LOW>; /* PM3 */ + post-power-on-delay-ms =3D <200>; + }; +}; + +&cpu0 { + cpu-supply =3D <®_dcdca>; +}; + +&de { + status =3D "okay"; +}; + +&ehci0 { + status =3D "okay"; +}; + +&ehci3 { + status =3D "okay"; +}; + +&hdmi { + status =3D "okay"; +}; + +&hdmi_out { + hdmi_out_con: endpoint { + remote-endpoint =3D <&hdmi_con_in>; + }; +}; + +&mmc0 { + vmmc-supply =3D <®_cldo1>; + cd-gpios =3D <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ + bus-width =3D <4>; + status =3D "okay"; +}; + +&mmc1 { + vmmc-supply =3D <®_vcc33_wifi>; + vqmmc-supply =3D <®_vcc_wifi_io>; + mmc-pwrseq =3D <&wifi_pwrseq>; + bus-width =3D <4>; + non-removable; + status =3D "okay"; + + brcm: sdio-wifi at 1 { + reg =3D <1>; + compatible =3D "brcm,bcm4329-fmac"; + interrupt-parent =3D <&r_pio>; + interrupts =3D <1 0 IRQ_TYPE_LEVEL_LOW>; /* PM0 */ + interrupt-names =3D "host-wake"; + }; +}; + +&ohci0 { + status =3D "okay"; +}; + +&ohci3 { + status =3D "okay"; +}; + +&pio { + vcc-pc-supply =3D <®_bldo2>; + vcc-pd-supply =3D <®_cldo1>; + vcc-pg-supply =3D <®_vcc_wifi_io>; +}; + +&r_i2c { + status =3D "okay"; + + axp805: pmic at 36 { + compatible =3D "x-powers,axp805", "x-powers,axp806"; + reg =3D <0x36>; + interrupt-parent =3D <&r_intc>; + interrupts =3D <0 IRQ_TYPE_LEVEL_LOW>; + interrupt-controller; + #interrupt-cells =3D <1>; + x-powers,self-working-mode; + vina-supply =3D <®_vcc5v>; + vinb-supply =3D <®_vcc5v>; + vinc-supply =3D <®_vcc5v>; + vind-supply =3D <®_vcc5v>; + vine-supply =3D <®_vcc5v>; + aldoin-supply =3D <®_vcc5v>; + bldoin-supply =3D <®_vcc5v>; + cldoin-supply =3D <®_vcc5v>; + + regulators { + reg_aldo1: aldo1 { + regulator-always-on; + regulator-min-microvolt =3D <3300000>; + regulator-max-microvolt =3D <3300000>; + regulator-name =3D "vcc-pl-led-ir"; + }; + + reg_aldo2: aldo2 { + regulator-min-microvolt =3D <3300000>; + regulator-max-microvolt =3D <3300000>; + regulator-name =3D "vcc33-audio-tv-ephy-mac"; + }; + + /* ALDO3 is shorted to CLDO1 */ + reg_aldo3: aldo3 { + regulator-always-on; + regulator-min-microvolt =3D <3300000>; + regulator-max-microvolt =3D <3300000>; + regulator-name =3D "vcc33-io-pd-emmc-sd-usb-uart-1"; + }; + + reg_bldo1: bldo1 { + regulator-always-on; + regulator-min-microvolt =3D <1800000>; + regulator-max-microvolt =3D <1800000>; + regulator-name =3D "vcc18-dram-bias-pll"; + }; + + reg_bldo2: bldo2 { + regulator-always-on; + regulator-min-microvolt =3D <1800000>; + regulator-max-microvolt =3D <1800000>; + regulator-name =3D "vcc-efuse-pcie-hdmi-pc"; + }; + + bldo3 { + /* unused */ + }; + + bldo4 { + /* unused */ + }; + + reg_cldo1: cldo1 { + regulator-always-on; + regulator-min-microvolt =3D <3300000>; + regulator-max-microvolt =3D <3300000>; + regulator-name =3D "vcc33-io-pd-emmc-sd-usb-uart-2"; + }; + + cldo2 { + /* unused */ + }; + + cldo3 { + /* unused */ + }; + + reg_dcdca: dcdca { + regulator-always-on; + regulator-min-microvolt =3D <800000>; + regulator-max-microvolt =3D <1160000>; + regulator-name =3D "vdd-cpu"; + }; + + reg_dcdcc: dcdcc { + regulator-min-microvolt =3D <810000>; + regulator-max-microvolt =3D <1080000>; + regulator-name =3D "vdd-gpu"; + }; + + reg_dcdcd: dcdcd { + regulator-always-on; + regulator-min-microvolt =3D <960000>; + regulator-max-microvolt =3D <960000>; + regulator-name =3D "vdd-sys"; + }; + + reg_dcdce: dcdce { + regulator-always-on; + regulator-min-microvolt =3D <1200000>; + regulator-max-microvolt =3D <1200000>; + regulator-name =3D "vcc-dram"; + }; + + sw { + /* unused */ + }; + }; + }; +}; + +&uart0 { + pinctrl-names =3D "default"; + pinctrl-0 =3D <&uart0_ph_pins>; + status =3D "okay"; +}; + +&usb2otg { + /* + * This board doesn't have a controllable VBUS even though it + * does have an ID pin. Using it as anything but a USB host is + * unsafe. + */ + dr_mode =3D "host"; + status =3D "okay"; +}; + +&usb2phy { + usb0_id_det-gpios =3D <&pio 2 15 GPIO_ACTIVE_HIGH>; /* PC15 */ + usb0_vbus-supply =3D <®_vcc5v>; + usb3_vbus-supply =3D <®_vcc5v>; + status =3D "okay"; +}; diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS index a2adf89b5d..3c0fd0cae8 100644 --- a/board/sunxi/MAINTAINERS +++ b/board/sunxi/MAINTAINERS @@ -375,6 +375,11 @@ M: Icenowy Zheng S: Maintained F: configs/teres_i_defconfig =20 +ORANGEPI 3 BOARD +M: Andre Heider +S: Maintained +F: configs/orangepi_3_defconfig + ORANGEPI LITE2 BOARD M: Jagan Teki S: Maintained diff --git a/configs/orangepi_3_defconfig b/configs/orangepi_3_defconfig new file mode 100644 index 0000000000..c9db0abb77 --- /dev/null +++ b/configs/orangepi_3_defconfig @@ -0,0 +1,18 @@ +CONFIG_ARM=3Dy +CONFIG_ARCH_SUNXI=3Dy +CONFIG_NR_DRAM_BANKS=3D1 +CONFIG_SPL=3Dy +CONFIG_MACH_SUN50I_H6=3Dy +CONFIG_SUNXI_DRAM_H6_LPDDR3=3Dy +CONFIG_MMC0_CD_PIN=3D"PF6" +CONFIG_MMC_SUNXI_SLOT_EXTRA=3D2 +CONFIG_FIXUP_BDADDR=3D"brcm,bcm4345c5" +# CONFIG_PSCI_RESET is not set +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set +CONFIG_USE_PREBOOT=3Dy +# 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-h6-orangepi-3" +CONFIG_USB_EHCI_HCD=3Dy +CONFIG_USB_OHCI_HCD=3Dy --=20 2.24.0