Patchwork [U-Boot,v7,15/19] nand: mxc: Switch NAND SPL to generic SPL

login
register
mail settings
Submitter Benoît Thébaudeau
Date Feb. 15, 2013, 8:54 p.m.
Message ID <1360961665-10693-15-git-send-email-benoit.thebaudeau@advansee.com>
Download mbox | patch
Permalink /patch/220869/
State Superseded
Delegated to: Stefano Babic
Headers show

Comments

Benoît Thébaudeau - Feb. 15, 2013, 8:54 p.m.
This also fixes support for mx31pdk and tx25, which had been broken by commit
e05e5de7fae5bec79617e113916dac6631251156.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
---
Changes in v7: None
Changes in v6:
 - Automate 'u-boot.imx' and 'SPL' make targets for all imx processors.
 - Move board_init_f() to <board>.c.
 - Get rid of board SPL linker scripts.
 - Define CONFIG_SYS_NAND_U_BOOT_OFFS as CONFIG_SPL_MAX_SIZE rather than
   duplicating the constant value.
 - Define CONFIG_SYS_NAND_U_BOOT_DST as CONFIG_SYS_TEXT_BASE rather than
   duplicating the constant value.
 - Pass 0 as the 1st argument to relocate_code() since it's unused.
 - Fix stack pointers.
 - Rebase on latest u-boot-imx/master.
 - Move unrelated changes to separate patches.

Changes in v5:
 - Remove spaces between function name and open parenthesis.
 - Fix mx31pdk and tx25 Makefile-s and SPL linker scripts.
 - Remove the useless definition of CONFIG_SPL_LDSCRIPT.
 - Fix the call to nand_boot().

Changes in v4:
 - New patch.

Changes in v3: None
Changes in v2: None

 arch/arm/cpu/arm926ejs/start.S                     |    3 +-
 board/freescale/mx31pdk/Makefile                   |    3 +
 board/freescale/mx31pdk/config.mk                  |    5 --
 board/freescale/mx31pdk/mx31pdk.c                  |    8 ++
 board/karo/tx25/Makefile                           |    4 +-
 board/karo/tx25/config.mk                          |    5 --
 board/karo/tx25/tx25.c                             |    8 ++
 boards.cfg                                         |    2 +-
 drivers/mtd/nand/Makefile                          |    1 +
 drivers/mtd/nand/mxc_nand.c                        |   10 +--
 include/fsl_nfc.h => drivers/mtd/nand/mxc_nand.h   |   10 +--
 .../mtd/nand/mxc_nand_spl.c                        |   26 ++----
 include/configs/mx31pdk.h                          |   17 +++-
 include/configs/tx25.h                             |   22 +++--
 nand_spl/board/freescale/mx31pdk/Makefile          |   68 ---------------
 nand_spl/board/freescale/mx31pdk/u-boot.lds        |   87 -------------------
 nand_spl/board/karo/tx25/Makefile                  |   89 --------------------
 nand_spl/board/karo/tx25/config.mk                 |    1 -
 nand_spl/board/karo/tx25/u-boot.lds                |   87 -------------------
 19 files changed, 72 insertions(+), 384 deletions(-)
 delete mode 100644 board/freescale/mx31pdk/config.mk
 delete mode 100644 board/karo/tx25/config.mk
 rename include/fsl_nfc.h => drivers/mtd/nand/mxc_nand.h (98%)
 rename nand_spl/nand_boot_fsl_nfc.c => drivers/mtd/nand/mxc_nand_spl.c (92%)
 delete mode 100644 nand_spl/board/freescale/mx31pdk/Makefile
 delete mode 100644 nand_spl/board/freescale/mx31pdk/u-boot.lds
 delete mode 100644 nand_spl/board/karo/tx25/Makefile
 delete mode 100644 nand_spl/board/karo/tx25/config.mk
 delete mode 100644 nand_spl/board/karo/tx25/u-boot.lds
Fabio Estevam - Feb. 22, 2013, 7:14 p.m.
Hi Benoît,

On Fri, Feb 15, 2013 at 6:54 PM, Benoît Thébaudeau
<benoit.thebaudeau@advansee.com> wrote:
> This also fixes support for mx31pdk and tx25, which had been broken by commit
> e05e5de7fae5bec79617e113916dac6631251156.

Just tested your patch series on a mx31pdk, but unfortunately it does
not fix mx31pdk boot.

I will start looking at it, but any suggestion is welcome.

Regards,

Fabio Estevam
Fabio Estevam - Feb. 22, 2013, 7:30 p.m.
On Fri, Feb 22, 2013 at 4:14 PM, Fabio Estevam <festevam@gmail.com> wrote:

> Just tested your patch series on a mx31pdk, but unfortunately it does
> not fix mx31pdk boot.
>
> I will start looking at it, but any suggestion is welcome.

Ok, just changed to a proper toolchain and the result is a bit better now:

U-Boot 2013.01 (Feb 22 2013 - 16:25:48)

CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
Reset cause: POR
Board: MX31PDK
DRAM:  128 MiB

(hangs here).
Benoît Thébaudeau - Feb. 22, 2013, 8:09 p.m.
Hi Fabio,

On Friday, February 22, 2013 8:30:36 PM, Fabio Estevam wrote:
> On Fri, Feb 22, 2013 at 4:14 PM, Fabio Estevam <festevam@gmail.com> wrote:
> 
> > Just tested your patch series on a mx31pdk, but unfortunately it does
> > not fix mx31pdk boot.
> >
> > I will start looking at it, but any suggestion is welcome.
> 
> Ok, just changed to a proper toolchain and the result is a bit better now:
> 
> U-Boot 2013.01 (Feb 22 2013 - 16:25:48)
> 
> CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
> Reset cause: POR
> Board: MX31PDK
> DRAM:  128 MiB
> 
> (hangs here).

It looks very much like the issue that Marek had on i.MX53 (which self-resolved
for an unknown reason).

Try to enable the debug trace to see if anything else is printed after
display_dram_config(). I would especially be interested in:
        debug("relocation Offset is: %08lx\n", gd->reloc_off);
        debug("monitor flash len: %08lX\n", monitor_flash_len);

We should also check if CONFIG_SPL_TEXT_BASE and CONFIG_SYS_TEXT_BASE don't
overlap with something depending on code size. That's especially true for
CONFIG_SYS_TEXT_BASE.

After that, JTAG if no clue left... ;(

Best regards,
Benoît
Troy Kisky - Feb. 22, 2013, 8:55 p.m.
On 2/22/2013 1:09 PM, Benoît Thébaudeau wrote:
> Hi Fabio,
>
> On Friday, February 22, 2013 8:30:36 PM, Fabio Estevam wrote:
>> On Fri, Feb 22, 2013 at 4:14 PM, Fabio Estevam <festevam@gmail.com> wrote:
>>
>>> Just tested your patch series on a mx31pdk, but unfortunately it does
>>> not fix mx31pdk boot.
>>>
>>> I will start looking at it, but any suggestion is welcome.
>> Ok, just changed to a proper toolchain and the result is a bit better now:
>>
>> U-Boot 2013.01 (Feb 22 2013 - 16:25:48)
>>
>> CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
>> Reset cause: POR
>> Board: MX31PDK
>> DRAM:  128 MiB
>>
>> (hangs here).
> It looks very much like the issue that Marek had on i.MX53 (which self-resolved
> for an unknown reason).
>
> Try to enable the debug trace to see if anything else is printed after
> display_dram_config(). I would especially be interested in:
>          debug("relocation Offset is: %08lx\n", gd->reloc_off);
>          debug("monitor flash len: %08lX\n", monitor_flash_len);
>
> We should also check if CONFIG_SPL_TEXT_BASE and CONFIG_SYS_TEXT_BASE don't
> overlap with something depending on code size. That's especially true for
> CONFIG_SYS_TEXT_BASE.
>
> After that, JTAG if no clue left... ;(
>
> Best regards,
> Benoît
>
It does look familiar, can you try changing imximage.c


*header_size_ptr = ROUND(sbuf->st_size + imxhdr->flash_offset, 512);

to

*header_size_ptr = ROUND(sbuf->st_size + imxhdr->flash_offset, 4096);

(or whatever your nand sector size is)
and see if it makes a difference?
Fabio Estevam - Feb. 22, 2013, 9:06 p.m.
Hi Benoît,

On Fri, Feb 22, 2013 at 5:09 PM, Benoît Thébaudeau
<benoit.thebaudeau@advansee.com> wrote:

> It looks very much like the issue that Marek had on i.MX53 (which self-resolved
> for an unknown reason).
>
> Try to enable the debug trace to see if anything else is printed after
> display_dram_config(). I would especially be interested in:
>         debug("relocation Offset is: %08lx\n", gd->reloc_off);
>         debug("monitor flash len: %08lX\n", monitor_flash_len);

Here is the output:

U-Boot 2013.01 (Feb 22 2013 - 18:00:50)

U-Boot code: 87F00000 -> 87F2C184  BSS: -> 87F311B4
CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
Reset cause: POR
Board: MX31PDK
monitor len: 000311B4
ramsize: 08000000
TLB table from 87ff0000 to 87ff4000
Top of RAM usable for U-Boot at: 87ff0000
Reserving 196k for U-Boot at: 87fbe000
Reserving 640k for malloc() at: 87f1e000
Reserving 32 Bytes for Board Info at: 87f1dfe0
Reserving 128 Bytes for Global Data at: 87f1df60
New Stack Pointer is: 87f1df50
RAM Configuration:
Bank #0: 80000000 128 MiB
relocation Offset is: 000be000
Fabio Estevam - Feb. 22, 2013, 9:07 p.m.
Hi Troy,

On Fri, Feb 22, 2013 at 5:55 PM, Troy Kisky
<troy.kisky@boundarydevices.com> wrote:

> It does look familiar, can you try changing imximage.c
>
>
> *header_size_ptr = ROUND(sbuf->st_size + imxhdr->flash_offset, 512);
>
> to
>
> *header_size_ptr = ROUND(sbuf->st_size + imxhdr->flash_offset, 4096);
>
> (or whatever your nand sector size is)
> and see if it makes a difference?

Thanks for the suggestion, but mx31 does not run imximage tool.
Benoît Thébaudeau - Feb. 22, 2013, 9:13 p.m.
Hi Fabio,

On Friday, February 22, 2013 10:06:42 PM, Fabio Estevam wrote:
> Hi Benoît,
> 
> On Fri, Feb 22, 2013 at 5:09 PM, Benoît Thébaudeau
> <benoit.thebaudeau@advansee.com> wrote:
> 
> > It looks very much like the issue that Marek had on i.MX53 (which
> > self-resolved
> > for an unknown reason).
> >
> > Try to enable the debug trace to see if anything else is printed after
> > display_dram_config(). I would especially be interested in:
> >         debug("relocation Offset is: %08lx\n", gd->reloc_off);
> >         debug("monitor flash len: %08lX\n", monitor_flash_len);
> 
> Here is the output:
> 
> U-Boot 2013.01 (Feb 22 2013 - 18:00:50)
> 
> U-Boot code: 87F00000 -> 87F2C184  BSS: -> 87F311B4
> CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
> Reset cause: POR
> Board: MX31PDK
> monitor len: 000311B4
> ramsize: 08000000
> TLB table from 87ff0000 to 87ff4000
> Top of RAM usable for U-Boot at: 87ff0000
> Reserving 196k for U-Boot at: 87fbe000
> Reserving 640k for malloc() at: 87f1e000
> Reserving 32 Bytes for Board Info at: 87f1dfe0
> Reserving 128 Bytes for Global Data at: 87f1df60
> New Stack Pointer is: 87f1df50
> RAM Configuration:
> Bank #0: 80000000 128 MiB
> relocation Offset is: 000be000

CONFIG_SYS_TEXT_BASE seems fine according to this trace. But anyway, can you
test with this change in mx31pdk.h?
#define CONFIG_SPL_TEXT_BASE	0x84000000
#define CONFIG_SYS_TEXT_BASE	0x83000000

Can you try to revert 10/19, only for arm1136/start.S (1 line to restore)? There
is an issue in this patch that I have already fixed in my v8.

Best regards,
Benoît
Benoît Thébaudeau - Feb. 22, 2013, 9:24 p.m.
Hi Fabio,

On Friday, February 22, 2013 10:26:47 PM, Fabio Estevam wrote:
> On Fri, Feb 22, 2013 at 6:13 PM, Benoît Thébaudeau
> <benoit.thebaudeau@advansee.com> wrote:
> 
> > CONFIG_SYS_TEXT_BASE seems fine according to this trace. But anyway, can
> > you
> > test with this change in mx31pdk.h?
> > #define CONFIG_SPL_TEXT_BASE    0x84000000
> > #define CONFIG_SYS_TEXT_BASE    0x83000000
> >
> > Can you try to revert 10/19, only for arm1136/start.S (1 line to restore)?
> > There
> > is an issue in this patch that I have already fixed in my v8.
> 
> Just tried with the above changes:
> 
> U-Boot code: 83000000 -> 8302C184  BSS: -> 830311B4
> CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
> Reset cause: POR
> Board: MX31PDK
> monitor len: 000311B4
> ramsize: 08000000
> TLB table from 87ff0000 to 87ff4000
> Top of RAM usable for U-Boot at: 87ff0000
> Reserving 196k for U-Boot at: 87fbe000
> Reserving 640k for malloc() at: 87f1e000
> Reserving 32 Bytes for Board Info at: 87f1dfe0
> Reserving 128 Bytes for Global Data at: 87f1df60
> New Stack Pointer is: 87f1df50
> RAM Configuration:
> Bank #0: 80000000 128 MiB
> relocation Offset is: 04fbe000

I have no other clue for now. Can you try asm step by step in relocate_code()?
:(

Best regards,
Benoît
Fabio Estevam - Feb. 22, 2013, 9:26 p.m.
On Fri, Feb 22, 2013 at 6:13 PM, Benoît Thébaudeau
<benoit.thebaudeau@advansee.com> wrote:

> CONFIG_SYS_TEXT_BASE seems fine according to this trace. But anyway, can you
> test with this change in mx31pdk.h?
> #define CONFIG_SPL_TEXT_BASE    0x84000000
> #define CONFIG_SYS_TEXT_BASE    0x83000000
>
> Can you try to revert 10/19, only for arm1136/start.S (1 line to restore)? There
> is an issue in this patch that I have already fixed in my v8.

Just tried with the above changes:

U-Boot code: 83000000 -> 8302C184  BSS: -> 830311B4
CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
Reset cause: POR
Board: MX31PDK
monitor len: 000311B4
ramsize: 08000000
TLB table from 87ff0000 to 87ff4000
Top of RAM usable for U-Boot at: 87ff0000
Reserving 196k for U-Boot at: 87fbe000
Reserving 640k for malloc() at: 87f1e000
Reserving 32 Bytes for Board Info at: 87f1dfe0
Reserving 128 Bytes for Global Data at: 87f1df60
New Stack Pointer is: 87f1df50
RAM Configuration:
Bank #0: 80000000 128 MiB
relocation Offset is: 04fbe000
Benoît Thébaudeau - Feb. 22, 2013, 9:27 p.m.
Hi Troy,

On Friday, February 22, 2013 10:30:21 PM, Troy Kisky wrote:
> On 2/22/2013 2:13 PM, Benoît Thébaudeau wrote:
> > Hi Fabio,
> >
> > On Friday, February 22, 2013 10:06:42 PM, Fabio Estevam wrote:
> >> Hi Benoît,
> >>
> >> On Fri, Feb 22, 2013 at 5:09 PM, Benoît Thébaudeau
> >> <benoit.thebaudeau@advansee.com> wrote:
> >>
> >>> It looks very much like the issue that Marek had on i.MX53 (which
> >>> self-resolved
> >>> for an unknown reason).
> >>>
> >>> Try to enable the debug trace to see if anything else is printed after
> >>> display_dram_config(). I would especially be interested in:
> >>>          debug("relocation Offset is: %08lx\n", gd->reloc_off);
> >>>          debug("monitor flash len: %08lX\n", monitor_flash_len);
> >> Here is the output:
> >>
> >> U-Boot 2013.01 (Feb 22 2013 - 18:00:50)
> >>
> >> U-Boot code: 87F00000 -> 87F2C184  BSS: -> 87F311B4
> >> CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
> >> Reset cause: POR
> >> Board: MX31PDK
> >> monitor len: 000311B4
> >> ramsize: 08000000
> >> TLB table from 87ff0000 to 87ff4000
> >> Top of RAM usable for U-Boot at: 87ff0000
> >> Reserving 196k for U-Boot at: 87fbe000
> >> Reserving 640k for malloc() at: 87f1e000
> >> Reserving 32 Bytes for Board Info at: 87f1dfe0
> >> Reserving 128 Bytes for Global Data at: 87f1df60
> >> New Stack Pointer is: 87f1df50
> >> RAM Configuration:
> >> Bank #0: 80000000 128 MiB
> >> relocation Offset is: 000be000
> > CONFIG_SYS_TEXT_BASE seems fine according to this trace. But anyway, can
> > you
> > test with this change in mx31pdk.h?
> > #define CONFIG_SPL_TEXT_BASE	0x84000000
> > #define CONFIG_SYS_TEXT_BASE	0x83000000
> >
> > Can you try to revert 10/19, only for arm1136/start.S (1 line to restore)?
> > There
> > is an issue in this patch that I have already fixed in my v8.
> >
> > Best regards,
> > Benoît
> > _______________________________________________
> >
> How about changing
> 
> #define CONFIG_SYS_NAND_U_BOOT_SIZE   0x30000
> #define CONFIG_SYS_NAND_U_BOOT_SIZE   0x32000
> 
> is see monitor len: 311B4 above is over 0x30000
> 
> 
> Please excuse me if they are unrelated.

That could be it. Thanks! Fabio, please try.

Best regards,
Benoît
Troy Kisky - Feb. 22, 2013, 9:30 p.m.
On 2/22/2013 2:13 PM, Benoît Thébaudeau wrote:
> Hi Fabio,
>
> On Friday, February 22, 2013 10:06:42 PM, Fabio Estevam wrote:
>> Hi Benoît,
>>
>> On Fri, Feb 22, 2013 at 5:09 PM, Benoît Thébaudeau
>> <benoit.thebaudeau@advansee.com> wrote:
>>
>>> It looks very much like the issue that Marek had on i.MX53 (which
>>> self-resolved
>>> for an unknown reason).
>>>
>>> Try to enable the debug trace to see if anything else is printed after
>>> display_dram_config(). I would especially be interested in:
>>>          debug("relocation Offset is: %08lx\n", gd->reloc_off);
>>>          debug("monitor flash len: %08lX\n", monitor_flash_len);
>> Here is the output:
>>
>> U-Boot 2013.01 (Feb 22 2013 - 18:00:50)
>>
>> U-Boot code: 87F00000 -> 87F2C184  BSS: -> 87F311B4
>> CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
>> Reset cause: POR
>> Board: MX31PDK
>> monitor len: 000311B4
>> ramsize: 08000000
>> TLB table from 87ff0000 to 87ff4000
>> Top of RAM usable for U-Boot at: 87ff0000
>> Reserving 196k for U-Boot at: 87fbe000
>> Reserving 640k for malloc() at: 87f1e000
>> Reserving 32 Bytes for Board Info at: 87f1dfe0
>> Reserving 128 Bytes for Global Data at: 87f1df60
>> New Stack Pointer is: 87f1df50
>> RAM Configuration:
>> Bank #0: 80000000 128 MiB
>> relocation Offset is: 000be000
> CONFIG_SYS_TEXT_BASE seems fine according to this trace. But anyway, can you
> test with this change in mx31pdk.h?
> #define CONFIG_SPL_TEXT_BASE	0x84000000
> #define CONFIG_SYS_TEXT_BASE	0x83000000
>
> Can you try to revert 10/19, only for arm1136/start.S (1 line to restore)? There
> is an issue in this patch that I have already fixed in my v8.
>
> Best regards,
> Benoît
> _______________________________________________
>
How about changing

#define CONFIG_SYS_NAND_U_BOOT_SIZE   0x30000
#define CONFIG_SYS_NAND_U_BOOT_SIZE   0x32000

is see monitor len: 311B4 above is over 0x30000


Please excuse me if they are unrelated.

Troy
Benoît Thébaudeau - Feb. 22, 2013, 9:31 p.m.
On Friday, February 22, 2013 10:27:57 PM, Benoît Thébaudeau wrote:
> Hi Troy,
> 
> On Friday, February 22, 2013 10:30:21 PM, Troy Kisky wrote:
> > On 2/22/2013 2:13 PM, Benoît Thébaudeau wrote:
> > > Hi Fabio,
> > >
> > > On Friday, February 22, 2013 10:06:42 PM, Fabio Estevam wrote:
> > >> Hi Benoît,
> > >>
> > >> On Fri, Feb 22, 2013 at 5:09 PM, Benoît Thébaudeau
> > >> <benoit.thebaudeau@advansee.com> wrote:
> > >>
> > >>> It looks very much like the issue that Marek had on i.MX53 (which
> > >>> self-resolved
> > >>> for an unknown reason).
> > >>>
> > >>> Try to enable the debug trace to see if anything else is printed after
> > >>> display_dram_config(). I would especially be interested in:
> > >>>          debug("relocation Offset is: %08lx\n", gd->reloc_off);
> > >>>          debug("monitor flash len: %08lX\n", monitor_flash_len);
> > >> Here is the output:
> > >>
> > >> U-Boot 2013.01 (Feb 22 2013 - 18:00:50)
> > >>
> > >> U-Boot code: 87F00000 -> 87F2C184  BSS: -> 87F311B4
> > >> CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
> > >> Reset cause: POR
> > >> Board: MX31PDK
> > >> monitor len: 000311B4
> > >> ramsize: 08000000
> > >> TLB table from 87ff0000 to 87ff4000
> > >> Top of RAM usable for U-Boot at: 87ff0000
> > >> Reserving 196k for U-Boot at: 87fbe000
> > >> Reserving 640k for malloc() at: 87f1e000
> > >> Reserving 32 Bytes for Board Info at: 87f1dfe0
> > >> Reserving 128 Bytes for Global Data at: 87f1df60
> > >> New Stack Pointer is: 87f1df50
> > >> RAM Configuration:
> > >> Bank #0: 80000000 128 MiB
> > >> relocation Offset is: 000be000
> > > CONFIG_SYS_TEXT_BASE seems fine according to this trace. But anyway, can
> > > you
> > > test with this change in mx31pdk.h?
> > > #define CONFIG_SPL_TEXT_BASE	0x84000000
> > > #define CONFIG_SYS_TEXT_BASE	0x83000000
> > >
> > > Can you try to revert 10/19, only for arm1136/start.S (1 line to
> > > restore)?
> > > There
> > > is an issue in this patch that I have already fixed in my v8.
> > >
> > > Best regards,
> > > Benoît
> > > _______________________________________________
> > >
> > How about changing
> > 
> > #define CONFIG_SYS_NAND_U_BOOT_SIZE   0x30000
> > #define CONFIG_SYS_NAND_U_BOOT_SIZE   0x32000
> > 
> > is see monitor len: 311B4 above is over 0x30000
> > 
> > 
> > Please excuse me if they are unrelated.
> 
> That could be it. Thanks! Fabio, please try.

But Fabio, how have you been able to program u-boot-with-spl.bin if it overlaps
the next MTD partition, unless you destroyed what follows or
CONFIG_SYS_NAND_U_BOOT_SIZE does not match your NAND images layout?

Best regards,
Benoît
Benoît Thébaudeau - Feb. 22, 2013, 9:40 p.m.
On Friday, February 22, 2013 10:31:13 PM, Benoît Thébaudeau wrote:
> On Friday, February 22, 2013 10:27:57 PM, Benoît Thébaudeau wrote:
> > Hi Troy,
> > 
> > On Friday, February 22, 2013 10:30:21 PM, Troy Kisky wrote:
> > > On 2/22/2013 2:13 PM, Benoît Thébaudeau wrote:
> > > > Hi Fabio,
> > > >
> > > > On Friday, February 22, 2013 10:06:42 PM, Fabio Estevam wrote:
> > > >> Hi Benoît,
> > > >>
> > > >> On Fri, Feb 22, 2013 at 5:09 PM, Benoît Thébaudeau
> > > >> <benoit.thebaudeau@advansee.com> wrote:
> > > >>
> > > >>> It looks very much like the issue that Marek had on i.MX53 (which
> > > >>> self-resolved
> > > >>> for an unknown reason).
> > > >>>
> > > >>> Try to enable the debug trace to see if anything else is printed
> > > >>> after
> > > >>> display_dram_config(). I would especially be interested in:
> > > >>>          debug("relocation Offset is: %08lx\n", gd->reloc_off);
> > > >>>          debug("monitor flash len: %08lX\n", monitor_flash_len);
> > > >> Here is the output:
> > > >>
> > > >> U-Boot 2013.01 (Feb 22 2013 - 18:00:50)
> > > >>
> > > >> U-Boot code: 87F00000 -> 87F2C184  BSS: -> 87F311B4
> > > >> CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
> > > >> Reset cause: POR
> > > >> Board: MX31PDK
> > > >> monitor len: 000311B4
> > > >> ramsize: 08000000
> > > >> TLB table from 87ff0000 to 87ff4000
> > > >> Top of RAM usable for U-Boot at: 87ff0000
> > > >> Reserving 196k for U-Boot at: 87fbe000
> > > >> Reserving 640k for malloc() at: 87f1e000
> > > >> Reserving 32 Bytes for Board Info at: 87f1dfe0
> > > >> Reserving 128 Bytes for Global Data at: 87f1df60
> > > >> New Stack Pointer is: 87f1df50
> > > >> RAM Configuration:
> > > >> Bank #0: 80000000 128 MiB
> > > >> relocation Offset is: 000be000
> > > > CONFIG_SYS_TEXT_BASE seems fine according to this trace. But anyway,
> > > > can
> > > > you
> > > > test with this change in mx31pdk.h?
> > > > #define CONFIG_SPL_TEXT_BASE	0x84000000
> > > > #define CONFIG_SYS_TEXT_BASE	0x83000000
> > > >
> > > > Can you try to revert 10/19, only for arm1136/start.S (1 line to
> > > > restore)?
> > > > There
> > > > is an issue in this patch that I have already fixed in my v8.
> > > >
> > > > Best regards,
> > > > Benoît
> > > > _______________________________________________
> > > >
> > > How about changing
> > > 
> > > #define CONFIG_SYS_NAND_U_BOOT_SIZE   0x30000
> > > #define CONFIG_SYS_NAND_U_BOOT_SIZE   0x32000
> > > 
> > > is see monitor len: 311B4 above is over 0x30000
> > > 
> > > 
> > > Please excuse me if they are unrelated.
> > 
> > That could be it. Thanks! Fabio, please try.
> 
> But Fabio, how have you been able to program u-boot-with-spl.bin if it
> overlaps
> the next MTD partition, unless you destroyed what follows or
> CONFIG_SYS_NAND_U_BOOT_SIZE does not match your NAND images layout?

u-boot.bin is also a little bit larger than 0x30000 with my compiler, so there
is definitely an issue with CONFIG_SYS_NAND_U_BOOT_SIZE. If it really has to fit
in 0x30000 in your NAND, then try -ffunction-section, -fdata-sections and
-Wl,--gc-sections in the board config.mk.

Best regards,
Benoît
Fabio Estevam - Feb. 22, 2013, 9:51 p.m.
On Fri, Feb 22, 2013 at 6:30 PM, Troy Kisky
<troy.kisky@boundarydevices.com> wrote:
> On 2/22/2013 2:13 PM, Benoît Thébaudeau wrote:
>>
>> Hi Fabio,
>>
>> On Friday, February 22, 2013 10:06:42 PM, Fabio Estevam wrote:
>>>
>>> Hi Benoît,
>>>
>>> On Fri, Feb 22, 2013 at 5:09 PM, Benoît Thébaudeau
>>> <benoit.thebaudeau@advansee.com> wrote:
>>>
>>>> It looks very much like the issue that Marek had on i.MX53 (which
>>>> self-resolved
>>>> for an unknown reason).
>>>>
>>>> Try to enable the debug trace to see if anything else is printed after
>>>> display_dram_config(). I would especially be interested in:
>>>>          debug("relocation Offset is: %08lx\n", gd->reloc_off);
>>>>          debug("monitor flash len: %08lX\n", monitor_flash_len);
>>>
>>> Here is the output:
>>>
>>> U-Boot 2013.01 (Feb 22 2013 - 18:00:50)
>>>
>>> U-Boot code: 87F00000 -> 87F2C184  BSS: -> 87F311B4
>>> CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
>>> Reset cause: POR
>>> Board: MX31PDK
>>> monitor len: 000311B4
>>> ramsize: 08000000
>>> TLB table from 87ff0000 to 87ff4000
>>> Top of RAM usable for U-Boot at: 87ff0000
>>> Reserving 196k for U-Boot at: 87fbe000
>>> Reserving 640k for malloc() at: 87f1e000
>>> Reserving 32 Bytes for Board Info at: 87f1dfe0
>>> Reserving 128 Bytes for Global Data at: 87f1df60
>>> New Stack Pointer is: 87f1df50
>>> RAM Configuration:
>>> Bank #0: 80000000 128 MiB
>>> relocation Offset is: 000be000
>>
>> CONFIG_SYS_TEXT_BASE seems fine according to this trace. But anyway, can
>> you
>> test with this change in mx31pdk.h?
>> #define CONFIG_SPL_TEXT_BASE    0x84000000
>> #define CONFIG_SYS_TEXT_BASE    0x83000000
>>
>> Can you try to revert 10/19, only for arm1136/start.S (1 line to restore)?
>> There
>> is an issue in this patch that I have already fixed in my v8.
>>
>> Best regards,
>> Benoît
>> _______________________________________________
>>
> How about changing
>
> #define CONFIG_SYS_NAND_U_BOOT_SIZE   0x30000
> #define CONFIG_SYS_NAND_U_BOOT_SIZE   0x32000
>
> is see monitor len: 311B4 above is over 0x30000

Thanks, Troy. When I tried increasing from 0x30000 it did not boot
anymore. Still checking.

Thanks!
Fabio Estevam - Feb. 22, 2013, 9:53 p.m.
On Fri, Feb 22, 2013 at 6:31 PM, Benoît Thébaudeau
<benoit.thebaudeau@advansee.com> wrote:

> But Fabio, how have you been able to program u-boot-with-spl.bin if it overlaps
> the next MTD partition, unless you destroyed what follows or
> CONFIG_SYS_NAND_U_BOOT_SIZE does not match your NAND images layout?

Yes, I program u-boot-with-spl.bin into offset 0 of NAND flash and I
have no other MTD partition currently on my NAND.

Thanks,

Fabio Estevam
Fabio Estevam - Feb. 22, 2013, 10:02 p.m.
On Fri, Feb 22, 2013 at 6:51 PM, Fabio Estevam <festevam@gmail.com> wrote:
> On Fri, Feb 22, 2013 at 6:30 PM, Troy Kisky
> <troy.kisky@boundarydevices.com> wrote:
>> On 2/22/2013 2:13 PM, Benoît Thébaudeau wrote:
>>>
>>> Hi Fabio,
>>>
>>> On Friday, February 22, 2013 10:06:42 PM, Fabio Estevam wrote:
>>>>
>>>> Hi Benoît,
>>>>
>>>> On Fri, Feb 22, 2013 at 5:09 PM, Benoît Thébaudeau
>>>> <benoit.thebaudeau@advansee.com> wrote:
>>>>
>>>>> It looks very much like the issue that Marek had on i.MX53 (which
>>>>> self-resolved
>>>>> for an unknown reason).
>>>>>
>>>>> Try to enable the debug trace to see if anything else is printed after
>>>>> display_dram_config(). I would especially be interested in:
>>>>>          debug("relocation Offset is: %08lx\n", gd->reloc_off);
>>>>>          debug("monitor flash len: %08lX\n", monitor_flash_len);
>>>>
>>>> Here is the output:
>>>>
>>>> U-Boot 2013.01 (Feb 22 2013 - 18:00:50)
>>>>
>>>> U-Boot code: 87F00000 -> 87F2C184  BSS: -> 87F311B4
>>>> CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
>>>> Reset cause: POR
>>>> Board: MX31PDK
>>>> monitor len: 000311B4
>>>> ramsize: 08000000
>>>> TLB table from 87ff0000 to 87ff4000
>>>> Top of RAM usable for U-Boot at: 87ff0000
>>>> Reserving 196k for U-Boot at: 87fbe000
>>>> Reserving 640k for malloc() at: 87f1e000
>>>> Reserving 32 Bytes for Board Info at: 87f1dfe0
>>>> Reserving 128 Bytes for Global Data at: 87f1df60
>>>> New Stack Pointer is: 87f1df50
>>>> RAM Configuration:
>>>> Bank #0: 80000000 128 MiB
>>>> relocation Offset is: 000be000
>>>
>>> CONFIG_SYS_TEXT_BASE seems fine according to this trace. But anyway, can
>>> you
>>> test with this change in mx31pdk.h?
>>> #define CONFIG_SPL_TEXT_BASE    0x84000000
>>> #define CONFIG_SYS_TEXT_BASE    0x83000000
>>>
>>> Can you try to revert 10/19, only for arm1136/start.S (1 line to restore)?
>>> There
>>> is an issue in this patch that I have already fixed in my v8.
>>>
>>> Best regards,
>>> Benoît
>>> _______________________________________________
>>>
>> How about changing
>>
>> #define CONFIG_SYS_NAND_U_BOOT_SIZE   0x30000
>> #define CONFIG_SYS_NAND_U_BOOT_SIZE   0x32000
>>
>> is see monitor len: 311B4 above is over 0x30000
>
> Thanks, Troy. When I tried increasing from 0x30000 it did not boot
> anymore. Still checking.

Sorry, I flashed it incorrectly.

Now, after changing it to 0x32000 I can see the boot progresses a bit:

U-Boot code: 87F00000 -> 87F2C184  BSS: -> 87F311B4
CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
Reset cause: WDOG
Board: MX31PDK
monitor len: 000311B4
ramsize: 08000000
TLB table from 87ff0000 to 87ff4000
Top of RAM usable for U-Boot at: 87ff0000
Reserving 196k for U-Boot at: 87fbe000
Reserving 640k for malloc() at: 87f1e000
Reserving 32 Bytes for Board Info at: 87f1dfe0
Reserving 128 Bytes for Global Data at: 87f1df60
New Stack Pointer is: 87f1df50
RAM Configuration:
Bank #0: 80000000 128 MiB
relocation Offset is: 000be000
monitor flash len: 00030F7C
Now running in RAM - U-Boot at: 87fbe000
NAND:  256 MiB
Fabio Estevam - Feb. 22, 2013, 10:03 p.m.
On Fri, Feb 22, 2013 at 7:02 PM, Fabio Estevam <festevam@gmail.com> wrote:

> U-Boot code: 87F00000 -> 87F2C184  BSS: -> 87F311B4
> CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
> Reset cause: WDOG
> Board: MX31PDK
> monitor len: 000311B4
> ramsize: 08000000
> TLB table from 87ff0000 to 87ff4000
> Top of RAM usable for U-Boot at: 87ff0000
> Reserving 196k for U-Boot at: 87fbe000
> Reserving 640k for malloc() at: 87f1e000
> Reserving 32 Bytes for Board Info at: 87f1dfe0
> Reserving 128 Bytes for Global Data at: 87f1df60
> New Stack Pointer is: 87f1df50
> RAM Configuration:
> Bank #0: 80000000 128 MiB
> relocation Offset is: 000be000
> monitor flash len: 00030F7C
> Now running in RAM - U-Boot at: 87fbe000
> NAND:  256 MiB

and after this it does not hang, it keeps resetting forever.
Fabio Estevam - Feb. 22, 2013, 10:08 p.m.
On Fri, Feb 22, 2013 at 7:03 PM, Fabio Estevam <festevam@gmail.com> wrote:
> On Fri, Feb 22, 2013 at 7:02 PM, Fabio Estevam <festevam@gmail.com> wrote:
>
>> U-Boot code: 87F00000 -> 87F2C184  BSS: -> 87F311B4
>> CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
>> Reset cause: WDOG
>> Board: MX31PDK
>> monitor len: 000311B4
>> ramsize: 08000000
>> TLB table from 87ff0000 to 87ff4000
>> Top of RAM usable for U-Boot at: 87ff0000
>> Reserving 196k for U-Boot at: 87fbe000
>> Reserving 640k for malloc() at: 87f1e000
>> Reserving 32 Bytes for Board Info at: 87f1dfe0
>> Reserving 128 Bytes for Global Data at: 87f1df60
>> New Stack Pointer is: 87f1df50
>> RAM Configuration:
>> Bank #0: 80000000 128 MiB
>> relocation Offset is: 000be000
>> monitor flash len: 00030F7C
>> Now running in RAM - U-Boot at: 87fbe000
>> NAND:  256 MiB
>
> and after this it does not hang, it keeps resetting forever.

I disabled watchdog and now I can reach U-boot prompt :-)  Thanks
Benoit and Troy!

Will fix the watchdog later.
Benoît Thébaudeau - Feb. 22, 2013, 10:42 p.m.
Hi Fabio,

On Friday, February 22, 2013 11:08:14 PM, Fabio Estevam wrote:
> On Fri, Feb 22, 2013 at 7:03 PM, Fabio Estevam <festevam@gmail.com> wrote:
> > On Fri, Feb 22, 2013 at 7:02 PM, Fabio Estevam <festevam@gmail.com> wrote:
> >
> >> U-Boot code: 87F00000 -> 87F2C184  BSS: -> 87F311B4
> >> CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
> >> Reset cause: WDOG
> >> Board: MX31PDK
> >> monitor len: 000311B4
> >> ramsize: 08000000
> >> TLB table from 87ff0000 to 87ff4000
> >> Top of RAM usable for U-Boot at: 87ff0000
> >> Reserving 196k for U-Boot at: 87fbe000
> >> Reserving 640k for malloc() at: 87f1e000
> >> Reserving 32 Bytes for Board Info at: 87f1dfe0
> >> Reserving 128 Bytes for Global Data at: 87f1df60
> >> New Stack Pointer is: 87f1df50
> >> RAM Configuration:
> >> Bank #0: 80000000 128 MiB
> >> relocation Offset is: 000be000
> >> monitor flash len: 00030F7C
> >> Now running in RAM - U-Boot at: 87fbe000
> >> NAND:  256 MiB
> >
> > and after this it does not hang, it keeps resetting forever.
> 
> I disabled watchdog and now I can reach U-boot prompt :-)  Thanks
> Benoit and Troy!
> 
> Will fix the watchdog later.

Great! So can you confirm that for my series, all I have to change is:
#define CONFIG_SYS_NAND_U_BOOT_SIZE   0x32000
?

Did you also have a chance to test nand commands on mx53ard?

Thanks for all your tests.

Best regards,
Benoît
Fabio Estevam - Feb. 22, 2013, 10:56 p.m.
On Fri, Feb 22, 2013 at 7:42 PM, Benoît Thébaudeau
<benoit.thebaudeau@advansee.com> wrote:

> Great! So can you confirm that for my series, all I have to change is:
> #define CONFIG_SYS_NAND_U_BOOT_SIZE   0x32000

Yes, correct. This is the only change you need to do in your series.

> Did you also have a chance to test nand commands on mx53ard?

Not yet, will try this early next week.

Thanks for providing SPL NAND support for imx!

Regards,

Fabio Estevam
Marek Vasut - Feb. 22, 2013, 11:09 p.m.
Dear Troy Kisky,

> On 2/22/2013 1:09 PM, Benoît Thébaudeau wrote:
> > Hi Fabio,
> > 
> > On Friday, February 22, 2013 8:30:36 PM, Fabio Estevam wrote:
> >> On Fri, Feb 22, 2013 at 4:14 PM, Fabio Estevam <festevam@gmail.com> wrote:
> >>> Just tested your patch series on a mx31pdk, but unfortunately it does
> >>> not fix mx31pdk boot.
> >>> 
> >>> I will start looking at it, but any suggestion is welcome.
> >> 
> >> Ok, just changed to a proper toolchain and the result is a bit better
> >> now:
> >> 
> >> U-Boot 2013.01 (Feb 22 2013 - 16:25:48)
> >> 
> >> CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
> >> Reset cause: POR
> >> Board: MX31PDK
> >> DRAM:  128 MiB
> >> 
> >> (hangs here).
> > 
> > It looks very much like the issue that Marek had on i.MX53 (which
> > self-resolved for an unknown reason).
> > 
> > Try to enable the debug trace to see if anything else is printed after
> > 
> > display_dram_config(). I would especially be interested in:
> >          debug("relocation Offset is: %08lx\n", gd->reloc_off);
> >          debug("monitor flash len: %08lX\n", monitor_flash_len);
> > 
> > We should also check if CONFIG_SPL_TEXT_BASE and CONFIG_SYS_TEXT_BASE
> > don't overlap with something depending on code size. That's especially
> > true for CONFIG_SYS_TEXT_BASE.
> > 
> > After that, JTAG if no clue left... ;(
> > 
> > Best regards,
> > Benoît
> 
> It does look familiar, can you try changing imximage.c
> 
> 
> *header_size_ptr = ROUND(sbuf->st_size + imxhdr->flash_offset, 512);
> 
> to
> 
> *header_size_ptr = ROUND(sbuf->st_size + imxhdr->flash_offset, 4096);
> 
> (or whatever your nand sector size is)
> and see if it makes a difference?

This patch is needed for NAND boot on mx53. I still dont have the patches quite 
ready, but we can omit SPL on mx53 ;-)

Best regards,
Marek Vasut
Marek Vasut - Feb. 22, 2013, 11:11 p.m.
Dear Fabio Estevam,

> On Fri, Feb 22, 2013 at 7:42 PM, Benoît Thébaudeau
> 
> <benoit.thebaudeau@advansee.com> wrote:
> > Great! So can you confirm that for my series, all I have to change is:
> > #define CONFIG_SYS_NAND_U_BOOT_SIZE   0x32000
> 
> Yes, correct. This is the only change you need to do in your series.
> 
> > Did you also have a chance to test nand commands on mx53ard?
> 
> Not yet, will try this early next week.
> 
> Thanks for providing SPL NAND support for imx!

We won't need SPL on mx53, I pretty much have patches for mx53 NAND boot without 
SPL ready, just need some polishment.

Best regards,
Marek Vasut
Benoît Thébaudeau - Feb. 22, 2013, 11:12 p.m.
Dear Marek Vasut,

On Saturday, February 23, 2013 12:11:47 AM, Marek Vasut wrote:
> Dear Fabio Estevam,
> 
> > On Fri, Feb 22, 2013 at 7:42 PM, Benoît Thébaudeau
> > 
> > <benoit.thebaudeau@advansee.com> wrote:
> > > Great! So can you confirm that for my series, all I have to change is:
> > > #define CONFIG_SYS_NAND_U_BOOT_SIZE   0x32000
> > 
> > Yes, correct. This is the only change you need to do in your series.
> > 
> > > Did you also have a chance to test nand commands on mx53ard?
> > 
> > Not yet, will try this early next week.
> > 
> > Thanks for providing SPL NAND support for imx!
> 
> We won't need SPL on mx53, I pretty much have patches for mx53 NAND boot
> without
> SPL ready, just need some polishment.

Cool.

How did you omit the SPL? Are you using the FCB bad block feature to handle
these? Have you tested that it still works if your image spans several NAND
blocks among which are some bad blocks (with bad blocks having been skipped
while programming the image)?

Best regards,
Benoît
Marek Vasut - Feb. 22, 2013, 11:56 p.m.
Dear Benoît Thébaudeau,

> Dear Marek Vasut,
> 
> On Saturday, February 23, 2013 12:11:47 AM, Marek Vasut wrote:
> > Dear Fabio Estevam,
> > 
> > > On Fri, Feb 22, 2013 at 7:42 PM, Benoît Thébaudeau
> > > 
> > > <benoit.thebaudeau@advansee.com> wrote:
> > > > Great! So can you confirm that for my series, all I have to change
> > > > is: #define CONFIG_SYS_NAND_U_BOOT_SIZE   0x32000
> > > 
> > > Yes, correct. This is the only change you need to do in your series.
> > > 
> > > > Did you also have a chance to test nand commands on mx53ard?
> > > 
> > > Not yet, will try this early next week.
> > > 
> > > Thanks for providing SPL NAND support for imx!
> > 
> > We won't need SPL on mx53, I pretty much have patches for mx53 NAND boot
> > without
> > SPL ready, just need some polishment.
> 
> Cool.
> 
> How did you omit the SPL? Are you using the FCB bad block feature to handle
> these? Have you tested that it still works if your image spans several NAND
> blocks among which are some bad blocks (with bad blocks having been skipped
> while programming the image)?

My NAND is almost new by now, so I haven't.

Best regards,
Marek Vasut
Benoît Thébaudeau - Feb. 23, 2013, 12:55 a.m.
Dear Marek Vasut,

On Saturday, February 23, 2013 12:56:32 AM, Marek Vasut wrote:
> Dear Benoît Thébaudeau,
> 
> > Dear Marek Vasut,
> > 
> > On Saturday, February 23, 2013 12:11:47 AM, Marek Vasut wrote:
> > > Dear Fabio Estevam,
> > > 
> > > > On Fri, Feb 22, 2013 at 7:42 PM, Benoît Thébaudeau
> > > > 
> > > > <benoit.thebaudeau@advansee.com> wrote:
> > > > > Great! So can you confirm that for my series, all I have to change
> > > > > is: #define CONFIG_SYS_NAND_U_BOOT_SIZE   0x32000
> > > > 
> > > > Yes, correct. This is the only change you need to do in your series.
> > > > 
> > > > > Did you also have a chance to test nand commands on mx53ard?
> > > > 
> > > > Not yet, will try this early next week.
> > > > 
> > > > Thanks for providing SPL NAND support for imx!
> > > 
> > > We won't need SPL on mx53, I pretty much have patches for mx53 NAND boot
> > > without
> > > SPL ready, just need some polishment.
> > 
> > Cool.
> > 
> > How did you omit the SPL? Are you using the FCB bad block feature to handle
> > these? Have you tested that it still works if your image spans several NAND
> > blocks among which are some bad blocks (with bad blocks having been skipped
> > while programming the image)?
> 
> My NAND is almost new by now, so I haven't.

Sure, but you can still play with "nand markbad" (and with "nand scrub" for
cleanup after your tests) with BBT disabled (in order to avoid any assumption
regarding the possible handling of the BBT by the boot ROM since markbad only
updates the BBT if it is enabled). So here is the procedure that you could
follow:
 - Use "nand bad" to keep track of the initial true bad blocks (+ fake ones at
   the end of the NAND if you have enabled BBT).
 - Disable BBT if it was enabled (undefine CONFIG_SYS_NAND_USE_FLASH_BBT).
 - Use "nand markbad" to create some fake bad blocks (at least 1) at the
   location of your image.
 - Program your image skipping bad blocks.
 - Test your SPL-free boot.
 - Once done, use "nand scrub" to try to unmark bad blocks.
 - Use "nand markbad" to re-mark the true bad blocks as such.
 - Re-enable BBT in your code if you want to.

Best regards,
Benoît

Patch

diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
index 70551ec..1db1152 100644
--- a/arch/arm/cpu/arm926ejs/start.S
+++ b/arch/arm/cpu/arm926ejs/start.S
@@ -200,7 +200,6 @@  reset:
 
 /*------------------------------------------------------------------------------*/
 
-#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_NAND_SPL)
 /*
  * void relocate_code (addr_sp, gd, addr_moni)
  *
@@ -272,6 +271,8 @@  relocate_done:
 
 	bx	lr
 
+#ifndef CONFIG_SPL_BUILD
+
 _rel_dyn_start_ofs:
 	.word __rel_dyn_start - _start
 _rel_dyn_end_ofs:
diff --git a/board/freescale/mx31pdk/Makefile b/board/freescale/mx31pdk/Makefile
index 5b7cafd..b910722 100644
--- a/board/freescale/mx31pdk/Makefile
+++ b/board/freescale/mx31pdk/Makefile
@@ -27,6 +27,9 @@  include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(BOARD).o
 
+ifdef CONFIG_SPL_BUILD
+SOBJS	:= lowlevel_init.o
+endif
 COBJS	:= mx31pdk.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/board/freescale/mx31pdk/config.mk b/board/freescale/mx31pdk/config.mk
deleted file mode 100644
index de2c642..0000000
--- a/board/freescale/mx31pdk/config.mk
+++ /dev/null
@@ -1,5 +0,0 @@ 
-ifdef CONFIG_NAND_SPL
-CONFIG_SYS_TEXT_BASE = 0x87ec0000
-else
-CONFIG_SYS_TEXT_BASE = 0x87f00000
-endif
diff --git a/board/freescale/mx31pdk/mx31pdk.c b/board/freescale/mx31pdk/mx31pdk.c
index 895396c..df5d407 100644
--- a/board/freescale/mx31pdk/mx31pdk.c
+++ b/board/freescale/mx31pdk/mx31pdk.c
@@ -36,6 +36,14 @@ 
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifdef CONFIG_SPL_BUILD
+void board_init_f(ulong bootflag)
+{
+	relocate_code(0, NULL, CONFIG_SPL_TEXT_BASE);
+	asm volatile("ldr pc, =nand_boot\n");
+}
+#endif
+
 int dram_init(void)
 {
 	/* dram_init must store complete ramsize in gd->ram_size */
diff --git a/board/karo/tx25/Makefile b/board/karo/tx25/Makefile
index 9617fa5..c26bf36 100644
--- a/board/karo/tx25/Makefile
+++ b/board/karo/tx25/Makefile
@@ -25,8 +25,10 @@  include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(BOARD).o
 
-COBJS	:= tx25.o
+ifdef CONFIG_SPL_BUILD
 SOBJS	:= lowlevel_init.o
+endif
+COBJS	:= tx25.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
diff --git a/board/karo/tx25/config.mk b/board/karo/tx25/config.mk
deleted file mode 100644
index 18b2883..0000000
--- a/board/karo/tx25/config.mk
+++ /dev/null
@@ -1,5 +0,0 @@ 
-ifdef CONFIG_NAND_SPL
-CONFIG_SYS_TEXT_BASE = 0x810c0000
-else
-CONFIG_SYS_TEXT_BASE = 0x81200000
-endif
diff --git a/board/karo/tx25/tx25.c b/board/karo/tx25/tx25.c
index 362f00a..6058fbf 100644
--- a/board/karo/tx25/tx25.c
+++ b/board/karo/tx25/tx25.c
@@ -33,6 +33,14 @@ 
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifdef CONFIG_SPL_BUILD
+void board_init_f(ulong bootflag)
+{
+	relocate_code(0, NULL, CONFIG_SPL_TEXT_BASE);
+	asm volatile("ldr pc, =nand_boot\n");
+}
+#endif
+
 #ifdef CONFIG_FEC_MXC
 #define GPIO_FEC_RESET_B	IMX_GPIO_NR(4, 7)
 #define GPIO_FEC_ENABLE_B	IMX_GPIO_NR(4, 9)
diff --git a/boards.cfg b/boards.cfg
index 7d03620..2649c88 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -45,7 +45,7 @@  imx31_phycore                arm         arm1136     -                   -
 imx31_phycore_eet            arm         arm1136     imx31_phycore       -              mx31         imx31_phycore:IMX31_PHYCORE_EET
 qong                         arm         arm1136     -                   davedenx       mx31
 mx31ads                      arm         arm1136     -                   freescale      mx31
-mx31pdk                      arm         arm1136     -                   freescale      mx31         mx31pdk:NAND_U_BOOT
+mx31pdk                      arm         arm1136     -                   freescale      mx31
 tt01                         arm         arm1136     -                   hale           mx31
 imx31_litekit                arm         arm1136     -                   logicpd        mx31
 flea3                        arm         arm1136     -                   CarMediaLab    mx35
diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index c77c0c4..bcb7161 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -82,6 +82,7 @@  COBJS-$(CONFIG_NAND_PLAT) += nand_plat.o
 else  # minimal SPL drivers
 
 COBJS-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_spl.o
+COBJS-$(CONFIG_NAND_MXC) += mxc_nand_spl.o
 
 endif # drivers
 endif # nand
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index 001c2c0..159e3b4 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -26,7 +26,7 @@ 
 	defined(CONFIG_MX51) || defined(CONFIG_MX53)
 #include <asm/arch/imx-regs.h>
 #endif
-#include <fsl_nfc.h>
+#include "mxc_nand.h"
 
 #define DRIVER_NAME "mxc_nand"
 
@@ -36,9 +36,9 @@  struct mxc_nand_host {
 	struct mtd_info			mtd;
 	struct nand_chip		*nand;
 
-	struct fsl_nfc_regs __iomem	*regs;
+	struct mxc_nand_regs __iomem	*regs;
 #ifdef MXC_NFC_V3_2
-	struct fsl_nfc_ip_regs __iomem	*ip_regs;
+	struct mxc_nand_ip_regs __iomem	*ip_regs;
 #endif
 	int				spare_only;
 	int				status_request;
@@ -1254,10 +1254,10 @@  int board_nand_init(struct nand_chip *this)
 	this->read_buf = mxc_nand_read_buf;
 	this->verify_buf = mxc_nand_verify_buf;
 
-	host->regs = (struct fsl_nfc_regs __iomem *)CONFIG_MXC_NAND_REGS_BASE;
+	host->regs = (struct mxc_nand_regs __iomem *)CONFIG_MXC_NAND_REGS_BASE;
 #ifdef MXC_NFC_V3_2
 	host->ip_regs =
-		(struct fsl_nfc_ip_regs __iomem *)CONFIG_MXC_NAND_IP_REGS_BASE;
+		(struct mxc_nand_ip_regs __iomem *)CONFIG_MXC_NAND_IP_REGS_BASE;
 #endif
 	host->clk_act = 1;
 
diff --git a/include/fsl_nfc.h b/drivers/mtd/nand/mxc_nand.h
similarity index 98%
rename from include/fsl_nfc.h
rename to drivers/mtd/nand/mxc_nand.h
index 48a6448..308ff8d 100644
--- a/include/fsl_nfc.h
+++ b/drivers/mtd/nand/mxc_nand.h
@@ -20,8 +20,8 @@ 
  * MA 02111-1307 USA
  */
 
-#ifndef __FSL_NFC_H
-#define __FSL_NFC_H
+#ifndef __MXC_NAND_H
+#define __MXC_NAND_H
 
 /*
  * Register map and bit definitions for the Freescale NAND Flash Controller
@@ -73,7 +73,7 @@ 
 #define NAND_MXC_REG_OFFSET		0x1e00
 #endif
 
-struct fsl_nfc_regs {
+struct mxc_nand_regs {
 	u8 main_area[NAND_MXC_NR_BUFS][0x200];
 	u8 spare_area[NAND_MXC_NR_BUFS][NAND_MXC_SPARE_BUF_SIZE];
 	/*
@@ -131,7 +131,7 @@  struct fsl_nfc_regs {
 };
 
 #ifdef MXC_NFC_V3_2
-struct fsl_nfc_ip_regs {
+struct mxc_nand_ip_regs {
 	u32 wrprot;
 	u32 wrprot_unlock_blkaddr[8];
 	u32 config2;
@@ -222,4 +222,4 @@  struct fsl_nfc_ip_regs {
 #define writenfc	writel
 #endif
 
-#endif /* __FSL_NFC_H */
+#endif /* __MXC_NAND_H */
diff --git a/nand_spl/nand_boot_fsl_nfc.c b/drivers/mtd/nand/mxc_nand_spl.c
similarity index 92%
rename from nand_spl/nand_boot_fsl_nfc.c
rename to drivers/mtd/nand/mxc_nand_spl.c
index 1096727..09f23c3 100644
--- a/nand_spl/nand_boot_fsl_nfc.c
+++ b/drivers/mtd/nand/mxc_nand_spl.c
@@ -28,13 +28,13 @@ 
 #include <nand.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/io.h>
-#include <fsl_nfc.h>
+#include "mxc_nand.h"
 
 #if defined(MXC_NFC_V1) || defined(MXC_NFC_V2_1)
-static struct fsl_nfc_regs *const nfc = (void *)NFC_BASE_ADDR;
+static struct mxc_nand_regs *const nfc = (void *)NFC_BASE_ADDR;
 #elif defined(MXC_NFC_V3_2)
-static struct fsl_nfc_regs *const nfc = (void *)NFC_BASE_ADDR_AXI;
-static struct fsl_nfc_ip_regs *const nfc_ip = (void *)NFC_BASE_ADDR;
+static struct mxc_nand_regs *const nfc = (void *)NFC_BASE_ADDR_AXI;
+static struct mxc_nand_ip_regs *const nfc_ip = (void *)NFC_BASE_ADDR;
 #endif
 
 static void nfc_wait_ready(void)
@@ -68,7 +68,7 @@  static void nfc_nand_init(void)
 
 	tmp = (readnfc(&nfc_ip->config2) & ~(NFC_V3_CONFIG2_SPAS_MASK |
 			NFC_V3_CONFIG2_EDC_MASK | NFC_V3_CONFIG2_PS_MASK)) |
-		NFC_V3_CONFIG2_SPAS(CONFIG_SYS_NAND_SPARE_SIZE / 2) |
+		NFC_V3_CONFIG2_SPAS(CONFIG_SYS_NAND_OOBSIZE / 2) |
 		NFC_V3_CONFIG2_INT_MSK | NFC_V3_CONFIG2_ECC_EN |
 		NFC_V3_CONFIG2_ONE_CYCLE;
 	if (CONFIG_SYS_NAND_PAGE_SIZE == 4096)
@@ -81,7 +81,7 @@  static void nfc_nand_init(void)
 	 * if spare size is larger that 16 bytes per 512 byte hunk
 	 * then use 8 symbol correction instead of 4
 	 */
-	if (CONFIG_SYS_NAND_SPARE_SIZE / ecc_per_page > 16)
+	if (CONFIG_SYS_NAND_OOBSIZE / ecc_per_page > 16)
 		tmp |= NFC_V3_CONFIG2_ECC_MODE_8;
 	else
 		tmp &= ~NFC_V3_CONFIG2_ECC_MODE_8;
@@ -102,7 +102,7 @@  static void nfc_nand_init(void)
 	int ecc_per_page = CONFIG_SYS_NAND_PAGE_SIZE / 512;
 	int config1;
 
-	writenfc(CONFIG_SYS_NAND_SPARE_SIZE / 2, &nfc->spare_area_size);
+	writenfc(CONFIG_SYS_NAND_OOBSIZE / 2, &nfc->spare_area_size);
 
 	/* unlocking RAM Buff */
 	writenfc(0x2, &nfc->config);
@@ -115,7 +115,7 @@  static void nfc_nand_init(void)
 	 * if spare size is larger that 16 bytes per 512 byte hunk
 	 * then use 8 symbol correction instead of 4
 	 */
-	if (CONFIG_SYS_NAND_SPARE_SIZE / ecc_per_page > 16)
+	if (CONFIG_SYS_NAND_OOBSIZE / ecc_per_page > 16)
 		config1 &= ~NFC_V2_CONFIG1_ECC_MODE_4;
 	else
 		config1 |= NFC_V2_CONFIG1_ECC_MODE_4;
@@ -204,7 +204,7 @@  static int nfc_nand_check_ecc(void)
 #elif defined(MXC_NFC_V2_1) || defined(MXC_NFC_V3_2)
 	u32 ecc_status = readl(&nfc->ecc_status_result);
 	int ecc_per_page = CONFIG_SYS_NAND_PAGE_SIZE / 512;
-	int err_limit = CONFIG_SYS_NAND_SPARE_SIZE / ecc_per_page > 16 ? 8 : 4;
+	int err_limit = CONFIG_SYS_NAND_OOBSIZE / ecc_per_page > 16 ? 8 : 4;
 	int subpages = CONFIG_SYS_NAND_PAGE_SIZE / 512;
 
 	do {
@@ -332,14 +332,6 @@  static int nand_load(unsigned int from, unsigned int size, unsigned char *buf)
 	return 0;
 }
 
-#if defined(CONFIG_ARM)
-void board_init_f (ulong bootflag)
-{
-	relocate_code (CONFIG_SYS_TEXT_BASE - TOTAL_MALLOC_LEN, NULL,
-		       CONFIG_SYS_TEXT_BASE);
-}
-#endif
-
 /*
  * The main entry for NAND booting. It's necessary that SDRAM is already
  * configured and available since this code loads the main U-Boot image
diff --git a/include/configs/mx31pdk.h b/include/configs/mx31pdk.h
index 34e4295..d80a43e 100644
--- a/include/configs/mx31pdk.h
+++ b/include/configs/mx31pdk.h
@@ -45,7 +45,16 @@ 
 
 #define CONFIG_MACH_TYPE	MACH_TYPE_MX31_3DS
 
-#if defined(CONFIG_NAND_U_BOOT) && !defined(CONFIG_NAND_SPL)
+#define CONFIG_SPL
+#define CONFIG_SPL_TARGET	"u-boot-with-spl.bin"
+#define CONFIG_SPL_LDSCRIPT	"arch/$(ARCH)/cpu/u-boot.lds"
+#define CONFIG_SPL_MAX_SIZE	2048
+#define CONFIG_SPL_NAND_SUPPORT
+
+#define CONFIG_SPL_TEXT_BASE	0x87ec0000
+#define CONFIG_SYS_TEXT_BASE	0x87f00000
+
+#ifndef CONFIG_SPL_BUILD
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #endif
 
@@ -163,7 +172,7 @@ 
 #define CONFIG_SYS_GBL_DATA_OFFSET	(CONFIG_SYS_INIT_RAM_SIZE - \
 						GENERATED_GBL_DATA_SIZE)
 #define CONFIG_SYS_INIT_SP_ADDR	(CONFIG_SYS_INIT_RAM_ADDR + \
-						CONFIG_SYS_GBL_DATA_OFFSET)
+						CONFIG_SYS_INIT_RAM_SIZE)
 
 /*-----------------------------------------------------------------------
  * FLASH and environment organization
@@ -189,10 +198,10 @@ 
 /* NAND configuration for the NAND_SPL */
 
 /* Start copying real U-boot from the second page */
-#define CONFIG_SYS_NAND_U_BOOT_OFFS	0x800
+#define CONFIG_SYS_NAND_U_BOOT_OFFS	CONFIG_SPL_MAX_SIZE
 #define CONFIG_SYS_NAND_U_BOOT_SIZE	0x30000
 /* Load U-Boot to this address */
-#define CONFIG_SYS_NAND_U_BOOT_DST	0x87f00000
+#define CONFIG_SYS_NAND_U_BOOT_DST	CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_NAND_U_BOOT_DST
 
 #define CONFIG_SYS_NAND_PAGE_SIZE	0x800
diff --git a/include/configs/tx25.h b/include/configs/tx25.h
index 80194d8..df69beb 100644
--- a/include/configs/tx25.h
+++ b/include/configs/tx25.h
@@ -21,6 +21,7 @@ 
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#include <asm/arch/imx-regs.h>
 
 /*
  * KARO TX25 board - SoC Configuration
@@ -31,8 +32,14 @@ 
 
 #define	CONFIG_SYS_MONITOR_LEN		(256 << 10)	/* 256 kB for U-Boot */
 
-/* NAND BOOT is the only boot method */
-#define CONFIG_NAND_U_BOOT
+#define CONFIG_SPL
+#define CONFIG_SPL_TARGET		"u-boot-with-spl.bin"
+#define CONFIG_SPL_LDSCRIPT		"arch/$(ARCH)/cpu/u-boot.lds"
+#define CONFIG_SPL_MAX_SIZE		2048
+#define CONFIG_SPL_NAND_SUPPORT
+
+#define CONFIG_SPL_TEXT_BASE		0x810c0000
+#define CONFIG_SYS_TEXT_BASE		0x81200000
 
 #ifndef MACH_TYPE_TX25
 #define MACH_TYPE_TX25	2177
@@ -40,16 +47,16 @@ 
 
 #define CONFIG_MACH_TYPE MACH_TYPE_TX25
 
-#ifdef CONFIG_NAND_SPL
+#ifdef CONFIG_SPL_BUILD
 /* Start copying real U-boot from the second page */
-#define CONFIG_SYS_NAND_U_BOOT_OFFS	0x800
+#define CONFIG_SYS_NAND_U_BOOT_OFFS	CONFIG_SPL_MAX_SIZE
 #define CONFIG_SYS_NAND_U_BOOT_SIZE	0x30000
 
-#define CONFIG_SYS_NAND_U_BOOT_DST      (0x81200000)
+#define CONFIG_SYS_NAND_U_BOOT_DST      CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_NAND_U_BOOT_START    CONFIG_SYS_NAND_U_BOOT_DST
 
 #define CONFIG_SYS_NAND_PAGE_SIZE	2048
-#define CONFIG_SYS_NAND_SPARE_SIZE	64
+#define CONFIG_SYS_NAND_OOBSIZE		64
 #define CONFIG_SYS_NAND_BLOCK_SIZE	(128 * 1024)
 #define CONFIG_SYS_NAND_PAGE_COUNT	64
 #define CONFIG_SYS_NAND_SIZE		(128 * 1024 * 1024)
@@ -173,7 +180,6 @@ 
 
 /* additions for new relocation code, must be added to all boards */
 #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
-#define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_SDRAM_BASE + 0x1000 - /* Fix this */ \
-					GENERATED_GBL_DATA_SIZE)
+#define CONFIG_SYS_INIT_SP_ADDR		(IMX_RAM_BASE + IMX_RAM_SIZE)
 
 #endif /* __CONFIG_H */
diff --git a/nand_spl/board/freescale/mx31pdk/Makefile b/nand_spl/board/freescale/mx31pdk/Makefile
deleted file mode 100644
index fd0dfc1..0000000
--- a/nand_spl/board/freescale/mx31pdk/Makefile
+++ /dev/null
@@ -1,68 +0,0 @@ 
-CONFIG_NAND_SPL	= y
-PAD_TO	:= 2048
-
-include $(TOPDIR)/config.mk
-
-nandobj	:= $(OBJTREE)/nand_spl/
-
-LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
-LSTSCRIPT= $(nandobj)/board/$(BOARDDIR)/u-boot.lst
-LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
-	   $(LDFLAGS_FINAL)
-AFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
-CFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
-
-SOBJS	= start.o crt0.o lowlevel_init.o
-COBJS	= nand_boot_fsl_nfc.o
-
-SRCS	:= $(SRCTREE)/nand_spl/nand_boot_fsl_nfc.c
-SRCS	+= $(SRCTREE)/arch/arm/cpu/arm1136/start.S
-SRCS	+= $(SRCTREE)/arch/arm/lib/crt0.S
-SRCS	+= $(SRCTREE)/board/freescale/mx31pdk/lowlevel_init.S
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-__OBJS	:= $(SOBJS) $(COBJS)
-LNDIR	:= $(nandobj)board/$(BOARDDIR)
-
-ALL	= $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
-
-all:	$(obj).depend $(ALL)
-
-$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
-	$(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
-
-$(nandobj)u-boot-spl.bin:	$(nandobj)u-boot-spl
-	$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
-
-$(nandobj)u-boot-spl:	$(OBJS) $(nandobj)u-boot.lds
-	cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \
-		-Map $(nandobj)u-boot-spl.map \
-		-o $@
-
-# The following line expands into whole rule which generates $(LSTSCRIPT),
-# the file containing u-boots LG-array linker section. This is included into
-# $(LDSCRIPT). The function make_u_boot_list is defined in helper.mk file.
-$(eval $(call make_u_boot_list, $(LSTSCRIPT), $(OBJS)))
-$(nandobj)u-boot.lds: $(LDSCRIPT) $(LSTSCRIPT)
-	$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(nandobj)/board/$(BOARDDIR) \
-		-ansi -D__ASSEMBLY__ -P - <$< >$@
-
-#########################################################################
-
-$(obj)%.o:	$(SRCTREE)/arch/arm/cpu/arm1136/%.S
-	$(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o:	$(SRCTREE)/arch/arm/lib/%.S
-	$(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o:	$(SRCTREE)/board/freescale/mx31pdk/%.S
-	$(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o:	$(SRCTREE)/nand_spl/%.c
-	$(CC) $(CFLAGS) -c -o $@ $<
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
diff --git a/nand_spl/board/freescale/mx31pdk/u-boot.lds b/nand_spl/board/freescale/mx31pdk/u-boot.lds
deleted file mode 100644
index a26110f..0000000
--- a/nand_spl/board/freescale/mx31pdk/u-boot.lds
+++ /dev/null
@@ -1,87 +0,0 @@ 
-/*
- * (C) Copyright 2009
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * 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
- */
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-ENTRY(_start)
-SECTIONS
-{
-	. = 0x00000000;
-
-	. = ALIGN(4);
-	.text :
-	{
-		start.o			(.text)
-		lowlevel_init.o		(.text)
-		nand_boot_fsl_nfc.o	(.text)
-		*(.text)
-		. = 2K;
-	}
-
-	. = ALIGN(4);
-	.rodata : { *(.rodata) }
-
-	. = ALIGN(4);
-	.data : {
-		*(.data)
-	}
-
-	. = ALIGN(4);
-
-	. = ALIGN(4);
-	.u_boot_list : {
-		#include <u-boot.lst>
-	}
-
-	. = ALIGN(4);
-
-	__image_copy_end = .;
-
-	.rel.dyn : {
-		__rel_dyn_start = .;
-		*(.rel*)
-		__rel_dyn_end = .;
-	}
-
-	.dynsym : {
-		__dynsym_start = .;
-		*(.dynsym)
-	}
-
-	_end = .;
-
-	.bss __rel_dyn_start (OVERLAY) : {
-		__bss_start = .;
-		*(.bss)
-		 . = ALIGN(4);
-		__bss_end__ = .;
-	}
-
-	/DISCARD/ : { *(.bss*) }
-	/DISCARD/ : { *(.dynstr*) }
-	/DISCARD/ : { *(.dynsym*) }
-	/DISCARD/ : { *(.dynamic*) }
-	/DISCARD/ : { *(.hash*) }
-	/DISCARD/ : { *(.plt*) }
-	/DISCARD/ : { *(.interp*) }
-	/DISCARD/ : { *(.gnu*) }
-}
diff --git a/nand_spl/board/karo/tx25/Makefile b/nand_spl/board/karo/tx25/Makefile
deleted file mode 100644
index 82489d2..0000000
--- a/nand_spl/board/karo/tx25/Makefile
+++ /dev/null
@@ -1,89 +0,0 @@ 
-#
-# (C) Copyright 2009 DENX Software Engineering
-#
-# 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 Foundatio; 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
-#
-CONFIG_NAND_SPL	= y
-
-include $(TOPDIR)/config.mk
-include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
-
-nandobj	:= $(OBJTREE)/nand_spl/
-
-LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
-LSTSCRIPT= $(nandobj)/board/$(BOARDDIR)/u-boot.lst
-LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
-	   $(LDFLAGS_FINAL)
-AFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
-CFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
-
-SOBJS	= start.o crt0.o lowlevel_init.o
-COBJS	= nand_boot_fsl_nfc.o
-
-SRCS	:= $(SRCTREE)/nand_spl/nand_boot_fsl_nfc.c
-SRCS	+= $(SRCTREE)/arch/arm/cpu/arm926ejs/start.S
-SRCS	+= $(SRCTREE)/arch/arm/lib/crt0.S
-SRCS	+= $(SRCTREE)/board/karo/tx25/lowlevel_init.S
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-__OBJS	:= $(SOBJS) $(COBJS)
-LNDIR	:= $(nandobj)board/$(BOARDDIR)
-
-ALL	= $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
-
-all:	$(obj).depend $(ALL)
-
-$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
-	$(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
-
-$(nandobj)u-boot-spl.bin:	$(nandobj)u-boot-spl
-	$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
-
-$(nandobj)u-boot-spl:	$(OBJS) $(nandobj)u-boot.lds
-	cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \
-		-Map $(nandobj)u-boot-spl.map \
-		-o $@
-
-# The following line expands into whole rule which generates $(LSTSCRIPT),
-# the file containing u-boots LG-array linker section. This is included into
-# $(LDSCRIPT). The function make_u_boot_list is defined in helper.mk file.
-$(eval $(call make_u_boot_list, $(LSTSCRIPT), $(OBJS)))
-$(nandobj)u-boot.lds: $(LDSCRIPT) $(LSTSCRIPT)
-	$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(nandobj)/board/$(BOARDDIR) \
-		-ansi -D__ASSEMBLY__ -P - <$< >$@
-
-#########################################################################
-
-$(obj)%.o:	$(SRCTREE)/arch/arm/cpu/arm926ejs/%.S
-	$(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o:	$(SRCTREE)/arch/arm/lib/%.S
-	$(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o:	$(SRCTREE)/board/karo/tx25/%.S
-	$(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o:	$(SRCTREE)/nand_spl/%.c
-	$(CC) $(CFLAGS) -c -o $@ $<
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
diff --git a/nand_spl/board/karo/tx25/config.mk b/nand_spl/board/karo/tx25/config.mk
deleted file mode 100644
index 68afbf1..0000000
--- a/nand_spl/board/karo/tx25/config.mk
+++ /dev/null
@@ -1 +0,0 @@ 
-PAD_TO	:= 2048
diff --git a/nand_spl/board/karo/tx25/u-boot.lds b/nand_spl/board/karo/tx25/u-boot.lds
deleted file mode 100644
index 95ea8ac..0000000
--- a/nand_spl/board/karo/tx25/u-boot.lds
+++ /dev/null
@@ -1,87 +0,0 @@ 
-/*
- * (C) Copyright 2009
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * 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
- */
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-ENTRY(_start)
-SECTIONS
-{
-	. = 0x00000000;
-
-	. = ALIGN(4);
-	.text :
-	{
-		start.o			(.text)
-		lowlevel_init.o		(.text)
-		nand_boot_fsl_nfc.o	(.text)
-		*(.text)
-		. = 2K;
-	}
-
-	. = ALIGN(4);
-	.rodata : { *(.rodata) }
-
-	. = ALIGN(4);
-	.data : {
-		*(.data)
-	}
-
-	. = ALIGN(4);
-
-	. = ALIGN(4);
-	.u_boot_list : {
-	#include <u-boot.lst>
-	}
-
-	. = ALIGN(4);
-
-	__image_copy_end = .;
-
-	.rel.dyn : {
-		__rel_dyn_start = .;
-		*(.rel*)
-		__rel_dyn_end = .;
-	}
-
-	.dynsym : {
-		__dynsym_start = .;
-		*(.dynsym)
-	}
-
-	_end = .;
-
-	.bss __rel_dyn_start (OVERLAY) : {
-		__bss_start = .;
-		*(.bss)
-		 . = ALIGN(4);
-		__bss_end__ = .;
-	}
-
-	/DISCARD/ : { *(.bss*) }
-	/DISCARD/ : { *(.dynstr*) }
-	/DISCARD/ : { *(.dynsym*) }
-	/DISCARD/ : { *(.dynamic*) }
-	/DISCARD/ : { *(.hash*) }
-	/DISCARD/ : { *(.plt*) }
-	/DISCARD/ : { *(.interp*) }
-	/DISCARD/ : { *(.gnu*) }
-}