From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH][RFC][for next] 5xxx, fdt: move fdt_fixup_memory() to cpu.c file
Date: Tue, 08 Dec 2009 08:01:10 +0100 [thread overview]
Message-ID: <4B1DF9B6.3040400@denx.de> (raw)
In-Reply-To: <20091207215008.E801A3F6CC@gemini.denx.de>
Hello Wolfgang,
Wolfgang Denk wrote:
> In message <4B1790D6.6030303@denx.de> you wrote:
>> u-boot updates, before starting Linux, the memory node in the
>> DTS. As this is a "standard" feature, move this functionality
>> to the cpu.c file for mpc5xxx and mpc512x processors.
>>
>> Signed-off-by: Heiko Schocher <hs@denx.de>
>
> I generally agree with this patch, but...
>
>> --- a/board/cm5200/cm5200.c
>> +++ b/board/cm5200/cm5200.c
>> @@ -271,13 +271,6 @@ static void ft_blob_update(void *blob, bd_t *bd)
>> if (ret < 0)
>> printf("ft_blob_update(): cannot set /model property err:%s\n",
>> fdt_strerror(ret));
>> -
>> - ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
>> -
>> - if (ret < 0) {
>> - printf("ft_blob_update(): cannot set /memory/reg "
>> - "property err:%s\n", fdt_strerror(ret));
>> - }
>
> Here we do some error checking, which is always a Good Thing (TM).
Yep!
>> diff --git a/cpu/mpc512x/cpu.c b/cpu/mpc512x/cpu.c
>> index 42ccd81..dac48db 100644
>> --- a/cpu/mpc512x/cpu.c
>> +++ b/cpu/mpc512x/cpu.c
>> @@ -197,6 +197,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
>> #ifdef CONFIG_HAS_ETH0
>> fdt_fixup_ethernet(blob);
>> #endif
>> + fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
>> }
>> #endif
>>
>> diff --git a/cpu/mpc5xxx/cpu.c b/cpu/mpc5xxx/cpu.c
>> index efa64c7..2a28df4 100644
>> --- a/cpu/mpc5xxx/cpu.c
>> +++ b/cpu/mpc5xxx/cpu.c
>> @@ -157,6 +157,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
>> }
>>
>> #endif
>> + fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
>> }
>> #endif
>
> May I suggest to add the same error checking in these two files, then?
Hmm.. fdt_fixup_memory() does this error checking (Also in a much
stricter way, than in the board code). So I think, this is not
necessary here ...
bye
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
next prev parent reply other threads:[~2009-12-08 7:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-03 10:20 [U-Boot] [PATCH][RFC][for next] 5xxx, fdt: move fdt_fixup_memory() to cpu.c file Heiko Schocher
2009-12-07 21:50 ` Wolfgang Denk
2009-12-08 7:01 ` Heiko Schocher [this message]
2009-12-08 21:07 ` Wolfgang Denk
2009-12-08 21:13 ` Wolfgang Denk
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=4B1DF9B6.3040400@denx.de \
--to=hs@denx.de \
--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