summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap
diff options
context:
space:
mode:
authorTeresa Gámez <t.gamez@phytec.de>2013-04-02 14:48:06 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-04-03 09:21:12 +0200
commitc61cc9809129d31295b9069f76368917db3523ba (patch)
tree6674f09a63e6f3a34f6b91df4edc7fc5a80c8761 /arch/arm/mach-omap
parent28ce80f53ccdae02d3b64dc6270b92f760ca4b9d (diff)
downloadbarebox-c61cc9809129d31295b9069f76368917db3523ba.tar.gz
barebox-c61cc9809129d31295b9069f76368917db3523ba.tar.xz
OMAP: Move bootsource functions
The bootsource functions are not specific to the first stage bootloader. They may also be used for detecting the bootsource to decide where to load the environment from. Also clean up includes in board files. Signed-off-by: Teresa Gámez <t.gamez@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-omap')
-rw-r--r--arch/arm/mach-omap/Makefile2
-rw-r--r--arch/arm/mach-omap/am33xx_generic.c2
-rw-r--r--arch/arm/mach-omap/include/mach/generic.h16
-rw-r--r--arch/arm/mach-omap/include/mach/xload.h16
-rw-r--r--arch/arm/mach-omap/omap3_generic.c2
-rw-r--r--arch/arm/mach-omap/omap4_generic.c2
-rw-r--r--arch/arm/mach-omap/omap4_rom_usb.c2
-rw-r--r--arch/arm/mach-omap/omap_generic.c32
-rw-r--r--arch/arm/mach-omap/xload.c13
9 files changed, 54 insertions, 33 deletions
diff --git a/arch/arm/mach-omap/Makefile b/arch/arm/mach-omap/Makefile
index 38786b2bd5..d9e00f77ae 100644
--- a/arch/arm/mach-omap/Makefile
+++ b/arch/arm/mach-omap/Makefile
@@ -15,7 +15,7 @@
# GNU General Public License for more details.
#
#
-obj-$(CONFIG_ARCH_OMAP) += syslib.o omap_devices.o
+obj-$(CONFIG_ARCH_OMAP) += syslib.o omap_devices.o omap_generic.o
pbl-$(CONFIG_ARCH_OMAP) += syslib.o
obj-$(CONFIG_OMAP_CLOCK_SOURCE_S32K) += s32k_clksource.o
obj-$(CONFIG_OMAP_CLOCK_SOURCE_DMTIMER0) += dmtimer0.o
diff --git a/arch/arm/mach-omap/am33xx_generic.c b/arch/arm/mach-omap/am33xx_generic.c
index d3014c20b5..059c55e3b0 100644
--- a/arch/arm/mach-omap/am33xx_generic.c
+++ b/arch/arm/mach-omap/am33xx_generic.c
@@ -24,7 +24,7 @@
#include <mach/am33xx-silicon.h>
#include <mach/am33xx-clock.h>
#include <mach/sys_info.h>
-#include <mach/xload.h>
+#include <mach/generic.h>
#include <mach/am33xx-generic.h>
void __noreturn reset_cpu(unsigned long addr)
diff --git a/arch/arm/mach-omap/include/mach/generic.h b/arch/arm/mach-omap/include/mach/generic.h
index c801a068e3..edc4f1d3d0 100644
--- a/arch/arm/mach-omap/include/mach/generic.h
+++ b/arch/arm/mach-omap/include/mach/generic.h
@@ -1,3 +1,5 @@
+#ifndef _MACH_GENERIC_H
+#define _MACH_GENERIC_H
/* I2C controller revisions */
#define OMAP_I2C_REV_2 0x20
@@ -24,3 +26,17 @@
#else
#define cpu_is_omap4xxx() (0)
#endif
+
+enum omap_boot_src {
+ OMAP_BOOTSRC_UNKNOWN,
+ OMAP_BOOTSRC_MMC1,
+ OMAP_BOOTSRC_NAND,
+ OMAP_BOOTSRC_SPI1,
+ OMAP_BOOTSRC_USB1,
+};
+
+enum omap_boot_src am33xx_bootsrc(void);
+enum omap_boot_src omap3_bootsrc(void);
+enum omap_boot_src omap4_bootsrc(void);
+
+#endif
diff --git a/arch/arm/mach-omap/include/mach/xload.h b/arch/arm/mach-omap/include/mach/xload.h
deleted file mode 100644
index d632735267..0000000000
--- a/arch/arm/mach-omap/include/mach/xload.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _MACH_XLOAD_H
-#define _MACH_XLOAD_H
-
-enum omap_boot_src {
- OMAP_BOOTSRC_UNKNOWN,
- OMAP_BOOTSRC_MMC1,
- OMAP_BOOTSRC_NAND,
- OMAP_BOOTSRC_SPI1,
- OMAP_BOOTSRC_USB1,
-};
-
-enum omap_boot_src am33xx_bootsrc(void);
-enum omap_boot_src omap3_bootsrc(void);
-enum omap_boot_src omap4_bootsrc(void);
-
-#endif /* _MACH_XLOAD_H */
diff --git a/arch/arm/mach-omap/omap3_generic.c b/arch/arm/mach-omap/omap3_generic.c
index a21a938ef0..10e03aec02 100644
--- a/arch/arm/mach-omap/omap3_generic.c
+++ b/arch/arm/mach-omap/omap3_generic.c
@@ -40,7 +40,7 @@
#include <mach/wdt.h>
#include <mach/sys_info.h>
#include <mach/syslib.h>
-#include <mach/xload.h>
+#include <mach/generic.h>
/**
* @brief Reset the CPU
diff --git a/arch/arm/mach-omap/omap4_generic.c b/arch/arm/mach-omap/omap4_generic.c
index 2a09eb635d..e1edffa351 100644
--- a/arch/arm/mach-omap/omap4_generic.c
+++ b/arch/arm/mach-omap/omap4_generic.c
@@ -5,7 +5,7 @@
#include <mach/omap4-silicon.h>
#include <mach/omap4-mux.h>
#include <mach/syslib.h>
-#include <mach/xload.h>
+#include <mach/generic.h>
#include <mach/gpmc.h>
#include <mach/gpio.h>
#include <mach/omap4_rom_usb.h>
diff --git a/arch/arm/mach-omap/omap4_rom_usb.c b/arch/arm/mach-omap/omap4_rom_usb.c
index de35d61c13..31d93c34ee 100644
--- a/arch/arm/mach-omap/omap4_rom_usb.c
+++ b/arch/arm/mach-omap/omap4_rom_usb.c
@@ -33,7 +33,7 @@
#include <common.h>
#include <mach/omap4-silicon.h>
#include <mach/omap4_rom_usb.h>
-#include <mach/xload.h>
+#include <mach/generic.h>
#include <init.h>
static struct omap4_usbboot omap4_usbboot_data;
diff --git a/arch/arm/mach-omap/omap_generic.c b/arch/arm/mach-omap/omap_generic.c
new file mode 100644
index 0000000000..f2fd1d33af
--- /dev/null
+++ b/arch/arm/mach-omap/omap_generic.c
@@ -0,0 +1,32 @@
+/*
+ * (C) Copyright 2013 Teresa Gámez, Phytec Messtechnik GmbH
+ *
+ * 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.
+ *
+ */
+#include <common.h>
+#include <envfs.h>
+#include <init.h>
+#include <io.h>
+#include <fs.h>
+#include <linux/stat.h>
+#include <mach/generic.h>
+
+enum omap_boot_src omap_bootsrc(void)
+{
+#if defined(CONFIG_ARCH_OMAP3)
+ return omap3_bootsrc();
+#elif defined(CONFIG_ARCH_OMAP4)
+ return omap4_bootsrc();
+#elif defined(CONFIG_ARCH_AM33XX)
+ return am33xx_bootsrc();
+#endif
+}
diff --git a/arch/arm/mach-omap/xload.c b/arch/arm/mach-omap/xload.c
index 41533a9680..72aa3791e4 100644
--- a/arch/arm/mach-omap/xload.c
+++ b/arch/arm/mach-omap/xload.c
@@ -6,7 +6,7 @@
#include <linux/mtd/mtd.h>
#include <fs.h>
#include <fcntl.h>
-#include <mach/xload.h>
+#include <mach/generic.h>
#include <sizes.h>
#include <filetype.h>
@@ -158,17 +158,6 @@ static void *omap4_xload_boot_usb(void){
return buf;
}
-enum omap_boot_src omap_bootsrc(void)
-{
-#if defined(CONFIG_ARCH_OMAP3)
- return omap3_bootsrc();
-#elif defined(CONFIG_ARCH_OMAP4)
- return omap4_bootsrc();
-#elif defined(CONFIG_ARCH_AM33XX)
- return am33xx_bootsrc();
-#endif
-}
-
/*
* Replaces the default shell in xload configuration
*/