[U-Boot] ubi part partation issue (ubi at u-boot)

naveen yadav yad.naveen at gmail.com
Wed Aug 5 13:40:56 CEST 2009


Hi All,

i am following following issues when using samsung flex-onenand of size 1GB.

1. I am doing following steps,

0) onenand erase force  0x200000 0x6400000

if i erase full onenand my oneboot and uboot also get erased( which
are at first block of onenand) i do not know is there different erase
command for SLC and MLC.
if any body is having idea how to do pls let me know.

onenand_erase: start = 0x06500000, len = 131072
onenand_erase: start = 0x06520000, len = 131072
onenand_erase: start = 0x06540000, len = 131072
onenand_erase: start = 0x06560000, len = 131072
onenand_erase: start = 0x06580000, len = 131072
onenand_erase: start = 0x065a0000, len = 131072
onenand_erase: start = 0x065c0000, len = 131072
onenand_erase: start = 0x065e0000, len = 131072
OK

a) mtdparts

mtdparts

---mtdparts_init---
last_ids  : onenand0=onenand
env_ids   : onenand0=onenand
last_parts: mtdparts=onenand:256k at 1m(params),8m at 2m(kernel),16m(rootfs),32m(fs),-
(ubifs)
env_parts : mtdparts=onenand:256k at 1m(params),8m at 2m(kernel),16m(rootfs),32m(fs),-
(ubifs)

last_partition : onenand0,0
env_partition  : onenand0,0

---list_partitions---

device onenand0 <onenand>, # parts = 5
#: name                size            offset          mask_flags
0: params              0x00040000      0x00100000      0
1: kernel              0x00800000      0x00200000      0
2: rootfs              0x01000000      0x00a00000      0
3: fs                  0x02000000      0x01a00000      0
4: ubifs               0x2c600000      0x03a00000      0

--- mtd_part_info: partition number 0 for device onenand0 (onenand)

active partition: onenand0,0 - (params) 0x00040000 @ 0x00100000

defaults:
mtdids  : onenand0=onenand
mtdparts: mtdparts=onenand:256k at 1m(params),8m at 2m(kernel),16m(rootfs),32m(fs),-(u
bifs)


******* Reboot the target *****************
b) ubi part kernel

LEONID # ubi part kernel

---mtdparts_init---
last_ids  : onenand0=onenand
env_ids   : onenand0=onenand
last_parts: mtdparts=onenand:256k at 1m(params),8m at 2m(kernel),16m(rootfs),32m(fs),-
(ubifs)
env_parts : mtdparts=onenand:256k at 1m(params),8m at 2m(kernel),16m(rootfs),32m(fs),-
(ubifs)

last_partition : onenand0,0
env_partition  : onenand0=onenand
--- getting current partition: onenand0=onenand
--- find_dev_and_part ---
id = onenand0=onenand
no partition number specified
448 do_ubi -1454 do_ubi -2466 do_ubi -5UBI: mtd1 is detached from ubi0
--- find_dev_and_part ---
id = kernel
--- find_dev_and_part ---
id = kernel
Creating 1 MTD partitions on "onenand0":
0x%lx-0x%lx : ""
UBI: attaching mtd1 to ubi0 ubi_attach_mtd_dev
UBI: min_io_size      2048
UBI: hdrs_min_io_size 512
UBI: ec_hdr_alsize    512
UBI: vid_hdr_alsize   512
UBI: vid_hdr_offset   512
UBI: vid_hdr_aloffset 512
UBI: vid_hdr_shift    0
UBI: leb_start        2048
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: logical eraseblock size:    129024 bytes
UBI: sub-page size:              512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
$$$$$$$$$$$$$abcd 0x20000,0x67821140e1attach_by_scanning-1
attach_by_scanning-2
attach_by_scanning-3
attach_by_scanning-4
attach_by_scanning-5
attach_by_scanning-6
attach_by_scanning-7
23ubi_attach_mtd_dev error code =0UBI: attached mtd1 to ubi0
UBI: MTD device name:            "mtd=1"
UBI: MTD device size:            %lu MiB
UBI: number of good PEBs:        51
UBI: number of bad PEBs:         13
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     0
UBI: available PEBs:             45
UBI: total number of reserved PEBs: 6
UBI: number of PEBs reserved for bad PEB handling: 2
UBI: max/mean erase counter: 1/1


# ubi part kernel

---mtdparts_init---
last_ids  : onenand0=onenand
env_ids   : onenand0=onenand
last_parts: mtdparts=onenand:256k at 1m(params),8m at 2m(kernel),16m(rootfs),32m(fs),-
(ubifs)
env_parts : mtdparts=onenand:256k at 1m(params),8m at 2m(kernel),16m(rootfs),32m(fs),-
(ubifs)

last_partition : onenand0,0
env_partition  : onenand0=onenand
--- getting current partition: onenand0=onenand
--- find_dev_and_part ---
id = onenand0=onenand
no partition number specified
448 do_ubi -1454 do_ubi -2466 do_ubi -5UBI: mtd1 is detached from ubi0
--- find_dev_and_part ---
id = kernel
--- find_dev_and_part ---
id = kernel
Creating 1 MTD partitions on "onenand0":
0x%lx-0x%lx : ""
UBI: attaching mtd1 to ubi0 ubi_attach_mtd_dev
UBI: min_io_size      2048
UBI: hdrs_min_io_size 512
UBI: ec_hdr_alsize    512
UBI: vid_hdr_alsize   512
UBI: vid_hdr_offset   512
UBI: vid_hdr_aloffset 512
UBI: vid_hdr_shift    0
UBI: leb_start        2048
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: logical eraseblock size:    129024 bytes
UBI: sub-page size:              512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
$$$$$$$$$$$$$abcd 0x20000,0x67821140e1attach_by_scanning-1
attach_by_scanning-2
attach_by_scanning-3
attach_by_scanning-4
attach_by_scanning-5
attach_by_scanning-6
attach_by_scanning-7
23ubi_attach_mtd_dev error code =0UBI: attached mtd1 to ubi0
UBI: MTD device name:            "mtd=1"
UBI: MTD device size:            %lu MiB
UBI: number of good PEBs:        51
UBI: number of bad PEBs:         13
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     0
UBI: available PEBs:             45
UBI: total number of reserved PEBs: 6
UBI: number of PEBs reserved for bad PEB handling: 2
UBI: max/mean erase counter: 1/1

c1) ubi create kernel 0x600000 s

i face below error

# ubi create kernel 0x600000 s

---mtdparts_init---
last_ids  : onenand0=onenand
env_ids   : onenand0=onenand
last_parts: mtdparts=onenand:256k at 1m(params),8m at 2m(kernel),16m(rootfs),32m(fs),-
(ubifs)
env_parts : mtdparts=onenand:256k at 1m(params),8m at 2m(kernel),16m(rootfs),32m(fs),-
(ubifs)

last_partition : onenand0,0
env_partition  : onenand0=onenand
--- getting current partition: onenand0=onenand
--- find_dev_and_part ---
id = onenand0=onenand
no partition number specified
448 do_ubi -1512 do_ubi -3Creating static volume kernel of size 6291456
UBI error: ubi_create_volume: cannot create volume 0, error -28


c2) ubi create kernel is sucessfull

# ubi create kernel 0x600000 s

---mtdparts_init---
last_ids  : onenand0=onenand
env_ids   : onenand0=onenand
last_parts: mtdparts=onenand:256k at 1m(params),8m at 2m(kernel),16m(rootfs),32m(fs),-
(ubifs)
env_parts : mtdparts=onenand:256k at 1m(params),8m at 2m(kernel),16m(rootfs),32m(fs),-
(ubifs)

last_partition : onenand0,0
env_partition  : onenand0=onenand
--- getting current partition: onenand0=onenand
--- find_dev_and_part ---
id = onenand0=onenand
no partition number specified
448 do_ubi -1512 do_ubi -3Creating static volume kernel of size 6291456
UBI error: ubi_create_volume: cannot create volume 0, error -28
LEONID # ubi create kernel

---mtdparts_init---
last_ids  : onenand0=onenand
env_ids   : onenand0=onenand
last_parts: mtdparts=onenand:256k at 1m(params),8m at 2m(kernel),16m(rootfs),32m(fs),-
(ubifs)
env_parts : mtdparts=onenand:256k at 1m(params),8m at 2m(kernel),16m(rootfs),32m(fs),-
(ubifs)

last_partition : onenand0,0
env_partition  : onenand0=onenand
--- getting current partition: onenand0=onenand
--- find_dev_and_part ---
id = onenand0=onenand
no partition number specified
448 do_ubi -1512 do_ubi -3Creating dynamic volume kernel of size 5806080
onenand_erase: start = 0x00240000, len = 131072
onenand_erase: start = 0x00260000, len = 131072
onenand_erase: start = 0x00280000, len = 131072
onenand_erase: start = 0x002a0000, len = 131072
onenand_erase: start = 0x002c0000, len = 131072
onenand_erase: start = 0x002e0000, len = 131072
onenand_erase: start = 0x00300000, len = 131072
onenand_erase: start = 0x00320000, len = 131072
onenand_erase: start = 0x00340000, len = 131072
onenand_erase: start = 0x00360000, len = 131072
onenand_erase: start = 0x00380000, len = 131072
onenand_erase: start = 0x003a0000, len = 131072
onenand_erase: start = 0x003c0000, len = 131072
onenand_erase: start = 0x003e0000, len = 131072
onenand_erase: start = 0x00400000, len = 131072
onenand_erase: start = 0x00420000, len = 131072
onenand_erase: start = 0x00440000, len = 131072
onenand_erase: start = 0x00460000, len = 131072
onenand_erase: start = 0x00480000, len = 131072
onenand_erase: start = 0x004a0000, len = 131072
onenand_erase: start = 0x004c0000, len = 131072
onenand_erase: start = 0x004e0000, len = 131072
onenand_erase: start = 0x00500000, len = 131072
onenand_erase: start = 0x00520000, len = 131072
onenand_erase: start = 0x00540000, len = 131072
onenand_erase: start = 0x00560000, len = 131072
onenand_erase: start = 0x00580000, len = 131072
onenand_erase: start = 0x005a0000, len = 131072
onenand_erase: start = 0x005c0000, len = 131072
onenand_erase: start = 0x005e0000, len = 131072
onenand_erase: start = 0x00620000, len = 131072
onenand_erase: start = 0x00660000, len = 131072
onenand_erase: start = 0x00680000, len = 131072
onenand_erase: start = 0x006a0000, len = 131072
onenand_erase: start = 0x006c0000, len = 131072
onenand_erase: start = 0x006e0000, len = 131072
onenand_erase: start = 0x00700000, len = 131072
onenand_erase: start = 0x00720000, len = 131072
onenand_erase: start = 0x00740000, len = 131072
onenand_erase: start = 0x00760000, len = 131072
onenand_erase: start = 0x00780000, len = 131072
onenand_erase: start = 0x007a0000, len = 131072
onenand_erase: start = 0x007c0000, len = 131072
onenand_erase: start = 0x007e0000, len = 131072
onenand_erase: start = 0x00800000, len = 131072
onenand_erase: start = 0x00840000, len = 131072
onenand_erase: start = 0x008c0000, len = 131072
onenand_erase: start = 0x008e0000, len = 131072
onenand_erase: start = 0x00940000, len = 131072


# ubi info l

---mtdparts_init---
last_ids  : onenand0=onenand
env_ids   : onenand0=onenand
last_parts: mtdparts=onenand:256k at 1m(params),8m at 2m(kernel),16m(rootfs),32m(fs),-
(ubifs)
env_parts : mtdparts=onenand:256k at 1m(params),8m at 2m(kernel),16m(rootfs),32m(fs),-
(ubifs)

last_partition : onenand0,0
env_partition  : onenand0=onenand
--- getting current partition: onenand0=onenand
--- find_dev_and_part ---
id = onenand0=onenand
no partition number specified
448 do_ubi -1512 do_ubi -3UBI: volume information dump:
UBI: vol_id          0
UBI: reserved_pebs   45
UBI: alignment       1
UBI: data_pad        0
UBI: vol_type        3
UBI: name_len        6
UBI: usable_leb_size 129024
UBI: used_ebs        45
UBI: used_bytes      %ld
UBI: last_eb_bytes   129024
UBI: corrupted       0
UBI: upd_marker      0
UBI: name            kernel

UBI: volume information dump:
UBI: vol_id          2147479551
UBI: reserved_pebs   2
UBI: alignment       1
UBI: data_pad        0
UBI: vol_type        3
UBI: name_len        13
UBI: usable_leb_size 129024
UBI: used_ebs        2
UBI: used_bytes      %ld
UBI: last_eb_bytes   2
UBI: corrupted       0
UBI: upd_marker      0
UBI: name            layout volume


d)ubi write 0x62000000 zImage 0x490000



after reset the target

a) ubi part kernel command fails with below error
UBI error: ubi_io_read: error -5 while reading 64 bytes from PEB 50:0, read %zd

# ubi part kernel

---mtdparts_init---
last_ids  : onenand0=onenand
env_ids   : onenand0=onenand
last_parts: mtdparts=onenand:256k at 1m(params),8m at 2m(kernel),16m(rootfs),32m(fs),-
(ubifs)
env_parts : mtdparts=onenand:256k at 1m(params),8m at 2m(kernel),16m(rootfs),32m(fs),-
(ubifs)

last_partition : onenand0,0
env_partition  : onenand0,0
448 do_ubi -1454 do_ubi -2466 do_ubi -5--- find_dev_and_part ---
id = kernel
--- find_dev_and_part ---
id = kernel
Creating 1 MTD partitions on "onenand0":
0x%lx-0x%lx : ""
UBI: attaching mtd1 to ubi0 ubi_attach_mtd_dev
UBI: min_io_size      2048
UBI: hdrs_min_io_size 512
UBI: ec_hdr_alsize    512
UBI: vid_hdr_alsize   512
UBI: vid_hdr_offset   512
UBI: vid_hdr_aloffset 512
UBI: vid_hdr_shift    0
UBI: leb_start        2048
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
$$$$$$$$$$$$$abcd 0x20000,0x67821140e1attach_by_scanning-1
onenand_wait: controller error = 0x0400
onenand_wait: controller error = 0x0400
onenand_wait: controller error = 0x0400
onenand_wait: controller error = 0x0400
UBI error: ubi_io_read: error -5 while reading 64 bytes from PEB 50:0, read %zd
bytes
attach_by_scanning-2
2UBI error: ubi_init: cannot attach mtd1
UBI error: ubi_init: UBI error: cannot initialize UBI, error -5
UBI init error -5
LEONID #


More information about the U-Boot mailing list