summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorTeresa Gámez <t.gamez@phytec.de>2012-12-20 15:22:30 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-12-21 08:28:05 +0100
commiteb68d9a51bfdf5b159a78c65ad6fbebd80f8a0ff (patch)
tree7068833d143a1ceb085f71284846c60449b070f6 /arch
parent145fe7c167139f71aef6202ce000a6dead586d67 (diff)
downloadbarebox-eb68d9a51bfdf5b159a78c65ad6fbebd80f8a0ff.tar.gz
barebox-eb68d9a51bfdf5b159a78c65ad6fbebd80f8a0ff.tar.xz
ARM OMAP: Add SRAM and DRAM to device register functions
Signed-off-by: Teresa Gámez <t.gamez@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap/include/mach/devices.h4
-rw-r--r--arch/arm/mach-omap/include/mach/omap3-devices.h6
-rw-r--r--arch/arm/mach-omap/include/mach/omap4-devices.h5
-rw-r--r--arch/arm/mach-omap/include/mach/omap4-silicon.h2
-rw-r--r--arch/arm/mach-omap/omap_devices.c12
5 files changed, 29 insertions, 0 deletions
diff --git a/arch/arm/mach-omap/include/mach/devices.h b/arch/arm/mach-omap/include/mach/devices.h
index 9881604370..6cbb25e028 100644
--- a/arch/arm/mach-omap/include/mach/devices.h
+++ b/arch/arm/mach-omap/include/mach/devices.h
@@ -3,6 +3,10 @@
#include <mach/omap_hsmmc.h>
+void omap_add_ram0(resource_size_t size);
+
+void omap_add_sram0(resource_size_t base, resource_size_t size);
+
struct device_d *omap_add_uart(int id, unsigned long base);
struct device_d *omap_add_mmc(int id, unsigned long base,
diff --git a/arch/arm/mach-omap/include/mach/omap3-devices.h b/arch/arm/mach-omap/include/mach/omap3-devices.h
index 6617430ef5..9d682cf662 100644
--- a/arch/arm/mach-omap/include/mach/omap3-devices.h
+++ b/arch/arm/mach-omap/include/mach/omap3-devices.h
@@ -8,6 +8,12 @@
#include <mach/mcspi.h>
#include <mach/omap_hsmmc.h>
+
+static inline void omap3_add_sram0(void)
+{
+ return omap_add_sram0(OMAP3_SRAM_BASE, 64 * SZ_1K);
+}
+
/* the device numbering is the same as in the device tree */
static inline struct device_d *omap3_add_spi(int id, resource_size_t start)
diff --git a/arch/arm/mach-omap/include/mach/omap4-devices.h b/arch/arm/mach-omap/include/mach/omap4-devices.h
index 448de6824e..df0694f9fa 100644
--- a/arch/arm/mach-omap/include/mach/omap4-devices.h
+++ b/arch/arm/mach-omap/include/mach/omap4-devices.h
@@ -8,6 +8,11 @@
#include <mach/mcspi.h>
#include <mach/omap_hsmmc.h>
+static inline void omap44xx_add_sram0(void)
+{
+ return omap_add_sram0(OMAP44XX_SRAM_BASE, 48 * SZ_1K);
+}
+
static inline struct device_d *omap44xx_add_uart1(void)
{
return omap_add_uart(0, OMAP44XX_UART1_BASE);
diff --git a/arch/arm/mach-omap/include/mach/omap4-silicon.h b/arch/arm/mach-omap/include/mach/omap4-silicon.h
index 0e8abdaab4..9e82435e9c 100644
--- a/arch/arm/mach-omap/include/mach/omap4-silicon.h
+++ b/arch/arm/mach-omap/include/mach/omap4-silicon.h
@@ -41,6 +41,8 @@
#define OMAP44XX_SRAM_BASE 0x40300000
+#define OMAP44XX_SRAM_BASE 0x40300000
+
/* EMIF and DMM registers */
#define OMAP44XX_EMIF1_BASE 0x4c000000
#define OMAP44XX_EMIF2_BASE 0x4d000000
diff --git a/arch/arm/mach-omap/omap_devices.c b/arch/arm/mach-omap/omap_devices.c
index acf029d9c1..e83ac85179 100644
--- a/arch/arm/mach-omap/omap_devices.c
+++ b/arch/arm/mach-omap/omap_devices.c
@@ -1,7 +1,19 @@
#include <driver.h>
#include <ns16550.h>
+#include <asm/armlinux.h>
+
#include <mach/omap3-devices.h>
+void omap_add_ram0(resource_size_t size)
+{
+ arm_add_mem_device("ram0", 0x80000000, size);
+}
+
+void omap_add_sram0(resource_size_t base, resource_size_t size)
+{
+ add_mem_device("sram0", base, size, IORESOURCE_MEM_WRITEABLE);
+}
+
static struct NS16550_plat serial_plat = {
.clock = 48000000, /* 48MHz (APLL96/2) */
.shift = 2,