Patchwork [U-Boot,1/1] MX5:MX53: support for freescale MX53LOCO board

login
register
mail settings
Submitter Liu Hui-R64343
Date Feb. 21, 2011, 10:15 a.m.
Message ID <1298283316-3443-1-git-send-email-r64343@freescale.com>
Download mbox | patch
Permalink /patch/83817/
State Superseded
Headers show

Comments

Liu Hui-R64343 - Feb. 21, 2011, 10:15 a.m.
This patch add initial support for freescale MX53LOCO board.
Network(FEC),SD/MMC, UART have been supported by this patch.

Signed-off-by: Jason Liu <r64343@freescale.com>
---
 MAINTAINERS                           |    1 +
 board/freescale/mx53loco/Makefile     |   46 +++++
 board/freescale/mx53loco/config.mk    |   24 +++
 board/freescale/mx53loco/imximage.cfg |   99 ++++++++++
 board/freescale/mx53loco/mx53loco.c   |  316 +++++++++++++++++++++++++++++++++
 boards.cfg                            |    1 +
 include/configs/mx53loco.h            |  196 ++++++++++++++++++++
 7 files changed, 683 insertions(+), 0 deletions(-)
Stefano Babic - Feb. 21, 2011, 12:46 p.m.
On 02/21/2011 11:15 AM, Jason Liu wrote:

Hi Jason,


> +#########################################################################
> diff --git a/board/freescale/mx53loco/config.mk b/board/freescale/mx53loco/config.mk
> new file mode 100644
> index 0000000..ec0c66c

As I discovered myself, usage of config.mk is discouraged and it should
be removed and it is not accepted anymore for new boards. Instead of
that, it is possible to add CONFIG_ options in boards.cfg.

I have already sent changes for imx51evk, as example for the imx5
boards. However, I sent them when window was already closed, and I
merged them on the next branch of u-boot-imx. You will find these
patches in archive also as:

[PATCH 1/2] Makefile: change rule to build IMX image
[PATCH 2/2] MX51: drop config.mk from mx51evk

You can take a look at them to see how to drop the config.mk file.

Best regards,
Stefano Babic
Fabio Estevam - Feb. 21, 2011, 11:38 p.m.
Hi Jason,

--- On Mon, 2/21/11, Jason Liu <r64343@freescale.com> wrote:
...
> --- /dev/null
> +++ b/board/freescale/mx53loco/imximage.cfg
> @@ -0,0 +1,99 @@
> +#
> +# (C Copyright 2009
> +# Stefano Babic DENX Software Engineering sbabic@denx.de.
> +# (C Copyright 2011
> +# Jason Liu Freescale Software Engineering r64343@freescale.com

Why don´t you use the standard Freescale copyright header here instead?

Regards,

Fabio Estevam
Liu Hui-R64343 - Feb. 22, 2011, 1:44 a.m.
Hi, Stefano, 

>-----Original Message-----
>From: Stefano Babic [mailto:sbabic@denx.de]
>Sent: Monday, February 21, 2011 8:46 PM
>To: Liu Hui-R64343
>Cc: u-boot@lists.denx.de; sbabic@denx.de
>Subject: Re: [U-Boot][PATCH 1/1] MX5:MX53: support for freescale MX53LOCO
>board
>
>On 02/21/2011 11:15 AM, Jason Liu wrote:
>
>Hi Jason,
>
>
>>
>+################################################################
>#####
>> +####
>> diff --git a/board/freescale/mx53loco/config.mk
>> b/board/freescale/mx53loco/config.mk
>> new file mode 100644
>> index 0000000..ec0c66c
>
>As I discovered myself, usage of config.mk is discouraged and it should be
>removed and it is not accepted anymore for new boards. Instead of that, it is
>possible to add CONFIG_ options in boards.cfg.

OK, do you know why config.mk is discouraged?

>
>I have already sent changes for imx51evk, as example for the imx5 boards.
>However, I sent them when window was already closed, and I merged them
>on the next branch of u-boot-imx. You will find these patches in archive also
>as:

Can I based on next of u-boot-imx to submit new patches since master branch
Of uboot does not have it?

>
>[PATCH 1/2] Makefile: change rule to build IMX image [PATCH 2/2] MX51:
>drop config.mk from mx51evk
>
>You can take a look at them to see how to drop the config.mk file.

OK, thanks for the information. I will look at it and check my new version patch.

>
>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@denx.de
>=================================================================
>====
Liu Hui-R64343 - Feb. 22, 2011, 1:47 a.m.
Hi, Fabio, 

>-----Original Message-----
>From: Fabio Estevam [mailto:fabioestevam@yahoo.com]
>Sent: Tuesday, February 22, 2011 7:38 AM
>To: u-boot@lists.denx.de; Liu Hui-R64343
>Subject: Re: [U-Boot] [PATCH 1/1] MX5:MX53: support for freescale
>MX53LOCO board
>
>Hi Jason,
>
>--- On Mon, 2/21/11, Jason Liu <r64343@freescale.com> wrote:
>...
>> --- /dev/null
>> +++ b/board/freescale/mx53loco/imximage.cfg
>> @@ -0,0 +1,99 @@
>> +#
>> +# (C Copyright 2009
>> +# Stefano Babic DENX Software Engineering sbabic@denx.de.
>> +# (C Copyright 2011
>> +# Jason Liu Freescale Software Engineering r64343@freescale.com
>
>Why don´t you use the standard Freescale copyright header here instead?

Do you think it's a must to do it here?

>
>Regards,
>
>Fabio Estevam
>
>
>
>
Wolfgang Denk - Feb. 22, 2011, 6:53 a.m.
Dear Liu Hui-R64343,

In message <2CF7613B9822A943BEF13EF7ACEC5BD114A316@039-SN1MPN1-003.039d.mgd.msft.net> you wrote:
> 
> >As I discovered myself, usage of config.mk is discouraged and it should be
> >removed and it is not accepted anymore for new boards. Instead of that, it is
> >possible to add CONFIG_ options in boards.cfg.
> 
> OK, do you know why config.mk is discouraged?

There are seeral reasons, the most prominent being

1) because it's simply not needed in 95% of all cases

2) because it's bad to distribute vital configuration information into
   several independent files

and

3) because we're preparing the grounds for a Kconfig based setup so we
   want to have all config options controlled by a single mechanism
   (board config file).

Best regards,

Wolfgang Denk

--
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@denx.de
All easy problems have already been solved.
Wolfgang Denk - Feb. 22, 2011, 6:54 a.m.
Dear Liu Hui-R64343,

In message <2CF7613B9822A943BEF13EF7ACEC5BD114A32A@039-SN1MPN1-003.039d.mgd.msft.net> you wrote:
> 
> >> +# (C Copyright 2011
> >> +# Jason Liu Freescale Software Engineering r64343@freescale.com
> >
> >Why don´t you use the standard Freescale copyright header here instead?
>
> Do you think it's a must to do it here?

Your manager at Freescale probably wants it.

Best regards,

Wolfgang Denk
Jason Liu - Feb. 22, 2011, 7:59 a.m.
Hi, Wolfgang,

2011/2/22 Wolfgang Denk <wd@denx.de>:
> Dear Liu Hui-R64343,
>
> In message <2CF7613B9822A943BEF13EF7ACEC5BD114A316@039-SN1MPN1-003.039d.mgd.msft.net> you wrote:
>>
>> >As I discovered myself, usage of config.mk is discouraged and it should be
>> >removed and it is not accepted anymore for new boards. Instead of that, it is
>> >possible to add CONFIG_ options in boards.cfg.
>>
>> OK, do you know why config.mk is discouraged?
>
> There are seeral reasons, the most prominent being
>
> 1) because it's simply not needed in 95% of all cases
>
> 2) because it's bad to distribute vital configuration information into
>   several independent files
>
> and
>
> 3) because we're preparing the grounds for a Kconfig based setup so we
>   want to have all config options controlled by a single mechanism
>   (board config file).

OK,  get it. Thanks for the detailed information.

>
> Best regards,
>
> Wolfgang Denk
>
> --
> 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@denx.de
> All easy problems have already been solved.
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
Jason Liu - Feb. 22, 2011, 8:01 a.m.
Hi, Wolfgang,

2011/2/22 Wolfgang Denk <wd@denx.de>:
> Dear Liu Hui-R64343,
>
> In message <2CF7613B9822A943BEF13EF7ACEC5BD114A32A@039-SN1MPN1-003.039d.mgd.msft.net> you wrote:
>>
>> >> +# (C Copyright 2011
>> >> +# Jason Liu Freescale Software Engineering r64343@freescale.com
>> >
>> >Why don´t you use the standard Freescale copyright header here instead?
>>
>> Do you think it's a must to do it here?
>
> Your manager at Freescale probably wants it.

Yes, maybe. Thanks, :)

>
> Best regards,
>
> Wolfgang Denk
>
> --
> 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@denx.de
> The IQ of the group is the lowest IQ of a member of the group divided
> by the number of people in the group.
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
Stefano Babic - Feb. 22, 2011, 11:48 a.m.
On 02/22/2011 02:44 AM, Liu Hui-R64343 wrote:
>> As I discovered myself, usage of config.mk is discouraged and it should be
>> removed and it is not accepted anymore for new boards. Instead of that, it is
>> possible to add CONFIG_ options in boards.cfg.
> 
> OK, do you know why config.mk is discouraged?

Wolfgang has already explained why.

> Can I based on next of u-boot-imx to submit new patches since master branch
> Of uboot does not have it?

Yes, of course. I will apply in any case your patches on top of
u-boot-imx/next until the window will be opened again.

Best regards,
Stefano Babic
Wolfgang Denk - April 13, 2011, 8:37 p.m.
Dear Jason Liu,

In message <1298283316-3443-1-git-send-email-r64343@freescale.com> you wrote:
> This patch add initial support for freescale MX53LOCO board.
> Network(FEC),SD/MMC, UART have been supported by this patch.
> 
> Signed-off-by: Jason Liu <r64343@freescale.com>
...
> +int dram_init(void)
> +{
> +	gd->ram_size = get_ram_size((volatile void *)CONFIG_SYS_SDRAM_BASE,
> +				PHYS_SDRAM_1_SIZE);
> +
> +	return 0;
> +}
> +void dram_init_banksize(void)
> +{
> +	gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
> +	gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
> +
> +	gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
> +	gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
> +}

This is apparently wrong: in dram_init() you run get_ram_size() only
over the first bank of memory, but dram_init_banksize() says you have
two of them ??


> +int board_mmc_getcd(u8 *cd, struct mmc *mmc)
> +{
> +	struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
> +
> +	if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
> +		*cd = mxc_gpio_get(77); /*GPIO3_13*/
> +	else
> +		*cd = mxc_gpio_get(75); /*GPIO3_11*/

Is this just data or a device?  If the latter should be the case you
mustuse I/O accessors instead.

...
> +	puts("Board: MX53LOCO [");
> +
> +	cause = src_regs->srsr;
> +	switch (cause) {
> +	case 0x0001:
> +		printf("POR");
> +		break;
> +	case 0x0009:
> +		printf("RST");
> +		break;
> +	case 0x0010:
> +	case 0x0011:
> +		printf("WDOG");
> +		break;
> +	default:
> +		printf("unknown");
> +	}

This has been discussed before: this code should be factored out into
common code.

...
> +#define CONFIG_CMDLINE_TAG		1	/* enable passing of ATAGs */
> +#define CONFIG_REVISION_TAG		1
> +#define CONFIG_SETUP_MEMORY_TAGS	1
> +#define CONFIG_INITRD_TAG		1

Please remove the '1' from all #defines that just enable features,
i.  e. where no specific numeric value is needed.


> +#define CONFIG_SYS_MEMTEST_START       0x70000000
> +#define CONFIG_SYS_MEMTEST_END         0x10000

Has this actually been tested?

Best regards,

Wolfgang Denk
Jason Liu - April 14, 2011, 3:26 a.m.
Hi, Wolfgang,

2011/4/14 Wolfgang Denk <wd@denx.de>:
> Dear Jason Liu,
>
> In message <1298283316-3443-1-git-send-email-r64343@freescale.com> you wrote:
>> This patch add initial support for freescale MX53LOCO board.
>> Network(FEC),SD/MMC, UART have been supported by this patch.
>>
>> Signed-off-by: Jason Liu <r64343@freescale.com>
> ...
>> +int dram_init(void)
>> +{
>> +     gd->ram_size = get_ram_size((volatile void *)CONFIG_SYS_SDRAM_BASE,
>> +                             PHYS_SDRAM_1_SIZE);
>> +
>> +     return 0;
>> +}
>> +void dram_init_banksize(void)
>> +{
>> +     gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
>> +     gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
>> +
>> +     gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
>> +     gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
>> +}
>
> This is apparently wrong: in dram_init() you run get_ram_size() only
> over the first bank of memory, but dram_init_banksize() says you have
> two of them ??

Yes, I have already thought about it before I submit patches. The fact is that
there is there are two DDR chips connected to CS0 and CS1 of MX53 on loco
board, but each DDR chip is 512MB, but CS0 and CS1 can support up to 1GB,
which means the memory space is not continuous, when set:
gd->ram_size = get_ram_size((volatile void *)CONFIG_SYS_SDRAM_BASE,
                          PHYS_SDRAM_1_SIZE + PHYS_SDRAM_2_SIZE);
it will return the same as:

gd->ram_size = get_ram_size((volatile void *)CONFIG_SYS_SDRAM_BASE,
                            PHYS_SDRAM_1_SIZE);


I think the gd->ram_size is just used for uboot, but
dram_init_banksize will tell
linux kernel about the real memory layout.

If you still think that I really need fix it, I will do it.

>
>
>> +int board_mmc_getcd(u8 *cd, struct mmc *mmc)
>> +{
>> +     struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
>> +
>> +     if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
>> +             *cd = mxc_gpio_get(77); /*GPIO3_13*/
>> +     else
>> +             *cd = mxc_gpio_get(75); /*GPIO3_11*/
>
> Is this just data or a device?  If the latter should be the case you
> mustuse I/O accessors instead.

It's data not a device here, so no need use I/O accessors.

>
> ...
>> +     puts("Board: MX53LOCO [");
>> +
>> +     cause = src_regs->srsr;
>> +     switch (cause) {
>> +     case 0x0001:
>> +             printf("POR");
>> +             break;
>> +     case 0x0009:
>> +             printf("RST");
>> +             break;
>> +     case 0x0010:
>> +     case 0x0011:
>> +             printf("WDOG");
>> +             break;
>> +     default:
>> +             printf("unknown");
>> +     }
>
> This has been discussed before: this code should be factored out into
> common code.

Yes, I think I can send out another clean up patch for it to fix all
the boards including
mx31/35/51/53 later.

>
> ...
>> +#define CONFIG_CMDLINE_TAG           1       /* enable passing of ATAGs */
>> +#define CONFIG_REVISION_TAG          1
>> +#define CONFIG_SETUP_MEMORY_TAGS     1
>> +#define CONFIG_INITRD_TAG            1
>
> Please remove the '1' from all #defines that just enable features,
> i.  e. where no specific numeric value is needed.

Yes, I can send out another clean up patch to fix all the i.mx board config file

>
>
>> +#define CONFIG_SYS_MEMTEST_START       0x70000000
>> +#define CONFIG_SYS_MEMTEST_END         0x10000
>
> Has this actually been tested?

Yes, I have tested with mtest command.

BTW, this patch set has been send out 2 months ago and Stefano has
send out pull request
to Albert and Albert has pulled in already, do you agree I send out
another patch to address
your comments? Thanks for your consideration.

BR,
Jason

>
> Best regards,
>
> Wolfgang Denk
>
> --
> 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@denx.de
> People seldom know what they want until you give them what  they  ask
> for.
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
Wolfgang Denk - April 14, 2011, 5:31 a.m.
Dear Jason Liu,

In message <BANLkTinApAmm6hrcSofdYA6r7KUPMr8L+w@mail.gmail.com> you wrote:
> 
> Yes, I have already thought about it before I submit patches. The fact is that
> there is there are two DDR chips connected to CS0 and CS1 of MX53 on loco
> board, but each DDR chip is 512MB, but CS0 and CS1 can support up to 1GB,
> which means the memory space is not continuous, when set:

The mapping is fix, and you cannot remap it as a single, contiguous
region?

> gd->ram_size = get_ram_size((volatile void *)CONFIG_SYS_SDRAM_BASE,
>                           PHYS_SDRAM_1_SIZE + PHYS_SDRAM_2_SIZE);
> it will return the same as:
>
> gd->ram_size = get_ram_size((volatile void *)CONFIG_SYS_SDRAM_BASE,
>                             PHYS_SDRAM_1_SIZE);

You have always to test each bank on it's own, i. e.

	size1 = get_ram_size(..., PHYS_SDRAM_1_SIZE);
	size2 = get_ram_size(..., PHYS_SDRAM_2_SIZE);

	gd->ram_size = get_ram_size = size1 + size2;

> I think the gd->ram_size is just used for uboot, but

Right, but it is supposed to show the full RAM size, and not only half
of it (otherwise it should be gd->half_ram_size or similar ;-)

> If you still think that I really need fix it, I will do it.

THis needs fixing.

> > This has been discussed before: this code should be factored out into
> > common code.
>
> Yes, I think I can send out another clean up patch for it to fix all
> the boards including
> mx31/35/51/53 later.

No. Wrong order.  Please don't add to the mess and clean up later.
Instead, clean up now, and base your patch on th already cleaned up
code.

> > Please remove the '1' from all #defines that just enable features,
> > i.  e. where no specific numeric value is needed.
>
> Yes, I can send out another clean up patch to fix all the i.mx board config>  file

Again: No.  Please clean up NOW.

This patch will not be accepted as is.

> BTW, this patch set has been send out 2 months ago and Stefano has
> send out pull request
> to Albert and Albert has pulled in already, do you agree I send out
> another patch to address
> your comments? Thanks for your consideration.

No, this patch has serious bugs (memory size calculation) and other
issues (needs cleanup) and is thus rejected.

Best regards,

Wolfgang Denk
Jason Liu - April 14, 2011, 7:48 a.m.
2011/4/14 Wolfgang Denk <wd@denx.de>:
> Dear Jason Liu,
>
> In message <BANLkTinApAmm6hrcSofdYA6r7KUPMr8L+w@mail.gmail.com> you wrote:
[...]
>> BTW, this patch set has been send out 2 months ago and Stefano has
>> send out pull request
>> to Albert and Albert has pulled in already, do you agree I send out
>> another patch to address
>> your comments? Thanks for your consideration.
>
> No, this patch has serious bugs (memory size calculation) and other
> issues (needs cleanup) and is thus rejected.

OK, I will send out v3 patch to address it. Thanks,

Jason

>
> Best regards,
>
> Wolfgang Denk
>
> --
> 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@denx.de
> "Anyone attempting to generate random numbers by deterministic  means
> is, of course, living in a state of sin."          - John Von Neumann
>
Jason Liu - April 14, 2011, 8:12 a.m.
Hi, Stefano,

2011/4/14 Jason Liu <liu.h.jason@gmail.com>:
> 2011/4/14 Wolfgang Denk <wd@denx.de>:
>> Dear Jason Liu,
>>
>> In message <BANLkTinApAmm6hrcSofdYA6r7KUPMr8L+w@mail.gmail.com> you wrote:
> [...]
>>> BTW, this patch set has been send out 2 months ago and Stefano has
>>> send out pull request
>>> to Albert and Albert has pulled in already, do you agree I send out
>>> another patch to address
>>> your comments? Thanks for your consideration.
>>
>> No, this patch has serious bugs (memory size calculation) and other
>> issues (needs cleanup) and is thus rejected.
>
> OK, I will send out v3 patch to address it. Thanks,

Please drop the mx53loco board support patch from u-boot-imx master branch
and I will resubmit the following patches soon since the merge window will be
closed soon.

(1) clean-up patch:factor out the boot reason code to common code for
all the mx5
(2) fix-up: address Wolfgang's last minute comments and resubmit the patch.

Stefano, do you have some comments about what else I should do?

Sorry for bring your trouble and thanks for consideration.


BR,
Jason


>>
>> Best regards,
>>
>> Wolfgang Denk
>>
>> --
>> 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@denx.de
>> "Anyone attempting to generate random numbers by deterministic  means
>> is, of course, living in a state of sin."          - John Von Neumann
>>
>
Stefano Babic - April 15, 2011, 4:24 p.m.
On 04/14/2011 10:12 AM, Jason Liu wrote:
> Hi, Stefano,

Hi Jason,

> Please drop the mx53loco board support patch from u-boot-imx master branch
> and I will resubmit the following patches soon since the merge window will be
> closed soon.

Ok - I'll do it.

> 
> (1) clean-up patch:factor out the boot reason code to common code for
> all the mx5
> (2) fix-up: address Wolfgang's last minute comments and resubmit the patch.
> 
> Stefano, do you have some comments about what else I should do?

Please merge your other two patches for the LOCO board together - these
other patches correct only some CONFIG_ in the board configuration file:

	mx53loco: set mmc env to MMC slot1
	MX5: Enable flat-device-tree support on mx53 loco board

Submit a single patch with already the correct configuration for the
LOCO board. I will drop all three current patches from u-boot-imx.

Best regards,
Stefano
Jason Liu - April 15, 2011, 5:32 p.m.
Hi, Stefano,

2011/4/16 Stefano Babic <sbabic@denx.de>:
> On 04/14/2011 10:12 AM, Jason Liu wrote:
>> Hi, Stefano,
>
> Hi Jason,
>
>> Please drop the mx53loco board support patch from u-boot-imx master branch
>> and I will resubmit the following patches soon since the merge window will be
>> closed soon.
>
> Ok - I'll do it.
>
>>
>> (1) clean-up patch:factor out the boot reason code to common code for
>> all the mx5
>> (2) fix-up: address Wolfgang's last minute comments and resubmit the patch.
>>
>> Stefano, do you have some comments about what else I should do?
>
> Please merge your other two patches for the LOCO board together - these
> other patches correct only some CONFIG_ in the board configuration file:
>
>        mx53loco: set mmc env to MMC slot1
>        MX5: Enable flat-device-tree support on mx53 loco board
>
> Submit a single patch with already the correct configuration for the
> LOCO board. I will drop all three current patches from u-boot-imx.

I have sent out V4 patch as you tell. Thanks.

Jason

>
> Best regards,
> Stefano
>
> --
> =====================================================================
> 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@denx.de
> =====================================================================
>

Patch

diff --git a/MAINTAINERS b/MAINTAINERS
index 07541bd..b635a8a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -567,6 +567,7 @@  Stefano Babic <sbabic@denx.de>
 Jason Liu <r64343@freescale.com>
 
 	mx53evk         i.MX53
+	mx53loco        i.MX53
 
 Enric Balletbo i Serra <eballetbo@iseebcn.com>
 
diff --git a/board/freescale/mx53loco/Makefile b/board/freescale/mx53loco/Makefile
new file mode 100644
index 0000000..92ba09a
--- /dev/null
+++ b/board/freescale/mx53loco/Makefile
@@ -0,0 +1,46 @@ 
+#
+# (C) Copyright 2011 Freescale Semiconductor, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).o
+
+COBJS	:= mx53loco.o
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+SOBJS	:= $(addprefix $(obj),$(SOBJS))
+
+$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
+	$(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+clean:
+	rm -f $(SOBJS) $(OBJS)
+
+distclean:	clean
+	rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/freescale/mx53loco/config.mk b/board/freescale/mx53loco/config.mk
new file mode 100644
index 0000000..ec0c66c
--- /dev/null
+++ b/board/freescale/mx53loco/config.mk
@@ -0,0 +1,24 @@ 
+#
+# Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+IMX_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/imximage.cfg
+ALL += $(obj)u-boot.imx
diff --git a/board/freescale/mx53loco/imximage.cfg b/board/freescale/mx53loco/imximage.cfg
new file mode 100755
index 0000000..07dae26
--- /dev/null
+++ b/board/freescale/mx53loco/imximage.cfg
@@ -0,0 +1,99 @@ 
+#
+# (C Copyright 2009
+# Stefano Babic DENX Software Engineering sbabic@denx.de.
+# (C Copyright 2011
+# Jason Liu Freescale Software Engineering r64343@freescale.com
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not write to the Free Software
+# Foundation Inc. 51 Franklin Street Fifth Floor Boston,
+# MA 02110-1301 USA
+#
+# Refer docs/README.imxmage for more details about how-to configure
+# and create imximage boot image
+#
+# The syntax is taken as close as possible with the kwbimage
+
+# image version
+
+IMAGE_VERSION 2
+
+# Boot Device : one of
+# spi, sd (the board has no nand neither onenand)
+
+BOOT_FROM	sd
+
+# Device Configuration Data (DCD)
+#
+# Each entry must have the format:
+# Addr-type           Address        Value
+#
+# where:
+#	Addr-type register length (1,2 or 4 bytes)
+#	Address	  absolute address of the register
+#	value	  value to be stored in the register
+
+DATA 4 0x53fa8554 0x00300000
+DATA 4 0x53fa8558 0x00300040
+DATA 4 0x53fa8560 0x00300000
+DATA 4 0x53fa8564 0x00300040
+DATA 4 0x53fa8568 0x00300040
+DATA 4 0x53fa8570 0x00300000
+DATA 4 0x53fa8574 0x00300000
+DATA 4 0x53fa8578 0x00300000
+DATA 4 0x53fa857c 0x00300040
+DATA 4 0x53fa8580 0x00300040
+DATA 4 0x53fa8584 0x00300000
+DATA 4 0x53fa8588 0x00300000
+DATA 4 0x53fa8590 0x00300040
+DATA 4 0x53fa8594 0x00300000
+DATA 4 0x53fa86f0 0x00300000
+DATA 4 0x53fa86f4 0x00000000
+DATA 4 0x53fa86fc 0x00000000
+DATA 4 0x53fa8714 0x00000000
+DATA 4 0x53fa8718 0x00300000
+DATA 4 0x53fa871c 0x00300000
+DATA 4 0x53fa8720 0x00300000
+DATA 4 0x53fa8724 0x04000000
+DATA 4 0x53fa8728 0x00300000
+DATA 4 0x53fa872c 0x00300000
+DATA 4 0x63fd9088 0x35343535
+DATA 4 0x63fd9090 0x4d444c44
+DATA 4 0x63fd907c 0x01370138
+DATA 4 0x63fd9080 0x013b013c
+DATA 4 0x63fd9018 0x00011740
+DATA 4 0x63fd9000 0xc3190000
+DATA 4 0x63fd900c 0x9f5152e3
+DATA 4 0x63fd9010 0xb68e8a63
+DATA 4 0x63fd9014 0x01ff00db
+DATA 4 0x63fd902c 0x000026d2
+DATA 4 0x63fd9030 0x009f0e21
+DATA 4 0x63fd9008 0x12273030
+DATA 4 0x63fd9004 0x0002002d
+DATA 4 0x63fd901c 0x00008032
+DATA 4 0x63fd901c 0x00008033
+DATA 4 0x63fd901c 0x00028031
+DATA 4 0x63fd901c 0x092080b0
+DATA 4 0x63fd901c 0x04008040
+DATA 4 0x63fd901c 0x0000803a
+DATA 4 0x63fd901c 0x0000803b
+DATA 4 0x63fd901c 0x00028039
+DATA 4 0x63fd901c 0x09208138
+DATA 4 0x63fd901c 0x04008048
+DATA 4 0x63fd9020 0x00001800
+DATA 4 0x63fd9040 0x04b80003
+DATA 4 0x63fd9058 0x00022227
+DATA 4 0x63fd901c 0x00000000
diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c
new file mode 100755
index 0000000..b517671
--- /dev/null
+++ b/board/freescale/mx53loco/mx53loco.c
@@ -0,0 +1,316 @@ 
+/*
+ * Copyright (C) 2011 Freescale Semiconductor, Inc.
+ * Jason.Liu <r64343@freescale.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/imx-regs.h>
+#include <asm/arch/mx5x_pins.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/arch/crm_regs.h>
+#include <asm/arch/iomux.h>
+#include <asm/errno.h>
+#include <netdev.h>
+#include <i2c.h>
+#include <mmc.h>
+#include <fsl_esdhc.h>
+#include <mxc_gpio.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+u32 get_board_rev(void)
+{
+	return get_cpu_rev();
+}
+
+int dram_init(void)
+{
+	gd->ram_size = get_ram_size((volatile void *)CONFIG_SYS_SDRAM_BASE,
+				PHYS_SDRAM_1_SIZE);
+
+	return 0;
+}
+void dram_init_banksize(void)
+{
+	gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+	gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+
+	gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
+	gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
+}
+
+static void setup_iomux_uart(void)
+{
+	/* UART1 RXD */
+	mxc_request_iomux(MX53_PIN_CSI0_D11, IOMUX_CONFIG_ALT2);
+	mxc_iomux_set_pad(MX53_PIN_CSI0_D11,
+				PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH |
+				PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE |
+				PAD_CTL_HYS_ENABLE | PAD_CTL_100K_PU |
+				PAD_CTL_ODE_OPENDRAIN_ENABLE);
+	mxc_iomux_set_input(MX53_UART1_IPP_UART_RXD_MUX_SELECT_INPUT, 0x1);
+
+	/* UART1 TXD */
+	mxc_request_iomux(MX53_PIN_CSI0_D10, IOMUX_CONFIG_ALT2);
+	mxc_iomux_set_pad(MX53_PIN_CSI0_D10,
+				PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH |
+				PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE |
+				PAD_CTL_HYS_ENABLE | PAD_CTL_100K_PU |
+				PAD_CTL_ODE_OPENDRAIN_ENABLE);
+}
+
+static void setup_iomux_fec(void)
+{
+	/*FEC_MDIO*/
+	mxc_request_iomux(MX53_PIN_FEC_MDIO, IOMUX_CONFIG_ALT0);
+	mxc_iomux_set_pad(MX53_PIN_FEC_MDIO,
+				PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH |
+				PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE |
+				PAD_CTL_22K_PU | PAD_CTL_ODE_OPENDRAIN_ENABLE);
+	mxc_iomux_set_input(MX53_FEC_FEC_MDI_SELECT_INPUT, 0x1);
+
+	/*FEC_MDC*/
+	mxc_request_iomux(MX53_PIN_FEC_MDC, IOMUX_CONFIG_ALT0);
+	mxc_iomux_set_pad(MX53_PIN_FEC_MDC, PAD_CTL_DRV_HIGH);
+
+	/* FEC RXD1 */
+	mxc_request_iomux(MX53_PIN_FEC_RXD1, IOMUX_CONFIG_ALT0);
+	mxc_iomux_set_pad(MX53_PIN_FEC_RXD1,
+			PAD_CTL_HYS_ENABLE | PAD_CTL_PKE_ENABLE);
+
+	/* FEC RXD0 */
+	mxc_request_iomux(MX53_PIN_FEC_RXD0, IOMUX_CONFIG_ALT0);
+	mxc_iomux_set_pad(MX53_PIN_FEC_RXD0,
+			PAD_CTL_HYS_ENABLE | PAD_CTL_PKE_ENABLE);
+
+	 /* FEC TXD1 */
+	mxc_request_iomux(MX53_PIN_FEC_TXD1, IOMUX_CONFIG_ALT0);
+	mxc_iomux_set_pad(MX53_PIN_FEC_TXD1, PAD_CTL_DRV_HIGH);
+
+	/* FEC TXD0 */
+	mxc_request_iomux(MX53_PIN_FEC_TXD0, IOMUX_CONFIG_ALT0);
+	mxc_iomux_set_pad(MX53_PIN_FEC_TXD0, PAD_CTL_DRV_HIGH);
+
+	/* FEC TX_EN */
+	mxc_request_iomux(MX53_PIN_FEC_TX_EN, IOMUX_CONFIG_ALT0);
+	mxc_iomux_set_pad(MX53_PIN_FEC_TX_EN, PAD_CTL_DRV_HIGH);
+
+	/* FEC TX_CLK */
+	mxc_request_iomux(MX53_PIN_FEC_REF_CLK, IOMUX_CONFIG_ALT0);
+	mxc_iomux_set_pad(MX53_PIN_FEC_REF_CLK,
+			PAD_CTL_HYS_ENABLE | PAD_CTL_PKE_ENABLE);
+
+	/* FEC RX_ER */
+	mxc_request_iomux(MX53_PIN_FEC_RX_ER, IOMUX_CONFIG_ALT0);
+	mxc_iomux_set_pad(MX53_PIN_FEC_RX_ER,
+			PAD_CTL_HYS_ENABLE | PAD_CTL_PKE_ENABLE);
+
+	/* FEC CRS */
+	mxc_request_iomux(MX53_PIN_FEC_CRS_DV, IOMUX_CONFIG_ALT0);
+	mxc_iomux_set_pad(MX53_PIN_FEC_CRS_DV,
+			PAD_CTL_HYS_ENABLE | PAD_CTL_PKE_ENABLE);
+}
+
+#ifdef CONFIG_FSL_ESDHC
+struct fsl_esdhc_cfg esdhc_cfg[2] = {
+	{MMC_SDHC1_BASE_ADDR, 1},
+	{MMC_SDHC3_BASE_ADDR, 1},
+};
+
+int board_mmc_getcd(u8 *cd, struct mmc *mmc)
+{
+	struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
+
+	if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
+		*cd = mxc_gpio_get(77); /*GPIO3_13*/
+	else
+		*cd = mxc_gpio_get(75); /*GPIO3_11*/
+
+	return 0;
+}
+
+int board_mmc_init(bd_t *bis)
+{
+	u32 index;
+	s32 status = 0;
+
+	for (index = 0; index < CONFIG_SYS_FSL_ESDHC_NUM; index++) {
+		switch (index) {
+		case 0:
+			mxc_request_iomux(MX53_PIN_SD1_CMD, IOMUX_CONFIG_ALT0);
+			mxc_request_iomux(MX53_PIN_SD1_CLK, IOMUX_CONFIG_ALT0);
+			mxc_request_iomux(MX53_PIN_SD1_DATA0,
+						IOMUX_CONFIG_ALT0);
+			mxc_request_iomux(MX53_PIN_SD1_DATA1,
+						IOMUX_CONFIG_ALT0);
+			mxc_request_iomux(MX53_PIN_SD1_DATA2,
+						IOMUX_CONFIG_ALT0);
+			mxc_request_iomux(MX53_PIN_SD1_DATA3,
+						IOMUX_CONFIG_ALT0);
+			mxc_request_iomux(MX53_PIN_EIM_DA13,
+						IOMUX_CONFIG_ALT1);
+
+			mxc_iomux_set_pad(MX53_PIN_SD1_CMD,
+				PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH |
+				PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE |
+				PAD_CTL_HYS_ENABLE | PAD_CTL_100K_PU);
+			mxc_iomux_set_pad(MX53_PIN_SD1_CLK,
+				PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE |
+				PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU |
+				PAD_CTL_DRV_HIGH);
+			mxc_iomux_set_pad(MX53_PIN_SD1_DATA0,
+				PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH |
+				PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE |
+				PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU);
+			mxc_iomux_set_pad(MX53_PIN_SD1_DATA1,
+				PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH |
+				PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE |
+				PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU);
+			mxc_iomux_set_pad(MX53_PIN_SD1_DATA2,
+				PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH |
+				PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE |
+				PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU);
+			mxc_iomux_set_pad(MX53_PIN_SD1_DATA3,
+				PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH |
+				PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE |
+				PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU);
+			break;
+		case 1:
+			mxc_request_iomux(MX53_PIN_ATA_RESET_B,
+						IOMUX_CONFIG_ALT2);
+			mxc_request_iomux(MX53_PIN_ATA_IORDY,
+						IOMUX_CONFIG_ALT2);
+			mxc_request_iomux(MX53_PIN_ATA_DATA8,
+						IOMUX_CONFIG_ALT4);
+			mxc_request_iomux(MX53_PIN_ATA_DATA9,
+						IOMUX_CONFIG_ALT4);
+			mxc_request_iomux(MX53_PIN_ATA_DATA10,
+						IOMUX_CONFIG_ALT4);
+			mxc_request_iomux(MX53_PIN_ATA_DATA11,
+						IOMUX_CONFIG_ALT4);
+			mxc_request_iomux(MX53_PIN_ATA_DATA0,
+						IOMUX_CONFIG_ALT4);
+			mxc_request_iomux(MX53_PIN_ATA_DATA1,
+						IOMUX_CONFIG_ALT4);
+			mxc_request_iomux(MX53_PIN_ATA_DATA2,
+						IOMUX_CONFIG_ALT4);
+			mxc_request_iomux(MX53_PIN_ATA_DATA3,
+						IOMUX_CONFIG_ALT4);
+			mxc_request_iomux(MX53_PIN_EIM_DA11,
+						IOMUX_CONFIG_ALT1);
+
+			mxc_iomux_set_pad(MX53_PIN_ATA_RESET_B,
+				PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH |
+				PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE |
+				PAD_CTL_HYS_ENABLE | PAD_CTL_100K_PU);
+			mxc_iomux_set_pad(MX53_PIN_ATA_IORDY,
+				PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE |
+				PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU |
+				PAD_CTL_DRV_HIGH);
+			mxc_iomux_set_pad(MX53_PIN_ATA_DATA8,
+				PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH |
+				PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE |
+				PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU);
+			mxc_iomux_set_pad(MX53_PIN_ATA_DATA9,
+				PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH |
+				PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE |
+				PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU);
+			mxc_iomux_set_pad(MX53_PIN_ATA_DATA10,
+				PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH |
+				PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE |
+				PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU);
+			mxc_iomux_set_pad(MX53_PIN_ATA_DATA11,
+				PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH |
+				PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE |
+				PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU);
+			mxc_iomux_set_pad(MX53_PIN_ATA_DATA0,
+				PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH |
+				PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE |
+				PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU);
+			mxc_iomux_set_pad(MX53_PIN_ATA_DATA1,
+				PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH |
+				PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE |
+				PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU);
+			mxc_iomux_set_pad(MX53_PIN_ATA_DATA2,
+				PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH |
+				PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE |
+				PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU);
+			mxc_iomux_set_pad(MX53_PIN_ATA_DATA3,
+				PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH |
+				PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE |
+				PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU);
+
+			break;
+		default:
+			printf("Warning: you configured more ESDHC controller"
+				"(%d) as supported by the board(2)\n",
+				CONFIG_SYS_FSL_ESDHC_NUM);
+			return status;
+		}
+		status |= fsl_esdhc_initialize(bis, &esdhc_cfg[index]);
+	}
+
+	return status;
+}
+#endif
+
+int board_early_init_f(void)
+{
+	setup_iomux_uart();
+	setup_iomux_fec();
+
+	return 0;
+}
+
+int board_init(void)
+{
+	gd->bd->bi_arch_number = MACH_TYPE_MX53_LOCO;
+	gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
+
+	return 0;
+}
+
+int checkboard(void)
+{
+	u32 cause;
+	struct src *src_regs = (struct src *)SRC_BASE_ADDR;
+
+	puts("Board: MX53LOCO [");
+
+	cause = src_regs->srsr;
+	switch (cause) {
+	case 0x0001:
+		printf("POR");
+		break;
+	case 0x0009:
+		printf("RST");
+		break;
+	case 0x0010:
+	case 0x0011:
+		printf("WDOG");
+		break;
+	default:
+		printf("unknown");
+	}
+	printf("]\n");
+	return 0;
+}
diff --git a/boards.cfg b/boards.cfg
index 5be6d62..e59fc0a 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -109,6 +109,7 @@  ca9x4_ct_vxp                 arm         armv7       vexpress            armltd
 efikamx                      arm         armv7       efikamx             -              mx5
 mx51evk                      arm         armv7       mx51evk             freescale      mx5
 mx53evk                      arm         armv7       mx53evk             freescale      mx5
+mx53loco                     arm         armv7       mx53loco            freescale      mx5
 vision2                      arm         armv7       vision2             ttcontrol      mx5
 cm_t35                       arm         armv7       cm_t35              -              omap3
 omap3_overo                  arm         armv7       overo               -              omap3
diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
new file mode 100644
index 0000000..01490c3
--- /dev/null
+++ b/include/configs/mx53loco.h
@@ -0,0 +1,196 @@ 
+/*
+ * Copyright (C) 2010 Freescale Semiconductor, Inc.
+ * Jason.Liu <r64343@freescale.com>
+ *
+ * Configuration settings for Freescale MX53 low cost board.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#define CONFIG_MX53
+
+#define CONFIG_SYS_MX5_HCLK	24000000
+#define CONFIG_SYS_MX5_CLK32		32768
+#define CONFIG_DISPLAY_CPUINFO
+#define CONFIG_DISPLAY_BOARDINFO
+
+#define CONFIG_L2_OFF
+
+#include <asm/arch/imx-regs.h>
+
+#define CONFIG_CMDLINE_TAG		1	/* enable passing of ATAGs */
+#define CONFIG_REVISION_TAG		1
+#define CONFIG_SETUP_MEMORY_TAGS	1
+#define CONFIG_INITRD_TAG		1
+
+/* Size of malloc() pool */
+#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 2 * 1024 * 1024)
+
+#define CONFIG_BOARD_EARLY_INIT_F
+#define CONFIG_MXC_GPIO
+
+#define CONFIG_MXC_UART
+#define CONFIG_SYS_MX53_UART1
+
+/* I2C Configs */
+#define CONFIG_CMD_I2C          1
+#define CONFIG_HARD_I2C         1
+#define CONFIG_I2C_MXC          1
+#define CONFIG_SYS_I2C_MX53_PORT2       1
+#define CONFIG_SYS_I2C_SPEED            100000
+#define CONFIG_SYS_I2C_SLAVE            0xfe
+
+/* PMIC Configs */
+#define CONFIG_FSL_PMIC
+#define CONFIG_FSL_PMIC_I2C
+#define CONFIG_SYS_FSL_PMIC_I2C_ADDR    8
+
+/* MMC Configs */
+#define CONFIG_FSL_ESDHC
+#define CONFIG_SYS_FSL_ESDHC_ADDR	0
+#define CONFIG_SYS_FSL_ESDHC_NUM	2
+
+#define CONFIG_MMC
+#define CONFIG_CMD_MMC
+#define CONFIG_GENERIC_MMC
+#define CONFIG_CMD_FAT
+#define CONFIG_DOS_PARTITION
+
+/* Eth Configs */
+#define CONFIG_HAS_ETH1
+#define CONFIG_NET_MULTI
+#define CONFIG_MII
+#define CONFIG_DISCOVER_PHY
+
+#define CONFIG_FEC_MXC
+#define IMX_FEC_BASE	FEC_BASE_ADDR
+#define CONFIG_FEC_MXC_PHYADDR	0x1F
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NET
+
+/* allow to overwrite serial and ethaddr */
+#define CONFIG_ENV_OVERWRITE
+#define CONFIG_CONS_INDEX		1
+#define CONFIG_BAUDRATE			115200
+#define CONFIG_SYS_BAUDRATE_TABLE	{9600, 19200, 38400, 57600, 115200}
+
+/* Command definition */
+#include <config_cmd_default.h>
+
+#undef CONFIG_CMD_IMLS
+
+#define CONFIG_BOOTDELAY	3
+
+#define CONFIG_PRIME	"FEC0"
+
+#define CONFIG_LOADADDR		0x70800000	/* loadaddr env var */
+#define CONFIG_SYS_TEXT_BASE    0x77800000
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	"script=boot.scr\0" \
+	"uimage=uImage\0" \
+	"mmcdev=0\0" \
+	"mmcpart=2\0" \
+	"mmcroot=/dev/mmcblk0p3 rw\0" \
+	"mmcrootfstype=ext3 rootwait\0" \
+	"mmcargs=setenv bootargs console=ttymxc0,${baudrate} " \
+		"root=${mmcroot} " \
+		"rootfstype=${mmcrootfstype}\0" \
+	"loadbootscript=" \
+		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
+	"bootscript=echo Running bootscript from mmc ...; " \
+		"source\0" \
+	"loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
+	"mmcboot=echo Booting from mmc ...; " \
+		"run mmcargs; " \
+		"bootm\0" \
+	"netargs=setenv bootargs console=ttymxc0,${baudrate} " \
+		"root=/dev/nfs " \
+		"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
+	"netboot=echo Booting from net ...; " \
+		"run netargs; " \
+		"dhcp ${uimage}; bootm\0" \
+
+#define CONFIG_BOOTCOMMAND \
+	"if mmc rescan ${mmcdev}; then " \
+		"if run loadbootscript; then " \
+			"run bootscript; " \
+		"else " \
+			"if run loaduimage; then " \
+				"run mmcboot; " \
+			"else run netboot; " \
+			"fi; " \
+		"fi; " \
+	"else run netboot; fi"
+
+#define CONFIG_ARP_TIMEOUT	200UL
+
+/* Miscellaneous configurable options */
+#define CONFIG_SYS_LONGHELP		/* undef to save memory */
+#define CONFIG_SYS_HUSH_PARSER		/* use "hush" command parser */
+#define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
+#define CONFIG_SYS_PROMPT		"MX53LOCO U-Boot > "
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_SYS_CBSIZE		256	/* Console I/O Buffer Size */
+
+/* Print Buffer Size */
+#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
+#define CONFIG_SYS_MAXARGS	16	/* max number of command args */
+#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
+
+#define CONFIG_SYS_MEMTEST_START       0x70000000
+#define CONFIG_SYS_MEMTEST_END         0x10000
+
+#define CONFIG_SYS_LOAD_ADDR		CONFIG_LOADADDR
+
+#define CONFIG_SYS_HZ		1000
+#define CONFIG_CMDLINE_EDITING
+
+/* Stack sizes */
+#define CONFIG_STACKSIZE	(128 * 1024)	/* regular stack */
+
+/* Physical Memory Map */
+#define CONFIG_NR_DRAM_BANKS	2
+#define PHYS_SDRAM_1		CSD0_BASE_ADDR
+#define PHYS_SDRAM_1_SIZE	(512 * 1024 * 1024)
+#define PHYS_SDRAM_2		CSD1_BASE_ADDR
+#define PHYS_SDRAM_2_SIZE	(512 * 1024 * 1024)
+#define PHYS_SDRAM_SIZE         (PHYS_SDRAM_1_SIZE + PHYS_SDRAM_2_SIZE)
+
+#define CONFIG_SYS_SDRAM_BASE		(PHYS_SDRAM_1)
+#define CONFIG_SYS_INIT_RAM_ADDR	(IRAM_BASE_ADDR)
+#define CONFIG_SYS_INIT_RAM_SIZE	(IRAM_SIZE)
+
+#define CONFIG_SYS_INIT_SP_OFFSET \
+	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
+#define CONFIG_SYS_INIT_SP_ADDR \
+	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
+
+/* FLASH and environment organization */
+#define CONFIG_SYS_NO_FLASH
+
+#define CONFIG_ENV_OFFSET      (6 * 64 * 1024)
+#define CONFIG_ENV_SIZE        (8 * 1024)
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV 1
+
+#endif				/* __CONFIG_H */