- 论坛徽章:
- 0
|
在现在的板子上(cpu:mpc8306s,linux: linux-2.6.34)的spi控制器上接了个从设备,想用gpio来片选这个从设备, 参考内核中的文档修改dts,编译mpc8306som.dts总报错,请高手看看如何修改dts。谢谢!
默认的mpc8306som.dts中关于spi的如下:
spi@7000 {
cell-index = <0>;
compatible = "fsl,spi";
reg = <0x7000 0x1000>;
interrupts = <16 0x8>;
interrupt-parent = <&ipic>;
mode = "cpu";
};
参考linux-2.6.34\Documentation\powerpc\dts-bindings\fsl\spi.txt 如下:
Example:
spi@4c0 {
cell-index = <0>;
compatible = "fsl,spi";
reg = <4c0 40>;
interrupts = <82 0>;
interrupt-parent = <700>;
mode = "cpu";
gpios = <&gpio 18 1 // device reg=<0>
&gpio 19 1>; // device reg=<1>
};
修改mpc8306som.dts, 如下:
spi@7000 {
cell-index = <0>;
compatible = "fsl,spi";
reg = <0x7000 0x1000>;
interrupts = <16 0x8>;
interrupt-parent = <&ipic>;
mode = "cpu";
gpios = <&gpio 10 1>;
};
但是编译总是在报错,
make mpc8306som.dtb
[root@localhost linux-2.6.34]# make mpc8306som.dtb
/opt/freescale/mpc8306/kernel/linux-2.6.34/scripts/dtc/dtc -O dtb -o arch/powerpc/boot/mpc8306som.dtb -b 0 -p 1024 /opt/freescale/mpc8306/kernel/linux-2.6.34/arch/powerpc/boot/dts/mpc8306som.dts
DTC: dts->dtb on file "/opt/freescale/mpc8306/kernel/linux-2.6.34/arch/powerpc/boot/dts/mpc8306som.dts"
ERROR (phandle_references): Reference to non-existent node or label "gpio"
ERROR: Input tree has errors, aborting (use -f to force output)
make[1]: *** [arch/powerpc/boot/mpc8306som.dtb] Error 2
make: *** [mpc8306som.dtb] Error 2 |
|