* [U-Boot] [PATCH] SPL: do not use fix value for u-boot size
@ 2012-08-23 8:40 Stefano Babic
2012-08-23 8:51 ` Stefan Roese
2012-08-23 10:46 ` [U-Boot] [PATCH V2] " Stefano Babic
0 siblings, 2 replies; 8+ messages in thread
From: Stefano Babic @ 2012-08-23 8:40 UTC (permalink / raw)
To: u-boot
If an u-boot image is not found, SPL thinks to load a bare
u-boot.bin image with a maximum size of 200KB.
Use CONFIG_SYS_MONITOR_LEN instead.
Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Tom Rini <trini@ti.com>
---
Note: this is based on Tom's series
"ARM: SPL: Make more generic, merge DaVinci and OMAP"
Tested with V2 version on a MX35.
common/spl/spl.c | 4 ++++
1 file changed, 4 insertions(+)
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
spl_image.entry_point = CONFIG_SYS_TEXT_BASE;
spl_image.load_addr = CONFIG_SYS_TEXT_BASE;
spl_image.os = IH_OS_U_BOOT;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread* [U-Boot] [PATCH] SPL: do not use fix value for u-boot size
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 10:46 ` [U-Boot] [PATCH V2] " Stefano Babic
1 sibling, 1 reply; 8+ messages in thread
From: Stefan Roese @ 2012-08-23 8:51 UTC (permalink / raw)
To: u-boot
On 08/23/2012 10:40 AM, Stefano Babic wrote:
> If an u-boot image is not found, SPL thinks to load a bare
> u-boot.bin image with a maximum size of 200KB.
> Use CONFIG_SYS_MONITOR_LEN instead.
>
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> CC: Tom Rini <trini@ti.com>
> ---
>
> Note: this is based on Tom's series
> "ARM: SPL: Make more generic, merge DaVinci and OMAP"
>
> Tested with V2 version on a MX35.
>
> common/spl/spl.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> 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? If
this is correct, then we should probably remove setting it completely.
What do you think?
Thanks,
Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread* [U-Boot] [PATCH] SPL: do not use fix value for u-boot size
2012-08-23 8:51 ` Stefan Roese
@ 2012-08-23 9:23 ` Stefano Babic
2012-08-23 9:28 ` Stefan Roese
0 siblings, 1 reply; 8+ messages in thread
From: Stefano Babic @ 2012-08-23 9:23 UTC (permalink / raw)
To: u-boot
On 23/08/2012 10:51, Stefan Roese wrote:
> On 08/23/2012 10:40 AM, Stefano Babic wrote:
>> If an u-boot image is not found, SPL thinks to load a bare
>> u-boot.bin image with a maximum size of 200KB.
>> Use CONFIG_SYS_MONITOR_LEN instead.
>>
>> Signed-off-by: Stefano Babic <sbabic@denx.de>
>> CC: Tom Rini <trini@ti.com>
>> ---
>>
Hi Stefan,
>> Note: this is based on Tom's series
>> "ARM: SPL: Make more generic, merge DaVinci and OMAP"
>>
>> Tested with V2 version on a MX35.
>>
>> common/spl/spl.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> 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.
Cheers,
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
=====================================================================
^ permalink raw reply [flat|nested] 8+ messages in thread* [U-Boot] [PATCH] SPL: do not use fix value for u-boot size
2012-08-23 9:23 ` Stefano Babic
@ 2012-08-23 9:28 ` Stefan Roese
2012-08-23 9:38 ` Stefano Babic
0 siblings, 1 reply; 8+ messages in thread
From: Stefan Roese @ 2012-08-23 9:28 UTC (permalink / raw)
To: u-boot
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.
Thanks,
Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread* [U-Boot] [PATCH] SPL: do not use fix value for u-boot size
2012-08-23 9:28 ` Stefan Roese
@ 2012-08-23 9:38 ` Stefano Babic
0 siblings, 0 replies; 8+ messages in thread
From: Stefano Babic @ 2012-08-23 9:38 UTC (permalink / raw)
To: u-boot
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
=====================================================================
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH V2] SPL: do not use fix value for u-boot size
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 10:46 ` Stefano Babic
2012-08-23 11:19 ` Stefan Roese
2012-08-23 22:03 ` Tom Rini
1 sibling, 2 replies; 8+ messages in thread
From: Stefano Babic @ 2012-08-23 10:46 UTC (permalink / raw)
To: u-boot
If an u-boot image is not found, SPL thinks to load a bare
u-boot.bin image with a maximum size of 200KB.
Use CONFIG_SYS_MONITOR_LEN instead.
Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Tom Rini <trini@ti.com>
CC: Stefan Roese <stefan.roese@gmail.com>
---
Changes:
- move the #ifdef out of the C code (Stefan Roese)
common/spl/spl.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 7d15460..d9e4b62 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -36,6 +36,10 @@
DECLARE_GLOBAL_DATA_PTR;
+#ifndef CONFIG_SYS_MONITOR_LEN
+#define CONFIG_SYS_MONITOR_LEN (200 * 1024)
+#endif
+
u32* boot_params_ptr = NULL;
struct spl_image_info spl_image;
@@ -100,7 +104,7 @@ 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 */
- spl_image.size = 200 * 1024;
+ spl_image.size = CONFIG_SYS_MONITOR_LEN;
spl_image.entry_point = CONFIG_SYS_TEXT_BASE;
spl_image.load_addr = CONFIG_SYS_TEXT_BASE;
spl_image.os = IH_OS_U_BOOT;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread* [U-Boot] [PATCH V2] SPL: do not use fix value for u-boot size
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
1 sibling, 0 replies; 8+ messages in thread
From: Stefan Roese @ 2012-08-23 11:19 UTC (permalink / raw)
To: u-boot
On 08/23/2012 12:46 PM, Stefano Babic wrote:
> If an u-boot image is not found, SPL thinks to load a bare
> u-boot.bin image with a maximum size of 200KB.
> Use CONFIG_SYS_MONITOR_LEN instead.
>
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> CC: Tom Rini <trini@ti.com>
> CC: Stefan Roese <stefan.roese@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Thanks,
Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH V2] SPL: do not use fix value for u-boot size
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
1 sibling, 0 replies; 8+ messages in thread
From: Tom Rini @ 2012-08-23 22:03 UTC (permalink / raw)
To: u-boot
On 08/23/2012 03:46 AM, Stefano Babic wrote:
> If an u-boot image is not found, SPL thinks to load a bare
> u-boot.bin image with a maximum size of 200KB.
> Use CONFIG_SYS_MONITOR_LEN instead.
>
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> CC: Tom Rini <trini@ti.com>
> CC: Stefan Roese <stefan.roese@gmail.com>
Looks good, I'll take this for my v4.
--
Tom
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-08-23 22:03 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox