Marcelo Barros

ubiattach not working on i.mx28 EVK ?

Discussion created by Marcelo Barros on Feb 3, 2012
Latest reply on Mar 13, 2012 by Christian Pellegrin

I installed a 256MB NAND in i.mx28 EVK REV D and I am trying to format and mount it using UBSFS. I am booting from an SDCARD and using the Linux version provided by FSL (2.6.35). I installed mtd-util and I am executing the following commands:

 

mknod /dev/ubi_ctrl c 10 63

flash_eraseall /dev/mtd1

ubiformat /dev/mtd1 -y

ubiattach /dev/ubi_ctrl -m 1

 

But ubiattach it is now working as expected:

 

ubiattach: error!: cannot attach mtd1
           error 38 (Function not implemented)

 

I updated mtd-util (now using 1.4.9, no success). Checking source code of libubi.c, it is possible to see that we have an error after a call to ioctrl. Kernel code at this point (drivers/mtd/ubi/cdev.c:ctrl_cdev_ioctl) is the same as code found at imx kernel code repository.

 

ret = ioctl(fd, UBI_IOCATT, r);

 

Any tips to solve this problem ?

 

Additional info:

 

root@/usr/bin$ cat /proc/mtd
dev:    size   erasesize  name
mtd0: 01400000 00020000 "gpmi-nfc-0-boot"
mtd1: 0ec00000 00020000 "gpmi-nfc-general-use"

 

root$ cat linux.config  | grep MTD | grep -v "^#"
CONFIG_MTD=y
CONFIG_MTD_DEBUG=y
CONFIG_MTD_DEBUG_VERBOSE=3
CONFIG_MTD_CONCAT=y
CONFIG_MTD_PARTITIONS=y
CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLKDEVS=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
CONFIG_MTD_M25P80=m
CONFIG_MTD_BLOCK2MTD=y
CONFIG_MTD_NAND_ECC=y
CONFIG_MTD_NAND=y
CONFIG_MTD_NAND_DENALI_

SCRATCH_REG_ADDR=0xFF108018
CONFIG_MTD_NAND_IDS=y
CONFIG_MTD_NAND_GPMI_NFC=y
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_MTD_UBI_BEB_RESERVE=1
CONFIG_MTD_UBI_DEBUG=y
CONFIG_MTD_UBI_DEBUG_MSG=y
CONFIG_MTD_UBI_DEBUG_MSG_BLD=y

roott$ cat linux.config  | grep UBI | grep -v "^#"
CONFIG_TCP_CONG_CUBIC=y
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_MTD_UBI_BEB_RESERVE=1
CONFIG_MTD_UBI_DEBUG=y
CONFIG_MTD_UBI_DEBUG_MSG=y
CONFIG_MTD_UBI_DEBUG_MSG_BLD=y
CONFIG_UBIFS_FS=y
CONFIG_UBIFS_FS_XATTR=y
CONFIG_UBIFS_FS_ADVANCED_COMPR=y
CONFIG_UBIFS_FS_LZO=y
CONFIG_UBIFS_FS_ZLIB=y
CONFIG_UBIFS_FS_DEBUG=y
CONFIG_UBIFS_FS_DEBUG_MSG_LVL=0


Outcomes