Re: [U-Boot] [PATCH v4 1/5] x86: Add a target for running as a coreboot payload

2011-11-17 Thread Alan Carvalho de Assis
On 11/17/11, Graeme Russ graeme.r...@gmail.com wrote:
 Hi Gabe,


[snip]

 I don't follow. I'm not referencing it, that's what we're calling our
 board
 since it's an x86 chromebook.

 I mean, if this is 'generic', why is there a reference to the chromebook?


I think a name like coreboot-x86 could make sense here, but it
shouldn't have dependence on drivers specific for chromebook hardware.
Only 'generic' drivers as vesa video and keyboard input needs to be
referenced on it. Then others developers could extend it to their
specific hardware, adding items like ethernet, mmc/sd driver, etc

Best Regards,

Alan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Debugging u-boot with bdi3000 basics

2010-05-27 Thread Alan Carvalho de Assis
Dear Wolfgang Denk,

Yes, it is true.

Currently only for ARMs and i386.

Best Regards,

Alan

On 5/27/10, Wolfgang Denk w...@denx.de wrote:
 Dear Alan Carvalho de Assis,

 In message aanlktik4fypdak9bhvkzrndmvuyccg-xdabqtkqyz...@mail.gmail.com
 you wrote:
 Hi Mark,

 On 5/27/10, Mark Fanara mark.fan...@gmail.com wrote:
 ...
 
  2) I am using a bdi3000. Is there no way to build u-boot so that it is
  directly loaded to RAM by the debugger and does not relocate itself?
 

 #define CONFIG_SKIP_RELOCATE_UBOOT

 Note that this doesn't exist on ll architectures. For example on
 PowerPC, we will always relocate.

 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: w...@denx.de
 Die ganzen Zahlen hat der liebe Gott  geschaffen,  alles  andere  ist
 Menschenwerk... Leopold Kronecker

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Debugging u-boot with bdi3000 basics

2010-05-26 Thread Alan Carvalho de Assis
Hi Mark,

On 5/27/10, Mark Fanara mark.fan...@gmail.com wrote:
...

 2) I am using a bdi3000. Is there no way to build u-boot so that it is
 directly loaded to RAM by the debugger and does not relocate itself?


#define CONFIG_SKIP_RELOCATE_UBOOT

BRs,

Alan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Ethernet over USB using PXA320

2010-04-26 Thread Alan Carvalho de Assis
Hi Thad,

On 4/26/10, Thad Phetteplace tdphe...@gmail.com wrote:
 I'm working on a board based on the PXA320 Zylonite reference board and
 attempting to get Ethernet via USB support working in u-boot.  From what I
 can tell so far, this is not yet well supported in the u-boot mainline.
 I've been looking at the u-boot-usb branch but its been slow going.  Can
 anyone point me at a particular driver or board that would make a good
 starting point?  What success has there been in using USB attached Ethernet
 dongles with u-boot?

 I apologize if this is well documented somewhere.  I've been searching the
 archives and digging through source code, but I could use a nudge in the
 right direction to speed things along.


Did you see that:
http://free-electrons.com/blog/usbeth/

I hope it help you.

Best Regards,

Alan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] I am maintainer of Freescale i.MX

2009-09-28 Thread Alan Carvalho de Assis
Hi Fred,

On 9/28/09, Fan YeFeng-R01011 r01...@freescale.com wrote:
 Dear Wolfgang Denk,
   I prefer to use fanyef...@gmail.com. What is my ssh key?
 Does it ssh key related with my computer system?

Please, take a look on this page:

http://www.sshkeychain.org/mirrors/SSH-with-Keys-HOWTO/

Best Regards,

Alan

 -Original Message-
 From: Wolfgang Denk [mailto:w...@denx.de]
 Sent: Wednesday, September 23, 2009 2:10 AM
 To: Fred Fan
 Cc: Tom; u-boot@lists.denx.de; Fan YeFeng-R01011; Estevam Fabio-R49496;
 Kline Paul-R3AADA; Herring Robert-RA7055; Gopi Rajesh-R80039
 Subject: Re: I am maintainer of Freescale i.MX

 Dear Fred,

 In message 2f495dc80909170830j7acdd1b0j4e4d27e60af06...@mail.gmail.com
 you wrote:

  I am u-boot maintainer of Freescale i.MX team.
  I have two mail accounts:

 Thanks for volunteering to become the custodian for the i.MX support in
 U-Boot.

 Please send me your SSH private key, and I will set up a repository for
 you.

 fanyef...@gmail.com and r01...@freescale.com.
  I will use both of them.

 That's fine. Your identification for the git repository is through your
 SSH key. Which address do you prefer when sending mail to the i.MX
 custodian?


 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: w...@denx.de
 Perl itself is  usually  pretty  good  about  telling  you  what  you
 shouldn't do. :-) - Larry Wall in 11...@jpl-devvax.jpl.nasa.gov

 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Subject: [PATCH v3] mx27ads: add support for iMX27ADS board from Freescale

2009-09-22 Thread Alan Carvalho de Assis
Hi Fred,

Thank you for your fast reply, please see my comments below:

On 9/21/09, Fred Fan fanyef...@gmail.com wrote:
 Dear Alan Carvalho de Assis,

 2009/9/16 Alan Carvalho de Assis acas...@gmail.com

 +   /*
 +* DDR on CSD0
 +*/
 +   write32 0xD8001010, 0x0008
 +   write32 0x10027828, 0x
 +   write32 0x10027830, 0x
 +   write32 0x10027834, 0x
 +   write32 0x10027838, 0x5005
 +   write32 0x1002783C, 0x1555
 +   write32 0xD8001010, 0x0004
 +   write32 0xD8001004, 0x006ac73a
 +   write32 0xD8001000, 0x9210
 +   write32 0xAF00, 0x
 +   write32 0xD8001000, 0xA210
 +   write32 0xAF00, 0x
 +   write32 0xAF00, 0x
 +   write32 0xAF00, 0x
 +   write32 0xAF00, 0x
 +   write32 0xD8001000, 0xA220
 +   write32 0xAF00, 0x
 +   write32 0xAF00, 0x
 +   write32 0xAF00, 0x
 +   write32 0xAF00, 0x
 +   write32 0xD8001000, 0xb210

 +   ldr r0, =0xA033
 +   mov r1, #0xda
 +   strbr1, [r0]
 +   ldr r0, =0xA100
 +   mov r1, #0xff
 +   strbr1, [r0]
 +   write32 0xD8001000, 0x82226080

 Please use the friendly register definition.

I based on U-Boot-v2 start-up code.
Where should I place these registers definition? (could be in
include/asm-arm/arch-mx27/imx-regs.h ?)

 +*
 +* FIXME: Using the 399*2 MHz values from table 3-8 doens't work
 +*with 1.2 V core voltage! Find out if this is
 +*documented somewhere.
 +*/
 +   write32 MPCTL0, 0x1EF15D5   /* MPLL = 199.5*2 MHz
 */
 +   write32 SPCTL0, 0x043A1C09  /* SPLL = FIXME (needs review)
  */

  I will check the setting in another mail.


Sure, I will wait for it.

 +   /* clock gating enable */
 +   write32 0x10027818, 0x00050f08
 +

 ditto


ACK

 +
 +   /* skip sdram initialization if we run from ram */
 +   cmp pc, #0xa000
 +   bls 1f
 +   cmp pc, #0xc000
 +   bhi 1f

 Please use the definitions of ddr area.


Ok

 +int board_init(void)
 +{
 +   struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE;
 +
 +   gd-bd-bi_arch_number = MACH_TYPE_MX27ADS;
 +   gd-bd-bi_boot_params = PHYS_SDRAM_1 + 0x100;

 move bi_boot_params to dram_init.


Ok

 +/*
 + * Ethernet
 + */
 +#define CONFIG_FEC_MXC
 +#define CONFIG_FEC_MXC_PHYADDR 0x1f
 +#define CONFIG_MII
 +#define CONFIG_NET_MULTI
 +
 +/*#define CONFIG_DRIVER_CS89001
 +#define CS8900_BASE 0xD4020300
 +#define CS8900_BUS161*/

 Remove commented code.


I will active this commented lines, I think it just need another
ETHADDR to work.

 +#define CONFIG_ETHADDR 02:80:ad:20:31:e8

Thank you Fred, I am glad to see more Freescale guys helping
open-source projects.

Best Regards,

Alan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] mx27ads: add support for iMX27ADS board from Freescale

2009-09-18 Thread Alan Carvalho de Assis
Hi Javier,

On 9/17/09, javier Martin javier.mar...@vista-silicon.com wrote:
 Has anyone tested ethernet connection in this board?


yes, it is working fine!

Best Regards,

Alan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] mx27ads: add support for iMX27ADS board from Freescale

2009-09-15 Thread Alan Carvalho de Assis
ping

On 9/9/09, Alan Carvalho de Assis acas...@gmail.com wrote:
 This patch adds support to iMX27ADS development board. This board has
 128MB RAM, 32MB NOR Flash and 128MB NAND Flash. Currently only
 booting from NOR is supported.

 Signed-off-by: Alan Carvalho de Assis acas...@gmail.com
 ---
  MAINTAINERS |3 +
  MAKEALL |1 +
  Makefile|3 +
  board/freescale/mx27ads/Makefile|   51 
  board/freescale/mx27ads/config.mk   |1 +
  board/freescale/mx27ads/lowlevel_init.S |  128 +++
  board/freescale/mx27ads/mx27ads.c   |   93 ++
  board/freescale/mx27ads/u-boot.lds  |   56 +
  include/configs/mx27ads.h   |  202
 +++
  9 files changed, 538 insertions(+), 0 deletions(-)
  create mode 100644 board/freescale/mx27ads/Makefile
  create mode 100644 board/freescale/mx27ads/config.mk
  create mode 100644 board/freescale/mx27ads/lowlevel_init.S
  create mode 100644 board/freescale/mx27ads/mx27ads.c
  create mode 100644 board/freescale/mx27ads/u-boot.lds
  create mode 100644 include/configs/mx27ads.h

 diff --git a/MAINTAINERS b/MAINTAINERS
 index e9db278..5b25188 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
 @@ -550,6 +550,9 @@ Thomas Elste i...@elste.org

   modnet50ARM720T (NET+50)

 +Alan Carvalho de Assis acas...@gmail.com
 + mx27ads i.MX27
 +
  Fabio Estevam fabio.este...@freescale.com

   mx31pdk i.MX31
 diff --git a/MAKEALL b/MAKEALL
 index f0ed8ea..8411eef 100755
 --- a/MAKEALL
 +++ b/MAKEALL
 @@ -520,6 +520,7 @@ LIST_ARM9=   \
   cp926ejs\
   cp946es \
   cp966   \
 + mx27ads \
   imx27lite   \
   lpd7a400\
   mv88f6281gtw_ge \
 diff --git a/Makefile b/Makefile
 index 0449a5b..6fa4b28 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -2961,6 +2961,9 @@ davinci_dm365evm_config :   unconfig
  imx27lite_config:unconfig
   @$(MKCONFIG) $(@:_config=) arm arm926ejs imx27lite logicpd mx27

 +mx27ads_config : unconfig
 + @$(MKCONFIG) $(@:_config=) arm arm926ejs mx27ads freescale mx27
 +
  lpd7a400_config \
  lpd7a404_config: unconfig
   @$(MKCONFIG) $(@:_config=) arm lh7a40x lpd7a40x
 diff --git a/board/freescale/mx27ads/Makefile
 b/board/freescale/mx27ads/Makefile
 new file mode 100644
 index 000..d142a9e
 --- /dev/null
 +++ b/board/freescale/mx27ads/Makefile
 @@ -0,0 +1,51 @@
 +#
 +# (C) Copyright 2000-2004
 +# Wolfgang Denk, DENX Software Engineering, w...@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
 +#
 +
 +include $(TOPDIR)/config.mk
 +
 +LIB  = $(obj)lib$(BOARD).a
 +
 +COBJS:= mx27ads.o
 +SOBJS:= lowlevel_init.o
 +
 +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 +OBJS := $(addprefix $(obj),$(COBJS))
 +SOBJS:= $(addprefix $(obj),$(SOBJS))
 +
 +$(LIB):  $(obj).depend $(OBJS) $(SOBJS)
 + $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
 +
 +clean:
 + rm -f $(SOBJS) $(OBJS)
 +
 +distclean:   clean
 + rm -f $(LIB) core *.bak $(obj).depend
 +
 +#
 +
 +include $(SRCTREE)/rules.mk
 +
 +sinclude $(obj).depend
 +
 +#
 +
 diff --git a/board/freescale/mx27ads/config.mk
 b/board/freescale/mx27ads/config.mk
 new file mode 100644
 index 000..a2e7768
 --- /dev/null
 +++ b/board/freescale/mx27ads/config.mk
 @@ -0,0 +1 @@
 +TEXT_BASE = 0xA7F0
 diff --git a/board/freescale/mx27ads/lowlevel_init.S
 b/board/freescale/mx27ads/lowlevel_init.S
 new file mode 100644
 index 000..a4e1191
 --- /dev/null
 +++ b/board/freescale/mx27ads/lowlevel_init.S
 @@ -0,0 +1,128 @@
 +/*
 + * Copyright (C) 2008, Guennadi Liakhovetski l...@denx.de
 + *
 + * 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

Re: [U-Boot] [PATCH v2] mx27ads: add support for iMX27ADS board from Freescale

2009-09-15 Thread Alan Carvalho de Assis
Hi Denk,

On 9/15/09, Wolfgang Denk w...@denx.de wrote:
 Dear Alan Carvalho de Assis,

 In message 37367b3a0909150513o76ed5842u4ce717b535f0a...@mail.gmail.com you
 wrote:
 ping

 You may (or may not  have  noticed)  that  we  have  reorganized  the
 custodians  for  ARM  systems in the meantime. By now, Tom Rix is the
 responsible custodian who is supposed to pick up this patch (assuming
 there are no pending review comments for it).

 AFAIK, Tom is on vacation this week, and I'm not sure if he has
 network connectivity and/or time to work on this.


Sure, thank you very much.

Best Regards,

Alan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] mx27ads: add support for iMX27ADS board from Freescale

2009-09-15 Thread Alan Carvalho de Assis
Hi Magnus,

On 9/15/09, Magnus Lilja lilja.mag...@gmail.com wrote:
 Hi

 Some minor below.

 Alan Carvalho de Assis skrev:
...
 +#include config.h
 +#include asm/macro.h
 +#include asm/arch/imx-regs.h
 +#include asm/arch/asm-offsets.h
 +
 +.macro sdram_init
 +/*
 + * DDR on CSD0
 + */
 +write32 0xD8001010 0x0008

 I would insert a comma (,) after the first argument to the macro. Didn't
 know it worked without.
 The same comment applies to the rest of this file. Don't know what the
 U-boot coding standard says about this though.


Hmm, I think I based on other example. Need I to replace it?

 +/* peripheral clock divider */
 +write32 PCDR0 0x120470C3/* FIXME*/
 +write32 PCDR1 0x03030303/* PERDIV1=08 @133 MHz  */
 +/* PERDIV1=04 @266 MHz  *
 + * /

 The last line with '* /' looks a bit odd compated to the other comments.


I will remove this extra space

 +/*
 + * Ethernet
 + */
 +#define CONFIG_FEC_MXC
 +#define CONFIG_FEC_MXC_PHYADDR  0x1f
 +#define CONFIG_MII
 +#define CONFIG_NET_MULTI
 +
 +/*#define CONFIG_DRIVER_CS89001
 +#define CS8900_BASE 0xD4020300
 +#define CS8900_BUS161*/

 Does the board have a CS8900 as well?


Yes, it has. But it is not working correctly, then I just let it commented out.

Best Regards,

Alan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Subject: [PATCH v3] mx27ads: add support for iMX27ADS board from Freescale

2009-09-15 Thread Alan Carvalho de Assis
This patch adds support to iMX27ADS development board. This board has
128MB RAM, 32MB NOR Flash and 128MB NAND Flash. Currently only
booting from NOR is supported.

Signed-off-by: Alan Carvalho de Assis acas...@gmail.com
---
 MAINTAINERS |3 +
 MAKEALL |1 +
 Makefile|3 +
 board/freescale/mx27ads/Makefile|   51 
 board/freescale/mx27ads/config.mk   |1 +
 board/freescale/mx27ads/lowlevel_init.S |  127 +++
 board/freescale/mx27ads/mx27ads.c   |   93 ++
 board/freescale/mx27ads/u-boot.lds  |   56 +
 include/configs/mx27ads.h   |  202 +++
 9 files changed, 537 insertions(+), 0 deletions(-)
 create mode 100644 board/freescale/mx27ads/Makefile
 create mode 100644 board/freescale/mx27ads/config.mk
 create mode 100644 board/freescale/mx27ads/lowlevel_init.S
 create mode 100644 board/freescale/mx27ads/mx27ads.c
 create mode 100644 board/freescale/mx27ads/u-boot.lds
 create mode 100644 include/configs/mx27ads.h

diff --git a/MAINTAINERS b/MAINTAINERS
index e9db278..7ff3160 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -512,6 +512,9 @@ Unknown / orphaned boards:
 #  Board   CPU #
 #

+Alan Carvalho de Assis acas...@gmail.com
+   mx27ads i.MX27
+
 Rowel Atienza ro...@diwalabs.com

armadillo   ARM720T
diff --git a/MAKEALL b/MAKEALL
index f0ed8ea..56b4446 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -525,6 +525,7 @@ LIST_ARM9= \
mv88f6281gtw_ge \
mx1ads  \
mx1fs2  \
+   mx27ads \
netstar \
nhk8815 \
nhk8815_onenand \
diff --git a/Makefile b/Makefile
index 9764cea..4f2dcef 100644
--- a/Makefile
+++ b/Makefile
@@ -2965,6 +2965,9 @@ davinci_dm365evm_config : unconfig
 imx27lite_config:  unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs imx27lite logicpd mx27

+mx27ads_config :   unconfig
+   @$(MKCONFIG) $(@:_config=) arm arm926ejs mx27ads freescale mx27
+
 lpd7a400_config \
 lpd7a404_config:   unconfig
@$(MKCONFIG) $(@:_config=) arm lh7a40x lpd7a40x
diff --git a/board/freescale/mx27ads/Makefile b/board/freescale/mx27ads/Makefile
new file mode 100644
index 000..d142a9e
--- /dev/null
+++ b/board/freescale/mx27ads/Makefile
@@ -0,0 +1,51 @@
+#
+# (C) Copyright 2000-2004
+# Wolfgang Denk, DENX Software Engineering, w...@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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS  := mx27ads.o
+SOBJS  := lowlevel_init.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
+
diff --git a/board/freescale/mx27ads/config.mk
b/board/freescale/mx27ads/config.mk
new file mode 100644
index 000..a2e7768
--- /dev/null
+++ b/board/freescale/mx27ads/config.mk
@@ -0,0 +1 @@
+TEXT_BASE = 0xA7F0
diff --git a/board/freescale/mx27ads/lowlevel_init.S
b/board/freescale/mx27ads/lowlevel_init.S
new file mode 100644
index 000..dc62a93
--- /dev/null
+++ b/board/freescale/mx27ads/lowlevel_init.S
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2008, Guennadi Liakhovetski l...@denx.de
+ *
+ * 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

[U-Boot] [PATCH v2] mx27ads: add support for iMX27ADS board from Freescale

2009-09-09 Thread Alan Carvalho de Assis
This patch adds support to iMX27ADS development board. This board has
128MB RAM, 32MB NOR Flash and 128MB NAND Flash. Currently only
booting from NOR is supported.

Signed-off-by: Alan Carvalho de Assis acas...@gmail.com
---
 MAINTAINERS |3 +
 MAKEALL |1 +
 Makefile|3 +
 board/freescale/mx27ads/Makefile|   51 
 board/freescale/mx27ads/config.mk   |1 +
 board/freescale/mx27ads/lowlevel_init.S |  128 +++
 board/freescale/mx27ads/mx27ads.c   |   93 ++
 board/freescale/mx27ads/u-boot.lds  |   56 +
 include/configs/mx27ads.h   |  202 +++
 9 files changed, 538 insertions(+), 0 deletions(-)
 create mode 100644 board/freescale/mx27ads/Makefile
 create mode 100644 board/freescale/mx27ads/config.mk
 create mode 100644 board/freescale/mx27ads/lowlevel_init.S
 create mode 100644 board/freescale/mx27ads/mx27ads.c
 create mode 100644 board/freescale/mx27ads/u-boot.lds
 create mode 100644 include/configs/mx27ads.h

diff --git a/MAINTAINERS b/MAINTAINERS
index e9db278..5b25188 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -550,6 +550,9 @@ Thomas Elste i...@elste.org

modnet50ARM720T (NET+50)

+Alan Carvalho de Assis acas...@gmail.com
+   mx27ads i.MX27
+
 Fabio Estevam fabio.este...@freescale.com

mx31pdk i.MX31
diff --git a/MAKEALL b/MAKEALL
index f0ed8ea..8411eef 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -520,6 +520,7 @@ LIST_ARM9= \
cp926ejs\
cp946es \
cp966   \
+   mx27ads \
imx27lite   \
lpd7a400\
mv88f6281gtw_ge \
diff --git a/Makefile b/Makefile
index 0449a5b..6fa4b28 100644
--- a/Makefile
+++ b/Makefile
@@ -2961,6 +2961,9 @@ davinci_dm365evm_config : unconfig
 imx27lite_config:  unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs imx27lite logicpd mx27

+mx27ads_config :   unconfig
+   @$(MKCONFIG) $(@:_config=) arm arm926ejs mx27ads freescale mx27
+
 lpd7a400_config \
 lpd7a404_config:   unconfig
@$(MKCONFIG) $(@:_config=) arm lh7a40x lpd7a40x
diff --git a/board/freescale/mx27ads/Makefile b/board/freescale/mx27ads/Makefile
new file mode 100644
index 000..d142a9e
--- /dev/null
+++ b/board/freescale/mx27ads/Makefile
@@ -0,0 +1,51 @@
+#
+# (C) Copyright 2000-2004
+# Wolfgang Denk, DENX Software Engineering, w...@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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS  := mx27ads.o
+SOBJS  := lowlevel_init.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
+
diff --git a/board/freescale/mx27ads/config.mk
b/board/freescale/mx27ads/config.mk
new file mode 100644
index 000..a2e7768
--- /dev/null
+++ b/board/freescale/mx27ads/config.mk
@@ -0,0 +1 @@
+TEXT_BASE = 0xA7F0
diff --git a/board/freescale/mx27ads/lowlevel_init.S
b/board/freescale/mx27ads/lowlevel_init.S
new file mode 100644
index 000..a4e1191
--- /dev/null
+++ b/board/freescale/mx27ads/lowlevel_init.S
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2008, Guennadi Liakhovetski l...@denx.de
+ *
+ * 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

[U-Boot] [PATCH] mx27ads: add support for iMX27ADS board from Freescale

2009-09-08 Thread Alan Carvalho de Assis
This patch adds support to iMX27ADS development board. This board has
128MB RAM, 32MB NOR Flash and 128MB NAND Flash. Currently only
booting from NOR is supported.
---
 MAINTAINERS |3 +
 MAKEALL |1 +
 Makefile|3 +
 board/freescale/mx27ads/Makefile|   51 
 board/freescale/mx27ads/config.mk   |1 +
 board/freescale/mx27ads/lowlevel_init.S |  130 +++
 board/freescale/mx27ads/mx27ads.c   |   93 ++
 board/freescale/mx27ads/u-boot.lds  |   56 +
 include/configs/mx27ads.h   |  205 +++
 9 files changed, 543 insertions(+), 0 deletions(-)
 create mode 100644 board/freescale/mx27ads/Makefile
 create mode 100644 board/freescale/mx27ads/config.mk
 create mode 100644 board/freescale/mx27ads/lowlevel_init.S
 create mode 100644 board/freescale/mx27ads/mx27ads.c
 create mode 100644 board/freescale/mx27ads/u-boot.lds
 create mode 100644 include/configs/mx27ads.h

diff --git a/MAINTAINERS b/MAINTAINERS
index e9db278..5b25188 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -550,6 +550,9 @@ Thomas Elste i...@elste.org

modnet50ARM720T (NET+50)

+Alan Carvalho de Assis acas...@gmail.com
+   mx27ads i.MX27
+
 Fabio Estevam fabio.este...@freescale.com

mx31pdk i.MX31
diff --git a/MAKEALL b/MAKEALL
index f0ed8ea..8411eef 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -520,6 +520,7 @@ LIST_ARM9= \
cp926ejs\
cp946es \
cp966   \
+   mx27ads \
imx27lite   \
lpd7a400\
mv88f6281gtw_ge \
diff --git a/Makefile b/Makefile
index 0449a5b..6fa4b28 100644
--- a/Makefile
+++ b/Makefile
@@ -2961,6 +2961,9 @@ davinci_dm365evm_config : unconfig
 imx27lite_config:  unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs imx27lite logicpd mx27

+mx27ads_config :   unconfig
+   @$(MKCONFIG) $(@:_config=) arm arm926ejs mx27ads freescale mx27
+
 lpd7a400_config \
 lpd7a404_config:   unconfig
@$(MKCONFIG) $(@:_config=) arm lh7a40x lpd7a40x
diff --git a/board/freescale/mx27ads/Makefile b/board/freescale/mx27ads/Makefile
new file mode 100644
index 000..d142a9e
--- /dev/null
+++ b/board/freescale/mx27ads/Makefile
@@ -0,0 +1,51 @@
+#
+# (C) Copyright 2000-2004
+# Wolfgang Denk, DENX Software Engineering, w...@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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS  := mx27ads.o
+SOBJS  := lowlevel_init.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
+
diff --git a/board/freescale/mx27ads/config.mk
b/board/freescale/mx27ads/config.mk
new file mode 100644
index 000..a2e7768
--- /dev/null
+++ b/board/freescale/mx27ads/config.mk
@@ -0,0 +1 @@
+TEXT_BASE = 0xA7F0
diff --git a/board/freescale/mx27ads/lowlevel_init.S
b/board/freescale/mx27ads/lowlevel_init.S
new file mode 100644
index 000..9560802
--- /dev/null
+++ b/board/freescale/mx27ads/lowlevel_init.S
@@ -0,0 +1,130 @@
+/*
+ * Copyright (C) 2008, Guennadi Liakhovetski l...@denx.de
+ *
+ * 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

Re: [U-Boot] uboot iMX25 or iMX27

2009-06-30 Thread Alan Carvalho de Assis
Hi Johan,

On 6/30/09, Johann Steinbrecher steinbrecher.joh...@googlemail.com wrote:
 Hello,

 does anybody have experience in setting up the uboot for a iMX25 or iMX27
 processor.
 Is there already a uboot configuration for those processors?


Please search on mailing list, there is patches to add U-Boot
(mainstream) support from iMX27.

Also there is U-Bootv2 support to iMX27.

Regards,

Alan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] Small fix to m5282evb

2009-03-28 Thread Alan Carvalho de Assis
This is just a small fix to get u-boot on m5282evb.

Signed-off-by: Alan Carvalho de Assis acas...@gmail.com
---
 board/freescale/m5282evb/u-boot.lds |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/board/freescale/m5282evb/u-boot.lds
b/board/freescale/m5282evb/u-boot.lds
index dc18b7d..f46e025 100644
--- a/board/freescale/m5282evb/u-boot.lds
+++ b/board/freescale/m5282evb/u-boot.lds
@@ -61,7 +61,7 @@ SECTIONS
 lib_generic/vsprintf.o (.text)
 lib_generic/crc32.o(.text)

-. = env_offset;
+. = DEFINED(env_offset) ? env_offset : .;
 common/env_embedded.o(.text)

 *(.text)
-- 
1.5.6.3
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/3] iMX31: Add support to copy NAND Flash code to RAM

2008-10-24 Thread Alan Carvalho de Assis
Hi Guennadi,

On Fri, Oct 24, 2008 at 4:57 AM, Guennadi Liakhovetski [EMAIL PROTECTED] 
wrote:
 On Fri, 24 Oct 2008, Magnus Lilja wrote:

 Where can one find developer documentation for nand_spl?

 doc/README.nand-boot-ppc440

 Also, is there any ARM board supporting this already?

 nand_spl/board/samsung/smdk6400/

 The nand_spl for the i.MX31 has to fit within 2048 bytes, along with
 some of the usual low_levelinit.S stuff.

 src/u-boot$ ls -l nand_spl/u-boot-spl.bin
 -rwxrwxr-x 1 * * 2840 2008-10-23 09:22 nand_spl/u-boot-spl.bin

 So, you just need to reduce it by about 30%:-)

 Also, for anyone implementing a new nand_spl board, please, change the
 SPL-image name from nand_spl/u-boot-spl-16k.bin to something more
 flexible:-)


Thank you very much! I found your explanation very useful.
Sorry about my mistake. Really is better get the right implementation
integrated at first than apply other patch to remove the wrong
implementation and add the new one.

I am going to implement it on nand_spl.

 Thanks

Thank you very much,

 Guennadi
 ---
 Guennadi Liakhovetski, Ph.D.

 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: [EMAIL PROTECTED]


Alan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 0/3] iMX31: Add iMX31 support to boots from NAND

2008-10-23 Thread Alan Carvalho de Assis
Hi,

This serie of patches was rebased to adds support to iMX31PDK board to
boot directly from NAND.
Notice these patches don't add support to MTD NAND Flash support to U-Boot
(like reading and saving environment parameters in Flash because MTD NAND Flash
driver still needs further revision).
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/3] iMX31: Reducing start.S size to let boot from NAND

2008-10-23 Thread Alan Carvalho de Assis
iMX31 NAND Flash Controller has a 2KB RAM buffer, but the
current start.S file is too much big to let NAND copy routine
to fit in. This patch will reduce the start.S when booting from
NAND Flash.

Signed-off-by: Alan Carvalho de Assis [EMAIL PROTECTED]
---
 cpu/arm1136/start.S |   24 ++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/cpu/arm1136/start.S b/cpu/arm1136/start.S
index e622338..4f3675d 100644
--- a/cpu/arm1136/start.S
+++ b/cpu/arm1136/start.S
@@ -32,6 +32,15 @@
 #include version.h
 .globl _start
 _start: b  reset
+#ifdef CONFIG_BOOT_FROM_NAND
+   b   .   /* Undefined Instruction*/
+   b   .   /* Software Interrupt   */
+   b   .   /* Prefetch Abort   */
+   b   .   /* Data Abort   */
+   b   .   /* Reserved */
+   b   .   /* IRQ  */
+   b   .   /* FIQ  */
+#else
 #ifdef CONFIG_ONENAND_IPL
ldr pc, _hang
ldr pc, _hang
@@ -68,6 +77,7 @@ _irq: .word irq
 _fiq:  .word fiq
 _pad:  .word 0x12345678 /* now 16*4=64 */
 #endif /* CONFIG_ONENAND_IPL */
+#endif /* CONFIG_BOOT_FROM_NAND */
 .global _end_vect
 _end_vect:

@@ -151,6 +161,7 @@ next:
bl  cpu_init_crit
 #endif

+_cstartup:
 #ifndef CONFIG_SKIP_RELOCATE_UBOOT
 relocate:  /* relocate U-Boot to RAM   */
adr r0, _start  /* r0 - current position of code   */
@@ -239,12 +250,18 @@ cpu_init_crit:
 * Jump to board specific initialization... The Mask ROM will have
already initialized
 * basic memory.  Go here to bump up clock rate and handle wake up 
conditions.
 */
+#ifdef CONFIG_BOOT_FROM_NAND
+   ldr sp, =CFG_INTERNAL_SRAM_STACK/* Initial stack point in the 
SRAM  */
+   ldr r0, =_cstartup  /* load the return address  */
+   mov lr, r0  /* set the return address after remap   */
+   b   lowlevel_init   /* relative branch enables remap*/
+#endif
mov ip, lr  /* persevere link reg across call */
bl  lowlevel_init   /* go setup pll,mux,memory */
mov lr, ip  /* restore link */
mov pc, lr  /* back to my caller */

-#ifndef CONFIG_ONENAND_IPL
+#if !defined(CONFIG_ONENAND_IPL)  !defined(CONFIG_BOOT_FROM_NAND)
 /*
  *
  *
@@ -357,11 +374,12 @@ cpu_init_crit:
.macro get_fiq_stack@ setup FIQ stack
ldr sp, FIQ_STACK_START
.endm
-#endif /* CONFIG_ONENAND_IPL */
+#endif /* CONFIG_ONENAND_IPL/CONFIG_BOOT_FROM_NAND */

 /*
  * exception handlers
  */
+#ifndef CONFIG_BOOT_FROM_NAND
 #ifdef CONFIG_ONENAND_IPL
.align  5
 do_hang:
@@ -436,3 +454,5 @@ arm1136_cache_flush:
mcr p15, 0, r1, c7, c5, 0   @ invalidate I cache
mov pc, lr  @ back to caller
 #endif /* CONFIG_ONENAND_IPL */
+#endif /* CONFIG_BOOT_FROM_NAND */
+
-- 
1.5.4.3
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/3] iMX31: Add support to copy NAND Flash code to RAM

2008-10-23 Thread Alan Carvalho de Assis
This code is executed from internal 2KB NAND Flash Controller RAM buffer
and will copy the remaining U-Boot code from NAND Flash verifying its
bad blocks (case it exists).

Signed-off-by: Alan Carvalho de Assis [EMAIL PROTECTED]
---
 cpu/arm1136/mx31/Makefile |2 +
 cpu/arm1136/mx31/nand_copy.S  |  263 +
 include/asm-arm/arch-mx31/mx31-regs.h |   69 +
 3 files changed, 334 insertions(+), 0 deletions(-)
 create mode 100644 cpu/arm1136/mx31/nand_copy.S

diff --git a/cpu/arm1136/mx31/Makefile b/cpu/arm1136/mx31/Makefile
index b648ffd..0490706 100644
--- a/cpu/arm1136/mx31/Makefile
+++ b/cpu/arm1136/mx31/Makefile
@@ -26,7 +26,9 @@ include $(TOPDIR)/config.mk
 LIB= $(obj)lib$(SOC).a

 COBJS  = interrupts.o serial.o generic.o
+SOBJS-$(CONFIG_BOOT_FROM_NAND) = nand_copy.o

+SOBJS  := $(SOBJS-y)
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))

diff --git a/cpu/arm1136/mx31/nand_copy.S b/cpu/arm1136/mx31/nand_copy.S
new file mode 100644
index 000..7a2460c
--- /dev/null
+++ b/cpu/arm1136/mx31/nand_copy.S
@@ -0,0 +1,263 @@
+/*
+ * Copyright (C) 2008 Freescale Semiconductor, Inc.
+ *
+ * Alan Carvalho de Assis [EMAIL PROTECTED]
+ * based on iMX31PDK RedBoot_200814 code.
+ *
+ * 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 config.h
+#include asm/arch/mx31-regs.h
+
+.macro do_addr_input
+   and r3, r3, #0xFF
+   strhr3, [r12, #NFC_FLASH_ADDR_OFF]
+   mov r3, #NAND_FLASH_CONFIG2_FADD_EN
+   strhr3, [r12, #NFC_CONFIG2_OFF]
+   bl  do_wait_op_done
+.endm   /* do_addr_input */
+
+do_wait_op_done:
+1: ldrhr3, [r12, #NFC_CONFIG2_OFF]
+   andsr3, r3, #NAND_FLASH_CONFIG2_INT_DONE
+   beq 1b
+   bx  lr
+
+nfc_data_output:
+   mov r3, #(NAND_FLASH_CONFIG1_INT_MSK | NAND_FLASH_CONFIG1_ECC_EN)
+   strhr3, [r12, #NFC_CONFIG1_OFF]
+   strhr8, [r12, #NFC_BUF_ADDR_OFF]
+   mov r3, #FDO_PAGE_SPARE_VAL
+   strhr3, [r12, #NFC_CONFIG2_OFF]
+   bx  lr
+
+.globl nand_copy
+nand_copy:
+   /* Copy image from flash to SDRAM first */
+   mov r0, #NFC_BASE_ADDR
+   add r2, r0, #0x800  /* 2K window */
+   ldr r1, MXC_UBOOT_ROM_START
+
+1: ldmia   r0!, {r3-r10}
+   stmia   r1!, {r3-r10}
+   cmp r0, r2
+   blo 1b
+   /* Jump to SDRAM */
+   ldr r1, =0x0FFF
+   and r0, pc, r1 /* offset of pc */
+   ldr r1, MXC_UBOOT_ROM_START
+   add r1, r1, #0x10
+   add pc, r0, r1
+   nop
+   nop
+   nop
+   nop
+
+nand_copy_main:
+   /* Check if x16/2kb page */
+   ldr r7, =CCM_BASE
+   ldr r7, [r7, #0xC]
+   andsr7, r7, #(1  30)
+
+   mov r0, #NAND_FLASH_BOOT
+   ldr r1, =AVIC_VECTOR0
+   str r0, [r1]
+   mov r0, #MXCFIS_NAND
+   ldr r1, =AVIC_VECTOR1
+   str r0, [r1]
+
+   mov r0, #NFC_BASE_ADDR /* r0: nfc base. Reloaded after each page 
copying */
+   mov r1, #0x800   /* r1: starting flash addr to be copied.
Updated constantly */
+   add r2, r0, #0x800   /* r2: end of 3rd RAM buf. Doesn't change */
+   addeq   r2, r0, #0x200   /* r2: end of 1st RAM buf. Doesn't change
(only set for small page NAND) */
+   add r12, r0, #0xE00  /* r12: NFC register base. Doesn't change */
+   ldr r11, MXC_UBOOT_ROM_START
+   add r13, r11, #0x4 /* r13: end of SDRAM address for copying.
Doesn't change */
+   add r11, r11, r1 /* r11: starting SDRAM address for copying.
Updated constantly */
+
+   /* unlock internal buffer */
+   mov r3, #0x2
+   strhr3, [r12, #0xA]
+
+nfc_read_page:
+   mov r3, #0x0
+   strhr3, [r12, #NFC_FLASH_CMD_OFF]
+   mov r3, #NAND_FLASH_CONFIG2_FCMD_EN
+   strhr3, [r12, #NFC_CONFIG2_OFF]
+   bl  do_wait_op_done
+
+   /* Check if x16/2kb page */
+   ldr r7, =CCM_BASE
+   ldr r7, [r7, #0xC]
+   andsr7, r7, #(1  30)
+   bne nfc_addr_ops_2kb
+
+   /* 1st addr cycle */
+   mov r3, r1
+   do_addr_input
+   /* 1st addr cycle */
+   mov r3, r1, lsr #9

[U-Boot] [PATCH 3/3] iMX31: Add support to iMX31PDK board boots from NAND Flash

2008-10-23 Thread Alan Carvalho de Assis
This patch adds support to iMX31PDK board to boot directly from NAND
Flash. In order to it works the previous patches (which reduces start.S
size and copy NAND code to RAM) need be applied first.

Signed-off-by: Alan Carvalho de Assis [EMAIL PROTECTED]
---
 board/freescale/mx31pdk/lowlevel_init.S |   95 +-
 board/freescale/mx31pdk/u-boot.lds  |3 +
 include/configs/mx31pdk.h   |   15 +++--
 3 files changed, 104 insertions(+), 9 deletions(-)

diff --git a/board/freescale/mx31pdk/lowlevel_init.S
b/board/freescale/mx31pdk/lowlevel_init.S
index f368d10..58f6d3d 100644
--- a/board/freescale/mx31pdk/lowlevel_init.S
+++ b/board/freescale/mx31pdk/lowlevel_init.S
@@ -20,11 +20,98 @@
  * MA 02111-1307 USA
  */

-/*
- * This is just to keep the linker happy.
- */
+#include asm/arch/mx31-regs.h
+
+.macro REG reg, val
+   ldr r2, =\reg
+   ldr r3, =\val
+   str r3, [r2]
+.endm
+
+.macro REG8 reg, val
+   ldr r2, =\reg
+   ldr r3, =\val
+   strb r3, [r2]
+.endm
+
+.macro DELAY loops
+   ldr r2, =\loops
+1:
+   subsr2, r2, #1
+   nop
+   bcs 1b
+.endm

 .globl lowlevel_init
 lowlevel_init:
-   mov pc, lr
+   /* Store return address on the stack since lr is re-used in this file */
+   /* and all other registers are re-used as well */
+   str lr, [sp]
+
+   /* Also setup the Peripheral Port Remap register inside the core */
+   ldr r0, =ARM_PPMRR  /* start from AIPS 2GB region */
+   mcr p15, 0, r0, c15, c2, 4
+
+   REG IPU_CONF, IPU_CONF_DI_EN
+   REG CCM_CCMR, 0x074B0BF5
+
+   DELAY 0x4
+
+   REG CCM_CCMR, 0x074B0BF5 | CCMR_MPE
+   REG CCM_CCMR, (0x074B0BF5 | CCMR_MPE)  ~CCMR_MDS
+
+   /* Set up clock to 532MHz */
+   REG CCM_PDR0, 0xFF871D58
+   REG CCM_MPCTL, 0x0033280C
+   REG CCM_SPCTL, PLL_PD(1) | PLL_MFD(4) | PLL_MFI(12) | PLL_MFN(1)
+
+   /* Set up CPLD on CS5 */
+   REG CSCR_U(5), 0xD843
+   REG CSCR_L(5), 0x22252521
+   REG CSCR_A(5), 0x0A00
+
+   /* Set up MX31 DDR Memory Controller */
+   REG 0x43FAC26C, 0 /* SDCLK */
+   REG 0x43FAC270, 0 /* CAS */
+   REG 0x43FAC274, 0 /* RAS */
+   REG 0x43FAC27C, 0x1000 /* CS2   CSD0) */
+   REG 0x43FAC284, 0 /* DQM3 */
+   REG 0x43FAC288, 0 /* DQM2, DQM1, DQM0, SD31-SD0, A25-A0, MA10   
0x288..0x2DC) */
+   REG 0x43FAC28C, 0
+   REG 0x43FAC290, 0
+   REG 0x43FAC294, 0
+   REG 0x43FAC298, 0
+   REG 0x43FAC29C, 0
+   REG 0x43FAC2A0, 0
+   REG 0x43FAC2A4, 0
+   REG 0x43FAC2A8, 0
+   REG 0x43FAC2AC, 0
+   REG 0x43FAC2B0, 0
+   REG 0x43FAC2B4, 0
+   REG 0x43FAC2B8, 0
+   REG 0x43FAC2BC, 0
+   REG 0x43FAC2C0, 0
+   REG 0x43FAC2C4, 0
+   REG 0x43FAC2C8, 0
+   REG 0x43FAC2CC, 0
+   REG 0x43FAC2D0, 0
+   REG 0x43FAC2D4, 0
+   REG 0x43FAC2D8, 0
+   REG 0x43FAC2DC, 0
+   REG 0xB8001010, 0x0004
+   REG 0xB8001004, 0x006ac73a
+   REG 0xB8001000, 0x9210
+   REG 0x8f00, 0x12344321
+   REG 0xB8001000, 0xa210
+   REG 0x8000, 0x12344321
+   REG 0x8000, 0x12344321
+   REG 0xB8001000, 0xb210
+   REG80x8033, 0xda
+   REG80x8100, 0xff
+   REG 0xB8001000, 0x82226080
+   REG 0x8000, 0xDEADBEEF
+   REG 0xB8001010, 0x000c
+
+   /* Copy from NAND to RAM */
+   b nand_copy

diff --git a/board/freescale/mx31pdk/u-boot.lds
b/board/freescale/mx31pdk/u-boot.lds
index 04a8f77..1cfa3ca 100644
--- a/board/freescale/mx31pdk/u-boot.lds
+++ b/board/freescale/mx31pdk/u-boot.lds
@@ -35,6 +35,9 @@ SECTIONS
.text  :
{
cpu/arm1136/start.o (.text)
+   board/freescale/mx31pdk/lowlevel_init.o (.text)
+   cpu/arm1136/mx31/nand_copy.o(.text)
+   . = 2K; /* lowlevel NAND needs to fit in 2KB of NFC buffer */
*(.text)
}

diff --git a/include/configs/mx31pdk.h b/include/configs/mx31pdk.h
index 5752856..183b0f3 100644
--- a/include/configs/mx31pdk.h
+++ b/include/configs/mx31pdk.h
@@ -38,6 +38,9 @@
 #define CONFIG_MX31_HCLK_FREQ  2600
 #define CONFIG_MX31_CLK32  32768

+/* We are booting from NAND. Used to shrink start.S */
+#define CONFIG_BOOT_FROM_NAND  1
+
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO

@@ -45,11 +48,6 @@
 #define CONFIG_SETUP_MEMORY_TAGS   1
 #define CONFIG_INITRD_TAG  1

-/* No support for NAND boot for i.MX31 PDK yet, so we rely on some other
- * program to initialize the SDRAM.
- */
-#define CONFIG_SKIP_LOWLEVEL_INIT
-
 /*
  * Size of malloc() pool
  */
@@ -136,6 +134,13 @@
 #define CONFIG_CMDLINE_EDITING 1

Re: [U-Boot] [PATCH 2/3] iMX31: Add support to copy NAND Flash code to RAM

2008-10-23 Thread Alan Carvalho de Assis
Hi Guennadi,

On Thu, Oct 23, 2008 at 4:10 PM, Guennadi Liakhovetski [EMAIL PROTECTED] 
wrote:

 Last time Scott Wood suggested to use nand_spl you replied I think using
 nand_spl is the best approach, but it will needs more effort to complete.
 and Anyway, right now we can have iMX31PDK booting with this code as an
 option for users willing to use U-Boot in this board. So, what's the
 status of this effort? If this your new submission, which still doesn't
 use nand_spl is not really targeted for upstream merge, I think, it would
 be better not to mark these mails PATCH. Or have I missed anything?


This patch is just a rebase of previous patch, to be merged on
u-boot-arm/master repository.
I don't have nand_spl working until now.

I am new sending patches to u-boot mailing list. So what is the
problem when calling it of PATCH? Please, let me know about my
mistake, can you explain about it?

 Thanks
 Guennadi


Best Regards,

Alan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/3] iMX31: Add support to iMX31PDK board boots from NAND Flash

2008-10-22 Thread Alan Carvalho de Assis
Hi Jean,

On Wed, 2008-10-22 at 11:59 +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
 On 15:01 Tue 07 Oct , Alan Carvalho de Assis wrote:
  From ae5af322e53d00d021f6d4aa39c6916e1d3e12b7 Mon Sep 17 00:00:00 2001
  From: Alan Carvalho de Assis [EMAIL PROTECTED]
  Date: Sun, 5 Oct 2008 20:00:59 -0300
  Subject: [PATCH] iMX31: Add support to iMX31PDK board boots from NAND Flash
  
  This patch adds support to iMX31PDK board to boot directly from NAND
  Flash. In order to it works the previous patches (which reduces start.S
  size and copy NAND code to RAM) need be applied first.
  
  Signed-off-by: Alan Carvalho de Assis [EMAIL PROTECTED]
  ---
   board/freescale/mx31pdk/lowlevel_init.S |   95 
  +-
   board/freescale/mx31pdk/u-boot.lds  |3 +
   include/configs/mx31pdk.h   |   16 --
   3 files changed, 105 insertions(+), 9 deletions(-)
  
   Please rebase against u-boot-arm/master otherwhise ACK execpt some
   whitespace see comment below
 
   Best Regards,
   J.
  diff --git a/board/freescale/mx31pdk/lowlevel_init.S
  b/board/freescale/mx31pdk/lowlevel_init.S
  index a94ea7f..71ab612 100644
  --- a/board/freescale/mx31pdk/lowlevel_init.S
  +++ b/board/freescale/mx31pdk/lowlevel_init.S
  @@ -20,11 +20,98 @@
* MA 02111-1307 USA
*/
  
  -/*
  - * This is just to keep the linker happy.
  - */
  +#include asm/arch/mx31-regs.h
  +
  +.macro REG reg, val
  +   ldr r2, =\reg
  +   ldr r3, =\val
  +   str r3, [r2]
  +.endm
  +
  +.macro REG8 reg, val
  +   ldr r2, =\reg
  +   ldr r3, =\val
  +   strb r3, [r2]
  +.endm
  +
  +.macro DELAY loops
  +   ldr r2, =\loops
  +1:
  +   subsr2, r2, #1
  +   nop
  +   bcs 1b
  +.endm
  
   .globl lowlevel_init
   lowlevel_init:
  -   mov pc, lr
  +   /* Store return address on the stack since lr is re-used in this file */
  +   /* and all other registers are re-used as well */
  +   str lr, [sp]
  +
  +   /* Also setup the Peripheral Port Remap register inside the core */
  +   ldr r0, =ARM_PPMRR/* start from AIPS 2GB region */
   
   please use tab
  +   mcr p15, 0, r0, c15, c2, 4
  +
  +   REG IPU_CONF, IPU_CONF_DI_EN
  +   REG CCM_CCMR, 0x074B0BF5
  +
  +   DELAY 0x4
  +
  +   REG CCM_CCMR, 0x074B0BF5 | CCMR_MPE
  +   REG CCM_CCMR, (0x074B0BF5 | CCMR_MPE)  ~CCMR_MDS
  +
  +   /* Set up clock to 532MHz */
  +   REG CCM_PDR0, 0xFF871D58
  +   REG CCM_MPCTL, 0x0033280C
  +   REG CCM_SPCTL, PLL_PD(1) | PLL_MFD(4) | PLL_MFI(12) | PLL_MFN(1)
  +
  +   /* Set up CPLD on CS5 */
  +   REG CSCR_U(5), 0xD843
  +   REG CSCR_L(5), 0x22252521
  +   REG CSCR_A(5), 0x0A00
  +
  +   /* Set up MX31 DDR Memory Controller */
  +   REG 0x43FAC26C, 0 /* SDCLK */
  +   REG 0x43FAC270, 0 /* CAS */
  +   REG 0x43FAC274, 0 /* RAS */
  +   REG 0x43FAC27C, 0x1000 /* CS2   CSD0) */
  +   REG 0x43FAC284, 0 /* DQM3 */
  +   REG 0x43FAC288, 0 /* DQM2, DQM1, DQM0, SD31-SD0, A25-A0, MA10   
  0x288..0x2DC) */
  +   REG 0x43FAC28C, 0
  +   REG 0x43FAC290, 0
  +   REG 0x43FAC294, 0
  +   REG 0x43FAC298, 0
  +   REG 0x43FAC29C, 0
  +   REG 0x43FAC2A0, 0
  +   REG 0x43FAC2A4, 0
  +   REG 0x43FAC2A8, 0
  +   REG 0x43FAC2AC, 0
  +   REG 0x43FAC2B0, 0
  +   REG 0x43FAC2B4, 0
  +   REG 0x43FAC2B8, 0
  +   REG 0x43FAC2BC, 0
  +   REG 0x43FAC2C0, 0
  +   REG 0x43FAC2C4, 0
  +   REG 0x43FAC2C8, 0
  +   REG 0x43FAC2CC, 0
  +   REG 0x43FAC2D0, 0
  +   REG 0x43FAC2D4, 0
  +   REG 0x43FAC2D8, 0
  +   REG 0x43FAC2DC, 0
  +   REG 0xB8001010, 0x0004
  +   REG 0xB8001004, 0x006ac73a
  +   REG 0xB8001000, 0x9210
  +   REG 0x8f00, 0x12344321
  +   REG 0xB8001000, 0xa210
  +   REG 0x8000, 0x12344321
  +   REG 0x8000, 0x12344321
  +   REG 0xB8001000, 0xb210
  +   REG80x8033, 0xda
  +   REG80x8100, 0xff
  +   REG 0xB8001000, 0x82226080
  +   REG 0x8000, 0xDEADBEEF
  +   REG 0xB8001010, 0x000c
  +
  +   /* Copy from NAND to RAM */
  +   b nand_copy
  
  diff --git a/board/freescale/mx31pdk/u-boot.lds
  b/board/freescale/mx31pdk/u-boot.lds
  index 1460adc..8602f3e 100644
  --- a/board/freescale/mx31pdk/u-boot.lds
  +++ b/board/freescale/mx31pdk/u-boot.lds
  @@ -35,6 +35,9 @@ SECTIONS
  .text  :
  {
cpu/arm1136/start.o   (.text)
 ^^
   please use tab
  + board/freescale/mx31pdk/lowlevel_init.o   (.text)
 ^^
  + cpu/arm1136/mx31/nand_copy.o  (.text)
 ^^
  + . = 2K; /* lowlevel NAND needs to fit in 2KB of NFC buffer */
 ^^
*(.text)
 ^^
  }
 
 Best Regards,
 J.

I can't rebase [PATCH 3/3] on u-boot-arm/master because it applies over
Magnus Lilja's patch i.MX31: Add basic support for Freescale's i.MX31
PDK board. (968614d8c3f17eb834838de9a390ef4879fb1e77)

Can you please pull

Re: [U-Boot] [PATCH v3 3/6] i.MX31: Add basic support for Freescale's i.MX31 PDK board.

2008-10-15 Thread Alan Carvalho de Assis
Hi Jean-Christophe,

On Mon, Oct 13, 2008 at 5:49 AM, Jean-Christophe PLAGNIOL-VILLARD
[EMAIL PROTECTED] wrote:
 Is there any special reason it was not added to the master branch
 yet?


 As we discuss on IRC this board will be merge when it can boot from a storage


Using some patches I sent we can boot it from storage, even without
the MTD NAND driver.

 Best Regards,
 J.

Regards,

Alan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/3] iMX31: Add support to copy NAND Flash code to RAM

2008-10-08 Thread Alan Carvalho de Assis
Hi Scott,

On Tue, Oct 7, 2008 at 3:03 PM, Scott Wood [EMAIL PROTECTED] wrote:
 Alan Carvalho de Assis wrote:

 From 473120de8390abd78014cac9fe0925cb49f57fbe Mon Sep 17 00:00:00 2001
 From: Alan Carvalho de Assis [EMAIL PROTECTED]
 Date: Sun, 5 Oct 2008 19:59:47 -0300
 Subject: [PATCH] iMX31: Add support to copy NAND Flash code to RAM

 This code is executed from internal 2KB NAND Flash Controller RAM buffer
 and will copy the remaining U-Boot code from NAND Flash verifying its
 bad blocks (case it exists).

 Signed-off-by: Alan Carvalho de Assis [EMAIL PROTECTED]
 ---
  cpu/arm1136/mx31/Makefile |2 +
  cpu/arm1136/mx31/nand_copy.S  |  263
 +
  include/asm-arm/arch-mx31/mx31-regs.h |   69 +

 Please use the nand_spl infrastructure to whatever extent is practical.

 Does this code really need to be in assembly to fit?

I reused the source code from RedBoot. I think using nand_spl is the
best approach, but it will needs more effort to complete.

I am afraid about the 2KB NAND loader limitation, this is too tight to
fill using C code. I will investigate to verify if it is feasible.

Anyway, right now we can have iMX31PDK booting with this code as an
option for users willing to use U-Boot in this board.

 -Scott


Best Regards,

Alan

P.S.: I am sending this email again because I sent it erroneously only to Scott
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 0/3] iMX31: Add iMX31 support to boots from NAND

2008-10-07 Thread Alan Carvalho de Assis
This serie of patches adds support to iMX31PDK board to boot directly from NAND.
Notice these patches don't add support to MTD NAND Flash support to U-Boot
(like reading and saving environment parameters in Flash because MTD NAND Flash
driver still needs further revision).


For people willing to test it follow these simple steps:

Create a local copy of u-boot-arm/testing:
$ git clone git://git.denx.de/u-boot-arm-next.git u-boot-arm
$ cd u-boot-arm
$ git checkout -b local_test origin/testing

Apply patches:
$ patch -p1  ../0001-iMX31-Reducing-start.S-size-to-let-boot-from-NAND.patch
$ patch -p1  ../0002-iMX31-Add-support-to-copy-NAND-Flash-code-to-RAM.patch
$ patch -p1  ../0003-iMX31-Add-support-to-iMX31PDK-board-and-let-it-boot.patch

Set up your cross-compile (we are using one from LTIB):
$ export 
PATH=$PATH:/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/
$ export CROSS_COMPILE=arm-none-linux-gnueabi-

Compile U-Boot to iMX31PDK board:
$ make mx31pdk_config
$ make

Flash u-boot.bin to NAND flash (we are using ATK to do that)es doesn't
add U-Boot support to erase/write on NAND.

These patches will be applied against u-boot-arm/testing, against
Magnus Lilja patches.


Thanks to Kenneth Johansson about the idea to reduce start.S size.

Thanks very much to Magnus Lilja and Fabio Estevam for all the help
testing these patches.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/3] iMX31: Reducing start.S size to let boot from NAND

2008-10-07 Thread Alan Carvalho de Assis
From eeb4a71a3565098ba43aeb83be163731065a039d Mon Sep 17 00:00:00 2001
From: Alan Carvalho de Assis [EMAIL PROTECTED]
Date: Sun, 5 Oct 2008 19:57:22 -0300
Subject: [PATCH] iMX31: Reducing start.S size to let boot from NAND

iMX31 NAND Flash Controller has a 2KB RAM buffer, but the
current start.S file is too much big to let NAND copy routine
to fit in. This patch will reduce the start.S when booting from
NAND Flash.

Signed-off-by: Alan Carvalho de Assis [EMAIL PROTECTED]
---
 cpu/arm1136/start.S |   24 ++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/cpu/arm1136/start.S b/cpu/arm1136/start.S
index 51b664d..b24fe41 100644
--- a/cpu/arm1136/start.S
+++ b/cpu/arm1136/start.S
@@ -32,6 +32,15 @@
 #include version.h
 .globl _start
 _start: b  reset
+#ifdef CONFIG_BOOT_FROM_NAND
+   b   .   /* Undefined Instruction */
+   b   .   /* Software Interrupt*/
+   b   .   /* Prefetch Abort*/
+   b   .   /* Data Abort*/
+   b   .   /* Reserved  */
+   b   .   /* IRQ   */
+   b   .   /* FIQ   */
+#else
 #ifdef CONFIG_ONENAND_IPL
ldr pc, _hang
ldr pc, _hang
@@ -68,6 +77,7 @@ _irq: .word irq
 _fiq:  .word fiq
 _pad:  .word 0x12345678 /* now 16*4=64 */
 #endif /* CONFIG_ONENAND_IPL */
+#endif /* CONFIG_BOOT_FROM_NAND */
 .global _end_vect
 _end_vect:

@@ -151,6 +161,7 @@ next:
bl  cpu_init_crit
 #endif

+_cstartup:
 #ifndef CONFIG_SKIP_RELOCATE_UBOOT
 relocate:  /* relocate U-Boot to RAM   */
adr r0, _start  /* r0 - current position of code   */
@@ -239,12 +250,18 @@ cpu_init_crit:
 * Jump to board specific initialization... The Mask ROM will have
already initialized
 * basic memory.  Go here to bump up clock rate and handle wake up 
conditions.
 */
+#ifdef CONFIG_BOOT_FROM_NAND
+   ldr sp, =CFG_INTERNAL_SRAM_STACK/* Initial stack point in the 
SRAM  */
+   ldr r0, =_cstartup  /* load the return address  */
+   mov lr, r0  /* set the return address after remap   */
+   b   lowlevel_init   /* relative branch enables remap*/
+#endif
mov ip, lr  /* persevere link reg across call */
bl  lowlevel_init   /* go setup pll,mux,memory */
mov lr, ip  /* restore link */
mov pc, lr  /* back to my caller */

-#ifndef CONFIG_ONENAND_IPL
+#if !defined(CONFIG_ONENAND_IPL)  !defined(CONFIG_BOOT_FROM_NAND)
 /*
  *
  *
@@ -357,11 +374,12 @@ cpu_init_crit:
.macro get_fiq_stack@ setup FIQ stack
ldr sp, FIQ_STACK_START
.endm
-#endif /* CONFIG_ONENAND_IPL */
+#endif /* CONFIG_ONENAND_IPL/CONFIG_BOOT_FROM_NAND */

 /*
  * exception handlers
  */
+#ifndef CONFIG_BOOT_FROM_NAND
 #ifdef CONFIG_ONENAND_IPL
.align  5
 do_hang:
@@ -436,3 +454,5 @@ arm1136_cache_flush:
mcr p15, 0, r1, c7, c5, 0   @ invalidate I cache
mov pc, lr  @ back to caller
 #endif /* CONFIG_ONENAND_IPL */
+#endif /* CONFIG_BOOT_FROM_NAND */
+
-- 
1.5.4.3
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 3/3] iMX31: Add support to iMX31PDK board boots from NAND Flash

2008-10-07 Thread Alan Carvalho de Assis
From ae5af322e53d00d021f6d4aa39c6916e1d3e12b7 Mon Sep 17 00:00:00 2001
From: Alan Carvalho de Assis [EMAIL PROTECTED]
Date: Sun, 5 Oct 2008 20:00:59 -0300
Subject: [PATCH] iMX31: Add support to iMX31PDK board boots from NAND Flash

This patch adds support to iMX31PDK board to boot directly from NAND
Flash. In order to it works the previous patches (which reduces start.S
size and copy NAND code to RAM) need be applied first.

Signed-off-by: Alan Carvalho de Assis [EMAIL PROTECTED]
---
 board/freescale/mx31pdk/lowlevel_init.S |   95 +-
 board/freescale/mx31pdk/u-boot.lds  |3 +
 include/configs/mx31pdk.h   |   16 --
 3 files changed, 105 insertions(+), 9 deletions(-)

diff --git a/board/freescale/mx31pdk/lowlevel_init.S
b/board/freescale/mx31pdk/lowlevel_init.S
index a94ea7f..71ab612 100644
--- a/board/freescale/mx31pdk/lowlevel_init.S
+++ b/board/freescale/mx31pdk/lowlevel_init.S
@@ -20,11 +20,98 @@
  * MA 02111-1307 USA
  */

-/*
- * This is just to keep the linker happy.
- */
+#include asm/arch/mx31-regs.h
+
+.macro REG reg, val
+   ldr r2, =\reg
+   ldr r3, =\val
+   str r3, [r2]
+.endm
+
+.macro REG8 reg, val
+   ldr r2, =\reg
+   ldr r3, =\val
+   strb r3, [r2]
+.endm
+
+.macro DELAY loops
+   ldr r2, =\loops
+1:
+   subsr2, r2, #1
+   nop
+   bcs 1b
+.endm

 .globl lowlevel_init
 lowlevel_init:
-   mov pc, lr
+   /* Store return address on the stack since lr is re-used in this file */
+   /* and all other registers are re-used as well */
+   str lr, [sp]
+
+   /* Also setup the Peripheral Port Remap register inside the core */
+   ldr r0, =ARM_PPMRR/* start from AIPS 2GB region */
+   mcr p15, 0, r0, c15, c2, 4
+
+   REG IPU_CONF, IPU_CONF_DI_EN
+   REG CCM_CCMR, 0x074B0BF5
+
+   DELAY 0x4
+
+   REG CCM_CCMR, 0x074B0BF5 | CCMR_MPE
+   REG CCM_CCMR, (0x074B0BF5 | CCMR_MPE)  ~CCMR_MDS
+
+   /* Set up clock to 532MHz */
+   REG CCM_PDR0, 0xFF871D58
+   REG CCM_MPCTL, 0x0033280C
+   REG CCM_SPCTL, PLL_PD(1) | PLL_MFD(4) | PLL_MFI(12) | PLL_MFN(1)
+
+   /* Set up CPLD on CS5 */
+   REG CSCR_U(5), 0xD843
+   REG CSCR_L(5), 0x22252521
+   REG CSCR_A(5), 0x0A00
+
+   /* Set up MX31 DDR Memory Controller */
+   REG 0x43FAC26C, 0 /* SDCLK */
+   REG 0x43FAC270, 0 /* CAS */
+   REG 0x43FAC274, 0 /* RAS */
+   REG 0x43FAC27C, 0x1000 /* CS2   CSD0) */
+   REG 0x43FAC284, 0 /* DQM3 */
+   REG 0x43FAC288, 0 /* DQM2, DQM1, DQM0, SD31-SD0, A25-A0, MA10   
0x288..0x2DC) */
+   REG 0x43FAC28C, 0
+   REG 0x43FAC290, 0
+   REG 0x43FAC294, 0
+   REG 0x43FAC298, 0
+   REG 0x43FAC29C, 0
+   REG 0x43FAC2A0, 0
+   REG 0x43FAC2A4, 0
+   REG 0x43FAC2A8, 0
+   REG 0x43FAC2AC, 0
+   REG 0x43FAC2B0, 0
+   REG 0x43FAC2B4, 0
+   REG 0x43FAC2B8, 0
+   REG 0x43FAC2BC, 0
+   REG 0x43FAC2C0, 0
+   REG 0x43FAC2C4, 0
+   REG 0x43FAC2C8, 0
+   REG 0x43FAC2CC, 0
+   REG 0x43FAC2D0, 0
+   REG 0x43FAC2D4, 0
+   REG 0x43FAC2D8, 0
+   REG 0x43FAC2DC, 0
+   REG 0xB8001010, 0x0004
+   REG 0xB8001004, 0x006ac73a
+   REG 0xB8001000, 0x9210
+   REG 0x8f00, 0x12344321
+   REG 0xB8001000, 0xa210
+   REG 0x8000, 0x12344321
+   REG 0x8000, 0x12344321
+   REG 0xB8001000, 0xb210
+   REG80x8033, 0xda
+   REG80x8100, 0xff
+   REG 0xB8001000, 0x82226080
+   REG 0x8000, 0xDEADBEEF
+   REG 0xB8001010, 0x000c
+
+   /* Copy from NAND to RAM */
+   b nand_copy

diff --git a/board/freescale/mx31pdk/u-boot.lds
b/board/freescale/mx31pdk/u-boot.lds
index 1460adc..8602f3e 100644
--- a/board/freescale/mx31pdk/u-boot.lds
+++ b/board/freescale/mx31pdk/u-boot.lds
@@ -35,6 +35,9 @@ SECTIONS
.text  :
{
  cpu/arm1136/start.o   (.text)
+ board/freescale/mx31pdk/lowlevel_init.o   (.text)
+ cpu/arm1136/mx31/nand_copy.o  (.text)
+ . = 2K; /* lowlevel NAND needs to fit in 2KB of NFC buffer */
  *(.text)
}

diff --git a/include/configs/mx31pdk.h b/include/configs/mx31pdk.h
index 6df1a00..d4362e3 100644
--- a/include/configs/mx31pdk.h
+++ b/include/configs/mx31pdk.h
@@ -38,6 +38,9 @@
 #define CONFIG_MX31_HCLK_FREQ  2600
 #define CONFIG_MX31_CLK32  32768

+/* We are booting from NAND. Used to shrink start.S */
+#define CONFIG_BOOT_FROM_NAND  1
+
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO

@@ -45,11 +48,6 @@
 #define CONFIG_SETUP_MEMORY_TAGS   1
 #define CONFIG_INITRD_TAG  1

-/* No support for NAND boot for i.MX31 PDK yet, so we rely on some other