Skip to contentSkip to conversation

davinci: reduce pimux_config size by storing register id instead of address

PATCH New Jérôme Carretero 2 participants 2 messages Apr 8, 2012 – Jul 9, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 davinci: reduce pimux_config size by storing register id instead of address

This patch does nothing except saving a few bytes (makes a difference SPL)

CC Manjunathappa, Prakash <[email protected]>
---
 arch/arm/cpu/arm926ejs/davinci/pinmux.c          |    2 +-
 arch/arm/include/asm/arch-davinci/davinci_misc.h |    2 +-
 arch/arm/include/asm/arch-davinci/hardware.h     |    2 +-
 drivers/gpio/da8xx_gpio.c                        |    2 --
 4 files changed, 3 insertions(+), 5 deletions(-)
arch/arm/cpu/arm926ejs/davinci/pinmux.c +1 -1
index ce58f71..bf7bfbb 100644
@@ -65,7 +65,7 @@ int davinci_configure_pin_mux(const struct pinmux_config *pins,
 		const int offset = pins[i].field * PIN_MUX_FIELD_SIZE;
 		const unsigned int value = pins[i].value << offset;
 		const unsigned int mask = PIN_MUX_FIELD_MASK << offset;
-		const dv_reg *mux = pins[i].mux;
+		const dv_reg *mux = &davinci_syscfg_regs->pinmux[pins[i].mux];
 
 		writel(value | (readl(mux) & (~mask)), mux);
 	}
arch/arm/include/asm/arch-davinci/davinci_misc.h +1 -1
index 463cbde..64e799b 100644
@@ -29,7 +29,7 @@
 
 /* pin definition */
 struct pinmux_config {
-	dv_reg		*mux;		/* Address of mux register */
+	char		mux;		/* Mux register */
 	unsigned char	value;		/* Value to set in field */
 	unsigned char	field;		/* field number */
 };
arch/arm/include/asm/arch-davinci/hardware.h +1 -1
index 994657a..601c6f5 100644
@@ -486,7 +486,7 @@ struct davinci_syscfg_regs {
 #define davinci_syscfg_regs \
 	((struct davinci_syscfg_regs *)DAVINCI_BOOTCFG_BASE)
 
-#define pinmux(x)	(&davinci_syscfg_regs->pinmux[x])
+#define pinmux(x)	(x)
 
 /* Emulation suspend bits */
 #define DAVINCI_SYSCFG_SUSPSRC_EMAC		(1 << 5)
drivers/gpio/da8xx_gpio.c +0 -2
index 4c30fa3..ab05201 100644
@@ -31,8 +31,6 @@ static struct gpio_registry {
 	char name[GPIO_NAME_SIZE];
 } gpio_registry[MAX_NUM_GPIOS] = {};
 
-#define pinmux(x)       (&davinci_syscfg_regs->pinmux[x])
-
 static const struct pinmux_config gpio_pinmux[] = {
 	{ pinmux(1), 8, 7 },	/* GP0[0] */
 	{ pinmux(1), 8, 6 },
Signature · 1 line
1.7.9.4
#1 lore raw

PATCH 1/1 davinci: reduce pimux_config size by storing register id instead of address

Quoted 10 lines · J?r?me Carretero

This patch does nothing except saving a few bytes (makes a difference SPL)

CC Manjunathappa, Prakash <[email protected]>
---
 arch/arm/cpu/arm926ejs/davinci/pinmux.c          |    2 +-
 arch/arm/include/asm/arch-davinci/davinci_misc.h |    2 +-
 arch/arm/include/asm/arch-davinci/hardware.h     |    2 +-
 drivers/gpio/da8xx_gpio.c                        |    2 --
 4 files changed, 3 insertions(+), 5 deletions(-)

I'm OK with the concept, but it no longer applies such that boards still build. Please re-submit when a MAKEALL -s davinci builds and I'll get this into /master if there's still time or /next. Sorry for the delay, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120709/caf1b890/attachment.pgp>