How to setup or change partitions of NAND?

cancel
Showing results for 
Search instead for 
Did you mean: 

How to setup or change partitions of NAND?

595 Views
x10
Contributor V

Hi, All

uboot_ivt.sb can be programmed into imx28EVK through MfgTool, and NAND command can run without error after booting. But I don't know what's size of each partition in NAND, and how to change the partion. As I understand, the UTP driver in updater_ivt.sb will charge those issue, but I can not even find where the driver's code is. Please give me some hits if any body know something about these issues, thanks!

BR

Cheng Shi

Labels (1)
1 Reply

60 Views
bba
Contributor III

Hello, you can read the partion size with:

root@freescale-evk /home/user$ cat /proc/mtd
dev: size erasesize name
mtd0: 01400000 00020000 "gpmi-nfc-0-boot"
mtd1: 3ec00000 00020000 "gpmi-nfc-general-use"

The boot area size on mtd0 will be defined inside: linux/arch/arm/mach-mx28/device.c

static struct gpmi_nfc_platform_data gpmi_nfc_platform_data = {
  .nfc_version = 1,
  .boot_rom_version = 1,
  .clock_name = "gpmi",
  .platform_init = gpmi_nfc_platform_init,
  .platform_exit = gpmi_nfc_platform_exit,
  .min_prop_delay_in_ns = 5,
  .max_prop_delay_in_ns = 9,
  .max_chip_count = 2,
  .boot_area_size_in_bytes = 20 * SZ_1M,
  .partition_source_types = gpmi_nfc_partition_source_types,
  .partitions = 0,
  .partition_count = 0,
};

On my side the partition on mtd1 will be devided later in more logical ubifs partitions using flash utilities.

echo "*** Erasing MTD Device 1 ***"
#flash_erase /dev/mtd1 0 0
ubiformat /dev/mtd1 -y
echo "*** Attaching UBI partition ***"
ubiattach /dev/ubi_ctrl -m 1
echo "*** Creating UBI volumes ***"
ubimkvol /dev/ubi0 -n 0 -N rootfs0 -s 40MiB
ubimkvol /dev/ubi0 -n 1 -N firmware -s 40MiB
ubimkvol /dev/ubi0 -n 2 -N data -m
echo "*** Mounting ***"
mkdir /mnt/ubifs
mount -t ubifs ubi0:rootfs0 /mnt/ubifs
mkdir /mnt/firmware
mount -t ubifs ubi0:firmware /mnt/firmware
mkdir /mnt/data
mount -t ubifs ubi0:data /mnt/data

...

Regards,

BBa