]> git.openpandora.org Git - pandora-x-loader.git/commitdiff
OMAP3: Move get_device_type() function to not duplicate code
authorEnric Balletbo i Serra <eballetbo@gmail.com>
Wed, 25 May 2011 07:37:22 +0000 (09:37 +0200)
committerAnand Gadiyar <gadiyar@ti.com>
Thu, 14 Jul 2011 12:10:48 +0000 (17:40 +0530)
The get_device_type() function is implemented by various boards, this
patch moves this function to a common place to not duplicate code.

 board/omap3530beagle/omap3530beagle.c:97:u32 get_device_type(void)
 board/igep00x0/igep00x0.c            :90:u32 get_device_type(void)
 board/omap3430sdp/omap3430sdp.c      :82:u32 get_device_type(void)
 board/omap3evm/omap3evm.c            :84:u32 get_device_type(void)
 board/omap3430labrador/omap3430sdp.c :79:u32 get_device_type(void)
 board/overo/overo.c                  :105:u32 get_device_type(void)

Signed-off-by: Enric Balletbo i Serra <eballetbo@gmail.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
board/igep00x0/igep00x0.c
board/omap3430labrador/omap3430sdp.c
board/omap3430sdp/omap3430sdp.c
board/omap3530beagle/omap3530beagle.c
board/omap3evm/omap3evm.c
board/overo/overo.c
cpu/omap3/Makefile
cpu/omap3/sys_info.c [new file with mode: 0644]

index b794abbcb184e00facbc4949fec6d2e019b08948..16663376df8c3328f4d5a63a41803e6cdd797f82 100644 (file)
@@ -84,16 +84,6 @@ void udelay (unsigned long usecs) {
        delay(usecs);
 }
 
-/*************************************************************
- *  get_device_type(): tell if GP/HS/EMU/TST
- *************************************************************/
-u32 get_device_type(void)
-{
-       int mode;
-       mode = __raw_readl(CONTROL_STATUS) & (DEVICE_MASK);
-       return mode >>= 8;
-}
-
 /*************************************************************
  * Routine: get_mem_type(void) - returns the kind of memory connected
  * to GPMC that we are trying to boot form. Uses SYS BOOT settings.
index 89d9ff14d2181f54da19a16eb87dab7004110025..0312d66712f7ee82a916d2206acb22a067ecec7f 100644 (file)
@@ -73,16 +73,6 @@ int board_init (void)
        return 0;
 }
 
-/*************************************************************
- *  get_device_type(): tell if GP/HS/EMU/TST
- *************************************************************/
-u32 get_device_type(void)
-{
-        int mode;
-        mode = __raw_readl(CONTROL_STATUS) & (DEVICE_MASK);
-        return(mode >>= 8);
-}
-
 /******************************************
  * get_cpu_rev(void) - extract version info
  ******************************************/
index 6ed62bcee2b3c2dd0c583306450653a8141de411..7cb45bba1620085012f524a2f29633bb46ff2198 100644 (file)
@@ -76,16 +76,6 @@ int board_init (void)
        return 0;
 }
 
-/*************************************************************
- *  get_device_type(): tell if GP/HS/EMU/TST
- *************************************************************/
-u32 get_device_type(void)
-{
-        int mode;
-        mode = __raw_readl(CONTROL_STATUS) & (DEVICE_MASK);
-        return(mode >>= 8);
-}
-
 /******************************************
  * get_cpu_rev(void) - extract version info
  ******************************************/
index 15943f55dcb7e4b5e5fcfebfc384d221e87ec5ef..0402a5741455f71fa5205be554e89be274787309 100644 (file)
@@ -91,16 +91,6 @@ int board_init(void)
        return 0;
 }
 
-/*************************************************************
- *  get_device_type(): tell if GP/HS/EMU/TST
- *************************************************************/
-u32 get_device_type(void)
-{
-       int mode;
-       mode = __raw_readl(CONTROL_STATUS) & (DEVICE_MASK);
-       return mode >>= 8;
-}
-
 /************************************************
  * get_sysboot_value(void) - return SYS_BOOT[4:0]
  ************************************************/
index 16c1f708f5bf9934aa5b4250fda66284aab7d2fd..4f1fedd3c308ff7ea55a0795faf4a3057a304857 100644 (file)
@@ -78,16 +78,6 @@ int board_init (void)
        return 0;
 }
 
-/*************************************************************
- *  get_device_type(): tell if GP/HS/EMU/TST
- *************************************************************/
-u32 get_device_type(void)
-{
-        int mode;
-        mode = __raw_readl(CONTROL_STATUS) & (DEVICE_MASK);
-        return(mode >>= 8);
-}
-
 /************************************************
  * get_sysboot_value(void) - return SYS_BOOT[4:0]
  ************************************************/
index b2c536a9264c1f6544947afb4682ec9b7181c792..b942c5b337d145e631f19c484a98a43403907360 100644 (file)
@@ -99,16 +99,6 @@ int board_init(void)
        return 0;
 }
 
-/*************************************************************
- *  get_device_type(): tell if GP/HS/EMU/TST
- *************************************************************/
-u32 get_device_type(void)
-{
-       int mode;
-       mode = __raw_readl(CONTROL_STATUS) & (DEVICE_MASK);
-       return mode >>= 8;
-}
-
 /************************************************
  * get_sysboot_value(void) - return SYS_BOOT[4:0]
  ************************************************/
index 678619cb3a922db42fe683bdcf4b6116729dca53..eba6987a2764d6cc1a73a04187000b447906895f 100644 (file)
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-COBJS  = cpu.o mmc.o gpio.o
+COBJS  = cpu.o mmc.o gpio.o sys_info.o
 
 SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/cpu/omap3/sys_info.c b/cpu/omap3/sys_info.c
new file mode 100644 (file)
index 0000000..f6cb65f
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/bits.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/arch/sys_info.h>
+
+/*
+ *  get_device_type(): tell if GP/HS/EMU/TST
+ */
+u32 get_device_type(void)
+{
+       int mode;
+       mode = __raw_readl(CONTROL_STATUS) & (DEVICE_MASK);
+       return mode >>= 8;
+}