ARM i.MX53 enable SMD and LOCO board bootup
Subsystems (2)
cover ARM i.MX53 enable SMD and LOCO board bootup
SMD and LOCO are newly developed boards of i.MX53. LOCO means "low cost", which is supposed to be widespread soon.
PATCH 1/2 ARM i.MX53 enable SMD board bootup
From: Yong Shen <[email protected]>
1. Add Kconfig and Makefile entries
2. Add board definition
3. enable uart and fec for SMD board
--- arch/arm/mach-mx5/Kconfig | 7 ++ arch/arm/mach-mx5/Makefile | 1 + arch/arm/mach-mx5/board-mx53_smd.c | 112 ++++++++++++++++++++++++++++++++++++ 3 files changed, 120 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-mx5/board-mx53_smd.c
arch/arm/mach-mx5/Kconfig +7 -0
@@ -130,6 +130,13 @@ config MACH_MX53_EVK Include support for MX53 EVK platform. This includes specific configurations for the board and its peripherals. +config MACH_MX53_SMD + bool "Support MX53 SMD platforms" + select SOC_IMX53 + select IMX_HAVE_PLATFORM_IMX_UART + help + Include support for MX53 SMD platform. This includes specific + configurations for the board and its peripherals. config MACH_MX50_RDP bool "Support MX50 reference design platform"
arch/arm/mach-mx5/Makefile +1 -0
@@ -10,6 +10,7 @@ obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx51.o obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o obj-$(CONFIG_MACH_MX51_3DS) += board-mx51_3ds.o obj-$(CONFIG_MACH_MX53_EVK) += board-mx53_evk.o +obj-$(CONFIG_MACH_MX53_SMD) += board-mx53_smd.o obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += board-cpuimx51.o obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += board-cpuimx51sd.o
arch/arm/mach-mx5/board-mx53_smd.c new file +112 -0
112 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 2/2 ARM i.MX53 enable LOCO board bootup
In reply to yong.shen at freescale.comFrom: Yong Shen <[email protected]>
1. Add Kconfig and Makefile entries
2. Add board definition
3. enable uart and fec for LOCO board
--- arch/arm/mach-mx5/Kconfig | 8 +++ arch/arm/mach-mx5/Makefile | 1 + arch/arm/mach-mx5/board-mx53_loco.c | 112 +++++++++++++++++++++++++++++++++++ 3 files changed, 121 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-mx5/board-mx53_loco.c
arch/arm/mach-mx5/Kconfig +8 -0
@@ -138,6 +138,14 @@ config MACH_MX53_SMD Include support for MX53 SMD platform. This includes specific configurations for the board and its peripherals. +config MACH_MX53_LOCO + bool "Support MX53 LOCO platforms" + select SOC_IMX53 + select IMX_HAVE_PLATFORM_IMX_UART + help + Include support for MX53 LOCO platform. This includes specific + configurations for the board and its peripherals. + config MACH_MX50_RDP bool "Support MX50 reference design platform" depends on BROKEN
arch/arm/mach-mx5/Makefile +1 -0
@@ -11,6 +11,7 @@ obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o obj-$(CONFIG_MACH_MX51_3DS) += board-mx51_3ds.o obj-$(CONFIG_MACH_MX53_EVK) += board-mx53_evk.o obj-$(CONFIG_MACH_MX53_SMD) += board-mx53_smd.o +obj-$(CONFIG_MACH_MX53_LOCO) += board-mx53_loco.o obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += board-cpuimx51.o obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += board-cpuimx51sd.o
arch/arm/mach-mx5/board-mx53_loco.c new file +112 -0
112 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 2/2 ARM i.MX53 enable LOCO board bootup
Hi Yong,
Quoted 8 lines · On Tue, Jan 11, 2011 at 4:23 AM, <[email protected]> wrote:
From: Yong Shen <[email protected]>
1. Add
KconfigandMakefileentries
2. Add board definition
3. enable uart and fec for LOCO boardSigned-off-by Yong Shen <[email protected]>---
....
Quoted 3 lines
+ ? ? ? }
+ ? ? ?gpio_direction_output(LOCO_FEC_PHY_RST, 0);
+ ? ? ?gpio_set_value(LOCO_FEC_PHY_RST, 0);
As Baruch pointed out on a previous post, you can remove the gpio_set_value line here.
Regards,
Fabio Estevam
PATCH 2/2 ARM i.MX53 enable LOCO board bootup
Hi Fabio,
Below is my reply to Baruch, I meant to keep this code here to show the reset process clearly.
Quoted 9 lines
arch/arm/mach-mx5/board-mx53_loco.c
Quoted 6 lines
arch/arm/mach-mx5/board-mx53_loco.c new file +6
-0+if (ret) { +printk (KERN_ERR "failed to get GPIO_FEC_PHY_RESET: %d\n" , ret); +return ; + } +gpio_direction_output (SMD_FEC_PHY_RST ,0 ); +gpio_set_value (SMD_FEC_PHY_RST ,0 );This seems to be redundant.
gpio_direction_output()has already set the value to 0.
You are right. But, gpio_set_value is meant to be here to show the process of fec reset: first pull low and then pull high. And gpio_direction_output here is for direction configuration although it has the ability of configure output value.
thanks
Yong
PATCH 2/2 ARM i.MX53 enable LOCO board bootup
Quoted 11 lines · Yong Shen
Hi Fabio,
Below is my reply to Baruch, I meant to keep this code here to show the reset process clearly.
Quoted 7 lines
Quoted 6 lines
arch/arm/mach-mx5/board-mx53_loco.c new file +6
-0+if (ret) { +printk (KERN_ERR "failed to get GPIO_FEC_PHY_RESET: %d\n" , ret); +return ; + } +gpio_direction_output (SMD_FEC_PHY_RST ,0 ); +gpio_set_value (SMD_FEC_PHY_RST ,0 );
Quoted 7 lines
Quoted 2 lines
This seems to be redundant.
gpio_direction_output()has already set the value to 0.You are right. But,
gpio_set_valueis meant to be here to show the process of fec reset: first pull low and then pull high. Andgpio_direction_outputhere is for direction configuration although it has the ability of configure output value.
If you care about it: I'd vote for removing the call to gpio_set_value, too.
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
cover ARM i.MX53 enable SMD and LOCO board bootup
In reply to yong.shen at freescale.comHi Yong,
Quoted 2 lines · yong.shen at freescale.com
SMD and LOCO are newly developed boards of i.MX53. LOCO means "low cost", which is supposed to be widespread soon.
These two patches seem almost identical. Can't both board support code share the same file?
baruch
Signature · 3 lines
~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -cover ARM i.MX53 enable SMD and LOCO board bootup
Hi Baruch,
So far they are similar, but as more code and features are added in, they are going to be different. We had registered different mach id to distinguish these two boards.
Thanks
Yong
Quoted 16 lines · Baruch Siach
Hi Yong,
Quoted 2 lines · yong.shen at freescale.com
SMD and LOCO are newly developed boards of i.MX53. LOCO means "low cost", which is supposed to be widespread soon.
These two patches seem almost identical. Can't both board support code share the same file?
baruch
--
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ~. .~ ? Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= ? - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
cover ARM i.MX53 enable SMD and LOCO board bootup
Hi Yong,
Quoted 3 lines · Yong Shen
So far they are similar, but as more code and features are added in, they are going to be different. We had registered different mach id to distinguish these two boards.
Code for two (or more) different machines can be shared in the same file. See for example the code in arch/arm/mach-at91/board-stamp9g20.c which supports both taskit PortuxG20 and taskit Stamp9G20, and arch/arm/mach-at91/board-pcontrol-g20.c which is reusing code from these boards for a third board (PControl G20).
We should avoid code duplication as much as possible, IMO.
baruch
Quoted 7 lines · Baruch Siach
Quoted 6 lines · yong.shen at freescale.com
Quoted 2 lines
SMD and LOCO are newly developed boards of i.MX53. LOCO means "low cost", which is supposed to be widespread soon.
These two patches seem almost identical. Can't both board support code share the same file?
Signature · 3 lines
~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -cover ARM i.MX53 enable SMD and LOCO board bootup
Hi Baruch,
Quoted 9 lines
Code for two (or more) different machines can be shared in the same file. See for example the code in
arch/arm/mach-at91/board-stamp9g20.cwhich supports both taskit PortuxG20 and taskit Stamp9G20, andarch/arm/mach-at91/board-pcontrol-g20.cwhich is reusing code from these boards for a third board (PControl G20).We should avoid code duplication as much as possible, IMO.
I agree the rule you mentioned about: avoid code duplication, and I also know that one file can hold multiple board definitions. However, in this case, these two boards were designed for different purpose. For example, SMD is for smart mobile device, while LOCO is more generic for multiple usage. As time goes on, the code for each boards are supposed to be much more different than it is now.
So I still stick on my opinion, hope you can understand.
thanks
Yong