linux - 嵌入式设备为何以及何时会同时具有 NAND 和 NOR?

标签 linux linux-kernel operating-system embedded-linux device-tree

我在嵌入式产品的dts文件中找到了这段代码。
为什么我们有 NAND flash 而有 NOR flash?
而下面localbus节点中提到的LCS0,LCS1是什么意思呢?

        localbus@a8405000 {
        #address-cells = <2>;
        #size-cells = <1>;
        compatible = "fsl,mpc8313-elbc", "fsl,elbc", "simple-bus";
        reg = <0xa8405000 0x1000>;
        interrupts = <77 0x8>;
        interrupt-parent = <&ipic>;

        // CS0 and CS1 are swapped when
        // booting from nand, but the
        // addresses are the same.
//      ranges = <0x0 0x0 0xfe000000 0x01000000    /* LCS0: NOR BOOT        */
        ranges = <0x0 0x0 0xfe000000 0x02000000    /* LCS0: NOR BOOT        */
                  0x1 0x0 0xa8000000 0x00040000    /* LCS1: NAND CONTROLLER */
//            0x2 0x0 0xa0000000 0x04000000    /* LCS2: FGPA            */
              0x2 0x0 0xa0000000 0x04000000>;  /* LCS2: FGPA            */
//            0x3 0x0 0xff000000 0x01000000>;  /* LCS3: NOR RESERVE     */

        flash@0,0 {
            #address-cells = <1>;
            #size-cells = <1>;
            compatible = "cfi-flash";
//          reg = <0x0 0x0 0x1000000>; /* 16MB */
            reg = <0x0 0x0 0x2000000>; /* 32MB */
            bank-width = <2>;
            device-width = <1>;

            u-boot@0 {
                reg = <0x0 0x80000>;
            };

            xxxx@80000 {
                reg = <0x080000 0x1000000>;
            };

            log@1080000 {
                reg = <0x1080000 0x2c0000>;
            };

            inventry@1340000 {
                reg = <0x1340000 0x20000>;
            };

            xxxxx@1360000 {
                reg = <0x1360000 0x20000>;
            };

            xxxxx@1380000 {
                reg = <0x1380000 0x20000>;
            };

            xxxxx@13a0000 {
                reg = <0x13a0000 0x20000>;
            };

            reserve-nor1@13c0000 {
                reg = <0x13c0000 0xc40000>;
            };

            dummy1@2000000 {
                reg = <0x2000000 0x0>;
            };

            dummy2@2000000 {
                reg = <0x2000000 0x0>;
            };
        };

        nand@1,0 {
            #address-cells = <1>;
            #size-cells = <1>;
            compatible = "fsl,mpc8313-fcm-nand",
                         "fsl,elbc-fcm-nand";
            reg = <0x1 0x0 0x40000>; /* NAND CONTROLLER 256KB */

            dtb-0@0 {
                reg = <0x0 0x20000>;
            };

            kernel-0@20000 {
                reg = <0x20000 0x400000>;
            };

            rootfs-0@420000 {
                reg = <0x420000 0x099e0000>;
            };

            dtb-1@9e00000 {
                reg = <0x09e00000 0x20000>;
            };

            kernel-1@9e20000 {
                reg = <0x09e20000 0x400000>;
            };

            rootfs-1@a220000 {
                reg = <0x0a220000 0x099e0000>;
            };

            internal@13c00000 {
                reg = <0x13c00000 0x6400000>;
            };

            xxxx-log@1a000000 {
                reg = <0x1a000000 0x6000000>;
            };
        };
    };

我完全不明白下面的片段是什么意思

        // CS0 and CS1 are swapped when
        // booting from nand, but the
        // addresses are the same.
//      ranges = <0x0 0x0 0xfe000000 0x01000000    /* LCS0: NOR BOOT        */
        ranges = <0x0 0x0 0xfe000000 0x02000000    /* LCS0: NOR BOOT        */
                  0x1 0x0 0xa8000000 0x00040000    /* LCS1: NAND CONTROLLER */
//            0x2 0x0 0xa0000000 0x04000000    /* LCS2: FGPA            */
              0x2 0x0 0xa0000000 0x04000000>;  /* LCS2: FGPA            */
//            0x3 0x0 0xff000000 0x01000000>;  /* LCS3: NOR RESERVE     */

最佳答案

NOR-flash is slower in erase-operation and write-operation compared to NAND-flash. That means the NAND-flash has faster erase and write times. More over NAND has smaller erase units. So fewer erases are needed. NOR-flash can read data slightly faster than NAND.

NOR 提供完整的地址和数据总线来随机访问其任何内存位置(可寻址到每个字节)。这使它成为老式 ROM BIOS/固件芯片的合适替代品,后者很少需要更新。其耐用性为 10,000 至 1,000,000 次删除循环。 NOR 非常适合在嵌入式系统中存储代码。还支持 XiP(eXecute in Place) 使得从(甚至在初始化 DDR 之前)加载初始引导加载程序成为一个非常有吸引力的选择。

NAND-flash occupies smaller chip area per cell. This maker NAND available in greater storage densities and at lower costs per bit than NOR-flash. It also has up to ten times the endurance of NOR-flash. NAND is more fit as storage media for large files including video and audio. The USB thumb drives, SD cards and MMC cards are of NAND type.

NAND 闪存不提供随机访问外部地址总线,因此数据必须以 block 为单位读取(也称为页面访问),其中每个 block 包含数百到数千位,类似于一种顺序数据访问。这是NAND-flash不适合替代ROM的主要原因之一,因为大多数微处理器和微 Controller 都需要字节级随机访问。

结帐 Table 1 in this document说明每个的比较优点。

关于linux - 嵌入式设备为何以及何时会同时具有 NAND 和 NOR?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18426258/

相关文章:

linux - Spring Boot Index jsp 在本地主机上工作,但在 linux 服务器上找不到

linux - 为配备 NVMe SSD 的主机选择合适的 Linux I/O 调度程序?

linux - IP地址如何通知linux内核?

c - 如何在 Linux 内核中找到信号处理程序定义?

algorithm - 哲学家同步算法

c++ - 将 Objective-C 代码转换为 C++ 以检测 OS X 上的用户空闲时间

c - struct statvfs 中的 f_bsize 和 f_frsize 代表什么?

c - 这个程序中的 child 将如何运行?

python - 在 Red Hat 6 上安装 numpy?

c++ - 内存段中存储的全局变量和静态变量在哪里?