diff --git a/arch/loongarch/boot/dts/Makefile b/arch/loongarch/boot/dts/Makefile index 0c59047e8..e4818de05 100644 --- a/arch/loongarch/boot/dts/Makefile +++ b/arch/loongarch/boot/dts/Makefile @@ -4,7 +4,7 @@ ifdef CONFIG_DTB_MATCH_BY_BOARD_NAME dtb-$(CONFIG_LOONGSON_2K300) += ls2k300_mini_dp.dtb ls2k300_vanguard_pi.dtb ls2k300_gongkong_gbkpgk0.dtb \ - ls2k300_alientek.dtb ls2k300_99pi_wifi.dtb + ls2k300_alientek.dtb ls2k300_99pi_wifi.dtb ls2k300_99pi_tf.dtb dtb-$(CONFIG_LOONGSON_2K1000) += ls2k1000_dp.dtb obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) diff --git a/arch/loongarch/boot/dts/ls2k300_99pi.dtsi b/arch/loongarch/boot/dts/ls2k300_99pi.dtsi new file mode 100644 index 000000000..fc4c73714 --- /dev/null +++ b/arch/loongarch/boot/dts/ls2k300_99pi.dtsi @@ -0,0 +1,184 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2025 Loongson Technology Corporation Limited + */ + +/ { + chosen { + stdout-path = "serial0:115200n8"; + bootargs = "earlycon"; + }; + + /* not need memory node, we get memory info from boot params. */ + + leds { + compatible = "gpio-leds"; + + led1 { + label = "led1"; + gpios = <&gpio 83 GPIO_ACTIVE_LOW>; + linux,default-trigger = "heartbeat"; + default-state = "on"; + }; + }; + + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + linux,cma { + compatible = "shared-dma-pool"; + reusable; + size = <0 0x02000000>; + linux,cma-default; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&uart1 { + status = "okay"; +}; + +&uart2 { + status = "okay"; +}; + +&gmac0 { + status = "okay"; + phy-handle = <&yt8511h0>; + mdio { + compatible = "snps,dwmac-mdio"; + #address-cells = <1>; + #size-cells = <0>; + + yt8511h0: ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + motorcomm,led0_cfg = <0x40>; //千兆常亮 + motorcomm,led1_cfg = <0x30>; //百兆 十兆常亮 + motorcomm,led2_cfg = <0x2600>; //有数据时闪烁 + }; + }; +}; + +&i2c0 { + status = "okay"; +}; + +&i2c1 { + status = "okay"; +}; + +&i2c2 { + status = "disabled"; // 在 LCD 排线处 +}; + +&spi0 { + status = "okay"; + pinctrl-0 = <&qspi0_pins>; + pinctrl-names = "default"; + + spi-flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <25000000>; + reg = <0>; + }; +}; + +&spi1 { + status = "okay"; + + spidev0@0 { + compatible = "rohm,dh2228fv"; + reg = <0>; + spi-max-frequency = <25000000>; + }; +}; + +&spi2 { + status = "okay"; // 与 PWM0-3 的 MUX0 冲突 + + spidev1@0 { + compatible = "rohm,dh2228fv"; + reg = <0>; + spi-max-frequency = <25000000>; + }; +}; + +&timers1 { + status = "okay"; + /delete-property/ dmas; + /delete-property/ dma-names; + pinctrl-0 = <&atim3n_pin_m1>; // LCD PWM 背光,备用 + pinctrl-names = "default"; + + pwm { + compatible = "loongson,ls2k-pwm-timer"; + #pwm-cells = <2>; + status = "okay"; + }; +}; + +&timers2 { + status = "okay"; + dmas = <&dma 2 0x400>, <&dma 3 0x400>; + dma-names = "ch3", "ch4"; + pinctrl-0 = <>im2_pin_m1>, <>im3_pin_m1>; + pinctrl-names = "default"; + + pwm { + compatible = "loongson,ls2k-pwm-timer"; + #pwm-cells = <2>; + status = "okay"; + }; +}; + +&pwm0 { + status = "disabled"; + pinctrl-0 = <&pwm0_mux_m0>; + pinctrl-names = "default"; +}; + +&pwm1 { + status = "disabled"; + pinctrl-0 = <&pwm1_mux_m0>; + pinctrl-names = "default"; +}; + +&pwm2 { + status = "disabled"; + pinctrl-0 = <&pwm2_mux_m0>; + pinctrl-names = "default"; +}; + +&pwm3 { + status = "disabled"; + pinctrl-0 = <&pwm3_mux_m0>; + pinctrl-names = "default"; +}; + +&can2 { + status = "okay"; +}; + +&can3 { + status = "okay"; +}; + +&adc { + status = "okay"; +}; + +&rtc0 { + status = "okay"; +}; + +&sdio1 { + cd-gpios = <&gpio 82 GPIO_ACTIVE_LOW>; + status = "okay"; +}; diff --git a/arch/loongarch/boot/dts/ls2k300_99pi_tf.dts b/arch/loongarch/boot/dts/ls2k300_99pi_tf.dts new file mode 100644 index 000000000..adb702774 --- /dev/null +++ b/arch/loongarch/boot/dts/ls2k300_99pi_tf.dts @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2025 Loongson Technology Corporation Limited + */ + +/dts-v1/; + +#include "loongson-2k0300.dtsi" +#include "loongson_panel_param.dtsi" +#include "ls2k300_99pi.dtsi" + +/ { + model = "LS2K300-99PI-TF"; +}; + +&emmc { + status = "disabled"; +}; diff --git a/arch/loongarch/boot/dts/ls2k300_99pi_wifi.dts b/arch/loongarch/boot/dts/ls2k300_99pi_wifi.dts index c18776b7e..ac9c4211d 100644 --- a/arch/loongarch/boot/dts/ls2k300_99pi_wifi.dts +++ b/arch/loongarch/boot/dts/ls2k300_99pi_wifi.dts @@ -7,185 +7,8 @@ #include "loongson-2k0300.dtsi" #include "loongson_panel_param.dtsi" +#include "ls2k300_99pi.dtsi" / { model = "LS2K300-99PI-WIFI"; - - chosen { - stdout-path = "serial0:115200n8"; - bootargs = "earlycon"; - }; - - /* not need memory node, we get memory info from boot params. */ - - leds { - compatible = "gpio-leds"; - - led1 { - label = "led1"; - gpios = <&gpio 83 GPIO_ACTIVE_LOW>; - linux,default-trigger = "heartbeat"; - default-state = "on"; - }; - }; - - reserved-memory { - #address-cells = <2>; - #size-cells = <2>; - ranges; - - linux,cma { - compatible = "shared-dma-pool"; - reusable; - size = <0 0x02000000>; - linux,cma-default; - }; - }; -}; - -&uart0 { - status = "okay"; -}; - -&uart1 { - status = "okay"; -}; - -&uart2 { - status = "okay"; -}; - -&gmac0 { - status = "okay"; - phy-handle = <&yt8511h0>; - mdio { - compatible = "snps,dwmac-mdio"; - #address-cells = <1>; - #size-cells = <0>; - - yt8511h0: ethernet-phy@0 { - compatible = "ethernet-phy-ieee802.3-c22"; - reg = <0>; - motorcomm,led0_cfg = <0x40>; //千兆常亮 - motorcomm,led1_cfg = <0x30>; //百兆 十兆常亮 - motorcomm,led2_cfg = <0x2600>; //有数据时闪烁 - }; - }; -}; - -&i2c0 { - status = "okay"; -}; - -&i2c1 { - status = "okay"; -}; - -&i2c2 { - status = "disabled"; // 在 LCD 排线处 -}; - -&spi0 { - status = "okay"; - pinctrl-0 = <&qspi0_pins>; - pinctrl-names = "default"; - - spi-flash@0 { - compatible = "jedec,spi-nor"; - spi-max-frequency = <25000000>; - reg = <0>; - }; -}; - -&spi1 { - status = "okay"; - - spidev0@0 { - compatible = "rohm,dh2228fv"; - reg = <0>; - spi-max-frequency = <25000000>; - }; -}; - -&spi2 { - status = "okay"; // 与 PWM0-3 的 MUX0 冲突 - - spidev1@0 { - compatible = "rohm,dh2228fv"; - reg = <0>; - spi-max-frequency = <25000000>; - }; -}; - -&timers1 { - status = "okay"; - /delete-property/ dmas; - /delete-property/ dma-names; - pinctrl-0 = <&atim3n_pin_m1>; // LCD PWM 背光,备用 - pinctrl-names = "default"; - - pwm { - compatible = "loongson,ls2k-pwm-timer"; - #pwm-cells = <2>; - status = "okay"; - }; -}; - -&timers2 { - status = "okay"; - dmas = <&dma 2 0x400>, <&dma 3 0x400>; - dma-names = "ch3", "ch4"; - pinctrl-0 = <>im2_pin_m1>, <>im3_pin_m1>; - pinctrl-names = "default"; - - pwm { - compatible = "loongson,ls2k-pwm-timer"; - #pwm-cells = <2>; - status = "okay"; - }; -}; - -&pwm0 { - status = "disabled"; - pinctrl-0 = <&pwm0_mux_m0>; - pinctrl-names = "default"; -}; - -&pwm1 { - status = "disabled"; - pinctrl-0 = <&pwm1_mux_m0>; - pinctrl-names = "default"; -}; - -&pwm2 { - status = "disabled"; - pinctrl-0 = <&pwm2_mux_m0>; - pinctrl-names = "default"; -}; - -&pwm3 { - status = "disabled"; - pinctrl-0 = <&pwm3_mux_m0>; - pinctrl-names = "default"; -}; - -&can2 { - status = "okay"; -}; - -&can3 { - status = "okay"; -}; - -&adc { - status = "okay"; -}; - -&rtc0 { - status = "okay"; -}; - -&sdio1 { - cd-gpios = <&gpio 82 GPIO_ACTIVE_LOW>; - status = "okay"; }; diff --git a/arch/loongarch/include/asm/mach/boot_param.h b/arch/loongarch/include/asm/mach/boot_param.h index 23284b28d..2a221848e 100644 --- a/arch/loongarch/include/asm/mach/boot_param.h +++ b/arch/loongarch/include/asm/mach/boot_param.h @@ -116,6 +116,7 @@ extern u32 __dtb_ls2k300_vanguard_pi_begin[]; extern u32 __dtb_ls2k300_gongkong_gbkpgk0_begin[]; extern u32 __dtb_ls2k300_alientek_begin[]; extern u32 __dtb_ls2k300_99pi_wifi_begin[]; +extern u32 __dtb_ls2k300_99pi_tf_begin[]; extern char __dtb_start[]; extern struct boot_params *efi_bp; extern struct loongson_board_info b_info; diff --git a/arch/loongarch/kernel/setup.c b/arch/loongarch/kernel/setup.c index e44658332..2ed658a26 100644 --- a/arch/loongarch/kernel/setup.c +++ b/arch/loongarch/kernel/setup.c @@ -311,6 +311,7 @@ char *board_names[] = { "LS2K300-GONGKONG-GBKPGK0", "LS2K300-ATK-DL2K0300B-V01", "LS2K300-99PI-WIFI", + "LS2K300-99PI-TF", #endif NULL }; @@ -332,6 +333,7 @@ void *fdts[] = { &__dtb_ls2k300_gongkong_gbkpgk0_begin, &__dtb_ls2k300_alientek_begin, &__dtb_ls2k300_99pi_wifi_begin, + &__dtb_ls2k300_99pi_tf_begin, #endif NULL };