Re: [U-Boot] [PATCH 9/9] mx6qsabrelite: Add splaschscreen support

2012-06-03 Thread Fabio Estevam
On Sat, Jun 2, 2012 at 9:12 PM, Troy Kisky
 wrote:

> If 0x1f is the Hannstar LVDS address, then you definitely should NOT use
> 0x1f for the
>
> CONFIG_SYS_I2C_SLAVE value.
>
>
> CONFIG_SYS_I2C_SLAVE is meant to define which address the processor will
> respond to
> in a multi-master bus environment. However, as mxc_i2c does not support
> slave mode
> the entire discussion is moot.

Thanks for the clarification, Troy.

So it means I can safely drop the CONFIG_SYS_I2C_SLAVE definition in
the board config file.

According to include/i2c.h:

"/*
 * Many boards/controllers/drivers don't support an I2C slave interface so
 * provide a default slave address for them for use in common code.  A real
 * value for CONFIG_SYS_I2C_SLAVE should be defined for any board which does
 * support a slave interface.
 */
#ifndef CONFIG_SYS_I2C_SLAVE
#define CONFIG_SYS_I2C_SLAVE0xfe
#endif
"

Will submit a patch removing CONFIG_SYS_I2C_SLAVE from imx boards.

Thanks,

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


[U-Boot] [PATCH 1/6] imx31_phycore: Remove CONFIG_SYS_I2C_SLAVE definition

2012-06-03 Thread Fabio Estevam
From: Fabio Estevam 

According to include/i2c.h:

"/*
 * Many boards/controllers/drivers don't support an I2C slave interface so
 * provide a default slave address for them for use in common code.  A real
 * value for CONFIG_SYS_I2C_SLAVE should be defined for any board which does
 * support a slave interface.
 */
#ifndef CONFIG_SYS_I2C_SLAVE
#define CONFIG_SYS_I2C_SLAVE0xfe
#endif
"

As the mxc_i2c driver does not support slave mode, there is no need
to define CONFIG_SYS_I2C_SLAVE in i.MX board file.

Signed-off-by: Fabio Estevam 
---
 include/configs/imx31_phycore.h |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/include/configs/imx31_phycore.h b/include/configs/imx31_phycore.h
index 3153eb5..b3244b9 100644
--- a/include/configs/imx31_phycore.h
+++ b/include/configs/imx31_phycore.h
@@ -56,7 +56,6 @@
 #define CONFIG_I2C_MXC
 #define CONFIG_SYS_I2C_MX31_PORT2
 #define CONFIG_SYS_I2C_SPEED   10
-#define CONFIG_SYS_I2C_SLAVE   0xfe
 
 #define CONFIG_MXC_UART
 #define CONFIG_MXC_UART_BASE   UART1_BASE
-- 
1.7.1

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


[U-Boot] [PATCH 2/6] mx35pdk: Remove CONFIG_SYS_I2C_SLAVE definition

2012-06-03 Thread Fabio Estevam
From: Fabio Estevam 

According to include/i2c.h:

"/*
 * Many boards/controllers/drivers don't support an I2C slave interface so
 * provide a default slave address for them for use in common code.  A real
 * value for CONFIG_SYS_I2C_SLAVE should be defined for any board which does
 * support a slave interface.
 */
#ifndef CONFIG_SYS_I2C_SLAVE
#define CONFIG_SYS_I2C_SLAVE0xfe
#endif
"

As the mxc_i2c driver does not support slave mode, there is no need
to define CONFIG_SYS_I2C_SLAVE in i.MX board file.

Signed-off-by: Fabio Estevam 
---
 include/configs/mx35pdk.h |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/include/configs/mx35pdk.h b/include/configs/mx35pdk.h
index bd57baa..5f75018 100644
--- a/include/configs/mx35pdk.h
+++ b/include/configs/mx35pdk.h
@@ -59,7 +59,6 @@
 #define CONFIG_I2C_MXC
 #define CONFIG_SYS_I2C_MX35_PORT1
 #define CONFIG_SYS_I2C_SPEED   10
-#define CONFIG_SYS_I2C_SLAVE   0xfe
 #define CONFIG_MXC_SPI
 #define CONFIG_MXC_GPIO
 
-- 
1.7.1

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


[U-Boot] [PATCH 3/6] mx53ard: Remove CONFIG_SYS_I2C_SLAVE definition

2012-06-03 Thread Fabio Estevam
According to include/i2c.h:

"/*
 * Many boards/controllers/drivers don't support an I2C slave interface so
 * provide a default slave address for them for use in common code.  A real
 * value for CONFIG_SYS_I2C_SLAVE should be defined for any board which does
 * support a slave interface.
 */
#ifndef CONFIG_SYS_I2C_SLAVE
#define CONFIG_SYS_I2C_SLAVE0xfe
#endif
"

As the mxc_i2c driver does not support slave mode, there is no need
to define CONFIG_SYS_I2C_SLAVE in i.MX board file.

Signed-off-by: Fabio Estevam 
---
 include/configs/mx53ard.h |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/include/configs/mx53ard.h b/include/configs/mx53ard.h
index f48a41e..f879edc 100644
--- a/include/configs/mx53ard.h
+++ b/include/configs/mx53ard.h
@@ -52,7 +52,6 @@
 #define CONFIG_I2C_MXC
 #define CONFIG_SYS_I2C_MX53_PORT2
 #define CONFIG_SYS_I2C_SPEED10
-#define CONFIG_SYS_I2C_SLAVE0xfe
 
 /* MMC Configs */
 #define CONFIG_FSL_ESDHC
-- 
1.7.1

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


[U-Boot] [PATCH 4/6] mx53evk: Remove CONFIG_SYS_I2C_SLAVE definition

2012-06-03 Thread Fabio Estevam
From: Fabio Estevam 

According to include/i2c.h:

"/*
 * Many boards/controllers/drivers don't support an I2C slave interface so
 * provide a default slave address for them for use in common code.  A real
 * value for CONFIG_SYS_I2C_SLAVE should be defined for any board which does
 * support a slave interface.
 */
#ifndef CONFIG_SYS_I2C_SLAVE
#define CONFIG_SYS_I2C_SLAVE0xfe
#endif
"

As the mxc_i2c driver does not support slave mode, there is no need
to define CONFIG_SYS_I2C_SLAVE in i.MX board file.

Cc: Jason Liu 
Signed-off-by: Fabio Estevam 
---
 include/configs/mx53evk.h |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/include/configs/mx53evk.h b/include/configs/mx53evk.h
index a77e5b2..2acefe9 100644
--- a/include/configs/mx53evk.h
+++ b/include/configs/mx53evk.h
@@ -55,7 +55,6 @@
 #define CONFIG_I2C_MXC
 #define CONFIG_SYS_I2C_MX53_PORT2   1
 #define CONFIG_SYS_I2C_SPEED10
-#define CONFIG_SYS_I2C_SLAVE0xfe
 
 /* PMIC Configs */
 #define CONFIG_PMIC
-- 
1.7.1

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


[U-Boot] [PATCH 5/6] mx53loco: Remove CONFIG_SYS_I2C_SLAVE definition

2012-06-03 Thread Fabio Estevam
From: Fabio Estevam 

According to include/i2c.h:

"/*
 * Many boards/controllers/drivers don't support an I2C slave interface so
 * provide a default slave address for them for use in common code.  A real
 * value for CONFIG_SYS_I2C_SLAVE should be defined for any board which does
 * support a slave interface.
 */
#ifndef CONFIG_SYS_I2C_SLAVE
#define CONFIG_SYS_I2C_SLAVE0xfe
#endif
"

As the mxc_i2c driver does not support slave mode, there is no need
to define CONFIG_SYS_I2C_SLAVE in i.MX board file.

Cc: Jason Liu 
Signed-off-by: Fabio Estevam 
---
 include/configs/mx53loco.h |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
index 7d782e2..7c45647 100644
--- a/include/configs/mx53loco.h
+++ b/include/configs/mx53loco.h
@@ -92,7 +92,6 @@
 #define CONFIG_I2C_MXC
 #define CONFIG_SYS_I2C_MX53_PORT1
 #define CONFIG_SYS_I2C_SPEED   10
-#define CONFIG_SYS_I2C_SLAVE   0xfe
 
 /* PMIC Controller */
 #define CONFIG_PMIC
-- 
1.7.1

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


[U-Boot] [PATCH 6/6] mx53smd: Remove CONFIG_SYS_I2C_SLAVE definition

2012-06-03 Thread Fabio Estevam
From: Fabio Estevam 

According to include/i2c.h:

"/*
 * Many boards/controllers/drivers don't support an I2C slave interface so
 * provide a default slave address for them for use in common code.  A real
 * value for CONFIG_SYS_I2C_SLAVE should be defined for any board which does
 * support a slave interface.
 */
#ifndef CONFIG_SYS_I2C_SLAVE
#define CONFIG_SYS_I2C_SLAVE0xfe
#endif
"

As the mxc_i2c driver does not support slave mode, there is no need
to define CONFIG_SYS_I2C_SLAVE in i.MX board file.

Signed-off-by: Fabio Estevam 
---
 include/configs/mx53smd.h |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/include/configs/mx53smd.h b/include/configs/mx53smd.h
index a04db3f..61edd7f 100644
--- a/include/configs/mx53smd.h
+++ b/include/configs/mx53smd.h
@@ -52,7 +52,6 @@
 #define CONFIG_I2C_MXC
 #define CONFIG_SYS_I2C_MX53_PORT2
 #define CONFIG_SYS_I2C_SPEED10
-#define CONFIG_SYS_I2C_SLAVE0xfe
 
 /* MMC Configs */
 #define CONFIG_FSL_ESDHC
-- 
1.7.1

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


[U-Boot] (no subject)

2012-06-03 Thread Stijn Souffriau
Fixed a comment

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


[U-Boot] [PATCH resend] Added UBL_MAGIC_PLL number for ublimage + added automatic page size calculation

2012-06-03 Thread Stijn Souffriau
---
 tools/mkimage.h  |6 ++
 tools/ublimage.c |   31 +--
 tools/ublimage.h |2 ++
 3 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/tools/mkimage.h b/tools/mkimage.h
index 5fe1a48..cd835f0 100644
--- a/tools/mkimage.h
+++ b/tools/mkimage.h
@@ -140,6 +140,12 @@ struct image_type_params {
 void mkimage_register (struct image_type_params *tparams);
 
 /*
+ * This struct contains the global parameters and is initialized 
+ * by the main core before any image type specific functions are called.
+ */
+extern struct mkimage_params params;
+
+/*
  * There is a c file associated with supported image type low level code
  * for ex. default_image.c, fit_image.c
  * init is the only function referred by mkimage core.
diff --git a/tools/ublimage.c b/tools/ublimage.c
index d6b4017..b5fa5c2 100644
--- a/tools/ublimage.c
+++ b/tools/ublimage.c
@@ -36,6 +36,10 @@
 #include 
 #include "ublimage.h"
 
+#include 
+#include 
+#include 
+
 /*
  * Supported commands for configuration file
  */
@@ -58,8 +62,9 @@ static table_entry_t ublimage_cmds[] = {
  * this is needed to set the correct flash offset
  */
 static table_entry_t ublimage_bootops[] = {
-   {UBL_MAGIC_SAFE,"safe", "Safe boot mode",   },
-   {-1,"", "Invalid",  },
+   {UBL_MAGIC_SAFE,"safe", "Safe boot mode",   },
+   {UBL_MAGIC_PLL, "pll", "With PLL enabled to have higher ARM/DMA 
clocks",},
+   {-1,"", "Invalid",  },
 };
 
 static struct ubl_header ublimage_header;
@@ -89,6 +94,22 @@ static void print_hdr(struct ubl_header *ubl_hdr)
printf("start page : %08x\n", ubl_hdr->page);
 }
 
+/* 
+ * This function calculates the size of the datafile in NAND pages
+ */
+static uint32_t get_data_pages_size(void)
+{
+   uint32_t size = 0;
+   struct stat buf;
+   int rv = stat(params.datafile, &buf);
+   if (rv == 0) {
+   size = (buf.st_size/UBL_BLOCK_SIZE) + (buf.st_size % 
UBL_BLOCK_SIZE == 0 ? 0 : 1);
+   } else {
+   fprintf(stderr, "Error: could not stat datafile %s\n", 
params.datafile);
+   }
+   return size;
+}
+
 static void parse_cfg_cmd(struct ubl_header *ublhdr, int32_t cmd, char *token,
char *name, int lineno, int fld, int dcd_len)
 {
@@ -171,6 +192,12 @@ static uint32_t parse_cfg_file(struct ubl_header *ublhdr, 
char *name)
*ptr = 0xff;
ptr++;
}
+   
+/* By default, the size of the data in NAND pages
+ * will be automatically calculated but it can be overwritten
+ * in the configuration file.
+ */
+   ublhdr->pages = get_data_pages_size();
 
/*
 * Very simple parsing, line starting with # are comments
diff --git a/tools/ublimage.h b/tools/ublimage.h
index e440625..cbff8b7 100644
--- a/tools/ublimage.h
+++ b/tools/ublimage.h
@@ -61,6 +61,8 @@ enum ublimage_fld_types {
 #define UBL_MAGIC_DMA_IC(0x44)
 /* DMA + ICache + Fast EMIF boot mode */
 #define UBL_MAGIC_DMA_IC_FAST   (0x55)
+/* With PLL enabled to have higher ARM/DMA clocks */
+#define UBL_MAGIC_PLL   (0x66)
 
 /* Define max UBL image size */
 #define UBL_IMAGE_SIZE  (0x3800u)
-- 
1.7.9.5

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


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

2012-06-03 Thread Marek Vasut
Dear Pali Rohár,

Please CC proper custodians in order to get reviews next time.

[...]

> --- a/include/menu.h
> +++ b/include/menu.h
> @@ -21,12 +21,14 @@
>  struct 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 *),

Where is this item_data_choice() used?

> + void *menu_data);
>  int menu_default_set(struct menu *m, char *item_key);
>  int menu_get_choice(struct menu *m, void **choice);
>  int menu_item_add(struct menu *m, char *item_key, void *item_data);
>  int menu_destroy(struct menu *m);
> -void menu_display_statusline(struct menu *m);
> +void menu_display_statusline(void *menu_data);
> 
>  #if defined(CONFIG_MENU_SHOW)
>  int menu_show(int bootdelay);

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


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

2012-06-03 Thread Pali Rohár
On Sunday 03 June 2012 11:59:16 Marek Vasut wrote:
> > --- a/include/menu.h
> > +++ b/include/menu.h
> > @@ -21,12 +21,14 @@
> >
> >  struct 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 *),
>
> Where is this item_data_choice() used?

This is alternative function for menu entry choice. It is used in
function menu_interactive_choice. If item_data_choice is NULL
default code with readline_into_buffer is used.

ANSI bootmenu command (in next patch) is using its own function.

--
Pali Rohár
pali.ro...@gmail.com

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 2/2] New command bootmenu: ANSI terminal Boot Menu support

2012-06-03 Thread Marek Vasut
Dear Pali Rohár,

> Signed-off-by: Pali Rohár 

Try keeping the subject line short and add a patch description instead. Btw. 
Try 
avoiding unicode characters in the patch. Also, is "Pali" your real name that 
you have on your IDs etc. ?

> ---
>  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 
> + *
> + * 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 
> +
> +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)

Why add this artificial limit?

> + 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);

Why not just write it below into the condition?

> +
> + printf(ANSI_CURSOR_POSITION, entry->num + 4, 1);

What are all these artificial numbers here?

> +
> + 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;

Can't the spaghetti function below be split into multiple smaller ones? You 
know 
the rule of the thumb, if the code spans multiple screens, something's 
seriously 
wrong.

> + 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()) {

if (!tstc())
 continue;

... do your job
break;

You'll get one less level of indent and much more readable code.

> + menu->delay = -1;
> + 

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

2012-06-03 Thread Marek Vasut
Dear Pali Rohár,

> On Sunday 03 June 2012 11:59:16 Marek Vasut wrote:
> > > --- a/include/menu.h
> > > +++ b/include/menu.h
> > > @@ -21,12 +21,14 @@
> > > 
> > >  struct 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 *),
> > 
> > Where is this item_data_choice() used?
> 
> This is alternative function for menu entry choice. It is used in
> function menu_interactive_choice. If item_data_choice is NULL
> default code with readline_into_buffer is used.
> 
> ANSI bootmenu command (in next patch) is using its own function.

Hm so why not make this ANSI stuff one plugin and the other bootmenu stuff 
another plugin (which will be default). Then you won't have to check if 
anything 
is null.

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


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

2012-06-03 Thread Luka Perkov
Hi Marek,

On Sun, Jun 03, 2012 at 12:06:55PM +0200, Marek Vasut wrote:
> Dear Pali Rohár,
> 
> > Signed-off-by: Pali Rohár 
> 
> Try keeping the subject line short and add a patch description instead. Btw. 
> Try 
> avoiding unicode characters in the patch. Also, is "Pali" your real name that 
> you have on your IDs etc. ?

What kind of question is that :) ?

Like you can do anything if it's real or not...

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


[U-Boot] [PATCH] da850/omap-l138: Enable auto negotiation in RMII mode

2012-06-03 Thread Prabhakar Lad
From: Rajashekhara, Sudhakar 

On DA850/OMAP-L138 it was observed that in RMII mode,
auto negotiation was not performed. This patch enables
auto negotiation in RMII mode. Without this patch, EMAC
initialization takes more time and sometimes tftp fails
in RMII mode.

Signed-off-by: Rajashekhara, Sudhakar 
Signed-off-by: Lad, Prabhakar 
Signed-off-by: Hadli, Manjunath 
---
 drivers/net/davinci_emac.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index fbd0f1b..9bbd625 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -895,5 +895,10 @@ int davinci_emac_initialize(void)
miiphy_register(phy[i].name, davinci_mii_phy_read,
davinci_mii_phy_write);
}
+
+#if defined(CONFIG_DRIVER_TI_EMAC_USE_RMII) && \
+   defined(CONFIG_MACH_DAVINCI_DA850_EVM)
+   gen_auto_negotiate(active_phy_addr);
+#endif
return(1);
 }
-- 
1.7.4.1

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


[U-Boot] [PATCH] da850/omap-l138: enable SPI flash in RMII mode

2012-06-03 Thread Prabhakar Lad
From: Rajashekhara, Sudhakar 

According to DA850/OMAP-L138 schematics, GP2[6] line has to be driven
high for RMII mode to work. In RMII mode, SPI flash becomes un-usable.
But during testing it was found out that, driving GP2[6] low also
enables RMII and in this configuration SPI flash is also accessible.

Signed-off-by: Rajashekhara, Sudhakar 
Signed-off-by: Lad, Prabhakar 
Signed-off-by: Hadli, Manjunath 
---
 board/davinci/da8xxevm/da850evm.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/board/davinci/da8xxevm/da850evm.c 
b/board/davinci/da8xxevm/da850evm.c
index 004d5ad..82d707f 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -438,10 +438,10 @@ int rmii_hw_init(void)
CONFIG_SYS_I2C_EXPANDER_ADDR);
}
 
-   /* Set the output as high */
-   temp = REG(GPIO_BANK2_REG_SET_ADDR);
+   /* Set the output as low */
+   temp = REG(GPIO_BANK2_REG_CLR_ADDR);
temp |= (0x01 << 6);
-   REG(GPIO_BANK2_REG_SET_ADDR) = temp;
+   REG(GPIO_BANK2_REG_CLR_ADDR) = temp;
 
/* Set the GPIO direction as output */
temp = REG(GPIO_BANK2_REG_DIR_ADDR);
-- 
1.7.4.1

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


[U-Boot] [PATCH 0/7] feature additions and fixes for da850/omap-l138

2012-06-03 Thread Prabhakar Lad
From: Lad, Prabhakar 

This series adds MMC/SD, NAND and NOR SPL support
for Logic PD's DA850/OMAP-L138 EVM. This series
also fixes some issues found on the EVM during
testing. The patches are sent in a series as these
patches need to be applied in the order they are sent.

Lad, Prabhakar (5):
  da850/omap-l138: Add MMC support for DA850/OMAP-L138
  da850/omap-l138: Add support to read u-boot image from MMC/SD
  da850/omap-l138: Fix NAND flash timings
  da850/omap-l138: Add support for NAND SPL
  da850/omap-l138: add support for direct NOR boot mode

Rajashekhara, Sudhakar (2):
  da850/omap-l138: modifications for Logic PD Rev.3 AM18xx EVM
  da850/omap-l138: Make MMC and NOR support mutually exclusive

 arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c   |   13 
 arch/arm/cpu/arm926ejs/davinci/spl.c|   25 +--
 arch/arm/include/asm/arch-davinci/hardware.h|1 +
 arch/arm/include/asm/arch-davinci/pinmux_defs.h |3 +
 board/davinci/da8xxevm/da850evm.c   |   50 --
 drivers/mmc/Makefile|4 +
 drivers/mmc/spl_mmc_load.c  |   62 
 include/configs/da850evm.h  |   87 +--
 include/mmc.h   |2 +
 9 files changed, 229 insertions(+), 18 deletions(-)
 create mode 100644 drivers/mmc/spl_mmc_load.c

-- 
1.7.4.1

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


[U-Boot] [PATCH 1/7] da850/omap-l138: Add MMC support for DA850/OMAP-L138

2012-06-03 Thread Prabhakar Lad
From: Lad, Prabhakar 

This patch adds support for MMC/SD on DA850/OMAP-L138.

Signed-off-by: Lad, Prabhakar 
Signed-off-by: Rajashekhara, Sudhakar 
Signed-off-by: Hadli, Manjunath 
---
 arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c   |   13 ++
 arch/arm/include/asm/arch-davinci/hardware.h|1 +
 arch/arm/include/asm/arch-davinci/pinmux_defs.h |3 ++
 board/davinci/da8xxevm/da850evm.c   |   28 +++
 include/configs/da850evm.h  |   14 +++
 5 files changed, 59 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c 
b/arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c
index fa07fb5..a95e419 100644
--- a/arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c
+++ b/arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c
@@ -169,3 +169,16 @@ const struct pinmux_config emifa_pins_nor[] = {
{ pinmux(12), 1, 6 }, /* EMA_A[1] */
{ pinmux(12), 1, 7 }, /* EMA_A[0] */
 };
+
+/* MMC0 pin muxer settings */
+const struct pinmux_config mmc0_pins[] = {
+   /* GP0[11] is required for SD to work on Rev 3 EVMs */
+   { pinmux(0),  8, 4 },   /* GP0[11] */
+   { pinmux(10), 2, 0 },   /* MMCSD0_CLK */
+   { pinmux(10), 2, 1 },   /* MMCSD0_CMD */
+   { pinmux(10), 2, 2 },   /* MMCSD0_DAT_0 */
+   { pinmux(10), 2, 3 },   /* MMCSD0_DAT_1 */
+   { pinmux(10), 2, 4 },   /* MMCSD0_DAT_2 */
+   { pinmux(10), 2, 5 },   /* MMCSD0_DAT_3 */
+   /* DA850 supports only 4-bit mode, remaining pins are not configured */
+};
diff --git a/arch/arm/include/asm/arch-davinci/hardware.h 
b/arch/arm/include/asm/arch-davinci/hardware.h
index b145c6e..f6b7a2c 100644
--- a/arch/arm/include/asm/arch-davinci/hardware.h
+++ b/arch/arm/include/asm/arch-davinci/hardware.h
@@ -446,6 +446,7 @@ struct davinci_pllc_regs {
 #define DAVINCI_SPI1_CLKID  (cpu_is_da830() ? 2 : ASYNC3)
 /* Clock IDs */
 enum davinci_clk_ids {
+   DAVINCI_MMCSD_CLKID = 2,
DAVINCI_SPI0_CLKID = 2,
DAVINCI_UART2_CLKID = 2,
DAVINCI_MMC_CLKID = 2,
diff --git a/arch/arm/include/asm/arch-davinci/pinmux_defs.h 
b/arch/arm/include/asm/arch-davinci/pinmux_defs.h
index 07aceaa..c9ac697 100644
--- a/arch/arm/include/asm/arch-davinci/pinmux_defs.h
+++ b/arch/arm/include/asm/arch-davinci/pinmux_defs.h
@@ -48,4 +48,7 @@ extern const struct pinmux_config emifa_pins_cs4[1];
 extern const struct pinmux_config emifa_pins_nand[12];
 extern const struct pinmux_config emifa_pins_nor[43];
 
+/* MMC pin muxer settings */
+extern const struct pinmux_config mmc0_pins[7];
+
 #endif
diff --git a/board/davinci/da8xxevm/da850evm.c 
b/board/davinci/da8xxevm/da850evm.c
index 82d707f..608c652 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -36,6 +36,11 @@
 #include 
 #include 
 
+#ifdef CONFIG_DAVINCI_MMC
+#include 
+#include 
+#endif
+
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_DRIVER_TI_EMAC
@@ -204,6 +209,23 @@ int misc_init_r(void)
return 0;
 }
 
+#ifdef CONFIG_DAVINCI_MMC
+static struct davinci_mmc mmc_sd0 = {
+   .reg_base = (struct davinci_mmc_regs *)DAVINCI_MMC_SD0_BASE,
+   .host_caps = MMC_MODE_4BIT, /* DA850 supports only 4-bit SD/MMC */
+   .voltages = MMC_VDD_32_33 | MMC_VDD_33_34,
+   .version = MMC_CTLR_VERSION_2,
+};
+
+int board_mmc_init(bd_t *bis)
+{
+   mmc_sd0.input_clk = clk_get(DAVINCI_MMCSD_CLKID);
+
+   /* Add slot-0 to mmc subsystem */
+   return davinci_mmc_init(bis, &mmc_sd0);
+}
+#endif
+
 static const struct pinmux_config gpio_pins[] = {
 #ifdef CONFIG_USE_NOR
/* GP0[11] is required for NOR to work on Rev 3 EVMs */
@@ -236,6 +258,9 @@ const struct pinmux_resource pinmuxes[] = {
PINMUX_ITEM(emifa_pins_nor),
 #endif
PINMUX_ITEM(gpio_pins),
+#ifdef CONFIG_DAVINCI_MMC
+   PINMUX_ITEM(mmc0_pins),
+#endif
 };
 
 const int pinmuxes_size = ARRAY_SIZE(pinmuxes);
@@ -246,6 +271,9 @@ const struct lpsc_resource lpsc[] = {
{ DAVINCI_LPSC_EMAC },  /* image download */
{ DAVINCI_LPSC_UART2 }, /* console */
{ DAVINCI_LPSC_GPIO },
+#ifdef CONFIG_DAVINCI_MMC
+   { DAVINCI_LPSC_MMC_SD },
+#endif
 };
 
 const int lpsc_size = ARRAY_SIZE(lpsc);
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index 989472b..9301a3b 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -313,6 +313,20 @@
 #undef CONFIG_CMD_ENV
 #endif
 
+/* SD/MMC */
+#define CONFIG_MMC
+#define CONFIG_DAVINCI_MMC_SD1
+#define CONFIG_MMC_MBLOCK
+#define CONFIG_GENERIC_MMC
+#define CONFIG_DAVINCI_MMC
+
+#ifdef CONFIG_MMC
+#define CONFIG_DOS_PARTITION
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_MMC
+#endif
+
 /* defines for SPL */
 #define CONFIG_SPL
 #define CONFIG_SPL_SPI_SUPPORT
-- 
1.7.4.1

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


[U-Boot] [PATCH 4/7] da850/omap-l138: Make MMC and NOR support mutually exclusive

2012-06-03 Thread Prabhakar Lad
From: Rajashekhara, Sudhakar 

On Logic PD Rev.3 DA850/OMAP-L138 EVM, NOR and MMC/SD cannot
work together. This patch enables the MMC/SD support only
when NOR support is disabled. NOR Flash identification works
even without this patch, but erase and write will have issues.

Signed-off-by: Rajashekhara, Sudhakar 
Signed-off-by: Lad, Prabhakar 
Signed-off-by: Hadli, Manjunath 
---
 include/configs/da850evm.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index 4da6d24..08f8d9b 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -314,11 +314,13 @@
 #endif
 
 /* SD/MMC */
+#ifndef CONFIG_USE_NOR
 #define CONFIG_MMC
 #define CONFIG_DAVINCI_MMC_SD1
 #define CONFIG_MMC_MBLOCK
 #define CONFIG_GENERIC_MMC
 #define CONFIG_DAVINCI_MMC
+#endif
 
 /* Load U-Boot Image From MMC */
 #ifdef CONFIG_SPL_MMC_LOAD
-- 
1.7.4.1

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


[U-Boot] [PATCH 7/7] da850/omap-l138: add support for direct NOR boot mode

2012-06-03 Thread Prabhakar Lad
From: Lad, Prabhakar 

This patch adds support for direct NOR boot mode on
da850/omap-l138.

Define the CONFIG_DIRECT_NOR_BOOT macro along with
CONFIG_USE_NOR in the DA850/OMAP-L138 configuration
file to enable this feature.

Signed-off-by: Lad, Prabhakar 
Signed-off-by: Rajashekhara, Sudhakar 
Signed-off-by: Hadli, Manjunath 
---
 include/configs/da850evm.h |   26 +-
 1 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index f33eba8..5c373bc 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -24,6 +24,13 @@
 #define __CONFIG_H
 
 /*
+ * Define this when NOR U-Boot is loaded directly from flash as it
+ * must perform all the low level initialization itself.
+ *
+#define CONFIG_DIRECT_NOR_BOOT
+*/
+
+/*
  * Board
  */
 #define CONFIG_DRIVER_TI_EMAC
@@ -43,10 +50,19 @@
 #define CONFIG_SYS_TIMERBASE   DAVINCI_TIMER0_BASE
 #define CONFIG_SYS_HZ_CLOCKclk_get(DAVINCI_AUXCLK_CLKID)
 #define CONFIG_SYS_HZ  1000
-#define CONFIG_SYS_TEXT_BASE   0xc108
 #define CONFIG_SYS_DA850_PLL_INIT
 #define CONFIG_SYS_DA850_DDR_INIT
 
+#ifdef CONFIG_DIRECT_NOR_BOOT
+#define CONFIG_ARCH_CPU_INIT
+#define CONFIG_DA8XX_GPIO
+#define CONFIG_SYS_TEXT_BASE   0x6000
+#define CONFIG_SYS_DV_NOR_BOOT_CFG (0x11)
+#define CONFIG_DA850_LOWLEVEL
+#else
+#define CONFIG_SYS_TEXT_BASE   0xc108
+#endif
+
 /*
  * Memory Info
  */
@@ -373,6 +389,7 @@
 #define CONFIG_SYS_SPI_U_BOOT_SIZE 0x3
 #endif
 
+#ifndef CONFIG_USE_NOR
 /* defines for SPL */
 #define CONFIG_SPL
 #define CONFIG_SPL_SERIAL_SUPPORT
@@ -382,9 +399,16 @@
 #define CONFIG_SPL_STACK   0x8001ff00
 #define CONFIG_SPL_TEXT_BASE   0x8000
 #define CONFIG_SPL_MAX_SIZE32768
+#endif
+
 /* additions for new relocation code, must added to all boards */
 #define CONFIG_SYS_SDRAM_BASE  0xc000
+
+#ifdef CONFIG_DIRECT_NOR_BOOT
+#define CONFIG_SYS_INIT_SP_ADDR0x8001ff00
+#else
 #define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_SDRAM_BASE + 0x1000 
- /* Fix this */ \
GENERATED_GBL_DATA_SIZE)
+#endif /* CONFIG_DIRECT_NOR_BOOT */
 
 #endif /* __CONFIG_H */
-- 
1.7.4.1

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


[U-Boot] [PATCH 2/7] da850/omap-l138: modifications for Logic PD Rev.3 AM18xx EVM

2012-06-03 Thread Prabhakar Lad
From: Rajashekhara, Sudhakar 

AHCLKR/UART1_RTS/GP0[11] pin needs to be configured for
MMC and NOR to work on DA850/OMAP-L138 Rev.3 EVM. When
GP0[11] is low, the SD0 interface will not work, but NOR
flash will. When GP0[11] is high, SD0 will work but NOR
flash will not.

Signed-off-by: Rajashekhara, Sudhakar 
Signed-off-by: Lad, Prabhakar 
Signed-off-by: Hadli, Manjunath 
---
 board/davinci/da8xxevm/da850evm.c |   12 +++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/board/davinci/da8xxevm/da850evm.c 
b/board/davinci/da8xxevm/da850evm.c
index 608c652..62b9098 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -331,7 +331,7 @@ int board_early_init_f(void)
 
 int board_init(void)
 {
-#ifdef CONFIG_USE_NOR
+#if defined(CONFIG_USE_NOR) || defined(CONFIG_DAVINCI_MMC)
u32 val;
 #endif
 
@@ -382,6 +382,16 @@ int board_init(void)
writel(val, GPIO_BANK0_REG_CLR_ADDR);
 #endif
 
+#ifdef CONFIG_DAVINCI_MMC
+   /* Set the GPIO direction as output */
+   clrbits_be32((u32 *)GPIO_BANK0_REG_DIR_ADDR, (0x01 << 11));
+
+   /* Set the output as high */
+   val = readl(GPIO_BANK0_REG_SET_ADDR);
+   val |= (0x01 << 11);
+   writel(val, GPIO_BANK0_REG_SET_ADDR);
+#endif
+
 #ifdef CONFIG_DRIVER_TI_EMAC
davinci_emac_mii_mode_sel(HAS_RMII);
 #endif /* CONFIG_DRIVER_TI_EMAC */
-- 
1.7.4.1

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


[U-Boot] [PATCH 5/7] da850/omap-l138: Fix NAND flash timings

2012-06-03 Thread Prabhakar Lad
From: Lad, Prabhakar 

Though Commit id a3f88293ddd13facd734769c1664d35ab4ed681f (da850evm:
setup the NAND flash timings) has configured the AEMIF timings, they
are not exactly in sync with the timings used in Linux. Linux is
configuring the timing register as 0x0804, where as currently it
configured to 0x00100084 in U-Boot. This issue was found out when
support for NAND SPL is added in U-Boot. Without this patch U-Boot
does not come up with SPL.

Signed-off-by: Lad, Prabhakar 
Signed-off-by: Rajashekhara, Sudhakar 
Signed-off-by: Hadli, Manjunath 
---
 board/davinci/da8xxevm/da850evm.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/board/davinci/da8xxevm/da850evm.c 
b/board/davinci/da8xxevm/da850evm.c
index 62b9098..2c4d2c4 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -344,11 +344,11 @@ int board_init(void)
 * NAND CS setup - cycle counts based on da850evm NAND timings in the
 * Linux kernel @ 25MHz EMIFA
 */
-   writel((DAVINCI_ABCR_WSETUP(0) |
-   DAVINCI_ABCR_WSTROBE(1) |
-   DAVINCI_ABCR_WHOLD(0) |
-   DAVINCI_ABCR_RSETUP(0) |
-   DAVINCI_ABCR_RSTROBE(1) |
+   writel((DAVINCI_ABCR_WSETUP(2) |
+   DAVINCI_ABCR_WSTROBE(2) |
+   DAVINCI_ABCR_WHOLD(1) |
+   DAVINCI_ABCR_RSETUP(1) |
+   DAVINCI_ABCR_RSTROBE(4) |
DAVINCI_ABCR_RHOLD(0) |
DAVINCI_ABCR_TA(1) |
DAVINCI_ABCR_ASIZE_8BIT),
-- 
1.7.4.1

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


[U-Boot] [PATCH 6/7] da850/omap-l138: Add support for NAND SPL

2012-06-03 Thread Prabhakar Lad
From: Lad, Prabhakar 

This patch adds support for NAND SPL on DA850/OMAP-L138.

Signed-off-by: Lad, Prabhakar 
Signed-off-by: Rajashekhara, Sudhakar 
Signed-off-by: Hadli, Manjunath 
---
 arch/arm/cpu/arm926ejs/davinci/spl.c |   13 ++-
 include/configs/da850evm.h   |   39 +
 2 files changed, 41 insertions(+), 11 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c 
b/arch/arm/cpu/arm926ejs/davinci/spl.c
index be397ce..53df581 100644
--- a/arch/arm/cpu/arm926ejs/davinci/spl.c
+++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
@@ -79,12 +79,6 @@ void board_init_f(ulong dummy)
 
 void board_init_r(gd_t *id, ulong dummy)
 {
-#ifdef CONFIG_SPL_NAND_LOAD
-   nand_init();
-   puts("Nand boot...\n");
-   nand_boot();
-#endif
-#ifdef CONFIG_SPL_SPI_LOAD
mem_malloc_init(CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN,
CONFIG_SYS_MALLOC_LEN);
 
@@ -95,6 +89,13 @@ void board_init_r(gd_t *id, ulong dummy)
serial_init();  /* serial communications setup */
gd->have_console = 1;
 
+#ifdef CONFIG_SPL_NAND_LOAD
+   puts("Nand boot...\n");
+   nand_init();
+   puts("Nand Initalized...\n");
+   nand_boot();
+#endif
+#ifdef CONFIG_SPL_SPI_LOAD
puts("SPI boot...\n");
 #ifdef CONFIG_SPL_MMC_LOAD
spl_mmc_load();
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index 08f8d9b..f33eba8 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -183,6 +183,32 @@
 #define CONFIG_SYS_ALE_MASK0x8
 #undef CONFIG_SYS_NAND_HW_ECC
 #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND devices */
+#define CONFIG_SYS_NAND_HW_ECC_OOBFIRST
+#define CONFIG_SYS_NAND_5_ADDR_CYCLE
+#define CONFIG_SYS_NAND_PAGE_SIZE  (2 << 10)
+#define CONFIG_SYS_NAND_BLOCK_SIZE (128 << 10)
+#define CONFIG_SYS_NAND_U_BOOT_OFFS0x28000
+#define CONFIG_SYS_NAND_U_BOOT_SIZE0x6
+#define CONFIG_SYS_NAND_U_BOOT_DST 0xc108
+#define CONFIG_SYS_NAND_U_BOOT_START   CONFIG_SYS_NAND_U_BOOT_DST
+#define CONFIG_SYS_NAND_U_BOOT_RELOC_SP(CONFIG_SYS_NAND_U_BOOT_DST - \
+   CONFIG_SYS_NAND_U_BOOT_SIZE - \
+   CONFIG_SYS_MALLOC_LEN -   \
+   GENERATED_GBL_DATA_SIZE)
+#define CONFIG_SYS_NAND_ECCPOS {   \
+   24, 25, 26, 27, 28, \
+   29, 30, 31, 32, 33, 34, 35, 36, 37, 38, \
+   39, 40, 41, 42, 43, 44, 45, 46, 47, 48, \
+   49, 50, 51, 52, 53, 54, 55, 56, 57, 58, \
+   59, 60, 61, 62, 63 }
+#define CONFIG_SYS_NAND_PAGE_COUNT 64
+#define CONFIG_SYS_NAND_BAD_BLOCK_POS  0
+#define CONFIG_SYS_NAND_ECCSIZE512
+#define CONFIG_SYS_NAND_ECCBYTES   10
+#define CONFIG_SYS_NAND_OOBSIZE64
+#define CONFIG_SPL_NAND_SUPPORT
+#define CONFIG_SPL_NAND_SIMPLE
+#define CONFIG_SPL_NAND_LOAD
 #endif
 
 /*
@@ -337,13 +363,18 @@
 #define CONFIG_CMD_MMC
 #endif
 
-/* defines for SPL */
-#define CONFIG_SPL
+#ifdef CONFIG_USE_SPIFLASH
 #define CONFIG_SPL_SPI_SUPPORT
 #define CONFIG_SPL_SPI_FLASH_SUPPORT
 #define CONFIG_SPL_SPI_LOAD
 #define CONFIG_SPL_SPI_BUS 0
 #define CONFIG_SPL_SPI_CS 0
+#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x8000
+#define CONFIG_SYS_SPI_U_BOOT_SIZE 0x3
+#endif
+
+/* defines for SPL */
+#define CONFIG_SPL
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_LIBCOMMON_SUPPORT
 #define CONFIG_SPL_LIBGENERIC_SUPPORT
@@ -351,11 +382,9 @@
 #define CONFIG_SPL_STACK   0x8001ff00
 #define CONFIG_SPL_TEXT_BASE   0x8000
 #define CONFIG_SPL_MAX_SIZE32768
-#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x8000
-#define CONFIG_SYS_SPI_U_BOOT_SIZE 0x3
-
 /* additions for new relocation code, must added to all boards */
 #define CONFIG_SYS_SDRAM_BASE  0xc000
 #define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_SDRAM_BASE + 0x1000 
- /* Fix this */ \
GENERATED_GBL_DATA_SIZE)
+
 #endif /* __CONFIG_H */
-- 
1.7.4.1

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


[U-Boot] [PATCH 3/7] da850/omap-l138: Add support to read u-boot image from MMC/SD

2012-06-03 Thread Prabhakar Lad
From: Lad, Prabhakar 

DA850/OMAP-L138 does not support strict MMC/SD boot mode. SPL will
be in SPI flash and U-Boot image will be in MMC/SD card. SPL will
do the low level initialization and then loads the u-boot image
from MMC/SD card.

Define the CONFIG_SPL_MMC_LOAD macro in the DA850/OMAP-L138
configuration file to enable this feature.

Signed-off-by: Lad, Prabhakar 
Signed-off-by: Rajashekhara, Sudhakar 
Signed-off-by: Hadli, Manjunath 
---
 arch/arm/cpu/arm926ejs/davinci/spl.c |   12 ++-
 drivers/mmc/Makefile |4 ++
 drivers/mmc/spl_mmc_load.c   |   62 ++
 include/configs/da850evm.h   |8 
 include/mmc.h|2 +
 5 files changed, 87 insertions(+), 1 deletions(-)
 create mode 100644 drivers/mmc/spl_mmc_load.c

diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c 
b/arch/arm/cpu/arm926ejs/davinci/spl.c
index 74632e5..be397ce 100644
--- a/arch/arm/cpu/arm926ejs/davinci/spl.c
+++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
@@ -28,6 +28,11 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
 
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 
@@ -91,6 +96,11 @@ void board_init_r(gd_t *id, ulong dummy)
gd->have_console = 1;
 
puts("SPI boot...\n");
+#ifdef CONFIG_SPL_MMC_LOAD
+   spl_mmc_load();
+#else
spi_boot();
-#endif
+#endif /* CONFIG_SPL_MMC_LOAD */
+
+#endif /* CONFIG_SPL_SPI_LOAD */
 }
diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
index c245352..bf4b7d5 100644
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -25,6 +25,10 @@ include $(TOPDIR)/config.mk
 
 LIB:= $(obj)libmmc.o
 
+ifdef CONFIG_SPL_MMC_LOAD
+COBJS-$(CONFIG_SPL_SPI_LOAD)   += spl_mmc_load.o
+endif
+
 COBJS-$(CONFIG_BFIN_SDH) += bfin_sdh.o
 COBJS-$(CONFIG_DAVINCI_MMC) += davinci_mmc.o
 COBJS-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o
diff --git a/drivers/mmc/spl_mmc_load.c b/drivers/mmc/spl_mmc_load.c
new file mode 100644
index 000..347dcfe
--- /dev/null
+++ b/drivers/mmc/spl_mmc_load.c
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static void mmc_load_image(struct mmc *mmc)
+{
+   s32 err;
+   void (*uboot)(void) __noreturn;
+
+   err = mmc->block_dev.block_read(0, CONFIG_SYS_MMC_U_BOOT_OFFS,
+   CONFIG_SYS_SPI_U_BOOT_SIZE/512,
+   (u32 *)CONFIG_SYS_TEXT_BASE);
+
+   if (err <= 0) {
+   printf("spl: error reading image %s, err - %d\n",
+   "u-boot.img", err);
+   hang();
+   }
+   uboot = (void *) CONFIG_SYS_TEXT_BASE;
+   (*uboot)();
+}
+
+void spl_mmc_load(void)
+{
+   struct mmc *mmc;
+   int err;
+   void (mmc_load_image)(struct mmc *mmc) __noreturn;
+
+   mmc_initialize(gd->bd);
+   mmc = find_mmc_device(0);
+   if (!mmc) {
+   puts("spl: mmc device not found!!\n");
+   hang();
+   } else {
+   puts("spl: mmc device found\n");
+   }
+   err = mmc_init(mmc);
+   if (err) {
+   printf("spl: mmc init failed: err - %d\n", err);
+   hang();
+   }
+   mmc_load_image(mmc);
+}
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index 9301a3b..4da6d24 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -320,6 +320,14 @@
 #define CONFIG_GENERIC_MMC
 #define CONFIG_DAVINCI_MMC
 
+/* Load U-Boot Image From MMC */
+#ifdef CONFIG_SPL_MMC_LOAD
+#define CONFIG_SPL_MMC_SUPPORT
+#define CONFIG_SPL_FAT_SUPPORT
+#define CONFIG_SPL_LIBDISK_SUPPORT
+#define CONFIG_SYS_MMC_U_BOOT_OFFS 0x75
+#endif
+
 #ifdef CONFIG_MMC
 #define CONFIG_DOS_PARTITION
 #define CONFIG_CMD_EXT2
diff --git a/include/mmc.h b/include/mmc.h
index f52df70..282b54d 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -27,6 +27,7 @@
 #define _MMC_H_
 
 #include 
+#include 
 
 #define SD_VERSION_SD  0x2
 #define SD_VERSION_2   (SD_VERSION_SD | 0x20)
@@ -320,6 +321,7 @@ int get_mmc_num(void);
 int board_mmc_getcd(struct mmc *mmc);
 int mmc_switch_part(int dev_num, unsigned int part_num);
 int mmc_getcd(struct mmc *mmc);
+void spl_mmc_load(void) __noret

Re: [U-Boot] [PATCH] fix IDE_BUS(dev) macro

2012-06-03 Thread Vágó Tibor

Hi,

I've tested this IDE patch on my NAS6220 and it works.

U-boot detect both HDD correctly and boot from them.

Cheers,
Tibor


 Original message 
IDE_BUS assumes that each bus has two devices and thus returns the first
bus even when the second one should be probed.

Signed-off-by: Simon Baatz 
Tested-by: Luka Perkov 
---

Simon discovered this while adding support for new board IB NAS6210.

More info can be found here:

http://lists.denx.de/pipermail/u-boot/2012-April/122525.html

When this is commited I will do a coding style cleanup. There are tabs
after few "#define" parts in include/ide.h.

 include/ide.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/ide.h b/include/ide.h
index 8ecc9dd..385e909 100644
--- a/include/ide.h
+++ b/include/ide.h
@@ -24,7 +24,7 @@
 #ifndef_IDE_H
 #define _IDE_H

-#defineIDE_BUS(dev)(dev >> 1)
+#define IDE_BUS(dev)	(dev / (CONFIG_SYS_IDE_MAXDEVICE / 
CONFIG_SYS_IDE_MAXBUS))


 #define	ATA_CURR_BASE(dev) 
(CONFIG_SYS_ATA_BASE_ADDR+ide_bus_offset[IDE_BUS(dev)])

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


Re: [U-Boot] [PATCH] fix IDE_BUS(dev) macro

2012-06-03 Thread Vágó Tibor

Hi,

I've tested this IDE patch on my NAS6220 and it works.

U-boot detect both HDD correctly and boot from them.

Cheers,
Tibor


 Original message 
IDE_BUS assumes that each bus has two devices and thus returns the first
bus even when the second one should be probed.

Signed-off-by: Simon Baatz 
Tested-by: Luka Perkov 
---

Simon discovered this while adding support for new board IB NAS6210.

More info can be found here:

http://lists.denx.de/pipermail/u-boot/2012-April/122525.html

When this is commited I will do a coding style cleanup. There are tabs
after few "#define" parts in include/ide.h.

 include/ide.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/ide.h b/include/ide.h
index 8ecc9dd..385e909 100644
--- a/include/ide.h
+++ b/include/ide.h
@@ -24,7 +24,7 @@
 #ifndef_IDE_H
 #define _IDE_H

-#defineIDE_BUS(dev)(dev >> 1)
+#define IDE_BUS(dev)	(dev / (CONFIG_SYS_IDE_MAXDEVICE / 
CONFIG_SYS_IDE_MAXBUS))


 #define	ATA_CURR_BASE(dev) 
(CONFIG_SYS_ATA_BASE_ADDR+ide_bus_offset[IDE_BUS(dev)])

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


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

2012-06-03 Thread Marek Vasut
Dear Luka Perkov,

> Hi Marek,
> 
> On Sun, Jun 03, 2012 at 12:06:55PM +0200, Marek Vasut wrote:
> > Dear Pali Rohár,
> > 
> > > Signed-off-by: Pali Rohár 
> > 
> > Try keeping the subject line short and add a patch description instead.
> > Btw. Try avoiding unicode characters in the patch. Also, is "Pali" your
> > real name that you have on your IDs etc. ?
> 
> What kind of question is that :) ?
> 
> Like you can do anything if it's real or not...

I can vote for the patch to not be merged obviously if it's of suspicious 
origin. But before you loose your temper completely and flame me to death, read 
on ...

Basically, I don't want to be the bitch that wards people off here, but we 
better obey some kind of rules. See http://lwn.net/Articles/195643/ why such 
possibly minor thing might be an issue. There was very long thread about it in 
the LKML back in the day. Though it's not exactly the case here, Pavel, please 
use the real name in your patches and especially in the SoB lines.

> Regards,
> Luka

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


Re: [U-Boot] [PATCH] fix IDE_BUS(dev) macro

2012-06-03 Thread Rogan Dawes

On 19/04/2012 08:38, Albert ARIBAUD wrote:

Hi Dave,

Le 18/04/2012 23:37, David Purdy a écrit :

On Tue, Apr 17, 2012 at 2:06 PM, Luka Perkov wrote:

IDE_BUS assumes that each bus has two devices and thus returns the first
bus even when the second one should be probed.

Signed-off-by: Simon Baatz
Tested-by: Luka Perkov
---

Simon discovered this while adding support for new board IB NAS6210.

More info can be found here:

http://lists.denx.de/pipermail/u-boot/2012-April/122525.html

When this is commited I will do a coding style cleanup. There are tabs
after few "#define" parts in include/ide.h.

include/ide.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/ide.h b/include/ide.h
index 8ecc9dd..385e909 100644
--- a/include/ide.h
+++ b/include/ide.h
@@ -24,7 +24,7 @@
#ifndef _IDE_H


Simon, Luka, Prafulla, etal,

I've tested this out on the Seagate GoFlex Net (Kirkwood) device,
which also has dual SATA ports, and it resolved the long-standing (and
irritating) bug/unwanted-feature that required us to boot from _only_
the right side port.

I would guess that other Kirkwood dual-SATA-port boxes would be
happier because of this, as well.

Nice catch, Simon.


Not my main area of expertise here, but I am not sure how this plays on
Marvell non-kirkwood platforms (e.g., orion5x).

ISTR it is not the first time we deal with the whole IDE number of bus /
number of ports [ / useable ports ] issue, and we may be running in
circles here, fixing one platform and breaking another.

I'll try this on EDMiniV2 in the coming days, and let people know the
results in this thread.


regards,

Dave


Amicalement,


I had something similar for my DNS323 port (orion5x-based), which other 
people may be remembering.


http://lists.denx.de/pipermail/u-boot/2010-August/075589.html

I seem to recall Wolfgang was not terribly enthused about it for some 
reason, though.


Rogan


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


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

2012-06-03 Thread Luka Perkov
Hi Marek,

On Sun, Jun 03, 2012 at 08:27:53PM +0200, Marek Vasut wrote:
> > > Try keeping the subject line short and add a patch description instead.
> > > Btw. Try avoiding unicode characters in the patch. Also, is "Pali" your
> > > real name that you have on your IDs etc. ?
> > 
> > What kind of question is that :) ?
> > 
> > Like you can do anything if it's real or not...
> 
> I can vote for the patch to not be merged obviously if it's of suspicious 
> origin.

Ah yes, I forgot that one.

> But before you loose your temper completely and flame me to death, read 
> on ...

I'm not loosing my temper nor going to flame you ;) I was just supprised
with the question. And now I know why you have asked it.

> Basically, I don't want to be the bitch that wards people off here, but we 
> better obey some kind of rules. See http://lwn.net/Articles/195643/ why such 
> possibly minor thing might be an issue. There was very long thread about it 
> in 
> the LKML back in the day.

It was a good read. Thanks for pointing out that one.

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


Re: [U-Boot] [PATCH] fix IDE_BUS(dev) macro

2012-06-03 Thread Luka Perkov
Hi Tibor,

On Sun, Jun 03, 2012 at 05:03:13PM +0200, Vágó Tibor wrote:
> Hi,
> 
> I've tested this IDE patch on my NAS6220 and it works.
> 
> U-boot detect both HDD correctly and boot from them.

Thank you for testing.

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


Re: [U-Boot] [PATCH] fix IDE_BUS(dev) macro

2012-06-03 Thread Luka Perkov
Hi Rogan,

On Sun, Jun 03, 2012 at 10:23:15PM +0200, Rogan Dawes wrote:
> I had something similar for my DNS323 port (orion5x-based), which
> other people may be remembering.
> 
> http://lists.denx.de/pipermail/u-boot/2010-August/075589.html
> 
> I seem to recall Wolfgang was not terribly enthused about it for
> some reason, though.

I'm waiting for Albert to do testing on his boards. I was going to ping
him again about this one next week ;)

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


[U-Boot] [PATCH] MIPS: bootm.c: make checkpatch.pl clean

2012-06-03 Thread Daniel Schwierzeck
Signed-off-by: Daniel Schwierzeck 
---
 arch/mips/lib/bootm.c |  102 -
 1 file changed, 51 insertions(+), 51 deletions(-)

diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
index 9930abf..608c1a7 100644
--- a/arch/mips/lib/bootm.c
+++ b/arch/mips/lib/bootm.c
@@ -33,22 +33,23 @@ DECLARE_GLOBAL_DATA_PTR;
 #defineLINUX_MAX_ENVS  256
 #defineLINUX_MAX_ARGS  256
 
-static int linux_argc;
-static char ** linux_argv;
+static int linux_argc;
+static char **linux_argv;
 
-static char ** linux_env;
-static char *  linux_env_p;
-static int linux_env_idx;
+static char **linux_env;
+static char *linux_env_p;
+static int linux_env_idx;
 
-static void linux_params_init (ulong start, char * commandline);
-static void linux_env_set (char * env_name, char * env_val);
+static void linux_params_init(ulong start, char *commandline);
+static void linux_env_set(char *env_name, char *env_val);
 
-int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t 
*images)
+int do_bootm_linux(int flag, int argc, char * const argv[],
+   bootm_headers_t *images)
 {
-   void(*theKernel) (int, char **, char **, int *);
-   char*commandline = getenv ("bootargs");
-   charenv_buf[12];
-   char*cp;
+   void (*theKernel) (int, char **, char **, int *);
+   char *commandline = getenv("bootargs");
+   char env_buf[12];
+   char *cp;
 
if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
return 1;
@@ -59,53 +60,53 @@ int do_bootm_linux(int flag, int argc, char * const argv[], 
bootm_headers_t *ima
bootstage_mark(BOOTSTAGE_ID_RUN_OS);
 
 #ifdef DEBUG
-   printf ("## Transferring control to Linux (at address %08lx) ...\n",
+   printf("## Transferring control to Linux (at address %08lx) ...\n",
(ulong) theKernel);
 #endif
 
-   linux_params_init (UNCACHED_SDRAM (gd->bd->bi_boot_params), 
commandline);
+   linux_params_init(UNCACHED_SDRAM(gd->bd->bi_boot_params), commandline);
 
 #ifdef CONFIG_MEMSIZE_IN_BYTES
-   sprintf (env_buf, "%lu", (ulong)gd->ram_size);
-   debug ("## Giving linux memsize in bytes, %lu\n", (ulong)gd->ram_size);
+   sprintf(env_buf, "%lu", (ulong)gd->ram_size);
+   debug("## Giving linux memsize in bytes, %lu\n", (ulong)gd->ram_size);
 #else
-   sprintf (env_buf, "%lu", (ulong)(gd->ram_size >> 20));
-   debug ("## Giving linux memsize in MB, %lu\n", (ulong)(gd->ram_size >> 
20));
+   sprintf(env_buf, "%lu", (ulong)(gd->ram_size >> 20));
+   debug("## Giving linux memsize in MB, %lu\n",
+   (ulong)(gd->ram_size >> 20));
 #endif /* CONFIG_MEMSIZE_IN_BYTES */
 
-   linux_env_set ("memsize", env_buf);
+   linux_env_set("memsize", env_buf);
 
-   sprintf (env_buf, "0x%08X", (uint) UNCACHED_SDRAM (images->rd_start));
-   linux_env_set ("initrd_start", env_buf);
+   sprintf(env_buf, "0x%08X", (uint) UNCACHED_SDRAM(images->rd_start));
+   linux_env_set("initrd_start", env_buf);
 
-   sprintf (env_buf, "0x%X", (uint) (images->rd_end - images->rd_start));
-   linux_env_set ("initrd_size", env_buf);
+   sprintf(env_buf, "0x%X", (uint) (images->rd_end - images->rd_start));
+   linux_env_set("initrd_size", env_buf);
 
-   sprintf (env_buf, "0x%08X", (uint) (gd->bd->bi_flashstart));
-   linux_env_set ("flash_start", env_buf);
+   sprintf(env_buf, "0x%08X", (uint) (gd->bd->bi_flashstart));
+   linux_env_set("flash_start", env_buf);
 
-   sprintf (env_buf, "0x%X", (uint) (gd->bd->bi_flashsize));
-   linux_env_set ("flash_size", env_buf);
+   sprintf(env_buf, "0x%X", (uint) (gd->bd->bi_flashsize));
+   linux_env_set("flash_size", env_buf);
 
cp = getenv("ethaddr");
-   if (cp != NULL) {
+   if (cp)
linux_env_set("ethaddr", cp);
-   }
 
cp = getenv("eth1addr");
-   if (cp != NULL) {
+   if (cp)
linux_env_set("eth1addr", cp);
-   }
 
/* we assume that the kernel is in place */
-   printf ("\nStarting kernel ...\n\n");
+   printf("\nStarting kernel ...\n\n");
+
+   theKernel(linux_argc, linux_argv, linux_env, 0);
 
-   theKernel (linux_argc, linux_argv, linux_env, 0);
/* does not return */
return 1;
 }
 
-static void linux_params_init (ulong start, char *line)
+static void linux_params_init(ulong start, char *line)
 {
char *next, *quote, *argp;
 
@@ -117,26 +118,25 @@ static void linux_params_init (ulong start, char *line)
next = line;
 
while (line && *line && linux_argc < LINUX_MAX_ARGS) {
-   quote = strchr (line, '"');
-   next = strchr (line, ' ');
+   quote = strchr(line, '"');
+   next = strchr(line, ' ');
 
-   while (next != NULL && quote != NULL && quote < next) {
+   while (next && qu

[U-Boot] [PATCH] MIPS: bootm_qemu_mips.c: make checkpatch.pl clean

2012-06-03 Thread Daniel Schwierzeck
Signed-off-by: Daniel Schwierzeck 
---
 arch/mips/lib/bootm_qemu_mips.c |   26 ++
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/arch/mips/lib/bootm_qemu_mips.c b/arch/mips/lib/bootm_qemu_mips.c
index bb6442a..0815c9c 100644
--- a/arch/mips/lib/bootm_qemu_mips.c
+++ b/arch/mips/lib/bootm_qemu_mips.c
@@ -29,30 +29,31 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t 
*images)
+int do_bootm_linux(int flag, int argc, char * const argv[],
+   bootm_headers_t *images)
 {
-   void(*theKernel) (int, char **, char **, int *);
-   char*bootargs = getenv ("bootargs");
-   char*start;
-   uintlen;
+   void (*theKernel) (int, char **, char **, int *);
+   char *bootargs = getenv("bootargs");
+   char *start;
+   uint len;
 
/* find kernel entry point */
theKernel = (void (*)(int, char **, char **, int *))images->ep;
 
bootstage_mark(BOOTSTAGE_ID_RUN_OS);
 
-   debug ("## Transferring control to Linux (at address %08lx) ...\n",
+   debug("## Transferring control to Linux (at address %08lx) ...\n",
(ulong) theKernel);
 
gd->bd->bi_boot_params = gd->bd->bi_memstart + (16 << 20) - 256;
-   debug ("%-12s= 0x%08lX\n", "boot_params", 
(ulong)gd->bd->bi_boot_params);
+   debug("%-12s= 0x%08lX\n", "boot_params", (ulong)gd->bd->bi_boot_params);
 
/* set Magic */
*(int32_t *)(gd->bd->bi_boot_params - 4) = 0x12345678;
/* set ram_size */
*(int32_t *)(gd->bd->bi_boot_params - 8) = gd->ram_size;
 
-   start = (char*)gd->bd->bi_boot_params;
+   start = (char *)gd->bd->bi_boot_params;
 
len = strlen(bootargs);
 
@@ -62,15 +63,16 @@ int do_bootm_linux(int flag, int argc, char * const argv[], 
bootm_headers_t *ima
 
len = images->rd_end - images->rd_start;
if (len > 0) {
-   start += sprintf(start," rd_start=0x%08X rd_size=0x%0X",
-   (uint) UNCACHED_SDRAM (images->rd_start),
+   start += sprintf(start, " rd_start=0x%08X rd_size=0x%0X",
+   (uint) UNCACHED_SDRAM(images->rd_start),
(uint) len);
}
 
/* we assume that the kernel is in place */
-   printf ("\nStarting kernel ...\n\n");
+   printf("\nStarting kernel ...\n\n");
+
+   theKernel(0, NULL, NULL, 0);
 
-   theKernel (0, NULL, NULL, 0);
/* does not return */
return 1;
 }
-- 
1.7.10

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


[U-Boot] [PATCH] MIPS: board.c: move extern declarations to u-boot-mips.h

2012-06-03 Thread Daniel Schwierzeck
This fixes some remaining checkpatch.pl warnings.

Signed-off-by: Daniel Schwierzeck 
---
 arch/mips/include/asm/u-boot-mips.h |   11 +++
 arch/mips/lib/board.c   |7 ---
 include/common.h|3 +++
 3 files changed, 14 insertions(+), 7 deletions(-)
 create mode 100644 arch/mips/include/asm/u-boot-mips.h

diff --git a/arch/mips/include/asm/u-boot-mips.h 
b/arch/mips/include/asm/u-boot-mips.h
new file mode 100644
index 000..6f26dfa
--- /dev/null
+++ b/arch/mips/include/asm/u-boot-mips.h
@@ -0,0 +1,11 @@
+/*
+ * This file is released under the terms of GPL v2 and any later version.
+ * See the file COPYING in the root directory of the source tree for details.
+ *
+ * Copyright (C) 2003 Wolfgang Denk, DENX Software Engineering, w...@denx.de
+ */
+
+extern ulong uboot_end_data;
+extern ulong uboot_end;
+
+extern int incaip_set_cpuclk(void);
diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
index 59a8001..62d47a8 100644
--- a/arch/mips/lib/board.c
+++ b/arch/mips/lib/board.c
@@ -38,13 +38,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-extern int timer_init(void);
-
-extern int incaip_set_cpuclk(void);
-
-extern ulong uboot_end_data;
-extern ulong uboot_end;
-
 ulong monitor_flash_len;
 
 static char *failed = "*** failed ***\n";
diff --git a/include/common.h b/include/common.h
index 8564a65..ecfa6c4 100644
--- a/include/common.h
+++ b/include/common.h
@@ -355,6 +355,9 @@ int setenv_addr(const char *varname, const void *addr);
 # include 
 # include 
 #endif /* CONFIG_NDS32 */
+#ifdef CONFIG_MIPS
+# include 
+#endif /* CONFIG_MIPS */
 
 #ifdef CONFIG_AUTO_COMPLETE
 int env_complete(char *var, int maxv, char *cmdv[], int maxsz, char *buf);
-- 
1.7.10

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


[U-Boot] [GIT PULL] u-boot-mips/master

2012-06-03 Thread Daniel Schwierzeck
Dear Wolfgang,

please pull some checkpatch.pl cleanups for MIPS.

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-mips.git master

for you to fetch changes up to e034ea3b77baf90ab8dde2c1beeb22704b01fb2d:

  MIPS: board.c: move extern declarations to u-boot-mips.h (2012-06-03 23:46:04 
+0200)


Daniel Schwierzeck (3):
  MIPS: bootm.c: make checkpatch.pl clean
  MIPS: bootm_qemu_mips.c: make checkpatch.pl clean
  MIPS: board.c: move extern declarations to u-boot-mips.h

 arch/mips/include/asm/u-boot-mips.h |   11 
 arch/mips/lib/board.c   |7 ---
 arch/mips/lib/bootm.c   |  102 +--
 arch/mips/lib/bootm_qemu_mips.c |   26 -
 include/common.h|3 ++
 5 files changed, 79 insertions(+), 70 deletions(-)
 create mode 100644 arch/mips/include/asm/u-boot-mips.h
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] malloc: remove extern declarations of malloc_bin_reloc() in board.c files

2012-06-03 Thread Daniel Schwierzeck
Declare malloc_bin_reloc() in malloc.h and remove all extern declarations
in various board.c files to get rid of one checkpatch.pl warning.

Signed-off-by: Daniel Schwierzeck 
Cc: Wolfgang Denk 
Cc: Andreas Bießmann 
Cc: Jason Jin 
Cc: Macpaul Lin 
Cc: Daniel Hellstrom 
---
 arch/avr32/lib/board.c |1 -
 arch/m68k/lib/board.c  |1 -
 arch/mips/lib/board.c  |1 -
 arch/nds32/lib/board.c |2 --
 arch/sparc/lib/board.c |1 -
 include/malloc.h   |1 +
 6 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c
index b390a6c..676f358 100644
--- a/arch/avr32/lib/board.c
+++ b/arch/avr32/lib/board.c
@@ -250,7 +250,6 @@ void board_init_f(ulong board_type)
 
 void board_init_r(gd_t *new_gd, ulong dest_addr)
 {
-   extern void malloc_bin_reloc (void);
 #ifndef CONFIG_ENV_IS_NOWHERE
extern char * env_name_spec;
 #endif
diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c
index 65a8595..2add630 100644
--- a/arch/m68k/lib/board.c
+++ b/arch/m68k/lib/board.c
@@ -389,7 +389,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
 {
char *s;
bd_t *bd;
-   extern void malloc_bin_reloc (void);
 
 #ifndef CONFIG_ENV_IS_NOWHERE
extern char * env_name_spec;
diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
index 59a8001..6a71a6b 100644
--- a/arch/mips/lib/board.c
+++ b/arch/mips/lib/board.c
@@ -255,7 +255,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 #ifndef CONFIG_SYS_NO_FLASH
ulong size;
 #endif
-   extern void malloc_bin_reloc(void);
 #ifndef CONFIG_ENV_IS_NOWHERE
extern char *env_name_spec;
 #endif
diff --git a/arch/nds32/lib/board.c b/arch/nds32/lib/board.c
index 7121313..d834975 100644
--- a/arch/nds32/lib/board.c
+++ b/arch/nds32/lib/board.c
@@ -305,8 +305,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
bd_t *bd;
ulong malloc_start;
 
-   extern void malloc_bin_reloc(void);
-
gd = id;
bd = gd->bd;
 
diff --git a/arch/sparc/lib/board.c b/arch/sparc/lib/board.c
index 7e48775..b836cf5 100644
--- a/arch/sparc/lib/board.c
+++ b/arch/sparc/lib/board.c
@@ -62,7 +62,6 @@ DECLARE_GLOBAL_DATA_PTR;
 */
 
 extern void timer_interrupt_init(void);
-extern void malloc_bin_reloc(void);
 extern int do_ambapp_print(cmd_tbl_t * cmdtp, int flag, int argc, char * const 
argv[]);
 extern int prom_init(void);
 
diff --git a/include/malloc.h b/include/malloc.h
index ecf3c67..6543f4a 100644
--- a/include/malloc.h
+++ b/include/malloc.h
@@ -937,6 +937,7 @@ extern ulong mem_malloc_end;
 extern ulong mem_malloc_brk;
 
 void mem_malloc_init(ulong start, ulong size);
+void malloc_bin_reloc(void);
 
 #ifdef __cplusplus
 };  /* end of extern "C" */
-- 
1.7.10

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


[U-Boot] [PATCH] mmc: fix wrong timeout check in mmc_send_status()

2012-06-03 Thread Jongman Heo
(!timeout) condition check in mmc_send_status() can never be met,
because do-while loop ends up with negative timeout value, -1.

Fix it by using pre-decrement.

Signed-off-by: Jongman Heo 
---
 drivers/mmc/mmc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index aebe578..de19d4e 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -232,7 +232,7 @@ int mmc_send_status(struct mmc *mmc, int timeout)

udelay(1000);

-   } while (timeout--);
+   } while (--timeout);

 #ifdef CONFIG_MMC_TRACE
status = (cmd.response[0] & MMC_STATUS_CURR_STATE) >> 9;
-- 
1.7.7.6
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 4/7] tegra: Allow boards to perform early GPIO setup

2012-06-03 Thread Thierry Reding
* Tom Warren wrote:
> Thierry,
> 
> > -Original Message-
> > From: Thierry Reding [mailto:thierry.red...@avionic-design.de]
> > Sent: Friday, May 25, 2012 11:00 AM
> > To: Stephen Warren
> > Cc: u-boot@lists.denx.de; Tom Warren; Simon Glass
> > Subject: Re: [PATCH v2 4/7] tegra: Allow boards to perform early GPIO setup
> > 
> > * PGP Signed by an unknown key
> > 
> > * Thierry Reding wrote:
> > > Furthermore I'll need to rebase the patches onto the Tegra branch due
> > > to the major restructuring of the configuration files.
> > 
> > This isn't true. But I'll still have to respin because of the MAINTAINERS
> > entry and the other points that you brought up, so let me know if I should
> > add a patch for Seaboard.
> When you respin this, make sure to base it on current u-boot-tegra/master,
> and change any CONFIG_TEGRA2_MMC or _SPI references to CONFIG_TEGRA_MMC &
> _SPI (see my changes to rename tegra periph drivers for the upcoming Tegra3
> rearch).

I saw that you already carry a patch in your next branch that does the
renames in the tec.h configuration. Can I assume that when I respin with
those changes included in the patch that introduces TEC support you'll drop
that hunk from your patch? Or should I rather follow up with patches based on
your next branch?

Thierry


pgpeUW0ETMpbb.pgp
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mmc: fix wrong timeout check in mmc_send_status()

2012-06-03 Thread Graeme Russ
Hi Jongman,

On Mon, Jun 4, 2012 at 3:32 PM, Jongman Heo  wrote:
> (!timeout) condition check in mmc_send_status() can never be met,
> because do-while loop ends up with negative timeout value, -1.
>
> Fix it by using pre-decrement.
>
> Signed-off-by: Jongman Heo 
> ---
>  drivers/mmc/mmc.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index aebe578..de19d4e 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -232,7 +232,7 @@ int mmc_send_status(struct mmc *mmc, int timeout)
>
>                udelay(1000);
>
> -       } while (timeout--);
> +       } while (--timeout);
>
>  #ifdef CONFIG_MMC_TRACE
>        status = (cmd.response[0] & MMC_STATUS_CURR_STATE) >> 9;

Changing if (!timeout) to if(timeout <=0) would be more consistent
with other usage in mmc.c

Regards,

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