diff mbox

[U-Boot,1/8] include/config_fallbacks.h: add default for CONFIG_SYS_CBSIZE

Message ID 20170823205906.20933-2-thomas.petazzoni@free-electrons.com
State Accepted
Commit 72f09606d80f6786ae7f20f4b0e621ddb576302e
Delegated to: Tom Rini
Headers show

Commit Message

Thomas Petazzoni Aug. 23, 2017, 8:58 p.m. UTC
CONFIG_SYS_CBSIZE contains the buffer size for input for the
console. The vast majority of platforms define them to some reasonable
value (256, 512 or 1024 bytes), and it is quite annoying to repeat
this definition for all platforms while it isn't really HW-related.

Therefore, let's provide a sane fallback value in config_fallbacks.h,
so that platforms can rely on it instead of having to explicitly
define it.

We use 1024 when KGDB is enabled, and 256 otherwise, which is what the
majority of the platforms are doing.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 include/config_fallbacks.h | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Tom Rini Aug. 25, 2017, 1:12 a.m. UTC | #1
On Wed, Aug 23, 2017 at 10:58:59PM +0200, Thomas Petazzoni wrote:

> CONFIG_SYS_CBSIZE contains the buffer size for input for the
> console. The vast majority of platforms define them to some reasonable
> value (256, 512 or 1024 bytes), and it is quite annoying to repeat
> this definition for all platforms while it isn't really HW-related.
> 
> Therefore, let's provide a sane fallback value in config_fallbacks.h,
> so that platforms can rely on it instead of having to explicitly
> define it.
> 
> We use 1024 when KGDB is enabled, and 256 otherwise, which is what the
> majority of the platforms are doing.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Reviewed-by: Tom Rini <trini@konsulko.com>
Tom Rini Sept. 4, 2017, 12:41 a.m. UTC | #2
On Wed, Aug 23, 2017 at 10:58:59PM +0200, Thomas Petazzoni wrote:

> CONFIG_SYS_CBSIZE contains the buffer size for input for the
> console. The vast majority of platforms define them to some reasonable
> value (256, 512 or 1024 bytes), and it is quite annoying to repeat
> this definition for all platforms while it isn't really HW-related.
> 
> Therefore, let's provide a sane fallback value in config_fallbacks.h,
> so that platforms can rely on it instead of having to explicitly
> define it.
> 
> We use 1024 when KGDB is enabled, and 256 otherwise, which is what the
> majority of the platforms are doing.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/include/config_fallbacks.h b/include/config_fallbacks.h
index 961a83d..f9461f0 100644
--- a/include/config_fallbacks.h
+++ b/include/config_fallbacks.h
@@ -71,6 +71,15 @@ 
 #define CONFIG_LIB_RAND
 #endif
 
+/* Console I/O Buffer Size */
+#ifndef CONFIG_SYS_CBSIZE
+#if defined(CONFIG_CMD_KGDB)
+#define CONFIG_SYS_CBSIZE	1024
+#else
+#define CONFIG_SYS_CBSIZE	256
+#endif
+#endif
+
 #ifndef CONFIG_SYS_PBSIZE
 #define CONFIG_SYS_PBSIZE	(CONFIG_SYS_CBSIZE + 128)
 #endif