Hi,
I'm trying to get a MCP2515 working with an OpenWRT router connected to
the
second SPI channel (CS1). The first one is used by the flash. Here the
error
message while loading the mcp251x module (Kernel 5.10.26):
[ 112.226164] mcp251x spi0.1: spi transfer failed: ret = -22
[ 112.231810] mcp251x spi0.1: Probe failed, err=22
[ 112.237021] mcp251x: probe of spi0.1 failed with error -22
The DTS part looks like:
/ {
compatible = "onion,omega2", "mediatek,mt7628an-soc";
};
...
&spi0 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>;
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <40000000>;
...
};
can0: can@1 {
compatible = "microchip,mcp2515";
reg = <1>;
clock-frequency = <8000000>;
interrupt-parent = <&gpio>;
interrupts = <16 8>;
spi-max-frequency = <10000000>;
};
};
I don't see any activity on the SPI bus/CS1 line. A cross check with
spidev
using following DTS sequence instead of can0:
spidev@1 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "rohm,dh2228fv";
reg = <1>;
spi-max-frequency = <100000>;
};
shows, that the setup using SPI bus with CS1 is working.
Of course, sharing the SPI bus with the flash isn't the best performance
practice, but it should be ok because when the programms are loaded,
it's
unlikely that the SPI bus is occupied by the routers flash system
anymore.
Does anybody have a hint why the init fails ?
Regards
Gerd