public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@xilinx.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] common: board_f: Dont relocate FDT incase of CONFIG_OF_EMBED
Date: Tue, 1 Dec 2015 07:56:09 +0100	[thread overview]
Message-ID: <565D4489.9020207@xilinx.com> (raw)
In-Reply-To: <CAPnjgZ2PhbQMMhjxA_QNk5yuU7+cDqLoQderMwj6wcW7u0tjEw@mail.gmail.com>

On 1.12.2015 00:17, Simon Glass wrote:
> Hi Michal,
> 
> On 27 November 2015 at 00:28, Michal Simek <michal.simek@xilinx.com> wrote:
>> From: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
>>
>> Don't relocate fdt in case of CONFIG_OF EMBED as the fdt is
>> already embedded with u-boot image. Also update the fdt_blob
>> correctly in this case
>>
>> Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> Reviewed-by: Alexey Brodkin <abrodkin@synopsys.com>
>> ---
>>
>> Changes in v2:
>> - Fix commit message reported by Alexey
>>
>>  common/board_f.c | 11 +++++++++--
>>  1 file changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/common/board_f.c b/common/board_f.c
>> index b035c90ff3b7..91bf8beea1c6 100644
>> --- a/common/board_f.c
>> +++ b/common/board_f.c
>> @@ -508,7 +508,7 @@ static int reserve_global_data(void)
>>         return 0;
>>  }
>>
>> -static int reserve_fdt(void)
>> +static int __maybe_unused reserve_fdt(void)
>>  {
>>         /*
>>          * If the device tree is sitting immediately above our image then we
>> @@ -658,7 +658,7 @@ static int setup_dram_config(void)
>>         return 0;
>>  }
>>
>> -static int reloc_fdt(void)
>> +static int __maybe_unused reloc_fdt(void)
>>  {
>>         if (gd->flags & GD_FLG_SKIP_RELOC)
>>                 return 0;
>> @@ -687,6 +687,9 @@ static int setup_reloc(void)
>>         gd->reloc_off = gd->relocaddr - (CONFIG_SYS_TEXT_BASE + 0x400);
>>  #endif
>>  #endif
>> +#ifdef CONFIG_OF_EMBED
>> +       gd->fdt_blob += gd->reloc_off;
>> +#endif
>>         memcpy(gd->new_gd, (char *)gd, sizeof(gd_t));
>>
>>         debug("Relocation Offset is: %08lx\n", gd->reloc_off);
>> @@ -938,7 +941,9 @@ static init_fnc_t init_sequence_f[] = {
>>  #endif
>>         setup_machine,
>>         reserve_global_data,
>> +#ifndef CONFIG_OF_EMBED
>>         reserve_fdt,
>> +#endif
> 
> Can you please put the #ifdef in the function? At some point we are
> hoping to get rid of all these #ifdefs.

Do you think that this is the best way how to handle this?
We are targeting small uboot running from OCM on Zynq. Moving ifdef to
function itself will caused that we will waste some bytes which do nothing.
Reference in table stays there and then return from that function too.
It it is not huge but this way seems to me better.

But no problem to change it if you think that this is the best way how
to handle this.

Thanks,
Michal

  reply	other threads:[~2015-12-01  6:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-27  7:28 [U-Boot] [PATCH v2] common: board_f: Dont relocate FDT incase of CONFIG_OF_EMBED Michal Simek
2015-11-27  7:46 ` Bin Meng
2015-11-29  6:15 ` Thomas Chou
2015-11-30 23:17 ` Simon Glass
2015-12-01  6:56   ` Michal Simek [this message]
2015-12-01 15:09     ` Simon Glass
2015-12-01 15:12       ` Michal Simek
2015-12-01 20:02         ` 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=565D4489.9020207@xilinx.com \
    --to=michal.simek@xilinx.com \
    --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