Skip to contentSkip to conversation

powerpc/mpc8xxx: Move HWCONFIG_BUFFER_SIZE into config.h

PATCH New York Sun 1 participant 1 message Sep 7, 2012 PowerPC

lore
Share & tools
lore

York Sun

author
#0 lore raw

PATCH v2 1/1 powerpc/mpc8xxx: Move HWCONFIG_BUFFER_SIZE into config.h

Before proper environment is setup, we extract hwconfig and put it into a buffer with size HWCONFIG_BUFFER_SIZE. We need to enlarge the buffer to accommodate longer string. Since this macro is used in multiple files, we move it into arch/powerpc/include/asm/config.h.

---
Change since v1:
Move HWCONFIG_BUFFER_SIZE under #ifdef

 arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c |    2 --
 arch/powerpc/cpu/mpc8xxx/ddr/options.c        |    1 -
 arch/powerpc/include/asm/config.h             |    8 ++++++++
 3 files changed, 8 insertions(+), 3 deletions(-)
arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c +0 -2
index 4b52dad..ef4ce09 100644
@@ -46,8 +46,6 @@
 
 static u32 serdes_prtcl_map;
 
-#define HWCONFIG_BUFFER_SIZE	128
-
 #ifdef DEBUG
 static const char *serdes_prtcl_str[] = {
 	[NONE] = "NA",
arch/powerpc/cpu/mpc8xxx/ddr/options.c +0 -1
index 00ec57b..24c8a51 100644
@@ -19,7 +19,6 @@
  * This is pretty fragile on both the use of stack and if the buffer is big
  * enough. However we will get a warning from getenv_f for the later.
  */
-#define HWCONFIG_BUFFER_SIZE	128
 
 /* Board-specific functions defined in each board's ddr.c */
 extern void fsl_ddr_board_options(memctl_options_t *popts,
arch/powerpc/include/asm/config.h +8 -0
index d138636..5038195 100644
@@ -29,6 +29,14 @@
 #include <asm/config_mpc86xx.h>
 #endif
 
+#if	defined(CONFIG_MPC85xx) || \
+	defined(CONFIG_MPC86xx) || \
+	defined(CONFIG_MPC83xx)
+#ifndef HWCONFIG_BUFFER_SIZE
+  #define HWCONFIG_BUFFER_SIZE 256
+#endif
+#endif
+
 /* CONFIG_HARD_SPI triggers SPI bus initialization in PowerPC */
 #if defined(CONFIG_MPC8XXX_SPI) || defined(CONFIG_FSL_ESPI)
 # ifndef CONFIG_HARD_SPI
Signature · 1 line
1.7.9.5