ARM DaVinci: Adding new Header file
PATCH 1/1 ARM DaVinci: Adding new Header file
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 <[email protected]>
--- 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
board/davinci/dm355evm/dm355evm.c +1 -0
@@ -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"
board/davinci/dvevm/dvevm.c +1 -0
@@ -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 ;
board/davinci/schmoogie/schmoogie.c +1 -0
@@ -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 ;
board/davinci/sffsdr/sffsdr.c +1 -0
@@ -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. */
board/davinci/sonata/sonata.c +1 -0
@@ -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 ;
cpu/arm926ejs/davinci/cpu.c +1 -1
@@ -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
cpu/arm926ejs/davinci/dm355.c +1 -1
@@ -23,7 +23,7 @@#include <common.h> #include <asm/arch/hardware.h> - +#include <asm/arch/devices.h> void davinci_enable_uart0 (void ) {
cpu/arm926ejs/davinci/dm644x.c +1 -1
@@ -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)
cpu/arm926ejs/davinci/psc.c +1 -0
@@ -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
drivers/i2c/davinci_i2c.c +1 -0
@@ -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 () \
include/asm-arm/arch-davinci/devices.h new file +45 -0
45 lines not on this page · raw message
include/asm-arm/arch-davinci/emac_defs.h +1 -1
@@ -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)
include/asm-arm/arch-davinci/emif_defs.h +1 -0
@@ -23,6 +23,7 @@#define _EMIF_DEFS_H_#include <asm/arch/hardware.h> +#include <asm/arch/devices.h> typedef struct { dv_reg ERCSR;
include/asm-arm/arch-davinci/hardware.h +0 -14
@@ -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)
Signature · 1 line
1.6.0.4
PATCH 1/1 ARM DaVinci: Adding new Header file
Quoted 53 lines
include/asm-arm/arch-davinci/devices.h new file +45
-0@@ -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 */ include/asm-arm/arch-davinci/emac_defs.h +0
-0
<snip>
Quoted 17 lines
include/asm-arm/arch-davinci/emif_defs.h +1
-0@@ -23,6 +23,7 @@#define _EMIF_DEFS_H_#include <asm/arch/hardware.h> +#include <asm/arch/devices.h> typedef struct { dv_reg ERCSR;include/asm-arm/arch-davinci/hardware.h +0
-0
include/asm-arm/arch-davinci/hardware.h line 43
Quoted 8 lines
include/asm-arm/arch-davinci/hardware.h +0
-5@@ -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 ;
we need to drop this REG and REG_P stuff and use instead generic accessor
and for this patch move them will not help. The idea behind the devices.h is to have a header where will have all device init prototypes
Best Regards,
J.