diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile index 09288ce2c266fa..69ca83712a4f96 100644 --- a/package/boot/uboot-sunxi/Makefile +++ b/package/boot/uboot-sunxi/Makefile @@ -483,6 +483,12 @@ define U-Boot/tlink_e1 BUILD_DEVICES:=kooiot_tlink-e1 endef +define U-Boot/tlink_rp_t113 + BUILD_SUBTARGET:=cortexa7 + NAME:=RP T113-S3 board + BUILD_DEVICES:=kooiot_tlink-rp-t113 +endef + define U-Boot/tlink_c4 BUILD_SUBTARGET:=cortexa7 NAME:=ThingsLink C4 @@ -551,6 +557,7 @@ UBOOT_TARGETS := \ tlink_m416 \ tlink_e1 \ tlink_s1 \ + tlink_rp_t113 \ Lichee_Zero_Plus \ sinlinx_sin_v3s \ nanopi_neo2 \ diff --git a/package/boot/uboot-sunxi/patches/823-board-sunxi-support-t113s-uart4-console.patch b/package/boot/uboot-sunxi/patches/823-board-sunxi-support-t113s-uart4-console.patch new file mode 100644 index 00000000000000..72907a59258ee6 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/823-board-sunxi-support-t113s-uart4-console.patch @@ -0,0 +1,25 @@ +diff -Nurp a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c +--- a/arch/arm/mach-sunxi/board.c ++++ b/arch/arm/mach-sunxi/board.c +@@ -195,6 +195,10 @@ static int gpio_init(void) + sunxi_gpio_set_cfgpin(SUNXI_GPL(2), SUN8I_GPL_R_UART); + sunxi_gpio_set_cfgpin(SUNXI_GPL(3), SUN8I_GPL_R_UART); + sunxi_gpio_set_pull(SUNXI_GPL(3), SUNXI_GPIO_PULL_UP); ++#elif CONFIG_CONS_INDEX == 5 && defined(CONFIG_MACH_SUN8I_R528) ++ sunxi_gpio_set_cfgpin(SUNXI_GPD(7), 5); ++ sunxi_gpio_set_cfgpin(SUNXI_GPD(8), 5); ++ sunxi_gpio_set_pull(SUNXI_GPD(8), SUNXI_GPIO_PULL_UP); + #elif CONFIG_CONS_INDEX == 2 && (defined(CONFIG_MACH_SUN8I) && \ + !defined(CONFIG_MACH_SUN8I_R40)) \ + || defined(CONFIG_MACH_SUN8I_R528) +diff -Nurp a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c +--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c ++++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c +@@ -623,6 +623,7 @@ static const struct sunxi_pinctrl_functi + #else + { "uart3", 7 }, /* PB6-PB7 */ + #endif ++ { "uart4", 5 }, /* PD7-PD8 */ + }; + + static const struct sunxi_pinctrl_desc __maybe_unused sun20i_d1_pinctrl_desc = { diff --git a/package/boot/uboot-sunxi/patches/894-ARM-dts-rp-t113s.patch b/package/boot/uboot-sunxi/patches/894-ARM-dts-rp-t113s.patch new file mode 100644 index 00000000000000..636c43d70fe06e --- /dev/null +++ b/package/boot/uboot-sunxi/patches/894-ARM-dts-rp-t113s.patch @@ -0,0 +1,134 @@ +--- /dev/null ++++ b/configs/tlink_rp_t113_defconfig +@@ -0,0 +1,17 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_SUNXI=y ++CONFIG_DEFAULT_DEVICE_TREE="sun8i-t113s-tlink-rp-t113" ++CONFIG_SPL=y ++CONFIG_MACH_SUN8I_R528=y ++CONFIG_DRAM_CLK=792 ++CONFIG_DRAM_ZQ=8092667 ++CONFIG_SUNXI_MINIMUM_DRAM_MB=128 ++# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set ++CONFIG_DRAM_SUNXI_ODT_EN=0 ++CONFIG_DRAM_SUNXI_TPR0=0x004a2195 ++CONFIG_DRAM_SUNXI_TPR11=0x340000 ++CONFIG_DRAM_SUNXI_TPR12=0x46 ++CONFIG_DRAM_SUNXI_TPR13=0x34000100 ++CONFIG_CONS_INDEX=4 ++CONFIG_UART3_PORT_E=y ++CONFIG_MMC_SUNXI_SLOT_EXTRA=2 +--- /dev/null ++++ b/arch/arm/dts/sun8i-t113s-tlink-rp-t113.dts +@@ -0,0 +1,111 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++// Copyright (C) 2024 Dirk Chang . ++ ++#include ++#include ++#include ++ ++/dts-v1/; ++ ++#include "sun8i-t113s.dtsi" ++ ++/ { ++ model = "ThingsLink RP-T113"; ++ compatible = "kooiot,tlink-rp-t113", "allwinner,sun8i-t113s"; ++ ++ aliases { ++ serial0 = &uart3; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ /* board wide 5V supply directly from the USB-C socket */ ++ reg_vcc5v: regulator-5v { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc-5v"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-always-on; ++ }; ++ ++ /* SY8008 DC/DC regulator on the board */ ++ reg_3v3: regulator-3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc-3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <®_vcc5v>; ++ }; ++ ++ /* SY8008 DC/DC regulator on the board, also supplying VDD-SYS */ ++ reg_vcc_core: regulator-core { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc-core"; ++ regulator-min-microvolt = <880000>; ++ regulator-max-microvolt = <880000>; ++ vin-supply = <®_vcc5v>; ++ }; ++ ++ /* XC6206 LDO on the board */ ++ reg_avdd2v8: regulator-avdd { ++ compatible = "regulator-fixed"; ++ regulator-name = "avdd2v8"; ++ regulator-min-microvolt = <2800000>; ++ regulator-max-microvolt = <2800000>; ++ vin-supply = <®_3v3>; ++ }; ++}; ++ ++&cpu0 { ++ cpu-supply = <®_vcc_core>; ++}; ++ ++&cpu1 { ++ cpu-supply = <®_vcc_core>; ++}; ++ ++&dcxo { ++ clock-frequency = <24000000>; ++}; ++ ++&mmc0 { ++ pinctrl-0 = <&mmc0_pins>; ++ pinctrl-names = "default"; ++ vmmc-supply = <®_3v3>; ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; ++ disable-wp; ++ bus-width = <4>; ++ status = "okay"; ++}; ++ ++&mmc2 { ++ bus-width = <8>; ++ non-removable; ++ vmmc-supply = <®_3v3>; ++ vqmmc-supply = <®_3v3>; ++ pinctrl-0 = <&mmc2_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++}; ++ ++&pio { ++ vcc-pb-supply = <®_3v3>; ++ vcc-pd-supply = <®_3v3>; ++ vcc-pe-supply = <®_avdd2v8>; ++ vcc-pf-supply = <®_3v3>; ++ vcc-pg-supply = <®_3v3>; ++ ++ uart3_pe_pins: uart3-pe-pins { ++ pins = "PE8", "PE9"; ++ function = "uart3"; ++ }; ++}; ++ ++&uart3 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart3_pe_pins>; ++ status = "okay"; ++}; ++ diff --git a/package/boot/uboot-sunxi/patches/923-ARM-dts-tlink-e1.patch b/package/boot/uboot-sunxi/patches/923-ARM-dts-tlink-e1.patch index 1b34a60140be1b..1702fcc4b45d42 100644 --- a/package/boot/uboot-sunxi/patches/923-ARM-dts-tlink-e1.patch +++ b/package/boot/uboot-sunxi/patches/923-ARM-dts-tlink-e1.patch @@ -8,6 +8,8 @@ +CONFIG_MACH_SUN8I_R528=y +CONFIG_DRAM_CLK=792 +CONFIG_DRAM_ZQ=8092667 ++CONFIG_MMC0_CD_PIN="PF6" ++CONFIG_MMC_SUNXI_SLOT_EXTRA=2 +CONFIG_SUNXI_MINIMUM_DRAM_MB=128 +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set +CONFIG_DRAM_SUNXI_ODT_EN=0 @@ -15,14 +17,12 @@ +CONFIG_DRAM_SUNXI_TPR11=0x340000 +CONFIG_DRAM_SUNXI_TPR12=0x46 +CONFIG_DRAM_SUNXI_TPR13=0x34000100 -+CONFIG_CONS_INDEX=4 -+CONFIG_UART3_PORT_E=y -+CONFIG_MMC_SUNXI_SLOT_EXTRA=2 ++CONFIG_CONS_INDEX=5 --- /dev/null +++ b/arch/arm/dts/sun8i-t113s-tlink-e1.dts -@@ -0,0 +1,111 @@ +@@ -0,0 +1,124 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+// Copyright (C) 2022 Arm Ltd. ++// Copyright (C) 2024 Dirk Chang + +#include +#include @@ -37,14 +37,13 @@ + compatible = "kooiot,tlink-e1", "allwinner,sun8i-t113s"; + + aliases { -+ serial0 = &uart3; ++ serial0 = &uart4; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + -+ /* board wide 5V supply directly from the USB-C socket */ + reg_vcc5v: regulator-5v { + compatible = "regulator-fixed"; + regulator-name = "vcc-5v"; @@ -53,7 +52,6 @@ + regulator-always-on; + }; + -+ /* SY8008 DC/DC regulator on the board */ + reg_3v3: regulator-3v3 { + compatible = "regulator-fixed"; + regulator-name = "vcc-3v3"; @@ -62,12 +60,28 @@ + vin-supply = <®_vcc5v>; + }; + -+ /* SY8008 DC/DC regulator on the board, also supplying VDD-SYS */ ++ reg_1v8: regulator-1v8 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc-1v8"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1900000>; ++ vin-supply = <®_3v3>; ++ }; ++ ++ reg_vcc_wifi_3v3: regulator-wifi-3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc-wifi-3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; /* PD20 EXT-P-EN pin */ ++ vin-supply = <®_vcc5v>; ++ }; ++ ++ /* SY8089 DC/DC regulator on the board, also supplying VDD-SYS */ + reg_vcc_core: regulator-core { + compatible = "regulator-fixed"; + regulator-name = "vcc-core"; -+ regulator-min-microvolt = <880000>; -+ regulator-max-microvolt = <880000>; ++ regulator-min-microvolt = <950000>; ++ regulator-max-microvolt = <950000>; + vin-supply = <®_vcc5v>; + }; + @@ -97,7 +111,7 @@ + pinctrl-0 = <&mmc0_pins>; + pinctrl-names = "default"; + vmmc-supply = <®_3v3>; -+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ + disable-wp; + bus-width = <4>; + status = "okay"; @@ -116,19 +130,18 @@ +&pio { + vcc-pb-supply = <®_3v3>; + vcc-pd-supply = <®_3v3>; -+ vcc-pe-supply = <®_avdd2v8>; ++ vcc-pe-supply = <®_3v3>; + vcc-pf-supply = <®_3v3>; -+ vcc-pg-supply = <®_3v3>; ++ vcc-pg-supply = <®_1v8>; + -+ uart3_pe_pins: uart3-pe-pins { -+ pins = "PE8", "PE9"; -+ function = "uart3"; ++ uart4_pd_pins: uart4-pd-pins { ++ pins = "PD7", "PD8"; ++ function = "uart4"; + }; +}; + -+&uart3 { ++&uart4 { + pinctrl-names = "default"; -+ pinctrl-0 = <&uart3_pe_pins>; ++ pinctrl-0 = <&uart4_pd_pins>; + status = "okay"; +}; -+ diff --git a/package/boot/uboot-sunxi/patches/999-sunxi-add-boards-dts.patch b/package/boot/uboot-sunxi/patches/999-sunxi-add-boards-dts.patch index 702d866fd1e7f3..775a223c9c165b 100644 --- a/package/boot/uboot-sunxi/patches/999-sunxi-add-boards-dts.patch +++ b/package/boot/uboot-sunxi/patches/999-sunxi-add-boards-dts.patch @@ -1,6 +1,6 @@ --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile -@@ -673,6 +673,8 @@ +@@ -772,6 +772,8 @@ dtb-$(CONFIG_MACH_SUN8I_A83T) += \ sun8i-a83t-bananapi-m3.dtb \ sun8i-a83t-cubietruck-plus.dtb \ sun8i-a83t-tbs-a711.dtb @@ -9,7 +9,7 @@ dtb-$(CONFIG_MACH_SUN8I_H3) += \ sun8i-h2-plus-bananapi-m2-zero.dtb \ sun8i-h2-plus-libretech-all-h3-cc.dtb \ -@@ -699,16 +701,31 @@ +@@ -798,19 +800,36 @@ dtb-$(CONFIG_MACH_SUN8I_H3) += \ sun8i-h3-orangepi-plus2e.dtb \ sun8i-h3-orangepi-zero-plus2.dtb \ sun8i-h3-rervision-dvk.dtb \ @@ -40,5 +40,11 @@ + sun8i-s3-tlink-s1.dtb \ + sun8i-v3s-sinlinx-sin-v3s.dtb \ sun8i-v3s-licheepi-zero.dtb + dtb-$(CONFIG_MACH_SUN8I_R528) += \ +- sun8i-t113s-mangopi-mq-r-t113.dtb ++ sun8i-t113s-mangopi-mq-r-t113.dtb \ ++ sun8i-t113s-tlink-rp-t113.dtb \ ++ sun8i-t113s-tlink-e1.dtb dtb-$(CONFIG_MACH_SUN50I_H5) += \ sun50i-h5-bananapi-m2-plus.dtb \ + sun50i-h5-emlid-neutis-n5-devboard.dtb \ diff --git a/package/boot/uboot-sunxi/uEnv-t113.txt b/package/boot/uboot-sunxi/uEnv-t113.txt deleted file mode 100644 index f4c0634d5dfc11..00000000000000 --- a/package/boot/uboot-sunxi/uEnv-t113.txt +++ /dev/null @@ -1,8 +0,0 @@ -setenv fdt_high ffffffff -setenv mmc_rootpart 2 -part uuid mmc ${mmc_bootdev}:${mmc_rootpart} uuid -setenv loadkernel load mmc \$mmc_bootdev \$kernel_addr_r uImage -setenv loaddtb load mmc \$mmc_bootdev \$fdt_addr_r dtb -setenv bootargs console=ttyS0,115200 console=ttyS3,115200 earlyprintk root=PARTUUID=${uuid} rootwait -setenv uenvcmd run loadkernel \&\& run loaddtb \&\& bootm \$kernel_addr_r - \$fdt_addr_r -run uenvcmd diff --git a/target/linux/sunxi/image/cortexa7.mk b/target/linux/sunxi/image/cortexa7.mk index 952b73d174e2a9..cbc74c05e0617e 100644 --- a/target/linux/sunxi/image/cortexa7.mk +++ b/target/linux/sunxi/image/cortexa7.mk @@ -608,6 +608,26 @@ define Device/kooiot_tlink-m416 endef TARGET_DEVICES += kooiot_tlink-m416 +define Device/kooiot_tlink-rp-t113 + DEVICE_VENDOR := KooIoT + DEVICE_MODEL := ThingsLink RP-T113 + DEVICE_PACKAGES:=kmod-rtc-sunxi \ + wpad-basic-mbedtls \ + kmod-usb2 kmod-usb-ohci kmod-gpio-button-hotplug \ + kmod-leds-gpio kmod-ledtrig-heartbeat \ + kmod-ledtrig-netdev kmod-ledtrig-gpio \ + kmod-usb-serial kmod-usb-serial-option \ + kmod-usb-serial-qualcomm kmod-usb-net-qmi-wwan \ + kmod-can-bcm kmod-can-raw ip-full\ + uqmi fdisk usbutils freeioe wwanleds \ + luci-app-freeioe luci-proto-qmi luci-proto-3g \ + tinc-freeioe-tunnel ser2net shellinabox iperf3 ethtool \ + blockd kmod-usb-storage \ + usb-otg-sunxi kmod-usb-gadget-serial + SOC := sun8i-t113 +endef +TARGET_DEVICES += kooiot_tlink-rp-t113 + define Device/kooiot_tlink-e1 DEVICE_VENDOR := KooIoT DEVICE_MODEL := ThingsLink E1 diff --git a/target/linux/sunxi/patches-6.6/894-ARM-dts-sun8i-kooiot-tlink-rp-t113.patch b/target/linux/sunxi/patches-6.6/894-ARM-dts-sun8i-kooiot-tlink-rp-t113.patch new file mode 100644 index 00000000000000..455ddb5515ade3 --- /dev/null +++ b/target/linux/sunxi/patches-6.6/894-ARM-dts-sun8i-kooiot-tlink-rp-t113.patch @@ -0,0 +1,406 @@ +--- a/arch/arm/boot/dts/allwinner/Makefile ++++ b/arch/arm/boot/dts/allwinner/Makefile +@@ -338,7 +338,8 @@ dtb-$(CONFIG_MACH_SUN8I) += \ + sun8i-v3s-sinlinx-sin-v3s.dtb \ + sun8i-v40-bananapi-m2-berry.dtb \ + sun8i-t113-mangopi-dual.dtb \ +- sun8i-t113-iot-station.dtb ++ sun8i-t113-iot-station.dtb \ ++ sun8i-t113-tlink-rp-t113.dtb + dtb-$(CONFIG_MACH_SUN9I) += \ + sun9i-a80-optimus.dtb \ + sun9i-a80-cubieboard4.dtb +--- /dev/null ++++ b/arch/arm/boot/dts/allwinner/sun8i-t113-tlink-rp-t113.dts +@@ -0,0 +1,391 @@ ++// SPDX-License-Identifier: (GPL-2.0+ or MIT) ++// Copyright (C) 2024 Dirk Chang ++ ++/dts-v1/; ++ ++#include ++#include ++#include ++#include ++#include ++#include "sun8i-t113.dtsi" ++ ++/ { ++ model = "ThingsLink RP-T113"; ++ compatible = "kooiot,tlink-rp-t113", "allwinner,sun8i-t113"; ++ ++ aliases { ++ ethernet0 = &emac; ++ mmc0 = &mmc0; ++ mmc1 = &mmc2; ++ serial0 = &uart3; ++ serial1 = &uart0; ++ serial2 = &uart1; ++ serial3 = &uart4; ++ serial4 = &uart5; ++ spi0 = &spi0; ++ spi1 = &spi1; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@40000000 { ++ device_type = "memory"; ++ reg = <0x40000000 0x8000000>; /* SIP 128MB */ ++ }; ++ ++ reg_vcc: vcc { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ }; ++ ++ reg_usbvbus: usbvbus { ++ compatible = "regulator-fixed"; ++ regulator-name = "usbvbus"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <®_vcc>; ++ }; ++ ++ reg_vcc_3v3: vcc-3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc-3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <®_vcc>; ++ }; ++ ++ // reg_avdd2v8: avdd2v8 { ++ // compatible = "regulator-fixed"; ++ // regulator-name = "avdd2v8"; ++ // regulator-min-microvolt = <2800000>; ++ // regulator-max-microvolt = <2800000>; ++ // vin-supply = <®_vcc_3v3>; ++ // }; ++ ++ reg_vdd_cpu: vdd-cpu { ++ compatible = "regulator-fixed"; ++ regulator-name = "vdd-cpu"; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <900000>; ++ vin-supply = <®_vcc>; ++ }; ++ ++ ++ // leds { ++ // compatible = "gpio-leds"; ++ ++ // status_led { ++ // linux,default-trigger = "heartbeat"; ++ // label = "blue:status"; ++ // gpios = <&pio 3 22 GPIO_ACTIVE_HIGH>; ++ // }; ++ // }; ++ ++ wheel_keys: gpio-keys { ++ compatible = "gpio-keys"; ++ autorepeat; ++ ++ key-center { ++ label = "Wheel Key Center"; ++ linux,code = ; ++ wakeup-source; ++ wakeup-event-action = ; ++ interrupt-parent = <&pio>; ++ interrupts = <6 8 IRQ_TYPE_LEVEL_HIGH>; /* PG8 */ ++ }; ++ }; ++ ++ wifi_pwrseq: wifi-pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ // clocks = <&ccu CLK_FANOUT1>; ++ // clock-names = "ext_clock"; ++ reset-gpios = <&pio 3 21 GPIO_ACTIVE_LOW>; /* PD21 */ ++ // assigned-clocks = <&ccu CLK_FANOUT1>; ++ // assigned-clock-rates = <32768>; ++ // pinctrl-0 = <&clk_pg11_pin>; ++ // pinctrl-names = "default"; ++ }; ++ ++ gpio_export { ++ compatible = "gpio-export"; ++ #size-cells = <0>; ++ ++ vdd_5v { ++ gpio-export,name = "vdd_5v"; ++ gpio-export,output=<1>; ++ gpios = <&pio 3 15 GPIO_ACTIVE_HIGH>; /* PD15 */ ++ }; ++ ++ hub_reset { ++ gpio-export,name = "hub_reset"; ++ gpio-export,output=<1>; ++ gpios = <&pio 4 0 GPIO_ACTIVE_LOW>; /* PE0 */ ++ }; ++ ++ /* J6 USB_B */ ++ usb2_power { ++ gpio-export,name = "usb2_power"; ++ gpio-export,output=<1>; ++ gpios = <&pio 6 6 GPIO_ACTIVE_HIGH>; /* PG6 */ ++ }; ++ ++ /* J7 USB_B */ ++ usb3_power { ++ gpio-export,name = "usb3_power"; ++ gpio-export,output=<1>; ++ gpios = <&pio 6 7 GPIO_ACTIVE_HIGH>; /* PG7 */ ++ }; ++ ++ /* J9 HOST */ ++ usb4_power { ++ gpio-export,name = "usb4_power"; ++ gpio-export,output=<1>; ++ gpios = <&pio 6 8 GPIO_ACTIVE_HIGH>; /* PG8 */ ++ }; ++ ++ /* WIFI POWER */ ++ wifi_power { ++ gpio-export,name = "wifi_power"; ++ gpio-export,output=<1>; ++ gpios = <&pio 3 17 GPIO_ACTIVE_HIGH>; /* PD17 */ ++ }; ++ ++ /* 4G POWER */ ++ pcie_power { ++ gpio-export,name = "pcie_power"; ++ gpio-export,output=<1>; ++ gpios = <&pio 4 1 GPIO_ACTIVE_HIGH>; /* PE1 */ ++ }; ++ }; ++}; ++ ++®_aldo { ++ regulator-boot-on; ++ regulator-always-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ vdd33-supply = <®_vcc_3v3>; ++}; ++ ++®_hpldo { ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ hpldoin-supply = <®_vcc_3v3>; ++}; ++ ++&cpu0 { ++ cpu-supply = <®_vdd_cpu>; ++}; ++ ++&cpu1 { ++ cpu-supply = <®_vdd_cpu>; ++}; ++ ++&wdt { ++ status = "okay"; ++}; ++ ++&pio { ++ vcc-pb-supply = <®_vcc_3v3>; ++ vcc-pc-supply = <®_vcc_3v3>; ++ vcc-pd-supply = <®_vcc_3v3>; ++ vcc-pe-supply = <®_vcc_3v3>; ++ vcc-pf-supply = <®_vcc_3v3>; ++ vcc-pg-supply = <®_vcc_3v3>; ++ ++ /omit-if-no-ref/ ++ uart1_pe10_pins: uart1-pe10-pins { ++ pins = "PE10", "PE11"; ++ function = "uart1"; ++ }; ++ ++ uart2_pd1_pins: uart2-pd1-pins { ++ pins = "PD1", "PD2"; ++ function = "uart2"; ++ }; ++ ++ uart3_pe8_pins: uart3-pe8-pins { ++ pins = "PE8", "PE9"; ++ function = "uart3"; ++ }; ++ ++ uart4_pe4_pins: uart4-pe4-pins { ++ pins = "PE4", "PE5"; ++ function = "uart4"; ++ }; ++ ++ uart5_pe6_pins: uart5-pe6-pins { ++ pins = "PE6", "PE7"; ++ function = "uart5"; ++ }; ++ ++ /omit-if-no-ref/ ++ spi1_pd_pins_a: spi1-pd-pins-a { ++ pins = "PD10", "PD11", "PD12", "PD13"; ++ function = "spi1"; ++ }; ++ ++ /omit-if-no-ref/ ++ mii_pg_pins: mii-pg-pins { ++ pins = "PG0", "PG1", "PG2", "PG3", "PG4", "PG5", ++ "PG11", "PG12", "PG13", "PG14", "PG15"; ++ function = "emac"; ++ drive-strength = <30>; ++ bias-pull-up; ++ }; ++ ++ // clk_pg11_pin: clk-pg11-pin { ++ // pins = "PG11"; ++ // function = "clk"; ++ // }; ++}; ++ ++&uart0 { ++ pinctrl-0 = <&uart0_pe2_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++}; ++ ++&uart1 { ++ pinctrl-0 = <&uart1_pe10_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++}; ++ ++/* ++&uart2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart2_pd1_pins>; ++ status = "okay"; ++}; ++*/ ++ ++&uart3 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart3_pe8_pins>; ++ status = "okay"; ++}; ++ ++&uart4 { ++ pinctrl-0 = <&uart4_pe4_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++}; ++ ++&uart5 { ++ pinctrl-0 = <&uart5_pe6_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++}; ++ ++&spi1 { ++ pinctrl-0 = <&spi1_pd_pins_a>; ++ pinctrl-names = "default"; ++ status = "okay"; ++ spi_slave_mode = <0>; ++ // spi_dbi_enable = <1>; ++ spi1_cs_number = <1>; ++ spi-supply = <®_vcc_3v3>; ++ ++ // st7735s: st7735s@0 { ++ // reg = <0>; ++ // spi-max-frequency = <80000000>; ++ // status = "okay"; ++ // }; ++}; ++ ++&mmc0 { ++ bus-width = <4>; ++ disable-wp; ++ vmmc-supply = <®_vcc_3v3>; ++ vqmmc-supply = <®_vcc_3v3>; ++ pinctrl-0 = <&mmc0_pins>; ++ pinctrl-names = "default"; ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ ++ status = "okay"; ++}; ++ ++&mmc2 { ++ bus-width = <8>; ++ non-removable; ++ vmmc-supply = <®_vcc_3v3>; ++ vqmmc-supply = <®_vcc_3v3>; ++ pinctrl-0 = <&mmc2_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++}; ++ ++&usb_otg { ++ dr_mode = "otg"; ++ status = "okay"; ++}; ++ ++&ehci0 { ++ status = "okay"; ++}; ++ ++// &dmic { ++// status = "okay"; ++// }; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++ ++&ohci0 { ++ status = "okay"; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++ ++&ths { ++ status = "okay"; ++ vref-supply = <®_aldo>; ++}; ++ ++&usbphy { ++ usb0_vbus-supply = <®_usbvbus>; ++ usb1_vbus-supply = <®_usbvbus>; ++ status = "okay"; ++}; ++ ++&mdio { ++ status = "okay"; ++ ext_rmii_phy: ethernet-phy@1 { ++ compatible = "ethernet-phy-ieee802.3-c22"; ++ reg = <1>; ++ }; ++}; ++ ++&emac { ++ pinctrl-0 = <&mii_pg_pins>; ++ pinctrl-names = "default"; ++ phy-handle = <&ext_rmii_phy>; ++ phy-mode = "rmii"; ++ phy-supply = <®_vcc_3v3>; ++ snps,reset-gpio = <&pio 6 9 GPIO_ACTIVE_LOW>; /* PG9 */ ++ snps,reset-delays-us = <0 10000 1000000>; ++ status = "okay"; ++}; ++ ++&can0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&can0_pins>; ++ status = "okay"; ++}; ++ ++&can1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&can1_pins>; ++ status = "okay"; ++}; ++ diff --git a/target/linux/sunxi/patches-6.6/923-ARM-dts-sun8i-kooiot-tlink-e1.patch b/target/linux/sunxi/patches-6.6/923-ARM-dts-sun8i-kooiot-tlink-e1.patch index 0d7c3dd7291153..46e301e45f317b 100644 --- a/target/linux/sunxi/patches-6.6/923-ARM-dts-sun8i-kooiot-tlink-e1.patch +++ b/target/linux/sunxi/patches-6.6/923-ARM-dts-sun8i-kooiot-tlink-e1.patch @@ -1,18 +1,18 @@ --- a/arch/arm/boot/dts/allwinner/Makefile +++ b/arch/arm/boot/dts/allwinner/Makefile -@@ -338,7 +338,8 @@ dtb-$(CONFIG_MACH_SUN8I) += \ - sun8i-v3s-sinlinx-sin-v3s.dtb \ +@@ -339,7 +339,8 @@ dtb-$(CONFIG_MACH_SUN8I) += \ sun8i-v40-bananapi-m2-berry.dtb \ sun8i-t113-mangopi-dual.dtb \ -- sun8i-t113-iot-station.dtb -+ sun8i-t113-iot-station.dtb \ + sun8i-t113-iot-station.dtb \ +- sun8i-t113-tlink-rp-t113.dtb ++ sun8i-t113-tlink-rp-t113.dtb \ + sun8i-t113-tlink-e1.dtb dtb-$(CONFIG_MACH_SUN9I) += \ sun9i-a80-optimus.dtb \ sun9i-a80-cubieboard4.dtb --- /dev/null +++ b/arch/arm/boot/dts/allwinner/sun8i-t113-tlink-e1.dts -@@ -0,0 +1,391 @@ +@@ -0,0 +1,362 @@ +// SPDX-License-Identifier: (GPL-2.0+ or MIT) +// Copyright (C) 2024 Dirk Chang + @@ -33,13 +33,10 @@ + ethernet0 = &emac; + mmc0 = &mmc0; + mmc1 = &mmc2; -+ serial0 = &uart3; -+ serial1 = &uart0; ++ serial0 = &uart4; ++ serial1 = &uart2; + serial2 = &uart1; -+ serial3 = &uart4; -+ serial4 = &uart5; -+ spi0 = &spi0; -+ spi1 = &spi1; ++ serial3 = &uart3; + }; + + chosen { @@ -63,6 +60,7 @@ + regulator-name = "usbvbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; ++ gpio = <&pio 2 7 GPIO_ACTIVE_LOW>; /* PC7 */ + vin-supply = <®_vcc>; + }; + @@ -74,109 +72,96 @@ + vin-supply = <®_vcc>; + }; + -+ // reg_avdd2v8: avdd2v8 { -+ // compatible = "regulator-fixed"; -+ // regulator-name = "avdd2v8"; -+ // regulator-min-microvolt = <2800000>; -+ // regulator-max-microvolt = <2800000>; -+ // vin-supply = <®_vcc_3v3>; -+ // }; ++ reg_avcc_1v8: avcc_1v8 { ++ compatible = "regulator-fixed"; ++ regulator-name = "avcc-1v8"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ vin-supply = <®_vcc_3v3>; ++ }; + + reg_vdd_cpu: vdd-cpu { + compatible = "regulator-fixed"; + regulator-name = "vdd-cpu"; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <900000>; ++ regulator-min-microvolt = <950000>; ++ regulator-max-microvolt = <950000>; + vin-supply = <®_vcc>; + }; + -+ -+ // leds { -+ // compatible = "gpio-leds"; -+ -+ // status_led { -+ // linux,default-trigger = "heartbeat"; -+ // label = "blue:status"; -+ // gpios = <&pio 3 22 GPIO_ACTIVE_HIGH>; -+ // }; -+ // }; -+ -+ wheel_keys: gpio-keys { -+ compatible = "gpio-keys"; -+ autorepeat; -+ -+ key-center { -+ label = "Wheel Key Center"; -+ linux,code = ; -+ wakeup-source; -+ wakeup-event-action = ; -+ interrupt-parent = <&pio>; -+ interrupts = <6 8 IRQ_TYPE_LEVEL_HIGH>; /* PG8 */ -+ }; -+ }; -+ -+ wifi_pwrseq: wifi-pwrseq { -+ compatible = "mmc-pwrseq-simple"; -+ // clocks = <&ccu CLK_FANOUT1>; -+ // clock-names = "ext_clock"; -+ reset-gpios = <&pio 3 21 GPIO_ACTIVE_LOW>; /* PD21 */ -+ // assigned-clocks = <&ccu CLK_FANOUT1>; -+ // assigned-clock-rates = <32768>; -+ // pinctrl-0 = <&clk_pg11_pin>; -+ // pinctrl-names = "default"; ++ reg_vcc_wifi_3v3: regulator-wifi-3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc-wifi-3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <®_vcc>; + }; + -+ gpio_export { -+ compatible = "gpio-export"; -+ #size-cells = <0>; -+ -+ vdd_5v { -+ gpio-export,name = "vdd_5v"; -+ gpio-export,output=<1>; -+ gpios = <&pio 3 15 GPIO_ACTIVE_HIGH>; /* PD15 */ ++ leds { ++ compatible = "gpio-leds"; ++ ++ /* ++ status_led { ++ linux,default-trigger = "heartbeat"; ++ label = "blue:status"; ++ gpios = <&pio 3 22 GPIO_ACTIVE_HIGH>; ++ }; ++ */ ++ ++ modem { ++ label = "kooiot:green:modem"; ++ gpios = <&pio 4 0 GPIO_ACTIVE_HIGH>; /* PE0 */ ++ default-state = "off"; + }; + -+ hub_reset { -+ gpio-export,name = "hub_reset"; -+ gpio-export,output=<1>; -+ gpios = <&pio 4 0 GPIO_ACTIVE_LOW>; /* PE0 */ ++ csq { ++ label = "kooiot:green:csq"; ++ gpios = <&pio 4 1 GPIO_ACTIVE_HIGH>; /* PE1 */ ++ default-state = "off"; + }; + -+ /* J6 USB_B */ -+ usb2_power { -+ gpio-export,name = "usb2_power"; -+ gpio-export,output=<1>; -+ gpios = <&pio 6 6 GPIO_ACTIVE_HIGH>; /* PG6 */ ++ cloud { ++ label = "kooiot:green:cloud"; ++ gpios = <&pio 4 11 GPIO_ACTIVE_HIGH>; /* PE11 */ ++ default-state = "off"; + }; ++ }; + -+ /* J7 USB_B */ -+ usb3_power { -+ gpio-export,name = "usb3_power"; -+ gpio-export,output=<1>; -+ gpios = <&pio 6 7 GPIO_ACTIVE_HIGH>; /* PG7 */ -+ }; ++ gpio_keys { ++ compatible = "gpio-keys"; + -+ /* J9 HOST */ -+ usb4_power { -+ gpio-export,name = "usb4_power"; -+ gpio-export,output=<1>; -+ gpios = <&pio 6 8 GPIO_ACTIVE_HIGH>; /* PG8 */ ++ reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&pio 4 12 GPIO_ACTIVE_LOW>; /* PE12 */ + }; ++ }; + -+ /* WIFI POWER */ -+ wifi_power { -+ gpio-export,name = "wifi_power"; -+ gpio-export,output=<1>; -+ gpios = <&pio 3 17 GPIO_ACTIVE_HIGH>; /* PD17 */ -+ }; ++ gpio_export { ++ compatible = "gpio-export"; ++ #size-cells = <0>; + -+ /* 4G POWER */ ++ pcie_reset { ++ gpio-export,name = "pcie_reset"; ++ gpio-export,output=<0>; ++ gpios = <&pio 6 10 GPIO_ACTIVE_HIGH>; /* PD0 */ ++ }; + pcie_power { + gpio-export,name = "pcie_power"; -+ gpio-export,output=<1>; -+ gpios = <&pio 4 1 GPIO_ACTIVE_HIGH>; /* PE1 */ ++ gpio-export,output=<0>; ++ gpios = <&pio 6 20 GPIO_ACTIVE_LOW>; /* PD20 */ + }; + }; ++ ++ wifi_pwrseq: wifi-pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ // clocks = <&ccu CLK_FANOUT1>; ++ // clock-names = "ext_clock"; ++ // reset-gpios = <&pio 3 21 GPIO_ACTIVE_LOW>; /* PD21 */ ++ // assigned-clocks = <&ccu CLK_FANOUT1>; ++ // assigned-clock-rates = <32768>; ++ // pinctrl-0 = <&clk_pg11_pin>; ++ // pinctrl-names = "default"; ++ }; +}; + +®_aldo { @@ -214,8 +199,8 @@ + vcc-pg-supply = <®_vcc_3v3>; + + /omit-if-no-ref/ -+ uart1_pe10_pins: uart1-pe10-pins { -+ pins = "PE10", "PE11"; ++ uart1_pd21_pins: uart1-pd21-pins { ++ pins = "PD21", "PD22"; + function = "uart1"; + }; + @@ -224,25 +209,26 @@ + function = "uart2"; + }; + -+ uart3_pe8_pins: uart3-pe8-pins { -+ pins = "PE8", "PE9"; ++ uart3_pd10_pins: uart3-pd10-pins { ++ pins = "PD10", "PD11"; + function = "uart3"; + }; + -+ uart4_pe4_pins: uart4-pe4-pins { -+ pins = "PE4", "PE5"; ++ uart4_pd7_pins: uart4-pd7-pins { ++ pins = "PD7", "PD8"; + function = "uart4"; + }; + -+ uart5_pe6_pins: uart5-pe6-pins { -+ pins = "PE6", "PE7"; -+ function = "uart4"; -+ }; ++ /omit-if-no-ref/ ++ i2c0_pb_pins: i2c0-pb-pins { ++ pins = "PB2", "PB3"; ++ function = "i2c0"; ++ }; + + /omit-if-no-ref/ -+ spi1_pd_pins_a: spi1-pd-pins-a { -+ pins = "PD10", "PD11", "PD12", "PD13"; -+ function = "spi1"; ++ i2c3_pb_pins: i2c3-pb-pins { ++ pins = "PB6", "PB7"; ++ function = "i2c3"; + }; + + /omit-if-no-ref/ @@ -253,65 +239,54 @@ + drive-strength = <30>; + bias-pull-up; + }; -+ -+ // clk_pg11_pin: clk-pg11-pin { -+ // pins = "PG11"; -+ // function = "clk"; -+ // }; -+}; -+ -+&uart0 { -+ pinctrl-0 = <&uart0_pe2_pins>; -+ pinctrl-names = "default"; -+ status = "okay"; +}; + +&uart1 { -+ pinctrl-0 = <&uart1_pe10_pins>; ++ pinctrl-0 = <&uart1_pd21_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + -+/* +&uart2 { + pinctrl-names = "default"; + pinctrl-0 = <&uart2_pd1_pins>; + status = "okay"; +}; -+*/ + +&uart3 { + pinctrl-names = "default"; -+ pinctrl-0 = <&uart3_pe8_pins>; ++ pinctrl-0 = <&uart3_pd10_pins>; + status = "okay"; +}; + +&uart4 { -+ pinctrl-0 = <&uart4_pe4_pins>; ++ pinctrl-0 = <&uart4_pd7_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + -+&uart5 { -+ pinctrl-0 = <&uart5_pe6_pins>; ++&i2c0 { ++ pinctrl-0 = <&i2c0_pb_pins>; + pinctrl-names = "default"; + status = "okay"; ++ ++ sd2059: sd2059@32 { ++ compatible = "whwave,sd3078"; ++ reg = <0x32>; ++ status = "okay"; ++ }; +}; + -+&spi1 { -+ pinctrl-0 = <&spi1_pd_pins_a>; ++&i2c3 { ++ pinctrl-0 = <&i2c3_pb_pins>; + pinctrl-names = "default"; + status = "okay"; -+ spi_slave_mode = <0>; -+ // spi_dbi_enable = <1>; -+ spi1_cs_number = <1>; -+ spi-supply = <®_vcc_3v3>; -+ -+ // st7735s: st7735s@0 { -+ // reg = <0>; -+ // spi-max-frequency = <80000000>; -+ // status = "okay"; -+ // }; ++ ++ at24c02: eeprom@50 { ++ compatible = "atmel,24c02"; ++ reg = <0x50>; ++ pagesize = <16>; ++ }; +}; + +&mmc0 { @@ -344,10 +319,6 @@ + status = "okay"; +}; + -+// &dmic { -+// status = "okay"; -+// }; -+ +&ehci1 { + status = "okay"; +}; @@ -382,12 +353,12 @@ +}; + +&emac { -+ pinctrl-0 = <&mii_pg_pins>; ++ pinctrl-0 = <&rmii_pe_pins>; + pinctrl-names = "default"; + phy-handle = <&ext_rmii_phy>; + phy-mode = "rmii"; + phy-supply = <®_vcc_3v3>; -+ snps,reset-gpio = <&pio 6 9 GPIO_ACTIVE_LOW>; /* PG9 */ ++ snps,reset-gpio = <&pio 4 13 GPIO_ACTIVE_LOW>; /* PE13 */ + snps,reset-delays-us = <0 10000 1000000>; + status = "okay"; +};