How to partition QSPI memory on iMX6UL-EVK ?

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

How to partition QSPI memory on iMX6UL-EVK ?

2,019 Views
toanjunifer
Senior Contributor I

Hi NXP,

   My name is Toan. Currently, I am using iMX6UL-EVK with imx-yocto-L4.14.98_2.0.0_ga distro and mfgtools to flash. I'm trying to flash U-boot, kernel, zImage and device tree into QSPI. But as I know that, each of 4 parts need a individual partition. But I can see only /dev/mtd0 with size 32Mb. And I wanna devide it to 4 partitions is mtd0, mtd1, mtd2 and mtd3 to flash on it. I trying search but i can not find out something.  

Someone can guide me step in step ?
Thank you so much.

   Toan

Labels (1)
5 Replies

1,739 Views
Yuri
NXP Employee
NXP Employee

Hello,

  According to section 4.6.5 (QuadSPI flash memory map) of "i.MX_Linux_User's_Guide.pdf" in documentation

package of L4.14.98_2.0.0:

The QuadSPI flash memory can be configured using the Linux kernel command line.
U-Boot is loaded at the beginning of the QuadSPI memory so that the device can boot from it. The default configuration is
that on boot up, U-Boot loads the kernel, DTB, and root file system from the SD/MMC card into DDRAM. The end user can
change the default settings according to their requirements. More partitions can be added through the kernel command line.
The following is an example of what might be added to the Linux boot command line:

mtdparts=21e4000.qspi:1m(uboot),8m(kernel),1m(dtb),-(user)

Regards,

Yuri.

1,739 Views
toanjunifer
Senior Contributor I

Hi @YuriMuhin,

Thank you for quick reply. I try to type this command with small modify to compatible with my device. When boot device i stop at autoboot and type command: 

mtdparts=21e0000.qspi:1m(uboot),14m(kernel),1m(dtb),-(user)

It's show no error:

U-Boot 2016.03-imx_v2016.03_4.1.15_2.0.0_ga+g0ec2a01 (Sep 16 2016 - 18:36:22 -0500)

CPU: Freescale i.MX6UL rev1.1 528 MHz (running at 396 MHz)
CPU: Industrial temperature grade (-40C to 105C) at 33C
Reset cause: POR
Board: MX6UL 14x14 EVK
I2C: ready
DRAM: 512 MiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1
SF: Detected N25Q256 with page size 256 Bytes, erase size 64 KiB, total 32 MiB
*** Warning - bad CRC, using default environment

Display: TFT43AB (480x272)
Video: 480x272x24
In: serial
Out: serial
Err: serial
Net: FEC1
Normal Boot
Hit any key to stop autoboot: 0
=> mtdparts=21e0000.qspi:1m(uboot),14m(kernel),1m(dtb),-(user)
=> saveenv
Saving Environment to SPI Flash...
SF: Detected N25Q256 with page size 256 Bytes, erase size 64 KiB, total 32 MiB
Erasing SPI flash...Writing to SPI flash...done

But when I check with:
   $ cat /proc/mtd

I get: 

root@imx6ulevk:~# cat /proc/mtd
dev: size erasesize name
mtd0: 02000000 00010000 "21e0000.qspi"

I seem no effect or I did wrong way ?

Thank you so much,

   Toan

0 Kudos
Reply

1,739 Views
Yuri
NXP Employee
NXP Employee

Hello,

  Check environment regarding Linux boot command line, using U-boot command printenv.

Regards,

Yuri.

1,739 Views
toanjunifer
Senior Contributor I

After run printenv, I got this:

baudrate=115200
board_name=EVK
board_rev=14X14
boot_fdt=try
bootcmd=run findfdt;mmc dev ${mmcdev};mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; else run netboot; fi
bootcmd_mfg=run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};
bootdelay=3
bootscript=echo Running bootscript from mmc ...; source
console=ttymxc0
ethact=FEC1
ethaddr=00:04:9f:04:d3:8d
ethprime=FEC
fdt_addr=0x83000000
fdt_file=undefined
fdt_high=0xffffffff
findfdt=if test $fdt_file = undefined; then if test $board_name = EVK && test $board_rev = 9X9; then setenv fdt_file imx6ul-9x9-evk.dtb; fi; if test $board_name = EVK && test $board_rev = 14X14; then setenv fdt_file imx6ul-14x14-evk.dtb; fi; if test $fdt_file = undefined; then echo WARNING: Could not determine dtb to use; fi; fi;
image=zImage
initrd_addr=0x83800000
initrd_high=0xffffffff
ip_dyn=yes
loadaddr=0x80800000
loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};
loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}
loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}
mfgtool_args=setenv bootargs console=${console},${baudrate} rdinit=/linuxrc g_mass_storage.stall=0 g_mass_storage.removable=1 g_mass_storage.file=/fat g_mass_storage.ro=1 g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF g_mass_storage.iSerialNumber="" clk_ignore_unused
mmcargs=setenv bootargs console=${console},${baudrate} root=${mmcroot}
mmcautodetect=yes
mmcboot=echo Booting from mmc ...; run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
mmcdev=1
mmcpart=1
mmcroot=/dev/mmcblk1p2 rootwait rw
netargs=setenv bootargs console=${console},${baudrate} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp
netboot=echo Booting from net ...; run netargs; if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; ${get_cmd} ${image}; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if ${get_cmd} ${fdt_addr} ${fdt_file}; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
panel=TFT43AB
script=boot.scr

Environment size: 2457/8188 byte

No mtdparts found ?

0 Kudos
Reply

1,739 Views
Yuri
NXP Employee
NXP Employee

Hello,

   Try the following:

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

UBootCmdGroupFlash < DULG < DENX 

Regards,

Yuri.