diff mbox

[U-Boot,v5,18/25] SPL: NAND: Move arch/arm/cpu/armv7/omap-common/spl_nand.c to common/spl

Message ID 1346109527-17182-19-git-send-email-trini@ti.com
State Superseded
Headers show

Commit Message

Tom Rini Aug. 27, 2012, 11:18 p.m. UTC
We move the spl_nand_load_image function to common/spl.  This will allow
for easier integration of SPL-boots-Linux code on other arches.

Signed-off-by: Tom Rini <trini@ti.com>
---
Changes in v4:
- Leave nand_spl_load.c alone, move the new load into nand_spl_simple.c

Changes in v5:
  after talking with Scott Wood
- Move the file to common/spl/ rather than integrate with another file,

 arch/arm/cpu/armv7/omap-common/Makefile            |    6 ------
 common/spl/Makefile                                |    1 +
 .../armv7/omap-common => common/spl}/spl_nand.c    |   10 ++++------
 3 files changed, 5 insertions(+), 12 deletions(-)
 rename {arch/arm/cpu/armv7/omap-common => common/spl}/spl_nand.c (94%)

Comments

Scott Wood Aug. 27, 2012, 11:22 p.m. UTC | #1
On 08/27/2012 06:18 PM, Tom Rini wrote:
> diff --git a/common/spl/Makefile b/common/spl/Makefile
> index b61b438..7a77cd3 100644
> --- a/common/spl/Makefile
> +++ b/common/spl/Makefile
> @@ -16,6 +16,7 @@ LIB	= $(obj)libspl.o
>  ifdef CONFIG_SPL_BUILD
>  COBJS-$(CONFIG_SPL_FRAMEWORK) += spl.o
>  COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += spl_ymodem.o
> +COBJS-$(CONFIG_SPL_NAND_SIMPLE) += spl_nand.o

Please use a separate config symbol for this.

-Scott
Tom Rini Aug. 28, 2012, 12:36 a.m. UTC | #2
On 08/27/2012 04:22 PM, Scott Wood wrote:
> On 08/27/2012 06:18 PM, Tom Rini wrote:
>> diff --git a/common/spl/Makefile b/common/spl/Makefile
>> index b61b438..7a77cd3 100644
>> --- a/common/spl/Makefile
>> +++ b/common/spl/Makefile
>> @@ -16,6 +16,7 @@ LIB	= $(obj)libspl.o
>>  ifdef CONFIG_SPL_BUILD
>>  COBJS-$(CONFIG_SPL_FRAMEWORK) += spl.o
>>  COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += spl_ymodem.o
>> +COBJS-$(CONFIG_SPL_NAND_SIMPLE) += spl_nand.o
> 
> Please use a separate config symbol for this.

No need, common/spl/libspl.o is dependent on CONFIG_SPL_FRAMEWORK
Scott Wood Aug. 28, 2012, 12:38 a.m. UTC | #3
On 08/27/2012 07:36 PM, Tom Rini wrote:
> On 08/27/2012 04:22 PM, Scott Wood wrote:
>> On 08/27/2012 06:18 PM, Tom Rini wrote:
>>> diff --git a/common/spl/Makefile b/common/spl/Makefile
>>> index b61b438..7a77cd3 100644
>>> --- a/common/spl/Makefile
>>> +++ b/common/spl/Makefile
>>> @@ -16,6 +16,7 @@ LIB	= $(obj)libspl.o
>>>  ifdef CONFIG_SPL_BUILD
>>>  COBJS-$(CONFIG_SPL_FRAMEWORK) += spl.o
>>>  COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += spl_ymodem.o
>>> +COBJS-$(CONFIG_SPL_NAND_SIMPLE) += spl_nand.o
>>
>> Please use a separate config symbol for this.
> 
> No need, common/spl/libspl.o is dependent on CONFIG_SPL_FRAMEWORK

Do you not want it to be possible for hardware which cannot use
CONFIG_SPL_NAND_SIMPLE to use this?

-Scott
Tom Rini Aug. 28, 2012, 12:53 a.m. UTC | #4
On 08/27/2012 05:38 PM, Scott Wood wrote:
> On 08/27/2012 07:36 PM, Tom Rini wrote:
>> On 08/27/2012 04:22 PM, Scott Wood wrote:
>>> On 08/27/2012 06:18 PM, Tom Rini wrote:
>>>> diff --git a/common/spl/Makefile b/common/spl/Makefile
>>>> index b61b438..7a77cd3 100644
>>>> --- a/common/spl/Makefile
>>>> +++ b/common/spl/Makefile
>>>> @@ -16,6 +16,7 @@ LIB	= $(obj)libspl.o
>>>>  ifdef CONFIG_SPL_BUILD
>>>>  COBJS-$(CONFIG_SPL_FRAMEWORK) += spl.o
>>>>  COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += spl_ymodem.o
>>>> +COBJS-$(CONFIG_SPL_NAND_SIMPLE) += spl_nand.o
>>>
>>> Please use a separate config symbol for this.
>>
>> No need, common/spl/libspl.o is dependent on CONFIG_SPL_FRAMEWORK
> 
> Do you not want it to be possible for hardware which cannot use
> CONFIG_SPL_NAND_SIMPLE to use this?

OK, you're right.  I wish we had another NAND driver already :)  Yes,
this should be CONFIG_SPL_NAND_SUPPORT.  The code depends on (and
wouldn't make sense to separate since it would become
CONFIG_SPL_NAND_LOAD, +-) CONFIG_SPL_FRAMEWORK.  But another NAND driver
should provide the required functions.
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/omap-common/Makefile b/arch/arm/cpu/armv7/omap-common/Makefile
index 837e22e..0e0b641 100644
--- a/arch/arm/cpu/armv7/omap-common/Makefile
+++ b/arch/arm/cpu/armv7/omap-common/Makefile
@@ -45,12 +45,6 @@  COBJS	+= boot-common.o
 SOBJS	+= lowlevel_init.o
 endif
 
-ifdef CONFIG_SPL_BUILD
-ifdef CONFIG_SPL_NAND_SUPPORT
-COBJS	+= spl_nand.o
-endif
-endif
-
 ifndef CONFIG_SPL_BUILD
 ifneq ($(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),)
 COBJS	+= mem-common.o
diff --git a/common/spl/Makefile b/common/spl/Makefile
index b61b438..7a77cd3 100644
--- a/common/spl/Makefile
+++ b/common/spl/Makefile
@@ -16,6 +16,7 @@  LIB	= $(obj)libspl.o
 ifdef CONFIG_SPL_BUILD
 COBJS-$(CONFIG_SPL_FRAMEWORK) += spl.o
 COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += spl_ymodem.o
+COBJS-$(CONFIG_SPL_NAND_SIMPLE) += spl_nand.o
 endif
 
 COBJS	:= $(sort $(COBJS-y))
diff --git a/arch/arm/cpu/armv7/omap-common/spl_nand.c b/common/spl/spl_nand.c
similarity index 94%
rename from arch/arm/cpu/armv7/omap-common/spl_nand.c
rename to common/spl/spl_nand.c
index 9e9206c..61de5a4 100644
--- a/arch/arm/cpu/armv7/omap-common/spl_nand.c
+++ b/common/spl/spl_nand.c
@@ -21,12 +21,10 @@ 
  * MA 02111-1307 USA
  */
 #include <common.h>
+#include <config.h>
 #include <spl.h>
-#include <asm/u-boot.h>
-#include <asm/utils.h>
 #include <asm/io.h>
 #include <nand.h>
-#include <version.h>
 
 void spl_nand_load_image(void)
 {
@@ -71,10 +69,10 @@  void spl_nand_load_image(void)
 			nand_deselect();
 			return;
 		} else {
-			printf("The Expected Linux image was not"
-				"found. Please check your NAND"
+			puts("The Expected Linux image was not "
+				"found. Please check your NAND "
 				"configuration.\n");
-			printf("Trying to start u-boot now...\n");
+			puts("Trying to start u-boot now...\n");
 		}
 	}
 #endif