Re: [U-Boot] [PATCH v2 3/5] usb:gadget: USB Mass Storage - files from Linux kernel

2011-10-07 Thread Lukasz Majewski
Hi Wolfgang,

> Dear Lukasz Majewski,
> 
> In message <1310567392-29082-4-git-send-email-l.majew...@samsung.com>
> you wrote:
> > Two files from Linux kernel source tree have been ported
> > to u-boot (Linux Kernel v2.6.34):
> > 
> > File file_storage.c
> > commit 2ecdc82ef0b03e67ce5ecee79d0d108177a704df
> > Author: Christoph Hellwig 
> > Date:   Tue Jan 26 17:27:20 2010 +0100
> > 
> > kill unused invalidate_inode_pages helper
> > 
> > File storage_common.c
> > commit d26a6aa08b9f12b44fb1ee65625e7480d3d5bb81
> > Author: Michal Nazarewicz 
> > Date:   Mon Nov 9 14:15:23 2009 +0100
> > 
> > USB: g_mass_storage: code cleaned up and comments updated
> > 
> > In order to work with u-boot, changed were made.
> > 
> > Signed-off-by: Lukasz Majewski 
> > Signed-off-by: Andrzej Pietrasiewicz 
> > Signed-off-by: Kyungmin Park 
> > Cc: Minkyu Kang 
> > Cc: Remy Bohmer 
> > ---
> >  drivers/usb/gadget/file_storage.c   | 3536
> > +++
> > drivers/usb/gadget/storage_common.c |  765  2 files
> > changed, 4301 insertions(+), 0 deletions(-) create mode 100644
> > drivers/usb/gadget/file_storage.c create mode 100644
> > drivers/usb/gadget/storage_common.c
> 
> Checkpatch says:
> 
> total: 184 errors, 27 warnings, 4301 lines checked
> 
> Please clean up and resubmit.  Thanks.
> 

I'd like to ask about rules for porting - moving files from Linux.

As you can see this file is directly taken from Linux kernel. This code
has been accepted to kernel mainline.

So shall I:
1. Submit this patch again as is and
2. Post a separate patch to remove "warnings and errors" with my sign
off?

or:

1. Mangle this patch with my correction (186 errors is a lot) and then
resubmit it with my name included at sign-off?
Then it won't be anymore a file taken directly from Linux kernel.
Moreover we will duplicate code, since two different patches with two
identical functionality will emerge.

I'm a bit confused now...

-- 
Best regards,

Lukasz Majewski

Samsung Poland R&D Center
Platform Group
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/5 v2] microblaze: Call common console_init_f initialization function

2011-10-07 Thread Michal Simek
Calling console_init_f enables CTRL+C usage.

Signed-off-by: Michal Simek 

---
v2: Fix commit message - origin subject
"microblaze: Support CTRL+C when tftp is running"
---
 arch/microblaze/lib/board.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index d97543b..5510c12 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -68,6 +68,7 @@ typedef int (init_fnc_t) (void);
 init_fnc_t *init_sequence[] = {
env_init,
serial_init,
+   console_init_f,
 #ifdef CONFIG_SYS_GPIO_0
gpio_init,
 #endif
-- 
1.5.5.6

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


[U-Boot] [PATCH 2/5 v4] microblaze: Support flashes on lower addresses

2011-10-07 Thread Michal Simek
Signed-off-by: Michal Simek 

---
v2: Change symbol references provided by a linker script

v3: Move externs to header

v4: Add license and copyright with #ifdef protection
---
 arch/microblaze/include/asm/processor.h |   32 ++-
 arch/microblaze/lib/board.c |5 
 2 files changed, 36 insertions(+), 1 deletions(-)

diff --git a/arch/microblaze/include/asm/processor.h 
b/arch/microblaze/include/asm/processor.h
index 78b8976..2295d0a 100644
--- a/arch/microblaze/include/asm/processor.h
+++ b/arch/microblaze/include/asm/processor.h
@@ -1 +1,31 @@
-/* FIXME: Implement this! */
+/*
+ * Copyright (C) 2011 Michal Simek 
+ *
+ * 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
+ */
+
+#ifndef __ASM_MICROBLAZE_PROCESSOR_H
+#define __ASM_MICROBLAZE_PROCESSOR_H
+
+/* References to section boundaries */
+
+extern char __end[];
+extern char __text_start[];
+
+#endif /* __ASM_MICROBLAZE_PROCESSOR_H */
diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index 5510c12..df27c1c 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -84,6 +85,8 @@ init_fnc_t *init_sequence[] = {
NULL,
 };
 
+unsigned long monitor_flash_len;
+
 void board_init (void)
 {
bd_t *bd;
@@ -105,6 +108,8 @@ void board_init (void)
bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
gd->flags |= GD_FLG_RELOC;  /* tell others: relocation done */
 
+   monitor_flash_len = __end - __text_start;
+
/*
 * The Malloc area is immediately below the monitor copy in DRAM
 * aka CONFIG_SYS_MONITOR_BASE - Note there is no need for reloc_off
-- 
1.5.5.6

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


[U-Boot] [PATCH 3/5 v3] microblaze: Initialize jumptable and console

2011-10-07 Thread Michal Simek
This changes were done to get support for netconsole.

Signed-off-by: Michal Simek 

---
v2: Fix commit message

v3: Fix coding style
---
 arch/microblaze/lib/board.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index df27c1c..d677329 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -166,6 +166,12 @@ void board_init (void)
/* Initialize stdio devices */
stdio_init ();
 
+   /* Initialize the jump table for applications */
+   jumptable_init();
+
+   /* Initialize the console (after the relocation and devices init) */
+   console_init_r();
+
if ((s = getenv ("loadaddr")) != NULL) {
load_addr = simple_strtoul (s, NULL, 16);
}
-- 
1.5.5.6

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


[U-Boot] [PATCH 4/5 v2] microblaze: Fix unaligned.h for endians

2011-10-07 Thread Michal Simek
Also support little endian MB.

Signed-off-by: Michal Simek 

---
v2: Use asm-generic unaligned code
---
 arch/microblaze/include/asm/unaligned.h |   17 +
 1 files changed, 1 insertions(+), 16 deletions(-)

diff --git a/arch/microblaze/include/asm/unaligned.h 
b/arch/microblaze/include/asm/unaligned.h
index 785c2e9..6cecbbb 100644
--- a/arch/microblaze/include/asm/unaligned.h
+++ b/arch/microblaze/include/asm/unaligned.h
@@ -1,16 +1 @@
-#ifndef _ASM_MICROBLAZE_UNALIGNED_H
-#define _ASM_MICROBLAZE_UNALIGNED_H
-
-#ifdef __KERNEL__
-
-/*
- * The Microblaze can do unaligned accesses itself in big endian mode.
- */
-#include 
-#include 
-
-#define get_unaligned  __get_unaligned_be
-#define put_unaligned  __put_unaligned_be
-
-#endif /* __KERNEL__ */
-#endif /* _ASM_MICROBLAZE_UNALIGNED_H */
+#include 
-- 
1.5.5.6

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


[U-Boot] [PATCH 5/5 v2] microblaze: Copy bootfile from variables

2011-10-07 Thread Michal Simek
Setup bootfile.

Signed-off-by: Michal Simek 

---
v2: Move getenv assignment out of if
---
 arch/microblaze/lib/board.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index d677329..ca5882d 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -186,6 +186,10 @@ void board_init (void)
uchar enetaddr[6];
eth_getenv_enetaddr("ethaddr", enetaddr);
printf("MAC:   %pM\n", enetaddr);
+
+   s = getenv("bootfile");
+   if (s != NULL)
+   copy_filename(BootFile, s, sizeof(BootFile));
 #endif
 
/* main_loop */
-- 
1.5.5.6

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


Re: [U-Boot] [PATCH] UBI: fix endless loop when a bitflip was detected

2011-10-07 Thread Holger Brunck
Hi Wolfgang,

Wolfgang Denk wrote:
> In message <1315904833-11430-1-git-send-email-holger.bru...@keymile.com> you 
> wrote:
>> On km_kirkwood boards we saw that u-boot gets stuck if the
>> UBI layer detects a correctable bitflip in the NAND flash
>> when u-boot tries to attach to the UBI device.
>>
>> This was already fixed in the UBI layer in the current
>> mainline linux. The original commit was:
>>
>> "commit b86a2c56e512f46d140a4bcb4e35e8a7d4a99a4b
>> Author: Artem Bityutskiy 
>> Date:   Sun May 24 14:13:34 2009 +0300
>>

[...]

>>
>> Signed-off-by: Holger Brunck 
>> cc: Stefan Roese 
>> ---
>>  drivers/mtd/ubi/build.c |9 +
>>  drivers/mtd/ubi/eba.c   |8 ++--
>>  drivers/mtd/ubi/ubi.h   |   10 --
>>  drivers/mtd/ubi/wl.c|   43 +--
>>  4 files changed, 60 insertions(+), 10 deletions(-)
> 
> Checkpatch says:
> 
> total: 0 errors, 2 warnings, 166 lines checked
> 
> Please clean up and resubmit.  Thanks.
> 

I already made the request to drop this patch. Please take a look at:
http://lists.denx.de/pipermail/u-boot/2011-September/101888.html

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


Re: [U-Boot] [PATCH v2 1/5] usb:gadget:s5p USB Device Controller (UDC) implementation

2011-10-07 Thread Lukasz Majewski
On Fri, 07 Oct 2011 00:10:48 +0200
Wolfgang Denk  wrote:

> Dear Lukasz Majewski,
> 
> In message <1310567392-29082-2-git-send-email-l.majew...@samsung.com>
> you wrote:
> > This commit provides UDC driver support for Samsung's SoC
> > family of processors.
> > 
> > Signed-off-by: Lukasz Majewski 
> > Signed-off-by: Marek Szyprowski 
> > Signed-off-by: Kyungmin Park 
> > Cc: Minkyu Kang 
> > Cc: Remy Bohmer 
> > 
> > ---
> > Changes for v2:
> > - Coding cleanups and fixes
> > - s3c_udc* files history and origination added
> > - regs-otg.h rewritten to use structs instedad of
> >   #defines
> > ---
> >  drivers/usb/gadget/Makefile   |6 +-
> >  drivers/usb/gadget/regs-otg.h |  209 +
> >  drivers/usb/gadget/s3c_udc_otg.c  |  892 ++
> >  drivers/usb/gadget/s3c_udc_otg_xfer_dma.c | 1419
> > +
> > include/usb/lin_gadget_compat.h   |   66 ++
> > include/usb/s3c_udc.h |  160  6 files
> > changed, 2749 insertions(+), 3 deletions(-) create mode 100644
> > drivers/usb/gadget/regs-otg.h create mode 100644
> > drivers/usb/gadget/s3c_udc_otg.c create mode 100644
> > drivers/usb/gadget/s3c_udc_otg_xfer_dma.c create mode 100644
> > include/usb/lin_gadget_compat.h create mode 100644
> > include/usb/s3c_udc.h
> 
> Checkpatch says:
> 
> total: 0 errors, 16 warnings, 2758 lines checked
> 
> Please clean up and resubmit.  Thanks.
> 
> Best regards,
> 
> Wolfgang Denk
> 

Hi Wolfgang,

I've run the checkpatch from 3.1 Linux Kernel.

Output can be seen at:
http://pastebin.com/KjAKUhx0

Most warnings are related to lines over 80 characters. 
This code is a debug code. As fair as I remember debug print code shall
not be break in Linux kernel for easier debugging.

I don't know what is the policy in u-boot. I haven't seen any guideline
about breaking debug code when it is larger than 80 characters (so I
stick to kernel policy).

Other warnings are related to kernel API (like the min() macro usage)
which is different in u-boot.

-- 
Best regards,

Lukasz Majewski

Samsung Poland R&D Center
Platform Group
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/3 v2] net: emaclite: Setup RX/TX ping pong for every instance

2011-10-07 Thread Michal Simek
Setup RX/TX ping-pong buffer for every emaclite IP separately.
The next patch move initialization directly to board code.

Signed-off-by: Michal Simek 

---
v2: Fix coding style violations
---
 drivers/net/xilinx_emaclite.c |  123 ++--
 1 files changed, 68 insertions(+), 55 deletions(-)

diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c
index 8e574cd..9342476 100644
--- a/drivers/net/xilinx_emaclite.c
+++ b/drivers/net/xilinx_emaclite.c
@@ -66,6 +66,8 @@
 struct xemaclite {
u32 nexttxbuffertouse;  /* Next TX buffer to write to */
u32 nextrxbuffertouse;  /* Next RX buffer to read from */
+   u32 txpp;   /* TX ping pong buffer */
+   u32 rxpp;   /* RX ping pong buffer */
 };
 
 static u32 etherrxbuff[PKTSIZE_ALIGN/4]; /* Receive buffer */
@@ -131,6 +133,7 @@ static void emaclite_halt(struct eth_device *dev)
 
 static int emaclite_init(struct eth_device *dev, bd_t *bis)
 {
+   struct xemaclite *emaclite = dev->priv;
debug ("EmacLite Initialization Started\n");
 
 /*
@@ -150,28 +153,28 @@ static int emaclite_init(struct eth_device *dev, bd_t 
*bis)
XEL_TSR_PROG_MAC_ADDR) != 0)
;
 
-#ifdef CONFIG_XILINX_EMACLITE_TX_PING_PONG
-   /* The same operation with PONG TX */
-   out_be32 (dev->iobase + XEL_TSR_OFFSET + XEL_BUFFER_OFFSET, 0);
-   xemaclite_alignedwrite(dev->enetaddr, dev->iobase +
-   XEL_BUFFER_OFFSET, ENET_ADDR_LENGTH);
-   out_be32 (dev->iobase + XEL_TPLR_OFFSET, ENET_ADDR_LENGTH);
-   out_be32 (dev->iobase + XEL_TSR_OFFSET + XEL_BUFFER_OFFSET,
-   XEL_TSR_PROG_MAC_ADDR);
-   while ((in_be32 (dev->iobase + XEL_TSR_OFFSET +
-   XEL_BUFFER_OFFSET) & XEL_TSR_PROG_MAC_ADDR) != 0)
-   ;
-#endif
+   if (emaclite->txpp) {
+   /* The same operation with PONG TX */
+   out_be32 (dev->iobase + XEL_TSR_OFFSET + XEL_BUFFER_OFFSET, 0);
+   xemaclite_alignedwrite(dev->enetaddr, dev->iobase +
+   XEL_BUFFER_OFFSET, ENET_ADDR_LENGTH);
+   out_be32 (dev->iobase + XEL_TPLR_OFFSET, ENET_ADDR_LENGTH);
+   out_be32 (dev->iobase + XEL_TSR_OFFSET + XEL_BUFFER_OFFSET,
+   XEL_TSR_PROG_MAC_ADDR);
+   while ((in_be32 (dev->iobase + XEL_TSR_OFFSET +
+   XEL_BUFFER_OFFSET) & XEL_TSR_PROG_MAC_ADDR) != 0)
+   ;
+   }
 
 /*
  * RX - RX_PING & RX_PONG initialization
  */
/* Write out the value to flush the RX buffer */
out_be32 (dev->iobase + XEL_RSR_OFFSET, XEL_RSR_RECV_IE_MASK);
-#ifdef CONFIG_XILINX_EMACLITE_RX_PING_PONG
-   out_be32 (dev->iobase + XEL_RSR_OFFSET + XEL_BUFFER_OFFSET,
-   XEL_RSR_RECV_IE_MASK);
-#endif
+
+   if (emaclite->rxpp)
+   out_be32 (dev->iobase + XEL_RSR_OFFSET + XEL_BUFFER_OFFSET,
+   XEL_RSR_RECV_IE_MASK);
 
debug ("EmacLite Initialization complete\n");
return 0;
@@ -221,10 +224,10 @@ static int emaclite_send (struct eth_device *dev, 
volatile void *ptr, int len)
printf ("Error: Timeout waiting for ethernet TX buffer\n");
/* Restart PING TX */
out_be32 (dev->iobase + XEL_TSR_OFFSET, 0);
-#ifdef CONFIG_XILINX_EMACLITE_TX_PING_PONG
-   out_be32 (dev->iobase + XEL_TSR_OFFSET +
-   XEL_BUFFER_OFFSET, 0);
-#endif
+   if (emaclite->txpp) {
+   out_be32 (dev->iobase + XEL_TSR_OFFSET +
+   XEL_BUFFER_OFFSET, 0);
+   }
return -1;
}
 
@@ -237,9 +240,9 @@ static int emaclite_send (struct eth_device *dev, volatile 
void *ptr, int len)
&& ((in_be32 ((baseaddress) + XEL_TSR_OFFSET)
& XEL_TSR_XMIT_ACTIVE_MASK) == 0)) {
 
-#ifdef CONFIG_XILINX_EMACLITE_TX_PING_PONG
-   emaclite->nexttxbuffertouse ^= XEL_BUFFER_OFFSET;
-#endif
+   if (emaclite->txpp)
+   emaclite->nexttxbuffertouse ^= XEL_BUFFER_OFFSET;
+
debug ("Send packet from 0x%x\n", baseaddress);
/* Write the frame to the buffer */
xemaclite_alignedwrite ((void *) ptr, baseaddress, len);
@@ -253,28 +256,30 @@ static int emaclite_send (struct eth_device *dev, 
volatile void *ptr, int len)
out_be32 (baseaddress + XEL_TSR_OFFSET, reg);
return 0;
}
-#ifdef CONFIG_XILINX_EMACLITE_TX_PING_PONG
-   /* Switch to second buffer */
-   baseaddress ^= XEL_BUFFER_OFFSET;
-   /* Determine if the expected buffer address is empty */
-   reg = in_be32 (baseaddress + XEL_TSR_OFFSET);
-   if (((reg & XEL_TSR_XMIT_BUSY_MASK) == 0)
-   && ((in_be32 ((baseaddress) + XEL_TSR_OFFSET)
-   & XEL_TSR_XMIT_ACTIVE_MASK) == 0)) {
-   deb

[U-Boot] [PATCH 2/3] net: emaclite: Use PKTSIZE directly

2011-10-07 Thread Michal Simek
Do not setup additional ENET_MAX_MTU macro.

Signed-off-by: Michal Simek 
---
 drivers/net/xilinx_emaclite.c |   10 --
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c
index 9342476..aa9ac4b 100644
--- a/drivers/net/xilinx_emaclite.c
+++ b/drivers/net/xilinx_emaclite.c
@@ -31,8 +31,6 @@
 
 #undef DEBUG
 
-#define ENET_MAX_MTU   PKTSIZE
-#define ENET_MAX_MTU_ALIGNED   PKTSIZE_ALIGN
 #define ENET_ADDR_LENGTH   6
 
 /* EmacLite constants */
@@ -212,8 +210,8 @@ static int emaclite_send (struct eth_device *dev, volatile 
void *ptr, int len)
 
u32 maxtry = 1000;
 
-   if (len > ENET_MAX_MTU)
-   len = ENET_MAX_MTU;
+   if (len > PKTSIZE)
+   len = PKTSIZE;
 
while (!xemaclite_txbufferavailable(dev) && maxtry) {
udelay (10);
@@ -328,8 +326,8 @@ static int emaclite_recv(struct eth_device *dev)
debug ("IP Packet\n");
break;
default:
-   debug ("Other Packet\n");
-   length = ENET_MAX_MTU;
+   debug("Other Packet\n");
+   length = PKTSIZE;
break;
}
 
-- 
1.5.5.6

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


[U-Boot] [PATCH 3/3] net: emaclite: Fix coding style

2011-10-07 Thread Michal Simek
Checked by checkpatch.pl script.
No functional changes.

Signed-off-by: Michal Simek 
---
 drivers/net/xilinx_emaclite.c |   57 +++-
 1 files changed, 27 insertions(+), 30 deletions(-)

diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c
index aa9ac4b..bb4fb01 100644
--- a/drivers/net/xilinx_emaclite.c
+++ b/drivers/net/xilinx_emaclite.c
@@ -70,7 +70,7 @@ struct xemaclite {
 
 static u32 etherrxbuff[PKTSIZE_ALIGN/4]; /* Receive buffer */
 
-static void xemaclite_alignedread (u32 *srcptr, void *destptr, u32 bytecount)
+static void xemaclite_alignedread(u32 *srcptr, void *destptr, u32 bytecount)
 {
u32 i;
u32 alignbuffer;
@@ -90,14 +90,13 @@ static void xemaclite_alignedread (u32 *srcptr, void 
*destptr, u32 bytecount)
to8ptr = (u8 *) to32ptr;
 
alignbuffer = *from32ptr++;
-   from8ptr = (u8 *) & alignbuffer;
+   from8ptr = (u8 *) &alignbuffer;
 
-   for (i = 0; i < bytecount; i++) {
+   for (i = 0; i < bytecount; i++)
*to8ptr++ = *from8ptr++;
-   }
 }
 
-static void xemaclite_alignedwrite (void *srcptr, u32 destptr, u32 bytecount)
+static void xemaclite_alignedwrite(void *srcptr, u32 destptr, u32 bytecount)
 {
u32 i;
u32 alignbuffer;
@@ -114,25 +113,24 @@ static void xemaclite_alignedwrite (void *srcptr, u32 
destptr, u32 bytecount)
}
 
alignbuffer = 0;
-   to8ptr = (u8 *) & alignbuffer;
+   to8ptr = (u8 *) &alignbuffer;
from8ptr = (u8 *) from32ptr;
 
-   for (i = 0; i < bytecount; i++) {
+   for (i = 0; i < bytecount; i++)
*to8ptr++ = *from8ptr++;
-   }
 
*to32ptr++ = alignbuffer;
 }
 
 static void emaclite_halt(struct eth_device *dev)
 {
-   debug ("eth_halt\n");
+   debug("eth_halt\n");
 }
 
 static int emaclite_init(struct eth_device *dev, bd_t *bis)
 {
struct xemaclite *emaclite = dev->priv;
-   debug ("EmacLite Initialization Started\n");
+   debug("EmacLite Initialization Started\n");
 
 /*
  * TX - TX_PING & TX_PONG initialization
@@ -140,8 +138,7 @@ static int emaclite_init(struct eth_device *dev, bd_t *bis)
/* Restart PING TX */
out_be32 (dev->iobase + XEL_TSR_OFFSET, 0);
/* Copy MAC address */
-   xemaclite_alignedwrite (dev->enetaddr,
-   dev->iobase, ENET_ADDR_LENGTH);
+   xemaclite_alignedwrite(dev->enetaddr, dev->iobase, ENET_ADDR_LENGTH);
/* Set the length */
out_be32 (dev->iobase + XEL_TPLR_OFFSET, ENET_ADDR_LENGTH);
/* Update the MAC address in the EMAC Lite */
@@ -174,7 +171,7 @@ static int emaclite_init(struct eth_device *dev, bd_t *bis)
out_be32 (dev->iobase + XEL_RSR_OFFSET + XEL_BUFFER_OFFSET,
XEL_RSR_RECV_IE_MASK);
 
-   debug ("EmacLite Initialization complete\n");
+   debug("EmacLite Initialization complete\n");
return 0;
 }
 
@@ -199,10 +196,10 @@ static int xemaclite_txbufferavailable(struct eth_device 
*dev)
txpongbusy = ((reg & XEL_TSR_XMIT_BUSY_MASK) ==
XEL_TSR_XMIT_BUSY_MASK);
 
-   return (!(txpingbusy && txpongbusy));
+   return !(txpingbusy && txpongbusy);
 }
 
-static int emaclite_send (struct eth_device *dev, volatile void *ptr, int len)
+static int emaclite_send(struct eth_device *dev, volatile void *ptr, int len)
 {
u32 reg;
u32 baseaddress;
@@ -214,12 +211,12 @@ static int emaclite_send (struct eth_device *dev, 
volatile void *ptr, int len)
len = PKTSIZE;
 
while (!xemaclite_txbufferavailable(dev) && maxtry) {
-   udelay (10);
+   udelay(10);
maxtry--;
}
 
if (!maxtry) {
-   printf ("Error: Timeout waiting for ethernet TX buffer\n");
+   printf("Error: Timeout waiting for ethernet TX buffer\n");
/* Restart PING TX */
out_be32 (dev->iobase + XEL_TSR_OFFSET, 0);
if (emaclite->txpp) {
@@ -241,16 +238,15 @@ static int emaclite_send (struct eth_device *dev, 
volatile void *ptr, int len)
if (emaclite->txpp)
emaclite->nexttxbuffertouse ^= XEL_BUFFER_OFFSET;
 
-   debug ("Send packet from 0x%x\n", baseaddress);
+   debug("Send packet from 0x%x\n", baseaddress);
/* Write the frame to the buffer */
-   xemaclite_alignedwrite ((void *) ptr, baseaddress, len);
+   xemaclite_alignedwrite((void *) ptr, baseaddress, len);
out_be32 (baseaddress + XEL_TPLR_OFFSET,(len &
(XEL_TPLR_LENGTH_MASK_HI | XEL_TPLR_LENGTH_MASK_LO)));
reg = in_be32 (baseaddress + XEL_TSR_OFFSET);
reg |= XEL_TSR_XMIT_BUSY_MASK;
-   if ((reg & XEL_TSR_XMIT_IE_MASK) != 0) {
+   if ((reg & XEL_TSR_XMIT_IE_MASK) != 0)
reg |= XEL_TSR_XMIT_ACT

[U-Boot] [PATCH RESEND] FAT: Add FAT write feature

2011-10-07 Thread Donggeun Kim
In some cases, saving data in RAM as a file with FAT format is required.
This patch allows the file to be written in FAT formatted partition.

The usage is similar with reading a file.
First, fat_register_device function is called before file_fat_write function
in order to set target partition.
Then, file_fat_write function is invoked with desired file name,
start ram address for writing data, and file size.

Signed-off-by: Donggeun Kim 
Signed-off-by: Kyungmin Park 
---
 fs/fat/Makefile|1 +
 fs/fat/fat.c   |2 +
 fs/fat/fat_write.c | 1091 
 include/fat.h  |3 +
 4 files changed, 1097 insertions(+), 0 deletions(-)
 create mode 100644 fs/fat/fat_write.c

diff --git a/fs/fat/Makefile b/fs/fat/Makefile
index 93b6f07..9635d36 100644
--- a/fs/fat/Makefile
+++ b/fs/fat/Makefile
@@ -25,6 +25,7 @@ LIB   = $(obj)libfat.o
 
 AOBJS  =
 COBJS-$(CONFIG_CMD_FAT):= fat.o
+COBJS-$(CONFIG_FAT_WRITE):= fat_write.o
 
 ifndef CONFIG_SPL_BUILD
 COBJS-$(CONFIG_CMD_FAT)+= file.o
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 756ac64..7cf173c 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -46,6 +46,7 @@ static void downcase (char *str)
 static block_dev_desc_t *cur_dev = NULL;
 
 static unsigned long part_offset = 0;
+static unsigned long part_size;
 
 static int cur_part = 1;
 
@@ -99,6 +100,7 @@ int fat_register_device (block_dev_desc_t * dev_desc, int 
part_no)
if (!get_partition_info(dev_desc, part_no, &info)) {
part_offset = info.start;
cur_part = part_no;
+   part_size = info.size;
} else if ((strncmp((char *)&buffer[DOS_FS_TYPE_OFFSET], "FAT", 3) == 
0) ||
   (strncmp((char *)&buffer[DOS_FS32_TYPE_OFFSET], "FAT32", 5) 
== 0)) {
/* ok, we assume we are on a PBR only */
diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
new file mode 100644
index 000..e8e823b
--- /dev/null
+++ b/fs/fat/fat_write.c
@@ -0,0 +1,1091 @@
+/*
+ * fat_write.c
+ *
+ * R/W (V)FAT 12/16/32 filesystem implementation by Donggeun Kim
+ *
+ * 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 
+#include 
+#include 
+#include "fat.c"
+
+static void uppercase(char *str, int len)
+{
+   int i;
+
+   for (i = 0; i < len; i++) {
+   TOUPPER(*str);
+   str++;
+   }
+}
+
+static int total_sector;
+static int disk_write(__u32 startblock, __u32 getsize, __u8 *bufptr)
+{
+   if (cur_dev == NULL)
+   return -1;
+
+   if (startblock + getsize > total_sector) {
+   printf("error: overflow occurs\n");
+   return -1;
+   }
+
+   startblock += part_offset;
+
+   if (cur_dev->block_read) {
+   return cur_dev->block_write(cur_dev->dev, startblock, getsize,
+  (unsigned long *) bufptr);
+   }
+   return -1;
+}
+
+/*
+ * Set short name in directory entry
+ */
+static void set_name(dir_entry *dirent, const char *filename)
+{
+   char s_name[VFAT_MAXLEN_BYTES];
+   char *period;
+   int period_location, len, i, ext_num;
+
+   if (filename == NULL)
+   return;
+
+   len = strlen(filename);
+   if (len == 0)
+   return;
+
+   memcpy(s_name, filename, len);
+   uppercase(s_name, len);
+
+   period = strchr(s_name, '.');
+   if (period == NULL) {
+   period_location = len;
+   ext_num = 0;
+   } else {
+   period_location = period - s_name;
+   ext_num = len - period_location - 1;
+   }
+
+   /* Pad spaces when the length of file name is shorter than eight */
+   if (period_location < 8) {
+   memcpy(dirent->name, s_name, period_location);
+   for (i = period_location; i < 8; i++)
+   dirent->name[i] = ' ';
+   } else if (period_location == 8) {
+   memcpy(dirent->name, s_name, period_location);
+   } else {
+   memcpy(dirent->name, s_name, 6);
+   dirent->name[6] = '~';
+   dirent->name[7] = '1';
+   }
+
+   if (ext_num < 3) 

[U-Boot] [PATCH] README: fix documentation of CONFIG_SHOW_BOOT_PROGRESS

2011-10-07 Thread Wolfgang Denk
SOme previous changes added code right in the middle of the
description of CONFIG_SHOW_BOOT_PROGRESS.  Move this text down.
Fix formatting while we are at it.

Signed-off-by: Wolfgang Denk 
---
 README |   72 
 1 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/README b/README
index 0868531..e0a4d53 100644
--- a/README
+++ b/README
@@ -620,18 +620,18 @@ The following options need to be configured:
the SMC.
 
 - Pre-Console Buffer:
-Prior to the console being initialised (i.e. serial UART
-initialised etc) all console output is silently discarded.
-Defining CONFIG_PRE_CONSOLE_BUFFER will cause U-Boot to
-buffer any console messages prior to the console being
-initialised to a buffer of size CONFIG_PRE_CON_BUF_SZ
-bytes located at CONFIG_PRE_CON_BUF_ADDR. The buffer is
-a circular buffer, so if more than CONFIG_PRE_CON_BUF_SZ
-bytes are output before the console is  initialised, the
-earlier bytes are discarded.
-
-'Sane' compilers will generate smaller code if
-CONFIG_PRE_CON_BUF_SZ is a power of 2
+   Prior to the console being initialised (i.e. serial UART
+   initialised etc) all console output is silently discarded.
+   Defining CONFIG_PRE_CONSOLE_BUFFER will cause U-Boot to
+   buffer any console messages prior to the console being
+   initialised to a buffer of size CONFIG_PRE_CON_BUF_SZ
+   bytes located at CONFIG_PRE_CON_BUF_ADDR. The buffer is
+   a circular buffer, so if more than CONFIG_PRE_CON_BUF_SZ
+   bytes are output before the console is  initialised, the
+   earlier bytes are discarded.
+
+   'Sane' compilers will generate smaller code if
+   CONFIG_PRE_CON_BUF_SZ is a power of 2
 
 - Boot Delay:  CONFIG_BOOTDELAY - in seconds
Delay before automatically booting the default image;
@@ -2108,28 +2108,6 @@ The following options need to be configured:
example, some LED's) on your board. At the moment,
the following checkpoints are implemented:
 
-- Standalone program support:
-   CONFIG_STANDALONE_LOAD_ADDR
-
-   This option allows to define board specific values
-   for the address where standalone program gets loaded,
-   thus overwriting the architecutre dependent default
-   settings.
-
-- Frame Buffer Address:
-   CONFIG_FB_ADDR
-
-   Define CONFIG_FB_ADDR if you want to use specific address for
-   frame buffer.
-   Then system will reserve the frame buffer address to defined address
-   instead of lcd_setmem (this function grab the memory for frame buffer
-   by panel's size).
-
-   Please see board_init_f function.
-
-   If you want this config option then,
-   please define it at your board config file
-
 Legacy uImage format:
 
   Arg  Where   When
@@ -2283,6 +2261,28 @@ FIT uImage format:
  -150  common/cmd_nand.c   Incorrect FIT image format
   151  common/cmd_nand.c   FIT image format OK
 
+- Standalone program support:
+   CONFIG_STANDALONE_LOAD_ADDR
+
+   This option allows to define board specific values
+   for the address where standalone program gets loaded,
+   thus overwriting the architecutre dependent default
+   settings.
+
+- Frame Buffer Address:
+   CONFIG_FB_ADDR
+
+   Define CONFIG_FB_ADDR if you want to use specific
+   address for frame buffer.
+   Then system will reserve the frame buffer address to
+   defined address instead of lcd_setmem (this function
+   grab the memory for frame buffer by panel's size).
+
+   Please see board_init_f function.
+
+   If you want this config option then,
+   please define it at your board config file
+
 - Automatic software updates via TFTP server
CONFIG_UPDATE_TFTP
CONFIG_UPDATE_TFTP_CNT_MAX
@@ -2899,8 +2899,8 @@ Low Level (hardware related) configuration options:
* 1ull) << 32 | CONFIG_SYS_CCSRBAR_PHYS_LOW)
 
 - CONFIG_SYS_CCSRBAR_PHYS_HIGH:
-   Bits 33-36 of CONFIG_SYS_CCSRBAR_PHYS.  This value is typically
-   either 0 (32-bit build) or 0xF (36-bit build).  This macro is
+   Bits 33-36 of CONFIG_SYS_CCSRBAR_PHYS.  This value is typically
+   either 0 (32-bit build) or 0xF (36-bit build).  This macro is
used in assembly code, so it must not contain typecasts or
integer size suffixes (e.g. "ULL").
 
-- 
1.7.6.2

___
U-Boot m

Re: [U-Boot] [PATCH v2 3/5] usb:gadget: USB Mass Storage - files from Linux kernel

2011-10-07 Thread Wolfgang Denk
Dear Lukasz Majewski,

In message <20111007092838.02c6a42f@lmajewski.digital.local> you wrote:
> 
> > Checkpatch says:
> > 
> > total: 184 errors, 27 warnings, 4301 lines checked
> > 
> > Please clean up and resubmit.  Thanks.
> 
> I'd like to ask about rules for porting - moving files from Linux.

We try to keepo these files unchanged to the extend possile.  But we
also try to add only "clean" code.


> As you can see this file is directly taken from Linux kernel. This code
> has been accepted to kernel mainline.

Yes, but that does not mean that the code is clean.

> So shall I:
> 1. Submit this patch again as is and
> 2. Post a separate patch to remove "warnings and errors" with my sign
> off?
> 
> or:
> 
> 1. Mangle this patch with my correction (186 errors is a lot) and then
> resubmit it with my name included at sign-off?
> Then it won't be anymore a file taken directly from Linux kernel.
> Moreover we will duplicate code, since two different patches with two
> identical functionality will emerge.

The best would be to send cleanup patches to Linux, so we can import a
clean version.

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
How can you tell when sour cream goes bad?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2 0/2] api: export LCD and video to external apps

2011-10-07 Thread Che-Liang Chiou
This patch set exports LCD and video clearing and bitmap-rendering on
screen functions to external apps, and provides a unified interface
of accessing them.

Che-Liang Chiou (2):
  lcd: video: add clear and draw bitmap declaration
  api: export LCD and video to external apps

 api/Makefile |3 +-
 api/api.c|   51 +
 api/api_display.c|   86 ++
 api/api_private.h|4 ++
 common/lcd.c |   16 ++---
 examples/api/demo.c  |   31 ++
 examples/api/glue.c  |   31 ++
 examples/api/glue.h  |5 +++
 include/api_public.h |   16 +
 include/lcd.h|2 +
 include/video.h  |2 +
 include/video_font.h |6 +++
 12 files changed, 246 insertions(+), 7 deletions(-)
 create mode 100644 api/api_display.c

-- 
1.7.3.1

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


[U-Boot] [PATCH V2 1/2] lcd: video: add clear and draw bitmap declaration

2011-10-07 Thread Che-Liang Chiou
The functions for clearing and drawing bitmaps on the screen were not
exposed publicly and are made public in this patch in preparation for
implementing the display interface of api_public.h.

Signed-off-by: Che-Liang Chiou 
---

Changes since V1
  Fix style errors

 common/lcd.c|   16 ++--
 include/lcd.h   |2 ++
 include/video.h |2 ++
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index d9cb8ca..20e97b9 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -78,7 +78,6 @@ static inline void lcd_putc_xy (ushort x, ushort y, uchar  c);
 
 static int lcd_init (void *lcdbase);
 
-static int lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char * const 
argv[]);
 static void *lcd_logo (void);
 
 static int lcd_getbgcolor (void);
@@ -353,7 +352,14 @@ int drv_lcd_init (void)
 }
 
 /*--*/
-static int lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char * const 
argv[])
+static
+int do_lcd_clear(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+{
+   lcd_clear();
+   return 0;
+}
+
+void lcd_clear(void)
 {
 #if LCD_BPP == LCD_MONOCHROME
/* Setting the palette */
@@ -394,12 +400,10 @@ static int lcd_clear (cmd_tbl_t * cmdtp, int flag, int 
argc, char * const argv[]
 
console_col = 0;
console_row = 0;
-
-   return (0);
 }
 
 U_BOOT_CMD(
-   cls,1,  1,  lcd_clear,
+   cls,1,  1,  do_lcd_clear,
"clear screen",
""
 );
@@ -413,7 +417,7 @@ static int lcd_init (void *lcdbase)
 
lcd_ctrl_init (lcdbase);
lcd_is_enabled = 1;
-   lcd_clear (NULL, 1, 1, NULL);   /* dummy args */
+   lcd_clear();
lcd_enable ();
 
/* Initialize the console */
diff --git a/include/lcd.h b/include/lcd.h
index 0e098d9..39af14a 100644
--- a/include/lcd.h
+++ b/include/lcd.h
@@ -210,6 +210,8 @@ voidlcd_disable (void);
 void   lcd_putc(const char c);
 void   lcd_puts(const char *s);
 void   lcd_printf  (const char *fmt, ...);
+void   lcd_clear(void);
+intlcd_display_bitmap(ulong bmp_image, int x, int y);
 
 /* Allow boards to customize the information displayed */
 void lcd_show_board_info(void);
diff --git a/include/video.h b/include/video.h
index efcc682..280bb76 100644
--- a/include/video.h
+++ b/include/video.h
@@ -15,5 +15,7 @@ int   video_init  (void *videobase);
 void   video_putc  (const char c);
 void   video_puts  (const char *s);
 void   video_printf(const char *fmt, ...);
+void   video_clear(void);
+intvideo_display_bitmap(ulong bmp_image, int x, int y);
 
 #endif
-- 
1.7.3.1

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


[U-Boot] [PATCH V2 2/2] api: export LCD and video to external apps

2011-10-07 Thread Che-Liang Chiou
This patch exports LCD and video information and bitmap-rendering
functions to external apps.

This patch is tested on a Seaboard, which does not have a video output.
So I only tested LCD code paths.

NOTE: The Seaboard LCD driver is not yet upstreamed; the test was done
in a local downstream repo.

Signed-off-by: Che-Liang Chiou 
---

Changes since V1
  Fix style errors

 api/Makefile |3 +-
 api/api.c|   51 +
 api/api_display.c|   86 ++
 api/api_private.h|4 ++
 examples/api/demo.c  |   31 ++
 examples/api/glue.c  |   31 ++
 examples/api/glue.h  |5 +++
 include/api_public.h |   16 +
 include/video_font.h |6 +++
 9 files changed, 232 insertions(+), 1 deletions(-)
 create mode 100644 api/api_display.c

diff --git a/api/Makefile b/api/Makefile
index 2a64c4d..0e99f74 100644
--- a/api/Makefile
+++ b/api/Makefile
@@ -24,7 +24,8 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)libapi.o
 
-COBJS-$(CONFIG_API) += api.o api_net.o api_storage.o api_platform-$(ARCH).o
+COBJS-$(CONFIG_API) += api.o api_display.o api_net.o api_storage.o \
+  api_platform-$(ARCH).o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/api/api.c b/api/api.c
index 853f010..ddf2edd 100644
--- a/api/api.c
+++ b/api/api.c
@@ -553,6 +553,54 @@ static int API_env_enum(va_list ap)
return 0;
 }
 
+/*
+ * pseudo signature:
+ *
+ * int API_display_get_info(int type, struct display_info *di)
+ */
+static int API_display_get_info(va_list ap)
+{
+   int type;
+   struct display_info *di;
+
+   type = (int)va_arg(ap, u_int32_t);
+   di = (struct display_info *)va_arg(ap, u_int32_t);
+   if (!di)
+   return API_EINVAL;
+
+   return display_get_info(type, di);
+}
+
+/*
+ * pseudo signature:
+ *
+ * int API_display_draw_bitmap(void *bitmap, int x, int y)
+ */
+static int API_display_draw_bitmap(va_list ap)
+{
+   ulong bitmap;
+   int x, y;
+
+   bitmap = (ulong)va_arg(ap, ulong);
+   if (!bitmap)
+   return API_EINVAL;
+   x = (int)va_arg(ap, u_int32_t);
+   y = (int)va_arg(ap, u_int32_t);
+
+   return display_draw_bitmap(bitmap, x, y);
+}
+
+/*
+ * pseudo signature:
+ *
+ * void API_display_clear(void)
+ */
+static int API_display_clear(va_list ap)
+{
+   display_clear();
+   return 0;
+}
+
 static cfp_t calls_table[API_MAXCALL] = { NULL, };
 
 /*
@@ -616,6 +664,9 @@ void api_init(void)
calls_table[API_ENV_GET] = &API_env_get;
calls_table[API_ENV_SET] = &API_env_set;
calls_table[API_ENV_ENUM] = &API_env_enum;
+   calls_table[API_DISPLAY_GET_INFO] = &API_display_get_info;
+   calls_table[API_DISPLAY_DRAW_BITMAP] = &API_display_draw_bitmap;
+   calls_table[API_DISPLAY_CLEAR] = &API_display_clear;
calls_no = API_MAXCALL;
 
debugf("API initialized with %d calls\n", calls_no);
diff --git a/api/api_display.c b/api/api_display.c
new file mode 100644
index 000..4746d20
--- /dev/null
+++ b/api/api_display.c
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * 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  /* Get font width and height */
+#include 
+
+int display_get_info(int type, struct display_info *di)
+{
+   switch (type) {
+   default:
+   debug("%s: unsupport display device type: %d\n",
+   __FILE__, type);
+   return API_ENODEV;
+
+#ifdef CONFIG_LCD
+   case DISPLAY_TYPE_LCD:
+   di->pixel_width  = panel_info.vl_col;
+   di->pixel_height = panel_info.vl_row;
+   di->screen_rows = CONSOLE_ROWS;
+   di->screen_cols = CONSOLE_COLS;
+   break;
+#endif
+
+#if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE)
+   case DISPLAY_TYPE_VIDEO:
+   di->pixel_width  = VIDEO_VISIBLE_COLS;
+   di->pixel_height = VIDEO_VISIBLE_ROWS;
+   di->screen_rows = CONSOLE_ROWS;
+   di->screen_cols = CONSOLE_COLS;
+   break;
+#endif
+   }
+
+  

Re: [U-Boot] [PATCH] mvgbe: fix network device indices

2011-10-07 Thread Prafulla Wadaskar


> -Original Message-
> From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
> On Behalf Of Michael Walle
> Sent: Friday, October 07, 2011 3:53 AM
> To: u-boot@lists.denx.de
> Subject: [U-Boot] [PATCH] mvgbe: fix network device indices
> 
> Don't assume that the MAC address of egiga0 rsp. egiga1 is ethaddr rsp.
> eth1addr. If there is only a egiga1 device, u-boot will enumerate it as
> device 0 and therefore the MAC address is set with the environmen
> varibale
> ethaddr.

So if there is only one eth port available, the associated environment variable 
should be ethaddr, this is understood.
Is there any issue with this?

Then I have anther question in my mind-
Why not we name eth0addr for environment variable associated with egiga0 to 
maintain consistency with naming and used ports?

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


Re: [U-Boot] [PATCH 2/2] api: export LCD and video to external apps

2011-10-07 Thread Che-liang Chiou
Dear Wolfgang Denk,
On Fri, Oct 7, 2011 at 2:33 AM, Wolfgang Denk  wrote:
> Dear Che-Liang Chiou,
>
> In message 
> 
>  you wrote:
>> This patch exports LCD and video information and bitmap-rendering
>> functions to external apps.
>>
>> This patch is tested on a Seaboard, which does not have a video output.
>> So I only tested LCD code paths.
>>
>> NOTE: The Seaboard LCD driver is not yet upstreamed; the test was done
>> in a local downstream repo.
> ...
>
>> +     switch (type) {
>> +     default:
>> +             debug("%s: unsupport display device type: %d\n", __FILE__, 
>> type);
>
> Line too long.
>
>> +
>> +#ifdef CONFIG_LCD
>> +     case DISPLAY_TYPE_LCD:
>> +             di->pixel_width  = panel_info.vl_col;
>> +             di->pixel_height = panel_info.vl_row;
>> +             di->screen_rows = CONSOLE_ROWS;
>> +             di->screen_cols = CONSOLE_COLS;
>> +             break;
>> +#endif
>> +
>> +#if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE)
>> +     case DISPLAY_TYPE_VIDEO:
>> +             di->pixel_width  = VIDEO_VISIBLE_COLS;
>> +             di->pixel_height = VIDEO_VISIBLE_ROWS;
>> +             di->screen_rows = CONSOLE_ROWS;
>> +             di->screen_cols = CONSOLE_COLS;
>> +             break;
>> +#endif
>> +     }
>> +
>> +     di->type = type;
>> +     return 0;
>> +}
>> +
>> +int display_draw_bitmap(ulong bitmap, int x, int y)
>> +{
>> +     int err = 0;
>> +
>> +     /*
>> +      * Although CONFIG_LCD and CONFIG_VIDEO or CONFIG_CFB_CONSOLE
>> +      * generally should not be both set, if this does happen, I think
>> +      * drawing on both of them makes more sense.
>> +      */
>> +#ifdef CONFIG_LCD
>> +     err |= lcd_display_bitmap(bitmap, x, y);
>> +#endif
>> +#if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE)
>> +     err |= video_display_bitmap(bitmap, x, y);
>> +#endif
>> +
>> +     return err;
>> +}
>> +
>> +void display_clear(void)
>> +{
>> +#ifdef CONFIG_LCD
>> +     lcd_clear();
>> +#endif
>> +#if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE)
>> +     video_clear();
>> +#endif
>> +}
>> diff --git a/api/api_private.h b/api/api_private.h
>> index 94a7fc5..988f702 100644
>> --- a/api/api_private.h
>> +++ b/api/api_private.h
>> @@ -45,4 +45,8 @@ int         dev_write_net(void *, void *, int);
>>
>>  void dev_stor_init(void);
>>
>> +int display_get_info(int type, struct display_info *di);
>> +int display_draw_bitmap(ulong bitmap, int x, int y);
>> +void display_clear(void);
>> +
>>  #endif /* _API_PRIVATE_H_ */
>> diff --git a/examples/api/demo.c b/examples/api/demo.c
>> index 65e7491..191bd79 100644
>> --- a/examples/api/demo.c
>> +++ b/examples/api/demo.c
>> @@ -176,6 +176,34 @@ int main(int argc, char * const argv[])
>>       while ((env = ub_env_enum(env)) != NULL)
>>               printf("%s = %s\n", env, ub_env_get(env));
>>
>> +     printf("\n*** Display ***\n");
>> +
>> +     struct display_info disinfo;
>
> Please don't mix declarations and code.
>
>> +     if (ub_display_get_info(DISPLAY_TYPE_LCD, &disinfo))
>> +             printf("LCD info: failed\n");
>> +     else {
>
> Use braces in both branches.  Please fix globally.
>
>> +     /* this only clears messages on screen, not on serial port */
>> +     ub_display_clear();
>
> What happens here if no display is available?

It is equivalent to a no-op. Or do you think we should print a warning
message if no display is available?

>
> 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
> Randal said it would be tough to do in sed. He didn't say  he  didn't
> understand  sed.  Randal  understands sed quite well. Which is why he
> uses Perl. :-)         - Larry Wall in <7...@jpl-devvax.jpl.nasa.gov>
>

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


Re: [U-Boot] [PATCH V2 1/2] mmc: change magic number to macro define

2011-10-07 Thread Prafulla Wadaskar


> -Original Message-
> From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
> On Behalf Of Lei Wen
> Sent: Thursday, October 06, 2011 8:41 PM
> To: Marek Vasut
> Cc: Lei Wen; u-boot@lists.denx.de; Andy Fleming
> Subject: Re: [U-Boot] [PATCH V2 1/2] mmc: change magic number to macro
> define
> 
> Hi Marek,
> 
> On Tue, Oct 4, 2011 at 8:07 PM, Marek Vasut 
> wrote:
> > On Tuesday, October 04, 2011 08:35:10 AM Lei Wen wrote:
> >> Previous magic number is hard to parse its meaning, change it to
> >> respective macro definition
> >>
> >> Signed-off-by: Lei Wen 
> >
> > [..]
> >
> >> --- a/include/mmc.h
> >> +++ b/include/mmc.h
> >> @@ -145,13 +145,15 @@
> >>  /*
> >>   * EXT_CSD fields
> >>   */
> >> -
> >> -#define EXT_CSD_PART_CONF    179     /* R/W */
> >> -#define EXT_CSD_BUS_WIDTH    183     /* R/W */
> >> -#define EXT_CSD_HS_TIMING    185     /* R/W */
> >> -#define EXT_CSD_CARD_TYPE    196     /* RO */
> >> -#define EXT_CSD_REV          192     /* RO */
> >> -#define EXT_CSD_SEC_CNT              212     /* RO, 4 bytes */
> >> +#define EXT_CSD_PARTITIONING_SUPPORT 160     /* RO */
> >> +#define EXT_CSD_ERASE_GROUP_DEF              175     /* R/W */
> >> +#define EXT_CSD_PART_CONF            179     /* R/W */
> >> +#define EXT_CSD_BUS_WIDTH            183     /* R/W */
> >> +#define EXT_CSD_HS_TIMING            185     /* R/W */
> >> +#define EXT_CSD_REV                  192     /* RO */
> >> +#define EXT_CSD_CARD_TYPE            196     /* RO */
> >> +#define EXT_CSD_SEC_CNT                      212     /* RO, 4 bytes
> */
> >> +#define EXT_CSD_HC_ERASE_GRP_SIZE    224     /* RO */
> >>
> >>  /*
> >>   * EXT_CSD field definitions
> >
> > Hi Lei,
> > this is better, but what about structure-based access ?
> >
> > struct somrthing {
> >  u8 a1;
> >  u8 a2;
> > ...
> > };
> >
> > Like this.
> >
> > Also, CC Andy.
> >
> 
> The ext_csd current usage in mmc.c is not too much, here I mean only few
> of
> the fields of the ext_csd is used, also fully definition of ext_csd
> member would seems so huge a structure at its appearence...
> 
> So macro may looks more concise and could parse from its meaning easily
> enough.
> 
> Anyway, more comments on this welcomes. :)

Dear Lei
Using c-struct is our strategy, may be full definition is huge, you may skip 
them inserting padding in the c-struct.

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


Re: [U-Boot] [PATCH V2] USB: Add usb_event_poll() to get keyboards working with EHCI

2011-10-07 Thread Marek Vasut
On Friday, October 07, 2011 07:25:22 AM Wolfgang Denk wrote:
> Dear Marek Vasut,
> 
> In message <201110070130.14881.marek.va...@gmail.com> you wrote:
> > > Checkpatch says:
> > > 
> > > total: 0 errors, 1 warnings, 43 lines checked
> > > 
> > > Please clean up and resubmit.  Thanks.
> 
> ...
> 
> > The extern-stuff checkpatch is complaining about is a problem with
> > usbkbd.c . The file needs cleanup, badly, only then we can get rid of
> > those externs.
> > 
> > I'd prefer to get this applied and then cleanup the usbkbd.c. The musb
> > driver suffers the same trouble, so it can be cleaned up with this
> > together.
> 
> If Remy accepts this, I'm fine with it, too.

I'm adding the cleanup to my todo.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4] OMAP3: mvblx: Initial support for mvBlueLYNX-X

2011-10-07 Thread Michael Jones
Hi Wolfgang,

On 10/06/2011 11:51 PM, Wolfgang Denk wrote:
>
> Dear Michael Jones,
>
> In message<1313571318-17795-1-git-send-email-michael.jo...@matrix-vision.de>  
> you wrote:
>> Add support for the MATRIX VISION mvBlueLYNX-X, an OMAP3-based
>> intelligent camera.
>>
>> Signed-off-by: Michael Jones
>> ---
>>
>> I haven't had any real feedback on this submission yet, and I don't
>> know if there is still any hope of getting it in to v2011.09. The
>> previous version didn't build on top of the latest u-boot-arm branch
>> anymore, so I'm rebasing it in the hopes that this will ease the
>> review process.
>>
>> v3 introduced a change which causes the board not to run on the
>> current arm master branch until this patch is applied:
>> http://patchwork.ozlabs.org/patch/107021/
>> But this is a runtime problem.
>>
>> Changes for v4:
>>- rebased on top of u-boot-arm master (f0628a67)
>>
>> Changes for v3:
>>- Use CONFIG_MACH_TYPE to set gd->bd->bi_arch_number
>>
>> Changes for v2:
>>- None. Resubmitting to include custodian in cc:
>>
>>   MAINTAINERS|4 +
>>   board/matrix_vision/mvblx/Makefile |   53 +
>>   board/matrix_vision/mvblx/config.mk|   33 +++
>>   board/matrix_vision/mvblx/fpga.c   |  222 ++
>>   board/matrix_vision/mvblx/fpga.h   |   32 +++
>>   board/matrix_vision/mvblx/mvblx.c  |  169 ++
>>   board/matrix_vision/mvblx/mvblx.h  |  362 +
>>   board/matrix_vision/mvblx/sys_eeprom.c |  395 
>> 
>>   boards.cfg |1 +
>>   doc/README.omap3   |5 +
>>   include/configs/omap3_mvblx.h  |  313 +
>>   11 files changed, 1589 insertions(+), 0 deletions(-)
>>   create mode 100644 board/matrix_vision/mvblx/Makefile
>>   create mode 100644 board/matrix_vision/mvblx/config.mk
>>   create mode 100644 board/matrix_vision/mvblx/fpga.c
>>   create mode 100644 board/matrix_vision/mvblx/fpga.h
>>   create mode 100644 board/matrix_vision/mvblx/mvblx.c
>>   create mode 100644 board/matrix_vision/mvblx/mvblx.h
>>   create mode 100644 board/matrix_vision/mvblx/sys_eeprom.c
>>   create mode 100644 include/configs/omap3_mvblx.h
>
> Checkpatch says:
>
> total: 0 errors, 49 warnings, 1607 lines checked
>
> Please clean up and resubmit.  Thanks.
>
> Best regards,
>
> Wolfgang Denk
>

I've already submitted v5 [1], which was mainly to get rid of exactly 
those warnings.  There remain 4 warnings, but they look Linux-specific.

But while we're on the topic- Most of those old warnings were because my 
board/matrix_vision/mvblx/mvblx.h was based on board/ti/beagle/beagle.h, 
which would've itself had lots of checkpatch warnings from long lines. 
Sandeep advised me that this was a poor argument for submitting a patch 
with warnings, so I submitted v5.  Now I've researched this again and 
found the patch which introduced the warnings for beagle.h and the 
discussion [2] around it.  If it was decided back then to indent the 
lines with tabs although it caused checkpatch warnings, isn't it 
reasonable for mvblx.h to be formatted in the same way?  I don't care 
how it's formatted, but I find the inconsistency ugly.

If you agree that the checkpatch warnings from mvblx.h are preferable to 
being inconsistent with the formatting of beagle.h, I will submit v6 
with mvblx.h changed back to be formatted like the current beagle.h.

-Michael

[1]http://patchwork.ozlabs.org/patch/117879/
[2]http://http://lists.denx.de/pipermail/u-boot/2009-September/061619.html

MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, Erhard Meier
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] api: export LCD and video to external apps

2011-10-07 Thread Wolfgang Denk
Dear Che-liang Chiou,

In message  
you wrote:
>
> >> +   ub_display_clear();
> >
> > What happens here if no display is available?
> 
> It is equivalent to a no-op. Or do you think we should print a warning
> message if no display is available?

Please either add an if() and don;t run the function at all, or add a
comment that explains that this callis harmless if no display is
present.

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
"He was so narrow minded he could see through  a  keyhole  with  both
eyes ..."
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V3] cmd_time: add time command

2011-10-07 Thread Che-Liang Chiou
The 'time' command runs and reports execution time of commands.

Sample usage:

u-boot# time crc 0x1000 1000
CRC32 for 1000 ... 1fff ==> ae94dc4b

time: 0.004 seconds, 4 ticks


Signed-off-by: Che-Liang Chiou 
---

Changes since V2
 - Remove CONFIG_CMD_TIME from config_cmd_all.h

Changes Since V1
 - Switch unsigned long int to ulong to match function prototype
 - Remove unnecessary 'ifdef CONFIG_SYS_HZ' guard
 - Factor out codes into the run_command_and_time_it() function

 README|1 +
 common/Makefile   |1 +
 common/cmd_time.c |   90 +
 3 files changed, 92 insertions(+), 0 deletions(-)
 create mode 100644 common/cmd_time.c

diff --git a/README b/README
index 0868531..246e76f 100644
--- a/README
+++ b/README
@@ -783,6 +783,7 @@ The following options need to be configured:
CONFIG_CMD_SOURCE "source" command Support
CONFIG_CMD_SPI  * SPI serial bus support
CONFIG_CMD_TFTPSRV  * TFTP transfer in server mode
+   CONFIG_CMD_TIME * run command and report execution time
CONFIG_CMD_USB  * USB support
CONFIG_CMD_CDP  * Cisco Discover Protocol support
CONFIG_CMD_FSL  * Microblaze FSL support
diff --git a/common/Makefile b/common/Makefile
index 371a0d9..fdc4206 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -147,6 +147,7 @@ COBJS-$(CONFIG_CMD_SPI) += cmd_spi.o
 COBJS-$(CONFIG_CMD_SPIBOOTLDR) += cmd_spibootldr.o
 COBJS-$(CONFIG_CMD_STRINGS) += cmd_strings.o
 COBJS-$(CONFIG_CMD_TERMINAL) += cmd_terminal.o
+COBJS-$(CONFIG_CMD_TIME) += cmd_time.o
 COBJS-$(CONFIG_SYS_HUSH_PARSER) += cmd_test.o
 COBJS-$(CONFIG_CMD_TSI148) += cmd_tsi148.o
 COBJS-$(CONFIG_CMD_UBI) += cmd_ubi.o
diff --git a/common/cmd_time.c b/common/cmd_time.c
new file mode 100644
index 000..c937ae4
--- /dev/null
+++ b/common/cmd_time.c
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * 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 
+
+/*
+ * TODO(clchiou): This function actually minics the bottom-half of the
+ * run_command() function.  Since this function has ARM-dependent timer
+ * codes, we cannot merge it with the run_command() for now.
+ */
+static int run_command_and_time_it(int flag, int argc, char * const argv[],
+   ulong *cycles)
+{
+   cmd_tbl_t *cmdtp = find_cmd(argv[0]);
+   int retval = 0;
+
+   if (!cmdtp) {
+   printf("%s: command not found\n", argv[0]);
+   return 1;
+   }
+   if (argc > cmdtp->maxargs)
+   return cmd_usage(cmdtp);
+
+   /*
+* TODO(clchiou): get_timer_masked() is only defined in certain ARM
+* boards.  We could use the new timer API that Graeme is proposing
+* so that this piece of code would be arch-independent.
+*/
+   *cycles = get_timer_masked();
+   retval = cmdtp->cmd(cmdtp, flag, argc, argv);
+   *cycles = get_timer_masked() - *cycles;
+
+   return retval;
+}
+
+static void report_time(ulong cycles)
+{
+   ulong minutes, seconds, milliseconds;
+   ulong total_seconds, remainder;
+
+   total_seconds = cycles / CONFIG_SYS_HZ;
+   remainder = cycles % CONFIG_SYS_HZ;
+   minutes = total_seconds / 60;
+   seconds = total_seconds % 60;
+   /* approximate millisecond value */
+   milliseconds = (remainder * 1000 + CONFIG_SYS_HZ / 2) / CONFIG_SYS_HZ;
+
+   printf("\ntime:");
+   if (minutes)
+   printf(" %lu minutes,", minutes);
+   printf(" %lu.%03lu seconds, %lu ticks\n",
+   seconds, milliseconds, cycles);
+}
+
+static int do_time(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+   ulong cycles = 0;
+   int retval = 0;
+
+   if (argc == 1)
+   return cmd_usage(cmdtp);
+
+   retval = run_command_and_time_it(0, argc - 1, argv + 1, &cycles);
+   report_time(cycles);
+
+   return retval;
+}
+
+U_BOOT_CMD(time, CONFIG_SYS_MAXARGS, 0, do_time,
+   "run commands and summarize execution time",
+

[U-Boot] You Have Been Chosen

2011-10-07 Thread Catholic Charity Funds
Your Email I.D Won a Sum payout of one million dollars ($1,000 000) As
CATHOLIC CHARITY FUNDS donation to less privileged and to eradicate poverty
allover the world and your email address was luckily selected true a search
machine from the internet and you are one of our lucky winner.Grant
Verify this mail immediately by writing To our Executive
Secretary.Mr.Recharge Bathes.Office email-  catholiccharityfu...@yahoo.com
 On behalf of the Board kindly accept our warmest congratulations.



PLEASE FILL OUT THE VERIFICATION AND FUNDS RELEASE
1.FULL NAMES:_2.ADDRESS:3.Country
__4SEX:___5.AGE:6.OCCUPATION:__7.TELEPHONE
NUMBER_


Choose your claims option:


1. Courier delivery .

2. Bank to bank wire-transfer..

Tel:+447031869671
Regards,
GRANT CO-ORDINATION

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


Re: [U-Boot] [PATCH 2/2] api: export LCD and video to external apps

2011-10-07 Thread Che-liang Chiou
Hi Wolfgang Denk,

I have added following comments to this call in patch V2.
+       /*+        * This only clears messages on screen, not on
serial port. It is+        * equivalent to a no-op if no display is
available.+        */Do you think it is sufficient?

Regards,
Che-Liang

On Fri, Oct 7, 2011 at 5:05 PM, Wolfgang Denk  wrote:
> Dear Che-liang Chiou,
>
> In message 
>  you 
> wrote:
>>
>> >> +       ub_display_clear();
>> >
>> > What happens here if no display is available?
>>
>> It is equivalent to a no-op. Or do you think we should print a warning
>> message if no display is available?
>
> Please either add an if() and don;t run the function at all, or add a
> comment that explains that this callis harmless if no display is
> present.
>
> 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
> "He was so narrow minded he could see through  a  keyhole  with  both
> eyes ..."
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Can I boot at image from a jffs2 filesystem

2011-10-07 Thread Phillips, Owain
Hi,

I am trying to squeeze new features onto a uboot based system where we have run 
out of flash.
In tandum with general optimisation of apps, removal of redundant code etc I 
wanted to rework our boot schema to reclaim some free space in other partitions.

Kernel currently boots from its own partition before mounting JFFS2 root 
partition; this seems to be the standard uboot approach.
JFFS2 is nearly full; Kernel partition has free space.

I see two options -

1) Reduce size of kernel partition and increase that of root partition.
2) modify boot to boot kernel from jffs2 root partition.

I favour option 2 as this means we maximise flash utilisation; all free space 
lands in root partition.

But can uboot boot a kernel from a JFFS2 partition?
Such a boot schema does not seem to be documented anywhere?

Is this possible?
Does anyone boot like this?

Regards,
Owain


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


Re: [U-Boot] [PATCH] README: fix documentation of CONFIG_SHOW_BOOT_PROGRESS

2011-10-07 Thread Michael Jones
Hi Wolfgang,

On 10/07/2011 10:04 AM, Wolfgang Denk wrote:
>
> SOme previous changes added code right in the middle of the

typo- double capitalization

> description of CONFIG_SHOW_BOOT_PROGRESS.  Move this text down.
> Fix formatting while we are at it.
>
> Signed-off-by: Wolfgang Denk
> ---
>   README |   72 
> 
>   1 files changed, 36 insertions(+), 36 deletions(-)
>
> diff --git a/README b/README
> index 0868531..e0a4d53 100644
> --- a/README
> +++ b/README
> @@ -620,18 +620,18 @@ The following options need to be configured:
>   the SMC.
>
>   - Pre-Console Buffer:
> -Prior to the console being initialised (i.e. serial UART
> -initialised etc) all console output is silently discarded.
> -Defining CONFIG_PRE_CONSOLE_BUFFER will cause U-Boot to
> -buffer any console messages prior to the console being
> -initialised to a buffer of size CONFIG_PRE_CON_BUF_SZ
> -bytes located at CONFIG_PRE_CON_BUF_ADDR. The buffer is
> -a circular buffer, so if more than CONFIG_PRE_CON_BUF_SZ
> -bytes are output before the console is  initialised, the
> -earlier bytes are discarded.
> -
> -'Sane' compilers will generate smaller code if
> -CONFIG_PRE_CON_BUF_SZ is a power of 2
> + Prior to the console being initialised (i.e. serial UART
> + initialised etc) all console output is silently discarded.
> + Defining CONFIG_PRE_CONSOLE_BUFFER will cause U-Boot to
> + buffer any console messages prior to the console being
> + initialised to a buffer of size CONFIG_PRE_CON_BUF_SZ
> + bytes located at CONFIG_PRE_CON_BUF_ADDR. The buffer is
> + a circular buffer, so if more than CONFIG_PRE_CON_BUF_SZ
> + bytes are output before the console is  initialised, the

two spaces between 'is' and 'initialised'

> + earlier bytes are discarded.
> +
> + 'Sane' compilers will generate smaller code if
> + CONFIG_PRE_CON_BUF_SZ is a power of 2
>
>   - Boot Delay:   CONFIG_BOOTDELAY - in seconds
>   Delay before automatically booting the default image;
> @@ -2108,28 +2108,6 @@ The following options need to be configured:
>   example, some LED's) on your board. At the moment,
>   the following checkpoints are implemented:
>
> -- Standalone program support:
> - CONFIG_STANDALONE_LOAD_ADDR
> -
> - This option allows to define board specific values
> - for the address where standalone program gets loaded,
> - thus overwriting the architecutre dependent default
> - settings.
> -
> -- Frame Buffer Address:
> - CONFIG_FB_ADDR
> -
> - Define CONFIG_FB_ADDR if you want to use specific address for
> - frame buffer.
> - Then system will reserve the frame buffer address to defined address
> - instead of lcd_setmem (this function grab the memory for frame buffer
> - by panel's size).
> -
> - Please see board_init_f function.
> -
> - If you want this config option then,
> - please define it at your board config file
> -
>   Legacy uImage format:
>
> Arg   Where   When
> @@ -2283,6 +2261,28 @@ FIT uImage format:
>-150   common/cmd_nand.c   Incorrect FIT image format
> 151   common/cmd_nand.c   FIT image format OK
>
> +- Standalone program support:
> + CONFIG_STANDALONE_LOAD_ADDR
> +
> + This option allows to define board specific values

This option defines a board specific value

> + for the address where standalone program gets loaded,
> + thus overwriting the architecutre dependent default

'architecture' was misspelled.

> + settings.
> +
> +- Frame Buffer Address:
> + CONFIG_FB_ADDR
> +
> + Define CONFIG_FB_ADDR if you want to use specific
> + address for frame buffer.
> + Then system will reserve the frame buffer address to
> + defined address instead of lcd_setmem (this function
> + grab the memory for frame buffer by panel's size).

grabs

> +
> + Please see board_init_f function.
> +
> + If you want this config option then,
> + please define it at your board config file

Do we need to say that if you want this option, you need to set it in 
your board config file?  Is there someplace else one would set this 
option if they wanted it?

> +
>   - Automatic software updates via TFTP server
>   CONFIG_UPDATE_TFTP
>   CONFIG_UPDATE_TFTP_CNT_MAX
> @@ -2899,8 +2899,8 @@ Low Level (hardware related) configuration options:
>   * 1ull)<<  32 | CONFIG_SYS_CCSRBAR_PHYS_LOW)
>
>   - CONFIG_SYS_CCSRBA

Re: [U-Boot] [PATCH] mvgbe: fix network device indices

2011-10-07 Thread Michael Walle
Am Fr, 7.10.2011, 10:26 schrieb Prafulla Wadaskar:
>> -Original Message-
>> From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
>> On Behalf Of Michael Walle
>> Sent: Friday, October 07, 2011 3:53 AM
>> To: u-boot@lists.denx.de
>> Subject: [U-Boot] [PATCH] mvgbe: fix network device indices
>>
>> Don't assume that the MAC address of egiga0 rsp. egiga1 is ethaddr rsp.
>> eth1addr. If there is only a egiga1 device, u-boot will enumerate it as
>> device 0 and therefore the MAC address is set with the environmen
>> varibale
>> ethaddr.
>
> So if there is only one eth port available, the associated environment
> variable should be ethaddr, this is understood.
> Is there any issue with this?
Are you asking me or the list? (if the question was for me, remember that
there might be _only_ the egiga1 device.)

> Then I have anther question in my mind-
> Why not we name eth0addr for environment variable associated with egiga0
> to maintain consistency with naming and used ports?

If i get it right, there is another problem with setting the environment
variable from the driver itself.

eth_register() and eth_init() using an own index to enumerate the devices.
Eg. if an e1000 is registered before the the associated environment
variable would be eth1addr for the first mvgbe device and eth2addr for the
second.

This patch only fixes the case where no other network device is
registered. (The current behaviour just works with egiga0 being the only
or the first and egiga1 being the second device).

-- 
Michael


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


[U-Boot] [PATCH 2/2] ppc: Fix DBSR_IAx defines in

2011-10-07 Thread Stefan Roese
While adding asm/cache.h to common.h for PPC targets, I got an
error about multiple definitions of some DBSR_ macros. While
scanning these defines, I noticed that some where defined not
correctly for all PPC variants. So I removed all unused defines,
and corrected the ones really used by bedbug (book-e vs. ppc40x).

Signed-off-by: Stefan Roese 
Cc: Wolfgang Denk 
---
 include/bedbug/regs.h |   31 +++
 1 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/include/bedbug/regs.h b/include/bedbug/regs.h
index 938e435..eb74691 100644
--- a/include/bedbug/regs.h
+++ b/include/bedbug/regs.h
@@ -143,22 +143,21 @@
 #define DBCR1_DV1BE0xF000
 #define DBCR1_DV2BE0x0F00
 
-/* Bits for the DBSR register */
-#define DBSR_IC0x8000
-#define DBSR_BT0x4000
-#define DBSR_EDE   0x2000
-#define DBSR_TIE   0x1000
-#define DBSR_UDE   0x0800
-#define DBSR_IA1   0x0400
-#define DBSR_IA2   0x0200
-#define DBSR_DR1   0x0100
-#define DBSR_DW1   0x0080
-#define DBSR_DR2   0x0040
-#define DBSR_DW2   0x0020
-#define DBSR_IDE   0x0010
-#define DBSR_IA3   0x0008
-#define DBSR_IA4   0x0004
-#define DBSR_MRR   0x0300
+/*
+ * DBSR bits which have conflicting definitions on true Book E versus PPC40x
+ */
+#ifdef CONFIG_BOOKE
+#define DBSR_IA1   0x0080  /* Instr Address Compare 1 Event */
+#define DBSR_IA2   0x0040  /* Instr Address Compare 2 Event */
+#define DBSR_IA3   0x0020  /* Instr Address Compare 3 Event */
+#define DBSR_IA4   0x0010  /* Instr Address Compare 4 Event */
+#endif
+#ifndef CONFIG_440
+#define DBSR_IA1   0x0400  /* Instr Address Compare 1 Event */
+#define DBSR_IA2   0x0200  /* Instr Address Compare 2 Event */
+#define DBSR_IA3   0x0008  /* Instr Address Compare 3 Event */
+#define DBSR_IA4   0x0004  /* Instr Address Compare 4 Event */
+#endif
 
 struct spr_info {
   int  spr_val;
-- 
1.7.6.1

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


[U-Boot] [PATCH 1/2] ppc: Include in common.h

2011-10-07 Thread Stefan Roese
This is needed for the patch "cache: add default setting for
CONFIG_SYS_CACHELINE_SIZE" from Anton Staaf. As cache.h defines
CONFIG_SYS_CACHELINE_SIZE for PPC targets.

This will remove the following warnings/errors:

include/common.h:819:2: warning: #warning CONFIG_SYS_CACHELINE_SIZE not 
defined, using __BIGGEST_ALIGNMENT__
cache.c:33: error: '__BIGGEST_ALIGNMENT__' undeclared (first use in this 
function)

Signed-off-by: Stefan Roese 
Cc: Anton Staaf 
Cc: Wolfgang Denk 
---
 include/common.h |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/include/common.h b/include/common.h
index b55592d..f0ab346 100644
--- a/include/common.h
+++ b/include/common.h
@@ -782,6 +782,14 @@ int cpu_release(int nr, int argc, char * const argv[]);
 
 #endif /* __ASSEMBLY__ */
 
+#ifdef CONFIG_PPC
+/*
+ * Has to be included outside of the #ifndef __ASSEMBLY__ section.
+ * Otherwise might lead to compilation errors in assembler files.
+ */
+#include 
+#endif
+
 /* Put only stuff here that the assembler can digest */
 
 #ifdef CONFIG_POST
-- 
1.7.6.1

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


[U-Boot] [PATCH v2 0/3] arm, davinci: add am1808 based enbw_cmc board

2011-10-07 Thread Heiko Schocher
repost from
http://patchwork.ozlabs.org/patch/114758/

changes:
  - rebase against TOT
  - use CONFIG_MACH_TYPE instead setting the MACH_TYPE in
board specific code, as Igor Grinberg suggested.
  - add logversion=2 to default Environment
  - Fix typo CONFIG_AM1808_LOWLEVEL as Christian Riesch
suggested.
  - Fix comment for PLL0 and PLL1 frequency and use PLLM = 18
for PLL0 to get the 456 MHz as Christian Riesch commented.
Also fix the DDR RAM timing according to the new settings
from the PLL
  - add MMC support
  - enable USB PSC
  - correct default environment "key_cmd*" vars
  - added MAINTAINERS entry

also needed patches:

[U-Boot] arm, post, memory: fix bug if sdram base != 0x
http://patchwork.ozlabs.org/patch/118208/

[U-Boot] : davinci: Replace CONFIG_PRELOADER with CONFIG_SPL_BUILD in 
board/davinci/common/misc.c
http://patchwork.ozlabs.org/patch/114482/

[U-Boot] arm, fdt: update ethernet mac address before booting Linux
http://patchwork.ozlabs.org/patch/114736/

[U-Boot] arm, logbuffer: make it compileclean
http://patchwork.ozlabs.org/patch/114740/

[U-Boot] cosmetic, post: Codingstyle cleanup
http://patchwork.ozlabs.org/patch/114742/

[U-Boot] arm, post: add missing post_time_ms for arm
http://patchwork.ozlabs.org/patch/114743/

checkpatch:
total: 0 errors, 0 warnings, 8 lines checked

20111007/0001-arm-davinci-fix-typo-in-arch-arm-cpu-arm926ejs-davin.patch has no 
obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 7 lines checked

20111007/0002-arm-davinci-add-DAVINCI_MMC_CLKID.patch has no obvious style 
problems and is ready for submission.
WARNING: Use #include  instead of 
#163: FILE: board/enbw/enbw_cmc/enbw_cmc.c:45:
+#include 

ERROR: Macros with multiple statements should be enclosed in a do - while loop
#831: FILE: include/configs/enbw_cmc.h:96:
+#define CONFIG_DTT_SENSORS {0} /* Sensor addresses */

total: 1 errors, 1 warnings, 1116 lines checked

20111007/0003-arm-davinci-add-support-for-am1808-based-enbw_cmc-bo.patch has 
style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

Cc: Christian Riesch 
Cc: Paulraj Sandeep 
Cc: Albert ARIBAUD 

Heiko Schocher (3):
  arm, davinci: fix typo in arch/arm/cpu/arm926ejs/davinci/Makefile
  arm, davinci: add DAVINCI_MMC_CLKID
  arm, davinci: add support for am1808 based enbw_cmc board

 MAINTAINERS  |1 +
 arch/arm/cpu/arm926ejs/davinci/Makefile  |2 +-
 arch/arm/include/asm/arch-davinci/hardware.h |1 +
 board/enbw/enbw_cmc/Makefile |   51 +++
 board/enbw/enbw_cmc/enbw_cmc.c   |  599 ++
 boards.cfg   |1 +
 include/configs/enbw_cmc.h   |  452 +++
 7 files changed, 1106 insertions(+), 1 deletions(-)
 create mode 100644 board/enbw/enbw_cmc/Makefile
 create mode 100644 board/enbw/enbw_cmc/enbw_cmc.c
 create mode 100644 include/configs/enbw_cmc.h

-- 
1.7.6.2

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


[U-Boot] [PATCH v2 2/3] arm, davinci: add DAVINCI_MMC_CLKID

2011-10-07 Thread Heiko Schocher
Signed-off-by: Heiko Schocher 
---
 arch/arm/include/asm/arch-davinci/hardware.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/arch-davinci/hardware.h 
b/arch/arm/include/asm/arch-davinci/hardware.h
index b6a3209..24ae49d 100644
--- a/arch/arm/include/asm/arch-davinci/hardware.h
+++ b/arch/arm/include/asm/arch-davinci/hardware.h
@@ -416,6 +416,7 @@ struct davinci_pllc_regs {
 enum davinci_clk_ids {
DAVINCI_SPI0_CLKID = 2,
DAVINCI_UART2_CLKID = 2,
+   DAVINCI_MMC_CLKID = 2,
DAVINCI_MDIO_CLKID = 4,
DAVINCI_ARM_CLKID = 6,
DAVINCI_PLLM_CLKID = 0xff,
-- 
1.7.6.2

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


[U-Boot] [PATCH v2 1/3] arm, davinci: fix typo in arch/arm/cpu/arm926ejs/davinci/Makefile

2011-10-07 Thread Heiko Schocher
Signed-off-by: Heiko Schocher 
Cc: Christian Riesch 
Cc: Paulraj Sandeep 
Cc: Albert ARIBAUD 
---
 arch/arm/cpu/arm926ejs/davinci/Makefile |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/davinci/Makefile 
b/arch/arm/cpu/arm926ejs/davinci/Makefile
index 0310957..d91a2b8 100644
--- a/arch/arm/cpu/arm926ejs/davinci/Makefile
+++ b/arch/arm/cpu/arm926ejs/davinci/Makefile
@@ -28,7 +28,7 @@ include $(TOPDIR)/config.mk
 LIB= $(obj)lib$(SOC).o
 
 COBJS-y+= cpu.o timer.o psc.o
-COBJS-$(CONFIG_AM18018_LOWLEVEL)   += am1808_lowlevel.o
+COBJS-$(CONFIG_AM1808_LOWLEVEL)   += am1808_lowlevel.o
 COBJS-$(CONFIG_SOC_DM355)  += dm355.o
 COBJS-$(CONFIG_SOC_DM365)  += dm365.o
 COBJS-$(CONFIG_SOC_DM644X) += dm644x.o
-- 
1.7.6.2

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


[U-Boot] [PATCH v2 3/3] arm, davinci: add support for am1808 based enbw_cmc board

2011-10-07 Thread Heiko Schocher
- booting from NOR Flash with direct boot method
- POST support
- LOGBUF support

Signed-off-by: Heiko Schocher 
Cc: Paulraj Sandeep 
Cc: Albert ARIBAUD 
Cc: Igor Grinberg 
Cc: Christian Riesch 
***
Message-Id: <1316066380-7397-9-git-send-email...@denx.de>

- changes for v2
  - use CONFIG_MACH_TYPE instead setting the MACH_TYPE in
board specific code, as Igor Grinberg suggested.
  - add logversion=2 to default Environment
  - Fix typo CONFIG_AM1808_LOWLEVEL as Christian Riesch
suggested.
  - Fix comment for PLL0 and PLL1 frequency and use PLLM = 18
for PLL0 to get the 456 MHz as Christian Riesch commented.
Also fix the DDR RAM timing according to the new settings
from the PLL
  - add MMC support
  - enable USB PSC
  - correct default environment "key_cmd*" vars
  - added MAINTAINERS entry
---
 MAINTAINERS|1 +
 board/enbw/enbw_cmc/Makefile   |   51 
 board/enbw/enbw_cmc/enbw_cmc.c |  599 
 boards.cfg |1 +
 include/configs/enbw_cmc.h |  452 ++
 5 files changed, 1104 insertions(+), 0 deletions(-)
 create mode 100644 board/enbw/enbw_cmc/Makefile
 create mode 100644 board/enbw/enbw_cmc/enbw_cmc.c
 create mode 100644 include/configs/enbw_cmc.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 3ab38fa..e0ae81c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -796,6 +796,7 @@ Jens Scharsig 
 
 Heiko Schocher 
 
+   enbw_cmcARM926EJS (AM1808 SoC)
magnesium   i.MX27
mgcoge3un   ARM926EJS (Kirkwood SoC)
 
diff --git a/board/enbw/enbw_cmc/Makefile b/board/enbw/enbw_cmc/Makefile
new file mode 100644
index 000..bdba069
--- /dev/null
+++ b/board/enbw/enbw_cmc/Makefile
@@ -0,0 +1,51 @@
+#
+# (C) Copyright 2000, 2001, 2002
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# Copyright (C) 2007 Sergey Kubushyn 
+#
+# 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   := $(BOARD).o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak *~ .depend
+
+#
+# This is for $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/enbw/enbw_cmc/enbw_cmc.c b/board/enbw/enbw_cmc/enbw_cmc.c
new file mode 100644
index 000..c25d240
--- /dev/null
+++ b/board/enbw/enbw_cmc/enbw_cmc.c
@@ -0,0 +1,599 @@
+/*
+ * (C) Copyright 2011
+ * Heiko Schocher, DENX Software Engineering, h...@denx.de.
+ *
+ * Based on:
+ * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Based on da830evm.c. Original Copyrights follow:
+ *
+ * Copyright (C) 2009 Nick Thompson, GE Fanuc, Ltd. 
+ * Copyright (C) 2007 Sergey Kubushyn 
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static const struct lpsc_resource lpsc[] = {
+   { DAVINCI_LPSC_AEMIF }, /* NAND, NOR */
+   { DAVINCI_LPSC_EMAC },  /* image dow

[U-Boot] [PATCH 0/2] USB keyboard driver rework

2011-10-07 Thread Marek Vasut
This series reworks the common/usb_kbd.c driver. The code in the driver was
messy so this is mostly cleanup and reorganisation.

This depends on previous patches:

[PATCH V2] USB: Add functionality to poll the USB keyboard via control EP
Message-Id: <1316977237-8709-1-git-send-email-marek.va...@gmail.com>

[PATCH V2] USB: Add usb_event_poll() to get keyboards working with EHCI
Message-Id: <1316977676-10284-1-git-send-email-marek.va...@gmail.com>

Cc: Ajay Kumar Gupta 
Cc: Bryan Wu 
Cc: Cliff Cai 
Cc: Mike Frysinger 
Cc: Remy Bohmer 
Cc: Wolfgang Denk 

Marek Vasut (2):
  USB: Rework USB keyboard driver
  USB: Drop dead code from usb_kbd.c

 common/usb_kbd.c|  977 +++
 drivers/usb/host/ehci-hcd.c |   20 +-
 drivers/usb/musb/musb_hcd.c |   19 +-
 include/usb.h   |1 +
 4 files changed, 351 insertions(+), 666 deletions(-)

-- 
1.7.6.3

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


[U-Boot] [PATCH 1/2] USB: Rework USB keyboard driver

2011-10-07 Thread Marek Vasut
Also, fix usb drivers which use extern new.

Signed-off-by: Marek Vasut 
Cc: Ajay Kumar Gupta 
Cc: Bryan Wu 
Cc: Cliff Cai 
Cc: Mike Frysinger 
Cc: Remy Bohmer 
Cc: Wolfgang Denk 
---
 common/usb_kbd.c|  644 ---
 drivers/usb/host/ehci-hcd.c |   20 +--
 drivers/usb/musb/musb_hcd.c |   19 +--
 include/usb.h   |1 +
 4 files changed, 369 insertions(+), 315 deletions(-)

NOTE: Tested on EfikaSB device, but please test on some more hardware first!

diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 503d175..d19551b 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -25,402 +25,490 @@
  *
  */
 #include 
+#include 
 #include 
 #include 
 
 #include 
 
-#undef USB_KBD_DEBUG
+/* USB Keyboard Debug */
+#undef USB_KBD_DEBUG
+
+#ifdef USB_KBD_DEBUG
+#defineUSB_KBD_PRINTF(fmt, args...)printf(fmt, ##args)
+#else
+#define USB_KBD_PRINTF(fmt, args...)
+#endif
+
 /*
- * if overwrite_console returns 1, the stdin, stderr and stdout
+ * If overwrite_console returns 1, the stdin, stderr and stdout
  * are switched to the serial port, else the settings in the
  * environment are used
  */
 #ifdef CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
-extern int overwrite_console (void);
+extern int overwrite_console(void);
 #else
 int overwrite_console (void)
 {
-   return (0);
+   return 0;
 }
 #endif
 
-#ifdef USB_KBD_DEBUG
-#defineUSB_KBD_PRINTF(fmt,args...) printf (fmt ,##args)
-#else
-#define USB_KBD_PRINTF(fmt,args...)
-#endif
-
-
-#define REPEAT_RATE  40/4 /* 40msec -> 25cps */
-#define REPEAT_DELAY 10 /* 10 x REAPEAT_RATE = 400msec */
-
-#define NUM_LOCK   0x53
-#define CAPS_LOCK 0x39
-#define SCROLL_LOCK 0x47
+/* Keyboard sampling rate */
+#defineREPEAT_RATE (40 / 4)/* 40msec -> 25cps */
+#defineREPEAT_DELAY10  /* 10 x REAPEAT_RATE = 400msec 
*/
 
+#defineNUM_LOCK0x53
+#defineCAPS_LOCK   0x39
+#defineSCROLL_LOCK 0x47
 
 /* Modifier bits */
-#define LEFT_CNTR  0
-#define LEFT_SHIFT 1
-#define LEFT_ALT   2
-#define LEFT_GUI   3
-#define RIGHT_CNTR 4
-#define RIGHT_SHIFT5
-#define RIGHT_ALT  6
-#define RIGHT_GUI  7
-
-#define USB_KBD_BUFFER_LEN 0x20  /* size of the keyboardbuffer */
-
-static volatile char usb_kbd_buffer[USB_KBD_BUFFER_LEN];
-static volatile int usb_in_pointer = 0;
-static volatile int usb_out_pointer = 0;
-
-unsigned char new[8];
-unsigned char old[8];
-int repeat_delay;
-#define DEVNAME "usbkbd"
-static unsigned char num_lock = 0;
-static unsigned char caps_lock = 0;
-static unsigned char scroll_lock = 0;
-static unsigned char ctrl = 0;
-
-static unsigned char leds __attribute__ ((aligned (0x4)));
-
-static unsigned char usb_kbd_numkey[] = {
-'1', '2', '3', '4', '5', '6', '7', '8', '9', '0','\r',0x1b,'\b','\t',' 
', '-',
-'=', '[', ']','\\', '#', ';', '\'', '`', ',', '.', '/'
+#defineLEFT_CNTR   (1 << 0)
+#defineLEFT_SHIFT  (1 << 1)
+#defineLEFT_ALT(1 << 2)
+#defineLEFT_GUI(1 << 3)
+#defineRIGHT_CNTR  (1 << 4)
+#defineRIGHT_SHIFT (1 << 5)
+#defineRIGHT_ALT   (1 << 6)
+#defineRIGHT_GUI   (1 << 7)
+
+/* Size of the keyboard buffer */
+#defineUSB_KBD_BUFFER_LEN  0x20
+
+/* Device name */
+#defineDEVNAME "usbkbd"
+
+/* Keyboard maps */
+static const unsigned char usb_kbd_numkey[] = {
+'1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
+'\r', 0x1b, '\b', '\t', ' ', '-', '=', '[', ']',
+'\\', '#', ';', '\'', '`', ',', '.', '/'
 };
-static unsigned char usb_kbd_numkey_shifted[] = {
-'!', '@', '#', '$', '%', '^', '&', '*', '(', ')','\r',0x1b,'\b','\t',' 
', '_',
-'+', '{', '}', '|', '~', ':', '"', '~', '<', '>', '?'
+
+static const unsigned char usb_kbd_numkey_shifted[] = {
+'!', '@', '#', '$', '%', '^', '&', '*', '(', ')',
+'\r', 0x1b, '\b', '\t', ' ', '_', '+', '{', '}',
+'|', '~', ':', '"', '~', '<', '>', '?'
 };
 
-static int usb_kbd_irq_worker(struct usb_device *dev);
+/*
+ * NOTE: It's important for the NUM, CAPS, SCROLL-lock bits to be in this
+ *   order. See usb_kbd_setled() function!
+ */
+#defineUSB_KBD_NUMLOCK (1 << 0)
+#defineUSB_KBD_CAPSLOCK(1 << 1)
+#defineUSB_KBD_SCROLLLOCK  (1 << 2)
+#defineUSB_KBD_CTRL(1 << 3)
 
-/**
- * Interrupt polling
- **/
-static inline void usb_kbd_poll_for_event(struct usb_device *dev)
-{
-#ifdefined(CONFIG_SYS_USB_EVENT_POLL)
-   usb_event_poll();
-   usb_kbd_irq_worker(dev);
-#elif  defined(CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP)
-   struct usb_interface *iface;
-   iface = &dev->config.if_d

[U-Boot] [PATCH 2/2] USB: Drop dead code from usb_kbd.c

2011-10-07 Thread Marek Vasut
Signed-off-by: Marek Vasut 
Cc: Wolfgang Denk 
Cc: Remy Bohmer 
---
 common/usb_kbd.c |  369 --
 1 files changed, 0 insertions(+), 369 deletions(-)

diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index d19551b..c453ea3 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -509,372 +509,3 @@ int usb_kbd_deregister(void)
return 1;
 #endif
 }
-
-#if 0
-struct usb_hid_descriptor {
-   unsigned char  bLength;
-   unsigned char  bDescriptorType; /* 0x21 for HID */
-   unsigned short bcdHID; /* release number */
-   unsigned char  bCountryCode;
-   unsigned char  bNumDescriptors;
-   unsigned char  bReportDescriptorType;
-   unsigned short wDescriptorLength;
-} __attribute__ ((packed));
-
-/*
- * We parse each description item into this structure. Short items data
- * values are expanded to 32-bit signed int, long items contain a pointer
- * into the data area.
- */
-
-struct hid_item {
-   unsigned char format;
-   unsigned char size;
-   unsigned char type;
-   unsigned char tag;
-   union {
-   unsigned char   u8;
-   chars8;
-   unsigned short  u16;
-   short   s16;
-   unsigned long   u32;
-   longs32;
-   unsigned char  *longdata;
-   } data;
-};
-
-/*
- * HID report item format
- */
-
-#define HID_ITEM_FORMAT_SHORT  0
-#define HID_ITEM_FORMAT_LONG   1
-
-/*
- * Special tag indicating long items
- */
-
-#define HID_ITEM_TAG_LONG  15
-
-
-static struct usb_hid_descriptor usb_kbd_hid_desc;
-
-void usb_kbd_display_hid(struct usb_hid_descriptor *hid)
-{
-   printf("USB_HID_DESC:\n");
-   printf("  bLenght   0x%x\n",hid->bLength);
-   printf("  bcdHID0x%x\n",hid->bcdHID);
-   printf("  bCountryCode  %d\n",hid->bCountryCode);
-   printf("  bNumDescriptors   0x%x\n",hid->bNumDescriptors);
-   printf("  bReportDescriptorType 0x%x\n",hid->bReportDescriptorType);
-   printf("  wDescriptorLength 0x%x\n",hid->wDescriptorLength);
-}
-
-
-/*
- * Fetch a report description item from the data stream. We support long
- * items, though they are not used yet.
- */
-
-static int fetch_item(unsigned char *start,unsigned char *end, struct hid_item 
*item)
-{
-   if((end - start) > 0) {
-   unsigned char b = *start++;
-   item->type = (b >> 2) & 3;
-   item->tag  = (b >> 4) & 15;
-   if (item->tag == HID_ITEM_TAG_LONG) {
-   item->format = HID_ITEM_FORMAT_LONG;
-   if ((end - start) >= 2) {
-   item->size = *start++;
-   item->tag  = *start++;
-   if ((end - start) >= item->size) {
-   item->data.longdata = start;
-   start += item->size;
-   return item->size;
-   }
-   }
-   } else {
-   item->format = HID_ITEM_FORMAT_SHORT;
-   item->size = b & 3;
-   switch (item->size) {
-   case 0:
-   return item->size;
-   case 1:
-   if ((end - start) >= 1) {
-   item->data.u8 = *start++;
-   return item->size;
-   }
-   break;
-   case 2:
-   if ((end - start) >= 2) {
-   item->data.u16 = 
le16_to_cpu((unsigned short *)start);
-   start+=2;
-   return item->size;
-   }
-   case 3:
-   item->size++;
-   if ((end - start) >= 4) {
-   item->data.u32 = 
le32_to_cpu((unsigned long *)start);
-   start+=4;
-   return item->size;
-   }
-   }
-   }
-   }
-   return -1;
-}
-
-/*
- * HID report descriptor item type (prefix bit 2,3)
- */
-
-#define HID_ITEM_TYPE_MAIN 0
-#define HID_ITEM_TYPE_GLOBAL   1
-#define HID_ITEM_TYPE_LOCAL2
-#define HID_ITEM_TYPE_RESERVED 3
-/*
- * HID report descriptor main item tags
- */
-
-#define HID_MAIN_ITEM_TAG_INPUT8
-#define HID_MAIN_ITEM_TAG_OUTPUT   9
-#de

Re: [U-Boot] RFC [PATCH 2/5] arm/kirkwood: print speeds with cpu info.

2011-10-07 Thread Jason
Wolfgang,

On Thu, Oct 06, 2011 at 08:13:36PM +0200, Wolfgang Denk wrote:
> In message <1311715171-13128-2-git-send-email-u-b...@lakedaemon.net> you 
> wrote:
> ...
> > +   printf("CPU running @ %dMHz L2 running @ %dMHz\n",
> > +   cpu_clk, l2_clk);
> > +   printf("SysClock = %dMHz, TClock = %dMHz\n",
> > +   sys_clk, t_clk / 100);
> 
> Please use strmhz() to format the frequencies.

Will do, however, please be aware that this patch has been set aside.  I
not familiar enough with all the variants to do it properly, and it was
purely informative.

If somebody expresses an interest, or offers to help, I'll resume work
on it at a later date.

thx,

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


Re: [U-Boot] RFC [PATCH 4/5 v5] dreamplug: initial board support.

2011-10-07 Thread Jason
Wolfgang,

On Thu, Oct 06, 2011 at 08:15:28PM +0200, Wolfgang Denk wrote:
> In message <1311715171-13128-4-git-send-email-u-b...@lakedaemon.net> you 
> wrote:
> > Copied wholeheartedly from board/Marvell/guruplug and modified to add 
> > support
> > for SPI NOR flash.
> ...
> > +   /* command to read PHY dev address */
> > +   if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) {
> > +   printf("Err..%s could not read PHY dev address\n",
> > +   __FUNCTION__);
> 
> Checkpatch says:
> 
> WARNING: __func__ should be used instead of gcc specific __FUNCTION__

This is an old version of this patch.  v8 is currently in Prafulla's
u-boot-marvell git tree.  It's fixed in there.

thx,

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


Re: [U-Boot] [PATCH 1/2] nand: Merge BCH code from Linux nand driver

2011-10-07 Thread Christian Hitz
Hello,

Am 07.10.2011 07:29, schrieb Wolfgang Denk:
> In 
> message  
> you wrote:
>>
>>> total: 566 errors, 1052 warnings, 1912 lines checked
>>>
>>> Please clean up and resubmit.
>>
>> Not that I've checked personally but might this be a case of matching
>> the kernel code and keeping in sync there?
>
> This is just too bad.  If needed, the kernel code should be cleaned up
> in sync.
>
> BTW: if this is copied from Linux, then you failed to provide exavct
> reference - see bullet # 4 at
> http://www.denx.de/wiki/view/U-Boot/Patches#Attributing_Code_Copyrights_Sign

I will resubmit using a real email client and also add the exact reference.

Regards,
Christian

-- 
Christian Hitz
aizo ag, Schlieren, Switzerland, www.aizo.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] powerpc/85xx: CONFIG_ENABLE_36BIT_PHYS does not depend on CONFIG_PHYS_64BIT

2011-10-07 Thread Kumar Gala

On Sep 6, 2011, at 9:36 AM, Timur Tabi wrote:

> The macro CONFIG_ENABLE_36BIT_PHYS is used to indicate that the given SOC is
> capable of 36-bit physical addresses, even if such large addresses are not
> used.  On two boards, this macro was enabled only when building a 36-bit
> image.
> 
> Signed-off-by: Timur Tabi 
> ---
> include/configs/P1022DS.h  |3 ++-
> include/configs/p1_p2_rdb_pc.h |3 +--
> 2 files changed, 3 insertions(+), 3 deletions(-)

applied to 85xx

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


Re: [U-Boot] [u-boot-release] [PATCH] powerpc/mpc8xxx: Merge entries in DDR speed table

2011-10-07 Thread Kumar Gala

On Oct 3, 2011, at 11:19 AM, York Sun wrote:

> It is not necessary to keep multiple entries for the same setting in DDR
> speed tables. Merge them for smaller tables. Also restructure the tables
> for smaller size. Cleanup some typedefs.
> 
> Enforce strict checking for speed table. If DIMM is running at higher than
> known speed, try to use the highest speed setting. If rank is unknown, it
> has to panic.
> 
> Removed ODT overriding for P2020DS as it is not necessary.
> 
> Signed-off-by: York Sun 
> ---
> board/freescale/corenet_ds/ddr.c  |  222 -
> board/freescale/mpc8349emds/ddr.c |   80 --
> board/freescale/mpc8572ds/ddr.c   |  203 +-
> board/freescale/mpc8641hpcn/ddr.c |  165 
> board/freescale/p1022ds/ddr.c |   79 +-
> board/freescale/p2020ds/ddr.c |  105 +
> board/freescale/p2041rdb/ddr.c|   78 -
> 7 files changed, 472 insertions(+), 460 deletions(-)

applied to 85xx

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


Re: [U-Boot] [PATCH 2/2] nand: Merge changes from Linux nand driver

2011-10-07 Thread Christian Hitz
Am 06.10.2011 23:25, schrieb Scott Wood:
> On 10/06/2011 04:06 PM, Wolfgang Denk wrote:
>> Dear "Hitz, Christian",
>>
>> In 
>> message
>>   you wrote:
>>> This patch synchronizes the nand driver with the Linux 3.0 state.
>>>
>>> Signed-off-by: Christian Hitz
>>> ---
>>>   drivers/mtd/nand/nand_base.c |  578 
>>> +-
>>>   drivers/mtd/nand/nand_bbt.c  |  423 ---
>>>   drivers/mtd/nand/nand_ecc.c  |  560 
>>> +++-
>>>   include/linux/mtd/bbm.h  |   29 ++-
>>>   include/linux/mtd/nand.h |  378 
>>>   include/linux/string.h   |   46 +++-
>>>   lib/string.c |  461 --
>>>   7 files changed, 1709 insertions(+), 766 deletions(-)
>
> What do the string changes have to do with synchronizing the NAND driver?

Strings read from ONFI are now sanitized. For that strim() is used which 
was not yet available in U-Boots string library. Of course I went 
overboard with syncing the whole string library. I'll submit a new 
version that only adds strim().

> How much does this update affect image size?  This may be a good time to
> start ifdeffing portions of the NAND code based on what's actually
> needed by the target.

before: u-boot.bin: 298112 bytes
after: u-boot.bin: 301928 bytes
(based on our at91sam9g20ek based design, ONFI enabled)

One option would be to ifdef the 1-bit software ECC. This would free 
aroud 2k (down to: 299744 bytes).

Regards,
Christian

-- 
Christian Hitz
aizo ag, Schlieren, Switzerland, www.aizo.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] powerpc/85xx: fix null pointer dereference when initializing the SGMII TBI PHY

2011-10-07 Thread Kumar Gala

On Oct 4, 2011, at 4:44 PM, Timur Tabi wrote:

> Function dtsec_configure_serdes() needs to know where the TBI PHY registers
> are in order to configure SGMII for proper SerDes operation.
> 
> During SGMII initialzation, fm_eth_init_mac() passing NULL for 'phyregs' when
> it called init_dtsec(), because it was believed that phyregs was not used.
> In fact, it is used by dtsec_configure_serdes() to configure the TBI PHY
> registers.
> 
> We also need to define the PHY registers in struct fm_mdio.
> 
> Signed-off-by: Timur Tabi 
> ---
> 
> Note: I'm not sure of my change to struct fm_mdio.  It works, but it doesn't
> smell right.
> 
> arch/powerpc/include/asm/fsl_fman.h |9 -
> drivers/net/fm/dtsec.c  |2 +-
> drivers/net/fm/eth.c|3 ++-
> 3 files changed, 11 insertions(+), 3 deletions(-)

applied to 85xx

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


Re: [U-Boot] [PATCH 1/2] powerpc/mpc8641hpcn: fix SRIO BAT config

2011-10-07 Thread Kumar Gala

On Oct 3, 2011, at 7:10 PM, Becky Bruce wrote:

> There were duplicate (and conflicting) defines for the BATs used
> to cover SRIO.  Drop the bogus set.
> 
> Signed-off-by: Becky Bruce 
> ---
> include/configs/MPC8641HPCN.h |5 -
> 1 files changed, 0 insertions(+), 5 deletions(-)

applied to 85xx

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


Re: [U-Boot] [PATCH 2/2] powerpc/mpc86xx: Disable translation for BAT setup

2011-10-07 Thread Kumar Gala

On Oct 3, 2011, at 7:10 PM, Becky Bruce wrote:

> We really shouldn't be overwriting bat registers with translation
> enabled, especially when we're executing code using one of them
> for translating the current instruction stream.  Instead, disable
> address translation while doing the final BAT setup.
> 
> In order to do this, setup_bats has to move back to asm code,
> because we require translation to be enabled to have a stack for
> C code.  The yucky thing about that is that the assembler doesn't
> like ULL so we have to switch to using HIGH/LOW pairs for
> physical addresses that are > 32 bits in length.
> 
> Signed-off-by: Becky Bruce 
> Acked-by: York Sun 
> ---
> arch/powerpc/cpu/mpc86xx/cpu_init.c |   28 
> arch/powerpc/cpu/mpc86xx/start.S|   69 +++-
> include/configs/MPC8641HPCN.h   |  123 +--
> include/mpc86xx.h   |1 +
> 4 files changed, 142 insertions(+), 79 deletions(-)

applied to 85xx

- k

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


Re: [U-Boot] [PATCH 1/4] powerpc/mpc8536ds: Add eSPI support for MPC8536DS

2011-10-07 Thread Kumar Gala

On Oct 3, 2011, at 2:18 PM, York Sun wrote:

> From: Xie Xiaobo 
> 
> 1.The SD_DATA[4:7] signals are shared with the SPI chip selects on 8536DS,
>  so don't set MPC85xx_PMUXCR_SD_DATA that config eSDHC data bus-width
>  to 4-bit and enable SPI signals.
> 2.Add eSPI controller and SPI-FLASH definition.
> 
> Signed-off-by: Xie Xiaobo 
> ---
> arch/powerpc/include/asm/immap_85xx.h |5 +
> board/freescale/mpc8536ds/mpc8536ds.c |6 ++
> include/configs/MPC8536DS.h   |   14 ++
> 3 files changed, 21 insertions(+), 4 deletions(-)

applied to 85xx

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


Re: [U-Boot] [PATCH 4/4] powerpc/mpc8536ds: Add USB support for MPC8536DS

2011-10-07 Thread Kumar Gala

On Oct 3, 2011, at 2:18 PM, York Sun wrote:

> From: Fanzc 
> 
> Add EHCI controller and USB command definition.
> 
> Signed-off-by: Xie Xiaobo 
> ---
> include/configs/MPC8536DS.h |   15 +++
> 1 files changed, 15 insertions(+), 0 deletions(-)

applied to 85xx

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


Re: [U-Boot] [PATCH] powerpc/mpc8536ds: Save the env variables to SDcard and SPI flash

2011-10-07 Thread Kumar Gala

On Oct 3, 2011, at 2:54 PM, York Sun wrote:

> From: Xie Xiaobo 
> 
> MPC8536DS offer booting from SDcard or SPI flash.
> This patch defined that u-boot can save the environment variables
> on SDcard or SPI flash when booting from the related device.
> The Env parameter region and linux kernel region have overlap
> in SPI-Flash, So change the Env param saving address.
> 
> Signed-off-by: Xie Xiaobo 
> ---
> include/configs/MPC8536DS.h |   22 ++
> 1 files changed, 18 insertions(+), 4 deletions(-)

applied to 85xx

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


Re: [U-Boot] [PATCH] phylib: Work around bug in Teranetics PHY

2011-10-07 Thread Kumar Gala

On Aug 16, 2011, at 5:08 PM, Andy Fleming wrote:

> The Teranetics PHY does not properly report the link state
> for fiber connections. The new PHY code actually checked the link,
> and so the FM driver would refuse to talk over a linkless PHY.
> 
> But the link may actually be up, so now we always report it as up
> for fiber connections on the tn2020.
> 
> Signed-off-by: Andy Fleming 
> ---
> drivers/net/phy/teranetics.c |   21 -
> 1 files changed, 20 insertions(+), 1 deletions(-)

applied to 85xx

- k

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


Re: [U-Boot] [Patch v4 7/7] powerpc/8xxx: Add support for interactive DDR programming interface

2011-10-07 Thread Kumar Gala

On Sep 16, 2011, at 3:21 PM, York Sun wrote:

> Interactive DDR debugging provides a user interface to view and modify SPD,
> DIMM parameters, board options and DDR controller registers before DDR is
> initialized. With this feature, developers can fine-tune DDR for board
> bringup and other debugging without frequently having to reprogram the flash.
> 
> To enable this feature, define CONFIG_FSL_DDR_INTERACTIVE in board header
> file and set an environment variable to activate it. Syntax:
> 
> setenv ddr_interactive on
> 
> After reset, U-boot prompts before initializing DDR controllers
> FSL DDR>
> 
> The available commands are
> print  print SPD and intermediate computed data
> reset  reboot machine
> recompute  reload SPD and options to default and recompute regs
> edit   modify spd, parameter, or option
> computerecompute registers from current next_step to end
> next_step  shows current next_step
> help   this message
> go program the memory controller and continue with u-boot
> 
> The first command should be "compute", which reads data from DIMM SPDs and
> board options, performs the calculation then stops before setting DDR
> controller. A user can use "print" and "edit" commands to view and modify
> anything. "Go" picks up from current step with any modification and
> compltes the calculation then enables the DDR controller to continue u-boot.
> "Recompute" does it over from fresh reading.
> 
> Signed-off-by: York Sun 
> ---
> Change since v3
> Add detail syntax and examples in README.fsl-doc
> 
> README |3 +
> arch/powerpc/cpu/mpc8xxx/ddr/Makefile  |3 +-
> arch/powerpc/cpu/mpc8xxx/ddr/ddr.h |   40 +-
> arch/powerpc/cpu/mpc8xxx/ddr/interactive.c | 1691 
> arch/powerpc/cpu/mpc8xxx/ddr/main.c|9 +-
> doc/README.fsl-ddr |  150 +++
> 6 files changed, 1879 insertions(+), 17 deletions(-)
> create mode 100644 arch/powerpc/cpu/mpc8xxx/ddr/interactive.c

applied to 85xx

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


Re: [U-Boot] [PATCH 6/9] powerpc/mpc8548cds: Update config file

2011-10-07 Thread Kumar Gala

On Oct 6, 2011, at 4:33 PM, Wolfgang Denk wrote:

> Dear Zhao Chenhui,
> 
> In message <1315898131-27710-6-git-send-email-chenhui.z...@freescale.com> you 
> wrote:
>> From: chenhui zhao 
>> 
>> -Increase the size of malloc space.
>> -Enable e1000 network card.
>> -Change the location of env address.
>> -Use hwconfig to turn off ECC.
>> 
>> Signed-off-by: Zhao Chenhui 
>> ---
>> include/configs/MPC8548CDS.h |   14 +++---
>> 1 files changed, 11 insertions(+), 3 deletions(-)
> 
> Checkpatch says:
> 
> total: 0 errors, 1 warnings, 50 lines checked
> 
> Please clean up and resubmit.  Thanks.
> 
> Best regards,
> 
> Wolfgang Denk

I don't agree with this checkpatch warning.  The extra space adds to 
readability so leaving this alone.

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


Re: [U-Boot] [PATCH 6/9] powerpc/mpc8548cds: Update config file

2011-10-07 Thread Kumar Gala

On Sep 13, 2011, at 2:15 AM, Zhao Chenhui wrote:

> From: chenhui zhao 
> 
> -Increase the size of malloc space.
> -Enable e1000 network card.
> -Change the location of env address.
> -Use hwconfig to turn off ECC.
> 
> Signed-off-by: Zhao Chenhui 
> ---
> include/configs/MPC8548CDS.h |   14 +++---
> 1 files changed, 11 insertions(+), 3 deletions(-)

applied to 85xx

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


Re: [U-Boot] [PATCH 8/9] powerpc/mpc8548cds: Fix config according to system address map

2011-10-07 Thread Kumar Gala

On Sep 13, 2011, at 2:15 AM, Zhao Chenhui wrote:

> From: chenhui zhao 
> 
> - Fix config according to system address map in the manual.
> - Rework tlb and law tables.
> - Remove unnecessary macros.
> 
> Signed-off-by: Zhao Chenhui 
> ---
> board/freescale/mpc8548cds/law.c|   19 +
> board/freescale/mpc8548cds/mpc8548cds.c |8 ++--
> board/freescale/mpc8548cds/tlb.c|   67 ---
> include/configs/MPC8548CDS.h|   56 -
> 4 files changed, 76 insertions(+), 74 deletions(-)

with which manual?  If its the board manual that isn't correct, the one in the 
board manual is just an example.

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


Re: [U-Boot] [PATCH 2/2] nand: Merge changes from Linux nand driver

2011-10-07 Thread Scott Wood
On 10/07/2011 10:04 AM, Christian Hitz wrote:
> Am 06.10.2011 23:25, schrieb Scott Wood:
>> What do the string changes have to do with synchronizing the NAND driver?
> 
> Strings read from ONFI are now sanitized. For that strim() is used which
> was not yet available in U-Boots string library. Of course I went
> overboard with syncing the whole string library. I'll submit a new
> version that only adds strim().

Please make it a separate patch.

>> How much does this update affect image size?  This may be a good time to
>> start ifdeffing portions of the NAND code based on what's actually
>> needed by the target.
> 
> before: u-boot.bin: 298112 bytes
> after: u-boot.bin: 301928 bytes
> (based on our at91sam9g20ek based design, ONFI enabled)
> 
> One option would be to ifdef the 1-bit software ECC. This would free
> aroud 2k (down to: 299744 bytes).

There are a bunch of things that could be ifdeffed, which gc-sections
doesn't help with because they are referenced with things like:

if (!pointer)
pointer = some_func;


Think large page versus small page, functions that the hw-specific
driver overrides, all the different types of ECC (ifdeffing out 1-bit
but not 4 or 8 won't keep U-Boot from growing on boards that use 1-bit),
ONFI, the read_page/write_page variants, etc.

-Scott

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


Re: [U-Boot] [PATCH 3/4] fsl_sata: Fix compile error when CONFIG_LBA48 is not defined

2011-10-07 Thread Kumar Gala

On Oct 3, 2011, at 2:18 PM, York Sun wrote:

> From: Tang Yuantian 
> 
> If CONFIG_LBA48 is not defined, the element lba48 of
> struct sata_dev_desc is not avaible, and can't be used.
> 
> Signed-off-by: Tang Yuantian 
> ---
> drivers/block/fsl_sata.c |   15 ++-
> 1 files changed, 10 insertions(+), 5 deletions(-)

applied to 85xx

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


[U-Boot] [GIT PULL] Pull request u-boot-85xx.git

2011-10-07 Thread Kumar Gala
The following changes since commit 08e4f700ac450ddc5d4819e23df5bc46eb767464:
  Marek Vasut (1):
SPL: Make path to start.S configurable

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

Andy Fleming (1):
  phylib: Work around bug in Teranetics PHY

Becky Bruce (2):
  powerpc/mpc8641hpcn: fix SRIO BAT config
  powerpc/mpc86xx: Disable translation for BAT setup

Fanzc (1):
  powerpc/mpc8536ds: Add USB support for MPC8536DS

Tang Yuantian (1):
  fsl_sata: Fix compile error when CONFIG_LBA48 is not defined

Timur Tabi (2):
  powerpc/85xx: CONFIG_ENABLE_36BIT_PHYS does not depend on 
CONFIG_PHYS_64BIT
  powerpc/85xx: fix null pointer dereference when init the SGMII TBI PHY

Xie Xiaobo (3):
  powerpc/mpc8536ds: Add eSPI support for MPC8536DS
  powerpc/mpc8536ds: Invert SDHC_WP pin polarity
  powerpc/mpc8536ds: Save the env variables to SDcard and SPI flash

York Sun (2):
  powerpc/8xxx: Add support for interactive DDR programming interface
  powerpc/mpc8xxx: Merge entries in DDR speed table

chenhui zhao (1):
  powerpc/mpc8548cds: Update config file

 README |3 +
 arch/powerpc/cpu/mpc86xx/cpu_init.c|   28 -
 arch/powerpc/cpu/mpc86xx/start.S   |   69 ++-
 arch/powerpc/cpu/mpc8xxx/ddr/Makefile  |3 +-
 arch/powerpc/cpu/mpc8xxx/ddr/ddr.h |   40 +-
 arch/powerpc/cpu/mpc8xxx/ddr/interactive.c | 1691 
 arch/powerpc/cpu/mpc8xxx/ddr/main.c|9 +-
 arch/powerpc/include/asm/fsl_fman.h|9 +-
 arch/powerpc/include/asm/immap_85xx.h  |5 +
 board/freescale/corenet_ds/ddr.c   |  222 ++--
 board/freescale/mpc8349emds/ddr.c  |   80 +-
 board/freescale/mpc8536ds/mpc8536ds.c  |   12 +-
 board/freescale/mpc8572ds/ddr.c|  203 ++--
 board/freescale/mpc8641hpcn/ddr.c  |  165 ++--
 board/freescale/p1022ds/ddr.c  |   79 +-
 board/freescale/p2020ds/ddr.c  |  105 +-
 board/freescale/p2041rdb/ddr.c |   78 +-
 doc/README.fsl-ddr |  150 +++
 drivers/block/fsl_sata.c   |   15 +-
 drivers/net/fm/dtsec.c |2 +-
 drivers/net/fm/eth.c   |3 +-
 drivers/net/phy/teranetics.c   |   21 +-
 include/configs/MPC8536DS.h|   51 +-
 include/configs/MPC8548CDS.h   |   16 +-
 include/configs/MPC8641HPCN.h  |  128 ++-
 include/configs/P1022DS.h  |3 +-
 include/configs/p1_p2_rdb_pc.h |5 +-
 include/mpc86xx.h  |1 +
 28 files changed, 2611 insertions(+), 585 deletions(-)
 create mode 100644 arch/powerpc/cpu/mpc8xxx/ddr/interactive.c
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] image: Implement IH_TYPE_KERNEL_REL

2011-10-07 Thread Stephen Warren
Wolfgang Denk wrote at Friday, October 07, 2011 12:51 AM:
> Dear Stephen Warren,
> 
> In message <1317940584-19528-1-git-send-email-swar...@nvidia.com> you wrote:
> > uImage files contain absolute "load" and "entry" addresses. Such a concept
> > is incompatible with using the same kernel image on multiple SoCs, each with
> > a potentially different SDRAM base. To support that, create a new image type
> > IH_TYPE_KERNEL_REL, which is handled identically to IH_TYPE_KERNEL, except
> > that the "load" and "entry" properties are an offset from the base of SDRAM,
> > rather than an absolute address.
> >
> > "An offset from the base of SDRAM" is specified as:
> > a) CONFIG_SYS_SDRAM_BASE, if set.
> > b) Otherwise, for ARM, the start address of the first bank of SDRAM known
> >to U-Boot.
> > c) Otherwise, 0.
> 
> I agree with Kumar: it should be sufficient to have this omment in
> the code.

OK. I was trying to make the commit comment standalone so people could
read and understand it without having to go read the whole patch to find
the comment too. I guess I can drop it from the commit description if
you want.

> But please define "first bank" - does it mena the firs one
> initialized, or the lowest start address, or the lowest chip select,
> or ... ?

It's the following currently:

gd->bd->bi_dram[0].start

* How would you describe this; "the first DRAM bank registered with
U-Boot"?

* Is this a good value to use, or should getenv_bootm_low() search through
all banks to find the one with lowest address or something?

> Also, I think you are right, and we should add IH_TYPE_FLATDT_REL as
> well.

OK.

...
> > - * fit_image_get_load - get load address property for a given component 
> > image node
> > + * fit_image_get_load_raw - get raw load address property for a given 
> > component image node
> 
> Line too long. [Did you run checkpatch?]

Yes, but I though (evidently incorrectly) that the first sentence of
function comments was supposed to be one line for grep'ability.

...
> Hm... this appears to add some additional code.  How much does the
> size grow?

At least when building for Tegra, this adds 576 bytes text, and 136 bytes
rodata. That's about a 0.4% size increase to each section.

> Can we make support for relative images optional?

I guess it's possible. It'll mean a heck of a lot of ifdef's in the
middle of all those multi-test if statements that work on a variety of
image types though. Are the size increases above as large as you feared;
is it worth making it optional?

Thanks for the review.

-- 
nvpublic

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


Re: [U-Boot] [PATCH 2/4] powerpc/mpc8536ds: Invert SDHC_WP pin polarity

2011-10-07 Thread Kumar Gala

On Oct 3, 2011, at 2:18 PM, York Sun wrote:

> From: Xie Xiaobo 
> 
> MPC8536 Rev 1.0 silicon have NMG_eSDHC118 erratum,
> so that the SDHC write protected pin polarity does not
> follow the SD card standard in MPC8536 Rev 1.0 silicon.
> The MPC8536DS board invert the SDHC_WP pin as a workaround.
> However, This silicon erratum has been fixed in Rev 1.1,
> So need invert the SDHC_WP polarity again when use the MPC8536
> Rev1.1 and greater on MPC8536DS board.
> 
> Signed-off-by: Xie Xiaobo 
> ---
> board/freescale/mpc8536ds/mpc8536ds.c |8 
> 1 files changed, 8 insertions(+), 0 deletions(-)

applied to 85xx

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


Re: [U-Boot] [PATCH 1/7] arch/arm/lib/board.c: fix warning: variable ... set but not used

2011-10-07 Thread Simon Glass
Hi Wolfgang,

On Wed, Oct 5, 2011 at 2:17 PM, Wolfgang Denk  wrote:
> Fix:
> board.c:445:8: warning: variable 'bd' set but not used 
> [-Wunused-but-set-variable]
>
> Signed-off-by: Wolfgang Denk 
> Cc: Albert ARIBAUD 
> ---
>  arch/arm/lib/board.c |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
> index 705d4d2..b266f78 100644
> --- a/arch/arm/lib/board.c
> +++ b/arch/arm/lib/board.c
> @@ -442,14 +442,12 @@ static char *failed = "*** failed ***\n";
>  void board_init_r(gd_t *id, ulong dest_addr)
>  {
>        char *s;
> -       bd_t *bd;
>        ulong malloc_start;
>  #if !defined(CONFIG_SYS_NO_FLASH)
>        ulong flash_size;
>  #endif
>
>        gd = id;
> -       bd = gd->bd;
>
>        gd->flags |= GD_FLG_RELOC;      /* tell others: relocation done */

Sorry if I have missed a mailing list patch, but in my version of the
source there is a line a little lower down which uses bd:

   mmc_initialize(bd);

Of course it can just become gd->bd so there is no problem removing
the variable.

Regards,
Simon

>
> --
> 1.7.6.2
>
> ___
> 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] [PATCH v8 4/4] Add USB support for Efika

2011-10-07 Thread Jana Rapava
2011/10/6 Wolfgang Denk 

>
> Checkpatch says:
>
> total: 1 errors, 0 warnings, 502 lines checked
>
> Please clean up and resubmit.  Thanks.
>
>
Last version of this patch is here:
http://lists.denx.de/pipermail/u-boot/2011-September/102803.html
(sorry for breaking the thread but I messed up some In-Reply-To: headers).
On the last version checkpatch says only two warnings, both are about
including files not from  and doesn't make sense in this case.
Regards,
Jana Rapava
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mvgbe: fix network device indices

2011-10-07 Thread Mike Frysinger
On Thursday 06 October 2011 18:23:22 Michael Walle wrote:
> --- a/net/eth.c
> +++ b/net/eth.c
> 
> +int eth_setenv_enetaddr_by_index(const char *base_name, int index,
> +  const uchar *enetaddr)
> +{
> + char enetvar[32];
> + sprintf(enetvar, index ? "%s%daddr" : "%saddr", base_name, index);
> + return eth_setenv_enetaddr(enetvar, enetaddr);
> +}

please unify the duplicate logic coming from eth_getenv_enetaddr_by_index in a 
new local static function
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V3] cmd_time: add time command

2011-10-07 Thread Mike Frysinger
Acked-by: Mike Frysinger 
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/5 v2] microblaze: Fix unaligned.h for endians

2011-10-07 Thread Mike Frysinger
Acked-by: Mike Frysinger 
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arm, post, memory: fix bug if sdram base != 0x00000000

2011-10-07 Thread Mike Frysinger
Acked-by: Mike Frysinger 
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4] net: axi_ethernet: Add driver to u-boot

2011-10-07 Thread Mike Frysinger
Acked-by: Mike Frysinger 
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Ignore generated files

2011-10-07 Thread Mike Frysinger
On Thursday 06 October 2011 19:46:04 Joe Hershberger wrote:
> --- a/.gitignore
> +++ b/.gitignore
>
>  /lib/asm-offsets.s
>  /arch/*/cpu/asm-offsets.s
> +/arch/*/cpu/*/asm-offsets.s

NAK: your tree is out of date.  please sync up as this should be fixed already.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] kirkwood_spi: add dummy spi_init()

2011-10-07 Thread Mike Frysinger
Acked-by: Mike Frysinger 
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] netconsole: support packets longer than 512 bytes

2011-10-07 Thread Mike Frysinger
On Thursday 06 October 2011 18:23:38 Michael Walle wrote:
> --- a/drivers/net/netconsole.c
> +++ b/drivers/net/netconsole.c
> 
> - if ((len = strlen (s)) > 512)
> - len = 512;
> -
> - nc_send_packet (s, len);
> + len = strlen (s);
> + while (1) {
> + if (len > 512) {
> + nc_send_packet (s, 512);
> + len -= 512;
> + s += 512;
> + } else {
> + nc_send_packet (s, len);
> + break;
> + }
> + }

i know the existing code is broken, but when adding/changing lines, please use 
the correct style.  so this should be strlen(s) and such.

in terms of the actual content, this should be simpler:
while (len) {
int send_len = min(len, 512);
nc_send_packet(s, send_len);
len -= send_len;
s += send_len;
}
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arm: add ide initialization

2011-10-07 Thread Mike Frysinger
On Thursday 06 October 2011 18:23:06 Michael Walle wrote:
> --- a/arch/arm/lib/board.c
> +++ b/arch/arm/lib/board.c
> 
> +#if defined(CONFIG_CMD_IDE)
> + puts ("IDE:   ");
> + ide_init ();
> +#endif

NAK: no space before that open paren
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/6] davinci_emac: fix for running with dcache enabled

2011-10-07 Thread Mike Frysinger
On Wednesday 05 October 2011 19:36:44 Ilya Yanok wrote:
> --- a/drivers/net/davinci_emac.c
> +++ b/drivers/net/davinci_emac.c
> 
> +#ifdef DAVINCI_EMAC_DCACHE
> +static inline void davinci_flush(void *addr, int size)
> +{
> + flush_dcache_range((unsigned long)addr,
> + (unsigned long)addr + size);
> +}
> +
> +static inline void davinci_invalidate(void *addr, int size)
> +{
> + invalidate_dcache_range((unsigned long)addr,
> + (unsigned long)addr + size);
> +}
> +#else
> +#define davinci_flush(addr, size)do {} while (0)
> +#define davinci_invalidate(addr, size)   do {} while (0)
> +#endif

does it really make sense to have this be conditional ?
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 03/19] sandbox: Add architecture image support

2011-10-07 Thread Mike Frysinger
On Tuesday 04 October 2011 01:26:34 Simon Glass wrote:
> --- a/include/image.h
> +++ b/include/image.h
> 
>  static inline int image_check_target_arch (const image_header_t *hdr)
>  {
> -#if defined(__ARM__)
> +#if defined(CONFIG_SANDBOX_ARCH)
> + if (!image_check_arch(hdr, IH_ARCH_SANDBOX))
> +#elif defined(__ARM__)

you'll need to rebase onto latest master as this code no longer exists :).  
see 476af299b04ef07117bbc3cdef07885e1089967e for more info.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] USB: Rework USB keyboard driver

2011-10-07 Thread Mike Frysinger
On Friday 07 October 2011 08:30:55 Marek Vasut wrote:
> Also, fix usb drivers which use extern new.

this summary/changelog is lacking in information as to what you actually did 
and why ...
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] ppc: Include in common.h

2011-10-07 Thread Anton Staaf
On Fri, Oct 7, 2011 at 4:05 AM, Stefan Roese  wrote:
> This is needed for the patch "cache: add default setting for
> CONFIG_SYS_CACHELINE_SIZE" from Anton Staaf. As cache.h defines
> CONFIG_SYS_CACHELINE_SIZE for PPC targets.
>
> This will remove the following warnings/errors:
>
> include/common.h:819:2: warning: #warning CONFIG_SYS_CACHELINE_SIZE not 
> defined, using __BIGGEST_ALIGNMENT__
> cache.c:33: error: '__BIGGEST_ALIGNMENT__' undeclared (first use in this 
> function)
>
> Signed-off-by: Stefan Roese 
> Cc: Anton Staaf 
> Cc: Wolfgang Denk 
> ---
>  include/common.h |    8 
>  1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/include/common.h b/include/common.h
> index b55592d..f0ab346 100644
> --- a/include/common.h
> +++ b/include/common.h
> @@ -782,6 +782,14 @@ int cpu_release(int nr, int argc, char * const argv[]);
>
>  #endif /* __ASSEMBLY__ */
>
> +#ifdef CONFIG_PPC

It would be great if this could be enabled for all configs, not just
PPC.  Would it make sense to remove this check and add #ifndef
__ASSEMBLY__ to the other cache.h files?  The list is not too long
(m68k, sparc, sh, nios2, and arm).  I'd be happy to look into that if
you'd rather get this in first.

Thanks,
Anton

> +/*
> + * Has to be included outside of the #ifndef __ASSEMBLY__ section.
> + * Otherwise might lead to compilation errors in assembler files.
> + */
> +#include 
> +#endif
> +
>  /* Put only stuff here that the assembler can digest */
>
>  #ifdef CONFIG_POST
> --
> 1.7.6.1
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 03/19] sandbox: Add architecture image support

2011-10-07 Thread Simon Glass
Hi Mike,

On Fri, Oct 7, 2011 at 10:35 AM, Mike Frysinger  wrote:
> On Tuesday 04 October 2011 01:26:34 Simon Glass wrote:
>> --- a/include/image.h
>> +++ b/include/image.h
>>
>>  static inline int image_check_target_arch (const image_header_t *hdr)
>>  {
>> -#if defined(__ARM__)
>> +#if defined(CONFIG_SANDBOX_ARCH)
>> +     if (!image_check_arch(hdr, IH_ARCH_SANDBOX))
>> +#elif defined(__ARM__)
>
> you'll need to rebase onto latest master as this code no longer exists :).
> see 476af299b04ef07117bbc3cdef07885e1089967e for more info.
> -mike
>

OK I have rebased and will resend another version. Any other little
refactors I should know about? :-)

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


Re: [U-Boot] [PATCH v4 01/19] sandbox: Add architecture header files

2011-10-07 Thread Simon Glass
Hi Wolfg

On Thu, Oct 6, 2011 at 2:27 PM, Simon Glass  wrote:

> Hi Wolfgang,
>
> On Thu, Oct 6, 2011 at 2:11 PM, Wolfgang Denk  wrote:
>
>> Dear Simon Glass,
>>
>> In message <1317706010-17151-2-git-send-email-...@chromium.org> you
>> wrote:
>> > This adds required header files for the sandbox architecture, and a
>> basic
>> > description of what sandbox is (README.sandbox).
>> >
>> > Signed-off-by: Simon Glass 
>> > ---
>> > Changes in v2:
>> > - Removed unneeded clock.h
>> > - Moved gpio.h to asm-generic, removed GPIO_COUNT
>> > - Removed kernel cruft from posix_types.h
>> > - Removed dummy field from struct pt_regs
>> > - Remove contents of string.h; instead include linux/string.h
>> > - Remove unneeded functions in u-boot-sandbox.h
>> > - Remove contents of unaligned.h; instead include
>> asm-generic/unaligned.h
>> >
>> > Changes in v4:
>> > - Remove mon_len from global data
>> > - Fix up arm header file incorrectly removed
>> > - Added README note that standalone/API support is not available
>> >
>> >  arch/sandbox/include/asm/bitops.h |  162
>> +
>> >  arch/sandbox/include/asm/byteorder.h  |   40 +++
>> >  arch/sandbox/include/asm/config.h |   26 +
>> >  arch/sandbox/include/asm/global_data.h|   67 
>> >  arch/sandbox/include/asm/io.h |   41 +++
>> >  arch/sandbox/include/asm/posix_types.h|   57 ++
>> >  arch/sandbox/include/asm/ptrace.h |   38 +++
>> >  arch/sandbox/include/asm/string.h |   23 
>> >  arch/sandbox/include/asm/system.h |   36 +++
>> >  arch/sandbox/include/asm/types.h  |   72 +
>> >  arch/sandbox/include/asm/u-boot-sandbox.h |   38 +++
>> >  arch/sandbox/include/asm/u-boot.h |   61 +++
>> >  arch/sandbox/include/asm/unaligned.h  |   23 
>> >  doc/README.sandbox|   49 +
>> >  include/asm-generic/gpio.h|   25 +
>> >  include/common.h  |3 +
>> >  16 files changed, 761 insertions(+), 0 deletions(-)
>> >  create mode 100644 arch/sandbox/include/asm/bitops.h
>> >  create mode 100644 arch/sandbox/include/asm/byteorder.h
>> >  create mode 100644 arch/sandbox/include/asm/config.h
>> >  create mode 100644 arch/sandbox/include/asm/global_data.h
>> >  create mode 100644 arch/sandbox/include/asm/io.h
>> >  create mode 100644 arch/sandbox/include/asm/posix_types.h
>> >  create mode 100644 arch/sandbox/include/asm/ptrace.h
>> >  create mode 100644 arch/sandbox/include/asm/string.h
>> >  create mode 100644 arch/sandbox/include/asm/system.h
>> >  create mode 100644 arch/sandbox/include/asm/types.h
>> >  create mode 100644 arch/sandbox/include/asm/u-boot-sandbox.h
>> >  create mode 100644 arch/sandbox/include/asm/u-boot.h
>> >  create mode 100644 arch/sandbox/include/asm/unaligned.h
>> >  create mode 100644 doc/README.sandbox
>> >  create mode 100644 include/asm-generic/gpio.h
>>
>> Checkpatch says:
>>
>> total: 0 errors, 44 warnings, 767 lines checked
>>
>
> Yes there are a lot of warnings. Most of them seemed to be Linux-specific
> to me (e.g. use linux/io.h instead of asm/io.h, or not adding new typedefs).
> Should I post a list of them and why I think they are not relevant?
>
>
To follow up, here are the warnings I see, with my explanation below each
warning / group:

clean-patch.py -n
Cleaned 19 patches
0 errors, 44 warnings for 0001-sandbox-Add-architecture-header-files.patch:
warning: arch/sandbox/include/asm/bitops.h,30: Use of volatile is usually
wrong: see Documentation/volatile-considered-harmful.txt
warning: arch/sandbox/include/asm/bitops.h,32: Use of volatile is usually
wrong: see Documentation/volatile-considered-harmful.txt
warning: arch/sandbox/include/asm/bitops.h,34: Use of volatile is usually
wrong: see Documentation/volatile-considered-harmful.txt
warning: arch/sandbox/include/asm/bitops.h,36: Use of volatile is usually
wrong: see Documentation/volatile-considered-harmful.txt
warning: arch/sandbox/include/asm/bitops.h,44: Use of volatile is usually
wrong: see Documentation/volatile-considered-harmful.txt
warning: arch/sandbox/include/asm/bitops.h,54: Use of volatile is usually
wrong: see Documentation/volatile-considered-harmful.txt
warning: arch/sandbox/include/asm/bitops.h,66: Use of volatile is usually
wrong: see Documentation/volatile-considered-harmful.txt
warning: arch/sandbox/include/asm/bitops.h,76: Use of volatile is usually
wrong: see Documentation/volatile-considered-harmful.txt
warning: arch/sandbox/include/asm/bitops.h,88: Use of volatile is usually
wrong: see Documentation/volatile-considered-harmful.txt
warning: arch/sandbox/include/asm/bitops.h,90: Use of volatile is usually
wrong: see Documentation/volatile-considered-harmful.txt

These are the bitops and seem to have volatile in all the other archs also.

warning: arch/sandbox/include/asm/global_data.h,38: do not add new typedefs

This is the typedef for

Re: [U-Boot] [PATCH 1/2] USB: Rework USB keyboard driver

2011-10-07 Thread Marek Vasut
On Friday, October 07, 2011 07:38:19 PM Mike Frysinger wrote:
> On Friday 07 October 2011 08:30:55 Marek Vasut wrote:
> > Also, fix usb drivers which use extern new.
> 
> this summary/changelog is lacking in information as to what you actually
> did and why ...
> -mike

Hi Mike, generally shuffling with code, abstracting out some things, making it 
checkpatch-comformant. Also, addition of generic key report code when polling.

Do you have any comments on the code ? After I get some more feedback, I'll 
roll 
out V2.

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


Re: [U-Boot] [PATCH v4 03/19] sandbox: Add architecture image support

2011-10-07 Thread Mike Frysinger
On Friday 07 October 2011 15:58:36 Simon Glass wrote:
> On Fri, Oct 7, 2011 at 10:35 AM, Mike Frysinger wrote:
> > On Tuesday 04 October 2011 01:26:34 Simon Glass wrote:
> >> --- a/include/image.h
> >> +++ b/include/image.h
> >> 
> >>  static inline int image_check_target_arch (const image_header_t *hdr)
> >>  {
> >> -#if defined(__ARM__)
> >> +#if defined(CONFIG_SANDBOX_ARCH)
> >> + if (!image_check_arch(hdr, IH_ARCH_SANDBOX))
> >> +#elif defined(__ARM__)
> > 
> > you'll need to rebase onto latest master as this code no longer exists
> > :). see 476af299b04ef07117bbc3cdef07885e1089967e for more info.
> 
> OK I have rebased and will resend another version. Any other little
> refactors I should know about? :-)

i think that's the only refactor i've published so far that affects this set
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/3] [v2] powerpc/85xx: don't display address map size (32-bit vs. 36-bit) during boot

2011-10-07 Thread Timur Tabi
Most 85xx boards can be built as a 32-bit or a 36-bit.  Current code sometimes
displays which of these is actually built, but it's inconsistent.  This is
especially problematic since the "default" build for a given 85xx board can
be either one, so if you don't see a message, you can't always know which
size is being used.  Not only that, but each board includes code that displays
the message, so there is duplication.

So instead of displaying this message at boot time, the address map size
information is moved into the 'bdinfo' command.  The board-specific code is
deleted.

Signed-off-by: Timur Tabi 
---
 board/freescale/corenet_ds/corenet_ds.c |4 
 board/freescale/mpc8536ds/mpc8536ds.c   |7 +--
 board/freescale/mpc8572ds/mpc8572ds.c   |6 +-
 board/freescale/p1010rdb/p1010rdb.c |6 +-
 board/freescale/p1022ds/p1022ds.c   |8 ++--
 board/freescale/p1_p2_rdb/p1_p2_rdb.c   |4 +---
 board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c |8 +---
 board/freescale/p2020ds/p2020ds.c   |8 ++--
 board/freescale/p2041rdb/p2041rdb.c |4 
 common/cmd_bdinfo.c |8 
 10 files changed, 17 insertions(+), 46 deletions(-)

diff --git a/board/freescale/corenet_ds/corenet_ds.c 
b/board/freescale/corenet_ds/corenet_ds.c
index b1eecc4..a33c936 100644
--- a/board/freescale/corenet_ds/corenet_ds.c
+++ b/board/freescale/corenet_ds/corenet_ds.c
@@ -62,10 +62,6 @@ int checkboard (void)
else
printf("invalid setting of SW%u\n", PIXIS_LBMAP_SWITCH);
 
-#ifdef CONFIG_PHYS_64BIT
-   puts("36-bit Addressing\n");
-#endif
-
/* Display the RCW, so that no one gets confused as to what RCW
 * we're actually using for this boot.
 */
diff --git a/board/freescale/mpc8536ds/mpc8536ds.c 
b/board/freescale/mpc8536ds/mpc8536ds.c
index c9f85c8..6d0bfde 100644
--- a/board/freescale/mpc8536ds/mpc8536ds.c
+++ b/board/freescale/mpc8536ds/mpc8536ds.c
@@ -68,12 +68,7 @@ int checkboard (void)
u8 vboot;
u8 *pixis_base = (u8 *)PIXIS_BASE;
 
-   puts("Board: MPC8536DS ");
-#ifdef CONFIG_PHYS_64BIT
-   puts("(36-bit addrmap) ");
-#endif
-
-   printf ("Sys ID: 0x%02x, "
+   printf("Board: MPC8536DS Sys ID: 0x%02x, "
"Sys Ver: 0x%02x, FPGA Ver: 0x%02x, ",
in_8(pixis_base + PIXIS_ID), in_8(pixis_base + PIXIS_VER),
in_8(pixis_base + PIXIS_PVER));
diff --git a/board/freescale/mpc8572ds/mpc8572ds.c 
b/board/freescale/mpc8572ds/mpc8572ds.c
index b20299e..33a02ba 100644
--- a/board/freescale/mpc8572ds/mpc8572ds.c
+++ b/board/freescale/mpc8572ds/mpc8572ds.c
@@ -45,11 +45,7 @@ int checkboard (void)
u8 vboot;
u8 *pixis_base = (u8 *)PIXIS_BASE;
 
-   puts ("Board: MPC8572DS ");
-#ifdef CONFIG_PHYS_64BIT
-   puts ("(36-bit addrmap) ");
-#endif
-   printf ("Sys ID: 0x%02x, "
+   printf("Board: MPC8572DS Sys ID: 0x%02x, "
"Sys Ver: 0x%02x, FPGA Ver: 0x%02x, ",
in_8(pixis_base + PIXIS_ID), in_8(pixis_base + PIXIS_VER),
in_8(pixis_base + PIXIS_PVER));
diff --git a/board/freescale/p1010rdb/p1010rdb.c 
b/board/freescale/p1010rdb/p1010rdb.c
index 03e9da1..7aa2117 100644
--- a/board/freescale/p1010rdb/p1010rdb.c
+++ b/board/freescale/p1010rdb/p1010rdb.c
@@ -165,11 +165,7 @@ int checkboard(void)
struct cpu_type *cpu;
 
cpu = gd->cpu;
-   printf("Board: %sRDB ", cpu->name);
-#ifdef CONFIG_PHYS_64BIT
-   puts("(36-bit addrmap)");
-#endif
-   puts("\n");
+   printf("Board: %sRDB\n", cpu->name);
 
return 0;
 }
diff --git a/board/freescale/p1022ds/p1022ds.c 
b/board/freescale/p1022ds/p1022ds.c
index 456d9b0..aca30f3 100644
--- a/board/freescale/p1022ds/p1022ds.c
+++ b/board/freescale/p1022ds/p1022ds.c
@@ -56,12 +56,8 @@ int checkboard(void)
 {
u8 sw;
 
-   puts("Board: P1022DS ");
-#ifdef CONFIG_PHYS_64BIT
-   puts("(36-bit addrmap) ");
-#endif
-
-   printf("Sys ID: 0x%02x, Sys Ver: 0x%02x, FPGA Ver: 0x%02x, ",
+   printf("Board: P1022DS Sys ID: 0x%02x, "
+  "Sys Ver: 0x%02x, FPGA Ver: 0x%02x, ",
in_8(&pixis->id), in_8(&pixis->arch), in_8(&pixis->scver));
 
sw = in_8(&PIXIS_SW(PIXIS_LBMAP_SWITCH));
diff --git a/board/freescale/p1_p2_rdb/p1_p2_rdb.c 
b/board/freescale/p1_p2_rdb/p1_p2_rdb.c
index 864b3ce..6418710 100644
--- a/board/freescale/p1_p2_rdb/p1_p2_rdb.c
+++ b/board/freescale/p1_p2_rdb/p1_p2_rdb.c
@@ -110,9 +110,7 @@ int checkboard (void)
 
cpu = gd->cpu;
printf ("Board: %sRDB Rev%c\n", cpu->name, board_rev);
-#ifdef CONFIG_PHYS_64BIT
-   puts ("(36-bit addrmap) \n");
-#endif
+
setbits_be32(&pgpio->gpdir, GPIO_DIR);
 
 /*
diff --git a/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c 
b/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c
index 4671128..abe087b 100644
--- a/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c
+++ b/board/

[U-Boot] [PATCH 2/3] [v2] phylib: wait for TN2020 to achieve SERDES lane alignment at startup

2011-10-07 Thread Timur Tabi
Before the Teranetics TN2020 PHY can be used, the SERDES lanes need to be
aligned, so wait for lane alignment before completing the startup sequence.

Note that this process can take up to three seconds.

Signed-off-by: Timur Tabi 
---
 drivers/net/phy/teranetics.c |   33 +
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/drivers/net/phy/teranetics.c b/drivers/net/phy/teranetics.c
index a13b48c..9d9397a 100644
--- a/drivers/net/phy/teranetics.c
+++ b/drivers/net/phy/teranetics.c
@@ -21,6 +21,7 @@
  *
  */
 #include 
+#include 
 #include 
 
 #ifndef CONFIG_PHYLIB_10G
@@ -43,6 +44,38 @@ int tn2020_config(struct phy_device *phydev)
 
 int tn2020_startup(struct phy_device *phydev)
 {
+   unsigned int timeout = 5 * 1000; /* 5 second timeout */
+
+#define MDIO_PHYXS_LANE_READY (MDIO_PHYXS_LNSTAT_SYNC0 | \
+  MDIO_PHYXS_LNSTAT_SYNC1 | \
+  MDIO_PHYXS_LNSTAT_SYNC2 | \
+  MDIO_PHYXS_LNSTAT_SYNC3 | \
+  MDIO_PHYXS_LNSTAT_ALIGN)
+
+   /*
+* Wait for the XAUI-SERDES lanes to align first.  Under normal
+* circumstances, this can take up to three seconds.
+*/
+   while (--timeout) {
+   int reg = phy_read(phydev, MDIO_MMD_PHYXS, MDIO_PHYXS_LNSTAT);
+   if (reg < 0) {
+   printf("TN2020: Error reading from PHY at "
+  "address %u\n", phydev->addr);
+   break;
+   }
+   if ((reg & MDIO_PHYXS_LANE_READY) == MDIO_PHYXS_LANE_READY)
+   break;
+   udelay(1000);
+   }
+   if (!timeout) {
+   /*
+* A timeout is bad, but it may not be fatal, so don't
+* return an error.  Display a warning instead.
+*/
+   printf("TN2020: Timeout waiting for PHY at address %u to "
+  "align.\n", phydev->addr);
+   }
+
if (phydev->port != PORT_FIBRE)
return gen10g_startup(phydev);
 
-- 
1.7.3.4


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


[U-Boot] [PATCH 3/3] [v2] powerpc/85xx: wait for alignment before resetting SERDES RX lanes (SERDES9)

2011-10-07 Thread Timur Tabi
The work-around for P4080 erratum SERDES9 says that the SERDES receiver lanes
should be reset after the XAUI starts tranmitting alignment signals.

Signed-off-by: Timur Tabi 
---
 arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c |   10 --
 board/freescale/corenet_ds/eth_p4080.c|   42 -
 drivers/net/phy/teranetics.h  |1 +
 3 files changed, 35 insertions(+), 18 deletions(-)
 create mode 100644 drivers/net/phy/teranetics.h

diff --git a/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c 
b/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c
index 07e58ed..89ed5b4 100644
--- a/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c
+++ b/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c
@@ -504,9 +504,6 @@ void fsl_serdes_init(void)
const char *srds_lpd_arg;
size_t arglen;
 #endif
-#ifdef CONFIG_SYS_P4080_ERRATUM_SERDES9
-   enum srds_prtcl device;
-#endif
 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES_A001
int need_serdes_a001;   /* TRUE == need work-around for SERDES A001 */
 #endif
@@ -787,11 +784,4 @@ void fsl_serdes_init(void)
 SRDS_RSTCTL_SDPD);
}
 #endif
-
-#ifdef CONFIG_SYS_P4080_ERRATUM_SERDES9
-   for (device = XAUI_FM1; device <= XAUI_FM2; device++) {
-   if (is_serdes_configured(device))
-   __serdes_reset_rx(srds_regs, cfg, device);
-   }
-#endif
 }
diff --git a/board/freescale/corenet_ds/eth_p4080.c 
b/board/freescale/corenet_ds/eth_p4080.c
index d4657f7..1c22a4d 100644
--- a/board/freescale/corenet_ds/eth_p4080.c
+++ b/board/freescale/corenet_ds/eth_p4080.c
@@ -42,6 +42,10 @@
 #include "../common/fman.h"
 #include 
 
+#if defined(CONFIG_SYS_P4080_ERRATUM_SERDES9) && defined(CONFIG_PHY_TERANETICS)
+#include "../../../drivers/net/phy/teranetics.h" /* for tn2020_driver.uid */
+#endif
+
 #define EMI_NONE   0x
 #define EMI_MASK   0xf000
 #define EMI1_RGMII 0x0
@@ -93,21 +97,43 @@ struct mii_dev *mii_dev_for_muxval(u32 muxval)
return bus;
 }
 
-#ifdef CONFIG_SYS_P4080_ERRATUM_SERDES9
+#if defined(CONFIG_SYS_P4080_ERRATUM_SERDES9) && defined(CONFIG_PHY_TERANETICS)
 int board_phy_config(struct phy_device *phydev)
 {
-   /*
-* If this is the 10G PHY, and we switched it to fiber,
-* we need to reset the serdes link for SERDES9
-*/
-   if ((phydev->port == PORT_FIBRE) && (phydev->drv->uid == 0x00a19410)) {
+   if (phydev->drv->uid == tn2020_driver.uid) {
+   unsigned long timeout = 1 * 1000; /* 1 seconds */
enum srds_prtcl device;
 
+   /*
+* Wait for the XAUI to come out of reset.  This is when it
+* starts transmitting alignment signals.
+*/
+   while (--timeout) {
+   int reg = phy_read(phydev, MDIO_MMD_PHYXS, MDIO_CTRL1);
+   if (reg < 0) {
+   printf("TN2020: Error reading from PHY at "
+  "address %u\n", phydev->addr);
+   break;
+   }
+   /*
+* Note that we've never actually seen
+* MDIO_CTRL1_RESET set to 1.
+*/
+   if ((reg & MDIO_CTRL1_RESET) == 0)
+   break;
+   udelay(1000);
+   }
+
+   if (!timeout) {
+   printf("TN2020: Timeout waiting for PHY at address %u "
+  " to reset.\n", phydev->addr);
+   }
+
switch (phydev->addr) {
-   case 4:
+   case CONFIG_SYS_FM1_10GEC1_PHY_ADDR:
device = XAUI_FM1;
break;
-   case 0:
+   case CONFIG_SYS_FM2_10GEC1_PHY_ADDR:
device = XAUI_FM2;
break;
default:
diff --git a/drivers/net/phy/teranetics.h b/drivers/net/phy/teranetics.h
new file mode 100644
index 000..1d983de
--- /dev/null
+++ b/drivers/net/phy/teranetics.h
@@ -0,0 +1 @@
+extern struct phy_driver tn2020_driver;
-- 
1.7.3.4


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


[U-Boot] (no subject)

2011-10-07 Thread Mr. Wen Lee



I am Mr. Wen Lee director of operations of the Bank Of Tiapei Tiawan. I
have an obscured business proposal for you. Reply if interested.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] (no subject)

2011-10-07 Thread Mr. Wen Lee



I am Mr. Wen Lee director of operations of the Bank Of Tiapei Tiawan. I
have an obscured business proposal for you. Reply if interested.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] hi

2011-10-07 Thread paulina kayumba
hello
 





















































my name is Paulina and i seek for true friendship and





















































partner so i contact you,pls if you dont mind i will like





















































you to reply my mail back so i can send you my picture





















































and tell you more about me,





















































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


Re: [U-Boot] [PATCH] arm: add ide initialization

2011-10-07 Thread Michael Walle
Am Freitag 07 Oktober 2011, 19:27:11 schrieb Mike Frysinger:
> On Thursday 06 October 2011 18:23:06 Michael Walle wrote:
> > --- a/arch/arm/lib/board.c
> > +++ b/arch/arm/lib/board.c
> > 
> > +#if defined(CONFIG_CMD_IDE)
> > +   puts ("IDE:   ");
> > +   ide_init ();
> > +#endif
> 
> NAK: no space before that open paren
> -mike

as long as the style is the only objection, i'm glad to resend a fixed patch 
:)

Albert, are there any other objections?

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


[U-Boot] [PATCH v2] netconsole: support packets longer than 512 bytes

2011-10-07 Thread Michael Walle
Esp. while printing the environment the output is usually longer than 512
bytes. Instead of cutting the message, send multiple 512 bytes packets.

Signed-off-by: Michael Walle 
---
 drivers/net/netconsole.c |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index e40efb8..56ba64f 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -189,10 +189,13 @@ static void nc_puts(const char *s)
return;
output_recursion = 1;
 
-   if ((len = strlen (s)) > 512)
-   len = 512;
-
-   nc_send_packet (s, len);
+   len = strlen(s);
+   while (len) {
+   int send_len = min(len, 512);
+   nc_send_packet(s, send_len);
+   len -= send_len;
+   s += send_len;
+   }
 
output_recursion = 0;
 }
-- 
1.7.2.5

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


[U-Boot] checkpatch compliance

2011-10-07 Thread Joe Hershberger
Hi Wolfgang,

I'm attempting to make the files I touched in several recent
patch-series chechkpatch.pl compliant.

I've hit several cases which fail and probably shouldn't.  For each of
these cases, should the warning / error just be ignored or reported to
checkpatch maintainers or altered some other way?

ERROR: Macros with multiple statements should be enclosed in a do - while loop
+#define CONFIG_SYS_I2C_NOPROBES{ {0, 0x51} } /* Don't probe
these addrs */
Used like this:
static struct
{
uchar   bus;
uchar   addr;
} i2c_no_probes[] = CONFIG_SYS_I2C_NOPROBES;


ERROR: need consistent spacing around '/' (ctx:WxV)
+#define CONFIG_ROOTPATH/nfs/root/path
Used like this:
#ifdef  CONFIG_ROOTPATH
"rootpath=" MK_STR(CONFIG_ROOTPATH) "\0"


ERROR: Macros with complex values should be enclosed in parenthesis
+#define CONFIG_ROOTPATH/nfs/root/path


ERROR: Macros with complex values should be enclosed in parenthesis
+#define CONFIG_UBOOTPATH   u-boot.bin


ERROR: Macros with complex values should be enclosed in parenthesis
#218: FILE: include/configs/MPC8313ERDB.h:274:
+#define CONFIG_SYS_NAND_BR_PRELIM  (CONFIG_SYS_NAND_BASE \
| (2

Re: [U-Boot] [PATCH v2] netconsole: support packets longer than 512 bytes

2011-10-07 Thread Mike Frysinger
On Friday 07 October 2011 18:27:50 Michael Walle wrote:
> Esp. while printing the environment the output is usually longer than 512
> bytes. Instead of cutting the message, send multiple 512 bytes packets.

sorry, i probably should have looked closer earlier.  this isn't really your 
fault, but i'm guessing this 512 limit is due to the size of the static 
input_buffer ?  if so, let's use sizeof(input_buffer) instead of 512.  or add a 
define at the top like NETCONSOLE_BUFFER_SIZE and use that everywhere.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] Move timestamp and version files into 'generated' subdir

2011-10-07 Thread Simon Glass
There is a rather subtle build problem where the build time stamp is not
updated for out-of-tree builds if there exists an in-tree build which
has a valid timestamp file. So if you do an in-tree build, then an
out-of-tree build your timestamp will not change.

The correct timestamp_autogenerated.h lives in the object tree, but it
is not always found there. The source still lives in the source tree and
when compiling version.h, it includes timestamp_autogenerated.h. Since
the current directory is always searched first, this will come from the
source tree rather than the object tree if it exists there. This affects
dependency generation also, which means that common/cmd_version.o will not
even be rebuilt if you have ever done an in-tree build.

A similar problem exists with the version file.

This change moves both files into the 'generated' subdir, which is already
used for asm-offsets.h. Then timestamp.h and version.h are updated to
include the files from there.

There are other places where these generated files are included, but I
cannot see why these don't just use the timestamp.h and version.h headers.
So this change also tidies that up.

I have tested this with in- and out-of-tree builds, but not SPL. I have
looked at various other options for fixing this, including sed on the dep
files, -I- and -include flags to gcc, but I don't think they can be made
to work. Comments welcome.

Signed-off-by: Simon Glass 
---
 Makefile  |5 +++--
 arch/arm/cpu/armv7/omap-common/spl.c  |3 +--
 arch/arm/cpu/armv7/omap-common/spl_mmc.c  |3 +--
 arch/arm/cpu/armv7/omap-common/spl_nand.c |3 +--
 drivers/serial/usbtty.h   |2 +-
 include/timestamp.h   |2 +-
 include/version.h |2 +-
 7 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/Makefile b/Makefile
index cd6fc8c..f69ea25 100644
--- a/Makefile
+++ b/Makefile
@@ -30,8 +30,8 @@ U_BOOT_VERSION = 
$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 else
 U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL)$(EXTRAVERSION)
 endif
-TIMESTAMP_FILE = $(obj)include/timestamp_autogenerated.h
-VERSION_FILE = $(obj)include/version_autogenerated.h
+TIMESTAMP_FILE = $(obj)include/generated/timestamp_autogenerated.h
+VERSION_FILE = $(obj)include/generated/version_autogenerated.h
 
 HOSTARCH := $(shell uname -m | \
sed -e s/i.86/x86/ \
@@ -456,6 +456,7 @@ $(obj)spl/u-boot-spl.bin:   depend
$(MAKE) -C spl all
 
 $(TIMESTAMP_FILE):
+   @mkdir -p $(dir $@)
@LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > $@
@LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@
 
diff --git a/arch/arm/cpu/armv7/omap-common/spl.c 
b/arch/arm/cpu/armv7/omap-common/spl.c
index c76fea6..01fd58a 100644
--- a/arch/arm/cpu/armv7/omap-common/spl.c
+++ b/arch/arm/cpu/armv7/omap-common/spl.c
@@ -29,8 +29,7 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/arch/arm/cpu/armv7/omap-common/spl_mmc.c 
b/arch/arm/cpu/armv7/omap-common/spl_mmc.c
index 1d1e50c..6f5b43e 100644
--- a/arch/arm/cpu/armv7/omap-common/spl_mmc.c
+++ b/arch/arm/cpu/armv7/omap-common/spl_mmc.c
@@ -28,8 +28,7 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/arch/arm/cpu/armv7/omap-common/spl_nand.c 
b/arch/arm/cpu/armv7/omap-common/spl_nand.c
index af02a59..38d06b1 100644
--- a/arch/arm/cpu/armv7/omap-common/spl_nand.c
+++ b/arch/arm/cpu/armv7/omap-common/spl_nand.c
@@ -25,8 +25,7 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
 
 
diff --git a/drivers/serial/usbtty.h b/drivers/serial/usbtty.h
index a23169a..14961c1 100644
--- a/drivers/serial/usbtty.h
+++ b/drivers/serial/usbtty.h
@@ -37,7 +37,7 @@
 #include 
 #endif
 
-#include 
+#include 
 
 /* If no VendorID/ProductID is defined in config.h, pretend to be Linux
  * DO NOT Reuse this Vendor/Product setup with protocol incompatible devices */
diff --git a/include/timestamp.h b/include/timestamp.h
index b2f4cf4..05a6658 100644
--- a/include/timestamp.h
+++ b/include/timestamp.h
@@ -24,7 +24,7 @@
 #define__TIMESTAMP_H__
 
 #ifndef DO_DEPS_ONLY
-#include "timestamp_autogenerated.h"
+#include "generated/timestamp_autogenerated.h"
 #endif
 
 #endif /* __TIMESTAMP_H__ */
diff --git a/include/version.h b/include/version.h
index 129acef..c908bd3 100644
--- a/include/version.h
+++ b/include/version.h
@@ -27,7 +27,7 @@
 #include 
 
 #ifndef DO_DEPS_ONLY
-#include "version_autogenerated.h"
+#include "generated/version_autogenerated.h"
 #endif
 
 #ifndef CONFIG_IDENT_STRING
-- 
1.7.3.1

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


Re: [U-Boot] [PATCH v2] netconsole: support packets longer than 512 bytes

2011-10-07 Thread Michael Walle
Am Samstag 08 Oktober 2011, 00:53:13 schrieb Mike Frysinger:
> On Friday 07 October 2011 18:27:50 Michael Walle wrote:
> > Esp. while printing the environment the output is usually longer than 512
> > bytes. Instead of cutting the message, send multiple 512 bytes packets.
> 
> sorry, i probably should have looked closer earlier.  this isn't really
> your fault, but i'm guessing this 512 limit is due to the size of the
> static input_buffer ?  if so, let's use sizeof(input_buffer) instead of
> 512.  or add a define at the top like NETCONSOLE_BUFFER_SIZE and use that
> everywhere. -mike

i don't think the input buffer has sth to do with the output. of course it 
could be intended, that the input buffer has the same size as the max output 
size. if i didn't miss sth, the output size is only limited by the maximum 
packet size (minus headers) defined by PKTSIZE.

I don't know why the input buffer and max output size has this particular 
size. Well, the input buffer could be some arbitrary number to. not too big to 
save some space :)

The max output size should be PKTSIZE-NetEthHdrSize()-IP_HDR_SIZE.

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


[U-Boot] [PATCH v5 0/20] New 'sandbox' test architecture for U-Boot

2011-10-07 Thread Simon Glass

This patch set points towards a possible way to improve the test
infrastructure in U-Boot. The goal is to have a test suite that can run in
a minute or two on a Linux PC and test all non-platform code.

This set aims to be just enough boot to U-Boot to a command prompt. You
can type help; anything else will probably segfault :-) Press Ctrl-C or
type 'reset' to exit.

This patch set does not include some other code I have been playing around
with, like a SPI flash driver and sandbox 'state' (so the state can be
examined and modified to test failure modes and the like).

$ ./u-boot

U-Boot 2011.09-rc1-00041-ge50de7d-dirty (Sep 17 2011 - 08:17:40)

DRAM:  128 MiB
Using default environment

In:serial
Out:   serial
Err:   serial

Detail
==
We can break the U-Boot code base into two parts:

1. Platform code, which is SOC-specifc. At present this is the CPU
init (arch/xxx/cpu/...) and SOC-specific drivers (mostly in the
drivers directory). There is also a small amount of generic CPU code
in arch/xxx/lib and some board-specific code/drivers (e.g. drivers not
within the SOC).

2. Portable/Generic U-Boot code, which is cross-platform. This
includes many drivers, the various commands, file system support,
things like the MMC, USB and network stacks, etc.

My focus in this patch set is the second part of the code base - all the
code which is not platform-specific, but can still have bugs.

Proposal

To a large extent, testing of this part of the code base could simply
be built on one or more of the available platforms. We could then run
the tests on that platform, and announce that the code base works fine
on that platform. Obviously the platform needs to support all possible
features of U-Boot.

However, this approach fails to take advantage of two useful
properties of this code:

- It is cross-platform, and even runs on x86
- It is standalone, requiring no OS libraries to run

For speed, debugging and convenience, it would be nice to run U-Boot
under a generic Linux environment on a workstation, and test all the
generic non-platform code. The basic problem with this is that the
non-platform code requires the platform code to operate. Even the x86
platform code is designed for standalone operation on a particular x86
board, and is not suitable for running under x86 Linux.

To get around this I propose that we create a new ‘sandbox’
architecture. We write code in ‘arch/sandbox’ which can run under
Linux. Since all the non-platform code will happily run under this new
‘architecture’, we can then write tests which run quickly under x86
Linux (or another Linux for that matter). This U-Boot 'architecture'
should build natively on any 32/64-bit Linux machine since it just
uses standard Linux system calls. Calls to Linux would be entirely
within this arch/sandbox subdirectory.

Benefit
===
What will this buy us? Well we can do things like:

- Create a test SPI flash device, which is file-backed. Use this to
write a test of the cmd_sf layer by issuing a series of commands and
making sure that the correct SPI flash contents is obtained

- Create a test MMC or IDE device, backed by a file. Use this to issue
ext2 and fat commands to manipulate the filesystem. Then loopback
mount the file and check from Linux that U-Boot did the right thing

- Create a test Ethernet device with a mocked remote host attached.
Use this to issue network commands like bootp and tftp and check that
the correct results are obtained.

Ultimately (one day) we might have a set of unit tests for U-Boot
which can run to very quickly check that a patch does not break the
core U-Boot code.

Building


make ARCH=sandbox sandbox_config
make ARCH=sandbox all

(The lds script is targeted for bfd and might not work with the gold linker)

Comments

Comments are welcome and I have cc'd those who showed an interest to my
initial email. My goal is to create a real patch set in the next few weeks.

Please excuse the checkpatch violations, many of which seem to be less than
useful. This code is a bit rough in places, but I want comments on it before
polishing. There are a few strange things needed in the build as well, which
I hope to improve.

Changes in v2:
- Rebase to master
- Tidy top-level Makefile to minimise changes
- Remove CONFIG_SYS_SDRAM_BASE which is always 0 for sandbox boards
- Fix #define
- Remove CONFIG_LMB
- Move os layer into arch/sandbox
- Remove clean and dist-clean targets from Makefile
- Try and fail to remove the global -I/usr/include
- Fix cast of int to pointer instead of just removing the code
- Move lds script out of the board directory
- Fix commit message typo, sadly
- Remove ARM cruft from Makefile
- Remove version_string and make display_banner() call display_options()
- Tidy up DRAM logic (but I think it is still needed to fit in with U-Boot)
- Remove use of CONFIG_SYS_NO_FLASH
- Make board_init_f() call board_init_r() for now
- Make board_init_r() call main_loop() for now
- Remove setting of LDSCRIPT

[U-Boot] [PATCH v5 03/20] sandbox: Add architecture image support

2011-10-07 Thread Simon Glass
We won't actually load an image with this architecture, but we still need to
define it.

Signed-off-by: Simon Glass 
---
Changes in v3:
- Add architecture image support for sandbox

Changes in v5:
- Define IH_ARCH_DEFAULT which is now required

 arch/sandbox/include/asm/u-boot.h |3 +++
 include/image.h   |1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/sandbox/include/asm/u-boot.h 
b/arch/sandbox/include/asm/u-boot.h
index 7d91847..166ef14 100644
--- a/arch/sandbox/include/asm/u-boot.h
+++ b/arch/sandbox/include/asm/u-boot.h
@@ -58,4 +58,7 @@ typedef struct bd_info {
} bi_dram[CONFIG_NR_DRAM_BANKS];
 } bd_t;
 
+/* For image.h:image_check_target_arch() */
+#define IH_ARCH_DEFAULT IH_ARCH_SANDBOX
+
 #endif /* _U_BOOT_H_ */
diff --git a/include/image.h b/include/image.h
index cca1cc5..b7caaa6 100644
--- a/include/image.h
+++ b/include/image.h
@@ -106,6 +106,7 @@
 #define IH_ARCH_BLACKFIN   16  /* Blackfin */
 #define IH_ARCH_AVR32  17  /* AVR32*/
 #define IH_ARCH_ST200  18  /* STMicroelectronics ST200  */
+#define IH_ARCH_SANDBOX19  /* Sandbox architecture (test 
only) */
 
 /*
  * Image Types
-- 
1.7.3.1

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


[U-Boot] [PATCH v5 09/20] sandbox: Add bootm support

2011-10-07 Thread Simon Glass
This adds sandbox architecture support to bootm, although it is probably
not useful to load sandbox code into the address space and execute it.

This change at least make the file build correctly on 64-bit machines.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Fix cast of int to pointer instead of just removing the code

 common/cmd_bootm.c |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index c2e8038..bb9b698 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -438,9 +438,8 @@ static int bootm_start_standalone(ulong iflag, int argc, 
char * const argv[])
setenv("filesize", buf);
return 0;
}
-   appl = (int (*)(int, char * const []))ntohl(images.ep);
+   appl = (int (*)(int, char * const []))(ulong)ntohl(images.ep);
(*appl)(argc-1, &argv[1]);
-
return 0;
 }
 
@@ -464,14 +463,14 @@ static cmd_tbl_t cmd_bootm_sub[] = {
 int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char * const 
argv[])
 {
int ret = 0;
-   int state;
+   long state;
cmd_tbl_t *c;
boot_os_fn *boot_fn;
 
c = find_cmd_tbl(argv[1], &cmd_bootm_sub[0], ARRAY_SIZE(cmd_bootm_sub));
 
if (c) {
-   state = (int)c->cmd;
+   state = (long)c->cmd;
 
/* treat start special since it resets the state machine */
if (state == BOOTM_STATE_START) {
-- 
1.7.3.1

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


[U-Boot] [PATCH v5 02/20] Fix use of int as pointer in image.c

2011-10-07 Thread Simon Glass
It is better to use %p in this case.

Signed-off-by: Simon Glass 
Acked-by: Mike Frysinger 
---
Changes in v2:
- Split this change out from 'Add architecture image support'

 common/image.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/image.c b/common/image.c
index d38ce4a..fc475cd 100644
--- a/common/image.c
+++ b/common/image.c
@@ -1581,7 +1581,7 @@ int boot_get_fdt (int flag, int argc, char * const 
argv[], bootm_headers_t *imag
goto error;
}
 
-   printf ("   Booting using the fdt blob at 0x%x\n", 
(int)fdt_blob);
+   printf("   Booting using the fdt blob at 0x%p\n", fdt_blob);
 
} else if (images->legacy_hdr_valid &&
image_check_type (&images->legacy_hdr_os_copy, 
IH_TYPE_MULTI)) {
@@ -1600,7 +1600,7 @@ int boot_get_fdt (int flag, int argc, char * const 
argv[], bootm_headers_t *imag
if (fdt_len) {
 
fdt_blob = (char *)fdt_data;
-   printf ("   Booting using the fdt at 0x%x\n", 
(int)fdt_blob);
+   printf("   Booting using the fdt at 0x%p\n", fdt_blob);
 
if (fdt_check_header (fdt_blob) != 0) {
fdt_error ("image is not a fdt");
-- 
1.7.3.1

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


[U-Boot] [PATCH v5 10/20] sandbox: Disable built-in malloc

2011-10-07 Thread Simon Glass
We prefer to U-Boot's malloc but for now it is easier to use the C library's
version.

Signed-off-by: Simon Glass 
---
 common/Makefile |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/common/Makefile b/common/Makefile
index 371a0d9..fee6de1 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -29,7 +29,9 @@ LIB   = $(obj)libcommon.o
 ifndef CONFIG_SPL_BUILD
 COBJS-y += main.o
 COBJS-y += command.o
+ifndef CONFIG_SANDBOX
 COBJS-y += dlmalloc.o
+endif
 COBJS-y += exports.o
 COBJS-$(CONFIG_SYS_HUSH_PARSER) += hush.o
 COBJS-y += image.o
-- 
1.7.3.1

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


[U-Boot] [PATCH v5 14/20] sandbox: Add main program

2011-10-07 Thread Simon Glass
Add a main program so that we can run U-Boot.

Signed-off-by: Simon Glass 
---
Changes in v4:
- Move main() into arch/sandbox/cpu/start.c

 arch/sandbox/cpu/Makefile |2 +-
 arch/sandbox/cpu/start.c  |   33 +
 2 files changed, 34 insertions(+), 1 deletions(-)
 create mode 100644 arch/sandbox/cpu/start.c

diff --git a/arch/sandbox/cpu/Makefile b/arch/sandbox/cpu/Makefile
index 1a0b260..e5e860b 100644
--- a/arch/sandbox/cpu/Makefile
+++ b/arch/sandbox/cpu/Makefile
@@ -30,7 +30,7 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(CPU).o
 
-COBJS  := cpu.o os.o
+COBJS  := cpu.o start.o os.o
 
 SRCS   := $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
new file mode 100644
index 000..685793e
--- /dev/null
+++ b/arch/sandbox/cpu/start.c
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * 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 
+
+int main(int argc, char *argv[])
+{
+   /*
+* Do pre- and post-relocation init, then start up U-Boot. This will
+* never return.
+*/
+   board_init_f(0);
+
+   return 0;
+}
-- 
1.7.3.1

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


[U-Boot] [PATCH v5 15/20] sandbox: Add serial uart

2011-10-07 Thread Simon Glass
This uart simply writes to stdout and reads from stdin. We might imagine
instead buffering the data so that a test interface can check output and
inject input.

Signed-off-by: Simon Glass 
---
Changes in v4:
- Remove serial_exit()

 drivers/serial/Makefile  |1 +
 drivers/serial/sandbox.c |   63 ++
 2 files changed, 64 insertions(+), 0 deletions(-)
 create mode 100644 drivers/serial/sandbox.c

diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 1dcc1c7..6309549 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -53,6 +53,7 @@ COBJS-$(CONFIG_SA1100_SERIAL) += serial_sa1100.o
 COBJS-$(CONFIG_S3C24X0_SERIAL) += serial_s3c24x0.o
 COBJS-$(CONFIG_S3C44B0_SERIAL) += serial_s3c44b0.o
 COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
+COBJS-$(CONFIG_SANDBOX_SERIAL) += sandbox.o
 COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
 COBJS-$(CONFIG_TEGRA2) += serial_tegra2.o
 
diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c
new file mode 100644
index 000..0d65587
--- /dev/null
+++ b/drivers/serial/sandbox.c
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * 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
+ */
+
+/*
+ * This provide a test serial port. It provides an emulated serial port where
+ * a test program and read out the serial output and inject serial input for
+ * U-Boot.
+ */
+
+#include 
+#include 
+
+int serial_init(void)
+{
+   return 0;
+}
+
+void serial_setbrg(void)
+{
+}
+
+void serial_putc(const char ch)
+{
+   os_write(1, &ch, 1);
+}
+
+void serial_puts(const char *str)
+{
+   while (*str)
+   serial_putc(*str++);
+}
+
+int serial_getc(void)
+{
+   char buf;
+   int count;
+
+   count = os_read(0, &buf, 1);
+   return count == 1 ? buf : 0;
+}
+
+int serial_tstc(void)
+{
+   return 0;
+}
-- 
1.7.3.1

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


[U-Boot] [PATCH v5 16/20] sandbox: Add basic config file

2011-10-07 Thread Simon Glass
This basic provides required features along with a basic command set.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Remove CONFIG_SYS_SDRAM_BASE which is always 0 for sandbox boards
- Fix #define
- Remove CONFIG_LMB

Changes in v4:
- Add CONFIG_SYS_SDRAM_SIZE for size of emulated SDRAM
- Add #ifdef protection around sandbox.h header file

 include/configs/sandbox.h |   85 +
 1 files changed, 85 insertions(+), 0 deletions(-)
 create mode 100644 include/configs/sandbox.h

diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
new file mode 100644
index 000..0230256
--- /dev/null
+++ b/include/configs/sandbox.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * 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
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#define CONFIG_NR_DRAM_BANKS   1
+#define CONFIG_DRAM_SIZE   (128 << 20)
+
+/* Number of bits in a C 'long' on this architecture */
+#define CONFIG_SANDBOX_BITS_PER_LONG   64
+
+/*
+ * Size of malloc() pool, although we don't actually use this yet.
+ */
+#define CONFIG_SYS_MALLOC_LEN  (4 << 20)   /* 4MB  */
+
+#define CONFIG_SYS_PROMPT  "=>"/* Command Prompt */
+#define CONFIG_SYS_HUSH_PARSER
+#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
+#define CONFIG_SYS_LONGHELP/* #undef to save memory */
+#define CONFIG_SYS_CBSIZE  1024/* Console I/O Buffer Size */
+
+/* Print Buffer Size */
+#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
+#define CONFIG_SYS_MAXARGS 16
+
+/* turn on command-line edit/c/auto */
+#define CONFIG_CMDLINE_EDITING
+#define CONFIG_COMMAND_HISTORY
+#define CONFIG_AUTOCOMPLETE
+
+#define CONFIG_ENV_SIZE8192
+#define CONFIG_ENV_IS_NOWHERE
+
+#define CONFIG_SYS_HZ  1000
+
+/* Memory things - we don't really want a memory test */
+#define CONFIG_SYS_LOAD_ADDR   0x1000
+#define CONFIG_SYS_MEMTEST_START   0x1000
+#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x1000)
+#define CONFIG_PHYS_64BIT
+
+/* Size of our emulated memory */
+#define CONFIG_SYS_SDRAM_SIZE  (128 << 20)
+
+#define CONFIG_BAUDRATE115200
+#define CONFIG_SYS_BAUDRATE_TABLE  {4800, 9600, 19200, 38400, 57600,\
+   115200}
+#define CONFIG_SANDBOX_SERIAL
+
+#define CONFIG_SYS_NO_FLASH
+
+/* include default commands */
+#include 
+
+/* We don't have networking support yet */
+#undef CONFIG_CMD_NET
+#undef CONFIG_CMD_NFS
+
+#define CONFIG_BOOTARGS ""
+
+#define CONFIG_EXTRA_ENV_SETTINGS  "stdin=serial\0" \
+   "stdout=serial\0" \
+   "stderr=serial\0"
+
+#endif
-- 
1.7.3.1

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


[U-Boot] [PATCH v5 01/20] sandbox: Add architecture header files

2011-10-07 Thread Simon Glass
This adds required header files for the sandbox architecture, and a basic
description of what sandbox is (README.sandbox).

This commit generates a list of 44 checkpatch warnings:

0 errors, 44 warnings for 0001-sandbox-Add-architecture-header-files.patch:
warning: arch/sandbox/include/asm/bitops.h,30: Use of volatile is usually 
wrong: see Documentation/volatile-considered-harmful.txt
warning: arch/sandbox/include/asm/bitops.h,32: Use of volatile is usually 
wrong: see Documentation/volatile-considered-harmful.txt
warning: arch/sandbox/include/asm/bitops.h,34: Use of volatile is usually 
wrong: see Documentation/volatile-considered-harmful.txt
warning: arch/sandbox/include/asm/bitops.h,36: Use of volatile is usually 
wrong: see Documentation/volatile-considered-harmful.txt
warning: arch/sandbox/include/asm/bitops.h,44: Use of volatile is usually 
wrong: see Documentation/volatile-considered-harmful.txt
warning: arch/sandbox/include/asm/bitops.h,54: Use of volatile is usually 
wrong: see Documentation/volatile-considered-harmful.txt
warning: arch/sandbox/include/asm/bitops.h,66: Use of volatile is usually 
wrong: see Documentation/volatile-considered-harmful.txt
warning: arch/sandbox/include/asm/bitops.h,76: Use of volatile is usually 
wrong: see Documentation/volatile-considered-harmful.txt
warning: arch/sandbox/include/asm/bitops.h,88: Use of volatile is usually 
wrong: see Documentation/volatile-considered-harmful.txt
warning: arch/sandbox/include/asm/bitops.h,90: Use of volatile is usually 
wrong: see Documentation/volatile-considered-harmful.txt

(These are the bitops and seem to have volatile in all the other archs also.)

warning: arch/sandbox/include/asm/global_data.h,38: do not add new typedefs

(This is the typedef for gd_t which I think is needed.)

warning: arch/sandbox/include/asm/global_data.h,64: storage class should be at 
the beginning of the declaration

(This line is:

which I need to keep, so that various files can declare that pointer.)

warning: arch/sandbox/include/asm/posix_types.h,22: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,23: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,24: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,25: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,26: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,27: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,28: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,29: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,30: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,32: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,33: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,34: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,36: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,37: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,38: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,40: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,41: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,42: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,43: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,44: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,45: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,46: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,47: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,48: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,50: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,51: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,54: do not add new typedefs

(These are things like:

typedef unsigned short  __kernel_dev_t;

and I believe they are needed.)

warning: arch/sandbox/include/asm/types.h,26: do not add new typedefs
warning: arch/sandbox/include/asm/types.h,66: do not add new typedefs
warning: arch/sandbox/include/asm/types.h,67: do not add new typedefs
warning: arch/sandbox/include/asm/types.h,68: do not add new typedefs
warning: arch/sandbox/include/asm/u-boot.h,39: do not add new typedefs

(These are similar, and common with other architectures, so I think they are 
needed.)

Signed-off-by: Simon Glass 
---
Changes in v2:
- Removed unneeded clock.h
- Moved gpio.h to asm-generic, removed GPIO_COUNT
- Removed kernel cruft from posix_types.h
- Removed dummy field from struct pt_regs
- Remove contents of string.h; instead include linux/string.h
- Remove unneeded functions in u-boot-sandbox.h
- Remove contents of unaligned.h; instead include asm-generic/unaligned.h

Changes in v4

  1   2   >