All of lore.kernel.org
 help / color / mirror / Atom feed
* ubiattach error
@ 2011-09-20 14:25 Lambrecht Jürgen
  2011-09-23 14:01 ` Lambrecht Jürgen
  0 siblings, 1 reply; 3+ messages in thread
From: Lambrecht Jürgen @ 2011-09-20 14:25 UTC (permalink / raw)
  To: barebox@lists.infradead.org

Hello,

When I want to run 'ubiattach' I get this error:

barebox:/dev erase nand0.root1.bb
Skipping bad block at 0x08000000
Skipping bad block at 0x08020000
barebox:/dev ubiattach nand0.root1
UBI: attaching mtd0 to ubi0
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
UBI: empty MTD device detected
UBI: create volume table (copy #1)
UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 0:512, 
written 0 bytes
UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 1:512, 
written 0 bytes
UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 2:512, 
written 0 bytes
UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 3:512, 
written 0 bytes
UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 4:512, 
written 0 bytes
UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 5:512, 
written 0 bytes
failed to attach: I/O error
------------------------------------------------------------------
- I use a imx27, and our HW is based on the imx27pdk.
- We use the BI-swap solution to work around the nand flash HW bug (2kB 
pages are load in 512 chunks, mangling the spare area) (so 
drivers/mtd/nand/nand_imx.c is patched).
- I see UBI detects a sub-page size of 512B, what does that mean?
   Because in the UBI menu config "drivers - mtd - NAND - select nand 
pagesize you want to support booting from", I must take '2048 byte page 
size'; with '512 byte and 2048 byte pagesize' selected the board does 
not boot.
- I use LTIB from CVS (not the freescale one), that I have patched 
according to the imx28 BSP from freescale to support UBI

Kind regards,
Jürgen

-- 
Jürgen Lambrecht
R&D Associate
Tel: +32 (0)51 303045    Fax: +32 (0)51 310670
http://www.televic-rail.com
Televic Rail NV - Leo Bekaertlaan 1 - 8870 Izegem - Belgium
Company number 0825.539.581 - RPR Kortrijk

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ubiattach error
  2011-09-20 14:25 ubiattach error Lambrecht Jürgen
@ 2011-09-23 14:01 ` Lambrecht Jürgen
  0 siblings, 0 replies; 3+ messages in thread
From: Lambrecht Jürgen @ 2011-09-23 14:01 UTC (permalink / raw)
  To: barebox@lists.infradead.org

On 09/20/2011 04:25 PM, Lambrecht Jürgen wrote:
>
> Hello,
>
> When I want to run 'ubiattach' I get this error:
>
> barebox:/dev erase nand0.root1.bb
> Skipping bad block at 0x08000000
> Skipping bad block at 0x08020000
> barebox:/dev ubiattach nand0.root1
>
first do 'ubiformat' in linux or flash an ubi image. Then you can attach 
to it.
Mark: you can only attach 1 mtd0

After a lot of reading and trial-and-error, now I understand ubi and ubifs.

Juergen
>
> UBI: attaching mtd0 to ubi0
> 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
> UBI: empty MTD device detected
> UBI: create volume table (copy #1)
> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 0:512,
> written 0 bytes
> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 1:512,
> written 0 bytes
> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 2:512,
> written 0 bytes
> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 3:512,
> written 0 bytes
> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 4:512,
> written 0 bytes
> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 5:512,
> written 0 bytes
> failed to attach: I/O error
> ------------------------------------------------------------------
> - I use a imx27, and our HW is based on the imx27pdk.
> - We use the BI-swap solution to work around the nand flash HW bug (2kB
> pages are load in 512 chunks, mangling the spare area) (so
> drivers/mtd/nand/nand_imx.c is patched).
> - I see UBI detects a sub-page size of 512B, what does that mean?
>    Because in the UBI menu config "drivers - mtd - NAND - select nand
> pagesize you want to support booting from", I must take '2048 byte page
> size'; with '512 byte and 2048 byte pagesize' selected the board does
> not boot.
> - I use LTIB from CVS (not the freescale one), that I have patched
> according to the imx28 BSP from freescale to support UBI
>
> Kind regards,
> Jürgen
>
> --
> Jürgen Lambrecht
> R&D Associate
> Tel: +32 (0)51 303045    Fax: +32 (0)51 310670
> http://www.televic-rail.com
> Televic Rail NV - Leo Bekaertlaan 1 - 8870 Izegem - Belgium
> Company number 0825.539.581 - RPR Kortrijk
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>


-- 
Jürgen Lambrecht
R&D Associate
Tel: +32 (0)51 303045    Fax: +32 (0)51 310670
http://www.televic-rail.com
Televic Rail NV - Leo Bekaertlaan 1 - 8870 Izegem - Belgium
Company number 0825.539.581 - RPR Kortrijk

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* ubiattach error
@ 2014-01-09 17:54 C J
  0 siblings, 0 replies; 3+ messages in thread
From: C J @ 2014-01-09 17:54 UTC (permalink / raw)
  To: linux-mtd@lists.infradead.org

I have a small 'ARMv7 Processor rev 2 (v7l)' powered box running Ubuntu 10.04 LTS with kernel 2.6.37  The environment is a squashfs rootfs with a small RW config area:

# df
Filesystem       1K-blocks      Used Available Use% Mounted on
/dev/mtdblock11     246664    246664         0 100% /
ubi1_0                6648       100      6548   2% /.profile

The box boots and operates without problems, however I am trying to access some of the /dev/mtd devices but receive errors when trying to attach:

# /usr/sbin/ubiattach /dev/ubi_ctrl -m 3

[2335587.812500] UBI: attaching mtd3 to ubi2
[2335587.812500] UBI: physical eraseblock size:   131072 bytes (128 KiB)
[2335587.812500] UBI: logical eraseblock size:    129024 bytes
[2335587.812500] UBI: smallest flash I/O unit:    2048
[2335587.812500] UBI: sub-page size:              512
[2335587.812500] UBI: VID header offset:          512 (aligned 512)
[2335587.812500] UBI: data offset:                2048
[2335587.820312] UBI: max. sequence number:       0
[2335587.820312] UBI error: ubi_read_volume_table: the layout volume was not found

Some devices I can access, but most I cannot.  Example: /dev/mtd10 I can attach to but not /dev/mtd5

# /usr/sbin/mtdinfo /dev/mtd10 -u
mtd10
Name:                           backup
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          320 (41943040 bytes, 40.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:20
Bad blocks are allowed:         true
Device is writable:             true
Default UBI VID header offset:  512
Default UBI data offset:        2048
Default UBI LEB size:           129024 bytes, 126.0 KiB
Maximum UBI volumes count:      128

# /usr/sbin/mtdinfo /dev/mtd5 -u
mtd5
Name:                           initrd
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          96 (12582912 bytes, 12.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:10
Bad blocks are allowed:         true
Device is writable:             true
Default UBI VID header offset:  512
Default UBI data offset:        2048
Default UBI LEB size:           129024 bytes, 126.0 KiB
Maximum UBI volumes count:      128

Installed utilities are version 1.4.5

Looking for help to find out why I can't attach..

Thanks,

-Craig 		 	   		  

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-09 17:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-20 14:25 ubiattach error Lambrecht Jürgen
2011-09-23 14:01 ` Lambrecht Jürgen
  -- strict thread matches above, loose matches on Subject: below --
2014-01-09 17:54 C J

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.