All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V4] console: Implement pre-console buffer
Date: Wed, 31 Aug 2011 09:58:38 -0700	[thread overview]
Message-ID: <CAPnjgZ1bMkN3xoNCqtg1CLMa=0rgpHsuyHyZg5yOkR3Hk+v+Bw@mail.gmail.com> (raw)
In-Reply-To: <1314795505-14321-1-git-send-email-graeme.russ@gmail.com>

Hi Graeme,

On Wed, Aug 31, 2011 at 5:58 AM, Graeme Russ <graeme.russ@gmail.com> wrote:
> Allow redirection of console output prior to console initialisation to a
> temporary buffer.
>
> To enable this functionality, the board configuration file must define:
> ?- CONFIG_PRE_CONSOLE_BUFFER - Enable pre-console buffer
> ?- CONFIG_PRE_CON_BUF_ADDR - Base address of pre-console buffer
> ?- CONFIG_PRE_CON_BUF_SZ - Size of pre-console buffer (in bytes)
>
> The pre-console buffer will buffer the last CONFIG_PRE_CON_BUF_SZ bytes
> Any earlier characters are silently dropped.
>
> Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
> ---
> Changes since V3
> ?- Fixed ?blank subject caused by gap between the Cc: list and Date:
>
> Changes since V2
> ?- Cast buffer size to unsigned long to help compilers produce tighter
> ? code
> ?- Use inline stub functions to reduce #ifdef clutter
> ?- Add documentation to README
>
> Changes Since V1
> ?- Implemented circular buffer
> ?- Trivial code styl corrections
>
> ?README ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?| ? 14 +++++++++
> ?arch/arm/include/asm/global_data.h ? ? ? ?| ? ?3 ++
> ?arch/avr32/include/asm/global_data.h ? ? ?| ? ?3 ++
> ?arch/blackfin/include/asm/global_data.h ? | ? ?3 ++
> ?arch/m68k/include/asm/global_data.h ? ? ? | ? ?3 ++
> ?arch/microblaze/include/asm/global_data.h | ? ?3 ++
> ?arch/mips/include/asm/global_data.h ? ? ? | ? ?3 ++
> ?arch/nios2/include/asm/global_data.h ? ? ?| ? ?3 ++
> ?arch/powerpc/include/asm/global_data.h ? ?| ? ?3 ++
> ?arch/sh/include/asm/global_data.h ? ? ? ? | ? ?3 ++
> ?arch/sparc/include/asm/global_data.h ? ? ?| ? ?3 ++
> ?arch/x86/include/asm/global_data.h ? ? ? ?| ? ?3 ++
> ?common/console.c ? ? ? ? ? ? ? ? ? ? ? ? ?| ? 43 +++++++++++++++++++++++++++-
> ?13 files changed, 88 insertions(+), 2 deletions(-)
>
> diff --git a/README b/README
> index 0886987..170e67b 100644
> --- a/README
> +++ b/README
> @@ -619,6 +619,20 @@ 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 cicular buffer, so if more than CONFIG_PRE_CON_BUF_SZ

nit: circular. Just a suggestion if you like: you could also offer
guidance for the location of the buffer, something like:

You can place the buffer at the top of memory by adding something like
this in your board config file:

#define CONFIG_PRE_CON_BUF_ADDR		(CONFIG_SYS_INIT_RAM_ADDR + \
					CONFIG_SYS_INIT_RAM_SIZE - \
					CONFIG_PRE_CON_BUF_SZ)
#define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_PRE_CON_BUF_ADDR - \
						GENERATED_GBL_DATA_SIZE)

> + ? ? ? ? ? ? ? ?bytes are output before the console is ?initialised, the
> + ? ? ? ? ? ? ? ?earlier bytes are discarded.
> +

Anyway:

Acked-by: Simon Glass <sjg@chromium.org>

Regards,
Simon

  parent reply	other threads:[~2011-08-31 16:58 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-29 12:14 [U-Boot] [PATCH 0/2] console: Squelch and pre-console buffer Graeme Russ
2011-08-29 12:14 ` [U-Boot] [PATCH 1/2] console: Squelch pre-console output in console functions Graeme Russ
2011-08-30 17:16   ` Mike Frysinger
2011-08-30 19:01     ` Wolfgang Denk
2011-09-21 23:21   ` Simon Glass
2011-10-01 19:54   ` Wolfgang Denk
2011-08-29 12:14 ` [U-Boot] [PATCH 2/2] console: Implement pre-console buffer Graeme Russ
2011-08-30 12:49   ` [U-Boot] [PATCH V2] " Graeme Russ
2011-08-30 17:19     ` Mike Frysinger
2011-08-30 19:45     ` Simon Glass
2011-08-30 19:52       ` Wolfgang Denk
2011-08-30 19:58         ` Mike Frysinger
2011-08-30 20:08           ` Wolfgang Denk
2011-08-30 20:18             ` Simon Glass
2011-08-30 20:57               ` Wolfgang Denk
2011-08-30 21:02                 ` Simon Glass
2011-08-30 23:00                   ` Graeme Russ
2011-08-30 23:39                     ` Graeme Russ
2011-08-31  2:46                       ` Mike Frysinger
2011-08-30 20:07         ` Simon Glass
2011-08-31 12:35     ` [U-Boot] (no subject) Graeme Russ
2011-08-31 12:38       ` Graeme Russ
2011-08-31 12:58       ` [U-Boot] [PATCH V4] console: Implement pre-console buffer Graeme Russ
2011-08-31 15:09         ` Mike Frysinger
2011-08-31 21:15           ` Graeme Russ
2011-08-31 21:33             ` Mike Frysinger
2011-08-31 21:59               ` Graeme Russ
2011-08-31 22:44                 ` Mike Frysinger
2011-08-31 22:51                   ` Graeme Russ
2011-08-31 16:58         ` Simon Glass [this message]
2011-08-31 19:18           ` Wolfgang Denk
2011-08-31 20:05             ` Simon Glass
2011-08-31 20:22               ` Mike Frysinger
2011-08-31 20:26                 ` Simon Glass
2011-09-01 10:48         ` [U-Boot] [PATCH V5] " Graeme Russ
2011-09-01 10:52           ` Graeme Russ
2011-09-01 14:02             ` Mike Frysinger
2011-09-01 18:51               ` Simon Glass
2011-09-01 23:34                 ` Graeme Russ
2011-09-02  2:41                   ` Mike Frysinger
2011-09-02  2:58                   ` Simon Glass
2011-09-21 23:18             ` Simon Glass
2011-10-04  5:30               ` Simon Glass
2011-10-05 18:50             ` Wolfgang Denk
2011-09-26 22:50         ` [U-Boot] [PATCH V4] " Vadim Bendebury
2011-09-27 11:22           ` Graeme Russ
2011-09-27 14:55             ` Vadim Bendebury
2011-09-29 23:15               ` Graeme Russ
2011-09-29 23:39                 ` Vadim Bendebury
2011-09-29 23:47                   ` Graeme Russ

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPnjgZ1bMkN3xoNCqtg1CLMa=0rgpHsuyHyZg5yOkR3Hk+v+Bw@mail.gmail.com' \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.