Re: [U-Boot] [PATCH 1/3] common/cmd_rsmode.c: add imx reset mode command

2012-05-27 Thread Dirk Behme

Hi Troy,

On 26.05.2012 23:01, Troy Kisky wrote:

This is useful for forcing the ROM's
usb downloader to activate upon a watchdog reset.
Or, you can boot from either SD Card.


Thanks!

Just for my understanding: Who will enable/run the watchdog reset? It 
was my understanding that after writing gpr9 and gpr10 someone has to 
enable the watchdog to execute the reset?


Best regards

Dirk

P.S.: I pushed this to my staging branch

https://github.com/dirkbehme/u-boot-imx6/commits/u-boot-imx-staging


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


Re: [U-Boot] [PATCH 0/4] ARM: OMAP4+: Miscellaneous fixes

2012-05-27 Thread R, Sricharan
 R Sricharan (4):
   ARM: OMAP4+: dmm: Take care of overlapping dmm and trap sections.
   ARM: OMAP5: dmm: Create a tiler trap section.
   ARM: OMAP5: Align memory used for testing to the power of 2
   ARM: OMAP5: Correct the DRAM_ADDR_SPACE_END macro.

  arch/arm/cpu/armv7/omap-common/emif-common.c   |    3 +++
  arch/arm/cpu/armv7/omap-common/hwinit-common.c |   20 ++--
  arch/arm/cpu/armv7/omap5/sdram.c               |    6 +++---
  arch/arm/include/asm/arch-omap5/omap.h         |    2 +-
  4 files changed, 25 insertions(+), 6 deletions(-)

 Applied to u-boot-ti/master, thanks.
 Thanks Tom !

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


[U-Boot] usb to ethernet adaptor support

2012-05-27 Thread 孟令锋
Hello, Anders
I'm trying use to support the ASIX  driver  for u-boot. And I find that you 
have met the same question. I was wondering if you could send me some example 
code on how to use the adaptor support?Can you please add a description to 
doc/README.usb and provide a patch for that? best regards, Xiatsinggood___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2012-05-27 Thread 刘力
How do i get these patches, please?
Thx.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] menu: Added support to use user defined functions

2012-05-27 Thread Pali Rohár
* In menu_interactive_choice can be used user specified function
  item_data_choice (instead hardcoded function which read input
  from standard input)

* Added option to specify user data for menu

* menu_display_statusline will pass pointer to user data
  (instead pointer to menu)

* This patch is needed for creating ANSI bootmenu

Signed-off-by: Pali Rohár pali.ro...@gmail.com
---
 board/ait/cam_enc_4xx/cam_enc_4xx.c |5 ++--
 common/cmd_pxe.c|3 ++-
 common/menu.c   |   43 +++
 include/menu.h  |6 +++--
 4 files changed, 37 insertions(+), 20 deletions(-)

diff --git a/board/ait/cam_enc_4xx/cam_enc_4xx.c 
b/board/ait/cam_enc_4xx/cam_enc_4xx.c
index 32b28f9..5078b01 100644
--- a/board/ait/cam_enc_4xx/cam_enc_4xx.c
+++ b/board/ait/cam_enc_4xx/cam_enc_4xx.c
@@ -561,7 +561,8 @@ static char *menu_handle(struct menu_display *display)
char *s;
char temp[6][200];
 
-   m = menu_create(display-title, display-timeout, 1, ait_menu_print);
+   m = menu_create(display-title, display-timeout, 1, ait_menu_print,
+   NULL, NULL);
 
for (i = 0; display-menulist[i]; i++) {
sprintf(key, %d, i + 1);
@@ -1097,7 +1098,7 @@ int menu_show(int bootdelay)
return MENU_EXIT;
 }
 
-void menu_display_statusline(struct menu *m)
+void menu_display_statusline(void *data)
 {
char *s1, *s2;
 
diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c
index b3c1f67..346e275 100644
--- a/common/cmd_pxe.c
+++ b/common/cmd_pxe.c
@@ -1198,7 +1198,8 @@ static struct menu *pxe_menu_to_menu(struct pxe_menu *cfg)
/*
 * Create a menu and add items for all the labels.
 */
-   m = menu_create(cfg-title, cfg-timeout, cfg-prompt, label_print);
+   m = menu_create(cfg-title, cfg-timeout, cfg-prompt, label_print,
+   NULL, NULL);
 
if (!m)
return NULL;
diff --git a/common/menu.c b/common/menu.c
index aa16c9a..470eb9f 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -47,6 +47,8 @@ struct menu {
char *title;
int prompt;
void (*item_data_print)(void *);
+   char *(*item_data_choice)(void *);
+   void *data;
struct list_head items;
 };
 
@@ -113,11 +115,11 @@ static inline void *menu_item_destroy(struct menu *m,
return NULL;
 }
 
-void __menu_display_statusline(struct menu *m)
+void __menu_display_statusline(void *menu_data)
 {
return;
 }
-void menu_display_statusline(struct menu *m)
+void menu_display_statusline(void *menu_data)
__attribute__ ((weak, alias(__menu_display_statusline)));
 
 /*
@@ -130,7 +132,7 @@ static inline void menu_display(struct menu *m)
puts(m-title);
putc('\n');
}
-   menu_display_statusline(m);
+   menu_display_statusline(m-data);
 
menu_items_iter(m, menu_item_print, NULL);
 }
@@ -230,20 +232,27 @@ static inline int menu_interactive_choice(struct menu *m, 
void **choice)
 
menu_display(m);
 
-   readret = readline_into_buffer(Enter choice: , cbuf,
-   m-timeout);
-
-   if (readret = 0) {
-   choice_item = menu_item_by_key(m, cbuf);
-
-   if (!choice_item) {
-   printf(%s not found\n, cbuf);
-   m-timeout = 0;
+   if (!m-item_data_choice) {
+   readret = readline_into_buffer(Enter choice: , cbuf,
+   m-timeout);
+
+   if (readret = 0) {
+   choice_item = menu_item_by_key(m, cbuf);
+   if (!choice_item)
+   printf(%s not found\n, cbuf);
+   } else {
+   puts(^C\n);
+   return -EINTR;
}
} else {
-   puts(^C\n);
-   return -EINTR;
+   char *key = m-item_data_choice(m-data);
+   if (!key)
+   return -EINTR;
+   choice_item = menu_item_by_key(m, key);
}
+
+   if (!choice_item)
+   m-timeout = 0;
}
 
*choice = choice_item-data;
@@ -380,7 +389,9 @@ int menu_item_add(struct menu *m, char *item_key, void 
*item_data)
  * insufficient memory available to create the menu.
  */
 struct menu *menu_create(char *title, int timeout, int prompt,
-   void (*item_data_print)(void *))
+   void (*item_data_print)(void *),
+   char *(*item_data_choice)(void *),
+   void *menu_data)
 {
struct menu *m;
 
@@ -393,6 +404,8 @@ struct 

[U-Boot] [PATCH 0/2] ANSI terminal Bootmenu

2012-05-27 Thread Pali Rohár
This patch series adds ANSI terminal Bootmenu command. It use generic menu
code for creating menu structures, but use own functions for drawing menu on
ANSI terminal. First patch modify generic menu code for using other functions
for printing and choosing menu entry, second patch is bootmenu command itself.

Pali Rohár (2):
  menu: Added support to use user defined functions
  New command bootmenu: ANSI terminal Boot Menu support

 board/ait/cam_enc_4xx/cam_enc_4xx.c |5 +-
 common/Makefile |1 +
 common/cmd_bootmenu.c   |  446 +++
 common/cmd_pxe.c|3 +-
 common/menu.c   |   43 ++--
 doc/README.bootmenu |   61 +
 include/common.h|   20 ++
 include/config_cmd_all.h|1 +
 include/menu.h  |6 +-
 9 files changed, 566 insertions(+), 20 deletions(-)
 create mode 100644 common/cmd_bootmenu.c
 create mode 100644 doc/README.bootmenu

-- 
1.7.9.5

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


[U-Boot] [PATCH 2/2] New command bootmenu: ANSI terminal Boot Menu support

2012-05-27 Thread Pali Rohár
Signed-off-by: Pali Rohár pali.ro...@gmail.com
---
 common/Makefile  |1 +
 common/cmd_bootmenu.c|  446 ++
 doc/README.bootmenu  |   61 +++
 include/common.h |   20 +++
 include/config_cmd_all.h |1 +
 5 files changed, 529 insertions(+)
 create mode 100644 common/cmd_bootmenu.c
 create mode 100644 doc/README.bootmenu

diff --git a/common/Makefile b/common/Makefile
index 6e23baa..b9d4a4a 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -69,6 +69,7 @@ COBJS-$(CONFIG_CMD_SOURCE) += cmd_source.o
 COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
 COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o
 COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
+COBJS-$(CONFIG_CMD_BOOTMENU) += cmd_bootmenu.o
 COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
 COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o
 COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o
diff --git a/common/cmd_bootmenu.c b/common/cmd_bootmenu.c
new file mode 100644
index 000..935b60a
--- /dev/null
+++ b/common/cmd_bootmenu.c
@@ -0,0 +1,446 @@
+/*
+ * (C) Copyright 2011-2012 Pali Rohár pali.ro...@gmail.com
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include common.h
+#include command.h
+#include menu.h
+#include hush.h
+#include watchdog.h
+#include malloc.h
+#include linux/string.h
+
+struct bootmenu_entry {
+   int num;/* unique number 0..99 */
+   char key[3];/* key idetifier of number */
+   char *title;/* title of entry */
+   char *command;  /* hush command of entry */
+   struct bootmenu_data *menu; /* this bootmenu */
+   struct bootmenu_entry *next;/* next menu entry (num+1) */
+};
+
+struct bootmenu_data {
+   int delay;  /* delay for autoboot */
+   int active; /* active menu entry */
+   int count;  /* total count of menu entries */
+   struct bootmenu_entry *first;   /* first menu entry */
+};
+
+static char *bootmenu_getoption(int n)
+{
+   char name[] = bootmenu_\0\0;
+
+   if (n  0 || n  99)
+   return NULL;
+
+   sprintf(name+9, %d, n);
+   return getenv(name);
+}
+
+static void bootmenu_print_entry(void *data)
+{
+   struct bootmenu_entry *entry = data;
+   int reverse = (entry-menu-active == entry-num);
+
+   printf(ANSI_CURSOR_POSITION, entry-num + 4, 1);
+
+   if (reverse)
+   puts(ANSI_COLOR_REVERSE);
+
+   puts( );
+   puts(entry-title);
+   puts(ANSI_CLEAR_LINE_TO_END);
+
+   if (reverse)
+   puts(ANSI_COLOR_RESET);
+}
+
+static char *bootmenu_choice_entry(void *data)
+{
+   struct bootmenu_data *menu = data;
+
+   int key = 0; /* 0 - NONE, 1 - UP, 2 - DOWN, 3 - SELECT */
+   int esc = 0;
+
+   while (1) {
+
+   if (menu-delay = 0) {
+
+   if (menu-delay  0) {
+   printf(ANSI_CURSOR_POSITION, menu-count+5, 1);
+   printf(  Hit any key to stop autoboot: %2d ,
+   menu-delay);
+   }
+
+   while (menu-delay  0) {
+
+   int i;
+   for (i = 0; i  100; ++i) {
+   if (tstc()) {
+   menu-delay = -1;
+   key = getc();
+
+   if (key == '\e') {
+   esc = 1;
+   key = 0;
+   } else if (key == '\r')
+   key = 3;
+   else
+   key = 0;
+
+   break;
+
+   }
+
+   WATCHDOG_RESET();
+   udelay(1);
+
+  

Re: [U-Boot] [PATCH 1/3] common/cmd_rsmode.c: add imx reset mode command

2012-05-27 Thread Eric Nelson

Hi Dirk,

On 05/26/2012 11:04 PM, Dirk Behme wrote:

Hi Troy,

On 26.05.2012 23:01, Troy Kisky wrote:

This is useful for forcing the ROM's
usb downloader to activate upon a watchdog reset.
Or, you can boot from either SD Card.


Thanks!

Just for my understanding: Who will enable/run the watchdog reset? It was my
understanding that after writing gpr9 and gpr10 someone has to enable the
watchdog to execute the reset?


Or just issue the 'reset' command, so we can prevent the need to
re-program the SPI ROM with the boot to SD shim with something like
this:

U-Boot set bootcmd 'rsmode esdhc3  reset'  saveenv

I discussed this with Troy yesterday and would like to get some feedback
from those most likely to use the features of this code.

Troy's implementation exposes the internals and all of the power
of the reset mode override feature. Through the 'rsmode' command,
you can set up what happens during the next watchdog reset and then do
something else.

For instance, you could say 'rsmode esdhc1', set up the watchdog and
then launch an O/S which should take over the watchdog. If something
fails, the ROM will attempt to boot to esdhc1, providing a fallback
mechanism of sorts.

While there may be some conditions under which this will be used,
a few dominant use cases and these could be made simpler to understand
and use.

1. Change 'rsmode' to 'rstmode'. I suspect that everyone will have
   an easier time understanding that the latter means 'reset mode'.

2. Implement 'download_mode' or 'downusb' as a short-hand for the
   sequence:

U-Boot rsmode usb  reset

   This sequence will be executed mostly by those on this list and
   the abbreviation is worth the small addition of code.

   I already have 'down' in muscle memory and using it will ease
   the pain for the (hopefully short) interval while I'm using
   both the Freescale 2009.08 code base and mainline.

3. Similarly, implement 'bootsd' or 'bootmmc' with a parameter that
   matches the SD card naming used by other U-Boot commands.

   How many of you know without grepping or pulling up a schematic
   which device corresponds to 'mmc 0'?

   It seems more intuitive to issue this command:

U-Boot bootmmc 0

   instead of this:

U-Boot rsmode esdhc3  reset

4. Same rationale for 'bootsata'.

5. Allow boards to say which devices are even exposed in their config
   headers. i.e.
#define BOARD_HAS_ESDHC3

...

#ifdef BOARD_HAS_ESDHC3
{esdhc1,mkval(0x40, 0x20, 0x00, 0x12)},
#endif

   This will allow a form of self-documentation when running 'rsmode'
   with no parameters.

   I doubt any board supports all of the boot options.

Let us know your thoughts on this and thanks for the code Troy!

Regards,


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


Re: [U-Boot] [PATCH 1/3] common/cmd_rsmode.c: add imx reset mode command

2012-05-27 Thread Eric Nelson

Hi Troy,

Nitpicks below.

On 05/26/2012 02:01 PM, Troy Kisky wrote:

This is useful for forcing the ROM's
usb downloader to activate upon a watchdog reset.
Or, you can boot from either SD Card.

Currently, support added for MX53 and MX6Q
Signed-off-by: Troy Kiskytroy.ki...@boundarydevices.com

Note: MX53 support untested.
---
  arch/arm/include/asm/arch-mx5/imx-regs.h |   18 +
  arch/arm/include/asm/arch-mx6/imx-regs.h |   21 +
  common/Makefile  |1 +
  common/cmd_rsmode.c  |  118 ++
  4 files changed, 158 insertions(+), 0 deletions(-)
  create mode 100644 common/cmd_rsmode.c



 snip


diff --git a/common/Makefile b/common/Makefile
index d9f10f3..8e17cec 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -139,6 +139,7 @@ COBJS-$(CONFIG_CMD_PORTIO) += cmd_portio.o
  COBJS-$(CONFIG_CMD_PXE) += cmd_pxe.o
  COBJS-$(CONFIG_CMD_REGINFO) += cmd_reginfo.o
  COBJS-$(CONFIG_CMD_REISER) += cmd_reiser.o
+COBJS-$(CONFIG_CMD_RSMODE) += cmd_rsmode.o
  COBJS-$(CONFIG_CMD_SATA) += cmd_sata.o
  COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
  COBJS-$(CONFIG_CMD_SCSI) += cmd_scsi.o


Since this code is very machine-specific, should this code
go into the board/freescale/common/ or
arch/arm/cpu/armv7/imx-common/ directory?


diff --git a/common/cmd_rsmode.c b/common/cmd_rsmode.c
new file mode 100644


 snip


+int do_rsmode(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+   int i;
+   if (argc  2) {
+options:
+   printf(Options:\n);
+   for (i = 0; i  ARRAY_SIZE(modes); i++)
+   printf(%s\n, modes[i].name);


A leading tab here will make the output easier to parse:

U-Boot rsmode
Options:
usb
sata

U-Boot rsmode
Options:
usb
sata
ecspi.0
...


+   return 0;
+   }
+   for (i = 0; i  ARRAY_SIZE(modes); i++) {
+   if (!strcmp(modes[i].name, argv[1]))
+   break;
+   }

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


Re: [U-Boot] [PATCH] Kirkwood: declare mpp config static and const

2012-05-27 Thread Luka Perkov
Hi Michael,

On Sat, May 26, 2012 at 02:27:01AM +0200, Michael Walle wrote:
 Change the prototype of kirkwood_mpp_conf() from
   void kirkwood_mpp_conf(u32 *mpp_list)
 to
   void kirkwood_mpp_conf(const u32 *mpp_list)
 
 Now we can declare the kwmpp_config static and const where possible.
 
 Signed-off-by: Michael Walle mich...@walle.cc
 Cc: Prafulla Wadaskar prafu...@marvell.com
 Cc: Simon Guinot simon.gui...@sequanux.org
 Cc: Jason Cooper u-b...@lakedaemon.net
 Cc: Siddarth Gore go...@marvell.com
 Cc: Eric Cooper e...@cmu.edu
 Cc: Stefan Herbrechtsmeier ste...@code.herbrechtsmeier.net
 Cc: Valentin Longchamp valentin.longch...@keymile.com
 ---
 
 This was spotted by Mike in an earlier patch series (Kirkwood: add lschlv2
 and lsxhl board support). Declaring the mpp_config static avoids generating
 the array on the stack.
 This was compile tested on all kirkwood boards and tested on the lschlv2.
 
 
  arch/arm/cpu/arm926ejs/kirkwood/mpp.c   |2 +-
  arch/arm/include/asm/arch-kirkwood/mpp.h|2 +-
  board/LaCie/net2big_v2/net2big_v2.c |2 +-
  board/LaCie/netspace_v2/netspace_v2.c   |2 +-
  board/Marvell/dreamplug/dreamplug.c |2 +-
  board/Marvell/guruplug/guruplug.c   |2 +-
  board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c |2 +-
  board/Marvell/openrd/openrd.c   |2 +-
  board/Marvell/rd6281a/rd6281a.c |2 +-
  board/Marvell/sheevaplug/sheevaplug.c   |2 +-
  board/Seagate/dockstar/dockstar.c   |2 +-
  board/buffalo/lsxl/lsxl.c   |2 +-
  board/d-link/dns325/dns325.c|2 +-
  board/keymile/km_arm/km_arm.c   |2 +-
  14 files changed, 14 insertions(+), 14 deletions(-)

NACK. At least in this version. Please double check all the kirkwood
boards (taken from boards.cfg):

pogo_e02 arm arm926ejs   -   
cloudengines   kirkwood
dns325   arm arm926ejs   -   d-link 
kirkwood
km_kirkwood  arm arm926ejs   km_arm  
keymilekirkwoodkm_kirkwood:KM_DISABLE_PCI
km_kirkwood_pci  arm arm926ejs   km_arm  
keymilekirkwoodkm_kirkwood:KM_RECONFIG_XLX
mgcoge3unarm arm926ejs   km_arm  
keymilekirkwood
portl2   arm arm926ejs   km_arm  
keymilekirkwood
inetspace_v2 arm arm926ejs   netspace_v2 LaCie  
kirkwoodlacie_kw:INETSPACE_V2
net2big_v2   arm arm926ejs   net2big_v2  LaCie  
kirkwoodlacie_kw:NET2BIG_V2
netspace_max_v2  arm arm926ejs   netspace_v2 LaCie  
kirkwoodlacie_kw:NETSPACE_MAX_V2
netspace_v2  arm arm926ejs   netspace_v2 LaCie  
kirkwoodlacie_kw:NETSPACE_V2
dreamplugarm arm926ejs   -   
Marvellkirkwood
guruplug arm arm926ejs   -   
Marvellkirkwood
mv88f6281gtw_ge  arm arm926ejs   -   
Marvellkirkwood
openrd_base  arm arm926ejs   openrd  
Marvellkirkwoodopenrd:BOARD_IS_OPENRD_BASE
openrd_clientarm arm926ejs   openrd  
Marvellkirkwoodopenrd:BOARD_IS_OPENRD_CLIENT
openrd_ultimate  arm arm926ejs   openrd  
Marvellkirkwoodopenrd:BOARD_IS_OPENRD_ULTIMATE
rd6281a  arm arm926ejs   -   
Marvellkirkwood
sheevaplug   arm arm926ejs   -   
Marvellkirkwood
ib62x0   arm arm926ejs   ib62x0  
raidsonic  kirkwood
dockstar arm arm926ejs   -   
Seagatekirkwood

I have noticed that board ib62x0 is not in this patch. I have tested
this patch with my ib62x0 board and it works. This is the patch I have
added:

diff --git a/board/raidsonic/ib62x0/ib62x0.c b/board/raidsonic/ib62x0/ib62x0.c
index 65f2c2e..f888901 100644
--- a/board/raidsonic/ib62x0/ib62x0.c
+++ b/board/raidsonic/ib62x0/ib62x0.c
@@ -42,7 +42,7 @@ int board_early_init_f(void)
IB62x0_OE_LOW, IB62x0_OE_HIGH);
 
/* Multi-Purpose Pins Functionality configuration */
-   u32 kwmpp_config[] = {
+   static const kwmpp_config[] = {
MPP0_NF_IO2,
MPP1_NF_IO3,
MPP2_NF_IO4,

Also you should note that this patch should be applied after your
patches for lsxl board.

Regards,
Luka
___
U-Boot mailing list

[U-Boot] [PATCH v3] [resend] kwboot: boot kirkwood SoCs over a serial link

2012-05-27 Thread Luka Perkov
The kwboot program boots boards based on Marvell's Kirkwood platform
via Xmodem over their integrated UART.

Signed-off-by: Daniel Stodden daniel.stod...@googlemail.com
Acked-by: Luka Perkov ub...@lukaperkov.net
Tested-By: Holger Brunck holger.bru...@keymile.com
Tested-By: David Purdy david.c.pu...@gmail.com
Tested-by: Simon Guinot simon.gui...@sequanux.org
---

Changes from version 2:

 * fix timeouts in kwboot_tty_recv
 * revert indentation on manpage
 * on manpage note that TTY isn't optional
 * add David and Luka into the manpage

Changes from version v1:
 * fix man page
 * minor cosmetic fixes in tools/kwboot.c

I'm resending this patch because original version 3 was not following
patch submission guidlines.

 doc/kwboot.1   |   84 +++
 tools/Makefile |6 +
 tools/kwboot.c |  742 
 3 files changed, 832 insertions(+)

diff --git a/doc/kwboot.1 b/doc/kwboot.1
new file mode 100644
index 000..ed08398
--- /dev/null
+++ b/doc/kwboot.1
@@ -0,0 +1,84 @@
+.TH KWBOOT 1 2012-05-19
+
+.SH NAME
+kwboot \- Boot Marvell Kirkwood SoCs over a serial link.
+.SH SYNOPSIS
+.B kwboot
+.RB [ -b \fIimage\fP ]
+.RB [ -p ]
+.RB [ -t ]
+.RB [ -B \fIbaudrate\fP ]
+.RB \fITTY\fP
+.SH DESCRIPTION
+
+The \fBmkimage\fP program boots boards based on Marvell's Kirkwood
+platform over their integrated UART. Boot image files will typically
+contain a second stage boot loader, such as U-Boot. The image file
+must conform to Marvell's BootROM firmware image format
+(\fIkwbimage\fP), created using a tool such as \fBmkimage\fP.
+
+Following power-up or a system reset, system BootROM code polls the
+UART for a brief period of time, sensing a handshake message which
+initiates an image upload. This program sends this boot message until
+it receives a positive acknowledgement. The image is transfered using
+Xmodem.
+
+Additionally, this program implements a minimal terminal mode, which
+can be used either standalone, or entered immediately following boot
+image transfer completion. This is often useful to catch early boot
+messages, or to manually interrupt a default boot procedure performed
+by the second-stage loader.
+
+.SH OPTIONS
+
+.TP
+.BI \-b \fIimage\fP
+Handshake; then upload file \fIimage\fP over \fITTY\fP.
+
+Note that for the encapsulated boot code to be executed, \fIimage\fP
+must be of type UART boot (0x69). Boot images of different types,
+such as backup images of vendor firmware downloaded from flash memory
+(type 0x8B), will not work (or not as expected). See \fB-p\fP for a
+workaround.
+
+This mode writes handshake status and upload progress indication to
+stdout.
+
+.TP
+.BI \-p
+In combination with \fB-b\fP, patches the header in \fIimage\fP prior
+to upload, to UART boot type.
+
+This option attempts on-the-fly conversion of some none-UART image
+types, such as images which were originally formatted to be stored in
+flash memory.
+
+Conversion is performed in memory. The contents of \fIimage\fP will
+not be altered.
+
+.TP
+.BI \-t
+Run a terminal program, connecting standard input and output to
+.RB \fITTY\fP.
+
+If used in combination with \fB-b\fP, terminal mode is entered
+immediately following a successful image upload.
+
+If standard I/O streams connect to a console, this mode will terminate
+after receiving 'ctrl-\\' followed by 'c' from console input.
+
+.TP
+.BI \-B \fIbaudrate\fP
+Adjust the baud rate on \fITTY\fP. Default rate is 115200.
+
+.SH SEE ALSO
+.PP
+\fBmkimage\fP(1)
+
+.SH AUTHORS
+
+Daniel Stodden daniel.stod...@gmail.com
+.br
+Luka Perkov ub...@lukaperkov.net
+.br
+David Purdy david.c.pu...@gmail.com
diff --git a/tools/Makefile b/tools/Makefile
index 8993fdd..8097d95 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -72,6 +72,7 @@ BIN_FILES-$(CONFIG_SMDK5250) += mksmdk5250spl$(SFX)
 BIN_FILES-$(CONFIG_MX28) += mxsboot$(SFX)
 BIN_FILES-$(CONFIG_NETCONSOLE) += ncb$(SFX)
 BIN_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX)
+BIN_FILES-$(CONFIG_KIRKWOOD) += kwboot$(SFX)
 
 # Source files which exist outside the tools directory
 EXT_OBJ_FILES-$(CONFIG_BUILD_ENVCRC) += common/env_embedded.o
@@ -101,6 +102,7 @@ OBJ_FILES-$(CONFIG_NETCONSOLE) += ncb.o
 NOPED_OBJ_FILES-y += os_support.o
 OBJ_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1.o
 NOPED_OBJ_FILES-y += ublimage.o
+OBJ_FILES-$(CONFIG_KIRKWOOD) += kwboot.o
 
 # Don't build by default
 #ifeq ($(ARCH),ppc)
@@ -234,6 +236,10 @@ $(obj)ncb$(SFX):   $(obj)ncb.o
 $(obj)ubsha1$(SFX):$(obj)os_support.o $(obj)sha1.o $(obj)ubsha1.o
$(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
 
+$(obj)kwboot$(SFX): $(obj)kwboot.o
+   $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
+   $(HOSTSTRIP) $@
+
 # Some of the tool objects need to be accessed from outside the tools directory
 $(obj)%.o: $(SRCTREE)/common/%.c
$(HOSTCC) -g $(HOSTCFLAGS_NOPED) -c -o $@ $
diff --git a/tools/kwboot.c b/tools/kwboot.c
new file mode 100644
index 000..e773f01
--- /dev/null
+++ b/tools/kwboot.c

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

2012-05-27 Thread Nobuhiro Iwamatsu
Dear Wolfgang Denk.

Please pull from git://git.denx.de/u-boot-sh master.

Best regards,
  Nobuhiro

The following changes since commit 4398d55991eb3c2484a2a8e991d701e5d7a64874:

  net: sh-eth: Add support Gigabit of SH7734 (2012-05-23 17:53:09 -0500)

are available in the git repository at:

  git://git.denx.de/u-boot-sh.git master

for you to fetch changes up to 99fc4fd168f2eff3237f05c6ec4e2bbffe9c06e5:

  sh/ap_sh4a_4a: Fix typo of operator in ET0_ETXD4 (2012-05-28 09:12:54 +0900)


Nobuhiro Iwamatsu (8):
  sh: Add support Renesas SH7734
  sh: Add support for r0p7734 board
  sh: Add bit control functions
  sh: r0p7734: Add support I2C controller
  sh: Add register definition of PFC for SH7734
  sh: Add support for AP-SH4A-4A board
  sh: Set CONFIG_SH_ETHER_PHY_MODE and CONFIG_SH_ETHER_SH7734_MII
to boards with sh_eth
  sh/ap_sh4a_4a: Fix typo of operator in ET0_ETXD4

Phil Edworthy (1):
  sh: Add SH7269 device and RSK2+SH7269 board

 MAINTAINERS   |2 +
 arch/sh/include/asm/cpu_sh2.h |2 +
 arch/sh/include/asm/cpu_sh4.h |2 +
 arch/sh/include/asm/cpu_sh7269.h  |   26 +++
 arch/sh/include/asm/cpu_sh7734.h  |   70 ++
 arch/sh/include/asm/io.h  |   43 ++-
 board/alphaproject/ap_sh4a_4a/Makefile|   40 ++
 board/alphaproject/ap_sh4a_4a/ap_sh4a_4a.c|  195
+
 board/alphaproject/ap_sh4a_4a/lowlevel_init.S |  459
+++
 board/renesas/r0p7734/Makefile|   40 ++
 board/renesas/r0p7734/lowlevel_init.S |  606

 board/renesas/r0p7734/r0p7734.c   |   96 
 board/renesas/rsk7269/Makefile|   27 +++
 board/renesas/rsk7269/lowlevel_init.S |  182
++
 board/renesas/rsk7269/rsk7269.c   |   73 +++
 boards.cfg|3 +
 drivers/serial/serial_sh.c|4 +
 drivers/serial/serial_sh.h|   20 +
 include/configs/ap_sh4a_4a.h  |  176

 include/configs/ecovec.h  |1 +
 include/configs/espt.h|1 +
 include/configs/r0p7734.h |  186
+++
 include/configs/rsk7269.h |   76 +++
 include/configs/sh7757lcr.h   |1 +
 include/configs/sh7763rdp.h   |1 +
 25 files changed, 2329 insertions(+), 3 deletions(-)
 create mode 100644 arch/sh/include/asm/cpu_sh7269.h
 create mode 100644 arch/sh/include/asm/cpu_sh7734.h
 create mode 100644 board/alphaproject/ap_sh4a_4a/Makefile
 create mode 100644 board/alphaproject/ap_sh4a_4a/ap_sh4a_4a.c
 create mode 100644 board/alphaproject/ap_sh4a_4a/lowlevel_init.S
 create mode 100644 board/renesas/r0p7734/Makefile
 create mode 100644 board/renesas/r0p7734/lowlevel_init.S
 create mode 100644 board/renesas/r0p7734/r0p7734.c
 create mode 100644 board/renesas/rsk7269/Makefile
 create mode 100644 board/renesas/rsk7269/lowlevel_init.S
 create mode 100644 board/renesas/rsk7269/rsk7269.c
 create mode 100644 include/configs/ap_sh4a_4a.h
 create mode 100644 include/configs/r0p7734.h
 create mode 100644 include/configs/rsk7269.h


-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] MMC: MSHCI: Add MSHCI driver

2012-05-27 Thread Rajeshwari Birje
Hi All,

This patch is based on:  EXYNOS5: PINMUX: Added default pinumx settings.

Regards,
Rajeshwari Shinde.

On Fri, May 25, 2012 at 5:21 PM, Rajeshwari Shinde
rajeshwar...@samsung.com wrote:
 Add MSHCI driver support and resgister description for same.

 Signed-off-by: Alim Akhtar alim.akh...@samsung.com
 Signed-off-by: Terry Lambert tlamb...@chromium.org
 Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
 ---
  arch/arm/include/asm/arch-exynos/mshc.h |  174 ++
  drivers/mmc/Makefile                    |    1 +
  drivers/mmc/exynos_mshc.c               |  553 
 +++
  3 files changed, 728 insertions(+), 0 deletions(-)
  create mode 100644 arch/arm/include/asm/arch-exynos/mshc.h
  create mode 100644 drivers/mmc/exynos_mshc.c

 diff --git a/arch/arm/include/asm/arch-exynos/mshc.h 
 b/arch/arm/include/asm/arch-exynos/mshc.h
 new file mode 100644
 index 000..7226619
 --- /dev/null
 +++ b/arch/arm/include/asm/arch-exynos/mshc.h
 @@ -0,0 +1,174 @@
 +/*
 + * (C) Copyright 2012 SAMSUNG Electronics
 + * Abhilash Kesavan a.kesa...@samsung.com
 + *
 + * 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_ARCH_COMMON_MSHC_H
 +#define __ASM_ARCH_COMMON_MSHC_H
 +
 +#include asm/arch/pinmux.h
 +#ifndef __ASSEMBLY__
 +struct mshci_host {
 +       struct exynos_mshci     *reg;           /* Mapped address */
 +       unsigned int            clock;          /* Current clock in MHz */
 +       enum periph_id  peripheral;
 +};
 +
 +struct exynos_mshci {
 +       unsigned int    ctrl;
 +       unsigned int    pwren;
 +       unsigned int    clkdiv;
 +       unsigned int    clksrc;
 +       unsigned int    clkena;
 +       unsigned int    tmout;
 +       unsigned int    ctype;
 +       unsigned int    blksiz;
 +       unsigned int    bytcnt;
 +       unsigned int    intmask;
 +       unsigned int    cmdarg;
 +       unsigned int    cmd;
 +       unsigned int    resp0;
 +       unsigned int    resp1;
 +       unsigned int    resp2;
 +       unsigned int    resp3;
 +       unsigned int    mintsts;
 +       unsigned int    rintsts;
 +       unsigned int    status;
 +       unsigned int    fifoth;
 +       unsigned int    cdetect;
 +       unsigned int    wrtprt;
 +       unsigned int    gpio;
 +       unsigned int    tcbcnt;
 +       unsigned int    tbbcnt;
 +       unsigned int    debnce;
 +       unsigned int    usrid;
 +       unsigned int    verid;
 +       unsigned int    hcon;
 +       unsigned int    uhs_reg;
 +       unsigned int    rst_n;
 +       unsigned char   reserved1[4];
 +       unsigned int    bmod;
 +       unsigned int    pldmnd;
 +       unsigned int    dbaddr;
 +       unsigned int    idsts;
 +       unsigned int    idinten;
 +       unsigned int    dscaddr;
 +       unsigned int    bufaddr;
 +       unsigned int    clksel;
 +       unsigned char   reserved2[460];
 +       unsigned int    cardthrctl;
 +};
 +
 +/*
 + * Struct idma
 + * Holds the descriptor list
 + */
 +struct mshci_idmac {
 +       u32     des0;
 +       u32     des1;
 +       u32     des2;
 +       u32     des3;
 +};
 +
 +/*  Control Register  Register */
 +#define CTRL_RESET     (0x1  0)
 +#define FIFO_RESET     (0x1  1)
 +#define DMA_RESET      (0x1  2)
 +#define DMA_ENABLE     (0x1  5)
 +#define SEND_AS_CCSD   (0x1  10)
 +#define ENABLE_IDMAC    (0x1  25)
 +
 +/*  Power Enable Register */
 +#define POWER_ENABLE   (0x1  0)
 +
 +/*  Clock Enable Register */
 +#define CLK_ENABLE     (0x1  0)
 +#define CLK_DISABLE    (0x0  0)
 +
 +/* Timeout Register */
 +#define TMOUT_MAX      0x
 +
 +/*  Card Type Register */
 +#define PORT0_CARD_WIDTH1      0
 +#define PORT0_CARD_WIDTH4      (0x1  0)
 +#define PORT0_CARD_WIDTH8      (0x1  16)
 +
 +/*  Interrupt Mask Register */
 +#define INTMSK_ALL     0x
 +#define INTMSK_RE      (0x1  1)
 +#define INTMSK_CDONE   (0x1  2)
 +#define INTMSK_DTO     (0x1  3)
 +#define INTMSK_DCRC    (0x1  7)
 +#define INTMSK_RTO     (0x1  8)
 +#define INTMSK_DRTO    (0x1  9)
 +#define INTMSK_HTO     (0x1  10)
 +#define INTMSK_FRUN    (0x1  11)
 +#define INTMSK_HLE     (0x1  12)
 +#define INTMSK_SBE     (0x1  13)
 +#define INTMSK_ACD     (0x1  14)
 +#define INTMSK_EBE     (0x1  15)
 +
 +/* Command Register */
 +#define CMD_RESP_EXP_BIT       (0x1  6)
 +#define