mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jan Luebbe <jlu@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 14/19] ARM omap hsmmc: Fix register offset
Date: Tue, 18 Dec 2012 15:22:36 +0100	[thread overview]
Message-ID: <1355840561-11552-15-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>

The hsmmc module has a 0x100 offset in its register space. The real
register space size for the module is 4K, so when we register the
device with the size 4k, we have to account for the offset in the
driver, not in the resource allocation.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-omap/include/mach/omap3-devices.h |    6 +++---
 arch/arm/mach-omap/include/mach/omap4-silicon.h |   10 +++++-----
 drivers/mci/omap_hsmmc.c                        |    4 +++-
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-omap/include/mach/omap3-devices.h b/arch/arm/mach-omap/include/mach/omap3-devices.h
index dd6826a..555e86f 100644
--- a/arch/arm/mach-omap/include/mach/omap3-devices.h
+++ b/arch/arm/mach-omap/include/mach/omap3-devices.h
@@ -53,17 +53,17 @@ static inline struct device_d *omap3_add_uart3(void)
 
 static inline struct device_d *omap3_add_mmc1(struct omap_hsmmc_platform_data *pdata)
 {
-	return omap_add_mmc(0, OMAP_MMC1_BASE + 0x100, pdata);
+	return omap_add_mmc(0, OMAP_MMC1_BASE, pdata);
 }
 
 static inline struct device_d *omap3_add_mmc2(struct omap_hsmmc_platform_data *pdata)
 {
-	return omap_add_mmc(1, OMAP_MMC2_BASE + 0x100, pdata);
+	return omap_add_mmc(1, OMAP_MMC2_BASE, pdata);
 }
 
 static inline struct device_d *omap3_add_mmc3(struct omap_hsmmc_platform_data *pdata)
 {
-	return omap_add_mmc(2, OMAP_MMC3_BASE + 0x100, pdata);
+	return omap_add_mmc(2, OMAP_MMC3_BASE, pdata);
 }
 
 static inline struct device_d *omap3_add_i2c1(void *pdata)
diff --git a/arch/arm/mach-omap/include/mach/omap4-silicon.h b/arch/arm/mach-omap/include/mach/omap4-silicon.h
index 5755856..b5d1eb9 100644
--- a/arch/arm/mach-omap/include/mach/omap4-silicon.h
+++ b/arch/arm/mach-omap/include/mach/omap4-silicon.h
@@ -95,11 +95,11 @@
 #define OMAP44XX_32KTIMER_BASE		(OMAP44XX_L4_WKUP_BASE + 0x4000)
 
 /* MMC */
-#define OMAP44XX_MMC1_BASE		(OMAP44XX_L4_PER_BASE + 0x09C100)
-#define OMAP44XX_MMC2_BASE		(OMAP44XX_L4_PER_BASE + 0x0B4100)
-#define OMAP44XX_MMC3_BASE		(OMAP44XX_L4_PER_BASE + 0x0AD100)
-#define OMAP44XX_MMC4_BASE		(OMAP44XX_L4_PER_BASE + 0x0D1100)
-#define OMAP44XX_MMC5_BASE		(OMAP44XX_L4_PER_BASE + 0x0D5100)
+#define OMAP44XX_MMC1_BASE		(OMAP44XX_L4_PER_BASE + 0x09C000)
+#define OMAP44XX_MMC2_BASE		(OMAP44XX_L4_PER_BASE + 0x0B4000)
+#define OMAP44XX_MMC3_BASE		(OMAP44XX_L4_PER_BASE + 0x0AD000)
+#define OMAP44XX_MMC4_BASE		(OMAP44XX_L4_PER_BASE + 0x0D1000)
+#define OMAP44XX_MMC5_BASE		(OMAP44XX_L4_PER_BASE + 0x0D5000)
 
 /* GPIO
  *
diff --git a/drivers/mci/omap_hsmmc.c b/drivers/mci/omap_hsmmc.c
index d1e4c36..6471ea6 100644
--- a/drivers/mci/omap_hsmmc.c
+++ b/drivers/mci/omap_hsmmc.c
@@ -175,6 +175,7 @@ struct omap_hsmmc {
 	struct mci_host		mci;
 	struct device_d		*dev;
 	struct hsmmc		*base;
+	void __iomem		*iobase;
 };
 
 #define to_hsmmc(mci)	container_of(mci, struct omap_hsmmc, mci)
@@ -575,7 +576,8 @@ static int omap_mmc_probe(struct device_d *dev)
 	hsmmc->mci.host_caps = MMC_MODE_4BIT | MMC_MODE_HS_52MHz | MMC_MODE_HS;
 	hsmmc->mci.hw_dev = dev;
 
-	hsmmc->base = dev_request_mem_region(dev, 0);
+	hsmmc->iobase = dev_request_mem_region(dev, 0);
+	hsmmc->base = hsmmc->iobase + 0x100;
 
 	hsmmc->mci.voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
 
-- 
1.7.10.4


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

  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 ` [PATCH 05/19] ARM omap: Make gpmc base runtime configurable Jan Luebbe
2012-12-18 14:22 ` [PATCH 06/19] ARM omap: Make timer " 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 ` Jan Luebbe [this message]
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-15-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