[PATCHv2 2/6] ARM OMAP: Add SRAM and DRAM to device register functions

Teresa Gámez t.gamez at phytec.de
Thu Dec 20 09:22:30 EST 2012


Signed-off-by: Teresa Gámez <t.gamez at phytec.de>
---
 arch/arm/mach-omap/include/mach/devices.h       |    4 ++++
 arch/arm/mach-omap/include/mach/omap3-devices.h |    6 ++++++
 arch/arm/mach-omap/include/mach/omap4-devices.h |    5 +++++
 arch/arm/mach-omap/include/mach/omap4-silicon.h |    2 ++
 arch/arm/mach-omap/omap_devices.c               |   12 ++++++++++++
 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 9881604..6cbb25e 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 6617430..9d682cf 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 448de68..df0694f 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 b5d1eb9..379588d 100644
--- a/arch/arm/mach-omap/include/mach/omap4-silicon.h
+++ b/arch/arm/mach-omap/include/mach/omap4-silicon.h
@@ -39,6 +39,8 @@
 #define OMAP44XX_L4_WKUP_BASE		0x4A300000
 #define OMAP44XX_L4_PER_BASE		0x48000000
 
+#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 acf029d..e83ac85 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,
-- 
1.7.0.4




More information about the barebox mailing list