Right now we're working on a board with two spi controlled sensors on it. Each sensor is on a different spi controller. For some reason we're only able to read back data from the sensor on mcspi1. The reads from mcspi3 all come back as 0s. Both sensors wired to their individual chip select 0 pins with d0 wired to MOSI and d1 to MISO.
/* These SPI1 values are for e2v0 (cam1), and match the board layout */
spi1_pins: spi1_pins {
pinctrl-single,pins = <
0x3A4 (PIN_INPUT | MUX_MODE0) /* spi1_sclk SPI1_SCLK */
0x3A8 (PIN_INPUT | MUX_MODE0) /* spi1_d1 SPI1_D1 */
0x3AC (PIN_OUTPUT | MUX_MODE0) /* spi1_d0 SPI1_D0 */
0x3B0 (PIN_OUTPUT | MUX_MODE0) /* spi1_cs0 SPI1_CS0 */
>;
};
/* /1* These SPI3 values are for e2v1 (cam2), and match the board layout *1/ */
spi3_pins: spi3_pins {
pinctrl-single,pins = <
0x2D4 (PIN_INPUT | MUX_MODE3) /* mcasp1_axr8 SPI3_SCLK */
0x2D8 (PIN_INPUT | MUX_MODE3) /* mcasp1_axr9 SPI3_D1 */
0x2DC (PIN_OUTPUT | MUX_MODE3) /* mcasp1_axr10 SPI3_D0 */
0x2E0 (PIN_OUTPUT | MUX_MODE3) /* mcasp1_axr11 SPI3_CS0 */
>;
};
/* e2v0, cam1, SPI control */
&mcspi1 {
pinctrl-names = "default";
pinctrl-0 = <&spi1_pins>;
status = "okay";
ti,pindir-d0-out-d1-in;
ev76c560@0 {
/* compatible = "linux,spidev"; */
compatible ="ti,ev76c560";
pinctrl-names = "default";
pinctrl-0 = <&e2v0_pinmux_core &e2v0_pru_gpios>;
spi-max-frequency = <5000000>;
reg = <0x0>;
port {
cam1: endpoint {
remote-endpoint = <&vin1a>;
hsync-active = <1>;
vsync-active = <1>;
pclk-sample = <0>;
input-clock-freq = <32000000>;
pixel-clock-freq = <96000000>;
mclk-frequency = <48000000>;
gpio-reset = <171>; /* gpio6_11 */
};
};
};
};
/* e2v1, cam2, SPI control */
&mcspi3 {
pinctrl-names = "default";
pinctrl-0 = <&spi3_pins>;
status = "okay";
ti,pindir-d0-out-d1-in;
ev76c560@0 {
/* compatible = "linux,spidev"; */
compatible = "ti,ev76c560";
pinctrl-names = "default";
pinctrl-0 = <&e2v1_pinmux_core &e2v1_pru_gpios>;
spi-max-frequency = <5000000>;
reg = <0x0>;
port {
cam2: endpoint {
remote-endpoint = <&vin2a>;
hsync-active = <1>;
vsync-active = <1>;
pclk-sample = <0>;
input-clock-freq = <32000000>;
pixel-clock-freq = <96000000>;
mclk-frequency = <48000000>;
gpio-reset = <225>; /* gpio8_1 */
};
};
};
};