From 54d39940bed3f71c4fe3e09e851b323dfe32d4c0 Mon Sep 17 00:00:00 2001 From: maoxiaochuan Date: Thu, 26 Feb 2026 18:16:07 +0800 Subject: [PATCH] LoongArch: dts: loongson-2k1000: Sync from linux 7.0 Signed-off-by: maoxiaochuan --- .../boot/dts/loongson-2k1000-ref.dts | 35 ++ arch/loongarch/boot/dts/loongson-2k1000.dtsi | 467 ++---------------- 2 files changed, 66 insertions(+), 436 deletions(-) diff --git a/arch/loongarch/boot/dts/loongson-2k1000-ref.dts b/arch/loongarch/boot/dts/loongson-2k1000-ref.dts index 78ea995ab..51b8e53cb 100644 --- a/arch/loongarch/boot/dts/loongson-2k1000-ref.dts +++ b/arch/loongarch/boot/dts/loongson-2k1000-ref.dts @@ -48,6 +48,41 @@ }; }; +&apbdma0 { + status = "okay"; +}; + +&nand { + status = "okay"; + + pinctrl-0 = <&nand_pins_default>; + pinctrl-names = "default"; + + #address-cells = <1>; + #size-cells = <0>; + nand@0 { + reg = <0>; + label = "ls2k1000-nand"; + nand-use-soft-ecc-engine; + nand-ecc-algo = "bch"; + nand-ecc-strength = <8>; + nand-ecc-step-size = <512>; + }; +}; + +&apbdma1 { + status = "okay"; +}; + +&mmc { + status = "okay"; + + pinctrl-0 = <&sdio_pins_default>; + pinctrl-names = "default"; + bus-width = <4>; + cd-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>; +}; + &gmac0 { status = "okay"; diff --git a/arch/loongarch/boot/dts/loongson-2k1000.dtsi b/arch/loongarch/boot/dts/loongson-2k1000.dtsi index 0dcab766a..ab6a55937 100644 --- a/arch/loongarch/boot/dts/loongson-2k1000.dtsi +++ b/arch/loongarch/boot/dts/loongson-2k1000.dtsi @@ -152,187 +152,7 @@ pctrl: pinctrl@1fe00420 { compatible = "loongson,ls2k-pinctrl"; reg = <0x0 0x1fe00420 0x0 0x18>; - - gmac1_default:gmac1 { - mux { - groups ="gmac1"; - function ="gmac1"; - }; - }; - - hda_default:hda { - mux { - groups ="hda_i2s"; - function ="hda"; - }; - }; - - hda_as_gpio:hda_as_gpio { - mux { - groups ="hda_i2s"; - function ="gpio"; - }; - }; - - i2s_default:i2s { - mux { - groups ="hda_i2s"; - function ="i2s"; - }; - }; - - ahci_default:ahci { - mux { - groups ="sata_led"; - function ="sata_led"; - }; - }; - - ahci_led_as_gpio:ahci_led_as_gpio { - mux { - groups ="sata_led"; - function ="gpio"; - }; - }; - - pwm0_default:pwm0 { - mux { - groups ="pwm0"; - function ="pwm0"; - }; - }; - - pwm0_as_gpio:pwm0_as_gpio { - mux { - groups ="pwm0"; - function ="gpio"; - }; - }; - - pwm1_default:pwm1 { - mux { - groups ="pwm1"; - function ="pwm1"; - }; - }; - - pwm1_as_gpio:pwm1_as_gpio { - mux { - groups ="pwm1"; - function ="gpio"; - }; - }; - - pwm2_default:pwm2 { - mux { - groups ="pwm2"; - function ="pwm2"; - }; - }; - - pwm2_as_gpio:pwm2_as_gpio { - mux { - groups ="pwm2"; - function ="gpio"; - }; - }; - - pwm3_default:pwm3 { - mux { - groups ="pwm3"; - function ="pwm3"; - }; - }; - - pwm3_as_gpio:pwm3_as_gpio { - mux { - groups ="pwm3"; - function ="gpio"; - }; - }; - - uart0_4_default:uart0_4{ - mux { - groups = "uart0"; - function = "uart0_4"; - }; - }; - - uart1_4_default:uart1_4 { - mux { - groups = "uart1"; - function = "uart1_4"; - }; - }; - - uart2_4_default:uart2_4 { - mux { - groups = "uart2"; - function = "uart2_4"; - }; - }; - - dvo0_default:dvo0 { - mux { - groups = "dvo0_lio_uart"; - function = "dvo0"; - }; - }; - - dvo1_default:dvo1 { - mux { - groups = "dvo1_camera"; - function = "dvo1"; - }; - }; - - can0_default:can0 { - mux { - groups = "can0"; - function = "can0"; - }; - }; - - can1_default:can1 { - mux { - groups = "can1"; - function = "can1"; - }; - }; - - can1_as_gpio:can1_as_gpio { - mux { - groups = "can1"; - function = "gpio"; - }; - }; - - sdio_gpio:sdio { - mux { - groups = "sdio"; - function = "gpio"; - }; - }; - - lio_default:lio { - mux { - groups = "dvo0_lio_uart"; - function = "lio"; - }; - }; - - i2c0_as_gpio:i2c0_as_gpio { - mux { - groups = "i2c0"; - function = "gpio"; - }; - }; - i2c1_as_gpio:i2c1_as_gpio { - mux { - groups = "i2c1"; - function = "gpio"; - }; - }; + status = "disabled"; }; clk: clock-controller@1fe00480 { @@ -369,14 +189,14 @@ <26 IRQ_TYPE_LEVEL_HIGH>, <26 IRQ_TYPE_LEVEL_HIGH>, <26 IRQ_TYPE_LEVEL_HIGH>, - <>, - <26 IRQ_TYPE_LEVEL_HIGH>, + <0 IRQ_TYPE_NONE>, <26 IRQ_TYPE_LEVEL_HIGH>, <26 IRQ_TYPE_LEVEL_HIGH>, <26 IRQ_TYPE_LEVEL_HIGH>, <26 IRQ_TYPE_LEVEL_HIGH>, <26 IRQ_TYPE_LEVEL_HIGH>, <26 IRQ_TYPE_LEVEL_HIGH>, + <26 IRQ_TYPE_NONE>, <26 IRQ_TYPE_LEVEL_HIGH>, <26 IRQ_TYPE_LEVEL_HIGH>, <26 IRQ_TYPE_LEVEL_HIGH>, @@ -391,13 +211,13 @@ <27 IRQ_TYPE_LEVEL_HIGH>, <27 IRQ_TYPE_LEVEL_HIGH>, <27 IRQ_TYPE_LEVEL_HIGH>, - <>, + <0 IRQ_TYPE_NONE>, <27 IRQ_TYPE_LEVEL_HIGH>, <27 IRQ_TYPE_LEVEL_HIGH>, <27 IRQ_TYPE_LEVEL_HIGH>, <27 IRQ_TYPE_LEVEL_HIGH>, - <>, - <>, + <0 IRQ_TYPE_NONE>, + <0 IRQ_TYPE_NONE>, <27 IRQ_TYPE_LEVEL_HIGH>, <27 IRQ_TYPE_LEVEL_HIGH>, <27 IRQ_TYPE_LEVEL_HIGH>, @@ -485,121 +305,7 @@ interrupt-parent = <&liointc0>; interrupts = <0x0 IRQ_TYPE_LEVEL_HIGH>; no-loopback-test; - status = "okay"; - }; - - uart1: serial@0x1fe20100 { - compatible = "ns16550a"; - pinctrl-names = "default"; - pinctrl-0 = <&uart1_4_default>; - reg = <0 0x1fe20100 0 0x10>; - clocks = <&clk LOONGSON2_APB_CLK>; - interrupt-parent = <&liointc0>; - interrupts = <0x0 IRQ_TYPE_LEVEL_HIGH>; - no-loopback-test; - status = "disable"; - }; - - uart2: serial@0x1fe20200 { - compatible = "ns16550a"; - pinctrl-names = "default"; - pinctrl-0 = <&uart2_4_default>; - reg = <0 0x1fe20200 0 0x10>; - clocks = <&clk LOONGSON2_APB_CLK>; - interrupt-parent = <&liointc0>; - interrupts = <0x0 IRQ_TYPE_LEVEL_HIGH>; - no-loopback-test; - status = "disable"; - }; - - uart3: serial@0x1fe20300 { - compatible = "ns16550a"; - reg = <0 0x1fe20300 0 0x10>; - clocks = <&clk LOONGSON2_APB_CLK>; - interrupt-parent = <&liointc0>; - interrupts = <0x0 IRQ_TYPE_LEVEL_HIGH>; - no-loopback-test; - status = "disable"; - }; - - uart4: serial@0x1fe20400 { - compatible = "ns16550a"; - reg = <0 0x1fe20400 0 0x10>; - clocks = <&clk LOONGSON2_APB_CLK>; - interrupt-parent = <&liointc0>; - interrupts = <0x1 IRQ_TYPE_LEVEL_HIGH>; - no-loopback-test; - status = "disable"; - }; - - uart5: serial@0x1fe20500 { - compatible = "ns16550a"; - reg = <0 0x1fe20500 0 0x10>; - clocks = <&clk LOONGSON2_APB_CLK>; - interrupt-parent = <&liointc0>; - interrupts = <0x1 IRQ_TYPE_LEVEL_HIGH>; - no-loopback-test; - status = "disable"; - }; - - uart6: serial@0x1fe20600 { - compatible = "ns16550a"; - reg = <0 0x1fe20600 0 0x10>; - clocks = <&clk LOONGSON2_APB_CLK>; - interrupt-parent = <&liointc0>; - interrupts = <0x1 IRQ_TYPE_LEVEL_HIGH>; - no-loopback-test; - status = "disable"; - }; - - uart7: serial@0x1fe20700 { - compatible = "ns16550a"; - reg = <0 0x1fe20700 0 0x10>; - clocks = <&clk LOONGSON2_APB_CLK>; - interrupt-parent = <&liointc0>; - interrupts = <0x1 IRQ_TYPE_LEVEL_HIGH>; - no-loopback-test; - status = "disable"; - }; - - uart8: serial@0x1fe20800 { - compatible = "ns16550a"; - reg = <0 0x1fe20800 0 0x10>; - clocks = <&clk LOONGSON2_APB_CLK>; - interrupt-parent = <&liointc0>; - interrupts = <0x2 IRQ_TYPE_LEVEL_HIGH>; - no-loopback-test; - status = "disable"; - }; - - uart9: serial@0x1fe20900 { - compatible = "ns16550a"; - reg = <0 0x1fe20900 0 0x10>; - clocks = <&clk LOONGSON2_APB_CLK>; - interrupt-parent = <&liointc0>; - interrupts = <0x2 IRQ_TYPE_LEVEL_HIGH>; - no-loopback-test; - status = "disable"; - }; - - uart10: serial@0x1fe20a00 { - compatible = "ns16550a"; - reg = <0 0x1fe20a00 0 0x10>; - clocks = <&clk LOONGSON2_APB_CLK>; - interrupt-parent = <&liointc0>; - interrupts = <0x2 IRQ_TYPE_LEVEL_HIGH>; - no-loopback-test; - status = "disable"; - }; - - uart11: serial@0x1fe20b00 { - compatible = "ns16550a"; - reg = <0 0x1fe20b00 0 0x10>; - clocks = <&clk LOONGSON2_APB_CLK>; - interrupt-parent = <&liointc0>; - interrupts = <0x2 IRQ_TYPE_LEVEL_HIGH>; - no-loopback-test; - status = "disable"; + status = "disabled"; }; i2c2: i2c@1fe21000 { @@ -658,6 +364,17 @@ status = "disabled"; }; + nand: nand-controller@1fe26000 { + compatible = "loongson,ls2k1000-nand-controller"; + reg = <0 0x1fe26000 0 0x24>, + <0 0x1fe26040 0 0x4>, + <0 0x1fe00438 0 0x8>; + reg-names = "nand", "nand-dma", "dma-config"; + dmas = <&apbdma0 0>; + dma-names = "rxtx"; + status = "disabled"; + }; + pmc: power-management@1fe27000 { compatible = "loongson,ls2k1000-pmc", "loongson,ls2k0500-pmc", "syscon"; reg = <0x0 0x1fe27000 0x0 0x58>; @@ -688,7 +405,6 @@ status = "disabled"; }; - //no driver i2s: i2s@1fe2d000 { compatible = "loongson,ls2k1000-i2s"; reg = <0 0x1fe2d000 0 0x14>, @@ -702,6 +418,18 @@ status = "disabled"; }; + mmc: mmc@1fe2c000 { + compatible = "loongson,ls2k1000-mmc"; + reg = <0 0x1fe2c000 0 0x68>, + <0 0x1fe00438 0 0x8>; + interrupt-parent = <&liointc0>; + interrupts = <31 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clk LOONGSON2_APB_CLK>; + dmas = <&apbdma1 0>; + dma-names = "rx-tx"; + status = "disabled"; + }; + spi0: spi@1fff0220 { compatible = "loongson,ls2k1000-spi"; reg = <0x0 0x1fff0220 0x0 0x10>; @@ -709,106 +437,6 @@ status = "disabled"; }; - //no driver - nand: nand@1fe26040 { - #address-cells = <2>; - compatible = "loongson,ls-nand"; - reg = <0 0x1fe26040 0 0x0 - 0 0x1fe26000 0 0x20>; - interrupt-parent = <&liointc0>; - interrupts = <20 IRQ_TYPE_LEVEL_HIGH>; - interrupt-names = "nand_irq"; - - dmas = <&apbdma0 1>; - dma-names = "nand_rw"; - dma-mask = <0xffffffff 0xffffffff>; - - status = "disabled"; - }; - - /* CAN controller nodes: - * If you want to use the "can" function,enable the "can" - * controller by configure general configuration register 0. - */ - can0: can@1fe20c00{ - compatible = "nxp,sja1000"; - reg = <0 0x1fe20c00 0 0xff>; - interrupt-parent = <&liointc0>; - interrupts = <16 IRQ_TYPE_LEVEL_HIGH>; - pinctrl-0 = <&can0_default>; - pinctrl-names = "default"; - status = "disabled"; - }; - can1: can@1fe20d00{ - compatible = "nxp,sja1000"; - reg = <0 0x1fe20d00 0 0xff>; - interrupt-parent = <&liointc0>; - interrupts = <17 IRQ_TYPE_LEVEL_HIGH>; - pinctrl-0 = <&can1_default>; - pinctrl-names = "default"; - status = "disabled"; - }; - - - pwm0: pwm@1fe22000{ - compatible = "loongson,ls2k-pwm"; - reg = <0 0x1fe22000 0 0x10>; - clocks = <&clk LOONGSON2_APB_CLK>; - clock-names = "pwm-clk"; - interrupt-parent = <&liointc0>; - interrupts = <24 IRQ_TYPE_LEVEL_HIGH>; - #pwm-cells = <2>; - pinctrl-0 = <&pwm0_default>; - pinctrl-names = "default"; - status = "disabled"; - }; - - pwm1: pwm@1fe22010{ - compatible = "loongson,ls2k-pwm"; - reg = <0 0x1fe22010 0 0x10>; - clocks = <&clk LOONGSON2_APB_CLK>; - clock-names = "pwm-clk"; - interrupt-parent = <&liointc0>; - interrupts = <25 IRQ_TYPE_LEVEL_HIGH>; - #pwm-cells = <2>; - pinctrl-0 = <&pwm1_default>; - pinctrl-names = "default"; - status = "disabled"; - }; - - pwm2: pwm@1fe22020 { - compatible = "loongson,ls2k-pwm"; - - reg = <0 0x1fe22020 0 0xf>; - clocks = <&clk LOONGSON2_APB_CLK>; - clock-names = "pwm-clk"; - interrupt-parent = <&liointc0>; - interrupts = <26 IRQ_TYPE_LEVEL_HIGH>; //34- 31 - - #pwm-cells = <2>; - pinctrl-0 = <&pwm2_default>; - pinctrl-names = "default"; - - status = "disabled"; - }; - - pwm3: pwm@1fe22030 { - compatible = "loongson,ls2k-pwm"; - - reg = <0 0x1fe22030 0 0xf>; - clocks = <&clk LOONGSON2_APB_CLK>; - clock-names = "pwm-clk"; - interrupt-parent = <&liointc0>; - interrupts = <27 IRQ_TYPE_LEVEL_HIGH>; - - #pwm-cells = <2>; - pinctrl-0 = <&pwm3_default>; - pinctrl-names = "default"; - - status = "disabled"; - }; - - pcie@1a000000 { compatible = "loongson,ls2k-pci"; reg = <0x0 0x1a000000 0x0 0x02000000>, @@ -820,14 +448,7 @@ ranges = <0x01000000 0x0 0x00008000 0x0 0x18008000 0x0 0x00008000>, <0x02000000 0x0 0x60000000 0x0 0x60000000 0x0 0x20000000>; - - gmac0: ethernet@3,0 { - // compatible = "snps,dwmac-3.70a"; - compatible = "pci0014,7a03.0", - "pci0014,7a03", - "pciclass0c0320", - "pciclass0c03"; reg = <0x1800 0x0 0x0 0x0 0x0>; interrupts-extended = <&liointc0 12 IRQ_TYPE_LEVEL_HIGH>, <&liointc0 13 IRQ_TYPE_LEVEL_HIGH>; @@ -836,7 +457,6 @@ }; gmac1: ethernet@3,1 { - // compatible = "snps,dwmac-3.70a"; reg = <0x1900 0x0 0x0 0x0 0x0>; interrupts-extended = <&liointc0 14 IRQ_TYPE_LEVEL_HIGH>, <&liointc0 15 IRQ_TYPE_LEVEL_HIGH>; @@ -844,38 +464,19 @@ status = "disabled"; }; - otg: usb@4,0 { - compatible = "loongson,dwc2-otg"; - reg = <0x2000 0x0 0x0 0x0 0x0>; - interrupt-parent = <&liointc1>; - interrupts = <17 IRQ_TYPE_LEVEL_HIGH>; - status = "disabled"; - }; - ehci0: usb@4,1 { - // compatible = "generic-ehci"; - compatible = "pci0014,7a14.0", - "pci0014,7a14", - "pciclass0c0320", - "pciclass0c03"; - reg = <0x2100 0x0 0x0 0x0 0x0>; interrupts-extended = <&liointc1 18 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; }; ohci0: usb@4,2 { - // compatible = "generic-ohci"; - compatible = "pci0014,7a24.0", - "pci0014,7a24", - "pciclass0c0310", - "pciclass0c03"; reg = <0x2200 0x0 0x0 0x0 0x0>; interrupts-extended = <&liointc1 19 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; }; - dc: display@6,0 { + display@6,0 { reg = <0x3000 0x0 0x0 0x0 0x0>; interrupts-extended = <&liointc0 28 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; @@ -888,12 +489,6 @@ }; sata: sata@8,0 { - // compatible = "snps,spear-ahci"; - compatible = "pci0014,7a08.0", - "pci0014,7a08", - "pciclass010601", - "pciclass0106"; - reg = <0x4000 0x0 0x0 0x0 0x0>; interrupts-extended = <&liointc0 19 IRQ_TYPE_LEVEL_HIGH>; status = "disabled";