public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] common: board_f: Dont relocate FDT incase of CONFIG_OF_EMBED
@ 2015-11-27  7:28 Michal Simek
  2015-11-27  7:46 ` Bin Meng
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Michal Simek @ 2015-11-27  7:28 UTC (permalink / raw)
  To: u-boot

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
 	reserve_arch,
 	reserve_stacks,
 	setup_dram_config,
@@ -955,7 +960,9 @@ static init_fnc_t init_sequence_f[] = {
 	setup_board_extra,
 #endif
 	INIT_FUNC_WATCHDOG_RESET
+#ifndef CONFIG_OF_EMBED
 	reloc_fdt,
+#endif
 	setup_reloc,
 #if defined(CONFIG_X86) || defined(CONFIG_ARC)
 	copy_uboot_to_ram,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2] common: board_f: Dont relocate FDT incase of CONFIG_OF_EMBED
  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
  2 siblings, 0 replies; 8+ messages in thread
From: Bin Meng @ 2015-11-27  7:46 UTC (permalink / raw)
  To: u-boot

On Fri, Nov 27, 2015 at 3:28 PM, 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
>         reserve_arch,
>         reserve_stacks,
>         setup_dram_config,
> @@ -955,7 +960,9 @@ static init_fnc_t init_sequence_f[] = {
>         setup_board_extra,
>  #endif
>         INIT_FUNC_WATCHDOG_RESET
> +#ifndef CONFIG_OF_EMBED
>         reloc_fdt,
> +#endif
>         setup_reloc,
>  #if defined(CONFIG_X86) || defined(CONFIG_ARC)
>         copy_uboot_to_ram,
> --

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on QEMU x86
Tested-by: Bin Meng <bmeng.cn@gmail.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2] common: board_f: Dont relocate FDT incase of CONFIG_OF_EMBED
  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
  2 siblings, 0 replies; 8+ messages in thread
From: Thomas Chou @ 2015-11-29  6:15 UTC (permalink / raw)
  To: u-boot

Hi Michal,

On 2015?11?27? 15:28, Michal Simek 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(-)
>

Tested on nios2 boards.

Tested-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Thomas Chou <thomas@wytron.com.tw>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2] common: board_f: Dont relocate FDT incase of CONFIG_OF_EMBED
  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
  2 siblings, 1 reply; 8+ messages in thread
From: Simon Glass @ 2015-11-30 23:17 UTC (permalink / raw)
  To: u-boot

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.

>         reserve_arch,
>         reserve_stacks,
>         setup_dram_config,
> @@ -955,7 +960,9 @@ static init_fnc_t init_sequence_f[] = {
>         setup_board_extra,
>  #endif
>         INIT_FUNC_WATCHDOG_RESET
> +#ifndef CONFIG_OF_EMBED
>         reloc_fdt,
> +#endif
>         setup_reloc,
>  #if defined(CONFIG_X86) || defined(CONFIG_ARC)
>         copy_uboot_to_ram,
> --
> 1.9.1
>

Regards,
Simon

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2] common: board_f: Dont relocate FDT incase of CONFIG_OF_EMBED
  2015-11-30 23:17 ` Simon Glass
@ 2015-12-01  6:56   ` Michal Simek
  2015-12-01 15:09     ` Simon Glass
  0 siblings, 1 reply; 8+ messages in thread
From: Michal Simek @ 2015-12-01  6:56 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2] common: board_f: Dont relocate FDT incase of CONFIG_OF_EMBED
  2015-12-01  6:56   ` Michal Simek
@ 2015-12-01 15:09     ` Simon Glass
  2015-12-01 15:12       ` Michal Simek
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Glass @ 2015-12-01 15:09 UTC (permalink / raw)
  To: u-boot

Hi Michal,

On 30 November 2015 at 23:56, Michal Simek <michal.simek@xilinx.com> wrote:
> 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.

You should not be using CONFIG_OF_EMBED...

I recall you were originally worried about the name change from
u-boot.bin to u-boot-dtb.bin. Is that right?

Regards,
Simon

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2] common: board_f: Dont relocate FDT incase of CONFIG_OF_EMBED
  2015-12-01 15:09     ` Simon Glass
@ 2015-12-01 15:12       ` Michal Simek
  2015-12-01 20:02         ` Simon Glass
  0 siblings, 1 reply; 8+ messages in thread
From: Michal Simek @ 2015-12-01 15:12 UTC (permalink / raw)
  To: u-boot

On 1.12.2015 16:09, Simon Glass wrote:
> Hi Michal,
> 
> On 30 November 2015 at 23:56, Michal Simek <michal.simek@xilinx.com> wrote:
>> 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.
> 
> You should not be using CONFIG_OF_EMBED...

For production board.
Again is there really need to move to that ifdef inside reserve_fdt
function?

> I recall you were originally worried about the name change from
> u-boot.bin to u-boot-dtb.bin. Is that right?

No problem with this now.

Thanks,
Michal

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2] common: board_f: Dont relocate FDT incase of CONFIG_OF_EMBED
  2015-12-01 15:12       ` Michal Simek
@ 2015-12-01 20:02         ` Simon Glass
  0 siblings, 0 replies; 8+ messages in thread
From: Simon Glass @ 2015-12-01 20:02 UTC (permalink / raw)
  To: u-boot

Hi Michal,

On 1 December 2015 at 08:12, Michal Simek <michal.simek@xilinx.com> wrote:
> On 1.12.2015 16:09, Simon Glass wrote:
>> Hi Michal,
>>
>> On 30 November 2015 at 23:56, Michal Simek <michal.simek@xilinx.com> wrote:
>>> 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.
>>
>> You should not be using CONFIG_OF_EMBED...
>
> For production board.
> Again is there really need to move to that ifdef inside reserve_fdt
> function?

Well if we are trying to remove the #ifdefs from the list, but there
is a patch that adds one, that is going in the wrong direction.

>
>> I recall you were originally worried about the name change from
>> u-boot.bin to u-boot-dtb.bin. Is that right?
>
> No problem with this now.

OK, so I don't really need a need to save a few bytes on code that is
only ever used for debugging/testing.

Regards,
Simon

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-12-01 20:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2015-12-01 15:09     ` Simon Glass
2015-12-01 15:12       ` Michal Simek
2015-12-01 20:02         ` Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox