Re: [U-Boot] [RFC PATCH 3/8] arm, davinci: Add SPL support for DA850 SoCs

2011-11-15 Thread Heiko Schocher
Hello Christian,

Christian Riesch wrote:
> Hello Heiko,
> thanks for your comments!
> 
> On Wed, Nov 16, 2011 at 7:35 AM, Heiko Schocher  wrote:
>> Christian Riesch wrote:
>>> Signed-off-by: Christian Riesch 
>>> Cc: Heiko Schocher 
>>> Cc: Sandeep Paulraj 
>>> ---
>>>  arch/arm/cpu/arm926ejs/davinci/Makefile |3 ++-
>>>  arch/arm/cpu/arm926ejs/davinci/spl.c|   11 ++-
>>>  2 files changed, 12 insertions(+), 2 deletions(-)
>>>
> [...]
>>> diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c 
>>> b/arch/arm/cpu/arm926ejs/davinci/spl.c
>>> index d9b9398..bb4ee13 100644
>>> --- a/arch/arm/cpu/arm926ejs/davinci/spl.c
>>> +++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
> [...]
>>>  void board_init_r(gd_t *id, ulong dummy)
>>>  {
>>> -
>>> +#ifdef CONFIG_SOC_DM365
>>>   nand_init();
>>>   puts("Nand boot...\n");
>>>   nand_boot();
>>> +#endif
>>> +#ifdef CONFIG_SOC_DA8XX
>>> + hang();
>>> +#endif
>> Maybe a comment why you call hang() here (I think because SPL code
>> is not yet tried out on da8xx) would help here.
> 
> The code is tested on da8xx (the AM1808 I tested it on is part of the
> da8xx family) but as I didn't yet look into loading an u-boot image
> from SPI flash (which I should do here for the da850evm) I just call
> hang() here. I commented on this in the cover message:
> 
> ---snip---
> This patchset is not a complete implementation, it is missing the
> code that is actually used to load u-boot from SPI flash to the
> DDR memory. The code just hangs after the initialization is done. But
> I submit it nevertheless as RFC and I am looking forward to your comments.
> ---snip---

Ups .. sorry ... missed it. Hmm... have you no u-boot image on this
board (for example in nand)? Then you could load as an example this
code ...

Hmm.. as it is a RFC ... maybe we should go the following way:
(just a fast idea):

create new file u-boot:spl/boot.c:

/* could be board specific */
static int __weak get_boot_method(void)
{
#if defined SPL_BOOTMETHOD_NAND
return SPL_BOOTMETHOD_NAND
#endif
#if defined SPL_BOOTMETHOD_SPI
return SPL_BOOTMETHOD_SPI
#endif
[...]

/*
 * if more options are defined for one board
 * board specific code has to be written, to decide
 * which boot method is used (gpio pin?)
 * So it is possible to boot from different
 * devices...
 */
}

void board_init_r(gd_t *id, ulong dummy)
{
int boot_method;

boot_method = get_boot_method();
switch (boot_ethod) {
#if defined SPL_BOOTMETHOD_NAND
case SPL_BOOTMETHOD_NAND:
nand_init();
puts("Nand boot...\n");
nand_boot();
break;
#endif
#if defined SPL_BOOTMETHOD_SPI
case SPL_BOOTMETHOD_NAND:
puts("SPI boot...\n");
break;
#endif
default:
/* error */
puts("no valid boot method\n");
hang();
break;
}
}

That should be usable from other architectures too ...

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH 3/8] arm, davinci: Add SPL support for DA850 SoCs

2011-11-15 Thread Christian Riesch
Hello Heiko,
thanks for your comments!

On Wed, Nov 16, 2011 at 7:35 AM, Heiko Schocher  wrote:
> Christian Riesch wrote:
>> Signed-off-by: Christian Riesch 
>> Cc: Heiko Schocher 
>> Cc: Sandeep Paulraj 
>> ---
>>  arch/arm/cpu/arm926ejs/davinci/Makefile |    3 ++-
>>  arch/arm/cpu/arm926ejs/davinci/spl.c    |   11 ++-
>>  2 files changed, 12 insertions(+), 2 deletions(-)
>>
[...]
>> diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c 
>> b/arch/arm/cpu/arm926ejs/davinci/spl.c
>> index d9b9398..bb4ee13 100644
>> --- a/arch/arm/cpu/arm926ejs/davinci/spl.c
>> +++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
[...]
>>  void board_init_r(gd_t *id, ulong dummy)
>>  {
>> -
>> +#ifdef CONFIG_SOC_DM365
>>       nand_init();
>>       puts("Nand boot...\n");
>>       nand_boot();
>> +#endif
>> +#ifdef CONFIG_SOC_DA8XX
>> +     hang();
>> +#endif
>
> Maybe a comment why you call hang() here (I think because SPL code
> is not yet tried out on da8xx) would help here.

The code is tested on da8xx (the AM1808 I tested it on is part of the
da8xx family) but as I didn't yet look into loading an u-boot image
from SPI flash (which I should do here for the da850evm) I just call
hang() here. I commented on this in the cover message:

---snip---
This patchset is not a complete implementation, it is missing the
code that is actually used to load u-boot from SPI flash to the
DDR memory. The code just hangs after the initialization is done. But
I submit it nevertheless as RFC and I am looking forward to your comments.
---snip---

Regards, Christian
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH 3/8] arm, davinci: Add SPL support for DA850 SoCs

2011-11-15 Thread Heiko Schocher
Hello Christian,

Christian Riesch wrote:
> Signed-off-by: Christian Riesch 
> Cc: Heiko Schocher 
> Cc: Sandeep Paulraj 
> ---
>  arch/arm/cpu/arm926ejs/davinci/Makefile |3 ++-
>  arch/arm/cpu/arm926ejs/davinci/spl.c|   11 ++-
>  2 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/cpu/arm926ejs/davinci/Makefile 
> b/arch/arm/cpu/arm926ejs/davinci/Makefile
> index 2105ec5..99df0df 100644
> --- a/arch/arm/cpu/arm926ejs/davinci/Makefile
> +++ b/arch/arm/cpu/arm926ejs/davinci/Makefile
> @@ -37,7 +37,8 @@ COBJS-$(CONFIG_DRIVER_TI_EMAC)  += lxt972.o dp83848.o 
> et1011c.o ksz8873.o
>  
>  ifdef CONFIG_SPL_BUILD
>  COBJS-y  += spl.o
> -COBJS-y  += dm365_lowlevel.o
> +COBJS-$(CONFIG_SOC_DM365)+= dm365_lowlevel.o
> +COBJS-$(CONFIG_SOC_DA8XX)+= da850_lowlevel.o
>  endif
>  
>  SOBJS= reset.o
> diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c 
> b/arch/arm/cpu/arm926ejs/davinci/spl.c
> index d9b9398..bb4ee13 100644
> --- a/arch/arm/cpu/arm926ejs/davinci/spl.c
> +++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
> @@ -50,14 +50,23 @@ inline void hang(void)
>  
>  void board_init_f(ulong dummy)
>  {
> +#ifdef CONFIG_SOC_DM365
>   dm36x_lowlevel_init(0);
> +#endif
> +#ifdef CONFIG_SOC_DA8XX
> + arch_cpu_init();
> +#endif
>   relocate_code(CONFIG_SPL_STACK, NULL, CONFIG_SPL_TEXT_BASE);
>  }
>  
>  void board_init_r(gd_t *id, ulong dummy)
>  {
> -
> +#ifdef CONFIG_SOC_DM365
>   nand_init();
>   puts("Nand boot...\n");
>   nand_boot();
> +#endif
> +#ifdef CONFIG_SOC_DA8XX
> + hang();
> +#endif

Maybe a comment why you call hang() here (I think because SPL code
is not yet tried out on da8xx) would help here. Beside of that:

Acked-by: Heiko Schocher 

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 3/8] arm, davinci: Add SPL support for DA850 SoCs

2011-11-15 Thread Christian Riesch

Signed-off-by: Christian Riesch 
Cc: Heiko Schocher 
Cc: Sandeep Paulraj 
---
 arch/arm/cpu/arm926ejs/davinci/Makefile |3 ++-
 arch/arm/cpu/arm926ejs/davinci/spl.c|   11 ++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/davinci/Makefile 
b/arch/arm/cpu/arm926ejs/davinci/Makefile
index 2105ec5..99df0df 100644
--- a/arch/arm/cpu/arm926ejs/davinci/Makefile
+++ b/arch/arm/cpu/arm926ejs/davinci/Makefile
@@ -37,7 +37,8 @@ COBJS-$(CONFIG_DRIVER_TI_EMAC)+= lxt972.o dp83848.o 
et1011c.o ksz8873.o
 
 ifdef CONFIG_SPL_BUILD
 COBJS-y+= spl.o
-COBJS-y+= dm365_lowlevel.o
+COBJS-$(CONFIG_SOC_DM365)  += dm365_lowlevel.o
+COBJS-$(CONFIG_SOC_DA8XX)  += da850_lowlevel.o
 endif
 
 SOBJS  = reset.o
diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c 
b/arch/arm/cpu/arm926ejs/davinci/spl.c
index d9b9398..bb4ee13 100644
--- a/arch/arm/cpu/arm926ejs/davinci/spl.c
+++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
@@ -50,14 +50,23 @@ inline void hang(void)
 
 void board_init_f(ulong dummy)
 {
+#ifdef CONFIG_SOC_DM365
dm36x_lowlevel_init(0);
+#endif
+#ifdef CONFIG_SOC_DA8XX
+   arch_cpu_init();
+#endif
relocate_code(CONFIG_SPL_STACK, NULL, CONFIG_SPL_TEXT_BASE);
 }
 
 void board_init_r(gd_t *id, ulong dummy)
 {
-
+#ifdef CONFIG_SOC_DM365
nand_init();
puts("Nand boot...\n");
nand_boot();
+#endif
+#ifdef CONFIG_SOC_DA8XX
+   hang();
+#endif
 }
-- 
1.7.0.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot