mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* barebox image size
@ 2012-07-16  8:37 christian.buettner
  2012-07-16  8:54 ` Sascha Hauer
  0 siblings, 1 reply; 17+ messages in thread
From: christian.buettner @ 2012-07-16  8:37 UTC (permalink / raw)
  To: barebox


[-- Attachment #1.1: Type: text/plain, Size: 348 bytes --]

hi,

we need to implement a lot of features into the barebox. Finally the size 
of the image will be bigger than the standard max of 256K.
When i flash an image, bigger than 256K to nand, barebox does not boot 
anymore - if i reduce it to 256K or smaller, everthing works fine.

What do i have to do to use a bigger barebox image size?

- christian

[-- Attachment #1.2: Type: text/html, Size: 564 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

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

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

* Re: barebox image size
  2012-07-16  8:37 barebox image size christian.buettner
@ 2012-07-16  8:54 ` Sascha Hauer
  2012-07-16  9:15   ` Antwort: " christian.buettner
  0 siblings, 1 reply; 17+ messages in thread
From: Sascha Hauer @ 2012-07-16  8:54 UTC (permalink / raw)
  To: christian.buettner; +Cc: barebox

On Mon, Jul 16, 2012 at 10:37:41AM +0200, christian.buettner@rafi.de wrote:
> hi,
> 
> we need to implement a lot of features into the barebox. Finally the size 
> of the image will be bigger than the standard max of 256K.
> When i flash an image, bigger than 256K to nand, barebox does not boot 
> anymore - if i reduce it to 256K or smaller, everthing works fine.
> 
> What do i have to do to use a bigger barebox image size?

Just a guess:

You are using imx_nand_load_image() with a fixed size of 256k. grep for
this function in the current tree and see how the correct image size is
calculated.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

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

* Antwort: Re: barebox image size
  2012-07-16  8:54 ` Sascha Hauer
@ 2012-07-16  9:15   ` christian.buettner
  2012-07-16  9:20     ` Eric Bénard
  2012-07-16  9:21     ` Antwort: " Sascha Hauer
  0 siblings, 2 replies; 17+ messages in thread
From: christian.buettner @ 2012-07-16  9:15 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox


[-- Attachment #1.1: Type: text/plain, Size: 2267 bytes --]

i am using:

static inline struct device_d *imx53_add_nand(struct 
imx_nand_platform_data *pdata)
{
        struct resource res[] = {
                {
                        .start = MX53_NFC_BASE_ADDR,
                        .size = SZ_4K,
                        .flags = IORESOURCE_MEM,
                }, {
                        .start = MX53_NFC_AXI_BASE_ADDR,
                        .size = SZ_4K,
                        .flags = IORESOURCE_MEM,
                },
        };
        struct device_d *dev = xzalloc(sizeof(*dev));

        dev->resource = xzalloc(sizeof(struct resource) * 
ARRAY_SIZE(res));
        memcpy(dev->resource, res, sizeof(struct resource) * 
ARRAY_SIZE(res));
        dev->num_resources = ARRAY_SIZE(res);
        strcpy(dev->name, "imx_nand");
        dev->id = -1;
        dev->platform_data = pdata;

        register_device(dev);

        return dev;
}

with imx_nand_platform_data parameter:
static struct imx_nand_platform_data tx53_nand_pdata =
{
    .width      = 1,
    .hw_ecc     = 1,
    .flash_bbt  = 1,
};

imx_nand_load_image() is never used in my imx53 board init code.. is this 
the fault?

- christian



Von:    Sascha Hauer <s.hauer@pengutronix.de>
An:     christian.buettner@rafi.de, 
Kopie:  barebox@lists.infradead.org
Datum:  16.07.2012 10:54
Betreff:        Re: barebox image size



On Mon, Jul 16, 2012 at 10:37:41AM +0200, christian.buettner@rafi.de 
wrote:
> hi,
> 
> we need to implement a lot of features into the barebox. Finally the 
size 
> of the image will be bigger than the standard max of 256K.
> When i flash an image, bigger than 256K to nand, barebox does not boot 
> anymore - if i reduce it to 256K or smaller, everthing works fine.
> 
> What do i have to do to use a bigger barebox image size?

Just a guess:

You are using imx_nand_load_image() with a fixed size of 256k. grep for
this function in the current tree and see how the correct image size is
calculated.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


[-- Attachment #1.2: Type: text/html, Size: 7797 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

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

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

* Re: barebox image size
  2012-07-16  9:15   ` Antwort: " christian.buettner
@ 2012-07-16  9:20     ` Eric Bénard
  2012-07-16  9:21     ` Antwort: " Sascha Hauer
  1 sibling, 0 replies; 17+ messages in thread
From: Eric Bénard @ 2012-07-16  9:20 UTC (permalink / raw)
  To: barebox

Hi Christian,

Le Mon, 16 Jul 2012 11:15:24 +0200,
christian.buettner@rafi.de a écrit :
> imx_nand_load_image() is never used in my imx53 board init code.. is this 
> the fault?
> 
FWIW I had the same issue on an i.MX51 : I didn't yet had the time to
investigate.

Eric

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

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

* Re: Antwort: Re: barebox image size
  2012-07-16  9:15   ` Antwort: " christian.buettner
  2012-07-16  9:20     ` Eric Bénard
@ 2012-07-16  9:21     ` Sascha Hauer
  2012-07-16  9:37       ` Antwort: " christian.buettner
  1 sibling, 1 reply; 17+ messages in thread
From: Sascha Hauer @ 2012-07-16  9:21 UTC (permalink / raw)
  To: christian.buettner; +Cc: barebox

On Mon, Jul 16, 2012 at 11:15:24AM +0200, christian.buettner@rafi.de wrote:
> 
> imx_nand_load_image() is never used in my imx53 board init code.. is this 
> the fault?
> 

On i.MX53 there might be a similar issue. You probably have something
like this in your board:

struct imx_flash_header_v2 __flash_header_section flash_header = {
	.header.tag		= IVT_HEADER_TAG,
	.header.length		= cpu_to_be16(32),
	.header.version		= IVT_VERSION,

	.entry			= APP_DEST + 0x1000,
	.dcd_ptr		= APP_DEST + 0x400 + offsetof(struct imx_flash_header_v2, dcd),
	.boot_data_ptr		= APP_DEST + 0x400 + offsetof(struct imx_flash_header_v2, boot_data),
	.self			= APP_DEST + 0x400,

	.boot_data.start	= APP_DEST,
	.boot_data.size		= DCD_BAREBOX_SIZE,

.boot_data.size is the interesting field. What do you have here?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

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

* Antwort: Re: Antwort: Re: barebox image size
  2012-07-16  9:21     ` Antwort: " Sascha Hauer
@ 2012-07-16  9:37       ` christian.buettner
  2012-07-16 10:30         ` Sascha Hauer
  0 siblings, 1 reply; 17+ messages in thread
From: christian.buettner @ 2012-07-16  9:37 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox


[-- Attachment #1.1: Type: text/plain, Size: 2968 bytes --]

here it is:

struct imx_flash_header_v2 __flash_header_section flash_header =
{
    .header.tag         = IVT_HEADER_TAG,
    .header.length      = cpu_to_be16(32),
    .header.version     = IVT_VERSION,

    .entry              = APP_DEST + 0x1000,
    .dcd_ptr            = APP_DEST + 0x400 + offsetof(struct 
imx_flash_header_v2, dcd),
    .boot_data_ptr      = APP_DEST + 0x400 + offsetof(struct 
imx_flash_header_v2, boot_data),
    .self               = APP_DEST + 0x400,

    .boot_data.start    = APP_DEST,
    .boot_data.size     = 0x40000,

    .dcd.header.tag     = DCD_HEADER_TAG,
    .dcd.header.length  = cpu_to_be16(sizeof(struct imx_dcd) + 
sizeof(dcd_entry)),
    .dcd.header.version = DCD_VERSION,

    .dcd.command.tag    = DCD_COMMAND_WRITE_TAG,
    .dcd.command.length = cpu_to_be16(sizeof(struct imx_dcd_command) + 
sizeof(dcd_entry)),
    .dcd.command.param  = DCD_COMMAND_WRITE_PARAM,
};


there is another struct:

struct imx_fcb_header __flash_header_fcb fcb_entry =
{
    .fcb_marker = 0x20424346,
    .fcb_version = 0x01,
    .st_pg_prm = 0x0,
    .st_pg_sec = 0x0,
    .reserved3[0] = 0x6b,
    .reserved3[1] = 0x6b,
    .st_pg_dbbt = 0x0,
    .bbm_off_main = 0x0,
    .bi_swap = 0x0,
    .bbm_off_spare = 0x0,
};



Von:    Sascha Hauer <s.hauer@pengutronix.de>
An:     christian.buettner@rafi.de, 
Kopie:  barebox@lists.infradead.org
Datum:  16.07.2012 11:21
Betreff:        Re: Antwort: Re: barebox image size



On Mon, Jul 16, 2012 at 11:15:24AM +0200, christian.buettner@rafi.de 
wrote:
> 
> imx_nand_load_image() is never used in my imx53 board init code.. is 
this 
> the fault?
> 

On i.MX53 there might be a similar issue. You probably have something
like this in your board:

struct imx_flash_header_v2 __flash_header_section flash_header = {
                 .header.tag                             = IVT_HEADER_TAG,
                 .header.length                          = 
cpu_to_be16(32),
                 .header.version                                 = 
IVT_VERSION,

                 .entry                                          = 
APP_DEST + 0x1000,
                 .dcd_ptr                                = APP_DEST + 
0x400 + offsetof(struct imx_flash_header_v2, dcd),
                 .boot_data_ptr                          = APP_DEST + 
0x400 + offsetof(struct imx_flash_header_v2, boot_data),
                 .self                                           = 
APP_DEST + 0x400,

                 .boot_data.start                = APP_DEST,
                 .boot_data.size                                 = 
DCD_BAREBOX_SIZE,

.boot_data.size is the interesting field. What do you have here?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


[-- Attachment #1.2: Type: text/html, Size: 7154 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

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

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

* Re: Antwort: Re: Antwort: Re: barebox image size
  2012-07-16  9:37       ` Antwort: " christian.buettner
@ 2012-07-16 10:30         ` Sascha Hauer
  2012-07-16 12:17           ` Antwort: " christian.buettner
  0 siblings, 1 reply; 17+ messages in thread
From: Sascha Hauer @ 2012-07-16 10:30 UTC (permalink / raw)
  To: christian.buettner; +Cc: barebox

On Mon, Jul 16, 2012 at 11:37:59AM +0200, christian.buettner@rafi.de wrote:
> here it is:
> 
> struct imx_flash_header_v2 __flash_header_section flash_header =
> {
>     .header.tag         = IVT_HEADER_TAG,
>     .header.length      = cpu_to_be16(32),
>     .header.version     = IVT_VERSION,
> 
>     .entry              = APP_DEST + 0x1000,
>     .dcd_ptr            = APP_DEST + 0x400 + offsetof(struct 
> imx_flash_header_v2, dcd),
>     .boot_data_ptr      = APP_DEST + 0x400 + offsetof(struct 
> imx_flash_header_v2, boot_data),
>     .self               = APP_DEST + 0x400,
> 
>     .boot_data.start    = APP_DEST,
>     .boot_data.size     = 0x40000,

And here you have the magic 256k. Please use DCD_BAREBOX_SIZE instead.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

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

* Antwort: Re: Antwort: Re: Antwort: Re: barebox image size
  2012-07-16 10:30         ` Sascha Hauer
@ 2012-07-16 12:17           ` christian.buettner
  2012-07-16 13:47             ` Christian Kapeller
  2012-07-16 22:29             ` Antwort: Re: Antwort: Re: Antwort: " Marc Reilly
  0 siblings, 2 replies; 17+ messages in thread
From: christian.buettner @ 2012-07-16 12:17 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox


[-- Attachment #1.1: Type: text/plain, Size: 2078 bytes --]

ok i can boot now! Thank you!

I flashed from 0x0 to 0x7FFFF (image size: 479K).
I flashed the environment image (image size: 3K) from 0x80000 to 0xFFFFF 
and changed the config code from barebox/environs/common/config to:

...
nand_parts="512k(barebox)ro,768k(bareboxenv),4M(kernel),120M(root)"
...

Barebox can boot now but the startup log says:
barebox 2012.03.0-dirty (Jul 16 2012 - 09:01:01)

Board: i.MX53
eth@eth0: got MAC address from EEPROM: *********************
nand_get_flash_type: second ID read did not match ef,ef against c0,c0
No NAND device found (-19)!
Malloc space: 0x7df00000 -> 0x7fefffff (size 32 MB)
Stack space : 0x7def8000 -> 0x7df00000 (size 32 kB)
Open /dev/env0 No such file or directory
running /env/bin/init...
not found
barebox:/ 

How can i get the environment loaded?

- christian




Von:    Sascha Hauer <s.hauer@pengutronix.de>
An:     christian.buettner@rafi.de, 
Kopie:  barebox@lists.infradead.org
Datum:  16.07.2012 12:30
Betreff:        Re: Antwort: Re: Antwort: Re: barebox image size



On Mon, Jul 16, 2012 at 11:37:59AM +0200, christian.buettner@rafi.de 
wrote:
> here it is:
> 
> struct imx_flash_header_v2 __flash_header_section flash_header =
> {
>     .header.tag         = IVT_HEADER_TAG,
>     .header.length      = cpu_to_be16(32),
>     .header.version     = IVT_VERSION,
> 
>     .entry              = APP_DEST + 0x1000,
>     .dcd_ptr            = APP_DEST + 0x400 + offsetof(struct 
> imx_flash_header_v2, dcd),
>     .boot_data_ptr      = APP_DEST + 0x400 + offsetof(struct 
> imx_flash_header_v2, boot_data),
>     .self               = APP_DEST + 0x400,
> 
>     .boot_data.start    = APP_DEST,
>     .boot_data.size     = 0x40000,

And here you have the magic 256k. Please use DCD_BAREBOX_SIZE instead.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


[-- Attachment #1.2: Type: text/html, Size: 4379 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

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

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

* Re: Antwort: Re: Antwort: Re: Antwort: Re: barebox image size
  2012-07-16 12:17           ` Antwort: " christian.buettner
@ 2012-07-16 13:47             ` Christian Kapeller
  2012-07-16 13:52               ` Antwort: " christian.buettner
  2012-07-16 22:29             ` Antwort: Re: Antwort: Re: Antwort: " Marc Reilly
  1 sibling, 1 reply; 17+ messages in thread
From: Christian Kapeller @ 2012-07-16 13:47 UTC (permalink / raw)
  To: christian.buettner; +Cc: barebox

> I flashed from 0x0 to 0x7FFFF (image size: 479K).
> I flashed the environment image (image size: 3K) from 0x80000 to 0xFFFFF
> and changed the config code from barebox/environs/common/config to:
> 
> ...
> nand_parts="512k(barebox)ro,768k(bareboxenv),4M(kernel),120M(root)"
> ...
> 
> Barebox can boot now but the startup log says:
> barebox 2012.03.0-dirty (Jul 16 2012 - 09:01:01)
> 
> Board: i.MX53
> eth@eth0: got MAC address from EEPROM: *********************
> nand_get_flash_type: second ID read did not match ef,ef against c0,c0
> No NAND device found (-19)!
> Malloc space: 0x7df00000 -> 0x7fefffff (size 32 MB)
> Stack space : 0x7def8000 -> 0x7df00000 (size 32 kB)
> Open /dev/env0 No such file or directory
> running /env/bin/init...
> not found
> barebox:/
> 
> How can i get the environment loaded?

Normally you would issue 'saveenv' which writes the environment to the
environment partition. On subsequent boots the environment will be loaded.

But the flash device on your board isn't detected by barebox, so you
will have to fix the detection first.

> nand_get_flash_type: second ID read did not match ef,ef against c0,c0

This line suggests, that the nand flash isn't working property. The line
is generated in drivers/mtd/nand/nand_base.c, after reading manufacturer
id and chip id two times, and checking them for equality.

Not only does your board different values for manufacturer and flash id
on first and second read, but they are also the same. manuf id=ef and
chip id=ef isn't plausible. Maybe you should check your hardware.

Regards
Christian

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

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

* Antwort: Re: Antwort: Re: Antwort: Re: Antwort: Re: barebox image size
  2012-07-16 13:47             ` Christian Kapeller
@ 2012-07-16 13:52               ` christian.buettner
  2012-07-16 14:25                 ` Christian Kapeller
  0 siblings, 1 reply; 17+ messages in thread
From: christian.buettner @ 2012-07-16 13:52 UTC (permalink / raw)
  To: Christian Kapeller; +Cc: barebox


[-- Attachment #1.1: Type: text/plain, Size: 1962 bytes --]

Thx for the hint. 
What i don't understand is that barebox boots from nand but the 
environement can't..



Von:    Christian Kapeller <christian.kapeller@cmotion.eu>
An:     christian.buettner@rafi.de, 
Kopie:  Sascha Hauer <s.hauer@pengutronix.de>, barebox@lists.infradead.org
Datum:  16.07.2012 15:47
Betreff:        Re: Antwort: Re: Antwort: Re: Antwort: Re: barebox image 
size



> I flashed from 0x0 to 0x7FFFF (image size: 479K).
> I flashed the environment image (image size: 3K) from 0x80000 to 0xFFFFF
> and changed the config code from barebox/environs/common/config to:
> 
> ...
> nand_parts="512k(barebox)ro,768k(bareboxenv),4M(kernel),120M(root)"
> ...
> 
> Barebox can boot now but the startup log says:
> barebox 2012.03.0-dirty (Jul 16 2012 - 09:01:01)
> 
> Board: i.MX53
> eth@eth0: got MAC address from EEPROM: *********************
> nand_get_flash_type: second ID read did not match ef,ef against c0,c0
> No NAND device found (-19)!
> Malloc space: 0x7df00000 -> 0x7fefffff (size 32 MB)
> Stack space : 0x7def8000 -> 0x7df00000 (size 32 kB)
> Open /dev/env0 No such file or directory
> running /env/bin/init...
> not found
> barebox:/
> 
> How can i get the environment loaded?

Normally you would issue 'saveenv' which writes the environment to the
environment partition. On subsequent boots the environment will be loaded.

But the flash device on your board isn't detected by barebox, so you
will have to fix the detection first.

> nand_get_flash_type: second ID read did not match ef,ef against c0,c0

This line suggests, that the nand flash isn't working property. The line
is generated in drivers/mtd/nand/nand_base.c, after reading manufacturer
id and chip id two times, and checking them for equality.

Not only does your board different values for manufacturer and flash id
on first and second read, but they are also the same. manuf id=ef and
chip id=ef isn't plausible. Maybe you should check your hardware.

Regards
Christian


[-- Attachment #1.2: Type: text/html, Size: 2971 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

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

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

* Re: Antwort: Re: Antwort: Re: Antwort: Re: Antwort: Re: barebox image size
  2012-07-16 13:52               ` Antwort: " christian.buettner
@ 2012-07-16 14:25                 ` Christian Kapeller
  2012-07-16 14:30                   ` Antwort: " christian.buettner
  2012-07-16 14:32                   ` Eric Bénard
  0 siblings, 2 replies; 17+ messages in thread
From: Christian Kapeller @ 2012-07-16 14:25 UTC (permalink / raw)
  To: christian.buettner; +Cc: barebox

On 07/16/2012 03:52 PM, christian.buettner@rafi.de wrote:
> Thx for the hint.
> What i don't understand is that barebox boots from nand but the
> environement can't..

Good point. In any case the driver isn't able to recognize your nand
device. I see from you supplied code snipplets, that your barebox is
at least two weeks old. Maybe you use the upstream tree, as maybe there
are already fixes for imx53 nand flash.

Also you may want to activate mtd debugging:

#define CONFIG_MTD_DEBUG
#define CONFIG_MTD_DEBUG_VERBOSE 3

for example to  your include/linux/mtd/mtd.h file. (Those are config
settings, but they don't appear in any Kconfig file, hence supply them
manually)

good luck.

> 
> 
>> I flashed from 0x0 to 0x7FFFF (image size: 479K).
>> I flashed the environment image (image size: 3K) from 0x80000 to 0xFFFFF
>> and changed the config code from barebox/environs/common/config to:
>>
>> ...
>> nand_parts="512k(barebox)ro,768k(bareboxenv),4M(kernel),120M(root)"
>> ...
>>
>> Barebox can boot now but the startup log says:
>> barebox 2012.03.0-dirty (Jul 16 2012 - 09:01:01)
>>
>> Board: i.MX53
>> eth@eth0: got MAC address from EEPROM: *********************
>> nand_get_flash_type: second ID read did not match ef,ef against c0,c0
>> No NAND device found (-19)!
>> Malloc space: 0x7df00000 -> 0x7fefffff (size 32 MB)
>> Stack space : 0x7def8000 -> 0x7df00000 (size 32 kB)
>> Open /dev/env0 No such file or directory
>> running /env/bin/init...
>> not found
>> barebox:/
>>
>> How can i get the environment loaded?
> 
> Normally you would issue 'saveenv' which writes the environment to the
> environment partition. On subsequent boots the environment will be loaded.
> 
> But the flash device on your board isn't detected by barebox, so you
> will have to fix the detection first.
> 
>> nand_get_flash_type: second ID read did not match ef,ef against c0,c0
> 
> This line suggests, that the nand flash isn't working property. The line
> is generated in drivers/mtd/nand/nand_base.c, after reading manufacturer
> id and chip id two times, and checking them for equality.
> 
> Not only does your board different values for manufacturer and flash id
> on first and second read, but they are also the same. manuf id=ef and
> chip id=ef isn't plausible. Maybe you should check your hardware.
> 
> Regards
> Christian
> 


-- 
Christian Kapeller
cmotion GmbH
Kriehubergasse 16
1050 Wien / Austria
http://www.cmotion.eu

christian.kapeller@cmotion.eu
Phone: +43 1 789 1096 38



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

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

* Antwort: Re: Antwort: Re: Antwort: Re: Antwort: Re: Antwort: Re: barebox image size
  2012-07-16 14:25                 ` Christian Kapeller
@ 2012-07-16 14:30                   ` christian.buettner
  2012-07-16 14:32                   ` Eric Bénard
  1 sibling, 0 replies; 17+ messages in thread
From: christian.buettner @ 2012-07-16 14:30 UTC (permalink / raw)
  To: Christian Kapeller; +Cc: barebox


[-- Attachment #1.1: Type: text/plain, Size: 2810 bytes --]

ahh thank you.. i try that.



Von:    Christian Kapeller <christian.kapeller@cmotion.eu>
An:     christian.buettner@rafi.de, 
Kopie:  barebox@lists.infradead.org, Sascha Hauer <s.hauer@pengutronix.de>
Datum:  16.07.2012 16:26
Betreff:        Re: Antwort: Re: Antwort: Re: Antwort: Re: Antwort: Re: 
barebox image size



On 07/16/2012 03:52 PM, christian.buettner@rafi.de wrote:
> Thx for the hint.
> What i don't understand is that barebox boots from nand but the
> environement can't..

Good point. In any case the driver isn't able to recognize your nand
device. I see from you supplied code snipplets, that your barebox is
at least two weeks old. Maybe you use the upstream tree, as maybe there
are already fixes for imx53 nand flash.

Also you may want to activate mtd debugging:

#define CONFIG_MTD_DEBUG
#define CONFIG_MTD_DEBUG_VERBOSE 3

for example to  your include/linux/mtd/mtd.h file. (Those are config
settings, but they don't appear in any Kconfig file, hence supply them
manually)

good luck.

> 
> 
>> I flashed from 0x0 to 0x7FFFF (image size: 479K).
>> I flashed the environment image (image size: 3K) from 0x80000 to 
0xFFFFF
>> and changed the config code from barebox/environs/common/config to:
>>
>> ...
>> nand_parts="512k(barebox)ro,768k(bareboxenv),4M(kernel),120M(root)"
>> ...
>>
>> Barebox can boot now but the startup log says:
>> barebox 2012.03.0-dirty (Jul 16 2012 - 09:01:01)
>>
>> Board: i.MX53
>> eth@eth0: got MAC address from EEPROM: *********************
>> nand_get_flash_type: second ID read did not match ef,ef against c0,c0
>> No NAND device found (-19)!
>> Malloc space: 0x7df00000 -> 0x7fefffff (size 32 MB)
>> Stack space : 0x7def8000 -> 0x7df00000 (size 32 kB)
>> Open /dev/env0 No such file or directory
>> running /env/bin/init...
>> not found
>> barebox:/
>>
>> How can i get the environment loaded?
> 
> Normally you would issue 'saveenv' which writes the environment to the
> environment partition. On subsequent boots the environment will be 
loaded.
> 
> But the flash device on your board isn't detected by barebox, so you
> will have to fix the detection first.
> 
>> nand_get_flash_type: second ID read did not match ef,ef against c0,c0
> 
> This line suggests, that the nand flash isn't working property. The line
> is generated in drivers/mtd/nand/nand_base.c, after reading manufacturer
> id and chip id two times, and checking them for equality.
> 
> Not only does your board different values for manufacturer and flash id
> on first and second read, but they are also the same. manuf id=ef and
> chip id=ef isn't plausible. Maybe you should check your hardware.
> 
> Regards
> Christian
> 


-- 
Christian Kapeller
cmotion GmbH
Kriehubergasse 16
1050 Wien / Austria
http://www.cmotion.eu

christian.kapeller@cmotion.eu
Phone: +43 1 789 1096 38




[-- Attachment #1.2: Type: text/html, Size: 4166 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

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

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

* Re: barebox image size
  2012-07-16 14:25                 ` Christian Kapeller
  2012-07-16 14:30                   ` Antwort: " christian.buettner
@ 2012-07-16 14:32                   ` Eric Bénard
  1 sibling, 0 replies; 17+ messages in thread
From: Eric Bénard @ 2012-07-16 14:32 UTC (permalink / raw)
  To: Christian Kapeller; +Cc: barebox, christian.buettner

Hi,

Le Mon, 16 Jul 2012 16:25:57 +0200,
Christian Kapeller <christian.kapeller@cmotion.eu> a écrit :

> On 07/16/2012 03:52 PM, christian.buettner@rafi.de wrote:
> > Thx for the hint.
> > What i don't understand is that barebox boots from nand but the
> > environement can't..
> 
> Good point. In any case the driver isn't able to recognize your nand
> device. I see from you supplied code snipplets, that your barebox is
> at least two weeks old. Maybe you use the upstream tree, as maybe there
> are already fixes for imx53 nand flash.
> 
you may try the ONFI patches as the log "nand_get_flash_type: second ID
read did not match ef,ef against c0,c0" seems very similar to what I
already saw in the past on one of my i.MX53 based board :

http://git.pengutronix.de/?p=barebox.git;a=commit;h=7baead578db7e47aedfcd3a5a21a69b9f37630d1
http://git.pengutronix.de/?p=barebox.git;a=commit;h=4b23222c4d68bf40ad89c99bf5e7fcbaa235bffb
http://git.pengutronix.de/?p=barebox.git;a=commit;h=632c45795065e6a7471ab82be38e808eb6204341

Eric

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

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

* Re: Antwort: Re: Antwort: Re: Antwort: Re: barebox image size
  2012-07-16 12:17           ` Antwort: " christian.buettner
  2012-07-16 13:47             ` Christian Kapeller
@ 2012-07-16 22:29             ` Marc Reilly
  2012-07-17  9:58               ` Antwort: " christian.buettner
  1 sibling, 1 reply; 17+ messages in thread
From: Marc Reilly @ 2012-07-16 22:29 UTC (permalink / raw)
  To: barebox; +Cc: christian.buettner

Hi,

> I flashed from 0x0 to 0x7FFFF (image size: 479K).
> I flashed the environment image (image size: 3K) from 0x80000 to 0xFFFFF
Her you write 512k for env

> and changed the config code from barebox/environs/common/config to:
> 
> ...
> nand_parts="512k(barebox)ro,768k(bareboxenv),4M(kernel),120M(root)"
And here you say its 786k.

Cheers,
Marc


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

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

* Antwort: Re: Antwort: Re: Antwort: Re: Antwort: Re: barebox image size
  2012-07-16 22:29             ` Antwort: Re: Antwort: Re: Antwort: " Marc Reilly
@ 2012-07-17  9:58               ` christian.buettner
  2012-07-17 10:44                 ` Marc Reilly
  0 siblings, 1 reply; 17+ messages in thread
From: christian.buettner @ 2012-07-17  9:58 UTC (permalink / raw)
  To: Marc Reilly; +Cc: barebox


[-- Attachment #1.1: Type: text/plain, Size: 2576 bytes --]

ok i was able to preceed a little. The new error message after booting is:

barebox 2012.03.0-dirty (Jul 17 2012 - 11:36:47)

Board: RAFI i.MX53
eth@eth0: got MAC address from EEPROM: ********
NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 
3,3V 8-bit)
Bad block table found at page 65472, version 0x01
Bad block table found at page 65408, version 0x01
nand_read_bbt: Bad block at 0x060a0000
Malloc space: 0x7df00000 -> 0x7fefffff (size 32 MB)
Stack space : 0x7def8000 -> 0x7df00000 (size 32 kB)
envfs: wrong magic on /dev/env0
running /env/bin/init...
not found
barebox:/ 


current settings are:

flash_header.c
struct imx_flash_header_v2 __flash_header_section flash_header =
{
    .header.tag         = IVT_HEADER_TAG,
    .header.length      = cpu_to_be16(32),
    .header.version     = IVT_VERSION,

    .entry              = APP_DEST + 0x1000,
    .dcd_ptr            = APP_DEST + 0x400 + offsetof(struct 
imx_flash_header_v2, dcd),
    .boot_data_ptr      = APP_DEST + 0x400 + offsetof(struct 
imx_flash_header_v2, boot_data),
    .self               = APP_DEST + 0x400,

    .boot_data.start    = APP_DEST,
    .boot_data.size     = 0x80000,

    .dcd.header.tag     = DCD_HEADER_TAG,
    .dcd.header.length  = cpu_to_be16(sizeof(struct imx_dcd) + sizeof
(dcd_entry)),
    .dcd.header.version = DCD_VERSION,

    .dcd.command.tag    = DCD_COMMAND_WRITE_TAG,
    .dcd.command.length = cpu_to_be16(sizeof(struct imx_dcd_command) + 
sizeof(dcd_entry)),
    .dcd.command.param  = DCD_COMMAND_WRITE_PARAM,
};


Environment config
nand_parts="512k(barebox)ro,512k(bareboxenv),4M(kernel),120M(root)"


board_init.c
devfs_add_partition("nand0", 0x00000, 0x80000, PARTITION_FIXED, "self0");
devfs_add_partition("nand0", 0x80000, 0x80000, PARTITION_FIXED, "env0");


seems like the enviroment.c->envfs_load() looks into a wrong memory area.
Is there a Setting i forgot?

- christian




Von:    Marc Reilly <marc@cpdesign.com.au>
An:     barebox@lists.infradead.org, 
Kopie:  christian.buettner@rafi.de, Sascha Hauer <s.hauer@pengutronix.de>
Datum:  17.07.2012 00:34
Betreff:        Re: Antwort: Re: Antwort: Re: Antwort: Re: barebox image 
size
Gesendet von:   Marc Reilly <marc.reilly@gmail.com>



Hi,

> I flashed from 0x0 to 0x7FFFF (image size: 479K).
> I flashed the environment image (image size: 3K) from 0x80000 to 0xFFFFF
Her you write 512k for env

> and changed the config code from barebox/environs/common/config to:
> 
> ...
> nand_parts="512k(barebox)ro,768k(bareboxenv),4M(kernel),120M(root)"
And here you say its 786k.

Cheers,
Marc



[-- Attachment #1.2: Type: text/html, Size: 8464 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

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

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

* RE: Antwort: Re: Antwort: Re: Antwort: Re: Antwort: Re: barebox image size
  2012-07-17  9:58               ` Antwort: " christian.buettner
@ 2012-07-17 10:44                 ` Marc Reilly
  2012-07-17 10:49                   ` Antwort: " christian.buettner
  0 siblings, 1 reply; 17+ messages in thread
From: Marc Reilly @ 2012-07-17 10:44 UTC (permalink / raw)
  To: christian.buettner; +Cc: barebox

Hi,

>ok i was able to preceed a little. The new error message after booting is: 
>
>Board: RAFI i.MX53 
>eth@eth0: got MAC address from EEPROM: ******** 
>NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V
8-bit) 
>Bad block table found at page 65472, version 0x01 
>Bad block table found at page 65408, version 0x01 
>nand_read_bbt: Bad block at 0x060a0000 
>Malloc space: 0x7df00000 -> 0x7fefffff (size 32 MB) 
>Stack space : 0x7def8000 -> 0x7df00000 (size 32 kB) 
>envfs: wrong magic on /dev/env0 
>running /env/bin/init... 
>not found 
>barebox:/ 

What commands are you using to erase and program the flash area?

>Environment config 
>nand_parts="512k(barebox)ro,512k(bareboxenv),4M(kernel),120M(root)" 

>board_init.c 
>devfs_add_partition("nand0", 0x00000, 0x80000, PARTITION_FIXED, "self0"); 
>devfs_add_partition("nand0", 0x80000, 0x80000, PARTITION_FIXED, "env0"); 

These partitions aren't bad block aware, from memory, I think u want
something like:

devfs_add_partition("nand0", 0x80000, 0x80000, PARTITION_FIXED, "env0_raw");
dev_add_bb_dev("env0_raw", "env0");

Cheers,
Marc


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

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

* Antwort: RE: Antwort: Re: Antwort: Re: Antwort: Re: Antwort: Re: barebox image size
  2012-07-17 10:44                 ` Marc Reilly
@ 2012-07-17 10:49                   ` christian.buettner
  0 siblings, 0 replies; 17+ messages in thread
From: christian.buettner @ 2012-07-17 10:49 UTC (permalink / raw)
  To: marc; +Cc: barebox, Marc Reilly


[-- Attachment #1.1: Type: text/plain, Size: 1667 bytes --]

Ahh, thank you for the hint with the BB!
And finally - it is working!!
I forgot to change the erase settings in the lauterbach script.

Thank you all for your help and long lives barebox ;)

- christian



Von:    "Marc Reilly" <marc@cpdesign.com.au>
An:     <christian.buettner@rafi.de>, 
Kopie:  <barebox@lists.infradead.org>, "'Sascha Hauer'" 
<s.hauer@pengutronix.de>
Datum:  17.07.2012 12:44
Betreff:        RE: Antwort: Re: Antwort: Re: Antwort: Re: Antwort: Re: 
barebox image size
Gesendet von:   Marc Reilly <marc.reilly@gmail.com>



Hi,

>ok i was able to preceed a little. The new error message after booting 
is: 
>
>Board: RAFI i.MX53 
>eth@eth0: got MAC address from EEPROM: ******** 
>NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 
3,3V
8-bit) 
>Bad block table found at page 65472, version 0x01 
>Bad block table found at page 65408, version 0x01 
>nand_read_bbt: Bad block at 0x060a0000 
>Malloc space: 0x7df00000 -> 0x7fefffff (size 32 MB) 
>Stack space : 0x7def8000 -> 0x7df00000 (size 32 kB) 
>envfs: wrong magic on /dev/env0 
>running /env/bin/init... 
>not found 
>barebox:/ 

What commands are you using to erase and program the flash area?

>Environment config 
>nand_parts="512k(barebox)ro,512k(bareboxenv),4M(kernel),120M(root)" 

>board_init.c 
>devfs_add_partition("nand0", 0x00000, 0x80000, PARTITION_FIXED, "self0"); 

>devfs_add_partition("nand0", 0x80000, 0x80000, PARTITION_FIXED, "env0"); 

These partitions aren't bad block aware, from memory, I think u want
something like:

devfs_add_partition("nand0", 0x80000, 0x80000, PARTITION_FIXED, 
"env0_raw");
dev_add_bb_dev("env0_raw", "env0");

Cheers,
Marc



[-- Attachment #1.2: Type: text/html, Size: 3004 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

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

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

end of thread, other threads:[~2012-07-17 10:49 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-16  8:37 barebox image size christian.buettner
2012-07-16  8:54 ` Sascha Hauer
2012-07-16  9:15   ` Antwort: " christian.buettner
2012-07-16  9:20     ` Eric Bénard
2012-07-16  9:21     ` Antwort: " Sascha Hauer
2012-07-16  9:37       ` Antwort: " christian.buettner
2012-07-16 10:30         ` Sascha Hauer
2012-07-16 12:17           ` Antwort: " christian.buettner
2012-07-16 13:47             ` Christian Kapeller
2012-07-16 13:52               ` Antwort: " christian.buettner
2012-07-16 14:25                 ` Christian Kapeller
2012-07-16 14:30                   ` Antwort: " christian.buettner
2012-07-16 14:32                   ` Eric Bénard
2012-07-16 22:29             ` Antwort: Re: Antwort: Re: Antwort: " Marc Reilly
2012-07-17  9:58               ` Antwort: " christian.buettner
2012-07-17 10:44                 ` Marc Reilly
2012-07-17 10:49                   ` Antwort: " christian.buettner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox