diff mbox

[U-Boot,01/11] SPL: NAND: remove CONFIG_SYS_NAND_PAGE_SIZE

Message ID 1396504871-1454-2-git-send-email-tharvey@gateworks.com
State Changes Requested
Delegated to: Stefano Babic
Headers show

Commit Message

Tim Harvey April 3, 2014, 6:01 a.m. UTC
We only need to read in the size of struct image_header and thus don't
need to know the page size of the nand device.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 common/spl/spl_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Masahiro Yamada April 4, 2014, 2:33 a.m. UTC | #1
On Wed,  2 Apr 2014 23:01:01 -0700
Tim Harvey <tharvey@gateworks.com> wrote:

> We only need to read in the size of struct image_header and thus don't
> need to know the page size of the nand device.
> 
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>

+1



Best Regards
Masahiro Yamada
Nikita Kiryanov April 9, 2014, 2:55 p.m. UTC | #2
Hi Tim,

On 04/03/2014 09:01 AM, Tim Harvey wrote:
> We only need to read in the size of struct image_header and thus don't
> need to know the page size of the nand device.
>
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
> ---
>   common/spl/spl_nand.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
> index 9da0218..062461b 100644
> --- a/common/spl/spl_nand.c
> +++ b/common/spl/spl_nand.c
> @@ -76,7 +76,7 @@ void spl_nand_load_image(void)
>   #endif
>   	/* Load u-boot */
>   	nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
> -		CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
> +		sizeof(*header), (void *)header);
>   	spl_parse_image_header(header);
>   	nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
>   		spl_image.size, (void *)spl_image.load_addr);
>

+1
Stefano Babic April 14, 2014, 11:38 a.m. UTC | #3
On 03/04/2014 08:01, Tim Harvey wrote:
> We only need to read in the size of struct image_header and thus don't
> need to know the page size of the nand device.
> 
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
> ---
>  common/spl/spl_nand.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
> index 9da0218..062461b 100644
> --- a/common/spl/spl_nand.c
> +++ b/common/spl/spl_nand.c
> @@ -76,7 +76,7 @@ void spl_nand_load_image(void)
>  #endif
>  	/* Load u-boot */
>  	nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
> -		CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
> +		sizeof(*header), (void *)header);
>  	spl_parse_image_header(header);
>  	nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
>  		spl_image.size, (void *)spl_image.load_addr);
> 

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
Tim Harvey April 17, 2014, 2:18 p.m. UTC | #4
On Mon, Apr 14, 2014 at 4:38 AM, Stefano Babic <sbabic@denx.de> wrote:
> On 03/04/2014 08:01, Tim Harvey wrote:
>> We only need to read in the size of struct image_header and thus don't
>> need to know the page size of the nand device.
>>
>> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
>> ---
>>  common/spl/spl_nand.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
>> index 9da0218..062461b 100644
>> --- a/common/spl/spl_nand.c
>> +++ b/common/spl/spl_nand.c
>> @@ -76,7 +76,7 @@ void spl_nand_load_image(void)
>>  #endif
>>       /* Load u-boot */
>>       nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
>> -             CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
>> +             sizeof(*header), (void *)header);
>>       spl_parse_image_header(header);
>>       nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
>>               spl_image.size, (void *)spl_image.load_addr);
>>
>
> Acked-by: Stefano Babic <sbabic@denx.de>
>
> Best regards,
> Stefano Babic
>

Scott,

This should have been addressed to you in the first place as its NAND
and not IMX specific. It's been +1'd and ack'd, so if you agree with
it and commit it I'll remove it from my next patch series regarding
IMX6 SPL NAND support.

Tim
Scott Wood April 18, 2014, 10:23 p.m. UTC | #5
On Thu, 2014-04-17 at 07:18 -0700, Tim Harvey wrote:
> On Mon, Apr 14, 2014 at 4:38 AM, Stefano Babic <sbabic@denx.de> wrote:
> > On 03/04/2014 08:01, Tim Harvey wrote:
> >> We only need to read in the size of struct image_header and thus don't
> >> need to know the page size of the nand device.
> >>
> >> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
> >> ---
> >>  common/spl/spl_nand.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
> >> index 9da0218..062461b 100644
> >> --- a/common/spl/spl_nand.c
> >> +++ b/common/spl/spl_nand.c
> >> @@ -76,7 +76,7 @@ void spl_nand_load_image(void)
> >>  #endif
> >>       /* Load u-boot */
> >>       nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
> >> -             CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
> >> +             sizeof(*header), (void *)header);
> >>       spl_parse_image_header(header);
> >>       nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
> >>               spl_image.size, (void *)spl_image.load_addr);
> >>
> >
> > Acked-by: Stefano Babic <sbabic@denx.de>
> >
> > Best regards,
> > Stefano Babic
> >
> 
> Scott,
> 
> This should have been addressed to you in the first place as its NAND
> and not IMX specific. It's been +1'd and ack'd, so if you agree with
> it and commit it I'll remove it from my next patch series regarding
> IMX6 SPL NAND support.

I suppose it's not worse than what's already there, but I really don't
like the way nand_spl_load_image takes a pointer and a size, but can
write more bytes to the pointer than the size that was given (it rounds
up to the block -- not page -- size).

That said,
Acked-by: Scott Wood <scottwood@freescale.com>
...and feel free to leave it in with the rest of the patchset.

-Scott
diff mbox

Patch

diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
index 9da0218..062461b 100644
--- a/common/spl/spl_nand.c
+++ b/common/spl/spl_nand.c
@@ -76,7 +76,7 @@  void spl_nand_load_image(void)
 #endif
 	/* Load u-boot */
 	nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
-		CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
+		sizeof(*header), (void *)header);
 	spl_parse_image_header(header);
 	nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
 		spl_image.size, (void *)spl_image.load_addr);