Part1
在搞am335x的东西,最近到了spi的地方,
按照uart的套路
&uart1{
pinctrl - names = "default";
pinctrl - 0 = <&uart1_pins_default>;
status = "okay";
};
我写了spi的套路
&spi1 {
pinctrl - names = "default";
pinctrl - 0 = <&spi1_pins_default>;
status = "okay";
};
然而并没有成功!!!
抓耳挠腮!!
在网上找了一下资料,在这位大神的博客里面找到了关于spi的东西
白菜的专栏
他这边是这么写的
&spi1 {
status = "okay";//使能SPI1
pinctrl-names = "default";
pinctrl-0 = <&mcspi1_pins>;//设置SPI1的管脚
spidev@0 {//创建SPI设备/dev/spidev1.0
compatible = "rohm,dh2228fv";
spi-max-frequency=<24000000>;
reg = <0>;
};
};
为啥中间要多了?
spidev@0 {//创建SPI设备/dev/spidev1.0
compatible = "rohm,dh2228fv";
spi-max-frequency=<24000000>;
reg = <0>;
};
抓耳挠腮!!!
后来静下来自己想想,感觉原因应该是这样
SPI是作为总线存在的,这样的话我这里写的&spi1 应该也是声明了一个总线协议,然而并没有说明这个总线下面还挂在了其他的设备。所以需要在下面加入spidev一段,来声明有这么一个设备。
不知道我想的是对是错。
请大神指教!
Part2
例子:
&mmc3 {
/* these are on the crossbar and are outlined in the
xbar-event-map element */
dmas = <&edma 12
&edma 13>;
dma-names = "tx", "rx";
status = "okay";
vmmc-supply = <&wlan_en_reg>;
bus-width = <4>;
pinctrl-names = "default";
pinctrl-0 = <&mmc3_pins &wlan_pins>;
ti,non-removable;
ti,needs-special-hs-handling;
cap-power-off-card;
keep-power-in-suspend;
#address-cells = <1>;
#size-cells = <0>;
wlcore: wlcore@2 {
compatible = "ti,wl1835";
reg = <2>;
interrupt-parent = <&gpio3>;
interrupts = <17 IRQ_TYPE_LEVEL_HIGH>;
ref-clock-frequency = <38400000>;
};
};
当中有两项
存疑下次补充