From fdcfaa1b02268b2899e374b35adf936c911a47eb Mon Sep 17 00:00:00 2001 From: Zhang Wei Date: Wed, 6 Jun 2007 10:08:13 +0200 Subject: USB event poll support This patch adds USB event poll support, which could be used in usbkbd and other usb devices driver when the asynchronous interrupt processing is supported. Signed-off-by: Zhang Wei Date: Mon, 11 Jun 2007 19:01:43 -0500 Subject: common/cmd_[a-f]* : Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*). This is a compatibility step that allows both the older form and the new form to co-exist for a while until the older can be removed entirely. All transformations are of the form: Before: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) After: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT) Signed-off-by: Jon Loeliger --- common/cmd_autoscript.c | 6 +++--- common/cmd_bdinfo.c | 2 +- common/cmd_bedbug.c | 2 +- common/cmd_bmp.c | 4 ++-- common/cmd_bootm.c | 22 +++++++++++----------- common/cmd_cache.c | 2 +- common/cmd_console.c | 2 +- common/cmd_date.c | 2 +- common/cmd_dcr.c | 2 +- common/cmd_diag.c | 2 +- common/cmd_display.c | 2 +- common/cmd_doc.c | 2 +- common/cmd_dtt.c | 2 +- common/cmd_eeprom.c | 8 ++++---- common/cmd_elf.c | 4 ++-- common/cmd_ext2.c | 4 ++-- common/cmd_fat.c | 2 +- common/cmd_fdc.c | 11 ++++++----- common/cmd_fdos.c | 2 +- common/cmd_flash.c | 14 +++++++------- common/cmd_fpga.c | 4 ++-- 21 files changed, 51 insertions(+), 50 deletions(-) (limited to 'common') diff --git a/common/cmd_autoscript.c b/common/cmd_autoscript.c index e3253022dc..aaca3622bd 100644 --- a/common/cmd_autoscript.c +++ b/common/cmd_autoscript.c @@ -48,7 +48,7 @@ #endif #if defined(CONFIG_AUTOSCRIPT) || \ - (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT ) + (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT) extern image_header_t header; /* from cmd_bootm.c */ int @@ -152,7 +152,7 @@ autoscript (ulong addr) #endif /* CONFIG_AUTOSCRIPT || CFG_CMD_AUTOSCRIPT */ /**************************************************/ -#if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) +#if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT) int do_autoscript (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { @@ -170,7 +170,7 @@ do_autoscript (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return rcode; } -#if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) +#if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT) U_BOOT_CMD( autoscr, 2, 0, do_autoscript, "autoscr - run script from memory\n", diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index d97c09e88e..b5ba2a0374 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -30,7 +30,7 @@ DECLARE_GLOBAL_DATA_PTR; -#if (CONFIG_COMMANDS & CFG_CMD_BDI) +#if (CONFIG_COMMANDS & CFG_CMD_BDI) || defined(CONFIG_CMD_BDI) static void print_num(const char *, ulong); #ifndef CONFIG_ARM /* PowerPC and other */ diff --git a/common/cmd_bedbug.c b/common/cmd_bedbug.c index 48086a6280..4c309f9a9b 100644 --- a/common/cmd_bedbug.c +++ b/common/cmd_bedbug.c @@ -13,7 +13,7 @@ DECLARE_GLOBAL_DATA_PTR; -#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG) +#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG) || defined(CONFIG_CMD_BEDBUG) #ifndef MAX #define MAX(a,b) ((a) > (b) ? (a) : (b)) diff --git a/common/cmd_bmp.c b/common/cmd_bmp.c index ad412c81eb..d5c5bda01c 100644 --- a/common/cmd_bmp.c +++ b/common/cmd_bmp.c @@ -31,7 +31,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_BMP) +#if (CONFIG_COMMANDS & CFG_CMD_BMP) || defined(CONFIG_CMD_BMP) static int bmp_info (ulong addr); static int bmp_display (ulong addr, int x, int y); @@ -188,4 +188,4 @@ static int bmp_display(ulong addr, int x, int y) #endif } -#endif /* (CONFIG_COMMANDS & CFG_CMD_BMP) */ +#endif /* (CONFIG_COMMANDS & CFG_CMD_BMP) || defined(CONFIG_CMD_BMP) */ diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index a6499e8dd9..950e160d65 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -48,7 +48,7 @@ DECLARE_GLOBAL_DATA_PTR; /*cmd_boot.c*/ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); -#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP) +#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) #include #endif @@ -89,11 +89,11 @@ int gunzip (void *, int, unsigned char *, unsigned long *); static void *zalloc(void *, unsigned, unsigned); static void zfree(void *, void *, unsigned); -#if (CONFIG_COMMANDS & CFG_CMD_IMI) +#if (CONFIG_COMMANDS & CFG_CMD_IMI) || defined(CONFIG_CMD_IMI) static int image_info (unsigned long addr); #endif -#if (CONFIG_COMMANDS & CFG_CMD_IMLS) +#if (CONFIG_COMMANDS & CFG_CMD_IMLS) || defined(CONFIG_CMD_IMLS) #include extern flash_info_t flash_info[]; /* info for FLASH chips */ static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); @@ -133,7 +133,7 @@ static void fixup_silent_linux (void); #endif static boot_os_Fcn do_bootm_netbsd; static boot_os_Fcn do_bootm_rtems; -#if (CONFIG_COMMANDS & CFG_CMD_ELF) +#if (CONFIG_COMMANDS & CFG_CMD_ELF) || defined(CONFIG_CMD_ELF) static boot_os_Fcn do_bootm_vxworks; static boot_os_Fcn do_bootm_qnxelf; int do_bootvx ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] ); @@ -440,7 +440,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) addr, len_ptr, verify); break; -#if (CONFIG_COMMANDS & CFG_CMD_ELF) +#if (CONFIG_COMMANDS & CFG_CMD_ELF) || defined(CONFIG_CMD_ELF) case IH_OS_VXWORKS: do_bootm_vxworks (cmdtp, flag, argc, argv, addr, len_ptr, verify); @@ -1219,7 +1219,7 @@ do_bootm_artos (cmd_tbl_t *cmdtp, int flag, #endif -#if (CONFIG_COMMANDS & CFG_CMD_BOOTD) +#if (CONFIG_COMMANDS & CFG_CMD_BOOTD) || defined(CONFIG_CMD_BOOTD) int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { int rcode = 0; @@ -1247,7 +1247,7 @@ U_BOOT_CMD( #endif -#if (CONFIG_COMMANDS & CFG_CMD_IMI) +#if (CONFIG_COMMANDS & CFG_CMD_IMI) || defined(CONFIG_CMD_IMI) int do_iminfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { int arg; @@ -1317,7 +1317,7 @@ U_BOOT_CMD( #endif /* CFG_CMD_IMI */ -#if (CONFIG_COMMANDS & CFG_CMD_IMLS) +#if (CONFIG_COMMANDS & CFG_CMD_IMLS) || defined(CONFIG_CMD_IMLS) /*----------------------------------------------------------------------- * List all images found in flash. */ @@ -1378,13 +1378,13 @@ U_BOOT_CMD( void print_image_hdr (image_header_t *hdr) { -#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP) +#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) time_t timestamp = (time_t)ntohl(hdr->ih_time); struct rtc_time tm; #endif printf (" Image Name: %.*s\n", IH_NMLEN, hdr->ih_name); -#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP) +#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) to_tm (timestamp, &tm); printf (" Created: %4d-%02d-%02d %2d:%02d:%02d UTC\n", tm.tm_year, tm.tm_mon, tm.tm_mday, @@ -1588,7 +1588,7 @@ do_bootm_rtems (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], (*entry_point ) ( gd->bd ); } -#if (CONFIG_COMMANDS & CFG_CMD_ELF) +#if (CONFIG_COMMANDS & CFG_CMD_ELF) || defined(CONFIG_CMD_ELF) static void do_bootm_vxworks (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], ulong addr, ulong *len_ptr, int verify) diff --git a/common/cmd_cache.c b/common/cmd_cache.c index 6c250bc1c0..29ca6213f0 100644 --- a/common/cmd_cache.c +++ b/common/cmd_cache.c @@ -27,7 +27,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_CACHE) +#if (CONFIG_COMMANDS & CFG_CMD_CACHE) || defined(CONFIG_CMD_CACHE) static int on_off (const char *); diff --git a/common/cmd_console.c b/common/cmd_console.c index 1bd3709bd6..70f8a20649 100644 --- a/common/cmd_console.c +++ b/common/cmd_console.c @@ -28,7 +28,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_CONSOLE) +#if (CONFIG_COMMANDS & CFG_CMD_CONSOLE) || defined(CONFIG_CMD_CONSOLE) extern void _do_coninfo (void); int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char *argv[]) diff --git a/common/cmd_date.c b/common/cmd_date.c index 33d2e5661e..7b7f547ddb 100644 --- a/common/cmd_date.c +++ b/common/cmd_date.c @@ -31,7 +31,7 @@ DECLARE_GLOBAL_DATA_PTR; -#if (CONFIG_COMMANDS & CFG_CMD_DATE) +#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_CMD_DATE) const char *weekdays[] = { "Sun", "Mon", "Tues", "Wednes", "Thurs", "Fri", "Satur", diff --git a/common/cmd_dcr.c b/common/cmd_dcr.c index 7221a865ed..31c732e8da 100644 --- a/common/cmd_dcr.c +++ b/common/cmd_dcr.c @@ -29,7 +29,7 @@ #include #include -#if defined(CONFIG_4xx) && (CONFIG_COMMANDS & CFG_CMD_SETGETDCR) +#if defined(CONFIG_4xx) && ((CONFIG_COMMANDS & CFG_CMD_SETGETDCR) || defined(CONFIG_CMD_SETGETDCR)) unsigned long get_dcr (unsigned short); unsigned long set_dcr (unsigned short, unsigned long); diff --git a/common/cmd_diag.c b/common/cmd_diag.c index 45c4b31f5f..7293457c5d 100644 --- a/common/cmd_diag.c +++ b/common/cmd_diag.c @@ -28,7 +28,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_DIAG) && defined(CONFIG_POST) +#if ((CONFIG_COMMANDS & CFG_CMD_DIAG) || defined(CONFIG_CMD_DIAG)) && defined(CONFIG_POST) int do_diag (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) { diff --git a/common/cmd_display.c b/common/cmd_display.c index abee8444e2..f2e7e88062 100644 --- a/common/cmd_display.c +++ b/common/cmd_display.c @@ -24,7 +24,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_DISPLAY) +#if (CONFIG_COMMANDS & CFG_CMD_DISPLAY) || defined(CONFIG_CMD_DISPLAY) #undef DEBUG_DISP diff --git a/common/cmd_doc.c b/common/cmd_doc.c index ab37516953..4293aa18cf 100644 --- a/common/cmd_doc.c +++ b/common/cmd_doc.c @@ -19,7 +19,7 @@ # define SHOW_BOOT_PROGRESS(arg) #endif -#if (CONFIG_COMMANDS & CFG_CMD_DOC) +#if (CONFIG_COMMANDS & CFG_CMD_DOC) || defined(CONFIG_CMD_DOC) #include #include diff --git a/common/cmd_dtt.c b/common/cmd_dtt.c index 4f7b049d79..b220ecb2fb 100644 --- a/common/cmd_dtt.c +++ b/common/cmd_dtt.c @@ -25,7 +25,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_DTT) +#if (CONFIG_COMMANDS & CFG_CMD_DTT) || defined(CONFIG_CMD_DTT) #include #include diff --git a/common/cmd_eeprom.c b/common/cmd_eeprom.c index d15a412057..b4467e89cd 100644 --- a/common/cmd_eeprom.c +++ b/common/cmd_eeprom.c @@ -42,7 +42,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_EEPROM) || defined(CFG_ENV_IS_IN_EEPROM) +#if (CONFIG_COMMANDS & CFG_CMD_EEPROM) || defined(CFG_ENV_IS_IN_EEPROM) || defined(CONFIG_CMD_EEPROM) extern void eeprom_init (void); extern int eeprom_read (unsigned dev_addr, unsigned offset, @@ -62,7 +62,7 @@ extern int eeprom_write_enable (unsigned dev_addr, int state); /* ------------------------------------------------------------------------- */ -#if (CONFIG_COMMANDS & CFG_CMD_EEPROM) +#if (CONFIG_COMMANDS & CFG_CMD_EEPROM) || defined(CONFIG_CMD_EEPROM) int do_eeprom ( cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) { const char *const fmt = @@ -121,7 +121,7 @@ int do_eeprom ( cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) * 0x00000nxx for EEPROM address selectors and page number at n. */ -#if (CONFIG_COMMANDS & CFG_CMD_EEPROM) || defined(CFG_ENV_IS_IN_EEPROM) +#if (CONFIG_COMMANDS & CFG_CMD_EEPROM) || defined(CFG_ENV_IS_IN_EEPROM) || defined(CONFIG_CMD_EEPROM) #ifndef CONFIG_SPI #if !defined(CFG_I2C_EEPROM_ADDR_LEN) || CFG_I2C_EEPROM_ADDR_LEN < 1 || CFG_I2C_EEPROM_ADDR_LEN > 2 @@ -425,7 +425,7 @@ void eeprom_init (void) #endif /* CFG_CMD_EEPROM */ /***************************************************/ -#if (CONFIG_COMMANDS & CFG_CMD_EEPROM) +#if (CONFIG_COMMANDS & CFG_CMD_EEPROM) || defined(CONFIG_CMD_EEPROM) #ifdef CFG_I2C_MULTI_EEPROMS U_BOOT_CMD( diff --git a/common/cmd_elf.c b/common/cmd_elf.c index 0e3d56f6bb..cc8a8daa70 100644 --- a/common/cmd_elf.c +++ b/common/cmd_elf.c @@ -23,7 +23,7 @@ DECLARE_GLOBAL_DATA_PTR; #endif -#if (CONFIG_COMMANDS & CFG_CMD_ELF) +#if (CONFIG_COMMANDS & CFG_CMD_ELF) || defined(CONFIG_CMD_ELF) #ifndef MAX #define MAX(a,b) ((a) > (b) ? (a) : (b)) @@ -101,7 +101,7 @@ int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) else addr = simple_strtoul (argv[1], NULL, 16); -#if (CONFIG_COMMANDS & CFG_CMD_NET) +#if (CONFIG_COMMANDS & CFG_CMD_NET) || defined(CONFIG_CMD_NET) /* Check to see if we need to tftp the image ourselves before starting */ if ((argc == 2) && (strcmp (argv[1], "tftp") == 0)) { diff --git a/common/cmd_ext2.c b/common/cmd_ext2.c index 94bd9b61e6..d0999acd9e 100644 --- a/common/cmd_ext2.c +++ b/common/cmd_ext2.c @@ -35,14 +35,14 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_EXT2) +#if (CONFIG_COMMANDS & CFG_CMD_EXT2) || defined(CONFIG_CMD_EXT2) #include #include #include #include #include #include -#if ((CONFIG_COMMANDS & CFG_CMD_USB) && defined(CONFIG_USB_STORAGE)) +#if (((CONFIG_COMMANDS & CFG_CMD_USB) || defined(CONFIG_CMD_USB)) && defined(CONFIG_USB_STORAGE)) #include #endif diff --git a/common/cmd_fat.c b/common/cmd_fat.c index afaf299569..f7e6c86dc2 100644 --- a/common/cmd_fat.c +++ b/common/cmd_fat.c @@ -31,7 +31,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_FAT) +#if (CONFIG_COMMANDS & CFG_CMD_FAT) || defined(CONFIG_CMD_FAT) #undef DEBUG diff --git a/common/cmd_fdc.c b/common/cmd_fdc.c index 03f4ce6d34..3c2ba56bb3 100644 --- a/common/cmd_fdc.c +++ b/common/cmd_fdc.c @@ -47,11 +47,12 @@ #endif -/*#if (CONFIG_COMMANDS & CFG_CMD_DATE) */ +/*#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_CMD_DATE) */ /*#include */ /*#endif */ -#if ((CONFIG_COMMANDS & CFG_CMD_FDC) || (CONFIG_COMMANDS & CFG_CMD_FDOS)) +#if (CONFIG_COMMANDS & CFG_CMD_FDC) || defined(CONFIG_CMD_FDC) \ + || (CONFIG_COMMANDS & CFG_CMD_FDOS) || defined(CONFIG_CMD_FDOS) typedef struct { @@ -709,7 +710,7 @@ int fdc_setup(int drive, FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG) } #endif /* ((CONFIG_COMMANDS & CFG_CMD_FDC)||(CONFIG_COMMANDS & CFG_CMD_FDOS))*/ -#if (CONFIG_COMMANDS & CFG_CMD_FDOS) +#if (CONFIG_COMMANDS & CFG_CMD_FDOS) || defined(CONFIG_CMD_FDOS) /* Low level functions for the Floppy-DOS layer */ @@ -774,7 +775,7 @@ int fdc_fdos_read (void *buffer, int len) } #endif /* (CONFIG_COMMANDS & CFG_CMD_FDOS) */ -#if (CONFIG_COMMANDS & CFG_CMD_FDC) +#if (CONFIG_COMMANDS & CFG_CMD_FDC) || defined(CONFIG_CMD_FDC) /**************************************************************************** * main routine do_fdcboot */ @@ -886,7 +887,7 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) /***************************************************/ -#if (CONFIG_COMMANDS & CFG_CMD_FDC) +#if (CONFIG_COMMANDS & CFG_CMD_FDC) || defined(CONFIG_CMD_FDC) U_BOOT_CMD( fdcboot, 3, 1, do_fdcboot, diff --git a/common/cmd_fdos.c b/common/cmd_fdos.c index dc02b3595c..8208d7b82f 100644 --- a/common/cmd_fdos.c +++ b/common/cmd_fdos.c @@ -31,7 +31,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_FDOS) +#if (CONFIG_COMMANDS & CFG_CMD_FDOS) || defined(CONFIG_CMD_FDOS) /*----------------------------------------------------------------------------- * do_fdosboot -- diff --git a/common/cmd_flash.c b/common/cmd_flash.c index a34ab79c3d..4744e97767 100644 --- a/common/cmd_flash.c +++ b/common/cmd_flash.c @@ -31,9 +31,9 @@ #include #endif -#if (CONFIG_COMMANDS & CFG_CMD_FLASH) +#if (CONFIG_COMMANDS & CFG_CMD_FLASH) || defined(CONFIG_CMD_FLASH) -#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) +#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2)) && defined(CONFIG_JFFS2_CMDLINE) #include /* parition handling routines */ @@ -311,7 +311,7 @@ int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) flash_info_t *info; ulong bank, addr_first, addr_last; int n, sect_first, sect_last; -#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) +#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2)) && defined(CONFIG_JFFS2_CMDLINE) struct mtd_device *dev; struct part_info *part; u8 dev_type, dev_num, pnum; @@ -343,7 +343,7 @@ int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return rcode; } -#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) +#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2)) && defined(CONFIG_JFFS2_CMDLINE) /* erase - erase partition */ if ((argc == 2) && (id_parse(argv[1], NULL, &dev_type, &dev_num) == 0)) { mtdparts_init(); @@ -447,7 +447,7 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) flash_info_t *info; ulong bank, addr_first, addr_last; int i, p, n, sect_first, sect_last; -#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) +#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2)) && defined(CONFIG_JFFS2_CMDLINE) struct mtd_device *dev; struct part_info *part; u8 dev_type, dev_num, pnum; @@ -539,7 +539,7 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return rcode; } -#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) +#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2)) && defined(CONFIG_JFFS2_CMDLINE) /* protect on/off */ if ((argc == 3) && (id_parse(argv[2], NULL, &dev_type, &dev_num) == 0)) { mtdparts_init(); @@ -672,7 +672,7 @@ int flash_sect_protect (int p, ulong addr_first, ulong addr_last) /**************************************************/ -#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) +#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2)) && defined(CONFIG_JFFS2_CMDLINE) # define TMP_ERASE "erase \n - erase partition\n" # define TMP_PROT_ON "protect on \n - protect partition\n" # define TMP_PROT_OFF "protect off \n - make partition writable\n" diff --git a/common/cmd_fpga.c b/common/cmd_fpga.c index 3444091858..e32b29a011 100644 --- a/common/cmd_fpga.c +++ b/common/cmd_fpga.c @@ -27,7 +27,7 @@ */ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_NET) +#if (CONFIG_COMMANDS & CFG_CMD_NET) || defined(CONFIG_CMD_NET) #include #endif #include @@ -43,7 +43,7 @@ #define PRINTF(fmt,args...) #endif -#if defined (CONFIG_FPGA) && ( CONFIG_COMMANDS & CFG_CMD_FPGA ) +#if defined (CONFIG_FPGA) && ((CONFIG_COMMANDS & CFG_CMD_FPGA ) || defined(CONFIG_CMD_FPGA)) /* Local functions */ static void fpga_usage (cmd_tbl_t * cmdtp); -- cgit v1.2.1 From 65c450b47a62659d522cfa8f4fa1e4e5c60dccd0 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Mon, 11 Jun 2007 19:01:54 -0500 Subject: common/cmd_[i-z]* : Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*). This is a compatibility step that allows both the older form and the new form to co-exist for a while until the older can be removed entirely. All transformations are of the form: Before: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) After: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT) Signed-off-by: Jon Loeliger --- common/cmd_i2c.c | 10 +++++----- common/cmd_ide.c | 2 +- common/cmd_immap.c | 2 +- common/cmd_itest.c | 2 +- common/cmd_jffs2.c | 12 ++++++------ common/cmd_load.c | 24 +++++++++++++----------- common/cmd_mem.c | 16 +++++++++++----- common/cmd_mfsl.c | 2 +- common/cmd_mii.c | 2 +- common/cmd_misc.c | 4 ++-- common/cmd_mmc.c | 2 +- common/cmd_nand.c | 19 ++++++++++++------- common/cmd_net.c | 18 ++++++++++-------- common/cmd_nvedit.c | 18 +++++++++++------- common/cmd_pci.c | 2 +- common/cmd_pcmcia.c | 5 +++-- common/cmd_portio.c | 2 +- common/cmd_reginfo.c | 5 +++-- common/cmd_reiser.c | 2 +- common/cmd_scsi.c | 2 +- common/cmd_spi.c | 2 +- common/cmd_universe.c | 2 +- common/cmd_usb.c | 4 ++-- common/cmd_vfd.c | 2 +- common/cmd_ximg.c | 2 +- 25 files changed, 92 insertions(+), 71 deletions(-) (limited to 'common') diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c index 755810d590..b9d9d332e2 100644 --- a/common/cmd_i2c.c +++ b/common/cmd_i2c.c @@ -86,7 +86,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_I2C) +#if (CONFIG_COMMANDS & CFG_CMD_I2C) || defined(CONFIG_CMD_I2C) /* Display values from last command. @@ -657,7 +657,7 @@ int do_i2c_loop(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * The SDRAM command is separately configured because many * (most?) embedded boards don't use SDRAM DIMMs. */ -#if (CONFIG_COMMANDS & CFG_CMD_SDRAM) +#if (CONFIG_COMMANDS & CFG_CMD_SDRAM) || defined(CONFIG_CMD_SDRAM) /* * Syntax: @@ -938,7 +938,7 @@ int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) return do_i2c_probe(cmdtp, flag, --argc, ++argv); if (!strncmp(argv[1], "lo", 2)) return do_i2c_loop(cmdtp, flag, --argc, ++argv); -#if (CONFIG_COMMANDS & CFG_CMD_SDRAM) +#if (CONFIG_COMMANDS & CFG_CMD_SDRAM) || defined(CONFIG_CMD_SDRAM) if (!strncmp(argv[1], "sd", 2)) return do_sdram(cmdtp, flag, --argc, ++argv); #endif /* CFG_CMD_SDRAM */ @@ -965,7 +965,7 @@ U_BOOT_CMD( "i2c crc32 chip address[.0, .1, .2] count - compute CRC32 checksum\n" "i2c probe - show devices on the I2C bus\n" "i2c loop chip address[.0, .1, .2] [# of objects] - looping read of device\n" -#if (CONFIG_COMMANDS & CFG_CMD_SDRAM) +#if (CONFIG_COMMANDS & CFG_CMD_SDRAM) || defined(CONFIG_CMD_SDRAM) "i2c sdram chip - print SDRAM configuration information\n" #endif /* CFG_CMD_SDRAM */ ); @@ -1016,7 +1016,7 @@ U_BOOT_CMD( " - loop, reading a set of addresses\n" ); -#if (CONFIG_COMMANDS & CFG_CMD_SDRAM) +#if (CONFIG_COMMANDS & CFG_CMD_SDRAM) || defined(CONFIG_CMD_SDRAM) U_BOOT_CMD( isdram, 2, 1, do_sdram, "isdram - print SDRAM configuration information\n", diff --git a/common/cmd_ide.c b/common/cmd_ide.c index e308474af7..461a4bc533 100644 --- a/common/cmd_ide.c +++ b/common/cmd_ide.c @@ -78,7 +78,7 @@ DECLARE_GLOBAL_DATA_PTR; # define SYNC /* nothing */ #endif -#if (CONFIG_COMMANDS & CFG_CMD_IDE) +#if (CONFIG_COMMANDS & CFG_CMD_IDE) || defined(CONFIG_CMD_IDE) #ifdef CONFIG_IDE_8xx_DIRECT /* Timings for IDE Interface diff --git a/common/cmd_immap.c b/common/cmd_immap.c index fa79b45a3c..477c742e93 100644 --- a/common/cmd_immap.c +++ b/common/cmd_immap.c @@ -28,7 +28,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_IMMAP) && \ +#if ((CONFIG_COMMANDS & CFG_CMD_IMMAP) || defined(CONFIG_CMD_IMMAP)) && \ (defined(CONFIG_8xx) || defined(CONFIG_8260)) #if defined(CONFIG_8xx) diff --git a/common/cmd_itest.c b/common/cmd_itest.c index 8ad134f4a6..24129aa989 100644 --- a/common/cmd_itest.c +++ b/common/cmd_itest.c @@ -32,7 +32,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_ITEST) +#if (CONFIG_COMMANDS & CFG_CMD_ITEST) || defined(CONFIG_CMD_ITEST) #define EQ 0 #define NE 1 diff --git a/common/cmd_jffs2.c b/common/cmd_jffs2.c index 7fd1fa33da..8a882ab46c 100644 --- a/common/cmd_jffs2.c +++ b/common/cmd_jffs2.c @@ -94,11 +94,11 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) +#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2) #include -#if (CONFIG_COMMANDS & CFG_CMD_NAND) +#if (CONFIG_COMMANDS & CFG_CMD_NAND) || defined(CONFIG_CMD_NAND) #ifdef CFG_NAND_LEGACY #include #else /* !CFG_NAND_LEGACY */ @@ -321,7 +321,7 @@ static void current_save(void) */ static int part_validate_nor(struct mtdids *id, struct part_info *part) { -#if (CONFIG_COMMANDS & CFG_CMD_FLASH) +#if (CONFIG_COMMANDS & CFG_CMD_FLASH) || defined(CONFIG_CMD_FLASH) /* info for FLASH chips */ extern flash_info_t flash_info[]; flash_info_t *flash; @@ -370,7 +370,7 @@ static int part_validate_nor(struct mtdids *id, struct part_info *part) */ static int part_validate_nand(struct mtdids *id, struct part_info *part) { -#if defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND) +#if defined(CONFIG_JFFS2_NAND) && ((CONFIG_COMMANDS & CFG_CMD_NAND) || defined(CONFIG_CMD_NAND)) /* info for NAND chips */ nand_info_t *nand; @@ -719,7 +719,7 @@ static int part_parse(const char *const partdef, const char **ret, struct part_i static int device_validate(u8 type, u8 num, u32 *size) { if (type == MTD_DEV_TYPE_NOR) { -#if (CONFIG_COMMANDS & CFG_CMD_FLASH) +#if (CONFIG_COMMANDS & CFG_CMD_FLASH) || defined(CONFIG_CMD_FLASH) if (num < CFG_MAX_FLASH_BANKS) { extern flash_info_t flash_info[]; *size = flash_info[num].size; @@ -733,7 +733,7 @@ static int device_validate(u8 type, u8 num, u32 *size) printf("support for FLASH devices not present\n"); #endif } else if (type == MTD_DEV_TYPE_NAND) { -#if defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND) +#if defined(CONFIG_JFFS2_NAND) && ((CONFIG_COMMANDS & CFG_CMD_NAND) || defined(CONFIG_CMD_NAND)) if (num < CFG_MAX_NAND_DEVICE) { #ifndef CFG_NAND_LEGACY *size = nand_info[num].size; diff --git a/common/cmd_load.c b/common/cmd_load.c index f63b8e8056..0456f75ba9 100644 --- a/common/cmd_load.c +++ b/common/cmd_load.c @@ -33,14 +33,14 @@ DECLARE_GLOBAL_DATA_PTR; -#if (CONFIG_COMMANDS & CFG_CMD_LOADB) +#if (CONFIG_COMMANDS & CFG_CMD_LOADB) || defined(CONFIG_CMD_LOADB) static ulong load_serial_ymodem (ulong offset); #endif -#if (CONFIG_COMMANDS & CFG_CMD_LOADS) +#if (CONFIG_COMMANDS & CFG_CMD_LOADS) || defined(CONFIG_CMD_LOADS) static ulong load_serial (ulong offset); static int read_record (char *buf, ulong len); -# if (CONFIG_COMMANDS & CFG_CMD_SAVES) +# if (CONFIG_COMMANDS & CFG_CMD_SAVES) || defined(CONFIG_CMD_SAVES) static int save_serial (ulong offset, ulong size); static int write_record (char *buf); # endif /* CFG_CMD_SAVES */ @@ -50,7 +50,7 @@ static int do_echo = 1; /* -------------------------------------------------------------------- */ -#if (CONFIG_COMMANDS & CFG_CMD_LOADS) +#if (CONFIG_COMMANDS & CFG_CMD_LOADS) || defined(CONFIG_CMD_LOADS) int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { ulong offset = 0; @@ -253,7 +253,7 @@ read_record (char *buf, ulong len) return (p - buf); } -#if (CONFIG_COMMANDS & CFG_CMD_SAVES) +#if (CONFIG_COMMANDS & CFG_CMD_SAVES) || defined(CONFIG_CMD_SAVES) int do_save_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { @@ -404,8 +404,10 @@ write_record (char *buf) #endif /* CFG_CMD_LOADS */ -#if (CONFIG_COMMANDS & CFG_CMD_LOADB) /* loadb command (load binary) included */ - +#if (CONFIG_COMMANDS & CFG_CMD_LOADB) || defined(CONFIG_CMD_LOADB) +/* + * loadb command (load binary) included + */ #define XON_CHAR 17 #define XOFF_CHAR 19 #define START_CHAR 0x01 @@ -1040,7 +1042,7 @@ static ulong load_serial_ymodem (ulong offset) /* -------------------------------------------------------------------- */ -#if (CONFIG_COMMANDS & CFG_CMD_LOADS) +#if (CONFIG_COMMANDS & CFG_CMD_LOADS) || defined(CONFIG_CMD_LOADS) #ifdef CFG_LOADS_BAUD_CHANGE U_BOOT_CMD( @@ -1065,7 +1067,7 @@ U_BOOT_CMD( */ -#if (CONFIG_COMMANDS & CFG_CMD_SAVES) +#if (CONFIG_COMMANDS & CFG_CMD_SAVES) || defined(CONFIG_CMD_SAVES) #ifdef CFG_LOADS_BAUD_CHANGE U_BOOT_CMD( saves, 4, 0, do_save_serial, @@ -1086,7 +1088,7 @@ U_BOOT_CMD( #endif /* CFG_CMD_LOADS */ -#if (CONFIG_COMMANDS & CFG_CMD_LOADB) +#if (CONFIG_COMMANDS & CFG_CMD_LOADB) || defined(CONFIG_CMD_LOADB) U_BOOT_CMD( loadb, 3, 0, do_load_serial_bin, "loadb - load binary file over serial line (kermit mode)\n", @@ -1107,7 +1109,7 @@ U_BOOT_CMD( /* -------------------------------------------------------------------- */ -#if (CONFIG_COMMANDS & CFG_CMD_HWFLOW) +#if (CONFIG_COMMANDS & CFG_CMD_HWFLOW) || defined(CONFIG_CMD_HWFLOW) int do_hwflow (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { extern int hwflow_onoff(int); diff --git a/common/cmd_mem.c b/common/cmd_mem.c index fcbb0236d2..b5479743af 100644 --- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -29,7 +29,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_MMC) +#if (CONFIG_COMMANDS & CFG_CMD_MMC) || defined(CONFIG_CMD_MMC) #include #endif #ifdef CONFIG_HAS_DATAFLASH @@ -40,7 +40,13 @@ CFG_CMD_I2C | \ CFG_CMD_ITEST | \ CFG_CMD_PCI | \ - CMD_CMD_PORTIO ) ) + CMD_CMD_PORTIO ) ) \ + || defined(CONFIG_CMD_MEMORY) \ + || defined(CONFIG_CMD_I2C) \ + || defined(CONFIG_CMD_ITEST) \ + || defined(CONFIG_CMD_PCI) \ + || defined(CONFIG_CMD_PORTIO) + int cmd_get_data_size(char* arg, int default_size) { /* Check for a size specification .b, .w or .l. @@ -64,7 +70,7 @@ int cmd_get_data_size(char* arg, int default_size) } #endif -#if (CONFIG_COMMANDS & CFG_CMD_MEMORY) +#if (CONFIG_COMMANDS & CFG_CMD_MEMORY) || defined(CONFIG_CMD_MEMORY) #ifdef CMD_MEM_DEBUG #define PRINTF(fmt,args...) printf (fmt ,##args) @@ -403,7 +409,7 @@ int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } #endif -#if (CONFIG_COMMANDS & CFG_CMD_MMC) +#if (CONFIG_COMMANDS & CFG_CMD_MMC) || defined(CONFIG_CMD_MMC) if (mmc2info(dest)) { int rc; @@ -1149,7 +1155,7 @@ int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #endif /* CONFIG_CRC32_VERIFY */ /**************************************************/ -#if (CONFIG_COMMANDS & CFG_CMD_MEMORY) +#if (CONFIG_COMMANDS & CFG_CMD_MEMORY) || defined(CONFIG_CMD_MEMORY) U_BOOT_CMD( md, 3, 1, do_mem_md, "md - memory display\n", diff --git a/common/cmd_mfsl.c b/common/cmd_mfsl.c index ffa2666935..5dcfc9466f 100644 --- a/common/cmd_mfsl.c +++ b/common/cmd_mfsl.c @@ -30,7 +30,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_MFSL) +#if (CONFIG_COMMANDS & CFG_CMD_MFSL) || defined(CONFIG_CMD_MFSL) #include int do_frd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) diff --git a/common/cmd_mii.c b/common/cmd_mii.c index e6595360cb..bfeef792ba 100644 --- a/common/cmd_mii.c +++ b/common/cmd_mii.c @@ -28,7 +28,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_MII) +#if (CONFIG_COMMANDS & CFG_CMD_MII) || defined(CONFIG_CMD_MII) #include #ifdef CONFIG_TERSE_MII diff --git a/common/cmd_misc.c b/common/cmd_misc.c index a99222d3ef..c5540138f9 100644 --- a/common/cmd_misc.c +++ b/common/cmd_misc.c @@ -27,7 +27,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_MISC) +#if (CONFIG_COMMANDS & CFG_CMD_MISC) || defined(CONFIG_CMD_MISC) int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { @@ -52,7 +52,7 @@ int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } /* Implemented in $(CPU)/interrupts.c */ -#if (CONFIG_COMMANDS & CFG_CMD_IRQ) +#if (CONFIG_COMMANDS & CFG_CMD_IRQ) || defined(CONFIG_CMD_IRQ) int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); U_BOOT_CMD( diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c index 573eb97ead..7abaa98cf7 100644 --- a/common/cmd_mmc.c +++ b/common/cmd_mmc.c @@ -24,7 +24,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_MMC) +#if (CONFIG_COMMANDS & CFG_CMD_MMC) || defined(CONFIG_CMD_MMC) #include diff --git a/common/cmd_nand.c b/common/cmd_nand.c index b011b5e3de..63a68eb180 100644 --- a/common/cmd_nand.c +++ b/common/cmd_nand.c @@ -19,7 +19,7 @@ */ #include -#if (CONFIG_COMMANDS & CFG_CMD_NAND) +#if (CONFIG_COMMANDS & CFG_CMD_NAND) || defined(CONFIG_CMD_NAND) #include #include @@ -36,7 +36,8 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) +#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2)) \ + && defined(CONFIG_JFFS2_CMDLINE) /* parition handling routines */ int mtdparts_init(void); @@ -104,7 +105,8 @@ static int arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, ulong *size) { int idx = nand_curr_device; -#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) +#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2)) \ + && defined(CONFIG_JFFS2_CMDLINE) struct mtd_device *dev; struct part_info *part; u8 pnum; @@ -152,7 +154,8 @@ arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, ulong *size) *size = nand->size - *off; } -#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) +#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2)) \ + && defined(CONFIG_JFFS2_CMDLINE) out: #endif printf("device %d ", idx); @@ -534,7 +537,8 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) char *boot_device = NULL; int idx; ulong addr, offset = 0; -#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) +#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2)) \ + && defined(CONFIG_JFFS2_CMDLINE) struct mtd_device *dev; struct part_info *part; u8 pnum; @@ -578,7 +582,8 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) offset = simple_strtoul(argv[3], NULL, 16); break; default: -#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) +#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2)) \ + && defined(CONFIG_JFFS2_CMDLINE) usage: #endif printf("Usage:\n%s\n", cmdtp->usage); @@ -627,7 +632,7 @@ U_BOOT_CMD(nboot, 4, 1, do_nandboot, # define SHOW_BOOT_PROGRESS(arg) #endif -#if (CONFIG_COMMANDS & CFG_CMD_NAND) +#if (CONFIG_COMMANDS & CFG_CMD_NAND) || defined(CONFIG_CMD_NAND) #include #if 0 #include diff --git a/common/cmd_net.c b/common/cmd_net.c index 2cb2c5d34b..ad9a7dcd60 100644 --- a/common/cmd_net.c +++ b/common/cmd_net.c @@ -28,7 +28,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_NET) +#if (CONFIG_COMMANDS & CFG_CMD_NET) || defined(CONFIG_CMD_NET) extern int do_bootm (cmd_tbl_t *, int, int, char *[]); @@ -68,7 +68,7 @@ U_BOOT_CMD( "[loadAddress] [bootfilename]\n" ); -#if (CONFIG_COMMANDS & CFG_CMD_DHCP) +#if (CONFIG_COMMANDS & CFG_CMD_DHCP) || defined(CONFIG_CMD_DHCP) int do_dhcp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { return netboot_common(DHCP, cmdtp, argc, argv); @@ -81,7 +81,7 @@ U_BOOT_CMD( ); #endif /* CFG_CMD_DHCP */ -#if (CONFIG_COMMANDS & CFG_CMD_NFS) +#if (CONFIG_COMMANDS & CFG_CMD_NFS) || defined(CONFIG_CMD_NFS) int do_nfs (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { return netboot_common(NFS, cmdtp, argc, argv); @@ -137,13 +137,15 @@ static void netboot_update_env (void) if (NetOurNISDomain[0]) setenv ("domain", NetOurNISDomain); -#if (CONFIG_COMMANDS & CFG_CMD_SNTP) && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_TIMEOFFSET) +#if ((CONFIG_COMMANDS & CFG_CMD_SNTP) || defined(CONFIG_CMD_SNTP)) \ + && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_TIMEOFFSET) if (NetTimeOffset) { sprintf (tmp, "%d", NetTimeOffset); setenv ("timeoffset", tmp); } #endif -#if (CONFIG_COMMANDS & CFG_CMD_SNTP) && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NTPSERVER) +#if ((CONFIG_COMMANDS & CFG_CMD_SNTP) || defined(CONFIG_CMD_SNTP)) \ + && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NTPSERVER) if (NetNtpServerIP) { ip_to_string (NetNtpServerIP, tmp); setenv ("ntpserverip", tmp); @@ -220,7 +222,7 @@ netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char *argv[]) return rcode; } -#if (CONFIG_COMMANDS & CFG_CMD_PING) +#if (CONFIG_COMMANDS & CFG_CMD_PING) || defined(CONFIG_CMD_PING) int do_ping (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { if (argc < 2) @@ -249,7 +251,7 @@ U_BOOT_CMD( ); #endif /* CFG_CMD_PING */ -#if (CONFIG_COMMANDS & CFG_CMD_CDP) +#if (CONFIG_COMMANDS & CFG_CMD_CDP) || defined(CONFIG_CMD_CDP) static void cdp_update_env(void) { @@ -292,7 +294,7 @@ U_BOOT_CMD( ); #endif /* CFG_CMD_CDP */ -#if (CONFIG_COMMANDS & CFG_CMD_SNTP) +#if (CONFIG_COMMANDS & CFG_CMD_SNTP) || defined(CONFIG_CMD_SNTP) int do_sntp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { char *toff; diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index 977ec5bae9..27e46db36b 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -46,7 +46,7 @@ #include #include #include -#if (CONFIG_COMMANDS & CFG_CMD_NET) +#if (CONFIG_COMMANDS & CFG_CMD_NET) || defined(CONFIG_CMD_NET) #include #endif @@ -367,7 +367,7 @@ int _do_setenv (int flag, int argc, char *argv[]) load_addr = simple_strtoul(argv[2], NULL, 16); return 0; } -#if (CONFIG_COMMANDS & CFG_CMD_NET) +#if (CONFIG_COMMANDS & CFG_CMD_NET) || defined(CONFIG_CMD_NET) if (strcmp(argv[1],"bootfile") == 0) { copy_filename (BootFile, argv[2], sizeof(BootFile)); return 0; @@ -411,7 +411,7 @@ int do_setenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * Prompt for environment variable */ -#if (CONFIG_COMMANDS & CFG_CMD_ASKENV) +#if (CONFIG_COMMANDS & CFG_CMD_ASKENV) || defined(CONFIG_CMD_ASKENV) int do_askenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { extern char console_buffer[CFG_CBSIZE]; @@ -542,7 +542,9 @@ int getenv_r (char *name, char *buf, unsigned len) ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_FLASH)) == \ (CFG_CMD_ENV|CFG_CMD_FLASH)) || \ ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_NAND)) == \ - (CFG_CMD_ENV|CFG_CMD_NAND)) + (CFG_CMD_ENV|CFG_CMD_NAND)) \ + || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \ + || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { extern char * env_name_spec; @@ -600,7 +602,9 @@ U_BOOT_CMD( ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_FLASH)) == \ (CFG_CMD_ENV|CFG_CMD_FLASH)) || \ ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_NAND)) == \ - (CFG_CMD_ENV|CFG_CMD_NAND)) + (CFG_CMD_ENV|CFG_CMD_NAND)) \ + || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \ + || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) U_BOOT_CMD( saveenv, 1, 0, do_saveenv, "saveenv - save environment variables to persistent storage\n", @@ -609,7 +613,7 @@ U_BOOT_CMD( #endif /* CFG_CMD_ENV */ -#if (CONFIG_COMMANDS & CFG_CMD_ASKENV) +#if (CONFIG_COMMANDS & CFG_CMD_ASKENV) || defined(CONFIG_CMD_ASKENV) U_BOOT_CMD( askenv, CFG_MAXARGS, 1, do_askenv, @@ -626,7 +630,7 @@ U_BOOT_CMD( ); #endif /* CFG_CMD_ASKENV */ -#if (CONFIG_COMMANDS & CFG_CMD_RUN) +#if (CONFIG_COMMANDS & CFG_CMD_RUN) || defined(CONFIG_CMD_RUN) int do_run (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); U_BOOT_CMD( run, CFG_MAXARGS, 1, do_run, diff --git a/common/cmd_pci.c b/common/cmd_pci.c index 45085462fc..10e06912c4 100644 --- a/common/cmd_pci.c +++ b/common/cmd_pci.c @@ -38,7 +38,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_PCI) +#if (CONFIG_COMMANDS & CFG_CMD_PCI) || defined(CONFIG_CMD_PCI) extern int cmd_get_data_size(char* arg, int default_size); diff --git a/common/cmd_pcmcia.c b/common/cmd_pcmcia.c index b1a594f18b..dfa41e0ae2 100644 --- a/common/cmd_pcmcia.c +++ b/common/cmd_pcmcia.c @@ -61,7 +61,7 @@ /* -------------------------------------------------------------------- */ -#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA) +#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA) || defined(CONFIG_CMD_PCMCIA) extern int pcmcia_on (void); extern int pcmcia_off (void); @@ -99,7 +99,8 @@ U_BOOT_CMD( #undef CHECK_IDE_DEVICE -#if (CONFIG_COMMANDS & CFG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD) +#if ((CONFIG_COMMANDS & CFG_CMD_IDE) || defined(CONFIG_CMD_IDE)) \ + && defined(CONFIG_IDE_8xx_PCCARD) #define CHECK_IDE_DEVICE #endif diff --git a/common/cmd_portio.c b/common/cmd_portio.c index d2e4c4b504..6a074829e7 100644 --- a/common/cmd_portio.c +++ b/common/cmd_portio.c @@ -30,7 +30,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_PORTIO) +#if (CONFIG_COMMANDS & CFG_CMD_PORTIO) || defined(CONFIG_CMD_PORTIO) extern int cmd_get_data_size (char *arg, int default_size); diff --git a/common/cmd_reginfo.c b/common/cmd_reginfo.c index f428f7e9aa..57de0fe45c 100644 --- a/common/cmd_reginfo.c +++ b/common/cmd_reginfo.c @@ -32,7 +32,8 @@ #elif defined (CONFIG_MPC5200) #include #endif -#if (CONFIG_COMMANDS & CFG_CMD_REGINFO) + +#if (CONFIG_COMMANDS & CFG_CMD_REGINFO) || defined(CONFIG_CMD_REGINFO) int do_reginfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { @@ -341,7 +342,7 @@ int do_reginfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #if ( defined(CONFIG_8xx) || defined(CONFIG_405GP) || \ defined(CONFIG_405EP) || defined(CONFIG_MPC5200) ) && \ - (CONFIG_COMMANDS & CFG_CMD_REGINFO) + ((CONFIG_COMMANDS & CFG_CMD_REGINFO) || defined(CONFIG_CMD_REGINFO)) U_BOOT_CMD( reginfo, 2, 1, do_reginfo, diff --git a/common/cmd_reiser.c b/common/cmd_reiser.c index 09c86e66d7..f54019b5f1 100644 --- a/common/cmd_reiser.c +++ b/common/cmd_reiser.c @@ -28,7 +28,7 @@ */ #include -#if (CONFIG_COMMANDS & CFG_CMD_REISER) +#if (CONFIG_COMMANDS & CFG_CMD_REISER) || defined(CONFIG_CMD_REISER) #include #include #include diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c index 00b84fad19..ac3d81cfed 100644 --- a/common/cmd_scsi.c +++ b/common/cmd_scsi.c @@ -34,7 +34,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_SCSI) +#if (CONFIG_COMMANDS & CFG_CMD_SCSI) || defined(CONFIG_CMD_SCSI) #ifdef CONFIG_SCSI_SYM53C8XX #define SCSI_VEND_ID 0x1000 diff --git a/common/cmd_spi.c b/common/cmd_spi.c index a6fdf7fddb..5874222e7c 100644 --- a/common/cmd_spi.c +++ b/common/cmd_spi.c @@ -29,7 +29,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_SPI) +#if (CONFIG_COMMANDS & CFG_CMD_SPI) || defined(CONFIG_CMD_SPI) /*----------------------------------------------------------------------- * Definitions diff --git a/common/cmd_universe.c b/common/cmd_universe.c index 8d7b6fee12..cc55dc9303 100644 --- a/common/cmd_universe.c +++ b/common/cmd_universe.c @@ -28,7 +28,7 @@ #include -#if (CONFIG_COMMANDS & CFG_CMD_UNIVERSE) +#if (CONFIG_COMMANDS & CFG_CMD_UNIVERSE) || defined(CONFIG_CMD_UNIVERSE) #define PCI_VENDOR PCI_VENDOR_ID_TUNDRA #define PCI_DEVICE PCI_DEVICE_ID_TUNDRA_CA91C042 diff --git a/common/cmd_usb.c b/common/cmd_usb.c index 904df7159f..529938fb02 100644 --- a/common/cmd_usb.c +++ b/common/cmd_usb.c @@ -30,7 +30,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_USB) +#if (CONFIG_COMMANDS & CFG_CMD_USB) || defined(CONFIG_CMD_USB) #include @@ -612,7 +612,7 @@ int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #endif /* (CONFIG_COMMANDS & CFG_CMD_USB) */ -#if (CONFIG_COMMANDS & CFG_CMD_USB) +#if (CONFIG_COMMANDS & CFG_CMD_USB) || defined(CONFIG_CMD_USB) #ifdef CONFIG_USB_STORAGE U_BOOT_CMD( diff --git a/common/cmd_vfd.c b/common/cmd_vfd.c index 5e623a2705..fffb39cca2 100644 --- a/common/cmd_vfd.c +++ b/common/cmd_vfd.c @@ -35,7 +35,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_VFD) +#if (CONFIG_COMMANDS & CFG_CMD_VFD) || defined(CONFIG_CMD_VFD) #include #define VFD_TEST_LOGO_BMPNR 0 diff --git a/common/cmd_ximg.c b/common/cmd_ximg.c index 8359153b2b..e490243e7c 100644 --- a/common/cmd_ximg.c +++ b/common/cmd_ximg.c @@ -24,7 +24,7 @@ * MA 02111-1307 USA */ -#if (CONFIG_COMMANDS & CFG_CMD_XIMG) +#if (CONFIG_COMMANDS & CFG_CMD_XIMG) || defined(CONFIG_CMD_XIMG) /* * Multi Image extract -- cgit v1.2.1 From b453960d4fdb87b3970d96119b90df2ed024fc4a Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Mon, 11 Jun 2007 19:02:05 -0500 Subject: common/ non-cmd: Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*). This is a compatibility step that allows both the older form and the new form to co-exist for a while until the older can be removed entirely. All transformations are of the form: Before: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) After: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT) Signed-off-by: Jon Loeliger --- common/bedbug.c | 2 +- common/command.c | 4 ++-- common/docecc.c | 2 +- common/env_flash.c | 2 +- common/env_nand.c | 2 +- common/exports.c | 2 +- common/hush.c | 2 +- common/kgdb.c | 2 +- common/lcd.c | 2 +- common/main.c | 4 ++-- common/miiphyutil.c | 2 +- common/usb.c | 2 +- common/usb_storage.c | 2 +- 13 files changed, 15 insertions(+), 15 deletions(-) (limited to 'common') diff --git a/common/bedbug.c b/common/bedbug.c index 6966de7445..1a793f8268 100644 --- a/common/bedbug.c +++ b/common/bedbug.c @@ -2,7 +2,7 @@ #include -#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG) +#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG) || defined(CONFIG_CMD_BEDBUG) #include #include diff --git a/common/command.c b/common/command.c index e917975a73..f8bd16b6f5 100644 --- a/common/command.c +++ b/common/command.c @@ -42,7 +42,7 @@ U_BOOT_CMD( NULL ); -#if (CONFIG_COMMANDS & CFG_CMD_ECHO) +#if (CONFIG_COMMANDS & CFG_CMD_ECHO) || defined(CONFIG_CMD_ECHO) int do_echo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) @@ -409,7 +409,7 @@ void install_auto_complete(void) { install_auto_complete_handler("printenv", var_complete); install_auto_complete_handler("setenv", var_complete); -#if (CONFIG_COMMANDS & CFG_CMD_RUN) +#if (CONFIG_COMMANDS & CFG_CMD_RUN) || defined(CONFIG_CMD_RUN) install_auto_complete_handler("run", var_complete); #endif } diff --git a/common/docecc.c b/common/docecc.c index 79adb48958..d9c7a4133d 100644 --- a/common/docecc.c +++ b/common/docecc.c @@ -31,7 +31,7 @@ #undef ECC_DEBUG #undef PSYCHO_DEBUG -#if (CONFIG_COMMANDS & CFG_CMD_DOC) +#if (CONFIG_COMMANDS & CFG_CMD_DOC) || defined(CONFIG_CMD_DOC) #include diff --git a/common/env_flash.c b/common/env_flash.c index 1674b30e11..f9cf35a184 100644 --- a/common/env_flash.c +++ b/common/env_flash.c @@ -37,7 +37,7 @@ DECLARE_GLOBAL_DATA_PTR; -#if ((CONFIG_COMMANDS&(CFG_CMD_ENV|CFG_CMD_FLASH)) == (CFG_CMD_ENV|CFG_CMD_FLASH)) +#if ((CONFIG_COMMANDS&(CFG_CMD_ENV|CFG_CMD_FLASH)) == (CFG_CMD_ENV|CFG_CMD_FLASH)) || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) #define CMD_SAVEENV #elif defined(CFG_ENV_ADDR_REDUND) #error Cannot use CFG_ENV_ADDR_REDUND without CFG_CMD_ENV & CFG_CMD_FLASH diff --git a/common/env_nand.c b/common/env_nand.c index 67c4a4e011..f97af20fa3 100644 --- a/common/env_nand.c +++ b/common/env_nand.c @@ -39,7 +39,7 @@ #include #include -#if ((CONFIG_COMMANDS&(CFG_CMD_ENV|CFG_CMD_NAND)) == (CFG_CMD_ENV|CFG_CMD_NAND)) +#if ((CONFIG_COMMANDS&(CFG_CMD_ENV|CFG_CMD_NAND)) == (CFG_CMD_ENV|CFG_CMD_NAND)) || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) #define CMD_SAVEENV #elif defined(CFG_ENV_OFFSET_REDUND) #error Cannot use CFG_ENV_OFFSET_REDUND without CFG_CMD_ENV & CFG_CMD_NAND diff --git a/common/exports.c b/common/exports.c index 0cb4396ea4..fc8060ae53 100644 --- a/common/exports.c +++ b/common/exports.c @@ -32,7 +32,7 @@ void jumptable_init (void) gd->jt[XF_install_hdlr] = (void *) irq_install_handler; gd->jt[XF_free_hdlr] = (void *) irq_free_handler; #endif /* I386 || PPC */ -#if (CONFIG_COMMANDS & CFG_CMD_I2C) +#if (CONFIG_COMMANDS & CFG_CMD_I2C) || defined(CONFIG_CMD_I2C) gd->jt[XF_i2c_write] = (void *) i2c_write; gd->jt[XF_i2c_read] = (void *) i2c_read; #endif /* CFG_CMD_I2C */ diff --git a/common/hush.c b/common/hush.c index feb5627ff2..4ddbc64d2e 100644 --- a/common/hush.c +++ b/common/hush.c @@ -1682,7 +1682,7 @@ static int run_pipe_real(struct pipe *pi) return -1; /* give up after bad command */ } else { int rcode; -#if (CONFIG_COMMANDS & CFG_CMD_BOOTD) +#if (CONFIG_COMMANDS & CFG_CMD_BOOTD) || defined(CONFIG_CMD_BOOTD) extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); /* avoid "bootd" recursion */ diff --git a/common/kgdb.c b/common/kgdb.c index 6de6ec99a2..7a3e6d6edb 100644 --- a/common/kgdb.c +++ b/common/kgdb.c @@ -92,7 +92,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_KGDB) +#if (CONFIG_COMMANDS & CFG_CMD_KGDB) || defined(CONFIG_CMD_KGDB) #undef KGDB_DEBUG diff --git a/common/lcd.c b/common/lcd.c index eaed2abd80..3b6391b061 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -571,7 +571,7 @@ void bitmap_plot (int x, int y) #endif /* CONFIG_LCD_LOGO */ /*----------------------------------------------------------------------*/ -#if (CONFIG_COMMANDS & CFG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN) +#if (CONFIG_COMMANDS & CFG_CMD_BMP) || defined(CONFIG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN) /* * Display the BMP file located at address bmp_image. * Only uncompressed. diff --git a/common/main.c b/common/main.c index a00ebc194c..99693f4fcf 100644 --- a/common/main.c +++ b/common/main.c @@ -1311,7 +1311,7 @@ int run_command (const char *cmd, int flag) continue; } -#if (CONFIG_COMMANDS & CFG_CMD_BOOTD) +#if (CONFIG_COMMANDS & CFG_CMD_BOOTD) || defined(CONFIG_CMD_BOOTD) /* avoid "bootd" recursion */ if (cmdtp->cmd == do_bootd) { #ifdef DEBUG_PARSER @@ -1344,7 +1344,7 @@ int run_command (const char *cmd, int flag) /****************************************************************************/ -#if (CONFIG_COMMANDS & CFG_CMD_RUN) +#if (CONFIG_COMMANDS & CFG_CMD_RUN) || defined(CONFIG_CMD_RUN) int do_run (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) { int i; diff --git a/common/miiphyutil.c b/common/miiphyutil.c index e411e573c7..6482728e94 100644 --- a/common/miiphyutil.c +++ b/common/miiphyutil.c @@ -29,7 +29,7 @@ #include #include -#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII) +#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII) || defined(CONFIG_CMD_MII) #include #include #include diff --git a/common/usb.c b/common/usb.c index 0857494b27..282c1d97b7 100644 --- a/common/usb.c +++ b/common/usb.c @@ -49,7 +49,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_USB) +#if (CONFIG_COMMANDS & CFG_CMD_USB) || defined(CONFIG_CMD_USB) #include #ifdef CONFIG_4xx diff --git a/common/usb_storage.c b/common/usb_storage.c index 196ceb7359..d556475b61 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -55,7 +55,7 @@ #include -#if (CONFIG_COMMANDS & CFG_CMD_USB) +#if (CONFIG_COMMANDS & CFG_CMD_USB) || defined(CONFIG_CMD_USB) #include #include -- cgit v1.2.1 From baa26db4113679b80970ff447d91cc10217742a6 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Sun, 8 Jul 2007 17:51:39 -0500 Subject: common/cmd_[af]*: Remove obsolete references to CONFIG_COMMANDS. Signed-off-by: Jon Loeliger --- common/bedbug.c | 4 ++-- common/cmd_autoscript.c | 9 ++++----- common/cmd_bdinfo.c | 2 +- common/cmd_bedbug.c | 2 +- common/cmd_bmp.c | 4 ++-- common/cmd_bootm.c | 22 +++++++++++----------- common/cmd_cache.c | 2 +- common/cmd_console.c | 2 +- common/cmd_date.c | 2 +- common/cmd_dcr.c | 2 +- common/cmd_diag.c | 2 +- common/cmd_display.c | 2 +- common/cmd_doc.c | 4 ++-- common/cmd_dtt.c | 4 ++-- common/cmd_eeprom.c | 8 ++++---- common/cmd_elf.c | 4 ++-- common/cmd_ext2.c | 6 +++--- common/cmd_fat.c | 2 +- common/cmd_fdc.c | 17 ++++++++--------- common/cmd_fdos.c | 4 ++-- common/cmd_flash.c | 14 +++++++------- common/cmd_fpga.c | 6 +++--- 22 files changed, 61 insertions(+), 63 deletions(-) (limited to 'common') diff --git a/common/bedbug.c b/common/bedbug.c index 1a793f8268..3bf1fc3cc7 100644 --- a/common/bedbug.c +++ b/common/bedbug.c @@ -2,7 +2,7 @@ #include -#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG) || defined(CONFIG_CMD_BEDBUG) +#if defined(CONFIG_CMD_BEDBUG) #include #include @@ -1253,4 +1253,4 @@ int find_next_address (unsigned char *nextaddr, int step_over, * purpose. */ -#endif /* CONFIG_COMMANDS & CFG_CMD_BEDBUG */ +#endif diff --git a/common/cmd_autoscript.c b/common/cmd_autoscript.c index aaca3622bd..606fb9a1fc 100644 --- a/common/cmd_autoscript.c +++ b/common/cmd_autoscript.c @@ -47,8 +47,7 @@ #include #endif -#if defined(CONFIG_AUTOSCRIPT) || \ - (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT) +#if defined(CONFIG_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT) extern image_header_t header; /* from cmd_bootm.c */ int @@ -152,7 +151,7 @@ autoscript (ulong addr) #endif /* CONFIG_AUTOSCRIPT || CFG_CMD_AUTOSCRIPT */ /**************************************************/ -#if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT) +#if defined(CONFIG_CMD_AUTOSCRIPT) int do_autoscript (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { @@ -170,7 +169,7 @@ do_autoscript (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return rcode; } -#if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT) +#if defined(CONFIG_CMD_AUTOSCRIPT) U_BOOT_CMD( autoscr, 2, 0, do_autoscript, "autoscr - run script from memory\n", @@ -179,4 +178,4 @@ U_BOOT_CMD( ); #endif /* CFG_CMD_AUTOSCRIPT */ -#endif /* CONFIG_AUTOSCRIPT || CFG_CMD_AUTOSCRIPT */ +#endif /* CFG_CMD_AUTOSCRIPT */ diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index b5ba2a0374..55cb100044 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -30,7 +30,7 @@ DECLARE_GLOBAL_DATA_PTR; -#if (CONFIG_COMMANDS & CFG_CMD_BDI) || defined(CONFIG_CMD_BDI) +#if defined(CONFIG_CMD_BDI) static void print_num(const char *, ulong); #ifndef CONFIG_ARM /* PowerPC and other */ diff --git a/common/cmd_bedbug.c b/common/cmd_bedbug.c index 4c309f9a9b..0bd622bfd5 100644 --- a/common/cmd_bedbug.c +++ b/common/cmd_bedbug.c @@ -13,7 +13,7 @@ DECLARE_GLOBAL_DATA_PTR; -#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG) || defined(CONFIG_CMD_BEDBUG) +#if defined(CONFIG_CMD_BEDBUG) #ifndef MAX #define MAX(a,b) ((a) > (b) ? (a) : (b)) diff --git a/common/cmd_bmp.c b/common/cmd_bmp.c index d5c5bda01c..241aa8357a 100644 --- a/common/cmd_bmp.c +++ b/common/cmd_bmp.c @@ -31,7 +31,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_BMP) || defined(CONFIG_CMD_BMP) +#if defined(CONFIG_CMD_BMP) static int bmp_info (ulong addr); static int bmp_display (ulong addr, int x, int y); @@ -188,4 +188,4 @@ static int bmp_display(ulong addr, int x, int y) #endif } -#endif /* (CONFIG_COMMANDS & CFG_CMD_BMP) || defined(CONFIG_CMD_BMP) */ +#endif /* defined(CONFIG_CMD_BMP) */ diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 950e160d65..90de6b19a1 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -48,7 +48,7 @@ DECLARE_GLOBAL_DATA_PTR; /*cmd_boot.c*/ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); -#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) +#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) #include #endif @@ -89,11 +89,11 @@ int gunzip (void *, int, unsigned char *, unsigned long *); static void *zalloc(void *, unsigned, unsigned); static void zfree(void *, void *, unsigned); -#if (CONFIG_COMMANDS & CFG_CMD_IMI) || defined(CONFIG_CMD_IMI) +#if defined(CONFIG_CMD_IMI) static int image_info (unsigned long addr); #endif -#if (CONFIG_COMMANDS & CFG_CMD_IMLS) || defined(CONFIG_CMD_IMLS) +#if defined(CONFIG_CMD_IMLS) #include extern flash_info_t flash_info[]; /* info for FLASH chips */ static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); @@ -133,7 +133,7 @@ static void fixup_silent_linux (void); #endif static boot_os_Fcn do_bootm_netbsd; static boot_os_Fcn do_bootm_rtems; -#if (CONFIG_COMMANDS & CFG_CMD_ELF) || defined(CONFIG_CMD_ELF) +#if defined(CONFIG_CMD_ELF) static boot_os_Fcn do_bootm_vxworks; static boot_os_Fcn do_bootm_qnxelf; int do_bootvx ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] ); @@ -440,7 +440,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) addr, len_ptr, verify); break; -#if (CONFIG_COMMANDS & CFG_CMD_ELF) || defined(CONFIG_CMD_ELF) +#if defined(CONFIG_CMD_ELF) case IH_OS_VXWORKS: do_bootm_vxworks (cmdtp, flag, argc, argv, addr, len_ptr, verify); @@ -1219,7 +1219,7 @@ do_bootm_artos (cmd_tbl_t *cmdtp, int flag, #endif -#if (CONFIG_COMMANDS & CFG_CMD_BOOTD) || defined(CONFIG_CMD_BOOTD) +#if defined(CONFIG_CMD_BOOTD) int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { int rcode = 0; @@ -1247,7 +1247,7 @@ U_BOOT_CMD( #endif -#if (CONFIG_COMMANDS & CFG_CMD_IMI) || defined(CONFIG_CMD_IMI) +#if defined(CONFIG_CMD_IMI) int do_iminfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { int arg; @@ -1317,7 +1317,7 @@ U_BOOT_CMD( #endif /* CFG_CMD_IMI */ -#if (CONFIG_COMMANDS & CFG_CMD_IMLS) || defined(CONFIG_CMD_IMLS) +#if defined(CONFIG_CMD_IMLS) /*----------------------------------------------------------------------- * List all images found in flash. */ @@ -1378,13 +1378,13 @@ U_BOOT_CMD( void print_image_hdr (image_header_t *hdr) { -#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) +#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) time_t timestamp = (time_t)ntohl(hdr->ih_time); struct rtc_time tm; #endif printf (" Image Name: %.*s\n", IH_NMLEN, hdr->ih_name); -#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) +#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) to_tm (timestamp, &tm); printf (" Created: %4d-%02d-%02d %2d:%02d:%02d UTC\n", tm.tm_year, tm.tm_mon, tm.tm_mday, @@ -1588,7 +1588,7 @@ do_bootm_rtems (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], (*entry_point ) ( gd->bd ); } -#if (CONFIG_COMMANDS & CFG_CMD_ELF) || defined(CONFIG_CMD_ELF) +#if defined(CONFIG_CMD_ELF) static void do_bootm_vxworks (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], ulong addr, ulong *len_ptr, int verify) diff --git a/common/cmd_cache.c b/common/cmd_cache.c index 29ca6213f0..6890fafc30 100644 --- a/common/cmd_cache.c +++ b/common/cmd_cache.c @@ -27,7 +27,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_CACHE) || defined(CONFIG_CMD_CACHE) +#if defined(CONFIG_CMD_CACHE) static int on_off (const char *); diff --git a/common/cmd_console.c b/common/cmd_console.c index 70f8a20649..530e3453c7 100644 --- a/common/cmd_console.c +++ b/common/cmd_console.c @@ -28,7 +28,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_CONSOLE) || defined(CONFIG_CMD_CONSOLE) +#if defined(CONFIG_CMD_CONSOLE) extern void _do_coninfo (void); int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char *argv[]) diff --git a/common/cmd_date.c b/common/cmd_date.c index 7b7f547ddb..93c2ca43dc 100644 --- a/common/cmd_date.c +++ b/common/cmd_date.c @@ -31,7 +31,7 @@ DECLARE_GLOBAL_DATA_PTR; -#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_CMD_DATE) +#if defined(CONFIG_CMD_DATE) const char *weekdays[] = { "Sun", "Mon", "Tues", "Wednes", "Thurs", "Fri", "Satur", diff --git a/common/cmd_dcr.c b/common/cmd_dcr.c index 31c732e8da..e79280c105 100644 --- a/common/cmd_dcr.c +++ b/common/cmd_dcr.c @@ -29,7 +29,7 @@ #include #include -#if defined(CONFIG_4xx) && ((CONFIG_COMMANDS & CFG_CMD_SETGETDCR) || defined(CONFIG_CMD_SETGETDCR)) +#if defined(CONFIG_4xx) && defined(CONFIG_CMD_SETGETDCR) unsigned long get_dcr (unsigned short); unsigned long set_dcr (unsigned short, unsigned long); diff --git a/common/cmd_diag.c b/common/cmd_diag.c index 7293457c5d..091e3c8a77 100644 --- a/common/cmd_diag.c +++ b/common/cmd_diag.c @@ -28,7 +28,7 @@ #include #include -#if ((CONFIG_COMMANDS & CFG_CMD_DIAG) || defined(CONFIG_CMD_DIAG)) && defined(CONFIG_POST) +#if defined(CONFIG_CMD_DIAG) && defined(CONFIG_POST) int do_diag (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) { diff --git a/common/cmd_display.c b/common/cmd_display.c index f2e7e88062..47ef35a198 100644 --- a/common/cmd_display.c +++ b/common/cmd_display.c @@ -24,7 +24,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_DISPLAY) || defined(CONFIG_CMD_DISPLAY) +#if defined(CONFIG_CMD_DISPLAY) #undef DEBUG_DISP diff --git a/common/cmd_doc.c b/common/cmd_doc.c index 4293aa18cf..9af625ad20 100644 --- a/common/cmd_doc.c +++ b/common/cmd_doc.c @@ -19,7 +19,7 @@ # define SHOW_BOOT_PROGRESS(arg) #endif -#if (CONFIG_COMMANDS & CFG_CMD_DOC) || defined(CONFIG_CMD_DOC) +#if defined(CONFIG_CMD_DOC) #include #include @@ -1608,4 +1608,4 @@ void doc_probe(unsigned long physadr) } } -#endif /* (CONFIG_COMMANDS & CFG_CMD_DOC) */ +#endif diff --git a/common/cmd_dtt.c b/common/cmd_dtt.c index b220ecb2fb..8da95bf9d3 100644 --- a/common/cmd_dtt.c +++ b/common/cmd_dtt.c @@ -25,7 +25,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_DTT) || defined(CONFIG_CMD_DTT) +#if defined(CONFIG_CMD_DTT) #include #include @@ -61,4 +61,4 @@ U_BOOT_CMD( " - Read temperature from digital thermometer and thermostat.\n" ); -#endif /* CONFIG_COMMANDS & CFG_CMD_DTT */ +#endif diff --git a/common/cmd_eeprom.c b/common/cmd_eeprom.c index b4467e89cd..d6fb9ab748 100644 --- a/common/cmd_eeprom.c +++ b/common/cmd_eeprom.c @@ -42,7 +42,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_EEPROM) || defined(CFG_ENV_IS_IN_EEPROM) || defined(CONFIG_CMD_EEPROM) +#if defined(CFG_ENV_IS_IN_EEPROM) || defined(CONFIG_CMD_EEPROM) extern void eeprom_init (void); extern int eeprom_read (unsigned dev_addr, unsigned offset, @@ -62,7 +62,7 @@ extern int eeprom_write_enable (unsigned dev_addr, int state); /* ------------------------------------------------------------------------- */ -#if (CONFIG_COMMANDS & CFG_CMD_EEPROM) || defined(CONFIG_CMD_EEPROM) +#if defined(CONFIG_CMD_EEPROM) int do_eeprom ( cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) { const char *const fmt = @@ -121,7 +121,7 @@ int do_eeprom ( cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) * 0x00000nxx for EEPROM address selectors and page number at n. */ -#if (CONFIG_COMMANDS & CFG_CMD_EEPROM) || defined(CFG_ENV_IS_IN_EEPROM) || defined(CONFIG_CMD_EEPROM) +#if defined(CFG_ENV_IS_IN_EEPROM) || defined(CONFIG_CMD_EEPROM) #ifndef CONFIG_SPI #if !defined(CFG_I2C_EEPROM_ADDR_LEN) || CFG_I2C_EEPROM_ADDR_LEN < 1 || CFG_I2C_EEPROM_ADDR_LEN > 2 @@ -425,7 +425,7 @@ void eeprom_init (void) #endif /* CFG_CMD_EEPROM */ /***************************************************/ -#if (CONFIG_COMMANDS & CFG_CMD_EEPROM) || defined(CONFIG_CMD_EEPROM) +#if defined(CONFIG_CMD_EEPROM) #ifdef CFG_I2C_MULTI_EEPROMS U_BOOT_CMD( diff --git a/common/cmd_elf.c b/common/cmd_elf.c index cc8a8daa70..6d72619380 100644 --- a/common/cmd_elf.c +++ b/common/cmd_elf.c @@ -23,7 +23,7 @@ DECLARE_GLOBAL_DATA_PTR; #endif -#if (CONFIG_COMMANDS & CFG_CMD_ELF) || defined(CONFIG_CMD_ELF) +#if defined(CONFIG_CMD_ELF) #ifndef MAX #define MAX(a,b) ((a) > (b) ? (a) : (b)) @@ -101,7 +101,7 @@ int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) else addr = simple_strtoul (argv[1], NULL, 16); -#if (CONFIG_COMMANDS & CFG_CMD_NET) || defined(CONFIG_CMD_NET) +#if defined(CONFIG_CMD_NET) /* Check to see if we need to tftp the image ourselves before starting */ if ((argc == 2) && (strcmp (argv[1], "tftp") == 0)) { diff --git a/common/cmd_ext2.c b/common/cmd_ext2.c index d0999acd9e..8bd2b476e5 100644 --- a/common/cmd_ext2.c +++ b/common/cmd_ext2.c @@ -35,14 +35,14 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_EXT2) || defined(CONFIG_CMD_EXT2) +#if defined(CONFIG_CMD_EXT2) #include #include #include #include #include #include -#if (((CONFIG_COMMANDS & CFG_CMD_USB) || defined(CONFIG_CMD_USB)) && defined(CONFIG_USB_STORAGE)) +#if defined(CONFIG_CMD_USB) && defined(CONFIG_USB_STORAGE) #include #endif @@ -260,4 +260,4 @@ U_BOOT_CMD( " to address 'addr' from ext2 filesystem\n" ); -#endif /* CONFIG_COMMANDS & CFG_CMD_EXT2 */ +#endif diff --git a/common/cmd_fat.c b/common/cmd_fat.c index f7e6c86dc2..0f0ff4a369 100644 --- a/common/cmd_fat.c +++ b/common/cmd_fat.c @@ -31,7 +31,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_FAT) || defined(CONFIG_CMD_FAT) +#if defined(CONFIG_CMD_FAT) #undef DEBUG diff --git a/common/cmd_fdc.c b/common/cmd_fdc.c index 3c2ba56bb3..7349412c77 100644 --- a/common/cmd_fdc.c +++ b/common/cmd_fdc.c @@ -47,12 +47,11 @@ #endif -/*#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_CMD_DATE) */ +/*#if defined(CONFIG_CMD_DATE) */ /*#include */ /*#endif */ -#if (CONFIG_COMMANDS & CFG_CMD_FDC) || defined(CONFIG_CMD_FDC) \ - || (CONFIG_COMMANDS & CFG_CMD_FDOS) || defined(CONFIG_CMD_FDOS) +#if defined(CONFIG_CMD_FDC) || defined(CONFIG_CMD_FDOS) typedef struct { @@ -708,9 +707,9 @@ int fdc_setup(int drive, FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG) return TRUE; } -#endif /* ((CONFIG_COMMANDS & CFG_CMD_FDC)||(CONFIG_COMMANDS & CFG_CMD_FDOS))*/ +#endif -#if (CONFIG_COMMANDS & CFG_CMD_FDOS) || defined(CONFIG_CMD_FDOS) +#if defined(CONFIG_CMD_FDOS) /* Low level functions for the Floppy-DOS layer */ @@ -773,9 +772,9 @@ int fdc_fdos_read (void *buffer, int len) return (fdc_read_data (buffer, len, pCMD, pFG)); } -#endif /* (CONFIG_COMMANDS & CFG_CMD_FDOS) */ +#endif -#if (CONFIG_COMMANDS & CFG_CMD_FDC) || defined(CONFIG_CMD_FDC) +#if defined(CONFIG_CMD_FDC) /**************************************************************************** * main routine do_fdcboot */ @@ -881,13 +880,13 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } -#endif /* CONFIG_COMMANDS & CFG_CMD_FDC */ +#endif /***************************************************/ -#if (CONFIG_COMMANDS & CFG_CMD_FDC) || defined(CONFIG_CMD_FDC) +#if defined(CONFIG_CMD_FDC) U_BOOT_CMD( fdcboot, 3, 1, do_fdcboot, diff --git a/common/cmd_fdos.c b/common/cmd_fdos.c index 8208d7b82f..f9da98ddcc 100644 --- a/common/cmd_fdos.c +++ b/common/cmd_fdos.c @@ -31,7 +31,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_FDOS) || defined(CONFIG_CMD_FDOS) +#if defined(CONFIG_CMD_FDOS) /*----------------------------------------------------------------------------- * do_fdosboot -- @@ -154,4 +154,4 @@ U_BOOT_CMD( "[directory]\n" ); -#endif /* CONFIG_COMMANDS & CFG_CMD_FDOS */ +#endif diff --git a/common/cmd_flash.c b/common/cmd_flash.c index 4744e97767..e191f9ce40 100644 --- a/common/cmd_flash.c +++ b/common/cmd_flash.c @@ -31,9 +31,9 @@ #include #endif -#if (CONFIG_COMMANDS & CFG_CMD_FLASH) || defined(CONFIG_CMD_FLASH) +#if defined(CONFIG_CMD_FLASH) -#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2)) && defined(CONFIG_JFFS2_CMDLINE) +#if (defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) #include /* parition handling routines */ @@ -311,7 +311,7 @@ int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) flash_info_t *info; ulong bank, addr_first, addr_last; int n, sect_first, sect_last; -#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2)) && defined(CONFIG_JFFS2_CMDLINE) +#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) struct mtd_device *dev; struct part_info *part; u8 dev_type, dev_num, pnum; @@ -343,7 +343,7 @@ int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return rcode; } -#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2)) && defined(CONFIG_JFFS2_CMDLINE) +#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) /* erase - erase partition */ if ((argc == 2) && (id_parse(argv[1], NULL, &dev_type, &dev_num) == 0)) { mtdparts_init(); @@ -447,7 +447,7 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) flash_info_t *info; ulong bank, addr_first, addr_last; int i, p, n, sect_first, sect_last; -#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2)) && defined(CONFIG_JFFS2_CMDLINE) +#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) struct mtd_device *dev; struct part_info *part; u8 dev_type, dev_num, pnum; @@ -539,7 +539,7 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return rcode; } -#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2)) && defined(CONFIG_JFFS2_CMDLINE) +#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) /* protect on/off */ if ((argc == 3) && (id_parse(argv[2], NULL, &dev_type, &dev_num) == 0)) { mtdparts_init(); @@ -672,7 +672,7 @@ int flash_sect_protect (int p, ulong addr_first, ulong addr_last) /**************************************************/ -#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2)) && defined(CONFIG_JFFS2_CMDLINE) +#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) # define TMP_ERASE "erase \n - erase partition\n" # define TMP_PROT_ON "protect on \n - protect partition\n" # define TMP_PROT_OFF "protect off \n - make partition writable\n" diff --git a/common/cmd_fpga.c b/common/cmd_fpga.c index e32b29a011..3fc4fca9ae 100644 --- a/common/cmd_fpga.c +++ b/common/cmd_fpga.c @@ -27,7 +27,7 @@ */ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_NET) || defined(CONFIG_CMD_NET) +#if defined(CONFIG_CMD_NET) #include #endif #include @@ -43,7 +43,7 @@ #define PRINTF(fmt,args...) #endif -#if defined (CONFIG_FPGA) && ((CONFIG_COMMANDS & CFG_CMD_FPGA ) || defined(CONFIG_CMD_FPGA)) +#if defined (CONFIG_FPGA) && defined(CONFIG_CMD_FPGA) /* Local functions */ static void fpga_usage (cmd_tbl_t * cmdtp); @@ -321,4 +321,4 @@ U_BOOT_CMD (fpga, 6, 1, do_fpga, "\tloadb\tLoad device from bitstream buffer (Xilinx devices only)\n" "\tloadmk\tLoad device generated with mkimage\n" "\tdump\tLoad device to memory buffer\n"); -#endif /* CONFIG_FPGA && CONFIG_COMMANDS & CFG_CMD_FPGA */ +#endif -- cgit v1.2.1 From c76fe47425afc7d5d670ff0539823c85d65d9c42 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Sun, 8 Jul 2007 18:02:23 -0500 Subject: common/cmd_[i-n]*: Remove obsolete references to CONFIG_COMMANDS. Signed-off-by: Jon Loeliger --- common/cmd_i2c.c | 10 +++++----- common/cmd_ide.c | 4 ++-- common/cmd_immap.c | 2 +- common/cmd_itest.c | 4 ++-- common/cmd_jffs2.c | 14 +++++++------- common/cmd_load.c | 20 ++++++++++---------- common/cmd_mem.c | 15 +++++---------- common/cmd_mfsl.c | 2 +- common/cmd_mii.c | 2 +- common/cmd_misc.c | 6 +++--- common/cmd_mmc.c | 2 +- common/cmd_nand.c | 23 +++++++++-------------- common/cmd_net.c | 16 ++++++++-------- common/cmd_nvedit.c | 18 +++++------------- 14 files changed, 60 insertions(+), 78 deletions(-) (limited to 'common') diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c index b9d9d332e2..6aeeb84964 100644 --- a/common/cmd_i2c.c +++ b/common/cmd_i2c.c @@ -86,7 +86,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_I2C) || defined(CONFIG_CMD_I2C) +#if defined(CONFIG_CMD_I2C) /* Display values from last command. @@ -657,7 +657,7 @@ int do_i2c_loop(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * The SDRAM command is separately configured because many * (most?) embedded boards don't use SDRAM DIMMs. */ -#if (CONFIG_COMMANDS & CFG_CMD_SDRAM) || defined(CONFIG_CMD_SDRAM) +#if defined(CONFIG_CMD_SDRAM) /* * Syntax: @@ -938,7 +938,7 @@ int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) return do_i2c_probe(cmdtp, flag, --argc, ++argv); if (!strncmp(argv[1], "lo", 2)) return do_i2c_loop(cmdtp, flag, --argc, ++argv); -#if (CONFIG_COMMANDS & CFG_CMD_SDRAM) || defined(CONFIG_CMD_SDRAM) +#if defined(CONFIG_CMD_SDRAM) if (!strncmp(argv[1], "sd", 2)) return do_sdram(cmdtp, flag, --argc, ++argv); #endif /* CFG_CMD_SDRAM */ @@ -965,7 +965,7 @@ U_BOOT_CMD( "i2c crc32 chip address[.0, .1, .2] count - compute CRC32 checksum\n" "i2c probe - show devices on the I2C bus\n" "i2c loop chip address[.0, .1, .2] [# of objects] - looping read of device\n" -#if (CONFIG_COMMANDS & CFG_CMD_SDRAM) || defined(CONFIG_CMD_SDRAM) +#if defined(CONFIG_CMD_SDRAM) "i2c sdram chip - print SDRAM configuration information\n" #endif /* CFG_CMD_SDRAM */ ); @@ -1016,7 +1016,7 @@ U_BOOT_CMD( " - loop, reading a set of addresses\n" ); -#if (CONFIG_COMMANDS & CFG_CMD_SDRAM) || defined(CONFIG_CMD_SDRAM) +#if defined(CONFIG_CMD_SDRAM) U_BOOT_CMD( isdram, 2, 1, do_sdram, "isdram - print SDRAM configuration information\n", diff --git a/common/cmd_ide.c b/common/cmd_ide.c index 461a4bc533..d74f2dabcd 100644 --- a/common/cmd_ide.c +++ b/common/cmd_ide.c @@ -78,7 +78,7 @@ DECLARE_GLOBAL_DATA_PTR; # define SYNC /* nothing */ #endif -#if (CONFIG_COMMANDS & CFG_CMD_IDE) || defined(CONFIG_CMD_IDE) +#if defined(CONFIG_CMD_IDE) #ifdef CONFIG_IDE_8xx_DIRECT /* Timings for IDE Interface @@ -2080,4 +2080,4 @@ U_BOOT_CMD( "loadAddr dev:part\n" ); -#endif /* CONFIG_COMMANDS & CFG_CMD_IDE */ +#endif diff --git a/common/cmd_immap.c b/common/cmd_immap.c index 477c742e93..e211b161bd 100644 --- a/common/cmd_immap.c +++ b/common/cmd_immap.c @@ -28,7 +28,7 @@ #include #include -#if ((CONFIG_COMMANDS & CFG_CMD_IMMAP) || defined(CONFIG_CMD_IMMAP)) && \ +#if defined(CONFIG_CMD_IMMAP) && \ (defined(CONFIG_8xx) || defined(CONFIG_8260)) #if defined(CONFIG_8xx) diff --git a/common/cmd_itest.c b/common/cmd_itest.c index 24129aa989..8e2051714c 100644 --- a/common/cmd_itest.c +++ b/common/cmd_itest.c @@ -32,7 +32,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_ITEST) || defined(CONFIG_CMD_ITEST) +#if defined(CONFIG_CMD_ITEST) #define EQ 0 #define NE 1 @@ -197,4 +197,4 @@ U_BOOT_CMD( "itest\t- return true/false on integer compare\n", "[.b, .w, .l, .s] [*]value1 [*]value2\n" ); -#endif /* CONFIG_COMMANDS & CFG_CMD_ITEST */ +#endif diff --git a/common/cmd_jffs2.c b/common/cmd_jffs2.c index 8a882ab46c..777607a0ca 100644 --- a/common/cmd_jffs2.c +++ b/common/cmd_jffs2.c @@ -94,18 +94,18 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2) +#if defined(CONFIG_CMD_JFFS2) #include -#if (CONFIG_COMMANDS & CFG_CMD_NAND) || defined(CONFIG_CMD_NAND) +#if defined(CONFIG_CMD_NAND) #ifdef CFG_NAND_LEGACY #include #else /* !CFG_NAND_LEGACY */ #include #include #endif /* !CFG_NAND_LEGACY */ -#endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) */ +#endif /* enable/disable debugging messages */ #define DEBUG_JFFS #undef DEBUG_JFFS @@ -321,7 +321,7 @@ static void current_save(void) */ static int part_validate_nor(struct mtdids *id, struct part_info *part) { -#if (CONFIG_COMMANDS & CFG_CMD_FLASH) || defined(CONFIG_CMD_FLASH) +#if defined(CONFIG_CMD_FLASH) /* info for FLASH chips */ extern flash_info_t flash_info[]; flash_info_t *flash; @@ -370,7 +370,7 @@ static int part_validate_nor(struct mtdids *id, struct part_info *part) */ static int part_validate_nand(struct mtdids *id, struct part_info *part) { -#if defined(CONFIG_JFFS2_NAND) && ((CONFIG_COMMANDS & CFG_CMD_NAND) || defined(CONFIG_CMD_NAND)) +#if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND) /* info for NAND chips */ nand_info_t *nand; @@ -719,7 +719,7 @@ static int part_parse(const char *const partdef, const char **ret, struct part_i static int device_validate(u8 type, u8 num, u32 *size) { if (type == MTD_DEV_TYPE_NOR) { -#if (CONFIG_COMMANDS & CFG_CMD_FLASH) || defined(CONFIG_CMD_FLASH) +#if defined(CONFIG_CMD_FLASH) if (num < CFG_MAX_FLASH_BANKS) { extern flash_info_t flash_info[]; *size = flash_info[num].size; @@ -733,7 +733,7 @@ static int device_validate(u8 type, u8 num, u32 *size) printf("support for FLASH devices not present\n"); #endif } else if (type == MTD_DEV_TYPE_NAND) { -#if defined(CONFIG_JFFS2_NAND) && ((CONFIG_COMMANDS & CFG_CMD_NAND) || defined(CONFIG_CMD_NAND)) +#if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND) if (num < CFG_MAX_NAND_DEVICE) { #ifndef CFG_NAND_LEGACY *size = nand_info[num].size; diff --git a/common/cmd_load.c b/common/cmd_load.c index 0456f75ba9..d3d268158e 100644 --- a/common/cmd_load.c +++ b/common/cmd_load.c @@ -33,14 +33,14 @@ DECLARE_GLOBAL_DATA_PTR; -#if (CONFIG_COMMANDS & CFG_CMD_LOADB) || defined(CONFIG_CMD_LOADB) +#if defined(CONFIG_CMD_LOADB) static ulong load_serial_ymodem (ulong offset); #endif -#if (CONFIG_COMMANDS & CFG_CMD_LOADS) || defined(CONFIG_CMD_LOADS) +#if defined(CONFIG_CMD_LOADS) static ulong load_serial (ulong offset); static int read_record (char *buf, ulong len); -# if (CONFIG_COMMANDS & CFG_CMD_SAVES) || defined(CONFIG_CMD_SAVES) +# if defined(CONFIG_CMD_SAVES) static int save_serial (ulong offset, ulong size); static int write_record (char *buf); # endif /* CFG_CMD_SAVES */ @@ -50,7 +50,7 @@ static int do_echo = 1; /* -------------------------------------------------------------------- */ -#if (CONFIG_COMMANDS & CFG_CMD_LOADS) || defined(CONFIG_CMD_LOADS) +#if defined(CONFIG_CMD_LOADS) int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { ulong offset = 0; @@ -253,7 +253,7 @@ read_record (char *buf, ulong len) return (p - buf); } -#if (CONFIG_COMMANDS & CFG_CMD_SAVES) || defined(CONFIG_CMD_SAVES) +#if defined(CONFIG_CMD_SAVES) int do_save_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { @@ -404,7 +404,7 @@ write_record (char *buf) #endif /* CFG_CMD_LOADS */ -#if (CONFIG_COMMANDS & CFG_CMD_LOADB) || defined(CONFIG_CMD_LOADB) +#if defined(CONFIG_CMD_LOADB) /* * loadb command (load binary) included */ @@ -1042,7 +1042,7 @@ static ulong load_serial_ymodem (ulong offset) /* -------------------------------------------------------------------- */ -#if (CONFIG_COMMANDS & CFG_CMD_LOADS) || defined(CONFIG_CMD_LOADS) +#if defined(CONFIG_CMD_LOADS) #ifdef CFG_LOADS_BAUD_CHANGE U_BOOT_CMD( @@ -1067,7 +1067,7 @@ U_BOOT_CMD( */ -#if (CONFIG_COMMANDS & CFG_CMD_SAVES) || defined(CONFIG_CMD_SAVES) +#if defined(CONFIG_CMD_SAVES) #ifdef CFG_LOADS_BAUD_CHANGE U_BOOT_CMD( saves, 4, 0, do_save_serial, @@ -1088,7 +1088,7 @@ U_BOOT_CMD( #endif /* CFG_CMD_LOADS */ -#if (CONFIG_COMMANDS & CFG_CMD_LOADB) || defined(CONFIG_CMD_LOADB) +#if defined(CONFIG_CMD_LOADB) U_BOOT_CMD( loadb, 3, 0, do_load_serial_bin, "loadb - load binary file over serial line (kermit mode)\n", @@ -1109,7 +1109,7 @@ U_BOOT_CMD( /* -------------------------------------------------------------------- */ -#if (CONFIG_COMMANDS & CFG_CMD_HWFLOW) || defined(CONFIG_CMD_HWFLOW) +#if defined(CONFIG_CMD_HWFLOW) int do_hwflow (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { extern int hwflow_onoff(int); diff --git a/common/cmd_mem.c b/common/cmd_mem.c index b5479743af..001dfa27d7 100644 --- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -29,19 +29,14 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_MMC) || defined(CONFIG_CMD_MMC) +#if defined(CONFIG_CMD_MMC) #include #endif #ifdef CONFIG_HAS_DATAFLASH #include #endif -#if (CONFIG_COMMANDS & (CFG_CMD_MEMORY | \ - CFG_CMD_I2C | \ - CFG_CMD_ITEST | \ - CFG_CMD_PCI | \ - CMD_CMD_PORTIO ) ) \ - || defined(CONFIG_CMD_MEMORY) \ +#if defined(CONFIG_CMD_MEMORY) \ || defined(CONFIG_CMD_I2C) \ || defined(CONFIG_CMD_ITEST) \ || defined(CONFIG_CMD_PCI) \ @@ -70,7 +65,7 @@ int cmd_get_data_size(char* arg, int default_size) } #endif -#if (CONFIG_COMMANDS & CFG_CMD_MEMORY) || defined(CONFIG_CMD_MEMORY) +#if defined(CONFIG_CMD_MEMORY) #ifdef CMD_MEM_DEBUG #define PRINTF(fmt,args...) printf (fmt ,##args) @@ -409,7 +404,7 @@ int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } #endif -#if (CONFIG_COMMANDS & CFG_CMD_MMC) || defined(CONFIG_CMD_MMC) +#if defined(CONFIG_CMD_MMC) if (mmc2info(dest)) { int rc; @@ -1155,7 +1150,7 @@ int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #endif /* CONFIG_CRC32_VERIFY */ /**************************************************/ -#if (CONFIG_COMMANDS & CFG_CMD_MEMORY) || defined(CONFIG_CMD_MEMORY) +#if defined(CONFIG_CMD_MEMORY) U_BOOT_CMD( md, 3, 1, do_mem_md, "md - memory display\n", diff --git a/common/cmd_mfsl.c b/common/cmd_mfsl.c index 5dcfc9466f..b143dc291f 100644 --- a/common/cmd_mfsl.c +++ b/common/cmd_mfsl.c @@ -30,7 +30,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_MFSL) || defined(CONFIG_CMD_MFSL) +#if defined(CONFIG_CMD_MFSL) #include int do_frd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) diff --git a/common/cmd_mii.c b/common/cmd_mii.c index bfeef792ba..120b8e804a 100644 --- a/common/cmd_mii.c +++ b/common/cmd_mii.c @@ -28,7 +28,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_MII) || defined(CONFIG_CMD_MII) +#if defined(CONFIG_CMD_MII) #include #ifdef CONFIG_TERSE_MII diff --git a/common/cmd_misc.c b/common/cmd_misc.c index c5540138f9..4d5a2ff1df 100644 --- a/common/cmd_misc.c +++ b/common/cmd_misc.c @@ -27,7 +27,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_MISC) || defined(CONFIG_CMD_MISC) +#if defined(CONFIG_CMD_MISC) int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { @@ -52,7 +52,7 @@ int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } /* Implemented in $(CPU)/interrupts.c */ -#if (CONFIG_COMMANDS & CFG_CMD_IRQ) || defined(CONFIG_CMD_IRQ) +#if defined(CONFIG_CMD_IRQ) int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); U_BOOT_CMD( @@ -60,7 +60,7 @@ U_BOOT_CMD( "irqinfo - print information about IRQs\n", NULL ); -#endif /* CONFIG_COMMANDS & CFG_CMD_IRQ */ +#endif U_BOOT_CMD( sleep , 2, 1, do_sleep, diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c index 7abaa98cf7..c772e9bc3b 100644 --- a/common/cmd_mmc.c +++ b/common/cmd_mmc.c @@ -24,7 +24,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_MMC) || defined(CONFIG_CMD_MMC) +#if defined(CONFIG_CMD_MMC) #include diff --git a/common/cmd_nand.c b/common/cmd_nand.c index 63a68eb180..d5844456cb 100644 --- a/common/cmd_nand.c +++ b/common/cmd_nand.c @@ -19,7 +19,7 @@ */ #include -#if (CONFIG_COMMANDS & CFG_CMD_NAND) || defined(CONFIG_CMD_NAND) +#if defined(CONFIG_CMD_NAND) #include #include @@ -36,8 +36,7 @@ #include #include -#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2)) \ - && defined(CONFIG_JFFS2_CMDLINE) +#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) /* parition handling routines */ int mtdparts_init(void); @@ -105,8 +104,7 @@ static int arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, ulong *size) { int idx = nand_curr_device; -#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2)) \ - && defined(CONFIG_JFFS2_CMDLINE) +#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) struct mtd_device *dev; struct part_info *part; u8 pnum; @@ -154,8 +152,7 @@ arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, ulong *size) *size = nand->size - *off; } -#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2)) \ - && defined(CONFIG_JFFS2_CMDLINE) +#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) out: #endif printf("device %d ", idx); @@ -537,8 +534,7 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) char *boot_device = NULL; int idx; ulong addr, offset = 0; -#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2)) \ - && defined(CONFIG_JFFS2_CMDLINE) +#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) struct mtd_device *dev; struct part_info *part; u8 pnum; @@ -582,8 +578,7 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) offset = simple_strtoul(argv[3], NULL, 16); break; default: -#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) || defined(CONFIG_CMD_JFFS2)) \ - && defined(CONFIG_JFFS2_CMDLINE) +#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) usage: #endif printf("Usage:\n%s\n", cmdtp->usage); @@ -612,7 +607,7 @@ U_BOOT_CMD(nboot, 4, 1, do_nandboot, "nboot - boot from NAND device\n", "[partition] | [[[loadAddr] dev] offset]\n"); -#endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) */ +#endif #else /* CFG_NAND_LEGACY */ /* @@ -632,7 +627,7 @@ U_BOOT_CMD(nboot, 4, 1, do_nandboot, # define SHOW_BOOT_PROGRESS(arg) #endif -#if (CONFIG_COMMANDS & CFG_CMD_NAND) || defined(CONFIG_CMD_NAND) +#if defined(CONFIG_CMD_NAND) #include #if 0 #include @@ -990,6 +985,6 @@ U_BOOT_CMD( "loadAddr dev\n" ); -#endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) */ +#endif #endif /* CFG_NAND_LEGACY */ diff --git a/common/cmd_net.c b/common/cmd_net.c index ad9a7dcd60..da55f14a2e 100644 --- a/common/cmd_net.c +++ b/common/cmd_net.c @@ -28,7 +28,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_NET) || defined(CONFIG_CMD_NET) +#if defined(CONFIG_CMD_NET) extern int do_bootm (cmd_tbl_t *, int, int, char *[]); @@ -68,7 +68,7 @@ U_BOOT_CMD( "[loadAddress] [bootfilename]\n" ); -#if (CONFIG_COMMANDS & CFG_CMD_DHCP) || defined(CONFIG_CMD_DHCP) +#if defined(CONFIG_CMD_DHCP) int do_dhcp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { return netboot_common(DHCP, cmdtp, argc, argv); @@ -81,7 +81,7 @@ U_BOOT_CMD( ); #endif /* CFG_CMD_DHCP */ -#if (CONFIG_COMMANDS & CFG_CMD_NFS) || defined(CONFIG_CMD_NFS) +#if defined(CONFIG_CMD_NFS) int do_nfs (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { return netboot_common(NFS, cmdtp, argc, argv); @@ -137,14 +137,14 @@ static void netboot_update_env (void) if (NetOurNISDomain[0]) setenv ("domain", NetOurNISDomain); -#if ((CONFIG_COMMANDS & CFG_CMD_SNTP) || defined(CONFIG_CMD_SNTP)) \ +#if defined(CONFIG_CMD_SNTP) \ && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_TIMEOFFSET) if (NetTimeOffset) { sprintf (tmp, "%d", NetTimeOffset); setenv ("timeoffset", tmp); } #endif -#if ((CONFIG_COMMANDS & CFG_CMD_SNTP) || defined(CONFIG_CMD_SNTP)) \ +#if defined(CONFIG_CMD_SNTP) \ && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NTPSERVER) if (NetNtpServerIP) { ip_to_string (NetNtpServerIP, tmp); @@ -222,7 +222,7 @@ netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char *argv[]) return rcode; } -#if (CONFIG_COMMANDS & CFG_CMD_PING) || defined(CONFIG_CMD_PING) +#if defined(CONFIG_CMD_PING) int do_ping (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { if (argc < 2) @@ -251,7 +251,7 @@ U_BOOT_CMD( ); #endif /* CFG_CMD_PING */ -#if (CONFIG_COMMANDS & CFG_CMD_CDP) || defined(CONFIG_CMD_CDP) +#if defined(CONFIG_CMD_CDP) static void cdp_update_env(void) { @@ -294,7 +294,7 @@ U_BOOT_CMD( ); #endif /* CFG_CMD_CDP */ -#if (CONFIG_COMMANDS & CFG_CMD_SNTP) || defined(CONFIG_CMD_SNTP) +#if defined(CONFIG_CMD_SNTP) int do_sntp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { char *toff; diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index 27e46db36b..68a2dc8bb9 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -46,7 +46,7 @@ #include #include #include -#if (CONFIG_COMMANDS & CFG_CMD_NET) || defined(CONFIG_CMD_NET) +#if defined(CONFIG_CMD_NET) #include #endif @@ -367,7 +367,7 @@ int _do_setenv (int flag, int argc, char *argv[]) load_addr = simple_strtoul(argv[2], NULL, 16); return 0; } -#if (CONFIG_COMMANDS & CFG_CMD_NET) || defined(CONFIG_CMD_NET) +#if defined(CONFIG_CMD_NET) if (strcmp(argv[1],"bootfile") == 0) { copy_filename (BootFile, argv[2], sizeof(BootFile)); return 0; @@ -411,7 +411,7 @@ int do_setenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * Prompt for environment variable */ -#if (CONFIG_COMMANDS & CFG_CMD_ASKENV) || defined(CONFIG_CMD_ASKENV) +#if defined(CONFIG_CMD_ASKENV) int do_askenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { extern char console_buffer[CFG_CBSIZE]; @@ -539,10 +539,6 @@ int getenv_r (char *name, char *buf, unsigned len) } #if defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) || \ - ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_FLASH)) == \ - (CFG_CMD_ENV|CFG_CMD_FLASH)) || \ - ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_NAND)) == \ - (CFG_CMD_ENV|CFG_CMD_NAND)) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) @@ -599,10 +595,6 @@ U_BOOT_CMD( ); #if defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) || \ - ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_FLASH)) == \ - (CFG_CMD_ENV|CFG_CMD_FLASH)) || \ - ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_NAND)) == \ - (CFG_CMD_ENV|CFG_CMD_NAND)) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) U_BOOT_CMD( @@ -613,7 +605,7 @@ U_BOOT_CMD( #endif /* CFG_CMD_ENV */ -#if (CONFIG_COMMANDS & CFG_CMD_ASKENV) || defined(CONFIG_CMD_ASKENV) +#if defined(CONFIG_CMD_ASKENV) U_BOOT_CMD( askenv, CFG_MAXARGS, 1, do_askenv, @@ -630,7 +622,7 @@ U_BOOT_CMD( ); #endif /* CFG_CMD_ASKENV */ -#if (CONFIG_COMMANDS & CFG_CMD_RUN) || defined(CONFIG_CMD_RUN) +#if defined(CONFIG_CMD_RUN) int do_run (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); U_BOOT_CMD( run, CFG_MAXARGS, 1, do_run, -- cgit v1.2.1 From fd9bcaa35be64fe41a4223fdb6ecdbad52470b39 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Sun, 8 Jul 2007 18:05:39 -0500 Subject: common/cmd_[p-x]*: Remove obsolete references to CONFIG_COMMANDS. Signed-off-by: Jon Loeliger --- common/cmd_pci.c | 4 ++-- common/cmd_pcmcia.c | 7 +++---- common/cmd_portio.c | 2 +- common/cmd_reginfo.c | 6 +++--- common/cmd_reiser.c | 4 ++-- common/cmd_scsi.c | 4 ++-- common/cmd_spi.c | 2 +- common/cmd_universe.c | 4 ++-- common/cmd_usb.c | 6 +++--- common/cmd_vfd.c | 2 +- common/cmd_ximg.c | 4 ++-- 11 files changed, 22 insertions(+), 23 deletions(-) (limited to 'common') diff --git a/common/cmd_pci.c b/common/cmd_pci.c index 10e06912c4..8be6da93f9 100644 --- a/common/cmd_pci.c +++ b/common/cmd_pci.c @@ -38,7 +38,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_PCI) || defined(CONFIG_CMD_PCI) +#if defined(CONFIG_CMD_PCI) extern int cmd_get_data_size(char* arg, int default_size); @@ -565,6 +565,6 @@ U_BOOT_CMD( " - write to CFG address\n" ); -#endif /* (CONFIG_COMMANDS & CFG_CMD_PCI) */ +#endif #endif /* CONFIG_PCI */ diff --git a/common/cmd_pcmcia.c b/common/cmd_pcmcia.c index dfa41e0ae2..dcd07c05e5 100644 --- a/common/cmd_pcmcia.c +++ b/common/cmd_pcmcia.c @@ -61,7 +61,7 @@ /* -------------------------------------------------------------------- */ -#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA) || defined(CONFIG_CMD_PCMCIA) +#if defined(CONFIG_CMD_PCMCIA) extern int pcmcia_on (void); extern int pcmcia_off (void); @@ -93,14 +93,13 @@ U_BOOT_CMD( "pinit off - power off PCMCIA socket\n" ); -#endif /* CONFIG_COMMANDS & CFG_CMD_PCMCIA */ +#endif /* -------------------------------------------------------------------- */ #undef CHECK_IDE_DEVICE -#if ((CONFIG_COMMANDS & CFG_CMD_IDE) || defined(CONFIG_CMD_IDE)) \ - && defined(CONFIG_IDE_8xx_PCCARD) +#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD) #define CHECK_IDE_DEVICE #endif diff --git a/common/cmd_portio.c b/common/cmd_portio.c index 6a074829e7..ad6656a7e9 100644 --- a/common/cmd_portio.c +++ b/common/cmd_portio.c @@ -30,7 +30,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_PORTIO) || defined(CONFIG_CMD_PORTIO) +#if defined(CONFIG_CMD_PORTIO) extern int cmd_get_data_size (char *arg, int default_size); diff --git a/common/cmd_reginfo.c b/common/cmd_reginfo.c index 57de0fe45c..17e9cd9072 100644 --- a/common/cmd_reginfo.c +++ b/common/cmd_reginfo.c @@ -33,7 +33,7 @@ #include #endif -#if (CONFIG_COMMANDS & CFG_CMD_REGINFO) || defined(CONFIG_CMD_REGINFO) +#if defined(CONFIG_CMD_REGINFO) int do_reginfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { @@ -335,14 +335,14 @@ int do_reginfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 0; } -#endif /* CONFIG_COMMANDS & CFG_CMD_REGINFO */ +#endif /**************************************************/ #if ( defined(CONFIG_8xx) || defined(CONFIG_405GP) || \ defined(CONFIG_405EP) || defined(CONFIG_MPC5200) ) && \ - ((CONFIG_COMMANDS & CFG_CMD_REGINFO) || defined(CONFIG_CMD_REGINFO)) + defined(CONFIG_CMD_REGINFO) U_BOOT_CMD( reginfo, 2, 1, do_reginfo, diff --git a/common/cmd_reiser.c b/common/cmd_reiser.c index f54019b5f1..989fd57c77 100644 --- a/common/cmd_reiser.c +++ b/common/cmd_reiser.c @@ -28,7 +28,7 @@ */ #include -#if (CONFIG_COMMANDS & CFG_CMD_REISER) || defined(CONFIG_CMD_REISER) +#if defined(CONFIG_CMD_REISER) #include #include #include @@ -240,4 +240,4 @@ U_BOOT_CMD( " to address 'addr' from dos filesystem\n" ); -#endif /* CONFIG_COMMANDS & CFG_CMD_REISER */ +#endif diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c index ac3d81cfed..f56393107f 100644 --- a/common/cmd_scsi.c +++ b/common/cmd_scsi.c @@ -34,7 +34,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_SCSI) || defined(CONFIG_CMD_SCSI) +#if defined(CONFIG_CMD_SCSI) #ifdef CONFIG_SCSI_SYM53C8XX #define SCSI_VEND_ID 0x1000 @@ -609,4 +609,4 @@ U_BOOT_CMD( "loadAddr dev:part\n" ); -#endif /* #if (CONFIG_COMMANDS & CFG_CMD_SCSI) */ +#endif diff --git a/common/cmd_spi.c b/common/cmd_spi.c index 5874222e7c..d446fe5058 100644 --- a/common/cmd_spi.c +++ b/common/cmd_spi.c @@ -29,7 +29,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_SPI) || defined(CONFIG_CMD_SPI) +#if defined(CONFIG_CMD_SPI) /*----------------------------------------------------------------------- * Definitions diff --git a/common/cmd_universe.c b/common/cmd_universe.c index cc55dc9303..8bf0b1f1e2 100644 --- a/common/cmd_universe.c +++ b/common/cmd_universe.c @@ -28,7 +28,7 @@ #include -#if (CONFIG_COMMANDS & CFG_CMD_UNIVERSE) || defined(CONFIG_CMD_UNIVERSE) +#if defined(CONFIG_CMD_UNIVERSE) #define PCI_VENDOR PCI_VENDOR_ID_TUNDRA #define PCI_DEVICE PCI_DEVICE_ID_TUNDRA_CA91C042 @@ -387,4 +387,4 @@ U_BOOT_CMD( " 03 -> D32 Data Width\n" ); -#endif /* (CONFIG_COMMANDS & CFG_CMD_UNIVERSE) */ +#endif diff --git a/common/cmd_usb.c b/common/cmd_usb.c index 529938fb02..45e07f175c 100644 --- a/common/cmd_usb.c +++ b/common/cmd_usb.c @@ -30,7 +30,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_USB) || defined(CONFIG_CMD_USB) +#if defined(CONFIG_CMD_USB) #include @@ -609,10 +609,10 @@ int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } -#endif /* (CONFIG_COMMANDS & CFG_CMD_USB) */ +#endif -#if (CONFIG_COMMANDS & CFG_CMD_USB) || defined(CONFIG_CMD_USB) +#if defined(CONFIG_CMD_USB) #ifdef CONFIG_USB_STORAGE U_BOOT_CMD( diff --git a/common/cmd_vfd.c b/common/cmd_vfd.c index fffb39cca2..6fc06247bc 100644 --- a/common/cmd_vfd.c +++ b/common/cmd_vfd.c @@ -35,7 +35,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_VFD) || defined(CONFIG_CMD_VFD) +#if defined(CONFIG_CMD_VFD) #include #define VFD_TEST_LOGO_BMPNR 0 diff --git a/common/cmd_ximg.c b/common/cmd_ximg.c index e490243e7c..52e0614496 100644 --- a/common/cmd_ximg.c +++ b/common/cmd_ximg.c @@ -24,7 +24,7 @@ * MA 02111-1307 USA */ -#if (CONFIG_COMMANDS & CFG_CMD_XIMG) || defined(CONFIG_CMD_XIMG) +#if defined(CONFIG_CMD_XIMG) /* * Multi Image extract @@ -141,4 +141,4 @@ U_BOOT_CMD(imxtract, 4, 1, do_imgextract, "addr part [dest]\n" " - extract from image at and copy to \n"); -#endif /* CONFIG_COMMANDS & CFG_CMD_XIMG */ +#endif -- cgit v1.2.1 From c3517f919d0f61650cf3027fd4faf0f631142f6c Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Sun, 8 Jul 2007 18:10:08 -0500 Subject: common/* non-cmd*: Remove obsolete references to CONFIG_COMMANDS Signed-off-by: Jon Loeliger --- common/command.c | 4 ++-- common/docecc.c | 4 ++-- common/env_flash.c | 2 +- common/env_nand.c | 2 +- common/exports.c | 4 ++-- common/hush.c | 2 +- common/kgdb.c | 2 +- common/lcd.c | 4 ++-- common/main.c | 4 ++-- common/miiphyutil.c | 4 ++-- common/usb.c | 4 ++-- common/usb_storage.c | 2 +- 12 files changed, 19 insertions(+), 19 deletions(-) (limited to 'common') diff --git a/common/command.c b/common/command.c index f8bd16b6f5..361ca62f42 100644 --- a/common/command.c +++ b/common/command.c @@ -42,7 +42,7 @@ U_BOOT_CMD( NULL ); -#if (CONFIG_COMMANDS & CFG_CMD_ECHO) || defined(CONFIG_CMD_ECHO) +#if defined(CONFIG_CMD_ECHO) int do_echo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) @@ -409,7 +409,7 @@ void install_auto_complete(void) { install_auto_complete_handler("printenv", var_complete); install_auto_complete_handler("setenv", var_complete); -#if (CONFIG_COMMANDS & CFG_CMD_RUN) || defined(CONFIG_CMD_RUN) +#if defined(CONFIG_CMD_RUN) install_auto_complete_handler("run", var_complete); #endif } diff --git a/common/docecc.c b/common/docecc.c index d9c7a4133d..5daa6fc405 100644 --- a/common/docecc.c +++ b/common/docecc.c @@ -31,7 +31,7 @@ #undef ECC_DEBUG #undef PSYCHO_DEBUG -#if (CONFIG_COMMANDS & CFG_CMD_DOC) || defined(CONFIG_CMD_DOC) +#if defined(CONFIG_CMD_DOC) #include @@ -514,4 +514,4 @@ int doc_decode_ecc(unsigned char sector[SECTOR_SIZE], unsigned char ecc1[6]) return nb_errors; } -#endif /* (CONFIG_COMMANDS & CFG_CMD_DOC) */ +#endif diff --git a/common/env_flash.c b/common/env_flash.c index f9cf35a184..3b6c34d9e8 100644 --- a/common/env_flash.c +++ b/common/env_flash.c @@ -37,7 +37,7 @@ DECLARE_GLOBAL_DATA_PTR; -#if ((CONFIG_COMMANDS&(CFG_CMD_ENV|CFG_CMD_FLASH)) == (CFG_CMD_ENV|CFG_CMD_FLASH)) || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) +#if defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH) #define CMD_SAVEENV #elif defined(CFG_ENV_ADDR_REDUND) #error Cannot use CFG_ENV_ADDR_REDUND without CFG_CMD_ENV & CFG_CMD_FLASH diff --git a/common/env_nand.c b/common/env_nand.c index f97af20fa3..c8a80e0df1 100644 --- a/common/env_nand.c +++ b/common/env_nand.c @@ -39,7 +39,7 @@ #include #include -#if ((CONFIG_COMMANDS&(CFG_CMD_ENV|CFG_CMD_NAND)) == (CFG_CMD_ENV|CFG_CMD_NAND)) || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) +#if defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND) #define CMD_SAVEENV #elif defined(CFG_ENV_OFFSET_REDUND) #error Cannot use CFG_ENV_OFFSET_REDUND without CFG_CMD_ENV & CFG_CMD_NAND diff --git a/common/exports.c b/common/exports.c index fc8060ae53..a579554ab5 100644 --- a/common/exports.c +++ b/common/exports.c @@ -32,8 +32,8 @@ void jumptable_init (void) gd->jt[XF_install_hdlr] = (void *) irq_install_handler; gd->jt[XF_free_hdlr] = (void *) irq_free_handler; #endif /* I386 || PPC */ -#if (CONFIG_COMMANDS & CFG_CMD_I2C) || defined(CONFIG_CMD_I2C) +#if defined(CONFIG_CMD_I2C) gd->jt[XF_i2c_write] = (void *) i2c_write; gd->jt[XF_i2c_read] = (void *) i2c_read; -#endif /* CFG_CMD_I2C */ +#endif } diff --git a/common/hush.c b/common/hush.c index 4ddbc64d2e..bb6585e9ac 100644 --- a/common/hush.c +++ b/common/hush.c @@ -1682,7 +1682,7 @@ static int run_pipe_real(struct pipe *pi) return -1; /* give up after bad command */ } else { int rcode; -#if (CONFIG_COMMANDS & CFG_CMD_BOOTD) || defined(CONFIG_CMD_BOOTD) +#if defined(CONFIG_CMD_BOOTD) extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); /* avoid "bootd" recursion */ diff --git a/common/kgdb.c b/common/kgdb.c index 7a3e6d6edb..747a5b1ad2 100644 --- a/common/kgdb.c +++ b/common/kgdb.c @@ -92,7 +92,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_KGDB) || defined(CONFIG_CMD_KGDB) +#if defined(CONFIG_CMD_KGDB) #undef KGDB_DEBUG diff --git a/common/lcd.c b/common/lcd.c index 3b6391b061..914dc2ef7c 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -571,7 +571,7 @@ void bitmap_plot (int x, int y) #endif /* CONFIG_LCD_LOGO */ /*----------------------------------------------------------------------*/ -#if (CONFIG_COMMANDS & CFG_CMD_BMP) || defined(CONFIG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN) +#if defined(CONFIG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN) /* * Display the BMP file located at address bmp_image. * Only uncompressed. @@ -700,7 +700,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) return (0); } -#endif /* (CONFIG_COMMANDS & CFG_CMD_BMP) || CONFIG_SPLASH_SCREEN */ +#endif static void *lcd_logo (void) diff --git a/common/main.c b/common/main.c index 99693f4fcf..42e76716c0 100644 --- a/common/main.c +++ b/common/main.c @@ -1311,7 +1311,7 @@ int run_command (const char *cmd, int flag) continue; } -#if (CONFIG_COMMANDS & CFG_CMD_BOOTD) || defined(CONFIG_CMD_BOOTD) +#if defined(CONFIG_CMD_BOOTD) /* avoid "bootd" recursion */ if (cmdtp->cmd == do_bootd) { #ifdef DEBUG_PARSER @@ -1344,7 +1344,7 @@ int run_command (const char *cmd, int flag) /****************************************************************************/ -#if (CONFIG_COMMANDS & CFG_CMD_RUN) || defined(CONFIG_CMD_RUN) +#if defined(CONFIG_CMD_RUN) int do_run (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) { int i; diff --git a/common/miiphyutil.c b/common/miiphyutil.c index 6482728e94..c69501fedf 100644 --- a/common/miiphyutil.c +++ b/common/miiphyutil.c @@ -29,7 +29,7 @@ #include #include -#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII) || defined(CONFIG_CMD_MII) +#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) #include #include #include @@ -470,4 +470,4 @@ int miiphy_link (char *devname, unsigned char addr) } #endif -#endif /* CONFIG_MII || (CONFIG_COMMANDS & CFG_CMD_MII) */ +#endif /* CONFIG_MII */ diff --git a/common/usb.c b/common/usb.c index 282c1d97b7..933afa9e7b 100644 --- a/common/usb.c +++ b/common/usb.c @@ -49,7 +49,7 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_USB) || defined(CONFIG_CMD_USB) +#if defined(CONFIG_CMD_USB) #include #ifdef CONFIG_4xx @@ -1247,6 +1247,6 @@ int usb_hub_probe(struct usb_device *dev, int ifnum) return ret; } -#endif /* (CONFIG_COMMANDS & CFG_CMD_USB) */ +#endif /* EOF */ diff --git a/common/usb_storage.c b/common/usb_storage.c index d556475b61..2721589a1c 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -55,7 +55,7 @@ #include -#if (CONFIG_COMMANDS & CFG_CMD_USB) || defined(CONFIG_CMD_USB) +#if defined(CONFIG_CMD_USB) #include #include -- cgit v1.2.1 From 1fe80d79c5c4e52d3410a7ab4b8515da095cdab3 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Mon, 9 Jul 2007 22:08:34 -0500 Subject: Finally retire cmd_confdefs.h and CONFIG_BOOTP_MASK! All of the choices for CONFIG_BOOTP_ are now documented in the README file. You must now individually select exactly the set that you want using a series of #define CONFIG_BOOTP_ statements in the board port config files now. Signed-off-by: Jon Loeliger --- common/cmd_net.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/cmd_net.c b/common/cmd_net.c index da55f14a2e..8f766c8dbb 100644 --- a/common/cmd_net.c +++ b/common/cmd_net.c @@ -128,7 +128,7 @@ static void netboot_update_env (void) ip_to_string (NetOurDNSIP, tmp); setenv ("dnsip", tmp); } -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_DNS2) +#if defined(CONFIG_BOOTP_DNS2) if (NetOurDNS2IP) { ip_to_string (NetOurDNS2IP, tmp); setenv ("dnsip2", tmp); @@ -138,14 +138,14 @@ static void netboot_update_env (void) setenv ("domain", NetOurNISDomain); #if defined(CONFIG_CMD_SNTP) \ - && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_TIMEOFFSET) + && defined(CONFIG_BOOTP_TIMEOFFSET) if (NetTimeOffset) { sprintf (tmp, "%d", NetTimeOffset); setenv ("timeoffset", tmp); } #endif #if defined(CONFIG_CMD_SNTP) \ - && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NTPSERVER) + && defined(CONFIG_BOOTP_NTPSERVER) if (NetNtpServerIP) { ip_to_string (NetNtpServerIP, tmp); setenv ("ntpserverip", tmp); -- cgit v1.2.1 From 902531788376046da212afd1661cffb62f3daa1c Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Tue, 10 Jul 2007 11:02:44 -0500 Subject: common/: Remove lingering references to CFG_CMD_* symbols. Fixed some broken instances of "#ifdef CMD_CFG_IDE" too. Those always evaluated TRUE, and thus were always compiled even when IDE really wasn't defined/wanted. Signed-off-by: Jon Loeliger --- common/cmd_autoscript.c | 7 ++++--- common/cmd_bdinfo.c | 6 +++--- common/cmd_bedbug.c | 2 +- common/cmd_bootm.c | 12 ++++++------ common/cmd_cache.c | 2 +- common/cmd_console.c | 2 +- common/cmd_date.c | 2 +- common/cmd_dcr.c | 2 +- common/cmd_diag.c | 2 +- common/cmd_display.c | 2 +- common/cmd_eeprom.c | 7 ++++--- common/cmd_elf.c | 2 +- common/cmd_fat.c | 2 +- common/cmd_flash.c | 2 +- common/cmd_i2c.c | 8 ++++---- common/cmd_immap.c | 2 +- common/cmd_jffs2.c | 2 +- common/cmd_load.c | 18 +++++++++--------- common/cmd_mem.c | 2 +- common/cmd_mfsl.c | 2 +- common/cmd_mii.c | 2 +- common/cmd_misc.c | 2 +- common/cmd_mmc.c | 2 +- common/cmd_net.c | 12 ++++++------ common/cmd_nvedit.c | 10 +++++----- common/cmd_portio.c | 2 +- common/cmd_spi.c | 2 +- common/cmd_vfd.c | 2 +- common/command.c | 2 +- common/env_flash.c | 2 +- common/env_nand.c | 2 +- common/hush.c | 2 +- common/kgdb.c | 2 +- common/main.c | 4 ++-- common/usb_storage.c | 2 +- 35 files changed, 69 insertions(+), 67 deletions(-) (limited to 'common') diff --git a/common/cmd_autoscript.c b/common/cmd_autoscript.c index 606fb9a1fc..a6038a6eff 100644 --- a/common/cmd_autoscript.c +++ b/common/cmd_autoscript.c @@ -149,7 +149,8 @@ autoscript (ulong addr) return rcode; } -#endif /* CONFIG_AUTOSCRIPT || CFG_CMD_AUTOSCRIPT */ +#endif + /**************************************************/ #if defined(CONFIG_CMD_AUTOSCRIPT) int @@ -176,6 +177,6 @@ U_BOOT_CMD( "[addr] - run script starting at addr" " - A valid autoscr header must be present\n" ); -#endif /* CFG_CMD_AUTOSCRIPT */ +#endif -#endif /* CFG_CMD_AUTOSCRIPT */ +#endif diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 55cb100044..ccb826b8ab 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -167,7 +167,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) print_num ("sram size", (ulong)bd->bi_sramsize); #endif -#if defined(CFG_CMD_NET) +#if defined(CONFIG_CMD_NET) puts ("ethaddr ="); for (i=0; i<6; ++i) { printf ("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]); @@ -195,7 +195,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) print_num ("sram start ", (ulong)bd->bi_sramstart); print_num ("sram size ", (ulong)bd->bi_sramsize); #endif -#if defined(CFG_CMD_NET) +#if defined(CONFIG_CMD_NET) puts ("ethaddr ="); for (i=0; i<6; ++i) { printf ("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]); @@ -285,4 +285,4 @@ U_BOOT_CMD( "bdinfo - print Board Info structure\n", NULL ); -#endif /* CFG_CMD_BDI */ +#endif diff --git a/common/cmd_bedbug.c b/common/cmd_bedbug.c index 0bd622bfd5..1c3547a1fc 100644 --- a/common/cmd_bedbug.c +++ b/common/cmd_bedbug.c @@ -413,7 +413,7 @@ int do_bedbug_rdump (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) U_BOOT_CMD (rdump, 1, 1, do_bedbug_rdump, "rdump - Show registers.\n", " - Show registers.\n"); /* ====================================================================== */ -#endif /* CFG_CMD_BEDBUG */ +#endif /* diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 90de6b19a1..c371f0e864 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -138,7 +138,7 @@ static boot_os_Fcn do_bootm_vxworks; static boot_os_Fcn do_bootm_qnxelf; int do_bootvx ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] ); int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] ); -#endif /* CFG_CMD_ELF */ +#endif #if defined(CONFIG_ARTOS) && defined(CONFIG_PPC) static boot_os_Fcn do_bootm_artos; #endif @@ -449,7 +449,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) do_bootm_qnxelf (cmdtp, flag, argc, argv, addr, len_ptr, verify); break; -#endif /* CFG_CMD_ELF */ +#endif #ifdef CONFIG_ARTOS case IH_OS_ARTOS: do_bootm_artos (cmdtp, flag, argc, argv, @@ -1315,7 +1315,7 @@ U_BOOT_CMD( " image contents (magic number, header and payload checksums)\n" ); -#endif /* CFG_CMD_IMI */ +#endif #if defined(CONFIG_CMD_IMLS) /*----------------------------------------------------------------------- @@ -1373,7 +1373,7 @@ U_BOOT_CMD( " - Prints information about all images found at sector\n" " boundaries in flash.\n" ); -#endif /* CFG_CMD_IMLS */ +#endif void print_image_hdr (image_header_t *hdr) @@ -1389,7 +1389,7 @@ print_image_hdr (image_header_t *hdr) printf (" Created: %4d-%02d-%02d %2d:%02d:%02d UTC\n", tm.tm_year, tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); -#endif /* CFG_CMD_DATE, CONFIG_TIMESTAMP */ +#endif puts (" Image Type: "); print_type(hdr); printf ("\n Data Size: %d Bytes = ", ntohl(hdr->ih_size)); print_size (ntohl(hdr->ih_size), "\n"); @@ -1614,7 +1614,7 @@ do_bootm_qnxelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], local_args[1] = str; /* and provide it via the arguments */ do_bootelf(cmdtp, 0, 2, local_args); } -#endif /* CFG_CMD_ELF */ +#endif #ifdef CONFIG_LYNXKDI static void diff --git a/common/cmd_cache.c b/common/cmd_cache.c index 6890fafc30..675d43fa18 100644 --- a/common/cmd_cache.c +++ b/common/cmd_cache.c @@ -109,4 +109,4 @@ U_BOOT_CMD( " - enable or disable data (writethrough) cache\n" ); -#endif /* CFG_CMD_CACHE */ +#endif diff --git a/common/cmd_console.c b/common/cmd_console.c index 530e3453c7..5e0f990723 100644 --- a/common/cmd_console.c +++ b/common/cmd_console.c @@ -68,4 +68,4 @@ U_BOOT_CMD( "" ); -#endif /* CFG_CMD_CONSOLE */ +#endif diff --git a/common/cmd_date.c b/common/cmd_date.c index 93c2ca43dc..4a42534900 100644 --- a/common/cmd_date.c +++ b/common/cmd_date.c @@ -211,4 +211,4 @@ U_BOOT_CMD( " - with 'reset' argument: reset the RTC\n" ); -#endif /* CFG_CMD_DATE */ +#endif diff --git a/common/cmd_dcr.c b/common/cmd_dcr.c index e79280c105..12fa9db08d 100644 --- a/common/cmd_dcr.c +++ b/common/cmd_dcr.c @@ -246,4 +246,4 @@ U_BOOT_CMD( "adr_dcrn[.dat_dcrn] offset value - write offset to adr_dcrn, write value to dat_dcrn.\n" ); -#endif /* CONFIG_4xx & CFG_CMD_SETGETDCR */ +#endif diff --git a/common/cmd_diag.c b/common/cmd_diag.c index 091e3c8a77..cb99b7700f 100644 --- a/common/cmd_diag.c +++ b/common/cmd_diag.c @@ -77,4 +77,4 @@ U_BOOT_CMD( " - run specified tests\n" ); -#endif /* CFG_CMD_DIAG */ +#endif diff --git a/common/cmd_display.c b/common/cmd_display.c index 47ef35a198..d19f412819 100644 --- a/common/cmd_display.c +++ b/common/cmd_display.c @@ -79,4 +79,4 @@ U_BOOT_CMD( " - without arguments: clear dot matrix display\n" ); -#endif /* CFG_CMD_DISPLAY */ +#endif diff --git a/common/cmd_eeprom.c b/common/cmd_eeprom.c index d6fb9ab748..e5000e9ff3 100644 --- a/common/cmd_eeprom.c +++ b/common/cmd_eeprom.c @@ -110,7 +110,7 @@ int do_eeprom ( cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) printf ("Usage:\n%s\n", cmdtp->usage); return 1; } -#endif /* CFG_CMD_EEPROM */ +#endif /*----------------------------------------------------------------------- * @@ -422,7 +422,8 @@ void eeprom_init (void) } /*----------------------------------------------------------------------- */ -#endif /* CFG_CMD_EEPROM */ +#endif + /***************************************************/ #if defined(CONFIG_CMD_EEPROM) @@ -445,4 +446,4 @@ U_BOOT_CMD( ); #endif /* CFG_I2C_MULTI_EEPROMS */ -#endif /* CFG_CMD_EEPROM */ +#endif diff --git a/common/cmd_elf.c b/common/cmd_elf.c index 6d72619380..63a5593e43 100644 --- a/common/cmd_elf.c +++ b/common/cmd_elf.c @@ -324,4 +324,4 @@ U_BOOT_CMD( " [address] - load address of vxWorks ELF image.\n" ); -#endif /* CFG_CMD_ELF */ +#endif diff --git a/common/cmd_fat.c b/common/cmd_fat.c index 0f0ff4a369..54f0f9f9ce 100644 --- a/common/cmd_fat.c +++ b/common/cmd_fat.c @@ -324,4 +324,4 @@ void hexdump (int cnt, unsigned char *data) } #endif /* NOT_IMPLEMENTED_YET */ -#endif /* CFG_CMD_FAT */ +#endif diff --git a/common/cmd_flash.c b/common/cmd_flash.c index e191f9ce40..db38f94d03 100644 --- a/common/cmd_flash.c +++ b/common/cmd_flash.c @@ -732,4 +732,4 @@ U_BOOT_CMD( #undef TMP_PROT_ON #undef TMP_PROT_OFF -#endif /* CFG_CMD_FLASH */ +#endif diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c index 6aeeb84964..a684a580e6 100644 --- a/common/cmd_i2c.c +++ b/common/cmd_i2c.c @@ -877,7 +877,7 @@ int do_sdram ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 0; } -#endif /* CFG_CMD_SDRAM */ +#endif #if defined(CONFIG_I2C_CMD_TREE) #if defined(CONFIG_I2C_MULTI_BUS) @@ -941,7 +941,7 @@ int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) #if defined(CONFIG_CMD_SDRAM) if (!strncmp(argv[1], "sd", 2)) return do_sdram(cmdtp, flag, --argc, ++argv); -#endif /* CFG_CMD_SDRAM */ +#endif else printf ("Usage:\n%s\n", cmdtp->usage); return 0; @@ -967,7 +967,7 @@ U_BOOT_CMD( "i2c loop chip address[.0, .1, .2] [# of objects] - looping read of device\n" #if defined(CONFIG_CMD_SDRAM) "i2c sdram chip - print SDRAM configuration information\n" -#endif /* CFG_CMD_SDRAM */ +#endif ); #endif /* CONFIG_I2C_CMD_TREE */ U_BOOT_CMD( @@ -1025,4 +1025,4 @@ U_BOOT_CMD( ); #endif -#endif /* CFG_CMD_I2C */ +#endif diff --git a/common/cmd_immap.c b/common/cmd_immap.c index e211b161bd..ae95758247 100644 --- a/common/cmd_immap.c +++ b/common/cmd_immap.c @@ -720,4 +720,4 @@ U_BOOT_CMD( ); -#endif /* CFG_CMD_IMMAP && (CONFIG_8xx || CONFIG_8260) */ +#endif diff --git a/common/cmd_jffs2.c b/common/cmd_jffs2.c index 777607a0ca..513a226c43 100644 --- a/common/cmd_jffs2.c +++ b/common/cmd_jffs2.c @@ -2192,4 +2192,4 @@ U_BOOT_CMD( /***************************************************/ -#endif /* CFG_CMD_JFFS2 */ +#endif diff --git a/common/cmd_load.c b/common/cmd_load.c index d3d268158e..204c3ebf19 100644 --- a/common/cmd_load.c +++ b/common/cmd_load.c @@ -43,10 +43,10 @@ static int read_record (char *buf, ulong len); # if defined(CONFIG_CMD_SAVES) static int save_serial (ulong offset, ulong size); static int write_record (char *buf); -# endif /* CFG_CMD_SAVES */ +#endif static int do_echo = 1; -#endif /* CFG_CMD_LOADS */ +#endif /* -------------------------------------------------------------------- */ @@ -399,9 +399,9 @@ write_record (char *buf) } return (0); } -# endif /* CFG_CMD_SAVES */ +# endif -#endif /* CFG_CMD_LOADS */ +#endif #if defined(CONFIG_CMD_LOADB) @@ -1038,7 +1038,7 @@ static ulong load_serial_ymodem (ulong offset) return offset; } -#endif /* CFG_CMD_LOADB */ +#endif /* -------------------------------------------------------------------- */ @@ -1084,8 +1084,8 @@ U_BOOT_CMD( " - save S-Record file over serial line with offset 'off' and size 'size'\n" ); #endif /* CFG_LOADS_BAUD_CHANGE */ -#endif /* CFG_CMD_SAVES */ -#endif /* CFG_CMD_LOADS */ +#endif +#endif #if defined(CONFIG_CMD_LOADB) @@ -1105,7 +1105,7 @@ U_BOOT_CMD( " with offset 'off' and baudrate 'baud'\n" ); -#endif /* CFG_CMD_LOADB */ +#endif /* -------------------------------------------------------------------- */ @@ -1135,4 +1135,4 @@ U_BOOT_CMD( "[on|off]\n - change RTS/CTS hardware flow control over serial line\n" ); -#endif /* CFG_CMD_HWFLOW */ +#endif diff --git a/common/cmd_mem.c b/common/cmd_mem.c index 001dfa27d7..a994211138 100644 --- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -1253,4 +1253,4 @@ U_BOOT_CMD( #endif /* CONFIG_MX_CYCLIC */ #endif -#endif /* CFG_CMD_MEMORY */ +#endif diff --git a/common/cmd_mfsl.c b/common/cmd_mfsl.c index b143dc291f..8d4c1a38d7 100644 --- a/common/cmd_mfsl.c +++ b/common/cmd_mfsl.c @@ -414,4 +414,4 @@ U_BOOT_CMD (rspr, 3, 1, do_rspr, " 1 - EAR - Exception address register\n" " 2 - ESR - Exception status register\n"); -#endif /* CONFIG_MICROBLAZE & CFG_CMD_MFSL */ +#endif diff --git a/common/cmd_mii.c b/common/cmd_mii.c index 120b8e804a..f6b98d1f3d 100644 --- a/common/cmd_mii.c +++ b/common/cmd_mii.c @@ -595,4 +595,4 @@ U_BOOT_CMD( #endif /* CONFIG_TERSE_MII */ -#endif /* CFG_CMD_MII */ +#endif diff --git a/common/cmd_misc.c b/common/cmd_misc.c index 4d5a2ff1df..c0c6b8f05a 100644 --- a/common/cmd_misc.c +++ b/common/cmd_misc.c @@ -69,4 +69,4 @@ U_BOOT_CMD( " - delay execution for N seconds (N is _decimal_ !!!)\n" ); -#endif /* CFG_CMD_MISC */ +#endif diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c index c772e9bc3b..069c6d02a0 100644 --- a/common/cmd_mmc.c +++ b/common/cmd_mmc.c @@ -43,4 +43,4 @@ U_BOOT_CMD( NULL ); -#endif /* CFG_CMD_MMC */ +#endif diff --git a/common/cmd_net.c b/common/cmd_net.c index 8f766c8dbb..26efc6d206 100644 --- a/common/cmd_net.c +++ b/common/cmd_net.c @@ -79,7 +79,7 @@ U_BOOT_CMD( "dhcp\t- invoke DHCP client to obtain IP/boot params\n", "\n" ); -#endif /* CFG_CMD_DHCP */ +#endif #if defined(CONFIG_CMD_NFS) int do_nfs (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) @@ -92,7 +92,7 @@ U_BOOT_CMD( "nfs\t- boot image via network using NFS protocol\n", "[loadAddress] [host ip addr:bootfilename]\n" ); -#endif /* CFG_CMD_NFS */ +#endif static void netboot_update_env (void) { @@ -249,7 +249,7 @@ U_BOOT_CMD( "ping\t- send ICMP ECHO_REQUEST to network host\n", "pingAddress\n" ); -#endif /* CFG_CMD_PING */ +#endif #if defined(CONFIG_CMD_CDP) @@ -292,7 +292,7 @@ U_BOOT_CMD( cdp, 1, 1, do_cdp, "cdp\t- Perform CDP network configuration\n", ); -#endif /* CFG_CMD_CDP */ +#endif #if defined(CONFIG_CMD_SNTP) int do_sntp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) @@ -330,6 +330,6 @@ U_BOOT_CMD( "sntp\t- synchronize RTC via network\n", "[NTP server IP]\n" ); -#endif /* CFG_CMD_SNTP */ +#endif -#endif /* CFG_CMD_NET */ +#endif diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index 68a2dc8bb9..e313f2c4b6 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -372,7 +372,7 @@ int _do_setenv (int flag, int argc, char *argv[]) copy_filename (BootFile, argv[2], sizeof(BootFile)); return 0; } -#endif /* CFG_CMD_NET */ +#endif #ifdef CONFIG_AMIGAONEG3SE if (strcmp(argv[1], "vga_fg_color") == 0 || @@ -483,7 +483,7 @@ int do_askenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) /* Continue calling setenv code */ return _do_setenv (flag, len, local_args); } -#endif /* CFG_CMD_ASKENV */ +#endif /************************************************************************ * Look up variable from environment, @@ -603,7 +603,7 @@ U_BOOT_CMD( NULL ); -#endif /* CFG_CMD_ENV */ +#endif #if defined(CONFIG_CMD_ASKENV) @@ -620,7 +620,7 @@ U_BOOT_CMD( " - display 'message' string and get environment variable 'name'" "from stdin (max 'size' chars)\n" ); -#endif /* CFG_CMD_ASKENV */ +#endif #if defined(CONFIG_CMD_RUN) int do_run (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); @@ -630,4 +630,4 @@ U_BOOT_CMD( "var [...]\n" " - run the commands in the environment variable(s) 'var'\n" ); -#endif /* CFG_CMD_RUN */ +#endif diff --git a/common/cmd_portio.c b/common/cmd_portio.c index ad6656a7e9..bfe33e3a8c 100644 --- a/common/cmd_portio.c +++ b/common/cmd_portio.c @@ -166,4 +166,4 @@ U_BOOT_CMD( " - read datum from IO port\n" ); -#endif /* CFG_CMD_PORTIO */ +#endif diff --git a/common/cmd_spi.c b/common/cmd_spi.c index d446fe5058..3118d279b9 100644 --- a/common/cmd_spi.c +++ b/common/cmd_spi.c @@ -140,4 +140,4 @@ U_BOOT_CMD( " - Hexadecimal string that gets sent\n" ); -#endif /* CFG_CMD_SPI */ +#endif diff --git a/common/cmd_vfd.c b/common/cmd_vfd.c index 6fc06247bc..29c349dab9 100644 --- a/common/cmd_vfd.c +++ b/common/cmd_vfd.c @@ -73,7 +73,7 @@ U_BOOT_CMD( "vfd ADDR\n" " - load bitmap at address ADDR\n" ); -#endif /* CFG_CMD_VFD */ +#endif #ifdef CONFIG_VFD int trab_vfd (ulong bitmap) diff --git a/common/command.c b/common/command.c index 361ca62f42..af2f8cbf7b 100644 --- a/common/command.c +++ b/common/command.c @@ -76,7 +76,7 @@ U_BOOT_CMD( " - echo args to console; \\c suppresses newline\n" ); -#endif /* CFG_CMD_ECHO */ +#endif #ifdef CFG_HUSH_PARSER diff --git a/common/env_flash.c b/common/env_flash.c index 3b6c34d9e8..7a37e550de 100644 --- a/common/env_flash.c +++ b/common/env_flash.c @@ -40,7 +40,7 @@ DECLARE_GLOBAL_DATA_PTR; #if defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH) #define CMD_SAVEENV #elif defined(CFG_ENV_ADDR_REDUND) -#error Cannot use CFG_ENV_ADDR_REDUND without CFG_CMD_ENV & CFG_CMD_FLASH +#error Cannot use CFG_ENV_ADDR_REDUND without CONFIG_CMD_ENV & CONFIG_CMD_FLASH #endif #if defined(CFG_ENV_SIZE_REDUND) && (CFG_ENV_SIZE_REDUND < CFG_ENV_SIZE) diff --git a/common/env_nand.c b/common/env_nand.c index c8a80e0df1..38a07f8993 100644 --- a/common/env_nand.c +++ b/common/env_nand.c @@ -42,7 +42,7 @@ #if defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND) #define CMD_SAVEENV #elif defined(CFG_ENV_OFFSET_REDUND) -#error Cannot use CFG_ENV_OFFSET_REDUND without CFG_CMD_ENV & CFG_CMD_NAND +#error Cannot use CFG_ENV_OFFSET_REDUND without CONFIG_CMD_ENV & CONFIG_CMD_NAND #endif #if defined(CFG_ENV_SIZE_REDUND) && (CFG_ENV_SIZE_REDUND != CFG_ENV_SIZE) diff --git a/common/hush.c b/common/hush.c index bb6585e9ac..582635c04c 100644 --- a/common/hush.c +++ b/common/hush.c @@ -1694,7 +1694,7 @@ static int run_pipe_real(struct pipe *pi) else flag |= CMD_FLAG_BOOTD; } -#endif /* CFG_CMD_BOOTD */ +#endif /* found - check max args */ if ((child->argc - i) > cmdtp->maxargs) { printf ("Usage:\n%s\n", cmdtp->usage); diff --git a/common/kgdb.c b/common/kgdb.c index 747a5b1ad2..1d346699a5 100644 --- a/common/kgdb.c +++ b/common/kgdb.c @@ -591,4 +591,4 @@ U_BOOT_CMD( int kgdb_not_configured = 1; -#endif /* CFG_CMD_KGDB */ +#endif diff --git a/common/main.c b/common/main.c index 42e76716c0..c6a65b01e8 100644 --- a/common/main.c +++ b/common/main.c @@ -1325,7 +1325,7 @@ int run_command (const char *cmd, int flag) flag |= CMD_FLAG_BOOTD; } } -#endif /* CFG_CMD_BOOTD */ +#endif /* OK - call function to do the command */ if ((cmdtp->cmd) (cmdtp, flag, argc, argv) != 0) { @@ -1372,4 +1372,4 @@ int do_run (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) } return 0; } -#endif /* CFG_CMD_RUN */ +#endif diff --git a/common/usb_storage.c b/common/usb_storage.c index 2721589a1c..0f79f367c9 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -1249,4 +1249,4 @@ int usb_stor_get_info(struct usb_device *dev,struct us_data *ss,block_dev_desc_t } #endif /* CONFIG_USB_STORAGE */ -#endif /* CFG_CMD_USB */ +#endif -- cgit v1.2.1 From 3865b1fb7843a08ad49a6319a36415752276ff48 Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Wed, 11 Jul 2007 12:13:53 +0200 Subject: Fix some compile problems introduced by the latest CFG_CMD_xxx cleanup Signed-off-by: Stefan Roese --- common/cmd_flash.c | 2 +- common/cmd_nvedit.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'common') diff --git a/common/cmd_flash.c b/common/cmd_flash.c index db38f94d03..11c8857313 100644 --- a/common/cmd_flash.c +++ b/common/cmd_flash.c @@ -33,7 +33,7 @@ #if defined(CONFIG_CMD_FLASH) -#if (defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) +#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) #include /* parition handling routines */ diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index e313f2c4b6..de5a5148f6 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -538,7 +538,7 @@ int getenv_r (char *name, char *buf, unsigned len) return (-1); } -#if defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) || \ +#if defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) @@ -550,7 +550,6 @@ int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return (saveenv() ? 1 : 0); } - #endif @@ -594,7 +593,7 @@ U_BOOT_CMD( " - delete environment variable 'name'\n" ); -#if defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) || \ +#if defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) U_BOOT_CMD( -- cgit v1.2.1 From d4024bb72dd81695ec099b2199eda0d27c623e62 Mon Sep 17 00:00:00 2001 From: John Otken Date: Thu, 26 Jul 2007 17:49:11 +0200 Subject: ppc4xx: Add support for AMCC 405EP Taihu board Signed-off-by: John Otken --- common/soft_spi.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common') diff --git a/common/soft_spi.c b/common/soft_spi.c index 00a57de8aa..e4250616c2 100644 --- a/common/soft_spi.c +++ b/common/soft_spi.c @@ -79,7 +79,9 @@ void spi_init (void) */ int spi_xfer(spi_chipsel_type chipsel, int bitlen, uchar *dout, uchar *din) { +#ifdef CFG_IMMR volatile immap_t *immr = (immap_t *)CFG_IMMR; +#endif uchar tmpdin = 0; uchar tmpdout = 0; int j; -- cgit v1.2.1 From d2f68006627eda6cb6c7f364bddf621dbfd2fc68 Mon Sep 17 00:00:00 2001 From: Eugene OBrien Date: Tue, 31 Jul 2007 10:24:56 +0200 Subject: ppc4xx: Update AMCC Bamboo 440EP support Changed storage type of cfg_simulate_spd_eeprom to const Changed storage type of gpio_tab to stack storage (Cannot access global data declarations in .bss until afer code relocation) Improved SDRAM tests to catch problems where data is not uniquely addressable (e.g. incorrectly programmed SDRAM row or columns) Added CONFIG_PROG_SDRAM_TLB to support Bamboo SIMM/DIMM modules Fixed AM29LV320DT (OpCode Flash) sector map Signed-off-by: Eugene OBrien Signed-off-by: Stefan Roese --- common/flash.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'common') diff --git a/common/flash.c b/common/flash.c index a64bc98529..888ff9c67c 100644 --- a/common/flash.c +++ b/common/flash.c @@ -47,16 +47,16 @@ flash_protect (int flag, ulong from, ulong to, flash_info_t *info) short s_end = info->sector_count - 1; /* index of last sector */ int i; - debug ("flash_protect %s: from 0x%08lX to 0x%08lX\n", - (flag & FLAG_PROTECT_SET) ? "ON" : - (flag & FLAG_PROTECT_CLEAR) ? "OFF" : "???", - from, to); - /* Do nothing if input data is bad. */ if (info->sector_count == 0 || info->size == 0 || to < from) { return; } + debug ("flash_protect %s: from 0x%08lX to 0x%08lX\n", + (flag & FLAG_PROTECT_SET) ? "ON" : + (flag & FLAG_PROTECT_CLEAR) ? "OFF" : "???", + from, to); + /* There is nothing to do if we have no data about the flash * or the protect range and flash range don't overlap. */ -- cgit v1.2.1 From 8092fef4c29b395958bb649647da7e3775731517 Mon Sep 17 00:00:00 2001 From: Martin Krause Date: Tue, 12 Dec 2006 14:26:01 +0100 Subject: Add functions to list of exported functions Additionally export the following fuctions (to make trab_config build again): - simple_strtol() - strcmp() Also bump the ABI version to reflect this change Signed-off-by: Martin Krause --- common/exports.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common') diff --git a/common/exports.c b/common/exports.c index a579554ab5..ec4656bfbd 100644 --- a/common/exports.c +++ b/common/exports.c @@ -28,6 +28,8 @@ void jumptable_init (void) gd->jt[XF_get_timer] = (void *) get_timer; gd->jt[XF_simple_strtoul] = (void *) simple_strtoul; gd->jt[XF_udelay] = (void *) udelay; + gd->jt[XF_simple_strtol] = (void *) simple_strtol; + gd->jt[XF_strcmp] = (void *) strcmp; #if defined(CONFIG_I386) || defined(CONFIG_PPC) gd->jt[XF_install_hdlr] = (void *) irq_install_handler; gd->jt[XF_free_hdlr] = (void *) irq_free_handler; -- cgit v1.2.1 From c74b2108e31fe09bd1c5d291c3cf360510d4f13e Mon Sep 17 00:00:00 2001 From: Sergey Kubushyn Date: Fri, 10 Aug 2007 20:26:18 +0200 Subject: [ARM] TI DaVinci support, hopefully final Add support for the following DaVinci boards: - DV_EVM - SCHMOOGIE - SONATA Changes: - Split into separate board directories - Removed changes to MTD_DEBUG (or whatever it's called) - New CONFIG_CMD party line followed - Some cosmetic fixes, cleanup etc. - Patches against the latest U-Boot tree as of now. - Fixed CONFIG_CMD_NET in net files. - Fixed CONFIG_CMD_EEPROM for schmoogie. - Made sure it compiles and works (forceenv() link problem) on SCHMOOGIE and DV_EVM. Can't check if it works on SONATA, don't have a board any more, but it at least compiles. Here is an excerpt from session log on SCHMOOGIE... U-Boot 1.2.0-g6c33c785-dirty (Aug 7 2007 - 13:07:17) DRAM: 128 MB NAND: 128 MiB In: serial Out: serial Err: serial ARM Clock : 297MHz DDR Clock : 162MHz ETH PHY : DP83848 @ 0x01 U-Boot > iprobe Valid chip addresses: 1B 38 3A 3D 3F 50 5D 6F U-Boot > ping 192.168.253.10 host 192.168.253.10 is alive U-Boot > Signed-off-by: Sergey Kubushyn Acked-by: Dirk Behme Acked-by: Zach Sadecki Acked-by: Stefan Roese --- common/cmd_nvedit.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index de5a5148f6..1db0fc3c03 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -193,7 +193,12 @@ int _do_setenv (int flag, int argc, char *argv[]) * Ethernet Address and serial# can be set only once, * ver is readonly. */ +#ifdef CONFIG_HAS_UID + /* Allow serial# forced overwrite with 0xdeaf4add flag */ + if ( ((strcmp (name, "serial#") == 0) && (flag != 0xdeaf4add)) || +#else if ( (strcmp (name, "serial#") == 0) || +#endif ((strcmp (name, "ethaddr") == 0) #if defined(CONFIG_OVERWRITE_ETHADDR_ONCE) && defined(CONFIG_ETHADDR) && (strcmp ((char *)env_get_addr(oldval),MK_STR(CONFIG_ETHADDR)) != 0) @@ -397,7 +402,15 @@ void setenv (char *varname, char *varvalue) _do_setenv (0, 3, argv); } -int do_setenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +#ifdef CONFIG_HAS_UID +void forceenv (char *varname, char *varvalue) +{ + char *argv[4] = { "forceenv", varname, varvalue, NULL }; + _do_setenv (0xdeaf4add, 3, argv); +} +#endif + +int do_setenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { if (argc < 2) { printf ("Usage:\n%s\n", cmdtp->usage); -- cgit v1.2.1 From ba24e2ac3bdb5c489f3c787e7542b6474c4d65c6 Mon Sep 17 00:00:00 2001 From: Gerald Van Baren Date: Wed, 25 Apr 2007 21:24:27 -0400 Subject: Improve error messages, more informative. Print more than the raw libfdt error message strings. This is especially useful for cluing in the user when the bootm command aborts due to blob problems. Signed-off-by: Gerald Van Baren --- common/fdt_support.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'common') diff --git a/common/fdt_support.c b/common/fdt_support.c index 69099c4275..bcdc4154be 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -67,7 +67,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) return err; } if (used >= total) { - printf("fdt_chosen: no room in the reserved map (%d of %d)\n", + printf("WARNING fdt_chosen: no room in the reserved map (%d of %d)\n", used, total); return -1; } @@ -110,7 +110,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) */ nodeoffset = fdt_add_subnode(fdt, 0, "chosen"); if (nodeoffset < 0) { - printf("libfdt: %s\n", fdt_strerror(nodeoffset)); + printf("WARNING fdt_chosen: could not create the \"/chosen node\" (libfdt error %s).\n", fdt_strerror(nodeoffset)); return nodeoffset; } } @@ -122,22 +122,22 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) if (str != NULL) { err = fdt_setprop(fdt, nodeoffset, "bootargs", str, strlen(str)+1); if (err < 0) - printf("libfdt: %s\n", fdt_strerror(err)); + printf("WARNING fdt_chosen: could not set \"bootargs\" (libfdt error %s).\n", fdt_strerror(err)); } if (initrd_start && initrd_end) { tmp = __cpu_to_be32(initrd_start); err = fdt_setprop(fdt, nodeoffset, "linux,initrd-start", &tmp, sizeof(tmp)); if (err < 0) - printf("libfdt: %s\n", fdt_strerror(err)); + printf("WARNING fdt_chosen: could not set \"linux,initrd-start\" (libfdt error %s).\n", fdt_strerror(err)); tmp = __cpu_to_be32(initrd_end); err = fdt_setprop(fdt, nodeoffset, "linux,initrd-end", &tmp, sizeof(tmp)); if (err < 0) - printf("libfdt: %s\n", fdt_strerror(err)); + printf("WARNING fdt_chosen: could not set \"linux,initrd-end\" (libfdt error %s).\n", fdt_strerror(err)); } #ifdef OF_STDOUT_PATH err = fdt_setprop(fdt, nodeoffset, "linux,stdout-path", OF_STDOUT_PATH, strlen(OF_STDOUT_PATH)+1); if (err < 0) - printf("libfdt: %s\n", fdt_strerror(err)); + printf("WARNING fdt_chosen: could not set \"linux,stdout-path\" (libfdt error %s).\n", fdt_strerror(err)); #endif nodeoffset = fdt_path_offset (fdt, "/cpus"); @@ -145,7 +145,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) clock = cpu_to_be32(bd->bi_intfreq); err = fdt_setprop(fdt, nodeoffset, "clock-frequency", &clock, 4); if (err < 0) - printf("libfdt: %s\n", fdt_strerror(err)); + printf("WARNING fdt_chosen: could not set \"clock-frequency\" (libfdt error %s).\n", fdt_strerror(err)); } #ifdef OF_TBCLK nodeoffset = fdt_path_offset (fdt, "/cpus/" OF_CPU "/timebase-frequency"); @@ -153,7 +153,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) clock = cpu_to_be32(OF_TBCLK); err = fdt_setprop(fdt, nodeoffset, "clock-frequency", &clock, 4); if (err < 0) - printf("libfdt: %s\n", fdt_strerror(err)); + printf("WARNING fdt_chosen: could not set \"clock-frequency\" (libfdt error %s).\n", fdt_strerror(err)); } #endif return err; @@ -198,7 +198,7 @@ int fdt_env(void *fdt) */ nodeoffset = fdt_add_subnode(fdt, 0, "u-boot-env"); if (nodeoffset < 0) { - printf("libfdt: %s\n", fdt_strerror(nodeoffset)); + printf("WARNING fdt_env: could not create the \"/u-boot-env node\" (libfdt error %s).\n", fdt_strerror(nodeoffset)); return nodeoffset; } @@ -226,7 +226,7 @@ int fdt_env(void *fdt) continue; err = fdt_setprop(fdt, nodeoffset, lval, rval, strlen(rval)+1); if (err < 0) { - printf("libfdt: %s\n", fdt_strerror(err)); + printf("WARNING fdt_env: could not set \"%s\" (libfdt error %s).\n", lval, fdt_strerror(err)); return err; } } @@ -318,6 +318,7 @@ int fdt_bd_t(void *fdt) */ nodeoffset = fdt_add_subnode(fdt, 0, "bd_t"); if (nodeoffset < 0) { + printf("WARNING fdt_bd_t: could not create the \"/bd_t node\" (libfdt error %s).\n", fdt_strerror(nodeoffset)); printf("libfdt: %s\n", fdt_strerror(nodeoffset)); return nodeoffset; } @@ -328,17 +329,17 @@ int fdt_bd_t(void *fdt) tmp = cpu_to_be32(getenv("bootargs")); err = fdt_setprop(fdt, nodeoffset, bd_map[i].name, &tmp, sizeof(tmp)); if (err < 0) - printf("libfdt: %s\n", fdt_strerror(err)); + printf("WARNING fdt_bd_t: could not set \"%s\" (libfdt error %s).\n", bd_map[i].name, fdt_strerror(err)); } /* * Add a couple of oddball entries... */ err = fdt_setprop(fdt, nodeoffset, "enetaddr", &bd->bi_enetaddr, 6); if (err < 0) - printf("libfdt: %s\n", fdt_strerror(err)); + printf("WARNING fdt_bd_t: could not set \"enetaddr\" (libfdt error %s).\n", fdt_strerror(err)); err = fdt_setprop(fdt, nodeoffset, "ethspeed", &bd->bi_ethspeed, 4); if (err < 0) - printf("libfdt: %s\n", fdt_strerror(err)); + printf("WARNING fdt_bd_t: could not set \"ethspeed\" (libfdt error %s).\n", fdt_strerror(err)); return 0; } -- cgit v1.2.1 From bb930e76fea6cf89ca2d98e2f7c7a6043d79327d Mon Sep 17 00:00:00 2001 From: Gerald Van Baren Date: Wed, 25 Apr 2007 22:23:36 -0400 Subject: Minor code clean up. Declare the variable fdt properly as extern. Call the "set_fn" function pointer the "short way" without the full dereferencing syntax. Signed-off-by: Gerald Van Baren --- common/fdt_support.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'common') diff --git a/common/fdt_support.c b/common/fdt_support.c index bcdc4154be..15f133cec3 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -37,6 +37,11 @@ */ DECLARE_GLOBAL_DATA_PTR; +/* + * fdt points to our working device tree. + */ +struct fdt_header *fdt; + /********************************************************************/ -- cgit v1.2.1 From 6be07cc1ca458278c85ecdbf1a0536cff4c701ec Mon Sep 17 00:00:00 2001 From: Gerald Van Baren Date: Wed, 25 Apr 2007 22:47:15 -0400 Subject: Improve fdt move length handling. Make the length parameter optional: if not specified, do the move using the current size unchanged. Signed-off-by: Gerald Van Baren --- common/cmd_fdt.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'common') diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index 08fe3512d4..a119985942 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -115,7 +115,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) int len; int err; - if (argc != 5) { + if (argc < 4) { printf ("Usage:\n%s\n", cmdtp->usage); return 1; } @@ -129,11 +129,20 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) } newaddr = (struct fdt_header *)simple_strtoul(argv[3], NULL, 16); - len = simple_strtoul(argv[4], NULL, 16); - if (len < fdt_totalsize(fdt)) { - printf ("New length %d < existing length %d, aborting.\n", - len, fdt_totalsize(fdt)); - return 1; + + /* + * If the user specifies a length, use that. Otherwise use the + * current length. + */ + if (argc <= 4) { + len = fdt_totalsize(fdt); + } else { + len = simple_strtoul(argv[4], NULL, 16); + if (len < fdt_totalsize(fdt)) { + printf ("New length 0x%X < existing length 0x%X, aborting.\n", + len, fdt_totalsize(fdt)); + return 1; + } } /* -- cgit v1.2.1 From 89c8757d8f213c47709bdc4efe0695263a6080a6 Mon Sep 17 00:00:00 2001 From: Gerald Van Baren Date: Tue, 8 May 2007 21:27:35 -0400 Subject: Fix bugs in the CONFIG_OF_LIBFDT Stupid coding mistakes (identified by Timur Tabi, thanks). Signed-off-by: Gerald Van Baren --- common/cmd_bootm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 2436581b18..1cb0e43585 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -788,7 +788,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, return; } #if defined(CONFIG_OF_LIBFDT) - if (fdt_check_header(of_flat_tree + sizeof(image_header_t)) == 0) { + if (fdt_check_header(of_flat_tree + sizeof(image_header_t)) != 0) { #else if (*((ulong *)(of_flat_tree + sizeof(image_header_t))) != OF_DT_HEADER) { #endif @@ -944,7 +944,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, of_flat_tree = (char *)of_start; printf (" Loading Device Tree to %08lx, end %08lx ... ", of_start, of_start + of_len - 1); - err = fdt_open_into((void *)of_start, (void *)of_data, of_len); + err = fdt_open_into((void *)of_data, (void *)of_start, of_len); if (err != 0) { printf ("libfdt: %s " __FILE__ " %d\n", fdt_strerror(err), __LINE__); } -- cgit v1.2.1 From 38eb508e8e811e2e57628f445de3a24a23c7d804 Mon Sep 17 00:00:00 2001 From: Gerald Van Baren Date: Sat, 12 May 2007 09:45:46 -0400 Subject: Reorganize and fix problems (returns) in the bootm command. Do *NOT* return after the "point of no return" has been passed. If something goes wrong, the board must be reset after that point. Move the "Transferring control to Linux" debug message back to where it belongs: just before transferring control to linux. Signed-off-by: Gerald Van Baren --- common/cmd_bootm.c | 130 ++++++++++++++++++++++++++--------------------------- 1 file changed, 64 insertions(+), 66 deletions(-) (limited to 'common') diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 1cb0e43585..45ab13abd6 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -45,8 +45,8 @@ DECLARE_GLOBAL_DATA_PTR; - /*cmd_boot.c*/ - extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); +/*cmd_boot.c*/ +extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); #if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) #include @@ -756,8 +756,8 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, if ((ntohl(hdr->ih_load) < ((unsigned long)hdr + ntohl(hdr->ih_size) + sizeof(hdr))) && ((ntohl(hdr->ih_load) + ntohl(hdr->ih_size)) > (unsigned long)hdr)) { - printf ("ERROR: Load address overwrites Flat Device Tree uImage\n"); - return; + puts ("ERROR: Load address overwrites Flat Device Tree uImage\nMust RESET board to recover\n"); + do_reset (cmdtp, flag, argc, argv); } printf(" Verifying Checksum ... "); @@ -766,34 +766,34 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, header.ih_hcrc = 0; if(checksum != crc32(0, (uchar *)&header, sizeof(image_header_t))) { - printf("ERROR: Flat Device Tree header checksum is invalid\n"); - return; + puts ("ERROR: Flat Device Tree header checksum is invalid\nMust RESET board to recover\n"); + do_reset (cmdtp, flag, argc, argv); } checksum = ntohl(hdr->ih_dcrc); addr = (ulong)((uchar *)(hdr) + sizeof(image_header_t)); if(checksum != crc32(0, (uchar *)addr, ntohl(hdr->ih_size))) { - printf("ERROR: Flat Device Tree checksum is invalid\n"); - return; + puts ("ERROR: Flat Device Tree checksum is invalid\nMust RESET board to recover\n"); + do_reset (cmdtp, flag, argc, argv); } printf("OK\n"); if (ntohl(hdr->ih_type) != IH_TYPE_FLATDT) { - printf ("ERROR: uImage not Flat Device Tree type\n"); - return; + puts ("ERROR: uImage not Flat Device Tree type\nMust RESET board to recover\n"); + do_reset (cmdtp, flag, argc, argv); } if (ntohl(hdr->ih_comp) != IH_COMP_NONE) { - printf("ERROR: uImage is not uncompressed\n"); - return; + puts ("ERROR: uImage is not uncompressed\nMust RESET board to recover\n"); + do_reset (cmdtp, flag, argc, argv); } #if defined(CONFIG_OF_LIBFDT) if (fdt_check_header(of_flat_tree + sizeof(image_header_t)) != 0) { #else if (*((ulong *)(of_flat_tree + sizeof(image_header_t))) != OF_DT_HEADER) { #endif - printf ("ERROR: uImage data is not a flat device tree\n"); - return; + puts ("ERROR: uImage data is not a flat device tree\nMust RESET board to recover\n"); + do_reset (cmdtp, flag, argc, argv); } memmove((void *)ntohl(hdr->ih_load), @@ -801,8 +801,8 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, ntohl(hdr->ih_size)); of_flat_tree = (char *)ntohl(hdr->ih_load); } else { - printf ("Did not find a flat flat device tree at address %08lX\n", of_flat_tree); - return; + puts ("Did not find a flat flat device tree\nMust RESET board to recover\n"); + do_reset (cmdtp, flag, argc, argv); } printf (" Booting using flat device tree at 0x%x\n", of_flat_tree); @@ -833,8 +833,8 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, #else if (((struct boot_param_header *)of_data)->magic != OF_DT_HEADER) { #endif - printf ("ERROR: image is not a flat device tree\n"); - return; + puts ("ERROR: image is not a flat device tree\nMust RESET board to recover\n"); + do_reset (cmdtp, flag, argc, argv); } #if defined(CONFIG_OF_LIBFDT) @@ -842,8 +842,8 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, #else if (((struct boot_param_header *)of_data)->totalsize != ntohl(len_ptr[2])) { #endif - printf ("ERROR: flat device tree size does not agree with image\n"); - return; + puts ("ERROR: flat device tree size does not agree with image\nMust RESET board to recover\n"); + do_reset (cmdtp, flag, argc, argv); } } #endif @@ -916,15 +916,6 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, initrd_end = 0; } - debug ("## Transferring control to Linux (at address %08lx) ...\n", - (ulong)kernel); - - show_boot_progress (15); - -#if defined(CFG_INIT_RAM_LOCK) && !defined(CONFIG_E500) - unlock_ram_in_cache(); -#endif - #if defined(CONFIG_OF_LIBFDT) /* move of_flat_tree if needed */ if (of_data) { @@ -953,19 +944,19 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, * if the user wants it (the logic is in the subroutines). */ if (fdt_chosen(of_flat_tree, initrd_start, initrd_end, 0) < 0) { - printf("Failed creating the /chosen node (0x%08X), aborting.\n", of_flat_tree); - return; + puts ("ERROR: Failed creating the /chosen node, aborting.\nMust RESET board to recover\n"); + do_reset (cmdtp, flag, argc, argv); } #ifdef CONFIG_OF_HAS_UBOOT_ENV if (fdt_env(of_flat_tree) < 0) { - printf("Failed creating the /u-boot-env node, aborting.\n"); - return; + puts ("ERROR: Failed creating the /u-boot-env node, aborting.\nMust RESET board to recover\n"); + do_reset (cmdtp, flag, argc, argv); } #endif #ifdef CONFIG_OF_HAS_BD_T if (fdt_bd_t(of_flat_tree) < 0) { - printf("Failed creating the /bd_t node, aborting.\n"); - return; + puts ("ERROR: Failed creating the /bd_t node, aborting.\nMust RESET board to recover\n"); + do_reset (cmdtp, flag, argc, argv); } #endif } @@ -990,55 +981,62 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, memmove ((void *)of_start, (void *)of_data, of_len); } #endif - - /* - * Linux Kernel Parameters (passing board info data): - * r3: ptr to board info data - * r4: initrd_start or 0 if no initrd - * r5: initrd_end - unused if r4 is 0 - * r6: Start of command line string - * r7: End of command line string - */ -#if defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT) - if (!of_flat_tree) /* no device tree; boot old style */ -#endif - (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end); - /* does not return */ - -#if defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT) - /* - * Linux Kernel Parameters (passing device tree): - * r3: ptr to OF flat tree, followed by the board info data - * r4: physical pointer to the kernel itself - * r5: NULL - * r6: NULL - * r7: NULL - */ #if defined(CONFIG_OF_FLAT_TREE) ft_setup(of_flat_tree, kbd, initrd_start, initrd_end); /* ft_dump_blob(of_flat_tree); */ #endif #if defined(CONFIG_OF_LIBFDT) if (fdt_chosen(of_flat_tree, initrd_start, initrd_end, 0) < 0) { - printf("Failed creating the /chosen node (0x%08X), aborting.\n", of_flat_tree); - return; + puts ("ERROR: Failed to create the /chosen node, aborting.\nMust RESET board to recover\n"); + do_reset (cmdtp, flag, argc, argv); } #ifdef CONFIG_OF_HAS_UBOOT_ENV if (fdt_env(of_flat_tree) < 0) { - printf("Failed creating the /u-boot-env node, aborting.\n"); - return; + puts ("ERROR: Failed to create the /u-boot-env node, aborting.\nMust RESET board to recover\n"); + do_reset (cmdtp, flag, argc, argv); } #endif #ifdef CONFIG_OF_HAS_BD_T if (fdt_bd_t(of_flat_tree) < 0) { - printf("Failed creating the /bd_t node, aborting.\n"); - return; + puts ("ERROR: Failed to create the /bd_t node, aborting.\nMust RESET board to recover\n"); + do_reset (cmdtp, flag, argc, argv); } #endif #endif /* if defined(CONFIG_OF_LIBFDT) */ - (*kernel) ((bd_t *)of_flat_tree, (ulong)kernel, 0, 0, 0); + debug ("## Transferring control to Linux (at address %08lx) ...\n", + (ulong)kernel); + + show_boot_progress (15); + +#if defined(CFG_INIT_RAM_LOCK) && !defined(CONFIG_E500) + unlock_ram_in_cache(); #endif + +#if defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT) + if (of_flat_tree) { /* device tree; boot new style */ + /* + * Linux Kernel Parameters (passing device tree): + * r3: ptr to flattened device tree, followed by the board info data + * r4: physical pointer to the kernel itself + * r5: NULL + * r6: NULL + * r7: NULL + */ + (*kernel) ((bd_t *)of_flat_tree, (ulong)kernel, 0, 0, 0); + /* does not return */ + } +#endif + /* + * Linux Kernel Parameters (passing board info data): + * r3: ptr to board info data + * r4: initrd_start or 0 if no initrd + * r5: initrd_end - unused if r4 is 0 + * r6: Start of command line string + * r7: End of command line string + */ + (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end); + /* does not return */ } #endif /* CONFIG_PPC */ -- cgit v1.2.1 From 25114033ab21788810c48ba4df103b649da1223b Mon Sep 17 00:00:00 2001 From: Gerald Van Baren Date: Sat, 12 May 2007 09:47:25 -0400 Subject: FDT command improvements. Fix "fdt set" so that it will create a non-existing property. Add "fdt mknode" to create nodes. Signed-off-by: Gerald Van Baren --- common/cmd_fdt.c | 271 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 143 insertions(+), 128 deletions(-) (limited to 'common') diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index a119985942..8402ca7859 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -56,27 +56,38 @@ static char data[SCRATCHPAD]; static int fdt_valid(void); static void print_data(const void *data, int len); +static int findnodeoffset(const char *pathp) +{ + int nodeoffset; + + if (strcmp(pathp, "/") == 0) { + nodeoffset = 0; + } else { + nodeoffset = fdt_path_offset (fdt, pathp); + if (nodeoffset < 0) { + /* + * Not found or something else bad happened. + */ + printf ("findnodeoffset() libfdt: %s\n", fdt_strerror(nodeoffset)); + } + } + return nodeoffset; +} /* * Flattened Device Tree command, see the help for parameter definitions. */ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) { - char op; - if (argc < 2) { printf ("Usage:\n%s\n", cmdtp->usage); return 1; } - /* - * Figure out which subcommand was given - */ - op = argv[1][0]; /******************************************************************** * Set the address of the fdt ********************************************************************/ - if (op == 'a') { + if (argv[1][0] == 'a') { /* * Set the address [and length] of the fdt. */ @@ -102,7 +113,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) */ err = fdt_open_into(fdt, fdt, len); if (err != 0) { - printf ("libfdt: %s\n", fdt_strerror(err)); + printf ("libfdt fdt_open_into(): %s\n", fdt_strerror(err)); } } } @@ -110,7 +121,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) /******************************************************************** * Move the fdt ********************************************************************/ - } else if (op == 'm') { + } else if ((argv[1][0] == 'm') && (argv[1][1] == 'o')) { struct fdt_header *newaddr; int len; int err; @@ -150,15 +161,48 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) */ err = fdt_open_into(fdt, newaddr, len); if (err != 0) { - printf ("libfdt: %s\n", fdt_strerror(err)); + printf ("libfdt fdt_open_into(): %s\n", fdt_strerror(err)); return 1; } fdt = newaddr; /******************************************************************** - * Set the value of a node in the fdt. + * Make a new node + ********************************************************************/ + } else if ((argv[1][0] == 'm') && (argv[1][1] == 'k')) { + char *pathp; /* path */ + char *nodep; /* new node to add */ + int nodeoffset; /* node offset from libfdt */ + int err; + + /* + * Parameters: Node path, new node to be appended to the path. + */ + if (argc < 4) { + printf ("Usage:\n%s\n", cmdtp->usage); + return 1; + } + + pathp = argv[2]; + nodep = argv[3]; + + nodeoffset = findnodeoffset(pathp); + if (nodeoffset < 0) { + /* + * Not found or something else bad happened. + */ + return 1; + } + err = fdt_add_subnode(fdt, nodeoffset, nodep); + if (err < 0) { + printf ("libfdt fdt_add_subnode(): %s\n", fdt_strerror(err)); + return 1; + } + + /******************************************************************** + * Set the value of a property in the fdt. ********************************************************************/ - } else if (op == 's') { + } else if (argv[1][0] == 's') { char *pathp; /* path */ char *prop; /* property */ struct fdt_property *nodep; /* node struct pointer */ @@ -183,102 +227,85 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) prop = argv[3]; newval = argv[4]; - if (strcmp(pathp, "/") == 0) { - nodeoffset = 0; - } else { - nodeoffset = fdt_path_offset (fdt, pathp); - if (nodeoffset < 0) { - /* - * Not found or something else bad happened. - */ - printf ("libfdt: %s\n", fdt_strerror(nodeoffset)); - return 1; - } - } - nodep = fdt_getprop (fdt, nodeoffset, prop, &oldlen); - if (oldlen < 0) { - printf ("libfdt %s\n", fdt_strerror(oldlen)); - return 1; - } else if (oldlen == 0) { + nodeoffset = findnodeoffset(pathp); + if (nodeoffset < 0) { /* - * The specified property has no value + * Not found or something else bad happened. */ - printf("%s has no value, cannot set one (yet).\n", prop); return 1; - } else { + } + /* + * Convert the new property + */ + vp = data; + if (*newval == '<') { /* - * Convert the new property + * Bigger values than bytes. */ - vp = data; - if (*newval == '<') { - /* - * Bigger values than bytes. - */ - len = 0; - newval++; - while ((*newval != '>') && (*newval != '\0')) { - cp = newval; - tmp = simple_strtoul(cp, &newval, 16); - if ((newval - cp) <= 2) { - *vp = tmp & 0xFF; - vp += 1; - len += 1; - } else if ((newval - cp) <= 4) { - *(uint16_t *)vp = __cpu_to_be16(tmp); - vp += 2; - len += 2; - } else if ((newval - cp) <= 8) { - *(uint32_t *)vp = __cpu_to_be32(tmp); - vp += 4; - len += 4; - } else { - printf("Sorry, I could not convert \"%s\"\n", cp); - return 1; - } - while (*newval == ' ') - newval++; - } - if (*newval != '>') { - printf("Unexpected character '%c'\n", *newval); - return 1; - } - } else if (*newval == '[') { - /* - * Byte stream. Convert the values. - */ - len = 0; - newval++; - while ((*newval != ']') && (*newval != '\0')) { - tmp = simple_strtoul(newval, &newval, 16); - *vp++ = tmp & 0xFF; - len++; - while (*newval == ' ') - newval++; - } - if (*newval != ']') { - printf("Unexpected character '%c'\n", *newval); + len = 0; + newval++; + while ((*newval != '>') && (*newval != '\0')) { + cp = newval; + tmp = simple_strtoul(cp, &newval, 16); + if ((newval - cp) <= 2) { + *vp = tmp & 0xFF; + vp += 1; + len += 1; + } else if ((newval - cp) <= 4) { + *(uint16_t *)vp = __cpu_to_be16(tmp); + vp += 2; + len += 2; + } else if ((newval - cp) <= 8) { + *(uint32_t *)vp = __cpu_to_be32(tmp); + vp += 4; + len += 4; + } else { + printf("Sorry, I could not convert \"%s\"\n", cp); return 1; } - } else { - /* - * Assume it is a string. Copy it into our data area for - * convenience (including the terminating '\0'). - */ - len = strlen(newval) + 1; - strcpy(data, newval); + while (*newval == ' ') + newval++; } - - ret = fdt_setprop(fdt, nodeoffset, prop, data, len); - if (ret < 0) { - printf ("libfdt %s\n", fdt_strerror(ret)); + if (*newval != '>') { + printf("Unexpected character '%c'\n", *newval); + return 1; + } + } else if (*newval == '[') { + /* + * Byte stream. Convert the values. + */ + len = 0; + newval++; + while ((*newval != ']') && (*newval != '\0')) { + tmp = simple_strtoul(newval, &newval, 16); + *vp++ = tmp & 0xFF; + len++; + while (*newval == ' ') + newval++; + } + if (*newval != ']') { + printf("Unexpected character '%c'\n", *newval); return 1; } + } else { + /* + * Assume it is a string. Copy it into our data area for + * convenience (including the terminating '\0'). + */ + len = strlen(newval) + 1; + strcpy(data, newval); + } + + ret = fdt_setprop(fdt, nodeoffset, prop, data, len); + if (ret < 0) { + printf ("libfdt fdt_setprop(): %s\n", fdt_strerror(ret)); + return 1; } /******************************************************************** * Print (recursive) / List (single level) ********************************************************************/ - } else if ((op == 'p') || (op == 'l')) { + } else if ((argv[1][0] == 'p') || (argv[1][0] == 'l')) { /* * Recursively print (a portion of) the fdt. */ @@ -297,7 +324,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) /* * list is an alias for print, but limited to 1 level */ - if (op == 'l') { + if (argv[1][0] == 'l') { depth = 1; } @@ -311,18 +338,12 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) else prop = NULL; - if (strcmp(pathp, "/") == 0) { - nodeoffset = 0; - printf("/"); - } else { - nodeoffset = fdt_path_offset (fdt, pathp); - if (nodeoffset < 0) { - /* - * Not found or something else bad happened. - */ - printf ("libfdt %s\n", fdt_strerror(nodeoffset)); - return 1; - } + nodeoffset = findnodeoffset(pathp); + if (nodeoffset < 0) { + /* + * Not found or something else bad happened. + */ + return 1; } /* * The user passed in a property as well as node path. Print only @@ -339,7 +360,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) printf("\n"); return 0; } else { - printf ("libfdt %s\n", fdt_strerror(len)); + printf ("libfdt fdt_getprop(): %s\n", fdt_strerror(len)); return 1; } } @@ -359,7 +380,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) level++; offstack[level] = nodeoffset; if (level >= MAX_LEVEL) { - printf("Aaaiii nested too deep.\n"); + printf("Aaaiii nested too deep. Aborting.\n"); return 1; } break; @@ -374,7 +395,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) case FDT_PROP: nodep = fdt_getprop (fdt, offstack[level], pathp, &len); if (len < 0) { - printf ("libfdt %s\n", fdt_strerror(len)); + printf ("libfdt fdt_getprop(): %s\n", fdt_strerror(len)); return 1; } else if (len == 0) { /* the property has no value */ @@ -403,7 +424,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) /******************************************************************** * Remove a property/node ********************************************************************/ - } else if (op == 'r') { + } else if (argv[1][0] == 'r') { int nodeoffset; /* node offset from libfdt */ int err; @@ -411,17 +432,12 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) * Get the path. The root node is an oddball, the offset * is zero and has no name. */ - if (strcmp(argv[2], "/") == 0) { - nodeoffset = 0; - } else { - nodeoffset = fdt_path_offset (fdt, argv[2]); - if (nodeoffset < 0) { - /* - * Not found or something else bad happened. - */ - printf ("libfdt %s\n", fdt_strerror(nodeoffset)); - return 1; - } + nodeoffset = findnodeoffset(argv[2]); + if (nodeoffset < 0) { + /* + * Not found or something else bad happened. + */ + return 1; } /* * Do the delete. A fourth parameter means delete a property, @@ -430,13 +446,13 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) if (argc > 3) { err = fdt_delprop(fdt, nodeoffset, argv[3]); if (err < 0) { - printf("fdt_delprop libfdt: %s\n", fdt_strerror(err)); + printf("libfdt fdt_delprop(): %s\n", fdt_strerror(err)); return err; } } else { err = fdt_del_node(fdt, nodeoffset); if (err < 0) { - printf("fdt_del_node libfdt: %s\n", fdt_strerror(err)); + printf("libfdt fdt_del_node(): %s\n", fdt_strerror(err)); return err; } } @@ -444,19 +460,19 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) /******************************************************************** * Create a chosen node ********************************************************************/ - } else if (op == 'c') { + } else if (argv[1][0] == 'c') { fdt_chosen(fdt, 0, 0, 1); /******************************************************************** * Create a u-boot-env node ********************************************************************/ - } else if (op == 'e') { + } else if (argv[1][0] == 'e') { fdt_env(fdt); /******************************************************************** * Create a bd_t node ********************************************************************/ - } else if (op == 'b') { + } else if (argv[1][0] == 'b') { fdt_bd_t(fdt); /******************************************************************** @@ -486,7 +502,7 @@ static int fdt_valid(void) return 1; /* valid */ if (err < 0) { - printf("libfdt: %s", fdt_strerror(err)); + printf("libfdt fdt_check_header(): %s", fdt_strerror(err)); /* * Be more informative on bad version. */ @@ -630,7 +646,6 @@ U_BOOT_CMD( "fdt bd_t - Add/replace the \"/bd_t\" branch in the tree\n" #endif "Hints:\n" - " * Set a larger length with the fdt addr command to add to the blob.\n" " * If the property you are setting/printing has a '#' character,\n" " you MUST escape it with a \\ character or quote it with \" or\n" " it will be ignored as a comment.\n" -- cgit v1.2.1 From addd8ce83078c25f0eca5f23adbdfc64ca50a243 Mon Sep 17 00:00:00 2001 From: Gerald Van Baren Date: Wed, 16 May 2007 22:39:59 -0400 Subject: Fix cmd_fdt line lengths, refactor code. Break lines that were greater than 80 characters in length. Move the fdt print and property parsing code to separate static functions to reduce coding clutter in the fdt_cmd handling body. Signed-off-by: Gerald Van Baren --- common/cmd_fdt.c | 426 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 239 insertions(+), 187 deletions(-) (limited to 'common') diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index 8402ca7859..7066d7d6e6 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -44,17 +44,13 @@ */ DECLARE_GLOBAL_DATA_PTR; -/* - * Scratchpad memory. - */ -static char data[SCRATCHPAD]; - - /* * Function prototypes/declarations. */ static int fdt_valid(void); -static void print_data(const void *data, int len); +static int fdt_parse_prop(char *pathp, char *prop, char *newval, + char *data, int *len); +static int fdt_print(char *pathp, char *prop, int depth); static int findnodeoffset(const char *pathp) { @@ -68,7 +64,8 @@ static int findnodeoffset(const char *pathp) /* * Not found or something else bad happened. */ - printf ("findnodeoffset() libfdt: %s\n", fdt_strerror(nodeoffset)); + printf ("findnodeoffset() libfdt: %s\n", + fdt_strerror(nodeoffset)); } } return nodeoffset; @@ -105,7 +102,8 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) */ len = simple_strtoul(argv[3], NULL, 16); if (len < fdt_totalsize(fdt)) { - printf ("New length %d < existing length %d, ignoring.\n", + printf ("New length %d < existing length %d, " + "ignoring.\n", len, fdt_totalsize(fdt)); } else { /* @@ -113,7 +111,8 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) */ err = fdt_open_into(fdt, fdt, len); if (err != 0) { - printf ("libfdt fdt_open_into(): %s\n", fdt_strerror(err)); + printf ("libfdt fdt_open_into(): %s\n", + fdt_strerror(err)); } } } @@ -139,7 +138,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) return 1; } - newaddr = (struct fdt_header *)simple_strtoul(argv[3], NULL, 16); + newaddr = (struct fdt_header *)simple_strtoul(argv[3],NULL,16); /* * If the user specifies a length, use that. Otherwise use the @@ -150,7 +149,8 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) } else { len = simple_strtoul(argv[4], NULL, 16); if (len < fdt_totalsize(fdt)) { - printf ("New length 0x%X < existing length 0x%X, aborting.\n", + printf ("New length 0x%X < existing length " + "0x%X, aborting.\n", len, fdt_totalsize(fdt)); return 1; } @@ -161,7 +161,8 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) */ err = fdt_open_into(fdt, newaddr, len); if (err != 0) { - printf ("libfdt fdt_open_into(): %s\n", fdt_strerror(err)); + printf ("libfdt fdt_open_into(): %s\n", + fdt_strerror(err)); return 1; } fdt = newaddr; @@ -195,7 +196,8 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) } err = fdt_add_subnode(fdt, nodeoffset, nodep); if (err < 0) { - printf ("libfdt fdt_add_subnode(): %s\n", fdt_strerror(err)); + printf ("libfdt fdt_add_subnode(): %s\n", + fdt_strerror(err)); return 1; } @@ -204,16 +206,12 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) ********************************************************************/ } else if (argv[1][0] == 's') { char *pathp; /* path */ - char *prop; /* property */ - struct fdt_property *nodep; /* node struct pointer */ + char *prop; /* property */ char *newval; /* value from the user (as a string) */ - char *vp; /* temporary value pointer */ - char *cp; /* temporary char pointer */ int nodeoffset; /* node offset from libfdt */ - int len; /* new length of the property */ - int oldlen; /* original length of the property */ - unsigned long tmp; /* holds converted values */ - int ret; /* return value */ + static char data[SCRATCHPAD]; /* storage for the property */ + int len; /* new length of the property */ + int ret; /* return value */ /* * Parameters: Node path, property, value. @@ -234,67 +232,9 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) */ return 1; } - /* - * Convert the new property - */ - vp = data; - if (*newval == '<') { - /* - * Bigger values than bytes. - */ - len = 0; - newval++; - while ((*newval != '>') && (*newval != '\0')) { - cp = newval; - tmp = simple_strtoul(cp, &newval, 16); - if ((newval - cp) <= 2) { - *vp = tmp & 0xFF; - vp += 1; - len += 1; - } else if ((newval - cp) <= 4) { - *(uint16_t *)vp = __cpu_to_be16(tmp); - vp += 2; - len += 2; - } else if ((newval - cp) <= 8) { - *(uint32_t *)vp = __cpu_to_be32(tmp); - vp += 4; - len += 4; - } else { - printf("Sorry, I could not convert \"%s\"\n", cp); - return 1; - } - while (*newval == ' ') - newval++; - } - if (*newval != '>') { - printf("Unexpected character '%c'\n", *newval); - return 1; - } - } else if (*newval == '[') { - /* - * Byte stream. Convert the values. - */ - len = 0; - newval++; - while ((*newval != ']') && (*newval != '\0')) { - tmp = simple_strtoul(newval, &newval, 16); - *vp++ = tmp & 0xFF; - len++; - while (*newval == ' ') - newval++; - } - if (*newval != ']') { - printf("Unexpected character '%c'\n", *newval); - return 1; - } - } else { - /* - * Assume it is a string. Copy it into our data area for - * convenience (including the terminating '\0'). - */ - len = strlen(newval) + 1; - strcpy(data, newval); - } + ret = fdt_parse_prop(pathp, prop, newval, data, &len); + if (ret != 0) + return ret; ret = fdt_setprop(fdt, nodeoffset, prop, data, len); if (ret < 0) { @@ -306,20 +246,10 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) * Print (recursive) / List (single level) ********************************************************************/ } else if ((argv[1][0] == 'p') || (argv[1][0] == 'l')) { - /* - * Recursively print (a portion of) the fdt. - */ - static int offstack[MAX_LEVEL]; - static char tabs[MAX_LEVEL+1] = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"; int depth = MAX_LEVEL; /* how deep to print */ char *pathp; /* path */ - char *prop; /* property */ - void *nodep; /* property node pointer */ - int nodeoffset; /* node offset from libfdt */ - int nextoffset; /* next node offset from libfdt */ - uint32_t tag; /* tag */ - int len; /* length of the property */ - int level = 0; /* keep track of nesting level */ + char *prop; /* property */ + int ret; /* return value */ /* * list is an alias for print, but limited to 1 level @@ -338,88 +268,9 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) else prop = NULL; - nodeoffset = findnodeoffset(pathp); - if (nodeoffset < 0) { - /* - * Not found or something else bad happened. - */ - return 1; - } - /* - * The user passed in a property as well as node path. Print only - * the given property and then return. - */ - if (prop) { - nodep = fdt_getprop (fdt, nodeoffset, prop, &len); - if (len == 0) { - printf("%s %s\n", pathp, prop); /* no property value */ - return 0; - } else if (len > 0) { - printf("%s=", prop); - print_data (nodep, len); - printf("\n"); - return 0; - } else { - printf ("libfdt fdt_getprop(): %s\n", fdt_strerror(len)); - return 1; - } - } - - /* - * The user passed in a node path and no property, print the node - * and all subnodes. - */ - offstack[0] = nodeoffset; - - while(level >= 0) { - tag = fdt_next_tag(fdt, nodeoffset, &nextoffset, &pathp); - switch(tag) { - case FDT_BEGIN_NODE: - if(level <= depth) - printf("%s%s {\n", &tabs[MAX_LEVEL - level], pathp); - level++; - offstack[level] = nodeoffset; - if (level >= MAX_LEVEL) { - printf("Aaaiii nested too deep. Aborting.\n"); - return 1; - } - break; - case FDT_END_NODE: - level--; - if(level <= depth) - printf("%s};\n", &tabs[MAX_LEVEL - level]); - if (level == 0) { - level = -1; /* exit the loop */ - } - break; - case FDT_PROP: - nodep = fdt_getprop (fdt, offstack[level], pathp, &len); - if (len < 0) { - printf ("libfdt fdt_getprop(): %s\n", fdt_strerror(len)); - return 1; - } else if (len == 0) { - /* the property has no value */ - if(level <= depth) - printf("%s%s;\n", &tabs[MAX_LEVEL - level], pathp); - } else { - if(level <= depth) { - printf("%s%s=", &tabs[MAX_LEVEL - level], pathp); - print_data (nodep, len); - printf(";\n"); - } - } - break; - case FDT_NOP: - break; - case FDT_END: - return 1; - default: - if(level <= depth) - printf("Unknown tag 0x%08X\n", tag); - return 1; - } - nodeoffset = nextoffset; - } + ret = fdt_print(pathp, prop, depth); + if (ret != 0) + return ret; /******************************************************************** * Remove a property/node @@ -446,13 +297,15 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) if (argc > 3) { err = fdt_delprop(fdt, nodeoffset, argv[3]); if (err < 0) { - printf("libfdt fdt_delprop(): %s\n", fdt_strerror(err)); + printf("libfdt fdt_delprop(): %s\n", + fdt_strerror(err)); return err; } } else { err = fdt_del_node(fdt, nodeoffset); if (err < 0) { - printf("libfdt fdt_del_node(): %s\n", fdt_strerror(err)); + printf("libfdt fdt_del_node(): %s\n", + fdt_strerror(err)); return err; } } @@ -486,7 +339,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) return 0; } -/********************************************************************/ +/****************************************************************************/ static int fdt_valid(void) { @@ -509,12 +362,14 @@ static int fdt_valid(void) if (err == -FDT_ERR_BADVERSION) { if (fdt_version(fdt) < FDT_FIRST_SUPPORTED_VERSION) { printf (" - too old, fdt $d < %d", - fdt_version(fdt), FDT_FIRST_SUPPORTED_VERSION); + fdt_version(fdt), + FDT_FIRST_SUPPORTED_VERSION); fdt = NULL; } if (fdt_last_comp_version(fdt) > FDT_LAST_SUPPORTED_VERSION) { printf (" - too new, fdt $d > %d", - fdt_version(fdt), FDT_LAST_SUPPORTED_VERSION); + fdt_version(fdt), + FDT_LAST_SUPPORTED_VERSION); fdt = NULL; } return 0; @@ -525,13 +380,91 @@ static int fdt_valid(void) return 1; } -/********************************************************************/ +/****************************************************************************/ /* - * OF flat tree handling - * Written by: Pantelis Antoniou - * Updated by: Matthew McClintock - * Converted to libfdt by: Gerald Van Baren + * Parse the user's input, partially heuristic. Valid formats: + * <00> - hex byte + * <0011> - hex half word (16 bits) + * <00112233> - hex word (32 bits) + * - hex double words (64 bits) are not supported, must use + * a byte stream instead. + * [00 11 22 .. nn] - byte stream + * "string" - If the the value doesn't start with "<" or "[", it is + * treated as a string. Note that the quotes are + * stripped by the parser before we get the string. + */ +static int fdt_parse_prop(char *pathp, char *prop, char *newval, + char *data, int *len) +{ + char *cp; /* temporary char pointer */ + unsigned long tmp; /* holds converted values */ + + if (*newval == '<') { + /* + * Bigger values than bytes. + */ + *len = 0; + newval++; + while ((*newval != '>') && (*newval != '\0')) { + cp = newval; + tmp = simple_strtoul(cp, &newval, 16); + if ((newval - cp) <= 2) { + *data = tmp & 0xFF; + data += 1; + *len += 1; + } else if ((newval - cp) <= 4) { + *(uint16_t *)data = __cpu_to_be16(tmp); + data += 2; + *len += 2; + } else if ((newval - cp) <= 8) { + *(uint32_t *)data = __cpu_to_be32(tmp); + data += 4; + *len += 4; + } else { + printf("Sorry, I could not convert \"%s\"\n", + cp); + return 1; + } + while (*newval == ' ') + newval++; + } + if (*newval != '>') { + printf("Unexpected character '%c'\n", *newval); + return 1; + } + } else if (*newval == '[') { + /* + * Byte stream. Convert the values. + */ + *len = 0; + newval++; + while ((*newval != ']') && (*newval != '\0')) { + tmp = simple_strtoul(newval, &newval, 16); + *data++ = tmp & 0xFF; + *len++; + while (*newval == ' ') + newval++; + } + if (*newval != ']') { + printf("Unexpected character '%c'\n", *newval); + return 1; + } + } else { + /* + * Assume it is a string. Copy it into our data area for + * convenience (including the terminating '\0'). + */ + *len = strlen(newval) + 1; + strcpy(data, newval); + } + return 0; +} + +/****************************************************************************/ + +/* + * Heuristic to guess if this is a string or concatenated strings. */ static int is_printable_string(const void *data, int len) @@ -571,6 +504,12 @@ static int is_printable_string(const void *data, int len) return 1; } + +/* + * Print the property in the best format, a heuristic guess. Print as + * a string, concatenated strings, a byte, word, double word, or (if all + * else fails) it is printed as a stream of bytes. + */ static void print_data(const void *data, int len) { int j; @@ -626,6 +565,119 @@ static void print_data(const void *data, int len) } } +/****************************************************************************/ + +/* + * Recursively print (a portion of) the fdt. The depth parameter + * determines how deeply nested the fdt is printed. + */ +static int fdt_print(char *pathp, char *prop, int depth) +{ + static int offstack[MAX_LEVEL]; + static char tabs[MAX_LEVEL+1] = + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"; + void *nodep; /* property node pointer */ + int nodeoffset; /* node offset from libfdt */ + int nextoffset; /* next node offset from libfdt */ + uint32_t tag; /* tag */ + int len; /* length of the property */ + int level = 0; /* keep track of nesting level */ + + nodeoffset = findnodeoffset(pathp); + if (nodeoffset < 0) { + /* + * Not found or something else bad happened. + */ + return 1; + } + /* + * The user passed in a property as well as node path. + * Print only the given property and then return. + */ + if (prop) { + nodep = fdt_getprop (fdt, nodeoffset, prop, &len); + if (len == 0) { + /* no property value */ + printf("%s %s\n", pathp, prop); + return 0; + } else if (len > 0) { + printf("%s=", prop); + print_data (nodep, len); + printf("\n"); + return 0; + } else { + printf ("libfdt fdt_getprop(): %s\n", + fdt_strerror(len)); + return 1; + } + } + + /* + * The user passed in a node path and no property, + * print the node and all subnodes. + */ + offstack[0] = nodeoffset; + + while(level >= 0) { + tag = fdt_next_tag(fdt, nodeoffset, &nextoffset, &pathp); + switch(tag) { + case FDT_BEGIN_NODE: + if(level <= depth) + printf("%s%s {\n", + &tabs[MAX_LEVEL - level], pathp); + level++; + offstack[level] = nodeoffset; + if (level >= MAX_LEVEL) { + printf("Aaaiii nested too deep. " + "Aborting.\n"); + return 1; + } + break; + case FDT_END_NODE: + level--; + if(level <= depth) + printf("%s};\n", &tabs[MAX_LEVEL - level]); + if (level == 0) { + level = -1; /* exit the loop */ + } + break; + case FDT_PROP: + nodep = fdt_getprop (fdt, offstack[level], pathp, &len); + if (len < 0) { + printf ("libfdt fdt_getprop(): %s\n", + fdt_strerror(len)); + return 1; + } else if (len == 0) { + /* the property has no value */ + if(level <= depth) + printf("%s%s;\n", + &tabs[MAX_LEVEL - level], + pathp); + } else { + if(level <= depth) { + printf("%s%s=", + &tabs[MAX_LEVEL - level], + pathp); + print_data (nodep, len); + printf(";\n"); + } + } + break; + case FDT_NOP: + break; + case FDT_END: + return 1; + default: + if(level <= depth) + printf("Unknown tag 0x%08X\n", tag); + return 1; + } + nodeoffset = nextoffset; + } + return 0; +} + /********************************************************************/ U_BOOT_CMD( -- cgit v1.2.1 From 1a861169bc3758f9de3aead62b058736c6891246 Mon Sep 17 00:00:00 2001 From: Gerald Van Baren Date: Wed, 6 Jun 2007 22:47:58 -0400 Subject: Replace fdt_node_offset() with fdt_find_node_by_path(). The new name matches more closely the kernel's name, which is also a much better description. Signed-off-by: Wolfgang Grandegger Acked-by: Gerald Van Baren --- common/cmd_fdt.c | 2 +- common/fdt_support.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'common') diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index 7066d7d6e6..65960c6646 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -59,7 +59,7 @@ static int findnodeoffset(const char *pathp) if (strcmp(pathp, "/") == 0) { nodeoffset = 0; } else { - nodeoffset = fdt_path_offset (fdt, pathp); + nodeoffset = fdt_find_node_by_path (fdt, pathp); if (nodeoffset < 0) { /* * Not found or something else bad happened. diff --git a/common/fdt_support.c b/common/fdt_support.c index 15f133cec3..efa63f001d 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -97,7 +97,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) /* * Find the "chosen" node. */ - nodeoffset = fdt_path_offset (fdt, "/chosen"); + nodeoffset = fdt_find_node_by_path (fdt, "/chosen"); /* * If we have a "chosen" node already the "force the writing" @@ -145,7 +145,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) printf("WARNING fdt_chosen: could not set \"linux,stdout-path\" (libfdt error %s).\n", fdt_strerror(err)); #endif - nodeoffset = fdt_path_offset (fdt, "/cpus"); + nodeoffset = fdt_find_node_by_path (fdt, "/cpus"); if (nodeoffset >= 0) { clock = cpu_to_be32(bd->bi_intfreq); err = fdt_setprop(fdt, nodeoffset, "clock-frequency", &clock, 4); @@ -153,7 +153,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) printf("WARNING fdt_chosen: could not set \"clock-frequency\" (libfdt error %s).\n", fdt_strerror(err)); } #ifdef OF_TBCLK - nodeoffset = fdt_path_offset (fdt, "/cpus/" OF_CPU "/timebase-frequency"); + nodeoffset = fdt_find_node_by_path (fdt, "/cpus/" OF_CPU "/timebase-frequency"); if (nodeoffset >= 0) { clock = cpu_to_be32(OF_TBCLK); err = fdt_setprop(fdt, nodeoffset, "clock-frequency", &clock, 4); @@ -190,7 +190,7 @@ int fdt_env(void *fdt) * See if we already have a "u-boot-env" node, delete it if so. * Then create a new empty node. */ - nodeoffset = fdt_path_offset (fdt, "/u-boot-env"); + nodeoffset = fdt_find_node_by_path (fdt, "/u-boot-env"); if (nodeoffset >= 0) { err = fdt_del_node(fdt, nodeoffset); if (err < 0) { @@ -310,7 +310,7 @@ int fdt_bd_t(void *fdt) * See if we already have a "bd_t" node, delete it if so. * Then create a new empty node. */ - nodeoffset = fdt_path_offset (fdt, "/bd_t"); + nodeoffset = fdt_find_node_by_path (fdt, "/bd_t"); if (nodeoffset >= 0) { err = fdt_del_node(fdt, nodeoffset); if (err < 0) { -- cgit v1.2.1 From 06e19a07701c968f15d72c083b5872a1a11c7b01 Mon Sep 17 00:00:00 2001 From: Gerald Van Baren Date: Mon, 21 May 2007 23:27:16 -0400 Subject: For fdt_find_node_by_path(), handle the root path properly. Also removes the special case root path detection in cmd_fdt.c since it is no longer necessary. Signed-off-by: Gerald Van Baren --- common/cmd_fdt.c | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) (limited to 'common') diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index 65960c6646..7669676f2d 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -52,25 +52,6 @@ static int fdt_parse_prop(char *pathp, char *prop, char *newval, char *data, int *len); static int fdt_print(char *pathp, char *prop, int depth); -static int findnodeoffset(const char *pathp) -{ - int nodeoffset; - - if (strcmp(pathp, "/") == 0) { - nodeoffset = 0; - } else { - nodeoffset = fdt_find_node_by_path (fdt, pathp); - if (nodeoffset < 0) { - /* - * Not found or something else bad happened. - */ - printf ("findnodeoffset() libfdt: %s\n", - fdt_strerror(nodeoffset)); - } - } - return nodeoffset; -} - /* * Flattened Device Tree command, see the help for parameter definitions. */ @@ -187,11 +168,13 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) pathp = argv[2]; nodep = argv[3]; - nodeoffset = findnodeoffset(pathp); + nodeoffset = fdt_find_node_by_path (fdt, pathp); if (nodeoffset < 0) { /* * Not found or something else bad happened. */ + printf ("libfdt fdt_find_node_by_path() returned %s\n", + fdt_strerror(nodeoffset)); return 1; } err = fdt_add_subnode(fdt, nodeoffset, nodep); @@ -225,11 +208,13 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) prop = argv[3]; newval = argv[4]; - nodeoffset = findnodeoffset(pathp); + nodeoffset = fdt_find_node_by_path (fdt, pathp); if (nodeoffset < 0) { /* * Not found or something else bad happened. */ + printf ("libfdt fdt_find_node_by_path() returned %s\n", + fdt_strerror(nodeoffset)); return 1; } ret = fdt_parse_prop(pathp, prop, newval, data, &len); @@ -283,11 +268,13 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) * Get the path. The root node is an oddball, the offset * is zero and has no name. */ - nodeoffset = findnodeoffset(argv[2]); + nodeoffset = fdt_find_node_by_path (fdt, argv[2]); if (nodeoffset < 0) { /* * Not found or something else bad happened. */ + printf ("libfdt fdt_find_node_by_path() returned %s\n", + fdt_strerror(nodeoffset)); return 1; } /* @@ -584,11 +571,13 @@ static int fdt_print(char *pathp, char *prop, int depth) int len; /* length of the property */ int level = 0; /* keep track of nesting level */ - nodeoffset = findnodeoffset(pathp); + nodeoffset = fdt_find_node_by_path (fdt, pathp); if (nodeoffset < 0) { /* * Not found or something else bad happened. */ + printf ("libfdt fdt_find_node_by_path() returned %s\n", + fdt_strerror(nodeoffset)); return 1; } /* -- cgit v1.2.1 From 35ec398f16e17df600edc1b38c1e9e62c15c9aa1 Mon Sep 17 00:00:00 2001 From: Gerald Van Baren Date: Fri, 25 May 2007 22:08:57 -0400 Subject: Fix fdt_chosen() to call ft_board_setup(), clean up long lines. The fdt_chosen() function was adding/seting some properties ad-hoc improperly and duplicated (poorly) what was done in ft_board_setup() Clean up long lines (setting properties, printing errors). Signed-off-by: Gerald Van Baren --- common/fdt_support.c | 113 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 74 insertions(+), 39 deletions(-) (limited to 'common') diff --git a/common/fdt_support.c b/common/fdt_support.c index efa63f001d..d12c7516f0 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -32,6 +32,10 @@ #include #include +#ifdef CONFIG_OF_BOARD_SETUP +void ft_board_setup(void *blob, bd_t *bd); +#endif + /* * Global data (for the gd->bd) */ @@ -42,7 +46,6 @@ DECLARE_GLOBAL_DATA_PTR; */ struct fdt_header *fdt; - /********************************************************************/ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) @@ -50,9 +53,8 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) bd_t *bd = gd->bd; int nodeoffset; int err; - u32 tmp; /* used to set 32 bit integer properties */ - char *str; /* used to set string properties */ - ulong clock; + u32 tmp; /* used to set 32 bit integer properties */ + char *str; /* used to set string properties */ err = fdt_check_header(fdt); if (err < 0) { @@ -60,6 +62,17 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) return err; } +#ifdef CONFIG_OF_BOARD_SETUP + /* + * ft_board_setup() sets various board-specific properties to + * the proper values. + * + * STRICTLY SPEAKING, this is out of place, but it isn't clear + * where a better place would be. + */ + ft_board_setup(fdt, bd); +#endif + if (initrd_start && initrd_end) { struct fdt_reserve_entry re; int used; @@ -72,7 +85,8 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) return err; } if (used >= total) { - printf("WARNING fdt_chosen: no room in the reserved map (%d of %d)\n", + printf("WARNING fdt_chosen: " + "no room in the reserved map (%d of %d)\n", used, total); return -1; } @@ -115,7 +129,10 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) */ nodeoffset = fdt_add_subnode(fdt, 0, "chosen"); if (nodeoffset < 0) { - printf("WARNING fdt_chosen: could not create the \"/chosen node\" (libfdt error %s).\n", fdt_strerror(nodeoffset)); + printf("WARNING fdt_chosen: " + "could not create the \"/chosen node\" " + "(libfdt error %s).\n", + fdt_strerror(nodeoffset)); return nodeoffset; } } @@ -125,42 +142,42 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) */ str = getenv("bootargs"); if (str != NULL) { - err = fdt_setprop(fdt, nodeoffset, "bootargs", str, strlen(str)+1); + err = fdt_setprop(fdt, nodeoffset, + "bootargs", str, strlen(str)+1); if (err < 0) - printf("WARNING fdt_chosen: could not set \"bootargs\" (libfdt error %s).\n", fdt_strerror(err)); + printf("WARNING fdt_chosen: " + "could not set \"bootargs\" " + "(libfdt error %s).\n", + fdt_strerror(err)); } if (initrd_start && initrd_end) { tmp = __cpu_to_be32(initrd_start); - err = fdt_setprop(fdt, nodeoffset, "linux,initrd-start", &tmp, sizeof(tmp)); + err = fdt_setprop(fdt, nodeoffset, + "linux,initrd-start", &tmp, sizeof(tmp)); if (err < 0) - printf("WARNING fdt_chosen: could not set \"linux,initrd-start\" (libfdt error %s).\n", fdt_strerror(err)); + printf("WARNING fdt_chosen: " + "could not set \"linux,initrd-start\" " + "(libfdt error %s).\n", + fdt_strerror(err)); tmp = __cpu_to_be32(initrd_end); - err = fdt_setprop(fdt, nodeoffset, "linux,initrd-end", &tmp, sizeof(tmp)); + err = fdt_setprop(fdt, nodeoffset, + "linux,initrd-end", &tmp, sizeof(tmp)); if (err < 0) - printf("WARNING fdt_chosen: could not set \"linux,initrd-end\" (libfdt error %s).\n", fdt_strerror(err)); + printf("WARNING fdt_chosen: " + "could not set \"linux,initrd-end\" " + "(libfdt error %s).\n", + fdt_strerror(err)); } #ifdef OF_STDOUT_PATH - err = fdt_setprop(fdt, nodeoffset, "linux,stdout-path", OF_STDOUT_PATH, strlen(OF_STDOUT_PATH)+1); + err = fdt_setprop(fdt, nodeoffset, + "linux,stdout-path", OF_STDOUT_PATH, strlen(OF_STDOUT_PATH)+1); if (err < 0) - printf("WARNING fdt_chosen: could not set \"linux,stdout-path\" (libfdt error %s).\n", fdt_strerror(err)); + printf("WARNING fdt_chosen: " + "could not set \"linux,stdout-path\" " + "(libfdt error %s).\n", + fdt_strerror(err)); #endif - nodeoffset = fdt_find_node_by_path (fdt, "/cpus"); - if (nodeoffset >= 0) { - clock = cpu_to_be32(bd->bi_intfreq); - err = fdt_setprop(fdt, nodeoffset, "clock-frequency", &clock, 4); - if (err < 0) - printf("WARNING fdt_chosen: could not set \"clock-frequency\" (libfdt error %s).\n", fdt_strerror(err)); - } -#ifdef OF_TBCLK - nodeoffset = fdt_find_node_by_path (fdt, "/cpus/" OF_CPU "/timebase-frequency"); - if (nodeoffset >= 0) { - clock = cpu_to_be32(OF_TBCLK); - err = fdt_setprop(fdt, nodeoffset, "clock-frequency", &clock, 4); - if (err < 0) - printf("WARNING fdt_chosen: could not set \"clock-frequency\" (libfdt error %s).\n", fdt_strerror(err)); - } -#endif return err; } @@ -203,7 +220,10 @@ int fdt_env(void *fdt) */ nodeoffset = fdt_add_subnode(fdt, 0, "u-boot-env"); if (nodeoffset < 0) { - printf("WARNING fdt_env: could not create the \"/u-boot-env node\" (libfdt error %s).\n", fdt_strerror(nodeoffset)); + printf("WARNING fdt_env: " + "could not create the \"/u-boot-env node\" " + "(libfdt error %s).\n", + fdt_strerror(nodeoffset)); return nodeoffset; } @@ -231,7 +251,10 @@ int fdt_env(void *fdt) continue; err = fdt_setprop(fdt, nodeoffset, lval, rval, strlen(rval)+1); if (err < 0) { - printf("WARNING fdt_env: could not set \"%s\" (libfdt error %s).\n", lval, fdt_strerror(err)); + printf("WARNING fdt_env: " + "could not set \"%s\" " + "(libfdt error %s).\n", + lval, fdt_strerror(err)); return err; } } @@ -297,7 +320,7 @@ int fdt_bd_t(void *fdt) bd_t *bd = gd->bd; int nodeoffset; int err; - u32 tmp; /* used to set 32 bit integer properties */ + u32 tmp; /* used to set 32 bit integer properties */ int i; err = fdt_check_header(fdt); @@ -323,7 +346,10 @@ int fdt_bd_t(void *fdt) */ nodeoffset = fdt_add_subnode(fdt, 0, "bd_t"); if (nodeoffset < 0) { - printf("WARNING fdt_bd_t: could not create the \"/bd_t node\" (libfdt error %s).\n", fdt_strerror(nodeoffset)); + printf("WARNING fdt_bd_t: " + "could not create the \"/bd_t node\" " + "(libfdt error %s).\n", + fdt_strerror(nodeoffset)); printf("libfdt: %s\n", fdt_strerror(nodeoffset)); return nodeoffset; } @@ -332,20 +358,29 @@ int fdt_bd_t(void *fdt) */ for (i = 0; i < sizeof(bd_map)/sizeof(bd_map[0]); i++) { tmp = cpu_to_be32(getenv("bootargs")); - err = fdt_setprop(fdt, nodeoffset, bd_map[i].name, &tmp, sizeof(tmp)); + err = fdt_setprop(fdt, nodeoffset, + bd_map[i].name, &tmp, sizeof(tmp)); if (err < 0) - printf("WARNING fdt_bd_t: could not set \"%s\" (libfdt error %s).\n", bd_map[i].name, fdt_strerror(err)); + printf("WARNING fdt_bd_t: " + "could not set \"%s\" " + "(libfdt error %s).\n", + bd_map[i].name, fdt_strerror(err)); } /* * Add a couple of oddball entries... */ err = fdt_setprop(fdt, nodeoffset, "enetaddr", &bd->bi_enetaddr, 6); if (err < 0) - printf("WARNING fdt_bd_t: could not set \"enetaddr\" (libfdt error %s).\n", fdt_strerror(err)); + printf("WARNING fdt_bd_t: " + "could not set \"enetaddr\" " + "(libfdt error %s).\n", + fdt_strerror(err)); err = fdt_setprop(fdt, nodeoffset, "ethspeed", &bd->bi_ethspeed, 4); if (err < 0) - printf("WARNING fdt_bd_t: could not set \"ethspeed\" (libfdt error %s).\n", fdt_strerror(err)); - + printf("WARNING fdt_bd_t: " + "could not set \"ethspeed\" " + "(libfdt error %s).\n", + fdt_strerror(err)); return 0; } #endif /* ifdef CONFIG_OF_HAS_BD_T */ -- cgit v1.2.1 From c45874b05aae897a6c29d1a97d4bb708fca2756c Mon Sep 17 00:00:00 2001 From: Gerald Van Baren Date: Mon, 25 Jun 2007 19:52:23 -0400 Subject: Asthetic improvements: error messages and line lengths. Tighten up the error messages, split overlength lines. Signed-off-by: Gerald Van Baren --- common/cmd_bootm.c | 126 ++++++++++++++++++++++++++--------------------------- 1 file changed, 61 insertions(+), 65 deletions(-) (limited to 'common') diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 45ab13abd6..6ce62be91f 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -362,7 +362,6 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) if (i != BZ_OK) { printf ("BUNZIP2 ERROR %d - must RESET board to recover\n", i); show_boot_progress (-6); - udelay(100000); do_reset (cmdtp, flag, argc, argv); } break; @@ -741,32 +740,34 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, if(argc > 3) { of_flat_tree = (char *) simple_strtoul(argv[3], NULL, 16); hdr = (image_header_t *)of_flat_tree; -#if defined(CONFIG_OF_LIBFDT) - if (fdt_check_header(of_flat_tree) == 0) { +#if defined(CONFIG_OF_FLAT_TREE) + if (*((ulong *)(of_flat_tree + sizeof(image_header_t))) != OF_DT_HEADER) { #else - if (*(ulong *)of_flat_tree == OF_DT_HEADER) { + if (fdt_check_header(of_flat_tree + sizeof(image_header_t)) != 0) { #endif #ifndef CFG_NO_FLASH if (addr2info((ulong)of_flat_tree) != NULL) of_data = (ulong)of_flat_tree; #endif } else if (ntohl(hdr->ih_magic) == IH_MAGIC) { - printf("## Flat Device Tree Image at %08lX\n", hdr); + printf("## Flat Device Tree at %08lX\n", hdr); print_image_hdr(hdr); if ((ntohl(hdr->ih_load) < ((unsigned long)hdr + ntohl(hdr->ih_size) + sizeof(hdr))) && ((ntohl(hdr->ih_load) + ntohl(hdr->ih_size)) > (unsigned long)hdr)) { - puts ("ERROR: Load address overwrites Flat Device Tree uImage\nMust RESET board to recover\n"); + puts ("ERROR: fdt overwritten - " + "must RESET the board to recover.\n"); do_reset (cmdtp, flag, argc, argv); } - printf(" Verifying Checksum ... "); + puts (" Verifying Checksum ... "); memmove (&header, (char *)hdr, sizeof(image_header_t)); checksum = ntohl(header.ih_hcrc); header.ih_hcrc = 0; if(checksum != crc32(0, (uchar *)&header, sizeof(image_header_t))) { - puts ("ERROR: Flat Device Tree header checksum is invalid\nMust RESET board to recover\n"); + puts ("ERROR: fdt header checksum invalid - " + "must RESET the board to recover.\n"); do_reset (cmdtp, flag, argc, argv); } @@ -774,25 +775,29 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, addr = (ulong)((uchar *)(hdr) + sizeof(image_header_t)); if(checksum != crc32(0, (uchar *)addr, ntohl(hdr->ih_size))) { - puts ("ERROR: Flat Device Tree checksum is invalid\nMust RESET board to recover\n"); + puts ("ERROR: fdt checksum invalid - " + "must RESET the board to recover.\n"); do_reset (cmdtp, flag, argc, argv); } - printf("OK\n"); + puts ("OK\n"); if (ntohl(hdr->ih_type) != IH_TYPE_FLATDT) { - puts ("ERROR: uImage not Flat Device Tree type\nMust RESET board to recover\n"); + puts ("ERROR: uImage is not a fdt - " + "must RESET the board to recover.\n"); do_reset (cmdtp, flag, argc, argv); } if (ntohl(hdr->ih_comp) != IH_COMP_NONE) { - puts ("ERROR: uImage is not uncompressed\nMust RESET board to recover\n"); + puts ("ERROR: uImage is compressed - " + "must RESET the board to recover.\n"); do_reset (cmdtp, flag, argc, argv); } -#if defined(CONFIG_OF_LIBFDT) - if (fdt_check_header(of_flat_tree + sizeof(image_header_t)) != 0) { -#else +#if defined(CONFIG_OF_FLAT_TREE) if (*((ulong *)(of_flat_tree + sizeof(image_header_t))) != OF_DT_HEADER) { +#else + if (fdt_check_header(of_flat_tree + sizeof(image_header_t)) != 0) { #endif - puts ("ERROR: uImage data is not a flat device tree\nMust RESET board to recover\n"); + puts ("ERROR: uImage data is not a fdt - " + "must RESET the board to recover.\n"); do_reset (cmdtp, flag, argc, argv); } @@ -801,10 +806,11 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, ntohl(hdr->ih_size)); of_flat_tree = (char *)ntohl(hdr->ih_load); } else { - puts ("Did not find a flat flat device tree\nMust RESET board to recover\n"); + puts ("Did not find a flat Flat Device Tree.\n" + "Must RESET the board to recover.\n"); do_reset (cmdtp, flag, argc, argv); } - printf (" Booting using flat device tree at 0x%x\n", + printf (" Booting using the fdt at 0x%x\n", of_flat_tree); } else if ((hdr->ih_type==IH_TYPE_MULTI) && (len_ptr[1]) && (len_ptr[2])) { u_long tail = ntohl(len_ptr[0]) % 4; @@ -828,21 +834,23 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, of_data += 4 - tail; } -#if defined(CONFIG_OF_LIBFDT) - if (fdt_check_header((void *)of_data) != 0) { +#if defined(CONFIG_OF_FLAT_TREE) + if (*((ulong *)(of_flat_tree + sizeof(image_header_t))) != OF_DT_HEADER) { #else - if (((struct boot_param_header *)of_data)->magic != OF_DT_HEADER) { + if (fdt_check_header(of_flat_tree + sizeof(image_header_t)) != 0) { #endif - puts ("ERROR: image is not a flat device tree\nMust RESET board to recover\n"); + puts ("ERROR: image is not a fdt - " + "must RESET the board to recover.\n"); do_reset (cmdtp, flag, argc, argv); } -#if defined(CONFIG_OF_LIBFDT) - if (be32_to_cpu(fdt_totalsize(of_data)) != ntohl(len_ptr[2])) { -#else +#if defined(CONFIG_OF_FLAT_TREE) if (((struct boot_param_header *)of_data)->totalsize != ntohl(len_ptr[2])) { +#else + if (be32_to_cpu(fdt_totalsize(of_data)) != ntohl(len_ptr[2])) { #endif - puts ("ERROR: flat device tree size does not agree with image\nMust RESET board to recover\n"); + puts ("ERROR: fdt size != image size - " + "must RESET the board to recover.\n"); do_reset (cmdtp, flag, argc, argv); } } @@ -937,30 +945,35 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, of_start, of_start + of_len - 1); err = fdt_open_into((void *)of_data, (void *)of_start, of_len); if (err != 0) { - printf ("libfdt: %s " __FILE__ " %d\n", fdt_strerror(err), __LINE__); - } - /* - * Add the chosen node if it doesn't exist, add the env and bd_t - * if the user wants it (the logic is in the subroutines). - */ - if (fdt_chosen(of_flat_tree, initrd_start, initrd_end, 0) < 0) { - puts ("ERROR: Failed creating the /chosen node, aborting.\nMust RESET board to recover\n"); + puts ("ERROR: fdt move failed - " + "must RESET the board to recover.\n"); do_reset (cmdtp, flag, argc, argv); } + } + /* + * Add the chosen node if it doesn't exist, add the env and bd_t + * if the user wants it (the logic is in the subroutines). + */ + if (fdt_chosen(of_flat_tree, initrd_start, initrd_end, 0) < 0) { + puts ("ERROR: /chosen node create failed - " + "must RESET the board to recover.\n"); + do_reset (cmdtp, flag, argc, argv); + } #ifdef CONFIG_OF_HAS_UBOOT_ENV - if (fdt_env(of_flat_tree) < 0) { - puts ("ERROR: Failed creating the /u-boot-env node, aborting.\nMust RESET board to recover\n"); - do_reset (cmdtp, flag, argc, argv); - } + if (fdt_env(of_flat_tree) < 0) { + puts ("ERROR: /u-boot-env node create failed - " + "must RESET the board to recover.\n"); + do_reset (cmdtp, flag, argc, argv); + } #endif #ifdef CONFIG_OF_HAS_BD_T - if (fdt_bd_t(of_flat_tree) < 0) { - puts ("ERROR: Failed creating the /bd_t node, aborting.\nMust RESET board to recover\n"); - do_reset (cmdtp, flag, argc, argv); - } -#endif + if (fdt_bd_t(of_flat_tree) < 0) { + puts ("ERROR: /bd_t node create failed - " + "must RESET the board to recover.\n"); + do_reset (cmdtp, flag, argc, argv); } #endif +#endif /* CONFIG_OF_LIBFDT */ #if defined(CONFIG_OF_FLAT_TREE) /* move of_flat_tree if needed */ if (of_data) { @@ -980,30 +993,13 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, of_start, of_start + of_len - 1); memmove ((void *)of_start, (void *)of_data, of_len); } -#endif -#if defined(CONFIG_OF_FLAT_TREE) + /* + * Create the /chosen node and modify the blob with board specific + * values as needed. + */ ft_setup(of_flat_tree, kbd, initrd_start, initrd_end); /* ft_dump_blob(of_flat_tree); */ #endif -#if defined(CONFIG_OF_LIBFDT) - if (fdt_chosen(of_flat_tree, initrd_start, initrd_end, 0) < 0) { - puts ("ERROR: Failed to create the /chosen node, aborting.\nMust RESET board to recover\n"); - do_reset (cmdtp, flag, argc, argv); - } -#ifdef CONFIG_OF_HAS_UBOOT_ENV - if (fdt_env(of_flat_tree) < 0) { - puts ("ERROR: Failed to create the /u-boot-env node, aborting.\nMust RESET board to recover\n"); - do_reset (cmdtp, flag, argc, argv); - } -#endif -#ifdef CONFIG_OF_HAS_BD_T - if (fdt_bd_t(of_flat_tree) < 0) { - puts ("ERROR: Failed to create the /bd_t node, aborting.\nMust RESET board to recover\n"); - do_reset (cmdtp, flag, argc, argv); - } -#endif -#endif /* if defined(CONFIG_OF_LIBFDT) */ - debug ("## Transferring control to Linux (at address %08lx) ...\n", (ulong)kernel); @@ -1017,7 +1013,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, if (of_flat_tree) { /* device tree; boot new style */ /* * Linux Kernel Parameters (passing device tree): - * r3: ptr to flattened device tree, followed by the board info data + * r3: pointer to the fdt, followed by the board info data * r4: physical pointer to the kernel itself * r5: NULL * r6: NULL -- cgit v1.2.1 From 6f35ded9e85493595e0eb66a82b502a95326d049 Mon Sep 17 00:00:00 2001 From: Gerald Van Baren Date: Mon, 25 Jun 2007 20:55:58 -0400 Subject: Tighten up the error messages. Signed-off-by: Gerald Van Baren --- common/fdt_support.c | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) (limited to 'common') diff --git a/common/fdt_support.c b/common/fdt_support.c index d12c7516f0..ec04a639f3 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -130,8 +130,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) nodeoffset = fdt_add_subnode(fdt, 0, "chosen"); if (nodeoffset < 0) { printf("WARNING fdt_chosen: " - "could not create the \"/chosen node\" " - "(libfdt error %s).\n", + "could not create the /chosen node (%s).\n", fdt_strerror(nodeoffset)); return nodeoffset; } @@ -146,8 +145,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) "bootargs", str, strlen(str)+1); if (err < 0) printf("WARNING fdt_chosen: " - "could not set \"bootargs\" " - "(libfdt error %s).\n", + "could not set bootargs (%s).\n", fdt_strerror(err)); } if (initrd_start && initrd_end) { @@ -156,16 +154,14 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) "linux,initrd-start", &tmp, sizeof(tmp)); if (err < 0) printf("WARNING fdt_chosen: " - "could not set \"linux,initrd-start\" " - "(libfdt error %s).\n", + "could not set linux,initrd-start (%s).\n", fdt_strerror(err)); tmp = __cpu_to_be32(initrd_end); err = fdt_setprop(fdt, nodeoffset, "linux,initrd-end", &tmp, sizeof(tmp)); if (err < 0) printf("WARNING fdt_chosen: " - "could not set \"linux,initrd-end\" " - "(libfdt error %s).\n", + "could not set linux,initrd-end (%s).\n", fdt_strerror(err)); } #ifdef OF_STDOUT_PATH @@ -173,8 +169,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) "linux,stdout-path", OF_STDOUT_PATH, strlen(OF_STDOUT_PATH)+1); if (err < 0) printf("WARNING fdt_chosen: " - "could not set \"linux,stdout-path\" " - "(libfdt error %s).\n", + "could not set linux,stdout-path (%s).\n", fdt_strerror(err)); #endif @@ -221,8 +216,7 @@ int fdt_env(void *fdt) nodeoffset = fdt_add_subnode(fdt, 0, "u-boot-env"); if (nodeoffset < 0) { printf("WARNING fdt_env: " - "could not create the \"/u-boot-env node\" " - "(libfdt error %s).\n", + "could not create the /u-boot-env node (%s).\n", fdt_strerror(nodeoffset)); return nodeoffset; } @@ -252,8 +246,7 @@ int fdt_env(void *fdt) err = fdt_setprop(fdt, nodeoffset, lval, rval, strlen(rval)+1); if (err < 0) { printf("WARNING fdt_env: " - "could not set \"%s\" " - "(libfdt error %s).\n", + "could not set %s (%s).\n", lval, fdt_strerror(err)); return err; } @@ -347,8 +340,7 @@ int fdt_bd_t(void *fdt) nodeoffset = fdt_add_subnode(fdt, 0, "bd_t"); if (nodeoffset < 0) { printf("WARNING fdt_bd_t: " - "could not create the \"/bd_t node\" " - "(libfdt error %s).\n", + "could not create the /bd_t node (%s).\n", fdt_strerror(nodeoffset)); printf("libfdt: %s\n", fdt_strerror(nodeoffset)); return nodeoffset; @@ -362,8 +354,7 @@ int fdt_bd_t(void *fdt) bd_map[i].name, &tmp, sizeof(tmp)); if (err < 0) printf("WARNING fdt_bd_t: " - "could not set \"%s\" " - "(libfdt error %s).\n", + "could not set %s (%s).\n", bd_map[i].name, fdt_strerror(err)); } /* @@ -372,14 +363,12 @@ int fdt_bd_t(void *fdt) err = fdt_setprop(fdt, nodeoffset, "enetaddr", &bd->bi_enetaddr, 6); if (err < 0) printf("WARNING fdt_bd_t: " - "could not set \"enetaddr\" " - "(libfdt error %s).\n", + "could not set enetaddr (%s).\n", fdt_strerror(err)); err = fdt_setprop(fdt, nodeoffset, "ethspeed", &bd->bi_ethspeed, 4); if (err < 0) printf("WARNING fdt_bd_t: " - "could not set \"ethspeed\" " - "(libfdt error %s).\n", + "could not set ethspeed (%s).\n", fdt_strerror(err)); return 0; } -- cgit v1.2.1 From fd61e55dd8cb52ce3ff91b3917af26e24b6b0845 Mon Sep 17 00:00:00 2001 From: Gerald Van Baren Date: Mon, 25 Jun 2007 23:25:28 -0400 Subject: Create new fdt boardsetup command, fix bug parsing [] form of set values. Previously ft_board_setup() was called by fdt_chosen() which was not really correctly structured. This splits ft_board_setup() out by creating a new fdt boardsetup command. Fix a bug when parsing fdt set command values which have the square bracket form [00 11 22 33] - the length was updated incorrectly in when parsing that form. Signed-off-by: Gerald Van Baren --- common/cmd_fdt.c | 31 +++++++++++++++++++++---------- common/fdt_support.c | 15 --------------- 2 files changed, 21 insertions(+), 25 deletions(-) (limited to 'common') diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index 7669676f2d..824088c911 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -37,7 +37,7 @@ #include #define MAX_LEVEL 32 /* how deeply nested we will go */ -#define SCRATCHPAD 1024 /* bytes of scratchpad memory */ +#define SCRATCHPAD 1024 /* bytes of scratchpad memory */ /* * Global data (for the gd->bd) @@ -47,6 +47,10 @@ DECLARE_GLOBAL_DATA_PTR; /* * Function prototypes/declarations. */ +#ifdef CONFIG_OF_BOARD_SETUP +void ft_board_setup(void *blob, bd_t *bd); +#endif + static int fdt_valid(void); static int fdt_parse_prop(char *pathp, char *prop, char *newval, char *data, int *len); @@ -297,6 +301,13 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) } } +#ifdef CONFIG_OF_BOARD_SETUP + /******************************************************************** + * Call the board-specific fixup routine + ********************************************************************/ + } else if (argv[1][0] == 'b') { + ft_board_setup(fdt, gd->bd); +#endif /******************************************************************** * Create a chosen node ********************************************************************/ @@ -429,7 +440,7 @@ static int fdt_parse_prop(char *pathp, char *prop, char *newval, while ((*newval != ']') && (*newval != '\0')) { tmp = simple_strtoul(newval, &newval, 16); *data++ = tmp & 0xFF; - *len++; + *len = *len + 1; while (*newval == ' ') newval++; } @@ -673,25 +684,25 @@ U_BOOT_CMD( fdt, 5, 0, do_fdt, "fdt - flattened device tree utility commands\n", "addr [] - Set the fdt location to \n" +#ifdef CONFIG_OF_BOARD_SETUP + "fdt boardsetup - Do board-specific set up\n" +#endif "fdt move - Copy the fdt to \n" "fdt print [] - Recursive print starting at \n" "fdt list [] - Print one level starting at \n" "fdt set [] - Set [to ]\n" "fdt mknode - Create a new node after \n" "fdt rm [] - Delete the node or \n" - "fdt chosen - Add/update the \"/chosen\" branch in the tree\n" + "fdt chosen - Add/update the /chosen branch in the tree\n" #ifdef CONFIG_OF_HAS_UBOOT_ENV - "fdt env - Add/replace the \"/u-boot-env\" branch in the tree\n" + "fdt env - Add/replace the /u-boot-env branch in the tree\n" #endif #ifdef CONFIG_OF_HAS_BD_T - "fdt bd_t - Add/replace the \"/bd_t\" branch in the tree\n" + "fdt bd_t - Add/replace the /bd_t branch in the tree\n" #endif "Hints:\n" - " * If the property you are setting/printing has a '#' character,\n" - " you MUST escape it with a \\ character or quote it with \" or\n" - " it will be ignored as a comment.\n" - " * If the value has spaces in it, you MUST escape the spaces with\n" - " \\ characters or quote it with \"\"\n" + " If the property you are setting/printing has a '#' character or spaces,\n" + " you MUST escape it with a \\ character or quote it with \".\n" "Examples: fdt print / # print the whole tree\n" " fdt print /cpus \"#address-cells\"\n" " fdt set /cpus \"#address-cells\" \"[00 00 00 01]\"\n" diff --git a/common/fdt_support.c b/common/fdt_support.c index ec04a639f3..259bd42cc6 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -32,10 +32,6 @@ #include #include -#ifdef CONFIG_OF_BOARD_SETUP -void ft_board_setup(void *blob, bd_t *bd); -#endif - /* * Global data (for the gd->bd) */ @@ -62,17 +58,6 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) return err; } -#ifdef CONFIG_OF_BOARD_SETUP - /* - * ft_board_setup() sets various board-specific properties to - * the proper values. - * - * STRICTLY SPEAKING, this is out of place, but it isn't clear - * where a better place would be. - */ - ft_board_setup(fdt, bd); -#endif - if (initrd_start && initrd_end) { struct fdt_reserve_entry re; int used; -- cgit v1.2.1 From e125a2ffc209dd34794e326c7175658253beadf3 Mon Sep 17 00:00:00 2001 From: Gerald Van Baren Date: Tue, 10 Jul 2007 20:40:39 -0400 Subject: Call ft_board_setup() from the bootm command. In the patch titled "Create new fdt boardsetup command..." I removed the call to ft_board_setup() from the routine fdt_chosen(), but I forgot to add a direct call back into cmd_bootm.c This fixes the oversight by adding the direct call to the bootm command. Signed-off-by: Gerald Van Baren --- common/cmd_bootm.c | 4 ++++ common/cmd_fdt.c | 7 ------- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'common') diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 6ce62be91f..981ffc5000 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -973,6 +973,10 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, do_reset (cmdtp, flag, argc, argv); } #endif +#ifdef CONFIG_OF_BOARD_SETUP + /* Call the board-specific fixup routine */ + ft_board_setup(fdt, gd->bd); +#endif #endif /* CONFIG_OF_LIBFDT */ #if defined(CONFIG_OF_FLAT_TREE) /* move of_flat_tree if needed */ diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index 824088c911..9ddec47706 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -44,13 +44,6 @@ */ DECLARE_GLOBAL_DATA_PTR; -/* - * Function prototypes/declarations. - */ -#ifdef CONFIG_OF_BOARD_SETUP -void ft_board_setup(void *blob, bd_t *bd); -#endif - static int fdt_valid(void); static int fdt_parse_prop(char *pathp, char *prop, char *newval, char *data, int *len); -- cgit v1.2.1 From 91148bf7aeba142d6f348805db7625db7da64d6f Mon Sep 17 00:00:00 2001 From: Kim Phillips Date: Tue, 17 Jul 2007 13:56:53 -0500 Subject: fdt: do board setup based on fdt address specified on bootm line The last fdt patch to bootm did board setup based on the address specified by a prior fdt address command invocation. The bootm code, as its call to fdt_chosen does, should use the fdt specified by the user on the bootm command. Note this restores full functionality for the 8360's existing default boot environment values, e.g. 'run nfsboot' (i.e. no having to 'fdt addr $fdtaddr' before booting a kernel). Signed-off-by: Kim Phillips --- common/cmd_bootm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 981ffc5000..e19f83e48a 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -975,7 +975,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, #endif #ifdef CONFIG_OF_BOARD_SETUP /* Call the board-specific fixup routine */ - ft_board_setup(fdt, gd->bd); + ft_board_setup(of_flat_tree, gd->bd); #endif #endif /* CONFIG_OF_LIBFDT */ #if defined(CONFIG_OF_FLAT_TREE) -- cgit v1.2.1 From 99dffca3b7590a16a00bc475c860b67b2a3f1462 Mon Sep 17 00:00:00 2001 From: Kim Phillips Date: Tue, 17 Jul 2007 13:57:04 -0500 Subject: fdt: allow for builds that don't want env and bd_t nodes protect fdt_env and fdt_bd_t invocations, fix codingstyle while in the area. Signed-off-by: Kim Phillips --- common/cmd_fdt.c | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) (limited to 'common') diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index 9ddec47706..571b8f14d5 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -293,36 +293,28 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) return err; } } - + } #ifdef CONFIG_OF_BOARD_SETUP - /******************************************************************** - * Call the board-specific fixup routine - ********************************************************************/ - } else if (argv[1][0] == 'b') { + /* Call the board-specific fixup routine */ + else if (argv[1][0] == 'b') ft_board_setup(fdt, gd->bd); #endif - /******************************************************************** - * Create a chosen node - ********************************************************************/ - } else if (argv[1][0] == 'c') { + /* Create a chosen node */ + else if (argv[1][0] == 'c') fdt_chosen(fdt, 0, 0, 1); - /******************************************************************** - * Create a u-boot-env node - ********************************************************************/ - } else if (argv[1][0] == 'e') { +#ifdef CONFIG_OF_HAS_UBOOT_ENV + /* Create a u-boot-env node */ + else if (argv[1][0] == 'e') fdt_env(fdt); - - /******************************************************************** - * Create a bd_t node - ********************************************************************/ - } else if (argv[1][0] == 'b') { +#endif +#ifdef CONFIG_OF_HAS_BD_T + /* Create a bd_t node */ + else if (argv[1][0] == 'b') fdt_bd_t(fdt); - - /******************************************************************** - * Unrecognized command - ********************************************************************/ - } else { +#endif + else { + /* Unrecognized command */ printf ("Usage:\n%s\n", cmdtp->usage); return 1; } -- cgit v1.2.1 From 5fe6be6208dda852c3564e384bd78d75784dea3e Mon Sep 17 00:00:00 2001 From: Gerald Van Baren Date: Tue, 7 Aug 2007 21:14:22 -0400 Subject: Improve error print messages. Signed-off-by: Gerald Van Baren --- common/fdt_support.c | 52 +++++++++++++++++++++------------------------------- 1 file changed, 21 insertions(+), 31 deletions(-) (limited to 'common') diff --git a/common/fdt_support.c b/common/fdt_support.c index 259bd42cc6..caaa682a4f 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -54,7 +54,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) err = fdt_check_header(fdt); if (err < 0) { - printf("libfdt: %s\n", fdt_strerror(err)); + printf("fdt_chosen: %s\n", fdt_strerror(err)); return err; } @@ -66,11 +66,11 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) err = fdt_num_reservemap(fdt, &used, &total); if (err < 0) { - printf("libfdt: %s\n", fdt_strerror(err)); + printf("fdt_chosen: %s\n", fdt_strerror(err)); return err; } if (used >= total) { - printf("WARNING fdt_chosen: " + printf("WARNING: " "no room in the reserved map (%d of %d)\n", used, total); return -1; @@ -88,7 +88,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) err = fdt_replace_reservemap_entry(fdt, j, initrd_start, initrd_end - initrd_start + 1); if (err < 0) { - printf("libfdt: %s\n", fdt_strerror(err)); + printf("fdt_chosen: %s\n", fdt_strerror(err)); return err; } } @@ -114,8 +114,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) */ nodeoffset = fdt_add_subnode(fdt, 0, "chosen"); if (nodeoffset < 0) { - printf("WARNING fdt_chosen: " - "could not create the /chosen node (%s).\n", + printf("WARNING: could not create /chosen %s.\n", fdt_strerror(nodeoffset)); return nodeoffset; } @@ -129,8 +128,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) err = fdt_setprop(fdt, nodeoffset, "bootargs", str, strlen(str)+1); if (err < 0) - printf("WARNING fdt_chosen: " - "could not set bootargs (%s).\n", + printf("WARNING: could not set bootargs %s.\n", fdt_strerror(err)); } if (initrd_start && initrd_end) { @@ -138,23 +136,21 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) err = fdt_setprop(fdt, nodeoffset, "linux,initrd-start", &tmp, sizeof(tmp)); if (err < 0) - printf("WARNING fdt_chosen: " - "could not set linux,initrd-start (%s).\n", + printf("WARNING: " + "could not set linux,initrd-start %s.\n", fdt_strerror(err)); tmp = __cpu_to_be32(initrd_end); err = fdt_setprop(fdt, nodeoffset, "linux,initrd-end", &tmp, sizeof(tmp)); if (err < 0) - printf("WARNING fdt_chosen: " - "could not set linux,initrd-end (%s).\n", + printf("WARNING: could not set linux,initrd-end %s.\n", fdt_strerror(err)); } #ifdef OF_STDOUT_PATH err = fdt_setprop(fdt, nodeoffset, "linux,stdout-path", OF_STDOUT_PATH, strlen(OF_STDOUT_PATH)+1); if (err < 0) - printf("WARNING fdt_chosen: " - "could not set linux,stdout-path (%s).\n", + printf("WARNING: could not set linux,stdout-path %s.\n", fdt_strerror(err)); #endif @@ -179,7 +175,7 @@ int fdt_env(void *fdt) err = fdt_check_header(fdt); if (err < 0) { - printf("libfdt: %s\n", fdt_strerror(err)); + printf("fdt_env: %s\n", fdt_strerror(err)); return err; } @@ -191,7 +187,7 @@ int fdt_env(void *fdt) if (nodeoffset >= 0) { err = fdt_del_node(fdt, nodeoffset); if (err < 0) { - printf("libfdt: %s\n", fdt_strerror(err)); + printf("fdt_env: %s\n", fdt_strerror(err)); return err; } } @@ -200,8 +196,7 @@ int fdt_env(void *fdt) */ nodeoffset = fdt_add_subnode(fdt, 0, "u-boot-env"); if (nodeoffset < 0) { - printf("WARNING fdt_env: " - "could not create the /u-boot-env node (%s).\n", + printf("WARNING: could not create /u-boot-env %s.\n", fdt_strerror(nodeoffset)); return nodeoffset; } @@ -230,8 +225,7 @@ int fdt_env(void *fdt) continue; err = fdt_setprop(fdt, nodeoffset, lval, rval, strlen(rval)+1); if (err < 0) { - printf("WARNING fdt_env: " - "could not set %s (%s).\n", + printf("WARNING: could not set %s %s.\n", lval, fdt_strerror(err)); return err; } @@ -303,7 +297,7 @@ int fdt_bd_t(void *fdt) err = fdt_check_header(fdt); if (err < 0) { - printf("libfdt: %s\n", fdt_strerror(err)); + printf("fdt_bd_t: %s\n", fdt_strerror(err)); return err; } @@ -315,7 +309,7 @@ int fdt_bd_t(void *fdt) if (nodeoffset >= 0) { err = fdt_del_node(fdt, nodeoffset); if (err < 0) { - printf("libfdt: %s\n", fdt_strerror(err)); + printf("fdt_bd_t: %s\n", fdt_strerror(err)); return err; } } @@ -324,10 +318,9 @@ int fdt_bd_t(void *fdt) */ nodeoffset = fdt_add_subnode(fdt, 0, "bd_t"); if (nodeoffset < 0) { - printf("WARNING fdt_bd_t: " - "could not create the /bd_t node (%s).\n", + printf("WARNING: could not create /bd_t %s.\n", fdt_strerror(nodeoffset)); - printf("libfdt: %s\n", fdt_strerror(nodeoffset)); + printf("fdt_bd_t: %s\n", fdt_strerror(nodeoffset)); return nodeoffset; } /* @@ -338,8 +331,7 @@ int fdt_bd_t(void *fdt) err = fdt_setprop(fdt, nodeoffset, bd_map[i].name, &tmp, sizeof(tmp)); if (err < 0) - printf("WARNING fdt_bd_t: " - "could not set %s (%s).\n", + printf("WARNING: could not set %s %s.\n", bd_map[i].name, fdt_strerror(err)); } /* @@ -347,13 +339,11 @@ int fdt_bd_t(void *fdt) */ err = fdt_setprop(fdt, nodeoffset, "enetaddr", &bd->bi_enetaddr, 6); if (err < 0) - printf("WARNING fdt_bd_t: " - "could not set enetaddr (%s).\n", + printf("WARNING: could not set enetaddr %s.\n", fdt_strerror(err)); err = fdt_setprop(fdt, nodeoffset, "ethspeed", &bd->bi_ethspeed, 4); if (err < 0) - printf("WARNING fdt_bd_t: " - "could not set ethspeed (%s).\n", + printf("WARNING: could not set ethspeed %s.\n", fdt_strerror(err)); return 0; } -- cgit v1.2.1 From d4fc6012fd0a5c211b825691f44b06f8032c0551 Mon Sep 17 00:00:00 2001 From: Peter Pearse Date: Tue, 14 Aug 2007 10:10:52 +0100 Subject: Add MACH_TYPE records for several AT91 boards. Merge to two at45.c files into a common file, split to at45.c and spi.c Fix spelling error in DM9161 PHY Support. Initialize at91rm9200 board (and set LED). Add PIO control for at91rm9200dk LEDs and Mux. Change dataflash partition boundaries to be compatible with Linux 2.6. Signed-off-by: Peter Pearse Signed-off-by: Ulf Samuelsson --- common/soft_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') diff --git a/common/soft_i2c.c b/common/soft_i2c.c index 0f6e3a938d..c5d7e205e5 100644 --- a/common/soft_i2c.c +++ b/common/soft_i2c.c @@ -29,7 +29,7 @@ #ifdef CONFIG_MPC8260 /* only valid for MPC8260 */ #include #endif -#ifdef CONFIG_AT91RM9200DK /* need this for the at91rm9200dk */ +#ifdef CONFIG_AT91RM9200 /* need this for the at91rm9200 */ #include #include #endif -- cgit v1.2.1 From 073e1b509980cefe6f53c2d7fbbcd135df1e3924 Mon Sep 17 00:00:00 2001 From: Andy Fleming Date: Tue, 14 Aug 2007 10:32:59 -0500 Subject: Fix initrd/dtb interaction The original code would wrongly relocate the blob to be right before the initrd if it existed. The blob *must* be within CFG_BOOTMAPSZ, if it is defined. So we make two changes: 1) flag the blob for relocation whenever its address is above BOOTMAPSZ 2) If the blob is being relocated, relocate it before kbd, not initrd Signed-off-by: Andy Fleming --- common/cmd_bootm.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'common') diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index e19f83e48a..8249dceb4e 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -924,6 +924,15 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, initrd_end = 0; } +#ifdef CFG_BOOTMAPSZ + /* + * The blob must be within CFG_BOOTMAPSZ, + * so we flag it to be copied if it is + */ + if (of_flat_tree >= (char *)CFG_BOOTMAPSZ) + of_data = of_flat_tree; +#endif + #if defined(CONFIG_OF_LIBFDT) /* move of_flat_tree if needed */ if (of_data) { @@ -931,11 +940,9 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, ulong of_start, of_len; of_len = be32_to_cpu(fdt_totalsize(of_data)); - /* position on a 4K boundary before the initrd/kbd */ - if (initrd_start) - of_start = initrd_start - of_len; - else - of_start = (ulong)kbd - of_len; + + /* position on a 4K boundary before the kbd */ + of_start = (ulong)kbd - of_len; of_start &= ~(4096 - 1); /* align on page */ debug ("## device tree at 0x%08lX ... 0x%08lX (len=%ld=0x%lX)\n", of_data, of_data + of_len - 1, of_len, of_len); @@ -983,11 +990,9 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, if (of_data) { ulong of_start, of_len; of_len = ((struct boot_param_header *)of_data)->totalsize; + /* provide extra 8k pad */ - if (initrd_start) - of_start = initrd_start - of_len - 8192; - else - of_start = (ulong)kbd - of_len - 8192; + of_start = (ulong)kbd - of_len - 8192; of_start &= ~(4096 - 1); /* align on page */ debug ("## device tree at 0x%08lX ... 0x%08lX (len=%ld=0x%lX)\n", of_data, of_data + of_len - 1, of_len, of_len); -- cgit v1.2.1