[U-Boot] [PATCH 03/28] Convert CONSOLE_PRE_CONSOLE_BUFFER options to Kconfig
Tom Rini
trini at konsulko.com
Fri Sep 23 21:58:09 CEST 2016
On Mon, Sep 19, 2016 at 04:32:47PM -0600, Simon Glass wrote:
> Move these option to Kconfig and tidy up existing uses.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
> README | 17 -----------------
> board/sunxi/Kconfig | 11 +++++++++++
> common/Kconfig | 40 +++++++++++++++++++++++++++++++++++++++
> common/console.c | 6 +++---
> configs/tbs2910_defconfig | 3 +++
> include/asm-generic/global_data.h | 2 +-
> include/configs/sunxi-common.h | 6 ------
> include/configs/tbs2910.h | 4 ----
> scripts/config_whitelist.txt | 3 ---
> 9 files changed, 58 insertions(+), 34 deletions(-)
>
> diff --git a/README b/README
> index 1b6f8ec..26a53e2 100644
> --- a/README
> +++ b/README
> @@ -872,23 +872,6 @@ The following options need to be configured:
> must be defined, to setup the maximum idle timeout for
> the SMC.
>
> -- Pre-Console Buffer:
> - Prior to the console being initialised (i.e. serial UART
> - initialised etc) all console output is silently discarded.
> - Defining CONFIG_PRE_CONSOLE_BUFFER will cause U-Boot to
> - buffer any console messages prior to the console being
> - initialised to a buffer of size CONFIG_PRE_CON_BUF_SZ
> - bytes located at CONFIG_PRE_CON_BUF_ADDR. The buffer is
> - a circular buffer, so if more than CONFIG_PRE_CON_BUF_SZ
> - bytes are output before the console is initialised, the
> - earlier bytes are discarded.
> -
> - Note that when printing the buffer a copy is made on the
> - stack so CONFIG_PRE_CON_BUF_SZ must fit on the stack.
> -
> - 'Sane' compilers will generate smaller code if
> - CONFIG_PRE_CON_BUF_SZ is a power of 2
> -
> - Autoboot Command:
> CONFIG_BOOTCOMMAND
> Only needed when CONFIG_BOOTDELAY is enabled;
> diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
> index 79f644a..9954f0a 100644
> --- a/board/sunxi/Kconfig
> +++ b/board/sunxi/Kconfig
> @@ -1,5 +1,11 @@
> if ARCH_SUNXI
>
> +config PRE_CONSOLE_BUFFER
> + default y
> +
> +config PRE_CON_BUF_SZ
> + default 4096
> +
> config SPL_GPIO_SUPPORT
> default y
>
> @@ -21,6 +27,7 @@ config SPL_POWER_SUPPORT
> config SPL_SERIAL_SUPPORT
> default y
>
> +config PRE_CONSOLE_BUFFER
> # Note only one of these may be selected at a time! But hidden choices are
> # not supported by Kconfig
> config SUNXI_GEN_SUN4I
> @@ -121,6 +128,10 @@ config MACH_SUN50I
>
> endchoice
>
> +config PRE_CON_BUF_ADDR
> + default 0x2f000000 if MACH_SUN9I
> + default 0x4f000000 if !MACH_SUN9I
I think we should move these two over to common/Kconfig
> +
> # The sun8i SoCs share a lot, this helps to avoid a lot of "if A23 || A33"
> config MACH_SUN8I
> bool
> diff --git a/common/Kconfig b/common/Kconfig
> index 20f34bb..3ecb589 100644
> --- a/common/Kconfig
> +++ b/common/Kconfig
> @@ -241,6 +241,46 @@ config SILENT_CONSOLE_UPDATE_ON_RELOC
> (e.g. NAND). This option makes the value of the 'silent'
> environment variable take effect at relocation.
>
> +config PRE_CONSOLE_BUFFER
> + bool "Buffer characters before the console is available"
> + help
> + Prior to the console being initialised (i.e. serial UART
> + initialised etc) all console output is silently discarded.
> + Defining CONFIG_PRE_CONSOLE_BUFFER will cause U-Boot to
> + buffer any console messages prior to the console being
> + initialised to a buffer. The buffer is a circular buffer, so
> + if it overflows, earlier output is discarded.
> +
> + Note that this is not currently supported in SPL. It would be
> + useful to be able to share the pre-console buffer with SPL.
> +
> +config PRE_CON_BUF_SZ
> + hex "Sets the size of the pre-console buffer"
> + depends on PRE_CONSOLE_BUFFER
> + default 1024 if PRE_CONSOLE_BUFFER
Make this 4096, and we shouldn't need a conditional here if it already
depends on something else. Oh! And you're calling this hex and I think
everyone is using decimal values :)
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160923/de4d088c/attachment.sig>
More information about the U-Boot
mailing list