diff --git a/arch/loongarch/boot/dts/loongson/loongson2k300.dtsi b/arch/loongarch/boot/dts/loongson/loongson2k300.dtsi index a413d1db0..e54e657f8 100644 --- a/arch/loongarch/boot/dts/loongson/loongson2k300.dtsi +++ b/arch/loongarch/boot/dts/loongson/loongson2k300.dtsi @@ -106,7 +106,7 @@ }; uart5_pins: pinmux_G64_G65_as_uart5 { - pinctrl-single,bits = <0x10 0x000000a 0x0000000f>; + pinctrl-single,bits = <0x10 0x0000000a 0x0000000f>; }; uart6_pins: pinmux_G60_G61_as_uart6 { @@ -114,15 +114,15 @@ }; uart7_pins: pinmux_G68_G69_as_uart7 { - pinctrl-single,bits = <0x10 0xf0000a00 0x00000f00>; + pinctrl-single,bits = <0x10 0x00000a00 0x00000f00>; }; uart8_pins: pinmux_G70_G71_as_uart8 { - pinctrl-single,bits = <0x8 0x0f00a000 0x0f00f000>; + pinctrl-single,bits = <0x10 0x0000a000 0x0000f000>; }; uart9_pins: pinmux_G66_G67_as_uart9 { - pinctrl-single,bits = <0x10 0x000000a0 0xf00000f0>; + pinctrl-single,bits = <0x10 0x000000a0 0x000000f0>; }; gmac1_pins: pinmux_G44_G55_as_gmac1 { diff --git a/arch/loongarch/boot/dts/loongson/loongson2p500.dtsi b/arch/loongarch/boot/dts/loongson/loongson2p500.dtsi index 6ca564508..0afc7e3a3 100644 --- a/arch/loongarch/boot/dts/loongson/loongson2p500.dtsi +++ b/arch/loongarch/boot/dts/loongson/loongson2p500.dtsi @@ -278,10 +278,10 @@ pinctrl-single,bits = <0x4 0x80000000 0xc0000000>; }; prt_pwm14_pins:pinmux_prt_pwm14_pins { - pinctrl-single,bits = <0x8 0x00000020 0x0000030>; + pinctrl-single,bits = <0x8 0x00000002 0x0000003>; }; prt_pwm15_pins:pinmux_prt_pwm15_pins { - pinctrl-single,bits = <0x8 0x00000080 0x00000c0>; + pinctrl-single,bits = <0x8 0x00000008 0x000000c>; }; }; @@ -467,12 +467,12 @@ /*emmc*/ emmc0: mmc0@0x14210000 { #address-cells = <2>; - compatible = "loongson,ls2k_sdio_1.1"; + compatible = "loongson,ls2k_sdio_1.2"; reg = <0 0x14210000 0 0x1000>; - //interrupt-parent = <&icu>; - //interrupts = <13>; - interrupt-parent = <&extioiic>; - interrupts = <8>; + interrupt-parent = <&icu>; + interrupts = <13>; + //interrupt-parent = <&extioiic>; + //interrupts = <8>; interrupt-names = "ls2k_mci_irq"; dma-mask = <0xffffffff 0xffffffff>; clock-frequency = <0 200000000>; @@ -489,14 +489,14 @@ #address-cells = <2>; compatible = "loongson,ls2k_sdio_1.2"; reg = <0 0x14218000 0 0x1000>; - interrupt-parent = <&icu>; - interrupts = <13>; - //interrupt-parent = <&extioiic>; - //interrupts = <10>; + //interrupt-parent = <&icu>; + //interrupts = <13>; + interrupt-parent = <&extioiic>; + interrupts = <10>; interrupt-names = "ls2k_sdio_irq"; clock-frequency = <0 200000000>; dma-mask = <0xffffffff 0xffffffff>; - bus-width = <4>; + bus-width = <1>; cap-sd-highspeed; cap-mmc-highspeed; //no-mmc; @@ -780,6 +780,7 @@ clock-frequency = <200000000>; interrupt-parent = <&extioiic>; interrupts = <20>; + #pwm-cells = <2>; pinctrl-0 = <&pwm1_pins>; pinctrl-names = "default"; status = "disable"; @@ -791,6 +792,7 @@ clock-frequency = <200000000>; interrupt-parent = <&extioiic>; interrupts = <21>; + #pwm-cells = <2>; pinctrl-0 = <&pwm2_pins>; pinctrl-names = "default"; status = "disable"; @@ -802,6 +804,7 @@ clock-frequency = <200000000>; interrupt-parent = <&extioiic>; interrupts = <22>; + #pwm-cells = <2>; pinctrl-0 = <&pwm3_pins>; pinctrl-names = "default"; status = "disable"; @@ -814,6 +817,7 @@ clock-frequency = <200000000>; interrupt-parent = <&extioiic>; interrupts = <83>; + #pwm-cells = <2>; pinctrl-0 = <&prt_pwm0_pins>; pinctrl-names = "default"; status = "disable"; @@ -825,6 +829,7 @@ clock-frequency = <200000000>; interrupt-parent = <&extioiic>; interrupts = <83>; + #pwm-cells = <2>; pinctrl-0 = <&prt_pwm1_pins>; pinctrl-names = "default"; status = "disable"; @@ -836,6 +841,7 @@ clock-frequency = <200000000>; interrupt-parent = <&extioiic>; interrupts = <83>; + #pwm-cells = <2>; pinctrl-0 = <&prt_pwm2_pins>; pinctrl-names = "default"; status = "disable"; @@ -847,6 +853,7 @@ clock-frequency = <200000000>; interrupt-parent = <&extioiic>; interrupts = <83>; + #pwm-cells = <2>; pinctrl-0 = <&prt_pwm3_pins>; pinctrl-names = "default"; status = "disable"; @@ -858,6 +865,7 @@ clock-frequency = <200000000>; interrupt-parent = <&extioiic>; interrupts = <83>; + #pwm-cells = <2>; pinctrl-0 = <&prt_pwm4_pins>; pinctrl-names = "default"; status = "disable"; @@ -869,6 +877,7 @@ clock-frequency = <200000000>; interrupt-parent = <&extioiic>; interrupts = <83>; + #pwm-cells = <2>; pinctrl-0 = <&prt_pwm5_pins>; pinctrl-names = "default"; status = "disable"; @@ -880,6 +889,7 @@ clock-frequency = <200000000>; interrupt-parent = <&extioiic>; interrupts = <83>; + #pwm-cells = <2>; pinctrl-0 = <&prt_pwm6_pins>; pinctrl-names = "default"; status = "disable"; @@ -891,6 +901,7 @@ clock-frequency = <200000000>; interrupt-parent = <&extioiic>; interrupts = <83>; + #pwm-cells = <2>; pinctrl-0 = <&prt_pwm7_pins>; pinctrl-names = "default"; status = "disable"; @@ -902,6 +913,7 @@ clock-frequency = <200000000>; interrupt-parent = <&extioiic>; interrupts = <84>; + #pwm-cells = <2>; pinctrl-0 = <&prt_pwm8_pins>; pinctrl-names = "default"; status = "disable"; @@ -913,6 +925,7 @@ clock-frequency = <200000000>; interrupt-parent = <&extioiic>; interrupts = <84>; + #pwm-cells = <2>; pinctrl-0 = <&prt_pwm9_pins>; pinctrl-names = "default"; status = "disable"; @@ -924,6 +937,7 @@ clock-frequency = <200000000>; interrupt-parent = <&extioiic>; interrupts = <84>; + #pwm-cells = <2>; pinctrl-0 = <&prt_pwm10_pins>; pinctrl-names = "default"; status = "disable"; @@ -935,6 +949,7 @@ clock-frequency = <200000000>; interrupt-parent = <&extioiic>; interrupts = <84>; + #pwm-cells = <2>; pinctrl-0 = <&prt_pwm11_pins>; pinctrl-names = "default"; status = "disable"; @@ -946,6 +961,7 @@ clock-frequency = <200000000>; interrupt-parent = <&extioiic>; interrupts = <84>; + #pwm-cells = <2>; pinctrl-0 = <&prt_pwm12_pins>; pinctrl-names = "default"; status = "disable"; @@ -957,6 +973,7 @@ clock-frequency = <200000000>; interrupt-parent = <&extioiic>; interrupts = <84>; + #pwm-cells = <2>; pinctrl-0 = <&prt_pwm13_pins>; pinctrl-names = "default"; status = "disable"; @@ -968,6 +985,7 @@ clock-frequency = <200000000>; interrupt-parent = <&extioiic>; interrupts = <84>; + #pwm-cells = <2>; pinctrl-0 = <&prt_pwm14_pins>; pinctrl-names = "default"; status = "disable"; @@ -979,6 +997,7 @@ clock-frequency = <200000000>; interrupt-parent = <&extioiic>; interrupts = <84>; + #pwm-cells = <2>; pinctrl-0 = <&prt_pwm15_pins>; pinctrl-names = "default"; status = "disable"; diff --git a/arch/loongarch/boot/dts/loongson/loongson_panel_param.dtsi b/arch/loongarch/boot/dts/loongson/loongson_panel_param.dtsi index 7c5b0d6d9..63de5b3f3 100644 --- a/arch/loongarch/boot/dts/loongson/loongson_panel_param.dtsi +++ b/arch/loongarch/boot/dts/loongson/loongson_panel_param.dtsi @@ -27,8 +27,8 @@ }; panel-ATK-MD0430R-800x480 { - width-mm = <117>; - height-mm = <62>; + width-mm = <223>; + height-mm = <125>; label = "ATK-MD0430R-800x480"; data-mapping = "jeida-24"; @@ -50,8 +50,8 @@ }; panel-ATK-MD0700R-1024x600 { - width-mm = <180>; - height-mm = <110>; + width-mm = <223>; + height-mm = <125>; label = "ATK-MD0700R-1024x600"; data-mapping = "jeida-24"; diff --git a/arch/loongarch/boot/dts/loongson/ls2k300_mini_dp.dts b/arch/loongarch/boot/dts/loongson/ls2k300_mini_dp.dts index a16b2176f..414fd7f61 100644 --- a/arch/loongarch/boot/dts/loongson/ls2k300_mini_dp.dts +++ b/arch/loongarch/boot/dts/loongson/ls2k300_mini_dp.dts @@ -55,8 +55,8 @@ pixelclk-active = <0>; }; #else // 7' LCD - width-mm = <180>; - height-mm = <110>; + width-mm = <223>; + height-mm = <125>; label = "ATK-MD0700R-1024x600"; data-mapping = "jeida-24"; diff --git a/arch/loongarch/boot/dts/loongson/ls2k300_pai.dts b/arch/loongarch/boot/dts/loongson/ls2k300_pai.dts index 2b27505a3..73a5a73dd 100644 --- a/arch/loongarch/boot/dts/loongson/ls2k300_pai.dts +++ b/arch/loongarch/boot/dts/loongson/ls2k300_pai.dts @@ -83,8 +83,8 @@ pixelclk-active = <0>; }; #else // 7' LCD - width-mm = <180>; - height-mm = <110>; + width-mm = <223>; + height-mm = <125>; label = "ATK-MD0700R-1024x600"; data-mapping = "jeida-24"; @@ -125,24 +125,12 @@ regulator-always-on; }; - humidity_sensor { - compatible = "dht11-sensor"; - SHT11-gpios = <&gpio 61 GPIO_ACTIVE_HIGH>; - status = "okay"; - }; - // 虽然这个时钟在从模式下没用,但 es8388 驱动必须指定这个时钟 es8388_clk: es8388-clock { compatible = "fixed-clock"; clock-frequency = <11289600>; #clock-cells = <1>; }; - - onewire { - compatible = "w1-gpio"; - gpios = <&gpio 68 GPIO_ACTIVE_HIGH>; - status = "disabled"; - }; }; &uart0 { @@ -197,13 +185,12 @@ cs-gpios = <&gpio 67 0>, <&gpio 85 0>; - mcp3004@0 { - compatible = "mcp3004"; + spidev1@0 { + compatible = "rohm,dh2228fv"; reg = <0>; - spi-max-frequency = <1500000>; + spi-max-frequency = <25000000>; }; - - spidev1@1 { + spidev2@1 { compatible = "rohm,dh2228fv"; reg = <1>; spi-max-frequency = <25000000>; @@ -322,4 +309,12 @@ &sound { status = "okay"; -}; \ No newline at end of file +}; + +&pwm0 { + status = "okay"; +}; + +&pwm1 { + status = "okay"; +}; diff --git a/arch/loongarch/boot/dts/loongson/ls2k300_pai_func2.dts b/arch/loongarch/boot/dts/loongson/ls2k300_pai_func2.dts new file mode 100644 index 000000000..bb724ee1e --- /dev/null +++ b/arch/loongarch/boot/dts/loongson/ls2k300_pai_func2.dts @@ -0,0 +1,298 @@ +#include +#include +#include +#include + +#include "loongson2k300.dtsi" +#include "loongson_panel_param.dtsi" + +/ { + model = "LS2K300-PAI"; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs = "earlycon"; + }; + + /* not need memory node, we get memory info from boot params. */ + //memory { + // name = "memory"; + // device_type = "memory"; + // reg = <0 0x00200000 0 0x0ee00000 + // 0 0x90000000 0 0x10000000>; + //}; + + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + linux,cma { + compatible = "shared-dma-pool"; + reusable; + size = <0 0x02000000>; + linux,cma-default; + }; + }; + + leds { + compatible = "gpio-leds"; + + led1 { + label = "led1"; + gpios = <&gpio 54 GPIO_ACTIVE_LOW>; + linux,default-trigger = "heartbeat"; + default-state = "on"; + }; + }; + + lcd_backlight: backlight { + compatible = "gpio-backlight"; + gpios = <&gpio 43 GPIO_ACTIVE_HIGH>; + default-on; + }; + + panel: dvo-connector@0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "panel-lvds", "auo,b101ean01"; + backlight = <&lcd_backlight>; + + /* lcd power on control gpio */ + // enable-gpios = <&pioA 3 GPIO_ACTIVE_HIGH>; + // power-supply = <&vdd_lcd>; +#if 0 // 4.3' LCD + width-mm = <223>; + height-mm = <125>; + label = "ATK-MD0430R-800x480"; + data-mapping = "jeida-24"; + + panel-timing { + clock-frequency = <27000000>; + hactive = <800>; + vactive = <480>; + hsync-len = <40>; + hfront-porch = <48>; + hback-porch = <40>; + vfront-porch = <13>; + vback-porch = <32>; + vsync-len = <1>; + de-active = <1>; + hsync-active = <0>; + vsync-active = <0>; + pixelclk-active = <0>; + }; +#else // 7' LCD + width-mm = <223>; + height-mm = <125>; + label = "ATK-MD0700R-1024x600"; + data-mapping = "jeida-24"; + + panel-timing { + clock-frequency = <51200000>; + hactive = <1024>; + vactive = <600>; + hsync-len = <20>; + hfront-porch = <160>; + hback-porch = <140>; + vfront-porch = <12>; + vback-porch = <20>; + vsync-len = <3>; + de-active = <1>; + hsync-active = <0>; + vsync-active = <0>; + pixelclk-active = <0>; + }; +#endif + port@0 { + reg = <0>; + + #address-cells = <1>; + #size-cells = <0>; + + dvo_connector_in: endpoint@0 { + reg = <0>; + remote-endpoint = <&dc_out_rgb0>; + }; + }; + }; + + vccio_codec: 3_3V{ + compatible = "regulator-fixed"; + regulator-name = "VCC_IO"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + // 虽然这个时钟在从模式下没用,但 es8388 驱动必须指定这个时钟 + es8388_clk: es8388-clock { + compatible = "fixed-clock"; + clock-frequency = <11289600>; + #clock-cells = <1>; + }; +}; + +&uart0 { + status = "okay"; +}; + +&uart2 { + status = "okay"; +}; + +&uart4 { + status = "okay"; +}; + +&uart5 { + status = "okay"; +}; + +&uart6 { + status = "okay"; +}; + +&uart7 { + status = "disabled"; +}; + +&uart8 { + status = "disabled"; +}; + +&uart9 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + spi-flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <25000000>; + reg = <0>; + }; +}; + +&spi1 { + status = "disabled"; +}; + +&spi2 { + status = "disabled"; +}; + +&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>; //有数据时闪烁 + }; + }; +}; + +&dc { + status = "ok"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + dc_out_rgb0: endpoint { + remote-endpoint = <&dvo_connector_in>; + }; + }; + }; +}; + +&i2c0 { + status = "ok"; + + touchpad: gt9147@14 { + compatible = "goodix,gt9147"; + reg = <0x14>; + // 2K300 GPIO 支持中断控制 + // GPIO 中断号为 vhwirq-base + pinnum (170 = 128 + 42) + interrupt-parent = <&gpio>; + interrupts = <170 IRQ_TYPE_EDGE_FALLING>; + irq-gpios = <&gpio 42 GPIO_ACTIVE_LOW>; + reset-gpios = <&gpio 55 GPIO_ACTIVE_LOW>; + }; +}; + +&i2c1 { + status = "ok"; +}; + +&i2c2 { + status = "okay"; + + codec: es8388@11{ + compatible = "everest,es8388"; + reg = <0x11>; + AVDD-supply = <&vccio_codec>; + DVDD-supply = <&vccio_codec>; + HPVDD-supply = <&vccio_codec>; + PVDD-supply = <&vccio_codec>; + clocks = <&es8388_clk 0>; + }; +}; + + +&can0 { + status = "okay"; +}; + +&can1 { + status = "okay"; +}; + +&can2 { + status = "okay"; +}; + +&can3 { + status = "okay"; +}; + +&adc { + status = "okay"; +}; + +&rtc0 { + status = "okay"; +}; + +&sdio1 { + pinctrl-0 = <&sdio1_pins>; + pinctrl-names = "default"; + cap-sd-highspeed; + cap-mmc-highspeed; + bus-width = <4>; + cd-gpios = <&gpio 82 GPIO_ACTIVE_LOW>; + status = "okay"; +}; + +&i2s { + status = "okay"; +}; + +&audio { + status = "okay"; +}; + +&sound { + status = "okay"; +}; diff --git a/arch/loongarch/boot/dts/loongson/ls2k300_pai_pihat.dts b/arch/loongarch/boot/dts/loongson/ls2k300_pai_pihat.dts new file mode 100644 index 000000000..554d41b6b --- /dev/null +++ b/arch/loongarch/boot/dts/loongson/ls2k300_pai_pihat.dts @@ -0,0 +1,324 @@ +#include +#include +#include +#include + +#include "loongson2k300.dtsi" +#include "loongson_panel_param.dtsi" + +/ { + model = "LS2K300-PAI"; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs = "earlycon"; + }; + + /* not need memory node, we get memory info from boot params. */ + //memory { + // name = "memory"; + // device_type = "memory"; + // reg = <0 0x00200000 0 0x0ee00000 + // 0 0x90000000 0 0x10000000>; + //}; + + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + linux,cma { + compatible = "shared-dma-pool"; + reusable; + size = <0 0x02000000>; + linux,cma-default; + }; + }; + + leds { + compatible = "gpio-leds"; + + led1 { + label = "led1"; + gpios = <&gpio 54 GPIO_ACTIVE_LOW>; + linux,default-trigger = "heartbeat"; + default-state = "on"; + }; + }; + + lcd_backlight: backlight { + compatible = "gpio-backlight"; + gpios = <&gpio 43 GPIO_ACTIVE_HIGH>; + default-on; + }; + + panel: dvo-connector@0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "panel-lvds", "auo,b101ean01"; + backlight = <&lcd_backlight>; + + /* lcd power on control gpio */ + // enable-gpios = <&pioA 3 GPIO_ACTIVE_HIGH>; + // power-supply = <&vdd_lcd>; +#if 0 // 4.3' LCD + width-mm = <223>; + height-mm = <125>; + label = "ATK-MD0430R-800x480"; + data-mapping = "jeida-24"; + + panel-timing { + clock-frequency = <27000000>; + hactive = <800>; + vactive = <480>; + hsync-len = <40>; + hfront-porch = <48>; + hback-porch = <40>; + vfront-porch = <13>; + vback-porch = <32>; + vsync-len = <1>; + de-active = <1>; + hsync-active = <0>; + vsync-active = <0>; + pixelclk-active = <0>; + }; +#else // 7' LCD + width-mm = <223>; + height-mm = <125>; + label = "ATK-MD0700R-1024x600"; + data-mapping = "jeida-24"; + + panel-timing { + clock-frequency = <51200000>; + hactive = <1024>; + vactive = <600>; + hsync-len = <20>; + hfront-porch = <160>; + hback-porch = <140>; + vfront-porch = <12>; + vback-porch = <20>; + vsync-len = <3>; + de-active = <1>; + hsync-active = <0>; + vsync-active = <0>; + pixelclk-active = <0>; + }; +#endif + port@0 { + reg = <0>; + + #address-cells = <1>; + #size-cells = <0>; + + dvo_connector_in: endpoint@0 { + reg = <0>; + remote-endpoint = <&dc_out_rgb0>; + }; + }; + }; + + vccio_codec: 3_3V{ + compatible = "regulator-fixed"; + regulator-name = "VCC_IO"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + humidity_sensor { + compatible = "dht11-sensor"; + SHT11-gpios = <&gpio 61 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + // 虽然这个时钟在从模式下没用,但 es8388 驱动必须指定这个时钟 + es8388_clk: es8388-clock { + compatible = "fixed-clock"; + clock-frequency = <11289600>; + #clock-cells = <1>; + }; + + onewire { + compatible = "w1-gpio"; + gpios = <&gpio 68 GPIO_ACTIVE_HIGH>; + }; +}; + +&uart0 { + status = "okay"; +}; + +&uart2 { + status = "ok"; +}; + +&uart5 { + status = "disabled"; +}; + +&uart6 { + status = "disabled"; +}; + +&uart7 { + status = "disabled"; +}; + +&uart8 { + status = "disabled"; +}; + +&spi0 { + status = "okay"; + + 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 = "ok"; + pinctrl-0 = <&spi2_cs_as_gpio>; + pinctrl-names = "default"; + num-chipselects = <2>; + cs-gpios = <&gpio 67 0>, + <&gpio 85 0>; + + mcp3004@0 { + compatible = "mcp3004"; + reg = <0>; + spi-max-frequency = <1500000>; + }; + + spidev1@1 { + compatible = "rohm,dh2228fv"; + reg = <1>; + spi-max-frequency = <25000000>; + }; +}; + +&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>; //有数据时闪烁 + }; + }; +}; + +&dc { + status = "ok"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + dc_out_rgb0: endpoint { + remote-endpoint = <&dvo_connector_in>; + }; + }; + }; +}; + +&i2c0 { + status = "ok"; + + touchpad: gt9147@14 { + compatible = "goodix,gt9147"; + reg = <0x14>; + // 2K300 GPIO 支持中断控制 + // GPIO 中断号为 vhwirq-base + pinnum (170 = 128 + 42) + interrupt-parent = <&gpio>; + interrupts = <170 IRQ_TYPE_EDGE_FALLING>; + irq-gpios = <&gpio 42 GPIO_ACTIVE_LOW>; + reset-gpios = <&gpio 55 GPIO_ACTIVE_LOW>; + }; +}; + +&i2c1 { + status = "ok"; +}; + +&i2c2 { + status = "okay"; + + codec: es8388@11{ + compatible = "everest,es8388"; + reg = <0x11>; + AVDD-supply = <&vccio_codec>; + DVDD-supply = <&vccio_codec>; + HPVDD-supply = <&vccio_codec>; + PVDD-supply = <&vccio_codec>; + clocks = <&es8388_clk 0>; + }; +}; + + +&can0 { + status = "disabled"; +}; + +&can1 { + status = "disabled"; +}; + +&can2 { + status = "disabled"; +}; + +&can3 { + status = "disabled"; +}; + +&adc { + status = "okay"; +}; + +&rtc0 { + status = "okay"; +}; + +&sdio1 { + pinctrl-0 = <&sdio1_pins>; + pinctrl-names = "default"; + cap-sd-highspeed; + cap-mmc-highspeed; + bus-width = <4>; + cd-gpios = <&gpio 82 GPIO_ACTIVE_LOW>; + status = "okay"; +}; + +&i2s { + status = "okay"; +}; + +&audio { + status = "okay"; +}; + +&sound { + status = "okay"; +}; diff --git a/arch/loongarch/boot/dts/loongson/ls2p500_gbkpjm0_v10.dts b/arch/loongarch/boot/dts/loongson/ls2p500_gbkpjm0_v10.dts index 36428b486..108e5d1e5 100644 --- a/arch/loongarch/boot/dts/loongson/ls2p500_gbkpjm0_v10.dts +++ b/arch/loongarch/boot/dts/loongson/ls2p500_gbkpjm0_v10.dts @@ -5,6 +5,17 @@ / { model = "LS2P500-GBKPJM0"; + + leds { + compatible = "gpio-leds"; + + sysrun { + label = "sysrun"; + gpios = <&pioB 32 GPIO_ACTIVE_LOW>; + linux,default-trigger = "heartbeat"; + default-state = "on"; + }; + }; }; // UART LCD @@ -59,3 +70,7 @@ pinctrl-names = "default"; cd-gpios = <&pioA 14 GPIO_ACTIVE_LOW>; }; + +&prt_pwm15 { + status = "okay"; +}; diff --git a/arch/loongarch/boot/dts/loongson/ls2p500_rsj_mb_v10.dts b/arch/loongarch/boot/dts/loongson/ls2p500_rsj_mb_v10.dts index 8db14a1fd..ae36431b9 100644 --- a/arch/loongarch/boot/dts/loongson/ls2p500_rsj_mb_v10.dts +++ b/arch/loongarch/boot/dts/loongson/ls2p500_rsj_mb_v10.dts @@ -102,6 +102,17 @@ gpios = <&pioC 20 GPIO_ACTIVE_HIGH>; default-on; }; + + leds { + compatible = "gpio-leds"; + + led1 { + label = "led1"; + gpios = <&pioC 19 GPIO_ACTIVE_LOW>; + linux,default-trigger = "heartbeat"; + default-state = "on"; + }; + }; }; // UART LCD diff --git a/arch/loongarch/configs/loongson_2p500_defconfig b/arch/loongarch/configs/loongson_2p500_defconfig index 744fed95e..7abe9a0fb 100644 --- a/arch/loongarch/configs/loongson_2p500_defconfig +++ b/arch/loongarch/configs/loongson_2p500_defconfig @@ -260,10 +260,7 @@ CONFIG_MTD=y CONFIG_MTD_CMDLINE_PARTS=y CONFIG_MTD_BLOCK=y CONFIG_MTD_BLOCK2MTD=y -CONFIG_MTD_RAW_NAND=y -CONFIG_MTD_NAND_ECC_SW_BCH=y -CONFIG_MTD_NAND_LS=y -CONFIG_MTD_SPI_NOR=m +CONFIG_MTD_SPI_NOR=y CONFIG_MTD_UBI=y CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_CRYPTOLOOP=y @@ -452,6 +449,7 @@ CONFIG_MS518XN_ADC=y CONFIG_MCP4728=y CONFIG_MAX31865=y CONFIG_PWM=y +CONFIG_PWM_LS=y CONFIG_LOONGSON_IOINTC_2K500=y CONFIG_EXT2_FS=y CONFIG_EXT2_FS_XATTR=y diff --git a/drivers/misc/ls2x-lio.c b/drivers/misc/ls2x-lio.c index f007ab49b..242bdf911 100644 --- a/drivers/misc/ls2x-lio.c +++ b/drivers/misc/ls2x-lio.c @@ -149,6 +149,7 @@ static ssize_t lio_read (struct file *file, char __user *buf, size_t size, loff_ { unsigned long res; u8 *kbuf; + u16 val16; void *ptr; int i; struct lio_node* node = (struct lio_node*)(file->private_data); @@ -167,9 +168,18 @@ static ssize_t lio_read (struct file *file, char __user *buf, size_t size, loff_ } ptr = node->base + *offset; - for (i = 0; i < size; i++) { - kbuf[i] = ioread8(ptr + i); + if (node->parent->lio_io_width == 0) { + for (i = 0; i < size; i++) { + kbuf[i] = ioread8(ptr + i); + } + } else { + for (i = 0; i < size; i += 2) { + val16 = ioread16(ptr + i); + kbuf[i+1] = val16 >> 8; + kbuf[i] = val16 & 0xff; + } } + // pr_info("lio kernel read: 0x%x\n", kbuf[0]); res = copy_to_user(buf, kbuf, size); if (res != 0) { diff --git a/drivers/net/can/ls_canfd/lscanfd.ko b/drivers/net/can/ls_canfd/lscanfd.ko index caa563423..580daeb49 100644 Binary files a/drivers/net/can/ls_canfd/lscanfd.ko and b/drivers/net/can/ls_canfd/lscanfd.ko differ diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig index 12bf42e55..83f0e6ff9 100644 --- a/drivers/pwm/Kconfig +++ b/drivers/pwm/Kconfig @@ -572,7 +572,7 @@ config PWM_ZX config PWM_LS tristate "Loongson PWM support" - depends on LOONGSON_2K500 || LOONGSON_2K1000 || LOONGSON_2K300 + depends on LOONGSON_2K500 || LOONGSON_2K1000 || LOONGSON_2K300 || LOONGSON_2P500 help Generic PWM framework driver for loongson3.