Skip to contentSkip to conversation

MX5: Add initial support for mx53

PATCH New Jason Liu 3 participants 5 messages Dec 6, 2010 – Dec 7, 2010

Subsystems (3)
lore
Share & tools
lore

Jason Liu

author
#0 lore raw

PATCH 1/1 MX5: Add initial support for mx53

Add initial support for mx53 with the following change,

- Add the iomux support and the pin definition,
- Add the regs definition, clean up some unused def from mx51,
- Add the low level init support, make use the freq input of setup_pll macro

This patch has been tested on MX51 Babbage 3.0

---
 arch/arm/cpu/armv7/mx5/iomux.c            |  102 ++++---
 arch/arm/cpu/armv7/mx5/lowlevel_init.S    |   92 ++++---
 arch/arm/cpu/armv7/mx5/soc.c              |    5 +-
 arch/arm/include/asm/arch-mx5/imx-regs.h  |   73 ++---
 arch/arm/include/asm/arch-mx5/iomux.h     |  102 -------
 arch/arm/include/asm/arch-mx5/mx5x_pins.h |  469 ++++++++++++++++++++++++++++-
 arch/arm/include/asm/arch-mx5/sys_proto.h |    7 +-
 include/configs/mx51evk.h                 |    3 +-
 8 files changed, 617 insertions(+), 236 deletions(-)
arch/arm/cpu/armv7/mx5/iomux.c +61 -41
old mode 100644
new mode 100755
index e8928d5..d4b5bbd
@@ -34,7 +34,7 @@ enum iomux_reg_addr {
 	IOMUXSW_MUX_CTL = IOMUXC_BASE_ADDR,
 	IOMUXSW_MUX_END = IOMUXC_BASE_ADDR + MUX_I_END,
 	IOMUXSW_PAD_CTL = IOMUXC_BASE_ADDR + PAD_I_START,
-	IOMUXSW_INPUT_CTL = IOMUXC_BASE_ADDR,
+	IOMUXSW_INPUT_CTL = IOMUXC_BASE_ADDR + INPUT_CTL_START,
 };
 
 #define MUX_PIN_NUM_MAX (((MUX_I_END - MUX_I_START) >> 2) + 1)
@@ -44,20 +44,22 @@ static inline u32 get_mux_reg(iomux_pin_name_t pin)
 {
 	u32 mux_reg = PIN_TO_IOMUX_MUX(pin);
 
-	if (is_soc_rev(CHIP_REV_2_0) < 0) {
-		/*
-		 * Fixup register address:
-		 *	i.MX51 TO1 has offset with the register
-		 * 	which is define as TO2.
-		 */
-		if ((pin == MX51_PIN_NANDF_RB5) ||
-			(pin == MX51_PIN_NANDF_RB6) ||
-			(pin == MX51_PIN_NANDF_RB7))
-			; /* Do nothing */
-		else if (mux_reg >= 0x2FC)
-			mux_reg += 8;
-		else if (mux_reg >= 0x130)
-			mux_reg += 0xC;
+	if (is_soc_type(MX_CPU_MX51)) {
+		if (is_soc_rev(CHIP_REV_2_0) < 0) {
+			/*
+			 * Fixup register address:
+			 * i.MX51 TO1 has offset with the register
+			 * which is define as TO2.
+			 */
+			if ((pin == MX51_PIN_NANDF_RB5) ||
+				(pin == MX51_PIN_NANDF_RB6) ||
+				(pin == MX51_PIN_NANDF_RB7))
+				; /* Do nothing */
+			else if (mux_reg >= 0x2FC)
+				mux_reg += 8;
+			else if (mux_reg >= 0x130)
+				mux_reg += 0xC;
+		}
 	}
 	mux_reg += IOMUXSW_MUX_CTL;
 	return mux_reg;
@@ -68,28 +70,30 @@ static inline u32 get_pad_reg(iomux_pin_name_t pin)
 {
 	u32 pad_reg = PIN_TO_IOMUX_PAD(pin);
 
-	if (is_soc_rev(CHIP_REV_2_0) < 0) {
-		/*
-		 * Fixup register address:
-		 *	i.MX51 TO1 has offset with the register
-		 * 	which is define as TO2.
-		 */
-		if ((pin == MX51_PIN_NANDF_RB5) ||
-			(pin == MX51_PIN_NANDF_RB6) ||
-			(pin == MX51_PIN_NANDF_RB7))
-			; /* Do nothing */
-		else if (pad_reg == 0x4D0 - PAD_I_START)
-			pad_reg += 0x4C;
-		else if (pad_reg == 0x860 - PAD_I_START)
-			pad_reg += 0x9C;
-		else if (pad_reg >= 0x804 - PAD_I_START)
-			pad_reg += 0xB0;
-		else if (pad_reg >= 0x7FC - PAD_I_START)
-			pad_reg += 0xB4;
-		else if (pad_reg >= 0x4E4 - PAD_I_START)
-			pad_reg += 0xCC;
-		else
-			pad_reg += 8;
+	if (is_soc_type(MX_CPU_MX51)) {
+		if (is_soc_rev(CHIP_REV_2_0) < 0) {
+			/*
+			 * Fixup register address:
+			 * i.MX51 TO1 has offset with the register
+			 * which is define as TO2.
+			 */
+			if ((pin == MX51_PIN_NANDF_RB5) ||
+				(pin == MX51_PIN_NANDF_RB6) ||
+				(pin == MX51_PIN_NANDF_RB7))
+				; /* Do nothing */
+			else if (pad_reg == 0x4D0 - PAD_I_START)
+				pad_reg += 0x4C;
+			else if (pad_reg == 0x860 - PAD_I_START)
+				pad_reg += 0x9C;
+			else if (pad_reg >= 0x804 - PAD_I_START)
+				pad_reg += 0xB0;
+			else if (pad_reg >= 0x7FC - PAD_I_START)
+				pad_reg += 0xB4;
+			else if (pad_reg >= 0x4E4 - PAD_I_START)
+				pad_reg += 0xCC;
+			else
+				pad_reg += 8;
+		}
 	}
 	pad_reg += IOMUXSW_PAD_CTL;
 	return pad_reg;
@@ -98,10 +102,13 @@ static inline u32 get_pad_reg(iomux_pin_name_t pin)
 /* Get the last iomux register address */
 static inline u32 get_mux_end(void)
 {
-	if (is_soc_rev(CHIP_REV_2_0) < 0)
-		return IOMUXC_BASE_ADDR + (0x3F8 - 4);
-	else
-		return IOMUXC_BASE_ADDR + (0x3F0 - 4);
+	if (is_soc_type(MX_CPU_MX51)) {
+		if (is_soc_rev(CHIP_REV_2_0) < 0)
+			return IOMUXC_BASE_ADDR + (0x3F8 - 4);
+		else
+			return IOMUXC_BASE_ADDR + (0x3F0 - 4);
+	}
+	return IOMUXSW_MUX_END;
 }
 
 /*
@@ -164,3 +171,16 @@ unsigned int mxc_iomux_get_pad(iomux_pin_name_t pin)
 	u32 pad_reg = get_pad_reg(pin);
 	return readl(pad_reg);
 }
+
+/*
+ * This function configures input path.
+ *
+ * @param input    index of input select register
+ * @param config   the binary value of elements
+ */
+void mxc_iomux_set_input(iomux_input_select_t input, u32 config)
+{
+	u32 reg = IOMUXSW_INPUT_CTL + (input << 2);
+
+	writel(config, reg);
+}
arch/arm/cpu/armv7/mx5/lowlevel_init.S +55 -37

193 lines not on this page · raw message

arch/arm/cpu/armv7/mx5/soc.c +4 -1
index 7c7a565..ae60aa5 100644
@@ -25,6 +25,7 @@
 
 #include <common.h>
 #include <asm/arch/imx-regs.h>
+#include <asm/arch/sys_proto.h>
 #include <asm/arch/clock.h>
 #include <asm/errno.h>
 #include <asm/io.h>
@@ -34,7 +35,9 @@
 #endif
 
 #if defined(CONFIG_MX51)
-#define CPU_TYPE 0x51000
+#define CPU_TYPE MX_CPU_MX51
+#elif defined(CONFIG_MX53)
+#define CPU_TYPE MX_CPU_MX53
 #else
 #error "CPU_TYPE not defined"
 #endif
arch/arm/include/asm/arch-mx5/imx-regs.h +24 -49

108 lines not on this page · raw message

arch/arm/include/asm/arch-mx5/iomux.h +0 -102

108 lines not on this page · raw message

arch/arm/include/asm/arch-mx5/mx5x_pins.h +466 -3

490 lines not on this page · raw message

arch/arm/include/asm/arch-mx5/sys_proto.h +6 -1
old mode 100644
new mode 100755
index f687503..9b319ea
@@ -24,8 +24,13 @@
 #ifndef _SYS_PROTO_H_
 #define _SYS_PROTO_H_
 
-u32 get_cpu_rev(void);
+#define MX_CPU_MX51 0x51000
+#define MX_CPU_MX53 0x53000
+
 #define is_soc_rev(rev)	((get_cpu_rev() & 0xFF) - rev)
+#define is_soc_type(rev)((get_cpu_rev() & 0xFF000) == rev)
+
+u32 get_cpu_rev(void);
 void sdelay(unsigned long);
 
 #endif
include/configs/mx51evk.h +1 -2
index f98438d..e9e97a5 100644
@@ -24,8 +24,6 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-#include <asm/arch/imx-regs.h>
-
  /* High Level Configuration Options */
 
 #define CONFIG_MX51	/* in a mx51 */
@@ -37,6 +35,7 @@
 
 #define CONFIG_L2_OFF
 
+#include <asm/arch/imx-regs.h>
 /*
  * Disabled for now due to build problems under Debian and a significant
  * increase in the final file size: 144260 vs. 109536 Bytes.
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 1/1 MX5: Add initial support for mx53

On 12/06/2010 11:57 AM, Jason Liu wrote:

Hi Jason,

Quoted 7 lines

Add initial support for mx53 with the following change,

- Add the iomux support and the pin definition,
- Add the regs definition, clean up some unused def from mx51,
- Add the low level init support, make use the freq input of setup_pll macro

This patch has been tested on MX51 Babbage 3.0

I admit I am confused. If you are adding support for a new SoC, I am expecting you test on an evaluation board with that SoC on board, not on a MX51. Of course, the patch should be tested on the mx51evk as well for regression tests.

The patch adds dead code until the first board with the MX.53 goes to mainline. As I see for all new SoCs introduced in u-boot, it is really desired to have a patchset including the first board supporting that SoC. In this way, we are able to better understand all changes required by your patches.

If on the other side you want to fix something broken in the actual iomux code for i.MX51, this should be done in different patch, adding the part for the i.MX53 later.

Quoted 9 lines

#define MUX_PIN_NUM_MAX (((MUX_I_END - MUX_I_START) >> 2) + 1)

arch/arm/cpu/armv7/mx5/iomux.c +0 -4
@@ -44,20 +44,22 @@ static inline u32 get_mux_reg(iomux_pin_name_t pin)
 {
 	u32 mux_reg = PIN_TO_IOMUX_MUX(pin);
 
-	if (is_soc_rev(CHIP_REV_2_0) < 0) {
-		/*
-		 * Fixup register address:
-		 *	i.MX51 TO1 has offset with the register

arch/arm/cpu/armv7/mx5/iomux.c static inline u32 get_mux_reg(iomux_pin_name_t pin) · line 60

Quoted 10 lines
arch/arm/cpu/armv7/mx5/iomux.c +0 -10
-		 * 	which is define as TO2.
-		 */
-		if ((pin == MX51_PIN_NANDF_RB5) ||
-			(pin == MX51_PIN_NANDF_RB6) ||
-			(pin == MX51_PIN_NANDF_RB7))
-			; /* Do nothing */
-		else if (mux_reg >= 0x2FC)
-			mux_reg += 8;
-		else if (mux_reg >= 0x130)
-			mux_reg += 0xC;

I know all this crap is for MX51 in the TO1 version, even if I do not know if there are boards with this first version of the processor. Probably we must maintain this stuff for compatibility. Really I would like to remove it completely ;-).

Review static inline u32 get_mux_reg(iomux_pin_name_t pin) · line 47

Quoted 1 line
(quoted diff) +1 -0
+	if (is_soc_type(MX_CPU_MX51)) {

It seems to me you are mixing the check of the microprocessor type at compile time (#ifdef CONFIG_MX51) and at runtime with this new function. I think we should be consistent. If #define CONFIG_MX51 is defined, there should be no way for this function to return false, and then makes no sense to define a runtime function if we have already stated on which processor u-boot is running.

arch/arm/cpu/armv7/mx5/iomux.c unsigned int mxc_iomux_get_pad(iomux_pin_name_t pin) · line 181

Quoted 7 lines
arch/arm/cpu/armv7/mx5/iomux.c +7 -0
+/*
+ * This function configures input path.
+ *
+ * @param input    index of input select register
+ * @param config   the binary value of elements
+ */
+void mxc_iomux_set_input(iomux_input_select_t input, u32 config)

Probably it should be better to add a comment that this function supports pins in daisy-chain, as this feature is described in the reference manual.

arch/arm/cpu/armv7/mx5/lowlevel_init.S lowlevel_init: · line 277

Quoted 10 lines
arch/arm/cpu/armv7/mx5/lowlevel_init.S +0 -6
@@ -269,9 +284,12 @@ lowlevel_init:
 	mov pc,lr
 
 /* Board level setting value */
-DDR_PERCHARGE_CMD:	.word 0x04008008
-DDR_REFRESH_CMD:	.word 0x00008010
-DDR_LMR1_W:		.word 0x00338018
-DDR_LMR_CMD:		.word 0xB2220000
-DDR_TIMING_W:		.word 0xB02567A9
-DDR_MISC_W:		.word 0x000A0104

Good catch, this is dead code.

arch/arm/cpu/armv7/mx5/soc.c line 43

Quoted 10 lines
arch/arm/cpu/armv7/mx5/soc.c +3 -1
 
 #if defined(CONFIG_MX51)
-#define CPU_TYPE 0x51000
+#define CPU_TYPE MX_CPU_MX51
+#elif defined(CONFIG_MX53)
+#define CPU_TYPE MX_CPU_MX53
 #else
 #error "CPU_TYPE not defined"
 #endif

See my previous comment. You have already defined CONFIG_MX51 and CONFIG_MX53, and probably we do not need additionally defines for the same goal.

arch/arm/include/asm/arch-mx5/iomux.h typedef enum iomux_pad_config { · line 74

Quoted 13 lines
arch/arm/include/asm/arch-mx5/imx-regs.h +0 -0
old mode 100644
new mode 100755
arch/arm/include/asm/arch-mx5/iomux.h +0 -2
index 0d91a24..760371b 100644
@@ -70,108 +70,6 @@ typedef enum iomux_pad_config {
 	PAD_CTL_DRV_VOT_HIGH = 0x1 << 13,/* High voltage mode */
 } iomux_pad_config_t;
 
-/* various IOMUX input select register index */
-typedef enum iomux_input_select {

Agree. iomux_input_select is used only in iomux.c, so better to move it in the implementation file.

Quoted 6 lines
arch/arm/include/asm/arch-mx5/mx5x_pins.h +0 -0
old mode 100644
new mode 100755
index a564fce..a5cd773

arch/arm/include/asm/arch-mx5/mx5x_pins.h enum iomux_pins { · line 796

Quoted 8 lines
arch/arm/include/asm/arch-mx5/mx5x_pins.h +7 -0
 
+	MX53_AUDMUX_P5_INPUT_DA_AMX_SELECT_I,
+	MX53_AUDMUX_P5_INPUT_DB_AMX_SELECT_I,
+	MX53_AUDMUX_P5_INPUT_RXCLK_AMX_SELECT_INPUT,
+	MX53_AUDMUX_P5_INPUT_RXFS_AMX_SELECT_INPUT,
+	MX53_AUDMUX_P5_INPUT_TXCLK_AMX_SELECT_INPUT,
+	MX53_AUDMUX_P5_INPUT_TXFS_AMX_SELECT_INPUT,
+	MX53_CAN1_IPP_IND_CANRX_SELECT_INPUT,		/*0x760*/

What is the meaning of this comment ? It should have nothing to do with this enumeration type, The same globally in this structure.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#2 lore raw

PATCH 1/1 MX5: Add initial support for mx53

Hi, Stefano,

2010/12/7 Stefano Babic <[email protected]>:

Quoted 10 lines · Jason Liu

Hi Jason,

Quoted 6 lines

Add initial support for mx53 with the following change,

- Add the iomux support and the pin definition,
- Add the regs definition, clean up some unused def from mx51,
- Add the low level init support, make use the freq input of setup_pll macro

Quoted 6 lines
Quoted 1 line

This patch has been tested on MX51 Babbage 3.0

I admit I am confused. If you are adding support for a new SoC, I am expecting you test on an evaluation board with that SoC on board, not on a MX51. Of course, the patch should be tested on the mx51evk as well for regression tests.

Yes, I'm adding this to show that this patch has been tested on mx51evk and not affect mx51evk function.

Quoted 6 lines

The patch adds dead code until the first board with the MX.53 goes to mainline. As I see for all new SoCs introduced in u-boot, it is really desired to have a patchset including the first board supporting that SoC. In this way, we are able to better understand all changes required by your patches.

Yes, agree. The patch for mx53 board support will coming soon.

Quoted 21 lines

If on the other side you want to fix something broken in the actual iomux code for i.MX51, this should be done in different patch, adding the part for the i.MX53 later.

Quoted 16 lines

?#define MUX_PIN_NUM_MAX (((MUX_I_END - MUX_I_START) >> 2) + 1)

(quoted diff) +0 -11
@@ -44,20 +44,22 @@ static inline u32 get_mux_reg(iomux_pin_name_t pin)
 ?{
 ? ? ? u32 mux_reg = PIN_TO_IOMUX_MUX(pin);
 
- ? ? if (is_soc_rev(CHIP_REV_2_0) < 0) {
- ? ? ? ? ? ? /*
- ? ? ? ? ? ? ?* Fixup register address:
- ? ? ? ? ? ? ?* ? ? ?i.MX51 TO1 has offset with the register
- ? ? ? ? ? ? ?* ? ? ?which is define as TO2.
- ? ? ? ? ? ? ?*/
- ? ? ? ? ? ? if ((pin == MX51_PIN_NANDF_RB5) ||
- ? ? ? ? ? ? ? ? ? ? (pin == MX51_PIN_NANDF_RB6) ||
- ? ? ? ? ? ? ? ? ? ? (pin == MX51_PIN_NANDF_RB7))
- ? ? ? ? ? ? ? ? ? ? ; /* Do nothing */
- ? ? ? ? ? ? else if (mux_reg >= 0x2FC)
Quoted 8 lines

Review static inline u32 get_mux_reg(iomux_pin_name_t pin) · line 60

Quoted 3 lines
(quoted diff) +0 -3
- ? ? ? ? ? ? ? ? ? ? mux_reg += 8;
- ? ? ? ? ? ? else if (mux_reg >= 0x130)
- ? ? ? ? ? ? ? ? ? ? mux_reg += 0xC;

I know all this crap is for MX51 in the TO1 version, even if I do not know if there are boards with this first version of the processor. Probably we must maintain this stuff for compatibility. Really I would like to remove it completely ;-).

Do you mind that I remove it completely here?

Quoted 9 lines

Review static inline u32 get_mux_reg(iomux_pin_name_t pin) · line 47

Quoted 2 lines
(quoted diff) +1 -0
+ ? ? if (is_soc_type(MX_CPU_MX51)) {

It seems to me you are mixing the check of the microprocessor type at compile time (#ifdef CONFIG_MX51) and at runtime with this new function. I think we should be consistent. If #define CONFIG_MX51 is defined, there should be no way for this function to return false, and then makes no sense to define a runtime function if we have already stated on which processor u-boot is running.

The motivation to use " is_soc_type(CPU_TYPE) "is to remove the some #ifdef CONFIG_MX51in this file,
I can change back to the following,

+ #if defined (MX_CPU_MX51)
+ if (is_soc_rev(CHIP_REV_2_0) < 0) {
+ code snip
+ }
+ #endif

Is this ok?

Quoted 12 lines

arch/arm/cpu/armv7/mx5/iomux.c unsigned int mxc_iomux_get_pad(iomux_pin_name_t pin) · line 181

Quoted 8 lines
arch/arm/cpu/armv7/mx5/iomux.c +7 -0
+/*
+ * This function configures input path.
+ *
+ * @param input ? ?index of input select register
+ * @param config ? the binary value of elements
+ */
+void mxc_iomux_set_input(iomux_input_select_t input, u32 config)

Probably it should be better to add a comment that this function supports pins in daisy-chain, as this feature is described in the reference manual.

Yes, agree.

Quoted 15 lines
Quoted 11 lines
arch/arm/cpu/armv7/mx5/soc.c +0 -0

?#if defined(CONFIG_MX51)

arch/arm/cpu/armv7/mx5/soc.c +3 -1
-#define CPU_TYPE 0x51000
+#define CPU_TYPE MX_CPU_MX51
+#elif defined(CONFIG_MX53)
+#define CPU_TYPE MX_CPU_MX53

?#else
?#error "CPU_TYPE not defined"
?#endif

See my previous comment. You have already defined CONFIG_MX51 and CONFIG_MX53, and probably we do not need additionally defines for the same goal.

Yes, if we remove the runtime check, this def can be removed.

Quoted 12 lines
Quoted 12 lines
arch/arm/include/asm/arch-mx5/imx-regs.h +0 -0
old mode 100644
new mode 100755
arch/arm/include/asm/arch-mx5/iomux.h +0 -0
index 0d91a24..760371b 100644
@@ -70,108 +70,6 @@ typedef enum iomux_pad_config {

? ? ? PAD_CTL_DRV_VOT_HIGH = 0x1 << 13,/* High voltage mode */ ?} iomux_pad_config_t;

Quoted 5 lines

arch/arm/include/asm/arch-mx5/iomux.h typedef enum iomux_pad_config { · line 74

Quoted 2 lines
arch/arm/include/asm/arch-mx5/iomux.h +0 -2
-/* various IOMUX input select register index */
-typedef enum iomux_input_select {

Agree. iomux_input_select is used only in iomux.c, so better to move it in the implementation file.

OK,

Quoted 17 lines
Quoted 8 lines
arch/arm/include/asm/arch-mx5/mx5x_pins.h +0 -0
old mode 100644
new mode 100755
index a564fce..a5cd773

arch/arm/include/asm/arch-mx5/mx5x_pins.h

Quoted 8 lines
arch/arm/include/asm/arch-mx5/mx5x_pins.h +7 -0
 
+ ? ? MX53_AUDMUX_P5_INPUT_DA_AMX_SELECT_I,
+ ? ? MX53_AUDMUX_P5_INPUT_DB_AMX_SELECT_I,
+ ? ? MX53_AUDMUX_P5_INPUT_RXCLK_AMX_SELECT_INPUT,
+ ? ? MX53_AUDMUX_P5_INPUT_RXFS_AMX_SELECT_INPUT,
+ ? ? MX53_AUDMUX_P5_INPUT_TXCLK_AMX_SELECT_INPUT,
+ ? ? MX53_AUDMUX_P5_INPUT_TXFS_AMX_SELECT_INPUT,
+ ? ? MX53_CAN1_IPP_IND_CANRX_SELECT_INPUT, ? ? ? ? ? /*0x760*/
Quoted 2 lines

What is the meaning of this comment ? It should have nothing to do with this enumeration type, The same globally in this structure.

OK, I can remove it.

Thanks for the review.

BR,
Jason

Quoted 15 lines

Best regards,
Stefano Babic

--
=====================================================================
DENX Software Engineering GmbH, ? ? MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 ?Email: office at denx.de
=====================================================================
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#3 lore raw

PATCH 1/1 MX5: Add initial support for mx53

Quoted 6 lines · Jason Liu
Quoted 4 lines

I know all this crap is for MX51 in the TO1 version, even if I do not know if there are boards with this first version of the processor. Probably we must maintain this stuff for compatibility. Really I would like to remove it completely ;-).

Do you mind that I remove it completely here?

Really I do not know. This is clearly a workaround for the first MX.51 version (TO1), and it makes no sense for actual processor's revision. I do not know if there are mx51evk with this revision on board, but if there are we should maintain this code for compatibility reason.

Quoted 11 lines

The motivation to use " is_soc_type(CPU_TYPE) "is to remove the some #ifdef CONFIG_MX51in this file,
I can change back to the following,

+ #if defined (MX_CPU_MX51)

arch/arm/cpu/armv7/mx5/iomux.c +4 -0
+               if (is_soc_rev(CHIP_REV_2_0) < 0) {
+                                code snip
+  }
+ #endif

Is this ok?

I think so. If we were able to do everything on runtime, then we could proceed removing all #ifdef stuff. However, we need the #ifdef in the header files to select the different internal structures between MX.51 and MX.53.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#4 lore raw

PATCH 1/1 MX5: Add initial support for mx53

Hi, Stefano,

2010/12/7 Stefano Babic <[email protected]>:

Quoted 7 lines · Jason Liu
Quoted 6 lines
Quoted 5 lines

I know all this crap is for MX51 in the TO1 version, even if I do not know if there are boards with this first version of the processor. Probably we must maintain this stuff for compatibility. Really I would like to remove it completely ;-).

Quoted 6 lines
Quoted 1 line

Do you mind that I remove it completely here?

Really I do not know. This is clearly a workaround for the first MX.51 version (TO1), and it makes no sense for actual processor's revision. I do not know if there are mx51evk with this revision on board, but if there are we should maintain this code for compatibility reason.

OK, Let's keep it.

Quoted 11 lines
Quoted 11 lines

The motivation to use " is_soc_type(CPU_TYPE) "is to remove the some #ifdef CONFIG_MX51in this file,
?I can change back to the following,

+ #if defined (MX_CPU_MX51)
+ ? ? ? ? ? ? ? if (is_soc_rev(CHIP_REV_2_0) < 0) {
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?code snip
+ ?}
+ #endif

Quoted 6 lines
Quoted 1 line

Is this ok?

I think so. If we were able to do everything on runtime, then we could proceed removing all #ifdef stuff. However, we need the #ifdef in the header files to select the different internal structures between MX.51 and MX.53.

OK, I will do the change.

Thanks for the review.

Quoted 11 lines

Best regards,
Stefano Babic

--
=====================================================================
DENX Software Engineering GmbH, ? ? MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 ?Email: office at denx.de
=====================================================================