[U-Boot-Users] [PATCH 02/25] include/configs: Use new CONFIG_CMD_* in 82xx board config files.

Signed-off-by: Jon Loeliger jdl@freescale.com --- include/configs/MPC8260ADS.h | 90 +++++++++++++++++++++-------------------- include/configs/MPC8266ADS.h | 70 +++++++++++++++++---------------- 2 files changed, 82 insertions(+), 78 deletions(-)
diff --git a/include/configs/MPC8260ADS.h b/include/configs/MPC8260ADS.h index 6195bca..aaecd38 100644 --- a/include/configs/MPC8260ADS.h +++ b/include/configs/MPC8260ADS.h @@ -198,59 +198,61 @@
#define CONFIG_BAUDRATE 115200
-#define CFG_EXCLUDE CFG_CMD_BEDBUG | \ - CFG_CMD_BMP | \ - CFG_CMD_BSP | \ - CFG_CMD_DATE | \ - CFG_CMD_DISPLAY | \ - CFG_CMD_DOC | \ - CFG_CMD_DTT | \ - CFG_CMD_EEPROM | \ - CFG_CMD_ELF | \ - CFG_CMD_EXT2 | \ - CFG_CMD_FAT | \ - CFG_CMD_FDC | \ - CFG_CMD_FDOS | \ - CFG_CMD_HWFLOW | \ - CFG_CMD_IDE | \ - CFG_CMD_KGDB | \ - CFG_CMD_MMC | \ - CFG_CMD_NAND | \ - CFG_CMD_PCMCIA | \ - CFG_CMD_REISER | \ - CFG_CMD_SCSI | \ - CFG_CMD_SPI | \ - CFG_CMD_SNTP | \ - CFG_CMD_UNIVERSE | \ - CFG_CMD_USB | \ - CFG_CMD_VFD | \ - CFG_CMD_XIMG +/* + * Command line configuration. + */ +#include <config_cmd_all.h> + +#undef CONFIG_CMD_BEDBUG +#undef CONFIG_CMD_BMP +#undef CONFIG_CMD_BSP +#undef CONFIG_CMD_DATE +#undef CONFIG_CMD_DISPLAY +#undef CONFIG_CMD_DOC +#undef CONFIG_CMD_DTT +#undef CONFIG_CMD_EEPROM +#undef CONFIG_CMD_ELF +#undef CONFIG_CMD_EXT2 +#undef CONFIG_CMD_FAT +#undef CONFIG_CMD_FDC +#undef CONFIG_CMD_FDOS +#undef CONFIG_CMD_HWFLOW +#undef CONFIG_CMD_IDE +#undef CONFIG_CMD_KGDB +#undef CONFIG_CMD_MMC +#undef CONFIG_CMD_NAND +#undef CONFIG_CMD_PCMCIA +#undef CONFIG_CMD_REISER +#undef CONFIG_CMD_SCSI +#undef CONFIG_CMD_SPI +#undef CONFIG_CMD_SNTP +#undef CONFIG_CMD_UNIVERSE +#undef CONFIG_CMD_USB +#undef CONFIG_CMD_VFD +#undef CONFIG_CMD_XIMG
#if CONFIG_ADSTYPE == CFG_8272ADS -#define CONFIG_COMMANDS (CFG_CMD_ALL & ~( \ - CFG_CMD_SDRAM | \ - CFG_CMD_I2C | \ - CFG_EXCLUDE ) ) + #undef CONFIG_CMD_SDRAM + #undef CONFIG_CMD_I2C + #elif CONFIG_ADSTYPE >= CFG_PQ2FADS -#define CONFIG_COMMANDS (CFG_CMD_ALL & ~( \ - CFG_CMD_SDRAM | \ - CFG_CMD_I2C | \ - CFG_CMD_PCI | \ - CFG_EXCLUDE ) ) + #undef CONFIG_CMD_SDRAM + #undef CONFIG_CMD_I2C + #undef CONFIG_CMD_PCI + #else -#define CONFIG_COMMANDS (CFG_CMD_ALL & ~( \ - CMD_CFG_PCI | \ - CFG_EXCLUDE ) ) + #undef CONFIG_CMD_PCI + #endif /* CONFIG_ADSTYPE >= CFG_PQ2FADS */
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */ -#include <cmd_confdefs.h> + +
#define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */ #define CONFIG_BOOTCOMMAND "bootm fff80000" /* autoboot command */ #define CONFIG_BOOTARGS "root=/dev/mtdblock2"
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB) +#if defined(CONFIG_CMD_KGDB) #undef CONFIG_KGDB_ON_SMC /* define if kgdb on SMC */ #define CONFIG_KGDB_ON_SCC /* define if kgdb on SCC */ #undef CONFIG_KGDB_NONE /* define if kgdb on something else */ @@ -268,7 +270,7 @@ #define CFG_PROMPT_HUSH_PS2 "> " #define CFG_LONGHELP /* undef to save memory */ #define CFG_PROMPT "=> " /* Monitor Command Prompt */ -#if (CONFIG_COMMANDS & CFG_CMD_KGDB) +#if defined(CONFIG & CFG_CMD_KGDB) #define CFG_CBSIZE 1024 /* Console I/O Buffer Size */ #else #define CFG_CBSIZE 256 /* Console I/O Buffer Size */ @@ -384,7 +386,7 @@ #endif /* CFG_RAMBOOT */
#define CFG_CACHELINE_SIZE 32 /* For MPC8260 CPU */ -#if (CONFIG_COMMANDS & CFG_CMD_KGDB) +#if defined(CONFIG_CMD_KGDB) # define CFG_CACHELINE_SHIFT 5 /* log base 2 of the above value */ #endif
diff --git a/include/configs/MPC8266ADS.h b/include/configs/MPC8266ADS.h index 4953b70..d6dd73b 100644 --- a/include/configs/MPC8266ADS.h +++ b/include/configs/MPC8266ADS.h @@ -146,35 +146,39 @@ #define CONFIG_BAUDRATE 115200
-#define CONFIG_COMMANDS ( CFG_CMD_ALL & ~( \ - CFG_CMD_BEDBUG | \ - CFG_CMD_BMP | \ - CFG_CMD_BSP | \ - CFG_CMD_DATE | \ - CFG_CMD_DHCP | \ - CFG_CMD_DISPLAY | \ - CFG_CMD_DOC | \ - CFG_CMD_DTT | \ - CFG_CMD_EEPROM | \ - CFG_CMD_ELF | \ - CFG_CMD_EXT2 | \ - CFG_CMD_FDC | \ - CFG_CMD_FDOS | \ - CFG_CMD_HWFLOW | \ - CFG_CMD_IDE | \ - CFG_CMD_JFFS2 | \ - CFG_CMD_KGDB | \ - CFG_CMD_MMC | \ - CFG_CMD_NAND | \ - CFG_CMD_PCMCIA | \ - CFG_CMD_REISER | \ - CFG_CMD_SCSI | \ - CFG_CMD_SPI | \ - CFG_CMD_SNTP | \ - CFG_CMD_VFD | \ - CFG_CMD_UNIVERSE | \ - CFG_CMD_USB | \ - CFG_CMD_XIMG ) ) +/* + * Command line configuration. + */ +#include <config_cmd_all.h> + +#undef CONFIG_CMD_BEDBUG +#undef CONFIG_CMD_BMP +#undef CONFIG_CMD_BSP +#undef CONFIG_CMD_DATE +#undef CONFIG_CMD_DHCP +#undef CONFIG_CMD_DISPLAY +#undef CONFIG_CMD_DOC +#undef CONFIG_CMD_DTT +#undef CONFIG_CMD_EEPROM +#undef CONFIG_CMD_ELF +#undef CONFIG_CMD_EXT2 +#undef CONFIG_CMD_FDC +#undef CONFIG_CMD_FDOS +#undef CONFIG_CMD_HWFLOW +#undef CONFIG_CMD_IDE +#undef CONFIG_CMD_JFFS2 +#undef CONFIG_CMD_KGDB +#undef CONFIG_CMD_MMC +#undef CONFIG_CMD_NAND +#undef CONFIG_CMD_PCMCIA +#undef CONFIG_CMD_REISER +#undef CONFIG_CMD_SCSI +#undef CONFIG_CMD_SPI +#undef CONFIG_CMD_SNTP +#undef CONFIG_CMD_VFD +#undef CONFIG_CMD_UNIVERSE +#undef CONFIG_CMD_USB +#undef CONFIG_CMD_XIMG
/* Define a command string that is automatically executed when no character * is read on the console interface withing "Boot Delay" after reset. @@ -210,13 +214,11 @@ CONFIG_BOOTP_BOOTFILESIZE | \ CONFIG_BOOTP_DNS)
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */ -#include <cmd_confdefs.h>
#define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB) +#if defined(CONFIG_CMD_KGDB) #undef CONFIG_KGDB_ON_SMC /* define if kgdb on SMC */ #define CONFIG_KGDB_ON_SCC /* define if kgdb on SCC */ #undef CONFIG_KGDB_NONE /* define if kgdb on something else */ @@ -231,7 +233,7 @@ */ #define CFG_LONGHELP /* undef to save memory */ #define CFG_PROMPT "=> " /* Monitor Command Prompt */ -#if (CONFIG_COMMANDS & CFG_CMD_KGDB) +#if defined(CONFIG_CMD_KGDB) #define CFG_CBSIZE 1024 /* Console I/O Buffer Size */ #else #define CFG_CBSIZE 256 /* Console I/O Buffer Size */ @@ -452,7 +454,7 @@
#define CFG_CACHELINE_SIZE 32 /* For MPC8260 CPU */ -#if (CONFIG_COMMANDS & CFG_CMD_KGDB) +#if defined(CONFIG_CMD_KGDB) # define CFG_CACHELINE_SHIFT 5 /* log base 2 of the above value */ #endif

Jon Loeliger wrote:
Signed-off-by: Jon Loeliger jdl@freescale.com
include/configs/MPC8260ADS.h | 90 +++++++++++++++++++++-------------------- include/configs/MPC8266ADS.h | 70 +++++++++++++++++---------------- 2 files changed, 82 insertions(+), 78 deletions(-)
diff --git a/include/configs/MPC8260ADS.h b/include/configs/MPC8260ADS.h index 6195bca..aaecd38 100644 --- a/include/configs/MPC8260ADS.h +++ b/include/configs/MPC8260ADS.h @@ -198,59 +198,61 @@
#define CONFIG_BAUDRATE 115200
-#define CFG_EXCLUDE CFG_CMD_BEDBUG | \
CFG_CMD_BMP | \
CFG_CMD_BSP | \
CFG_CMD_DATE | \
CFG_CMD_DISPLAY | \
CFG_CMD_DOC | \
CFG_CMD_DTT | \
CFG_CMD_EEPROM | \
CFG_CMD_ELF | \
CFG_CMD_EXT2 | \
CFG_CMD_FAT | \
CFG_CMD_FDC | \
CFG_CMD_FDOS | \
CFG_CMD_HWFLOW | \
CFG_CMD_IDE | \
CFG_CMD_KGDB | \
CFG_CMD_MMC | \
CFG_CMD_NAND | \
CFG_CMD_PCMCIA | \
CFG_CMD_REISER | \
CFG_CMD_SCSI | \
CFG_CMD_SPI | \
CFG_CMD_SNTP | \
CFG_CMD_UNIVERSE | \
CFG_CMD_USB | \
CFG_CMD_VFD | \
CFG_CMD_XIMG
+/*
- Command line configuration.
- */
+#include <config_cmd_all.h>
+#undef CONFIG_CMD_BEDBUG +#undef CONFIG_CMD_BMP +#undef CONFIG_CMD_BSP +#undef CONFIG_CMD_DATE +#undef CONFIG_CMD_DISPLAY +#undef CONFIG_CMD_DOC +#undef CONFIG_CMD_DTT +#undef CONFIG_CMD_EEPROM +#undef CONFIG_CMD_ELF +#undef CONFIG_CMD_EXT2 +#undef CONFIG_CMD_FAT +#undef CONFIG_CMD_FDC +#undef CONFIG_CMD_FDOS +#undef CONFIG_CMD_HWFLOW +#undef CONFIG_CMD_IDE +#undef CONFIG_CMD_KGDB +#undef CONFIG_CMD_MMC +#undef CONFIG_CMD_NAND +#undef CONFIG_CMD_PCMCIA +#undef CONFIG_CMD_REISER +#undef CONFIG_CMD_SCSI +#undef CONFIG_CMD_SPI +#undef CONFIG_CMD_SNTP +#undef CONFIG_CMD_UNIVERSE +#undef CONFIG_CMD_USB +#undef CONFIG_CMD_VFD +#undef CONFIG_CMD_XIMG
This isn't your fault, Jon, but the command definition methodology in the 82xx is Very Very Bad[tm].
It is defining *ALL* commands and then selectively undefining specific ones. I tried to rebuild for my 8272ADS board and noticed the build broke because someone added a command which was incompatible with it, and the above methodology picked up the new command by default.
BAD. VERY VERY BAD.
$ grep -l CMD_ALL * acadia.h ADNPESC1.h DK1C20.h DK1S10.h ep8260.h hymod.h LANTEC.h MPC8260ADS.h MPC8266ADS.h RBC823.h RPXClassic.h
I added "fix stupid command configuration" to my job jar, but my job jar is pretty full. :-( If someone else has an empty job jar (yeah, that was a joke ;-) and incentive, this would be a profitable cleanup. I contend that the proper configuration would be to use the "normal" command configuration and then add whatever missing "abnormal" ;-) commands are desired. This is a much safer and saner way.
Is there a good reason to have an config_cmd_all.h "all commands" definition? If not, I propose we remove it and _properly_ fix the breakage that ensues.
I would further propose that, assuming Jon is willing, he be authorized to fix the above listed boards with wrongly configured command sets by simply setting their command set to the "normal" command set. If someone is interested in refining the command set back to the original configuration, that someone can submit a patch to do a proper addition/subtraction after Jon fixes the obvious brokenness.
gvb P.S. Sorry for volunteering you, Jon. Keep up the good work. :-)

So, like, the other day Jerry Van Baren mumbled:
+/*
- Command line configuration.
- */
+#include <config_cmd_all.h>
+#undef CONFIG_CMD_BEDBUG +#undef CONFIG_CMD_BMP +#undef CONFIG_CMD_BSP
...
This isn't your fault, Jon, but the command definition methodology in the 82xx is Very Very Bad[tm].
Um, yeah, I saw that too. :-)
It is defining *ALL* commands and then selectively undefining specific ones. I tried to rebuild for my 8272ADS board and noticed the build broke because someone added a command which was incompatible with it, and the above methodology picked up the new command by default.
BAD. VERY VERY BAD.
So, I've been pretty faithful in following the command selection that is already in the board files so far. As you have noticed, one of the effects of this work is that we get to more easily identify, um, oportunities for improvment...
And yes, I am absolutely relying on _other_ people to test this set of changes! I've been checking some of the PowerPC boards, but that's really all I can do here...
I added "fix stupid command configuration" to my job jar, but my job jar is pretty full. :-( If someone else has an empty job jar (yeah, that was a joke ;-) and incentive, this would be a profitable cleanup. I contend that the proper configuration would be to use the "normal" command configuration and then add whatever missing "abnormal" ;-) commands are desired. This is a much safer and saner way.
Right. My plan is this:
1) Continue with the remaining board config files I've not converted yet. 2) Drink. 3) Remove uses of CONFIG_COMMAND from the _entire_ rest of the code base. 4) Drink. 5) Cleanup stragglers, fix typos (!), READMEs, etc. 6) Profit.
I would encourage folks to read through their favorite config files in the testing tree and make sure it is sane, compiles, or even boots. If you want to then fix stuff, please submit it against "testing" so we can be pretty sure it is working there before pulling it into the mainline repo.
Is there a good reason to have an config_cmd_all.h "all commands" definition? If not, I propose we remove it and _properly_ fix the breakage that ensues.
I'm not convinced there is, long term. However, like I said, I am currently doing the straight-forward conversion right now. We can (and should) fix the fallout. I am in favor of removing the "config_cmd_all.h" file. That would be step 5), above.
I would further propose that, assuming Jon is willing, he be authorized to fix the above listed boards with wrongly configured command sets by simply setting their command set to the "normal" command set.
And in the meantime, patches against the testing repo are welcome too!
gvb P.S. Sorry for volunteering you, Jon. Keep up the good work. :-)
I hear you. :-)
jdl

Jon Loeliger wrote:
So, like, the other day Jerry Van Baren mumbled:
+/*
- Command line configuration.
- */
+#include <config_cmd_all.h>
+#undef CONFIG_CMD_BEDBUG +#undef CONFIG_CMD_BMP +#undef CONFIG_CMD_BSP
...
This isn't your fault, Jon, but the command definition methodology in the 82xx is Very Very Bad[tm].
Um, yeah, I saw that too. :-)
It is defining *ALL* commands and then selectively undefining specific ones. I tried to rebuild for my 8272ADS board and noticed the build broke because someone added a command which was incompatible with it, and the above methodology picked up the new command by default.
BAD. VERY VERY BAD.
So, I've been pretty faithful in following the command selection that is already in the board files so far. As you have noticed, one of the effects of this work is that we get to more easily identify, um, oportunities for improvment...
And yes, I am absolutely relying on _other_ people to test this set of changes! I've been checking some of the PowerPC boards, but that's really all I can do here...
I added "fix stupid command configuration" to my job jar, but my job jar is pretty full. :-( If someone else has an empty job jar (yeah, that was a joke ;-) and incentive, this would be a profitable cleanup. I contend that the proper configuration would be to use the "normal" command configuration and then add whatever missing "abnormal" ;-) commands are desired. This is a much safer and saner way.
Right. My plan is this:
1) Continue with the remaining board config files I've not converted yet. 2) Drink. 3) Remove uses of CONFIG_COMMAND from the _entire_ rest of the code base. 4) Drink. 5) Cleanup stragglers, fix typos (!), READMEs, etc. 6) Profit.
I would encourage folks to read through their favorite config files in the testing tree and make sure it is sane, compiles, or even boots. If you want to then fix stuff, please submit it against "testing" so we can be pretty sure it is working there before pulling it into the mainline repo.
Is there a good reason to have an config_cmd_all.h "all commands" definition? If not, I propose we remove it and _properly_ fix the breakage that ensues.
I'm not convinced there is, long term. However, like I said, I am currently doing the straight-forward conversion right now. We can (and should) fix the fallout. I am in favor of removing the "config_cmd_all.h" file. That would be step 5), above.
I would further propose that, assuming Jon is willing, he be authorized to fix the above listed boards with wrongly configured command sets by simply setting their command set to the "normal" command set.
And in the meantime, patches against the testing repo are welcome too!
gvb P.S. Sorry for volunteering you, Jon. Keep up the good work. :-)
I hear you. :-)
jdl
ACK on the "all commands" cleanup being part of Step 5. My proposal would short-circuit the orderly process. :-(
gvb P.S. I'll split the work with you, I'll do the even steps and you can do the odd steps. ;-)
participants (2)
-
Jerry Van Baren
-
Jon Loeliger