SPI Flash 驱动 mtdblock 部分简要分析

 

 

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"

可见节点添加成功。

 

posted @ 2020-02-29 22:20  Zackary丶Liu  阅读(596)  评论(0编辑  收藏  举报