GPIO SPI display on bpi-r4?

Greetings all, I’m wondering if anyone’s been able to make use of the SPI pins in the bpi-r4 GPIO header. I’m interested in building a monitor using an OLED display like this one, ideally using the luma-lcd library.

In another thread for the r3, frank-w was attempting the same thing. It’s unclear from that thread if it ever worked out, though I’ve heard the r3 has similar hardware as the r4.

Curious if anyone has any pointers here.

1 Like

There is a problem with the NVME SSD. I think you have to remove 2 resistors first…

I tried but cannot get display init to work…but have not tried luma-led with it. R3 and r4 using different soc,so hardware is different but basicly they have multiple spi,but maybe lumaled needs a exposed spidev device

I’m specifically looking at doing this in OpenWRT because I think the platform support for the R4 is probably best in that distro compared to upstream for now. I noticed what looks like a reference to SPI1 in one of the device tree files. I did also find a thread on the OpenWRT forum where someone made some progress accessing the spi1 device, but apparently it causes kernel panics.

According to the pinout diagram, it does look like SPI1 would be the right place to connect a display.

I’m curious how this relates to the i2c issue though? I read about the resistors messing up NVMe and SFP modules, but shouldn’t that be totally unrelated to the spi1 bus?

I think i2c issue is unrelated here, more i would suggest adding some printk to mtk_spi_set_cs and try again. Maybe cs pin is mapped to another function,but this should be handled properly…it looks like it is something related with interrupt handling

A bit more information is in the issue here,but suggested change seems not fixing it

Could you try this?

--- a/arch/arm64/boot/dts/mediatek/mt7988a.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7988a.dtsi
@@ -345,7 +345,7 @@ spi1: spi@11008000 {
                        reg = <0 0x11008000 0 0x100>;
                        interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&topckgen CLK_TOP_MPLL_D2>,
-                                <&topckgen CLK_TOP_SPI_SEL>,
+                                <&topckgen CLK_TOP_SPIM_MST_SEL>,
                                 <&infracfg CLK_INFRA_104M_SPI1>,
                                 <&infracfg CLK_INFRA_66M_SPI1_HCK>;
                        clock-names = "parent-clk", "sel-clk", "spi-clk",

and removing the “spi-” from hclk name…driver looks for “hclk”

OpenWrt should now support using SPI1

3 Likes

Indeed as per my first checks it seems SPI is working on BPI-R4 :wink: