public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 6/10] driver/ifc: define nand_spl_load_image() for SPL
@ 2014-03-31 10:04 Prabhakar Kushwaha
  2014-04-01 22:03 ` Scott Wood
  0 siblings, 1 reply; 4+ messages in thread
From: Prabhakar Kushwaha @ 2014-03-31 10:04 UTC (permalink / raw)
  To: u-boot

nand_spl_load_image() can also be used for non TPL framework.

Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
---
 drivers/mtd/nand/fsl_ifc_spl.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/fsl_ifc_spl.c b/drivers/mtd/nand/fsl_ifc_spl.c
index 2f82f7c..8a7a3a3 100644
--- a/drivers/mtd/nand/fsl_ifc_spl.c
+++ b/drivers/mtd/nand/fsl_ifc_spl.c
@@ -88,7 +88,7 @@ static inline int bad_block(uchar *marker, int port_size)
 		return __raw_readw((u16 *)marker) != 0xffff;
 }
 
-#ifdef CONFIG_TPL_BUILD
+#if defined(CONFIG_TPL_BUILD) || defined(CONFIG_SPL_BUILD)
 int nand_spl_load_image(uint32_t offs, unsigned int uboot_size, void *vdst)
 #else
 static int nand_load(uint32_t offs, unsigned int uboot_size, void *vdst)
@@ -221,7 +221,7 @@ static int nand_load(uint32_t offs, unsigned int uboot_size, void *vdst)
  * Defines a static function nand_load_image() here, because non-static makes
  * the code too large for certain SPLs(minimal SPL, maximum size <= 4Kbytes)
  */
-#ifndef CONFIG_TPL_BUILD
+#if !defined(CONFIG_TPL_BUILD) && !defined(CONFIG_SPL_BUILD)
 #define nand_spl_load_image(offs, uboot_size, vdst) \
 	nand_load(offs, uboot_size, vdst)
 #endif
-- 
1.7.9.5

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

* [U-Boot] [PATCH 6/10] driver/ifc: define nand_spl_load_image() for SPL
  2014-03-31 10:04 [U-Boot] [PATCH 6/10] driver/ifc: define nand_spl_load_image() for SPL Prabhakar Kushwaha
@ 2014-04-01 22:03 ` Scott Wood
  2014-04-02  4:21   ` Prabhakar Kushwaha
  0 siblings, 1 reply; 4+ messages in thread
From: Scott Wood @ 2014-04-01 22:03 UTC (permalink / raw)
  To: u-boot

On Mon, 2014-03-31 at 15:34 +0530, Prabhakar Kushwaha wrote:
> nand_spl_load_image() can also be used for non TPL framework.
> 
> Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
> ---
>  drivers/mtd/nand/fsl_ifc_spl.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/nand/fsl_ifc_spl.c b/drivers/mtd/nand/fsl_ifc_spl.c
> index 2f82f7c..8a7a3a3 100644
> --- a/drivers/mtd/nand/fsl_ifc_spl.c
> +++ b/drivers/mtd/nand/fsl_ifc_spl.c
> @@ -88,7 +88,7 @@ static inline int bad_block(uchar *marker, int port_size)
>  		return __raw_readw((u16 *)marker) != 0xffff;
>  }
>  
> -#ifdef CONFIG_TPL_BUILD
> +#if defined(CONFIG_TPL_BUILD) || defined(CONFIG_SPL_BUILD)
>  int nand_spl_load_image(uint32_t offs, unsigned int uboot_size, void *vdst)
>  #else
>  static int nand_load(uint32_t offs, unsigned int uboot_size, void *vdst)
> @@ -221,7 +221,7 @@ static int nand_load(uint32_t offs, unsigned int uboot_size, void *vdst)
>   * Defines a static function nand_load_image() here, because non-static makes
>   * the code too large for certain SPLs(minimal SPL, maximum size <= 4Kbytes)
>   */
> -#ifndef CONFIG_TPL_BUILD
> +#if !defined(CONFIG_TPL_BUILD) && !defined(CONFIG_SPL_BUILD)
>  #define nand_spl_load_image(offs, uboot_size, vdst) \
>  	nand_load(offs, uboot_size, vdst)
>  #endif

When would you ever use this file without having CONFIG_SPL_BUILD
defined?

-Scott

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

* [U-Boot] [PATCH 6/10] driver/ifc: define nand_spl_load_image() for SPL
  2014-04-01 22:03 ` Scott Wood
@ 2014-04-02  4:21   ` Prabhakar Kushwaha
  2014-04-02 18:06     ` Scott Wood
  0 siblings, 1 reply; 4+ messages in thread
From: Prabhakar Kushwaha @ 2014-04-02  4:21 UTC (permalink / raw)
  To: u-boot


On 4/2/2014 3:33 AM, Scott Wood wrote:
> On Mon, 2014-03-31 at 15:34 +0530, Prabhakar Kushwaha wrote:
>> nand_spl_load_image() can also be used for non TPL framework.
>>
>> Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
>> ---
>>   drivers/mtd/nand/fsl_ifc_spl.c |    4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/mtd/nand/fsl_ifc_spl.c b/drivers/mtd/nand/fsl_ifc_spl.c
>> index 2f82f7c..8a7a3a3 100644
>> --- a/drivers/mtd/nand/fsl_ifc_spl.c
>> +++ b/drivers/mtd/nand/fsl_ifc_spl.c
>> @@ -88,7 +88,7 @@ static inline int bad_block(uchar *marker, int port_size)
>>   		return __raw_readw((u16 *)marker) != 0xffff;
>>   }
>>   
>> -#ifdef CONFIG_TPL_BUILD
>> +#if defined(CONFIG_TPL_BUILD) || defined(CONFIG_SPL_BUILD)
>>   int nand_spl_load_image(uint32_t offs, unsigned int uboot_size, void *vdst)
>>   #else
>>   static int nand_load(uint32_t offs, unsigned int uboot_size, void *vdst)
>> @@ -221,7 +221,7 @@ static int nand_load(uint32_t offs, unsigned int uboot_size, void *vdst)
>>    * Defines a static function nand_load_image() here, because non-static makes
>>    * the code too large for certain SPLs(minimal SPL, maximum size <= 4Kbytes)
>>    */
>> -#ifndef CONFIG_TPL_BUILD
>> +#if !defined(CONFIG_TPL_BUILD) && !defined(CONFIG_SPL_BUILD)
>>   #define nand_spl_load_image(offs, uboot_size, vdst) \
>>   	nand_load(offs, uboot_size, vdst)
>>   #endif
> When would you ever use this file without having CONFIG_SPL_BUILD
> defined?

I want to use nand_spl_load_image in spl.c as it is defined in 
include/nand.h

Unfortunately, it is only defined for CONFIG_TPL_BUILD.
If i remove !CONFIG_SPL_BUILD from second place. this will enable 
nand_load() which i don't want to use.

will it be possible to change all nand_load to nand_spl_load_image() 
permanently.  the only impact I see of "static".
nand_load is static and nand_spl_load_image is not static function 
declaration.

Regards,
Prabhakar

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

* [U-Boot] [PATCH 6/10] driver/ifc: define nand_spl_load_image() for SPL
  2014-04-02  4:21   ` Prabhakar Kushwaha
@ 2014-04-02 18:06     ` Scott Wood
  0 siblings, 0 replies; 4+ messages in thread
From: Scott Wood @ 2014-04-02 18:06 UTC (permalink / raw)
  To: u-boot

On Wed, 2014-04-02 at 09:51 +0530, Prabhakar Kushwaha wrote:
> On 4/2/2014 3:33 AM, Scott Wood wrote:
> > On Mon, 2014-03-31 at 15:34 +0530, Prabhakar Kushwaha wrote:
> >> nand_spl_load_image() can also be used for non TPL framework.
> >>
> >> Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
> >> ---
> >>   drivers/mtd/nand/fsl_ifc_spl.c |    4 ++--
> >>   1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/mtd/nand/fsl_ifc_spl.c b/drivers/mtd/nand/fsl_ifc_spl.c
> >> index 2f82f7c..8a7a3a3 100644
> >> --- a/drivers/mtd/nand/fsl_ifc_spl.c
> >> +++ b/drivers/mtd/nand/fsl_ifc_spl.c
> >> @@ -88,7 +88,7 @@ static inline int bad_block(uchar *marker, int port_size)
> >>   		return __raw_readw((u16 *)marker) != 0xffff;
> >>   }
> >>   
> >> -#ifdef CONFIG_TPL_BUILD
> >> +#if defined(CONFIG_TPL_BUILD) || defined(CONFIG_SPL_BUILD)
> >>   int nand_spl_load_image(uint32_t offs, unsigned int uboot_size, void *vdst)
> >>   #else
> >>   static int nand_load(uint32_t offs, unsigned int uboot_size, void *vdst)
> >> @@ -221,7 +221,7 @@ static int nand_load(uint32_t offs, unsigned int uboot_size, void *vdst)
> >>    * Defines a static function nand_load_image() here, because non-static makes
> >>    * the code too large for certain SPLs(minimal SPL, maximum size <= 4Kbytes)
> >>    */
> >> -#ifndef CONFIG_TPL_BUILD
> >> +#if !defined(CONFIG_TPL_BUILD) && !defined(CONFIG_SPL_BUILD)
> >>   #define nand_spl_load_image(offs, uboot_size, vdst) \
> >>   	nand_load(offs, uboot_size, vdst)
> >>   #endif
> > When would you ever use this file without having CONFIG_SPL_BUILD
> > defined?
> 
> I want to use nand_spl_load_image in spl.c as it is defined in 
> include/nand.h
> 
> Unfortunately, it is only defined for CONFIG_TPL_BUILD.
> If i remove !CONFIG_SPL_BUILD from second place. this will enable 
> nand_load() which i don't want to use.

I'm not saying to remove !CONFIG_SPL_BUILD.  I'm saying to remove the
ifdef (and all the nand_load stuff) entirely.

> will it be possible to change all nand_load to nand_spl_load_image() 
> permanently.  the only impact I see of "static".
> nand_load is static and nand_spl_load_image is not static function 
> declaration.

Yes.  It was done on eLBC because using a static function saved a few
critical bytes.  IFC has more breathing room due to the 8K SPL, so
apparently it doesn't need this.

-Scott

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

end of thread, other threads:[~2014-04-02 18:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-31 10:04 [U-Boot] [PATCH 6/10] driver/ifc: define nand_spl_load_image() for SPL Prabhakar Kushwaha
2014-04-01 22:03 ` Scott Wood
2014-04-02  4:21   ` Prabhakar Kushwaha
2014-04-02 18:06     ` Scott Wood

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