SPI Flash 驱动 mtdblock 部分简要分析

 

SPI Flash 驱动 mtdblock 部分简要分析_第1张图片

 

Flash 节点添加实验:

① 修改设备树:

spiflash@0 {
    #address-cells = <0x1>;
    #size-cells = <0x1>;
    compatible = "nanopi,w25q32";
    reg = <0x1>;
    status = "okay";
    spi-max-frequency = <0x2faf080>;
    mode = <0x0>;
    linux,phandle = <0x67>;
    phandle = <0x67>;

    partition@0 {
        reg = <0x0 0x200000>;
        label = "lance_w25q32";
    };
    partition@1 {
        reg = <0x200000 0x400000>;
        label = "lance_w25q32_1";
    };
};

② 使用新的设备树启动内核:

/ # cat proc/mtd 
dev:    size   erasesize  name
mtd0: 00200000 00001000 "lance_w25q32"
mtd1: 00200000 00001000 "lance_w25q32_1"

可见节点添加成功。

 

你可能感兴趣的:(SPI Flash 驱动 mtdblock 部分简要分析)