Skip to contentSkip to conversation

MX31: Removed warnings for iomux function

PATCH Superseded Stefano Babic 3 participants 4 messages Oct 19, 2010 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MX31: Removed warnings for iomux function

Removed warnings generated in the mx31_set_pad() function.

---
 arch/arm/cpu/arm1136/mx31/generic.c   |    2 +-
 arch/arm/include/asm/arch-mx31/mx31.h |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/cpu/arm1136/mx31/generic.c +1 -1
index cbe8243..db5d3f0 100644
@@ -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);
 	field = (pin + 2) % 3;
 
 	l = __raw_readl(reg);
arch/arm/include/asm/arch-mx31/mx31.h +1 -0
index 5a5aa11..a755212 100644
@@ -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);
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 MX31: Removed warnings for iomux function

Hi, Stefano,

Quoted 2 lines

-----Original Message-----
From: u-boot-bounces at lists.denx.de

[mailto:u-boot-bounces at lists.denx.de]

Quoted 19 lines

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.

---
 arch/arm/cpu/arm1136/mx31/generic.c   |    2 +-
 arch/arm/include/asm/arch-mx31/mx31.h |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/cpu/arm1136/mx31/generic.c +0 -0
index cbe8243..db5d3f0 100644

arch/arm/cpu/arm1136/mx31/generic.c void mx31_set_pad(enum iomux_pins pin, u32 config) · line 100

Quoted 5 lines
arch/arm/cpu/arm1136/mx31/generic.c +1 -1
@@ -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?

Quoted 23 lines
arch/arm/cpu/arm1136/mx31/generic.c +0 -0
 	field = (pin + 2) % 3;
 
 	l = __raw_readl(reg);
arch/arm/include/asm/arch-mx31/mx31.h +1 -1
index 5a5aa11..a755212 100644
@@ -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

#2 lore raw

PATCH v2 1/1 MX31: Removed warnings for iomux function

In reply to Stefano Babic

Removed warnings generated in the mx31_set_pad() function.

---
 arch/arm/cpu/arm1136/mx31/generic.c   |    7 +++----
 arch/arm/include/asm/arch-mx31/mx31.h |    1 +
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/cpu/arm1136/mx31/generic.c +3 -4
index cbe8243..8bd23ee 100644
@@ -93,17 +93,16 @@ void mx31_gpio_mux(unsigned long mode)
 
 void mx31_set_pad(enum iomux_pins pin, u32 config)
 {
-	u32 field, l;
-	void *reg;
+	u32 field, l, reg;
 
 	pin &= IOMUX_PADNUM_MASK;
 	reg = (IOMUXC_BASE + 0x154) + (pin + 2) / 3 * 4;
 	field = (pin + 2) % 3;
 
-	l = __raw_readl(reg);
+	l = __REG(reg);
 	l &= ~(0x1ff << (field * 10));
 	l |= config << (field * 10);
-	__raw_writel(l, reg);
+	__REG(reg) = l;
 
 }
 
arch/arm/include/asm/arch-mx31/mx31.h +1 -0
index 5a5aa11..a755212 100644
@@ -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);
Signature · 1 line
1.7.1
#3 lore raw

PATCH v2 1/1 MX31: Removed warnings for iomux function

Dear Stefano Babic,

Quoted 7 lines · In message <[email protected]> you wrote:

Removed warnings generated in the mx31_set_pad() function.

---
 arch/arm/cpu/arm1136/mx31/generic.c   |    7 +++----
 arch/arm/include/asm/arch-mx31/mx31.h |    1 +
 2 files changed, 4 insertions(+), 4 deletions(-)

Applied directly, hope this is OK with you.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A modem is a baudy house.