Part Number: AM3352
Tool/software: Linux
Hello,everyone.
I used SDK 04.00.00.04(linux-4.9.28+gitAUTOINC+eed43d1050-geed43d1050).
When I use SPI0 to connect a chip which as a spi slave device, I found the SPI0_CS signal always stay in low.
I know the omap2_mcspi_set_enable function is enable the spi channel, which setting bit 0 of OMAP2_MCSPI_CHCTRL0 reg. and mcspi_write_chconf0 function used to set OMAP2_MCSPI_CHCONF0 reg. the bit 20 of OMAP2_MCSPI_CHCONF0 can control SPI0_CS to low or high.
I add printk in the mcspi_write_chconf0 function to print the OMAP2_MCSPI_CHCONF0 reg, and I found that after linux running, the bit 20(FORCE) of OMAP2_MCSPI_CHCONF0 reg is 1(EPOL=1), that is the resean the SPI0_CS stay in low.
But, I need the SPI0_CS stay in high when SPI0 not access the slave chip, and change to low when access the slave chip. And I think that is the right logic, but when I use the spi driver in SDK 04.00.00.04, I couldn't get this result.
I want to know how can I get the result which I wanted? Is there any error in the spi driver?
Following is my dts about spi:
spi0_pins:pinmux_spi0_pins {
pinctrl-single,pins = <
AM33XX_IOPAD(0x950, PIN_INPUT_PULLUP | MUX_MODE0) /* spi0_sclk.spi0_sclk */
AM33XX_IOPAD(0x954, PIN_INPUT_PULLUP | MUX_MODE0) /* spi0_d0.spi0_d0 */
AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE0) /* spi0_d1.spi0_d1 */
AM33XX_IOPAD(0x95C, PIN_OUTPUT_PULLUP | MUX_MODE0) /* spi0_cs0.spi0_cs0 */
/*SPI0_IRQ*/
AM33XX_IOPAD(0x97C, PIN_INPUT_PULLUP | MUX_MODE7) /* uart1_rtsn.gpio0_13 */
/*SPI0_RST*/
AM33XX_IOPAD(0x964, PIN_OUTPUT_PULLUP | MUX_MODE7) /* ecap0_in_pwm0_out.gpio0_7 */
>;
};
&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins>;
status = "okay";
wk2166@0{
compatible = "wk2xxxspi";
spi-max-frequency = <1000000>;
reg = <0>;
irq-gpio = <&gpio0 13 GPIO_ACTIVE_LOW>;
rst-gpio = <&gpio0 7 GPIO_ACTIVE_LOW>;
};
};
