Re: [U-Boot] UBI issues on SAMA5D31 NOR flash

2014-10-02 Thread Andy Pont
Hello Heiko,

  UBI error: vtbl_check: reserved_pebs 81, ubi-good_peb_count 80
  UBI error: vtbl_check: too large reserved_pebs, good PEBs 80
 
  Use of UBI is new to me so where are the PEBs configured?
 
 Good question ... looking into vtbl_check(), the reserved_pebs value
 is read from the record in the volume table:
 
  reserved_pebs = be32_to_cpu(vtbl[i].reserved_pebs);
 
 @reserved_pebs: how many physical eraseblocks are reserved for this
 volume

I have changed the size of the partition as defined in U-Boot and also
reduced the maximum image size when creating the UBI image and have found a
combination that moves me on to the next error:

U-Boot ubi part rootfs
UBI: attaching mtd2 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:130944 bytes
UBI: smallest flash I/O unit:1
UBI: VID header offset:  64 (aligned 64)
UBI: data offset:128
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
UBI error: ubi_io_write: error -5 while writing 64 bytes to PEB 0:0, written
0 bytes
UBI error: erase_worker: failed to erase PEB 0, error -5
UBI error: erase_worker: bad physical eraseblock 0 detected
UBI warning: ubi_ro_mode: switch to read-only mode
UBI error: do_work: work failed with error code -5
UBI error: autoresize: cannot auto-resize volume 0
UBI error: ubi_init: cannot attach mtd2
UBI error: ubi_init: UBI error: cannot initialize UBI, error -30
UBI init error 30

Hopefully this may be the last hurdle to overcome but somehow I think maybe
not!

Regards,

Andy.

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] UBI issues on SAMA5D31 NOR flash

2014-10-02 Thread Heiko Schocher

Hello Andy,

Am 02.10.2014 10:16, schrieb Andy Pont:

Hello Heiko,


UBI error: vtbl_check: reserved_pebs 81, ubi-good_peb_count 80
UBI error: vtbl_check: too large reserved_pebs, good PEBs 80

Use of UBI is new to me so where are the PEBs configured?


Good question ... looking into vtbl_check(), the reserved_pebs value
is read from the record in the volume table:

  reserved_pebs = be32_to_cpu(vtbl[i].reserved_pebs);

@reserved_pebs: how many physical eraseblocks are reserved for this
volume


I have changed the size of the partition as defined in U-Boot and also
reduced the maximum image size when creating the UBI image and have found a
combination that moves me on to the next error:

U-Boot  ubi part rootfs
UBI: attaching mtd2 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:130944 bytes
UBI: smallest flash I/O unit:1
UBI: VID header offset:  64 (aligned 64)
UBI: data offset:128
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
- Warning: 1 protected sectors will not be erased!
UBI error: ubi_io_write: error -5 while writing 64 bytes to PEB 0:0, written
0 bytes


What says flinfo ? It seems you have protected sectors on
your nor flash ... you must unprotect them before using it ...


UBI error: erase_worker: failed to erase PEB 0, error -5
UBI error: erase_worker: bad physical eraseblock 0 detected
UBI warning: ubi_ro_mode: switch to read-only mode
UBI error: do_work: work failed with error code -5
UBI error: autoresize: cannot auto-resize volume 0
UBI error: ubi_init: cannot attach mtd2
UBI error: ubi_init: UBI error: cannot initialize UBI, error -30
UBI init error 30

Hopefully this may be the last hurdle to overcome but somehow I think maybe
not!


Cheer up!

bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] UBI issues on SAMA5D31 NOR flash

2014-10-02 Thread Andy Pont
Hello Heiko,

 What says flinfo ? It seems you have protected sectors on
 your nor flash ... you must unprotect them before using it ...

flinfo says that all sectors are read only as the flash device supports
block locking and powers up with all sectors in their locked state.

The board configuration file includes CONFIG_SYS_FLASH_PROTECTION in order
to allow the protect off command to work prior to manual updates of the
flash content.

 Cheer up!

I'll try! :-)

Regards,

Andy.


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] UBI issues on SAMA5D31 NOR flash

2014-10-02 Thread Andy Pont
Hello Heiko,

  What says flinfo ? It seems you have protected sectors on
  your nor flash ... you must unprotect them before using it ...
 
 flinfo says that all sectors are read only as the flash device supports
 block locking and powers up with all sectors in their locked state.
 
 The board configuration file includes CONFIG_SYS_FLASH_PROTECTION in
 order to allow the protect off command to work prior to manual updates
 of the flash content.

Running protect off on the UBI area before ubi part rootfs makes the
command work without any issues.  Now just have to figure out why the Linux
kernel isn't detecting the partition and mounting it...

Regards,

Andy.

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] UBI issues on SAMA5D31 NOR flash

2014-10-01 Thread Heiko Schocher



Am 30.09.2014 13:19, schrieb Andy Pont:

Hello Heiko,


Hmm.. I thought to see something like this:

too large reserved_pebs %d, good PEBs %d

I am not familiar with this HW ... I think, you have to debug into it


Changing the dbg_err() to ubi_err() and also adding a bit more output then I
get:

UBI error: vtbl_check: reserved_pebs 81, ubi-good_peb_count 80
UBI error: vtbl_check: too large reserved_pebs, good PEBs 80

Use of UBI is new to me so where are the PEBs configured?


Good question ... looking into vtbl_check(), the reserved_pebs value
is read from the record in the volume table:

reserved_pebs = be32_to_cpu(vtbl[i].reserved_pebs);

@reserved_pebs: how many physical eraseblocks are reserved for this volume

The ubi-good_peb_count 80 seems correct to me.

maybe ubi image creation was bad?
I can only speculate ... sorry.

bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] UBI issues on SAMA5D31 NOR flash

2014-09-30 Thread Andy Pont
Hello Heiko,

  Using the patches from Bo Shen to support the NOR flash on the Atmel
 
 which patches?

I can't find the references in Patchman but they were sent to the mailing
list on 18th July 2014 in a series called ARM: atmel: sama5d3xek: enable
NOR flash support.  The patches basically just add the board features to
enable the IO pins for the NOR flash and to map it into the memory map at
0x1000.

  U-Boot  ubi part rootfs
  UBI: attaching mtd2 to ubi0
  UBI: physical eraseblock size:   131072 bytes (128 KiB)
  UBI: logical eraseblock size:130944 bytes
  UBI: smallest flash I/O unit:1
  UBI: VID header offset:  64 (aligned 64)
  UBI: data offset:128
  UBI error: vtbl_check: volume table check failed: record 0, error 9
 
 seems ubi does not find the volume table ... could you activate
 ubi error messages ubi_err() ?

Adding:

#define DEBUG
#define CONFIG_MTD_UBI_DEBUG
#define CONFIG_MTD_UBI_DEBUG_MSG
#define CONFIG_UBIFS_FS_DEBUG

Gives the following output:

U-Boot ubi part rootfs

---mtdparts_init---
last_ids  : nor0=physmap-flash.0
env_ids   : nor0=physmap-flash.0
last_parts:
mtdparts=physmap-flash.0:128k(bootstrap)ro,768k(u-boot)ro,128k(fdt),4m(kerne
l),10m(rootfs)
env_parts :
mtdparts=physmap-flash.0:128k(bootstrap)ro,768k(u-boot)ro,128k(fdt),4m(kerne
l),10m(rootfs)

last_partition : nor0,0
env_partition  : nor0,0
--- find_dev_and_part ---
id = rootfs
--- find_dev_and_part ---
id = rootfs
Creating 1 MTD partitions on nor0:
0x0050-0x00f0 : mtd=4
UBI: attaching mtd2 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:130944 bytes
UBI: smallest flash I/O unit:1
UBI: VID header offset:  64 (aligned 64)
UBI: data offset:128
UBI error: vtbl_check: volume table check failed: record 0, error 9
UBI error: ubi_init: cannot attach mtd2
UBI error: ubi_init: UBI error: cannot initialize UBI, error -22
UBI init error 22
Command failed, result=22

 Did the ubi partition work under linux? Did you tried current ML
 U-Boot (there MTD/UBI and UBIFS is synced with linux 3.15) ...

I haven't booted to Linux yet.  If I try to boot with the kernel that is in
the NOR flash then I get the following output from the console messages:

0.nor_flash: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID
0x89 Chip ID 0x00899a
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Using buffer write method
Using auto-unlock on power-up/resume
cfi_cmdset_0001: Erase suspend on write enabled
UBI error: ubi_init: UBI error: cannot initialize UBI, error -19

Is there something that I need to do in order to tell U-Boot and the kernel
that the base address of the NOR flash device is 0x1000 rather than 0x0?

Thanks,

Andy.


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] UBI issues on SAMA5D31 NOR flash

2014-09-30 Thread Heiko Schocher

Hello Andy,

Am 30.09.2014 11:04, schrieb Andy Pont:

Hello Heiko,


Using the patches from Bo Shen to support the NOR flash on the Atmel


which patches?


I can't find the references in Patchman but they were sent to the mailing
list on 18th July 2014 in a series called ARM: atmel: sama5d3xek: enable
NOR flash support.  The patches basically just add the board features to
enable the IO pins for the NOR flash and to map it into the memory map at
0x1000.


U-Boot   ubi part rootfs
UBI: attaching mtd2 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:130944 bytes
UBI: smallest flash I/O unit:1
UBI: VID header offset:  64 (aligned 64)
UBI: data offset:128
UBI error: vtbl_check: volume table check failed: record 0, error 9


seems ubi does not find the volume table ... could you activate
ubi error messages ubi_err() ?


Adding:

#define DEBUG
#define CONFIG_MTD_UBI_DEBUG
#define CONFIG_MTD_UBI_DEBUG_MSG
#define CONFIG_UBIFS_FS_DEBUG

Gives the following output:

U-Boot  ubi part rootfs

---mtdparts_init---
last_ids  : nor0=physmap-flash.0
env_ids   : nor0=physmap-flash.0
last_parts:
mtdparts=physmap-flash.0:128k(bootstrap)ro,768k(u-boot)ro,128k(fdt),4m(kerne
l),10m(rootfs)
env_parts :
mtdparts=physmap-flash.0:128k(bootstrap)ro,768k(u-boot)ro,128k(fdt),4m(kerne
l),10m(rootfs)

last_partition : nor0,0
env_partition  : nor0,0
--- find_dev_and_part ---
id = rootfs
--- find_dev_and_part ---
id = rootfs
Creating 1 MTD partitions on nor0:
0x0050-0x00f0 : mtd=4
UBI: attaching mtd2 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:130944 bytes
UBI: smallest flash I/O unit:1
UBI: VID header offset:  64 (aligned 64)
UBI: data offset:128
UBI error: vtbl_check: volume table check failed: record 0, error 9
UBI error: ubi_init: cannot attach mtd2
UBI error: ubi_init: UBI error: cannot initialize UBI, error -22
UBI init error 22
Command failed, result=22


Hmm.. I thought to see something like this:

too large reserved_pebs %d, good PEBs %d

I am not familiar with this HW ... I think, you have to debug into it ...
Maybe Bo has an idea?


Did the ubi partition work under linux? Did you tried current ML
U-Boot (there MTD/UBI and UBIFS is synced with linux 3.15) ...


I haven't booted to Linux yet.  If I try to boot with the kernel that is in
the NOR flash then I get the following output from the console messages:

0.nor_flash: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID
0x89 Chip ID 0x00899a
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Using buffer write method
Using auto-unlock on power-up/resume
cfi_cmdset_0001: Erase suspend on write enabled
UBI error: ubi_init: UBI error: cannot initialize UBI, error -19


Hmm.. linux returns another error ...


Is there something that I need to do in order to tell U-Boot and the kernel
that the base address of the NOR flash device is 0x1000 rather than 0x0?


I don t know ... but it seems, the chip is detected, so the base addr
should be correct.

bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] UBI issues on SAMA5D31 NOR flash

2014-09-30 Thread Andy Pont
Hello Heiko,

 Hmm.. I thought to see something like this:
 
 too large reserved_pebs %d, good PEBs %d
 
 I am not familiar with this HW ... I think, you have to debug into it

Changing the dbg_err() to ubi_err() and also adding a bit more output then I
get:

UBI error: vtbl_check: reserved_pebs 81, ubi-good_peb_count 80
UBI error: vtbl_check: too large reserved_pebs, good PEBs 80

Use of UBI is new to me so where are the PEBs configured?

Thanks,

Andy.


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] UBI issues on SAMA5D31 NOR flash

2014-09-29 Thread Andy Pont
Hello,

Using the patches from Bo Shen to support the NOR flash on the Atmel
SAMA5D31EK hardware platform I am trying to get a UBI root file system
within the NOR flash, at offset 0x1000 in the memory map, to work but
get errors from the ubi part command using U-Boot 2014.04:

U-Boot mtdparts

device nor0 physmap-flash.0, # parts = 5
 #: namesizeoffset  mask_flags
 0: bootstrap   0x0002  0x  1
 1: u-boot  0x000c  0x0002  1
 2: fdt 0x0002  0x000e  0
 3: kernel  0x0040  0x0010  0
 4: rootfs  0x00a0  0x0050  0

active partition: nor0,0 - (bootstrap) 0x0002 @ 0x

defaults:
mtdids  : nor0=physmap-flash.0
mtdparts:
mtdparts=physmap-flash.0:128k(bootstrap)ro,768k(u-boot)ro,128k(fdt),4m(kerne
l),10m(rootfs)

U-Boot ubi part rootfs
UBI: attaching mtd2 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:130944 bytes
UBI: smallest flash I/O unit:1
UBI: VID header offset:  64 (aligned 64)
UBI: data offset:128
UBI error: vtbl_check: volume table check failed: record 0, error 9
UBI error: ubi_init: cannot attach mtd2
UBI error: ubi_init: UBI error: cannot initialize UBI, error -22
UBI init error 22

The UBI settings are:

(2048) Image Size
(130944) Logical Erase Block Size
(1)   Minimum I/O Size
[ ]   mkfs.ubifs Space Fixup   
()mkfs.ubifs Options

*** UBI Image Properties ***
[*]   Create UBI Volume 
(10MiB) Root File System Volume Size   
(128 KiB) Physical Erase Block Size  
(1) Sub-page Size
()  ubinize Configuration File   
()  ubinize Options

Any ideas as to what I have missed?

Thanks,

Andy.



___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] UBI issues on SAMA5D31 NOR flash

2014-09-29 Thread Heiko Schocher

Hello Andy,

Am 29.09.2014 18:40, schrieb Andy Pont:

Hello,

Using the patches from Bo Shen to support the NOR flash on the Atmel


which patches?


SAMA5D31EK hardware platform I am trying to get a UBI root file system
within the NOR flash, at offset 0x1000 in the memory map, to work but
get errors from the ubi part command using U-Boot 2014.04:

U-Boot  mtdparts

device nor0physmap-flash.0, # parts = 5
  #: namesizeoffset  mask_flags
  0: bootstrap   0x0002  0x  1
  1: u-boot  0x000c  0x0002  1
  2: fdt 0x0002  0x000e  0
  3: kernel  0x0040  0x0010  0
  4: rootfs  0x00a0  0x0050  0

active partition: nor0,0 - (bootstrap) 0x0002 @ 0x

defaults:
mtdids  : nor0=physmap-flash.0
mtdparts:
mtdparts=physmap-flash.0:128k(bootstrap)ro,768k(u-boot)ro,128k(fdt),4m(kerne
l),10m(rootfs)

U-Boot  ubi part rootfs
UBI: attaching mtd2 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:130944 bytes
UBI: smallest flash I/O unit:1
UBI: VID header offset:  64 (aligned 64)
UBI: data offset:128
UBI error: vtbl_check: volume table check failed: record 0, error 9


seems ubi does not find the volume table ... could you activate
ubi error messages ubi_err() ?


UBI error: ubi_init: cannot attach mtd2
UBI error: ubi_init: UBI error: cannot initialize UBI, error -22
UBI init error 22

The UBI settings are:

(2048) Image Size
(130944) Logical Erase Block Size
(1)   Minimum I/O Size
[ ]   mkfs.ubifs Space Fixup
()mkfs.ubifs Options

*** UBI Image Properties ***
[*]   Create UBI Volume
(10MiB) Root File System Volume Size
(128 KiB) Physical Erase Block Size
(1) Sub-page Size
()  ubinize Configuration File
()  ubinize Options

Any ideas as to what I have missed?


Did the ubi partition work under linux? Did you tried current ML
U-Boot (there MTD/UBI and UBIFS is synced with linux 3.15) ...

bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot