[U-Boot] [PATCH] MX31: Removed warnings for iomux function
Liu Hui-R64343
r64343 at freescale.com
Tue Oct 19 10:21:16 CEST 2010
Hi, Stefano,
> -----Original Message-----
> From: u-boot-bounces at lists.denx.de
[mailto:u-boot-bounces at lists.denx.de]
> On Behalf Of Stefano Babic
> Sent: Tuesday, October 19, 2010 3:24 PM
> To: u-boot at lists.denx.de
> Subject: [U-Boot] [PATCH] MX31: Removed warnings for iomux function
>
> Removed warnings generated in the mx31_set_pad() function.
>
> Signed-off-by: Stefano Babic <sbabic at denx.de>
> ---
> arch/arm/cpu/arm1136/mx31/generic.c | 2 +-
> arch/arm/include/asm/arch-mx31/mx31.h | 1 +
> 2 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/cpu/arm1136/mx31/generic.c
> b/arch/arm/cpu/arm1136/mx31/generic.c
> index cbe8243..db5d3f0 100644
> --- a/arch/arm/cpu/arm1136/mx31/generic.c
> +++ b/arch/arm/cpu/arm1136/mx31/generic.c
> @@ -97,7 +97,7 @@ void mx31_set_pad(enum iomux_pins pin, u32 config)
> void *reg;
>
> pin &= IOMUX_PADNUM_MASK;
> - reg = (IOMUXC_BASE + 0x154) + (pin + 2) / 3 * 4;
> + reg = (void *)((IOMUXC_BASE + 0x154) + (pin + 2) / 3 * 4);
Any reason we need define void *reg here?
I also found there is some mess for register read/write in this file,
for example,
arch/arm/cpu/arm1136/mx31/generic.c:
In function: mx31_gpio_mux
unsigned long reg, shift, tmp;
tmp = __REG(reg);
while in function: mx31_set_pad
u32 field, l;
void *reg;
l = __raw_readl(reg);
We need take the same code-style, right?
> field = (pin + 2) % 3;
>
> l = __raw_readl(reg);
> diff --git a/arch/arm/include/asm/arch-mx31/mx31.h
> b/arch/arm/include/asm/arch-mx31/mx31.h
> index 5a5aa11..a755212 100644
> --- a/arch/arm/include/asm/arch-mx31/mx31.h
> +++ b/arch/arm/include/asm/arch-mx31/mx31.h
> @@ -27,6 +27,7 @@
> extern u32 mx31_get_ipg_clk(void);
> #define imx_get_uartclk mx31_get_ipg_clk
> extern void mx31_gpio_mux(unsigned long mode);
> +extern void mx31_set_pad(enum iomux_pins pin, u32 config);
>
> void mx31_uart1_hw_init(void);
> void mx31_spi2_hw_init(void);
> --
> 1.7.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
More information about the U-Boot
mailing list