Open main menu

DAVE Developer's Wiki β

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

< DESK-XZ7-L
(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...")
 
 
(2 intermediate revisions by 2 users not shown)
Line 6: Line 6:
 
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Notes
 
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Notes
 
|-
 
|-
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000"|2023/01/23
+
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|{{oldid|19917|2024/01/23}}
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000"|DESK-XZ7-L-1.0.1 release
+
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|DESK-XZ7-L-1.0.1 release
 +
|-
 +
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|2024/05/20
 +
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|DESK-XZ7-L-1.1.0 release
 
|-
 
|-
 
|}
 
|}
Line 13: Line 16:
 
<section begin=Body/>
 
<section begin=Body/>
  
== NAND flash memory ==
+
== Peripheral NAND ==
  
 
=== Device tree configuration ===
 
=== Device tree configuration ===
  
This configuration work for Boralite platform only.
+
{{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 Boralite ''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'':
  
 
From <code>bora.dtsi</code>:
 
From <code>bora.dtsi</code>:
Line 27: Line 30:
 
...
 
...
 
&nand0{
 
&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 {
 
     partition@nand-bootbin {
 
         label = "bootbin";
 
         label = "bootbin";
Line 50: Line 42:
 
     partition@nand-rootfs {
 
     partition@nand-rootfs {
 
         label = "rootfs";
 
         label = "rootfs";
         reg = <0x01640000 0x1BE00000>;
+
         reg = <0x01640000 0x0>;
 
     };
 
     };
 
};
 
};
Line 57: Line 49:
 
</pre>
 
</pre>
  
====Linux messages at boot time with uSD compatible with NAND flash====
+
===Accessing the peripheral ===
 +
 
 +
====Linux messages at boot time (boot from SD with NAND flash support) ====
  
* bootlog message
 
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
 
[    0.709510] nand: device found, Manufacturer ID: 0xef, Chip ID: 0xd3
 
[    0.709510] nand: device found, Manufacturer ID: 0xef, Chip ID: 0xd3
Line 69: Line 62:
 
[    0.753138] 0x000000000000-0x000001600000 : "bootbin"
 
[    0.753138] 0x000000000000-0x000001600000 : "bootbin"
 
[    0.760908] 0x000001600000-0x000001640000 : "ubootenv"
 
[    0.760908] 0x000001600000-0x000001640000 : "ubootenv"
[    0.776202] 0x000001640000-0x00001d440000 : "rootfs"
+
[    0.776202] 0x000001640000-0x000040000000 : "rootfs"
 
</pre>
 
</pre>
  
* mtd partitions
+
===== Check the mtd partitions =====
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
Line 79: Line 72:
 
mtd0: 01600000 00020000 "bootbin"
 
mtd0: 01600000 00020000 "bootbin"
 
mtd1: 00040000 00020000 "ubootenv"
 
mtd1: 00040000 00020000 "ubootenv"
mtd2: 1be00000 00020000 "rootfs"
+
mtd2: 3e9c0000 00020000 "rootfs"
 
</pre>
 
</pre>
  
====Linux messages at boot time with NAND flash====
+
====Linux messages at boot time (boot from NAND flash) ====
 
 
* bootlog message
 
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
Line 91: Line 82:
 
[    0.710317] nand: 1024 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
 
[    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
+
[    1.076003] 3 fixed-partitions partitions found on MTD device W29N08GV
[    0.741214] Creating 3 MTD partitions on "W29N08GV":
+
[    1.082625] Creating 3 MTD partitions on "W29N08GV":
[    0.746250] 0x000000000000-0x000001600000 : "bootbin"
+
[    1.087662] 0x000000000000-0x000001600000 : "bootbin"
[    0.753605] 0x000001600000-0x000001640000 : "ubootenv"
+
[    1.101780] 0x000001600000-0x000001640000 : "ubootenv"
[    0.760249] 0x000001640000-0x00001d440000 : "rootfs"
+
[    1.111817] 0x000001640000-0x000040000000 : "rootfs"
 
...
 
...
[    0.838733] ubi0: attaching mtd2
+
[    1.209392] ubi0: attaching mtd2
[    2.055918] ubi0: scanning is finished
+
[    3.943763] ubi0: scanning is finished
[    2.074094] ubi0: attached mtd2 (name "rootfs", size 446 MiB)
+
[    3.970955] ubi0: attached mtd2 (name "rootfs", size 1001 MiB)
[    2.079971] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
+
[    3.976801] 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
+
[    3.983713] 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
+
[    3.990409] ubi0: VID header offset: 512 (aligned 512), data offset: 2048
[    2.100464] ubi0: good PEBs: 3568, bad PEBs: 0, corrupted PEBs: 0
+
[    3.997277] ubi0: good PEBs: 8010, bad PEBs: 4, corrupted PEBs: 0
[    2.106577] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
+
[    4.003395] 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
+
[    4.010637] ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 1501637841
[    2.122886] ubi0: available PEBs: 0, total reserved PEBs: 3568, PEBs reserved for bad PEB handling: 160
+
[    4.019766] ubi0: available PEBs: 0, total reserved PEBs: 8010, PEBs reserved for bad PEB handling: 156
[    2.132320] ubi0: background thread "ubi_bgt0d" started, PID 53
+
[    4.029253] ubi0: background thread "ubi_bgt0d" started, PID 54
[    2.151720] UBIFS (ubi0:0): Mounting in unauthenticated mode
+
[    4.048733] UBIFS (ubi0:0): Mounting in unauthenticated mode
[    2.157627] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 54
+
[    4.054771] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 55
[    2.201015] UBIFS (ubi0:0): recovery needed
+
[    4.098540] UBIFS (ubi0:0): recovery needed
[    2.333896] UBIFS (ubi0:0): recovery completed
+
[    4.252929] UBIFS (ubi0:0): recovery completed
[    2.338412] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
+
[    4.257516] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "ubifs"
[    2.345831] UBIFS (ubi0:0): LEB size: 129024 bytes (126 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
+
[    4.264862] 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)
+
[    4.274857] UBIFS (ubi0:0): FS size: 1011419136 bytes (964 MiB, 7839 LEBs), journal size 9033728 bytes (8 MiB, 71 LEBs)
[    2.366754] UBIFS (ubi0:0): reserved for root: 4952683 bytes (4836 KiB)
+
[    4.285664] UBIFS (ubi0:0): reserved for root: 0 bytes (0 KiB)
[    2.373371] UBIFS (ubi0:0): media format: w5/r0 (latest is w5/r0), UUID 1D39DE69-4DB4-43C3-B1DC-4790B3D8D8CA, small LPT model
+
[    4.291525] UBIFS (ubi0:0): media format: w4/r0 (latest is w5/r0), UUID 18F323BA-5A9C-422A-912C-2C06647F3EDF, small LPT model
[    2.386230] VFS: Mounted root (ubifs filesystem) on device 0:13.
 
 
...
 
...
 
</pre>
 
</pre>
  
* mtd partitions
+
===== Check the mtd partitions =====
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
Line 128: Line 118:
 
mtd0: 01600000 00020000 "bootbin"
 
mtd0: 01600000 00020000 "bootbin"
 
mtd1: 00040000 00020000 "ubootenv"
 
mtd1: 00040000 00020000 "ubootenv"
mtd2: 1be00000 00020000 "rootfs"
+
mtd2: 3e9c0000 00020000 "rootfs"
 
</pre>
 
</pre>
  
 
<section end=Body/>
 
<section end=Body/>
  
----
+
[[Category:BORA Lite]]
 
 
[[Category:BORA]]
 

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


Contents

Peripheral NANDEdit

Device tree configurationEdit

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 peripheralEdit

Linux messages at boot time (boot from SD with NAND flash support)Edit

[    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 partitionsEdit
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

[    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 partitionsEdit
root@boralite:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 01600000 00020000 "bootbin"
mtd1: 00040000 00020000 "ubootenv"
mtd2: 3e9c0000 00020000 "rootfs"