How to partition QSPI memory on iMX6ULL-EVK

cancel
Showing results for 
Search instead for 
Did you mean: 

How to partition QSPI memory on iMX6ULL-EVK

799 Views
sergio_dorazio
Contributor IV

Hi,

I am working with IMX6ULL-EVK. I want to create the QSPINOR partition but it not work.

Following the step test :

  • compile u-boot for quad-spi-nor
  • I obtain u-boot.imx-qspi1
  • set the u-switch of EVK to start in QSPI mode
  • power-on the EVK
  • download the file u-boot.imx-qspi1 into qspi nor flash through lauterbach emulator
  • reset EVK
  • stop the software in u-boot mode
  • set the env

    setenv bootargs 'console=${console},${baudrate} root=${mmcroot} mtdparts=21e4000.qspi:1m(uboot),8m(kernel),1m(dtb),-(user)'

  • save the env
  • reset EVK
  • linux boot (kernel and fs are on SD card)
  • $ cat /proc/mtd

    mtd0: 02000000 00010000 "21e0000.qspi"

  • I see only one partition

  • Why I don't see the partition programmed ?
  • Sergio.
15 Replies

420 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Sergio

also one can look at spi-nor partition example in nitrogen board

imx6sx-nitrogen6sx.dts\dts\boot\arm\arch - linux-imx - i.MX Linux kernel 

Best regards
igor

0 Kudos

420 Views
sergio_dorazio
Contributor IV

Hi Igor,

for 32 MBytes of flash I put in dts file this :

&qspi {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_qspi>;
    status = "okay";
    ddrsmp=<0>;

 


    flash: m25p256a@0 {
        compatible = "micron,n25q256a";
        #address-cells = <1>;
        #size-cells = <1>;
        spi-max-frequency = <29000000>;
        spi-nor,ddr-quad-read-dummy = <6>;
        reg = <0>;

        partition@0 {
            label = "uboot";
            reg = <0x000000 0x100000>;
        };

        partition@100000 {
            label = "kernel";
            reg = <0x100000 0x800000>;
        };

        partition@900000 {
            label = "dtb";
            reg = <0x900000 0x100000>;
        };

        partition@A00000 {
            label = "user";
            reg = <0xA00000 0x1600000>;
        };
    };
};

Now I want work with a 256 MBytes of flash (mt25ql02g) , I change the name but I have error on compile dts file :

wflab@wflab-HP-Z4-G4-Workstation:~/imx-yocto-bsp/Linux-RCA2/linux-imx$ make imx6ull-14x14-evk.dtb
  CHK     scripts/mod/devicetable-offsets.h
  DTC     arch/arm/boot/dts/imx6ull-14x14-evk.dtb
Error: arch/arm/boot/dts/imx6ull-14x14-evk.dts:662.2-8 syntax error
FATAL ERROR: Unable to parse input tree
scripts/Makefile.lib:317: recipe for target 'arch/arm/boot/dts/imx6ull-14x14-evk.dtb' failed
make[1]: *** [arch/arm/boot/dts/imx6ull-14x14-evk.dtb] Error 1
arch/arm/Makefile:343: recipe for target 'imx6ull-14x14-evk.dtb' failed
make: *** [imx6ull-14x14-evk.dtb] Error 2
wflab@wflab-HP-Z4-G4-Workstation:~/imx-yocto-bsp/Linux-RCA2/linux-imx$

Have you have an example of partition for this type of flash ?

Sergio.

0 Kudos

420 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Sergio

to work with new flash (mt25ql02g) , it is not sufficient just to change name.

It is necessary to add "support" (specific parameters)  for that qspi in bsp (uboot/linux)

and then rebuild all from scratch.

Best regards
igor

0 Kudos

420 Views
sergio_dorazio
Contributor IV

Hi Igor,

u-boot is already to manage the new flash, at command "sf probe" it answer well:

Loading Environment from SPI Flash... SF: Detected mt25ql02g with page size 256 Bytes, erase size 4

How I add the support in kernel ?

Can you send me step by step the commands sequence ?

Can you send me also a .dts file example ?

Sergio.

0 Kudos

420 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Sergio

one can try with MT25QL256ABA1EW9 which is supported in NXP BSPs,

For help with porting other qspi chips one can try extended support with

Commercial Support and Engineering Services | NXP 

Best regards
igor

0 Kudos

420 Views
sergio_dorazio
Contributor IV

I Igor,

I have the same file in my yocto project, but the partition not work.

Have you othe suggestion ?

Sergio.

0 Kudos

420 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Sergio

 

what do you mean by "have the same file in my yocto project" ?

It is file for i.mx6sx processor, not for i.mx6ull, giving  example:

&qspi1 {

    flash: @0 {
        compatible = "    ";
..
        partition@0 {
            label = "U-Boot";
            reg = <0x0 0xc0000>;
            read-only;
        };

        partition@c0000 {
            label = "env";
            reg = <0xc0000 0x2000>;
            read-only;
        };

        partition@c2000 {
            label = "Kernel";
            reg = <0xc2000 0x11e000>;
        };

        partition@1e0000 {
            label = "M4";
            reg = <0x1e0000 0x20000>;
        };

Also may be useful to check linux qspi partition overview on

Confluence 

 

Best regards
igor

420 Views
sergio_dorazio
Contributor IV

Ok Igor,

I modify my imx6ull-14x14-evk.dts file with following partition and now I can see the partition on LINUX.

&qspi {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_qspi>;
    status = "okay";
    ddrsmp=<0>;


    flash: m25p256a@0 {
        compatible = "micron,n25q256a";
        #address-cells = <1>;
        #size-cells = <1>;
        spi-max-frequency = <29000000>;
        spi-nor,ddr-quad-read-dummy = <6>;
        reg = <0>;

        partition@0 {
            label = "uboot";
            reg = <0x000000 0x100000>;
        };

        partition@100000 {
            label = "kernel";
            reg = <0x100000 0x800000>;
        };

        partition@900000 {
            label = "dtb";
            reg = <0x900000 0x100000>;
        };

        partition@A00000 {
            label = "user";
            reg = <0xA00000 0x1600000>;
        };
    };
};

I don't know why nobody tell me this small and simple thing !!!!!!!!!!!

Now I want generate a small JFFS2 file system to put in my qspi nor flash.

How I have read in many forum , I put  IMAGE_FSTYPES = "jffs2" in my local.conf file , but the file system genarate is ext4 and not jffs2.

My complete local.conf file is:

MACHINE ??= 'imx6ull14x14evk'
DISTRO ?= 'fsl-imx-fb'
PACKAGE_CLASSES ?= "package_rpm"
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
USER_CLASSES ?= "buildstats image-mklibs image-prelink"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS ??= "\
    STOPTASKS,${TMPDIR},1G,100K \
    STOPTASKS,${DL_DIR},1G,100K \
    STOPTASKS,${SSTATE_DIR},1G,100K \
    STOPTASKS,/tmp,100M,100K \
    ABORT,${TMPDIR},100M,1K \
    ABORT,${DL_DIR},100M,1K \
    ABORT,${SSTATE_DIR},100M,1K \
    ABORT,/tmp,10M,1K"
PACKAGECONFIG_append_pn-qemu-native = " sdl"
PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
CONF_VERSION = "1"

DL_DIR ?= "${BSPDIR}/downloads/"
ACCEPT_FSL_EULA = "1"

IMAGE_FSTYPES = "jffs2"

Can you help me to do generate JFFS2 rootfs image ?

Sergio

0 Kudos

420 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Sergio

one can check Linux Manual from Linux L4.14.98_2.0.0 Documentation

Best regards
igor

0 Kudos

420 Views
sergio_dorazio
Contributor IV

Sorry Igor,

but in these manual I found only : .....if you have NOR flash you must use JFFS2 file system......

But the manual don't see how you must do for generate the file system, for format, for put in partition and so on....

Have you other suggestion ?

Sergio.

0 Kudos

420 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Sergio

this is general linux, one can look on web:

Memory Technology Device (MTD) Subsystem for Linux. 

Best regards
igor

0 Kudos

420 Views
sergio_dorazio
Contributor IV

Hi Igor,

for jffs2 file system generation I use this command:

sudo mkfs.jffs2 -d /core-image-minimal-imx6ull14x14evk.rootfs --eraseblock=0x10000 --pagesize=256 -o /rootfs-jffs2.img

After I have put /rootfs-jffs2.img on qspi nor flash, but when I boot my imx6ull-evk I found crc error !!!!!!!!!!!! this is the log:

VFS: Mounted root (jffs2 filesystem) on device 31:1.
devtmpfs: mounted
Freeing unused kernel memory: 1024K
jffs2: Node CRC dc88a1a7 != calculated CRC ef5e90f6 for node at 007670d0
Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000007

---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000007

If I repeat the boot I obtain other CRC value error.

If I boot the imx6ull-evk with SD card and after I mount the same file system it work well. Why ?

Can you help me ?

Sergio

0 Kudos

420 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Sergio

one can look at attached i.MX6D SCM spi-nor mfg tool example programming

(in ucl2.xml look for LIST name="SCM-Internal-SPI-NOR")

linux-imx - i.MX Linux kernel 

Best regards
igor

0 Kudos

420 Views
karangajjar
Senior Contributor II

Hi sergio d&#39;orazio ,

Please check the i.MX Linux User guide section "QuadSPI flash memory map" for more reference.

Regards,

Karan Gajjar

0 Kudos

420 Views
sergio_dorazio
Contributor IV

Hi Karan,

how you can see in my sequence, I follow exactly the section "QuadSPI flash memory map", but it not work !!!!!!!

Do you have other suggestion ?

For example , do I enable any parameter of kernel ?

Sergio.

0 Kudos