summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-11-21 09:15:55 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-11-27 10:42:53 +0100
commit5c8ea4ff9a0f305334d3aa73a35a3898bd2a61f6 (patch)
treed5acb7884c93e012b1921b1c707ac5f979e962ad
parent7603f7442bdd473c6986279c41ee7a7321ba1847 (diff)
downloadbarebox-5c8ea4ff9a0f305334d3aa73a35a3898bd2a61f6.tar.gz
omap: gpmc: some refactoring
- make debug messages more meaningful - calculate value once and use it to print and configure instead of calculating it twice Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/mach-omap/gpmc.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/arch/arm/mach-omap/gpmc.c b/arch/arm/mach-omap/gpmc.c
index bb84b38650..dae7630b63 100644
--- a/arch/arm/mach-omap/gpmc.c
+++ b/arch/arm/mach-omap/gpmc.c
@@ -111,7 +111,10 @@ void gpmc_cs_config(char cs, struct gpmc_config *config)
{
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);
+ uint32_t config7;
+
+ debug("%s: cs=%d base=0x%08x size=0x%08x\n", __func__,
+ cs, config->base, config->size);
/* Disable the CS before reconfiguring */
writel(0x0, GPMC_REG(CONFIG7_0) + (cs * GPMC_CONFIG_CS_SIZE));
@@ -119,22 +122,22 @@ void gpmc_cs_config(char cs, struct gpmc_config *config)
/* Write the CFG1-6 regs */
while (x < 6) {
- debug("gpmccfg%d Reg:0x%p <-0x%08x\n",
- x, reg, config->cfg[x]);
+ debug("gpmccfg%d Reg:0x%p <-0x%08x, old 0x%08x\n",
+ x, reg, config->cfg[x], readl(reg));
writel(config->cfg[x], reg);
reg += GPMC_CONFIG_REG_OFF;
x++;
}
- /* reg now points to CFG7 */
- debug("gpmccfg%d Reg:0x%p <-0x%08x\n",
- x, reg, (0x1 << 6) | /* CS enable */
- ((config->size & 0xF) << 8) | /* Size */
- ((config->base >> 24) & 0x3F));
- writel((0x1 << 6) | /* CS enable */
+ config7 = (0x1 << 6) | /* CS enable */
((config->size & 0xF) << 8) | /* Size */
- ((config->base >> 24) & 0x3F), /* Address */
- reg);
+ ((config->base >> 24) & 0x3F);
+
+ debug("gpmccfg%d Reg:0x%p <-0x%08x, old 0x%08x\n",
+ x, reg, config7, readl(reg));
+
+ writel(config7, reg);
+
mdelay(1); /* Settling time */
}
EXPORT_SYMBOL(gpmc_cs_config);