public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/8] arm: Add boottime support for the ARM architecture
Date: Tue, 20 Nov 2012 15:52:56 +0000	[thread overview]
Message-ID: <20121120155256.GA28265@gmail.com> (raw)
In-Reply-To: <CAP9ODKq8whBDSO6D9vLaU_6wXM6E_RsfdKXYZSVqati0N6eJRQ@mail.gmail.com>

On Tue, 20 Nov 2012, Otavio Salvador wrote:

> On Tue, Nov 20, 2012 at 12:33 PM, Lee Jones <lee.jones@linaro.org> wrote:
> 
> > This patch adds support for passing boot time information to
> > the Linus kernel using ATAGS when booting on ARM based devices.
>
> Linus or Linux?

Linux. 

I'll fix-up when the review process has finished.

Thanks.

> > Based heavily on the original driver by Jonas Aaberg.
> >
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> > ---
> >  arch/arm/include/asm/setup.h |   18 +++++++++++++++++
> >  arch/arm/lib/bootm.c         |   45
> > ++++++++++++++++++++++++++++++++++++++++--
> >  2 files changed, 61 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
> > index 78a7fac..6088440 100644
> > --- a/arch/arm/include/asm/setup.h
> > +++ b/arch/arm/include/asm/setup.h
> > @@ -205,6 +205,19 @@ struct tag_memclk {
> >         u32 fmemclk;
> >  };
> >
> > +/* for automatic boot timing testcases */
> > +#define ATAG_BOOTTIME  0x41000403
> > +#define BOOTTIME_MAX 10
> > +
> > +#include <boottime.h>
> > +
> > +struct tag_boottime {
> > +       struct boottime_entry entry[BOOTTIME_MAX];
> > +       u32 idle;  /* in us */
> > +       u32 total; /* in us */
> > +       u8 num;
> > +};
> > +
> >  struct tag {
> >         struct tag_header hdr;
> >         union {
> > @@ -227,6 +240,11 @@ struct tag {
> >                  * DC21285 specific
> >                  */
> >                 struct tag_memclk       memclk;
> > +
> > +               /*
> > +                * Boot time
> > +                */
> > +               struct tag_boottime     boottime;
> >         } u;
> >  };
> >
> > diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> > index 1bd2730..03774c8 100644
> > --- a/arch/arm/lib/bootm.c
> > +++ b/arch/arm/lib/bootm.c
> > @@ -28,6 +28,7 @@
> >  #include <common.h>
> >  #include <command.h>
> >  #include <image.h>
> > +#include <boottime.h>
> >  #include <u-boot/zlib.h>
> >  #include <asm/byteorder.h>
> >  #include <fdt.h>
> > @@ -114,7 +115,8 @@ static void announce_and_cleanup(void)
> >         defined(CONFIG_CMDLINE_TAG) || \
> >         defined(CONFIG_INITRD_TAG) || \
> >         defined(CONFIG_SERIAL_TAG) || \
> > -       defined(CONFIG_REVISION_TAG)
> > +       defined(CONFIG_REVISION_TAG) || \
> > +       defined(CONFIG_BOOTTIME)
> >  static void setup_start_tag (bd_t *bd)
> >  {
> >         params = (struct tag *)bd->bi_boot_params;
> > @@ -130,6 +132,37 @@ static void setup_start_tag (bd_t *bd)
> >  }
> >  #endif
> >
> > +#ifdef CONFIG_BOOTTIME
> > +static void setup_boottime_tags(void)
> > +{
> > +       unsigned int i;
> > +       struct boottime_entry *b;
> > +
> > +       params->hdr.tag = ATAG_BOOTTIME;
> > +       params->hdr.size = tag_size(tag_boottime);
> > +
> > +       params->u.boottime.idle = boottime_idle_get();
> > +       params->u.boottime.total = boottime_idle_done();
> > +
> > +       for (i = 0; i < BOOTTIME_MAX; i++) {
> > +               b = boottime_get_entry(i);
> > +               if (b == NULL)
> > +                       break;
> > +
> > +               params->u.boottime.entry[i].time = b->time;
> > +               strncpy((char *)params->u.boottime.entry[i].name,
> > +                       (char *)b->name, BOOTTIME_MAX_NAME_LEN);
> > +               params->u.boottime.entry[i].name[BOOTTIME_MAX_NAME_LEN -
> > 1] = '\0';
> > +
> > +       }
> > +
> > +       params->u.boottime.num = i;
> > +
> > +       params = tag_next(params);
> > +
> > +}
> > +#endif
> > +
> >  #ifdef CONFIG_SETUP_MEMORY_TAGS
> >  static void setup_memory_tags(bd_t *bd)
> >  {
> > @@ -233,6 +266,10 @@ static void setup_end_tag(bd_t *bd)
> >  }
> >  #endif
> >
> > +#ifdef CONFIG_BOOTTIME
> > +static void setup_boottime_tags(void);
> > +#endif
> > +
> >  #ifdef CONFIG_OF_LIBFDT
> >  static int create_fdt(bootm_headers_t *images)
> >  {
> > @@ -293,9 +330,13 @@ static void boot_prep_linux(bootm_headers_t *images)
> >         defined(CONFIG_CMDLINE_TAG) || \
> >         defined(CONFIG_INITRD_TAG) || \
> >         defined(CONFIG_SERIAL_TAG) || \
> > -       defined(CONFIG_REVISION_TAG)
> > +       defined(CONFIG_REVISION_TAG) || \
> > +       defined (CONFIG_BOOTTIME)
> >                 debug("using: ATAGS\n");
> >                 setup_start_tag(gd->bd);
> > +#ifdef CONFIG_BOOTTIME
> > +               setup_boottime_tags();
> > +#endif
> >  #ifdef CONFIG_SERIAL_TAG
> >                 setup_serial_tag(&params);
> >  #endif
> > --
> > 1.7.9.5
> >
> > _______________________________________________
> > U-Boot mailing list
> > U-Boot at lists.denx.de
> > http://lists.denx.de/mailman/listinfo/u-boot
> >
> 
> 
> 
> -- 
> Otavio Salvador                             O.S. Systems
> E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
> Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2012-11-20 15:52 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-20 14:33 [U-Boot] [PATCH 0/8] Adding boottime support Lee Jones
2012-11-20 14:33 ` [U-Boot] [PATCH 1/8] u8500: Correct unnecessary mathematical roll-over Lee Jones
2012-11-20 18:14   ` Wolfgang Denk
2012-11-21 10:02     ` Lee Jones
2012-11-21 13:51       ` Wolfgang Denk
2012-11-21 14:54         ` Lee Jones
2012-11-20 14:33 ` [U-Boot] [PATCH 2/8] u8500: Add utimer support Lee Jones
2012-11-20 14:33 ` [U-Boot] [PATCH 3/8] boottime: Add core boottime measurement support Lee Jones
2012-11-20 18:20   ` Wolfgang Denk
2012-11-21  9:50     ` Lee Jones
2012-11-21 13:44       ` Wolfgang Denk
2012-11-21 15:03         ` Lee Jones
2012-11-21 16:14           ` Wolfgang Denk
2012-11-21 17:26             ` Lee Jones
2012-11-21 19:04               ` Wolfgang Denk
2012-11-26  6:08   ` Simon Glass
2012-11-26  9:00     ` Lee Jones
2012-11-26 19:57       ` Simon Glass
2012-11-27  8:55         ` Lee Jones
2012-11-27 13:46           ` Wolfgang Denk
2012-11-27 14:28             ` Lee Jones
2012-11-20 14:33 ` [U-Boot] [PATCH 4/8] boottime: Apply some key boottime tags into common code Lee Jones
2012-11-20 18:22   ` Wolfgang Denk
2012-11-21  9:36     ` Lee Jones
2012-11-21 13:40       ` Wolfgang Denk
2012-11-21 15:07         ` Lee Jones
2012-11-20 14:33 ` [U-Boot] [PATCH 5/8] arm: Add boottime support for the ARM architecture Lee Jones
2012-11-20 15:11   ` Otavio Salvador
2012-11-20 15:52     ` Lee Jones [this message]
2012-11-20 18:24   ` Wolfgang Denk
2012-11-21  9:17     ` Lee Jones
2012-11-21  9:30       ` Wolfgang Denk
2012-11-21 10:13         ` Lee Jones
2012-11-21 13:58           ` Wolfgang Denk
2012-11-21 14:39             ` Lee Jones
2012-11-21 16:05               ` Wolfgang Denk
2012-11-21 17:48                 ` Lee Jones
2012-11-21 19:18                   ` Wolfgang Denk
2012-11-22 10:14                     ` Lee Jones
2012-11-22 13:04                       ` Wolfgang Denk
2012-11-22 16:08                         ` Lee Jones
2012-11-22 17:40                           ` Wolfgang Denk
2012-11-23 10:08                             ` Lee Jones
2012-11-20 14:33 ` [U-Boot] [PATCH 6/8] arm: Add some boottime tags into prime booting locations Lee Jones
2012-11-20 14:33 ` [U-Boot] [PATCH 7/8] href: Enable boottime functionality Lee Jones
2012-11-20 14:33 ` [U-Boot] [PATCH 8/8] snowball: " Lee Jones
2012-11-20 18:08 ` [U-Boot] [PATCH 0/8] Adding boottime support Wolfgang Denk
2012-11-21 10:03   ` Lee Jones

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=20121120155256.GA28265@gmail.com \
    --to=lee.jones@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox