From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] SPL: do not use fix value for u-boot size
Date: Thu, 23 Aug 2012 11:38:29 +0200 [thread overview]
Message-ID: <5035FA15.6020407@denx.de> (raw)
In-Reply-To: <5035F7C2.9060907@gmail.com>
On 23/08/2012 11:28, Stefan Roese wrote:
> Hi Stefano,
>
> On 08/23/2012 11:23 AM, Stefano Babic wrote:
>>>> diff --git a/common/spl/spl.c b/common/spl/spl.c
>>>> index 7d15460..827ff1c 100644
>>>> --- a/common/spl/spl.c
>>>> +++ b/common/spl/spl.c
>>>> @@ -100,7 +100,11 @@ void spl_parse_image_header(const struct image_header *header)
>>>> debug("mkimage signature not found - ih_magic = %x\n",
>>>> header->ih_magic);
>>>> /* Let's assume U-Boot will not be more than 200 KB */
>>>> +#ifdef CONFIG_SYS_MONITOR_LEN
>>>> + spl_image.size = CONFIG_SYS_MONITOR_LEN;
>>>> +#else
>>>> spl_image.size = 200 * 1024;
>>>> +#endif
>>>
>>> Yes, I noticed this 200 KiB setting as well. But it seems that this
>>> ".size" variable is not referenced at all. Or am I missing something?
>>
>> Your are missing something:
>>
>> drivers/mmc/spl_mmc.c:
>>
>> 55 /* convert size to sectors - round up */
>> 56 image_size_sectors = (spl_image.size + MMCSD_SECTOR_SIZE - 1) /
>> 57 MMCSD_SECTOR_SIZE;
>>
>> And I have an example where only a part of u-boot is copied.
>
> Ahh, I see. Thanks.
>
> I would prefer the following approach then, to move the #ifdef out of
> the C code:
>
> #ifndef CONFIG_SYS_MONITOR_LEN
> #define CONFIG_SYS_MONITOR_LEN (200 * 1024)
> #endif
>
> and then use CONFIG_SYS_MONITOR_LEN unconditionally.
Fine with me - I will fix in V2.
Regards,
Stefano
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
next prev parent reply other threads:[~2012-08-23 9:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-23 8:40 [U-Boot] [PATCH] SPL: do not use fix value for u-boot size Stefano Babic
2012-08-23 8:51 ` Stefan Roese
2012-08-23 9:23 ` Stefano Babic
2012-08-23 9:28 ` Stefan Roese
2012-08-23 9:38 ` Stefano Babic [this message]
2012-08-23 10:46 ` [U-Boot] [PATCH V2] " Stefano Babic
2012-08-23 11:19 ` Stefan Roese
2012-08-23 22:03 ` Tom Rini
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=5035FA15.6020407@denx.de \
--to=sbabic@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 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.