Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mt7986: add TP-Link TL-XTR8488 support #71

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CONFIG_PLAT_MT7986=y
CONFIG_TARGET_ALL_NO_SEC_BOOT=y
CONFIG_FLASH_DEVICE_SPIM_NAND=y
CONFIG_DRAM_DDR4=y
# CONFIG_NMBM is not set
4 changes: 2 additions & 2 deletions uboot-mtk-20220606/arch/arm/dts/mt7986a-tplink-tl-xdr608x.dts
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@
conf-pu {
pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
bias-pull-up = <MTK_PUPD_SET_R1R0_00>;
};

conf-pd {
pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
bias-pull-down = <MTK_PUPD_SET_R1R0_00>;
};
};
};
Expand Down
124 changes: 124 additions & 0 deletions uboot-mtk-20220606/arch/arm/dts/mt7986a-tplink-tl-xtr8488.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
// SPDX-License-Identifier: GPL-2.0

/dts-v1/;
#include "mt7986.dtsi"
#include <dt-bindings/gpio/gpio.h>

/ {
#address-cells = <1>;
#size-cells = <1>;
model = "mt7986-tplink_tl-xtr8488";
compatible = "mediatek,mt7986", "mediatek,mt7986-rfb";

chosen {
stdout-path = &uart0;
tick-timer = &timer0;
};

config {
bootcmd = "mtkboardboot";
blink_led = "green:status";
system_led = "red:status";
};

gpio-keys {
compatible = "gpio-keys";

button-reset {
label = "reset";
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
};

button-mesh {
label = "mesh";
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
};

button-turbo {
label = "turbo";
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
};
};

gpio-leds {
compatible = "gpio-leds";

led_status_red: led-0 {
label = "red:status";
gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
};

led_status_green: led-1 {
label = "green:status";
gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
};

led-2 {
label = "green:turbo";
gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
};
};
};

&eth {
status = "okay";
mediatek,gmac-id = <0>;
phy-mode = "sgmii";
mediatek,switch = "mt7531";
reset-gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;

fixed-link {
speed = <1000>;
full-duplex;
};
};

&pinctrl {
spi_flash_pins: spi0-pins-func-1 {
mux {
function = "flash";
groups = "spi0", "spi0_wp_hold";
};

conf-pu {
pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-up = <MTK_PUPD_SET_R1R0_00>;
};

conf-pd {
pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-down = <MTK_PUPD_SET_R1R0_00>;
};
};
};

&spi0 {
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&spi_flash_pins>;
status = "okay";
must_tx;
enhance_timing;
dma_ext;
ipm_design;
support_quad;
tick_dly = <2>;
sample_sel = <0>;

spi_nand@0 {
compatible = "spi-nand";
reg = <0>;
spi-max-frequency = <52000000>;
};
};

&uart0 {
status = "okay";
};

&watchdog {
status = "disabled";
};
87 changes: 87 additions & 0 deletions uboot-mtk-20220606/configs/mt7986_tplink_tl-xtr8488_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
CONFIG_ARM=y
CONFIG_POSITION_INDEPENDENT=y
CONFIG_ARCH_MEDIATEK=y
CONFIG_SYS_TEXT_BASE=0x41e00000
CONFIG_SYS_MALLOC_F_LEN=0x4000
CONFIG_NR_DRAM_BANKS=1
CONFIG_DEFAULT_DEVICE_TREE="mt7986a-tplink-tl-xtr8488"
CONFIG_TARGET_MT7986=y
CONFIG_MEDIATEK_BOOTMENU=y
CONFIG_MEDIATEK_BOOTMENU_DELAY=3
CONFIG_MT7986_BOOTMENU_UBI=y
CONFIG_DEBUG_UART_BASE=0x11002000
CONFIG_DEBUG_UART_CLOCK=40000000
CONFIG_SYS_LOAD_ADDR=0x46000000
CONFIG_DEBUG_UART=y
CONFIG_SYS_MEMTEST_START=0x40000000
CONFIG_SYS_MEMTEST_END=0x41000000
CONFIG_AUTOBOOT_MENU_SHOW=y
CONFIG_AUTOBOOT_MENU_MTK_SHOW=y
CONFIG_DEFAULT_FDT_FILE="mt7986a-rfb"
CONFIG_LOGLEVEL=7
CONFIG_LOG=y
CONFIG_POLLER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="MT7986> "
# CONFIG_BOOTM_NETBSD is not set
# CONFIG_BOOTM_PLAN9 is not set
# CONFIG_BOOTM_RTEMS is not set
# CONFIG_BOOTM_VXWORKS is not set
# CONFIG_CMD_ELF is not set
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_MEMTEST=y
CONFIG_CMD_DM=y
# CONFIG_CMD_FLASH is not set
CONFIG_CMD_GPIO=y
CONFIG_CMD_GPIO_READ=y
CONFIG_CMD_MMC=y
CONFIG_CMD_MTD=y
CONFIG_CMD_PCI=y
CONFIG_CMD_TFTPPUT=y
# CONFIG_CMD_NFS is not set
CONFIG_CMD_PING=y
CONFIG_CMD_LED_BLINK=y
CONFIG_CMD_SMC=y
CONFIG_CMD_MTDPARTS=y
CONFIG_MTDIDS_DEFAULT="spi-nand0=spi-nand0"
CONFIG_MTDPARTS_DEFAULT="spi-nand0:1024k(bl2),256k(config),256k(factory),2048k(reserved),2048k(fip),122880k(ubi)"
CONFIG_CMD_UBI=y
CONFIG_CMD_GL_BTN=y
CONFIG_DOS_PARTITION=y
CONFIG_EFI_PARTITION=y
CONFIG_PARTITION_TYPE_GUID=y
CONFIG_OF_EMBED=y
CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_REGMAP=y
CONFIG_SYSCON=y
CONFIG_BUTTON=y
CONFIG_BUTTON_GPIO=y
CONFIG_CLK=y
# CONFIG_I2C is not set
CONFIG_LED=y
CONFIG_LED_BLINK=y
CONFIG_LED_GPIO=y
CONFIG_MMC_HS200_SUPPORT=y
CONFIG_MMC_MTK=y
CONFIG_DM_MTD=y
CONFIG_MTD_SPI_NAND=y
CONFIG_PHY_FIXED=y
CONFIG_DM_ETH=y
CONFIG_MEDIATEK_ETH=y
CONFIG_PCI=y
CONFIG_PCIE_MEDIATEK=y
CONFIG_PINCTRL=y
CONFIG_PINCONF=y
CONFIG_PINCTRL_MT7986=y
CONFIG_POWER_DOMAIN=y
CONFIG_MTK_POWER_DOMAIN=y
CONFIG_DM_REGULATOR=y
CONFIG_DM_REGULATOR_FIXED=y
CONFIG_DM_SERIAL=y
CONFIG_MTK_SERIAL=y
CONFIG_SPI=y
CONFIG_DM_SPI=y
CONFIG_MTK_SPIM=y
CONFIG_HEXDUMP=y
# CONFIG_EFI_LOADER is not set
CONFIG_WEBUI_FAILSAFE=y
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@
conf-pu {
pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
bias-pull-up = <MTK_PUPD_SET_R1R0_00>;
};

conf-pd {
pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
bias-pull-down = <MTK_PUPD_SET_R1R0_00>;
};
};
};
Expand Down
136 changes: 136 additions & 0 deletions uboot-mtk-20230718-09eda825/arch/arm/dts/mt7986a-tplink-tl-xtr8488.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
// SPDX-License-Identifier: GPL-2.0

/dts-v1/;
#include "mt7986.dtsi"
#include <dt-bindings/gpio/gpio.h>

/ {
#address-cells = <1>;
#size-cells = <1>;
model = "mt7986-tplink_tl-xdr608x";
compatible = "mediatek,mt7986", "mediatek,mt7986-rfb";

chosen {
stdout-path = &uart0;
tick-timer = &timer0;
};

config {
bootcmd = "mtkboardboot";
blink_led = "green:status";
system_led = "red:status";
};

memory@40000000 {
device_type = "memory";
reg = <0x40000000 0x40000000>;
};

gpio-keys {
compatible = "gpio-keys";

button-reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
};

button-mesh {
label = "mesh";
linux,code = <BTN_9>;
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
};

button-turbo {
label = "turbo";
linux,code = <BTN_1>;
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
};
};

gpio-leds {
compatible = "gpio-leds";

led_status_red: led-0 {
label = "red:status";
gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
};

led_status_green: led-1 {
label = "green:status";
gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
};

led-2 {
label = "green:turbo";
gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
};
};

bl2_verify {
bl2_compatible = "spim-nand";
};
};

&eth {
status = "okay";
mediatek,gmac-id = <0>;
phy-mode = "2500base-x";
mediatek,switch = "mt7531";
reset-gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;

fixed-link {
speed = <2500>;
full-duplex;
};
};

&pinctrl {
spi_flash_pins: spi0-pins-func-1 {
mux {
function = "flash";
groups = "spi0", "spi0_wp_hold";
};

conf-pu {
pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-up = <MTK_PUPD_SET_R1R0_00>;
};

conf-pd {
pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-down = <MTK_PUPD_SET_R1R0_00>;
};
};
};

&spi0 {
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&spi_flash_pins>;
status = "okay";
must_tx;
enhance_timing;
dma_ext;
ipm_design;
support_quad;
tick_dly = <2>;
sample_sel = <0>;

spi_nand@0 {
compatible = "spi-nand";
reg = <1>;
spi-max-frequency = <52000000>;
};
};

&uart0 {
status = "okay";
};

&watchdog {
status = "disabled";
};
Loading