AnsweredAssumed Answered

mx28: load kernel into nand flash faild

Question asked by h k on Jan 12, 2016
Latest reply on Jan 12, 2016 by h k

Hi all,

   I have a mx28evk board with a Micron MT29F1G08ABADAWP  Nand flash. Totally 128MB and  2K + 64 page size.  When I update the firmware using MFGTool, I keep seeing the "Attempt to write not page aligned data" error.

 

NFC: Version 1, 8-chip GPMI and BCH

Boot ROM: Version 1, Single-chip boot area, block mark swapping supported

Scanning for NAND Flash chips...

NAND device: Manufacturer ID: 0x2c, Chip ID: 0xf1 (Micron NAND 128MiB 3,3V 8-bit)

-----------------------------

NAND Flash Device Information

-----------------------------

Manufacturer      : Micron (0x2c)

Device Code       : 0xf1

Cell Technology   : SLC

Chip Size         : 128 MiB

Pages per Block   : 64

Page Geometry     : 2048+64

ECC Strength      : 4 bits

ECC Size          : 512 B

Data Setup Time   : 10 ns

Data Hold Time    : 7 ns

Address Setup Time: 15 ns

GPMI Sample Delay : 6 ns

tREA              : Unknown

tRLOH             : Unknown

tRHOH             : Unknown

Description       : MT29F1G08ABADAWP

-----------------

Physical Geometry

-----------------

Chip Count             : 1

Page Data Size in Bytes: 2048 (0x800)

Page OOB Size in Bytes : 64

Block Size in Bytes    : 131072 (0x20000)

Block Size in Pages    : 64 (0x40)

Chip Size in Bytes     : 134217728 (0x8000000)

Chip Size in Pages     : 65536 (0x10000)

Chip Size in Blocks    : 1024 (0x400)

Medium Size in Bytes   : 134217728 (0x8000000)

------------

NFC Geometry

------------

ECC Algorithm          : BCH

ECC Strength           : 8

Page Size in Bytes     : 2112

Metadata Size in Bytes : 10

ECC Chunk Size in Bytes: 512

ECC Chunk Count        : 4

Payload Size in Bytes  : 2048

Auxiliary Size in Bytes: 16

Auxiliary Status Offset: 12

Block Mark Byte Offset : 1999

Block Mark Bit Offset  : 0

-----------------

Boot ROM Geometry

-----------------

Boot Area Count            : 1

Boot Area Size in Bytes    : 20971520 (0x1400000)

Stride Size in Pages       : 64

Search Area Stride Exponent: 2

Scanning device for bad blocks

Boot area protection is enabled.

Creating 2 MTD partitions on "gpmi-nfc-main":

0x000000000000-0x000001400000 : "gpmi-nfc-0-boot"

0x000001400000-0x000008000000 : "gpmi-nfc-general-use"

regulator_init_complete: incomplete constraints, leaving vbus5v on

mxs-rtc mxs-rtc.0: setting system clock to 1970-01-01 00:00:48 UTC (48)

Freeing init memory: 176K

Starting UTP

disable turn off display

uuc 0.4 [built Feb 21 2014 08:19:00]

UTP: Waiting for device to appear

utp_mk_devnode: creating node '/dev/utp' with 10+222

cpu_id is 28

g_file_storage gadget: high speed config #1

UTP: received command 'mknod class/mtd,mtd0,/dev/mtd0'

class = 'class/mtd'

item = 'mtd0'

node = /dev/mtd0

type = (null)

UTP: running utp_mk_devnode(class/mtd,mtd0,/dev/mtd0,0x2000)

utp_mk_devnode: creating node '/dev/mtd0' with 90+0

UTP: sending Success

UTP: received command 'mknod class/mtd,mtd1,/dev/mtd1'

class = 'class/mtd'

item = 'mtd1'

node = /dev/mtd1

type = (null)

UTP: running utp_mk_devnode(class/mtd,mtd1,/dev/mtd1,0x2000)

utp_mk_devnode: creating node '/dev/mtd1' with 90+2

UTP: sending Success

UTP: received command 'mknod class/misc,ubi_ctrl,/dev/ubi_ctrl'

class = 'class/misc'

item = 'ubi_ctrl'

node = /dev/ubi_ctrl

type = (null)

UTP: running utp_mk_devnode(class/misc,ubi_ctrl,/dev/ubi_ctrl,0x2000)

utp_mk_devnode: creating node '/dev/ubi_ctrl' with 10+60

UTP: sending Success

UTP: received command '$ flash_eraseall /dev/mtd0'

UTP: sending Busy

UTP: executing "flash_eraseall /dev/mtd0"

Erautp_poll: pass returned. -- 68 % complete.

Erasing 128 Kibyte @ 1400000 -- 100 % complete.

UTP: sending Success

UTP: received command '$ flash_eraseall /dev/mtd1'

UTP: sending Busy

UTP: executing "flash_eraseall /dev/mtd1"

Erasing 128 Kibyte @ 6c00000 -- 100 % complete.

UTP: sending Success

utp_poll: pass returned.

UTP: received command 'send'

UTP: sending Success

UTP: received command '$ dd if=$FILE of=/dev/mtd0'

UTP: sending Busy

UTP: executing "dd if=$FILE of=/dev/mtd0"

nand_do_write_ops: Attempt to write not page aligned data

dd: writing '/dev/mtd0': Invalid argument

1+0 records in

0+0 records out

UTP: sending Non-success

utp_poll: exit with status 256

 

Someone knows what happened? Kernel version is 2.6.35.3

 

I just add the flash's nand_device_info entry in nand_device_info.c. Except this nothing changed with nand driver.

Thanks in advance!

 

{

.end_of_table             = false,

.manufacturer_code        = 0x2c,

.device_code              = 0xf1,

.cell_technology          = NAND_DEVICE_CELL_TECH_SLC,

.chip_size_in_bytes       = 128LL*SZ_1M,

.block_size_in_pages      = 64,

.page_total_size_in_bytes = 2*SZ_1K + 64,

.ecc_strength_in_bits     = 4,

.ecc_size_in_bytes        = 512,

.data_setup_in_ns         = 10,

.data_hold_in_ns          = 7,

.address_setup_in_ns      = 15,

.gpmi_sample_delay_in_ns  = 6,

.tREA_in_ns               = -1,

.tRLOH_in_ns              = -1,

.tRHOH_in_ns              = -1,

"MT29F1G08ABADAWP",

},

Outcomes