rk3308-rock-pi-s icon indicating copy to clipboard operation
rk3308-rock-pi-s copied to clipboard

how to link pins to spi lcd and i2c touch?

Open myamoroso opened this issue 10 months ago • 6 comments

Describe the bug

how to update device tree to support spi lcd and i2c touch ? which pins to link?

thanks !!!

OpenWrt version

r14622-7da6ae78b3

OpenWrt target/subtarget

rockchip/armv8

Device

Radxa ROCK Pi S

Image kind

Self-built image

Steps to reproduce

No response

Actual behaviour

No response

Expected behaviour

No response

Additional info

No response

Diffconfig

No response

Terms

  • [ ] I am reporting an issue for OpenWrt, not an unsupported fork.

myamoroso avatar Aug 22 '23 15:08 myamoroso

which controller is the SPI display using?

jayanta525 avatar Aug 22 '23 17:08 jayanta525

spi : st7789v / ili9341 i2c: gt911

myamoroso avatar Aug 22 '23 18:08 myamoroso

@myamoroso , for SPI display with ILI9341 controller, you can hookup with the SPI2 bus on the ROCK Pi S, pinouts here - RADXA For Linux, Linux has native support for ILI9341 with DTS support - docs here

DTS modifications

&spi2 {
	status = "okay";

        display9341@0{
		compatible = "ilitek,ili9341";
		reg = <0>;
				
		spi-max-frequency = <32000000>;
		rotate = <0>;
		bgr;
		fps = <50>;
		buswidth = <8>;
		reset-gpios = <&gpio 17 0>;
		dc-gpios = <&gpio 16 0>;
		led-gpios = <&gpio 15 1>;
		debug = <0>;
	};
};

jayanta525 avatar Aug 23 '23 16:08 jayanta525

@jayanta525
Thanks for your reply. Unforturnatlly, i didn't get the /dev/fb0 device, and get the log:

[ 0.239304] SPI driver fb_ili9341 has no spi_device_id for ilitek,ili9341

Following is repro steps:

  1. Add the &spi2{} node to the bottom of the following dtsi and dts files:

./rk3308-rock-pi-s/build_dir/host/u-boot-2023.04/arch/arm/dts/rk3308-u-boot.dtsi ./rk3308-rock-pi-s/build_dir/target-aarch64_generic_musl/u-boot-2023.07.02/arch/arm/dts/rk3308-u-boot.dtsi ./rk3308-rock-pi-s/build_dir/target-aarch64_generic_musl/u-boot-rock-pi-s-rk3308/u-boot-2023.10-rc2/arch/arm/dts/rk3308-u-boot.dtsi

./rk3308-rock-pi-s/build_dir/host/u-boot-2023.04/arch/arm/dts/rk3308-rock-pi-s.dts ./rk3308-rock-pi-s/build_dir/toolchain-aarch64_generic_gcc-12.3.0_musl/linux-6.1.46/arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts ./rk3308-rock-pi-s/build_dir/target-aarch64_generic_musl/u-boot-2023.07.02/arch/arm/dts/rk3308-rock-pi-s.dts ./rk3308-rock-pi-s/build_dir/target-aarch64_generic_musl/linux-rockchip_armv8/linux-6.1.46/arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts ./rk3308-rock-pi-s/build_dir/target-aarch64_generic_musl/u-boot-rock-pi-s-rk3308/u-boot-2023.10-rc2/arch/arm/dts/rk3308-rock-pi-s.dts

  1. Apply pins the board: According SPI2(RADXA) and &spi2{} node, link the lcd pins to the board.

  2. enable the "FB_TFT_ILI9341" in the kernel menuconfig

where is missing or lost?

myamoroso avatar Aug 25 '23 12:08 myamoroso

@myamoroso, add only

&spi2 {
	status = "okay";
};

in uboot. (rk3308-rock-pi-s.dts)

and full node on (linux....rk3308-rock-pi-s.dts)

jayanta525 avatar Aug 25 '23 16:08 jayanta525

@myamoroso

try with a lower spi speed -

&spi2 {
	status = "okay";
        max-freq = <48000000>;

        display9341@0{
		compatible = "ilitek,ili9341";
                status = "okay";
		reg = <0>;
				
		spi-max-frequency = <15000000>;
		rotate = <0>;
		bgr;
		fps = <30>;
		buswidth = <8>;
		reset-gpios = <&gpio 17 0>;
		dc-gpios = <&gpio 16 0>;
		led-gpios = <&gpio 15 1>;
		debug = <0>;
	};
};

jayanta525 avatar Aug 26 '23 12:08 jayanta525