diff mbox

[U-Boot,V6,5/5] devkit8000: Add nand-spl support for new SPL

Message ID 1311842291-24837-6-git-send-email-simonschwarzcor@gmail.com
State Superseded
Headers show

Commit Message

Simon Schwarz July 28, 2011, 8:38 a.m. UTC
Add NAND SPL support to the devkit8000 config

Signed-off-by: Simon Schwarz <simonschwarzcor@gmail.com>
---
V1 changes:
ADD devkit8000_nand to board.cfg
ADD nand_spl Makefile, llinker script, spl-devkit8000.c
ADD config ecc, SRAM, SPL to board config
ADD CONFIG_SYS_SRAM_START and _SIZE to board config
ADD CONFIG_SYS_SPL_TEXT_BASE, _MAX_SIZE and SPL_STACK to board config

V2 changes:
ADD CONFIG_SPL and LIBCOMMON, LIBDISK, I2C, LIBGENERIC, SERIAL, POWER, NAND and
	CONFIG_SPL_LDSCRIPT to board config
CHG renamed CONFIG_SYS_SPL_* to CONFIG_SPL_*
ADD CONFIG_SYS_NAND_U_BOOT_START, _OFFS, _SIZE, _DST to board config: Where to
	expect u-boot and where to load it.
ADD some barrier to not build board_eth_init in SPL
DEL no changes to board.cfg
DEL everything used the old nand_spl layout (Makefile, linker script,
	spl-devkit8000.c)
CHG cosmetic

V3 changes:
CHG Deleted wrong comment

V4 changes:
CHG CONFIG_SYS_SRAM_SIZE NOW has the right value
CHG cosmetic - corrected style problems

V5 changes:
nothing

V6 changes:
nothing

Transition from V1 to V2 also includes that this patch is now based on
	- the new SPL layout by Aneesh V and Daniel Schwierzeck
  	- the OMAP4 SPL patches by Aneesh V

This is the successor of "[U-Boot,5/5] devkit8000 nand_spl: add nand_spl
support"
(http://article.gmane.org/gmane.comp.boot-loaders.u-boot/102111)
---
 board/timll/devkit8000/devkit8000.c |    2 +-
 include/configs/devkit8000.h        |   46 +++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 1 deletions(-)

Comments

Aneesh V July 28, 2011, 10:51 a.m. UTC | #1
On Thursday 28 July 2011 02:08 PM, Simon Schwarz wrote:
> Add NAND SPL support to the devkit8000 config
>
> Signed-off-by: Simon Schwarz<simonschwarzcor@gmail.com>
> ---
> V1 changes:
> ADD devkit8000_nand to board.cfg
> ADD nand_spl Makefile, llinker script, spl-devkit8000.c
> ADD config ecc, SRAM, SPL to board config
> ADD CONFIG_SYS_SRAM_START and _SIZE to board config
> ADD CONFIG_SYS_SPL_TEXT_BASE, _MAX_SIZE and SPL_STACK to board config
>
> V2 changes:
> ADD CONFIG_SPL and LIBCOMMON, LIBDISK, I2C, LIBGENERIC, SERIAL, POWER, NAND and
> 	CONFIG_SPL_LDSCRIPT to board config
> CHG renamed CONFIG_SYS_SPL_* to CONFIG_SPL_*
> ADD CONFIG_SYS_NAND_U_BOOT_START, _OFFS, _SIZE, _DST to board config: Where to
> 	expect u-boot and where to load it.
> ADD some barrier to not build board_eth_init in SPL
> DEL no changes to board.cfg
> DEL everything used the old nand_spl layout (Makefile, linker script,
> 	spl-devkit8000.c)
> CHG cosmetic
>
> V3 changes:
> CHG Deleted wrong comment
>
> V4 changes:
> CHG CONFIG_SYS_SRAM_SIZE NOW has the right value
> CHG cosmetic - corrected style problems
>
> V5 changes:
> nothing
>
> V6 changes:
> nothing
>
> Transition from V1 to V2 also includes that this patch is now based on
> 	- the new SPL layout by Aneesh V and Daniel Schwierzeck
>    	- the OMAP4 SPL patches by Aneesh V
>
> This is the successor of "[U-Boot,5/5] devkit8000 nand_spl: add nand_spl
> support"
> (http://article.gmane.org/gmane.comp.boot-loaders.u-boot/102111)
> ---
>   board/timll/devkit8000/devkit8000.c |    2 +-
>   include/configs/devkit8000.h        |   46 +++++++++++++++++++++++++++++++++++
>   2 files changed, 47 insertions(+), 1 deletions(-)
>
> diff --git a/board/timll/devkit8000/devkit8000.c b/board/timll/devkit8000/devkit8000.c
> index 95afaaa..9b53742 100644
> --- a/board/timll/devkit8000/devkit8000.c
> +++ b/board/timll/devkit8000/devkit8000.c
> @@ -119,7 +119,7 @@ void set_muxconf_regs(void)
>   	MUX_DEVKIT8000();
>   }
>
> -#ifdef CONFIG_DRIVER_DM9000
> +#if defined(CONFIG_DRIVER_DM9000)&  !defined(CONFIG_SPL_BUILD)
>   /*
>    * Routine: board_eth_init
>    * Description: Setting up the Ethernet hardware.
> diff --git a/include/configs/devkit8000.h b/include/configs/devkit8000.h
> index 125c690..022069d 100644
> --- a/include/configs/devkit8000.h
> +++ b/include/configs/devkit8000.h
> @@ -307,4 +307,50 @@
>   		                                         CONFIG_SYS_INIT_RAM_SIZE - \
>   		                                         GENERATED_GBL_DATA_SIZE)
>
> +/* SRAM config */
> +#define CONFIG_SYS_SRAM_START              0x40200000
> +#define CONFIG_SYS_SRAM_SIZE               0x10000

OMAP3 secure devices do not have this much public SRAM. So, the above
values wouldn't work for it. I suggest the following values:

#define CONFIG_SYS_SRAM_START              0x40208000
#define CONFIG_SYS_SRAM_SIZE               0x8000 /* 32 KB */

#define CONFIG_SPL_TEXT_BASE		CONFIG_SYS_SRAM_START
#define CONFIG_SPL_MAX_SIZE		0x7C00  /* 31 K  - set aside at least 1K 
for stack*/

best regards,
Aneesh
Simon Schwarz July 28, 2011, 11:54 a.m. UTC | #2
Hi Aneesh,

On 07/28/2011 12:51 PM, Aneesh V wrote:
> On Thursday 28 July 2011 02:08 PM, Simon Schwarz wrote:
>> Add NAND SPL support to the devkit8000 config
>>
>> Signed-off-by: Simon Schwarz<simonschwarzcor@gmail.com>
>> ---
>> V1 changes:
>> ADD devkit8000_nand to board.cfg
>> ADD nand_spl Makefile, llinker script, spl-devkit8000.c
>> ADD config ecc, SRAM, SPL to board config
>> ADD CONFIG_SYS_SRAM_START and _SIZE to board config
>> ADD CONFIG_SYS_SPL_TEXT_BASE, _MAX_SIZE and SPL_STACK to board config
>>
>> V2 changes:
>> ADD CONFIG_SPL and LIBCOMMON, LIBDISK, I2C, LIBGENERIC, SERIAL, POWER,
>> NAND and
>> CONFIG_SPL_LDSCRIPT to board config
>> CHG renamed CONFIG_SYS_SPL_* to CONFIG_SPL_*
>> ADD CONFIG_SYS_NAND_U_BOOT_START, _OFFS, _SIZE, _DST to board config:
>> Where to
>> expect u-boot and where to load it.
>> ADD some barrier to not build board_eth_init in SPL
>> DEL no changes to board.cfg
>> DEL everything used the old nand_spl layout (Makefile, linker script,
>> spl-devkit8000.c)
>> CHG cosmetic
>>
>> V3 changes:
>> CHG Deleted wrong comment
>>
>> V4 changes:
>> CHG CONFIG_SYS_SRAM_SIZE NOW has the right value
>> CHG cosmetic - corrected style problems
>>
>> V5 changes:
>> nothing
>>
>> V6 changes:
>> nothing
>>
>> Transition from V1 to V2 also includes that this patch is now based on
>> - the new SPL layout by Aneesh V and Daniel Schwierzeck
>> - the OMAP4 SPL patches by Aneesh V
>>
>> This is the successor of "[U-Boot,5/5] devkit8000 nand_spl: add nand_spl
>> support"
>> (http://article.gmane.org/gmane.comp.boot-loaders.u-boot/102111)
>> ---
>> board/timll/devkit8000/devkit8000.c | 2 +-
>> include/configs/devkit8000.h | 46 +++++++++++++++++++++++++++++++++++
>> 2 files changed, 47 insertions(+), 1 deletions(-)
>>
>> diff --git a/board/timll/devkit8000/devkit8000.c
>> b/board/timll/devkit8000/devkit8000.c
>> index 95afaaa..9b53742 100644
>> --- a/board/timll/devkit8000/devkit8000.c
>> +++ b/board/timll/devkit8000/devkit8000.c
>> @@ -119,7 +119,7 @@ void set_muxconf_regs(void)
>> MUX_DEVKIT8000();
>> }
>>
>> -#ifdef CONFIG_DRIVER_DM9000
>> +#if defined(CONFIG_DRIVER_DM9000)& !defined(CONFIG_SPL_BUILD)
>> /*
>> * Routine: board_eth_init
>> * Description: Setting up the Ethernet hardware.
>> diff --git a/include/configs/devkit8000.h b/include/configs/devkit8000.h
>> index 125c690..022069d 100644
>> --- a/include/configs/devkit8000.h
>> +++ b/include/configs/devkit8000.h
>> @@ -307,4 +307,50 @@
>> CONFIG_SYS_INIT_RAM_SIZE - \
>> GENERATED_GBL_DATA_SIZE)
>>
>> +/* SRAM config */
>> +#define CONFIG_SYS_SRAM_START 0x40200000
>> +#define CONFIG_SYS_SRAM_SIZE 0x10000
>
> OMAP3 secure devices do not have this much public SRAM. So, the above
> values wouldn't work for it. I suggest the following values:

> #define CONFIG_SYS_SRAM_START 0x40208000
> #define CONFIG_SYS_SRAM_SIZE 0x8000 /* 32 KB */
>
> #define CONFIG_SPL_TEXT_BASE CONFIG_SYS_SRAM_START
> #define CONFIG_SPL_MAX_SIZE 0x7C00 /* 31 K - set aside at least 1K for
> stack*/

What do you mean by secure devices? Custom processors? The datasheet i 
have says 64K for OMAP35x devices.

Since this is the configuration for the devkit8000 and these devices 
have 64K SRAM I would prefer to leave these settings as they are.

If the SPL is ported to other OMAP3 devs with just 32K they can change 
the settings then. (At the moment the NAND SPL has 19K so this won't be 
a problem)

>
> best regards,
> Aneesh

Regards & thanks for reviewing
Simon
diff mbox

Patch

diff --git a/board/timll/devkit8000/devkit8000.c b/board/timll/devkit8000/devkit8000.c
index 95afaaa..9b53742 100644
--- a/board/timll/devkit8000/devkit8000.c
+++ b/board/timll/devkit8000/devkit8000.c
@@ -119,7 +119,7 @@  void set_muxconf_regs(void)
 	MUX_DEVKIT8000();
 }
 
-#ifdef CONFIG_DRIVER_DM9000
+#if defined(CONFIG_DRIVER_DM9000) & !defined(CONFIG_SPL_BUILD)
 /*
  * Routine: board_eth_init
  * Description: Setting up the Ethernet hardware.
diff --git a/include/configs/devkit8000.h b/include/configs/devkit8000.h
index 125c690..022069d 100644
--- a/include/configs/devkit8000.h
+++ b/include/configs/devkit8000.h
@@ -307,4 +307,50 @@ 
 		                                         CONFIG_SYS_INIT_RAM_SIZE - \
 		                                         GENERATED_GBL_DATA_SIZE)
 
+/* SRAM config */
+#define CONFIG_SYS_SRAM_START              0x40200000
+#define CONFIG_SYS_SRAM_SIZE               0x10000
+
+/* Defines for SPL */
+#define CONFIG_SPL
+
+#define CONFIG_SPL_LIBCOMMON_SUPPORT
+#define CONFIG_SPL_LIBDISK_SUPPORT
+#define CONFIG_SPL_I2C_SUPPORT
+#define CONFIG_SPL_LIBGENERIC_SUPPORT
+#define CONFIG_SPL_SERIAL_SUPPORT
+#define CONFIG_SPL_POWER_SUPPORT
+#define CONFIG_SPL_NAND_SUPPORT
+#define CONFIG_SPL_LDSCRIPT		"$(CPUDIR)/omap-common/u-boot-spl.lds"
+
+#define CONFIG_SPL_TEXT_BASE		0x40200000 /*CONFIG_SYS_SRAM_START*/
+#define CONFIG_SPL_MAX_SIZE		0xB400  /* 45 K */
+#define CONFIG_SPL_STACK		LOW_LEVEL_SRAM_STACK
+
+#define CONFIG_SPL_BSS_START_ADDR	0x80000000 /*CONFIG_SYS_SDRAM_BASE*/
+#define CONFIG_SPL_BSS_MAX_SIZE		0x80000
+
+/* NAND boot config */
+#define CONFIG_SYS_NAND_PAGE_COUNT	64
+#define CONFIG_SYS_NAND_PAGE_SIZE	2048
+#define CONFIG_SYS_NAND_OOBSIZE		64
+#define CONFIG_SYS_NAND_BLOCK_SIZE	(128*1024)
+#define CONFIG_SYS_NAND_BAD_BLOCK_POS	0
+#define CONFIG_SYS_NAND_ECCPOS		{2, 3, 4, 5, 6, 7, 8, 9,\
+						10, 11, 12, 13}
+
+#define CONFIG_SYS_NAND_ECCSIZE		512
+#define CONFIG_SYS_NAND_ECCBYTES	3
+
+#define CONFIG_SYS_NAND_ECCSTEPS	(CONFIG_SYS_NAND_PAGE_SIZE / \
+						CONFIG_SYS_NAND_ECCSIZE)
+#define CONFIG_SYS_NAND_ECCTOTAL       (CONFIG_SYS_NAND_ECCBYTES * \
+						CONFIG_SYS_NAND_ECCSTEPS)
+
+#define CONFIG_SYS_NAND_U_BOOT_START   CONFIG_SYS_NAND_U_BOOT_DST
+
+#define CONFIG_SYS_NAND_U_BOOT_OFFS	0x80000
+#define CONFIG_SYS_NAND_U_BOOT_SIZE	0x200000
+#define CONFIG_SYS_NAND_U_BOOT_DST	CONFIG_SYS_TEXT_BASE
+
 #endif /* __CONFIG_H */