Re: [U-Boot] U-boot and UBI problem with vexpress board.

2015-03-30 Thread Heiko Schocher

Hello Marcin,

Am 29.03.2015 21:57, schrieb mar.krzeminski:

Hi,

It seem that I have found the root cause of the problem.


Good!


This board in qemu is set in this way, that device width is set to 2 and 
interface to 4.
That is why CFI driver in u-boot calculates wrongly sector size ( because size 
ratio variable was wrong ),
so in the end every odd sector (counting from 0 ) was not available.


Ah, ok...


I've changed vexpress board code in qemu and for now it is working.


Great.


I do not have real vexpress board to check if the root cause is u-boot or qemu,
but i think CFI driver i popular so propapbly there is something wrong in qemu 
site.


I don't know ... it would be nice to have this checked on a real hw...

bye,
Heiko
--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] U-boot and UBI problem with vexpress board.

2015-03-30 Thread mar.krzeminski

Hello Heiko,

I tried all people I know and unfortunately no one has this board.
If someone has this board here, it is very easy to check.
1. fli command returns number of sectors. Should be 256 sectors, in 
wrong case is 128.
Also sector addresses differs by 0x8 in wrong case, but should be 
0x4.

2. saveenv command fails if this bug is present.

Regards,
Marcin


W dniu 30.03.2015 o 08:05, Heiko Schocher pisze:

Hello Marcin,

Am 29.03.2015 21:57, schrieb mar.krzeminski:

Hi,

It seem that I have found the root cause of the problem.


Good!

This board in qemu is set in this way, that device width is set to 2 
and interface to 4.
That is why CFI driver in u-boot calculates wrongly sector size ( 
because size ratio variable was wrong ),

so in the end every odd sector (counting from 0 ) was not available.


Ah, ok...


I've changed vexpress board code in qemu and for now it is working.


Great.

I do not have real vexpress board to check if the root cause is 
u-boot or qemu,
but i think CFI driver i popular so propapbly there is something 
wrong in qemu site.


I don't know ... it would be nice to have this checked on a real hw...

bye,
Heiko


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


Re: [U-Boot] U-boot and UBI problem with vexpress board.

2015-03-30 Thread Heiko Schocher

Hello Marcin,

Am 30.03.2015 20:07, schrieb mar.krzeminski:

Hello Heiko,

I tried all people I know and unfortunately no one has this board.


:-(


If someone has this board here, it is very easy to check.
1. fli command returns number of sectors. Should be 256 sectors, in wrong case 
is 128.
Also sector addresses differs by 0x8 in wrong case, but should be 0x4.
2. saveenv command fails if this bug is present.


If saveenv also fails, I think, it is not an UBI problem.

bye,
Heiko


Regards,
Marcin


W dniu 30.03.2015 o 08:05, Heiko Schocher pisze:

Hello Marcin,

Am 29.03.2015 21:57, schrieb mar.krzeminski:

Hi,

It seem that I have found the root cause of the problem.


Good!


This board in qemu is set in this way, that device width is set to 2 and 
interface to 4.
That is why CFI driver in u-boot calculates wrongly sector size ( because size 
ratio variable was wrong ),
so in the end every odd sector (counting from 0 ) was not available.


Ah, ok...


I've changed vexpress board code in qemu and for now it is working.


Great.


I do not have real vexpress board to check if the root cause is u-boot or qemu,
but i think CFI driver i popular so propapbly there is something wrong in qemu 
site.


I don't know ... it would be nice to have this checked on a real hw...

bye,
Heiko





--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] U-boot and UBI problem with vexpress board.

2015-03-30 Thread Marcin Krzemiński
Hi Heiko,

I'm not stating that is ubi problem. I just found it playing with ubi.
It is in MTD driver, that is why I doubt it is related with u-boot at all,
but real check would be nice...

Regards,
Marcin

2015-03-31 7:24 GMT+02:00 Heiko Schocher h...@denx.de:

 Hello Marcin,

 Am 30.03.2015 20:07, schrieb mar.krzeminski:

 Hello Heiko,

 I tried all people I know and unfortunately no one has this board.


 :-(

  If someone has this board here, it is very easy to check.
 1. fli command returns number of sectors. Should be 256 sectors, in wrong
 case is 128.
 Also sector addresses differs by 0x8 in wrong case, but should be
 0x4.
 2. saveenv command fails if this bug is present.


 If saveenv also fails, I think, it is not an UBI problem.

 bye,
 Heiko


 Regards,
 Marcin


 W dniu 30.03.2015 o 08:05, Heiko Schocher pisze:

 Hello Marcin,

 Am 29.03.2015 21:57, schrieb mar.krzeminski:

 Hi,

 It seem that I have found the root cause of the problem.


 Good!

  This board in qemu is set in this way, that device width is set to 2
 and interface to 4.
 That is why CFI driver in u-boot calculates wrongly sector size (
 because size ratio variable was wrong ),
 so in the end every odd sector (counting from 0 ) was not available.


 Ah, ok...

  I've changed vexpress board code in qemu and for now it is working.


 Great.

  I do not have real vexpress board to check if the root cause is u-boot
 or qemu,
 but i think CFI driver i popular so propapbly there is something wrong
 in qemu site.


 I don't know ... it would be nice to have this checked on a real hw...

 bye,
 Heiko




 --
 DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
 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] U-boot and UBI problem with vexpress board.

2015-03-29 Thread Heiko Schocher

Hello Marcin,

Am 27.03.2015 16:53, schrieb mar.krzeminski:

Hi Stefan,

I've changed malloc pool size to 2MiB and nothing changed.
I've also disabled UBIFS support and that does not make any changes.
Still after qemu restart u-boot can not attach to ubi device.


Hmm.. hard to say, can you enable debug (not only in UBI) and
maybe try current mainline U-Boot?

The line UBI error: vtbl_check: bad CRC at record 0: 0x88cdfb6, not 0x
... it seems, you have some problems reading your flash ... can
you try a to write into your flash, reread the content and
compare it?

Thanks!

bye,
Heiko


Regards,
Marcin

W dniu 27.03.2015 o 16:01, Stefan Roese pisze:

Hi Marcin,

On 27.03.2015 13:59, Marcin Krzemiński wrote:

I want to test some UBI fs behavior in U-Boot using qemu and vexpress_ca9x4
board ( U-Boot 2015.1)
To tst UBI I added lines to vexpress_ca9x4.h:

#define CONFIG_MTD_DEVICE   /* needed for mtdparts commands */
#define CONFIG_MTD_PARTITIONS   /* needed for UBI */
#define CONFIG_FLASH_CFI_MTD
#define MTDIDS_DEFAULT  nor0=flash0-0
#define MTDPARTS_DEFAULT mtdparts=flash0-0:1m(empty),10m(ubi),-(rest)
#define CONFIG_LZO  /* needed for UBI */
#define CONFIG_RBTREE   /* needed for UBI */
#define CONFIG_CMD_MTDPARTS
#define CONFIG_CMD_UBI
#define CONFIG_CMD_UBIFS
#define CONFIG_FIT

also I've changed malloc pool size to 512kB in vexpress_common.h:
#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 512 * 1024)


Without looking deeper into your mail, I would recommend to increase the malloc 
size to at least 2MiB and test again.

Thanks,
Stefan




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


--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] U-boot and UBI problem with vexpress board.

2015-03-29 Thread mar.krzeminski

Hi,

It seem that I have found the root cause of the problem.
This board in qemu is set in this way, that device width is set to 2 and 
interface to 4.
That is why CFI driver in u-boot calculates wrongly sector size ( 
because size ratio variable was wrong ),

so in the end every odd sector (counting from 0 ) was not available.
I've changed vexpress board code in qemu and for now it is working.
I do not have real vexpress board to check if the root cause is u-boot 
or qemu,
but i think CFI driver i popular so propapbly there is something wrong 
in qemu site.


Regards,
Marcin


W dniu 27.03.2015 o 16:53, mar.krzeminski pisze:

Hi Stefan,

I've changed malloc pool size to 2MiB and nothing changed.
I've also disabled UBIFS support and that does not make any changes.
Still after qemu restart u-boot can not attach to ubi device.

Regards,
Marcin

W dniu 27.03.2015 o 16:01, Stefan Roese pisze:

Hi Marcin,

On 27.03.2015 13:59, Marcin Krzemiński wrote:
I want to test some UBI fs behavior in U-Boot using qemu and 
vexpress_ca9x4

board ( U-Boot 2015.1)
To tst UBI I added lines to vexpress_ca9x4.h:

#define CONFIG_MTD_DEVICE   /* needed for mtdparts commands */
#define CONFIG_MTD_PARTITIONS   /* needed for UBI */
#define CONFIG_FLASH_CFI_MTD
#define MTDIDS_DEFAULT  nor0=flash0-0
#define MTDPARTS_DEFAULT mtdparts=flash0-0:1m(empty),10m(ubi),-(rest)
#define CONFIG_LZO  /* needed for UBI */
#define CONFIG_RBTREE   /* needed for UBI */
#define CONFIG_CMD_MTDPARTS
#define CONFIG_CMD_UBI
#define CONFIG_CMD_UBIFS
#define CONFIG_FIT

also I've changed malloc pool size to 512kB in vexpress_common.h:
#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 512 * 1024)


Without looking deeper into your mail, I would recommend to increase 
the malloc size to at least 2MiB and test again.


Thanks,
Stefan






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


[U-Boot] U-boot and UBI problem with vexpress board.

2015-03-27 Thread Marcin Krzemiński
Hi,

I want to test some UBI fs behavior in U-Boot using qemu and vexpress_ca9x4
board ( U-Boot 2015.1)
To tst UBI I added lines to vexpress_ca9x4.h:

#define CONFIG_MTD_DEVICE   /* needed for mtdparts commands */
#define CONFIG_MTD_PARTITIONS   /* needed for UBI */
#define CONFIG_FLASH_CFI_MTD
#define MTDIDS_DEFAULT  nor0=flash0-0
#define MTDPARTS_DEFAULTmtdparts=flash0-0:1m(empty),10m(ubi),-(rest)
#define CONFIG_LZO  /* needed for UBI */
#define CONFIG_RBTREE   /* needed for UBI */
#define CONFIG_CMD_MTDPARTS
#define CONFIG_CMD_UBI
#define CONFIG_CMD_UBIFS
#define CONFIG_FIT

also I've changed malloc pool size to 512kB in vexpress_common.h:
#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 512 * 1024)

Also I enabled debugs in UBI and MTD driver

I'm running my test commands like that:
qemu-system-arm -M vexpress-a9 -kernel u-boot -m 1024M -nographic -pflash
flash1.bin -pflash flash2.bin
Than in u-boot console:
mtd default
ubi part ubi

results are:

UBI: attaching mtd2 to ubi0
UBI: scanning is finished
UBI: empty MTD device detected
UBI: attached mtd2 (name mtd=1, size 10 MiB) to ubi0
UBI: PEB size: 524288 bytes (512 KiB), LEB size: 524160 bytes
UBI: min./max. I/O unit sizes: 1/1, sub-page size 1
UBI: VID header offset: 64 (aligned 64), data offset: 128
UBI: good PEBs: 20, bad PEBs: 0, corrupted PEBs: 0
UBI: user volume: 0, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 1/0, WL threshold: 4096, image sequence
number: 0
UBI: available PEBs: 16, total reserved PEBs: 4, PEBs reserved for bad PEB
handling: 0

So it is ok flash was empty (file wit only ff's).

I am quting qemu, starting it again ant now I can not mount ubi.
Logs are here:
UBI: attaching mtd2 to ubi0
UBI: scanning is finished
UBI error: vtbl_check: bad CRC at record 0: 0x88cdfb6, not 0x
UBI error: vtbl_check: bad CRC at record 0: 0x88cdfb6, not 0x
UBI error: process_lvol: both volume tables are corrupted
UBI error: ubi_attach_mtd_dev: failed to attach mtd2, error -22
UBI error: ubi_init: cannot attach mtd2
UBI error: ubi_init: cannot initialize UBI, error -22
ubi_init
UBI init error 22

In flash imgae besides UBI! and UBI# headers I've got some other written
sectors in this partition, is that ok?
I thing i should have only those two headers ant their copy at this staete.
I also thing about changing pool size, maybe there is something wrong with
SP and that is why I've got this strange behaviour?
I've tested qemu flash emulation, and all seems to work fine (writing and
reading after reboots).

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


Re: [U-Boot] U-boot and UBI problem with vexpress board.

2015-03-27 Thread Stefan Roese

Hi Marcin,

On 27.03.2015 13:59, Marcin Krzemiński wrote:

I want to test some UBI fs behavior in U-Boot using qemu and vexpress_ca9x4
board ( U-Boot 2015.1)
To tst UBI I added lines to vexpress_ca9x4.h:

#define CONFIG_MTD_DEVICE   /* needed for mtdparts commands */
#define CONFIG_MTD_PARTITIONS   /* needed for UBI */
#define CONFIG_FLASH_CFI_MTD
#define MTDIDS_DEFAULT  nor0=flash0-0
#define MTDPARTS_DEFAULTmtdparts=flash0-0:1m(empty),10m(ubi),-(rest)
#define CONFIG_LZO  /* needed for UBI */
#define CONFIG_RBTREE   /* needed for UBI */
#define CONFIG_CMD_MTDPARTS
#define CONFIG_CMD_UBI
#define CONFIG_CMD_UBIFS
#define CONFIG_FIT

also I've changed malloc pool size to 512kB in vexpress_common.h:
#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 512 * 1024)


Without looking deeper into your mail, I would recommend to increase the 
malloc size to at least 2MiB and test again.


Thanks,
Stefan

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


Re: [U-Boot] U-boot and UBI problem with vexpress board.

2015-03-27 Thread mar.krzeminski

Hi Stefan,

I've changed malloc pool size to 2MiB and nothing changed.
I've also disabled UBIFS support and that does not make any changes.
Still after qemu restart u-boot can not attach to ubi device.

Regards,
Marcin

W dniu 27.03.2015 o 16:01, Stefan Roese pisze:

Hi Marcin,

On 27.03.2015 13:59, Marcin Krzemiński wrote:
I want to test some UBI fs behavior in U-Boot using qemu and 
vexpress_ca9x4

board ( U-Boot 2015.1)
To tst UBI I added lines to vexpress_ca9x4.h:

#define CONFIG_MTD_DEVICE   /* needed for mtdparts commands */
#define CONFIG_MTD_PARTITIONS   /* needed for UBI */
#define CONFIG_FLASH_CFI_MTD
#define MTDIDS_DEFAULT  nor0=flash0-0
#define MTDPARTS_DEFAULT mtdparts=flash0-0:1m(empty),10m(ubi),-(rest)
#define CONFIG_LZO  /* needed for UBI */
#define CONFIG_RBTREE   /* needed for UBI */
#define CONFIG_CMD_MTDPARTS
#define CONFIG_CMD_UBI
#define CONFIG_CMD_UBIFS
#define CONFIG_FIT

also I've changed malloc pool size to 512kB in vexpress_common.h:
#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 512 * 1024)


Without looking deeper into your mail, I would recommend to increase 
the malloc size to at least 2MiB and test again.


Thanks,
Stefan




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


Re: [U-Boot] U-Boot, dm, ubi: struct device is declared twice

2014-05-05 Thread Simon Glass
Hi Heiko,

On 4 May 2014 23:55, Heiko Schocher h...@denx.de wrote:
 Hello Simon,

 Am 02.05.2014 16:29, schrieb Simon Glass:

 Hi,

 On 2 May 2014 01:16, Heiko Schocherh...@denx.de  wrote:

 Hello Marek,

 Am 02.05.2014 08:06, schrieb Marek Vasut:

 On Friday, May 02, 2014 at 07:19:01 AM, Heiko Schocher wrote:


 Hello Simon, Marek,

 just updating to current mainline code and defining
 CONFIG_SYS_GENERIC_BOARD pops up the following error:

 CC  common/board_r.o
 In file included from include/linux/mtd/flashchip.h:21:0,
 from include/linux/mtd/nand.h:31,
 from include/nand.h:39,
 from common/board_r.c:40:
 include/ubi_uboot.h:202:8: error: redefinition of 'struct device'
 struct device {
^
 In file included from include/dm.h:10:0,
 from common/board_r.c:21:
 include/dm/device.h:56:8: note: originally defined here
 struct device {
^
 make[1]: *** [common/board_r.o] Fehler 1
 make: *** [common] Fehler 2
 pollux:u-boot hs [20140502] $

 for a not yet mainlined imx6 board using UBI/UBIFS on nand. I am
 currently sync current Linux MTD/UBI and UBIFS code to U-Boot, but
 I think this error should pop up for all boards using DM and UBI ...



 In the ideal case, we should use the same struct device for both UBI and
 DM, but



 Yes, that was also my first thought ...


 we cannot do that. Thus, renaming the DM struct device would be the best
 option
 for now.



 Ok. I prepare a patch for this.


 Linux also has struct device, so I wondered how it avoids this problem
 and took a look.


 Yes, the MTD/UBI and UBIFS subsystem is Code from Linux and it uses
 the linux struct device. I wonder, how DM and UBI compile together.

 Is this tried somewhere?

Not yet, but it sounds like we are hitting the problem now.


 (As I see drivers/usb/musb-new uses also struct device ...)


 This header file seems like a special thing for U-Boot - I wonder if


 Yes, it includes some missing defines, structs for the UBI Subsystem,
 so we could use Linux Code ... but we have also include/linux/compat.h
 for this ... Maybe it is worth to delete this include/ubi_uboot.h
 and move the missing symbols to include/linux/compat.h?


 it would be better to use #define at the top of the C file for the


 Yes, I thought about this too ...

 The UBI subsystem in U-Boot has defined UBI_LINUX instead of
 __UBOOT__ ... which surprised me too.

  maybe I prepare such a change (delete UBI_LINUX and use
 __UBOOT__) for the new sync with current Linux MTD/UBI and UBIFS
 layer?


 compatibility stuff (#define device ubi_device) rather than modify dm?


 Hmm... I can try this ... but I am not really happy to have
 such a define.

Me neither, but the justification is that we are trying to make
incompatible code work with minimal changes.



 It does seem very strange to me, particularly as from what I can tell,
 struct device is just a cut down version of the Linux struct.


 Wouldn;t it be better to move this to include/linux/device.h then?

 Looking in U-Boot:include/dm/device.h struct device:

 struct device {
 *struct driver *driver;
 *const char *name;
 *void *platdata;
 *int of_offset;
 struct device *parent;
 *void *priv;
 *struct uclass *uclass;
 *void *uclass_priv;
 *struct list_head uclass_node;
 *struct list_head child_head;
 *struct list_head sibling_node;
 *uint32_t flags;
 };

 All * are different to current mainline linux or not in it ...
 so I prefer first to rename the DM struct device into for example
 struct u_device ... Maybe we can sync them once with the linux
 struct device

OK, I prefer not to do this, since we are renaming U-Boot files to
make Linux source work in the U-Boot tree. But this is not my decision
and it may be a more widespread problem in the future. So if you think
this is better, how about udevice? You will then need to rename all
the APIs.

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


Re: [U-Boot] U-Boot, dm, ubi: struct device is declared twice

2014-05-04 Thread Heiko Schocher

Hello Simon,

Am 02.05.2014 16:29, schrieb Simon Glass:

Hi,

On 2 May 2014 01:16, Heiko Schocherh...@denx.de  wrote:

Hello Marek,

Am 02.05.2014 08:06, schrieb Marek Vasut:


On Friday, May 02, 2014 at 07:19:01 AM, Heiko Schocher wrote:


Hello Simon, Marek,

just updating to current mainline code and defining
CONFIG_SYS_GENERIC_BOARD pops up the following error:

CC  common/board_r.o
In file included from include/linux/mtd/flashchip.h:21:0,
from include/linux/mtd/nand.h:31,
from include/nand.h:39,
from common/board_r.c:40:
include/ubi_uboot.h:202:8: error: redefinition of 'struct device'
struct device {
   ^
In file included from include/dm.h:10:0,
from common/board_r.c:21:
include/dm/device.h:56:8: note: originally defined here
struct device {
   ^
make[1]: *** [common/board_r.o] Fehler 1
make: *** [common] Fehler 2
pollux:u-boot hs [20140502] $

for a not yet mainlined imx6 board using UBI/UBIFS on nand. I am
currently sync current Linux MTD/UBI and UBIFS code to U-Boot, but
I think this error should pop up for all boards using DM and UBI ...



In the ideal case, we should use the same struct device for both UBI and
DM, but



Yes, that was also my first thought ...



we cannot do that. Thus, renaming the DM struct device would be the best
option
for now.



Ok. I prepare a patch for this.


Linux also has struct device, so I wondered how it avoids this problem
and took a look.


Yes, the MTD/UBI and UBIFS subsystem is Code from Linux and it uses
the linux struct device. I wonder, how DM and UBI compile together.

Is this tried somewhere?

(As I see drivers/usb/musb-new uses also struct device ...)


This header file seems like a special thing for U-Boot - I wonder if


Yes, it includes some missing defines, structs for the UBI Subsystem,
so we could use Linux Code ... but we have also include/linux/compat.h
for this ... Maybe it is worth to delete this include/ubi_uboot.h
and move the missing symbols to include/linux/compat.h?


it would be better to use #define at the top of the C file for the


Yes, I thought about this too ...

The UBI subsystem in U-Boot has defined UBI_LINUX instead of
__UBOOT__ ... which surprised me too.

 maybe I prepare such a change (delete UBI_LINUX and use
__UBOOT__) for the new sync with current Linux MTD/UBI and UBIFS
layer?


compatibility stuff (#define device ubi_device) rather than modify dm?


Hmm... I can try this ... but I am not really happy to have
such a define.


It does seem very strange to me, particularly as from what I can tell,
struct device is just a cut down version of the Linux struct.


Wouldn;t it be better to move this to include/linux/device.h then?

Looking in U-Boot:include/dm/device.h struct device:

struct device {
*struct driver *driver;
*const char *name;
*void *platdata;
*int of_offset;
struct device *parent;
*void *priv;
*struct uclass *uclass;
*void *uclass_priv;
*struct list_head uclass_node;
*struct list_head child_head;
*struct list_head sibling_node;
*uint32_t flags;
};

All * are different to current mainline linux or not in it ...
so I prefer first to rename the DM struct device into for example
struct u_device ... Maybe we can sync them once with the linux
struct device

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] U-Boot, dm, ubi: struct device is declared twice

2014-05-02 Thread Marek Vasut
On Friday, May 02, 2014 at 07:19:01 AM, Heiko Schocher wrote:
 Hello Simon, Marek,
 
 just updating to current mainline code and defining
 CONFIG_SYS_GENERIC_BOARD pops up the following error:
 
   CC  common/board_r.o
 In file included from include/linux/mtd/flashchip.h:21:0,
   from include/linux/mtd/nand.h:31,
   from include/nand.h:39,
   from common/board_r.c:40:
 include/ubi_uboot.h:202:8: error: redefinition of 'struct device'
   struct device {
  ^
 In file included from include/dm.h:10:0,
   from common/board_r.c:21:
 include/dm/device.h:56:8: note: originally defined here
   struct device {
  ^
 make[1]: *** [common/board_r.o] Fehler 1
 make: *** [common] Fehler 2
 pollux:u-boot hs [20140502] $
 
 for a not yet mainlined imx6 board using UBI/UBIFS on nand. I am
 currently sync current Linux MTD/UBI and UBIFS code to U-Boot, but
 I think this error should pop up for all boards using DM and UBI ...

In the ideal case, we should use the same struct device for both UBI and DM, 
but 
we cannot do that. Thus, renaming the DM struct device would be the best option 
for now.

btw. are you syncing the UBI/UBIFS code from mainline into U-Boot now ? Can you 
keep me posted on patches please ?

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] U-Boot, dm, ubi: struct device is declared twice

2014-05-02 Thread Heiko Schocher

Hello Marek,

Am 02.05.2014 08:06, schrieb Marek Vasut:

On Friday, May 02, 2014 at 07:19:01 AM, Heiko Schocher wrote:

Hello Simon, Marek,

just updating to current mainline code and defining
CONFIG_SYS_GENERIC_BOARD pops up the following error:

   CC  common/board_r.o
In file included from include/linux/mtd/flashchip.h:21:0,
   from include/linux/mtd/nand.h:31,
   from include/nand.h:39,
   from common/board_r.c:40:
include/ubi_uboot.h:202:8: error: redefinition of 'struct device'
   struct device {
  ^
In file included from include/dm.h:10:0,
   from common/board_r.c:21:
include/dm/device.h:56:8: note: originally defined here
   struct device {
  ^
make[1]: *** [common/board_r.o] Fehler 1
make: *** [common] Fehler 2
pollux:u-boot hs [20140502] $

for a not yet mainlined imx6 board using UBI/UBIFS on nand. I am
currently sync current Linux MTD/UBI and UBIFS code to U-Boot, but
I think this error should pop up for all boards using DM and UBI ...


In the ideal case, we should use the same struct device for both UBI and DM, but


Yes, that was also my first thought ...


we cannot do that. Thus, renaming the DM struct device would be the best option
for now.


Ok. I prepare a patch for this.


btw. are you syncing the UBI/UBIFS code from mainline into U-Boot now ? Can you
keep me posted on patches please ?


Yes and Yes I can add you to cc.
(Currently MTD and UBI works on one board, now testing UBIFS ... after
this I want to test it on some more boards ...)

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] U-Boot, dm, ubi: struct device is declared twice

2014-05-02 Thread Simon Glass
Hi,

On 2 May 2014 01:16, Heiko Schocher h...@denx.de wrote:
 Hello Marek,

 Am 02.05.2014 08:06, schrieb Marek Vasut:

 On Friday, May 02, 2014 at 07:19:01 AM, Heiko Schocher wrote:

 Hello Simon, Marek,

 just updating to current mainline code and defining
 CONFIG_SYS_GENERIC_BOARD pops up the following error:

CC  common/board_r.o
 In file included from include/linux/mtd/flashchip.h:21:0,
from include/linux/mtd/nand.h:31,
from include/nand.h:39,
from common/board_r.c:40:
 include/ubi_uboot.h:202:8: error: redefinition of 'struct device'
struct device {
   ^
 In file included from include/dm.h:10:0,
from common/board_r.c:21:
 include/dm/device.h:56:8: note: originally defined here
struct device {
   ^
 make[1]: *** [common/board_r.o] Fehler 1
 make: *** [common] Fehler 2
 pollux:u-boot hs [20140502] $

 for a not yet mainlined imx6 board using UBI/UBIFS on nand. I am
 currently sync current Linux MTD/UBI and UBIFS code to U-Boot, but
 I think this error should pop up for all boards using DM and UBI ...


 In the ideal case, we should use the same struct device for both UBI and
 DM, but


 Yes, that was also my first thought ...


 we cannot do that. Thus, renaming the DM struct device would be the best
 option
 for now.


 Ok. I prepare a patch for this.

Linux also has struct device, so I wondered how it avoids this problem
and took a look.

This header file seems like a special thing for U-Boot - I wonder if
it would be better to use #define at the top of the C file for the
compatibility stuff (#define device ubi_device) rather than modify dm?
It does seem very strange to me, particularly as from what I can tell,
struct device is just a cut down version of the Linux struct.

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


[U-Boot] U-Boot, dm, ubi: struct device is declared twice

2014-05-01 Thread Heiko Schocher

Hello Simon, Marek,

just updating to current mainline code and defining
CONFIG_SYS_GENERIC_BOARD pops up the following error:

 CC  common/board_r.o
In file included from include/linux/mtd/flashchip.h:21:0,
 from include/linux/mtd/nand.h:31,
 from include/nand.h:39,
 from common/board_r.c:40:
include/ubi_uboot.h:202:8: error: redefinition of 'struct device'
 struct device {
^
In file included from include/dm.h:10:0,
 from common/board_r.c:21:
include/dm/device.h:56:8: note: originally defined here
 struct device {
^
make[1]: *** [common/board_r.o] Fehler 1
make: *** [common] Fehler 2
pollux:u-boot hs [20140502] $

for a not yet mainlined imx6 board using UBI/UBIFS on nand. I am
currently sync current Linux MTD/UBI and UBIFS code to U-Boot, but
I think this error should pop up for all boards using DM and UBI ...

How to solve this double named struct? I do not want to change this
in Linux code as struct device is very much used, and this would
be a maintaining nightmare for future syncs with linux code.

Should we rename the DM struct device in include/dm/device.h ?

diff --git a/include/dm/device.h b/include/dm/device.h
index 4cd38ed..ba9f128 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -24,7 +24,7 @@ struct driver_info;
 #define DM_FLAG_ALLOC_PDATA(2  0)

 /**
- * struct device - An instance of a driver
+ * struct dm_device - An instance of a driver
  *
  * This holds information about a device, which is a driver bound to a
  * particular port or peripheral (essentially a driver instance).
@@ -53,12 +53,12 @@ struct driver_info;
  * @sibling_node: Next device in list of all devices
  * @flags: Flags for this device DM_FLAG_...
  */
-struct device {
+struct dm_device {

What do you think?

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] U-Boot, dm, ubi: struct device is declared twice

2014-05-01 Thread Wolfgang Denk
Dear Heiko,

In message 53632ac5.1030...@denx.de you wrote:
 
 How to solve this double named struct? I do not want to change this
 in Linux code as struct device is very much used, and this would
 be a maintaining nightmare for future syncs with linux code.
 
 Should we rename the DM struct device in include/dm/device.h ?
...
 - * struct device - An instance of a driver
 + * struct dm_device - An instance of a driver

I agree that we should keep U-Boot code as compatible with Linux as
possible, i. e. I would suggest to rename our U-Boot struct.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
If I had to live my life again,  I'd  make  the  same  mistakes, only
sooner.  -- Tallulah Bankhead
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] u-boot and UBI

2011-09-12 Thread Detlev Zundel
Hi edm,

 Is there any way to access the Linux UBI file system from a u-boot shell?

If the binary was compiled with the relevant options, you surely can
read from them - cf. doc/README.ubi and common/cmd_ubifs.c

Cheers
  Detlev

-- 
You see, the best way to solve a problem is to rigorously define it in
terms of other people's problems, and then run away quickly.
  -- Roland McGrath
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] u-boot and UBI

2011-09-09 Thread ed in 92626
Hello,

Is there any way to access the Linux UBI file system from a u-boot shell?

Thank You.

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


Re: [U-Boot] U-Boot and UBI

2008-08-13 Thread Josh Boyer
On Wed, 2008-08-13 at 08:34 +0900, Kyungmin Park wrote:
 Hi,
 
 On Tue, Aug 12, 2008 at 8:11 PM, Stefan Roese [EMAIL PROTECTED] wrote:
  On Tuesday 12 August 2008, Kyungmin Park wrote:
   On Monday 11 August 2008, Kyungmin Park wrote:
   Actually the Samsung implemented the UBI support on U-boot already and
   has used it internally. The big difference is the code base. It's
   based on kernel UBI code. Yes it's not fit well to u-boot ecosystem so
   it created the ubi wrapper for u-boot.
  
   And how does NAND/OneNAND booting with UBI support fit into this? I
   assume that you have some size restrictions for the IPL/SPL on your
   platforms as well.
 
  It's not yet covered. it's TODO
 
  I see.
 
 
 Yes, we should make a u-boot within one block size since flash only
 guarantees the first one block as bad block free. e.g., exactly
 (128KiB - 2KiB) size if OneNAND case.
 For this, we need to code or size optimization.
 If this is solved, we can use flash as bad block free device with UBI.

An alternative to that is to have a very small IPL that loads U-Boot to
DRAM as the SPL.  That would require some relocatable support in U-Boot.

josh

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


Re: [U-Boot] U-Boot and UBI

2008-08-12 Thread Kyungmin Park
Hi,

On Tue, Aug 12, 2008 at 8:11 PM, Stefan Roese [EMAIL PROTECTED] wrote:
 On Tuesday 12 August 2008, Kyungmin Park wrote:
  On Monday 11 August 2008, Kyungmin Park wrote:
  Actually the Samsung implemented the UBI support on U-boot already and
  has used it internally. The big difference is the code base. It's
  based on kernel UBI code. Yes it's not fit well to u-boot ecosystem so
  it created the ubi wrapper for u-boot.
 
  And how does NAND/OneNAND booting with UBI support fit into this? I
  assume that you have some size restrictions for the IPL/SPL on your
  platforms as well.

 It's not yet covered. it's TODO

 I see.


Yes, we should make a u-boot within one block size since flash only
guarantees the first one block as bad block free. e.g., exactly
(128KiB - 2KiB) size if OneNAND case.
For this, we need to code or size optimization.
If this is solved, we can use flash as bad block free device with UBI.

Also there are some issues related with ubi partitioning.

It's just rough ideas. For make a system as reasonable it creates two
UBI devices, one for boot-loader and another for kernel. If we make
only one UBI device, we should read whole flash blocks to read kernel.
but it's not reasonable.

1. UBI image for bootloader.
boot params (rw), kernel(ro), [Optional] initrd (ro)

Even though it has r/w area, we regards it as static volume for
performance since boot params almost read only. I think If UBI has
only static volumes we can optimize it more. we don't need to mirror
layout volume. no wear leveling and so on. For this, of course, we
need special handling for boot params.

2. UBI image for kernel.
rootfs(ro/rw), datafs(rw), and others(??)

Feel free, you make it for your purposes.

Thank you,
Kyungmin Park
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] U-Boot and UBI

2008-08-11 Thread Stefan Roese
On Monday 11 August 2008, Kyungmin Park wrote:
 Actually the Samsung implemented the UBI support on U-boot already and
 has used it internally. The big difference is the code base. It's
 based on kernel UBI code. Yes it's not fit well to u-boot ecosystem so
 it created the ubi wrapper for u-boot.

And how does NAND/OneNAND booting with UBI support fit into this? I assume 
that you have some size restrictions for the IPL/SPL on your platforms as 
well.

snip

 I want to know what's the better way if there are two code bases.

 Please give any options and comments

As Josh already mentioned, your version might be better suited as a basis for 
mainline inclusion because its more feature complete and probably is for a 
newer U-Boot version.

So best would be to publish your UBI support too, then we can compare and 
decide where to go.

 Thank you,
 Kyungmin Park

 P.S., we will post the patches ASAP

Do you have a rough idea when you could publish your patches?

Thanks.

Best regards,
Stefan

=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: [EMAIL PROTECTED]
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] U-Boot and UBI

2008-08-08 Thread Josh Boyer
Hi All,

As has been stated before by various people, IBM has added some form of
UBI support to an older version of U-Boot.  While we would love to be
able to forward port this to the latest version of U-Boot, we have
simply not found the time and don't see that being the case in the near
future.

So as an alternative, I have cleaned up the code slightly and pushed out
a version that applies to U-Boot 1.1.6.  This way there is at least some
form of code release that people can use as a reference.  I am not
pushing this for inclusion into the current U-Boot, as we are well aware
of the need for further adaptation and cleanup.

A few caveats:

- This is a quick forward port from a patched 1.1.4 tree to 1.1.6.  It
compiles for the example board (PowerPC 440EP Bamboo), but that example
code may not actually work due to the differences in how flash was read
between the code bases.  When moving to a newer U-Boot, I highly
recommend using the generic MTD interfaces.

- There might be slight differences in the UBI format that this code
base supports and what is in the upstream Linux kernel.  Comparison of
the data structures in the current kernel would be advised if you are
forward porting.

- There is no write support for UBI in this port.

- The interfaces have two methods of getting scan information.  The
first is having a bit of code that runs before U-Boot do the scan and
pass it.  The second is to have a user/script use the ubiscan command
to have U-Boot manually perform the scan itself.  The latter method is
likely more flexible for new boards.

All of that being said, we hope this code is useful as a guide.  I will
certainly answer questions as I can.  If for some unknown reason I find
a massive amount of spare time, I might even try to forward port it, but
that seems unlikely these days.

I would like to thank Frank Haverkamp, Thomas Gleixner, Andreas Arnez,
and Artem Bityutskiy for their work on UBI and the majority of the
U-Boot code we have.

The git tree can be found here:

git fetch git://git.infradead.org/users/jwboyer/u-boot.git ubi

http://git.infradead.org/users/jwboyer/u-boot.git?a=shortlog;h=refs/heads/ubi

josh

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


Re: [U-Boot] U-Boot and UBI

2008-08-08 Thread Wolfgang Denk
Dear Josh,

in message [EMAIL PROTECTED] you wrote:
 
 As has been stated before by various people, IBM has added some form of
 UBI support to an older version of U-Boot.  While we would love to be
 able to forward port this to the latest version of U-Boot, we have
 simply not found the time and don't see that being the case in the near
 future.
 
 So as an alternative, I have cleaned up the code slightly and pushed out
 a version that applies to U-Boot 1.1.6.  This way there is at least some
 form of code release that people can use as a reference.  I am not
 pushing this for inclusion into the current U-Boot, as we are well aware
 of the need for further adaptation and cleanup.
...
 The git tree can be found here:
 
 git fetch git://git.infradead.org/users/jwboyer/u-boot.git ubi
 
 http://git.infradead.org/users/jwboyer/u-boot.git?a=shortlog;h=refs/heads/ubi

Thanks a lot.

I guess we will pick up this work ASAP.

If anybody else has intentions to work in this area, I'd appreciate if
you contact me so we can coordinate efforts.

Thanks again.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
Lead me not into temptation... I can find it myself.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot