[U-Boot] [PATCH 1/2] omap3: Remove externs from config files

Sanjeev Premi premi at ti.com
Wed Dec 23 15:38:20 CET 2009


All configurations based on OMAP3 define flash related
variables as externs.

This patch moves all extern declarations to a header
file and includes this header into each configuration.

Signed-off-by: Sanjeev Premi <premi at ti.com>
---
 include/asm-arm/arch-omap3/omap3_flash.h |   34 ++++++++++++++++++++++++++++++
 include/configs/omap3_beagle.h           |   12 +++-------
 include/configs/omap3_evm.h              |   14 ++++--------
 include/configs/omap3_overo.h            |   14 ++++--------
 include/configs/omap3_pandora.h          |   12 +++-------
 include/configs/omap3_sdp3430.h          |   13 +++--------
 include/configs/omap3_zoom1.h            |   13 ++++-------
 include/configs/omap3_zoom2.h            |   13 ++++-------
 8 files changed, 66 insertions(+), 59 deletions(-)
 create mode 100644 include/asm-arm/arch-omap3/omap3_flash.h

diff --git a/include/asm-arm/arch-omap3/omap3_flash.h b/include/asm-arm/arch-omap3/omap3_flash.h
new file mode 100644
index 0000000..d881ee9
--- /dev/null
+++ b/include/asm-arm/arch-omap3/omap3_flash.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
+ * Sanjeev Premi <premi at ti.com>
+ *
+ * Contents moved from existing configurations for OMAP3 based boards.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __ASM_ARCH_OMAP3_FLASH_H
+#define __ASM_ARCH_OMAP3_FLASH_H
+
+#ifndef __ASSEMBLY__
+extern unsigned int boot_flash_base;
+extern volatile unsigned int boot_flash_env_addr;
+extern unsigned int boot_flash_off;
+extern unsigned int boot_flash_sec;
+extern unsigned int boot_flash_type;
+#endif
+
+#endif /* __ASM_ARCH_OMAP3_FLASH_H */
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index 4fe3bd8..bc85dc3 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -327,13 +327,9 @@
 #define CONFIG_SYS_JFFS2_FIRST_BANK	CONFIG_SYS_MAX_FLASH_BANKS
 #define CONFIG_SYS_JFFS2_NUM_BANKS	1
 
-#ifndef __ASSEMBLY__
-extern struct gpmc *gpmc_cfg;
-extern unsigned int boot_flash_base;
-extern volatile unsigned int boot_flash_env_addr;
-extern unsigned int boot_flash_off;
-extern unsigned int boot_flash_sec;
-extern unsigned int boot_flash_type;
-#endif
+/*
+ * Include flash related variables
+ */
+#include <asm/arch/omap3_flash.h>
 
 #endif /* __CONFIG_H */
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index 630b00f..997f770 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -331,15 +331,6 @@
 #define CONFIG_SYS_JFFS2_FIRST_BANK	CONFIG_SYS_MAX_FLASH_BANKS
 #define CONFIG_SYS_JFFS2_NUM_BANKS	1
 
-#ifndef __ASSEMBLY__
-extern struct gpmc *gpmc_cfg;
-extern unsigned int boot_flash_base;
-extern volatile unsigned int boot_flash_env_addr;
-extern unsigned int boot_flash_off;
-extern unsigned int boot_flash_sec;
-extern unsigned int boot_flash_type;
-#endif
-
 /*----------------------------------------------------------------------------
  * SMSC9115 Ethernet from SMSC9118 family
  *----------------------------------------------------------------------------
@@ -362,4 +353,9 @@ extern unsigned int boot_flash_type;
 #define CONFIG_BOOTP_HOSTNAME		0x00000004
 #define CONFIG_BOOTP_BOOTPATH		0x00000010
 
+/*
+ * Include flash related variables
+ */
+#include <asm/arch/omap3_flash.h>
+
 #endif /* __CONFIG_H */
diff --git a/include/configs/omap3_overo.h b/include/configs/omap3_overo.h
index 0c12b9f..0059876 100644
--- a/include/configs/omap3_overo.h
+++ b/include/configs/omap3_overo.h
@@ -296,15 +296,6 @@
 #define CONFIG_SYS_JFFS2_FIRST_BANK	CONFIG_SYS_MAX_FLASH_BANKS
 #define CONFIG_SYS_JFFS2_NUM_BANKS	1
 
-#ifndef __ASSEMBLY__
-extern struct gpmc *gpmc_cfg;
-extern unsigned int boot_flash_base;
-extern volatile unsigned int boot_flash_env_addr;
-extern unsigned int boot_flash_off;
-extern unsigned int boot_flash_sec;
-extern unsigned int boot_flash_type;
-#endif
-
 #if defined(CONFIG_CMD_NET)
 /*----------------------------------------------------------------------------
  * SMSC9211 Ethernet from SMSC9118 family
@@ -318,4 +309,9 @@ extern unsigned int boot_flash_type;
 
 #endif /* (CONFIG_CMD_NET) */
 
+/*
+ * Include flash related variables
+ */
+#include <asm/arch/omap3_flash.h>
+
 #endif				/* __CONFIG_H */
diff --git a/include/configs/omap3_pandora.h b/include/configs/omap3_pandora.h
index 154c0f4..564ff34 100644
--- a/include/configs/omap3_pandora.h
+++ b/include/configs/omap3_pandora.h
@@ -288,13 +288,9 @@
 #define CONFIG_SYS_JFFS2_FIRST_BANK	CONFIG_SYS_MAX_FLASH_BANKS
 #define CONFIG_SYS_JFFS2_NUM_BANKS	1
 
-#ifndef __ASSEMBLY__
-extern struct gpmc *gpmc_cfg;
-extern unsigned int boot_flash_base;
-extern volatile unsigned int boot_flash_env_addr;
-extern unsigned int boot_flash_off;
-extern unsigned int boot_flash_sec;
-extern unsigned int boot_flash_type;
-#endif
+/*
+ * Include flash related variables
+ */
+#include <asm/arch/omap3_flash.h>
 
 #endif				/* __CONFIG_H */
diff --git a/include/configs/omap3_sdp3430.h b/include/configs/omap3_sdp3430.h
index fa2ad53..5dfceb9 100644
--- a/include/configs/omap3_sdp3430.h
+++ b/include/configs/omap3_sdp3430.h
@@ -359,15 +359,10 @@
  *  - rest for filesystem
  */
 
-/*--------------------------------------------------------------------------*/
 
-#ifndef __ASSEMBLY__
-extern struct gpmc *gpmc_cfg;
-extern unsigned int boot_flash_base;
-extern volatile unsigned int boot_flash_env_addr;
-extern unsigned int boot_flash_off;
-extern unsigned int boot_flash_sec;
-extern unsigned int boot_flash_type;
-#endif
+/*
+ * Include flash related variables
+ */
+#include <asm/arch/omap3_flash.h>
 
 #endif				/* __CONFIG_H */
diff --git a/include/configs/omap3_zoom1.h b/include/configs/omap3_zoom1.h
index fa58281..0d35f13 100644
--- a/include/configs/omap3_zoom1.h
+++ b/include/configs/omap3_zoom1.h
@@ -312,13 +312,10 @@
 #define CONFIG_SYS_JFFS2_FIRST_BANK	CONFIG_SYS_MAX_FLASH_BANKS
 #define CONFIG_SYS_JFFS2_NUM_BANKS	1
 
-#ifndef __ASSEMBLY__
-extern struct gpmc *gpmc_cfg;
-extern unsigned int boot_flash_base;
-extern volatile unsigned int boot_flash_env_addr;
-extern unsigned int boot_flash_off;
-extern unsigned int boot_flash_sec;
-extern unsigned int boot_flash_type;
-#endif
+
+/*
+ * Include flash related variables
+ */
+#include <asm/arch/omap3_flash.h>
 
 #endif				/* __CONFIG_H */
diff --git a/include/configs/omap3_zoom2.h b/include/configs/omap3_zoom2.h
index 7a8beb8..0a6fc80 100644
--- a/include/configs/omap3_zoom2.h
+++ b/include/configs/omap3_zoom2.h
@@ -269,13 +269,10 @@
 #define CONFIG_SYS_FLASH_ERASE_TOUT	(100 * CONFIG_SYS_HZ)
 #define CONFIG_SYS_FLASH_WRITE_TOUT	(100 * CONFIG_SYS_HZ)
 
-#ifndef __ASSEMBLY__
-extern struct gpmc *gpmc_cfg;
-extern unsigned int boot_flash_base;
-extern volatile unsigned int boot_flash_env_addr;
-extern unsigned int boot_flash_off;
-extern unsigned int boot_flash_sec;
-extern unsigned int boot_flash_type;
-#endif
+
+/*
+ * Include flash related variables
+ */
+#include <asm/arch/omap3_flash.h>
 
 #endif /* __CONFIG_H */
-- 
1.6.2.2



More information about the U-Boot mailing list