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 14/14] fdt: Set kernaddr if fdt indicates a kernel is present
Date: Wed, 28 Nov 2012 07:16:25 -0800	[thread overview]
Message-ID: <CAPnjgZ0Ae0rHQuk1i6hHr2DYW49NoPGatcuPOpdGUggHdjxBKQ@mail.gmail.com> (raw)
In-Reply-To: <CAF1ZMEc6+He9M8oBGyBgLXYzsLWb=pM2mOuU6709rZzkYSNGyA@mail.gmail.com>

Hi Dennis,

On Wed, Nov 28, 2012 at 6:30 AM, Dennis Lan (dlan)
<dennis.yxun@gmail.com> wrote:
> hi simon:
>   found a small bug?(not sure) which introduced by this commit.
>
> this line not inldue FDT option
> #if defined(CONFIG_SILENT_CONSOLE) || defined(CONFIG_POST) ||
> defined(CONFIG_CMDLINE_EDITING)
> DECLARE_GLOBAL_DATA_PTR;
> #endif

Thanks for reporting it -I will send a patch. Were you building for a
particular board, or did you just notice it?

>
>
> main.c: In function 'process_fdt_options':
> main.c:341:31: error: 'gd' undeclared (first use in this function)
> main.c:341:31: note: each undeclared identifier is reported only once for
> each function it appears in
> main.c: In function 'main_loop':
> main.c:464:33: error: 'gd' undeclared (first use in this function)
> make[2]: *** [main.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> make[1]: *** [common/libcommon.o] Error 2
> make[1]: *** Waiting for unfinished jobs....
> make: *** [lt703a] Error 2
>
Regards,
Simon

>
>
> On Fri, Oct 26, 2012 at 10:31 AM, Simon Glass <sjg@chromium.org> wrote:
>>
>> If kernel-offset is specified in the fdt, set an environment variable
>> so that scripts can access the attached kernel.
>>
>> This can be used by a packaging program to tell U-Boot about a kernel
>> that has been downloaded alongside U-Boot. The value in the fdt is
>> the offset of the kernel from the start of the U-Boot image, so we can
>> find it just by adding CONFIG_SYS_TEXT_BASE.
>>
>> It is then fairly easy to put something like this in the environment
>> variables in the board header file:
>>
>>                 "if test ${kernaddr} != \"\"; then "\
>>                         "echo \"Using bundled kernel\"; "\
>>                         "bootm ${kernaddr};" \
>>                 "fi; "\
>>                 /* rest of boot sequence follows here */
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> ---
>>  common/main.c |   16 ++++++++++++++++
>>  1 files changed, 16 insertions(+), 0 deletions(-)
>>
>> diff --git a/common/main.c b/common/main.c
>> index 03c63b4..3137b75 100644
>> --- a/common/main.c
>> +++ b/common/main.c
>> @@ -333,6 +333,20 @@ err:
>>         hang();
>>  }
>>
>> +static void process_fdt_options(const void *blob)
>> +{
>> +       ulong addr;
>> +
>> +       /* Add an env variable to point to a kernel payload, if available
>> */
>> +       addr = fdtdec_get_config_int(gd->fdt_blob, "kernel-offset", 0);
>> +       if (addr)
>> +               setenv_addr("kernaddr", (void *)(CONFIG_SYS_TEXT_BASE +
>> addr));
>> +
>> +       /* Add an env variable to point to a root disk, if available */
>> +       addr = fdtdec_get_config_int(gd->fdt_blob, "rootdisk-offset", 0);
>> +       if (addr)
>> +               setenv_addr("rootaddr", (void *)(CONFIG_SYS_TEXT_BASE +
>> addr));
>> +}
>>  #endif /* CONFIG_OF_CONTROL */
>>
>>
>> @@ -451,6 +465,8 @@ void main_loop (void)
>>         if (env)
>>                 s = env;
>>
>> +       process_fdt_options(gd->fdt_blob);
>> +
>>         /*
>>          * If the bootsecure option was chosen, use secure_boot_cmd().
>>          * Always use 'env' in this case, since bootsecure requres that
>> the
>> --
>> 1.7.7.3
>>
>> _______________________________________________
>> U-Boot mailing list
>> U-Boot at lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
>
>

  reply	other threads:[~2012-11-28 15:16 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-26  2:30 [PATCH 0/14] fdt: Add various device tree utilities and features Simon Glass
2012-10-26  2:30 ` [U-Boot] " Simon Glass
     [not found] ` <1351218671-15228-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2012-10-26  2:30   ` [PATCH 01/14] fdt: Add function to get config int from device tree Simon Glass
2012-10-26  2:30     ` [U-Boot] " Simon Glass
2012-10-26  2:30   ` [PATCH 02/14] fdt: Add function to get a config string " Simon Glass
2012-10-26  2:30     ` [U-Boot] " Simon Glass
2012-10-26  2:31   ` [PATCH 03/14] fdt: Add fdtdec_decode_region() to decode memory region Simon Glass
2012-10-26  2:31     ` [U-Boot] " Simon Glass
2012-10-26  2:31   ` [PATCH 04/14] fdt: Add function for decoding multiple gpios globally available Simon Glass
2012-10-26  2:31     ` [U-Boot] " Simon Glass
2012-10-26  2:31   ` [PATCH 05/14] fdt: Export fdtdec_find_alias_node() function Simon Glass
2012-10-26  2:31     ` [U-Boot] " Simon Glass
     [not found]     ` <1351218671-15228-6-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2012-10-26  4:24       ` David Gibson
2012-10-26  4:24         ` [U-Boot] " David Gibson
2012-10-31 23:50         ` Simon Glass
2012-10-31 23:50           ` [U-Boot] " Simon Glass
2012-10-26  2:31   ` [PATCH 06/14] fdt: Export fdtdec_lookup() and fix the name Simon Glass
2012-10-26  2:31     ` [U-Boot] " Simon Glass
2012-10-26  2:31   ` [PATCH 07/14] fdt: Add function to read boolean property Simon Glass
2012-10-26  2:31     ` [U-Boot] " Simon Glass
2012-10-26  2:31   ` [PATCH 08/14] fdt: Add fdtdec_get_uint64 to decode a 64-bit value from a property Simon Glass
2012-10-26  2:31     ` [U-Boot] " Simon Glass
2012-10-26  2:31   ` [PATCH 09/14] fdt: Add polarity-aware gpio functions to fdtdec Simon Glass
2012-10-26  2:31     ` [U-Boot] " Simon Glass
2012-10-26  7:17     ` Lucas Stach
2012-10-26  7:17       ` [U-Boot] " Lucas Stach
2012-10-31 23:59       ` Simon Glass
2012-10-31 23:59         ` [U-Boot] " Simon Glass
2012-11-01  4:50         ` Stephen Warren
2012-11-01  4:50           ` [U-Boot] " Stephen Warren
2012-11-15 23:31           ` Simon Glass
2012-11-15 23:31             ` [U-Boot] " Simon Glass
2012-11-15 23:46             ` Stephen Warren
2012-11-15 23:46               ` [U-Boot] " Stephen Warren
2012-11-16  0:01               ` Simon Glass
2012-11-16  0:01                 ` [U-Boot] " Simon Glass
2012-10-26  2:31   ` [PATCH 11/14] fdt: Tell the FDT library where the device tree is Simon Glass
2012-10-26  2:31     ` [U-Boot] " Simon Glass
2012-10-26  2:31   ` [PATCH 12/14] fdt: Allow device tree to specify secure booting Simon Glass
2012-10-26  2:31     ` [U-Boot] " Simon Glass
2012-10-26  2:31 ` [PATCH 10/14] fdt: Load boot command from device tree Simon Glass
2012-10-26  2:31   ` [U-Boot] " Simon Glass
2012-10-26  2:31 ` [PATCH 13/14] fdt: Add option to default to most compatible conf in a fit image Simon Glass
2012-10-26  2:31   ` [U-Boot] " Simon Glass
2012-10-26  2:31 ` [PATCH 14/14] fdt: Set kernaddr if fdt indicates a kernel is present Simon Glass
2012-10-26  2:31   ` [U-Boot] " Simon Glass
     [not found]   ` <1351218671-15228-15-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2012-11-28 14:30     ` Dennis Lan (dlan)
2012-11-28 14:30       ` Dennis Lan
2012-11-28 15:16       ` Simon Glass [this message]
2012-11-18  1:35 ` [PATCH 0/14] fdt: Add various device tree utilities and features Jerry Van Baren
2012-11-18  1:35   ` [U-Boot] " Jerry Van Baren
2012-11-19 17:08   ` Simon Glass
2012-11-19 17:08     ` [U-Boot] " Simon Glass

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=CAPnjgZ0Ae0rHQuk1i6hHr2DYW49NoPGatcuPOpdGUggHdjxBKQ@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.