From: Jan Luebbe <jlu@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 05/19] ARM omap: Make gpmc base runtime configurable
Date: Tue, 18 Dec 2012 15:22:27 +0100 [thread overview]
Message-ID: <1355840561-11552-6-git-send-email-jlu@pengutronix.de> (raw)
In-Reply-To: <1355840561-11552-1-git-send-email-jlu@pengutronix.de>
From: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-omap/devices-gpmc-nand.c | 2 +-
arch/arm/mach-omap/gpmc.c | 14 ++++++++++++--
arch/arm/mach-omap/include/mach/gpmc.h | 4 +++-
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-omap/devices-gpmc-nand.c b/arch/arm/mach-omap/devices-gpmc-nand.c
index 42cb1b4..b2a2b0f 100644
--- a/arch/arm/mach-omap/devices-gpmc-nand.c
+++ b/arch/arm/mach-omap/devices-gpmc-nand.c
@@ -46,7 +46,7 @@ int omap_add_gpmc_nand_device(struct gpmc_nand_platform_data *pdata)
/* Configure GPMC CS before register */
gpmc_cs_config(pdata->cs, pdata->nand_cfg);
- add_generic_device("gpmc_nand", DEVICE_ID_DYNAMIC, NULL, OMAP_GPMC_BASE,
+ add_generic_device("gpmc_nand", DEVICE_ID_DYNAMIC, NULL, (resource_size_t)omap_gpmc_base,
1024 * 4, IORESOURCE_MEM, pdata);
return 0;
diff --git a/arch/arm/mach-omap/gpmc.c b/arch/arm/mach-omap/gpmc.c
index 4cfb7cf..d2b7024 100644
--- a/arch/arm/mach-omap/gpmc.c
+++ b/arch/arm/mach-omap/gpmc.c
@@ -29,6 +29,16 @@
#include <mach/sys_info.h>
#include <mach/syslib.h>
+void __iomem *omap_gpmc_base;
+
+static int gpmc_init(void)
+{
+ omap_gpmc_base = (void *)OMAP_GPMC_BASE;
+
+ return 0;
+}
+pure_initcall(gpmc_init);
+
/**
* @brief Do a Generic initialization of GPMC. if you choose otherwise,
* Use gpmc registers to modify the values. The defaults configured are:
@@ -43,7 +53,7 @@
void gpmc_generic_init(unsigned int cfg)
{
uint64_t start;
- unsigned int reg = GPMC_REG(CONFIG7_0);
+ void __iomem *reg = GPMC_REG(CONFIG7_0);
char x = 0;
debug("gpmccfg=0x%x\n", cfg);
@@ -89,7 +99,7 @@ EXPORT_SYMBOL(gpmc_generic_init);
*/
void gpmc_cs_config(char cs, struct gpmc_config *config)
{
- unsigned int reg = GPMC_REG(CONFIG1_0) + (cs * GPMC_CONFIG_CS_SIZE);
+ void __iomem *reg = GPMC_REG(CONFIG1_0) + (cs * GPMC_CONFIG_CS_SIZE);
unsigned char x = 0;
debug("gpmccs=0x%x cfg=0x%p\n", cs, config);
diff --git a/arch/arm/mach-omap/include/mach/gpmc.h b/arch/arm/mach-omap/include/mach/gpmc.h
index 957ff55..d4eac79 100644
--- a/arch/arm/mach-omap/include/mach/gpmc.h
+++ b/arch/arm/mach-omap/include/mach/gpmc.h
@@ -32,8 +32,10 @@
#ifndef __ASM_ARCH_OMAP_GPMC_H
#define __ASM_ARCH_OMAP_GPMC_H
+extern void __iomem *omap_gpmc_base;
+
/** GPMC Reg Wrapper */
-#define GPMC_REG(REGNAME) (OMAP_GPMC_BASE + GPMC_##REGNAME)
+#define GPMC_REG(REGNAME) (omap_gpmc_base + GPMC_##REGNAME)
#define GPMC_SYS_CONFIG (0x10)
#define GPMC_SYS_STATUS (0x14)
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2012-12-18 14:23 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-18 14:22 AM33xx and BeagleBone support Jan Luebbe
2012-12-18 14:22 ` [PATCH 01/19] ARM omap: remove unused function Jan Luebbe
2012-12-18 14:22 ` [PATCH 02/19] ARM omap4: remove unused struct Jan Luebbe
2012-12-18 14:22 ` [PATCH 03/19] ARM omap4: Add missing assembly protection in header file Jan Luebbe
2012-12-18 14:22 ` [PATCH 04/19] ARM omap4: Add missing double include protection Jan Luebbe
2012-12-18 14:22 ` Jan Luebbe [this message]
2012-12-18 14:22 ` [PATCH 06/19] ARM omap: Make timer base runtime configurable Jan Luebbe
2012-12-18 14:22 ` [PATCH 07/19] ARM omap4: make PRM defines SoC specific Jan Luebbe
2012-12-18 14:22 ` [PATCH 08/19] ARM omap3: " Jan Luebbe
2012-12-18 14:22 ` [PATCH 09/19] ARM omap: Use SoC specific defines for gpmc and timer base Jan Luebbe
2012-12-18 14:22 ` [PATCH 10/19] ARM omap: include individual SoC files Jan Luebbe
2012-12-18 14:22 ` [PATCH 11/19] ARM omap: Add device register convenience functions Jan Luebbe
2012-12-18 14:22 ` [PATCH 12/19] ARM omap3: Use device register functions in boards Jan Luebbe
2012-12-18 14:22 ` [PATCH 13/19] ARM omap4: " Jan Luebbe
2012-12-18 14:22 ` [PATCH 14/19] ARM omap hsmmc: Fix register offset Jan Luebbe
2012-12-18 14:22 ` [PATCH 15/19] ARM omap3: Add change OMAP_ prefix to OMAP3_ for registers Jan Luebbe
2012-12-18 14:22 ` [PATCH 16/19] ARM OMAP AM33XX: create new ARCH for AM33xx Jan Luebbe
2012-12-18 14:22 ` [PATCH 17/19] arm: omap: am33xx: add support for low level debug Jan Luebbe
2012-12-18 14:22 ` [PATCH 18/19] arm: beaglebone: add first-stage support for AM335x and board Jan Luebbe
2012-12-19 12:07 ` Teresa Gámez
2012-12-18 14:22 ` [PATCH 19/19] drivers: net: add driver for TI CPSW Jan Luebbe
2012-12-19 21:11 ` 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=1355840561-11552-6-git-send-email-jlu@pengutronix.de \
--to=jlu@pengutronix.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