Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to link pins to spi lcd and i2c touch? #5

Open
1 task
myamoroso opened this issue Aug 22, 2023 · 6 comments
Open
1 task

how to link pins to spi lcd and i2c touch? #5

myamoroso opened this issue Aug 22, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@myamoroso
Copy link

myamoroso commented Aug 22, 2023

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 myamoroso added the bug Something isn't working label Aug 22, 2023
@jayanta525
Copy link
Owner

which controller is the SPI display using?

@myamoroso
Copy link
Author

spi : st7789v / ili9341
i2c: gt911

@jayanta525
Copy link
Owner

@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>;
	};
};

@myamoroso
Copy link
Author

myamoroso commented Aug 25, 2023

@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?

@jayanta525
Copy link
Owner

@myamoroso, add only

&spi2 {
	status = "okay";
};

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

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

@jayanta525
Copy link
Owner

@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>;
	};
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants