omap3evm: Support for quick boot
PATCH v2 1/1 omap3evm: Support for quick boot
Default configuration enables multiple features that are great for intial development work. But many of them are not useful when time taken to boot kernel is important - and uboot is frozen.
This patch attempts to reduce the size of u-boot binary by excluding unused/not-so-commonly used features/commands. It allows initialization of unused devices to be skipped.
Less time to load the binary and selective initialization results in considerable reduction in the boot time.
---
v2: Replaced occurences of "fast" with "quick"
to avoid any confusion with "fastboot" in Android.
include/configs/omap3_evm.h | 138 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 138 insertions(+), 0 deletions(-)
include/configs/omap3_evm.h +138 -0
@@ -378,4 +378,142 @@ extern unsigned int boot_flash_type;#define CONFIG_BOOTP_HOSTNAME 0x00000004#define CONFIG_BOOTP_BOOTPATH 0x00000010 +/* +* Support for quick boot +* +* In default build, the feature is disabled. To use the feature: +* 1) Define CONFIG_QUICK_BOOT +* 2) Select the device used as boot medium, by defining one of: +* - CONFIG_QUICK_BOOT_MMC +* - CONFIG_QUICK_BOOT_NAND +*/ +#undef CONFIG_QUICK_BOOT +#undef CONFIG_QUICK_BOOT_MMC +#undef CONFIG_QUICK_BOOT_NAND + +#ifdef CONFIG_QUICK_BOOT +/* +* Generic config options +*/ +#ifndef CONFIG_SILENT_CONSOLE +#define CONFIG_SILENT_CONSOLE 1 +#endif + +#ifndef CONFIG_ENV_IS_NOWHERE +#define CONFIG_ENV_IS_NOWHERE 1 +#endif + +/* +* Exclude unused/rarely used features. +*/ +#undef CONFIG_SYS_LONGHELP +#undef CONFIG_SYS_HUSH_PARSER + +#undef CONFIG_REVISION_TAG + +#undef CONFIG_MD5 +#undef CONFIG_SHA1 +#undef CONFIG_BZIP2 +#undef CONFIG_LZMA + +#undef CONFIG_CMD_BDI +#undef CONFIG_CMD_BOOTD +#undef CONFIG_CMD_CONSOLE +#undef CONFIG_CMD_ECHO +#undef CONFIG_CMD_EDITENV +#undef CONFIG_CMD_FPGA +#undef CONFIG_CMD_IMI +#undef CONFIG_CMD_ITEST +#undef CONFIG_CMD_LOADB +#undef CONFIG_CMD_LOADS +#undef CONFIG_CMD_NET +#undef CONFIG_CMD_NFS +#undef CONFIG_CMD_SETGETDCR +#undef CONFIG_CMD_SOURCE +#undef CONFIG_CMD_XIMG +#undef CONFIG_CMD_FPGA +#undef CONFIG_CMD_IMLS +#undef CONFIG_CMD_FLASH +#undef CONFIG_CMD_EXT2 +#undef CONFIG_CMD_USB + +#undef CONFIG_NET_MULTI + +#undef CONFIG_SMC911X + +#undef CONFIG_OF_LIBFDT +#undef CONFIG_FIT + +#undef CONFIG_EXTRA_ENV_SETTINGS +#define CONFIG_EXTRA_ENV_SETTINGS \ + "verify=no\0" \ + "bootfile=uImage\0" + +#undef CONFIG_BOOTDELAY +#define CONFIG_BOOTDELAY 0 + +/* +* Select options based on choice of boot medium. +*/ +#ifdef CONFIG_QUICK_BOOT_MMC +#undef CONFIG_NAND_OMAP_GPMC +#undef CONFIG_ENV_IS_IN_NAND +#undef CONFIG_CMD_NAND +#endif + +#ifdef CONFIG_QUICK_BOOT_MMC +#undef CONFIG_ENV_IS_IN_NAND +#undef CONFIG_CMD_NAND + +#undef CONFIG_BOOTCOMMAND +#define CONFIG_BOOTCOMMAND \ + "mmc init; " \ + "fatload mmc 0 0x80000000 uImage; " \ + "bootm 0x80000000;" + +#undef CONFIG_BOOTARGS +#define CONFIG_BOOTARGS \ + "console=ttyS0,115200n8 " \ + "mem=128M quiet noinitrd" \ + "root=/dev/mmcblk0p2 rw " \ + "rootfstype=ext3 rootwait " +#endif + +#ifdef CONFIG_QUICK_BOOT_NAND +# undef CONFIG_OMAP3_MMC +# undef CONFIG_CMD_MMC +# undef CONFIG_DOS_PARTITION +# undef CONFIG_CMD_FAT + +#undef CONFIG_BOOTCOMMAND +#define CONFIG_BOOTCOMMAND \ + "nand read.i 0x80000000 280000 500000; " \ + "bootm 0x80000000;" + +#undef CONFIG_BOOTARGS +#define CONFIG_BOOTARGS \ + "console=ttyS0,115200n8 " \ + "mem=128M quiet noinitrd" \ + "root=/dev/mtdblock4 rw " \ + "rootfstype=jffs2 " +#endif + +/* +* Board specific features +* Exclude not-so-common features +*/ +#undef CONFIG_USB_OMAP3 +#undef CONFIG_MUSB_HCD + +#undef CONFIG_USB_STORAGE +#undef CONFIG_USB_KEYBOARD +#undef CONFIG_SYS_USB_EVENT_POLL +#undef CONFIG_PREBOOT + +#undef CONFIG_MUSB_UDC +#undef CONFIG_USB_DEVICE +#undef CONFIG_USB_TTY + +#endif /* #ifdef CONFIG_QUICK_BOOT */ +#endif /* __CONFIG_H */
Signature · 1 line
1.7.2.2
PATCH v2 1/1 omap3evm: Support for quick boot
Dear Sanjeev Premi,
Quoted 33 lines · In message <[email protected]> you wrote:
Default configuration enables multiple features that are great for intial development work. But many of them are not useful when time taken to boot kernel is important - and uboot is frozen.
This patch attempts to reduce the size of u-boot binary by excluding unused/not-so-commonly used features/commands. It allows initialization of unused devices to be skipped.
Less time to load the binary and selective initialization results in considerable reduction in the boot time.
Signed-off-by Sanjeev Premi <[email protected]>---
v2: Replaced occurences of "fast" with "quick"
to avoid any confusion with "fastboot" in Android.include/configs/omap3_evm.h | 138 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 138 insertions(+), 0 deletions(-)include/configs/omap3_evm.h +2
-0@@ -378,4 +378,142 @@ extern unsigned int boot_flash_type;#define CONFIG_BOOTP_HOSTNAME 0x00000004#define CONFIG_BOOTP_BOOTPATH 0x00000010 +/* +* Support for quick boot
include/configs/omap3_evm.h extern unsigned int boot_flash_type; · line 392
Quoted 10 lines
include/configs/omap3_evm.h +10
-0+* +* In default build, the feature is disabled. To use the feature: +* 1) Define CONFIG_QUICK_BOOT +* 2) Select the device used as boot medium, by defining one of: +* - CONFIG_QUICK_BOOT_MMC +* - CONFIG_QUICK_BOOT_NAND +*/ +#undef CONFIG_QUICK_BOOT +#undef CONFIG_QUICK_BOOT_MMC +#undef CONFIG_QUICK_BOOT_NAND
If you use this here to show the options, then please move it into the comment above.
Otherwise, it is just dead code as you undefine things that are not defiend anyway. In any case, please remove the #undef's.
include/configs/omap3_evm.h extern unsigned int boot_flash_type; · line 404
Quoted 11 lines
include/configs/omap3_evm.h +11
-0+#ifdef CONFIG_QUICK_BOOT +/* +* Generic config options +*/ +#ifndef CONFIG_SILENT_CONSOLE +#define CONFIG_SILENT_CONSOLE 1 +#endif + +#ifndef CONFIG_ENV_IS_NOWHERE +#define CONFIG_ENV_IS_NOWHERE 1 +#endif
Style issue: Please always start preprocessor commands in column 1.
Quoted 23 lines
include/configs/omap3_evm.h +23
-0+/* +* Exclude unused/rarely used features. +*/ +#undef CONFIG_SYS_LONGHELP +#undef CONFIG_SYS_HUSH_PARSER + +#undef CONFIG_REVISION_TAG + +#undef CONFIG_MD5 +#undef CONFIG_SHA1 +#undef CONFIG_BZIP2 +#undef CONFIG_LZMA + +#undef CONFIG_CMD_BDI +#undef CONFIG_CMD_BOOTD +#undef CONFIG_CMD_CONSOLE +#undef CONFIG_CMD_ECHO +#undef CONFIG_CMD_EDITENV +#undef CONFIG_CMD_FPGA +#undef CONFIG_CMD_IMI +#undef CONFIG_CMD_ITEST +#undef CONFIG_CMD_LOADB +#undef CONFIG_CMD_LOADS
include/configs/omap3_evm.h extern unsigned int boot_flash_type; · line 438
Quoted 10 lines
include/configs/omap3_evm.h +10
-0+#undef CONFIG_CMD_NET +#undef CONFIG_CMD_NFS +#undef CONFIG_CMD_SETGETDCR +#undef CONFIG_CMD_SOURCE +#undef CONFIG_CMD_XIMG +#undef CONFIG_CMD_FPGA +#undef CONFIG_CMD_IMLS +#undef CONFIG_CMD_FLASH +#undef CONFIG_CMD_EXT2 +#undef CONFIG_CMD_USB
I do not like this approach at all. It will make the board config file basicly unreadable - it becomes a mess of defiunitions here and (even conditional) #undef's and re-definitions there.
I suggest you chose a different approach, for example move the common (always used) configuration settings into a separate header file, and then provide two separate board configurations (normal and quick boot) which include the common settings.
This has the additional benefit that you can actually build both configurations without the need to modify any source files.
Best regards,
Wolfgang Denk
Signature · 4 lines
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: wd at denx.de Lack of skill dictates economy of style. - Joey Ramone
Premi
PATCH v2 1/1 omap3evm: Support for quick boot
Quoted 7 lines
-----Original Message-----
From: Wolfgang Denk [mailto:wd at denx.de]
Sent: Wednesday, October 27, 2010 7:19 PM
To: Premi, Sanjeev
Cc: u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH v2] omap3evm: Support for quick boot
[snip]...[snip]
Quoted 6 lines
include/configs/omap3_evm.h extern unsigned int boot_flash_type; · line 392
Quoted 3 lines
include/configs/omap3_evm.h +3
-0+#undef CONFIG_QUICK_BOOT +#undef CONFIG_QUICK_BOOT_MMC +#undef CONFIG_QUICK_BOOT_NANDIf you use this here to show the options, then please move it into the comment above.
[sp] Will do.
Quoted 5 lines
Otherwise, it is just dead code as you undefine things that are not defiend anyway. In any case, please remove the #undef's.
Quoted 14 lines
include/configs/omap3_evm.h extern unsigned int boot_flash_type; · line 404
Quoted 11 lines
include/configs/omap3_evm.h +11
-0+#ifdef CONFIG_QUICK_BOOT +/* +* Generic config options +*/ +#ifndef CONFIG_SILENT_CONSOLE +#define CONFIG_SILENT_CONSOLE 1 +#endif + +#ifndef CONFIG_ENV_IS_NOWHERE +#define CONFIG_ENV_IS_NOWHERE 1 +#endif Style issue: Please always start preprocessor commands in column 1.
[sp] I was following style from another file which uses nesting.
Maybe, my choice of reference was incorect.
Will make the change.
[snip]...[snip]
Quoted 10 lines
include/configs/omap3_evm.h extern unsigned int boot_flash_type; · line 438
Quoted 1 line
include/configs/omap3_evm.h +1
-0+#undef CONFIG_CMD_USBI do not like this approach at all. It will make the board config file basicly unreadable - it becomes a mess of defiunitions here and (even conditional) #undef's and re-definitions there.
I suggest you chose a different approach, for example move the common (always used) configuration settings into a separate header file, and then provide two separate board configurations (normal and quick boot) which include the common settings.
[sp] I did think about it, infact, I was initially planning to follow
the config_cmd_default.h; because, same set of changes can apply across multiple boards. I did test the patch against Beagle board as well.
Quoted 3 lines
This has the additional benefit that you can actually build both configurations without the need to modify any source files.
[sp] Was only concerned about possibility of multiple configurations
per platform. Keeping them in sync could be pain.
Do you have suggestions on this?
Quoted 11 lines
Best regards,
Wolfgang Denk
Signature · 4 lines
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: wd at denx.de Lack of skill dictates economy of style. - Joey Ramone
PATCH v2 1/1 omap3evm: Support for quick boot
Dear "Premi, Sanjeev",
Quoted 8 lines · In message <[email protected]> you…
Quoted 3 lines
This has the additional benefit that you can actually build both configurations without the need to modify any source files.
[sp] Was only concerned about possibility of multiple configurations
per platform. Keeping them in sync could be pain.Do you have suggestions on this?
Well, if the common parts are indeed in some common header file, then the remaining content should all be specific for the selected configuration, so what needs to be kept in sync?
Best regards,
Wolfgang Denk
Signature · 4 lines
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: wd at denx.de I paid too much for it, but its worth it.
Premi
PATCH v2 1/1 omap3evm: Support for quick boot
Quoted 16 lines
-----Original Message-----
From: Wolfgang Denk [mailto:wd at denx.de]
Sent: Wednesday, October 27, 2010 8:32 PM
To: Premi, Sanjeev
Cc: u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH v2] omap3evm: Support for quick bootDear "Premi, Sanjeev",
In message <[email protected]>
Quoted 4 lines · you
Quoted 3 lines
This has the additional benefit that you can actually build both configurations without the need to modify any source files.
Quoted 8 lines
Quoted 4 lines
[sp] Was only concerned about possibility of multiple configurations
per platform. Keeping them in sync could be pain.Do you have suggestions on this?
Well, if the common parts are indeed in some common header file, then the remaining content should all be specific for the selected configuration, so what needs to be kept in sync?
I think I have been able to do what you have suggested above. But got a small set of config options that could be duplicated.
I am following this mail with an RFC series with specific code changes. Have tried to be explicit in my comments. There is one TBD in 2/3 that indicates possible duplication.
Your comments would be really useful.
Best regards,
Sanjeev
Quoted 11 lines
Best regards,
Wolfgang Denk
Signature · 4 lines
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: wd at denx.de I paid too much for it, but its worth it.