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: update device tree according to real device
- Loading branch information
Showing
9 changed files
with
744 additions
and
170 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
25 changes: 25 additions & 0 deletions
25
package/boot/uboot-sunxi/patches/823-board-sunxi-support-t113s-uart4-console.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,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 = { |
134 changes: 134 additions & 0 deletions
134
package/boot/uboot-sunxi/patches/894-ARM-dts-rp-t113s.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,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 <[email protected]>. | ||
+ | ||
+#include <dt-bindings/interrupt-controller/irq.h> | ||
+#include <dt-bindings/gpio/gpio.h> | ||
+#include <dt-bindings/leds/common.h> | ||
+ | ||
+/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"; | ||
+}; | ||
+ |
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 |
---|---|---|
|
@@ -8,21 +8,21 @@ | |
+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 | ||
+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 | ||
+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 <[email protected]> | ||
+ | ||
+#include <dt-bindings/interrupt-controller/irq.h> | ||
+#include <dt-bindings/gpio/gpio.h> | ||
|
@@ -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"; | ||
+}; | ||
+ |
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 was deleted.
Oops, something went wrong.
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.