- 积分
- 37
贡献251
飞刀47 FD
注册时间2017-7-25
在线时间7 小时
扫一扫,手机访问本帖
|
本帖最后由 Xiaoooo 于 2019-12-7 18:35 编辑
使用OKMX6UL-C2 nand 256m添加了两路SPI驱动,烧录后显示了spidev0.0和spidev1.0,但是使用测试代码输出全为0,连接我们自己的设备通信也不成功。设备树文件:
&ecspi1 {
compatible = "fsl,imx51-ecspi";
fsl,spi-num-chipselects = <1>;
cs-gpios = <&gpio4 26 GPIO_ACTIVE_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi1>;
status = "okay";
spidev@0{
compatible = "spidev";
spi-max-frequency = <20000000>;
reg = <0>;
status = "okay";
};
};
&ecspi2 {
compatible = "fsl,imx51-ecspi";
fsl,spi-num-chipselects = <1>;
cs-gpios = <&gpio4 22 GPIO_ACTIVE_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi2>;
status = "okay";
spidev@0{
compatible = "spidev";
spi-max-frequency = <20000000>;
reg = <0>;
status = "okay";
};
};
pinctrl_ecspi1: ecspi1grp {
fsl,pins = <
MX6UL_PAD_CSI_DATA07__ECSPI1_MISO 0x100b1
MX6UL_PAD_CSI_DATA06__ECSPI1_MOSI 0x100b1
MX6UL_PAD_CSI_DATA04__ECSPI1_SCLK 0x100b1
MX6UL_PAD_CSI_DATA05__ECSPI1_SS0 0x100b1
>;
};
pinctrl_ecspi2: ecspi2grp {
fsl,pins = <
MX6UL_PAD_CSI_DATA03__ECSPI2_MISO 0x100b1
MX6UL_PAD_CSI_DATA02__ECSPI2_MOSI 0x100b1
MX6UL_PAD_CSI_DATA00__ECSPI2_SCLK 0x100b1
MX6UL_PAD_CSI_DATA01__ECSPI2_SS0 0x100b1
>;
};
|
|