forked from openwrt/openwrt
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sunxi: support ThingsLink K4X device
- Loading branch information
Showing
12 changed files
with
964 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
271 changes: 271 additions & 0 deletions
271
package/boot/uboot-sunxi/patches/916-ARM-dts-tlink-k4x.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,271 @@ | ||
--- /dev/null | ||
+++ b/configs/tlink_k4x_defconfig | ||
@@ -0,0 +1,32 @@ | ||
+CONFIG_ARM=y | ||
+CONFIG_ARCH_SUNXI=y | ||
+CONFIG_SPL=y | ||
+CONFIG_MACH_SUN8I_R40=y | ||
+CONFIG_DRAM_CLK=576 | ||
+CONFIG_DRAM_ZQ=3881979 | ||
+# CONFIG_SUNXI_DRAM_DW_R40_DUAL_RANK is not set | ||
+CONFIG_MMC0_CD_PIN="PB8" | ||
+CONFIG_MMC_SUNXI_SLOT_EXTRA=2 | ||
+CONFIG_USB0_VBUS_PIN="PC18" | ||
+CONFIG_AHCI=y | ||
+CONFIG_SUNXI_DRAM_LPDDR3_STOCK=y | ||
+# CONFIG_NR_DRAM_BANKS is not set | ||
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set | ||
+CONFIG_SPL_I2C_SUPPORT=y | ||
+# CONFIG_CMD_FLASH is not set | ||
+CONFIG_DEFAULT_DEVICE_TREE="sun8i-r40-tlink-k4x" | ||
+CONFIG_SCSI_AHCI=y | ||
+CONFIG_MII=y | ||
+CONFIG_SUN8I_EMAC=y | ||
+CONFIG_AXP_GPIO=y | ||
+CONFIG_AXP_DCDC3_VOLT=1200 | ||
+CONFIG_AXP_DCDC5_VOLT=1200 | ||
+CONFIG_AXP_ALDO1_VOLT=3300 | ||
+CONFIG_AXP_ALDO2_VOLT=1800 | ||
+CONFIG_AXP_DLDO1_VOLT=3300 | ||
+CONFIG_AXP_DLDO4_VOLT=1800 | ||
+CONFIG_AXP_ELDO2_VOLT=1200 | ||
+CONFIG_AXP_ELDO3_VOLT=2500 | ||
+CONFIG_SCSI=y | ||
+CONFIG_USB_ECHI_HCD=y | ||
+CONFIG_USB_OCHI_HCD=y | ||
+++ a/arch/arm/dts/Makefile | ||
+++ b/arch/arm/dts/Makefile | ||
@@ -547,6 +547,7 @@ | ||
sun8i-r40-bananapi-m2-ultra.dtb \ | ||
sun8i-r40-tlink-k1.dtb \ | ||
sun8i-r40-tlink-k2x.dtb \ | ||
+ sun8i-r40-tlink-k4x.dtb \ | ||
sun8i-v40-bananapi-m2-berry.dtb \ | ||
sun8i-t3-tlink-m408.dtb | ||
dtb-$(CONFIG_MACH_SUN8I_V3S) += \ | ||
--- /dev/null | ||
+++ b/arch/arm/dts/sun8i-r40-tlink-k4x.dts | ||
@@ -0,0 +1,223 @@ | ||
+/* | ||
+ * Copyright (C) 2024 Dirk Chang <[email protected]> | ||
+ * | ||
+ */ | ||
+ | ||
+/dts-v1/; | ||
+#include "sun8i-r40.dtsi" | ||
+ | ||
+#include <dt-bindings/gpio/gpio.h> | ||
+ | ||
+/ { | ||
+ model = "ThingsLink K4X"; | ||
+ compatible = "kooiot,tlink-k4x", "allwinner,sun8i-r40"; | ||
+ | ||
+ aliases { | ||
+ ethernet0 = &gmac; | ||
+ ethernet1 = &emac; | ||
+ serial0 = &uart0; | ||
+ mmc0 = &mmc0; | ||
+ mmc1 = &mmc2; | ||
+ }; | ||
+ | ||
+ chosen { | ||
+ stdout-path = "serial0:115200n8"; | ||
+ }; | ||
+ | ||
+ leds { | ||
+ compatible = "gpio-leds"; | ||
+ | ||
+ status { | ||
+ label = "green:status"; | ||
+ gpios = <&pio 6 8 GPIO_ACTIVE_HIGH>; /* PG8 */ | ||
+ linux,default-trigger = "heartbeat"; | ||
+ }; | ||
+ }; | ||
+ | ||
+ reg_vcc3v3_sdc: vcc3v3-sdc { | ||
+ compatible = "regulator-fixed"; | ||
+ regulator-name = "vcc3v3-sdc"; | ||
+ regulator-always-on; | ||
+ regulator-boot-on; | ||
+ regulator-min-microvolt = <3300000>; | ||
+ regulator-max-microvolt = <3300000>; | ||
+ vin-supply = <®_dcdc1>; | ||
+ gpio = <&pio 2 16 GPIO_ACTIVE_LOW>; /* PC16 CARD0-PWR*/ | ||
+ // enable-active-high; | ||
+ }; | ||
+}; | ||
+ | ||
+&emac { | ||
+ pinctrl-names = "default"; | ||
+ pinctrl-0 = <&emac_mii_pins>; | ||
+ phy-handle = <&emac_phy>; | ||
+ phy-supply = <®_dcdc1>; | ||
+ phy-mode = "mii"; | ||
+ status = "okay"; | ||
+}; | ||
+ | ||
+&emac_mdio { | ||
+ status = "okay"; | ||
+ phy-supply = <®_dcdc1>; | ||
+ reset-gpios = <&pio 7 27 GPIO_ACTIVE_LOW>; /* PH27 */ | ||
+ reset-assert-us = <10000>; | ||
+ reset-deassert-us = <1000000>; | ||
+ emac_phy: ethernet-phy@3 { | ||
+ compatible = "ethernet-phy-ieee802.3-c22"; | ||
+ reg = <3>; | ||
+ }; | ||
+}; | ||
+ | ||
+&gmac { | ||
+ pinctrl-names = "default"; | ||
+ pinctrl-0 = <&gmac_rgmii_pins>; | ||
+ phy-handle = <&phy1>; | ||
+ phy-mode = "rgmii"; | ||
+ phy-supply = <®_dcdc1>; | ||
+ snps,reset-gpio = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */ | ||
+ snps,reset-delays-us = <0 10000 1000000>; | ||
+ status = "okay"; | ||
+}; | ||
+ | ||
+&gmac_mdio { | ||
+ phy1: ethernet-phy@3 { | ||
+ compatible = "ethernet-phy-ieee802.3-c22"; | ||
+ reg = <3>; | ||
+ // reset-gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */ | ||
+ // reset-assert-us = <10000>; | ||
+ // reset-deassert-us = <1000000>; | ||
+ // interrupt-parent = <&pio>; | ||
+ // interrupts = <&pio 0 17 GPIO_ACTIVE_LOW>; /* PA17 */ | ||
+ }; | ||
+}; | ||
+ | ||
+&i2c0 { | ||
+ status = "okay"; | ||
+ | ||
+ axp22x: pmic@34 { | ||
+ compatible = "x-powers,axp221"; | ||
+ reg = <0x34>; | ||
+ interrupt-parent = <&nmi_intc>; | ||
+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; | ||
+ }; | ||
+}; | ||
+ | ||
+#include "axp22x.dtsi" | ||
+ | ||
+&mmc0 { | ||
+ vmmc-supply = <®_vcc3v3_sdc>; | ||
+ bus-width = <4>; | ||
+ cd-gpios = <&pio 1 8 GPIO_ACTIVE_LOW>; /* PB3 */ | ||
+ status = "okay"; | ||
+}; | ||
+ | ||
+&mmc2 { | ||
+ vmmc-supply = <®_dcdc1>; | ||
+ vqmmc-supply = <®_aldo2>; | ||
+ bus-width = <8>; | ||
+ non-removable; | ||
+ status = "okay"; | ||
+}; | ||
+ | ||
+&pio { | ||
+ pinctrl-names = "default"; | ||
+ // pinctrl-0 = <&clk_out_a_pin>; // used by UART6 | ||
+ vcc-pa-supply = <®_dcdc1>; | ||
+ vcc-pc-supply = <®_dcdc1>; | ||
+ vcc-pd-supply = <®_dcdc1>; | ||
+ vcc-pe-supply = <®_dcdc1>; | ||
+ vcc-pf-supply = <®_dcdc1>; | ||
+ vcc-pg-supply = <®_dcdc1>; | ||
+}; | ||
+ | ||
+®_aldo1 { | ||
+ regulator-min-microvolt = <3300000>; | ||
+ regulator-max-microvolt = <3300000>; | ||
+ regulator-name = "vcc-wifi-io"; | ||
+}; | ||
+ | ||
+®_aldo2 { | ||
+ regulator-always-on; | ||
+ regulator-min-microvolt = <1800000>; | ||
+ regulator-max-microvolt = <1800000>; | ||
+ regulator-name = "vcc-pc"; | ||
+}; | ||
+ | ||
+®_aldo3 { | ||
+ regulator-always-on; | ||
+ regulator-min-microvolt = <3000000>; | ||
+ regulator-max-microvolt = <3000000>; | ||
+ regulator-name = "vcc-pll"; | ||
+}; | ||
+ | ||
+®_dc1sw { | ||
+ regulator-min-microvolt = <3300000>; | ||
+ regulator-max-microvolt = <3300000>; | ||
+ regulator-name = "vcc-wifi"; | ||
+}; | ||
+ | ||
+®_dcdc1 { | ||
+ regulator-always-on; | ||
+ regulator-min-microvolt = <3300000>; | ||
+ regulator-max-microvolt = <3300000>; | ||
+ regulator-name = "vcc-3v3"; | ||
+}; | ||
+ | ||
+®_dcdc2 { | ||
+ regulator-always-on; | ||
+ regulator-min-microvolt = <1000000>; | ||
+ regulator-max-microvolt = <1300000>; | ||
+ regulator-name = "vdd-sys"; | ||
+}; | ||
+ | ||
+®_dcdc3 { | ||
+ regulator-always-on; | ||
+ regulator-min-microvolt = <1000000>; | ||
+ regulator-max-microvolt = <1300000>; | ||
+ regulator-name = "vdd-cpu"; | ||
+}; | ||
+ | ||
+®_dcdc5 { | ||
+ regulator-always-on; | ||
+ regulator-min-microvolt = <1200000>; | ||
+ regulator-max-microvolt = <1200000>; | ||
+ regulator-name = "vcc-dram"; | ||
+}; | ||
+ | ||
+®_dldo1 { | ||
+ regulator-always-on; | ||
+ regulator-min-microvolt = <3300000>; | ||
+ regulator-max-microvolt = <3300000>; | ||
+ regulator-name = "vcc-eth-io"; | ||
+}; | ||
+ | ||
+®_dldo2 { | ||
+ regulator-always-on; | ||
+ regulator-min-microvolt = <3300000>; | ||
+ regulator-max-microvolt = <3300000>; | ||
+ regulator-name = "vcc-eth-io-2"; | ||
+}; | ||
+ | ||
+®_dldo3 { | ||
+ regulator-min-microvolt = <1800000>; | ||
+ regulator-max-microvolt = <1800000>; | ||
+ regulator-name = "vcc-wifi-1v8"; | ||
+}; | ||
+ | ||
+®_dldo4 { | ||
+ regulator-min-microvolt = <1800000>; | ||
+ regulator-max-microvolt = <1800000>; | ||
+ regulator-name = "vcc-wifi-1v8-2"; | ||
+}; | ||
+ | ||
+®_eldo3 { | ||
+ regulator-min-microvolt = <2500000>; | ||
+ regulator-max-microvolt = <2500000>; | ||
+ regulator-name = "vdd1v2-sata"; | ||
+}; | ||
+ | ||
+&uart0 { | ||
+ pinctrl-names = "default"; | ||
+ pinctrl-0 = <&uart0_pb_pins>; | ||
+ status = "okay"; | ||
+}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.