[U-Boot] [PATCH] ARM DaVinci: Adding new Header file

s-paulraj at ti.com s-paulraj at ti.com
Tue May 26 15:04:38 CEST 2009


Patch moves the device init functions to new header file
devices.h. This will enable us to use the MACROS in hardware.h
in the config files for the various DaVinci SOC's

Signed-off-by: Sandeep Paulraj <s-paulraj at ti.com>
---
 board/davinci/dm355evm/dm355evm.c        |    1 +
 board/davinci/dvevm/dvevm.c              |    1 +
 board/davinci/schmoogie/schmoogie.c      |    1 +
 board/davinci/sffsdr/sffsdr.c            |    1 +
 board/davinci/sonata/sonata.c            |    1 +
 cpu/arm926ejs/davinci/cpu.c              |    2 +-
 cpu/arm926ejs/davinci/dm355.c            |    2 +-
 cpu/arm926ejs/davinci/dm644x.c           |    2 +-
 cpu/arm926ejs/davinci/psc.c              |    1 +
 drivers/i2c/davinci_i2c.c                |    1 +
 include/asm-arm/arch-davinci/devices.h   |   45 ++++++++++++++++++++++++++++++
 include/asm-arm/arch-davinci/emac_defs.h |    2 +-
 include/asm-arm/arch-davinci/emif_defs.h |    1 +
 include/asm-arm/arch-davinci/hardware.h  |   14 ---------
 14 files changed, 57 insertions(+), 18 deletions(-)
 create mode 100644 include/asm-arm/arch-davinci/devices.h

diff --git a/board/davinci/dm355evm/dm355evm.c b/board/davinci/dm355evm/dm355evm.c
index 398f527..1b98136 100644
--- a/board/davinci/dm355evm/dm355evm.c
+++ b/board/davinci/dm355evm/dm355evm.c
@@ -22,6 +22,7 @@
 #include <asm/arch/hardware.h>
 #include <asm/arch/emif_defs.h>
 #include <asm/arch/nand_defs.h>
+#include <asm/arch/devices.h>
 #include "../common/misc.h"
 
 
diff --git a/board/davinci/dvevm/dvevm.c b/board/davinci/dvevm/dvevm.c
index 8f38633..2cc9f3e 100644
--- a/board/davinci/dvevm/dvevm.c
+++ b/board/davinci/dvevm/dvevm.c
@@ -27,6 +27,7 @@
 #include <common.h>
 #include <i2c.h>
 #include <asm/arch/hardware.h>
+#include <asm/arch/devices.h>
 #include "../common/misc.h"
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/board/davinci/schmoogie/schmoogie.c b/board/davinci/schmoogie/schmoogie.c
index 6e0f591..cee2c7b 100644
--- a/board/davinci/schmoogie/schmoogie.c
+++ b/board/davinci/schmoogie/schmoogie.c
@@ -27,6 +27,7 @@
 #include <common.h>
 #include <i2c.h>
 #include <asm/arch/hardware.h>
+#include <asm/arch/devices.h>
 #include "../common/misc.h"
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/board/davinci/sffsdr/sffsdr.c b/board/davinci/sffsdr/sffsdr.c
index 7f4ee36..deb8cb1 100644
--- a/board/davinci/sffsdr/sffsdr.c
+++ b/board/davinci/sffsdr/sffsdr.c
@@ -30,6 +30,7 @@
 #include <common.h>
 #include <i2c.h>
 #include <asm/arch/hardware.h>
+#include <asm/arch/devices.h>
 #include "../common/misc.h"
 
 #define DAVINCI_A3CR     (0x01E00014)	/* EMIF-A CS3 config register. */
diff --git a/board/davinci/sonata/sonata.c b/board/davinci/sonata/sonata.c
index a0bea05..56f5f37 100644
--- a/board/davinci/sonata/sonata.c
+++ b/board/davinci/sonata/sonata.c
@@ -26,6 +26,7 @@
 
 #include <common.h>
 #include <asm/arch/hardware.h>
+#include <asm/arch/devices.h>
 #include "../common/misc.h"
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/cpu/arm926ejs/davinci/cpu.c b/cpu/arm926ejs/davinci/cpu.c
index 29aead6..c30a44e 100644
--- a/cpu/arm926ejs/davinci/cpu.c
+++ b/cpu/arm926ejs/davinci/cpu.c
@@ -22,7 +22,7 @@
 
 #include <common.h>
 #include <asm/arch/hardware.h>
-
+#include <asm/arch/devices.h>
 
 /* offsets from PLL controller base */
 #define PLLC_PLLCTL	0x100
diff --git a/cpu/arm926ejs/davinci/dm355.c b/cpu/arm926ejs/davinci/dm355.c
index bc45b67..346831b 100644
--- a/cpu/arm926ejs/davinci/dm355.c
+++ b/cpu/arm926ejs/davinci/dm355.c
@@ -23,7 +23,7 @@
 
 #include <common.h>
 #include <asm/arch/hardware.h>
-
+#include <asm/arch/devices.h>
 
 void davinci_enable_uart0(void)
 {
diff --git a/cpu/arm926ejs/davinci/dm644x.c b/cpu/arm926ejs/davinci/dm644x.c
index bb105b5..cee0511 100644
--- a/cpu/arm926ejs/davinci/dm644x.c
+++ b/cpu/arm926ejs/davinci/dm644x.c
@@ -25,7 +25,7 @@
 
 #include <common.h>
 #include <asm/arch/hardware.h>
-
+#include <asm/arch/devices.h>
 
 #define PINMUX0_EMACEN (1 << 31)
 #define PINMUX0_AECS5  (1 << 11)
diff --git a/cpu/arm926ejs/davinci/psc.c b/cpu/arm926ejs/davinci/psc.c
index 5bb972f..967ebc9 100644
--- a/cpu/arm926ejs/davinci/psc.c
+++ b/cpu/arm926ejs/davinci/psc.c
@@ -25,6 +25,7 @@
 
 #include <common.h>
 #include <asm/arch/hardware.h>
+#include <asm/arch/devices.h>
 
 /*
  * The PSC manages three inputs to a "module" which may be a peripheral or
diff --git a/drivers/i2c/davinci_i2c.c b/drivers/i2c/davinci_i2c.c
index eee1cbd..ba489a4 100644
--- a/drivers/i2c/davinci_i2c.c
+++ b/drivers/i2c/davinci_i2c.c
@@ -27,6 +27,7 @@
 #include <common.h>
 #include <i2c.h>
 #include <asm/arch/hardware.h>
+#include <asm/arch/devices.h>
 #include <asm/arch/i2c_defs.h>
 
 #define CHECK_NACK() \
diff --git a/include/asm-arm/arch-davinci/devices.h b/include/asm-arm/arch-davinci/devices.h
new file mode 100644
index 0000000..fd7f6d0
--- /dev/null
+++ b/include/asm-arm/arch-davinci/devices.h
@@ -0,0 +1,45 @@
+/*
+ *
+ *  Copyright (C) 2009 Texas Instruments.
+ *
+ *  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  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
+ *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
+ *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
+ *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
+ *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
+ *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *  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.,
+ *  675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+#ifndef __ASM_ARCH_DEVICES_H
+#define __ASM_ARCH_DEVICES_H
+
+#include <asm/sizes.h>
+
+#define	REG(addr)	(*(volatile unsigned int *)(addr))
+#define REG_P(addr)	((volatile unsigned int *)(addr))
+
+typedef volatile unsigned int	dv_reg;
+typedef volatile unsigned int 	*dv_reg_p;
+
+void lpsc_on(unsigned int id);
+void dsp_on(void);
+
+void davinci_enable_uart0(void);
+void davinci_enable_emac(void);
+void davinci_enable_i2c(void);
+void davinci_errata_workarounds(void);
+
+#endif /* __ASM_ARCH_DEVICES_H */
diff --git a/include/asm-arm/arch-davinci/emac_defs.h b/include/asm-arm/arch-davinci/emac_defs.h
index c11161f..4a5e79d 100644
--- a/include/asm-arm/arch-davinci/emac_defs.h
+++ b/include/asm-arm/arch-davinci/emac_defs.h
@@ -37,7 +37,7 @@
 #define _DM644X_EMAC_H_
 
 #include <asm/arch/hardware.h>
-
+#include <asm/arch/devices.h>
 #define EMAC_BASE_ADDR			(0x01c80000)
 #define EMAC_WRAPPER_BASE_ADDR		(0x01c81000)
 #define EMAC_WRAPPER_RAM_ADDR		(0x01c82000)
diff --git a/include/asm-arm/arch-davinci/emif_defs.h b/include/asm-arm/arch-davinci/emif_defs.h
index 646fc77..53e84f6 100644
--- a/include/asm-arm/arch-davinci/emif_defs.h
+++ b/include/asm-arm/arch-davinci/emif_defs.h
@@ -23,6 +23,7 @@
 #define _EMIF_DEFS_H_
 
 #include <asm/arch/hardware.h>
+#include <asm/arch/devices.h>
 
 typedef struct {
 	dv_reg		ERCSR;
diff --git a/include/asm-arm/arch-davinci/hardware.h b/include/asm-arm/arch-davinci/hardware.h
index 313b3f3..0a685a7 100644
--- a/include/asm-arm/arch-davinci/hardware.h
+++ b/include/asm-arm/arch-davinci/hardware.h
@@ -36,12 +36,6 @@
 #include <config.h>
 #include <asm/sizes.h>
 
-#define	REG(addr)	(*(volatile unsigned int *)(addr))
-#define REG_P(addr)	((volatile unsigned int *)(addr))
-
-typedef volatile unsigned int	dv_reg;
-typedef volatile unsigned int *	dv_reg_p;
-
 /*
  * Base register addresses
  *
@@ -153,14 +147,6 @@ typedef volatile unsigned int *	dv_reg_p;
 #define DAVINCI_LPSC_GEM		39
 #define DAVINCI_LPSC_IMCOP		40
 
-void lpsc_on(unsigned int id);
-void dsp_on(void);
-
-void davinci_enable_uart0(void);
-void davinci_enable_emac(void);
-void davinci_enable_i2c(void);
-void davinci_errata_workarounds(void);
-
 /* Some PSC defines */
 #define PSC_CHP_SHRTSW			(0x01c40038)
 #define PSC_GBLCTL			(0x01c41010)
-- 
1.6.0.4



More information about the U-Boot mailing list