feat: add a common 99pi dtsi for both variants

This commit is contained in:
GH Cao
2025-05-05 02:22:27 +08:00
parent a7418fc11b
commit 2bd6ce0594
3 changed files with 186 additions and 356 deletions
+184
View File
@@ -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 = <&gtim2_pin_m1>, <&gtim3_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";
};
+1 -178
View File
@@ -7,187 +7,10 @@
#include "loongson-2k0300.dtsi"
#include "loongson_panel_param.dtsi"
#include "ls2k300_99pi.dtsi"
/ {
model = "LS2K300-99PI-TF";
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 = <&gtim2_pin_m1>, <&gtim3_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";
};
&emmc {
+1 -178
View File
@@ -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 = <&gtim2_pin_m1>, <&gtim3_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";
};