disk/part.c: Make features optional
Subsystems (2)
PATCH 1/3 disk/part.c: Make features optional
If we don't want to build support for any partition types we can now add #undef CONFIG_PARTITIONS in a board config file to keep this from being compiled in. Otherwise boards assume this is compiled in by default
--- common/cmd_mmc.c | 2 ++ disk/Makefile | 2 +- drivers/mmc/mmc.c | 2 ++ include/config_defaults.h | 1 + 4 files changed, 6 insertions(+), 1 deletions(-)
common/cmd_mmc.c +2 -0
@@ -168,7 +168,9 @@ int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) mmc_dev =mmc_get_dev (dev);if (mmc_dev !=NULL && mmc_dev->type !=DEV_TYPE_UNKNOWN ) { +#ifdef CONFIG_PARTITIONS print_part (mmc_dev); +#endif return 0 ; }
disk/Makefile +1 -1
@@ -27,7 +27,7 @@ include $(TOPDIR)/config.mk LIB = $(obj)libdisk.o -COBJS-y += part.o +COBJS-$(CONFIG_PARTITIONS) += part.o COBJS-$(CONFIG_MAC_PARTITION) += part_mac.o COBJS-$(CONFIG_DOS_PARTITION) += part_dos.o COBJS-$(CONFIG_ISO_PARTITION) += part_iso.o
drivers/mmc/mmc.c +2 -0
@@ -1012,7 +1012,9 @@ int mmc_startup(struct mmc *mmc) (mmc->cid[1] >> 8) & 0xff, mmc->cid[1] & 0xff);sprintf (mmc->block_dev.revision,"%d.%d" , mmc->cid[2 ] >>28 , (mmc->cid[2 ] >>24 ) &0xf ); +#ifdef CONFIG_PARTITIONS init_part (&mmc->block_dev); +#endif return 0 ; }
include/config_defaults.h +1 -0
@@ -16,5 +16,6 @@#define CONFIG_GZIP 1#define CONFIG_ZLIB 1 +#define CONFIG_PARTITIONS 1#endif
Signature · 1 line
1.7.3.4
PATCH 2/3 common/cmd_nand.c: add ifdef protection for do_bootm
Right now we do not check if do_bootm is actually built into this u-boot. Instead check define and only call do_bootm if it's actually available.
--- common/cmd_nand.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
common/cmd_nand.c +2 -0
@@ -806,9 +806,11 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand, local_args[0 ] = cmd; local_args[1 ] =NULL ; +#ifdef CONFIG_CMD_BOOTM printf ("Automatic boot of image at addr 0x%08lx ...\n" , addr);do_bootm (cmdtp,0 ,1 , local_args); +#endif return 1 ; }return 0 ;
Signature · 1 line
1.7.3.4
PATCH 3/3 common/cmd_ximg.c: add ifdef protection for gzip uncompression
Print a message if we do not have the ability to uncompress a gzip image. Before, u-boot would just assume the routines were available
--- common/cmd_ximg.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
common/cmd_ximg.c +6 -0
@@ -216,12 +216,18 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])#endif /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */ break ;case IH_COMP_GZIP : +#ifdef CONFIG_GZIP printf (" Uncompressing part %d ... " , part);if (gunzip ((void *) dest, unc_len, (uchar *) data, &len) !=0 ) {puts ("GUNZIP ERROR - image not loaded\n" );return 1 ; } +#else +printf (" gzip decompression not supported in this" +" build!\n" ); +return 1 ; +#endif break ;#if defined(CONFIG_BZIP2 )case IH_COMP_BZIP2 :
Signature · 1 line
1.7.3.4
PATCH 1/3 disk/part.c: Make features optional
In reply to Matthew McClintockQuoted 5 lines · Matthew McClintock
If we don't want to build support for any partition types we can now add #undef
CONFIG_PARTITIONSin a board config file to keep this from being compiled in. Otherwise boards assume this is compiled in by default
Quoted 7 lines
Signed-off-by Matthew McClintock <[email protected]>---
common/cmd_mmc.c | 2 ++ disk/Makefile | 2 +- drivers/mmc/mmc.c | 2 ++ include/config_defaults.h | 1 + 4 files changed, 6 insertions(+), 1 deletions(-)
Can you re-submit against at least v2011.06-rc1, this doesn't apply for me there.
- k
PATCH v2 1/3 disk/part.c: Make features optional
If we don't want to build support for any partition types we can now add #undef CONFIG_PARTITIONS in a board config file to keep this from being compiled in. Otherwise boards assume this is compiled in by default
---
v2: Fix patch to apply to current tree
Note: This includes the fixes for MMC only. USB/SATA/etc need to do something similiar
common/cmd_mmc.c | 2 ++ disk/Makefile | 2 +- drivers/mmc/mmc.c | 2 ++ include/config_defaults.h | 1 + 4 files changed, 6 insertions(+), 1 deletions(-)
common/cmd_mmc.c +2 -0
@@ -180,7 +180,9 @@ int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) mmc_dev =mmc_get_dev (curr_device);if (mmc_dev !=NULL && mmc_dev->type !=DEV_TYPE_UNKNOWN ) { +#ifdef CONFIG_PARTITIONS print_part (mmc_dev); +#endif return 0 ; }
disk/Makefile +1 -1
@@ -27,7 +27,7 @@ include $(TOPDIR)/config.mk LIB = $(obj)libdisk.o -COBJS-y += part.o +COBJS-$(CONFIG_PARTITIONS) += part.o COBJS-$(CONFIG_MAC_PARTITION) += part_mac.o COBJS-$(CONFIG_DOS_PARTITION) += part_dos.o COBJS-$(CONFIG_ISO_PARTITION) += part_iso.o
drivers/mmc/mmc.c +2 -0
@@ -1007,7 +1007,9 @@ int mmc_startup(struct mmc *mmc) (mmc->cid[1] >> 8) & 0xff, mmc->cid[1] & 0xff);sprintf (mmc->block_dev.revision,"%d.%d" , mmc->cid[2 ] >>28 , (mmc->cid[2 ] >>24 ) &0xf ); +#ifdef CONFIG_PARTITIONS init_part (&mmc->block_dev); +#endif return 0 ; }
include/config_defaults.h +1 -0
@@ -16,5 +16,6 @@#define CONFIG_GZIP 1#define CONFIG_ZLIB 1 +#define CONFIG_PARTITIONS 1#endif
Signature · 1 line
1.7.3.4
PATCH v2 1/3 disk/part.c: Make features optional
common/cmd_mmc.c int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, · line 185
Quoted 9 lines · On Monday, May 23, 2011 17:49:42 Matthew McClintock wrote:
common/cmd_mmc.c +2
-0@@ -180,7 +180,9 @@ int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) mmc_dev = mmc_get_dev(curr_device);if (mmc_dev !=NULL && mmc_dev->type !=DEV_TYPE_UNKNOWN ) { +#ifdef CONFIG_PARTITIONS print_part (mmc_dev); +#endif
how about adding this logic to the header ? then print_part() is transparently turned into a stub for all users ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110523/1991a95f/attachment.pgp
PATCH 3/3 common/cmd_ximg.c: add ifdef protection for gzip uncompression
In reply to Matthew McClintockQuoted 6 lines · On Monday, May 23, 2011 14:29:13 Matthew McClintock wrote:
common/cmd_ximg.c +1
-0break ;case IH_COMP_GZIP : +#ifdef CONFIG_GZIP printf (" Uncompressing part %d ... " , part);
common/cmd_ximg.c do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) · line 230
Quoted 10 lines
common/cmd_ximg.c +5
-0if (gunzip ((void *) dest, unc_len, (uchar *) data, &len) !=0 ) {puts ("GUNZIP ERROR - image not loaded\n" );return 1 ; } +#else +printf (" gzip decompression not supported in this" +" build!\n" ); +return 1 ; +#endif
a few things ...
- dont split string constants
- if you arent using any formats, then puts() is better
- the #else isnt even necessary ... wrap the "case" in the #ifdef too, and
then at runtime this will automatically fall through to the already existing
default: case
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110523/885b6143/attachment.pgp
PATCH 2/3 common/cmd_nand.c: add ifdef protection for do_bootm
In reply to Matthew McClintockQuoted 3 lines · On Monday, May 23, 2011 14:29:12 Matthew McClintock wrote:
Right now we do not check if
do_bootmis actually built into this u-boot. Instead check define and only calldo_bootmif it's actually available.
basic idea is sound ...
Quoted 4 lines
common/cmd_nand.c +0
-0@@ -806,9 +806,11 @@ local_args[0 ] = cmd;
common/cmd_nand.c line 816
Quoted 10 lines
common/cmd_nand.c +2
-0local_args[1 ] =NULL ; +#ifdef CONFIG_CMD_BOOTM printf ("Automatic boot of image at addr 0x%08lx ...\n" , addr);do_bootm (cmdtp,0 ,1 , local_args); +#endif return 1 ; }return 0 ;
there should be a space after the "#ifdef", not a tab. and the ifdef should be around the local_args[] too.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110523/154ab8b8/attachment.pgp
PATCH v3 1/3 disk/part.c: Make features optional
In reply to Mike FrysingerIf we don't want to build support for any partition types we can now add #undef CONFIG_PARTITIONS in a board config file to keep this from being compiled in. Otherwise boards assume this is compiled in by default
---
v2: Fix patch to apply to current tree
v3: Add stubs to header file instead of each place function is called,
this lets usb/sata/etc compile with partitions disabled. However, I have done limited testing on interfaces besides MMC
common/cmd_ide.c | 2 ++ common/cmd_sata.c | 2 ++ common/cmd_scsi.c | 3 ++- common/usb_storage.c | 3 ++- disk/Makefile | 2 +- drivers/block/mg_disk.c | 2 ++ drivers/block/systemace.c | 2 ++ drivers/mmc/mmc.c | 2 ++ include/config_defaults.h | 1 + include/part.h | 16 ++++++++++++++++ 10 files changed, 32 insertions(+), 3 deletions(-)
common/cmd_ide.c +2 -0
@@ -732,10 +732,12 @@ void ide_init (void)/* ------------------------------------------------------------------------- */ +#ifdef CONFIG_PARTITIONS block_dev_desc_t *ide_get_dev (int dev) {return (dev <CONFIG_SYS_IDE_MAXDEVICE ) ? &ide_dev_desc[dev] :NULL ; } +#endif #ifdef CONFIG_IDE_8xx_DIRECT
common/cmd_sata.c +2 -0
@@ -57,10 +57,12 @@ int __sata_initialize(void) }int sata_initialize (void ) __attribute__((weak,alias ("__sata_initialize" ))); +#ifdef CONFIG_PARTITIONS block_dev_desc_t *sata_get_dev (int dev) {return (dev <CONFIG_SYS_SATA_MAX_DEVICE ) ? &sata_dev_desc[dev] :NULL ; } +#endif int do_sata (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) {
common/cmd_scsi.c +2 -1
@@ -193,11 +193,12 @@ void scsi_init(void)scsi_scan (1 ); } +#ifdef CONFIG_PARTITIONS block_dev_desc_t *scsi_get_dev (int dev) {return (dev <CONFIG_SYS_SCSI_MAX_DEVICE ) ? &scsi_dev_desc[dev] :NULL ; } - +#endif /****************************************************************************** * scsi boot command intepreter. Derived from diskboot
common/usb_storage.c +2 -1
@@ -173,11 +173,12 @@ unsigned long usb_stor_write(int device, unsigned long blknr,struct usb_device *usb_get_dev_index (int index);void uhci_show_temp_int_td (void ); +#ifdef CONFIG_PARTITIONS block_dev_desc_t *usb_stor_get_dev (int index) {return (index < usb_max_devs) ? &usb_dev_desc[index] :NULL ; } - +#endif void usb_show_progress (void ) {
disk/Makefile +1 -1
@@ -27,7 +27,7 @@ include $(TOPDIR)/config.mk LIB = $(obj)libdisk.o -COBJS-y += part.o +COBJS-$(CONFIG_PARTITIONS) += part.o COBJS-$(CONFIG_MAC_PARTITION) += part_mac.o COBJS-$(CONFIG_DOS_PARTITION) += part_dos.o COBJS-$(CONFIG_ISO_PARTITION) += part_iso.o
drivers/block/mg_disk.c +2 -0
@@ -522,10 +522,12 @@ mg_write_exit:return err; } +#ifdef CONFIG_PARTITIONS block_dev_desc_t *mg_disk_get_dev (int dev) {return ((block_dev_desc_t *) & mg_disk_dev); } +#endif /* must override this function */ struct mg_drv_data * __attribute__((weak)) mg_get_drv_data (void)
drivers/block/systemace.c +2 -0
@@ -104,6 +104,7 @@ static void release_cf_lock(void)ace_writew ((val &0xffff ),0x18 ); } +#ifdef CONFIG_PARTITIONS block_dev_desc_t *systemace_get_dev (int dev) {/* The first time through this, the systemace_dev object is
@@ -128,6 +129,7 @@ block_dev_desc_t *systemace_get_dev(int dev) return &systemace_dev; } +#endif /* * This function is called (by dereferencing the block_read pointer in
drivers/mmc/mmc.c +2 -0
@@ -1054,12 +1054,14 @@ int mmc_register(struct mmc *mmc)return 0 ; } +#ifdef CONFIG_PARTITIONS block_dev_desc_t *mmc_get_dev (int dev) {struct mmc *mmc =find_mmc_device (dev);return mmc ? &mmc->block_dev :NULL ; } +#endif int mmc_init (struct mmc *mmc) {
include/config_defaults.h +1 -0
@@ -16,5 +16,6 @@#define CONFIG_GZIP 1#define CONFIG_ZLIB 1 +#define CONFIG_PARTITIONS 1#endif
include/part.h +17 -1
@@ -93,6 +93,7 @@ typedef struct disk_partition { } disk_partition_t;/* Misc _get_dev functions */ +#ifdef CONFIG_PARTITIONS block_dev_desc_t *get_dev (char * ifname,int dev);block_dev_desc_t *ide_get_dev (int dev);block_dev_desc_t *sata_get_dev (int dev);
@@ -107,7 +108,22 @@ int get_partition_info (block_dev_desc_t * dev_desc, int part, disk_partition_tvoid print_part (block_dev_desc_t *dev_desc);void init_part (block_dev_desc_t *dev_desc);void dev_print (block_dev_desc_t *dev_desc); - +#else +static inline block_dev_desc_t *get_dev (char * ifname,int dev) {return NULL ; } +static inline block_dev_desc_t *ide_get_dev (int dev) {return NULL ; } +static inline block_dev_desc_t *sata_get_dev (int dev) {return NULL ; } +static inline block_dev_desc_t *scsi_get_dev (int dev) {return NULL ; } +static inline block_dev_desc_t *usb_stor_get_dev (int dev) {return NULL ; } +static inline block_dev_desc_t *mmc_get_dev (int dev) {return NULL ; } +static inline block_dev_desc_t *systemace_get_dev (int dev) {return NULL ; } +static inline block_dev_desc_t *mg_disk_get_dev (int dev) {return NULL ; } + +static inline int get_partition_info (block_dev_desc_t * dev_desc,int part, +disk_partition_t *info) {return -1 ; } +static inline void print_part (block_dev_desc_t *dev_desc) {} +static inline void init_part (block_dev_desc_t *dev_desc) {} +static inline void dev_print (block_dev_desc_t *dev_desc) {} +#endif #ifdef CONFIG_MAC_PARTITION /* disk/part_mac.c */
Signature · 1 line
1.7.3.4
PATCH v2 2/3 common/cmd_nand.c: add ifdef protection for do_bootm
In reply to Mike FrysingerRight now we do not check if do_bootm is actually built into this u-boot. Instead check define and only call do_bootm if it's actually available.
---
v2: Add ifdef protect for the whole autostart/autoboot block as it's not
supported when the bootm command is not available
common/cmd_nand.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
common/cmd_nand.c +2 -0
@@ -799,6 +799,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand, load_addr = addr; +#ifdef CONFIG_CMD_BOOTM /* Check if we should attempt an auto-start */ if (((ep =getenv ("autostart" )) !=NULL ) && (strcmp (ep,"yes" ) ==0 )) {char *local_args[2 ];
@@ -811,6 +812,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,do_bootm (cmdtp,0 ,1 , local_args); return 1; } +#endif return 0 ; }
Signature · 1 line
1.7.3.4
PATCH v2 3/3 common/cmd_ximg.c: add ifdef protection for gzip uncompression
In reply to Mike FrysingerPrint a message if we do not have the ability to uncompress a gzip image. Before, u-boot would just assume the routines were available
---
v2: If gzip is not available block out case statement and let it fall through
to the default case
common/cmd_ximg.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
common/cmd_ximg.c +2 -0
@@ -215,6 +215,7 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])memmove ((char *) dest, (char *)data, len);#endif /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */ break ; +#ifdef CONFIG_GZIP case IH_COMP_GZIP :printf (" Uncompressing part %d ... " , part); if (gunzip ((void *) dest, unc_len,
@@ -223,6 +224,7 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])return 1 ; }break ; +#endif #if defined(CONFIG_BZIP2 )case IH_COMP_BZIP2 : {
Signature · 1 line
1.7.3.4
PATCH v2 2/3 common/cmd_nand.c: add ifdef protection for do_bootm
In reply to Matthew McClintockQuoted 3 lines · On Tuesday, May 24, 2011 11:47:39 Matthew McClintock wrote:
Right now we do not check if
do_bootmis actually built into this u-boot. Instead check define and only calldo_bootmif it's actually available.
actually, if you dont mind, i'd like to obsolete this patch with the one below. what do you think ?
-mike
common/cmd_bootm.c +15 -0
@@ -707,6 +707,21 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])return 1 ; } +int bootm_maybe_autostart (cmd_tbl_t *cmdtp,const char *cmd) +{ +const char *ep =getenv ("autostart" ); + +if (ep && !strcmp (ep,"yes" )) { +char *const local_args[2 ]; + local_args[0 ] = cmd; + local_args[1 ] =NULL ; +printf ("Automatic boot of image at addr 0x%08lX ...\n" , addr); +return do_bootm (cmdtp,0 ,1 , local_args); + } + +return 0 ; +} +/** * image_get_kernel - verify legacy format kernel image * @img_addr: in RAM address of the legacy format image to be verified
common/cmd_fdc.c +1 -14
@@ -722,7 +722,6 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])unsigned char boot_drive;int i,nrofblk;char *ep; -int rcode =0 ;#if defined(CONFIG_FIT )const void *fit_hdr =NULL ;#endif
@@ -823,19 +822,7 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])/* Loading ok, update default load address */ load_addr = addr; -/* Check if we should attempt an auto-start */ -if (((ep =getenv ("autostart" )) !=NULL ) && (strcmp (ep,"yes" ) ==0 )) { -char *local_args[2 ]; - - local_args[0 ] = argv[0 ]; - local_args[1 ] =NULL ; - -printf ("Automatic boot of image at addr 0x%08lX ...\n" , addr); - -do_bootm (cmdtp,0 ,1 , local_args); - rcode ++; - } -return rcode; +return bootm_maybe_autostart (cmdtp, argv[0 ]); } U_BOOT_CMD(
common/cmd_fdos.c +1 -10
@@ -40,7 +40,6 @@ int do_fdosboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])char *name;char *ep;int size; -int rcode =0 ;char buf [12 ];int drive =CONFIG_SYS_FDC_DRIVE_NUMBER ;
@@ -98,15 +97,7 @@ int do_fdosboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])printf ("Floppy DOS load complete: %d bytes loaded to 0x%lx\n" , size, load_addr); -/* Check if we should attempt an auto-start */ -if (((ep =getenv ("autostart" )) !=NULL ) && (strcmp (ep,"yes" ) ==0 )) { -char *local_args[2 ]; - local_args[0 ] = argv[0 ]; - local_args[1 ] =NULL ; -printf ("Automatic boot of image at addr 0x%08lX ...\n" , load_addr); - rcode =do_bootm (cmdtp,0 ,1 , local_args); - } -return rcode; +return bootm_maybe_autostart (cmdtp, argv[0 ]); }/*-----------------------------------------------------------------------------
common/cmd_ide.c +1 -14
@@ -356,7 +356,6 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])ulong addr, cnt;disk_partition_t info;image_header_t *hdr; -int rcode =0 ;#if defined(CONFIG_FIT )const void *fit_hdr =NULL ;#endif
@@ -495,19 +494,7 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) load_addr = addr; -/* Check if we should attempt an auto-start */ -if (((ep =getenv ("autostart" )) !=NULL ) && (strcmp (ep,"yes" ) ==0 )) { -char *local_args[2 ]; - - local_args[0 ] = argv[0 ]; - local_args[1 ] =NULL ; - -printf ("Automatic boot of image at addr 0x%08lX ...\n" , addr); - -do_bootm (cmdtp,0 ,1 , local_args); - rcode =1 ; - } -return rcode; +return bootm_maybe_autostart (cmdtp, argv[0 ]); }/* ------------------------------------------------------------------------- */
common/cmd_nand.c +1 -13
@@ -799,19 +799,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand, load_addr = addr; -/* Check if we should attempt an auto-start */ -if (((ep =getenv ("autostart" )) !=NULL ) && (strcmp (ep,"yes" ) ==0 )) { -char *local_args[2 ]; - - local_args[0 ] = cmd; - local_args[1 ] =NULL ; - -printf ("Automatic boot of image at addr 0x%08lx ...\n" , addr); - -do_bootm (cmdtp,0 ,1 , local_args); -return 1 ; - } -return 0 ; +return bootm_maybe_autostart (cmdtp, cmd); }int do_nandboot (cmd_tbl_t * cmdtp,int flag,int argc,char *const argv[])
common/cmd_net.c +2 -11
@@ -210,17 +210,8 @@ netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char * const argv[])/* flush cache */ flush_cache (load_addr, size); -/* Loading ok, check if we should attempt an auto-start */ -if (((s =getenv ("autostart" )) !=NULL ) && (strcmp (s,"yes" ) ==0 )) { -char *local_args[2 ]; - local_args[0 ] = argv[0 ]; - local_args[1 ] =NULL ; - -printf ("Automatic boot of image at addr 0x%08lX ...\n" , - load_addr); -show_boot_progress (82 ); - rcode =do_bootm (cmdtp,0 ,1 , local_args); - } +show_boot_progress (82 ); + rcode =bootm_maybe_autostart (cmdtp, argv[0 ]);if (rcode <0 )show_boot_progress (-83 );
common/cmd_scsi.c +1 -10
@@ -210,7 +210,6 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])ulong addr, cnt;disk_partition_t info;image_header_t *hdr; -int rcode =0 ;#if defined(CONFIG_FIT )const void *fit_hdr =NULL ;#endif
@@ -326,15 +325,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])flush_cache (addr, (cnt+1 )*info.blksz); -/* Check if we should attempt an auto-start */ -if (((ep =getenv ("autostart" )) !=NULL ) && (strcmp (ep,"yes" ) ==0 )) { -char *local_args[2 ]; - local_args[0 ] = argv[0 ]; - local_args[1 ] =NULL ; -printf ("Automatic boot of image at addr 0x%08lX ...\n" , addr); - rcode =do_bootm (cmdtp,0 ,1 , local_args); - } -return rcode; +return bootm_maybe_autostart (cmdtp, argv[0 ]); }/*********************************************************************************
common/cmd_usb.c +2 -11
@@ -356,7 +356,7 @@ int do_usbboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) {char *boot_device =NULL ;char *ep; -int dev, part =1 , rcode; +int dev, part =1 ;ulong addr, cnt;disk_partition_t info;image_header_t *hdr;
@@ -490,16 +490,7 @@ int do_usbboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])flush_cache (addr, (cnt+1 )*info.blksz); -/* Check if we should attempt an auto-start */ -if (((ep =getenv ("autostart" )) !=NULL ) && (strcmp (ep,"yes" ) ==0 )) { -char *local_args[2 ]; - local_args[0 ] = argv[0 ]; - local_args[1 ] =NULL ; -printf ("Automatic boot of image@addr 0x%08lX ...\n" , addr); - rcode =do_bootm (cmdtp,0 ,1 , local_args); -return rcode; - } - return 0; + return maybe_autostart(cmdtp, argv[0]); }#endif /* CONFIG_USB_STORAGE */
include/command.h +8 -0
@@ -98,7 +98,15 @@ extern int cmd_get_data_size(char* arg, int default_size);#ifdef CONFIG_CMD_BOOTD extern int do_bootd (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]);#endif +#ifdef CONFIG_CMD_BOOTM extern int do_bootm (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]); +extern int bootm_maybe_autostart (cmd_tbl_t *cmdtp,const char *cmd); +#else +static inline int bootm_maybe_autostart (cmd_tbl_t *cmdtp,const char *cmd) +{ +return 0 ; +} +#endif extern int do_reset (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]);#endif /* __ASSEMBLY__ */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110601/f0b2bffe/attachment.pgp
PATCH v2 2/3 common/cmd_nand.c: add ifdef protection for do_bootm
common/cmd_bootm.c int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) · line 710
Quoted 13 lines · Mike Frysinger
actually, if you dont mind, i'd like to obsolete this patch with the one below. ?what do you think ?
(quoted diff) +0
-1-mikecommon/cmd_bootm.c +1
-0@@ -707,6 +707,21 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ? ? ? ?return 1; ?} +int bootm_maybe_autostart (cmd_tbl_t *cmdtp,const char *cmd)
I don't tink this will work since if we undef CONFIG_CMD_BOOTM we don't even compile common/cmd_bootm.c.
-M
PATCH v2 2/3 common/cmd_nand.c: add ifdef protection for do_bootm
Quoted 12 lines · On Wednesday, June 01, 2011 11:55:03 McClintock Matthew-B29882 wrote:
Quoted 11 lines · Mike Frysinger
actually, if you dont mind, i'd like to obsolete this patch with the one below. what do you think ?
common/cmd_bootm.c +0
-0@@ -707,6 +707,21 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 1; }
Quoted 4 lines
common/cmd_bootm.c int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) · line 710
Quoted 1 line
common/cmd_bootm.c +1
-0+int bootm_maybe_autostart (cmd_tbl_t *cmdtp,const char *cmd)I don't tink this will work since if we undef
CONFIG_CMD_BOOTMwe don't even compilecommon/cmd_bootm.c.
please double check the patch where it modifies the header
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110601/4ce5fba7/attachment.pgp
PATCH v2 2/3 common/cmd_nand.c: add ifdef protection for do_bootm
In reply to Mike FrysingerQuoted 8 lines · On Wed, 1 Jun 2011 11:10:49 -0400 Mike Frysinger <[email protected]> wrote:
Quoted 3 lines · On Tuesday, May 24, 2011 11:47:39 Matthew McClintock wrote:
Right now we do not check if
do_bootmis actually built into this u-boot. Instead check define and only calldo_bootmif it's actually available.actually, if you dont mind, i'd like to obsolete this patch with the one below. what do you think ?
-mike
NAND bits Acked-by: Scott Wood <[email protected]>
-Scott
PATCH v2 2/3 common/cmd_nand.c: add ifdef protection for do_bootm
In reply to Mike FrysingerQuoted 4 lines · Mike Frysinger
Quoted 2 lines
I don't tink this will work since if we undef
CONFIG_CMD_BOOTMwe don't even compilecommon/cmd_bootm.c.please double check the patch where it modifies the header
Sorry. I did not get that far. Yes this looks good.
ACK
-M
PATCH v2 2/3 common/cmd_nand.c: add ifdef protection for do_bootm
In reply to Mike FrysingerDear Mike Frysinger,
Quoted 3 lines · In message <[email protected]> you wrote:
actually, if you dont mind, i'd like to obsolete this patch with the one below. what do you think ?
Please submit it as a proper patch then.
Best regards,
Wolfgang Denk
Signature · 5 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 really hate this damned machine It never does quite what I want I wish that they would sell it. But only what I tell it.
PATCH v2 2/3 common/cmd_nand.c: add ifdef protection for do_bootm
Quoted 5 lines · On Wednesday, June 01, 2011 15:21:54 Wolfgang Denk wrote:
Quoted 2 lines · Mike Frysinger
actually, if you dont mind, i'd like to obsolete this patch with the one below. what do you think ?
Please submit it as a proper patch then.
i was going to once i got feedback from the interested parties
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110602/9680a207/attachment.pgp
Wolfgang Denk
AppliedPATCH v2 3/3 common/cmd_ximg.c: add ifdef protection for gzip uncompression
In reply to Matthew McClintockDear Matthew McClintock,
Quoted 10 lines · In message <[email protected]> you wrote:
Print a message if we do not have the ability to uncompress a gzip image. Before, u-boot would just assume the routines were available
Signed-off-by Matthew McClintock <[email protected]>---
v2: If gzip is not available block out case statement and let it fall through
to the default casecommon/cmd_ximg.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 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 go on working for the same reason a hen goes on laying eggs." - H. L. Mencken