davinci: reduce pimux_config size by storing register id instead of address
Subsystems (2)
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)
Signed-off-by J?r?me Carretero <[email protected]>
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
@@ -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
@@ -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
@@ -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
@@ -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
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)
Signed-off-by J?r?me Carretero <[email protected]>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>