Skip to contentSkip to conversation

JFFS2 with NAND flash is very SLOW ...

U-Boot Pierre Savary 4 participants 11 messages Jun 2, 2009

lore
Share & tools
lore
#0 lore raw

Hi all,
Currently I work with the lpc3250 board of Phytec. I wish boot my Linux kernel from a NAND flash formatted with JFFS2. Here my current configuration:

[...]
#define CONFIG_CMD_NAND
#define CONFIG_SYS_MAX_FLASH_BANKS 1
#define CONFIG_SYS_MAX_NAND_DEVICE 1
#define CONFIG_SYS_NAND_BASE 0x20020000
#define NAND_MAX_CHIPS 1
#define CONFIG_ENV_IS_IN_NAND
[...]
#define CONFIG_CMD_JFFS2
[...]
#define CONFIG_JFFS2_NAND
#undef CONFIG_JFFS2_CMDLINE
#define CONFIG_JFFS2_DEV "nand0"
#define CONFIG_JFFS2_PART_SIZE 0x00C00000
#define CONFIG_JFFS2_PART_OFFSET 0x000C8000
[...]

It works... but I have a very big problem : it's very very slow!!!! How can I decrease the time to load the kernel image?
I try with u-boot 1.3.3, 1.3.4 and 2009.03 but the problem is always present...
Can you help me please?

Thanks in advance,
Best Regards

Pierre

#1 lore raw

Dear Pierre,

Quoted 4 lines

It works... but I have a very big problem : it's very very slow!!!! How can I decrease the time to load the kernel image?
I try with u-boot 1.3.3, 1.3.4 and 2009.03 but the problem is always present...

I have tried to boot from nand with 1.3.4 and 2009.03. I can tell you that 2009.03 is much faster then 1.3.4 to boot from a formatted JFFS2 nand.

Quoted 1 line

Can you help me please?

What is the size of the partition used to store the kernel? I suggest to use a small partition to store the kernel (5M by exemple something like 10M if you have an initramfs). You should have something like this:

MTD1 u-boot 2M
MTD2 kernel 5M
MTD3 content remainingM

Sylvain Cote

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
This electronic message may contain proprietary and confidential information of Verint Systems Inc., its affiliates and/or subsidiaries.
The information is intended to be for the use of the individual(s) or
entity(ies) named above. If you are not the intended recipient (or authorized to receive this e-mail for the intended recipient), you may not use, copy, disclose or distribute to anyone this message or any information contained in this message. If you have received this electronic message in error, please notify us by replying to this e-mail.

#2 lore raw

In my side:
MTD0 (720kB): U-boot
MTD1 (80kB) : env. Variables
MTD2 (12MB) : kernel + initramfs
MTD3 (50MB) : rootfs

If it exists a difference between 2009.03 and 1.3.3 it is not sufficient. It is very slow in both versions. It takes more than 1 minutes to obtain the result of "fsinfo" command !!!

Thanks for your help,

Pierre

-----Message d'origine-----
De?: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] De la part de Cote, Sylvain
Envoy??: mardi 2 juin 2009 14:22
??: Pierre Savary; u-boot-users at lists.sourceforge.net; u-boot at lists.denx.de Objet?: Re: [U-Boot] JFFS2 with NAND flash is very SLOW ...

Dear Pierre,

Quoted 1 line

It works... but I have a very big problem : it's very very slow!!!! How

can

Quoted 3 lines

I decrease the time to load the kernel image?
I try with u-boot 1.3.3, 1.3.4 and 2009.03 but the problem is always present...

I have tried to boot from nand with 1.3.4 and 2009.03. I can tell you that 2009.03 is much faster then 1.3.4 to boot from a formatted JFFS2 nand.

Quoted 1 line

Can you help me please?

What is the size of the partition used to store the kernel? I suggest to use a small partition to store the kernel (5M by exemple something like 10M if you have an initramfs). You should have something like this:

MTD1 u-boot 2M
MTD2 kernel 5M
MTD3 content remainingM

Sylvain Cote

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
This electronic message may contain proprietary and confidential information of Verint Systems Inc., its affiliates and/or subsidiaries.
The information is intended to be for the use of the individual(s) or entity(ies) named above. If you are not the intended recipient (or authorized to receive this e-mail for the intended recipient), you may not use, copy, disclose or distribute to anyone this message or any information contained in this message. If you have received this electronic message in error, please notify us by replying to this e-mail.

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

#3 lore raw
Quoted 7 lines

In my side:
MTD0 (720kB): U-boot
MTD1 (80kB) : env. Variables
MTD2 (12MB) : kernel + initramfs
MTD3 (50MB) : rootfs

Maybe it will not help you but I have

MTD0 (all the nand 256M)
MTD1 uboot+ embedded config 2M RAW
MTD2 1M JFFS2
MTD5 config 5M JFFS2
MTD3 Kernel + initramfs 12M JFFS2
MTD4 KernelBKp 12M JFFS2
MTD5 content 224M

Scanning and fsload of the MTD3 partition take 3 seconds with 2009.03
With 1.3.4 it was something like 6-10 seconds. But never 1 minute. I have seen that when scanning the content partition of 224M.

Quoted 3 lines

If it exists a difference between 2009.03 and 1.3.3 it is not sufficient. It is very slow in both versions. It takes more than 1 minutes to obtain the result of "fsinfo" command !!!

sYLVAIN

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

This electronic message may contain proprietary and confidential information of Verint Systems Inc., its affiliates and/or subsidiaries.
The information is intended to be for the use of the individual(s) or
entity(ies) named above. If you are not the intended recipient (or authorized to receive this e-mail for the intended recipient), you may not use, copy, disclose or distribute to anyone this message or any information contained in this message. If you have received this electronic message in error, please notify us by replying to this e-mail.

#4 lore raw
Quoted 16 lines · Sylvain
Quoted 5 lines

In my side:
MTD0 (720kB): U-boot
MTD1 (80kB) : env. Variables
MTD2 (12MB) : kernel + initramfs
MTD3 (50MB) : rootfs

Maybe it will not help you but I have

MTD0 (all the nand 256M)
MTD1 uboot+ embedded config 2M RAW
MTD2 1M JFFS2
MTD5 config 5M JFFS2
MTD3 Kernel + initramfs 12M JFFS2
MTD4 KernelBKp 12M JFFS2
MTD5 content 224M

Quoted 3 lines

Scanning and fsload of the MTD3 partition take 3 seconds with 2009.03 With 1.3.4 it was something like 6-10 seconds. But never 1 minute. I have seen that when scanning the content partition of 224M.

Parameters like I-cache and D-cache handling greatly effect this scan time. Some platforms have caches enabled others don't. This might explain some differences here.

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: office at denx.de
=====================================================================

#5 lore raw

Is it better to use or not D-cache and I-cache?
Currently, in my config file, I have only
#define CONFIG_CMD_CACHE
What do I have to add?

Thanks in advance for your help.

Pierre

-----Message d'origine-----
De?: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] De la part de Stefan Roese
Envoy??: mardi 2 juin 2009 15:18
??: u-boot at lists.denx.de
Cc?: Pierre Savary; Cote, Sylvain
Objet?: Re: [U-Boot] JFFS2 with NAND flash is very SLOW ...

Quoted 16 lines · Sylvain
Quoted 5 lines

In my side:
MTD0 (720kB): U-boot
MTD1 (80kB) : env. Variables
MTD2 (12MB) : kernel + initramfs
MTD3 (50MB) : rootfs

Maybe it will not help you but I have

MTD0 (all the nand 256M)
MTD1 uboot+ embedded config 2M RAW
MTD2 1M JFFS2
MTD5 config 5M JFFS2
MTD3 Kernel + initramfs 12M JFFS2
MTD4 KernelBKp 12M JFFS2
MTD5 content 224M

Quoted 2 lines

Scanning and fsload of the MTD3 partition take 3 seconds with 2009.03 With 1.3.4 it was something like 6-10 seconds. But never 1 minute. I

have

Quoted 1 line

seen that when scanning the content partition of 224M.

Parameters like I-cache and D-cache handling greatly effect this scan time. Some platforms have caches enabled others don't. This might explain some differences here.

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: office at denx.de
=====================================================================
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#6 lore raw
Quoted 1 line · On Tuesday 02 June 2009 15:23:57 Pierre Savary wrote:

Is it better to use or not D-cache and I-cache?

Depends a bit on the "application". From my experience I-Cache is most important. But for memory intensive applications (JFFS2 might be such a beast) D-cache could be very helpful as well. Best is to have both enabled of course.

Quoted 3 lines

Currently, in my config file, I have only
#define CONFIG_CMD_CACHE
What do I have to add?

Defining the cache commands doesn't insure that caches are really enabled. Some platforms don't support I- and/or D-cache in U-Boot. I can only speak for PPC4xx which has I-cache enabled and "usually" D-cache disabled (because of cache-coherency issues). This might be different on your platform. Again, just enabling the cache commands will most likely not help here.

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: office at denx.de
=====================================================================

#7 lore raw

In fact it is not better with this config:
#define CONFIG_ICACHE_ON
#define CONFIG_DCACHE_ON

#define CONFIG_SYS_DCACHE_SIZE          32768
#define CONFIG_SYS_ICACHE_SIZE          32768
#define CONFIG_SYS_CACHELINE_SIZE       32

My architecture is arm926ejs and it seems that CACHE management is not implemented...

I just measure a load of uImage (2MB) ... it takes more than 2 minutes :-(

Pierre

-----Message d'origine-----
De?: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] De la part de Stefan Roese
Envoy??: mardi 2 juin 2009 15:32
??: u-boot at lists.denx.de
Cc?: Pierre Savary; 'Cote, Sylvain'
Objet?: Re: [U-Boot] JFFS2 with NAND flash is very SLOW ...

Quoted 1 line · On Tuesday 02 June 2009 15:23:57 Pierre Savary wrote:

Is it better to use or not D-cache and I-cache?

Depends a bit on the "application". From my experience I-Cache is most important. But for memory intensive applications (JFFS2 might be such a beast)
D-cache could be very helpful as well. Best is to have both enabled of course.

Quoted 3 lines

Currently, in my config file, I have only
#define CONFIG_CMD_CACHE
What do I have to add?

Defining the cache commands doesn't insure that caches are really enabled. Some platforms don't support I- and/or D-cache in U-Boot. I can only speak for
PPC4xx which has I-cache enabled and "usually" D-cache disabled (because of cache-coherency issues). This might be different on your platform. Again, just
enabling the cache commands will most likely not help here.

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: office at denx.de
=====================================================================
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#8 lore raw
Quoted 11 lines · On Tuesday 02 June 2009 15:56:25 Pierre Savary wrote:

In fact it is not better with this config:
#define CONFIG_ICACHE_ON
#define CONFIG_DCACHE_ON

#define CONFIG_SYS_DCACHE_SIZE          32768
#define CONFIG_SYS_ICACHE_SIZE          32768
#define CONFIG_SYS_CACHELINE_SIZE       32

My architecture is arm926ejs and it seems that CACHE management is not implemented...

I just measure a load of uImage (2MB) ... it takes more than 2 minutes :-(

Yes, this is really slow. Jean-Christophe will be able to tell us if caches are supported on this platform in U-Boot.

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: office at denx.de
=====================================================================

#9 lore raw
Quoted 8 lines · Stefan Roese
Quoted 7 lines · On Tuesday 02 June 2009 15:56:25 Pierre Savary wrote:

In fact it is not better with this config:
#define CONFIG_ICACHE_ON
#define CONFIG_DCACHE_ON

#define CONFIG_SYS_DCACHE_SIZE          32768
#define CONFIG_SYS_ICACHE_SIZE          32768
#define CONFIG_SYS_CACHELINE_SIZE       32
Quoted 7 lines
Quoted 4 lines

My architecture is arm926ejs and it seems that CACHE management is not implemented...

I just measure a load of uImage (2MB) ... it takes more than 2 minutes :-(

Yes, this is really slow. Jean-Christophe will be able to tell us if caches are supported on this platform in U-Boot.

I've not yet find time to implement the MMU support for arm (needed for D-Cache support), I've plan to add it for the next release (not for this next merge window)

I-Cache is supported

but 2 mins is really slow, could show us your code?

Best Regards,
J.

#10 lore raw

Which source code? I use the 2009.03 version without modification. This is my config file:
[...]
#define CONFIG_CMD_NAND
#define CONFIG_SYS_MAX_FLASH_BANKS 1
#define CONFIG_SYS_MAX_NAND_DEVICE 1
#define CONFIG_SYS_NAND_BASE 0x20020000
#define NAND_MAX_CHIPS 1
#define CONFIG_ENV_IS_IN_NAND
[...]
#define CONFIG_CMD_JFFS2
[...]
#define CONFIG_JFFS2_NAND
#undef CONFIG_JFFS2_CMDLINE
#define CONFIG_JFFS2_DEV "nand0"
#define CONFIG_JFFS2_PART_SIZE 0x00C00000
#define CONFIG_JFFS2_PART_OFFSET 0x000C8000
[...]
#define CONFIG_ICACHE_ON
#define CONFIG_DCACHE_ON

#define CONFIG_SYS_DCACHE_SIZE          32768
#define CONFIG_SYS_ICACHE_SIZE          32768
#define CONFIG_SYS_CACHELINE_SIZE       32

[...]

And in fact it is better with I-Cache enabled. I carried out more precise measurements and I obtain: 1min45 without I-cache and 40sec with I-cache. It is better but not enough...

Thanks for your help.
Best Regards,

Pierre

-----Message d'origine-----
De?: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] De la part de Jean-Christophe PLAGNIOL-VILLARD
Envoy??: mardi 2 juin 2009 17:06
??: Stefan Roese
Cc?: Pierre Savary; 'Cote, Sylvain'; u-boot at lists.denx.de Objet?: Re: [U-Boot] JFFS2 with NAND flash is very SLOW ...

Quoted 8 lines · Stefan Roese
Quoted 7 lines · On Tuesday 02 June 2009 15:56:25 Pierre Savary wrote:

In fact it is not better with this config:
#define CONFIG_ICACHE_ON
#define CONFIG_DCACHE_ON

#define CONFIG_SYS_DCACHE_SIZE          32768
#define CONFIG_SYS_ICACHE_SIZE          32768
#define CONFIG_SYS_CACHELINE_SIZE       32
Quoted 4 lines
Quoted 4 lines

My architecture is arm926ejs and it seems that CACHE management is not implemented...

I just measure a load of uImage (2MB) ... it takes more than 2 minutes

:-(

Quoted 2 lines

Yes, this is really slow. Jean-Christophe will be able to tell us if

caches

Quoted 1 line

are supported on this platform in U-Boot.

I've not yet find time to implement the MMU support for arm (needed for D-Cache support), I've plan to add it for the next release (not for this next
merge window)

I-Cache is supported

but 2 mins is really slow, could show us your code?

Best Regards,
J.
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot