我正在使用我的自定义硬件处理基于 i.mx6 的 SOM
我正在使用 ksz8795 4 端口以太网交换机和 spi
例如,我正在使用 Variscite 提供的 Yocto Hardknott BSP 作为我的SOM来自Variscite
设备树配置如下
&ecspi1 {
fsl,spi-num-chipselects = <1>;
//cs-gpios = <&gpio4 26 0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi1_1>;
status = "okay";
chip1: spidev@0 {
compa
tible = "var,spidev";
spi-max-frequency = <25000000>;
reg = <0>;
status = "okay";
};
ksz8795@0 {
compatible = "microchip,ksz8795";
spi-max-frequency = <25000000>;
reg = <0>;
pinctrl-names = "default";
cs-gpios = <&gpio4 26 0>;
reset-gpios = <&gpio5 5 0>;
status = "okay";
//spi-cpha;
//spi-cpol;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
label = "lan1";
};
port@1 {
reg = <1>;
label = "lan2";
};
port@2 {
reg = <2>;
label = "lan3";
};
port@3 {
reg = <3>;
label = "lan4";
};
port@4 {
reg = <4>;
label = "cpu";
ethernet = <&fec2>;
fixed-link {
speed = <100>;
full-duplex;
};
};
};
};
};
除此之外,我还从菜单配置中激活了所有必要的驱动程序,如下所示
CONFIG_NET_DSA=y
CONFIG_NET_DSA_TAG_KSZ=y
CONFIG_NET_DSA_MICROCHIP_KSZ8795=m
CONFIG_NET_DSA_MICROCHIP_KSZ_COMMON=m
CONFIG_NET_DSA_MICROCHIP_KSZ8795_SPI=m
CONFIG_REGMAP_SPI=y
对我来说,SPI 运行良好
但是,在 boo 期间,我遇到以下错误,并且 ksz8795 驱动程序无法激活!
root@imx6ul-var-dart:~# dmesg | grep spi
[ 2.324211] spi_imx 2008000.spi: registered master spi0
[ 2.324649] spi spi0.0: spi_imx_setup: mode 0, 8 bpw, 25000000 hz
[ 2.324688] spi spi0.0: setup mode 0, 8 bits/w, 25000000 Hz max --> 0
[ 2.325946] spi_imx 2008000.spi: registered child spi0.0
[ 2.326022] spi_imx 2008000.spi: chipselect 0 already in use
[ 2.331997] spi_master spi0: spi_device register error /soc/bus@2000000/spba-bus@2000000/spi@2008000/ksz8795@0
[ 2.342136] spi_master spi0: Failed to create SPI device for /soc/bus@2000000/spba-bus@2000000/spi@2008000/ksz8795@0
似乎 CS 线正在被 spidev 使用
有人能帮我一下吗?
0