I am upgrading an old system to use openwrt 18.0.6. The old system had some spi data transfers that were accomplished using a custom character device driver.
All the device driver is doing is poking registers. I have recompiled the device against 18.0.6, but cannot get the spi transfers to work (a check on RT2880_SPI1_STAT_REG always indicates busy).
Following the advice in that bug report to change the dtsi does eliminate the boot error, but I still do not see spi devices in /dev/ and still cannot get spi to work with the custom register writes.
Does anyone have any suggestions? I am out of ideas.
Current workaround is to override with '''spi refclk''' in device DTS file
(leads to same pin settings as for CS1):
{{{
pinctrl {
...
spi_cs1: spi1 {
spi1 {
ralink,group = "spi refclk";
ralink,function = "spi refclk";
};
};
...
}
}}}
Yeah, that eliminates the error, but doesn't result in any spi devices, and as far as I can tell, is not putting the pincntrl into a good state for spi. Unless there is something else I have to do in order to be able to use spi directly from register poking.
note: this seems ok on master / more recent source ( spi refclk is present )... did you mention what source version your using? your sure your selecting the right target?
I'm on the 18.0.6 branch, I am setting spi0 and spi1 status to "okay". I am not sure what you mean by right target, but I am using a custom DTS on top of mt7620a.dtsi, and have system that compiles, flashes and runs fine, just can't make spi work.
The most aggravating part is that i dont need the spi char devices, i just need the board to be initialized so that I can use spi via direct register control, but I cant get either.
In the end my problem ended up being that spi0 was being configured differently on boot by the newer openwrt. I was unable to match it on boot via DTS edits, so added code to my binary to init it (in addition to the spi1 init that was already present). This solved my issue. The DTS "spi cs1" fix has made it into the 18.06 branch now. Thanks all.