Open main menu

DAVE Developer's Wiki β

DESK-XZ7-L/Peripherals/NAND

< DESK-XZ7-L
Revision as of 11:25, 24 January 2024 by U0028 (talk | contribs) (Created page with "<section begin=History/> {| style="border-collapse:collapse; " !colspan="4" style="width:100%; text-align:left"; border-bottom:solid 2px #ededed"|History |- !style="border-le...")

(diff) ← Older revision | Approved revision (diff) | Latest revision (diff) | Newer revision → (diff)
History
Issue Date Notes
2023/01/23 DESK-XZ7-L-1.0.1 release


Contents

NAND flash memoryEdit

Device tree configurationEdit

This configuration work for Boralite platform only.

Here below an example of device tree configuration used on standard DAVE's kit for the Boralite NAND flash:

From bora.dtsi:

...
...
&nand0{
    status = "okay";
    // timings for W29N08GV 8G-BIT 3.3V NAND FLASH MEMORY
    arm,nand-cycle-t0 = <0x5>;
    arm,nand-cycle-t1 = <0x5>;
    arm,nand-cycle-t2 = <0x3>;
    arm,nand-cycle-t3 = <0x2>;
    arm,nand-cycle-t4 = <0x4>;
    arm,nand-cycle-t5 = <0x4>;
    arm,nand-cycle-t6 = <0x4>;
    arm,nand-width = <8>;

    partition@nand-bootbin {
        label = "bootbin";
        reg = <0x00000000 0x01600000>;
    };

    partition@nand-ubootenv {
        label = "ubootenv";
        reg = <0x01600000 0x00040000>;
    };

    partition@nand-rootfs {
        label = "rootfs";
        reg = <0x01640000 0x1BE00000>;
    };
};
...
...

Linux messages at boot time with uSD compatible with NAND flashEdit

  • bootlog message
[    0.709510] nand: device found, Manufacturer ID: 0xef, Chip ID: 0xd3
[    0.712698] nand: Winbond W29N08GV
[    0.714412] nand: 1024 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
...
[    0.741479] 3 fixed-partitions partitions found on MTD device W29N08GV
[    0.748115] Creating 3 MTD partitions on "W29N08GV":
[    0.753138] 0x000000000000-0x000001600000 : "bootbin"
[    0.760908] 0x000001600000-0x000001640000 : "ubootenv"
[    0.776202] 0x000001640000-0x00001d440000 : "rootfs"
  • mtd partitions
root@boralite:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 01600000 00020000 "bootbin"
mtd1: 00040000 00020000 "ubootenv"
mtd2: 1be00000 00020000 "rootfs"

Linux messages at boot time with NAND flashEdit

  • bootlog message
[    0.705403] nand: device found, Manufacturer ID: 0xef, Chip ID: 0xd3
[    0.708607] nand: Winbond W29N08GV
[    0.710317] nand: 1024 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
...
[    0.734590] 3 fixed-partitions partitions found on MTD device W29N08GV
[    0.741214] Creating 3 MTD partitions on "W29N08GV":
[    0.746250] 0x000000000000-0x000001600000 : "bootbin"
[    0.753605] 0x000001600000-0x000001640000 : "ubootenv"
[    0.760249] 0x000001640000-0x00001d440000 : "rootfs"
...
[    0.838733] ubi0: attaching mtd2
[    2.055918] ubi0: scanning is finished
[    2.074094] ubi0: attached mtd2 (name "rootfs", size 446 MiB)
[    2.079971] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
[    2.086864] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
[    2.093559] ubi0: VID header offset: 512 (aligned 512), data offset: 2048
[    2.100464] ubi0: good PEBs: 3568, bad PEBs: 0, corrupted PEBs: 0
[    2.106577] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
[    2.113794] ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 635011865
[    2.122886] ubi0: available PEBs: 0, total reserved PEBs: 3568, PEBs reserved for bad PEB handling: 160
[    2.132320] ubi0: background thread "ubi_bgt0d" started, PID 53
[    2.151720] UBIFS (ubi0:0): Mounting in unauthenticated mode
[    2.157627] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 54
[    2.201015] UBIFS (ubi0:0): recovery needed
[    2.333896] UBIFS (ubi0:0): recovery completed
[    2.338412] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
[    2.345831] UBIFS (ubi0:0): LEB size: 129024 bytes (126 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[    2.355759] UBIFS (ubi0:0): FS size: 437262336 bytes (417 MiB, 3389 LEBs), journal size 21934080 bytes (20 MiB, 170 LEBs)
[    2.366754] UBIFS (ubi0:0): reserved for root: 4952683 bytes (4836 KiB)
[    2.373371] UBIFS (ubi0:0): media format: w5/r0 (latest is w5/r0), UUID 1D39DE69-4DB4-43C3-B1DC-4790B3D8D8CA, small LPT model
[    2.386230] VFS: Mounted root (ubifs filesystem) on device 0:13.
...
  • mtd partitions
root@boralite:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 01600000 00020000 "bootbin"
mtd1: 00040000 00020000 "ubootenv"
mtd2: 1be00000 00020000 "rootfs"