This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

在uboot中配置好SPI1的pinmux,在设备树中也配置(uboot配置的spi1 pinmux和设备树配置的一样),但内核启动后SPI1却通信不上。如果在uboot中不配置SPI1的pinmux,内核启动后SPI1通信正常。芯片:AM3352; 最新的TISDK。



uboot的配置

static struct module_pin_mux spi1_pin_mux[] = {
{OFFSET(mcasp0_aclkx), (MODE(3) | PULLUDEN)}, /* SPI0_SCLK */
{OFFSET(mcasp0_fsx), (MODE(3) | PULLUDEN)}, /* SPI0_D0 */
//{OFFSET(spi0_d1), (MODE(0) | RXACTIVE | PULLUDEN)}, /* SPI0_D1 */
//{OFFSET(spi0_cs0), (MODE(0) | RXACTIVE |
// PULLUDEN | PULLUP_EN)}, /* SPI0_CS0 */
{-1},
};

设备树的配置:

myspi1_pins_default: myspi1_pins_default {
pinctrl-single,pins = <
AM33XX_IOPAD(0x990, PIN_OUTPUT_PULLUP | MUX_MODE3) /* (A13) mcasp0_aclkx.spi1_sclk */
AM33XX_IOPAD(0x994, PIN_OUTPUT_PULLUP | MUX_MODE3) /* (B13) mcasp0_fsx.spi1_d0 */
>;
};

&spi1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&myspi1_pins_default>;
ti,pindir-d0-out-d1-in;

spidev@1 {
spi-max-frequency = <10000000>;
reg = <1>;
compatible = "rohm,dh2228fv";
};
};