Re: [U-Boot] [PATCH] arm/km: change default settings for egiga on mgcoge3un

2011-04-08 Thread Prafulla Wadaskar


> -Original Message-
> From: Valentin Longchamp [mailto:valentin.longch...@keymile.com]
> Sent: Friday, April 08, 2011 6:18 PM
> To: u-boot@lists.denx.de
> Cc: holger.bru...@keymile.com; h...@denx.de; Wolfgang Denk; Detlev Zundel;
> Prafulla Wadaskar; Valentin Longchamp
> Subject: [PATCH] arm/km: change default settings for egiga on mgcoge3un
> 
> From: Holger Brunck 
> 
> The reason we need this is that we have the gig port on mgcoge3un
> connected using a back-to-back pair of PHYs. There are no magnetics and
> because of that the port has to be run with a fixd configuration and
> auto-negotiation must be disabled. In the default mode the egiga driver
> uses autoneg to determine port speed - which defaults to 1G (we need
> 100M full duplex).
> 
> Signed-off-by: Holger Brunck 
> Acked-by: Heiko Schocher 
> cc: Wolfgang Denk 
> cc: Detlev Zundel 
> cc: Prafulla Wadaskar 
> cc: Valentin Longchamp 
> Signed-off-by: Valentin Longchamp 
> ---
>  drivers/net/mvgbe.h |2 ++
>  include/configs/mgcoge3un.h |   25 +
>  2 files changed, 27 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/mvgbe.h b/drivers/net/mvgbe.h
> index 3de98d0..d8a5429 100644
> --- a/drivers/net/mvgbe.h
> +++ b/drivers/net/mvgbe.h
> @@ -84,6 +84,7 @@
>   MVGBE_TX_BURST_SIZE_16_64BIT)
> 
>  /* Default port serial control value */
> +#ifndef PORT_SERIAL_CONTROL_VALUE
>  #define PORT_SERIAL_CONTROL_VALUE( \
>   MVGBE_FORCE_LINK_PASS   | \
>   MVGBE_DIS_AUTO_NEG_FOR_DUPLX| \
> @@ -101,6 +102,7 @@
>   MVGBE_CLR_EXT_LOOPBACK  | \
>   MVGBE_SET_FULL_DUPLEX_MODE  | \
>   MVGBE_DIS_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX)
> +#endif
> 
>  /* Tx WRR confoguration macros */
>  #define PORT_MAX_TRAN_UNIT   0x24/* MTU register (default) 9KByte */
> diff --git a/include/configs/mgcoge3un.h b/include/configs/mgcoge3un.h
> index da5935b..c7f9056 100644
> --- a/include/configs/mgcoge3un.h
> +++ b/include/configs/mgcoge3un.h
> @@ -48,6 +48,31 @@
>  #define KM_ENV_BUS   "pca9547:70:d" /* I2C2 (Mux-Port 5)*/
> 
>  /*
> + * mgcoge3un has a fixed link to the marvell switch
> + * with 100MB full duplex and autoneg off, for this
> + * reason we have to change the default settings
> + */
> +#define PORT_SERIAL_CONTROL_VALUE( \
> + MVGBE_FORCE_LINK_PASS   | \
> + MVGBE_DIS_AUTO_NEG_FOR_DUPLX| \
> + MVGBE_DIS_AUTO_NEG_FOR_FLOW_CTRL| \
> + MVGBE_ADV_NO_FLOW_CTRL  | \
> + MVGBE_FORCE_FC_MODE_NO_PAUSE_DIS_TX | \
> + MVGBE_FORCE_BP_MODE_NO_JAM  | \
> + (1 << 9) /* Reserved bit has to be 1 */ | \
> + MVGBE_DO_NOT_FORCE_LINK_FAIL| \
> + MVGBE_DIS_AUTO_NEG_SPEED_GMII   | \
> + MVGBE_DTE_ADV_0 | \
> + MVGBE_MIIPHY_MAC_MODE   | \
> + MVGBE_AUTO_NEG_NO_CHANGE| \
> + MVGBE_MAX_RX_PACKET_1552BYTE| \
> + MVGBE_CLR_EXT_LOOPBACK  | \
> + MVGBE_SET_FULL_DUPLEX_MODE  | \
> + MVGBE_DIS_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX|\
> + MVGBE_SET_GMII_SPEED_TO_10_100  |\
> + MVGBE_SET_MII_SPEED_TO_100)
> +
> +/*
>   * Default environment variables
>   */
>  #define CONFIG_EXTRA_ENV_SETTINGS

Acked-by: Prafulla Wadaskar 

Regards..
Prafulla . .

\
> --
> 1.7.0.5

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


Re: [U-Boot] u-boot and 2nd level usb hub

2011-04-08 Thread Kallol Biswas
I was wrong. The problem is somewhere else. Something is wrong with
our embedded board.

On Thu, Apr 7, 2011 at 11:28 PM, Kallol Biswas  wrote:
> Hi,
>     We have a system with a 2nd level USB hub. It seems that uboot
> does not discover devices beyond 1st level hub.
>
> If this is true, is there any patch that will discover devices behind
> multiple levels of hub?
>
> The linux kernel is able to detect and configure devices that are
> behind 2nd level hub.
>
> Kallol
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Blackfin: cmd_gpio: allow port pins over 15

2011-04-08 Thread Mike Frysinger
this is obsoleted by my recent patch:
[U-Boot] [PATCH] gpio: generalize for all generic gpio providers
-mike


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


Re: [U-Boot] [RFC] mpc83xx: add config options to spd_sdram

2011-04-08 Thread Andre Schwarz
On 04/08/2011 06:36 PM, York Sun wrote:
> On Fri, 2011-04-08 at 18:29 +0200, Andre Schwarz wrote:
>> York,
>>> On Fri, 2011-04-08 at 09:41 +0200, Andre Schwarz wrote:
> I am sorry I totally ignored the subject with mpc83xx. I was thinking of
> mpc85xx.
 ok - no "new" code for 83xx then.
> You are right the old code is in spd_sdram.c and it is still in use for
> mpc83xx. Unless to adjust the code, there is no board specific file.
>
 Are you willing to accept some changes to spd_sdram.c or will I have
 another out-of-tree board  ?

 What we need is :

 - more configurable settings like driver strength, cpo and odt values.
 - Reading SPD data from an arbitrary i2c eeprom.

 What's so bad about my proposal ?
 Please let me know so that I'm able to improve.

>>> I welcome the change to use the new code since the feature you asked is
>>> already there.
>> sorry, but I'm not sure if I understand this correctly.
>>
>> What I need is some minor non-intrusive changes to 83xx-specific file
>> spd_sdram.c because it is the most straightforward solution with *no*
>> impact on code size or other existing boards. So: The feature I ask for
>> is *not* already there.
>>
>> What I definitely won't do is use the "new" fsl ddr code in mpc8xxx/ddr
>> because it completely lacks 83xx support.
>> So: The feature I ask for is there but my CPU family is not supported.
>> IMHO the "new" code is total overkill for 83xx.
>>
> It would be easier to maintain one set of code. But if the change you
> need is relatively small to the old code and doesn't have negative
> impact on other boards, go ahead to post the patch.
yes - that's what I've been asking for.
So far Kim's NAK is still valid - let's see what his favorite solution 
will look like.

Thank you for sharing your thoughts.


Regards,
André

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


Re: [U-Boot] [RFC] mpc83xx: add config options to spd_sdram

2011-04-08 Thread York Sun
On Fri, 2011-04-08 at 18:29 +0200, Andre Schwarz wrote:
> York,
> > On Fri, 2011-04-08 at 09:41 +0200, Andre Schwarz wrote:
> >>> I am sorry I totally ignored the subject with mpc83xx. I was thinking of
> >>> mpc85xx.
> >> ok - no "new" code for 83xx then.
> >>> You are right the old code is in spd_sdram.c and it is still in use for
> >>> mpc83xx. Unless to adjust the code, there is no board specific file.
> >>>
> >> Are you willing to accept some changes to spd_sdram.c or will I have
> >> another out-of-tree board  ?
> >>
> >> What we need is :
> >>
> >> - more configurable settings like driver strength, cpo and odt values.
> >> - Reading SPD data from an arbitrary i2c eeprom.
> >>
> >> What's so bad about my proposal ?
> >> Please let me know so that I'm able to improve.
> >>
> > I welcome the change to use the new code since the feature you asked is
> > already there.
> sorry, but I'm not sure if I understand this correctly.
> 
> What I need is some minor non-intrusive changes to 83xx-specific file 
> spd_sdram.c because it is the most straightforward solution with *no* 
> impact on code size or other existing boards. So: The feature I ask for 
> is *not* already there.
> 
> What I definitely won't do is use the "new" fsl ddr code in mpc8xxx/ddr 
> because it completely lacks 83xx support.
> So: The feature I ask for is there but my CPU family is not supported.
> IMHO the "new" code is total overkill for 83xx.
> 

It would be easier to maintain one set of code. But if the change you
need is relatively small to the old code and doesn't have negative
impact on other boards, go ahead to post the patch.

York



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


Re: [U-Boot] [RFC] mpc83xx: add config options to spd_sdram

2011-04-08 Thread Andre Schwarz
York,
> On Fri, 2011-04-08 at 09:41 +0200, Andre Schwarz wrote:
>>> I am sorry I totally ignored the subject with mpc83xx. I was thinking of
>>> mpc85xx.
>> ok - no "new" code for 83xx then.
>>> You are right the old code is in spd_sdram.c and it is still in use for
>>> mpc83xx. Unless to adjust the code, there is no board specific file.
>>>
>> Are you willing to accept some changes to spd_sdram.c or will I have
>> another out-of-tree board  ?
>>
>> What we need is :
>>
>> - more configurable settings like driver strength, cpo and odt values.
>> - Reading SPD data from an arbitrary i2c eeprom.
>>
>> What's so bad about my proposal ?
>> Please let me know so that I'm able to improve.
>>
> I welcome the change to use the new code since the feature you asked is
> already there.
sorry, but I'm not sure if I understand this correctly.

What I need is some minor non-intrusive changes to 83xx-specific file 
spd_sdram.c because it is the most straightforward solution with *no* 
impact on code size or other existing boards. So: The feature I ask for 
is *not* already there.

What I definitely won't do is use the "new" fsl ddr code in mpc8xxx/ddr 
because it completely lacks 83xx support.
So: The feature I ask for is there but my CPU family is not supported.
IMHO the "new" code is total overkill for 83xx.



Cheers,
André

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


Re: [U-Boot] [RFC] mpc83xx: add config options to spd_sdram

2011-04-08 Thread York Sun
On Fri, 2011-04-08 at 09:41 +0200, Andre Schwarz wrote:
> > I am sorry I totally ignored the subject with mpc83xx. I was thinking of
> > mpc85xx.
> ok - no "new" code for 83xx then.
> > You are right the old code is in spd_sdram.c and it is still in use for
> > mpc83xx. Unless to adjust the code, there is no board specific file.
> >
> Are you willing to accept some changes to spd_sdram.c or will I have 
> another out-of-tree board  ?
> 
> What we need is :
> 
> - more configurable settings like driver strength, cpo and odt values.
> - Reading SPD data from an arbitrary i2c eeprom.
> 
> What's so bad about my proposal ?
> Please let me know so that I'm able to improve.
> 

I welcome the change to use the new code since the feature you asked is
already there.

York



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


[U-Boot] [PATCH 23/30] km/common: replace env var checkboardidlist by function

2011-04-08 Thread Valentin Longchamp
From: Thomas Herzmann 

The environment variable (defining a checkboardidlist function)
has been replaced by a u-boot function call. This call is much
faster and the environment is a leaner.

Signed-off-by: Thomas Herzmann 
Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 board/keymile/common/common.c|  112 ++
 include/configs/keymile-common.h |   30 +--
 2 files changed, 113 insertions(+), 29 deletions(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 5704b7f..72278a0 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
 #include 
@@ -714,3 +715,114 @@ static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int 
argc,
 U_BOOT_CMD(km_setboardid, 1, 0, do_setboardid, "setboardid", "read out bid and 
"
 "hwkey from IVM and set in environment");
 
+/*
+ * command km_checkboardidlist
+ * if "boardid" and "hwkey" are not already set in the environment, do:
+ * if a "boardIdListHex" exists in the environment:
+ * - read ivm data for boardid and hwkey
+ * - compare each entry of the boardIdListHex with the
+ * IVM data:
+ * if match:
+ * set environment variables boardid, boardId,
+ * hwkey, hwKey to the found values
+ * both (boardid and boardId) are set because
+ * they might be used differently in the
+ * application and in the init scripts (?)
+ * return 0 in case of match, 1 if not match or error
+ */
+int do_checkboardidlist(cmd_tbl_t *cmdtp, int flag, int argc,
+   char *const argv[])
+{
+   unsigned long ivmbid = 0, ivmhwkey = 0;
+   unsigned long envbid = 0, envhwkey = 0;
+   char *p;
+   int verbose = argc > 1 && *argv[1] == 'v';
+   int rc = 1; /* default: no match */
+
+   p = get_local_var("IVM_BoardId");
+   strict_strtoul(p, 16, &ivmbid);
+   p = get_local_var("IVM_HWKey");
+   strict_strtoul(p, 16, &ivmhwkey);
+
+   if (!ivmbid || !ivmhwkey) {
+   printf("Error: IVM_BoardId and/or IVM_HWKey not set!\n");
+   return rc;
+   }
+
+   /* try to read values from environment */
+   p = getenv("boardid");
+   if (p != NULL)
+   strict_strtoul(p, 16, &envbid);
+   p = getenv("hwkey");
+   if (p != NULL)
+   strict_strtoul(p, 16, &envhwkey);
+
+   if (!envbid || !envhwkey) {
+   /* must set environment first */
+   char *bidhwklist = getenv("boardIdListHex");
+   if (bidhwklist) {
+   int found = 0;
+   char *rest = bidhwklist;
+   char *endp;
+   if (verbose) {
+   printf("IVM_BoardId: %ld, IVM_HWKey=%ld\n",
+   ivmbid, ivmhwkey);
+   printf("boardIdHwKeyList: %s\n",
+   bidhwklist);
+   }
+   while (!found) {
+   /* loop over each bid/hwkey pair in the list */
+   unsigned long bid   = 0;
+   unsigned long hwkey = 0;
+   while (*rest && !isxdigit(*rest))
+   rest++;
+   bid = simple_strtoul(rest, &endp, 16);
+   if (*endp == '_') {
+   rest  = endp + 1;
+   hwkey = simple_strtoul(rest, &endp, 16);
+   rest  = endp;
+   while (*rest && !isxdigit(*rest))
+   rest++;
+   }
+   if ((!bid) || (!hwkey)) {
+   /* end of list */
+   break;
+   }
+   if (verbose) {
+   printf("trying bid=0x%lX, hwkey=%ld\n",
+   bid, hwkey);
+   }
+   if ((bid == ivmbid) && (hwkey == ivmhwkey)) {
+   char buf[10];
+
+   found = 1;
+   envbid   = bid;
+   envhwkey

[U-Boot] [PATCH 27/30] km/common: simplify default environment

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

This is a first step to simplify the default environment. Move all
the environment variables which are only needed for debugging
purpose to textfiles in the scripts directory. In case of debugging
these files can be loaded via tftp into RAM and set via the env import
command. Other variables are identified as obsolete and were removed.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 board/keymile/scripts/README   |   25 ++
 board/keymile/scripts/debug-arm-env.txt|2 +
 board/keymile/scripts/debug-common-env.txt |9 ++
 board/keymile/scripts/debug-ppc-env.txt|2 +
 include/configs/km/keymile-common.h|  128 +++-
 include/configs/km/km-powerpc.h|   12 +--
 include/configs/km/km_arm.h|5 +-
 7 files changed, 57 insertions(+), 126 deletions(-)
 create mode 100644 board/keymile/scripts/README
 create mode 100644 board/keymile/scripts/debug-arm-env.txt
 create mode 100644 board/keymile/scripts/debug-common-env.txt
 create mode 100644 board/keymile/scripts/debug-ppc-env.txt

diff --git a/board/keymile/scripts/README b/board/keymile/scripts/README
new file mode 100644
index 000..ce6d79a
--- /dev/null
+++ b/board/keymile/scripts/README
@@ -0,0 +1,25 @@
+debug-common-env.txt
+
+This file defines environment variables which are valid for powerpc boards
+and for arm boards.
+
+addramfs: add phram device for the rootfilesysten in ram
+develop: for development, laod kernel via tftp and mount  rootfs via NFS
+nfsargs: default arguments for nfs boot
+ramfs: load rootfilesystem in RAM  kernel
+rootfsfile: loacation of the rootfs file for ramfs
+setramfspram: compute PRAM size for ramfs target
+setrootfsaddr: compute rootfilesystem address for phram
+tftpkernel: load a kernel with tftp into ram
+tftpramfs: load rootfs with tftp into ram
+
+debug-ppc-env.txt
+
+fdt_file: location of the dtb file on the tftp server
+tftpfdt: load dtb file and set fdt address
+
+debug-arm-env.txt
+
+tftpfdt: for arm only a dummy variable, because we have no fdt on arm
+
+
diff --git a/board/keymile/scripts/debug-arm-env.txt 
b/board/keymile/scripts/debug-arm-env.txt
new file mode 100644
index 000..84498af
--- /dev/null
+++ b/board/keymile/scripts/debug-arm-env.txt
@@ -0,0 +1,2 @@
+debug_env_common=tftpboot 0x20 scripts/debug-common-env.txt && env import 
-t 0x20 ${filesize}
+tftpfdt=true
diff --git a/board/keymile/scripts/debug-common-env.txt 
b/board/keymile/scripts/debug-common-env.txt
new file mode 100644
index 000..1fd4b0c
--- /dev/null
+++ b/board/keymile/scripts/debug-common-env.txt
@@ -0,0 +1,9 @@
+addramfs=setenv bootargs "${bootargs} 
phram.phram=rootfs${boot_bank},${rootfsaddr},${rootfssize}"
+develop=setenv subbootcmds "tftpfdt tftpkernel nfsargs ${commonargs} boot " && 
setenv bootcmd 'run bootrunner' && setenv altbootcmd 'run bootcmd' && 
km_setboardid && saveenv && reset
+nfsargs=setenv bootargs ubi.mtd=ubi0 root=/dev/nfs rw 
nfsroot=${serverip}:${rootpath}
+ramfs=setenv actual_bank -1 && setenv subbootcmds "tftpfdt tftpkernel 
setrootfsaddr tftpramfs flashargs ${commonargs} addpanic addramfs boot " && 
setenv bootcmd 'run bootrunner' && setenv altbootcmd 'run bootcmd' && run 
setboardid && run setramfspram && run setpnvramaddr && saveenv && reset
+rootfsfile=${hostname}/rootfsImage
+setramfspram=setexpr value 0 + ${reservedpram} && setexpr value 0x${value} + 
${rootfssize} && setexpr value 0x${value} + ${varsize} && setexpr value 
0x${value} + ${pnvramsize} && setexpr value 0x${value} / 0x400 && setenv pram 
0x${value}
+tftpkernel=tftpboot ${kernel_addr_r} ${hostname}/uImage && setenv 
actual_kernel_addr ${kernel_addr_r}
+tftpramfs=tftpboot ${rootfsaddr} ${hostname}/rootfsImage && setenv loadaddr
+setrootfsaddr=setexpr value ${pnvramsize} - ${rootfssize} && setenv rootfsaddr 
0x${value}
diff --git a/board/keymile/scripts/debug-ppc-env.txt 
b/board/keymile/scripts/debug-ppc-env.txt
new file mode 100644
index 000..3c06ff1
--- /dev/null
+++ b/board/keymile/scripts/debug-ppc-env.txt
@@ -0,0 +1,2 @@
+debug_env_common=tftpboot 0x20 scripts/debug-common-env.txt && env import 
-t 0x20 ${filesize}
+tftpfdt=tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb && setenv 
actual_fdt_addr ${fdt_addr_r}
diff --git a/include/configs/km/keymile-common.h 
b/include/configs/km/keymile-common.h
index b313b2e..89f2d14 100644
--- a/include/configs/km/keymile-common.h
+++ b/include/configs/km/keymile-common.h
@@ -171,13 +171,8 @@
"break=0; " \
"for subbootcmd in ${subbootcmds}; do " \
"if test ${break} -eq 0; then; "\
-   "echo \"[INFO] running \\c\"; " 

[U-Boot] [PATCH 24/30] km/common: add pnvramsize to default environment

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

The pnvram size was used later from start scripts in linux. Therefore
it must be set inside u-boot.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 board/keymile/common/common.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 72278a0..da73f66 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -100,6 +100,9 @@ int set_km_env(void)
sprintf((char *)buf, "0x%x", pnvramaddr);
setenv("pnvramaddr", (char *)buf);
 
+   sprintf((char *)buf, "0x%x", CONFIG_KM_PNVRAM);
+   setenv("pnvramsize", (char *)buf);
+
pram = (CONFIG_KM_RESERVED_PRAM + CONFIG_KM_PHRAM + CONFIG_KM_PNVRAM) /
0x400;
sprintf((char *)buf, "0x%x", pram);
-- 
1.7.0.5

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


[U-Boot] [PATCH 22/30] km/common: implement setboardid as a command

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

Read out board id and HW key from the IVM eeprom and set
these values as an environment variable was now done inside the
code as a command.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 board/keymile/common/common.c |   25 +
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 9ec0022..5704b7f 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -25,6 +25,7 @@
 #if defined(CONFIG_KM82XX)
 #include 
 #endif
+#include 
 #include 
 #include 
 #include 
@@ -689,3 +690,27 @@ int board_eth_init(bd_t *bis)
 
return -1;
 }
+
+/*
+ * do_setboardid command
+ * read out the board id and the hw key from the intventory EEPROM and set
+ * this values as environment variables.
+ */
+static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int argc,
+   char *const argv[])
+{
+   unsigned char buf[32];
+   char *p;
+
+   p = get_local_var("IVM_BoardId");
+   sprintf((char *)buf, "%s", p);
+   setenv("boardid", (char *)buf);
+   p = get_local_var("IVM_HWKey");
+   sprintf((char *)buf, "%s", p);
+   setenv("hwkey", (char *)buf);
+   return 0;
+}
+
+U_BOOT_CMD(km_setboardid, 1, 0, do_setboardid, "setboardid", "read out bid and 
"
+"hwkey from IVM and set in environment");
+
-- 
1.7.0.5

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


[U-Boot] [PATCH 30/30] arm/km: update mgcoge3un board support

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

Add wait for the GPIO line connected to mgcoge3ne before
starting mgcoge3un. A board specific ethernet present function
was added, because on this board ethernet is always present.
The BOCO FPGA access was enhanced and changed to use register
definitions.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Prafulla Wadaskar 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 board/keymile/km_arm/km_arm.c |   80 +---
 1 files changed, 66 insertions(+), 14 deletions(-)

diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c
index a64cdd8..0b4d75b 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -41,6 +41,16 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+/*
+ * BOCO FPGA definitions
+ */
+#define BOCO   0x10
+#define REG_CTRL_H 0x02
+#define MASK_WRL_UNITRUN   0x01
+#define MASK_RBX_PGY_PRESENT   0x40
+#define REG_IRQ_CIRQ2  0x2d
+#define MASK_RBI_DEFECT_16 0x01
+
 /* Multi-Purpose Pins Functionality configuration */
 u32 kwmpp_config[] = {
MPP0_NF_IO2,
@@ -102,43 +112,64 @@ u32 kwmpp_config[] = {
0
 };
 
+#if defined(CONFIG_MGCOGE3UN)
+/*
+ * Wait for startup OK from mgcoge3ne
+ */
+int startup_allowed(void)
+{
+   unsigned char buf;
+
+   /*
+* Read CIRQ16 bit (bit 0)
+*/
+   if (i2c_read(BOCO, REG_IRQ_CIRQ2, 1, &buf, 1) != 0)
+   printf("%s: Error reading Boco\n", __func__);
+   else
+   if ((buf & MASK_RBI_DEFECT_16) == MASK_RBI_DEFECT_16)
+   return 1;
+   return 0;
+}
+
+/*
+ * mgcoge3un has always ethernet present. Its connected to the 6061 switch
+ * and provides ICNev and piggy4 connections.
+ */
+int ethernet_present(void)
+{
+   return 1;
+}
+#else
 int ethernet_present(void)
 {
uchar   buf;
int ret = 0;
 
-   if (i2c_read(0x10, 2, 1, &buf, 1) != 0) {
+   if (i2c_read(BOCO, REG_CTRL_H, 1, &buf, 1) != 0) {
printf("%s: Error reading Boco\n", __func__);
return -1;
}
-   if ((buf & 0x40) == 0x40)
+   if ((buf & MASK_RBX_PGY_PRESENT) == MASK_RBX_PGY_PRESENT)
ret = 1;
 
return ret;
 }
+#endif
 
 int initialize_unit_leds(void)
 {
/*
-* init the unit LEDs
-* per default they all are
+* Init the unit LEDs per default they all are
 * ok apart from bootstat
-* LED connected through BOCO
-* BOCO lies at the address  0x10
-* LEDs are in the block CTRL_H (addr 0x02)
-* BOOTSTAT LED is the first 0x01
 */
-   #define BOCO0x10
-   #define CTRL_H  0x02
-   #define APPLEDMASK  0x01
uchar buf;
 
-   if (i2c_read(BOCO, CTRL_H, 1, &buf, 1) != 0) {
+   if (i2c_read(BOCO, REG_CTRL_H, 1, &buf, 1) != 0) {
printf("%s: Error reading Boco\n", __func__);
return -1;
}
-   buf |= APPLEDMASK;
-   if (i2c_write(BOCO, CTRL_H, 1, &buf, 1) != 0) {
+   buf |= MASK_WRL_UNITRUN;
+   if (i2c_write(BOCO, REG_CTRL_H, 1, &buf, 1) != 0) {
printf("%s: Error writing Boco\n", __func__);
return -1;
}
@@ -156,6 +187,27 @@ int misc_init_r(void)
printf("Overwriting MACH_TYPE with %d!!!\n", mach_type);
gd->bd->bi_arch_number = mach_type;
}
+#if defined(CONFIG_MGCOGE3UN)
+   char *wait_for_ne;
+   wait_for_ne = getenv("waitforne");
+   if (wait_for_ne != NULL) {
+   if (strcmp(wait_for_ne, "true") == 0) {
+   int cnt = 0;
+   puts("NE go: ");
+   while (startup_allowed() == 0) {
+   udelay(20);
+   cnt++;
+   if (cnt == 5)
+   puts("wait\b\b\b\b");
+   if (cnt == 10) {
+   cnt = 0;
+   puts("\b\b\b\b");
+   }
+   }
+   puts("OK\n");
+   }
+   }
+#endif
 
initialize_unit_leds();
set_km_env();
-- 
1.7.0.5

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


[U-Boot] [PATCH 29/30] arm/km: change default settings for egiga on mgcoge3un

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

The reason we need this is that we have the gig port on mgcoge3un
connected using a back-to-back pair of PHYs. There are no magnetics and
because of that the port has to be run with a fixd configuration and
auto-negotiation must be disabled. In the default mode the egiga driver
uses autoneg to determine port speed - which defaults to 1G (we need
100M full duplex).

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Prafulla Wadaskar 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 drivers/net/mvgbe.h |2 ++
 include/configs/mgcoge3un.h |   25 +
 2 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/drivers/net/mvgbe.h b/drivers/net/mvgbe.h
index 3de98d0..d8a5429 100644
--- a/drivers/net/mvgbe.h
+++ b/drivers/net/mvgbe.h
@@ -84,6 +84,7 @@
MVGBE_TX_BURST_SIZE_16_64BIT)
 
 /* Default port serial control value */
+#ifndef PORT_SERIAL_CONTROL_VALUE
 #define PORT_SERIAL_CONTROL_VALUE  ( \
MVGBE_FORCE_LINK_PASS   | \
MVGBE_DIS_AUTO_NEG_FOR_DUPLX| \
@@ -101,6 +102,7 @@
MVGBE_CLR_EXT_LOOPBACK  | \
MVGBE_SET_FULL_DUPLEX_MODE  | \
MVGBE_DIS_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX)
+#endif
 
 /* Tx WRR confoguration macros */
 #define PORT_MAX_TRAN_UNIT 0x24/* MTU register (default) 9KByte */
diff --git a/include/configs/mgcoge3un.h b/include/configs/mgcoge3un.h
index da5935b..c7f9056 100644
--- a/include/configs/mgcoge3un.h
+++ b/include/configs/mgcoge3un.h
@@ -48,6 +48,31 @@
 #define KM_ENV_BUS "pca9547:70:d" /* I2C2 (Mux-Port 5)*/
 
 /*
+ * mgcoge3un has a fixed link to the marvell switch
+ * with 100MB full duplex and autoneg off, for this
+ * reason we have to change the default settings
+ */
+#define PORT_SERIAL_CONTROL_VALUE  ( \
+   MVGBE_FORCE_LINK_PASS   | \
+   MVGBE_DIS_AUTO_NEG_FOR_DUPLX| \
+   MVGBE_DIS_AUTO_NEG_FOR_FLOW_CTRL| \
+   MVGBE_ADV_NO_FLOW_CTRL  | \
+   MVGBE_FORCE_FC_MODE_NO_PAUSE_DIS_TX | \
+   MVGBE_FORCE_BP_MODE_NO_JAM  | \
+   (1 << 9) /* Reserved bit has to be 1 */ | \
+   MVGBE_DO_NOT_FORCE_LINK_FAIL| \
+   MVGBE_DIS_AUTO_NEG_SPEED_GMII   | \
+   MVGBE_DTE_ADV_0 | \
+   MVGBE_MIIPHY_MAC_MODE   | \
+   MVGBE_AUTO_NEG_NO_CHANGE| \
+   MVGBE_MAX_RX_PACKET_1552BYTE| \
+   MVGBE_CLR_EXT_LOOPBACK  | \
+   MVGBE_SET_FULL_DUPLEX_MODE  | \
+   MVGBE_DIS_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX|\
+   MVGBE_SET_GMII_SPEED_TO_10_100  |\
+   MVGBE_SET_MII_SPEED_TO_100)
+
+/*
  * Default environment variables
  */
 #define CONFIG_EXTRA_ENV_SETTINGS  \
-- 
1.7.0.5

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


[U-Boot] [PATCH 03/30] km/common: remove hdlc_enet implementation

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

The hdlc implementation for mgcoge was initially developed,
but later on not used. Remove the C files, the references
in mgcoge.c and the Makefile to decrease maintenance effort.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 board/keymile/common/common.c|3 -
 board/keymile/common/common.h|4 -
 board/keymile/common/keymile_hdlc_enet.c |  620 --
 board/keymile/mgcoge/Makefile|3 +-
 board/keymile/mgcoge/mgcoge_hdlc_enet.c  |  276 -
 5 files changed, 1 insertions(+), 905 deletions(-)
 delete mode 100644 board/keymile/common/keymile_hdlc_enet.c
 delete mode 100644 board/keymile/mgcoge/mgcoge_hdlc_enet.c

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 3908e63..b113c0a 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -677,9 +677,6 @@ int ethernet_present(void)
 
 int board_eth_init(bd_t *bis)
 {
-#ifdef CONFIG_KEYMILE_HDLC_ENET
-   (void)keymile_hdlc_enet_initialize(bis);
-#endif
if (ethernet_present())
return cpu_eth_init(bis);
 
diff --git a/board/keymile/common/common.h b/board/keymile/common/common.h
index cdc35b6..6ce992a 100644
--- a/board/keymile/common/common.h
+++ b/board/keymile/common/common.h
@@ -125,10 +125,6 @@ struct bfticu_iomap {
 int ethernet_present(void);
 int ivm_read_eeprom(void);
 
-#ifdef CONFIG_KEYMILE_HDLC_ENET
-int keymile_hdlc_enet_initialize(bd_t *bis);
-#endif
-
 int set_km_env(void);
 int fdt_set_node_and_value(void *blob,
char *nodename,
diff --git a/board/keymile/common/keymile_hdlc_enet.c 
b/board/keymile/common/keymile_hdlc_enet.c
deleted file mode 100644
index a545211..000
--- a/board/keymile/common/keymile_hdlc_enet.c
+++ /dev/null
@@ -1,620 +0,0 @@
-/*
- * (C) Copyright 2008
- * Gary Jennejohn, DENX Software Engineering GmbH, ga...@denx.de.
- *
- * Based in part on arch/powerpc/cpu/mpc8260/ether_scc.c.
- *
- * 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 
-
-#ifdef CONFIG_KEYMILE_HDLC_ENET
-#ifdef TEST_IT
-#include 
-#endif
-
-#include "keymile_hdlc_enet.h"
-
-extern char keymile_slot;  /* our slot number in the backplane */
-
-/* Allow up to about 50 ms for sending */
-#define TOUT_LOOP  5
-
-/*
- * Since, except during initialization, ethact is always HDLC
- * while we're in the driver, just use serial_printf() everywhere for
- * output.  This avoids possible conflicts when netconsole is being
- * used.
- */
-#define dprintf(fmt, args...)  serial_printf(fmt, ##args)
-
-/* Cannot use the storage from net.c because we allocate larger buffers */
-static volatile uchar MyPktBuf[HDLC_PKTBUFSRX * PKT_MAXBLR_SIZE + PKTALIGN];
-static volatile uchar *MyRxPackets[HDLC_PKTBUFSRX]; /* Receive packet */
-
-static unsigned int keymile_rxIdx; /* index of the current RX buffer */
-
-static IPaddr_t cachedNumbers[CACHEDNUMBERS]; /* 4 bytes per entry */
-void initCachedNumbers(int);
-
-/*
-  * SCC Ethernet Tx and Rx buffer descriptors allocated at the
-  *  immr->udata_bd address on Dual-Port RAM
-  * Provide for Double Buffering
-  */
-typedef volatile struct CommonBufferDescriptor {
-cbd_t txbd;/* Tx BD */
-cbd_t rxbd[HDLC_PKTBUFSRX];/* Rx BD */
-} RTXBD;
-
-/*
- * This must be extern because it is allocated in DPRAM using CPM-sepcific
- * code.
- */
-static RTXBD *rtx;
-
-static int keymile_hdlc_enet_send(struct eth_device *, volatile void *, int);
-static int keymile_hdlc_enet_recv(struct eth_device *);
-void keymile_hdlc_enet_init_bds(RTXBD *);
-extern int keymile_hdlc_enet_init(struct eth_device *, bd_t *);
-extern void keymile_hdlc_enet_halt(struct eth_device *);
-
-/* flags in the buffer descriptor not defined anywhere else */
-#define BD_SC_CT   BD_SC_CD
-#define BD_SC_CR   0x04
-#define BD_SC_DE   0x80
-#ifndef BD_SC_TC
-#define BD_SC_TC   ((ushort)0x0400)/* Transmit CRC */
-#endif
-#define BD_SC_FIRSTBD_SC_TC
-#define BD_SC_STATS (BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_CR | 

[U-Boot] [PATCH 25/30] km/common: fix coding style issues in generic header

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 include/configs/keymile-common.h |4 ++--
 include/configs/km_arm.h |   10 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/configs/keymile-common.h b/include/configs/keymile-common.h
index a6d3bcf..b313b2e 100644
--- a/include/configs/keymile-common.h
+++ b/include/configs/keymile-common.h
@@ -86,7 +86,7 @@
 #define CONFIG_SYS_HZ  1000/* decr. freq: 1 ms ticks */
 
 #define CONFIG_BAUDRATE115200
-#define CONFIG_SYS_BAUDRATE_TABLE  { 9600, 19200, 38400, 57600, 115200, 
230400 }
+#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
 
 #define CONFIG_LOADS_ECHO
 #define CONFIG_SYS_LOADS_BAUD_CHANGE
@@ -425,6 +425,6 @@
""
 #endif /* CONFIG_KM_DEF_ENV */
 
-#define CONFIG_VERSION_VARIABLE/* include version env variable */
+#define CONFIG_VERSION_VARIABLE/* include version env variable */
 
 #endif /* __CONFIG_KEYMILE_H */
diff --git a/include/configs/km_arm.h b/include/configs/km_arm.h
index 06f91fe..0148b24 100644
--- a/include/configs/km_arm.h
+++ b/include/configs/km_arm.h
@@ -110,7 +110,7 @@
 #define CONFIG_BOOTMAPSZ   (8 << 20)   /* Initial Memmap for Linux */
 #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs  */
 #define CONFIG_INITRD_TAG  /* enable INITRD tag */
-#define CONFIG_SETUP_MEMORY_TAGS   /* enable memory tag */
+#define CONFIG_SETUP_MEMORY_TAGS   /* enable memory tag */
 
 /*
  * Commands configuration
@@ -185,10 +185,10 @@
 #ifndef __ASSEMBLY__
 #include 
 extern void __set_direction(unsigned pin, int high);
-void set_sda (int state);
-void set_scl (int state);
-int get_sda (void);
-int get_scl (void);
+void set_sda(int state);
+void set_scl(int state);
+int get_sda(void);
+int get_scl(void);
 #define KM_KIRKWOOD_SDA_PIN8
 #define KM_KIRKWOOD_SCL_PIN9
 #define KM_KIRKWOOD_ENV_WP 38
-- 
1.7.0.5

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


[U-Boot] [PATCH 06/30] powerpc/km82xx: move SDRAM config to board config

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

To be prepared for mgcoge3ne which has a different SDRAM on board.
The config was moved from generic code to board specific header.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 include/configs/km82xx-common.h |   26 --
 include/configs/mgcoge.h|   26 ++
 include/configs/mgcoge2ne.h |   23 +++
 3 files changed, 49 insertions(+), 26 deletions(-)

diff --git a/include/configs/km82xx-common.h b/include/configs/km82xx-common.h
index 345212c..da551c9 100644
--- a/include/configs/km82xx-common.h
+++ b/include/configs/km82xx-common.h
@@ -243,13 +243,6 @@
 ORxG_SCY_5_CLK |\
 ORxG_TRLX)
 
-
-/*
- * Bank 1 - 60x bus SDRAM
- */
-#define SDRAM_MAX_SIZE 0x0800  /* max. 128 MB  */
-#define CONFIG_SYS_GLOBAL_SDRAM_LIMIT  (256 << 20) /* less than 256 MB */
-
 #define CONFIG_SYS_MPTPR   0x1800
 
 /*
@@ -268,25 +261,6 @@
 #define CONFIG_SYS_OR1_PRELIM  CONFIG_SYS_OR1
 
 /*
- *  SDRAM initialization values
- */
-
-#define CONFIG_SYS_OR1 ((~(CONFIG_SYS_GLOBAL_SDRAM_LIMIT-1) & ORxS_SDAM_MSK) |\
-ORxS_BPD_8 |\
-ORxS_ROWST_PBI0_A7 |\
-ORxS_NUMR_13)
-
-#define CONFIG_SYS_PSDMR (PSDMR_SDAM_A14_IS_A5 |\
-PSDMR_BSMA_A14_A16 |\
-PSDMR_SDA10_PBI0_A9|\
-PSDMR_RFRC_5_CLK   |\
-PSDMR_PRETOACT_2W  |\
-PSDMR_ACTTORW_2W   |\
-PSDMR_LDOTOPRE_1C  |\
-PSDMR_WRC_1C   |\
-PSDMR_CL_2)
-
-/*
  * UPIO FPGA (GPIO/PIGGY) on CS3 initialization values
  */
 #define CONFIG_SYS_KMBEC_FPGA_BASE 0x3000
diff --git a/include/configs/mgcoge.h b/include/configs/mgcoge.h
index 3d2ee24..aed1526 100644
--- a/include/configs/mgcoge.h
+++ b/include/configs/mgcoge.h
@@ -58,6 +58,32 @@
CONFIG_SYS_FLASH_BASE_2 }
 #define MTDIDS_DEFAULT "nor3=app"
 
+/*
+ * Bank 1 - 60x bus SDRAM
+ */
+#define SDRAM_MAX_SIZE 0x0800  /* max. 128 MB  */
+#define CONFIG_SYS_GLOBAL_SDRAM_LIMIT  (256 << 20) /* less than 256 MB */
+
+/* SDRAM initialization values
+*/
+
+#define CONFIG_SYS_OR1((~(CONFIG_SYS_GLOBAL_SDRAM_LIMIT-1) & \
+ORxS_SDAM_MSK) |\
+ORxS_BPD_8 |\
+ORxS_ROWST_PBI0_A7 |\
+ORxS_NUMR_13)
+
+#define CONFIG_SYS_PSDMR  (PSDMR_SDAM_A14_IS_A5 |\
+PSDMR_BSMA_A14_A16   |\
+PSDMR_SDA10_PBI0_A9|\
+PSDMR_RFRC_5_CLK   |\
+PSDMR_PRETOACT_2W  |\
+PSDMR_ACTTORW_2W   |\
+PSDMR_LDOTOPRE_1C  |\
+PSDMR_WRC_1C   |\
+PSDMR_CL_2)
+
+
 /* include further common stuff for all keymile 82xx boards */
 #include "km82xx-common.h"
 
diff --git a/include/configs/mgcoge2ne.h b/include/configs/mgcoge2ne.h
index 287b717..2b09b42 100644
--- a/include/configs/mgcoge2ne.h
+++ b/include/configs/mgcoge2ne.h
@@ -58,6 +58,29 @@
 
 #define MTDIDS_DEFAULT "nor2=app"
 
+/*
+ * Bank 1 - 60x bus SDRAM
+ * mgcoge2ne has 128M RAM
+ */
+#define SDRAM_MAX_SIZE 0x0800  /* max. 128 MB  */
+#define CONFIG_SYS_GLOBAL_SDRAM_LIMIT  (256 << 20) /* less than 256 MB */
+
+#define CONFIG_SYS_OR1((~(CONFIG_SYS_GLOBAL_SDRAM_LIMIT-1) & \
+ORxS_SDAM_MSK) |\
+ORxS_BPD_8 |\
+ORxS_ROWST_PBI0_A7 |\
+ORxS_NUMR_13)
+
+#define CONFIG_SYS_PSDMR  (PSDMR_SDAM_A14_IS_A5 |\
+PSDMR_BSMA_A14_A16   |\
+PSDMR_SDA10_PBI0_A9|\
+PSDMR_RFRC_5_CLK   |\
+PSDMR_PRETOACT_2W  |\
+PSDMR_ACTTORW_2W   |\
+PSDMR_LDOTOPRE_1C  |\
+PSDMR_WRC_1C   |\
+PSDMR_CL_2)
+
 /* include further common stuff for all keymile 82xx boards */
 #include "km82xx-common.h"
 
-- 
1.7.0.5

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


[U-Boot] [PATCH 17/30] cramfs: make cramfs usable without a NOR flash

2011-04-08 Thread Valentin Longchamp
From: Heiko Schocher 

Signed-off-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
cc: Holger Brunck 
Signed-off-by: Valentin Longchamp 
---
 common/cmd_cramfs.c |   12 +++-
 fs/cramfs/cramfs.c  |4 
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/common/cmd_cramfs.c b/common/cmd_cramfs.c
index 8c86dc5..5e1487f 100644
--- a/common/cmd_cramfs.c
+++ b/common/cmd_cramfs.c
@@ -43,7 +43,9 @@
 #endif
 
 #ifdef CONFIG_CRAMFS_CMDLINE
-flash_info_t flash_info[1];
+#if !defined(CONFIG_SYS_NO_FLASH)
+#include 
+#endif
 
 #ifndef CONFIG_CMD_JFFS2
 #include 
@@ -119,7 +121,11 @@ int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
dev.id = &id;
part.dev = &dev;
/* fake the address offset */
+#if !defined(CONFIG_SYS_NO_FLASH)
part.offset = addr - flash_info[id.num].start[0];
+#else
+   part.offset = addr;
+#endif
 
/* pre-set Boot file name */
if ((filename = getenv("bootfile")) == NULL) {
@@ -182,7 +188,11 @@ int do_cramfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
dev.id = &id;
part.dev = &dev;
/* fake the address offset */
+#if !defined(CONFIG_SYS_NO_FLASH)
part.offset = addr - flash_info[id.num].start[0];
+#else
+   part.offset = addr;
+#endif
 
if (argc == 2)
filename = argv[1];
diff --git a/fs/cramfs/cramfs.c b/fs/cramfs/cramfs.c
index 2956d39..910955d 100644
--- a/fs/cramfs/cramfs.c
+++ b/fs/cramfs/cramfs.c
@@ -41,8 +41,12 @@ struct cramfs_super super;
 
 /* CPU address space offset calculation macro, struct part_info offset is
  * device address space offset, so we need to shift it by a device start 
address. */
+#if !defined(CONFIG_SYS_NO_FLASH)
 extern flash_info_t flash_info[];
 #define PART_OFFSET(x) (x->offset + flash_info[x->dev->id->num].start[0])
+#else
+#define PART_OFFSET(x) (x->offset)
+#endif
 
 static int cramfs_read_super (struct part_info *info)
 {
-- 
1.7.0.5

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


[U-Boot] [PATCH 28/30] arm/km: rename mgcoge2un to mgcoge3un

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

The mgcoge2un target was only an intermediate step to mgcoge3un.
For this reason the mgcoge2un support was moved to mgcoge3un,
because it isn't needed to support both targets.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Prafulla Wadaskar 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 MAINTAINERS  |2 +-
 boards.cfg   |2 +-
 include/configs/{mgcoge2un.h => mgcoge3un.h} |   10 +-
 3 files changed, 7 insertions(+), 7 deletions(-)
 rename include/configs/{mgcoge2un.h => mgcoge3un.h} (92%)

diff --git a/MAINTAINERS b/MAINTAINERS
index 37e03c9..7fb778f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -430,7 +430,7 @@ Heiko Schocher 
kmsupx5 MPC8321
mgcoge  MPC8247
mgcoge3ne   MPC8247
-   mgcoge2un   ARM926EJS (Kirkwood SoC)
+   mgcoge3un   ARM926EJS (Kirkwood SoC)
mucmc52 MPC5200
muas3001MPC8270
municse MPC5200
diff --git a/boards.cfg b/boards.cfg
index f6105be..6c5400e 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -95,7 +95,7 @@ davinci_sffsdr   arm arm926ejs   sffsdr   
   davinci
 davinci_sonata   arm arm926ejs   sonata  
davincidavinci
 suen3arm arm926ejs   km_arm  
keymilekirkwood
 suen8arm arm926ejs   km_arm  
keymilekirkwood
-mgcoge2unarm arm926ejs   km_arm  
keymilekirkwood
+mgcoge3unarm arm926ejs   km_arm  
keymilekirkwood
 guruplug arm arm926ejs   -   
Marvellkirkwood
 mv88f6281gtw_ge  arm arm926ejs   -   
Marvellkirkwood
 openrd_base  arm arm926ejs   -   
Marvellkirkwood
diff --git a/include/configs/mgcoge2un.h b/include/configs/mgcoge3un.h
similarity index 92%
rename from include/configs/mgcoge2un.h
rename to include/configs/mgcoge3un.h
index 6256035..da5935b 100644
--- a/include/configs/mgcoge2un.h
+++ b/include/configs/mgcoge3un.h
@@ -31,8 +31,8 @@
 /* for linking errors see
  * http://lists.denx.de/pipermail/u-boot/2009-July/057350.html */
 
-#ifndef _CONFIG_MGCOGE2UN_H
-#define _CONFIG_MGCOGE2UN_H
+#ifndef _CONFIG_MGCOGE3UN_H
+#define _CONFIG_MGCOGE3UN_H
 
 /* include common defines/options for all arm based Keymile boards */
 #include "km/km_arm.h"
@@ -40,9 +40,9 @@
 /*
  * Version number information
  */
-#define CONFIG_IDENT_STRING"\nKeymile MGCOGE2UN"
-
-#define CONFIG_HOSTNAMEmgcoge2un
+#define CONFIG_IDENT_STRING"\nKeymile MGCOGE3UN"
+#define CONFIG_HOSTNAMEmgcoge3un
+#define CONFIG_MGCOGE3UN
 
 #define KM_IVM_BUS "pca9547:70:9" /* I2C2 (Mux-Port 1)*/
 #define KM_ENV_BUS "pca9547:70:d" /* I2C2 (Mux-Port 5)*/
-- 
1.7.0.5

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


[U-Boot] [PATCH 13/30] arm/km: add mkimage config file for uart download

2011-04-08 Thread Valentin Longchamp
Signed-off-by: Valentin Longchamp 
Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Prafulla Wadaskar 
---
 board/keymile/km_arm/kwbimage-uart.cfg |  179 
 1 files changed, 179 insertions(+), 0 deletions(-)
 create mode 100644 board/keymile/km_arm/kwbimage-uart.cfg

diff --git a/board/keymile/km_arm/kwbimage-uart.cfg 
b/board/keymile/km_arm/kwbimage-uart.cfg
new file mode 100644
index 000..d8c517c
--- /dev/null
+++ b/board/keymile/km_arm/kwbimage-uart.cfg
@@ -0,0 +1,179 @@
+#
+# (C) Copyright 2010
+# Heiko Schocher, DENX Software Engineering, h...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+# Refer docs/README.kwimage for more details about how-to configure
+# and create kirkwood boot image
+#
+
+# Boot Media configurations
+BOOT_FROM  uart# Boot from SPI flash
+
+DATA 0xFFD1 0x0111 # MPP Control 0 Register
+# bit 3-0:   MPPSel0   2, NF_IO[2]
+# bit 7-4:   MPPSel1   2, NF_IO[3]
+# bit 12-8:  MPPSel2   2, NF_IO[4]
+# bit 15-12: MPPSel3   2, NF_IO[5]
+# bit 19-16: MPPSel4   1, NF_IO[6]
+# bit 23-20: MPPSel5   1, NF_IO[7]
+# bit 27-24: MPPSel6   1, SYSRST_O
+# bit 31-28: MPPSel7   0, GPO[7]
+
+DATA 0xFFD10004 0x03303300
+
+DATA 0xFFD10008 0x1100 # MPP Control 2 Register
+# bit 3-0:   MPPSel16  0, GPIO[16]
+# bit 7-4:   MPPSel17  0, GPIO[17]
+# bit 12-8:  MPPSel18  1, NF_IO[0]
+# bit 15-12: MPPSel19  1, NF_IO[1]
+# bit 19-16: MPPSel20  0, GPIO[20]
+# bit 23-20: MPPSel21  0, GPIO[21]
+# bit 27-24: MPPSel22  0, GPIO[22]
+# bit 31-28: MPPSel23  0, GPIO[23]
+
+DATA 0xFFD100E0 0x1B1B1B1B # IO Configuration 0 Register
+DATA 0xFFD20134 0x # L2 RAM Timing 0 Register
+DATA 0xFFD20138 0x # L2 RAM Timing 1 Register
+DATA 0xFFD20154 0x0200 # CPU RAM Management Control3 Register
+DATA 0xFFD2014C 0x1C00 # CPU RAM Management Control1 Register
+DATA 0xFFD20148 0x0001 # CPU RAM Management Control0 Register
+
+# Dram initalization
+DATA 0xFFD01400 0x43000400 # SDRAM Configuration Register
+# bit13-0:  0x400 (DDR2 clks refresh rate)
+# bit23-14: zero
+# bit24: 1= enable exit self refresh mode on DDR access
+# bit25: 1 required
+# bit29-26: zero
+# bit31-30: 01
+
+DATA 0xFFD01404 0x39543000 # DDR Controller Control Low
+# bit 3-0:  0 reserved
+# bit 4:0=addr/cmd in smame cycle
+# bit 5:0=clk is driven during self refresh, we don't care for APX
+# bit 6:0=use recommended falling edge of clk for addr/cmd
+# bit14:0=input buffer always powered up
+# bit18:1=cpu lock transaction enabled
+# bit23-20: 3=recommended value for CL=3 and STARTBURST_DEL disabled bit31=0
+# bit27-24: 6= CL+3, STARTBURST sample stages, for freqs 400MHz, unbuffered 
DIMM
+# bit30-28: 3 required
+# bit31:0=no additional STARTBURST delay
+
+DATA 0xFFD01408 0x34136552 # DDR Timing (Low) (active cycles value +1)
+# bit3-0:   TRAS lsbs
+# bit7-4:   TRCD
+# bit11- 8: TRP
+# bit15-12: TWR
+# bit19-16: TWTR
+# bit20:TRAS msb
+# bit23-21: 0x0
+# bit27-24: TRRD
+# bit31-28: TRTP
+
+DATA 0xFFD0140C 0x0033 #  DDR Timing (High)
+# bit6-0:   TRFC
+# bit8-7:   TR2R
+# bit10-9:  TR2W
+# bit12-11: TW2W
+# bit31-13: zero required
+
+DATA 0xFFD01410 0x000D #  DDR Address Control
+# bit1-0:   01, Cs0width=x16
+# bit3-2:   11, Cs0size=1Gb
+# bit5-4:   00, Cs2width=nonexistent
+# bit7-6:   00, Cs1size =nonexistent
+# bit9-8:   00, Cs2width=nonexistent
+# bit11-10: 00, Cs2size =nonexistent
+# bit13-12: 00, Cs3width=nonexistent
+# bit15-14: 00, Cs3size =nonexistent
+# bit16:0,  Cs0AddrSel
+# bit17:0,  Cs1AddrSel
+# bit18:0,  Cs2AddrSel
+# bit19:0,  Cs3AddrSel
+# bit31-20: 0 required
+
+DATA 0xFFD01414 0x #  DDR Open Pages Control
+# bit0:0,  OpenPage enabled
+# bit31-1: 0 required
+
+DATA 0xFFD01418 0x #  DDR Operation
+# bit3-0:   0x0, DDR cmd
+# bit31-4:  0 required
+
+DATA 0xFFD0141C 0x0652 #  DDR Mode
+DATA 0xFFD01420 0x0044 #  DDR Extended Mode
+# bit0:0,  DDR DLL enabled
+# bit1:0,  DDR drive strenght normal
+# bit2:1,  DDR ODT control lsd disabled
+# bit5-3:  000, required
+# bit6:1,  DDR ODT control msb, enabled
+# bit9-7:  000, re

[U-Boot] [PATCH 08/30] powerpc/km82xx: rename mgcoge2ne to mgcoge3ne board support

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

This patch rename mgcoge2ne board support to mgcoge3ne.
The board is similar to mgcoge. The difference is that
a NUMONYX flash is used and a larger SDRAM (256MB).
Also introduce CONFIG_KM_82XX to collect ppc82xx common
settings.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 MAINTAINERS  |2 +-
 board/keymile/common/common.c|6 +-
 board/keymile/common/common.h|1 +
 board/keymile/km82xx/km82xx.c|   27 
 boards.cfg   |2 +-
 include/configs/mgcoge.h |1 +
 include/configs/{mgcoge2ne.h => mgcoge3ne.h} |   58 +++---
 7 files changed, 67 insertions(+), 30 deletions(-)
 rename include/configs/{mgcoge2ne.h => mgcoge3ne.h} (65%)

diff --git a/MAINTAINERS b/MAINTAINERS
index 9586bcb..37e03c9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -429,7 +429,7 @@ Heiko Schocher 
kmeter1 MPC8360
kmsupx5 MPC8321
mgcoge  MPC8247
-   mgcoge2ne   MPC8247
+   mgcoge3ne   MPC8247
mgcoge2un   ARM926EJS (Kirkwood SoC)
mucmc52 MPC5200
muas3001MPC8270
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index b113c0a..3a7980d 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -22,7 +22,7 @@
  */
 
 #include 
-#if defined(CONFIG_MGCOGE) || defined(CONFIG_MGCOGE2NE)
+#if defined(CONFIG_KM82XX)
 #include 
 #endif
 #include 
@@ -398,10 +398,10 @@ int ivm_read_eeprom(void)
 #define DELAY_ABORT_SEQ62  /* @200kHz 9 clocks = 44us, 62us is 
ok */
 #define DELAY_HALF_PERIOD  (500 / (CONFIG_SYS_I2C_SPEED / 1000))
 
-#if defined(CONFIG_MGCOGE) || defined(CONFIG_MGCOGE2NE)
+#if defined(CONFIG_KM_82XX)
 #define SDA_MASK   0x0001
 #define SCL_MASK   0x0002
-static void set_pin(int state, unsigned long mask)
+void set_pin(int state, unsigned long mask)
 {
ioport_t *iop = ioport_addr((immap_t *)CONFIG_SYS_IMMR, 3);
 
diff --git a/board/keymile/common/common.h b/board/keymile/common/common.h
index 6ce992a..cee24d4 100644
--- a/board/keymile/common/common.h
+++ b/board/keymile/common/common.h
@@ -124,6 +124,7 @@ struct bfticu_iomap {
 
 int ethernet_present(void);
 int ivm_read_eeprom(void);
+void set_pin(int state, unsigned long mask);
 
 int set_km_env(void);
 int fdt_set_node_and_value(void *blob,
diff --git a/board/keymile/km82xx/km82xx.c b/board/keymile/km82xx/km82xx.c
index 3db3c7b..5dc7ffa 100644
--- a/board/keymile/km82xx/km82xx.c
+++ b/board/keymile/km82xx/km82xx.c
@@ -287,6 +287,8 @@ int checkboard(void)
 {
 #if defined(CONFIG_MGCOGE)
puts("Board: Keymile mgcoge");
+#elif defined(CONFIG_MGCOGE3NE)
+   puts("Board: Keymile mgcoge3ne");
 #else
puts("Board: Keymile mgcoge2ne");
 #endif
@@ -296,6 +298,28 @@ int checkboard(void)
return 0;
 }
 
+#ifdef CONFIG_MGCOGE3NE
+/*
+ * For mgcoge3ne boards, the mgcoge3un control is controlled from
+ * a GPIO line on the PPC CPU. If bobcatreset is set the line
+ * will toggle once what forces the mgocge3un part to restart
+ * immediately.
+ */
+void handle_mgcoge3un_reset(void)
+{
+   char *bobcatreset = getenv("bobcatreset");
+   if (bobcatreset) {
+   if (strcmp(bobcatreset, "true") == 0) {
+   puts("Forcing bobcat reset\n");
+   set_pin(0, 0x0004); /* clear PD29 to reset arm */
+   udelay(1000);
+   set_pin(1, 0x0004);
+   } else
+   set_pin(1, 0x0004); /* set PD29 to not reset arm */
+   }
+}
+#endif
+
 /*
  * Early board initalization.
  */
@@ -311,6 +335,9 @@ int board_early_init_r(void)
out_8(&base->oprtl, (H_OPORTS_SCC4_ENA | H_OPORTS_SCC4_FD_ENA |
H_OPORTS_FCC1_PW_DWN));
 
+#ifdef CONFIG_MGCOGE3NE
+   handle_mgcoge3un_reset();
+#endif
return 0;
 }
 
diff --git a/boards.cfg b/boards.cfg
index 4c52770..f6105be 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -423,7 +423,7 @@ PQ2FADS-ZU_66MHz_lowboot powerpc mpc8260 
mpc8260ads  freesca
 PQ2FADS-ZU_lowboot   powerpc mpc8260 mpc8260ads  
freescale  -   
MPC8260ADS:ADSTYPE=CONFIG_SYS_PQ2FADS,SYS_TEXT_BASE=0xFF80
 VoVPN-GW_66MHz   powerpc mpc8260 vovpn-gw
funkwerk   -   VoVPN-GW:CLKIN_66MHz
 mgcoge   powerpc mpc8260 km82xx  
keymile
-mgcoge2nepowerpc mpc8260 km82xx  
keymile
+mgcoge3nepowerpc mpc8260 km82xx  
keymile
 SCM  powerpc mpc8260 -   
siemens
 TQM8255_AA   

[U-Boot] [PATCH 19/30] i2c, soft_i2c: deblock bus if switching to another i2c bus

2011-04-08 Thread Valentin Longchamp
From: Heiko Schocher 

Deblock i2c bus when switching to another i2c bus, if using
i2c_set_bus_num().

Signed-off-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
cc: Holger Brunck 
Signed-off-by: Valentin Longchamp 
---
 drivers/i2c/soft_i2c.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/soft_i2c.c b/drivers/i2c/soft_i2c.c
index 69b5f42..9b02e89 100644
--- a/drivers/i2c/soft_i2c.c
+++ b/drivers/i2c/soft_i2c.c
@@ -286,6 +286,7 @@ int i2c_set_bus_num(unsigned int bus)
int ret;
 
ret = i2x_mux_select_mux(bus);
+   i2c_init_board();
if (ret == 0)
i2c_bus_num = bus;
else
-- 
1.7.0.5

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


[U-Boot] [PATCH 21/30] common/hush: make get_local_var visible for other users

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 common/hush.c  |3 +--
 include/hush.h |1 +
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/hush.c b/common/hush.c
index 8021a68..85a6030 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -497,7 +497,6 @@ static void remove_bg_job(struct pipe *pi);
 /* local variable support */
 static char **make_list_in(char **inp, char *name);
 static char *insert_var_value(char *inp);
-static char *get_local_var(const char *var);
 
 #ifndef __U_BOOT__
 /* Table of built-in functions.  They can be forked or not, depending on
@@ -2169,7 +2168,7 @@ static char *get_dollar_var(char ch);
 #endif
 
 /* This is used to get/check local shell variables */
-static char *get_local_var(const char *s)
+char *get_local_var(const char *s)
 {
struct variables *cur;
 
diff --git a/include/hush.h b/include/hush.h
index 0805ff3..5c566cc 100644
--- a/include/hush.h
+++ b/include/hush.h
@@ -34,6 +34,7 @@ extern int parse_file_outer(void);
 
 int set_local_var(const char *s, int flg_export);
 void unset_local_var(const char *name);
+char *get_local_var(const char *s);
 
 #if defined(CONFIG_HUSH_INIT_VAR)
 extern int hush_init_var (void);
-- 
1.7.0.5

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


[U-Boot] [PATCH 09/30] poweprc/km82xx: add board specific environment variable

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

On mgcoge3ne a new environment variable bobcatreset is used.
So this patch adds a possibility to add board specific
environment variables in general and this specific variable
for mgcoge3ne.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 include/configs/km82xx-common.h |1 +
 include/configs/mgcoge.h|2 ++
 include/configs/mgcoge3ne.h |2 ++
 3 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/configs/km82xx-common.h b/include/configs/km82xx-common.h
index 894e015..446c1d0 100644
--- a/include/configs/km82xx-common.h
+++ b/include/configs/km82xx-common.h
@@ -80,6 +80,7 @@
  * Default environment settings
  */
 #defineCONFIG_EXTRA_ENV_SETTINGS   
\
+   CONFIG_KM_BOARD_EXTRA_ENV   \
CONFIG_KM_DEF_ENV   \
"EEprom_ivm=pca9544a:70:4 \0"   \
"unlock=yes\0"  \
diff --git a/include/configs/mgcoge.h b/include/configs/mgcoge.h
index 93a6f4a..0745855 100644
--- a/include/configs/mgcoge.h
+++ b/include/configs/mgcoge.h
@@ -85,6 +85,8 @@
 PSDMR_CL_2)
 
 
+#define CONFIG_KM_BOARD_EXTRA_ENV  ""
+
 /* include further common stuff for all keymile 82xx boards */
 #include "km82xx-common.h"
 
diff --git a/include/configs/mgcoge3ne.h b/include/configs/mgcoge3ne.h
index 3df7ef1..78ce468 100644
--- a/include/configs/mgcoge3ne.h
+++ b/include/configs/mgcoge3ne.h
@@ -89,6 +89,8 @@
PSDMR_WRC_2C|\
PSDMR_CL_2)
 
+#define CONFIG_KM_BOARD_EXTRA_ENV  "bobcatreset=true\0"
+
 /* include further common stuff for all keymile 82xx boards */
 #include "km82xx-common.h"
 
-- 
1.7.0.5

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


[U-Boot] [PATCH 18/30] i2c: add i2c deblock sequence before and after every mux config

2011-04-08 Thread Valentin Longchamp
From: Stefan Bigler 

To make sure that the mux can be configured a deblocking sequence
is done before the mux configuration. After the mux switch the new leaf
of, the i2c tree must be again deblocked.

Signed-off-by: Stefan Bigler 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Prafulla Wadaskar 
cc: Valentin Longchamp 
cc: Holger Brunck 
Signed-off-by: Valentin Longchamp 
---
 common/cmd_i2c.c |   12 
 include/i2c.h|2 --
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index c272b0d..d913e13 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -132,6 +132,14 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define DISP_LINE_LEN  16
 
+/* implement possible board specific board init */
+void __def_i2c_init_board(void)
+{
+   return;
+}
+void i2c_init_board(void)
+   __attribute__((weak, alias("__def_i2c_init_board")));
+
 /* TODO: Implement architecture-specific get/set functions */
 unsigned int __def_i2c_get_bus_speed(void)
 {
@@ -1541,6 +1549,8 @@ int i2x_mux_select_mux(int bus)
 
mux = dev->mux;
while (mux != NULL) {
+   /* do deblocking on each level of mux, before mux config */
+   i2c_init_board();
if (i2c_write(mux->chip, 0, 0, &mux->channel, 1) != 0) {
printf ("Error setting Mux: chip:%x channel: \
%x\n", mux->chip, mux->channel);
@@ -1548,6 +1558,8 @@ int i2x_mux_select_mux(int bus)
}
mux = mux->next;
}
+   /* do deblocking on each level of mux and after mux config */
+   i2c_init_board();
return 0;
 }
 #endif /* CONFIG_I2C_MUX */
diff --git a/include/i2c.h b/include/i2c.h
index cd23c8a..8ceb4c8 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -108,9 +108,7 @@
  * repeatedly to change the speed and slave addresses.
  */
 void i2c_init(int speed, int slaveaddr);
-#ifdef CONFIG_SYS_I2C_INIT_BOARD
 void i2c_init_board(void);
-#endif
 #ifdef CONFIG_SYS_I2C_BOARD_LATE_INIT
 void i2c_board_late_init(void);
 #endif
-- 
1.7.0.5

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


[U-Boot] [PATCH 02/30] powerpc/km82xx: add DIP switch detection

2011-04-08 Thread Valentin Longchamp
From: Huber, Andreas 

This reads the DIP switch register in the BFTICU (0x4089). If 'Full reset'
or 'DB erase' is selected, 'actual_bank' is set to 0. This loads the Bootloader
application who does the erase stuff. To access the register a struct for the
bfticu I/O map was added to common.h.

Signed-off-by: Andreas Huber 
Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 board/keymile/common/common.h |   79 +
 board/keymile/mgcoge/mgcoge.c |   12 ++
 2 files changed, 91 insertions(+), 0 deletions(-)

diff --git a/board/keymile/common/common.h b/board/keymile/common/common.h
index 099de98..cdc35b6 100644
--- a/board/keymile/common/common.h
+++ b/board/keymile/common/common.h
@@ -39,6 +39,85 @@ struct km_bec_fpga {
unsigned char   pgy_eth;
 };
 
+#define BFTICU_DIPSWITCH_MASK   0x0f
+
+/*
+ * BFTICU FPGA iomap
+ * BFTICU is used on mgcoge and mgocge3ne
+ */
+struct bfticu_iomap {
+   u8  xi_ena; /* General defect enable */
+   u8  pack1[3];
+   u8  en_csn;
+   u8  pack2;
+   u8  safe_mem;
+   u8  pack3;
+   u8  id;
+   u8  pack4;
+   u8  rev;
+   u8  build;
+   u8  p_frc;
+   u8  p_msk;
+   u8  pack5[2];
+   u8  xg_int;
+   u8  pack6[15];
+   u8  s_conf;
+   u8  pack7;
+   u8  dmx_conf12;
+   u8  pack8;
+   u8  s_clkslv;
+   u8  pack9[11];
+   u8  d_conf;
+   u8  d_mask_ca;
+   u8  d_pll_del;
+   u8  pack10[16];
+   u8  t_conf_ca;
+   u8  t_mask_ca;
+   u8  pack11[13];
+   u8  m_def0;
+   u8  m_def1;
+   u8  m_def2;
+   u8  m_def3;
+   u8  m_def4;
+   u8  m_def5;
+   u8  m_def_trap0;
+   u8  m_def_trap1;
+   u8  m_def_trap2;
+   u8  m_def_trap3;
+   u8  m_def_trap4;
+   u8  m_def_trap5;
+   u8  m_mask_def0;
+   u8  m_mask_def1;
+   u8  m_mask_def2;
+   u8  m_mask_def3;
+   u8  m_mask_def4;
+   u8  m_mask_def5;
+   u8  m_def_mask0;
+   u8  m_def_mask1;
+   u8  m_def_mask2;
+   u8  m_def_mask3;
+   u8  m_def_mask4;
+   u8  m_def_mask5;
+   u8  m_def_pri;
+   u8  pack12[11];
+   u8  hw_status;
+   u8  pack13;
+   u8  hw_control1;
+   u8  hw_control2;
+   u8  hw_control3;
+   u8  pack14[7];
+   u8  led_on; /* Leds */
+   u8  pack15;
+   u8  sfp_control;/* SFP modules */
+   u8  pack16;
+   u8  alarm_control;  /* Alarm output */
+   u8  pack17;
+   u8  icps;   /* ICN clock pulse shaping */
+   u8  mswitch;/* Read mode switch */
+   u8  pack18[6];
+   u8  pb_dbug;
+};
+
 #if !defined(CONFIG_PIGGY_MAC_ADRESS_OFFSET)
 #define CONFIG_PIGGY_MAC_ADRESS_OFFSET 0
 #endif
diff --git a/board/keymile/mgcoge/mgcoge.c b/board/keymile/mgcoge/mgcoge.c
index 340016b..11a0f79 100644
--- a/board/keymile/mgcoge/mgcoge.c
+++ b/board/keymile/mgcoge/mgcoge.c
@@ -315,6 +315,18 @@ int board_early_init_r(void)
 
 int last_stage_init(void)
 {
+   struct bfticu_iomap *base =
+   (struct bfticu_iomap *)CONFIG_SYS_FPGA_BASE;
+   u8 dip_switch;
+
+   dip_switch = in_8(&base->mswitch);
+   dip_switch &= BFTICU_DIPSWITCH_MASK;
+   /* dip switch 'full reset' or 'db erase' */
+   if (dip_switch & 0x1 || dip_switch & 0x2) {
+   /* start bootloader */
+   puts("DIP:   Enabled\n");
+   setenv("actual_bank", "0");
+   }
set_km_env();
return 0;
 }
-- 
1.7.0.5

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


[U-Boot] [PATCH 07/30] powerpc/km82xx: adapt CONFIG_SYSSYPCR to manual

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

Reserved bit was changed according to the processors manual.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 include/configs/km82xx-common.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/configs/km82xx-common.h b/include/configs/km82xx-common.h
index da551c9..894e015 100644
--- a/include/configs/km82xx-common.h
+++ b/include/configs/km82xx-common.h
@@ -182,7 +182,7 @@
 #define CONFIG_SYS_HID20
 
 #define CONFIG_SYS_SIUMCR  0x4020c200
-#define CONFIG_SYS_SYPCR   0xFFC3
+#define CONFIG_SYS_SYPCR   0xFF83
 #define CONFIG_SYS_BCR 0x1000
 #define CONFIG_SYS_SCCR(SCCR_PCI_MODE | SCCR_PCI_MODCK)
 
-- 
1.7.0.5

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


[U-Boot] [PATCH 05/30] powerpc/km82xx: rename mgcoge files to km82xx

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

The directory and file mgcoge was renamed to km82xx.
Because other keymile 82xx will follow and will use the
same platform code.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 board/keymile/{mgcoge => km82xx}/Makefile  |0
 board/keymile/{mgcoge/mgcoge.c => km82xx/km82xx.c} |0
 boards.cfg |4 ++--
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename board/keymile/{mgcoge => km82xx}/Makefile (100%)
 rename board/keymile/{mgcoge/mgcoge.c => km82xx/km82xx.c} (100%)

diff --git a/board/keymile/mgcoge/Makefile b/board/keymile/km82xx/Makefile
similarity index 100%
rename from board/keymile/mgcoge/Makefile
rename to board/keymile/km82xx/Makefile
diff --git a/board/keymile/mgcoge/mgcoge.c b/board/keymile/km82xx/km82xx.c
similarity index 100%
rename from board/keymile/mgcoge/mgcoge.c
rename to board/keymile/km82xx/km82xx.c
diff --git a/boards.cfg b/boards.cfg
index 79266c9..4c52770 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -422,8 +422,8 @@ PQ2FADS-ZU_66MHz powerpc mpc8260 
mpc8260ads  freesca
 PQ2FADS-ZU_66MHz_lowboot powerpc mpc8260 mpc8260ads  
freescale  -   
MPC8260ADS:ADSTYPE=CONFIG_SYS_PQ2FADS,8260_CLKIN=6600,SYS_TEXT_BASE=0xFF80
 PQ2FADS-ZU_lowboot   powerpc mpc8260 mpc8260ads  
freescale  -   
MPC8260ADS:ADSTYPE=CONFIG_SYS_PQ2FADS,SYS_TEXT_BASE=0xFF80
 VoVPN-GW_66MHz   powerpc mpc8260 vovpn-gw
funkwerk   -   VoVPN-GW:CLKIN_66MHz
-mgcoge   powerpc mpc8260 -   
keymile
-mgcoge2nepowerpc mpc8260 mgcoge  
keymile
+mgcoge   powerpc mpc8260 km82xx  
keymile
+mgcoge2nepowerpc mpc8260 km82xx  
keymile
 SCM  powerpc mpc8260 -   
siemens
 TQM8255_AA   powerpc mpc8260 tqm8260 tqc   
 -   TQM8260:MPC8255,300MHz
 TQM8260_AA   powerpc mpc8260 tqm8260 tqc   
 -   TQM8260:MPC8260,200MHz
-- 
1.7.0.5

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


[U-Boot] [PATCH 04/30] powerpc/km82xx: cleanup coding style for mgcoge.c

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 board/keymile/mgcoge/mgcoge.c |  291 +
 1 files changed, 146 insertions(+), 145 deletions(-)

diff --git a/board/keymile/mgcoge/mgcoge.c b/board/keymile/mgcoge/mgcoge.c
index 11a0f79..3db3c7b 100644
--- a/board/keymile/mgcoge/mgcoge.c
+++ b/board/keymile/mgcoge/mgcoge.c
@@ -45,154 +45,154 @@
  */
 const iop_conf_t iop_conf_tab[4][32] = {
 
-/* Port A */
-{  /*conf  ppar psor pdir podr pdat */
-   /* PA31 */ { 0,  0,   0,   0,   0,   0 }, /* PA31*/
-   /* PA30 */ { 0,  0,   0,   0,   0,   0 }, /* PA30*/
-   /* PA29 */ { 0,  0,   0,   0,   0,   0 }, /* PA29*/
-   /* PA28 */ { 0,  0,   0,   0,   0,   0 }, /* PA28*/
-   /* PA27 */ { 0,  0,   0,   0,   0,   0 }, /* PA27*/
-   /* PA26 */ { 0,  0,   0,   0,   0,   0 }, /* PA26*/
-   /* PA25 */ { 0,  0,   0,   0,   0,   0 }, /* PA25*/
-   /* PA24 */ { 0,  0,   0,   0,   0,   0 }, /* PA24*/
-   /* PA23 */ { 0,  0,   0,   0,   0,   0 }, /* PA23*/
-   /* PA22 */ { 0,  0,   0,   0,   0,   0 }, /* PA22*/
-   /* PA21 */ { 0,  0,   0,   0,   0,   0 }, /* PA21*/
-   /* PA20 */ { 0,  0,   0,   0,   0,   0 }, /* PA20*/
-   /* PA19 */ { 0,  0,   0,   0,   0,   0 }, /* PA19*/
-   /* PA18 */ { 0,  0,   0,   0,   0,   0 }, /* PA18*/
-   /* PA17 */ { 0,  0,   0,   0,   0,   0 }, /* PA17*/
-   /* PA16 */ { 0,  0,   0,   0,   0,   0 }, /* PA16*/
-   /* PA15 */ { 0,  0,   0,   0,   0,   0 }, /* PA15*/
-   /* PA14 */ { 0,  0,   0,   0,   0,   0 }, /* PA14*/
-   /* PA13 */ { 0,  0,   0,   0,   0,   0 }, /* PA13*/
-   /* PA12 */ { 0,  0,   0,   0,   0,   0 }, /* PA12*/
-   /* PA11 */ { 0,  0,   0,   0,   0,   0 }, /* PA11*/
-   /* PA10 */ { 0,  0,   0,   0,   0,   0 }, /* PA10*/
-   /* PA9  */ { 1,  1,   0,   1,   0,   0 }, /* SMC2 TxD*/
-   /* PA8  */ { 1,  1,   0,   0,   0,   0 }, /* SMC2 RxD*/
-   /* PA7  */ { 0,  0,   0,   0,   0,   0 }, /* PA7 */
-   /* PA6  */ { 0,  0,   0,   0,   0,   0 }, /* PA6 */
-   /* PA5  */ { 0,  0,   0,   0,   0,   0 }, /* PA5 */
-   /* PA4  */ { 0,  0,   0,   0,   0,   0 }, /* PA4 */
-   /* PA3  */ { 0,  0,   0,   0,   0,   0 }, /* PA3 */
-   /* PA2  */ { 0,  0,   0,   0,   0,   0 }, /* PA2 */
-   /* PA1  */ { 0,  0,   0,   0,   0,   0 }, /* PA1 */
-   /* PA0  */ { 0,  0,   0,   0,   0,   0 }  /* PA0 */
-},
-
-/* Port B */
-{  /*conf  ppar psor pdir podr pdat */
-   /* PB31 */ { 0,  0,   0,   0,   0,   0 }, /* PB31*/
-   /* PB30 */ { 0,  0,   0,   0,   0,   0 }, /* PB30*/
-   /* PB29 */ { 0,  0,   0,   0,   0,   0 }, /* PB29*/
-   /* PB28 */ { 0,  0,   0,   0,   0,   0 }, /* PB28*/
-   /* PB27 */ { 0,  0,   0,   0,   0,   0 }, /* PB27*/
-   /* PB26 */ { 0,  0,   0,   0,   0,   0 }, /* PB26*/
-   /* PB25 */ { 0,  0,   0,   0,   0,   0 }, /* PB25*/
-   /* PB24 */ { 0,  0,   0,   0,   0,   0 }, /* PB24*/
-   /* PB23 */ { 0,  0,   0,   0,   0,   0 }, /* PB23*/
-   /* PB22 */ { 0,  0,   0,   0,   0,   0 }, /* PB22*/
-   /* PB21 */ { 0,  0,   0,   0,   0,   0 }, /* PB21*/
-   /* PB20 */ { 0,  0,   0,   0,   0,   0 }, /* PB20*/
-   /* PB19 */ { 0,  0,   0,   0,   0,   0 }, /* PB19*/
-   /* PB18 */ { 0,  0,   0,   0,   0,   0 }, /* PB18*/
-   /* PB17 */ { 0,  0,   0,   0,   0,   0 }, /* non-existent*/
-   /* PB16 */ { 0,  0,   0,   0,   0,   0 }, /* non-existent*/
-   /* PB15 */ { 0,  0,   0,   0,   0,   0 }, /* non-existent*/
-   /* PB14 */ { 0,  0,   0,   0,   0,   0 }, /* non-existent*/
-   /* PB13 */ { 0,  0,   0,   0,   0,   0 }, /* non-existent*/
-   /* PB12 */ { 0,  0,   0,   0,   0,   0 }, /* non-existent*/
-   /* PB11 */ { 0,  0,   0,   0,   0,   0 }, /* non-existent*/
-   /* PB10 */ { 0,

[U-Boot] [PATCH 20/30] km/common: fix initial_boot_bank for bootpackages

2011-04-08 Thread Valentin Longchamp
From: Thomas Herzmann 

The initial_boot_bank can be set when more than one application is
used in a bootpackage. But a value n <> 0 never led to booting from
bank n. Instead, bank 0 was booted. This patch fixes this.

Signed-off-by: Thomas Herzmann 
Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 include/configs/keymile-common.h |   15 ---
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/include/configs/keymile-common.h b/include/configs/keymile-common.h
index 6329a1c..5c32023 100644
--- a/include/configs/keymile-common.h
+++ b/include/configs/keymile-common.h
@@ -249,10 +249,10 @@
"printbootargs boot "   \
"\" && "\
"setenv bootcmd \'" \
-   "run bootrunner; reset" \
+   "run actual bootrunner; reset"  \
"\' && "\
"setenv altbootcmd \'"  \
-   "run actual0 bootcmd; reset"\
+   "run backup bootrunner; reset"  \
"\' && "\
"saveenv && "   \
"reset\0"   \
@@ -290,7 +290,7 @@
"addramfs=" \
"setenv bootargs \""\
"${bootargs} phram.phram="  \
-   "rootfs${actual_bank},${rootfsaddr},${rootfssize}\"\0"  \
+   "rootfs${boot_bank},${rootfsaddr},${rootfssize}\"\0"\
"addtty="   \
"setenv bootargs ${bootargs}"   \
" console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}\0"  \
@@ -305,7 +305,7 @@
"flashargs="\
"setenv bootargs "  \
"ubi.mtd=" CONFIG_KM_UBI_LINUX_MTD_NAME " " \
-   "root=mtdblock:rootfs${actual_bank} "   \
+   "root=mtdblock:rootfs${boot_bank} " \
"rootfstype=squashfs ro\0"  \
""
 
@@ -354,7 +354,7 @@
"cramfsload ${kernel_addr_r} uImage && "\
"setenv actual_kernel_addr ${kernel_addr_r}\0"  \
"ubiattach=ubi part ${ubipartition}\0"  \
-   "ubicopy=ubi read ${cramfsaddr} bootfs${actual_bank}\0" \
+   "ubicopy=ubi read ${cramfsaddr} bootfs${boot_bank}\0"   \
"ubipartition=" CONFIG_KM_UBI_PARTITION_NAME "\0"   \
""
 
@@ -384,9 +384,10 @@
  * - 'default': setup default environment
  */
 #define CONFIG_KM_DEF_ENV_CONSTANTS\
-   "actual=setenv actual_bank ${initial_boot_bank}\0"  \
-   "actual0=setenv actual_bank 0\0"\
+   "actual=setenv boot_bank ${actual_bank}\0"  \
+   "backup=setenv boot_bank ${backup_bank}\0"  \
"actual_bank=${initial_boot_bank}\0"\
+   "backup_bank=0\0"   \
"default="  \
"setenv default 'run newenv; reset' &&  "   \
"run release && saveenv; reset\0"   \
-- 
1.7.0.5

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


[U-Boot] [PATCH 01/30] lib, vsprintf: introduce strict_strtoul

2011-04-08 Thread Valentin Longchamp
From: Heiko Schocher 

as checkpatch proposes to use strict_strtoul instead of
simple_strtoul, introduce it.

Signed-off-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
cc: Holger Brunck 
Signed-off-by: Valentin Longchamp 
---
 include/_exports.h |1 +
 include/common.h   |1 +
 include/exports.h  |1 +
 lib/vsprintf.c |   47 +++
 4 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/include/_exports.h b/include/_exports.h
index d89b65b..349a3c5 100644
--- a/include/_exports.h
+++ b/include/_exports.h
@@ -19,6 +19,7 @@ EXPORT_FUNC(do_reset)
 EXPORT_FUNC(getenv)
 EXPORT_FUNC(setenv)
 EXPORT_FUNC(simple_strtoul)
+EXPORT_FUNC(strict_strtoul)
 EXPORT_FUNC(simple_strtol)
 EXPORT_FUNC(strcmp)
 EXPORT_FUNC(i2c_write)
diff --git a/include/common.h b/include/common.h
index 49c884c..d180da2 100644
--- a/include/common.h
+++ b/include/common.h
@@ -648,6 +648,7 @@ voidudelay(unsigned long);
 
 /* lib/vsprintf.c */
 ulong  simple_strtoul(const char *cp,char **endp,unsigned int base);
+int strict_strtoul(const char *cp, unsigned int base, unsigned long *res);
 unsigned long long simple_strtoull(const char *cp,char **endp,unsigned int 
base);
 long   simple_strtol(const char *cp,char **endp,unsigned int base);
 void   panic(const char *fmt, ...)
diff --git a/include/exports.h b/include/exports.h
index 6382311..2f49cea 100644
--- a/include/exports.h
+++ b/include/exports.h
@@ -20,6 +20,7 @@ void __udelay(unsigned long);
 unsigned long get_timer(unsigned long);
 int vprintf(const char *, va_list);
 unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base);
+int strict_strtoul(const char *cp, unsigned int base, unsigned long *res);
 char *getenv (char *name);
 int setenv (char *varname, char *varvalue);
 long simple_strtol(const char *cp,char **endp,unsigned int base);
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 61e6f0d..0eda799 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #if !defined (CONFIG_PANIC_HANG)
@@ -61,6 +62,52 @@ unsigned long simple_strtoul(const char *cp,char 
**endp,unsigned int base)
return result;
 }
 
+/**
+ * strict_strtoul - convert a string to an unsigned long strictly
+ * @cp: The string to be converted
+ * @base: The number base to use
+ * @res: The converted result value
+ *
+ * strict_strtoul converts a string to an unsigned long only if the
+ * string is really an unsigned long string, any string containing
+ * any invalid char at the tail will be rejected and -EINVAL is returned,
+ * only a newline char at the tail is acceptible because people generally
+ * change a module parameter in the following way:
+ *
+ *  echo 1024 > /sys/module/e1000/parameters/copybreak
+ *
+ * echo will append a newline to the tail.
+ *
+ * It returns 0 if conversion is successful and *res is set to the converted
+ * value, otherwise it returns -EINVAL and *res is set to 0.
+ *
+ * simple_strtoul just ignores the successive invalid characters and
+ * return the converted value of prefix part of the string.
+ */
+int strict_strtoul(const char *cp, unsigned int base, unsigned long *res)
+{
+   char *tail;
+   unsigned long val;
+   size_t len;
+
+   *res = 0;
+   len = strlen(cp);
+   if (len == 0)
+   return -EINVAL;
+
+   val = simple_strtoul(cp, &tail, base);
+   if (tail == cp)
+   return -EINVAL;
+
+   if ((*tail == '\0') ||
+   ((len == (size_t)(tail - cp) + 1) && (*tail == '\n'))) {
+   *res = val;
+   return 0;
+   }
+
+   return -EINVAL;
+}
+
 long simple_strtol(const char *cp,char **endp,unsigned int base)
 {
if(*cp=='-')
-- 
1.7.0.5

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


[U-Boot] [PATCH 14/30] arm/km: add BootROM config files for memphis SDRAM

2011-04-08 Thread Valentin Longchamp
This RAM is used on mgcoge3un and needs other initialization values
for the SDRAM controller.

Signed-off-by: Valentin Longchamp 
Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Prafulla Wadaskar 
---
 board/keymile/km_arm/kwbimage-memphis-uart.cfg |  197 
 board/keymile/km_arm/kwbimage-memphis.cfg  |  197 
 2 files changed, 394 insertions(+), 0 deletions(-)
 create mode 100644 board/keymile/km_arm/kwbimage-memphis-uart.cfg
 create mode 100644 board/keymile/km_arm/kwbimage-memphis.cfg

diff --git a/board/keymile/km_arm/kwbimage-memphis-uart.cfg 
b/board/keymile/km_arm/kwbimage-memphis-uart.cfg
new file mode 100644
index 000..214f6b6
--- /dev/null
+++ b/board/keymile/km_arm/kwbimage-memphis-uart.cfg
@@ -0,0 +1,197 @@
+#
+# (C) Copyright 2010
+# Heiko Schocher, DENX Software Engineering, h...@denx.de.
+#
+# (C) Copyright 2011
+# Valentin Longchamp, Keymile AG, valentin.longch...@keymile.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., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+# Refer docs/README.kwimage for more details about how-to configure
+# and create kirkwood boot image
+#
+
+# Boot Media configurations
+BOOT_FROM  uart# Boot from SPI flash
+
+DATA 0xFFD1 0x0111 # MPP Control 0 Register
+# bit 3-0:   MPPSel0   2, NF_IO[2]
+# bit 7-4:   MPPSel1   2, NF_IO[3]
+# bit 12-8:  MPPSel2   2, NF_IO[4]
+# bit 15-12: MPPSel3   2, NF_IO[5]
+# bit 19-16: MPPSel4   1, NF_IO[6]
+# bit 23-20: MPPSel5   1, NF_IO[7]
+# bit 27-24: MPPSel6   1, SYSRST_O
+# bit 31-28: MPPSel7   0, GPO[7]
+
+DATA 0xFFD10004 0x03303300
+
+DATA 0xFFD10008 0x1100 # MPP Control 2 Register
+# bit 3-0:   MPPSel16  0, GPIO[16]
+# bit 7-4:   MPPSel17  0, GPIO[17]
+# bit 12-8:  MPPSel18  1, NF_IO[0]
+# bit 15-12: MPPSel19  1, NF_IO[1]
+# bit 19-16: MPPSel20  0, GPIO[20]
+# bit 23-20: MPPSel21  0, GPIO[21]
+# bit 27-24: MPPSel22  0, GPIO[22]
+# bit 31-28: MPPSel23  0, GPIO[23]
+
+DATA 0xFFD100E0 0x1B1B1B1B # IO Configuration 0 Register
+DATA 0xFFD20134 0x # L2 RAM Timing 0 Register
+DATA 0xFFD20138 0x # L2 RAM Timing 1 Register
+DATA 0xFFD20154 0x0200 # CPU RAM Management Control3 Register
+DATA 0xFFD2014C 0x1C00 # CPU RAM Management Control1 Register
+DATA 0xFFD20148 0x0001 # CPU RAM Management Control0 Register
+
+#Dram initalization
+DATA 0xFFD01400 0x430004E0 # SDRAM Configuration Register
+# bit13-0:  0x4E0 (DDR2 clks refresh rate)
+# bit23-14: zero
+# bit24: 1= enable exit self refresh mode on DDR access
+# bit25: 1 required
+# bit29-26: zero
+# bit31-30: 01
+
+DATA 0xFFD01404 0x38543000 # DDR Controller Control Low
+# bit 3-0:  0 reserved
+# bit 4:0=addr/cmd in smame cycle
+# bit 5:0=clk is driven during self refresh, we don't care for APX
+# bit 6:0=use recommended falling edge of clk for addr/cmd
+# bit14:0=input buffer always powered up
+# bit18:1=cpu lock transaction enabled
+# bit23-20: 5=recommended value for CL=4 and STARTBURST_DEL disabled bit31=0
+# bit27-24: 8= CL+4, STARTBURST sample stages, for freqs 400MHz, unbuffered 
DIMM
+# bit30-28: 3 required
+# bit31:0=no additional STARTBURST delay
+
+DATA 0xFFD01408 0x2302433E # DDR Timing (Low) (active cycles value +1)
+# bit3-0:   TRAS lsbs
+# bit7-4:   TRCD
+# bit11- 8: TRP
+# bit15-12: TWR
+# bit19-16: TWTR
+# bit20:TRAS msb
+# bit23-21: 0x0
+# bit27-24: TRRD
+# bit31-28: TRTP
+
+DATA 0xFFD0140C 0x0A3E #  DDR Timing (High)
+# bit6-0:   TRFC
+# bit8-7:   TR2R
+# bit10-9:  TR2W
+# bit12-11: TW2W
+# bit31-13: zero required
+
+DATA 0xFFD01410 0x0001 #  DDR Address Control
+# bit1-0:   01, Cs0width=x16
+# bit3-2:   00, Cs0size=2Gb
+# bit5-4:   00, Cs2width=nonexistent
+# bit7-6:   00, Cs1size =nonexistent
+# bit9-8:   00, Cs2width=nonexistent
+# bit11-10: 00, Cs2size =nonexistent
+# bit13-12: 00, Cs3width=nonexistent
+# bit15-14: 00, Cs3size =nonexistent
+# bit16:0,  Cs0AddrSel
+# bit17:0,  Cs1AddrSel
+# bit18:0,  Cs2AddrSel
+# bit19:0,  Cs3AddrSel
+# bit31-20: 0 required
+
+DATA 0xFFD01414 0x #  DDR Open Pages Control
+# bit0:0,  OpenPage enabled
+# bit31-1: 0 required
+
+DATA 0xFFD01418 0x #  DDR Operation

[U-Boot] [PATCH 11/30] arm/km: remove last_stage_init and unneeded printouts

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

last_stage_init is not available for arm platforms. So move
the call to set_km_var to misc_init_r and remove this function.
Additionally some unneeded printouts were removed.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Prafulla Wadaskar 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 board/keymile/km_arm/km_arm.c |   13 +
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c
index c772ee2..a64cdd8 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -150,11 +150,6 @@ int misc_init_r(void)
char *str;
int mach_type;
 
-   puts("Piggy:");
-   if (ethernet_present() == 0)
-   puts (" not");
-   puts(" present\n");
-
str = getenv("mach_type");
if (str != NULL) {
mach_type = simple_strtoul(str, NULL, 10);
@@ -163,6 +158,7 @@ int misc_init_r(void)
}
 
initialize_unit_leds();
+   set_km_env();
 
return 0;
 }
@@ -182,7 +178,6 @@ int board_early_init_f(void)
writel(tmp | FLASH_GPIO_PIN , KW_GPIO0_BASE);
tmp = readl(KW_GPIO0_BASE + 4);
writel(tmp & (~FLASH_GPIO_PIN) , KW_GPIO0_BASE + 4);
-   printf("KM: setting NAND mode\n");
 
 #if defined(CONFIG_SOFT_I2C)
/* init the GPIO for I2C Bitbang driver */
@@ -212,12 +207,6 @@ int board_init(void)
return 0;
 }
 
-int last_stage_init(void)
-{
-   set_km_env();
-   return 0;
-}
-
 #if defined(CONFIG_CMD_SF)
 int do_spi_toggle(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-- 
1.7.0.5

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


[U-Boot] [PATCH 12/30] arm/km: add CRAMFS support for keymile boards

2011-04-08 Thread Valentin Longchamp
From: Heiko Schocher 

Signed-off-by: Heiko Schocher 
Signed-off-by: Holger Brunck 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Prafulla Wadaskar 
Signed-off-by: Valentin Longchamp 
---
 include/configs/keymile-common.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/configs/keymile-common.h b/include/configs/keymile-common.h
index cb6d0fb..6329a1c 100644
--- a/include/configs/keymile-common.h
+++ b/include/configs/keymile-common.h
@@ -136,6 +136,8 @@
 #define CONFIG_MTD_PARTITIONS
 #define CONFIG_MTD_DEVICE
 #define CONFIG_MTD_CONCAT
+#define CONFIG_CMD_CRAMFS
+#define CONFIG_CRAMFS_CMDLINE
 
 /* common powerpc specific env settings */
 #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
-- 
1.7.0.5

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


[U-Boot] [PATCH 26/30] arm, powerpc, keymile boards: move keymile specific header in subdir

2011-04-08 Thread Valentin Longchamp
From: Heiko Schocher 

Collect all keymile specific common headers in include/configs/km.

Signed-off-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Prafulla Wadaskar 
cc: Kim Phillips 
cc: Valentin Longchamp 
cc: Holger Brunck 
Signed-off-by: Valentin Longchamp 
---
 include/configs/{ => km}/keymile-common.h |0
 include/configs/{ => km}/km-powerpc.h |0
 include/configs/{ => km}/km82xx-common.h  |0
 include/configs/{ => km}/km8321-common.h  |0
 include/configs/{ => km}/km83xx-common.h  |0
 include/configs/{ => km}/km_arm.h |0
 include/configs/kmeter1.h |2 +-
 include/configs/kmsupx5.h |2 +-
 include/configs/mgcoge.h  |6 +++---
 include/configs/mgcoge2un.h   |2 +-
 include/configs/mgcoge3ne.h   |6 +++---
 include/configs/suen3.h   |2 +-
 include/configs/suen8.h   |2 +-
 include/configs/suvd3.h   |2 +-
 include/configs/tuda1.h   |2 +-
 include/configs/tuxa1.h   |2 +-
 16 files changed, 14 insertions(+), 14 deletions(-)
 rename include/configs/{ => km}/keymile-common.h (100%)
 rename include/configs/{ => km}/km-powerpc.h (100%)
 rename include/configs/{ => km}/km82xx-common.h (100%)
 rename include/configs/{ => km}/km8321-common.h (100%)
 rename include/configs/{ => km}/km83xx-common.h (100%)
 rename include/configs/{ => km}/km_arm.h (100%)

diff --git a/include/configs/keymile-common.h 
b/include/configs/km/keymile-common.h
similarity index 100%
rename from include/configs/keymile-common.h
rename to include/configs/km/keymile-common.h
diff --git a/include/configs/km-powerpc.h b/include/configs/km/km-powerpc.h
similarity index 100%
rename from include/configs/km-powerpc.h
rename to include/configs/km/km-powerpc.h
diff --git a/include/configs/km82xx-common.h 
b/include/configs/km/km82xx-common.h
similarity index 100%
rename from include/configs/km82xx-common.h
rename to include/configs/km/km82xx-common.h
diff --git a/include/configs/km8321-common.h 
b/include/configs/km/km8321-common.h
similarity index 100%
rename from include/configs/km8321-common.h
rename to include/configs/km/km8321-common.h
diff --git a/include/configs/km83xx-common.h 
b/include/configs/km/km83xx-common.h
similarity index 100%
rename from include/configs/km83xx-common.h
rename to include/configs/km/km83xx-common.h
diff --git a/include/configs/km_arm.h b/include/configs/km/km_arm.h
similarity index 100%
rename from include/configs/km_arm.h
rename to include/configs/km/km_arm.h
diff --git a/include/configs/kmeter1.h b/include/configs/kmeter1.h
index 2fcecaf..8639ddd 100644
--- a/include/configs/kmeter1.h
+++ b/include/configs/kmeter1.h
@@ -34,7 +34,7 @@
"netdev=eth2\0" \
 
 /* include common defines/options for all 83xx Keymile boards */
-#include "km83xx-common.h"
+#include "km/km83xx-common.h"
 
 #define CONFIG_MISC_INIT_R
 /*
diff --git a/include/configs/kmsupx5.h b/include/configs/kmsupx5.h
index 55ed3f6..f8cd8e0 100644
--- a/include/configs/kmsupx5.h
+++ b/include/configs/kmsupx5.h
@@ -36,7 +36,7 @@
 #defineCONFIG_SYS_TEXT_BASE0xF000
 
 /* include common defines/options for all 8321 Keymile boards */
-#include "km8321-common.h"
+#include "km/km8321-common.h"
 
 /*
  * Init Local Bus Memory Controller:
diff --git a/include/configs/mgcoge.h b/include/configs/mgcoge.h
index 0745855..b736c56 100644
--- a/include/configs/mgcoge.h
+++ b/include/configs/mgcoge.h
@@ -37,8 +37,8 @@
 #defineCONFIG_SYS_TEXT_BASE0xFE00
 
 /* include common defines/options for all Keymile boards */
-#include "keymile-common.h"
-#include "km-powerpc.h"
+#include "km/keymile-common.h"
+#include "km/km-powerpc.h"
 
 #define CONFIG_SYS_SDRAM_BASE  0x
 #define CONFIG_SYS_FLASH_BASE  0xFE00
@@ -88,6 +88,6 @@
 #define CONFIG_KM_BOARD_EXTRA_ENV  ""
 
 /* include further common stuff for all keymile 82xx boards */
-#include "km82xx-common.h"
+#include "km/km82xx-common.h"
 
 #endif /* __CONFIG_H */
diff --git a/include/configs/mgcoge2un.h b/include/configs/mgcoge2un.h
index d3c7bdc..6256035 100644
--- a/include/configs/mgcoge2un.h
+++ b/include/configs/mgcoge2un.h
@@ -35,7 +35,7 @@
 #define _CONFIG_MGCOGE2UN_H
 
 /* include common defines/options for all arm based Keymile boards */
-#include "km_arm.h"
+#include "km/km_arm.h"
 
 /*
  * Version number information
diff --git a/include/configs/mgcoge3ne.h b/include/configs/mgcoge3ne.h
index 78ce468..027754a 100644
--- a/include/configs/mgcoge3ne.h
+++ b/include/configs/mgcoge3ne.h
@@ -37,8 +37,8 @@
 #defineCONFIG_SYS_TEXT_BASE0xFE00
 
 /* include common defines/options for all Keymile boards */
-#include "keymile-common.h"
-#include "km-powerpc.h"
+#include "km/keymile-common.h"
+#include "km/km-powerpc.h"
 
 #define CONFIG_SYS_SDRAM_BASE  0x
 #define CONFIG_SYS_FLASH_BASE   

[U-Boot] [PATCH 10/30] arm/km: add addbootcount environment variable

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

This environment variable is used to set the bootcount address
for the kernel.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 board/keymile/common/common.c |7 +++
 include/configs/km_arm.h  |3 +++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 3a7980d..9ec0022 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -106,6 +106,13 @@ int set_km_env(void)
varaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM;
sprintf((char *)buf, "0x%x", varaddr);
setenv("varaddr", (char *)buf);
+
+#ifdef BOOTCOUNT_ADDR
+   unsigned int bootcountaddr;
+   bootcountaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM;
+   sprintf((char *)buf, "0x%x", bootcountaddr);
+   setenv("bootcountaddr", (char *)buf);
+#endif
return 0;
 }
 
diff --git a/include/configs/km_arm.h b/include/configs/km_arm.h
index 70113d4..89f9d35 100644
--- a/include/configs/km_arm.h
+++ b/include/configs/km_arm.h
@@ -64,6 +64,9 @@
 #define CONFIG_KM_KERNEL_ADDR  0x200   /* 4096KBytes */
 
 #define CONFIG_KM_DEF_ENV_CPU  \
+   "addbootcount=" \
+   "setenv bootargs ${bootargs} "  \
+   "bootcountaddr=${bootcountaddr}\0"  \
"addmtdparts=setenv bootargs ${bootargs} ${mtdparts}\0" \
"boot=bootm ${actual_kernel_addr} - -\0"\
"cramfsloadfdt=echo c\0"\
-- 
1.7.0.5

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


[U-Boot] [PATCH 15/30] arm/km: disable ls (through jffs2 support)

2011-04-08 Thread Valentin Longchamp
This is not supported on our km-arm boards since we have defined
CONFIG_SYS_NO_FLASH for our NAND Flash chip.

With CONFIG_CMD_JFFS2, the ls command is present and works very badly
on our km-arm boards.

Signed-off-by: Valentin Longchamp 
Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Prafulla Wadaskar 
---
 include/configs/km_arm.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/configs/km_arm.h b/include/configs/km_arm.h
index 89f9d35..a8a4d77 100644
--- a/include/configs/km_arm.h
+++ b/include/configs/km_arm.h
@@ -248,6 +248,7 @@ int get_scl (void);
 #if defined(CONFIG_SYS_NO_FLASH)
 #define CONFIG_KM_UBI_PARTITION_NAME   "ubi0"
 #undef CONFIG_FLASH_CFI_MTD
+#undef CONFIG_CMD_JFFS2
 #undef CONFIG_JFFS2_CMDLINE
 #endif
 
-- 
1.7.0.5

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


[U-Boot] [PATCH 16/30] arm/km: add second serial interface for kirkwood

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Prafulla Wadaskar 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 include/configs/km_arm.h |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/configs/km_arm.h b/include/configs/km_arm.h
index a8a4d77..06f91fe 100644
--- a/include/configs/km_arm.h
+++ b/include/configs/km_arm.h
@@ -92,6 +92,7 @@
 #define CONFIG_SYS_NS16550_REG_SIZE(-4)
 #define CONFIG_SYS_NS16550_CLK CONFIG_SYS_TCLK
 #define CONFIG_SYS_NS16550_COM1KW_UART0_BASE
+#define CONFIG_SYS_NS16550_COM2KW_UART1_BASE
 
 /*
  * Serial Port configuration
@@ -136,7 +137,12 @@
 
 #define BOOTFLASH_START0x0
 
+/* Kirkwood has two serial IF */
+#if (CONFIG_CONS_INDEX == 2)
+#define CONFIG_KM_CONSOLE_TTY  "ttyS1"
+#else
 #define CONFIG_KM_CONSOLE_TTY  "ttyS0"
+#endif
 
 /* size in bytes reserved for initial data */
 
-- 
1.7.0.5

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


[U-Boot] [PATCH 00/30] Keymile boards mainlining, part 2 (resend)

2011-04-08 Thread Valentin Longchamp
This series is the second effort of merging the Keymile boards support
back into mainline.

Most of the patches are only keymile relevant and should only affect our
boards.

There are also patches for the i2c deblocking support and cramfs for ARM.

The whole series is based on current denx-master with the our first patch
series posted by Heiko that was reviewed previous weeks and should still
be merged during the current merge window:

http://lists.denx.de/pipermail/u-boot/2011-April/089530.html

Heiko Schocher (5):
  lib, vsprintf: introduce strict_strtoul
  arm/km: add CRAMFS support for keymile boards
  cramfs: make cramfs usable without a NOR flash
  i2c, soft_i2c: deblock bus if switching to another i2c bus
  arm, powerpc, keymile boards: move keymile specific header in subdir

Holger Brunck (18):
  km/common: remove hdlc_enet implementation
  powerpc/km82xx: cleanup coding style for mgcoge.c
  powerpc/km82xx: rename mgcoge files to km82xx
  powerpc/km82xx: move SDRAM config to board config
  powerpc/km82xx: adapt CONFIG_SYSSYPCR to manual
  powerpc/km82xx: rename mgcoge2ne to mgcoge3ne board support
  poweprc/km82xx: add board specific environment variable
  arm/km: add addbootcount environment variable
  arm/km: remove last_stage_init and unneeded printouts
  arm/km: add second serial interface for kirkwood
  common/hush: make get_local_var visible for other users
  km/common: implement setboardid as a command
  km/common: add pnvramsize to default environment
  km/common: fix coding style issues in generic header
  km/common: simplify default environment
  arm/km: rename mgcoge2un to mgcoge3un
  arm/km: change default settings for egiga on mgcoge3un
  arm/km: update mgcoge3un board support

Huber, Andreas (1):
  powerpc/km82xx: add DIP switch detection

Stefan Bigler (1):
  i2c: add i2c deblock sequence before and after every mux config

Thomas Herzmann (2):
  km/common: fix initial_boot_bank for bootpackages
  km/common: replace env var checkboardidlist by function

Valentin Longchamp (3):
  arm/km: add mkimage config file for uart download
  arm/km: add BootROM config files for memphis SDRAM
  arm/km: disable ls (through jffs2 support)

 MAINTAINERS|4 +-
 board/keymile/common/common.c  |  156 ++-
 board/keymile/common/common.h  |   84 +++-
 board/keymile/common/keymile_hdlc_enet.c   |  620 
 board/keymile/{mgcoge => km82xx}/Makefile  |3 +-
 board/keymile/km82xx/km82xx.c  |  373 ++
 board/keymile/km_arm/km_arm.c  |   93 +++-
 board/keymile/km_arm/kwbimage-memphis-uart.cfg |  197 
 board/keymile/km_arm/kwbimage-memphis.cfg  |  197 
 board/keymile/km_arm/kwbimage-uart.cfg |  179 +++
 board/keymile/mgcoge/mgcoge.c  |  333 -
 board/keymile/mgcoge/mgcoge_hdlc_enet.c|  276 ---
 board/keymile/scripts/README   |   25 +
 board/keymile/scripts/debug-arm-env.txt|2 +
 board/keymile/scripts/debug-common-env.txt |9 +
 board/keymile/scripts/debug-ppc-env.txt|2 +
 boards.cfg |6 +-
 common/cmd_cramfs.c|   12 +-
 common/cmd_i2c.c   |   12 +
 common/hush.c  |3 +-
 drivers/i2c/soft_i2c.c |1 +
 drivers/net/mvgbe.h|2 +
 fs/cramfs/cramfs.c |4 +
 include/_exports.h |1 +
 include/common.h   |1 +
 include/configs/{ => km}/keymile-common.h  |  175 +--
 include/configs/{ => km}/km-powerpc.h  |   12 +-
 include/configs/{ => km}/km82xx-common.h   |   29 +-
 include/configs/{ => km}/km8321-common.h   |0
 include/configs/{ => km}/km83xx-common.h   |0
 include/configs/{ => km}/km_arm.h  |   25 +-
 include/configs/kmeter1.h  |2 +-
 include/configs/kmsupx5.h  |2 +-
 include/configs/mgcoge.h   |   35 ++-
 include/configs/{mgcoge2ne.h => mgcoge3ne.h}   |   57 ++-
 include/configs/{mgcoge2un.h => mgcoge3un.h}   |   37 ++-
 include/configs/suen3.h|2 +-
 include/configs/suen8.h|2 +-
 include/configs/suvd3.h|2 +-
 include/configs/tuda1.h|2 +-
 include/configs/tuxa1.h|2 +-
 include/exports.h  |1 +
 include/hush.h |1 +
 include/i2c.h  |2 -
 lib/vsprintf.c |   47 ++
 45 files changed, 1531 insertions(+), 1499 deletions(-)
 delete mode 100644 board/keymile/common/keymile_hdlc_enet.c
 rename board/key

Re: [U-Boot] [PATCH] Keymile boards mainlining, part 2

2011-04-08 Thread Valentin Longchamp
And my coworker made me notice that the renames are not correctly 
handled either, so I am going to resent this whole series directly.

Please excuse me for the spam and inconvenience.

Valentin Longchamp wrote:
> Sorry, the whole series is not numbered, -N statt -n ... it will be 
> corrected for the very likely v2 of the series posting.
> 
> Valentin Longchamp wrote:
>> This series is the second effort of merging the Keymile boards support
>> back into mainline.
>>
>> Most of the patches are only keymile relevant and should only affect our
>> boards.
>>
>> There are also patches for the i2c deblocking support and cramfs for ARM.
>>
>> The whole series is based on current denx-master with the our first patch
>> series posted by Heiko that was reviewed previous weeks and should still
>> be merged during the current merge window:
>>
>> http://lists.denx.de/pipermail/u-boot/2011-April/089530.html
>>
>> Heiko Schocher (5):
>>   lib, vsprintf: introduce strict_strtoul
>>   arm/km: add CRAMFS support for keymile boards
>>   cramfs: make cramfs usable without a NOR flash
>>   i2c, soft_i2c: deblock bus if switching to another i2c bus
>>   arm, powerpc, keymile boards: move keymile specific header in subdir
>>
>> Holger Brunck (18):
>>   km/common: remove hdlc_enet implementation
>>   powerpc/km82xx: cleanup coding style for mgcoge.c
>>   powerpc/km82xx: rename mgcoge files to km82xx
>>   powerpc/km82xx: move SDRAM config to board config
>>   powerpc/km82xx: adapt CONFIG_SYSSYPCR to manual
>>   powerpc/km82xx: rename mgcoge2ne to mgcoge3ne board support
>>   poweprc/km82xx: add board specific environment variable
>>   arm/km: add addbootcount environment variable
>>   arm/km: remove last_stage_init and unneeded printouts
>>   arm/km: add second serial interface for kirkwood
>>   common/hush: make get_local_var visible for other users
>>   km/common: implement setboardid as a command
>>   km/common: add pnvramsize to default environment
>>   km/common: fix coding style issues in generic header
>>   km/common: simplify default environment
>>   arm/km: rename mgcoge2un to mgcoge3un
>>   arm/km: change default settings for egiga on mgcoge3un
>>   arm/km: update mgcoge3un board support
>>
>> Huber, Andreas (1):
>>   powerpc/km82xx: add DIP switch detection
>>
>> Stefan Bigler (1):
>>   i2c: add i2c deblock sequence before and after every mux config
>>
>> Thomas Herzmann (2):
>>   km/common: fix initial_boot_bank for bootpackages
>>   km/common: replace env var checkboardidlist by function
>>
>> Valentin Longchamp (3):
>>   arm/km: add mkimage config file for uart download
>>   arm/km: add BootROM config files for memphis SDRAM
>>   arm/km: disable ls (through jffs2 support)
>>
>>  MAINTAINERS|4 +-
>>  board/keymile/common/common.c  |  156 ++-
>>  board/keymile/common/common.h  |   84 +++-
>>  board/keymile/common/keymile_hdlc_enet.c   |  620 
>> 
>>  board/keymile/km82xx/Makefile  |   53 ++
>>  board/keymile/km82xx/km82xx.c  |  373 ++
>>  board/keymile/km_arm/km_arm.c  |   93 +++-
>>  board/keymile/km_arm/kwbimage-memphis-uart.cfg |  197 
>>  board/keymile/km_arm/kwbimage-memphis.cfg  |  197 
>>  board/keymile/km_arm/kwbimage-uart.cfg |  179 +++
>>  board/keymile/mgcoge/Makefile  |   54 --
>>  board/keymile/mgcoge/mgcoge.c  |  333 -
>>  board/keymile/mgcoge/mgcoge_hdlc_enet.c|  276 ---
>>  board/keymile/scripts/README   |   25 +
>>  board/keymile/scripts/debug-arm-env.txt|2 +
>>  board/keymile/scripts/debug-common-env.txt |9 +
>>  board/keymile/scripts/debug-ppc-env.txt|2 +
>>  boards.cfg |6 +-
>>  common/cmd_cramfs.c|   12 +-
>>  common/cmd_i2c.c   |   12 +
>>  common/hush.c  |3 +-
>>  drivers/i2c/soft_i2c.c |1 +
>>  drivers/net/mvgbe.h|2 +
>>  fs/cramfs/cramfs.c |4 +
>>  include/_exports.h |1 +
>>  include/common.h   |1 +
>>  include/configs/keymile-common.h   |  455 -
>>  include/configs/km-powerpc.h   |   92 
>>  include/configs/km/keymile-common.h|  328 +
>>  include/configs/km/km-powerpc.h|   88 
>>  include/configs/km/km82xx-common.h |  311 
>>  include/configs/km/km8321-common.h |  137 ++
>>  include/configs/km/km83xx-common.h |  325 +
>>  include/configs/km/km_arm.h|  275 +++
>>  include/configs/km82xx-common.h|  336 -
>

Re: [U-Boot] get ram size/end in env var

2011-04-08 Thread Fabian Cenedese
At 15:47 18.03.2011 +0100, Fabian Cenedese wrote:
>Hi
>
>I want to add in my board's config header an environment command
>that needs the ram end address (or ram size as ram starts at 0).
>As the sdram size can differ I'd like to get it at runtime and then
>jump there with the "go" command (minus some offset). How
>could I do that?

I was wondering if anybody had an idea. I don't know what commands
are possible.

Thanks

bye  Fabi

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


[U-Boot] [Nios] Pull Request

2011-04-08 Thread Scott McNutt
Dear Wolfgang,

The following changes since commit 4db2fa7f9446d0f2fe8db3d62184b1212fe22707:
   Wolfgang Denk (1):
 Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx

are available in the git repository at:

   git://git.denx.de/u-boot-nios.git next

Thomas Chou (1):
   nios2: reset cfi flash before reading env

  board/altera/nios2-generic/nios2-generic.c |   16 
  1 files changed, 16 insertions(+), 0 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] km/common: fix coding style issues in generic header

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 include/configs/keymile-common.h |4 ++--
 include/configs/km_arm.h |   10 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/configs/keymile-common.h b/include/configs/keymile-common.h
index a6d3bcf..b313b2e 100644
--- a/include/configs/keymile-common.h
+++ b/include/configs/keymile-common.h
@@ -86,7 +86,7 @@
 #define CONFIG_SYS_HZ  1000/* decr. freq: 1 ms ticks */
 
 #define CONFIG_BAUDRATE115200
-#define CONFIG_SYS_BAUDRATE_TABLE  { 9600, 19200, 38400, 57600, 115200, 
230400 }
+#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
 
 #define CONFIG_LOADS_ECHO
 #define CONFIG_SYS_LOADS_BAUD_CHANGE
@@ -425,6 +425,6 @@
""
 #endif /* CONFIG_KM_DEF_ENV */
 
-#define CONFIG_VERSION_VARIABLE/* include version env variable */
+#define CONFIG_VERSION_VARIABLE/* include version env variable */
 
 #endif /* __CONFIG_KEYMILE_H */
diff --git a/include/configs/km_arm.h b/include/configs/km_arm.h
index 06f91fe..0148b24 100644
--- a/include/configs/km_arm.h
+++ b/include/configs/km_arm.h
@@ -110,7 +110,7 @@
 #define CONFIG_BOOTMAPSZ   (8 << 20)   /* Initial Memmap for Linux */
 #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs  */
 #define CONFIG_INITRD_TAG  /* enable INITRD tag */
-#define CONFIG_SETUP_MEMORY_TAGS   /* enable memory tag */
+#define CONFIG_SETUP_MEMORY_TAGS   /* enable memory tag */
 
 /*
  * Commands configuration
@@ -185,10 +185,10 @@
 #ifndef __ASSEMBLY__
 #include 
 extern void __set_direction(unsigned pin, int high);
-void set_sda (int state);
-void set_scl (int state);
-int get_sda (void);
-int get_scl (void);
+void set_sda(int state);
+void set_scl(int state);
+int get_sda(void);
+int get_scl(void);
 #define KM_KIRKWOOD_SDA_PIN8
 #define KM_KIRKWOOD_SCL_PIN9
 #define KM_KIRKWOOD_ENV_WP 38
-- 
1.7.0.5

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


[U-Boot] [PATCH] km/common: simplify default environment

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

This is a first step to simplify the default environment. Move all
the environment variables which are only needed for debugging
purpose to textfiles in the scripts directory. In case of debugging
these files can be loaded via tftp into RAM and set via the env import
command. Other variables are identified as obsolete and were removed.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 board/keymile/scripts/README   |   25 ++
 board/keymile/scripts/debug-arm-env.txt|2 +
 board/keymile/scripts/debug-common-env.txt |9 ++
 board/keymile/scripts/debug-ppc-env.txt|2 +
 include/configs/km/keymile-common.h|  128 +++-
 include/configs/km/km-powerpc.h|   12 +--
 include/configs/km/km_arm.h|5 +-
 7 files changed, 57 insertions(+), 126 deletions(-)
 create mode 100644 board/keymile/scripts/README
 create mode 100644 board/keymile/scripts/debug-arm-env.txt
 create mode 100644 board/keymile/scripts/debug-common-env.txt
 create mode 100644 board/keymile/scripts/debug-ppc-env.txt

diff --git a/board/keymile/scripts/README b/board/keymile/scripts/README
new file mode 100644
index 000..ce6d79a
--- /dev/null
+++ b/board/keymile/scripts/README
@@ -0,0 +1,25 @@
+debug-common-env.txt
+
+This file defines environment variables which are valid for powerpc boards
+and for arm boards.
+
+addramfs: add phram device for the rootfilesysten in ram
+develop: for development, laod kernel via tftp and mount  rootfs via NFS
+nfsargs: default arguments for nfs boot
+ramfs: load rootfilesystem in RAM  kernel
+rootfsfile: loacation of the rootfs file for ramfs
+setramfspram: compute PRAM size for ramfs target
+setrootfsaddr: compute rootfilesystem address for phram
+tftpkernel: load a kernel with tftp into ram
+tftpramfs: load rootfs with tftp into ram
+
+debug-ppc-env.txt
+
+fdt_file: location of the dtb file on the tftp server
+tftpfdt: load dtb file and set fdt address
+
+debug-arm-env.txt
+
+tftpfdt: for arm only a dummy variable, because we have no fdt on arm
+
+
diff --git a/board/keymile/scripts/debug-arm-env.txt 
b/board/keymile/scripts/debug-arm-env.txt
new file mode 100644
index 000..84498af
--- /dev/null
+++ b/board/keymile/scripts/debug-arm-env.txt
@@ -0,0 +1,2 @@
+debug_env_common=tftpboot 0x20 scripts/debug-common-env.txt && env import 
-t 0x20 ${filesize}
+tftpfdt=true
diff --git a/board/keymile/scripts/debug-common-env.txt 
b/board/keymile/scripts/debug-common-env.txt
new file mode 100644
index 000..1fd4b0c
--- /dev/null
+++ b/board/keymile/scripts/debug-common-env.txt
@@ -0,0 +1,9 @@
+addramfs=setenv bootargs "${bootargs} 
phram.phram=rootfs${boot_bank},${rootfsaddr},${rootfssize}"
+develop=setenv subbootcmds "tftpfdt tftpkernel nfsargs ${commonargs} boot " && 
setenv bootcmd 'run bootrunner' && setenv altbootcmd 'run bootcmd' && 
km_setboardid && saveenv && reset
+nfsargs=setenv bootargs ubi.mtd=ubi0 root=/dev/nfs rw 
nfsroot=${serverip}:${rootpath}
+ramfs=setenv actual_bank -1 && setenv subbootcmds "tftpfdt tftpkernel 
setrootfsaddr tftpramfs flashargs ${commonargs} addpanic addramfs boot " && 
setenv bootcmd 'run bootrunner' && setenv altbootcmd 'run bootcmd' && run 
setboardid && run setramfspram && run setpnvramaddr && saveenv && reset
+rootfsfile=${hostname}/rootfsImage
+setramfspram=setexpr value 0 + ${reservedpram} && setexpr value 0x${value} + 
${rootfssize} && setexpr value 0x${value} + ${varsize} && setexpr value 
0x${value} + ${pnvramsize} && setexpr value 0x${value} / 0x400 && setenv pram 
0x${value}
+tftpkernel=tftpboot ${kernel_addr_r} ${hostname}/uImage && setenv 
actual_kernel_addr ${kernel_addr_r}
+tftpramfs=tftpboot ${rootfsaddr} ${hostname}/rootfsImage && setenv loadaddr
+setrootfsaddr=setexpr value ${pnvramsize} - ${rootfssize} && setenv rootfsaddr 
0x${value}
diff --git a/board/keymile/scripts/debug-ppc-env.txt 
b/board/keymile/scripts/debug-ppc-env.txt
new file mode 100644
index 000..3c06ff1
--- /dev/null
+++ b/board/keymile/scripts/debug-ppc-env.txt
@@ -0,0 +1,2 @@
+debug_env_common=tftpboot 0x20 scripts/debug-common-env.txt && env import 
-t 0x20 ${filesize}
+tftpfdt=tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb && setenv 
actual_fdt_addr ${fdt_addr_r}
diff --git a/include/configs/km/keymile-common.h 
b/include/configs/km/keymile-common.h
index b313b2e..89f2d14 100644
--- a/include/configs/km/keymile-common.h
+++ b/include/configs/km/keymile-common.h
@@ -171,13 +171,8 @@
"break=0; " \
"for subbootcmd in ${subbootcmds}; do " \
"if test ${break} -eq 0; then; "\
-   "echo \"[INFO] running \\c\"; " 

[U-Boot] [PATCH] km/common: add pnvramsize to default environment

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

The pnvram size was used later from start scripts in linux. Therefore
it must be set inside u-boot.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 board/keymile/common/common.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 72278a0..da73f66 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -100,6 +100,9 @@ int set_km_env(void)
sprintf((char *)buf, "0x%x", pnvramaddr);
setenv("pnvramaddr", (char *)buf);
 
+   sprintf((char *)buf, "0x%x", CONFIG_KM_PNVRAM);
+   setenv("pnvramsize", (char *)buf);
+
pram = (CONFIG_KM_RESERVED_PRAM + CONFIG_KM_PHRAM + CONFIG_KM_PNVRAM) /
0x400;
sprintf((char *)buf, "0x%x", pram);
-- 
1.7.0.5

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


[U-Boot] [PATCH] km/common: remove hdlc_enet implementation

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

The hdlc implementation for mgcoge was initially developed,
but later on not used. Remove the C files, the references
in mgcoge.c and the Makefile to decrease maintenance effort.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 board/keymile/common/common.c|3 -
 board/keymile/common/common.h|4 -
 board/keymile/common/keymile_hdlc_enet.c |  620 --
 board/keymile/mgcoge/Makefile|3 +-
 board/keymile/mgcoge/mgcoge_hdlc_enet.c  |  276 -
 5 files changed, 1 insertions(+), 905 deletions(-)
 delete mode 100644 board/keymile/common/keymile_hdlc_enet.c
 delete mode 100644 board/keymile/mgcoge/mgcoge_hdlc_enet.c

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 3908e63..b113c0a 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -677,9 +677,6 @@ int ethernet_present(void)
 
 int board_eth_init(bd_t *bis)
 {
-#ifdef CONFIG_KEYMILE_HDLC_ENET
-   (void)keymile_hdlc_enet_initialize(bis);
-#endif
if (ethernet_present())
return cpu_eth_init(bis);
 
diff --git a/board/keymile/common/common.h b/board/keymile/common/common.h
index cdc35b6..6ce992a 100644
--- a/board/keymile/common/common.h
+++ b/board/keymile/common/common.h
@@ -125,10 +125,6 @@ struct bfticu_iomap {
 int ethernet_present(void);
 int ivm_read_eeprom(void);
 
-#ifdef CONFIG_KEYMILE_HDLC_ENET
-int keymile_hdlc_enet_initialize(bd_t *bis);
-#endif
-
 int set_km_env(void);
 int fdt_set_node_and_value(void *blob,
char *nodename,
diff --git a/board/keymile/common/keymile_hdlc_enet.c 
b/board/keymile/common/keymile_hdlc_enet.c
deleted file mode 100644
index a545211..000
--- a/board/keymile/common/keymile_hdlc_enet.c
+++ /dev/null
@@ -1,620 +0,0 @@
-/*
- * (C) Copyright 2008
- * Gary Jennejohn, DENX Software Engineering GmbH, ga...@denx.de.
- *
- * Based in part on arch/powerpc/cpu/mpc8260/ether_scc.c.
- *
- * 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 
-
-#ifdef CONFIG_KEYMILE_HDLC_ENET
-#ifdef TEST_IT
-#include 
-#endif
-
-#include "keymile_hdlc_enet.h"
-
-extern char keymile_slot;  /* our slot number in the backplane */
-
-/* Allow up to about 50 ms for sending */
-#define TOUT_LOOP  5
-
-/*
- * Since, except during initialization, ethact is always HDLC
- * while we're in the driver, just use serial_printf() everywhere for
- * output.  This avoids possible conflicts when netconsole is being
- * used.
- */
-#define dprintf(fmt, args...)  serial_printf(fmt, ##args)
-
-/* Cannot use the storage from net.c because we allocate larger buffers */
-static volatile uchar MyPktBuf[HDLC_PKTBUFSRX * PKT_MAXBLR_SIZE + PKTALIGN];
-static volatile uchar *MyRxPackets[HDLC_PKTBUFSRX]; /* Receive packet */
-
-static unsigned int keymile_rxIdx; /* index of the current RX buffer */
-
-static IPaddr_t cachedNumbers[CACHEDNUMBERS]; /* 4 bytes per entry */
-void initCachedNumbers(int);
-
-/*
-  * SCC Ethernet Tx and Rx buffer descriptors allocated at the
-  *  immr->udata_bd address on Dual-Port RAM
-  * Provide for Double Buffering
-  */
-typedef volatile struct CommonBufferDescriptor {
-cbd_t txbd;/* Tx BD */
-cbd_t rxbd[HDLC_PKTBUFSRX];/* Rx BD */
-} RTXBD;
-
-/*
- * This must be extern because it is allocated in DPRAM using CPM-sepcific
- * code.
- */
-static RTXBD *rtx;
-
-static int keymile_hdlc_enet_send(struct eth_device *, volatile void *, int);
-static int keymile_hdlc_enet_recv(struct eth_device *);
-void keymile_hdlc_enet_init_bds(RTXBD *);
-extern int keymile_hdlc_enet_init(struct eth_device *, bd_t *);
-extern void keymile_hdlc_enet_halt(struct eth_device *);
-
-/* flags in the buffer descriptor not defined anywhere else */
-#define BD_SC_CT   BD_SC_CD
-#define BD_SC_CR   0x04
-#define BD_SC_DE   0x80
-#ifndef BD_SC_TC
-#define BD_SC_TC   ((ushort)0x0400)/* Transmit CRC */
-#endif
-#define BD_SC_FIRSTBD_SC_TC
-#define BD_SC_STATS (BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_CR | 

[U-Boot] [PATCH] Keymile boards mainlining, part 2

2011-04-08 Thread Valentin Longchamp
This series is the second effort of merging the Keymile boards support
back into mainline.

Most of the patches are only keymile relevant and should only affect our
boards.

There are also patches for the i2c deblocking support and cramfs for ARM.

The whole series is based on current denx-master with the our first patch
series posted by Heiko that was reviewed previous weeks and should still
be merged during the current merge window:

http://lists.denx.de/pipermail/u-boot/2011-April/089530.html

Heiko Schocher (5):
  lib, vsprintf: introduce strict_strtoul
  arm/km: add CRAMFS support for keymile boards
  cramfs: make cramfs usable without a NOR flash
  i2c, soft_i2c: deblock bus if switching to another i2c bus
  arm, powerpc, keymile boards: move keymile specific header in subdir

Holger Brunck (18):
  km/common: remove hdlc_enet implementation
  powerpc/km82xx: cleanup coding style for mgcoge.c
  powerpc/km82xx: rename mgcoge files to km82xx
  powerpc/km82xx: move SDRAM config to board config
  powerpc/km82xx: adapt CONFIG_SYSSYPCR to manual
  powerpc/km82xx: rename mgcoge2ne to mgcoge3ne board support
  poweprc/km82xx: add board specific environment variable
  arm/km: add addbootcount environment variable
  arm/km: remove last_stage_init and unneeded printouts
  arm/km: add second serial interface for kirkwood
  common/hush: make get_local_var visible for other users
  km/common: implement setboardid as a command
  km/common: add pnvramsize to default environment
  km/common: fix coding style issues in generic header
  km/common: simplify default environment
  arm/km: rename mgcoge2un to mgcoge3un
  arm/km: change default settings for egiga on mgcoge3un
  arm/km: update mgcoge3un board support

Huber, Andreas (1):
  powerpc/km82xx: add DIP switch detection

Stefan Bigler (1):
  i2c: add i2c deblock sequence before and after every mux config

Thomas Herzmann (2):
  km/common: fix initial_boot_bank for bootpackages
  km/common: replace env var checkboardidlist by function

Valentin Longchamp (3):
  arm/km: add mkimage config file for uart download
  arm/km: add BootROM config files for memphis SDRAM
  arm/km: disable ls (through jffs2 support)

 MAINTAINERS|4 +-
 board/keymile/common/common.c  |  156 ++-
 board/keymile/common/common.h  |   84 +++-
 board/keymile/common/keymile_hdlc_enet.c   |  620 
 board/keymile/km82xx/Makefile  |   53 ++
 board/keymile/km82xx/km82xx.c  |  373 ++
 board/keymile/km_arm/km_arm.c  |   93 +++-
 board/keymile/km_arm/kwbimage-memphis-uart.cfg |  197 
 board/keymile/km_arm/kwbimage-memphis.cfg  |  197 
 board/keymile/km_arm/kwbimage-uart.cfg |  179 +++
 board/keymile/mgcoge/Makefile  |   54 --
 board/keymile/mgcoge/mgcoge.c  |  333 -
 board/keymile/mgcoge/mgcoge_hdlc_enet.c|  276 ---
 board/keymile/scripts/README   |   25 +
 board/keymile/scripts/debug-arm-env.txt|2 +
 board/keymile/scripts/debug-common-env.txt |9 +
 board/keymile/scripts/debug-ppc-env.txt|2 +
 boards.cfg |6 +-
 common/cmd_cramfs.c|   12 +-
 common/cmd_i2c.c   |   12 +
 common/hush.c  |3 +-
 drivers/i2c/soft_i2c.c |1 +
 drivers/net/mvgbe.h|2 +
 fs/cramfs/cramfs.c |4 +
 include/_exports.h |1 +
 include/common.h   |1 +
 include/configs/keymile-common.h   |  455 -
 include/configs/km-powerpc.h   |   92 
 include/configs/km/keymile-common.h|  328 +
 include/configs/km/km-powerpc.h|   88 
 include/configs/km/km82xx-common.h |  311 
 include/configs/km/km8321-common.h |  137 ++
 include/configs/km/km83xx-common.h |  325 +
 include/configs/km/km_arm.h|  275 +++
 include/configs/km82xx-common.h|  336 -
 include/configs/km8321-common.h|  137 --
 include/configs/km83xx-common.h|  325 -
 include/configs/km_arm.h   |  266 --
 include/configs/kmeter1.h  |2 +-
 include/configs/kmsupx5.h  |2 +-
 include/configs/mgcoge.h   |   35 ++-
 include/configs/mgcoge2ne.h|   64 ---
 include/configs/mgcoge2un.h|   65 ---
 include/configs/mgcoge3ne.h|   97 
 include/configs/mgcoge3un.h|   90 
 include/configs/suen3.h 

[U-Boot] [PATCH] lib, vsprintf: introduce strict_strtoul

2011-04-08 Thread Valentin Longchamp
From: Heiko Schocher 

as checkpatch proposes to use strict_strtoul instead of
simple_strtoul, introduce it.

Signed-off-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
cc: Holger Brunck 
Signed-off-by: Valentin Longchamp 
---
 include/_exports.h |1 +
 include/common.h   |1 +
 include/exports.h  |1 +
 lib/vsprintf.c |   47 +++
 4 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/include/_exports.h b/include/_exports.h
index d89b65b..349a3c5 100644
--- a/include/_exports.h
+++ b/include/_exports.h
@@ -19,6 +19,7 @@ EXPORT_FUNC(do_reset)
 EXPORT_FUNC(getenv)
 EXPORT_FUNC(setenv)
 EXPORT_FUNC(simple_strtoul)
+EXPORT_FUNC(strict_strtoul)
 EXPORT_FUNC(simple_strtol)
 EXPORT_FUNC(strcmp)
 EXPORT_FUNC(i2c_write)
diff --git a/include/common.h b/include/common.h
index 49c884c..d180da2 100644
--- a/include/common.h
+++ b/include/common.h
@@ -648,6 +648,7 @@ voidudelay(unsigned long);
 
 /* lib/vsprintf.c */
 ulong  simple_strtoul(const char *cp,char **endp,unsigned int base);
+int strict_strtoul(const char *cp, unsigned int base, unsigned long *res);
 unsigned long long simple_strtoull(const char *cp,char **endp,unsigned int 
base);
 long   simple_strtol(const char *cp,char **endp,unsigned int base);
 void   panic(const char *fmt, ...)
diff --git a/include/exports.h b/include/exports.h
index 6382311..2f49cea 100644
--- a/include/exports.h
+++ b/include/exports.h
@@ -20,6 +20,7 @@ void __udelay(unsigned long);
 unsigned long get_timer(unsigned long);
 int vprintf(const char *, va_list);
 unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base);
+int strict_strtoul(const char *cp, unsigned int base, unsigned long *res);
 char *getenv (char *name);
 int setenv (char *varname, char *varvalue);
 long simple_strtol(const char *cp,char **endp,unsigned int base);
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 61e6f0d..0eda799 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #if !defined (CONFIG_PANIC_HANG)
@@ -61,6 +62,52 @@ unsigned long simple_strtoul(const char *cp,char 
**endp,unsigned int base)
return result;
 }
 
+/**
+ * strict_strtoul - convert a string to an unsigned long strictly
+ * @cp: The string to be converted
+ * @base: The number base to use
+ * @res: The converted result value
+ *
+ * strict_strtoul converts a string to an unsigned long only if the
+ * string is really an unsigned long string, any string containing
+ * any invalid char at the tail will be rejected and -EINVAL is returned,
+ * only a newline char at the tail is acceptible because people generally
+ * change a module parameter in the following way:
+ *
+ *  echo 1024 > /sys/module/e1000/parameters/copybreak
+ *
+ * echo will append a newline to the tail.
+ *
+ * It returns 0 if conversion is successful and *res is set to the converted
+ * value, otherwise it returns -EINVAL and *res is set to 0.
+ *
+ * simple_strtoul just ignores the successive invalid characters and
+ * return the converted value of prefix part of the string.
+ */
+int strict_strtoul(const char *cp, unsigned int base, unsigned long *res)
+{
+   char *tail;
+   unsigned long val;
+   size_t len;
+
+   *res = 0;
+   len = strlen(cp);
+   if (len == 0)
+   return -EINVAL;
+
+   val = simple_strtoul(cp, &tail, base);
+   if (tail == cp)
+   return -EINVAL;
+
+   if ((*tail == '\0') ||
+   ((len == (size_t)(tail - cp) + 1) && (*tail == '\n'))) {
+   *res = val;
+   return 0;
+   }
+
+   return -EINVAL;
+}
+
 long simple_strtol(const char *cp,char **endp,unsigned int base)
 {
if(*cp=='-')
-- 
1.7.0.5

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


[U-Boot] [PATCH] arm/km: add addbootcount environment variable

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

This environment variable is used to set the bootcount address
for the kernel.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 board/keymile/common/common.c |7 +++
 include/configs/km_arm.h  |3 +++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 3a7980d..9ec0022 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -106,6 +106,13 @@ int set_km_env(void)
varaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM;
sprintf((char *)buf, "0x%x", varaddr);
setenv("varaddr", (char *)buf);
+
+#ifdef BOOTCOUNT_ADDR
+   unsigned int bootcountaddr;
+   bootcountaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM;
+   sprintf((char *)buf, "0x%x", bootcountaddr);
+   setenv("bootcountaddr", (char *)buf);
+#endif
return 0;
 }
 
diff --git a/include/configs/km_arm.h b/include/configs/km_arm.h
index 70113d4..89f9d35 100644
--- a/include/configs/km_arm.h
+++ b/include/configs/km_arm.h
@@ -64,6 +64,9 @@
 #define CONFIG_KM_KERNEL_ADDR  0x200   /* 4096KBytes */
 
 #define CONFIG_KM_DEF_ENV_CPU  \
+   "addbootcount=" \
+   "setenv bootargs ${bootargs} "  \
+   "bootcountaddr=${bootcountaddr}\0"  \
"addmtdparts=setenv bootargs ${bootargs} ${mtdparts}\0" \
"boot=bootm ${actual_kernel_addr} - -\0"\
"cramfsloadfdt=echo c\0"\
-- 
1.7.0.5

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


[U-Boot] [PATCH] powerpc/km82xx: rename mgcoge2ne to mgcoge3ne board support

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

This patch rename mgcoge2ne board support to mgcoge3ne.
The board is similar to mgcoge. The difference is that
a NUMONYX flash is used and a larger SDRAM (256MB).
Also introduce CONFIG_KM_82XX to collect ppc82xx common
settings.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 MAINTAINERS   |2 +-
 board/keymile/common/common.c |6 +-
 board/keymile/common/common.h |1 +
 board/keymile/km82xx/km82xx.c |   27 
 boards.cfg|2 +-
 include/configs/mgcoge.h  |1 +
 include/configs/mgcoge2ne.h   |   87 -
 include/configs/mgcoge3ne.h   |   95 +
 8 files changed, 129 insertions(+), 92 deletions(-)
 delete mode 100644 include/configs/mgcoge2ne.h
 create mode 100644 include/configs/mgcoge3ne.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 9586bcb..37e03c9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -429,7 +429,7 @@ Heiko Schocher 
kmeter1 MPC8360
kmsupx5 MPC8321
mgcoge  MPC8247
-   mgcoge2ne   MPC8247
+   mgcoge3ne   MPC8247
mgcoge2un   ARM926EJS (Kirkwood SoC)
mucmc52 MPC5200
muas3001MPC8270
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index b113c0a..3a7980d 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -22,7 +22,7 @@
  */
 
 #include 
-#if defined(CONFIG_MGCOGE) || defined(CONFIG_MGCOGE2NE)
+#if defined(CONFIG_KM82XX)
 #include 
 #endif
 #include 
@@ -398,10 +398,10 @@ int ivm_read_eeprom(void)
 #define DELAY_ABORT_SEQ62  /* @200kHz 9 clocks = 44us, 62us is 
ok */
 #define DELAY_HALF_PERIOD  (500 / (CONFIG_SYS_I2C_SPEED / 1000))
 
-#if defined(CONFIG_MGCOGE) || defined(CONFIG_MGCOGE2NE)
+#if defined(CONFIG_KM_82XX)
 #define SDA_MASK   0x0001
 #define SCL_MASK   0x0002
-static void set_pin(int state, unsigned long mask)
+void set_pin(int state, unsigned long mask)
 {
ioport_t *iop = ioport_addr((immap_t *)CONFIG_SYS_IMMR, 3);
 
diff --git a/board/keymile/common/common.h b/board/keymile/common/common.h
index 6ce992a..cee24d4 100644
--- a/board/keymile/common/common.h
+++ b/board/keymile/common/common.h
@@ -124,6 +124,7 @@ struct bfticu_iomap {
 
 int ethernet_present(void);
 int ivm_read_eeprom(void);
+void set_pin(int state, unsigned long mask);
 
 int set_km_env(void);
 int fdt_set_node_and_value(void *blob,
diff --git a/board/keymile/km82xx/km82xx.c b/board/keymile/km82xx/km82xx.c
index 3db3c7b..5dc7ffa 100644
--- a/board/keymile/km82xx/km82xx.c
+++ b/board/keymile/km82xx/km82xx.c
@@ -287,6 +287,8 @@ int checkboard(void)
 {
 #if defined(CONFIG_MGCOGE)
puts("Board: Keymile mgcoge");
+#elif defined(CONFIG_MGCOGE3NE)
+   puts("Board: Keymile mgcoge3ne");
 #else
puts("Board: Keymile mgcoge2ne");
 #endif
@@ -296,6 +298,28 @@ int checkboard(void)
return 0;
 }
 
+#ifdef CONFIG_MGCOGE3NE
+/*
+ * For mgcoge3ne boards, the mgcoge3un control is controlled from
+ * a GPIO line on the PPC CPU. If bobcatreset is set the line
+ * will toggle once what forces the mgocge3un part to restart
+ * immediately.
+ */
+void handle_mgcoge3un_reset(void)
+{
+   char *bobcatreset = getenv("bobcatreset");
+   if (bobcatreset) {
+   if (strcmp(bobcatreset, "true") == 0) {
+   puts("Forcing bobcat reset\n");
+   set_pin(0, 0x0004); /* clear PD29 to reset arm */
+   udelay(1000);
+   set_pin(1, 0x0004);
+   } else
+   set_pin(1, 0x0004); /* set PD29 to not reset arm */
+   }
+}
+#endif
+
 /*
  * Early board initalization.
  */
@@ -311,6 +335,9 @@ int board_early_init_r(void)
out_8(&base->oprtl, (H_OPORTS_SCC4_ENA | H_OPORTS_SCC4_FD_ENA |
H_OPORTS_FCC1_PW_DWN));
 
+#ifdef CONFIG_MGCOGE3NE
+   handle_mgcoge3un_reset();
+#endif
return 0;
 }
 
diff --git a/boards.cfg b/boards.cfg
index 4c52770..f6105be 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -423,7 +423,7 @@ PQ2FADS-ZU_66MHz_lowboot powerpc mpc8260 
mpc8260ads  freesca
 PQ2FADS-ZU_lowboot   powerpc mpc8260 mpc8260ads  
freescale  -   
MPC8260ADS:ADSTYPE=CONFIG_SYS_PQ2FADS,SYS_TEXT_BASE=0xFF80
 VoVPN-GW_66MHz   powerpc mpc8260 vovpn-gw
funkwerk   -   VoVPN-GW:CLKIN_66MHz
 mgcoge   powerpc mpc8260 km82xx  
keymile
-mgcoge2nepowerpc mpc8260 km82xx  
keymile
+mgcoge3nepowerpc mpc8260 km82xx  
keymile
 SCM  powerpc mpc8260 -   
siemens
 T

[U-Boot] [PATCH] km/common: implement setboardid as a command

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

Read out board id and HW key from the IVM eeprom and set
these values as an environment variable was now done inside the
code as a command.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 board/keymile/common/common.c |   25 +
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 9ec0022..5704b7f 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -25,6 +25,7 @@
 #if defined(CONFIG_KM82XX)
 #include 
 #endif
+#include 
 #include 
 #include 
 #include 
@@ -689,3 +690,27 @@ int board_eth_init(bd_t *bis)
 
return -1;
 }
+
+/*
+ * do_setboardid command
+ * read out the board id and the hw key from the intventory EEPROM and set
+ * this values as environment variables.
+ */
+static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int argc,
+   char *const argv[])
+{
+   unsigned char buf[32];
+   char *p;
+
+   p = get_local_var("IVM_BoardId");
+   sprintf((char *)buf, "%s", p);
+   setenv("boardid", (char *)buf);
+   p = get_local_var("IVM_HWKey");
+   sprintf((char *)buf, "%s", p);
+   setenv("hwkey", (char *)buf);
+   return 0;
+}
+
+U_BOOT_CMD(km_setboardid, 1, 0, do_setboardid, "setboardid", "read out bid and 
"
+"hwkey from IVM and set in environment");
+
-- 
1.7.0.5

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


[U-Boot] [PATCH] poweprc/km82xx: add board specific environment variable

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

On mgcoge3ne a new environment variable bobcatreset is used.
So this patch adds a possibility to add board specific
environment variables in general and this specific variable
for mgcoge3ne.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 include/configs/km82xx-common.h |1 +
 include/configs/mgcoge.h|2 ++
 include/configs/mgcoge3ne.h |2 ++
 3 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/configs/km82xx-common.h b/include/configs/km82xx-common.h
index 894e015..446c1d0 100644
--- a/include/configs/km82xx-common.h
+++ b/include/configs/km82xx-common.h
@@ -80,6 +80,7 @@
  * Default environment settings
  */
 #defineCONFIG_EXTRA_ENV_SETTINGS   
\
+   CONFIG_KM_BOARD_EXTRA_ENV   \
CONFIG_KM_DEF_ENV   \
"EEprom_ivm=pca9544a:70:4 \0"   \
"unlock=yes\0"  \
diff --git a/include/configs/mgcoge.h b/include/configs/mgcoge.h
index 93a6f4a..0745855 100644
--- a/include/configs/mgcoge.h
+++ b/include/configs/mgcoge.h
@@ -85,6 +85,8 @@
 PSDMR_CL_2)
 
 
+#define CONFIG_KM_BOARD_EXTRA_ENV  ""
+
 /* include further common stuff for all keymile 82xx boards */
 #include "km82xx-common.h"
 
diff --git a/include/configs/mgcoge3ne.h b/include/configs/mgcoge3ne.h
index 3df7ef1..78ce468 100644
--- a/include/configs/mgcoge3ne.h
+++ b/include/configs/mgcoge3ne.h
@@ -89,6 +89,8 @@
PSDMR_WRC_2C|\
PSDMR_CL_2)
 
+#define CONFIG_KM_BOARD_EXTRA_ENV  "bobcatreset=true\0"
+
 /* include further common stuff for all keymile 82xx boards */
 #include "km82xx-common.h"
 
-- 
1.7.0.5

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


[U-Boot] [PATCH] powerpc/km82xx: move SDRAM config to board config

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

To be prepared for mgcoge3ne which has a different SDRAM on board.
The config was moved from generic code to board specific header.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 include/configs/km82xx-common.h |   26 --
 include/configs/mgcoge.h|   26 ++
 include/configs/mgcoge2ne.h |   23 +++
 3 files changed, 49 insertions(+), 26 deletions(-)

diff --git a/include/configs/km82xx-common.h b/include/configs/km82xx-common.h
index 345212c..da551c9 100644
--- a/include/configs/km82xx-common.h
+++ b/include/configs/km82xx-common.h
@@ -243,13 +243,6 @@
 ORxG_SCY_5_CLK |\
 ORxG_TRLX)
 
-
-/*
- * Bank 1 - 60x bus SDRAM
- */
-#define SDRAM_MAX_SIZE 0x0800  /* max. 128 MB  */
-#define CONFIG_SYS_GLOBAL_SDRAM_LIMIT  (256 << 20) /* less than 256 MB */
-
 #define CONFIG_SYS_MPTPR   0x1800
 
 /*
@@ -268,25 +261,6 @@
 #define CONFIG_SYS_OR1_PRELIM  CONFIG_SYS_OR1
 
 /*
- *  SDRAM initialization values
- */
-
-#define CONFIG_SYS_OR1 ((~(CONFIG_SYS_GLOBAL_SDRAM_LIMIT-1) & ORxS_SDAM_MSK) |\
-ORxS_BPD_8 |\
-ORxS_ROWST_PBI0_A7 |\
-ORxS_NUMR_13)
-
-#define CONFIG_SYS_PSDMR (PSDMR_SDAM_A14_IS_A5 |\
-PSDMR_BSMA_A14_A16 |\
-PSDMR_SDA10_PBI0_A9|\
-PSDMR_RFRC_5_CLK   |\
-PSDMR_PRETOACT_2W  |\
-PSDMR_ACTTORW_2W   |\
-PSDMR_LDOTOPRE_1C  |\
-PSDMR_WRC_1C   |\
-PSDMR_CL_2)
-
-/*
  * UPIO FPGA (GPIO/PIGGY) on CS3 initialization values
  */
 #define CONFIG_SYS_KMBEC_FPGA_BASE 0x3000
diff --git a/include/configs/mgcoge.h b/include/configs/mgcoge.h
index 3d2ee24..aed1526 100644
--- a/include/configs/mgcoge.h
+++ b/include/configs/mgcoge.h
@@ -58,6 +58,32 @@
CONFIG_SYS_FLASH_BASE_2 }
 #define MTDIDS_DEFAULT "nor3=app"
 
+/*
+ * Bank 1 - 60x bus SDRAM
+ */
+#define SDRAM_MAX_SIZE 0x0800  /* max. 128 MB  */
+#define CONFIG_SYS_GLOBAL_SDRAM_LIMIT  (256 << 20) /* less than 256 MB */
+
+/* SDRAM initialization values
+*/
+
+#define CONFIG_SYS_OR1((~(CONFIG_SYS_GLOBAL_SDRAM_LIMIT-1) & \
+ORxS_SDAM_MSK) |\
+ORxS_BPD_8 |\
+ORxS_ROWST_PBI0_A7 |\
+ORxS_NUMR_13)
+
+#define CONFIG_SYS_PSDMR  (PSDMR_SDAM_A14_IS_A5 |\
+PSDMR_BSMA_A14_A16   |\
+PSDMR_SDA10_PBI0_A9|\
+PSDMR_RFRC_5_CLK   |\
+PSDMR_PRETOACT_2W  |\
+PSDMR_ACTTORW_2W   |\
+PSDMR_LDOTOPRE_1C  |\
+PSDMR_WRC_1C   |\
+PSDMR_CL_2)
+
+
 /* include further common stuff for all keymile 82xx boards */
 #include "km82xx-common.h"
 
diff --git a/include/configs/mgcoge2ne.h b/include/configs/mgcoge2ne.h
index 287b717..2b09b42 100644
--- a/include/configs/mgcoge2ne.h
+++ b/include/configs/mgcoge2ne.h
@@ -58,6 +58,29 @@
 
 #define MTDIDS_DEFAULT "nor2=app"
 
+/*
+ * Bank 1 - 60x bus SDRAM
+ * mgcoge2ne has 128M RAM
+ */
+#define SDRAM_MAX_SIZE 0x0800  /* max. 128 MB  */
+#define CONFIG_SYS_GLOBAL_SDRAM_LIMIT  (256 << 20) /* less than 256 MB */
+
+#define CONFIG_SYS_OR1((~(CONFIG_SYS_GLOBAL_SDRAM_LIMIT-1) & \
+ORxS_SDAM_MSK) |\
+ORxS_BPD_8 |\
+ORxS_ROWST_PBI0_A7 |\
+ORxS_NUMR_13)
+
+#define CONFIG_SYS_PSDMR  (PSDMR_SDAM_A14_IS_A5 |\
+PSDMR_BSMA_A14_A16   |\
+PSDMR_SDA10_PBI0_A9|\
+PSDMR_RFRC_5_CLK   |\
+PSDMR_PRETOACT_2W  |\
+PSDMR_ACTTORW_2W   |\
+PSDMR_LDOTOPRE_1C  |\
+PSDMR_WRC_1C   |\
+PSDMR_CL_2)
+
 /* include further common stuff for all keymile 82xx boards */
 #include "km82xx-common.h"
 
-- 
1.7.0.5

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


[U-Boot] [PATCH] cramfs: make cramfs usable without a NOR flash

2011-04-08 Thread Valentin Longchamp
From: Heiko Schocher 

Signed-off-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
cc: Holger Brunck 
Signed-off-by: Valentin Longchamp 
---
 common/cmd_cramfs.c |   12 +++-
 fs/cramfs/cramfs.c  |4 
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/common/cmd_cramfs.c b/common/cmd_cramfs.c
index 8c86dc5..5e1487f 100644
--- a/common/cmd_cramfs.c
+++ b/common/cmd_cramfs.c
@@ -43,7 +43,9 @@
 #endif
 
 #ifdef CONFIG_CRAMFS_CMDLINE
-flash_info_t flash_info[1];
+#if !defined(CONFIG_SYS_NO_FLASH)
+#include 
+#endif
 
 #ifndef CONFIG_CMD_JFFS2
 #include 
@@ -119,7 +121,11 @@ int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
dev.id = &id;
part.dev = &dev;
/* fake the address offset */
+#if !defined(CONFIG_SYS_NO_FLASH)
part.offset = addr - flash_info[id.num].start[0];
+#else
+   part.offset = addr;
+#endif
 
/* pre-set Boot file name */
if ((filename = getenv("bootfile")) == NULL) {
@@ -182,7 +188,11 @@ int do_cramfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
dev.id = &id;
part.dev = &dev;
/* fake the address offset */
+#if !defined(CONFIG_SYS_NO_FLASH)
part.offset = addr - flash_info[id.num].start[0];
+#else
+   part.offset = addr;
+#endif
 
if (argc == 2)
filename = argv[1];
diff --git a/fs/cramfs/cramfs.c b/fs/cramfs/cramfs.c
index 2956d39..910955d 100644
--- a/fs/cramfs/cramfs.c
+++ b/fs/cramfs/cramfs.c
@@ -41,8 +41,12 @@ struct cramfs_super super;
 
 /* CPU address space offset calculation macro, struct part_info offset is
  * device address space offset, so we need to shift it by a device start 
address. */
+#if !defined(CONFIG_SYS_NO_FLASH)
 extern flash_info_t flash_info[];
 #define PART_OFFSET(x) (x->offset + flash_info[x->dev->id->num].start[0])
+#else
+#define PART_OFFSET(x) (x->offset)
+#endif
 
 static int cramfs_read_super (struct part_info *info)
 {
-- 
1.7.0.5

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


[U-Boot] [PATCH] km/common: fix initial_boot_bank for bootpackages

2011-04-08 Thread Valentin Longchamp
From: Thomas Herzmann 

The initial_boot_bank can be set when more than one application is
used in a bootpackage. But a value n <> 0 never led to booting from
bank n. Instead, bank 0 was booted. This patch fixes this.

Signed-off-by: Thomas Herzmann 
Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 include/configs/keymile-common.h |   15 ---
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/include/configs/keymile-common.h b/include/configs/keymile-common.h
index 6329a1c..5c32023 100644
--- a/include/configs/keymile-common.h
+++ b/include/configs/keymile-common.h
@@ -249,10 +249,10 @@
"printbootargs boot "   \
"\" && "\
"setenv bootcmd \'" \
-   "run bootrunner; reset" \
+   "run actual bootrunner; reset"  \
"\' && "\
"setenv altbootcmd \'"  \
-   "run actual0 bootcmd; reset"\
+   "run backup bootrunner; reset"  \
"\' && "\
"saveenv && "   \
"reset\0"   \
@@ -290,7 +290,7 @@
"addramfs=" \
"setenv bootargs \""\
"${bootargs} phram.phram="  \
-   "rootfs${actual_bank},${rootfsaddr},${rootfssize}\"\0"  \
+   "rootfs${boot_bank},${rootfsaddr},${rootfssize}\"\0"\
"addtty="   \
"setenv bootargs ${bootargs}"   \
" console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}\0"  \
@@ -305,7 +305,7 @@
"flashargs="\
"setenv bootargs "  \
"ubi.mtd=" CONFIG_KM_UBI_LINUX_MTD_NAME " " \
-   "root=mtdblock:rootfs${actual_bank} "   \
+   "root=mtdblock:rootfs${boot_bank} " \
"rootfstype=squashfs ro\0"  \
""
 
@@ -354,7 +354,7 @@
"cramfsload ${kernel_addr_r} uImage && "\
"setenv actual_kernel_addr ${kernel_addr_r}\0"  \
"ubiattach=ubi part ${ubipartition}\0"  \
-   "ubicopy=ubi read ${cramfsaddr} bootfs${actual_bank}\0" \
+   "ubicopy=ubi read ${cramfsaddr} bootfs${boot_bank}\0"   \
"ubipartition=" CONFIG_KM_UBI_PARTITION_NAME "\0"   \
""
 
@@ -384,9 +384,10 @@
  * - 'default': setup default environment
  */
 #define CONFIG_KM_DEF_ENV_CONSTANTS\
-   "actual=setenv actual_bank ${initial_boot_bank}\0"  \
-   "actual0=setenv actual_bank 0\0"\
+   "actual=setenv boot_bank ${actual_bank}\0"  \
+   "backup=setenv boot_bank ${backup_bank}\0"  \
"actual_bank=${initial_boot_bank}\0"\
+   "backup_bank=0\0"   \
"default="  \
"setenv default 'run newenv; reset' &&  "   \
"run release && saveenv; reset\0"   \
-- 
1.7.0.5

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


[U-Boot] [PATCH] powerpc/km82xx: rename mgcoge files to km82xx

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

The directory and file mgcoge was renamed to km82xx.
Because other keymile 82xx will follow and will use the
same platform code.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 board/keymile/km82xx/Makefile |   53 +++
 board/keymile/km82xx/km82xx.c |  346 +
 board/keymile/mgcoge/Makefile |   53 ---
 board/keymile/mgcoge/mgcoge.c |  346 -
 boards.cfg|4 +-
 5 files changed, 401 insertions(+), 401 deletions(-)
 create mode 100644 board/keymile/km82xx/Makefile
 create mode 100644 board/keymile/km82xx/km82xx.c
 delete mode 100644 board/keymile/mgcoge/Makefile
 delete mode 100644 board/keymile/mgcoge/mgcoge.c

diff --git a/board/keymile/km82xx/Makefile b/board/keymile/km82xx/Makefile
new file mode 100644
index 000..a2b9da4
--- /dev/null
+++ b/board/keymile/km82xx/Makefile
@@ -0,0 +1,53 @@
+#
+# (C) Copyright 2001-2007
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := $(BOARD).o ../common/common.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/keymile/km82xx/km82xx.c b/board/keymile/km82xx/km82xx.c
new file mode 100644
index 000..3db3c7b
--- /dev/null
+++ b/board/keymile/km82xx/km82xx.c
@@ -0,0 +1,346 @@
+/*
+ * (C) Copyright 2007 - 2008
+ * Heiko Schocher, DENX Software Engineering, h...@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
+#include 
+#endif
+
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+#include 
+#endif
+
+#include "../common/common.h"
+
+/*
+ * I/O Port configuration table
+ *
+ * if conf is 1, then that port pin will be configured at boot time
+ * according to the five values podr/pdir/ppar/psor/pdat for that entry
+ */
+const iop_conf_t iop_conf_tab[4][32] = {
+
+   /* Port A */
+   {   /*conf  ppar psor pdir podr pdat */
+   { 0, 0,   0,   0,   0,   0 }, /* PA31*/
+   { 0, 0,   0,   0,   0,   0 }, /* PA30*/
+   { 0, 0,   0,   0,   0,   0 }, /* PA29*/
+   { 0, 0,   0,   0,   0,   0 }, /* PA28*/
+   { 0, 0,   0,   0,   0,   0 }, /* PA27*/
+   { 0, 0,   0,   0,   0,   0 }, /* PA26*/
+   { 0, 0,   0,   0,   0,   0 }, /* PA25*/
+   { 0, 0,   0,   0,   0,   0 }, /* PA24*/
+   

[U-Boot] [PATCH] powerpc/km82xx: cleanup coding style for mgcoge.c

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 board/keymile/mgcoge/mgcoge.c |  291 +
 1 files changed, 146 insertions(+), 145 deletions(-)

diff --git a/board/keymile/mgcoge/mgcoge.c b/board/keymile/mgcoge/mgcoge.c
index 11a0f79..3db3c7b 100644
--- a/board/keymile/mgcoge/mgcoge.c
+++ b/board/keymile/mgcoge/mgcoge.c
@@ -45,154 +45,154 @@
  */
 const iop_conf_t iop_conf_tab[4][32] = {
 
-/* Port A */
-{  /*conf  ppar psor pdir podr pdat */
-   /* PA31 */ { 0,  0,   0,   0,   0,   0 }, /* PA31*/
-   /* PA30 */ { 0,  0,   0,   0,   0,   0 }, /* PA30*/
-   /* PA29 */ { 0,  0,   0,   0,   0,   0 }, /* PA29*/
-   /* PA28 */ { 0,  0,   0,   0,   0,   0 }, /* PA28*/
-   /* PA27 */ { 0,  0,   0,   0,   0,   0 }, /* PA27*/
-   /* PA26 */ { 0,  0,   0,   0,   0,   0 }, /* PA26*/
-   /* PA25 */ { 0,  0,   0,   0,   0,   0 }, /* PA25*/
-   /* PA24 */ { 0,  0,   0,   0,   0,   0 }, /* PA24*/
-   /* PA23 */ { 0,  0,   0,   0,   0,   0 }, /* PA23*/
-   /* PA22 */ { 0,  0,   0,   0,   0,   0 }, /* PA22*/
-   /* PA21 */ { 0,  0,   0,   0,   0,   0 }, /* PA21*/
-   /* PA20 */ { 0,  0,   0,   0,   0,   0 }, /* PA20*/
-   /* PA19 */ { 0,  0,   0,   0,   0,   0 }, /* PA19*/
-   /* PA18 */ { 0,  0,   0,   0,   0,   0 }, /* PA18*/
-   /* PA17 */ { 0,  0,   0,   0,   0,   0 }, /* PA17*/
-   /* PA16 */ { 0,  0,   0,   0,   0,   0 }, /* PA16*/
-   /* PA15 */ { 0,  0,   0,   0,   0,   0 }, /* PA15*/
-   /* PA14 */ { 0,  0,   0,   0,   0,   0 }, /* PA14*/
-   /* PA13 */ { 0,  0,   0,   0,   0,   0 }, /* PA13*/
-   /* PA12 */ { 0,  0,   0,   0,   0,   0 }, /* PA12*/
-   /* PA11 */ { 0,  0,   0,   0,   0,   0 }, /* PA11*/
-   /* PA10 */ { 0,  0,   0,   0,   0,   0 }, /* PA10*/
-   /* PA9  */ { 1,  1,   0,   1,   0,   0 }, /* SMC2 TxD*/
-   /* PA8  */ { 1,  1,   0,   0,   0,   0 }, /* SMC2 RxD*/
-   /* PA7  */ { 0,  0,   0,   0,   0,   0 }, /* PA7 */
-   /* PA6  */ { 0,  0,   0,   0,   0,   0 }, /* PA6 */
-   /* PA5  */ { 0,  0,   0,   0,   0,   0 }, /* PA5 */
-   /* PA4  */ { 0,  0,   0,   0,   0,   0 }, /* PA4 */
-   /* PA3  */ { 0,  0,   0,   0,   0,   0 }, /* PA3 */
-   /* PA2  */ { 0,  0,   0,   0,   0,   0 }, /* PA2 */
-   /* PA1  */ { 0,  0,   0,   0,   0,   0 }, /* PA1 */
-   /* PA0  */ { 0,  0,   0,   0,   0,   0 }  /* PA0 */
-},
-
-/* Port B */
-{  /*conf  ppar psor pdir podr pdat */
-   /* PB31 */ { 0,  0,   0,   0,   0,   0 }, /* PB31*/
-   /* PB30 */ { 0,  0,   0,   0,   0,   0 }, /* PB30*/
-   /* PB29 */ { 0,  0,   0,   0,   0,   0 }, /* PB29*/
-   /* PB28 */ { 0,  0,   0,   0,   0,   0 }, /* PB28*/
-   /* PB27 */ { 0,  0,   0,   0,   0,   0 }, /* PB27*/
-   /* PB26 */ { 0,  0,   0,   0,   0,   0 }, /* PB26*/
-   /* PB25 */ { 0,  0,   0,   0,   0,   0 }, /* PB25*/
-   /* PB24 */ { 0,  0,   0,   0,   0,   0 }, /* PB24*/
-   /* PB23 */ { 0,  0,   0,   0,   0,   0 }, /* PB23*/
-   /* PB22 */ { 0,  0,   0,   0,   0,   0 }, /* PB22*/
-   /* PB21 */ { 0,  0,   0,   0,   0,   0 }, /* PB21*/
-   /* PB20 */ { 0,  0,   0,   0,   0,   0 }, /* PB20*/
-   /* PB19 */ { 0,  0,   0,   0,   0,   0 }, /* PB19*/
-   /* PB18 */ { 0,  0,   0,   0,   0,   0 }, /* PB18*/
-   /* PB17 */ { 0,  0,   0,   0,   0,   0 }, /* non-existent*/
-   /* PB16 */ { 0,  0,   0,   0,   0,   0 }, /* non-existent*/
-   /* PB15 */ { 0,  0,   0,   0,   0,   0 }, /* non-existent*/
-   /* PB14 */ { 0,  0,   0,   0,   0,   0 }, /* non-existent*/
-   /* PB13 */ { 0,  0,   0,   0,   0,   0 }, /* non-existent*/
-   /* PB12 */ { 0,  0,   0,   0,   0,   0 }, /* non-existent*/
-   /* PB11 */ { 0,  0,   0,   0,   0,   0 }, /* non-existent*/
-   /* PB10 */ { 0,

[U-Boot] [PATCH] powerpc/km82xx: adapt CONFIG_SYSSYPCR to manual

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

Reserved bit was changed according to the processors manual.

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 include/configs/km82xx-common.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/configs/km82xx-common.h b/include/configs/km82xx-common.h
index da551c9..894e015 100644
--- a/include/configs/km82xx-common.h
+++ b/include/configs/km82xx-common.h
@@ -182,7 +182,7 @@
 #define CONFIG_SYS_HID20
 
 #define CONFIG_SYS_SIUMCR  0x4020c200
-#define CONFIG_SYS_SYPCR   0xFFC3
+#define CONFIG_SYS_SYPCR   0xFF83
 #define CONFIG_SYS_BCR 0x1000
 #define CONFIG_SYS_SCCR(SCCR_PCI_MODE | SCCR_PCI_MODCK)
 
-- 
1.7.0.5

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


[U-Boot] [PATCH] km/common: replace env var checkboardidlist by function

2011-04-08 Thread Valentin Longchamp
From: Thomas Herzmann 

The environment variable (defining a checkboardidlist function)
has been replaced by a u-boot function call. This call is much
faster and the environment is a leaner.

Signed-off-by: Thomas Herzmann 
Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 board/keymile/common/common.c|  112 ++
 include/configs/keymile-common.h |   30 +--
 2 files changed, 113 insertions(+), 29 deletions(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 5704b7f..72278a0 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
 #include 
@@ -714,3 +715,114 @@ static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int 
argc,
 U_BOOT_CMD(km_setboardid, 1, 0, do_setboardid, "setboardid", "read out bid and 
"
 "hwkey from IVM and set in environment");
 
+/*
+ * command km_checkboardidlist
+ * if "boardid" and "hwkey" are not already set in the environment, do:
+ * if a "boardIdListHex" exists in the environment:
+ * - read ivm data for boardid and hwkey
+ * - compare each entry of the boardIdListHex with the
+ * IVM data:
+ * if match:
+ * set environment variables boardid, boardId,
+ * hwkey, hwKey to the found values
+ * both (boardid and boardId) are set because
+ * they might be used differently in the
+ * application and in the init scripts (?)
+ * return 0 in case of match, 1 if not match or error
+ */
+int do_checkboardidlist(cmd_tbl_t *cmdtp, int flag, int argc,
+   char *const argv[])
+{
+   unsigned long ivmbid = 0, ivmhwkey = 0;
+   unsigned long envbid = 0, envhwkey = 0;
+   char *p;
+   int verbose = argc > 1 && *argv[1] == 'v';
+   int rc = 1; /* default: no match */
+
+   p = get_local_var("IVM_BoardId");
+   strict_strtoul(p, 16, &ivmbid);
+   p = get_local_var("IVM_HWKey");
+   strict_strtoul(p, 16, &ivmhwkey);
+
+   if (!ivmbid || !ivmhwkey) {
+   printf("Error: IVM_BoardId and/or IVM_HWKey not set!\n");
+   return rc;
+   }
+
+   /* try to read values from environment */
+   p = getenv("boardid");
+   if (p != NULL)
+   strict_strtoul(p, 16, &envbid);
+   p = getenv("hwkey");
+   if (p != NULL)
+   strict_strtoul(p, 16, &envhwkey);
+
+   if (!envbid || !envhwkey) {
+   /* must set environment first */
+   char *bidhwklist = getenv("boardIdListHex");
+   if (bidhwklist) {
+   int found = 0;
+   char *rest = bidhwklist;
+   char *endp;
+   if (verbose) {
+   printf("IVM_BoardId: %ld, IVM_HWKey=%ld\n",
+   ivmbid, ivmhwkey);
+   printf("boardIdHwKeyList: %s\n",
+   bidhwklist);
+   }
+   while (!found) {
+   /* loop over each bid/hwkey pair in the list */
+   unsigned long bid   = 0;
+   unsigned long hwkey = 0;
+   while (*rest && !isxdigit(*rest))
+   rest++;
+   bid = simple_strtoul(rest, &endp, 16);
+   if (*endp == '_') {
+   rest  = endp + 1;
+   hwkey = simple_strtoul(rest, &endp, 16);
+   rest  = endp;
+   while (*rest && !isxdigit(*rest))
+   rest++;
+   }
+   if ((!bid) || (!hwkey)) {
+   /* end of list */
+   break;
+   }
+   if (verbose) {
+   printf("trying bid=0x%lX, hwkey=%ld\n",
+   bid, hwkey);
+   }
+   if ((bid == ivmbid) && (hwkey == ivmhwkey)) {
+   char buf[10];
+
+   found = 1;
+   envbid   = bid;
+   envhwkey

[U-Boot] [PATCH] powerpc/km82xx: add DIP switch detection

2011-04-08 Thread Valentin Longchamp
From: Huber, Andreas 

This reads the DIP switch register in the BFTICU (0x4089). If 'Full reset'
or 'DB erase' is selected, 'actual_bank' is set to 0. This loads the Bootloader
application who does the erase stuff. To access the register a struct for the
bfticu I/O map was added to common.h.

Signed-off-by: Andreas Huber 
Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 board/keymile/common/common.h |   79 +
 board/keymile/mgcoge/mgcoge.c |   12 ++
 2 files changed, 91 insertions(+), 0 deletions(-)

diff --git a/board/keymile/common/common.h b/board/keymile/common/common.h
index 099de98..cdc35b6 100644
--- a/board/keymile/common/common.h
+++ b/board/keymile/common/common.h
@@ -39,6 +39,85 @@ struct km_bec_fpga {
unsigned char   pgy_eth;
 };
 
+#define BFTICU_DIPSWITCH_MASK   0x0f
+
+/*
+ * BFTICU FPGA iomap
+ * BFTICU is used on mgcoge and mgocge3ne
+ */
+struct bfticu_iomap {
+   u8  xi_ena; /* General defect enable */
+   u8  pack1[3];
+   u8  en_csn;
+   u8  pack2;
+   u8  safe_mem;
+   u8  pack3;
+   u8  id;
+   u8  pack4;
+   u8  rev;
+   u8  build;
+   u8  p_frc;
+   u8  p_msk;
+   u8  pack5[2];
+   u8  xg_int;
+   u8  pack6[15];
+   u8  s_conf;
+   u8  pack7;
+   u8  dmx_conf12;
+   u8  pack8;
+   u8  s_clkslv;
+   u8  pack9[11];
+   u8  d_conf;
+   u8  d_mask_ca;
+   u8  d_pll_del;
+   u8  pack10[16];
+   u8  t_conf_ca;
+   u8  t_mask_ca;
+   u8  pack11[13];
+   u8  m_def0;
+   u8  m_def1;
+   u8  m_def2;
+   u8  m_def3;
+   u8  m_def4;
+   u8  m_def5;
+   u8  m_def_trap0;
+   u8  m_def_trap1;
+   u8  m_def_trap2;
+   u8  m_def_trap3;
+   u8  m_def_trap4;
+   u8  m_def_trap5;
+   u8  m_mask_def0;
+   u8  m_mask_def1;
+   u8  m_mask_def2;
+   u8  m_mask_def3;
+   u8  m_mask_def4;
+   u8  m_mask_def5;
+   u8  m_def_mask0;
+   u8  m_def_mask1;
+   u8  m_def_mask2;
+   u8  m_def_mask3;
+   u8  m_def_mask4;
+   u8  m_def_mask5;
+   u8  m_def_pri;
+   u8  pack12[11];
+   u8  hw_status;
+   u8  pack13;
+   u8  hw_control1;
+   u8  hw_control2;
+   u8  hw_control3;
+   u8  pack14[7];
+   u8  led_on; /* Leds */
+   u8  pack15;
+   u8  sfp_control;/* SFP modules */
+   u8  pack16;
+   u8  alarm_control;  /* Alarm output */
+   u8  pack17;
+   u8  icps;   /* ICN clock pulse shaping */
+   u8  mswitch;/* Read mode switch */
+   u8  pack18[6];
+   u8  pb_dbug;
+};
+
 #if !defined(CONFIG_PIGGY_MAC_ADRESS_OFFSET)
 #define CONFIG_PIGGY_MAC_ADRESS_OFFSET 0
 #endif
diff --git a/board/keymile/mgcoge/mgcoge.c b/board/keymile/mgcoge/mgcoge.c
index 340016b..11a0f79 100644
--- a/board/keymile/mgcoge/mgcoge.c
+++ b/board/keymile/mgcoge/mgcoge.c
@@ -315,6 +315,18 @@ int board_early_init_r(void)
 
 int last_stage_init(void)
 {
+   struct bfticu_iomap *base =
+   (struct bfticu_iomap *)CONFIG_SYS_FPGA_BASE;
+   u8 dip_switch;
+
+   dip_switch = in_8(&base->mswitch);
+   dip_switch &= BFTICU_DIPSWITCH_MASK;
+   /* dip switch 'full reset' or 'db erase' */
+   if (dip_switch & 0x1 || dip_switch & 0x2) {
+   /* start bootloader */
+   puts("DIP:   Enabled\n");
+   setenv("actual_bank", "0");
+   }
set_km_env();
return 0;
 }
-- 
1.7.0.5

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


[U-Boot] [PATCH] i2c, soft_i2c: deblock bus if switching to another i2c bus

2011-04-08 Thread Valentin Longchamp
From: Heiko Schocher 

Deblock i2c bus when switching to another i2c bus, if using
i2c_set_bus_num().

Signed-off-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
cc: Holger Brunck 
Signed-off-by: Valentin Longchamp 
---
 drivers/i2c/soft_i2c.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/soft_i2c.c b/drivers/i2c/soft_i2c.c
index 69b5f42..9b02e89 100644
--- a/drivers/i2c/soft_i2c.c
+++ b/drivers/i2c/soft_i2c.c
@@ -286,6 +286,7 @@ int i2c_set_bus_num(unsigned int bus)
int ret;
 
ret = i2x_mux_select_mux(bus);
+   i2c_init_board();
if (ret == 0)
i2c_bus_num = bus;
else
-- 
1.7.0.5

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


[U-Boot] [PATCH] common/hush: make get_local_var visible for other users

2011-04-08 Thread Valentin Longchamp
From: Holger Brunck 

Signed-off-by: Holger Brunck 
Acked-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
Signed-off-by: Valentin Longchamp 
---
 common/hush.c  |3 +--
 include/hush.h |1 +
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/hush.c b/common/hush.c
index 8021a68..85a6030 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -497,7 +497,6 @@ static void remove_bg_job(struct pipe *pi);
 /* local variable support */
 static char **make_list_in(char **inp, char *name);
 static char *insert_var_value(char *inp);
-static char *get_local_var(const char *var);
 
 #ifndef __U_BOOT__
 /* Table of built-in functions.  They can be forked or not, depending on
@@ -2169,7 +2168,7 @@ static char *get_dollar_var(char ch);
 #endif
 
 /* This is used to get/check local shell variables */
-static char *get_local_var(const char *s)
+char *get_local_var(const char *s)
 {
struct variables *cur;
 
diff --git a/include/hush.h b/include/hush.h
index 0805ff3..5c566cc 100644
--- a/include/hush.h
+++ b/include/hush.h
@@ -34,6 +34,7 @@ extern int parse_file_outer(void);
 
 int set_local_var(const char *s, int flg_export);
 void unset_local_var(const char *name);
+char *get_local_var(const char *s);
 
 #if defined(CONFIG_HUSH_INIT_VAR)
 extern int hush_init_var (void);
-- 
1.7.0.5

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


Re: [U-Boot] [PATCH] Keymile boards mainlining, part 2

2011-04-08 Thread Valentin Longchamp
Sorry, the whole series is not numbered, -N statt -n ... it will be 
corrected for the very likely v2 of the series posting.

Valentin Longchamp wrote:
> This series is the second effort of merging the Keymile boards support
> back into mainline.
> 
> Most of the patches are only keymile relevant and should only affect our
> boards.
> 
> There are also patches for the i2c deblocking support and cramfs for ARM.
> 
> The whole series is based on current denx-master with the our first patch
> series posted by Heiko that was reviewed previous weeks and should still
> be merged during the current merge window:
> 
> http://lists.denx.de/pipermail/u-boot/2011-April/089530.html
> 
> Heiko Schocher (5):
>   lib, vsprintf: introduce strict_strtoul
>   arm/km: add CRAMFS support for keymile boards
>   cramfs: make cramfs usable without a NOR flash
>   i2c, soft_i2c: deblock bus if switching to another i2c bus
>   arm, powerpc, keymile boards: move keymile specific header in subdir
> 
> Holger Brunck (18):
>   km/common: remove hdlc_enet implementation
>   powerpc/km82xx: cleanup coding style for mgcoge.c
>   powerpc/km82xx: rename mgcoge files to km82xx
>   powerpc/km82xx: move SDRAM config to board config
>   powerpc/km82xx: adapt CONFIG_SYSSYPCR to manual
>   powerpc/km82xx: rename mgcoge2ne to mgcoge3ne board support
>   poweprc/km82xx: add board specific environment variable
>   arm/km: add addbootcount environment variable
>   arm/km: remove last_stage_init and unneeded printouts
>   arm/km: add second serial interface for kirkwood
>   common/hush: make get_local_var visible for other users
>   km/common: implement setboardid as a command
>   km/common: add pnvramsize to default environment
>   km/common: fix coding style issues in generic header
>   km/common: simplify default environment
>   arm/km: rename mgcoge2un to mgcoge3un
>   arm/km: change default settings for egiga on mgcoge3un
>   arm/km: update mgcoge3un board support
> 
> Huber, Andreas (1):
>   powerpc/km82xx: add DIP switch detection
> 
> Stefan Bigler (1):
>   i2c: add i2c deblock sequence before and after every mux config
> 
> Thomas Herzmann (2):
>   km/common: fix initial_boot_bank for bootpackages
>   km/common: replace env var checkboardidlist by function
> 
> Valentin Longchamp (3):
>   arm/km: add mkimage config file for uart download
>   arm/km: add BootROM config files for memphis SDRAM
>   arm/km: disable ls (through jffs2 support)
> 
>  MAINTAINERS|4 +-
>  board/keymile/common/common.c  |  156 ++-
>  board/keymile/common/common.h  |   84 +++-
>  board/keymile/common/keymile_hdlc_enet.c   |  620 
> 
>  board/keymile/km82xx/Makefile  |   53 ++
>  board/keymile/km82xx/km82xx.c  |  373 ++
>  board/keymile/km_arm/km_arm.c  |   93 +++-
>  board/keymile/km_arm/kwbimage-memphis-uart.cfg |  197 
>  board/keymile/km_arm/kwbimage-memphis.cfg  |  197 
>  board/keymile/km_arm/kwbimage-uart.cfg |  179 +++
>  board/keymile/mgcoge/Makefile  |   54 --
>  board/keymile/mgcoge/mgcoge.c  |  333 -
>  board/keymile/mgcoge/mgcoge_hdlc_enet.c|  276 ---
>  board/keymile/scripts/README   |   25 +
>  board/keymile/scripts/debug-arm-env.txt|2 +
>  board/keymile/scripts/debug-common-env.txt |9 +
>  board/keymile/scripts/debug-ppc-env.txt|2 +
>  boards.cfg |6 +-
>  common/cmd_cramfs.c|   12 +-
>  common/cmd_i2c.c   |   12 +
>  common/hush.c  |3 +-
>  drivers/i2c/soft_i2c.c |1 +
>  drivers/net/mvgbe.h|2 +
>  fs/cramfs/cramfs.c |4 +
>  include/_exports.h |1 +
>  include/common.h   |1 +
>  include/configs/keymile-common.h   |  455 -
>  include/configs/km-powerpc.h   |   92 
>  include/configs/km/keymile-common.h|  328 +
>  include/configs/km/km-powerpc.h|   88 
>  include/configs/km/km82xx-common.h |  311 
>  include/configs/km/km8321-common.h |  137 ++
>  include/configs/km/km83xx-common.h |  325 +
>  include/configs/km/km_arm.h|  275 +++
>  include/configs/km82xx-common.h|  336 -
>  include/configs/km8321-common.h|  137 --
>  include/configs/km83xx-common.h|  325 -
>  include/configs/km_arm.h   |  266 --
>  include/configs/kmeter1.h  |2 +-
>  include/configs/kmsupx5.h   

Re: [U-Boot] [PATCH v2 0/6] Universal PHY Infrastructure

2011-04-08 Thread Detlev Zundel
Hi,

> On Thu, Apr 7, 2011 at 10:13 AM, Andy Fleming wrote:
>> On Apr 6, 2011, at 7:07 AM, Detlev Zundel wrote:
 This second version cleans up all checkpatch errors that I reasonably 
 could,
 and addresses most of the comments from the first round of reviews.
>>>
>>>  WARNING: Use of volatile is usually wrong: see
>>> Documentation/volatile-considered-harmful.txt
>>>  #1299: FILE: drivers/net/tsec.c:1740:
>>>  +static int tsec_send(struct eth_device *dev, volatile void *packet, int 
>>> length)
>>>
>>> Ah I see.  This is needed because include/net.h prescribes this as the
>>> interface.  Oh well, we should clean this up at some later point, so
>>> it's ok from my perspective to ignore this and at least stay consistent.
>>>
>>>  WARNING: do not add new typedefs
>>>  #4271: FILE: include/phy.h:389:
>>>  +typedef enum {
>>>
>>> I know that we have lots of typedefs, but we should not add new ones.
>>> Actually not using this typedef for an enum-type would make the sources
>>> easier for me to read as I don't have to do this extra lookup step.
>>
>> True, but this typedef is in Linux the same way. It seemed sensible to keep 
>> them the same
>
> agreed.  fwiw :p.

I'm also fine with that.

Cheers
  Detlev

-- 
Warning: this comic occasionally contains strong language (which may be unsuit-
able for children), unusual humor (which may be unsuitable for adults), and ad-
vanced mathematics (which may be unsuitable for liberal-arts majors). /xkcd.org
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] tools/env: document current cross-compilation issues and workaround

2011-04-08 Thread Luca Ceresoli
Signed-off-by: Luca Ceresoli 
---
Cross-compiling fw_{print,set}env has caused people to waste a lot of time:
 - http://www.mail-archive.com/u-boot@lists.denx.de/msg42317.html
 - http://www.mail-archive.com/u-boot@lists.denx.de/msg39735.html
 - http://www.mail-archive.com/u-boot@lists.denx.de/msg48945.html
 - http://www.mail-archive.com/u-boot@lists.denx.de/msg49057.html
so at least let's have it documented.

 tools/env/README |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/tools/env/README b/tools/env/README
index 91e679a..d5f228f 100644
--- a/tools/env/README
+++ b/tools/env/README
@@ -2,6 +2,12 @@
 This is a demo implementation of a Linux command line tool to access
 the U-Boot's environment variables.
 
+In the current version, there is an issue in cross-compilation.
+In order to cross-compile fw_printenv, run
+make HOSTCC= env
+in the root directory of the U-Boot distribution. For example,
+make HOSTCC=arm-linux-gcc env
+
 For the run-time utiltity configuration uncomment the line
 #define CONFIG_FILE  "/etc/fw_env.config"
 in fw_env.h.
-- 
1.7.1

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


Re: [U-Boot] [PATCH v7 01/10] nds32: add header files support for nds32

2011-04-08 Thread Macpaul Lin
Hi Wolfgang,

>> > Checkpatch complains a lot about "do not add new typedefs".
>>
>> Indeed, but this seems is special for Linux Kernel,
>
> Not really.  This is Linux CodingStyle policy, which we usually adapt.
>
>> I've checked some of the "typedefs" from other architecture code in u-boot.
>
> This does not mean much.  Yes, there are tons of typedef's in U-Boot,
> but this is old code that has not been cleaned up yet.  At least we
> now try not to add to that pool.
>
>> I did check typedefs one by one by myself in hand and eye checking.
>> If some thing is not suitable for using "typedefs" please let me know.
>
> Please don't add any new typedef's.
>

I think we still have to discuss about the typedef's.
What does the "new" typedef means?

According to the checkpatch result, "typedef" warning exists in 4 files.
arch/nds32/include/asm/posix_types.h
arch/nds32/include/asm/types.h
arch/nds32/include/asm/global_data.h
arch/nds32/include/asm/u-boot.h.

File arch/nds32/include/asm/posix_types.h  and arch/nds32/include/asm/types.h
come from the Linux kernel. Which is usually used for posix
compatibility for Linux Kernel.
Which should be "old" features for posix and compatibility.
However, you cannot say for a new architecture to support posix and
other compatibility as
"new" typedef.
I've checked the latest kernel (2.6.38.1), arm, mips, avr32, powerpc
consist these posix_types.h and types.h with "typedef".

It looks the kernel is not going to fix the "old" typedef for
posix_types.h and types.h

I think they say "please do not add any new typedef" might mean to
those typedef
used in drivers or protocols.

In the other 2 files arch/nds32/include/asm/global_data.h and
arch/nds32/include/asm/u-boot.h,
typedef was used for
#449: FILE: arch/nds32/include/asm/global_data.h:46:
+typedefstruct global_data {
+} gd_t;
#1505: FILE: arch/nds32/include/asm/u-boot.h:41:
+typedef struct bd_info {
+} bd_t;

I don't know if you have any idea of fixing it in u-boot.

If you have an explicit way to fix it, for example,
"we must declare bd_t in each function before we use it",
I'll very glad to do it for fixing up the coding style.
Otherwise I'm afraid of the fixing "typedef" here in these 2 file might lead
function or other problem in u-boot build with nds32.

Thanks.

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


Re: [U-Boot] [PATCH v1 1/2] powerpc/85xx: rename NAND prefixes to CONFIG_SYS

2011-04-08 Thread Kumar Gala

On Apr 5, 2011, at 2:39 PM, Matthew McClintock wrote:

> renaming 85xx define CONFIG_NAND_OR_PRELIM to
> CONFIG_SYS_NAND_OR_PRELIM and CONFIG_NAND_BR_PRELIM to
> CONFIG_SYS_NAND_BR_PRELIM to use the more appropriate
> CONFIG_SYS prefix as well as be consistent with 83xx
> 
> Signed-off-by: Matthew McClintock 
> cc: Scott Wood 
> cc: Kumar Gala 
> ---
> arch/powerpc/cpu/mpc85xx/cpu_init_nand.c |8 
> include/configs/MPC8536DS.h  |   18 +-
> include/configs/MPC8569MDS.h |   12 ++--
> include/configs/MPC8572DS.h  |   18 +-
> include/configs/P1_P2_RDB.h  |   12 ++--
> include/configs/P2020DS.h|   14 +++---
> 6 files changed, 41 insertions(+), 41 deletions(-)

applied to 85xx

- k

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


[U-Boot] [PATCH] powerpc/85xx: Drop CONFIG_VIDEO support on corenet_ds boards

2011-04-08 Thread Kumar Gala
We don't really ever use Video cards on corenet_ds style boards and its
bloating our image which is close the its max size.  Drop support and
also kill some defines for non-PNP PCI which we never use.

Signed-off-by: Kumar Gala 
---
 include/configs/corenet_ds.h |   23 ---
 1 files changed, 0 insertions(+), 23 deletions(-)

diff --git a/include/configs/corenet_ds.h b/include/configs/corenet_ds.h
index f4c3fcd..7c77973 100644
--- a/include/configs/corenet_ds.h
+++ b/include/configs/corenet_ds.h
@@ -458,33 +458,10 @@
 #endif
 
 #ifdef CONFIG_PCI
-
-/*PCIE video card used*/
-#define VIDEO_IO_OFFSETCONFIG_SYS_PCIE1_IO_VIRT
-
-/* video */
-#define CONFIG_VIDEO
-
-#ifdef CONFIG_VIDEO
-#define CONFIG_BIOSEMU
-#define CONFIG_CFB_CONSOLE
-#define CONFIG_VIDEO_SW_CURSOR
-#define CONFIG_VGA_AS_SINGLE_DEVICE
-#define CONFIG_ATI_RADEON_FB
-#define CONFIG_VIDEO_LOGO
-#define CONFIG_SYS_ISA_IO_BASE_ADDRESS VIDEO_IO_OFFSET
-#endif
-
 #define CONFIG_NET_MULTI
 #define CONFIG_PCI_PNP /* do pci plug-and-play */
 #define CONFIG_E1000
 
-#ifndef CONFIG_PCI_PNP
-#define PCI_ENET0_IOADDR   CONFIG_SYS_PCI1_IO_BUS
-#define PCI_ENET0_MEMADDR  CONFIG_SYS_PCI1_IO_BUS
-#define PCI_IDSEL_NUMBER   0x11/* IDSEL = AD11 */
-#endif
-
 #define CONFIG_PCI_SCAN_SHOW   /* show pci devices on startup */
 #define CONFIG_DOS_PARTITION
 #endif /* CONFIG_PCI */
-- 
1.7.3.4

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


[U-Boot] DSN: failed (MESSAGE COULD NOT BE DELIVERED)

2011-04-08 Thread Mailbot for etexusa . com

This is a Delivery Status Notification (DSN).

I was unable to deliver your message to
serv...@akam.net.

The error was;
  Domain "akam.net" can't receive email

 
Reporting-MTA: dns; etexusa.com
Final-Recipient: RFC822; servers@akam.net
Action: failed
Status: 5.0.0
Received: from lists.denx.de ([122.178.114.115]) by etexusa.com for ; Fri, 8 Apr 2011 00:44:55 -0700
From: u-boot@lists.denx.de
To: serv...@akam.net
Subject: MESSAGE COULD NOT BE DELIVERED
Date: Fri, 8 Apr 2011 13:16:45 +0530
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="=_NextPart_000_0008_8DE8ACF9.2ED57E10"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.

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


Re: [U-Boot] [RFC] mpc83xx: add config options to spd_sdram

2011-04-08 Thread Andre Schwarz
Kim,


>>> York,
>>>
>>>
>>>
>>> ok - will give it a try tomorrow.
>>>
>>>
>>>
>>
>>
>> hmm - having a look at the Makefile it looks like I need
>> CONFIG_FSL_DDR2.
>>
>> This seems to pull in the "new" code ... without omitting the "old"
>> one
>>
>> in arch/powerpc/cpu/mpc83xx/spd_sdram.c
>>
>>
>>
>> The Makefile further uses ctrl_regs.c ... which fails.
>>
>>
>>
>> having a look arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c gives :
>>
>>
>>
>> #ifdef CONFIG_MPC85xx
>>
>>#define _DDR_ADDR CONFIG_SYS_MPC85xx_DDR_ADDR
>>
>> #elif defined(CONFIG_MPC86xx)
>>
>>#define _DDR_ADDR CONFIG_SYS_MPC86xx_DDR_ADDR
>>
>> #else
>>
>>#error "Undefined _DDR_ADDR"
>>
>> #endif
>>
>>
>>
>> There's not a single sign of any 83xx within this code.
>>
>> Grepping through the board configs only show 85xx and 86xx based
>> boards using it.
>>
>>
>>
>> Sorry, but I'm feeling like an idiot.
>>
>>
>>
>> Are you playing some game with me or am I simply unable to understand
>> the code ?
>>
>>
>>
>> Please shed some light on this.
>>
>>
> Andre,
>
> I am sorry I totally ignored the subject with mpc83xx. I was thinking of
> mpc85xx.
ok - no "new" code for 83xx then.
> You are right the old code is in spd_sdram.c and it is still in use for
> mpc83xx. Unless to adjust the code, there is no board specific file.
>
Are you willing to accept some changes to spd_sdram.c or will I have 
another out-of-tree board  ?

What we need is :

- more configurable settings like driver strength, cpo and odt values.
- Reading SPD data from an arbitrary i2c eeprom.

What's so bad about my proposal ?
Please let me know so that I'm able to improve.


Regards,
André

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


Re: [U-Boot] [PATCH v7 01/10] nds32: add header files support for nds32

2011-04-08 Thread macpaul
 Hi Wolfgang,

> This also triggers an erro-r from checkpatch, and indeed this is a
> strange define.
> 
> > +#define R0 uregs[1]/* R0 */
> > +#define R1 uregs[2]
> > +#define R2 uregs[3]
> > +#define R3 uregs[4]
> 
> NAK.  Please use a C struct instead.

After discussed with the colledgue responsor for GDB and ptrace utils, we will 
fix this in Linux kernel later.
Ans, I'll fix it in the next patch v8. 

> 
> ...
> > diff --git a/arch/nds32/include/asm/u-boot.h 
> b/arch/nds32/include/asm/u-boot.h
> > new file mode 100644
> > index 000..fafe4e4
> > --- /dev/null
> > +++ b/arch/nds32/include/asm/u-boot.h
> > @@ -0,0 +1,63 @@
> > +/*
> > + * (C) Copyright 2002
> > + * Sysgo Real-Time Solutions, GmbH 
> > + * Marius Groeger 
> > + *
> > + * Copyright (C) 2011 Andes Technology Corporation
> > + * Copyright (C) 2010 Shawn Lin (nobuh...@andestech.com)
> > + * Copyright (C) 2011 Macpaul Lin (macp...@andestech.com)
> ...
> > +#ifndef _U_BOOT_H_
> > +#define _U_BOOT_H_ 1
> > +
> > +#include 
> > +
> > +typedef struct bd_info {
> > +   int bi_baudrate;/* serial console baudrate */
> > +   unsigned long   bi_ip_addr; /* IP Address */
> > +   unsigned char   bi_enetaddr[6]; /* Ethernet adress */
> > +
> > +   env_t   *bi_env;
> > +   unsigned long   bi_arch_number; /* unique id for this board */
> > +   unsigned long   bi_boot_params; /* where this board 
> expects params */
> > +
> > +   unsigned long   bi_memstart;/* start of DRAM memory */
> > +   unsigned long   bi_memsize; /* size  of DRAM memory 
> in bytes */
> > +   unsigned long   bi_flashstart;  /* start of FLASH memory */
> > +   unsigned long   bi_flashsize;   /* size  of FLASH memory */
> > +   unsigned long   bi_flashoffset; /* reserved area for 
> startup monitor */
> > +
> > +   struct  /* RAM configuration */
> > +   {
> > +   unsigned long start;
> > +   unsigned long size;
> > +   } bi_dram[CONFIG_NR_DRAM_BANKS];
> > +} bd_t;
> 
> I wonder which part of this file would be (C) by any of the folks
> listed above?
> 

The typedef struct bd_info comes from arch/i386/include/asm/u-boot.h
and arch/arm/include/asm/u-boot.h.

If you grep the author "Marius Groeger " then you can find 
the
the 2 files were in the grep result which was originally referenced.
Hence we put (C) listed above because we have referenced those 2 files.

If you have any suggestion, please let me know.


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


[U-Boot] DSN: failed (Delivery reports about your e-mail)

2011-04-08 Thread Mailbot for etexusa . com

This is a Delivery Status Notification (DSN).

I was unable to deliver your message to
ep...@comcast.net.

I said 
  RCPT TO:

And they gave me the error;
  550 5.1.1 Not our Customer

 
Reporting-MTA: dns; etexusa.com
Final-Recipient: RFC822; episr@comcast.net
Action: failed
Status: 5.0.0
Received: from lists.denx.de ([122.178.114.115]) by etexusa.com for ; Fri, 8 Apr 2011 00:32:57 -0700
From: u-boot@lists.denx.de
To: ep...@comcast.net
Subject: Delivery reports about your e-mail
Date: Fri, 8 Apr 2011 13:04:20 +0530
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="=_NextPart_000_0013_8FE8303F.8A3BCEE9"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.

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


Re: [U-Boot] [PATCH v3 4/4] ARMV7: OMAP3: Add support for Comelit DIG297 board

2011-04-08 Thread Luca Ceresoli
Il 07/04/2011 23:49, Wolfgang Denk ha scritto:
> Dear Luca Ceresoli,
>
> In message<4d9e12b7.2040...@comelit.it>  you wrote:
>> I'm going to define the bit values for the GPMC_CONFIGn registers.
>> Is arch/arm/include/asm/arch-omap3/omap_gpmc.h the correct place?
> I think so, but I'm not an OMAP expert.
>
> Sandeep?
For similarity with other ARM architectures (pxa and imx), I added
arch/arm/include/asm/arch-omap3/omap3-regs.h instead.

Luca


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


Re: [U-Boot] [PATCH v3 0/8] Universal PHY Infrastructure

2011-04-08 Thread Andy Fleming
Latest changes are now in the u-boot-mmc.git repo, in the phylib
branch.  I changed patches 5 and 7, the new versions of which are
being sent now.

On Thu, Apr 7, 2011 at 11:49 PM, Mike Frysinger  wrote:
> do you have a git tree hosting these changes ?
> -mike
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] u-boot and 2nd level usb hub

2011-04-08 Thread Kallol Biswas
Hi,
 We have a system with a 2nd level USB hub. It seems that uboot
does not discover devices beyond 1st level hub.

If this is true, is there any patch that will discover devices behind
multiple levels of hub?

The linux kernel is able to detect and configure devices that are
behind 2nd level hub.

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