How to access to NOR flash in T2080RDB?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to access to NOR flash in T2080RDB?

Jump to solution
1,676 Views
manoloruiz
Contributor III


Hi,

I would like to access to the NOR flash in the t2080rdb from Linux.

Is it that possible?

Can I format those flashs in any format? for example fat or ext2 or ext4? I don´t care if it is not advisable. I just want to know if it is possible and how to access to the information form Linux.

BR

Labels (1)
0 Kudos
1 Solution
958 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello manolo ruiz,

First please make sure that IFC NOR driver has been configured in Kernel, in T2080RDB default dts file no partitions defined for NOR Flash, you could add partition definition in the node "nor@0,0" in the file t208xrdb.dtsi similar as the following, and rebuild the dts file.

                nor@0,0 {

                        #address-cells = <1>;

                        #size-cells = <1>;

                        compatible = "cfi-flash";

                        reg = <0x0 0x0 0x8000000>;

                        bank-width = <2>;

                        device-width = <1>;

            partition@800000 {

                        /* 1Mor DTB Image */

                        reg = <0x08000000 0x00100000>;

                        label = "NOR DTB Image";

                };

                partition@20000 {

                        /* 7 MB for Linux Kernel Image */

                        reg = <0x00020000 0x00700000>;

                        label = "NOR Linux Kernel Image";

                };

                partition@1300000 {

                        /* 20MB for JFFS2 based Root file System */

                        reg = <0x01300000 0x01400000>;

                        label = "NOR JFFS2 Root File System";

                };

    ... ...

  }

To verify NOR flash device as the following after the system boot up.

[root@ root]# cat /proc/mtd

dev: size erasesize name

mtd0: 00800000 000100000 "NOR DTB Image"

mtd1: 00020000 00700000 "NOR Linux Kernel Image"

mtd3: 01300000 01400000 "NOR JFFS2 Root File System"

[root@ root]# flash_eraseall -j /dev/mtd2

Erasing 128 Kibyte @ 1400000 -- 100% complete. Cleanmarker written at 13e0000.

[root@P1010RDB root]# mount -t jffs2 /dev/mtdblock2  /mnt

JFFS2 notice: (1202) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of

xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.

[root@ root]# cd /mnt/

[root@ mnt]# ls -l

[root@ mnt]# touch flash_file

[root@ root]# umount mnt

Or use the following commands

# mtd_debug erase /dev/mtd2 0 <mtdblack_size>

# mkfs.ext2 /dev/mtdblock2

# mount -t ext2 /dev/mtd2 /mnt


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
1 Reply
959 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello manolo ruiz,

First please make sure that IFC NOR driver has been configured in Kernel, in T2080RDB default dts file no partitions defined for NOR Flash, you could add partition definition in the node "nor@0,0" in the file t208xrdb.dtsi similar as the following, and rebuild the dts file.

                nor@0,0 {

                        #address-cells = <1>;

                        #size-cells = <1>;

                        compatible = "cfi-flash";

                        reg = <0x0 0x0 0x8000000>;

                        bank-width = <2>;

                        device-width = <1>;

            partition@800000 {

                        /* 1Mor DTB Image */

                        reg = <0x08000000 0x00100000>;

                        label = "NOR DTB Image";

                };

                partition@20000 {

                        /* 7 MB for Linux Kernel Image */

                        reg = <0x00020000 0x00700000>;

                        label = "NOR Linux Kernel Image";

                };

                partition@1300000 {

                        /* 20MB for JFFS2 based Root file System */

                        reg = <0x01300000 0x01400000>;

                        label = "NOR JFFS2 Root File System";

                };

    ... ...

  }

To verify NOR flash device as the following after the system boot up.

[root@ root]# cat /proc/mtd

dev: size erasesize name

mtd0: 00800000 000100000 "NOR DTB Image"

mtd1: 00020000 00700000 "NOR Linux Kernel Image"

mtd3: 01300000 01400000 "NOR JFFS2 Root File System"

[root@ root]# flash_eraseall -j /dev/mtd2

Erasing 128 Kibyte @ 1400000 -- 100% complete. Cleanmarker written at 13e0000.

[root@P1010RDB root]# mount -t jffs2 /dev/mtdblock2  /mnt

JFFS2 notice: (1202) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of

xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.

[root@ root]# cd /mnt/

[root@ mnt]# ls -l

[root@ mnt]# touch flash_file

[root@ root]# umount mnt

Or use the following commands

# mtd_debug erase /dev/mtd2 0 <mtdblack_size>

# mkfs.ext2 /dev/mtdblock2

# mount -t ext2 /dev/mtd2 /mnt


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos