From a39240bce797812e259f30922b4a2f067e5124a1 Mon Sep 17 00:00:00 2001 From: JuniorJPDJ Date: Fri, 19 Mar 2021 04:24:30 +0100 Subject: [PATCH] goclever-gcta741l: new device (MR 2040) still missing: * audio * lcd backlight control * touchscreen driver * front camera * accelerometer mount fix (driver seem not to support mount-matrix) * 3D acceleration * HDMI support --- .../testing/device-goclever-gcta741l/APKBUILD | 60 +++++ .../device-goclever-gcta741l/deviceinfo | 28 ++ .../u-boot-script.cmd | 21 ++ ...Fix-PLL1-setup-to-never-use-dividers.patch | 33 +++ temp/u-boot-goclever-gcta741l/APKBUILD | 118 +++++++++ .../add-dtbs-to-makefile.patch | 28 ++ .../goclever-gcta741l_defconfig | 27 ++ .../lark-freeme-70-2s_defconfig | 26 ++ .../prestigio-per5574bc_defconfig | 28 ++ .../sun4i-a10-lark-freeme-70-2s.dts | 246 ++++++++++++++++++ .../sun5i-a13-prestigio-per5574bc.dts | 59 +++++ .../sun6i-a31s-goclever-gcta741l.dts | 103 ++++++++ 12 files changed, 777 insertions(+) create mode 100644 device/testing/device-goclever-gcta741l/APKBUILD create mode 100644 device/testing/device-goclever-gcta741l/deviceinfo create mode 100644 device/testing/device-goclever-gcta741l/u-boot-script.cmd create mode 100644 temp/u-boot-goclever-gcta741l/0001-sunxi-h3-Fix-PLL1-setup-to-never-use-dividers.patch create mode 100644 temp/u-boot-goclever-gcta741l/APKBUILD create mode 100644 temp/u-boot-goclever-gcta741l/add-dtbs-to-makefile.patch create mode 100644 temp/u-boot-goclever-gcta741l/goclever-gcta741l_defconfig create mode 100644 temp/u-boot-goclever-gcta741l/lark-freeme-70-2s_defconfig create mode 100644 temp/u-boot-goclever-gcta741l/prestigio-per5574bc_defconfig create mode 100644 temp/u-boot-goclever-gcta741l/sun4i-a10-lark-freeme-70-2s.dts create mode 100644 temp/u-boot-goclever-gcta741l/sun5i-a13-prestigio-per5574bc.dts create mode 100644 temp/u-boot-goclever-gcta741l/sun6i-a31s-goclever-gcta741l.dts diff --git a/device/testing/device-goclever-gcta741l/APKBUILD b/device/testing/device-goclever-gcta741l/APKBUILD new file mode 100644 index 000000000..5a612ca3a --- /dev/null +++ b/device/testing/device-goclever-gcta741l/APKBUILD @@ -0,0 +1,60 @@ +# Maintainer: Jacek Pruciak +# Reference: +pkgname=device-goclever-gcta741l +pkgdesc="GoClever Orion 70L" +pkgver=0.1 +pkgrel=0 +url="https://postmarketos.org" +license="MIT" +arch="armv7" +options="!check !archcheck" +depends=" + linux-postmarketos-allwinner + mesa-egl + mesa-dri-gallium + postmarketos-base + u-boot-tools + u-boot-goclever-gcta741l +" +makedepends="devicepkg-dev linux-postmarketos-allwinner" +source=" + deviceinfo + u-boot-script.cmd +" +subpackages="$pkgname-nonfree-firmware:nonfree_firmware" + +build() { + devicepkg_build $startdir $pkgname + + mkimage \ + -A arm \ + -O linux \ + -T script \ + -C none \ + -a 0 \ + -e 0 \ + -n postmarketos \ + -d "$srcdir"/u-boot-script.cmd \ + "$srcdir"/boot.scr +} + +package() { + devicepkg_package $startdir $pkgname + + # U-Boot boot script + install -Dm644 "$srcdir"/boot.scr \ + "$pkgdir"/boot/boot.scr + + # Device Tree - temporary workaround: copy from kernel package + install -Dm644 /usr/share/dtb/sun6i-a31s-goclever-gcta741l.dtb \ + "$pkgdir"/boot/dtbs-postmarketos-allwinner/sun6i-a31s-goclever-gcta741l.dtb +} + +nonfree_firmware() { + pkgdesc="Wifi firmware (rtl8188eu)" + depends="linux-firmware-rtlwifi" + mkdir "$subpkgdir" +} + +sha512sums="ae8e102076bb526fdfbe3d507206c0ba253480f545f43cfe9e35a3232b9aed86fde1ef7881fcd5eede57c101012df9d107b29f5e72dffcf6d61d52b16d87f129 deviceinfo +26751c01bd998545b60d45f373e6d8356120ee2e49f923e85e1413b34a3aa1bdf9c84a04aac43c487d587e614710f7ade5a293c83a551cf7e3b2a4a90b076420 u-boot-script.cmd" diff --git a/device/testing/device-goclever-gcta741l/deviceinfo b/device/testing/device-goclever-gcta741l/deviceinfo new file mode 100644 index 000000000..6664191b3 --- /dev/null +++ b/device/testing/device-goclever-gcta741l/deviceinfo @@ -0,0 +1,28 @@ +# Reference: +# Please use double quotes only. You can source this file in shell +# scripts. + +deviceinfo_format_version="0" +deviceinfo_name="GoClever Orion 7OL" +deviceinfo_manufacturer="GoClever" +deviceinfo_codename="goclever-gcta741l" +deviceinfo_year="2013" +deviceinfo_dtb="" +deviceinfo_modules_initfs="" +deviceinfo_arch="armv7" +deviceinfo_mesa_driver="sun4i-drm" + +# Device related +deviceinfo_chassis="tablet" +deviceinfo_keyboard="false" +deviceinfo_external_storage="true" +deviceinfo_screen_width="800" +deviceinfo_screen_height="480" + +# Bootloader related +deviceinfo_flash_method="none" +deviceinfo_sd_embed_firmware="u-boot/goclever-gcta741l/u-boot-sunxi-with-spl.bin:8" + +# USB related +deviceinfo_usb_idVendor="0x1f3a" # Allwinner Technology Co., Ltd. +deviceinfo_usb_idProduct="0x1007" # reference Android device diff --git a/device/testing/device-goclever-gcta741l/u-boot-script.cmd b/device/testing/device-goclever-gcta741l/u-boot-script.cmd new file mode 100644 index 000000000..211198811 --- /dev/null +++ b/device/testing/device-goclever-gcta741l/u-boot-script.cmd @@ -0,0 +1,21 @@ +setenv kernel-flavor postmarketos-allwinner + +setenv bootargs init=/init.sh rw console=tty1 panic=10 consoleblank=0 loglevel=1 PMOS_FORCE_PARTITION_RESIZE pmos_boot=/dev/mmcblk0p1 pmos_root=/dev/mmcblk0p2 + +echo Loading DTB: dtbs-${kernel-flavor}/${fdtfile} +load mmc 0:1 ${fdt_addr_r} dtbs-${kernel-flavor}/${fdtfile} + +echo Resizing FDT +fdt addr ${fdt_addr_r} +fdt resize + +echo Loading Kernel: vmlinuz-${kernel-flavor} +load mmc 0:1 ${kernel_addr_r} vmlinuz-${kernel-flavor} + +echo Loading Initramfs: initramfs-${kernel-flavor} +load mmc 0:1 ${ramdisk_addr_r} initramfs-${kernel-flavor} + +echo Booting kernel +bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r} + +sleep 10 diff --git a/temp/u-boot-goclever-gcta741l/0001-sunxi-h3-Fix-PLL1-setup-to-never-use-dividers.patch b/temp/u-boot-goclever-gcta741l/0001-sunxi-h3-Fix-PLL1-setup-to-never-use-dividers.patch new file mode 100644 index 000000000..38fc91dba --- /dev/null +++ b/temp/u-boot-goclever-gcta741l/0001-sunxi-h3-Fix-PLL1-setup-to-never-use-dividers.patch @@ -0,0 +1,33 @@ +From 1af79995443ac2ed092391561fe93c8b70c5bd9f Mon Sep 17 00:00:00 2001 +From: Ondrej Jirman +Date: Tue, 20 Dec 2016 11:25:12 +0100 +Subject: [PATCH] sunxi: h3: Fix PLL1 setup to never use dividers + +Kernel would lower the divider on first CLK change and cause the +lock up. +--- + arch/arm/mach-sunxi/clock_sun6i.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/mach-sunxi/clock_sun6i.c b/arch/arm/mach-sunxi/clock_sun6i.c +index 8e84062bd7..8705fa5fc5 100644 +--- a/arch/arm/mach-sunxi/clock_sun6i.c ++++ b/arch/arm/mach-sunxi/clock_sun6i.c +@@ -117,11 +117,10 @@ void clock_set_pll1(unsigned int clk) + int k = 1; + int m = 1; + +- if (clk > 1152000000) { ++ if (clk >= 1368000000) { ++ k = 3; ++ } else if (clk >= 768000000) { + k = 2; +- } else if (clk > 768000000) { +- k = 4; +- m = 2; + } + + /* Switch to 24MHz clock while changing PLL1 */ +-- +2.31.0 + diff --git a/temp/u-boot-goclever-gcta741l/APKBUILD b/temp/u-boot-goclever-gcta741l/APKBUILD new file mode 100644 index 000000000..bf6616b54 --- /dev/null +++ b/temp/u-boot-goclever-gcta741l/APKBUILD @@ -0,0 +1,118 @@ +# Maintainer Jacek Pruciak +# Forked from Alpine, add external boards +pkgname=u-boot-goclever-gcta741l +pkgver=2021.01 +pkgrel=0 +pkgdesc="u-boot for goclever-gcta741l" +url="https://www.denx.de/wiki/U-Boot/" +arch="armv7" +license="GPL-2.0-or-later OFL-1.1 BSD-2-Clause BSD-3-Clause eCos-2.0 IBM-pibs + ISC LGPL-2.0-only LGPL-2.1-only X11" +options="!check" # no tests in upstream +makedepends="$depends_dev bc dtc python3-dev swig bison flex openssl-dev + py3-setuptools linux-headers" +# https://github.com/megous/linux/tree/orange-pi-5.12#kernel-lockup-issues +source=" + https://ftp.denx.de/pub/u-boot/u-boot-${pkgver//_/-}.tar.bz2 + 0001-sunxi-h3-Fix-PLL1-setup-to-never-use-dividers.patch + add-dtbs-to-makefile.patch + sun4i-a10-lark-freeme-70-2s.dts + sun5i-a13-prestigio-per5574bc.dts + sun6i-a31s-goclever-gcta741l.dts + goclever-gcta741l_defconfig + lark-freeme-70-2s_defconfig + prestigio-per5574bc_defconfig + " +builddir="$srcdir"/u-boot-${pkgver//_/-} + +board_configs=" + prestigio-per5574bc:prestigio-per5574bc + lark-freeme-70-2s:lark-freeme-70-2s + " + +subpackages="" +for board_config in $board_configs; do + _board="${board_config%%:*}" + subpackages="$subpackages u-boot-$_board:${_board//-/_}" +done + +prepare() { + default_prepare + + cp "$srcdir"/*.dts "$builddir"/arch/arm/dts/ + cp "$srcdir"/*_defconfig "$builddir"/configs/ +} + +build() { + cd "$builddir" + touch include/config.h + LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > include/timestamp_autogenerated.h + LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> include/timestamp_autogenerated.h + + local board_config board + for board_config in "goclever-gcta741l:goclever-gcta741l" $board_configs; do + local configs="${board_config#*:}" + for board in ${configs//,/ }; do + msg "Building u-boot for $board" + + export BUILD_DIR="$builddir"/build/$board + mkdir -p "$BUILD_DIR" + make O="$BUILD_DIR" ${board}_config || return 1 + make O="$BUILD_DIR" all || return 1 + done + done + msg "Building u-boot-tools" + make tools-only_defconfig + make tools-all +} + + +_split_boards() { + cd "$builddir"/build + pkgdesc="u-boot for $1" + depends="" + shift + local board + for board; do + msg "Including board $board" + mkdir -p "$subpkgdir"/usr/share/u-boot/$board + export BUILD_DIR="$builddir"/build/$board + local ok=no + for image in u-boot-sunxi-with-spl.bin -- MLO SPL u-boot.img -- u-boot.bin; do + if [ "$image" = "--" ]; then + [ "$ok" = yes ] && break + continue + fi + if [ -e "$BUILD_DIR"/$image ]; then + cp "$BUILD_DIR"/$image "$subpkgdir"/usr/share/u-boot/$board \ + || return 1 + ok=yes + fi + done + [ "$ok" = yes ] || return 1 + done +} + +package() { + _board="goclever-gcta741l" + _configs="goclever-gcta741l" + export subpkgdir="$pkgdir" + + _split_boards $_board ${_configs//,/ } +} + +for board_config in $board_configs; do + _board="${board_config%%:*}" + _configs="${board_config#*:}" + eval "${_board//-/_}() { _split_boards $_board ${_configs//,/ }; }" +done + +sha512sums="40dd4d9ef87a1829158658c433d46a047a39c0d8c314ad8d133f7240343ee3a75b060f009dd2efe598cfb8a766773f6cd773ea7f7745ee88e52a771c77eb1c6e u-boot-2021.01.tar.bz2 +9478a5b46414139212a11d29e05dd973c4c866e8970b25021517d47b7177a03c910dbe761ae9c5acee0e4f1a5a8db76f24e168b83a5ebd9034d9cb640350604e 0001-sunxi-h3-Fix-PLL1-setup-to-never-use-dividers.patch +37808f4c2651405b848f3072ebd6355db46e3b36d616763317d3e2f35e848aaeca34de05c57150742db018054c4661d71be6df1276c3d34171d6c758ff1a3698 add-dtbs-to-makefile.patch +205966445a09c391945fc0d93ff97297f75782ac57df65c23e2ae8076f0341370031d028d07c39235dfd81fe7e340c19c3ce0ab7594d6a3cd81622683c97db6a sun4i-a10-lark-freeme-70-2s.dts +4913803d7d0e9a97ff75ce3b3c791c89e450beb8320cc8354f8af172af7648823b4b20e3d068662080934351211232fb0827e76124461d4de9f74335c640dcc3 sun5i-a13-prestigio-per5574bc.dts +63ee02f1791c1cc388495bfac87a2b30565d8b70970fa4aa890c3a9edf0fabfb3245895378b269446ba1dd32808f9c2dde416b0bc857c10969023bda5d94770d sun6i-a31s-goclever-gcta741l.dts +b66b916360aae9af41ef161a854420f8dffefc5d50dca833366fed2a6d9cf7509ee12baffd87cd78af1dc350b42fcde80c12e4ed4c92990e0821e656192ad0f6 goclever-gcta741l_defconfig +73d6bfc743c893d295c46b6a2ebcf7fb07f57bf776158e3a41c715d47b8e9890bf9037bdc654ee65b90f7b1596428fb63229264e2d1176ca725d6cc0fc95e6b2 lark-freeme-70-2s_defconfig +b16feabad9944c0ae52394478ccf45034226c7e619f8bf97d8096577291567a6328a70ee9f590e8b260a7f83fad0cbfe12f4b9ff55e8697b52ca264fdbca7395 prestigio-per5574bc_defconfig" diff --git a/temp/u-boot-goclever-gcta741l/add-dtbs-to-makefile.patch b/temp/u-boot-goclever-gcta741l/add-dtbs-to-makefile.patch new file mode 100644 index 000000000..75078b2c4 --- /dev/null +++ b/temp/u-boot-goclever-gcta741l/add-dtbs-to-makefile.patch @@ -0,0 +1,28 @@ +diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile +index fd47e408f8..d35341d893 100644 +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -451,6 +451,7 @@ dtb-$(CONFIG_STM32H7) += stm32h743i-disco.dtb \ + stm32h743i-eval.dtb + + dtb-$(CONFIG_MACH_SUN4I) += \ ++ sun4i-a10-lark-freeme-70-2s.dtb \ + sun4i-a10-a1000.dtb \ + sun4i-a10-ba10-tvbox.dtb \ + sun4i-a10-chuwi-v7-cw0825.dtb \ +@@ -475,6 +476,7 @@ dtb-$(CONFIG_MACH_SUN4I) += \ + sun4i-a10-pcduino2.dtb \ + sun4i-a10-pov-protab2-ips9.dtb + dtb-$(CONFIG_MACH_SUN5I) += \ ++ sun5i-a13-prestigio-per5574bc.dtb \ + sun5i-a10s-auxtek-t003.dtb \ + sun5i-a10s-auxtek-t004.dtb \ + sun5i-a10s-mk802.dtb \ +@@ -495,6 +497,7 @@ dtb-$(CONFIG_MACH_SUN5I) += \ + sun5i-gr8-chip-pro.dtb \ + sun5i-r8-chip.dtb + dtb-$(CONFIG_MACH_SUN6I) += \ ++ sun6i-a31s-goclever-gcta741l.dtb \ + sun6i-a31-app4-evb1.dtb \ + sun6i-a31-colombus.dtb \ + sun6i-a31-hummingbird.dtb \ diff --git a/temp/u-boot-goclever-gcta741l/goclever-gcta741l_defconfig b/temp/u-boot-goclever-gcta741l/goclever-gcta741l_defconfig new file mode 100644 index 000000000..0c23d3ab0 --- /dev/null +++ b/temp/u-boot-goclever-gcta741l/goclever-gcta741l_defconfig @@ -0,0 +1,27 @@ +CONFIG_ARM=y +CONFIG_ARCH_SUNXI=y +CONFIG_SPL=y +CONFIG_MACH_SUN6I=y +CONFIG_DRAM_CLK=360 +CONFIG_DRAM_ZQ=251 +CONFIG_MMC0_CD_PIN="PA8" +CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE" +CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT" +CONFIG_USB0_ID_DET="PA15" +CONFIG_AXP_GPIO=y +CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:14,ri:240,up:3,lo:35,hs:30,vs:13,sync:3,vmode:0" +# le=-14,up=-3 +CONFIG_VIDEO_LCD_DCLK_PHASE=0 +CONFIG_VIDEO_LCD_BL_EN="PA25" +CONFIG_VIDEO_LCD_BL_PWM="PH13" +CONFIG_NR_DRAM_BANKS=1 +CONFIG_SPL_TEXT_BASE=0x60 +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set +CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31s-goclever-gcta741l" +CONFIG_AXP_DLDO1_VOLT=3300 +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_OHCI_HCD=y +CONFIG_USB_MUSB_HOST=y +CONFIG_USB_KEYBOARD=y +CONFIG_USB_STORAGE=y +CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y diff --git a/temp/u-boot-goclever-gcta741l/lark-freeme-70-2s_defconfig b/temp/u-boot-goclever-gcta741l/lark-freeme-70-2s_defconfig new file mode 100644 index 000000000..c6687f632 --- /dev/null +++ b/temp/u-boot-goclever-gcta741l/lark-freeme-70-2s_defconfig @@ -0,0 +1,26 @@ +CONFIG_ARM=y +CONFIG_ARCH_SUNXI=y +CONFIG_SPL=y +CONFIG_MACH_SUN4I=y +CONFIG_DRAM_CLK=360 +CONFIG_DRAM_EMR1=4 +CONFIG_MMC0_CD_PIN="PH1" +CONFIG_USB0_VBUS_DET="PH5" +CONFIG_USB0_VBUS_PIN="PB9" +CONFIG_USB0_ID_DET="PH4" +# CONFIG_VIDEO_HDMI is not set +CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:87,ri:40,up:31,lo:13,hs:1,vs:1,sync:3,vmode:0" +CONFIG_VIDEO_LCD_POWER="PH8" +CONFIG_VIDEO_LCD_BL_EN="PH7" +CONFIG_VIDEO_LCD_BL_PWM="PB2" +CONFIG_NR_DRAM_BANKS=1 +CONFIG_SPL_TEXT_BASE=0x60 +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set +CONFIG_SPL_I2C_SUPPORT=y +CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-lark-freeme-70-2s" +CONFIG_USB_MUSB_HOST=y +CONFIG_USB_OHCI_HCD=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_KEYBOARD=y +CONFIG_USB_STORAGE=y +CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y diff --git a/temp/u-boot-goclever-gcta741l/prestigio-per5574bc_defconfig b/temp/u-boot-goclever-gcta741l/prestigio-per5574bc_defconfig new file mode 100644 index 000000000..bd30cb74e --- /dev/null +++ b/temp/u-boot-goclever-gcta741l/prestigio-per5574bc_defconfig @@ -0,0 +1,28 @@ +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_USB0_VBUS_PIN="PG12" +CONFIG_USB0_VBUS_DET="PG1" +CONFIG_USB0_ID_DET="PG2" +CONFIG_AXP_GPIO=y +# CONFIG_VIDEO_HDMI is not set +CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:30000,le:45,ri:79,up:22,lo:13,hs:1,vs:1,sync:3,vmode:0" +CONFIG_VIDEO_LCD_POWER="AXP0-0" +CONFIG_VIDEO_LCD_BL_EN="AXP0-1" +CONFIG_VIDEO_LCD_BL_PWM="PB2" +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set +CONFIG_SPL_TEXT_BASE=0x60 +CONFIG_SPL_I2C_SUPPORT=y +CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-prestigio-per5574bc" +CONFIG_CONS_INDEX=2 +CONFIG_USB_MUSB_HOST=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_OHCI_HCD=y +CONFIG_USB_KEYBOARD=y +CONFIG_USB_STORAGE=y +CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y diff --git a/temp/u-boot-goclever-gcta741l/sun4i-a10-lark-freeme-70-2s.dts b/temp/u-boot-goclever-gcta741l/sun4i-a10-lark-freeme-70-2s.dts new file mode 100644 index 000000000..fcba87497 --- /dev/null +++ b/temp/u-boot-goclever-gcta741l/sun4i-a10-lark-freeme-70-2s.dts @@ -0,0 +1,246 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR X11) +// Copyright 2021 Jacek Pruciak +// Copyright 2020 Adam Słaboń +// Copyright 2015 Hans de Goede + +/dts-v1/; +#include "sun4i-a10.dtsi" +#include "sunxi-common-regulators.dtsi" +#include +#include +#include +#include + +/ { + model = "Lark FreeMe 70.2S"; + compatible = "lark,freeme-70-2s", "allwinner,sun4i-a10"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + hdmi-connector { + compatible = "hdmi-connector"; + type = "c"; + + port { + hdmi_con_in: endpoint { + remote-endpoint = <&hdmi_out_con>; + }; + }; + }; + + 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>; + enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ + }; + + panel: panel { + compatible = "hannstar,hsd070idw1-a"; + power-supply = <®_vcc3v3>; + enable-gpios = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* PH8 */ + backlight = <&backlight>; + + port { + panel_input: endpoint { + remote-endpoint = <&tcon0_out_lcd>; + }; + }; + }; +}; + +&tcon0 { + pinctrl-names = "default"; + pinctrl-0 = <&lcd_rgb666_pins>; + status = "okay"; +}; + +&tcon0_out { + tcon0_out_lcd: endpoint@0 { + reg = <0>; + remote-endpoint = <&panel_input>; + }; +}; + +&pio { + lcd_rgb666_pins: lcd-rgb666-pins { + pins = "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", + "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", + "PD18", "PD19", "PD20", "PD21", "PD22", "PD23", + "PD24", "PD25", "PD26", "PD27"; + function = "lcd0"; + }; +}; + +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm0_pin>; + status = "okay"; +}; + +&ehci1 { + /* WiFi card */ + status = "okay"; +}; + +&ohci0 { + /* Full USB port - USB1.1 */ + status = "okay"; +}; + +&ehci0 { + /* Full USB port - USB2 */ + status = "okay"; +}; + +&i2c0 { + status = "okay"; + + axp209: pmic@34 { + reg = <0x34>; + interrupts = <0>; + }; +}; + +&i2c1 { + status = "okay"; + + accelerometer@1c { + compatible = "domintech,dmard06"; + reg = <0x1c>; + }; +}; + +#include "axp209.dtsi" + +®_dcdc2 { + regulator-always-on; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1400000>; + regulator-name = "vdd-cpu"; +}; + +®_dcdc3 { + regulator-always-on; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1400000>; + regulator-name = "vdd-int-dll"; +}; + +®_ldo1 { + regulator-name = "vdd-rtc"; +}; + +®_ldo2 { + regulator-always-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "avcc"; +}; + +&ac_power_supply { + status = "okay"; +}; + +&battery_power_supply { + status = "okay"; +}; + +&usb_power_supply { + status = "okay"; +}; + +&i2c1 { + status = "okay"; +}; + +&lradc { + vref-supply = <®_vcc3v0>; + status = "okay"; + + button-400 { + label = "Key Esc"; + linux,code = ; + channel = <0>; + voltage = <400000>; + }; + + button-800 { + label = "Key Menu"; + linux,code = ; + channel = <0>; + voltage = <800000>; + }; +}; + +&mmc0 { + vmmc-supply = <®_vcc3v3>; + bus-width = <4>; + cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */ + status = "okay"; +}; + +&otg_sram { + status = "okay"; +}; + +®_usb0_vbus { + status = "okay"; +}; + +®_usb1_vbus { + status = "okay"; +}; + +®_usb2_vbus { + /* WiFi */ + gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */ + status = "okay"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pb_pins>; + status = "okay"; +}; + +&usb_otg { + dr_mode = "otg"; + status = "okay"; +}; + +&codec { + allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */ + status = "okay"; +}; + +&de { + status = "okay"; +}; + +&hdmi { + status = "okay"; +}; + +&hdmi_out { + hdmi_out_con: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; +}; + +&usbphy { + usb0_id_det-gpios = <&pio 7 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PH4 */ + usb0_vbus_det-gpios = <&pio 7 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; /* PH5 */ + usb0_vbus_power-supply = <&usb_power_supply>; + usb0_vbus-supply = <®_usb0_vbus>; + usb1_vbus-supply = <®_usb1_vbus>; + usb2_vbus-supply = <®_usb2_vbus>; + status = "okay"; +}; diff --git a/temp/u-boot-goclever-gcta741l/sun5i-a13-prestigio-per5574bc.dts b/temp/u-boot-goclever-gcta741l/sun5i-a13-prestigio-per5574bc.dts new file mode 100644 index 000000000..91038c396 --- /dev/null +++ b/temp/u-boot-goclever-gcta741l/sun5i-a13-prestigio-per5574bc.dts @@ -0,0 +1,59 @@ +/* + * Copyright 2018 Jacek Pruciak + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/dts-v1/; +#include "sun5i-a13.dtsi" +#include "sun5i-reference-design-tablet.dtsi" + +/ { + model = "Prestigio Multireader Stream PER5574BC"; + compatible = "prestigio,per5574bc", "allwinner,sun5i-a13"; +}; + +&usb_otg { + // Also doesn't work when set to "otg" + dr_mode = "host"; +}; + +&battery_power_supply { + status = "okay"; +}; diff --git a/temp/u-boot-goclever-gcta741l/sun6i-a31s-goclever-gcta741l.dts b/temp/u-boot-goclever-gcta741l/sun6i-a31s-goclever-gcta741l.dts new file mode 100644 index 000000000..7fb95aef4 --- /dev/null +++ b/temp/u-boot-goclever-gcta741l/sun6i-a31s-goclever-gcta741l.dts @@ -0,0 +1,103 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR X11) +// Copyright 2021 Jacek Pruciak + +/dts-v1/; +#include "sun6i-a31s.dtsi" +#include "sun6i-reference-design-tablet.dtsi" +//#include + +/ { + model = "GoClever Orion 70L"; + compatible = "goclever,gcta741l", "allwinner,sun6i-a31s"; + + panel { + compatible = "hannstar,tqtm070cb501"; + power-supply = <®_dc1sw>; + //backlight = <&backlight>; + + port { + panel_input: endpoint { + remote-endpoint = <&tcon0_out_lcd>; + }; + }; + }; + + // PWM not supported by sun6i at the moment + //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>; + // enable-gpios = <&pio 0 25 GPIO_ACTIVE_HIGH>; /* PA25 */ + //}; +}; + +&usb_otg { + dr_mode = "otg"; +}; + +&battery_power_supply { + status = "okay"; +}; + +&lradc { + vref-supply = <®_aldo3>; + status = "okay"; + + button-1000 { + label = "Home"; + linux,code = ; + channel = <0>; + voltage = <1000000>; + }; +}; + +&i2c2 { + status = "okay"; + + accelerometer@4c { + compatible = "fsl,mma7660"; + reg = <0x4c>; + interrupt-parent = <&pio>; + interrupts = <0 9 IRQ_TYPE_LEVEL_HIGH>; /* PA9 */ + + mount-matrix = "0", "1", "0", + "1", "0", "0", + "0", "0", "1"; + }; +}; + +&tcon0 { + pinctrl-names = "default"; + pinctrl-0 = <&lcd0_rgb888_pins>; + status = "okay"; +}; + +&tcon0_out { + tcon0_out_lcd: endpoint@0 { + reg = <0>; + remote-endpoint = <&panel_input>; + }; +}; + +&de { + status = "okay"; +}; + +&simplefb_lcd { + status = "okay"; +}; + +&codec { + // This still doesn't work + allwinner,audio-routing = + /* sink, source */ + "Headphone", "HP", + "Speaker", "LINEOUT", + "MIC1", "Mic", + "MIC2", "Headset Mic", + "Mic", "MBIAS", + "Headset Mic", "HBIAS"; + allwinner,pa-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */ + status = "okay"; +};