- 积分
- 63
贡献304
飞刀97 FD
注册时间2019-2-19
在线时间11 小时
扫一扫,手机访问本帖
|
您好,我想在SPI2上接4片芯片,需要4个片选脚。但设备树上我只找到一路CS0,我可以像GPIO口一样增加片选吗?还请帮忙看看这样行吗?还需要改哪些地方?
spi2_clk: spi2-clk {
rockchip,pins =
<2 11 RK_FUNC_1 &pcfg_pull_up>;
};
spi2_cs0: spi2-cs0 {
rockchip,pins =
<2 12 RK_FUNC_1 &pcfg_pull_up>;
};
spi2_cs1: spi1-cs1 {
rockchip,pins =
<2 2 RK_FUNC_1 &pcfg_pull_up>;
};
spi2_cs2: spi1-cs2 {
rockchip,pins =
<2 5 RK_FUNC_1 &pcfg_pull_up>;
};
spi2_cs3: spi1-cs3 {
rockchip,pins =
<2 3 RK_FUNC_1 &pcfg_pull_up>;
};
spi2_rx: spi2-rx {
rockchip,pins =
<2 9 RK_FUNC_1 &pcfg_pull_up>;
};
spi2_tx: spi2-tx {
rockchip,pins =
<2 10 RK_FUNC_1 &pcfg_pull_up>;
};
};
&spi2 {
status = "okay";
pinctrl-0 = <&spi1_clk &spi1_tx &spi1_rx &spi1_cs0 &spi1_cs1 &spi1_cs2 &spi1_cs3>;
#if 0
spidev@0 {
compatible = "spidev", "rohm,dh2228fv";
reg = <0>;
spi-max-frequency = <25000000>;
};
#endif
spi_tmc@0 {
compatible = "vistel,spi_tmc_CS0";
reg = <0>; //chip select 0:cs0 1:cs1
id = <0>;
spi-max-frequency = <2000000>; //spi output clock
};
spi_tmc@1 {
compatible = "vistel,spi_tmc_CS1";
reg = <1>; //chip select 0:cs0 1:cs1
id = <1>;
spi-max-frequency = <2000000>; //spi output clock
};
spi_tmc@2 {
compatible = "vistel,spi_tmc_CS2";
reg = <2>; //chip select 0:cs0 1:cs1
id = <2>;
spi-max-frequency = <2000000>; //spi output clock
};
spi_tmc@3 {
compatible = "vistel,spi_tmc_CS3";
reg = <3>; //chip select 0:cs0 1:cs1
id = <3>;
spi-max-frequency = <2000000>; //spi output clock
};
};
|
|