mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Teresa Gámez" <t.gamez@phytec.de>
To: barebox@lists.infradead.org
Subject: [PATCHv2 2/6] ARM OMAP: Add SRAM and DRAM to device register functions
Date: Thu, 20 Dec 2012 15:22:30 +0100	[thread overview]
Message-ID: <1356013354-25832-3-git-send-email-t.gamez@phytec.de> (raw)
In-Reply-To: <1356013354-25832-1-git-send-email-t.gamez@phytec.de>


Signed-off-by: Teresa Gámez <t.gamez@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


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2012-12-20 14:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-20 14:22 [PATCHv2 0/6] Add PCM051 support Teresa Gámez
2012-12-20 14:22 ` [PATCHv2 1/6] ARM AM33XX: Add mmc0 pin mux function Teresa Gámez
2012-12-20 14:22 ` Teresa Gámez [this message]
2012-12-20 14:22 ` [PATCHv2 3/6] ARM OMAP: Apply RAM device register functions to boards Teresa Gámez
2012-12-20 14:25   ` Jean-Christophe PLAGNIOL-VILLARD
2012-12-20 14:22 ` [PATCHv2 4/6] ARM OMAP: Add EHCI to device register functions Teresa Gámez
2012-12-20 14:22 ` [PATCHv2 5/6] ARM OMAP: Apply EHCI " Teresa Gámez
2012-12-20 14:22 ` [PATCHv2 6/6] pcm051: Add inital support Teresa Gámez
2012-12-21 11:22 ` [PATCHv2 0/6] Add PCM051 support Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1356013354-25832-3-git-send-email-t.gamez@phytec.de \
    --to=t.gamez@phytec.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox