[U-Boot] [PATCH] OMAP3: remove SZ definition in config definitions

Paulraj, Sandeep s-paulraj at ti.com
Wed Oct 7 04:26:32 CEST 2009



> Subject: [PATCH] OMAP3: remove SZ definition in config definitions
> 
> SZ definitions are deprecated as indicated by wd here:
> http://www.nabble.com/forum/Permalink.jtp?root=25518020&post=25584065&page
> =y
> 
> Fix by running the following script
> I=`cat include/asm-arm/sizes.h |grep SZ_|cut -d ' ' -f2`
> I=`cat include/asm-arm/sizes.h |grep SZ_|cut -d ' ' -f4-`
> sz_array=( $I )
> val_array=( $J )
> for file in include/configs/omap3_*;
> do
> 	x=0
> 	for i in $I
> 	do
> 		o=${sz_array[$x]}
> 		n=${val_array[$x]}
> 		cat $file |sed -e "s/$o/$n/g">b
> 		mv b $file
> 		x=$(( x + 1 ))
> 	done
> done
> 
> Signed-off-by: Nishanth Menon <nm at ti.com>
> Cc: Vikram Pandita <vikram.pandita at ti.com>
> Cc: Sandeep Paulraj <s-paulraj at ti.com>
> Cc: Tom Rix <tom.rix at windriver.com>
> Cc: Dirk Behme <dirk.behme at googlemail.com>
> ---
Nishanth, a general comment.

I submitted a similar patch for DaVinci. I had done the same things as you have done. But Wolfgang commented that instead of 0x00001000 it is better to use (4 << 10)

-#define CONFIG_STACKSIZE_IRQ	SZ_4K	/* IRQ stack */
-#define CONFIG_STACKSIZE_FIQ	SZ_4K	/* FIQ stack */
+#define CONFIG_STACKSIZE_IRQ	0x00001000	/* IRQ stack */
+#define CONFIG_STACKSIZE_FIQ	0x00001000	/* FIQ stack */

Taking the above as an example according to Wolfgang , you should have

+#define CONFIG_STACKSIZE_FIQ	(4 << 10)	/* IRQ stack of 4K */


Infact I have already submitted a patch for the above for OMAP, but I had to address some comments from Tom. Tom had commented on OMAP 2420 H4 specific code which had similar references. 

Thanks,
Sandeep


>  include/configs/omap3_beagle.h  |   16 ++++++++--------
>  include/configs/omap3_evm.h     |   16 ++++++++--------
>  include/configs/omap3_overo.h   |   16 ++++++++--------
>  include/configs/omap3_pandora.h |   16 ++++++++--------
>  include/configs/omap3_zoom1.h   |   16 ++++++++--------
>  include/configs/omap3_zoom2.h   |   16 ++++++++--------
>  6 files changed, 48 insertions(+), 48 deletions(-)
> 
> diff --git a/include/configs/omap3_beagle.h
> b/include/configs/omap3_beagle.h
> index 55eeb94..14754c3 100644
> --- a/include/configs/omap3_beagle.h
> +++ b/include/configs/omap3_beagle.h
> @@ -61,10 +61,10 @@
> 
>  /*
>   * Size of malloc() pool
> + * Total env = 128K, malloc = 128K
>   */
> -#define CONFIG_ENV_SIZE			SZ_128K	/* Total Size
> Environment */
> -						/* Sector */
> -#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + SZ_128K)
> +#define CONFIG_ENV_SIZE			0x00020000
> +#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 0x00020000)
>  #define CONFIG_SYS_GBL_DATA_SIZE	128	/* bytes reserved for */
>  						/* initial data */
> 
> @@ -239,10 +239,10 @@
>   *
>   * The stack sizes are set up in start.S using the settings below
>   */
> -#define CONFIG_STACKSIZE	SZ_128K	/* regular stack */
> +#define CONFIG_STACKSIZE	0x00020000	/* regular stack */
>  #ifdef CONFIG_USE_IRQ
> -#define CONFIG_STACKSIZE_IRQ	SZ_4K	/* IRQ stack */
> -#define CONFIG_STACKSIZE_FIQ	SZ_4K	/* FIQ stack */
> +#define CONFIG_STACKSIZE_IRQ	0x00001000	/* IRQ stack */
> +#define CONFIG_STACKSIZE_FIQ	0x00001000	/* FIQ stack */
>  #endif
> 
>  /*-----------------------------------------------------------------------
> @@ -250,7 +250,7 @@
>   */
>  #define CONFIG_NR_DRAM_BANKS	2	/* CS1 may or may not be populated */
>  #define PHYS_SDRAM_1		OMAP34XX_SDRC_CS0
> -#define PHYS_SDRAM_1_SIZE	SZ_32M	/* at least 32 meg */
> +#define PHYS_SDRAM_1_SIZE	0x02000000	/* at least 32 meg */
>  #define PHYS_SDRAM_2		OMAP34XX_SDRC_CS1
> 
>  /* SDRAM Bank Allocation method */
> @@ -269,7 +269,7 @@
>  #define CONFIG_SYS_MAX_FLASH_SECT	520	/* max number of sectors on */
>  						/* one chip */
>  #define CONFIG_SYS_MAX_FLASH_BANKS	2	/* max number of flash banks */
> -#define CONFIG_SYS_MONITOR_LEN		SZ_256K	/* Reserve 2 sectors
> */
> +#define CONFIG_SYS_MONITOR_LEN		0x00040000	/* Reserve 2 sectors
> */
> 
>  #define CONFIG_SYS_FLASH_BASE		boot_flash_base
> 
> diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
> index 72e9626..f615a4e 100644
> --- a/include/configs/omap3_evm.h
> +++ b/include/configs/omap3_evm.h
> @@ -66,10 +66,10 @@
> 
>  /*
>   * Size of malloc() pool
> + * Total Environment = 128K + malloc = 128K
>   */
> -#define CONFIG_ENV_SIZE			SZ_128K	/* Total Size
> Environment */
> -						/* Sector */
> -#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + SZ_128K)
> +#define CONFIG_ENV_SIZE			0x00020000
> +#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 0x00020000)
>  #define CONFIG_SYS_GBL_DATA_SIZE	128	/* bytes reserved for */
>  						/* initial data */
>  /*
> @@ -231,10 +231,10 @@
>   *
>   * The stack sizes are set up in start.S using the settings below
>   */
> -#define CONFIG_STACKSIZE	SZ_128K	/* regular stack */
> +#define CONFIG_STACKSIZE	0x00020000	/* regular stack */
>  #ifdef CONFIG_USE_IRQ
> -#define CONFIG_STACKSIZE_IRQ	SZ_4K	/* IRQ stack */
> -#define CONFIG_STACKSIZE_FIQ	SZ_4K	/* FIQ stack */
> +#define CONFIG_STACKSIZE_IRQ	0x00001000	/* IRQ stack */
> +#define CONFIG_STACKSIZE_FIQ	0x00001000	/* FIQ stack */
>  #endif
> 
>  /*-----------------------------------------------------------------------
> @@ -242,7 +242,7 @@
>   */
>  #define CONFIG_NR_DRAM_BANKS	2	/* CS1 may or may not be populated */
>  #define PHYS_SDRAM_1		OMAP34XX_SDRC_CS0
> -#define PHYS_SDRAM_1_SIZE	SZ_32M	/* at least 32 meg */
> +#define PHYS_SDRAM_1_SIZE	0x02000000	/* at least 32 meg */
>  #define PHYS_SDRAM_2		OMAP34XX_SDRC_CS1
> 
>  /* SDRAM Bank Allocation method */
> @@ -261,7 +261,7 @@
>  #define CONFIG_SYS_MAX_FLASH_SECT	520	/* max number of sectors */
>  						/* on one chip */
>  #define CONFIG_SYS_MAX_FLASH_BANKS	2	/* max number of flash banks */
> -#define CONFIG_SYS_MONITOR_LEN		SZ_256K	/* Reserve 2 sectors
> */
> +#define CONFIG_SYS_MONITOR_LEN		0x00040000	/* Reserve 2 sectors
> */
> 
>  #define CONFIG_SYS_FLASH_BASE		boot_flash_base
> 
> diff --git a/include/configs/omap3_overo.h b/include/configs/omap3_overo.h
> index 1a91921..3ba9b69 100644
> --- a/include/configs/omap3_overo.h
> +++ b/include/configs/omap3_overo.h
> @@ -53,10 +53,10 @@
> 
>  /*
>   * Size of malloc() pool
> + * Total Environment = 128K + malloc = 128K
>   */
> -#define CONFIG_ENV_SIZE			SZ_128K	/* Total Size
> Environment */
> -						/* Sector */
> -#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + SZ_128K)
> +#define CONFIG_ENV_SIZE			0x00020000
> +#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 0x00020000)
>  #define CONFIG_SYS_GBL_DATA_SIZE	128	/* bytes reserved for */
>  						/* initial data */
> 
> @@ -224,10 +224,10 @@
>   *
>   * The stack sizes are set up in start.S using the settings below
>   */
> -#define CONFIG_STACKSIZE	SZ_128K	/* regular stack */
> +#define CONFIG_STACKSIZE	0x00020000	/* regular stack */
>  #ifdef CONFIG_USE_IRQ
> -#define CONFIG_STACKSIZE_IRQ	SZ_4K	/* IRQ stack */
> -#define CONFIG_STACKSIZE_FIQ	SZ_4K	/* FIQ stack */
> +#define CONFIG_STACKSIZE_IRQ	0x00001000	/* IRQ stack */
> +#define CONFIG_STACKSIZE_FIQ	0x00001000	/* FIQ stack */
>  #endif
> 
>  /*-----------------------------------------------------------------------
> @@ -235,7 +235,7 @@
>   */
>  #define CONFIG_NR_DRAM_BANKS	2	/* CS1 may or may not be populated */
>  #define PHYS_SDRAM_1		OMAP34XX_SDRC_CS0
> -#define PHYS_SDRAM_1_SIZE	SZ_32M	/* at least 32 meg */
> +#define PHYS_SDRAM_1_SIZE	0x02000000	/* at least 32 meg */
>  #define PHYS_SDRAM_2		OMAP34XX_SDRC_CS1
> 
>  /* SDRAM Bank Allocation method */
> @@ -254,7 +254,7 @@
>  #define CONFIG_SYS_MAX_FLASH_SECT	520	/* max number of sectors on */
>  						/* one chip */
>  #define CONFIG_SYS_MAX_FLASH_BANKS	2	/* max number of flash banks */
> -#define CONFIG_SYS_MONITOR_LEN		SZ_256K	/* Reserve 2 sectors
> */
> +#define CONFIG_SYS_MONITOR_LEN		0x00040000	/* Reserve 2 sectors
> */
> 
>  #define CONFIG_SYS_FLASH_BASE		boot_flash_base
> 
> diff --git a/include/configs/omap3_pandora.h
> b/include/configs/omap3_pandora.h
> index 064c0bc..517df23 100644
> --- a/include/configs/omap3_pandora.h
> +++ b/include/configs/omap3_pandora.h
> @@ -56,10 +56,10 @@
> 
>  /*
>   * Size of malloc() pool
> + * Total Environment = 128K + malloc = 128K
>   */
> -#define CONFIG_ENV_SIZE			SZ_128K	/* Total Size
> Environment */
> -						/* Sector */
> -#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + SZ_128K)
> +#define CONFIG_ENV_SIZE			0x00020000
> +#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 0x00020000)
>  #define CONFIG_SYS_GBL_DATA_SIZE	128	/* bytes reserved for */
>  						/* initial data */
> 
> @@ -228,10 +228,10 @@
>   *
>   * The stack sizes are set up in start.S using the settings below
>   */
> -#define CONFIG_STACKSIZE	SZ_128K	/* regular stack */
> +#define CONFIG_STACKSIZE	0x00020000	/* regular stack */
>  #ifdef CONFIG_USE_IRQ
> -#define CONFIG_STACKSIZE_IRQ	SZ_4K	/* IRQ stack */
> -#define CONFIG_STACKSIZE_FIQ	SZ_4K	/* FIQ stack */
> +#define CONFIG_STACKSIZE_IRQ	0x00001000	/* IRQ stack */
> +#define CONFIG_STACKSIZE_FIQ	0x00001000	/* FIQ stack */
>  #endif
> 
>  /*-----------------------------------------------------------------------
> @@ -239,7 +239,7 @@
>   */
>  #define CONFIG_NR_DRAM_BANKS	2	/* CS1 may or may not be populated */
>  #define PHYS_SDRAM_1		OMAP34XX_SDRC_CS0
> -#define PHYS_SDRAM_1_SIZE	SZ_32M	/* at least 32 meg */
> +#define PHYS_SDRAM_1_SIZE	0x02000000	/* at least 32 meg */
>  #define PHYS_SDRAM_2		OMAP34XX_SDRC_CS1
> 
>  /* SDRAM Bank Allocation method */
> @@ -258,7 +258,7 @@
>  #define CONFIG_SYS_MAX_FLASH_SECT	520	/* max number of sectors on */
>  						/* one chip */
>  #define CONFIG_SYS_MAX_FLASH_BANKS	2	/* max number of flash banks */
> -#define CONFIG_SYS_MONITOR_LEN		SZ_256K	/* Reserve 2 sectors
> */
> +#define CONFIG_SYS_MONITOR_LEN		0x00040000	/* Reserve 2 sectors
> */
> 
>  #define CONFIG_SYS_FLASH_BASE		boot_flash_base
> 
> diff --git a/include/configs/omap3_zoom1.h b/include/configs/omap3_zoom1.h
> index b55b8f0..f428039 100644
> --- a/include/configs/omap3_zoom1.h
> +++ b/include/configs/omap3_zoom1.h
> @@ -62,10 +62,10 @@
> 
>  /*
>   * Size of malloc() pool
> + * Total Environment = 128K + malloc = 128K
>   */
> -#define CONFIG_ENV_SIZE			SZ_128K	/* Total Size
> Environment */
> -						/* Sector */
> -#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + SZ_128K)
> +#define CONFIG_ENV_SIZE			0x00020000
> +#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 0x00020000)
>  #define CONFIG_SYS_GBL_DATA_SIZE	128	/* bytes reserved for */
>  						/* initial data */
> 
> @@ -236,10 +236,10 @@
>   *
>   * The stack sizes are set up in start.S using the settings below
>   */
> -#define CONFIG_STACKSIZE	SZ_128K	/* regular stack */
> +#define CONFIG_STACKSIZE	0x00020000	/* regular stack */
>  #ifdef CONFIG_USE_IRQ
> -#define CONFIG_STACKSIZE_IRQ	SZ_4K	/* IRQ stack */
> -#define CONFIG_STACKSIZE_FIQ	SZ_4K	/* FIQ stack */
> +#define CONFIG_STACKSIZE_IRQ	0x00001000	/* IRQ stack */
> +#define CONFIG_STACKSIZE_FIQ	0x00001000	/* FIQ stack */
>  #endif
> 
>  /*-----------------------------------------------------------------------
> @@ -247,7 +247,7 @@
>   */
>  #define CONFIG_NR_DRAM_BANKS	2	/* CS1 may or may not be populated */
>  #define PHYS_SDRAM_1		OMAP34XX_SDRC_CS0
> -#define PHYS_SDRAM_1_SIZE	SZ_32M	/* at least 32 meg */
> +#define PHYS_SDRAM_1_SIZE	0x02000000	/* at least 32 meg */
>  #define PHYS_SDRAM_2		OMAP34XX_SDRC_CS1
> 
>  /* SDRAM Bank Allocation method */
> @@ -266,7 +266,7 @@
>  #define CONFIG_SYS_MAX_FLASH_SECT	520	/* max number of sectors on */
>  						/* one chip */
>  #define CONFIG_SYS_MAX_FLASH_BANKS	2	/* max number of flash banks */
> -#define CONFIG_SYS_MONITOR_LEN		SZ_256K	/* Reserve 2 sectors
> */
> +#define CONFIG_SYS_MONITOR_LEN		0x00040000	/* Reserve 2 sectors
> */
> 
>  #define CONFIG_SYS_FLASH_BASE		boot_flash_base
> 
> diff --git a/include/configs/omap3_zoom2.h b/include/configs/omap3_zoom2.h
> index 75ab980..d1989f7 100644
> --- a/include/configs/omap3_zoom2.h
> +++ b/include/configs/omap3_zoom2.h
> @@ -63,10 +63,10 @@
> 
>  /*
>   * Size of malloc() pool
> + * Total Environment = 128K + malloc = 128K
>   */
> -#define CONFIG_ENV_SIZE			SZ_128K	/* Total Size
> Environment */
> -						/* Sector */
> -#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + SZ_128K)
> +#define CONFIG_ENV_SIZE			0x00020000
> +#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 0x00020000)
>  #define CONFIG_SYS_GBL_DATA_SIZE	128	/* bytes reserved for */
>  						/* initial data */
>  /*
> @@ -201,10 +201,10 @@
>   *
>   * The stack sizes are set up in start.S using these settings
>   */
> -#define CONFIG_STACKSIZE	SZ_128K
> +#define CONFIG_STACKSIZE	0x00020000
>  #ifdef CONFIG_USE_IRQ
> -#define CONFIG_STACKSIZE_IRQ	SZ_4K
> -#define CONFIG_STACKSIZE_FIQ	SZ_4K
> +#define CONFIG_STACKSIZE_IRQ	0x00001000
> +#define CONFIG_STACKSIZE_FIQ	0x00001000
>  #endif
> 
>  /*-----------------------------------------------------------------------
> @@ -212,7 +212,7 @@
>   */
>  #define CONFIG_NR_DRAM_BANKS	2	/* CS1 may or may not be populated */
>  #define PHYS_SDRAM_1		OMAP34XX_SDRC_CS0
> -#define PHYS_SDRAM_1_SIZE	SZ_32M	/* at least 32 meg */
> +#define PHYS_SDRAM_1_SIZE	0x02000000	/* at least 32 meg */
>  #define PHYS_SDRAM_2		OMAP34XX_SDRC_CS1
> 
>  /* SDRAM Bank Allocation method */
> @@ -231,7 +231,7 @@
>  #define CONFIG_SYS_MAX_FLASH_SECT	520	/* max number of sectors on */
>  						/* one chip */
>  #define CONFIG_SYS_MAX_FLASH_BANKS	2	/* max number of flash banks */
> -#define CONFIG_SYS_MONITOR_LEN		SZ_256K	/* Reserve 2 sectors
> */
> +#define CONFIG_SYS_MONITOR_LEN		0x00040000	/* Reserve 2 sectors
> */
> 
>  #define CONFIG_SYS_FLASH_BASE		boot_flash_base
> 
> --
> 1.6.0.4



More information about the U-Boot mailing list