Difference between revisions of "DESK-XZ7-L/Peripherals/NAND"

From DAVE Developer's Wiki
Jump to: navigation, search
 
Line 19: Line 19:
  
 
=== Device tree configuration ===
 
=== Device tree configuration ===
 +
 +
{{ImportantMessage|text=If user use <code>petalinux-config</code> for configuration NAND partition this is not apply to device-tree correctly.}}
  
 
Here below an example of device tree configuration used on standard DAVE's kit for the [[BORA Lite SOM |BORA Lite]] ''NAND flash'':
 
Here below an example of device tree configuration used on standard DAVE's kit for the [[BORA Lite SOM |BORA Lite]] ''NAND flash'':

Latest revision as of 14:06, 17 May 2024

History
Issue Date Notes

2024/01/23

DESK-XZ7-L-1.0.1 release
2024/05/20 DESK-XZ7-L-1.1.0 release


Peripheral NAND[edit | edit source]

Device tree configuration[edit | edit source]

200px-Emblem-important.svg.png

If user use petalinux-config for configuration NAND partition this is not apply to device-tree correctly.

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

From bora.dtsi:

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

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

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

Accessing the peripheral[edit | edit source]

Linux messages at boot time (boot from SD with NAND flash support)[edit | edit source]

[    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-0x000040000000 : "rootfs"
Check the mtd partitions[edit | edit source]
root@boralite:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 01600000 00020000 "bootbin"
mtd1: 00040000 00020000 "ubootenv"
mtd2: 3e9c0000 00020000 "rootfs"

Linux messages at boot time (boot from NAND flash)[edit | edit source]

[    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
...
[    1.076003] 3 fixed-partitions partitions found on MTD device W29N08GV
[    1.082625] Creating 3 MTD partitions on "W29N08GV":
[    1.087662] 0x000000000000-0x000001600000 : "bootbin"
[    1.101780] 0x000001600000-0x000001640000 : "ubootenv"
[    1.111817] 0x000001640000-0x000040000000 : "rootfs"
...
[    1.209392] ubi0: attaching mtd2
[    3.943763] ubi0: scanning is finished
[    3.970955] ubi0: attached mtd2 (name "rootfs", size 1001 MiB)
[    3.976801] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
[    3.983713] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
[    3.990409] ubi0: VID header offset: 512 (aligned 512), data offset: 2048
[    3.997277] ubi0: good PEBs: 8010, bad PEBs: 4, corrupted PEBs: 0
[    4.003395] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
[    4.010637] ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 1501637841
[    4.019766] ubi0: available PEBs: 0, total reserved PEBs: 8010, PEBs reserved for bad PEB handling: 156
[    4.029253] ubi0: background thread "ubi_bgt0d" started, PID 54
[    4.048733] UBIFS (ubi0:0): Mounting in unauthenticated mode
[    4.054771] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 55
[    4.098540] UBIFS (ubi0:0): recovery needed
[    4.252929] UBIFS (ubi0:0): recovery completed
[    4.257516] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "ubifs"
[    4.264862] UBIFS (ubi0:0): LEB size: 129024 bytes (126 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[    4.274857] UBIFS (ubi0:0): FS size: 1011419136 bytes (964 MiB, 7839 LEBs), journal size 9033728 bytes (8 MiB, 71 LEBs)
[    4.285664] UBIFS (ubi0:0): reserved for root: 0 bytes (0 KiB)
[    4.291525] UBIFS (ubi0:0): media format: w4/r0 (latest is w5/r0), UUID 18F323BA-5A9C-422A-912C-2C06647F3EDF, small LPT model
...
Check the mtd partitions[edit | edit source]
root@boralite:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 01600000 00020000 "bootbin"
mtd1: 00040000 00020000 "ubootenv"
mtd2: 3e9c0000 00020000 "rootfs"