关于去掉SPI设备/dev/spidev32766.1的问题。



  • 由于SPI需要用作GPIO控制,编写ko驱动并制作固件后出现莫名的SQUASHFS error
    0_1495683461679_1.png
    0_1495683746515_1.png
    怀疑是SPI服用的问题,于是修改Widora.dts
    spi@b00 {
    status = "okay";

    改为
    spi@b00 {
    status = "disabled";
    后无法启动进入系统。。。



  • 是不是Widora默认在SPI上面挂载一片FLASH, linux,modalias = "m25p80", "w25q128";
    spi@b00 {
    status = "okay";

                        pinctrl-names = "default";
                        pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>;
    
                        m25p80@0 {
                                #address-cells = <1>;
                                #size-cells = <1>;
                                compatible = "w25q128";
                                reg = <0 0>;
                                linux,modalias = "m25p80", "w25q128";
                                spi-max-frequency = <40000000>;
                                m25p,chunked-io = <31>;
    
                                partition@0 {
                                        label = "u-boot";
                                        reg = <0x0 0x30000>;
                                        read-only;
                                };
    
                                partition@30000 {
                                        label = "u-boot-env";
                                        reg = <0x30000 0x10000>;
                                };
    
                                factory: partition@40000 {
                                        label = "factory";
                                        reg = <0x40000 0x10000>;
                                };
    
                                partition@50000 {
                                        label = "firmware";
                                        reg = <0x50000 0x0fb0000>;
                                };
                        };
    
                        spidev@1 {
                                #address-cells = <1>;
                                #size-cells = <1>;
                                compatible = "spidev";
                                reg = <1 0>;
                                spi-max-frequency = <40000000>;
                        };
    

    而加入GPIO驱动后,内核还是不断尝试加载该SPI FLASH分区才报的错误?


  • administrators

    你的意图是:由于SPI需要用作GPIO控制?什么意思,SPI是连接的Nor flash的。决定着系统启动。



  • 这个是SPI通信出错引起的,我以前在7620板上,SPI总线挂多个设备时候,经常曝出这个问题,你在dts配置文件里把spi的时钟速度调低一点试一下,
    改这个: spi-max-frequency = <40000000>;
    改成spi-max-frequency = <20000000>; 试试看