[U-Boot] Sandbox question

2012-04-22 Thread Wolfgang Denk

Hello,

I have a few sandbox related questions (examples run on v2012.04)

1) Memory map - What is it supposed to look like?

   I get "DRAM:  128 MiB", and

=>bdi
boot_params = 0x
DRAM bank   = 0x
-> start= 0x
-> size = 0x0800
FB base = 0x

   Yet I get:

=>md 0x100
0100:Segmentation fault

2) Sandbox does no handle EOF on stadin; this makes it impossible to
   use it in test scripts.  For example, something like this should
   work:

$ echo printenv | ./u-boot

   [As woraround I have to use ``echo 'printenv;reset' | ./u-boot'';
   this works, but is not really intuitive nore useful.]

3) For automatic test suites it would make a lot of sense if the
   return code of U-Boot was the return code of the last executed
   command (expecially when termination of U-Boot is the result of
   encountering EOF on stdin).


What do you think?

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
There is is no reason for any individual to have a computer in  their
home.  -- Ken Olsen (President of Digital Equipment Corporation),
  Convention of the World Future Society, in Boston, 1977
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] usb showed wrong device count

2012-04-22 Thread Ludovic Courtès
Hi,

Bob Liu  skribis:

> After patch: usb: Add support for multiple-LUN mass storage devices
> The usb device count isn't correct.

I don’t recall the details, but it worked for me on the GuruPlug.

What device are you using?

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


Re: [U-Boot] kwboot: Boot Marvell Kirkwood SoCs over a serial link.

2012-04-22 Thread Daniel Stodden
On Sun, 2012-04-22 at 11:46 -0700, Prafulla Wadaskar wrote:
> 
> > -Original Message-
> > From: u-boot-boun...@lists.denx.de [mailto:u-boot-
> > boun...@lists.denx.de] On Behalf Of Daniel Stodden
> > Sent: 22 April 2012 11:56
> > To: u-boot@lists.denx.de
> > Subject: [U-Boot] kwboot: Boot Marvell Kirkwood SoCs over a serial
> > link.
> > 
> > 
> > Hey.
> > 
> > I wrote a utility to boot Marvell SoCs over serial.
> > 
> > If that sounds generally useful, would you be so kind to merge
> > 
> > git://github.com/dns42/u-boot.git at dns/kwboot-1
> > 
> > If it's missing sth for that to happen, lemme know.
> > 
> 
> Hi Daniel
> 
> Yes, this will find very useful utility/tool.
> May you please post the patch for the same?

I git-mailed the delta.

Tweaked docs and whitespace a little since the original mail. Removing
some residual stuff I thought I'd eventually support, but so far don't
(like driving to debug mode etc.).

That bumped up my upstream branch revision to dns/kwboot-3.

Things were mostly tested with a qnap TS-219P+ board. Guess at this
point it should at least be good enough to leave plugcomputer folks etc
with a solid brick/unbrick perspective.

Ideas + overall input certainly welcome.

Cheers,
Daniel


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


[U-Boot] [PATCH] kwboot: Boot Marvell Kirkwood SoCs over a serial link.

2012-04-22 Thread Daniel Stodden
The kwboot program boots boards based on Marvell's Kirkwood platform
via Xmodem over their integrated UART.

Signed-off-by: Daniel Stodden 
---
 doc/kwboot.1   |   84 +++
 tools/Makefile |6 +
 tools/kwboot.c |  750 
 3 files changed, 840 insertions(+)
 create mode 100644 doc/kwboot.1
 create mode 100644 tools/kwboot.c

diff --git a/doc/kwboot.1 b/doc/kwboot.1
new file mode 100644
index 000..0d3eccd
--- /dev/null
+++ b/doc/kwboot.1
@@ -0,0 +1,84 @@
+.TH KWBOOT 1 "2012-03-05"
+
+.SH NAME
+kwboot \- Boot Marvell Kirkwood SoCs over a serial link.
+.SH SYNOPSIS
+.B kwboot
+.RB [ "-b \fIimage\fP" ]
+.RB [ "-t" ]
+.RB [...]
+.RB [\fITTY\fP]
+.SH "DESCRIPTION"
+
+The
+.B kwboot
+program boots boards based on Marvell's Kirkwood platform over their
+integrated UART. Boot image files will typically contain a second
+stage boot loader, such as U-Boot. The image file must conform to
+Marvell's BootROM firmware image format (\fIkwbimage\fP), created
+using a tool such as
+.B mkimage.
+
+Following power-up or a system reset, system BootROM code polls the
+UART for a brief period of time, sensing a handshake message which
+initiates an image upload. This program sends this boot message until
+it receives a positive acknowledgement. The image is transfered using
+Xmodem.
+
+Additionally, this program implements a minimal terminal mode, which
+can be used either standalone, or entered immediately following boot
+image transfer completion. This is often useful to catch early boot
+messages, or to manually interrupt a default boot procedure performed
+by the second-stage loader.
+
+.SH "OPTIONS"
+
+.TP
+.BI "\-b \fIimage\fP"
+Handshake; then upload file \fIimage\fP over \fITTY\fP. 
+
+Note that for the encapsulated boot code to be executed, \fIimage\fP
+must be of type "UART boot" (0x69). Boot images of different types,
+such as backup images of vendor firmware downloaded from flash memory
+(type 0x8B), will not work (or not as expected). See \fB-p\fP for a
+workaround.
+
+Unless \fB-q\fP is provided, this mode writes handshake status and
+upload progress indication to stdout.
+
+.TP
+.BI "\-p"
+In combination with \fB-b\fP, patches the header in \fIimage\fP prior
+to upload, to "UART boot" type.
+
+This option attempts on-the-fly conversion of some none-UART image
+types, such as images which were originally formatted to be stored in
+flash memory.
+
+Conversion is performed in-core. The contents of \fIimage\fP will not
+be altered.
+
+.TP
+.BI "\-t"
+Run a terminal program, connecting standard input and output to
+.RB \fITTY\fP.
+
+If used in combination with \fB-b\fP, terminal mode is entered
+immediately following a successful image upload.
+
+If standard I/O streams connect to a console, this mode will terminate
+after receiving 'ctrl-\\' followed by 'c' from console input.
+
+.TP
+.BI "\-B \fIbaudrate\fP"
+Adjust the baud rate on \fITTY\fP. Default rate is 115200.
+
+.SH "SEE ALSO"
+.PP
+\fBmkimage\fP(1)
+
+.SH "AUTHORS"
+
+Daniel Stodden 
+
+
diff --git a/tools/Makefile b/tools/Makefile
index 8993fdd..2a976f7 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -68,6 +68,7 @@ BIN_FILES-$(CONFIG_CMD_LOADS) += img2srec$(SFX)
 BIN_FILES-$(CONFIG_XWAY_SWAP_BYTES) += xway-swap-bytes$(SFX)
 BIN_FILES-y += mkenvimage$(SFX)
 BIN_FILES-y += mkimage$(SFX)
+BIN_FILES-y += kwboot$(SFX)
 BIN_FILES-$(CONFIG_SMDK5250) += mksmdk5250spl$(SFX)
 BIN_FILES-$(CONFIG_MX28) += mxsboot$(SFX)
 BIN_FILES-$(CONFIG_NETCONSOLE) += ncb$(SFX)
@@ -101,6 +102,7 @@ OBJ_FILES-$(CONFIG_NETCONSOLE) += ncb.o
 NOPED_OBJ_FILES-y += os_support.o
 OBJ_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1.o
 NOPED_OBJ_FILES-y += ublimage.o
+OBJ_FILES-y += kwboot.o
 
 # Don't build by default
 #ifeq ($(ARCH),ppc)
@@ -234,6 +236,10 @@ $(obj)ncb$(SFX):   $(obj)ncb.o
 $(obj)ubsha1$(SFX):$(obj)os_support.o $(obj)sha1.o $(obj)ubsha1.o
$(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
 
+$(obj)kwboot$(SFX): $(obj)kwboot.o
+   $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
+   $(HOSTSTRIP) $@
+
 # Some of the tool objects need to be accessed from outside the tools directory
 $(obj)%.o: $(SRCTREE)/common/%.c
$(HOSTCC) -g $(HOSTCFLAGS_NOPED) -c -o $@ $<
diff --git a/tools/kwboot.c b/tools/kwboot.c
new file mode 100644
index 000..65c50d2
--- /dev/null
+++ b/tools/kwboot.c
@@ -0,0 +1,750 @@
+/*
+ * Boot a Marvell Kirkwood SoC, with Xmodem over UART0.
+ *
+ * (c) 2012 Daniel Stodden 
+ *
+ * References: marvell.com, "88F6180, 88F6190, 88F6192, and 88F6281
+ *   Integrated Controller: Functional Specifications" December 2,
+ *   2008. Chapter 24.2 "BootROM Firmware".
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "kwbimage.h"
+
+#ifdef __GNUC__
+#define PACKED __attribute((packed))
+#else
+#define PACKED
+#endif
+
+/*
+ * Marvell BootROM UART Sensing
+ */
+
+static unsigned char kwboot_

[U-Boot] kwboot: Boot Marvell Kirkwood SoCs over a serial link.

2012-04-22 Thread Daniel Stodden
Hey.

I wrote a utility to boot Marvell SoCs over serial.

If that sounds generally useful, would you be so kind to merge

git://github.com/dns42/u-boot.git at dns/kwboot-1

If it's missing sth for that to happen, lemme know.

Cheers,
Daniel

PS: Sorry if you received this twice,
first mail got stuck in moderation.
 



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


Re: [U-Boot] 'run' no longer aborts on an error, can someone please verify

2012-04-22 Thread Timo Ketola
Dear Gray, Jason, Heiko, Simon,

I added you, Jason, Heiko and Simon, into the CC-list because there is
your commits in the history which seems somewhere to change the
behaviour below:

On 22.04.2012 00:55, Gray Remlin wrote:
> U-Boot v2012.04
> 
> Marvell>> setenv ipaddr '192.168.1.130'
> Marvell>> setenv ifhostisup 'ping 192.168.1.100'
> Marvell>> setenv saywearehappy 'echo "We are happy!"'
> Marvell>> run ifhostisup saywearehappy;
> Using egiga0 device
> ping failed; host 192.168.1.100 is not alive
> "We are happy!"
> Marvell>> 
> 
> This is not the same behaviour as my (unfortunately customised) version based 
> on the ancient U-Boot 2009.11
> Other commands are also effected, for example 'ide dev 0' would abort a 'run' 
> command if the device did not exist.
> 
> Is this my problem (corrupted source\compilation) or a change in policy ?

I took a quick glance over command/main.c. I think this is the "original
behaviour" (tree 9c506e 23 Aug 2011):

1374 /* OK - call function to do the command */
1375 if ((cmdtp->cmd) (cmdtp, flag, argc, argv) != 0) {
1376 rc = -1;
1377 }

run_command returns -1 on failure and

1407 if (run_command (arg, flag) == -1)
1408 return 1;

do_run exits the loop based on that.

Now (tree 762494 6 Mar 2012) builtin_run_command:

1341 rc = cmd_process(flag, argc, argv, &repeatable);

returns the exit code of the command but:

1366 if (builtin_run_command(cmd, flag) == -1)
1367 return 1;

run_command now depends on it to return -1 on failure. If I followed the
code right, this is clear change in the behaviour. I hope it is not
intentional and can be fixed because I have (too?) scripts that depends
on old behaviour. For example:

run get_update_from_usb erase_flash_and_write_it

Sequence must not continue to touching flash if load from USB fails.

--

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


[U-Boot] [PATCH 1/2] LCD: drawing 32bpp uncompressed bitmap image

2012-04-22 Thread Donghwa Lee
This patch supports drawing 32bpp uncompressed bitmap image.

Signed-off-by: Donghwa Lee 
Signed-off-by: Kyungmin.park 
---
 common/lcd.c |   26 ++
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index bf1a6a9..a7b04d2 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -645,14 +645,14 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 
bpix = NBITS(panel_info.vl_bpix);
 
-   if ((bpix != 1) && (bpix != 8) && (bpix != 16)) {
+   if ((bpix != 1) && (bpix != 8) && (bpix != 16) && (bpix != 32)) {
printf ("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n",
bpix, bmp_bpix);
return 1;
}
 
/* We support displaying 8bpp BMPs on 16bpp LCDs */
-   if (bpix != bmp_bpix && (bmp_bpix != 8 || bpix != 16)) {
+   if (bpix != bmp_bpix && (bmp_bpix != 8 || bpix != 16 || bpix != 32)) {
printf ("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n",
bpix,
le16_to_cpu(bmp->header.bit_count));
@@ -669,7 +669,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
cmap = (ushort *)fbi->palette;
 #elif defined(CONFIG_MPC823)
cmap = (ushort *)&(cp->lcd_cmap[255*sizeof(ushort)]);
-#elif !defined(CONFIG_ATMEL_LCD)
+#elif !defined(CONFIG_ATMEL_LCD) && !defined(CONFIG_EXYNOS_FB)
cmap = panel_info.cmap;
 #endif
 
@@ -739,8 +739,14 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
height = panel_info.vl_row - y;
 
bmap = (uchar *)bmp + le32_to_cpu (bmp->header.data_offset);
+
+#ifndef CONFIG_EXYNOS_FB
fb   = (uchar *) (lcd_base +
(y + height - 1) * lcd_line_length + x * bpix / 8);
+#else
+   fb = (uchar *) (lcd_base + (y + height) *
+   (panel_info.vl_col * (bpix / 8)) + x * (bpix / 8));
+#endif
 
switch (bmp_bpix) {
case 1: /* pass through */
@@ -788,9 +794,21 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
bmap += (padded_line - width) * 2;
fb   -= (width * 2 + lcd_line_length);
}
+
break;
 #endif /* CONFIG_BMP_16BPP */
-
+   case 32:
+   for (i = 0; i < height; ++i) {
+   for (j = 0; j < width; j++) {
+   *(fb++) = *(bmap++);
+   *(fb++) = *(bmap++);
+   *(fb++) = *(bmap++);
+   *(fb++) = *(bmap++);
+   }
+   fb  -= ((panel_info.vl_col *
+   (bpix / 8)) + width * (bpix / 8));
+   }
+   break;
default:
break;
};
-- 
1.7.4.1

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


[U-Boot] Pull request: Integrate latest yaffs2

2012-04-22 Thread Charles Manning
Hello all

I recently sent a message to the list announcing a method for patching in the 
latest yaffs2.

u-boot updated with the latest yaffs2 can be pulled from 
g...@github.com:cdhmanning/u-boot-yaffs2.git

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


Re: [U-Boot] [PATCH 1/2] S3C2440 : PLL Initialization should be SoC specific

2012-04-22 Thread Gabriel Huau
This patch can be cancel/ignore ... PLL initialization is BOARD-specific
and not SoC  So, now, no more problem about magic number in
others boards and management of s3c2410/s3c2440 :).

On Sun, Apr 22, 2012 at 11:32:18PM +0200, Marek Vasut wrote:
> Dear Gabriel Huau,
> 
> > On Sun, Apr 22, 2012 at 10:30:52PM +0200, Marek Vasut wrote:
> > > Dear Gabriel Huau,
> > > 
> > > > Signed-off-by: Gabriel Huau 
> > > > ---
> > > > 
> > > >  arch/arm/cpu/arm920t/s3c24x0/timer.c |   36
> > > > 
> > > > ++ board/mpl/vcma9/lowlevel_init.S 
> > > > |
> > > > 
> > > >  22 - board/samsung/smdk2410/smdk2410.c|   19
> > > > 
> > > > --
> > > > 
> > > >  3 files changed, 36 insertions(+), 41 deletions(-)
> > > > 
> > > > diff --git a/arch/arm/cpu/arm920t/s3c24x0/timer.c
> > > > b/arch/arm/cpu/arm920t/s3c24x0/timer.c index d8668be..7ff687c 100644
> > > > --- a/arch/arm/cpu/arm920t/s3c24x0/timer.c
> > > > +++ b/arch/arm/cpu/arm920t/s3c24x0/timer.c
> > > > @@ -37,8 +37,27 @@
> > > > 
> > > >  DECLARE_GLOBAL_DATA_PTR;
> > > > 
> > > > +#ifdef CONFIG_S3C2440
> > > > +/*
> > > > + * PLL/Clock configuration
> > > > + */
> > > > +/* FCLK = 405 MHz, HCLK = 101 MHz, PCLK = 50 MHz, UCLK = 48 MHz */
> > > > +#define CLKDIVN_VAL7
> > > > +#define M_MDIV 0x7f
> > > > +#define M_PDIV 0x2
> > > > +#define M_SDIV 0x1
> > > > +
> > > > +#define U_M_MDIV   0x38
> > > > +#define U_M_PDIV   0x2
> > > > +#define U_M_SDIV   0x2
> > > > +#endif
> > > 
> > > So after applying your patch, timer driver won't build for 2410 ?
> > 
> > Yes it will build, This patch is only for s3c2440. I just moved PLL
> > initialization of s3c2440 board to this file. I don't know if theses
> > values are correct for s3c2410 too.
> 
> I think these should be unified ... all these #ifdef blocks are stupid
> 
> > 
> > > > +
> > > > +   /* configure MPLL */
> > > > +   clk_power->mpllcon = ((M_MDIV << 12) + (M_PDIV << 4) + M_SDIV);
> > > > +
> > > > +   /* some delay between MPLL and UPLL */
> > > > +   __udelay(8000);
> > > > +#endif
> > > > +
> > > > 
> > > > return 0;
> > > >  
> > > >  }
> > > > 
> > > > diff --git a/board/mpl/vcma9/lowlevel_init.S
> > > > b/board/mpl/vcma9/lowlevel_init.S index dadaac7..4deb451 100644
> > > > --- a/board/mpl/vcma9/lowlevel_init.S
> > > > +++ b/board/mpl/vcma9/lowlevel_init.S
> > > > 
> > > > @@ -262,28 +262,6 @@ lowlevel_init:
> > > > cmp r3, r4
> > > > bne 0b
> > > > 
> > > > -   /* setup MPLL registers */
> > > > -   ldr r1, =CLKBASE
> > > > -   ldr r4, =0xFF
> > > > -   add r3, r2, #4  /* r3 points to PLL values */
> > > > -   str r4, [r1, #LOCKTIME]
> > > > -   ldmia   r3, {r4,r5}
> > > > -   str r5, [r1, #UPLLCON]  /* writing PLL register */
> > > > -   /* !! order seems to be 
> > > > important !! */
> > > > -   /* a little delay */
> > > > -   ldr r3, =0x4000
> > > > -0:
> > > > -   subsr3, r3, #1
> > > > -   bne 0b
> > > > -
> > > > -   str r4, [r1, #MPLLCON]  /* writing PLL register */
> > > > -   /* !! order seems to be 
> > > > important !! */
> > > > -   /* a little delay */
> > > > -   ldr r3, =0x4000
> > > > -0:
> > > > -   subsr3, r3, #1
> > > > -   bne 0b
> > > > -
> > > > 
> > > > /* everything is fine now */
> > > > mov pc, lr
> > > > 
> > > > diff --git a/board/samsung/smdk2410/smdk2410.c
> > > > b/board/samsung/smdk2410/smdk2410.c index e9ba922..3beb587 100644
> > > > --- a/board/samsung/smdk2410/smdk2410.c
> > > > +++ b/board/samsung/smdk2410/smdk2410.c
> > > > @@ -69,27 +69,8 @@ static inline void pll_delay(unsigned long loops)
> > > > 
> > > >  int board_early_init_f(void)
> > > >  {
> > > > 
> > > > -   struct s3c24x0_clock_power * const clk_power =
> > > > -   s3c24x0_get_base_clock_power();
> > > > 
> > > > struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
> > > > 
> > > > -   /* to reduce PLL lock time, adjust the LOCKTIME register */
> > > > -   writel(0xFF, &clk_power->locktime);
> > > > -
> > > > -   /* configure MPLL */
> > > > -   writel((M_MDIV << 12) + (M_PDIV << 4) + M_SDIV,
> > > > -  &clk_power->mpllcon);
> > > > -
> > > > -   /* some delay between MPLL and UPLL */
> > > > -   pll_delay(4000);
> > > > -
> > > > -   /* configure UPLL */
> > > > -   writel((U_M_MDIV << 12) + (U_M_PDIV << 4) + U_M_SDIV,
> > > > -  &clk_power->upllcon);
> > > > -
> > > > -   /* some delay between MPLL and UPLL */
> > > > -   pll_delay(8000);
> > > > -
> > > > 
> > > > /* set up the I/O ports */
> > > > writel(0x007F, &gpio->gpacon);
> > > > writel(0x00044555, &gpio->gpbcon);
> > >

Re: [U-Boot] [PATCH 1/2] S3C2440 : PLL Initialization should be SoC specific

2012-04-22 Thread Marek Vasut
Dear Gabriel Huau,

> On Sun, Apr 22, 2012 at 10:30:52PM +0200, Marek Vasut wrote:
> > Dear Gabriel Huau,
> > 
> > > Signed-off-by: Gabriel Huau 
> > > ---
> > > 
> > >  arch/arm/cpu/arm920t/s3c24x0/timer.c |   36
> > > 
> > > ++ board/mpl/vcma9/lowlevel_init.S 
> > > |
> > > 
> > >  22 - board/samsung/smdk2410/smdk2410.c|   19
> > > 
> > > --
> > > 
> > >  3 files changed, 36 insertions(+), 41 deletions(-)
> > > 
> > > diff --git a/arch/arm/cpu/arm920t/s3c24x0/timer.c
> > > b/arch/arm/cpu/arm920t/s3c24x0/timer.c index d8668be..7ff687c 100644
> > > --- a/arch/arm/cpu/arm920t/s3c24x0/timer.c
> > > +++ b/arch/arm/cpu/arm920t/s3c24x0/timer.c
> > > @@ -37,8 +37,27 @@
> > > 
> > >  DECLARE_GLOBAL_DATA_PTR;
> > > 
> > > +#ifdef CONFIG_S3C2440
> > > +/*
> > > + * PLL/Clock configuration
> > > + */
> > > +/* FCLK = 405 MHz, HCLK = 101 MHz, PCLK = 50 MHz, UCLK = 48 MHz */
> > > +#define CLKDIVN_VAL  7
> > > +#define M_MDIV   0x7f
> > > +#define M_PDIV   0x2
> > > +#define M_SDIV   0x1
> > > +
> > > +#define U_M_MDIV 0x38
> > > +#define U_M_PDIV 0x2
> > > +#define U_M_SDIV 0x2
> > > +#endif
> > 
> > So after applying your patch, timer driver won't build for 2410 ?
> 
> Yes it will build, This patch is only for s3c2440. I just moved PLL
> initialization of s3c2440 board to this file. I don't know if theses
> values are correct for s3c2410 too.

I think these should be unified ... all these #ifdef blocks are stupid

> 
> > > +
> > > + /* configure MPLL */
> > > + clk_power->mpllcon = ((M_MDIV << 12) + (M_PDIV << 4) + M_SDIV);
> > > +
> > > + /* some delay between MPLL and UPLL */
> > > + __udelay(8000);
> > > +#endif
> > > +
> > > 
> > >   return 0;
> > >  
> > >  }
> > > 
> > > diff --git a/board/mpl/vcma9/lowlevel_init.S
> > > b/board/mpl/vcma9/lowlevel_init.S index dadaac7..4deb451 100644
> > > --- a/board/mpl/vcma9/lowlevel_init.S
> > > +++ b/board/mpl/vcma9/lowlevel_init.S
> > > 
> > > @@ -262,28 +262,6 @@ lowlevel_init:
> > >   cmp r3, r4
> > >   bne 0b
> > > 
> > > - /* setup MPLL registers */
> > > - ldr r1, =CLKBASE
> > > - ldr r4, =0xFF
> > > - add r3, r2, #4  /* r3 points to PLL values */
> > > - str r4, [r1, #LOCKTIME]
> > > - ldmia   r3, {r4,r5}
> > > - str r5, [r1, #UPLLCON]  /* writing PLL register */
> > > - /* !! order seems to be important !! */
> > > - /* a little delay */
> > > - ldr r3, =0x4000
> > > -0:
> > > - subsr3, r3, #1
> > > - bne 0b
> > > -
> > > - str r4, [r1, #MPLLCON]  /* writing PLL register */
> > > - /* !! order seems to be important !! */
> > > - /* a little delay */
> > > - ldr r3, =0x4000
> > > -0:
> > > - subsr3, r3, #1
> > > - bne 0b
> > > -
> > > 
> > >   /* everything is fine now */
> > >   mov pc, lr
> > > 
> > > diff --git a/board/samsung/smdk2410/smdk2410.c
> > > b/board/samsung/smdk2410/smdk2410.c index e9ba922..3beb587 100644
> > > --- a/board/samsung/smdk2410/smdk2410.c
> > > +++ b/board/samsung/smdk2410/smdk2410.c
> > > @@ -69,27 +69,8 @@ static inline void pll_delay(unsigned long loops)
> > > 
> > >  int board_early_init_f(void)
> > >  {
> > > 
> > > - struct s3c24x0_clock_power * const clk_power =
> > > - s3c24x0_get_base_clock_power();
> > > 
> > >   struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
> > > 
> > > - /* to reduce PLL lock time, adjust the LOCKTIME register */
> > > - writel(0xFF, &clk_power->locktime);
> > > -
> > > - /* configure MPLL */
> > > - writel((M_MDIV << 12) + (M_PDIV << 4) + M_SDIV,
> > > -&clk_power->mpllcon);
> > > -
> > > - /* some delay between MPLL and UPLL */
> > > - pll_delay(4000);
> > > -
> > > - /* configure UPLL */
> > > - writel((U_M_MDIV << 12) + (U_M_PDIV << 4) + U_M_SDIV,
> > > -&clk_power->upllcon);
> > > -
> > > - /* some delay between MPLL and UPLL */
> > > - pll_delay(8000);
> > > -
> > > 
> > >   /* set up the I/O ports */
> > >   writel(0x007F, &gpio->gpacon);
> > >   writel(0x00044555, &gpio->gpbcon);
> > 
> > Magic?
> 
> I don't maintain theses boards, I just removed PLL initialization
> because I moved it. So for magic values in I/O port, we have to contact
> the maintainers :).

Good idea, please do :-)

> 
> > Best regards,
> > Marek Vasut

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] S3C2440 : PLL Initialization should be SoC specific

2012-04-22 Thread Gabriel Huau
On Sun, Apr 22, 2012 at 10:30:52PM +0200, Marek Vasut wrote:
> Dear Gabriel Huau,
> 
> > Signed-off-by: Gabriel Huau 
> > ---
> >  arch/arm/cpu/arm920t/s3c24x0/timer.c |   36
> > ++ board/mpl/vcma9/lowlevel_init.S  | 
> >  22 - board/samsung/smdk2410/smdk2410.c|   19
> > --
> >  3 files changed, 36 insertions(+), 41 deletions(-)
> > 
> > diff --git a/arch/arm/cpu/arm920t/s3c24x0/timer.c
> > b/arch/arm/cpu/arm920t/s3c24x0/timer.c index d8668be..7ff687c 100644
> > --- a/arch/arm/cpu/arm920t/s3c24x0/timer.c
> > +++ b/arch/arm/cpu/arm920t/s3c24x0/timer.c
> > @@ -37,8 +37,27 @@
> > 
> >  DECLARE_GLOBAL_DATA_PTR;
> > 
> > +#ifdef CONFIG_S3C2440
> > +/*
> > + * PLL/Clock configuration
> > + */
> > +/* FCLK = 405 MHz, HCLK = 101 MHz, PCLK = 50 MHz, UCLK = 48 MHz */
> > +#define CLKDIVN_VAL7
> > +#define M_MDIV 0x7f
> > +#define M_PDIV 0x2
> > +#define M_SDIV 0x1
> > +
> > +#define U_M_MDIV   0x38
> > +#define U_M_PDIV   0x2
> > +#define U_M_SDIV   0x2
> > +#endif
> 
> So after applying your patch, timer driver won't build for 2410 ?
> 

Yes it will build, This patch is only for s3c2440. I just moved PLL
initialization of s3c2440 board to this file. I don't know if theses
values are correct for s3c2410 too.

> > +
> > +   /* configure MPLL */
> > +   clk_power->mpllcon = ((M_MDIV << 12) + (M_PDIV << 4) + M_SDIV);
> > +
> > +   /* some delay between MPLL and UPLL */
> > +   __udelay(8000);
> > +#endif
> > +
> > return 0;
> >  }
> > 
> > diff --git a/board/mpl/vcma9/lowlevel_init.S
> > b/board/mpl/vcma9/lowlevel_init.S index dadaac7..4deb451 100644
> > --- a/board/mpl/vcma9/lowlevel_init.S
> > +++ b/board/mpl/vcma9/lowlevel_init.S
> > @@ -262,28 +262,6 @@ lowlevel_init:
> > cmp r3, r4
> > bne 0b
> > 
> > -   /* setup MPLL registers */
> > -   ldr r1, =CLKBASE
> > -   ldr r4, =0xFF
> > -   add r3, r2, #4  /* r3 points to PLL values */
> > -   str r4, [r1, #LOCKTIME]
> > -   ldmia   r3, {r4,r5}
> > -   str r5, [r1, #UPLLCON]  /* writing PLL register */
> > -   /* !! order seems to be important !! */
> > -   /* a little delay */
> > -   ldr r3, =0x4000
> > -0:
> > -   subsr3, r3, #1
> > -   bne 0b
> > -
> > -   str r4, [r1, #MPLLCON]  /* writing PLL register */
> > -   /* !! order seems to be important !! */
> > -   /* a little delay */
> > -   ldr r3, =0x4000
> > -0:
> > -   subsr3, r3, #1
> > -   bne 0b
> > -
> > /* everything is fine now */
> > mov pc, lr
> > 
> > diff --git a/board/samsung/smdk2410/smdk2410.c
> > b/board/samsung/smdk2410/smdk2410.c index e9ba922..3beb587 100644
> > --- a/board/samsung/smdk2410/smdk2410.c
> > +++ b/board/samsung/smdk2410/smdk2410.c
> > @@ -69,27 +69,8 @@ static inline void pll_delay(unsigned long loops)
> > 
> >  int board_early_init_f(void)
> >  {
> > -   struct s3c24x0_clock_power * const clk_power =
> > -   s3c24x0_get_base_clock_power();
> > struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
> > 
> > -   /* to reduce PLL lock time, adjust the LOCKTIME register */
> > -   writel(0xFF, &clk_power->locktime);
> > -
> > -   /* configure MPLL */
> > -   writel((M_MDIV << 12) + (M_PDIV << 4) + M_SDIV,
> > -  &clk_power->mpllcon);
> > -
> > -   /* some delay between MPLL and UPLL */
> > -   pll_delay(4000);
> > -
> > -   /* configure UPLL */
> > -   writel((U_M_MDIV << 12) + (U_M_PDIV << 4) + U_M_SDIV,
> > -  &clk_power->upllcon);
> > -
> > -   /* some delay between MPLL and UPLL */
> > -   pll_delay(8000);
> > -
> > /* set up the I/O ports */
> > writel(0x007F, &gpio->gpacon);
> > writel(0x00044555, &gpio->gpbcon);
> 
> Magic?
> 

I don't maintain theses boards, I just removed PLL initialization
because I moved it. So for magic values in I/O port, we have to contact
the maintainers :).

> Best regards,
> Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2 v4] Add support for MINI2440 (s3c2440).

2012-04-22 Thread Marek Vasut
Dear Gabriel Huau,

> ---
> Changes for v2:
>   - Coding style cleanup
>   - Remove unnecessary files modification
>   - Remove unnecessary board configuration set
> 
> Changes for v3:
>   - Coding style cleanup
>   - Move some macro definition from lowlevel_init.S
>   to a new header
>   - Remove some "magic bloat" with I/O board initialization
>   - Add a pll_delay and replace loop by it
>   - Somme cleanup in the configuration file
>   - Cancel modifications on an SoC specific header
>   - Add my name to copyright
> 
> Changes for v4:
>   - Move dram init to dram_init() instead low_levelinit
>   - Remove u-boot env from configuration file and change
>   the address of initial SP
>   - Remove PLL init, now it's SoC specific
> 
> Signed-off-by: Gabriel Huau 
> ---
>  board/friendlyarm/mini2440/Makefile   |   44 +++
>  board/friendlyarm/mini2440/mini2440.c |  121 +++
>  boards.cfg|1 +
>  include/configs/mini2440.h|  212
> + 4 files changed, 378 insertions(+)
>  create mode 100644 board/friendlyarm/mini2440/Makefile
>  create mode 100644 board/friendlyarm/mini2440/mini2440.c
>  create mode 100644 include/configs/mini2440.h
> 
> diff --git a/board/friendlyarm/mini2440/Makefile
> b/board/friendlyarm/mini2440/Makefile new file mode 100644
> index 000..b88e569
> --- /dev/null
> +++ b/board/friendlyarm/mini2440/Makefile
> @@ -0,0 +1,44 @@
> +#
> +# (C) Copyright 2012
> +# 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).o
> +
> +COBJS:= mini2440.o
> +
> +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
> +OBJS := $(addprefix $(obj),$(COBJS))
> +SOBJS:= $(addprefix $(obj),$(SOBJS))
> +
> +$(LIB):  $(obj).depend $(OBJS) $(SOBJS)
> + $(call cmd_link_o_target, $(OBJS) $(SOBJS))
> +
> +#
> +
> +# defines $(obj).depend target
> +include $(SRCTREE)/rules.mk
> +
> +sinclude $(obj).depend
> +
> +#
> diff --git a/board/friendlyarm/mini2440/mini2440.c
> b/board/friendlyarm/mini2440/mini2440.c new file mode 100644
> index 000..ab81939
> --- /dev/null
> +++ b/board/friendlyarm/mini2440/mini2440.c
> @@ -0,0 +1,121 @@
> +/*
> + * (C) Copyright 2002
> + * Sysgo Real-Time Solutions, GmbH 
> + * Marius Groeger 
> + *
> + * (C) Copyright 2002
> + * David Mueller, ELSOFT AG, 
> + *
> + * (C) Copyright 2009
> + * Michel Pollet 
> + *
> + * (C) Copyright 2012
> + * Gabriel Huau 
> + *
> + * 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 
> +#include 
> +#include 
> +#include 
> +
> +#ifdef CONFIG_DRIVER_DM9000
> +#include 
> +#endif

Just include it

> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +/*
> + * Miscellaneous platform dependent initialisations
> + */
> +int board_init(void)
> +{
> + struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
> +
> + /* set up the I/O ports */
> + writel(0x007F, &gpio->gpacon);
> + writel(0x00044555, &gpio->gpbcon);
> + writel(0x07FF, &gpio->gpbup);
> + writel(0x, &gpio->gpccon);
> + writel(0x, &gpio->gpcup);
> + writel(0x, &gpio->g

Re: [U-Boot] [PATCH 1/2] S3C2440 : PLL Initialization should be SoC specific

2012-04-22 Thread Marek Vasut
Dear Gabriel Huau,

> Signed-off-by: Gabriel Huau 
> ---
>  arch/arm/cpu/arm920t/s3c24x0/timer.c |   36
> ++ board/mpl/vcma9/lowlevel_init.S  | 
>  22 - board/samsung/smdk2410/smdk2410.c|   19
> --
>  3 files changed, 36 insertions(+), 41 deletions(-)
> 
> diff --git a/arch/arm/cpu/arm920t/s3c24x0/timer.c
> b/arch/arm/cpu/arm920t/s3c24x0/timer.c index d8668be..7ff687c 100644
> --- a/arch/arm/cpu/arm920t/s3c24x0/timer.c
> +++ b/arch/arm/cpu/arm920t/s3c24x0/timer.c
> @@ -37,8 +37,27 @@
> 
>  DECLARE_GLOBAL_DATA_PTR;
> 
> +#ifdef CONFIG_S3C2440
> +/*
> + * PLL/Clock configuration
> + */
> +/* FCLK = 405 MHz, HCLK = 101 MHz, PCLK = 50 MHz, UCLK = 48 MHz */
> +#define CLKDIVN_VAL  7
> +#define M_MDIV   0x7f
> +#define M_PDIV   0x2
> +#define M_SDIV   0x1
> +
> +#define U_M_MDIV 0x38
> +#define U_M_PDIV 0x2
> +#define U_M_SDIV 0x2
> +#endif

So after applying your patch, timer driver won't build for 2410 ?

> +
>  int timer_init(void)
>  {
> +#ifdef CONFIG_S3C2440
> + struct s3c24x0_clock_power * const clk_power =
> + s3c24x0_get_base_clock_power();
> +#endif

gc-sections will handle this

>   struct s3c24x0_timers *timers = s3c24x0_get_base_timers();
>   ulong tmr;
> 
> @@ -65,6 +84,23 @@ int timer_init(void)
>   gd->lastinc = 0;
>   gd->tbl = 0;
> 
> +#ifdef CONFIG_S3C2440

DTTO

> + /* to reduce PLL lock time, adjust the LOCKTIME register */
> + clk_power->locktime = 0xFF;

unexplained magic

> + clk_power->clkdivn = CLKDIVN_VAL;
> +
> + /* configure UPLL */
> + clk_power->upllcon = ((U_M_MDIV << 12) + (U_M_PDIV << 4) + U_M_SDIV);
> + /* some delay between MPLL and UPLL */
> + __udelay(10);

simple udelay() is ok.

> +
> + /* configure MPLL */
> + clk_power->mpllcon = ((M_MDIV << 12) + (M_PDIV << 4) + M_SDIV);
> +
> + /* some delay between MPLL and UPLL */
> + __udelay(8000);
> +#endif
> +
>   return 0;
>  }
> 
> diff --git a/board/mpl/vcma9/lowlevel_init.S
> b/board/mpl/vcma9/lowlevel_init.S index dadaac7..4deb451 100644
> --- a/board/mpl/vcma9/lowlevel_init.S
> +++ b/board/mpl/vcma9/lowlevel_init.S
> @@ -262,28 +262,6 @@ lowlevel_init:
>   cmp r3, r4
>   bne 0b
> 
> - /* setup MPLL registers */
> - ldr r1, =CLKBASE
> - ldr r4, =0xFF
> - add r3, r2, #4  /* r3 points to PLL values */
> - str r4, [r1, #LOCKTIME]
> - ldmia   r3, {r4,r5}
> - str r5, [r1, #UPLLCON]  /* writing PLL register */
> - /* !! order seems to be important !! */
> - /* a little delay */
> - ldr r3, =0x4000
> -0:
> - subsr3, r3, #1
> - bne 0b
> -
> - str r4, [r1, #MPLLCON]  /* writing PLL register */
> - /* !! order seems to be important !! */
> - /* a little delay */
> - ldr r3, =0x4000
> -0:
> - subsr3, r3, #1
> - bne 0b
> -
>   /* everything is fine now */
>   mov pc, lr
> 
> diff --git a/board/samsung/smdk2410/smdk2410.c
> b/board/samsung/smdk2410/smdk2410.c index e9ba922..3beb587 100644
> --- a/board/samsung/smdk2410/smdk2410.c
> +++ b/board/samsung/smdk2410/smdk2410.c
> @@ -69,27 +69,8 @@ static inline void pll_delay(unsigned long loops)
> 
>  int board_early_init_f(void)
>  {
> - struct s3c24x0_clock_power * const clk_power =
> - s3c24x0_get_base_clock_power();
>   struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
> 
> - /* to reduce PLL lock time, adjust the LOCKTIME register */
> - writel(0xFF, &clk_power->locktime);
> -
> - /* configure MPLL */
> - writel((M_MDIV << 12) + (M_PDIV << 4) + M_SDIV,
> -&clk_power->mpllcon);
> -
> - /* some delay between MPLL and UPLL */
> - pll_delay(4000);
> -
> - /* configure UPLL */
> - writel((U_M_MDIV << 12) + (U_M_PDIV << 4) + U_M_SDIV,
> -&clk_power->upllcon);
> -
> - /* some delay between MPLL and UPLL */
> - pll_delay(8000);
> -
>   /* set up the I/O ports */
>   writel(0x007F, &gpio->gpacon);
>   writel(0x00044555, &gpio->gpbcon);

Magic?

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [Yaffs] yaffs2 u-boot patching support

2012-04-22 Thread Charles Manning
On Friday 20 April 2012 09:40:50 Tom Rini wrote:
> On Mon, Apr 16, 2012 at 04:32:07PM +1200, Charles Manning wrote:
> > Hello ubooters and yaffsers
> >
> > I was commissioned to refresh yaffs2 in u-boot and add a mechanism to
> > support dynamic yaffs partition set up (way simpler than screwing around
> > with mtd part) and manual configuration.
> >
> >  Rather than do this as a once off, I set this scripting up so that this
> > can be done at any time (painlessly I hope) to bring in the fresh code
> > (as per Linux patching).
>
> Just to put this out there, if you're not submitting patches to get the
> code into git, should the current support in-tree be removed?

I think it is worth having yaffs in the main code base, but not the old stuff.

The primary reason to have a "patch-in" script is to allow people to refresh 
the yaffs they are using in a pretty painless way.

-- Charles

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


Re: [U-Boot] kwboot: Boot Marvell Kirkwood SoCs over a serial link.

2012-04-22 Thread Prafulla Wadaskar


> -Original Message-
> From: u-boot-boun...@lists.denx.de [mailto:u-boot-
> boun...@lists.denx.de] On Behalf Of Daniel Stodden
> Sent: 22 April 2012 11:56
> To: u-boot@lists.denx.de
> Subject: [U-Boot] kwboot: Boot Marvell Kirkwood SoCs over a serial
> link.
> 
> 
> Hey.
> 
> I wrote a utility to boot Marvell SoCs over serial.
> 
> If that sounds generally useful, would you be so kind to merge
> 
> git://github.com/dns42/u-boot.git at dns/kwboot-1
> 
> If it's missing sth for that to happen, lemme know.
> 

Hi Daniel

Yes, this will find very useful utility/tool.
May you please post the patch for the same?

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


[U-Boot] Pull request u-boot-blackfin.git (master branch)

2012-04-22 Thread Mike Frysinger
The following changes since commit 2790bf69dc12fb9aeb9836904e5f57c7f83d5552:

  Prepare v2012.04 (2012-04-21 18:55:26 +0200)

are available in the git repository at:
  git://www.denx.de/git/u-boot-blackfin.git master

Mike Frysinger (3):
  Blackfin: gd_t: relocate volatile markings
  Blackfin: move gd/bd to bss by default
  Blackfin: bfin_sdh: drop dos part hardcode

 arch/blackfin/include/asm/config.h  |8 +
 arch/blackfin/include/asm/global_data.h |2 +-
 arch/blackfin/lib/board.c   |   58 ++
 drivers/mmc/bfin_sdh.c  |1 -
 4 files changed, 44 insertions(+), 25 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] image/fit: drop inline markings on parser code

2012-04-22 Thread Mike Frysinger
Putting "inline" on extern funcs makes no sense, so drop them.

Signed-off-by: Mike Frysinger 
---
 common/image.c  |4 ++--
 include/image.h |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/image.c b/common/image.c
index 342b315..91954ac 100644
--- a/common/image.c
+++ b/common/image.c
@@ -1829,7 +1829,7 @@ static int fit_parse_spec(const char *spec, char sepc, 
ulong addr_curr,
  * addr and conf_name are set accordingly
  * 0 otherwise
  */
-inline int fit_parse_conf(const char *spec, ulong addr_curr,
+int fit_parse_conf(const char *spec, ulong addr_curr,
ulong *addr, const char **conf_name)
 {
return fit_parse_spec(spec, '#', addr_curr, addr, conf_name);
@@ -1855,7 +1855,7 @@ inline int fit_parse_conf(const char *spec, ulong 
addr_curr,
  * addr and image_name are set accordingly
  * 0 otherwise
  */
-inline int fit_parse_subimage(const char *spec, ulong addr_curr,
+int fit_parse_subimage(const char *spec, ulong addr_curr,
ulong *addr, const char **image_name)
 {
return fit_parse_spec(spec, ':', addr_curr, addr, image_name);
diff --git a/include/image.h b/include/image.h
index a1c6e4e..aa9daa2 100644
--- a/include/image.h
+++ b/include/image.h
@@ -531,9 +531,9 @@ static inline int image_check_target_arch(const 
image_header_t *hdr)
 #define FIT_MAX_HASH_LEN   20  /* max(crc32_len(4), sha1_len(20)) */
 
 /* cmdline argument format parsing */
-inline int fit_parse_conf(const char *spec, ulong addr_curr,
+int fit_parse_conf(const char *spec, ulong addr_curr,
ulong *addr, const char **conf_name);
-inline int fit_parse_subimage(const char *spec, ulong addr_curr,
+int fit_parse_subimage(const char *spec, ulong addr_curr,
ulong *addr, const char **image_name);
 
 void fit_print_contents(const void *fit);
-- 
1.7.8.5

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


[U-Boot] [PATCH 3/3] init_func: Use for eNET board

2012-04-22 Thread Graeme Russ

Signed-off-by: Graeme Russ 
---
 arch/x86/cpu/cpu.c   |3 +++
 arch/x86/cpu/sc520/sc520_sdram.c |3 +++
 arch/x86/cpu/sc520/sc520_timer.c |2 ++
 arch/x86/lib/init_helpers.c  |   14 ++
 arch/x86/lib/init_wrappers.c |   11 ++-
 arch/x86/lib/pcat_interrupts.c   |2 ++
 arch/x86/lib/relocate.c  |4 
 board/eNET/eNET.c|5 +
 common/console.c |3 +++
 common/env_dataflash.c   |1 +
 common/env_eeprom.c  |1 +
 common/env_fat.c |1 +
 common/env_flash.c   |2 ++
 common/env_mgdisk.c  |1 +
 common/env_mmc.c |1 +
 common/env_nand.c|1 +
 common/env_nowhere.c |1 +
 common/env_nvram.c   |1 +
 common/env_onenand.c |1 +
 common/env_sf.c  |1 +
 common/serial.c  |2 ++
 common/stdio.c   |2 ++
 include/configs/eNET.h   |1 +
 23 files changed, 63 insertions(+), 1 deletions(-)

diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
index e9bb0d7..263df28 100644
--- a/arch/x86/cpu/cpu.c
+++ b/arch/x86/cpu/cpu.c
@@ -33,6 +33,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -137,6 +138,7 @@ int x86_cpu_init_f(void)
return 0;
 }
 int cpu_init_f(void) __attribute__((weak, alias("x86_cpu_init_f")));
+INIT_FUNC(cpu_init_f, cpu_f, RESET, , SDRAM);
 
 int x86_cpu_init_r(void)
 {
@@ -145,6 +147,7 @@ int x86_cpu_init_r(void)
return 0;
 }
 int cpu_init_r(void) __attribute__((weak, alias("x86_cpu_init_r")));
+INIT_FUNC(cpu_init_r, cpu_r, mem_malloc_init_r, , );
 
 void x86_enable_caches(void)
 {
diff --git a/arch/x86/cpu/sc520/sc520_sdram.c b/arch/x86/cpu/sc520/sc520_sdram.c
index 9dc1334..7033e18 100644
--- a/arch/x86/cpu/sc520/sc520_sdram.c
+++ b/arch/x86/cpu/sc520/sc520_sdram.c
@@ -22,6 +22,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -51,6 +52,7 @@ int dram_init_f(void)
 
return 0;
 }
+INIT_FUNC(dram_init_f, dram_f, console_init_f, , SDRAM);
 
 static inline void sc520_dummy_write(void)
 {
@@ -477,3 +479,4 @@ int dram_init(void)
 
return 0;
 }
+INIT_FUNC(dram_init, dram_r, , board_early_init_r, );
diff --git a/arch/x86/cpu/sc520/sc520_timer.c b/arch/x86/cpu/sc520/sc520_timer.c
index 41f121f..7b25c08 100644
--- a/arch/x86/cpu/sc520/sc520_timer.c
+++ b/arch/x86/cpu/sc520/sc520_timer.c
@@ -25,6 +25,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -69,6 +70,7 @@ int timer_init(void)
 
return 0;
 }
+INIT_FUNC(timer_init, timer, interrupt_init, , );
 
 /* Allow boards to override udelay implementation */
 void __udelay(unsigned long usec)
diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c
index 9f4dee0..aa88048 100644
--- a/arch/x86/lib/init_helpers.c
+++ b/arch/x86/lib/init_helpers.c
@@ -21,6 +21,7 @@
  * MA 02111-1307 USA
  */
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -50,6 +51,7 @@ int display_banner(void)
 
return 0;
 }
+INIT_FUNC(display_banner, banner, timer_init, , );
 
 int display_dram_config(void)
 {
@@ -64,12 +66,14 @@ int display_dram_config(void)
 
return 0;
 }
+INIT_FUNC(display_dram_config, display_dram, display_banner, , );
 
 int init_baudrate_f(void)
 {
gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE);
return 0;
 }
+INIT_FUNC(init_baudrate_f, display_dram, env_init, , );
 
 int calculate_relocation_address(void)
 {
@@ -106,6 +110,7 @@ int calculate_relocation_address(void)
 
return 0;
 }
+INIT_FUNC(calculate_relocation_address, calc_reloc, dram_init_f, , );
 
 int copy_gd_to_ram_f_r(void)
 {
@@ -131,12 +136,14 @@ int copy_gd_to_ram_f_r(void)
 
return 0;
 }
+INIT_FUNC(copy_gd_to_ram_f_r, copy_gd, SDRAM, , RELOC);
 
 int init_cache_f_r(void)
 {
/* Initialise the CPU cache(s) */
return init_cache();
 }
+INIT_FUNC(init_cache_f_r, cache_f_r, copy_gd_to_ram_f_r, , RELOC);
 
 int set_reloc_flag_r(void)
 {
@@ -144,6 +151,7 @@ int set_reloc_flag_r(void)
 
return 0;
 }
+INIT_FUNC(set_reloc_flag_r, reloc_flag, RELOC, , );
 
 int mem_malloc_init_r(void)
 {
@@ -152,6 +160,7 @@ int mem_malloc_init_r(void)
 
return 0;
 }
+INIT_FUNC(mem_malloc_init_r, malloc, init_bd_struct_r, , );
 
 bd_t bd_data;
 
@@ -162,6 +171,7 @@ int init_bd_struct_r(void)
 
return 0;
 }
+INIT_FUNC(init_bd_struct_r, bd_struct, set_reloc_flag_r, , );
 
 #ifndef CONFIG_SYS_NO_FLASH
 int flash_init_r(void)
@@ -177,6 +187,7 @@ int flash_init_r(void)
 
return 0;
 }
+INIT_FUNC(flash_init_r, flash_r, RELOC, serial_initialize_r 
display_dram_config, );
 #endif
 
 int init_ip_address_r(void)
@@ -186,6 +197,7 @@ int init_ip_address_r(void)
 
return 0;
 }
+INIT_FUNC(init_ip_address_r, ip_address, env_relocate_r, , pci_init_r 
stdio_init);
 
 #ifdef CONFIG_STATUS_LED
 int status_led_s

[U-Boot] [PATCH 2/3] init_func: Add x86 support

2012-04-22 Thread Graeme Russ

Signed-off-by: Graeme Russ 
---
 arch/x86/cpu/u-boot.lds |   23 +++
 arch/x86/lib/board.c|   10 +++---
 2 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/arch/x86/cpu/u-boot.lds b/arch/x86/cpu/u-boot.lds
index fe28030..b88fd57 100644
--- a/arch/x86/cpu/u-boot.lds
+++ b/arch/x86/cpu/u-boot.lds
@@ -28,6 +28,27 @@ ENTRY(_start)
 
 SECTIONS
 {
+#ifdef MAKE_INIT_LDS
+   .initfuncs : { KEEP(*(.initfuncs*)) }
+
+   /DISCARD/ : { *(.text*) }
+   /DISCARD/ : { *(.debug*) }
+   /DISCARD/ : { *(.u_boot_cmd*) }
+   /DISCARD/ : { *(.rodata*) }
+   /DISCARD/ : { *(.data*) }
+   /DISCARD/ : { *(.dynsym*) }
+   /DISCARD/ : { *(.hash*) }
+   /DISCARD/ : { *(.bss*) }
+   /DISCARD/ : { *(.bss) }
+   /DISCARD/ : { *(.rel.dyn*) }
+   /DISCARD/ : { *(.rel.dyn) }
+   /DISCARD/ : { *(.dynstr*) }
+   /DISCARD/ : { *(.dynamic*) }
+   /DISCARD/ : { *(.plt*) }
+   /DISCARD/ : { *(.interp*) }
+   /DISCARD/ : { *(.gnu*) }
+   /DISCARD/ : { *(.comment*) }
+#else
. = CONFIG_SYS_TEXT_BASE;   /* Location of bootcode in flash */
__text_start = .;
.text  : { *(.text*); }
@@ -72,6 +93,7 @@ SECTIONS
/DISCARD/ : { *(.plt*) }
/DISCARD/ : { *(.interp*) }
/DISCARD/ : { *(.gnu*) }
+   /DISCARD/ : { *(.initfuncs*) }
 
/* 16bit realmode trampoline code */
.realmode REALMODE_BASE : AT ( LOADADDR(.rel.dyn) + SIZEOF(.rel.dyn) ) 
{ KEEP(*(.realmode)) }
@@ -94,4 +116,5 @@ SECTIONS
 
. = RESET_VEC_LOC;
.resetvec : AT (CONFIG_SYS_TEXT_BASE + (CONFIG_SYS_MONITOR_LEN - 
RESET_SEG_SIZE + RESET_VEC_LOC)) { KEEP(*(.resetvec)); }
+#endif
 }
diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index 5f0b62c..5789581 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -32,6 +32,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -77,13 +78,7 @@
  *  - All remaining initialisation
  */
 
-/*
- * The requirements for any new initalization function is simple: it is
- * a function with no parameters which returns an integer return code,
- * where 0 means "continue" and != 0 means "fatal error, hang the system"
- */
-typedef int (init_fnc_t) (void);
-
+#ifndef CONFIG_INIT_FUNC
 /*
  * init_sequence_f is the list of init functions which are run when U-Boot
  * is executing from Flash with a limited 'C' environment. The following
@@ -206,6 +201,7 @@ init_fnc_t *init_sequence_r[] = {
 #endif
NULL,
 };
+#endif
 
 static void do_init_loop(init_fnc_t **init_fnc_ptr)
 {
-- 
1.7.7.6

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


[U-Boot] [PATCH 1/3] init_func: Add fundamental framework

2012-04-22 Thread Graeme Russ

Signed-off-by: Graeme Russ 
---
 Makefile |   34 ++-
 common/Makefile  |2 +
 config.mk|2 +
 doc/README.INIT_FUNC |   65 +++
 include/init_func.h  |   37 ++
 tools/Makefile   |6 +
 tools/mkinitseq.c| 1512 ++
 7 files changed, 1657 insertions(+), 1 deletions(-)
 create mode 100644 doc/README.INIT_FUNC
 create mode 100644 include/init_func.h
 create mode 100644 tools/mkinitseq.c

diff --git a/Makefile b/Makefile
index cdd4294..62d9f81 100644
--- a/Makefile
+++ b/Makefile
@@ -467,8 +467,40 @@ GEN_UBOOT = \
-Map u-boot.map -o u-boot
 endif
 
+ifeq ($(CONFIG_INIT_FUNC),y)
+INIT_SEQ = $(obj)init_seq.o
+
+GEN_UBOOT_INIT = \
+   UNDEF_SYM=`$(OBJDUMP) -x $(LIBBOARD) $(LIBS) | \
+   sed  -n -e 
's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
+   cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM 
$(__OBJS) \
+   --start-group $(__LIBS) --end-group \
+   -Map u-boot-init.map -o u-boot-init
+
+$(obj)u-boot-init.lds: $(LDSCRIPT)
+   $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ 
-DMAKE_INIT_LDS -P - <$^ >$@
+
+$(obj)u-boot-init: depend \
+   $(SUBDIR_TOOLS) $(OBJS) $(LIBBOARD) $(LIBS) 
$(obj)u-boot-init.lds
+   $(GEN_UBOOT_INIT)
+
+$(obj)u-boot-init.bin: $(obj)u-boot-init
+   $(OBJCOPY) -j .initfuncs -O binary $< $@
+
+$(obj)init_seq.c:  depend \
+   $(obj)u-boot-init.bin
+   $(obj)tools/mkinitseq $(obj)u-boot-init.bin 
$(obj)common/init_seq.c
+
+$(obj)init_seq.o:  depend \
+   $(obj)init_seq.c
+   $(MAKE) BUILD_INIT_SEQ=y -C common all
+else
+INIT_SEQ =
+endif
+
 $(obj)u-boot:  depend \
-   $(SUBDIR_TOOLS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT) 
$(obj)u-boot.lds
+   $(SUBDIR_TOOLS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT) \
+   $(INIT_SEQ) $(obj)u-boot.lds
$(GEN_UBOOT)
 ifeq ($(CONFIG_KALLSYMS),y)
smap=`$(call SYSTEM_MAP,u-boot) | \
diff --git a/common/Makefile b/common/Makefile
index d9f10f3..02a4485 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -195,6 +195,8 @@ COBJS-y += dlmalloc.o
 COBJS-y += memsize.o
 COBJS-y += stdio.o
 
+# initialisation sequence (second build stage)
+COBJS-$(BUILD_INIT_SEQ) += init_seq.o
 
 COBJS  := $(sort $(COBJS-y))
 XCOBJS := $(sort $(XCOBJS-y))
diff --git a/config.mk b/config.mk
index fa33e62..2124b84 100644
--- a/config.mk
+++ b/config.mk
@@ -257,6 +257,8 @@ ifneq ($(CONFIG_SYS_TEXT_BASE),)
 LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
 endif
 
+LDFLAGS_u-boot-init += -T $(obj)u-boot-init.lds $(LDFLAGS_FINAL)
+
 LDFLAGS_u-boot-spl += -T $(obj)u-boot-spl.lds $(LDFLAGS_FINAL)
 ifneq ($(CONFIG_SPL_TEXT_BASE),)
 LDFLAGS_u-boot-spl += -Ttext $(CONFIG_SPL_TEXT_BASE)
diff --git a/doc/README.INIT_FUNC b/doc/README.INIT_FUNC
new file mode 100644
index 000..f9a0b18
--- /dev/null
+++ b/doc/README.INIT_FUNC
@@ -0,0 +1,65 @@
+The INIT_FUNC macro allows initialisation functions (i.e. functions which are
+executed before the main loop) to be easily added to the init sequence
+
+
+Specifying an Initialisation Function and is Dependencies
+-
+The format of the INIT_FUNC macro is:
+
+INIT_FUNC(fn, grp, man_reqs, pre_reqs, pst_reqs)
+
+fn is the name of the init function to call. This function must have the
+following prototype:
+
+int foo(void);
+
+Each init function must return 0 to indicate success - any other return value
+indicates failure and the init sequence will stop
+
+grp is the name of the group that the init function belongs to. grp may be
+the same as fn for any individual init function, but between init functions,
+fn and grp must be unique.
+
+The purpose of groups is to allow functions to be grouped together so other
+functions can specify the group as a whole as a dependency rather than having
+to list every function in the group in the dependency list
+
+man_reqs is a space seperated list of functions or groups that MUST exist and
+MUST run BEFORE fn
+
+pre_reqs is a space seperated list of functions or groups that MAY exist and
+(if they do) MUST run BEFORE fn
+
+pst_reqs is a space seperated list of functions or groups that MAY exist and
+(if they do) MUST run AFTER fn
+
+Skipping or Replacing a Function or Group
+-
+Occassionally, a board may provide a completely seperate implementation for
+an initialisation function that is provided in the common arch, SoC or
+common code.
+
+SKIP_INIT(fn_or_group)
+
+After the initialisation function dependencies are calculated, all functions
+and groups listed in any SKIP_INITs are removed - This may result in
+dependent functions being removed - It is up to the board code developer
+to ensure suitable replacements are in place
+
+REPLACE_INIT(

[U-Boot] [PATCH 0/3] Initialisation Sequence Framework

2012-04-22 Thread Graeme Russ
Well here it is (finally) - My Initialisation Sequence Framework

This series is limited to x86 and is controlled by CONFIG_INIT_FUNC so
no other arch should be effected. I don't have any cross compilers, so I
would appreciate if others could confirm the zero impact assertion

Asbestos suit on

Fire away ;)

Regards,

Graeme

Graeme Russ (3):
  init_func: Add fundamental framework
  init_func: Add x86 support
  init_func: Use for eNET board

 Makefile |   34 +-
 arch/x86/cpu/cpu.c   |3 +
 arch/x86/cpu/sc520/sc520_sdram.c |3 +
 arch/x86/cpu/sc520/sc520_timer.c |2 +
 arch/x86/cpu/u-boot.lds  |   23 +
 arch/x86/lib/board.c |   10 +-
 arch/x86/lib/init_helpers.c  |   14 +
 arch/x86/lib/init_wrappers.c |   11 +-
 arch/x86/lib/pcat_interrupts.c   |2 +
 arch/x86/lib/relocate.c  |4 +
 board/eNET/eNET.c|5 +
 common/Makefile  |2 +
 common/console.c |3 +
 common/env_dataflash.c   |1 +
 common/env_eeprom.c  |1 +
 common/env_fat.c |1 +
 common/env_flash.c   |2 +
 common/env_mgdisk.c  |1 +
 common/env_mmc.c |1 +
 common/env_nand.c|1 +
 common/env_nowhere.c |1 +
 common/env_nvram.c   |1 +
 common/env_onenand.c |1 +
 common/env_sf.c  |1 +
 common/serial.c  |2 +
 common/stdio.c   |2 +
 config.mk|2 +
 doc/README.INIT_FUNC |   65 ++
 include/configs/eNET.h   |1 +
 include/init_func.h  |   37 +
 tools/Makefile   |6 +
 tools/mkinitseq.c| 1512 ++
 32 files changed, 1746 insertions(+), 9 deletions(-)
 create mode 100644 doc/README.INIT_FUNC
 create mode 100644 include/init_func.h
 create mode 100644 tools/mkinitseq.c

-- 
1.7.7.6

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


[U-Boot] kwboot: Boot Marvell Kirkwood SoCs over a serial link.

2012-04-22 Thread Daniel Stodden

Hey.

I wrote a utility to boot Marvell SoCs over serial.

If that sounds generally useful, would you be so kind to merge

git://github.com/dns42/u-boot.git at dns/kwboot-1

If it's missing sth for that to happen, lemme know.

Cheers,
Daniel


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


Re: [U-Boot] [PATCH] Add support s3c2440 NAND controller

2012-04-22 Thread Ilya Averyanov
2012/4/19 Ilya Averyanov 

>  arch/arm/include/asm/arch-s3c24x0/s3c2410.h |4 +-
>  arch/arm/include/asm/arch-s3c24x0/s3c2440.h |4 +-
>  arch/arm/include/asm/arch-s3c24x0/s3c24x0.h |   13 +-
>  drivers/mtd/nand/Makefile   |3 +-
>  drivers/mtd/nand/s3c2410_nand.c |  189 ---
>  drivers/mtd/nand/s3c24x0_nand.c |  268
> +++
>  6 files changed, 283 insertions(+), 198 deletions(-)
>  delete mode 100644 drivers/mtd/nand/s3c2410_nand.c
>  create mode 100644 drivers/mtd/nand/s3c24x0_nand.c
>
> diff --git a/arch/arm/include/asm/arch-s3c24x0/s3c2410.h
> b/arch/arm/include/asm/arch-s3c24x0/s3c2410.h
> index 4fbdf20..71eb33e 100644
> --- a/arch/arm/include/asm/arch-s3c24x0/s3c2410.h
> +++ b/arch/arm/include/asm/arch-s3c24x0/s3c2410.h
> @@ -99,9 +99,9 @@ static inline struct s3c24x0_lcd
> *s3c24x0_get_base_lcd(void)
>  return (struct s3c24x0_lcd *)S3C24X0_LCD_BASE;
>  }
>
> -static inline struct s3c2410_nand *s3c2410_get_base_nand(void)
> +static inline struct s3c24x0_nand *s3c24x0_get_base_nand(void)
>  {
> -return (struct s3c2410_nand *)S3C2410_NAND_BASE;
> +return (struct s3c24x0_nand *)S3C2410_NAND_BASE;
>  }
>
>  static inline struct s3c24x0_uart
> diff --git a/arch/arm/include/asm/arch-s3c24x0/s3c2440.h
> b/arch/arm/include/asm/arch-s3c24x0/s3c2440.h
> index 8c606e3..8b9a5b0 100644
> --- a/arch/arm/include/asm/arch-s3c24x0/s3c2440.h
> +++ b/arch/arm/include/asm/arch-s3c24x0/s3c2440.h
> @@ -97,9 +97,9 @@ static inline struct s3c24x0_lcd
> *s3c24x0_get_base_lcd(void)
>  return (struct s3c24x0_lcd *)S3C24X0_LCD_BASE;
>  }
>
> -static inline struct s3c2440_nand *s3c2440_get_base_nand(void)
> +static inline struct s3c24x0_nand *s3c24x0_get_base_nand(void)
>  {
> -return (struct s3c2440_nand *)S3C2440_NAND_BASE;
> +return (struct s3c24x0_nand *)S3C2440_NAND_BASE;
>  }
>
>  static inline struct s3c24x0_uart
> diff --git a/arch/arm/include/asm/arch-s3c24x0/s3c24x0.h
> b/arch/arm/include/asm/arch-s3c24x0/s3c24x0.h
> index ca978c9..d82251d 100644
> --- a/arch/arm/include/asm/arch-s3c24x0/s3c24x0.h
> +++ b/arch/arm/include/asm/arch-s3c24x0/s3c24x0.h
> @@ -151,20 +151,19 @@ struct s3c24x0_lcd {
>  };
>
>
> +
> +struct s3c24x0_nand {
>  #ifdef CONFIG_S3C2410
>  /* NAND FLASH (see S3C2410 manual chapter 6) */
> -struct s3c2410_nand {
>  u32nfconf;
>  u32nfcmd;
>  u32nfaddr;
>  u32nfdata;
>  u32nfstat;
>  u32nfecc;
> -};
>  #endif
>  #ifdef CONFIG_S3C2440
>  /* NAND FLASH (see S3C2440 manual chapter 6) */
> -struct s3c2440_nand {
>  u32nfconf;
>  u32nfcont;
>  u32nfcmd;
> @@ -176,8 +175,14 @@ struct s3c2440_nand {
>  u32nfstat;
>  u32nfstat0;
>  u32nfstat1;
> -};
> +u32 nfmecc0;
> + u32 nfmecc1;
> + u32 nfsecc;
> +u32 nfsblk;
> +u32 nfeblk;
>  #endif
> +};
> +
>
>
>  /* UART (see manual chapter 11) */
> diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
> index 1d1b628..b080cf7 100644
> --- a/drivers/mtd/nand/Makefile
> +++ b/drivers/mtd/nand/Makefile
> @@ -58,7 +58,8 @@ COBJS-$(CONFIG_NAND_MXC) += mxc_nand.o
>  COBJS-$(CONFIG_NAND_MXS) += mxs_nand.o
>  COBJS-$(CONFIG_NAND_NDFC) += ndfc.o
>  COBJS-$(CONFIG_NAND_NOMADIK) += nomadik.o
> -COBJS-$(CONFIG_NAND_S3C2410) += s3c2410_nand.o
> +COBJS-$(CONFIG_NAND_S3C2410) += s3c24x0_nand.o
> +COBJS-$(CONFIG_NAND_S3C2440) += s3c24x0_nand.o
>  COBJS-$(CONFIG_NAND_S3C64XX) += s3c64xx.o
>  COBJS-$(CONFIG_NAND_SPEAR) += spr_nand.o
>  COBJS-$(CONFIG_NAND_OMAP_GPMC) += omap_gpmc.o
> diff --git a/drivers/mtd/nand/s3c2410_nand.c
> b/drivers/mtd/nand/s3c2410_nand.c
> deleted file mode 100644
> index e1a459b..000
> --- a/drivers/mtd/nand/s3c2410_nand.c
> +++ /dev/null
> @@ -1,189 +0,0 @@
> -/*
> - * (C) Copyright 2006 OpenMoko, Inc.
> - * Author: Harald Welte 
> - *
> - * 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 
> -
> -#include 
> -#include 
> -#include 
> -
> -#define S3C2410_NFCONF_EN  (1<<15)
> -#define S3C2410_NFCONF_512BYTE (1<<14)
> -#define S3C2410_NFCONF_4STEP   (1<<13)
> -#define S3C2410_NFCONF_INITECC (1<<12)
> -#define S3C2410_NFCONF_nFCE(1<<11)
> -#define S3C2410_NFCONF_TACLS(x)((x)<<8)
> -

Re: [U-Boot] [STATUS] v2012.04-rc2 and -rc3 are out

2012-04-22 Thread Simon Glass
Hi Wolfgang,

On Sun, Apr 22, 2012 at 3:25 AM, Wolfgang Denk  wrote:
> Dear Simon Glass,
>
> In message 
>  you 
> wrote:
>>
>> This fixes a sandbox problem where we use the wrong parser if someone
>> removes the CONFIG_SYS_HUSH_PARSER option:
>>
>> http://patchwork.ozlabs.org/patch/149810/
>
> Does this not also require the other (at least the previous 2) patches
> of this series?

No it is independent, those add run_command_list(), this patch just
updates recently added sandbox code to use run_command().

Regards,
Simon

>
>
> 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
> You can't have everything... where would you put it?  - Steven Wright
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Pull request: u-boot-nds32

2012-04-22 Thread Macpaul Lin
Dear Wolfgang,

Please pull the following 4 patches into your tree.

Thanks!
Macpaul Lin.


The following changes since commit 2790bf69dc12fb9aeb9836904e5f57c7f83d5552:

  Prepare v2012.04 (2012-04-21 18:55:26 +0200)

are available in the git repository at:
  git://git.denx.de/u-boot-nds32.git master

Macpaul Lin (4):
  nds32/ag102: add header support of ag102 soc
  nds32/ag102: add ag102 soc support
  board/adp-ag102: add board specific files
  board/adp-ag102: add configuration of adp-ag102

 MAINTAINERS|1 +
 arch/nds32/cpu/n1213/ag102/Makefile|   58 +
 arch/nds32/cpu/n1213/ag102/asm-offsets.c   |   54 
 arch/nds32/cpu/n1213/ag102/cpu.c   |  195 +++
 arch/nds32/cpu/n1213/ag102/lowlevel_init.S |  297 ++
 arch/nds32/cpu/n1213/ag102/timer.c |  205 +++
 arch/nds32/cpu/n1213/ag102/watchdog.S  |   49 
 arch/nds32/include/asm/arch-ag102/ag102.h  |   97 +++
 arch/nds32/include/asm/mach-types.h|   14 +
 board/AndesTech/adp-ag102/Makefile |   43 
 board/AndesTech/adp-ag102/adp-ag102.c  |  107 
 boards.cfg |1 +
 doc/README.ag102   |   36 +++
 include/configs/adp-ag102.h|  375 
 14 files changed, 1532 insertions(+), 0 deletions(-)
 create mode 100644 arch/nds32/cpu/n1213/ag102/Makefile
 create mode 100644 arch/nds32/cpu/n1213/ag102/asm-offsets.c
 create mode 100644 arch/nds32/cpu/n1213/ag102/cpu.c
 create mode 100644 arch/nds32/cpu/n1213/ag102/lowlevel_init.S
 create mode 100644 arch/nds32/cpu/n1213/ag102/timer.c
 create mode 100644 arch/nds32/cpu/n1213/ag102/watchdog.S
 create mode 100644 arch/nds32/include/asm/arch-ag102/ag102.h
 create mode 100644 board/AndesTech/adp-ag102/Makefile
 create mode 100644 board/AndesTech/adp-ag102/adp-ag102.c
 create mode 100644 doc/README.ag102
 create mode 100644 include/configs/adp-ag102.h



-- 
Best regards,
Macpaul Lin
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 2/4] nds32/ag102: add ag102 soc support

2012-04-22 Thread Macpaul Lin
Hi Macpaul,

2012/2/28 Macpaul Lin :
> From: Macpaul Lin 
>
> Add lowlevel ag102 soc support.
>
> Signed-off-by: Macpaul Lin 
> ---
> Changes for v2:
>  - cpu.c:
>   - 1. Remove unused variables.
>   - 2. Replace while(1) in do_reset by hang().
>   - 3. Clean up other coding styles.
>  - timer.c: remove unneccessary static declaration
> Changes for v3:
>  - watchdog.S: add support macro in linkage.h
>

Applied to u-boot-nds32/master,

Thanks.
-- 
Best regards,
Macpaul Lin
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/4] nds32/ag102: add header support of ag102 soc

2012-04-22 Thread Macpaul Lin
Hi Macpaul,

2012/2/28 Macpaul Lin :
> From: Macpaul Lin 
>
> Add device address offsets header of ag102 soc.
> Add ag102 into mach-types.h.
> Add asm-offsets.c for helping convert C headers into asm.
>
> Signed-off-by: Macpaul Lin 
> ---
> Changes for v2-v3:
>  - No change.

Applied to u-boot-nds32/master,

Thanks.
-- 
Best regards,
Macpaul Lin
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 3/4] board/adp-ag102: add board specific files

2012-04-22 Thread Macpaul Lin
Hi Macpaul,

2012/2/28 Macpaul Lin 
>
> From: Macpaul Lin 
>
> Add board specific files.
>
> Signed-off-by: Macpaul Lin 
> ---
> Changes for v2-v3:
>  - No change.
>
>  board/AndesTech/adp-ag102/Makefile    |   43 +
>  board/AndesTech/adp-ag102/adp-ag102.c |  107 
> +
>  2 files changed, 150 insertions(+), 0 deletions(-)
>  create mode 100644 board/AndesTech/adp-ag102/Makefile
>  create mode 100644 board/AndesTech/adp-ag102/adp-ag102.c
>
> diff --git a/board/AndesTech/adp-ag102/Makefile 
> b/board/AndesTech/adp-ag102/Makefile


Applied to u-boot-nds32/master,

Thanks.
--
Best regards,
Macpaul Lin
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 4/4] board/adp-ag102: add configuration of adp-ag102

2012-04-22 Thread Macpaul Lin
Hi Macpaul,

2012/2/28 Macpaul Lin 

> From: Macpaul Lin 
>
> board:
> Add config file of board adp-ag102
> Add adp-ag102 into boards.cfg
> Add adp-ag102 into MAINTAINERS
>
> doc:
> add README of ag102
>
> Signed-off-by: Macpaul Lin 
>

Applied to u-boot-nds32/master,

Thanks.
-- 
Best regards,
Macpaul Lin
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2 v4] Add support for MINI2440 (s3c2440).

2012-04-22 Thread Gabriel Huau
---
Changes for v2:
- Coding style cleanup
- Remove unnecessary files modification
- Remove unnecessary board configuration set

Changes for v3:
- Coding style cleanup
- Move some macro definition from lowlevel_init.S
to a new header
- Remove some "magic bloat" with I/O board initialization
- Add a pll_delay and replace loop by it
- Somme cleanup in the configuration file
- Cancel modifications on an SoC specific header
- Add my name to copyright

Changes for v4:
- Move dram init to dram_init() instead low_levelinit
- Remove u-boot env from configuration file and change
the address of initial SP
- Remove PLL init, now it's SoC specific

Signed-off-by: Gabriel Huau 
---
 board/friendlyarm/mini2440/Makefile   |   44 +++
 board/friendlyarm/mini2440/mini2440.c |  121 +++
 boards.cfg|1 +
 include/configs/mini2440.h|  212 +
 4 files changed, 378 insertions(+)
 create mode 100644 board/friendlyarm/mini2440/Makefile
 create mode 100644 board/friendlyarm/mini2440/mini2440.c
 create mode 100644 include/configs/mini2440.h

diff --git a/board/friendlyarm/mini2440/Makefile 
b/board/friendlyarm/mini2440/Makefile
new file mode 100644
index 000..b88e569
--- /dev/null
+++ b/board/friendlyarm/mini2440/Makefile
@@ -0,0 +1,44 @@
+#
+# (C) Copyright 2012
+# 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).o
+
+COBJS  := mini2440.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/friendlyarm/mini2440/mini2440.c 
b/board/friendlyarm/mini2440/mini2440.c
new file mode 100644
index 000..ab81939
--- /dev/null
+++ b/board/friendlyarm/mini2440/mini2440.c
@@ -0,0 +1,121 @@
+/*
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH 
+ * Marius Groeger 
+ *
+ * (C) Copyright 2002
+ * David Mueller, ELSOFT AG, 
+ *
+ * (C) Copyright 2009
+ * Michel Pollet 
+ *
+ * (C) Copyright 2012
+ * Gabriel Huau 
+ *
+ * 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 
+#include 
+#include 
+#include 
+
+#ifdef CONFIG_DRIVER_DM9000
+#include 
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ * Miscellaneous platform dependent initialisations
+ */
+int board_init(void)
+{
+   struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
+
+   /* set up the I/O ports */
+   writel(0x007F, &gpio->gpacon);
+   writel(0x00044555, &gpio->gpbcon);
+   writel(0x07FF, &gpio->gpbup);
+   writel(0x, &gpio->gpccon);
+   writel(0x, &gpio->gpcup);
+   writel(0x, &gpio->gpdcon);
+   writel(0x, &gpio->gpdup);
+   writel(0x, &gpio->gpecon);
+   writel(0x, &gpio->gpeup);
+   writel(0x55AA, &gpio->gpfcon);
+   writel(0x00FF, &gpio->gpfup);
+   writel(0xFF95FFBA, &gpio->gpgcon);
+   writel(0xF

[U-Boot] [PATCH 1/2] S3C2440 : PLL Initialization should be SoC specific

2012-04-22 Thread Gabriel Huau
Signed-off-by: Gabriel Huau 
---
 arch/arm/cpu/arm920t/s3c24x0/timer.c |   36 ++
 board/mpl/vcma9/lowlevel_init.S  |   22 -
 board/samsung/smdk2410/smdk2410.c|   19 --
 3 files changed, 36 insertions(+), 41 deletions(-)

diff --git a/arch/arm/cpu/arm920t/s3c24x0/timer.c 
b/arch/arm/cpu/arm920t/s3c24x0/timer.c
index d8668be..7ff687c 100644
--- a/arch/arm/cpu/arm920t/s3c24x0/timer.c
+++ b/arch/arm/cpu/arm920t/s3c24x0/timer.c
@@ -37,8 +37,27 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifdef CONFIG_S3C2440
+/*
+ * PLL/Clock configuration
+ */
+/* FCLK = 405 MHz, HCLK = 101 MHz, PCLK = 50 MHz, UCLK = 48 MHz */
+#define CLKDIVN_VAL7
+#define M_MDIV 0x7f
+#define M_PDIV 0x2
+#define M_SDIV 0x1
+
+#define U_M_MDIV   0x38
+#define U_M_PDIV   0x2
+#define U_M_SDIV   0x2
+#endif
+
 int timer_init(void)
 {
+#ifdef CONFIG_S3C2440
+   struct s3c24x0_clock_power * const clk_power =
+   s3c24x0_get_base_clock_power();
+#endif
struct s3c24x0_timers *timers = s3c24x0_get_base_timers();
ulong tmr;
 
@@ -65,6 +84,23 @@ int timer_init(void)
gd->lastinc = 0;
gd->tbl = 0;
 
+#ifdef CONFIG_S3C2440
+   /* to reduce PLL lock time, adjust the LOCKTIME register */
+   clk_power->locktime = 0xFF;
+   clk_power->clkdivn = CLKDIVN_VAL;
+
+   /* configure UPLL */
+   clk_power->upllcon = ((U_M_MDIV << 12) + (U_M_PDIV << 4) + U_M_SDIV);
+   /* some delay between MPLL and UPLL */
+   __udelay(10);
+
+   /* configure MPLL */
+   clk_power->mpllcon = ((M_MDIV << 12) + (M_PDIV << 4) + M_SDIV);
+
+   /* some delay between MPLL and UPLL */
+   __udelay(8000);
+#endif
+
return 0;
 }
 
diff --git a/board/mpl/vcma9/lowlevel_init.S b/board/mpl/vcma9/lowlevel_init.S
index dadaac7..4deb451 100644
--- a/board/mpl/vcma9/lowlevel_init.S
+++ b/board/mpl/vcma9/lowlevel_init.S
@@ -262,28 +262,6 @@ lowlevel_init:
cmp r3, r4
bne 0b
 
-   /* setup MPLL registers */
-   ldr r1, =CLKBASE
-   ldr r4, =0xFF
-   add r3, r2, #4  /* r3 points to PLL values */
-   str r4, [r1, #LOCKTIME]
-   ldmia   r3, {r4,r5}
-   str r5, [r1, #UPLLCON]  /* writing PLL register */
-   /* !! order seems to be important !! */
-   /* a little delay */
-   ldr r3, =0x4000
-0:
-   subsr3, r3, #1
-   bne 0b
-
-   str r4, [r1, #MPLLCON]  /* writing PLL register */
-   /* !! order seems to be important !! */
-   /* a little delay */
-   ldr r3, =0x4000
-0:
-   subsr3, r3, #1
-   bne 0b
-
/* everything is fine now */
mov pc, lr
 
diff --git a/board/samsung/smdk2410/smdk2410.c 
b/board/samsung/smdk2410/smdk2410.c
index e9ba922..3beb587 100644
--- a/board/samsung/smdk2410/smdk2410.c
+++ b/board/samsung/smdk2410/smdk2410.c
@@ -69,27 +69,8 @@ static inline void pll_delay(unsigned long loops)
 
 int board_early_init_f(void)
 {
-   struct s3c24x0_clock_power * const clk_power =
-   s3c24x0_get_base_clock_power();
struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
 
-   /* to reduce PLL lock time, adjust the LOCKTIME register */
-   writel(0xFF, &clk_power->locktime);
-
-   /* configure MPLL */
-   writel((M_MDIV << 12) + (M_PDIV << 4) + M_SDIV,
-  &clk_power->mpllcon);
-
-   /* some delay between MPLL and UPLL */
-   pll_delay(4000);
-
-   /* configure UPLL */
-   writel((U_M_MDIV << 12) + (U_M_PDIV << 4) + U_M_SDIV,
-  &clk_power->upllcon);
-
-   /* some delay between MPLL and UPLL */
-   pll_delay(8000);
-
/* set up the I/O ports */
writel(0x007F, &gpio->gpacon);
writel(0x00044555, &gpio->gpbcon);
-- 
1.7.9.5

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


[U-Boot] [PATCH 0/2] Add support for MINI2440

2012-04-22 Thread Gabriel Huau
These patches add the support for the mini2440 (s3c2440 arm). Currently, I'm
supporting only boot from NOR. The first patch move the PLL initialization
to SoC specific directory. I also changed boards which depend on this SoC.

Gabriel Huau (2):
  S3C2440 : PLL Initialization should be SoC specific
  Add support for MINI2440 (s3c2440).

 arch/arm/cpu/arm920t/s3c24x0/timer.c  |   36 ++
 board/friendlyarm/mini2440/Makefile   |   44 +++
 board/friendlyarm/mini2440/mini2440.c |  121 +++
 board/mpl/vcma9/lowlevel_init.S   |   22 
 board/samsung/smdk2410/smdk2410.c |   19 ---
 boards.cfg|1 +
 include/configs/mini2440.h|  212 +
 7 files changed, 414 insertions(+), 41 deletions(-)
 create mode 100644 board/friendlyarm/mini2440/Makefile
 create mode 100644 board/friendlyarm/mini2440/mini2440.c
 create mode 100644 include/configs/mini2440.h

-- 
1.7.9.5

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