Skip to contentSkip to conversation

hwconfig: Move HWCONFIG_BUFFER_SIZE into hwconfig.h

PATCH New York Sun 3 participants 5 messages Aug 16, 2012 – Sep 4, 2012 PowerPC

lore
Share & tools
lore

York Sun

author
#0 lore raw

PATCH 1/1 hwconfig: Move HWCONFIG_BUFFER_SIZE into hwconfig.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 hwconfig.h.

---

 arch/powerpc/cpu/mpc85xx/cpu_init.c           |    2 --
 arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c |    2 --
 arch/powerpc/cpu/mpc8xxx/ddr/options.c        |    1 -
 include/hwconfig.h                            |    2 ++
 4 files changed, 2 insertions(+), 5 deletions(-)
arch/powerpc/cpu/mpc85xx/cpu_init.c +0 -2
index c13c45f..2397547 100644
@@ -56,8 +56,6 @@
 
 #include "../../../../drivers/block/fsl_sata.h"
 
-#define HWCONFIG_BUFFER_SIZE 128
-
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_SECURE_BOOT
arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c +0 -2
index 9300e7f..69399aa 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,
include/hwconfig.h +2 -0
index a037ed8..64861c4 100644
@@ -18,6 +18,8 @@
 #include <linux/types.h>
 #include <asm/errno.h>
 
+#define HWCONFIG_BUFFER_SIZE 256
+
 #ifdef CONFIG_HWCONFIG
 
 extern int hwconfig_f(const char *opt, char *buf);
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 1/1 hwconfig: Move HWCONFIG_BUFFER_SIZE into hwconfig.h

Quoted 5 lines · York Sun

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 hwconfig.h.

Quoted 8 lines

---

arch/powerpc/cpu/mpc85xx/cpu_init.c           |    2 --
arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c |    2 --
arch/powerpc/cpu/mpc8xxx/ddr/options.c        |    1 -
include/hwconfig.h                            |    2 ++
4 files changed, 2 insertions(+), 5 deletions(-)

1. I don't think HWCONFIG_BUFFER_SIZE should be getting set in include/hwconfig.h, this is unique to FSL 8xxx usage not to hwconfig
2. if you are doing to something like this it should be:

	#ifndef CONFIG_HWCONFIG_BUFFER_SIZE
	  #define CONFIG_HWCONFIG_BUFFER_SIZE 128
	#endif

This allowing a board port to set it as needed.

- k

Quoted 60 lines
arch/powerpc/cpu/mpc85xx/cpu_init.c +0 -2
index c13c45f..2397547 100644
@@ -56,8 +56,6 @@
 
 #include "../../../../drivers/block/fsl_sata.h"
 
-#define HWCONFIG_BUFFER_SIZE 128
-
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_SECURE_BOOT
arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c +0 -2
index 9300e7f..69399aa 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,
include/hwconfig.h +2 -0
index a037ed8..64861c4 100644
@@ -18,6 +18,8 @@
 #include <linux/types.h>
 #include <asm/errno.h>
 
+#define HWCONFIG_BUFFER_SIZE 256
+
 #ifdef CONFIG_HWCONFIG
 
 extern int hwconfig_f(const char *opt, char *buf);
Signature · 7 lines
1.7.0.4


_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
author
#2 lore raw

PATCH 1/1 hwconfig: Move HWCONFIG_BUFFER_SIZE into hwconfig.h

Quoted 10 lines · Kumar Gala
Quoted 8 lines · York Sun

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 hwconfig.h.

---

Quoted 7 lines
Quoted 5 lines
arch/powerpc/cpu/mpc85xx/cpu_init.c           |    2 --
arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c |    2 --
arch/powerpc/cpu/mpc8xxx/ddr/options.c        |    1 -
include/hwconfig.h                            |    2 ++
4 files changed, 2 insertions(+), 5 deletions(-)

1. I don't think HWCONFIG_BUFFER_SIZE should be getting set in include/hwconfig.h, this is unique to FSL 8xxx usage not to hwconfig

If no one else uses this feature, I can move it to arch/powerpc/include/asm/config.h. How about that?

Quoted 8 lines

2. if you are doing to something like this it should be:

	#ifndef CONFIG_HWCONFIG_BUFFER_SIZE
	  #define CONFIG_HWCONFIG_BUFFER_SIZE 128
	#endif

This allowing a board port to set it as needed.

This is a good idea. Will do.

York

#3 lore raw

PATCH 1/1 hwconfig: Move HWCONFIG_BUFFER_SIZE into hwconfig.h

Dear York Sun,

Quoted 17 lines · In message <1345226412.6510.38.camel@oslab-l1> you wrote:
Quoted 16 lines · Kumar Gala
Quoted 13 lines · York Sun

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 hwconfig.h.

---

arch/powerpc/cpu/mpc85xx/cpu_init.c           |    2 --
arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c |    2 --
arch/powerpc/cpu/mpc8xxx/ddr/options.c        |    1 -
include/hwconfig.h                            |    2 ++
4 files changed, 2 insertions(+), 5 deletions(-)
Quoted 4 lines
Quoted 1 line

1. I don't think HWCONFIG_BUFFER_SIZE should be getting set in include/hwconfig.h, this is unique to FSL 8xxx usage not to hwconfig

If no one else uses this feature, I can move it to arch/powerpc/include/asm/config.h. How about that?

I cannot see in which way arch/powerpc/include/asm/config.h would be more FSL 8xxx specific ?

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The average woman would rather have beauty than brains,  because  the
average man can see better than he can think.
author
#4 lore raw

PATCH 1/1 hwconfig: Move HWCONFIG_BUFFER_SIZE into hwconfig.h

Quoted 20 lines · Wolfgang Denk

Dear York Sun,

Quoted 17 lines · In message <1345226412.6510.38.camel@oslab-l1> you wrote:
Quoted 16 lines · Kumar Gala
Quoted 13 lines · York Sun

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 hwconfig.h.

---

arch/powerpc/cpu/mpc85xx/cpu_init.c           |    2 --
arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c |    2 --
arch/powerpc/cpu/mpc8xxx/ddr/options.c        |    1 -
include/hwconfig.h                            |    2 ++
4 files changed, 2 insertions(+), 5 deletions(-)
Quoted 8 lines
Quoted 4 lines
Quoted 1 line

1. I don't think HWCONFIG_BUFFER_SIZE should be getting set in include/hwconfig.h, this is unique to FSL 8xxx usage not to hwconfig

If no one else uses this feature, I can move it to arch/powerpc/include/asm/config.h. How about that?

I cannot see in which way arch/powerpc/include/asm/config.h would be more FSL 8xxx specific ?

I can put it within

#if defined(CONFIG_MPC85xx) || \
     defined(CONFIG_MPC83xx) || \
     defined(CONFIG_MPC86xx)

#ednif

How about that?

York