Re: [U-Boot] [PATCH 1/3] ColdFire: Queued SPI driver

2011-03-21 Thread Jin Zhengxiong-R64188
> -Original Message-
> From: Richard Retanubun [mailto:richardretanu...@ruggedcom.com]
> Sent: Thursday, February 03, 2011 11:50 PM
> To: u-boot@lists.denx.de
> Cc: Jin Zhengxiong-R64188; Richard Retanubun
> Subject: [PATCH 1/3] ColdFire: Queued SPI driver
> 
> This patch adds a driver for Freescale Colfire Queued SPI bus.
> Coded to work with 8 bits per transfer to use with SPI flash.
> CPOL, CPHA, and CS_ACTIVE_HIGH can be configured.
> 
> Tested with MCF5270 which have 4 chip selects.
> 
> Activate by #define CONFIG_CF_QSPI in board config.
> ---
>  arch/m68k/cpu/mcf52x2/cpu_init.c  |  134 +-
>  arch/m68k/include/asm/coldfire/qspi.h |2 +-
>  arch/m68k/include/asm/m5271.h |   26 
>  drivers/spi/Makefile  |1 +
>  drivers/spi/cf_qspi.c |  257 
> +
>  5 files changed, 418 insertions(+), 2 deletions(-)
>  create mode 100644 drivers/spi/cf_qspi.c
>
Some general comments, thanks.
Please try the checkpatch script to clean up most of the errors and warnings.

Current DSPI code works as PIO mode. So please try to merge the qspi code to 
the current cf_spi code, and please unify the register access.

Only put the critical config in the cpu_init.c, please try to move the 
cs_activate and cs_deactivate to the spi driver.

Please clean up the Copyright information, Remove the Motorola information.


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


Re: [U-Boot] Coldfire 5235 flexbus.h

2011-03-21 Thread Jin Zhengxiong-R64188
> -Original Message-
> From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de] On
> Behalf Of Jate Sujjavanich
> Sent: Thursday, March 03, 2011 2:44 AM
> To: 'u-boot@lists.denx.de'
> Subject: [U-Boot] Coldfire 5235 flexbus.h
> 
> The defines in arch/m68k/include/coldfire/flexbus.h are not compatible with 
> the
> 5235 processor. The registers in struct fbcs are different sizes from those in
> the 5235. Also, the defines are a little different.
> 
> This is what I have so far. Comments?
> 
> 
> 
> --- u-boot-denx/arch/m68k/include/asm/coldfire/flexbus.h2011-03-02
> 11:02:14.0 -0500
> +++ u-boot/include/asm-m68k/coldfire/flexbus.h  2011-02-24 13:40:07.0 
> -
> 0500
> @@ -30,6 +30,57 @@
> * FlexBus Chip Selects (FBCS)
> */
> 
> +#ifdef CONFIG_M5235
> +typedef struct fbcs {
 
[snip]

> +u16 cscr7;
> +} fbcs_t;
> +#else

There are some different bit definition for the chip select module on all the 
ColdFire chips but the address is aligned for all the chips. Write to those 
reserved bit have no effect. Usually these configuration registers were 
initialized very only and the value write to them are defined by the platform 
with macro, So please try to hide the bit difference in the platform macro 
definition.  

[snip]
> +#ifdef CONFIG_M5235
> +#define FBCS_CSCR_SRWS(x)   (((x) & 0x3) << 14)
> +#define FBCS_CSCR_IWS(x)(((x) & 0xF) << 10)
> +#define FBCS_CSCR_AA_ON (1 << 8)
> +#define FBCS_CSCR_AA_OFF(0 << 8)
> +#define FBCS_CSCR_PS_32 (0 << 6)
> +#define FBCS_CSCR_PS_16 (2 << 6)
> +#define FBCS_CSCR_PS_8  (1 << 6)
> +#define FBCS_CSCR_BEM_ON(1 << 5)
> +#define FBCS_CSCR_BEM_OFF   (0 << 5)
> +#define FBCS_CSCR_BSTR_ON   (1 << 4)
> +#define FBCS_CSCR_BSTR_OFF  (0 << 4)
> +#define FBCS_CSCR_BSTW_ON   (1 << 3)
> +#define FBCS_CSCR_BSTW_OFF  (0 << 3)
> +#define FBCS_CSCR_SWWS(x)   (((x) & 0x7) << 0)
If the bit operation for the chip select module is needed, Please try to define 
it align with the common fbcs_t structure, Thanks.

Best Regards,
Jason

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


Re: [U-Boot] [PATCH v3 00/23] keymile board update

2011-03-21 Thread Heiko Schocher
Hello Prafulla,

Prafulla Wadaskar wrote:
> 
>> -Original Message-
>> From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
>> On Behalf Of Heiko Schocher
>> Sent: Monday, March 21, 2011 12:32 PM
>> To: u-boot@lists.denx.de
>> Cc: Heiko Schocher
>> Subject: [U-Boot] [PATCH v3 00/23] keymile board update
>>
>> The following patchset updates the support for the keymile
>> boards.
>>
>> - fix a lot of Codingstyle issues for this boards
>> - heavy rework of the headerfiles, common board code
>> - add support for 4 new mpc83xx based boards
>> - add support for 1 82xx based board
>> - add support for 2 new kirkwood based boards
>> - fix i2c deblocking for this boards
> 
> Hi Heiko
> Ideally this patch series should go all together, right?

Yep.

> Since there are multiple SoC based support in the same patch series, who is 
> suppose to pull this?

I think, that Wolfgang can pull this, if every custodian
Acks the appropriate patches.

> I suggest to have smaller patche series i.e. board wise.

Yep, normally I aggree, but boards from this manufacturer
use common headerfiles (we actually try to simplify), so
this got such a big package ... sorry.

> Since there is heavy rework,
> Also take a look at mv-common.h that we have created for armada100 and 
> Kirkwood common boards configs. With this we had an abstraction where mostly 
> files are only added to any new board support.

Ok, I look in it, maybe we can use them to simplify the
config files for the kirkwood based boards.

Thanks!

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 00/23] keymile board update

2011-03-21 Thread Prafulla Wadaskar


> -Original Message-
> From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
> On Behalf Of Heiko Schocher
> Sent: Monday, March 21, 2011 12:32 PM
> To: u-boot@lists.denx.de
> Cc: Heiko Schocher
> Subject: [U-Boot] [PATCH v3 00/23] keymile board update
> 
> The following patchset updates the support for the keymile
> boards.
> 
> - fix a lot of Codingstyle issues for this boards
> - heavy rework of the headerfiles, common board code
> - add support for 4 new mpc83xx based boards
> - add support for 1 82xx based board
> - add support for 2 new kirkwood based boards
> - fix i2c deblocking for this boards

Hi Heiko
Ideally this patch series should go all together, right?
Since there are multiple SoC based support in the same patch series, who is 
suppose to pull this?

I suggest to have smaller patche series i.e. board wise.
Since there is heavy rework,
Also take a look at mv-common.h that we have created for armada100 and Kirkwood 
common boards configs. With this we had an abstraction where mostly files are 
only added to any new board support.

Regards..
Prafulla . .

> 
> Heiko Schocher (16):
>   powerpc, mpc83xx: add missing functions to mpc83xx.h
>   keymile: Fix Coding style issues for keymile boards.
>   mpc832x: add support for the mpc8321 based suvd3 board
>   mpc832x: add support for mpc8321 based tuxa1 board
>   mpc832x: add support for mpc8321 based tuda1 board
>   arm: add support for kirkwood based mgcoge2un board
>   arm: add support of Kirkwood based board SUEN8
>   ppc: add support for ppc based board mgcoge2ne
>   powerpc, 83xx: add kmsupx5 board support
>   km-arm: i2c support for suenx based boards
>   km_arm: change some register values for SDRAM initialization
>   ppc, 8321: cleanup tuxa1, tuda1 and suvd3 support
>   keymile, common; fix i2c deblocking support
>   arm, keymile: updates for the arm based boards from keymile
>   keymile boards: add CONFIG_PIGGY_MAC_ADRESS_OFFSET
>   keymile, common: add setting of some environment variables
> 
> Holger Brunck (5):
>   arm, keymile: rename MACH_SUEN3 to MACH_KM_KIRKWOOD
>   ppc, arm: adapt keymile header
>   arm, ppc: rework environment variables for keymile boards
>   ppc, arm: rework and enhance keymile-common.h
>   keymile-common.h: remove IO mux stuff
> 
> Thomas Herzmann (1):
>   keymile boards: support of boardId / hwkey lists
> 
> Thomas Reufer (1):
>   keymile, 8321 boards: move common definitions to km8321-common.h
> 
>  MAINTAINERS|7 +
>  arch/powerpc/cpu/mpc83xx/fdt.c |3 +-
>  arch/powerpc/lib/bootcount.c   |2 +-
>  board/keymile/common/common.c  |  496 -
> ---
>  board/keymile/common/common.h  |   44 +++-
>  board/keymile/{kmeter1 => km83xx}/Makefile |0
>  board/keymile/km83xx/km83xx.c  |  288 
>  board/keymile/km_arm/km_arm.c  |   91 --
>  board/keymile/km_arm/kwbimage.cfg  |   32 +-
>  board/keymile/kmeter1/kmeter1.c|  217 
>  board/keymile/mgcoge/mgcoge.c  |   93 +++---
>  boards.cfg |9 +-
>  include/configs/keymile-common.h   |  489 +++--
> ---
>  include/configs/km-powerpc.h   |   92 +
>  include/configs/km82xx-common.h|  336 +++
>  include/configs/km8321-common.h|  138 
>  include/configs/km83xx-common.h|  325 ++
>  include/configs/km_arm.h   |  104 +-
>  include/configs/kmeter1.h  |  369 +++--
> -
>  include/configs/kmsupx5.h  |   91 +
>  include/configs/mgcoge.h   |  307 +-
>  include/configs/mgcoge2ne.h|   64 
>  include/configs/mgcoge2un.h|   65 
>  include/configs/suen3.h|   45 +---
>  include/configs/suen8.h|   65 
>  include/configs/suvd3.h|  104 ++
>  include/configs/tuda1.h|  141 
>  include/configs/tuxa1.h|  124 +++
>  include/mpc83xx.h  |6 +
>  29 files changed, 2794 insertions(+), 1353 deletions(-)
>  rename board/keymile/{kmeter1 => km83xx}/Makefile (100%)
>  create mode 100644 board/keymile/km83xx/km83xx.c
>  delete mode 100644 board/keymile/kmeter1/kmeter1.c
>  create mode 100644 include/configs/km-powerpc.h
>  create mode 100644 include/configs/km82xx-common.h
>  create mode 100644 include/configs/km8321-common.h
>  create mode 100644 include/configs/km83xx-common.h
>  create mode 100644 include/configs/kmsupx5.h
>  create mode 100644 include/configs/mgcoge2ne.h
>  create mode 100644 include/configs/mgcoge2un.h
>  create mode 100644 include/configs/suen8.h
>  create mode 100644 include/configs/suvd3.h
>  create mode 100644 include/con

[U-Boot] [PATCH v2 4/4] ftsmc020: move ftsmc020 static mem controller to driver/mtd

2011-03-21 Thread Macpaul Lin
Move the header file and definitions of ftsmc020
static memory control unit from a320 SoC folder to
"drivers/mtd" folder.

This change will let other SoC which also use ftsmc020
could share the same header file.

Signed-off-by: Macpaul Lin 
---
Changes for v2:
 - Move the header file of ftsmc020.h to include/faraday.
 - Fix the include path of ftsmc020 for a320evb.
 - v1 of this patch /patch/71957/ in patchworks has been marked as 
superseded.

 arch/arm/cpu/arm920t/a320/Makefile|1 -
 arch/arm/cpu/arm920t/a320/ftsmc020.c  |   51 --
 arch/arm/include/asm/arch-a320/ftsmc020.h | 
  79 -
 board/faraday/a320evb/a320evb.c   |2 +-
 drivers/mtd/Makefile  |1 +
 drivers/mtd/ftsmc020.c|   51 ++
 include/configs/a320evb.h |4 +-
 include/faraday/ftsmc020.h|   79 
+
 8 files changed, 135 insertions(+), 133 deletions(-)
 delete mode 100644 arch/arm/cpu/arm920t/a320/ftsmc020.c
 delete mode 100644 arch/arm/include/asm/arch-a320/ftsmc020.h
 create mode 100644 drivers/mtd/ftsmc020.c
 create mode 100644 include/faraday/ftsmc020.h

diff --git a/arch/arm/cpu/arm920t/a320/Makefile 
b/arch/arm/cpu/arm920t/a320/Makefile
index 31da706..50eb265 100644
--- a/arch/arm/cpu/arm920t/a320/Makefile
+++ b/arch/arm/cpu/arm920t/a320/Makefile
@@ -27,7 +27,6 @@ LIB   = $(obj)lib$(SOC).o

 SOBJS  += reset.o
 COBJS  += timer.o
-COBJS  += ftsmc020.o

 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/arch/arm/cpu/arm920t/a320/ftsmc020.c 
b/arch/arm/cpu/arm920t/a320/ftsmc020.c
deleted file mode 100644
index 7646537..000
--- a/arch/arm/cpu/arm920t/a320/ftsmc020.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * (C) Copyright 2009 Faraday Technology
- * Po-Yu Chuang 
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include 
-#include 
-#include 
-#include 
-
-struct ftsmc020_config {
-   unsigned intconfig;
-   unsigned inttiming;
-};
-
-static struct ftsmc020_config config[] = CONFIG_SYS_FTSMC020_CONFIGS;
-
-static struct ftsmc020 *smc = (struct ftsmc020 *)CONFIG_FTSMC020_BASE;
-
-static void ftsmc020_setup_bank(unsigned int bank, struct ftsmc020_config 
*cfg)
-{
-   if (bank > 3) {
-   printf("bank # %u invalid\n", bank);
-   return;
-   }
-
-   writel(cfg->config, &smc->bank[bank].cr);
-   writel(cfg->timing, &smc->bank[bank].tpr);
-}
-
-void ftsmc020_init(void)
-{
-   int i;
-
-   for (i = 0; i < ARRAY_SIZE(config); i++)
-   ftsmc020_setup_bank(i, &config[i]);
-}
diff --git a/arch/arm/include/asm/arch-a320/ftsmc020.h 
b/arch/arm/include/asm/arch-a320/ftsmc020.h
deleted file mode 100644
index 95d9500..000
--- a/arch/arm/include/asm/arch-a320/ftsmc020.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * (C) Copyright 2009 Faraday Technology
- * Po-Yu Chuang 
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-/*
- * Static Memory Controller
- */
-#ifndef __FTSMC020_H
-#define __FTSMC020_H
-
-#ifndef __ASSEMBLY__
-
-struct ftsmc020 {
-   struct {
-   unsigned intcr; /* 0x00, 0x08, 0x10, 0x18 */
-   unsigned inttpr;/* 0x04, 0x0c, 0x14, 0x1c */
-   } bank[4];
-   unsigned intpad[8]; /* 0x20 - 0x3c */
-   unsigned intssr;/* 0x40 */
-};
-
-void ftsmc020_init(void);
-
-#endif /* __ASSEMBLY__ */
-
-/*
- * Memory Bank Configuration Register
- */
-#define FTSMC020_BANK_ENABLE   (1 << 28)
-#define FTSMC020_BANK_BASE(x)  ((x) & 0x0fff1000)
-
-#define FTSMC020_BANK_WPROT 

[U-Boot] [PATCH v2 3/4] ftsdmc020: move ftsdmc020.h to include/faraday

2011-03-21 Thread Macpaul Lin
Move the header file "ftsdmc020.h" (SDRAM Controller)
to "include/faraday" folder.

This change will let other SoC which also use ftsdmc020
could share the same header file.

Signed-off-by: Macpaul Lin 
---
Changes for v2:
 - Fix the include path of ftsdmc020 for a320evb.
 - v1 of this patch /patch/71953/ in patchworks has been marked as 
superseded.

 arch/arm/include/asm/arch-a320/ftsdmc020.h | 
 103 
 board/faraday/a320evb/lowlevel_init.S  |2 +-
 include/faraday/ftsdmc020.h|  103 

 3 files changed, 104 insertions(+), 104 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-a320/ftsdmc020.h
 create mode 100644 include/faraday/ftsdmc020.h

diff --git a/arch/arm/include/asm/arch-a320/ftsdmc020.h 
b/arch/arm/include/asm/arch-a320/ftsdmc020.h
deleted file mode 100644
index 0699772..000
--- a/arch/arm/include/asm/arch-a320/ftsdmc020.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * (C) Copyright 2009 Faraday Technology
- * Po-Yu Chuang 
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-/*
- * SDRAM Controller
- */
-#ifndef __FTSDMC020_H
-#define __FTSDMC020_H
-
-#define FTSDMC020_OFFSET_TP0   0x00
-#define FTSDMC020_OFFSET_TP1   0x04
-#define FTSDMC020_OFFSET_CR0x08
-#define FTSDMC020_OFFSET_BANK0_BSR 0x0C
-#define FTSDMC020_OFFSET_BANK1_BSR 0x10
-#define FTSDMC020_OFFSET_BANK2_BSR 0x14
-#define FTSDMC020_OFFSET_BANK3_BSR 0x18
-#define FTSDMC020_OFFSET_BANK4_BSR 0x1C
-#define FTSDMC020_OFFSET_BANK5_BSR 0x20
-#define FTSDMC020_OFFSET_BANK6_BSR 0x24
-#define FTSDMC020_OFFSET_BANK7_BSR 0x28
-#define FTSDMC020_OFFSET_ACR   0x34
-
-/*
- * Timing Parametet 0 Register
- */
-#define FTSDMC020_TP0_TCL(x)   ((x) & 0x3)
-#define FTSDMC020_TP0_TWR(x)   (((x) & 0x3) << 4)
-#define FTSDMC020_TP0_TRF(x)   (((x) & 0xf) << 8)
-#define FTSDMC020_TP0_TRCD(x)  (((x) & 0x7) << 12)
-#define FTSDMC020_TP0_TRP(x)   (((x) & 0xf) << 16)
-#define FTSDMC020_TP0_TRAS(x)  (((x) & 0xf) << 20)
-
-/*
- * Timing Parametet 1 Register
- */
-#define FTSDMC020_TP1_REF_INTV(x)  ((x) & 0x)
-#define FTSDMC020_TP1_INI_REFT(x)  (((x) & 0xf) << 16)
-#define FTSDMC020_TP1_INI_PREC(x)  (((x) & 0xf) << 20)
-
-/*
- * Configuration Register
- */
-#define FTSDMC020_CR_SREF  (1 << 0)
-#define FTSDMC020_CR_PWDN  (1 << 1)
-#define FTSDMC020_CR_ISMR  (1 << 2)
-#define FTSDMC020_CR_IREF  (1 << 3)
-#define FTSDMC020_CR_IPREC (1 << 4)
-#define FTSDMC020_CR_REFTYPE   (1 << 5)
-
-/*
- * SDRAM External Bank Base/Size Register
- */
-#define FTSDMC020_BANK_ENABLE  (1 << 28)
-
-#define FTSDMC020_BANK_BASE(addr)  (((addr) >> 20) << 16)
-
-#define FTSDMC020_BANK_DDW_X4  (0 << 12)
-#define FTSDMC020_BANK_DDW_X8  (1 << 12)
-#define FTSDMC020_BANK_DDW_X16 (2 << 12)
-#define FTSDMC020_BANK_DDW_X32 (3 << 12)
-
-#define FTSDMC020_BANK_DSZ_16M (0 << 8)
-#define FTSDMC020_BANK_DSZ_64M (1 << 8)
-#define FTSDMC020_BANK_DSZ_128M(2 << 8)
-#define FTSDMC020_BANK_DSZ_256M(3 << 8)
-
-#define FTSDMC020_BANK_MBW_8   (0 << 4)
-#define FTSDMC020_BANK_MBW_16  (1 << 4)
-#define FTSDMC020_BANK_MBW_32  (2 << 4)
-
-#define FTSDMC020_BANK_SIZE_1M 0x0
-#define FTSDMC020_BANK_SIZE_2M 0x1
-#define FTSDMC020_BANK_SIZE_4M 0x2
-#define FTSDMC020_BANK_SIZE_8M 0x3
-#define FTSDMC020_BANK_SIZE_16M0x4
-#define FTSDMC020_BANK_SIZE_32M0x5
-#define FTSDMC020_BANK_SIZE_64M0x6
-#define FTSDMC020_BANK_SIZE_128M   0x7
-#define FTSDMC020_BANK_SIZE_256M   0x8
-
-/*
- * Arbiter Control Register
- */
-#define FTSDMC020_ACR_TOC(x)   ((x) & 0x1f)
-#define FTSDMC020_ACR_TOE  (1 << 8)
-
-#endif /* __FTSDMC020_H */
diff --git a/board/faraday/a320evb/lowlevel_init.S 
b/board/faraday/a320evb/lowlevel_init.S
index 97718c0..4262c11 100644
--- a/board/faraday/a320evb/lowlevel_init.S
+++ b/board/faraday/a320evb/lowlevel_init.S
@@ -21,7 +21,7 @@
 #include 

 #include 
-#include 
+#include 

 /*
  * parameters for the SDRAM controller
diff --git a/include/faraday/ftsdmc020.h b/include/faraday/ftsdmc020.h
new file mode 100644
index 000..0699772
--- /dev/null
+++ b/include/faraday/f

[U-Boot] [PATCH v2 2/4] ftsdmc021: add register definitions of ftsdmc021

2011-03-21 Thread Macpaul Lin
Support registers definitions of ftsdmc021 SDRAM controller.

Signed-off-by: Macpaul Lin 
---
Changes for v2:
 - Add __ASSEMBLY__ protecton to register offset for supporting 
lowlevel_init

 include/faraday/ftsdmc021.h |  154 
+++
 1 files changed, 154 insertions(+), 0 deletions(-)
 create mode 100644 include/faraday/ftsdmc021.h

diff --git a/include/faraday/ftsdmc021.h b/include/faraday/ftsdmc021.h
new file mode 100644
index 000..3ed535a
--- /dev/null
+++ b/include/faraday/ftsdmc021.h
@@ -0,0 +1,154 @@
+/*
+ * (C) Copyright 2009 Faraday Technology
+ * Po-Yu Chuang 
+ *
+ * (C) Copyright 2011 Andes Technology Corp
+ * Macpaul Lin 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/*
+ * FTSDMC021 - SDRAM Controller
+ */
+#ifndef __FTSDMC021_H
+#define __FTSDMC021_H
+
+#ifdef __ASSEMBLY__
+#define FTSDMC021_OFFSET_TP1   0x00/* SDRAM Timing Parameter 1 */
+#define FTSDMC021_OFFSET_TP2   0x04/* SDRAM Timing Parameter 2 */
+#define FTSDMC021_OFFSET_CR1   0x08/* SDRAM Configuration Reg 1 */
+#define FTSDMC021_OFFSET_CR2   0x0C/* SDRAM Configuration Reg 2 */
+#define FTSDMC021_OFFSET_BANK0_BSR 0x10/* External Bank Base/Size Reg 
0 */
+#define FTSDMC021_OFFSET_BANK1_BSR 0x14/* External Bank Base/Size Reg 
1 */
+#define FTSDMC021_OFFSET_BANK2_BSR 0x18/* External Bank Base/Size Reg 
2 */
+#define FTSDMC021_OFFSET_BANK3_BSR 0x1C/* External Bank Base/Size Reg 
3 */
+#define FTSDMC021_OFFSET_BANK4_BSR 0x20/* External Bank Base/Size Reg 
4 */
+#define FTSDMC021_OFFSET_BANK5_BSR 0x24/* External Bank Base/Size Reg 
5 */
+#define FTSDMC021_OFFSET_BANK6_BSR 0x28/* External Bank Base/Size Reg 
6 */
+#define FTSDMC021_OFFSET_BANK7_BSR 0x2C/* External Bank Base/Size Reg 
7 */
+#define FTSDMC021_OFFSET_RAGR  0x30/* Read Arbitration Group Reg */
+#define FTSDMC021_OFFSET_FRR   0x34/* Flush Request Register */
+#define FTSDMC021_OFFSET_EBISR 0x38/* EBI Support Register */
+#define FTSDMC021_OFFSET_CRR   0x100   /* Controller Revision Reg */
+#define FTSDMC021_OFFSET_CFR   0x104   /* Controller Feature Reg */
+#endif /* __ASSEMBLY__ */
+
+/*
+ * Timing Parameter 1 Register
+ */
+#define FTSDMC021_TP1_TCL(x)   ((x) & 0x3)
+#define FTSDMC021_TP1_TWR(x)   (((x) & 0x3) << 4)
+#define FTSDMC021_TP1_TRF(x)   (((x) & 0xf) << 8)
+#define FTSDMC021_TP1_TRCD(x)  (((x) & 0x7) << 12)
+#define FTSDMC021_TP1_TRP(x)   (((x) & 0xf) << 16)
+#define FTSDMC021_TP1_TRAS(x)  (((x) & 0xf) << 20)
+
+/*
+ * Timing Parameter 2 Register
+ */
+#define FTSDMC021_TP2_REF_INTV(x)  ((x) & 0x)
+#define FTSDMC021_TP2_INI_REFT(x)  (((x) & 0xf) << 16)
+#define FTSDMC021_TP2_INI_PREC(x)  (((x) & 0xf) << 20)
+
+/*
+ * Configuration Register 1
+ */
+#define FTSDMC021_CR1_BNKSIZEF(x)  ((x) & 0xf)
+#define FTSDMC021_CR1_MBW(x)   (((x) & 0x3) << 4)
+#define FTSDMC021_CR1_DSZ(x)   (((x) & 0x7) << 8)
+#define FTSDMC021_CR1_DDW(x)   (((x) & 0x3) << 12)
+#define FTSDMC021_CR1_MA2T(x)  (1 << 16)   /* Double Memory 
Address 
Cycle Enable */
+
+/*
+ * Configuration Register 2
+ */
+#define FTSDMC021_CR2_SREF (1 << 0)
+#define FTSDMC021_CR2_PWDN (1 << 1)
+#define FTSDMC021_CR2_ISMR (1 << 2)
+#define FTSDMC021_CR2_IREF (1 << 3)
+#define FTSDMC021_CR2_IPREC(1 << 4)
+#define FTSDMC021_CR2_REFTYPE  (1 << 5)
+
+/*
+ * SDRAM External Bank Base/Size Register
+ */
+#define FTSDMC021_BANK_ENABLE  (1 << 12)
+
+/* 12-bit base address of external bank.
+ * Default value is 0x800.
+ * The 12-bit equals to the haddr[31:20] of AHB address bus. */
+#define FTSDMC021_BANK_BASE(x) ((x) & 0xfff)
+
+#define FTSDMC021_BANK_SIZE_1M 0x0
+#define FTSDMC021_BANK_SIZE_2M 0x1
+#define FTSDMC021_BANK_SIZE_4M 0x2
+#define FTSDMC021_BANK_SIZE_8M 0x3
+#define FTSDMC021_BANK_SIZE_16M0x4
+#define FTSDMC021_BANK_SIZE_32M0x5
+#define FTSDMC021_BANK_SIZE_64M0x6
+#define FTSDMC021_BANK_SIZE_128M   0x7
+#define FTSDMC021_BANK_SIZE_256M   0x8
+#define FTSDMC021_BANK_SIZE_512M   0x9
+
+/*
+ * Read Arbitration Grant Window Register
+ */
+#define FTSDMC021_RAGR_CH1GW(x)  

[U-Boot] [PATCH v2 1/4] ftahbc020s: Faraday FTAHBC020s AHB Bus Controller

2011-03-21 Thread Macpaul Lin
ftahbc020s.h provides basic definitions of this controller
to help a SoC which use this AHB Controller could
do scalable software settings in lowlevel_init.S.

Signed-off-by: Macpaul Lin 
---
Changes for v2:
 - Add __ASSEMBLY__ protecton to register offset for supporting 
lowlevel_init

 include/faraday/ftahbc020s.h |   94 
++
 1 files changed, 94 insertions(+), 0 deletions(-)
 create mode 100644 include/faraday/ftahbc020s.h

diff --git a/include/faraday/ftahbc020s.h b/include/faraday/ftahbc020s.h
new file mode 100644
index 000..da85582
--- /dev/null
+++ b/include/faraday/ftahbc020s.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2011 Andes Technology Corporation
+ * Macpaul Lin, Andes Technology Corporation 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* FTAHBC020S - AHB Controller (Arbiter/Decoder) definitions */
+#ifndef __FTAHBC020S_H
+#define __FTAHBC202S_H
+
+/* Registers Offsets */
+
+/*
+ * AHB Slave BSR, n * 4, n=0~31
+ */
+#ifdef __ASSEMBLY__
+/* this section is used by lowlevel_init.S */
+#define FTAHBC020S_SLAVE_BSR_0 0x00/* Slave n Base/Size Reg */
+#define FTAHBC020S_SLAVE_BSR_1 0x04
+#define FTAHBC020S_SLAVE_BSR_2 0x08
+#define FTAHBC020S_SLAVE_BSR_3 0x0C
+#define FTAHBC020S_SLAVE_BSR_4 0x10
+#define FTAHBC020S_SLAVE_BSR_5 0x14
+#define FTAHBC020S_SLAVE_BSR_6 0x18
+#define FTAHBC020S_SLAVE_BSR_7 0x1C
+#define FTAHBC020S_SLAVE_BSR_8 0x20
+#define FTAHBC020S_SLAVE_BSR_9 0x24
+#define FTAHBC020S_SLAVE_BSR_100x28
+
+#define FTAHBC020S_PCR 0x80/* Priority Ctrl Reg */
+#define FTAHBC020S_TCRG0x84/* Transfer Ctrl Reg */
+#define FTAHBC020S_CR  0x88/* Ctrl Reg */
+#endif /* __ASSEMBLY__ */
+
+/*
+ * FTAHBC020S_SLAVE_BSR - Slave n Base / Size Register
+ */
+#define FTAHBC020S_SLAVE_BSR_BASE(x)   (((x) & 0xFFF) << 20)
+#define FTAHBC020S_SLAVE_BSR_SIZE(x)   (((x) & 0xF) << 16)
+
+#define FTAHBC020S_SLAVE_BSR_SIZE_1M   0x0
+#define FTAHBC020S_SLAVE_BSR_SIZE_2M   0x1
+#define FTAHBC020S_SLAVE_BSR_SIZE_4M   0x2
+#define FTAHBC020S_SLAVE_BSR_SIZE_8M   0x3
+#define FTAHBC020S_SLAVE_BSR_SIZE_16M  0x4
+#define FTAHBC020S_SLAVE_BSR_SIZE_32M  0x5
+#define FTAHBC020S_SLAVE_BSR_SIZE_64M  0x6
+#define FTAHBC020S_SLAVE_BSR_SIZE_128M 0x7
+#define FTAHBC020S_SLAVE_BSR_SIZE_256M 0x8
+#define FTAHBC020S_SLAVE_BSR_SIZE_512M 0x9
+#define FTAHBC020S_SLAVE_BSR_SIZE_1G   0xA
+#define FTAHBC020S_SLAVE_BSR_SIZE_2G   0xB
+
+/*
+ * FTAHBC020S_PCR - Priority Control Register
+ */
+#define FTAHBC020S_PCR_PLEVEL_15   (1 << 15)
+#define FTAHBC020S_PCR_PLEVEL_14   (1 << 14)
+#define FTAHBC020S_PCR_PLEVEL_13   (1 << 13)
+#define FTAHBC020S_PCR_PLEVEL_12   (1 << 12)
+#define FTAHBC020S_PCR_PLEVEL_11   (1 << 11)
+#define FTAHBC020S_PCR_PLEVEL_10   (1 << 10)
+#define FTAHBC020S_PCR_PLEVEL_09   (1 << 9)
+#define FTAHBC020S_PCR_PLEVEL_08   (1 << 8)
+#define FTAHBC020S_PCR_PLEVEL_07   (1 << 7)
+#define FTAHBC020S_PCR_PLEVEL_06   (1 << 6)
+#define FTAHBC020S_PCR_PLEVEL_05   (1 << 5)
+#define FTAHBC020S_PCR_PLEVEL_04   (1 << 4)
+#define FTAHBC020S_PCR_PLEVEL_03   (1 << 3)
+#define FTAHBC020S_PCR_PLEVEL_02   (1 << 2)
+#define FTAHBC020S_PCR_PLEVEL_01   (1 << 1)
+
+/*
+ * FTAHBC020S_CR - Interrupt Control Register
+ */
+#define FTAHBC020S_CR_INTSTS   (1 << 24)
+#define FTAHBC020S_CR_RESP(x)  (((x) & 0x3) << 20)
+#define FTAHBC020S_CR_INTSMASK (1 << 16)
+#define FTAHBC020S_CR_REMAP(1 << 0)
+
+#endif /* __FTAHBC020S_H */
-- 
1.7.3.5



CONFIDENTIALITY NOTICE:

This e-mail (and its attachments) may contain confidential and legally 
privileged information or information protected from disclosure. If you 
are not the intended recipient, you are hereby notified that any 
disclosure, copying, distribution, or use of the information contained 
herein is strictly prohibited. In this case, please immediately notify the 
sender by return e-mail, delete the message (and any accompanying 
documents) and destroy all printed hard copies. Thank you for your 
cooperation.

Copyright ANDES TECHNOLOGY CORPORATION - All Rights Reserved.

___
U-Boot mailing list
U-Boot@lists.denx.de
http://l

[U-Boot] [PATCH] ARMV7: S5PC110: Fixed register offset in mmc.h

2011-03-21 Thread Chander Kashyap
MMC controller "control4" register offset set to
0x8C as per data sheet.
Added missed out reserved field.
Updated padding field size.

Signed-off-by: Chander Kashyap 
---
 arch/arm/include/asm/arch-s5pc1xx/mmc.h |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/arch-s5pc1xx/mmc.h 
b/arch/arm/include/asm/arch-s5pc1xx/mmc.h
index 48de64d..d458d3b 100644
--- a/arch/arm/include/asm/arch-s5pc1xx/mmc.h
+++ b/arch/arm/include/asm/arch-s5pc1xx/mmc.h
@@ -53,10 +53,11 @@ struct s5p_mmc {
unsigned char   res3[0x34];
unsigned intcontrol2;
unsigned intcontrol3;
+   unsigned char   res4[4];
unsigned intcontrol4;
-   unsigned char   res4[0x6e];
+   unsigned char   res5[0x6e];
unsigned short  hcver;
-   unsigned char   res5[0xFFF02];
+   unsigned char   res6[0xFFF00];
 };
 
 struct mmc_host {
-- 
1.7.1

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


Re: [U-Boot] [PATCH V5 2/4] SMDK2410: remove unneeded config.mk

2011-03-21 Thread Minkyu Kang
Dear David Müller,

On 17 March 2011 21:35, David Müller  wrote:
> -CONFIG_SYS_TEXT_BASE = 0x33F8
> diff --git a/include/configs/smdk2410.h b/include/configs/smdk2410.h
> index 38b5684..3b037c4 100644
> --- a/include/configs/smdk2410.h
> +++ b/include/configs/smdk2410.h
> @@ -38,6 +38,8 @@
>  #define CONFIG_S3C2410 1       /* specifically a SAMSUNG S3C2410 SoC   */
>  #define CONFIG_SMDK2410        1       /* on a SAMSUNG SMDK2410 Board  */
>
> +#define CONFIG_SYS_TEXT_BASE   0x0

Zero is right? Maybe 0x33F8?

> +
>  /* input clock of PLL */
>  #define CONFIG_SYS_CLK_FREQ    1200/* the SMDK2410 has 12MHz input clock 
> */
>

Thanks
Minkyu Kang
-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5 1/4] SMDK2410: activate ARM relocation feature

2011-03-21 Thread Minkyu Kang
Dear David Müller,

On 17 March 2011 21:35, David Müller  wrote:
> Signed-off-by: David Müller 
>
> ---
>  include/configs/smdk2410.h |    7 +++
>  1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/include/configs/smdk2410.h b/include/configs/smdk2410.h
> index 62fe97e..38b5684 100644
> --- a/include/configs/smdk2410.h
> +++ b/include/configs/smdk2410.h
> @@ -179,4 +179,11 @@
>  #define        CONFIG_ENV_IS_IN_FLASH  1
>  #define CONFIG_ENV_SIZE                0x1 /* Total Size of Environment 
> Sector */
>
> +/* additions for new relocation code, must be added to all boards */
> +#undef CONFIG_SYS_ARM_WITHOUT_RELOC

Please remove this define.

> +#define CONFIG_SYS_SDRAM_BASE  PHYS_SDRAM_1
> +#define CONFIG_SYS_INIT_SP_ADDR        (CONFIG_SYS_SDRAM_BASE + 0x1000 - \
> +                               GENERATED_GBL_DATA_SIZE)
> +
> +
>  #endif /* __CONFIG_H */

Thanks
Minkyu Kang
-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [Patch v2] Fix hash table deletion to prevent lost entries

2011-03-21 Thread Peter Barada
On 03/21/2011 05:48 PM, Wolfgang Denk wrote:
> Dear Peter Barada,
>
> In message <4d385a7f.2070...@logicpd.com> you wrote:
>> On 01/19/2011 03:47 PM, Wolfgang Denk wrote:
>>> Dear Peter Barada,
>>>
>>> In message <4d371208.3090...@logicpd.com> you wrote:
>> The hash delete code is in error; instead of just removing the deleted
>> key, it should instead allocate a new hashtable, hash all the keys into
>> the new table except for the deleted key and then reclaim the old table
>> (and deleted key).
> Can you please come up with a patch?
>> From: Peter Barada 
>> Date: Thu, 20 Jan 2011 10:38:57 -0500
>> Subject: [PATCH] Fix hashtable to properly handle deletion.
>>
>> Use negative used value to mark deleted entry.  Search keeps probing past
>> deleted entries.  Adding an entry uses first deleted entry when it hits
>> end of probe chain.
>>
>> Signed-off-by: Peter Barada 
> Checkpatch generates a number of errors:
>
>   [PATCH] Fix hashtable to properly handle deletion.
>   total: 8 errors, 16 warnings, 66 lines checked
>
> Can you please fix these, and resubmit?
Updated patch attached (Thunderbird munched tabs)...

> Also, do you happen to have a test case that can be used show the
> problem in the existing code, and to test the patch?
No, I don't have a testcase off hand (IIRC hashtable size is dependent on size 
of u-boot and amount of RAM), from my original email:

In message <4d34c85e.4030...@logicpd.com> you wrote:

> > 
> > After spending an entire day digging into the hash using GDB/BDI on my 
> > ARM board, I've findally figured out that the hash key of "ramdiskimage" 
> > and "preboot" are the same modulus 347, and this is problematic because 
> > on the initial hash import, preboot is placed into the hash first (at 
> > idx 190 since the table is sorted), and then ramdiskimage collides with 
> > preboot causing the 2nd probe (at idx 191) to occur which works fine.  
> > Unfortunately as part of the housecleaning, preboot is deleted and the 
> > environemnt saved.  The delete of preboot removes entry at idx 190 and 
> > the next lookup of ramdiskimage sees that idx 190 is empty and believes 
> > that the ramdiskimage is not in the table ionstead of rehashing to find 
> > it at idx 191.
Hope this helps...

-- 
Peter Barada
peter.bar...@logicpd.com

From: Peter Barada 
Date: Mon, 21 Mar 2011 19:01:57 -0500
Subject: [PATCH] Fix hashtable to properly handle deletion.

Use negative used value to mark deleted entry.  Search keeps probing
past deleted entries.  Adding an entry uses first deleted entry when
it hits end of probe chain.

Initially found that "ramdiskimage" and "preboot" collide modulus 347,
causing "preboot" to be inserted at idx 190, "ramdiskimage" at idx 191.
Previous to this fix when "preboot" is deleted, "ramdiskimage" is
orphaned.

Signed-off-by: Peter Barada 
---
diff --git a/lib/hashtable.c b/lib/hashtable.c
index 9f069c0..fcdb53c 100644
--- a/lib/hashtable.c
+++ b/lib/hashtable.c
@@ -65,7 +65,7 @@
  * which describes the current status.
  */
 typedef struct _ENTRY {
-	unsigned int used;
+	int used;
 	ENTRY entry;
 } _ENTRY;
 
@@ -152,7 +152,7 @@ void hdestroy_r(struct hsearch_data *htab)
 
 	/* free used memory */
 	for (i = 1; i <= htab->size; ++i) {
-		if (htab->table[i].used) {
+		if (htab->table[i].used > 0) {
 			ENTRY *ep = &htab->table[i].entry;
 
 			free(ep->key);
@@ -209,7 +209,7 @@ int hmatch_r(const char *match, int last_idx, ENTRY ** retval,
 	size_t key_len = strlen(match);
 
 	for (idx = last_idx + 1; idx < htab->size; ++idx) {
-		if (!htab->table[idx].used)
+		if (htab->table[idx].used > 0)
 			continue;
 		if (!strncmp(match, htab->table[idx].entry.key, key_len)) {
 			*retval = &htab->table[idx].entry;
@@ -229,6 +229,7 @@ int hsearch_r(ENTRY item, ACTION action, ENTRY ** retval,
 	unsigned int count;
 	unsigned int len = strlen(item.key);
 	unsigned int idx;
+	unsigned int first_deleted = 0;
 
 	/* Compute an value for the given string. Perhaps use a better method. */
 	hval = len;
@@ -256,6 +257,10 @@ int hsearch_r(ENTRY item, ACTION action, ENTRY ** retval,
 		 */
 		unsigned hval2;
 
+		if (htab->table[idx].used == -1
+		&& !first_deleted)
+			first_deleted = idx;
+
 		if (htab->table[idx].used == hval
 		&& strcmp(item.key, htab->table[idx].entry.key) == 0) {
 			/* Overwrite existing value? */
@@ -335,6 +340,9 @@ int hsearch_r(ENTRY item, ACTION action, ENTRY ** retval,
 		 * Create new entry;
 		 * create copies of item.key and item.data
 		 */
+		if (first_deleted)
+			idx = first_deleted;
+
 		htab->table[idx].used = hval;
 		htab->table[idx].entry.key = strdup(item.key);
 		htab->table[idx].entry.data = strdup(item.data);
@@ -387,7 +395,7 @@ int hdelete_r(const char *key, struct hsearch_data *htab)
 
 	free(ep->key);
 	free(ep->data);
-	htab->table[idx].used = 0;
+	htab->table[idx].used = -1;
 
 	--htab->filled;
 
@@ -467,7 +475,7 @@ ssize_t hexport_r(struct hsearch_data *htab, const char sep,
 	 */
 	for (i = 1, n = 0, totl

Re: [U-Boot] [PATCH v6 4/4] mpc85xx: Add board support for the eXMeritus HWW-1U-1A devices

2011-03-21 Thread Moffett, Kyle D
On Mar 21, 2011, at 18:24, Wolfgang Denk wrote:
> In message  you wrote:
>> 
>> I apparently cannot rely on the U-Boot *CODE* to understand what the
>> U-Boot *CODING* style is.
> 
> You don't have to rely on the code.  It's clearly documented.
> 
> The README says:
> 
>   Coding Standards:
>   -
> 
>   All contributions to U-Boot should conform to the Linux kernel
>   coding style; see the file "Documentation/CodingStyle" and the script
>   "scripts/Lindent" in your Linux kernel source directory...
> 
> http://www.denx.de/wiki/U-Boot/CodingStyle  says the same.

So here it is claimed that the U-Boot coding style is the same as the Linux
Kernel coding style.

But previously you said:
 WARNING: line over 80 characters
 #463: FILE: board/exmeritus/hww1u1a/hww1u1a.c:136:
 +int do_hww1u1a_test_cpu_a(cmd_tbl_t *cmdtp, int flag, int argc, char *
 const argv[])
>>> 
>>> This one is only a warning, and it's much more readable to have 1
>>> 84-character line than split it across 2 different lines.  Even still,
>>> this warning is only issued if you pass "--subjective" to checkpatch, which
>>> is documented to "enable more subjective tests".
> 
> In U-Boot, it is considered to be an ERROR.


So which is it?

If U-Boot uses the official Linux Kernel CodingStyle, then a few >80-char
lines are OK if it increases readability, for example by not having to wrap
a simple U_BOOT_CMD function declaration that goes just a whole 4 characters
over the limit.

If U-Boot does NOT use the Linux Kernel CodingStyle and wants to refuse all
patches with over 80 characters then you should copy checkpatch.pl and the
CodingStyle document and change that wording from "strongly preferred" to
"hard requirement", and change the "WARNING" to "ERROR".


> And the referred document says:
>   Chapter 2: Breaking long lines and strings
>
>   Coding style is all about readability and maintainability using
>   commonly
>   available tools.
>
>   The limit on the length of lines is 80 columns and this is a strongly
>   preferred limit.
>
>   Statements longer than 80 columns will be broken into sensible chunks.
> 
> Now what exactly is unclear here?

You removed the very next paragraph in the Linux CodingStyle file,
which contains:

> The only exception to this is where exceeding 80 columns significantly 
> increases

> readability and does not hide information.


Furthermore, Linus Torvalds himself said in an email:
>> We fixed that to allow checkpatch to skip those warnings, but the fact is, 
>> the fundamnetal problem has always been the "80 character" part.

>> 
>> I don't think any kernel developers use a vt100 any more. And even if they 
>> do, I bet they curse the "24 lines" more than they curse the occasional 
>> 80+ character lines.
>> 
>> I'd be ok with changing the warning to 132 characters, which is another 
>> perfectly fine historical limit. Or we can split the difference, and say 
>> "ok, 106 characters is too much". I don't care. But 80 characters is 
>> causing too many idiotic changes.
>> 
>> There are way worse problems in many patches than long lines. Too complex 
>> expressions. Too deep indentation. Pure crap code. People seem to get way 
>> too hung up on ".. but at least it passes checkpatch". 

The line you were complaining about is a static U_BOOT_CMD function declaration
for goodness sakes!  It's about as common as dirt in the U-Boot code and the
only reason it doesn't fit on one line anymore is because I made the name of the
function *NAME* about 8 characters longer in this version of the patch than it
was in a previous patch.

It's not any more complex than it was before, nor is it any harder to read.

I'm tired and fed up with this whole mess.  If you think it's likely to be
accepted I'll go ahead and submit one more final respin tomorrow, assuming
I feel up to it.  Otherwise, I wish you the best of luck with U-Boot.

Good night.

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


Re: [U-Boot] [PATCH] DA8xx: fix LPSC numbering

2011-03-21 Thread Laurence Withers
On Mon, Mar 21, 2011 at 10:44:11PM +0100, Wolfgang Denk wrote:
> We should agree on a common way to implement this - either #define
> _or_ enum, but not a mix of both.
> 
> Having a closer look, it turns out that all these "indices" are
> actually register names, and functions like lpsc_on() use horrible
> code like this:
> 
>   mdstat = REG_P(PSC_MDSTAT_BASE + (id * 4));
> 
> to perform address magic, even worse, perform device I/O without using
> any I/O acessors (as in dsp_on()).

So, as a rough way forward, does the following sound sane?

 - drop REG_P() and REG() macros, use readl()/writel()/etc. instead.
 - drop address magic, use structures/arrays instead.
 - choose either enum or #define (I'd say enum as it's mostly a set of
   incrementing integers, but it depends on what the result looks like).
 - try to unify the various Davinci LPSC modules as much as possible.

I'm willing to give this a go, but I am unable to physically test the results
on any of the Davinci family except the DA850.

Bye for now,
-- 
Laurence Withers, http://www.guralp.com/
Direct tel:+447753988197 or tel:+44408643   Software Engineer
General support queries:  CMG-DCM CMG-EAM CMG-NAM
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v6 4/4] mpc85xx: Add board support for the eXMeritus HWW-1U-1A devices

2011-03-21 Thread Wolfgang Denk
Dear "Moffett, Kyle D",

In message  you wrote:
>
> I apparently cannot rely on the U-Boot *CODE* to understand what the
> U-Boot *CODING* style is.

You don't have to rely on the code.  It's clearly documented.

The README says:

Coding Standards:
-

All contributions to U-Boot should conform to the Linux kernel
coding style; see the file "Documentation/CodingStyle" and the script
"scripts/Lindent" in your Linux kernel source directory...

http://www.denx.de/wiki/U-Boot/CodingStyle  says the same.

And the referred document says:

Chapter 2: Breaking long lines and strings
 
Coding style is all about readability and maintainability using
commonly
available tools.
 
The limit on the length of lines is 80 columns and this is a strongly
preferred limit.
 
Statements longer than 80 columns will be broken into sensible chunks.

Now what exactly is unclear here?


And no, you are not the only one who is asked to fix his code beause
of "Line too long" errors. Here just a small collection from the last
4 months or so:

11/11 To:Xiangfu Liu Re: [U-Boot] [PATCH 1/5] those files are jz4740 base 
files
  http://article.gmane.org/gmane.comp.boot-loaders.u-boot/88655
12/04 To:Luigi 'Comio'   Re: [U-Boot] [PATCH 5/6 v2] Enable bootstrap support 
for MIPS architecture.
  http://article.gmane.org/gmane.comp.boot-loaders.u-boot/90325
12/12 To:Macpaul Lin Re: [U-Boot] [PATCH] ftgmac100: support of gigabit eth 
ftgmac100
  http://article.gmane.org/gmane.comp.boot-loaders.u-boot/90740
12/12 To:Macpaul Lin Re: [U-Boot] [PATCH] ftgmac100: support of gigabit eth 
ftgmac100
  http://article.gmane.org/gmane.comp.boot-loaders.u-boot/90740
03/13 To:Heiko Schocher  Re: [U-Boot] [PATCH 01/20] keymile: rework headerfiles 
for keymile boards
  http://article.gmane.org/gmane.comp.boot-loaders.u-boot/95728


> But otherwise I see no valid reason I should waste any more of my time
> submitting patches which get torn apart out of hand over issues which are
> completely ignored for patches which come in from other maintainers.

This is simply not true. But I'm not sure if you are still listening
to any rational arguments. I can only ask you to calm down, and
eventually reconsider.  Sorry.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Quote from a recent meeting:   "We are going to continue having these
meetings everyday until I find out why no work is getting done."
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v6 4/4] mpc85xx: Add board support for the eXMeritus HWW-1U-1A devices

2011-03-21 Thread Moffett, Kyle D
On Mar 21, 2011, at 17:34, Wolfgang Denk wrote:
> In message  you wrote:
>> 
>> Just looking at the last ~200 commits (actually 187, because it ignores
>> merges):
>> 
>> $ git format-patch -o recent-patches -200 origin/master
>> $ ./checkpatch.pl --no-tree --strict recent-patches/* >checkpatch.log 2>&1
>> $ grep 'over 80 char' checkpatch.log | wc -l
>> 130
>> 
>> That's 130 lines in the last 200 patches which are over 80 characters?!?!
>> How are those patches any different from mine?
> 
> The difference is: They were not detected.
> 
> Patches welcome.

If those were patches from two years ago and your style policies had
significantly changed since then I would understand.

But those are patches from *LAST MONTH* which you were perfectly happy to
merge from dozens of different developers, but had *I* submitted identical
patches they would have been rejected without even a second glance.

That is inconsistent at best, and in my humble opinion downright rude.


>> Look, I'm really trying to comply with U-Boot coding standards, but I'm
>> really of pissed off about the inconsistent requirements you are applying
>> to my patches versus a lot of other things that YOU ARE MERGING on a
>> regular basis.
> 
> The requirements are NOT inconsistent.  It's just that nobody is
> perfect, and nobody ever claimed that we manage to get 100% of review
> coverage.

I give up.

I apparently cannot rely on the U-Boot *CODE* to understand what the
U-Boot *CODING* style is.

The time investment to get reasonable board support merged into U-Boot is
proving to be *greater* than the time investment to just maintain our
board ports out of tree.

If anyone would like to use our code as a reference or try to get it merged
themselves, I will continue to maintain our GPLed out-of-tree patchset here:
  http://opensource.exmeritus.com/git/

But otherwise I see no valid reason I should waste any more of my time
submitting patches which get torn apart out of hand over issues which are
completely ignored for patches which come in from other maintainers.

In the future we will have to weigh other boot-loader alternatives due to
the unfriendly attitude here.

Good luck.

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


Re: [U-Boot] [PATCH v2 2/2] net: ftmac100: update get_timer() usages

2011-03-21 Thread Wolfgang Denk
Dear Po-Yu Chuang,

In message <1295596285-1690-1-git-send-email-ratbert.chu...@gmail.com> you 
wrote:
> From: Po-Yu Chuang 
> 
> Use get_timer() the same way as drivers/net/ftgmac100.c
> 
> Signed-off-by: Po-Yu Chuang 
> ---
> v2:
> this patch is splitted from "net: ftmac100: remove unncessary volatiles"
> 
>  drivers/net/ftmac100.c |6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
As usual, this being a 1.3.x release, I haven't  even  compiled  this
kernel yet. So if it works, you should be doubly impressed.
  - Linus Torvalds in <199506181536.saa10...@keos.cs.helsinki.fi>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] video: parse the video-mode environment variable

2011-03-21 Thread Timur Tabi
Add function video_get_video_mode(), which parses the "video-mode" environment
variable and returns each of its components.  The format matches the video=
command-line option used for Linux:

video-mode=:x-@<,option=string>

 The video driver, ignored by U-Boot
 The X resolution (in pixels) to use.
 The Y resolution (in pixels) to use.
 The color depth (in bits) to use.
 The frequency (in Hz) to use.
 A comma-separated list of device-specific options

Signed-off-by: Timur Tabi 
---
 doc/README.video   |   19 +
 drivers/video/videomodes.c |   64 
 drivers/video/videomodes.h |3 ++
 3 files changed, 86 insertions(+), 0 deletions(-)

diff --git a/doc/README.video b/doc/README.video
index 34e199c..0c04bea 100644
--- a/doc/README.video
+++ b/doc/README.video
@@ -28,3 +28,22 @@ The driver has been tested with the following configurations:
 
 - MPC823FADS with AD7176 on a PAL TV (YCbYCr)  - arse...@tin.it
 - GENIETVwith AD7177 on a PAL TV (YCbYCr)  - arse...@tin.it
+
+
+"video-mode" environment variable
+===
+
+The 'video-mode' environment variable can be used to enable and configure
+some video drivers.  The format matches the video= command-line option used
+for Linux:
+
+   video-mode=:x-@<,option=string>
+
+   The video driver name, ignored by U-Boot
+ The X resolution (in pixels) to use.
+ The Y resolution (in pixels) to use.
+The color depth (in bits) to use.
+ The frequency (in Hz) to use.
+  A comma-separated list of device-specific options
+
+Example: video-mode=fslfb:1280x1024-32@60,monitor=dvi
diff --git a/drivers/video/videomodes.c b/drivers/video/videomodes.c
index d27ce1d..6fe5811 100644
--- a/drivers/video/videomodes.c
+++ b/drivers/video/videomodes.c
@@ -1,6 +1,7 @@
 /*
  * (C) Copyright 2004
  * Pierre Aubert, Staubli Faverges , 
+ * Copyright 2011 Freescale Semiconductor, Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -73,6 +74,8 @@
 /
 
 #include 
+#include 
+
 #include "videomodes.h"
 
 const struct ctfb_vesa_modes vesa_modes[VESA_MODES_COUNT] = {
@@ -206,3 +209,64 @@ int video_get_params (struct ctfb_res_modes *pPar, char 
*penv)
}
return bpp;
 }
+
+/*
+ * Parse the 'video-mode' environment variable
+ *
+ * Example: "video-mode=fslfb:1280x1024-32@60,monitor=dvi".  See
+ * doc/README.video for more information on how to set the variable.
+ *
+ * @xres: returned value of X-resolution
+ * @yres: returned value of Y-resolution
+ * @depth: returned value of color depth
+ * @freq: returned value of monitor frequency
+ * @options: pointer to any remaining options, or NULL
+ *
+ * Returns 1 if valid values were found, 0 otherwise
+ */
+int video_get_video_mode(unsigned int *xres, unsigned int *yres,
+   unsigned int *depth, unsigned int *freq, const char **options)
+{
+   char *p = getenv("video-mode");
+   if (!p)
+   return 0;
+
+   /* Skip over the driver name, which we don't care about. */
+   p = strchr(p, ':');
+   if (!p)
+   return 0;
+
+   /* Get the X-resolution*/
+   while (*p && !isdigit(*p))
+   p++;
+   *xres = simple_strtoul(p, &p, 10);
+   if (!*xres)
+   return 0;
+
+   /* Get the Y-resolution */
+   while (*p && !isdigit(*p))
+   p++;
+   *yres = simple_strtoul(p, &p, 10);
+   if (!*yres)
+   return 0;
+
+   /* Get the depth */
+   while (*p && !isdigit(*p))
+   p++;
+   *depth = simple_strtoul(p, &p, 10);
+   if (!*depth)
+   return 0;
+
+   /* Get the frequency */
+   while (*p && !isdigit(*p))
+   p++;
+   *freq = simple_strtoul(p, &p, 10);
+   if (!*freq)
+   return 0;
+
+   /* Find the extra options, if any */
+   p = strchr(p, ',');
+   *options = p ? p + 1 : NULL;
+
+   return 1;
+}
diff --git a/drivers/video/videomodes.h b/drivers/video/videomodes.h
index 0d7c335..e546ab4 100644
--- a/drivers/video/videomodes.h
+++ b/drivers/video/videomodes.h
@@ -86,3 +86,6 @@ extern const struct ctfb_vesa_modes vesa_modes[];
 extern const struct ctfb_res_modes res_mode_init[];
 
 int video_get_params (struct ctfb_res_modes *pPar, char *penv);
+
+int video_get_video_mode(unsigned int *xres, unsigned int *yres,
+   unsigned int *depth, unsigned int *freq, const char **options);
-- 
1.7.3.4


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


Re: [U-Boot] [PATCH v2 1/2] net: ftmac100: remove unncessary volatiles

2011-03-21 Thread Wolfgang Denk
Dear Po-Yu Chuang,

In message <1295596237-1658-1-git-send-email-ratbert.chu...@gmail.com> you 
wrote:
> From: Po-Yu Chuang 
> 
> 
> Signed-off-by: Po-Yu Chuang 
> ---
> v2:
> split get_timer() changes to a seperate patch
> 
>  drivers/net/ftmac100.c |   12 ++--
>  1 files changed, 6 insertions(+), 6 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
If the car industry behaved like the computer industry over the  last
30  years, a Rolls-Royce would cost $5, get 300 miles per gallon, and
blow up once a year killing all passengers inside.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mpc52xx, digsy_mtc_rev5: Fix Linux crash, if no Flash in bank 2

2011-03-21 Thread Wolfgang Denk
Dear Heiko Schocher,

In message <1295591015-26109-1-git-send-email...@denx.de> you wrote:
> If no Flash is connected to cs1, Linux crashes, because
> reg entries are not correct adapted.
> 
> Following fix is needed:
> - swap base addresses in CONFIG_SYS_FLASH_BANKS_LIST, as
>   flash bank 1 is on chipselect 0 and flash bank 2 on
>   chipselect 1
> - call fdt_fixup_nor_flash_size() from ft_board_setup()
> 
> Signed-off-by: Heiko Schocher 
> cc: Wolfgang Denk 
> cc: Werner Pfister 
> cc: Detlev Zundel 
> ---
>  board/digsy_mtc/digsy_mtc.c |5 +
>  include/configs/digsy_mtc.h |4 ++--
>  2 files changed, 7 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
So we follow our wandering paths, and the very darkness acts  as  our
guide and our doubts serve to reassure us. - Jean-Pierre de Caussade,
eighteenth-century Jesuit priest
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [Patch v2] Fix hash table deletion to prevent lost entries

2011-03-21 Thread Wolfgang Denk
Dear Peter Barada,

In message <4d385a7f.2070...@logicpd.com> you wrote:
> On 01/19/2011 03:47 PM, Wolfgang Denk wrote:
> > Dear Peter Barada,
> >
> > In message <4d371208.3090...@logicpd.com> you wrote:
>  The hash delete code is in error; instead of just removing the deleted
>  key, it should instead allocate a new hashtable, hash all the keys into
>  the new table except for the deleted key and then reclaim the old table
>  (and deleted key).
> >>> Can you please come up with a patch?
> >>
> 
> From: Peter Barada 
> Date: Thu, 20 Jan 2011 10:38:57 -0500
> Subject: [PATCH] Fix hashtable to properly handle deletion.
> 
> Use negative used value to mark deleted entry.  Search keeps probing past
> deleted entries.  Adding an entry uses first deleted entry when it hits
> end of probe chain.
> 
> Signed-off-by: Peter Barada 

Checkpatch generates a number of errors:

[PATCH] Fix hashtable to properly handle deletion.
total: 8 errors, 16 warnings, 66 lines checked

Can you please fix these, and resubmit?

Also, do you happen to have a test case that can be used show the
problem in the existing code, and to test the patch?

Thanks.

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Any sufficiently advanced bug is indistinguishable from a feature.
  - Rich Kulawiec
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] DA8xx: fix LPSC numbering

2011-03-21 Thread Wolfgang Denk
Dear Laurence Withers,

In message <20110321212544.gb15...@lwithers.me.uk> you wrote:
>
> Looking at the hardware.h file that I changed, just above the enum { } block
> where my changes reside are a set of #defines for the same symbols. The
> #defines are used when CONFIG_SOC_DA8XX is not defined; the enum is used when
> it is.

Argh.   Can we please clean up such a mess, then?

> Which is the preferred option? Or something else entirely?

We should agree on a common way to implement this - either #define
_or_ enum, but not a mix of both.

Having a closer look, it turns out that all these "indices" are
actually register names, and functions like lpsc_on() use horrible
code like this:

mdstat = REG_P(PSC_MDSTAT_BASE + (id * 4));

to perform address magic, even worse, perform device I/O without using
any I/O acessors (as in dsp_on()).


I am aware that this is unrelated to your patch, but this needs to be
cleaned up ASAP!



As for your patch - maybe we can at least unify the #define versus
enum mixture?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
"Beauty is transitory." "Beauty survives."
-- Spock and Kirk, "That Which Survives", stardate unknown
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] [v3] powerpc: user 'video-mode' environment variable to configure DIU

2011-03-21 Thread Timur Tabi
Use the 'video-mode' environment variable (for Freescale chips that have a
DIU display controller) to designate the full video configuration.  Previously,
the DIU driver used the 'monitor' variable, and only to determine the output
video port.

The old definition of the "monitor" environment variable only determines
which video port to use for output.  This variable is set to a number (0,
1, or sometimes 2) to specify a DVI, LVDS, or Dual-LVDS port.  The
resolution is hard-coded into board-specific code.  The Linux command-line
arguments need to be hard-coded to the proper video definition string.

Signed-off-by: Timur Tabi 
---

This patch depends on my previous patch, "[v4] powerpc: clean up DIU macro
definitions for Freescale reference boards".

 README|   11 +-
 board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c |   73 +--
 board/freescale/p1022ds/diu.c |   29 +-
 drivers/video/Makefile|2 +-
 drivers/video/fsl_diu_fb.c|  938 +++--
 include/configs/MPC8610HPCD.h |   16 +-
 include/configs/P1022DS.h |   12 +-
 include/fsl_diu_fb.h  |   91 +--
 8 files changed, 521 insertions(+), 651 deletions(-)
 rewrite drivers/video/fsl_diu_fb.c (63%)
 rewrite include/fsl_diu_fb.h (62%)

diff --git a/README b/README
index 9597fed..bc168d6 100644
--- a/README
+++ b/README
@@ -1071,13 +1071,10 @@ The following options need to be configured:
CONFIG_VIDEO_LOGO
CONFIG_VIDEO_BMP_LOGO
 
-   The DIU driver will look for the 'monitor' environment variable,
-   and if defined, enable the DIU as a console during boot.  This
-   variable should be set to one of these values:
-
-   '0' Output video to the DVI connector
-   '1' Output video to the LVDS connector
-   '2' Output video to the Dual-Link LVDS connector
+   The DIU driver will look for the 'video-mode' environment
+   variable, and if defined, enable the DIU as a console during
+   boot.  See the documentation file README.video for a
+   description of this variable.
 
 - Keyboard Support:
CONFIG_KEYBOARD
diff --git a/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c 
b/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c
index 81e53e7..3011bb8 100644
--- a/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c
+++ b/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c
@@ -1,6 +1,7 @@
 /*
- * Copyright 2007 Freescale Semiconductor, Inc.
- * York Sun 
+ * Copyright 2007-2011 Freescale Semiconductor, Inc.
+ * Authors: York Sun 
+ *  Timur Tabi 
  *
  * FSL DIU Framebuffer driver
  *
@@ -27,6 +28,10 @@
 #include 
 #include 
 #include 
+#include "../common/pixis.h"
+
+#define PX_BRDCFG0_DLINK   0x10
+#define PX_BRDCFG0_DVISEL  0x08
 
 void diu_set_pixel_clock(unsigned int pixclock)
 {
@@ -49,50 +54,34 @@ void diu_set_pixel_clock(unsigned int pixclock)
debug("DIU: Modified value of CLKDVDR = 0x%08x\n", *guts_clkdvdr);
 }
 
-int platform_diu_init(unsigned int *xres, unsigned int *yres)
+int platform_diu_init(unsigned int xres, unsigned int yres, const char *port)
 {
-   char *monitor_port;
-   int gamma_fix;
-   unsigned int pixel_format;
-   unsigned char tmp_val;
-   unsigned char pixis_arch;
-   u8 *pixis_base = (u8 *)PIXIS_BASE;
-
-   tmp_val = in_8(pixis_base + PIXIS_BRDCFG0);
-   pixis_arch = in_8(pixis_base + PIXIS_VER);
-
-   monitor_port = getenv("monitor");
-   if (!strncmp(monitor_port, "0", 1)) {   /* 0 - DVI */
-   *xres = 1280;
-   *yres = 1024;
-   if (pixis_arch == 0x01)
-   pixel_format = 0x2317;
-   else
-   pixel_format = 0x3316;
-   gamma_fix = 0;
-   out_8(pixis_base + PIXIS_BRDCFG0, tmp_val | 0x08);
+   const char *name;
+   int gamma_fix = 0;
+   u32 pixel_format = 0x3316;
+   u8 temp;
 
-   } else if (!strncmp(monitor_port, "1", 1)) { /* 1 - Single link LVDS */
-   *xres = 1024;
-   *yres = 768;
-   pixel_format = 0x3316;
-   gamma_fix = 0;
-   out_8(pixis_base + PIXIS_BRDCFG0, (tmp_val & 0xf7) | 0x10);
+   temp = in_8(&pixis->brdcfg0);
 
-   } else if (!strncmp(monitor_port, "2", 1)) { /* 2 - Double link LVDS */
-   *xres = 1280;
-   *yres = 1024;
-   pixel_format = 0x3316;
+   if (strncmp(port, "dlvds", 5) == 0) {
+   /* Dual link LVDS */
gamma_fix = 1;
-   out_8(pixis_base + PIXIS_BRDCFG0, tmp_val & 0xe7);
-
-   } else {/* DVI */
-   *xres = 1280;
-   *yres = 1024;
-   pixel_format 

Re: [U-Boot] [PATCH v6 4/4] mpc85xx: Add board support for the eXMeritus HWW-1U-1A devices

2011-03-21 Thread Wolfgang Denk
Dear "Moffett, Kyle D",

In message  you wrote:
>
> Just looking at the last ~200 commits (actually 187, because it ignores mer=
> ges):
> 
> $ git format-patch -o recent-patches -200 origin/master
> $ ./checkpatch.pl --no-tree --strict recent-patches/* >checkpatch.log 2>&1
> $ grep 'over 80 char' checkpatch.log | wc -l
> 130
> 
> That's 130 lines in the last 200 patches which are over 80 characters?!?!
> How are those patches any different from mine?

The difference is: They were not detected.

Patches welcome.

> Look, I'm really trying to comply with U-Boot coding standards, but I'm rea=
> lly
> of pissed off about the inconsistent requirements you are applying to my
> patches versus a lot of other things that YOU ARE MERGING on a regular basi=
> s.

The requirements are NOT inconsistent.  It's just that nobody is
perfect, and nobody ever claimed that we manage to get 100% of review
coverage.

> So why are you picking on my board-specific code so hard here?  This is

It's just that the problems got noticed.

> > "checkpatch.pl --no-tree"
> 
> What version of checkpatch are you running?  I copied version 0.31 out of
> my latest Linux kernel tree, which identical to the latest version from
> here:

-> checkpatch.pl --version
Usage: checkpatch.pl [OPTION]... [FILE]...
Version: 0.31
...

> If U-Boot policy is to run checkpatch then you'd better either specify a
> particular version and command-line options or be willing to accept the
> default output of the latest version.

I don't see any version issue here, nor do I use any non-standard
options.

>  +U_BOOT_CMD(
>  +hww1u1a_test_cpu_a, 1, 0, do_hww1u1a_test_cpu_a,
>  +"Test if this is CPU A (versus B) on the eXMeritus HWW-1U-1A 
>  board",
>  +/*  */" && \n"
>  +"hww1u1a_test_cpu_a || \n"
> >>> =20
> >>> What is this empty comment needed for?
> >> 
> >> Just a mental placeholder for the fact that the U_BOOT_CMD macro inserts
> >> the name of the command in that spot.  Will remove.
> > 
> > We don't provide usage examples in the help text.  This should be
> > fixed in the first place.
>
> This *IS* the help text, and not a sample usage.  This is visually and
> effectively no different from this text in common/cmd_mp.c:

The synopsis of a command gives the command name and possible options,
and explains what the command does and what the options do.

"name && " does NOT fall into that pattern.

Look, alternatively I can claim your help message is highly incomplete
as it fails to cover use cases like

name || 

etc.

Not to mention that the usage message is plain wrong for all boards
that don't have the hush shell enabled.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Ninety-Ninety Rule of Project Schedules:
The first ninety percent of the task takes ninety percent of
the time, and the last ten percent takes the other ninety percent.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] DA8xx: fix LPSC numbering

2011-03-21 Thread Laurence Withers
On Mon, Mar 21, 2011 at 10:14:18PM +0100, Wolfgang Denk wrote:
> -> grep -R DAVINCI_LPSC_TPCC *
> arch/arm/include/asm/arch-davinci/hardware.h:#define DAVINCI_LPSC_TPCC
>   2
> arch/arm/include/asm/arch-davinci/hardware.h:   DAVINCI_LPSC_TPCC = 0,
> board/davinci/dm355evm/dm355evm.c:  lpsc_on(DAVINCI_LPSC_TPCC);
> 
> you change:
> 
> - DAVINCI_LPSC_MMC_SD,
> + DAVINCI_LPSC_MMC_SD0,
> 
> I see:
> 
> -> grep -R DAVINCI_LPSC_MMC_SD *
> arch/arm/cpu/arm926ejs/davinci/psc.c:   case DAVINCI_LPSC_MMC_SD:
> arch/arm/include/asm/arch-davinci/hardware.h:#define DAVINCI_LPSC_MMC_SD  
>   15
> arch/arm/include/asm/arch-davinci/hardware.h:   DAVINCI_LPSC_MMC_SD,
> 
> 
> Seems your change would break a few boards...

There are several chips in the Davinci family; my commit changes the LPSC
definitions for the DA8xx (the DA830/DA850) processors only, leaving the
other processors alone (they are quite different).

Looking at the hardware.h file that I changed, just above the enum { } block
where my changes reside are a set of #defines for the same symbols. The
#defines are used when CONFIG_SOC_DA8XX is not defined; the enum is used when
it is.

The existing uses in the code are special cases for the non-DA8xx processors;
DAVINCI_LPSC_TPCC is used in the DM355 EVM kit board code, and while
DAVINCI_LPSC_MMC_SD is used in the processor generic C code it is wrapped in
a #ifdef CONFIG_SOC_DM644X (another chip) with a comment about special
treatment.

So, I can change the non-DA8xx names to match. But that changes existing,
working code and the names would no longer match the datasheets.

Or, I can leave the old names be, and then have the new names with suffices, 
e.g.:

DAVINCI_LPSC_MMC_SD,/* actually MMC_SD0 on DA8xx */
DAVINCI_LPSC_MMC_SD1,

It seems a little inconsistent to me, but I'm happy to do it if preferred.
Or, I can do what I have done, and change only the DA8xx names.

Which is the preferred option? Or something else entirely?

Many thanks, and bye for now,
-- 
Laurence Withers, http://www.guralp.com/
Direct tel:+447753988197 or tel:+44408643   Software Engineer
General support queries:  CMG-DCM CMG-EAM CMG-NAM
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v6 4/4] mpc85xx: Add board support for the eXMeritus HWW-1U-1A devices

2011-03-21 Thread Moffett, Kyle D
On Mar 21, 2011, at 16:30, Wolfgang Denk wrote:
> In message <5b9d9c87-c278-4af3-b20c-26ecff6c0...@boeing.com> you wrote:
>> 
>>> WARNING: line over 80 characters
>>> #463: FILE: board/exmeritus/hww1u1a/hww1u1a.c:136:
>>> +int do_hww1u1a_test_cpu_a(cmd_tbl_t *cmdtp, int flag, int argc, char *
>>> const argv[])
>> 
>> This one is only a warning, and it's much more readable to have 1 84-charac
> 
> In U-Boot, it is considered to be an ERROR.

Just looking at the last ~200 commits (actually 187, because it ignores merges):

$ git format-patch -o recent-patches -200 origin/master
$ ./checkpatch.pl --no-tree --strict recent-patches/* >checkpatch.log 2>&1
$ grep 'over 80 char' checkpatch.log | wc -l
130

That's 130 lines in the last 200 patches which are over 80 characters?!?!
How are those patches any different from mine?

$ grep '^ERROR:' checkpatch.log | wc -l
113

And that's 113 HARD ERRORS from checkpatch!?!?!

Of those, 32 are "Missing Signed-off-by: line(s)", 20 are "macros with
complex values should be enclosed in parenthesis", 19 are inconsistent
or missing whitespace issues, 4 are "(foo*) instead of "(foo *)", 3 are
invalid UTF-8 errors, 4 are "return is not a function" errors, etc, etc.

Look, I'm really trying to comply with U-Boot coding standards, but I'm really
of pissed off about the inconsistent requirements you are applying to my
patches versus a lot of other things that YOU ARE MERGING on a regular basis.

So why are you picking on my board-specific code so hard here?  This is
extremely frustrating for me and a strong deterrent against us *ever*
contributing to U-Boot again in the future.


>> ter line than split it across 2 different lines.  Even still, this
>> warning is only issued if you pass "--subjective" to checkpatch, which
>> is documented to "enable more subjective tests".
> 
> No, I get this warning without such flags.  The command I run is just
> "checkpatch.pl --no-tree"

What version of checkpatch are you running?  I copied version 0.31 out of
my latest Linux kernel tree, which identical to the latest version from
here:

http://www.kernel.org/pub/linux/kernel/people/apw/checkpatch/

If U-Boot policy is to run checkpatch then you'd better either specify a
particular version and command-line options or be willing to accept the
default output of the latest version.


> BTW - could you please restrict your line length to some 70 characters
> or so?  Thanks.

Sorry about that, sending email through an Exchange server is no fun :-(.
Hopefully I've got it fixed.


 +U_BOOT_CMD(
 +  hww1u1a_test_cpu_a, 1, 0, do_hww1u1a_test_cpu_a,
 +  "Test if this is CPU A (versus B) on the eXMeritus HWW-1U-1A board",
 +  /*  */" && \n"
 +  "hww1u1a_test_cpu_a || \n"
>>> =20
>>> What is this empty comment needed for?
>> 
>> Just a mental placeholder for the fact that the U_BOOT_CMD macro inserts
>> the name of the command in that spot.  Will remove.
> 
> We don't provide usage examples in the help text.  This should be
> fixed in the first place.

This *IS* the help text, and not a sample usage.  This is visually and
effectively no different from this text in common/cmd_mp.c:

U_BOOT_CMD(
cpu, CONFIG_SYS_MAXARGS, 1, cpu_cmd,
"Multiprocessor CPU boot manipulation and release",
" reset - Reset cpu \n"
"cpu  status- Status of cpu \n"
"cpu  disable   - Disable cpu \n"
"cpu  release  [args] - Release cpu  at  with 
[args]"
#ifdef CPU_ARCH_HELP
"\n"
CPU_ARCH_HELP
#endif
);


 +  /* Turn on the "HRESET_REQ" pin (hard-reset request) */
 +  printf("\nRESET: Hardware reset triggered, waiting...\n");
 +  out_be32(&gur->rstcr, 0x2);
 +  while (1)
 +  udelay(1);
 +  }
>>> Should that not be an infinite wait here?
>> 
>> At this point if the board does not reset due to hardware failure it's
>> better off hanging than silently falling through.
> 
> Why don't you simply call "hang()" then?

Didn't know it existed at the time the code was written.  Will fix.

Cheers,
Kyle Moffett

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


Re: [U-Boot] [PATCH] DA8xx: fix LPSC numbering

2011-03-21 Thread Laurence Withers
On Mon, Mar 21, 2011 at 07:43:51PM +0100, Wolfgang Denk wrote:
> SoB missing.
> 
> Lines in commit message too long.

Thanks; I have fixed and will resend.

> Please fix also all other places where these identifiers are used in
> the code.

The identifiers changed in the patch were not used anywhere in the code. I
also verified that a "./MAKEALL -s davinci" gave the same results before
and after.

Many thanks for the feedback, and bye for now,
-- 
Laurence Withers, http://www.guralp.com/
Direct tel:+447753988197 or tel:+44408643   Software Engineer
General support queries:  CMG-DCM CMG-EAM CMG-NAM
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] DA8xx: fix LPSC numbering

2011-03-21 Thread Wolfgang Denk
Dear Laurence Withers,

In message <1300740277-2358-1-git-send-email-lwith...@guralp.com> you wrote:
> The DA8xx chips have two modules PSC0 and PSC1 for the local power and
> sleep controllers (LPSC). Each LPSC has up to 32 submodules over which
> it has control, which are enumerated by the DAVINCI_LPSC_* symbols.
> 
> This commit fixes the definitions of a number of symbols to be
> consistent with both the OMAP-L137 and OMAP-L138 data sheets (TI
> documents SPRS563D and SPRS586A respectively): some minor renaming to
> reflect actual functionality and some reordering of modules in PSC1 to
> be correct.
> 
> None of the affected symbols were actually used anywhere in the code,
> so there are no related code changes.
> 
> Signed-off-by: Laurence Withers 
> Cc: Sandeep Paulraj 
> ---
> Changes for v2:
>- Fixed formatting of commit message.
> ---
>  arch/arm/include/asm/arch-davinci/hardware.h |   29 
> +-
>  1 files changed, 19 insertions(+), 10 deletions(-)

NAK, as this is breaking existing code as I pointed out previously.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Unix is supported by IBM, like a hanging man is supported by rope.
- Don Libes & Sandy Ressler: _Life With Unix_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] DA8xx: fix LPSC numbering

2011-03-21 Thread Wolfgang Denk
Dear Laurence Withers,

In message <20110321203839.ga15...@lwithers.me.uk> you wrote:
>
> > Please fix also all other places where these identifiers are used in
> > the code.
> 
> The identifiers changed in the patch were not used anywhere in the code. I
> also verified that a "./MAKEALL -s davinci" gave the same results before
> and after.

I cannot confirm this; for example, you change:

-   DAVINCI_LPSC_TPCC = 0,
+   DAVINCI_LPSC_TPCC0 = 0,

I see:

-> grep -R DAVINCI_LPSC_TPCC *
arch/arm/include/asm/arch-davinci/hardware.h:#define DAVINCI_LPSC_TPCC  
2
arch/arm/include/asm/arch-davinci/hardware.h:   DAVINCI_LPSC_TPCC = 0,
board/davinci/dm355evm/dm355evm.c:  lpsc_on(DAVINCI_LPSC_TPCC);

you change:

-   DAVINCI_LPSC_MMC_SD,
+   DAVINCI_LPSC_MMC_SD0,

I see:

-> grep -R DAVINCI_LPSC_MMC_SD *
arch/arm/cpu/arm926ejs/davinci/psc.c:   case DAVINCI_LPSC_MMC_SD:
arch/arm/include/asm/arch-davinci/hardware.h:#define DAVINCI_LPSC_MMC_SD
15
arch/arm/include/asm/arch-davinci/hardware.h:   DAVINCI_LPSC_MMC_SD,


Seems your change would break a few boards...

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
There's an old story about the person who wished his computer were as
easy to use as his telephone. That wish has come  true,  since  I  no
longer know how to use my telephone.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] DA8xx: fix LPSC numbering

2011-03-21 Thread Laurence Withers
The DA8xx chips have two modules PSC0 and PSC1 for the local power and
sleep controllers (LPSC). Each LPSC has up to 32 submodules over which
it has control, which are enumerated by the DAVINCI_LPSC_* symbols.

This commit fixes the definitions of a number of symbols to be
consistent with both the OMAP-L137 and OMAP-L138 data sheets (TI
documents SPRS563D and SPRS586A respectively): some minor renaming to
reflect actual functionality and some reordering of modules in PSC1 to
be correct.

None of the affected symbols were actually used anywhere in the code,
so there are no related code changes.

Signed-off-by: Laurence Withers 
Cc: Sandeep Paulraj 
---
Changes for v2:
   - Fixed formatting of commit message.
---
 arch/arm/include/asm/arch-davinci/hardware.h |   29 +-
 1 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/arch/arm/include/asm/arch-davinci/hardware.h 
b/arch/arm/include/asm/arch-davinci/hardware.h
index df3f549..d0a3036 100644
--- a/arch/arm/include/asm/arch-davinci/hardware.h
+++ b/arch/arm/include/asm/arch-davinci/hardware.h
@@ -214,12 +214,12 @@ typedef volatile unsigned int *   dv_reg_p;
 #else /* CONFIG_SOC_DA8XX */
 
 enum davinci_lpsc_ids {
-   DAVINCI_LPSC_TPCC = 0,
+   DAVINCI_LPSC_TPCC0 = 0,
DAVINCI_LPSC_TPTC0,
DAVINCI_LPSC_TPTC1,
DAVINCI_LPSC_AEMIF,
DAVINCI_LPSC_SPI0,
-   DAVINCI_LPSC_MMC_SD,
+   DAVINCI_LPSC_MMC_SD0,
DAVINCI_LPSC_AINTC,
DAVINCI_LPSC_ARM_RAM_ROM,
DAVINCI_LPSC_SECCTL_KEYMGR,
@@ -227,31 +227,40 @@ enum davinci_lpsc_ids {
DAVINCI_LPSC_SCR0,
DAVINCI_LPSC_SCR1,
DAVINCI_LPSC_SCR2,
-   DAVINCI_LPSC_DMAX,
+   DAVINCI_LPSC_PRUSS,
DAVINCI_LPSC_ARM,
DAVINCI_LPSC_GEM,
/* for LPSCs in PSC1, offset from 32 for differentiation */
DAVINCI_LPSC_PSC1_BASE = 32,
-   DAVINCI_LPSC_USB11,
+   DAVINCI_LPSC_TPCC1 = 32,
DAVINCI_LPSC_USB20,
+   DAVINCI_LPSC_USB11,
DAVINCI_LPSC_GPIO,
DAVINCI_LPSC_UHPI,
DAVINCI_LPSC_EMAC,
DAVINCI_LPSC_DDR_EMIF,
DAVINCI_LPSC_McASP0,
-   DAVINCI_LPSC_McASP1,
-   DAVINCI_LPSC_McASP2,
+   DAVINCI_LPSC_McASP1_SATA,
+   DAVINCI_LPSC_McASP2_VPIF,
DAVINCI_LPSC_SPI1,
DAVINCI_LPSC_I2C1,
DAVINCI_LPSC_UART1,
DAVINCI_LPSC_UART2,
+   DAVINCI_LPSC_McBSP0,
+   DAVINCI_LPSC_McBSP1,
DAVINCI_LPSC_LCDC,
DAVINCI_LPSC_ePWM,
+   DAVINCI_LPSC_MMC_SD1,
+   DAVINCI_LPSC_uPP,
DAVINCI_LPSC_eCAP,
-   DAVINCI_LPSC_eQEP,
-   DAVINCI_LPSC_SCR_P0,
-   DAVINCI_LPSC_SCR_P1,
-   DAVINCI_LPSC_CR_P3,
+   DAVINCI_LPSC_eQEP_TPTC2,
+   DAVINCI_LPSC_SCR_F0 = 56,
+   DAVINCI_LPSC_SCR_F1,
+   DAVINCI_LPSC_SCR_F2,
+   DAVINCI_LPSC_SCR_F6,
+   DAVINCI_LPSC_SCR_F7,
+   DAVINCI_LPSC_SCR_F8,
+   DAVINCI_LPSC_BR_F7,
DAVINCI_LPSC_L3_CBA_RAM
 };
 
-- 
1.7.2.5

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


Re: [U-Boot] Please pull u-boot-ubi/master

2011-03-21 Thread Wolfgang Denk
Dear Stefan Roese,

In message <201103211403.04123...@denx.de> you wrote:
> Hi Wolfgang,
> 
> please pull the following UBI fix:
> 
> The following changes since commit cc1dd33f273f8c96cbd7539b4a2d1d7aa12773cd:
> 
>   mpc8[5/6]xx: Ensure POST word does not get reset (2011-03-13 11:24:44 -0500)
> 
> are available in the git repository at:
>   git://www.denx.de/git/u-boot-ubi.git master
> 
> Stefan Roese (1):
>   UBI: Fix error code handling in ubi commands
> 
>  common/cmd_ubi.c |  137 +
>  1 files changed, 65 insertions(+), 72 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
"May your future be limited only by your dreams."
- Christa McAuliffe
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2011-03-21 Thread Wolfgang Denk
Dear Nobuhiro Iwamatsu,

In message  you 
wrote:
> Dear Wolfgang Denk.
> 
> Please pull from u-boot-sh/master.
> 
> The following changes since commit cc1dd33f273f8c96cbd7539b4a2d1d7aa12773cd=
> :
> 
>   mpc8[5/6]xx: Ensure POST word does not get reset (2011-03-13 11:24:44 -05=
> 00)
> 
> are available in the git repository at:
>   git://git.denx.de/u-boot-sh.git master
> 
> Nobuhiro Iwamatsu (2):
>   sh: Add handling of CONFIG_SYS_NO_FLASH for board.c
>   sh: Add KEEP order to start.o section
> 
> Yoshihiro Shimoda (1):
>   net: sh_eth: add support for SH7757's ETHER
> 
>  arch/sh/cpu/sh2/u-boot.lds |2 +-
>  arch/sh/cpu/sh3/u-boot.lds |2 +-
>  arch/sh/cpu/sh4/u-boot.lds |2 +-
>  arch/sh/lib/board.c|8 +-
>  drivers/net/sh_eth.c   |   37 +-
>  drivers/net/sh_eth.h   |   53 =
> +--
>  6 files changed, 96 insertions(+), 8 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Alles Gescheite ist schon gedacht worden, man muß nur versuchen,
es noch einmal zu denken.  -- Goethe, Maximen und Reflexionen
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Please pull u-boot-mpc85xx.git

2011-03-21 Thread Wolfgang Denk
Dear Kumar Gala,

In message  you 
wrote:
> The following changes since commit cc1dd33f273f8c96cbd7539b4a2d1d7aa12773cd:
> 
>   mpc8[5/6]xx: Ensure POST word does not get reset (2011-03-13 11:24:44 -0500)
> 
> are available in the git repository at:
>   git://git.denx.de/u-boot-mpc85xx.git master
> 
> Kumar Gala (1):
>   powerpc/85xx: Fix synchronization of timebase on MP boot
> 
>  arch/powerpc/cpu/mpc85xx/mp.c |9 +
>  1 files changed, 9 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Killing is wrong.
-- Losira, "That Which Survives", stardate unknown
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v6 4/4] mpc85xx: Add board support for the eXMeritus HWW-1U-1A devices

2011-03-21 Thread Wolfgang Denk
Dear "Moffett, Kyle D",

In message <5b9d9c87-c278-4af3-b20c-26ecff6c0...@boeing.com> you wrote:
> 
> > WARNING: line over 80 characters
> > #463: FILE: board/exmeritus/hww1u1a/hww1u1a.c:136:
> > +int do_hww1u1a_test_cpu_a(cmd_tbl_t *cmdtp, int flag, int argc, char * c=
> onst argv[])
> 
> This one is only a warning, and it's much more readable to have 1 84-charac=

In U-Boot, it is considered to be an ERROR.

> ter line than split it across 2 different lines.  Even still, this warning =
> is only issued if you pass "--subjective" to checkpatch, which is documente=
> d to "enable more subjective tests".  This thread discusses it further:

No, I get this warning without such flags.  The command I run is just
"checkpatch.pl --no-tree"

BTW - could you please restrict your line length to some 70 characters
or so?  Thanks.

> >> +U_BOOT_CMD(
> >> +  hww1u1a_test_cpu_a, 1, 0, do_hww1u1a_test_cpu_a,
> >> +  "Test if this is CPU A (versus B) on the eXMeritus HWW-1U-1A board",
> >> +  /*  */" && \n"
> >> +  "hww1u1a_test_cpu_a || \n"
> >=20
> > What is this empty comment needed for?
> 
> Just a mental placeholder for the fact that the U_BOOT_CMD macro inserts th=
> e name of the command in that spot.  Will remove.

We don't provide usage examples in the help text.  This should be
fixed in the first place.

> >> +  /* Turn on the "HRESET_REQ" pin (hard-reset request) */
> >> +  printf("\nRESET: Hardware reset triggered, waiting...\n");
> >> +  out_be32(&gur->rstcr, 0x2);
> >> +  while (1)
> >> +  udelay(1);
> >> +  }
> >=20
> > Should that not be an infinite wait here?
> 
> At this point if the board does not reset due to hardware failure it's bett=
> er off hanging than silently falling through.

Why don't you simply call "hang()" then?

> >> +/* Enable the U-Boot "memory test" */
> >> +#define CONFIG_SYS_MEMTEST_START 0x
> >> +#define CONFIG_SYS_MEMTEST_END   0x7fff
> >=20
> > I think this has not been tested, right?
> 
> I'm pretty sure it's been tested, but not very recently; the memory on all =
> the shipped units is ECC anyways.

I guess testing it would reveal that it crashes your system because you
are overwriting the exception vectors.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Madness has no purpose.  Or reason.  But it may have a goal.
-- Spock, "The Alternative Factor", stardate 3088.7
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARMV7: OMAP3: Add support for Comelit CPS board

2011-03-21 Thread Wolfgang Denk
Dear Luca Ceresoli,

In message <4d878b2c.5050...@comelit.it> you wrote:
>
> > Will be called dig297 in v2.
> 
> Well, not so fast.
> 
> The board is named OMAP3_CPS in the ARM Linux Machine Registry
> (http://www.arm.linux.org.uk/developer/machines/list.php?id=2751),
> which is reflected in mach-types.h.

If you want, you can ask for a name change in the Machine Registry.
On the other hand, I see no inherent issues when the board config name
0n U-Boot (and Linux?) don't match the MACH_ID's name.

But I forgot one thing: it seems also a good idear that the board
config names in U-Boot and Linux match.  But you don't have any Linux
kernel code pushed upstream yet, or have you?


> Am I supposed to rename the board in the registry, then wait for
> mach-types to be updated in U-Boot before submitting a new patch?

No, this is not really necessary.

> Or can I live with the current name in mach-types and rename elsewhere?

Yes.  You may want to clean that up in the near future, but it's not
blocking anything here.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
1 1 was a race-horse, 2 2 was 1 2. When 1 1 1 1 race, 2 2 1 1 2.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARMV7: OMAP3: Add support for Comelit CPS board

2011-03-21 Thread Wolfgang Denk
Dear Luca Ceresoli,

In message <4d877d80.6060...@comelit.it> you wrote:
> 
> > It appears you base this code on an old version of U-Boot.  Please
> > update your code base first.
> 
> Strange.
> 
> My patch is based on current master, on the latest commit that I see
> today on git://git.denx.de/u-boot.git:

Sorry. I thought we had cleaned up the config.mk file use for these
boards long ago. Seems I was wrong.

>  > WARNING: Use #include  instead of 
>  > #169: FILE: board/comelit/cps/cps.c:39:
>  > +#include 
> 
> I guess I can safely ignore this one.

Yes.

>  > WARNING: Use of volatile is usually wrong: see 
> Documentation/volatile-considered-harmful.txt
>  > #1011: FILE: include/configs/omap3_cps.h:305:
>  > +extern volatile unsigned int boot_flash_env_addr;
> 
> I don't know why it is volatile, but since it's defined this way in
> arch/arm/cpu/armv7/omap3/mem.c I think there's a reason.

No, this should be removed.  See
Documentation/volatile-considered-harmful.txt

> > We don't accept such config.mk files any more.  Please move definition
> > into your board config file.
> 
> Meaning I should remove config.mk entirely, right?

Right.

> > Please name your board just "cps" (or chose a better name).  There
> > shall be no SoC-prefix in the board names.
> 
> Will be called dig297 in v2.

Thanks.

> > #defines like these which select a feature shall not have values
> > assigned.  Remove all these '1' here.  Please fix globally.
> >
> 
> Ok except for OMAP34XX, since arch/arm/cpu/armv7/start.S at line 114
> does:
> 
>  > #if (CONFIG_OMAP34XX)
> 
> Is it intended?
> If that's a mistake, I can submit a trivial patch to fix it.

Ouch.  This is wrong and should be fixed.  Yes, please send a
(separate) patch for that.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
My play was a complete success.  The audience was a failure.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] DA8xx: fix LPSC numbering

2011-03-21 Thread Wolfgang Denk
Dear Laurence Withers,

In message  you wrote:
> 
> I'm in the process of porting u-boot to a new board we have developed using 
> the
> OMAP-L138 (or DA850). While I'm a long way from finishing the port, I have
> noticed that the definitions of some of the local power and sleep controller
> (LPSC) register module numbers are incorrect.

Why do you falg a message that does not contail a patch with a
'[PATCH]' subject?  Please don't!!

> As a reply to this mail I've attached my first attempt at a patch for u-boot,
> which addresses this issue.

This is crap. Don't do such things.

> Any feedback (esp. wrt formatting and use of the git tools etc.) is gratefully
> received.

Please read the documentation _before_ posting.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
I am more bored than you could ever possibly be.  Go back to work.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] DA8xx: fix LPSC numbering

2011-03-21 Thread Wolfgang Denk
Dear Laurence Withers,

In message 
 
you wrote:
> The DA8xx chips have two modules PSC0 and PSC1 for the local power and sleep
> controllers (LPSC). Each LPSC has up to 32 submodules over which it has 
> control,
> which are enumerated by the DAVINCI_LPSC_* symbols.
> 
> This commit fixes the definitions of a number of symbols to be consistent with
> both the OMAP-L137 and OMAP-L138 data sheets (TI documents SPRS563D and 
> SPRS586A
> respectively): some minor renaming to reflect actual functionality and some
> reordering of modules in PSC1 to be correct.
> 
> None of the affected symbols were actually used anywhere in the code, so there
> are no related code changes.
> ---
>  arch/arm/include/asm/arch-davinci/hardware.h |   29 
> +-
>  1 files changed, 19 insertions(+), 10 deletions(-)

SoB missing.

Lines in commit message too long.

Please fix also all other places where these identifiers are used in
the code.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Genius doesn't work on an assembly line basis.  You can't simply say,
"Today I will be brilliant."
-- Kirk, "The Ultimate Computer", stardate 4731.3
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARMV7: OMAP3: Add support for Comelit CPS board

2011-03-21 Thread Luca Ceresoli
Il 21/03/2011 17:32, Luca Ceresoli ha scritto:
...
>>> --- a/boards.cfg
>>> +++ b/boards.cfg
>>> @@ -117,6 +117,7 @@ omap3_pandoraarm armv7   
>>> pandora -
>>>igep0020 arm armv7   igep0020
>>> isee   omap3
>>>igep0030 arm armv7   igep0030
>>> isee   omap3
>>>am3517_evm   arm armv7   am3517evm   
>>> logicpdomap3
>>> +omap3_cpsarm armv7   cps 
>>> comelitomap3
>>>omap3_zoom1  arm armv7   zoom1   
>>> logicpdomap3
>>>omap3_zoom2  arm armv7   zoom2   
>>> logicpdomap3
>>>omap3_beagle arm armv7   beagle  
>>> ti omap3
>>
>> Please name your board just "cps" (or chose a better name).  There
>> shall be no SoC-prefix in the board names.
>
> Will be called dig297 in v2.

Well, not so fast.

The board is named OMAP3_CPS in the ARM Linux Machine Registry
(http://www.arm.linux.org.uk/developer/machines/list.php?id=2751),
which is reflected in mach-types.h.

I don't know how exactly the registry info is used throughout U-Boot,
and I didn't find documentation about it.

Am I supposed to rename the board in the registry, then wait for
mach-types to be updated in U-Boot before submitting a new patch?

Or can I live with the current name in mach-types and rename elsewhere?

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


[U-Boot] [PATCH] cfi_flash: fix bug with flash banks with different sector numbers

2011-03-21 Thread Martin Krause
The function find_sector() does not take into account if the flash bank
has changed since the last call. This could lead to illegal accesses inside
and beyond the flash_info_t info strcture. For example if the current
flash bank has less sectors than the last used flash bank.

This patch adds two cheks. One that insures, that the current sector does
not exceed the allowed maximum (which is always a good idea). And one that
checks if the current access is to the same flash bank as the last access.
If not, the search loop will start with sector 0.

Signed-off-by: Martin Krause 
---
 drivers/mtd/cfi_flash.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index dd394a8..0909fe7 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -744,8 +744,12 @@ static void flash_add_byte (flash_info_t * info, cfiword_t 
* cword, uchar c)
 static flash_sect_t find_sector (flash_info_t * info, ulong addr)
 {
static flash_sect_t saved_sector = 0; /* previously found sector */
+   static flash_info_t *saved_info = 0; /* previously used flash bank */
flash_sect_t sector = saved_sector;
 
+   if ((info != saved_info) || (sector >= info->sector_count))
+   sector = 0;
+
while ((info->start[sector] < addr)
&& (sector < info->sector_count - 1))
sector++;
@@ -757,6 +761,7 @@ static flash_sect_t find_sector (flash_info_t * info, ulong 
addr)
sector--;
 
saved_sector = sector;
+   saved_info = info;
return sector;
 }
 
-- 
1.5.4.3

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


Re: [U-Boot] [PATCH] ARMV7: OMAP3: Add support for Comelit CPS board

2011-03-21 Thread Luca Ceresoli
Wolfgang,

thanks for your patient and prompt review, and sorry for having
overlooked checkpatch.

Il 21/03/2011 12:55, Wolfgang Denk ha scritto:
> Dear Luca Ceresoli,
>
> In message<1300707767-15682-2-git-send-email-luca.ceres...@comelit.it>  you 
> wrote:
>> Board support for the Comelit Group SpA CPS board, which is a custom board
>> based on the BeagleBoard  by Texas Instruments.
>>
>> The board support is based on the BeagleBoard implementation.
>
> It appears you base this code on an old version of U-Boot.  Please
> update your code base first.

Strange.

My patch is based on current master, on the latest commit that I see
today on git://git.denx.de/u-boot.git:

$ git show HEAD^
commit cc1dd33f273f8c96cbd7539b4a2d1d7aa12773cd
Author: John Schmoller 
Date:   Thu Mar 10 16:09:26 2011 -0600

 mpc8[5/6]xx: Ensure POST word does not get reset
...

The "next" branch is much older, and I haven't found any more recent
head in either u-boot-arm nor u-boot-ti.

Where should I rebase my code on?

>
> ALso make sure to run your patch to checkpatch before submitting:
>
> [PATCH] ARMV7: OMAP3: Add support for Comelit CPS board
> total: 4 errors, 325 warnings, 976 lines checked
>
> Please fix these!

Fixed most of them for v2. There are still a few warnings, though, that
I think are false positives:

 > WARNING: Use #include  instead of 
 > #169: FILE: board/comelit/cps/cps.c:39:
 > +#include 

I guess I can safely ignore this one.

 > WARNING: Use of volatile is usually wrong: see 
Documentation/volatile-considered-harmful.txt
 > #1011: FILE: include/configs/omap3_cps.h:305:
 > +extern volatile unsigned int boot_flash_env_addr;

I don't know why it is volatile, but since it's defined this way in
arch/arm/cpu/armv7/omap3/mem.c I think there's a reason.

>
>> --- /dev/null
>> +++ b/board/comelit/cps/config.mk
> ...
>> +CONFIG_SYS_TEXT_BASE = 0x80008000
>
> We don't accept such config.mk files any more.  Please move definition
> into your board config file.

Meaning I should remove config.mk entirely, right?

>
>> +/* GPIO list
>> +   - 159 OUT (GPIO5+31): reset for remote camera interface connector.
>> +   - 19  OUT (GPIO1+19): integrated speaker amplifier (1=on, 0=shdn).
>> +   - 20  OUT (GPIO1+20): handset amplifier (1=on, 0=shdn).
>> +*/
>
> Incorrect multiline comment style.

Will fix in v2.

>
> ...
>> --- a/boards.cfg
>> +++ b/boards.cfg
>> @@ -117,6 +117,7 @@ omap3_pandoraarm armv7   
>> pandora -
>>   igep0020 arm armv7   igep0020
>> isee   omap3
>>   igep0030 arm armv7   igep0030
>> isee   omap3
>>   am3517_evm   arm armv7   am3517evm   
>> logicpdomap3
>> +omap3_cpsarm armv7   cps 
>> comelitomap3
>>   omap3_zoom1  arm armv7   zoom1   
>> logicpdomap3
>>   omap3_zoom2  arm armv7   zoom2   
>> logicpdomap3
>>   omap3_beagle arm armv7   beagle  
>> ti omap3
>
> Please name your board just "cps" (or chose a better name).  There
> shall be no SoC-prefix in the board names.

Will be called dig297 in v2.

>
>> --- /dev/null
>> +++ b/include/configs/omap3_cps.h
>> @@ -0,0 +1,315 @@
> ...
>> +#define CONFIG_ARMV71   /* This is an ARM V7 CPU core */
>> +#define CONFIG_OMAP 1   /* in a TI OMAP core */
>> +#define CONFIG_OMAP34XX 1   /* which is a 34XX */
>> +#define CONFIG_OMAP3430 1   /* which is in a 3430 */
>> +#define CONFIG_OMAP3_CPS1   /* working with CPS board */
>
> #defines like these which select a feature shall not have values
> assigned.  Remove all these '1' here.  Please fix globally.
>

Ok except for OMAP34XX, since arch/arm/cpu/armv7/start.S at line 114
does:

 > #if (CONFIG_OMAP34XX)

Is it intended?
If that's a mistake, I can submit a trivial patch to fix it.

> Best regards,
>
> Wolfgang Denk
>

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


Re: [U-Boot] [PATCH v6 4/4] mpc85xx: Add board support for the eXMeritus HWW-1U-1A devices

2011-03-21 Thread Moffett, Kyle D
Wolfgang,

Thanks for your detailed reviews!

Once I get these last few style issues resolved, what more do I need to do to 
get this merged?  I don't really want to spam the list with more nearly 
identical copies of these patches unless I'm sure that all the necessary review 
items have been taken care of.


On Mar 15, 2011, at 15:36, Wolfgang Denk wrote:
> In message <1300208664-18339-5-git-send-email-kyle.d.moff...@boeing.com> you 
> wrote:
>> The eXMeritus HWW-1U-1A unit is a DO-160-certified 13lb 1U chassis
>> with 3 independent TEMPEST zones.  Two independent P2020 computers may
>> be found inside each zone.  Complete hardware support is included.
> 
> Please run checkpatch on your submissions!

I did run it on this patch, although I forgot to run it on the resurrected 
reset patch (which is also now fixed).  It's a common gripe on the LKML that 
the tool is overzealous about certain warnings in cases where the "fix" makes 
the code less readable.

Specifically:

> ...
>> +/* Ok, now go ahead and program all of those in one go */
>> +mpc85xx_gpio_set(   gpio_high|gpio_low|gpio_in,
>> +gpio_high|gpio_low,
>> +gpio_high);
> 
> ERROR: space prohibited after that open parenthesis '('
> #427: FILE: board/exmeritus/hww1u1a/hww1u1a.c:100:
> +   mpc85xx_gpio_set(   gpio_high|gpio_low|gpio_in,

I could "fix" this code to read:

mpc85xx_gpio_set(gpio_high|gpio_low|gpio_in,
gpio_high|gpio_low, gpio_high);

And it would be much harder to visually compare the three bitmask arguments 
against each other.


>> +/*
>> + * If things have been taken out of reset early (for example, by one
>> + * of the BDI3000 debuggers), then we need to put them back in reset
>> + * and delay a while before we continue.
>> + */
>> +#define GPIO_RESETS (GPIO_DIMM_RESET|GPIO_USB_RESET|GPIO_GETH0_RESET)
>> +if (mpc85xx_gpio_get(GPIO_RESETS)) {
> 
> Please don;t add #defines right in the middle of the code.

Fixed, thanks!


>> +/*
>> + * This little shell function just returns whether or not it's CPU A.
>> + * It can be used to select the right device-tree when booting, etc.
>> + */
>> +int do_hww1u1a_test_cpu_a(cmd_tbl_t *cmdtp, int flag, int argc, char * 
>> const argv[])
> 
> WARNING: line over 80 characters
> #463: FILE: board/exmeritus/hww1u1a/hww1u1a.c:136:
> +int do_hww1u1a_test_cpu_a(cmd_tbl_t *cmdtp, int flag, int argc, char * const 
> argv[])

This one is only a warning, and it's much more readable to have 1 84-character 
line than split it across 2 different lines.  Even still, this warning is only 
issued if you pass "--subjective" to checkpatch, which is documented to "enable 
more subjective tests".  This thread discusses it further:
  http://lkml.org/lkml/2009/12/15/490

>> +U_BOOT_CMD(
>> +hww1u1a_test_cpu_a, 1, 0, do_hww1u1a_test_cpu_a,
>> +"Test if this is CPU A (versus B) on the eXMeritus HWW-1U-1A board",
>> +/*  */" && \n"
>> +"hww1u1a_test_cpu_a || \n"
> 
> What is this empty comment needed for?

Just a mental placeholder for the fact that the U_BOOT_CMD macro inserts the 
name of the command in that spot.  Will remove.


>> +/* Now the serial# part of the hostname */
>> +for (j = 0; serialnr[j]; j++)
>> +if (isalnum(serialnr[j]))
>> +hww1u1a_prompt[i++] = tolower(serialnr[j]);
> 
> Braces needed for multiline statements.

Fixed, thanks!


>> +/* Turn on the "HRESET_REQ" pin (hard-reset request) */
>> +printf("\nRESET: Hardware reset triggered, waiting...\n");
>> +out_be32(&gur->rstcr, 0x2);
>> +while (1)
>> +udelay(1);
>> +}
> 
> Should that not be an infinite wait here?

At this point if the board does not reset due to hardware failure it's better 
off hanging than silently falling through.


>> +/* Enable the U-Boot "memory test" */
>> +#define CONFIG_SYS_MEMTEST_START 0x
>> +#define CONFIG_SYS_MEMTEST_END   0x7fff
> 
> I think this has not been tested, right?

I'm pretty sure it's been tested, but not very recently; the memory on all the 
shipped units is ECC anyways.

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


[U-Boot] [PATCH] DA8xx: fix LPSC numbering

2011-03-21 Thread Laurence Withers
The DA8xx chips have two modules PSC0 and PSC1 for the local power and sleep
controllers (LPSC). Each LPSC has up to 32 submodules over which it has control,
which are enumerated by the DAVINCI_LPSC_* symbols.

This commit fixes the definitions of a number of symbols to be consistent with
both the OMAP-L137 and OMAP-L138 data sheets (TI documents SPRS563D and SPRS586A
respectively): some minor renaming to reflect actual functionality and some
reordering of modules in PSC1 to be correct.

None of the affected symbols were actually used anywhere in the code, so there
are no related code changes.
---
 arch/arm/include/asm/arch-davinci/hardware.h |   29 +-
 1 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/arch/arm/include/asm/arch-davinci/hardware.h 
b/arch/arm/include/asm/arch-davinci/hardware.h
index df3f549..d0a3036 100644
--- a/arch/arm/include/asm/arch-davinci/hardware.h
+++ b/arch/arm/include/asm/arch-davinci/hardware.h
@@ -214,12 +214,12 @@ typedef volatile unsigned int *   dv_reg_p;
 #else /* CONFIG_SOC_DA8XX */
 
 enum davinci_lpsc_ids {
-   DAVINCI_LPSC_TPCC = 0,
+   DAVINCI_LPSC_TPCC0 = 0,
DAVINCI_LPSC_TPTC0,
DAVINCI_LPSC_TPTC1,
DAVINCI_LPSC_AEMIF,
DAVINCI_LPSC_SPI0,
-   DAVINCI_LPSC_MMC_SD,
+   DAVINCI_LPSC_MMC_SD0,
DAVINCI_LPSC_AINTC,
DAVINCI_LPSC_ARM_RAM_ROM,
DAVINCI_LPSC_SECCTL_KEYMGR,
@@ -227,31 +227,40 @@ enum davinci_lpsc_ids {
DAVINCI_LPSC_SCR0,
DAVINCI_LPSC_SCR1,
DAVINCI_LPSC_SCR2,
-   DAVINCI_LPSC_DMAX,
+   DAVINCI_LPSC_PRUSS,
DAVINCI_LPSC_ARM,
DAVINCI_LPSC_GEM,
/* for LPSCs in PSC1, offset from 32 for differentiation */
DAVINCI_LPSC_PSC1_BASE = 32,
-   DAVINCI_LPSC_USB11,
+   DAVINCI_LPSC_TPCC1 = 32,
DAVINCI_LPSC_USB20,
+   DAVINCI_LPSC_USB11,
DAVINCI_LPSC_GPIO,
DAVINCI_LPSC_UHPI,
DAVINCI_LPSC_EMAC,
DAVINCI_LPSC_DDR_EMIF,
DAVINCI_LPSC_McASP0,
-   DAVINCI_LPSC_McASP1,
-   DAVINCI_LPSC_McASP2,
+   DAVINCI_LPSC_McASP1_SATA,
+   DAVINCI_LPSC_McASP2_VPIF,
DAVINCI_LPSC_SPI1,
DAVINCI_LPSC_I2C1,
DAVINCI_LPSC_UART1,
DAVINCI_LPSC_UART2,
+   DAVINCI_LPSC_McBSP0,
+   DAVINCI_LPSC_McBSP1,
DAVINCI_LPSC_LCDC,
DAVINCI_LPSC_ePWM,
+   DAVINCI_LPSC_MMC_SD1,
+   DAVINCI_LPSC_uPP,
DAVINCI_LPSC_eCAP,
-   DAVINCI_LPSC_eQEP,
-   DAVINCI_LPSC_SCR_P0,
-   DAVINCI_LPSC_SCR_P1,
-   DAVINCI_LPSC_CR_P3,
+   DAVINCI_LPSC_eQEP_TPTC2,
+   DAVINCI_LPSC_SCR_F0 = 56,
+   DAVINCI_LPSC_SCR_F1,
+   DAVINCI_LPSC_SCR_F2,
+   DAVINCI_LPSC_SCR_F6,
+   DAVINCI_LPSC_SCR_F7,
+   DAVINCI_LPSC_SCR_F8,
+   DAVINCI_LPSC_BR_F7,
DAVINCI_LPSC_L3_CBA_RAM
 };
 
-- 
1.7.2.5

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


[U-Boot] [PATCH] DA8xx: fix LPSC numbering

2011-03-21 Thread Laurence Withers
Hi,

I'm in the process of porting u-boot to a new board we have developed using the
OMAP-L138 (or DA850). While I'm a long way from finishing the port, I have
noticed that the definitions of some of the local power and sleep controller
(LPSC) register module numbers are incorrect.

As a reply to this mail I've attached my first attempt at a patch for u-boot,
which addresses this issue.

Any feedback (esp. wrt formatting and use of the git tools etc.) is gratefully
received.

Laurence Withers (1):
  DA8xx: fix LPSC numbering

 arch/arm/include/asm/arch-davinci/hardware.h |   29 +-
 1 files changed, 19 insertions(+), 10 deletions(-)

-- 
Laurence Withers, http://www.guralp.com/
Direct tel:+447753988197 or tel:+44408643   Software Engineer
General support queries:  CMG-DCM CMG-EAM CMG-NAM
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] cfi_flash - bug with flash banks with different sector numbers

2011-03-21 Thread Martin Krause
Hi Stefan,

Stefan Roese wrote on Montag, 21. März 2011 14:10:
> Hi Martin,
> 
> On Monday 21 March 2011 13:42:00 Martin Krause wrote:
>> I encountered a problem with the cfi_flash driver on a board with
>> two flash banks with a different number of flash secotrs.
>> 
>> It seems that the function find_sector() which tries to speed up
>> successive flash accesses does not take into account the current
>> flash bank correctly. 
>> 
>> I created a patch with a fix (see blow), but since I do not
>> work with current U-Boot, this patch likely will not apply cleanly
>> to TOT (but is neccessary, since the bug is still present there).
> 
> First, the patch is line wrapped. Would it be possible for

Oh, I forgot dumb M$ outlook.

> you to take the
> time to rebase it against TOT and send a non line wrapped version?

I will do, if the patch otherwise is OK. Since the computer my git 
repo is installed on has no direct connection to the internet, this 
is not as easy as it could be. And I will not be able to test the 
patched TOT U-Boot apart from compiling without errors.

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


Re: [U-Boot] [PATCH 1/9] arm926ej-s: Invalidate instruction cache in flush_cache

2011-03-21 Thread arden jay
Hi Michael,
Thanks, it is the key point:
"The problem is that it hits, but returns the wrong instructions."

Hi Aneesh,
Thanks for your sharing, it makes sense to check that way.

2011/3/21 Aneesh V :
> Hi Arden,
>
> On Sunday 20 March 2011 08:00 AM, arden jay wrote:
>>
>> Hi Michael,
>> Curiously, have any idea how to test cache stuff?
>
> Recently I did some cache testing. Here is the technique I used for
> data-cache:
>
> To test flush:
> * Write a known pattern to a region of memory
> * Flush the region
> * Invalidate the region
> * Read back the region and see if you get the original pattern. If the
> flush was effective you will see the original data.
>
> To test Invalidate:
> * Write a known pattern to a region of memory
> * Invalidate the region immediately
> * Read back the region and see if you get the original pattern. You
> should *not* be seeing the expected pattern for the entire region if
> the invalidate was successful.
>
> Similar tests can be done for the I-cache, but maybe a little more
> tedious.
>
> I agree that these tests may not be 100% fool-proof - for instance what
> if both invalidate and flush didn't work in the first case. But these
> should at least catch very obvious errors and can be used in
> combination with other techniques to make sure that your cache
> operations are indeed working.
>
> Additionally, there was a JTAG debugger technique that I found quite
> useful. If your processor supports a technique called DAP(Debug Access
> Port or Dual Access Port, I am not sure) then a debugger like
> Lauterbach can view memory in two modes, one the normal or CPU mode and
> the other DAP mode. In normal mode the memory is dumped as if it is
> viewed from the CPU, so it goes through the cache and you see the cache
> contents if the area in question is in cache. In DAP mode the
> real memory contents are dumped. Comparing these two you can see
> whether cache and memory are coherent for a given area. It worked quite
> well with Lauterbach and OMAP4.
>
> br,
> Aneesh
>
>>
>> 2011/3/18 Michael Spang:
>>>
>>> If U-Boot is loaded from RAM and the OS is loaded into an overlapping
>>> region, the instruction cache is not coherent when that OS is started.
>>> We must therefore invalidate the instruction cache in addition to
>>> cleaning the data cache.
>>>
>>> Signed-off-by: Michael Spang
>>> ---
>>>  arch/arm/lib/cache.c |    2 ++
>>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/arch/arm/lib/cache.c b/arch/arm/lib/cache.c
>>> index 30686fe..047786a 100644
>>> --- a/arch/arm/lib/cache.c
>>> +++ b/arch/arm/lib/cache.c
>>> @@ -37,6 +37,8 @@ void  flush_cache (unsigned long dummy1, unsigned long
>>> dummy2)
>>>        asm("0: mrc p15, 0, r15, c7, c10, 3\n\t" "bne 0b\n" : : :
>>> "memory");
>>>        /* disable write buffer as well (page 2-22) */
>>>        asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (0));
>>> +       /* invalidate icache for coherence with cleaned dcache */
>>> +       asm("mcr p15, 0, %0, c7, c5, 0" : : "r" (0));
>>>  #endif
>>>  #ifdef CONFIG_OMAP34XX
>>>        void v7_flush_cache_all(void);
>>> --
>>> 1.7.2.3
>>>
>>> ___
>>> U-Boot mailing list
>>> U-Boot@lists.denx.de
>>> http://lists.denx.de/mailman/listinfo/u-boot
>>>
>>
>>
>>
>



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


[U-Boot] Your email ID has been awarded 1, 000, 000, 00 GBP. in our Tobacco Promo

2011-03-21 Thread food
Send Details

Names:
Address:
Tel:

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


[U-Boot] Changing USB speed from slow to fast

2011-03-21 Thread Nikhilesh Dwivedi
Hi,

I am working on ARM at91sam9g20ek. I am copying my Kernel image and 
rootfilesystem (jffs2) from USB to nand memory in UBOOT. Currently copying 
files from USB to RAM takes more time and I figured out from the code that USB 
Speed is low (1.5Mb/s). How can I change it to Fast speed in Uboot?

Thanks for help.

Regards,
Nikhilesh Dwivedi

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


Re: [U-Boot] cfi_flash - bug with flash banks with different sector numbers

2011-03-21 Thread Stefan Roese
Hi Martin,

On Monday 21 March 2011 13:42:00 Martin Krause wrote:
> I encountered a problem with the cfi_flash driver on a board with
> two flash banks with a different number of flash secotrs.
> 
> It seems that the function find_sector() which tries to speed up
> successive flash accesses does not take into account the current
> flash bank correctly.
> 
> I created a patch with a fix (see blow), but since I do not
> work with current U-Boot, this patch likely will not apply cleanly
> to TOT (but is neccessary, since the bug is still present there).

First, the patch is line wrapped. Would it be possible for you to take the 
time to rebase it against TOT and send a non line wrapped version?

Thanks.
 
Cheers,
Stefan

--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: off...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Please pull u-boot-ubi/master

2011-03-21 Thread Stefan Roese
Hi Wolfgang,

please pull the following UBI fix:

The following changes since commit cc1dd33f273f8c96cbd7539b4a2d1d7aa12773cd:

  mpc8[5/6]xx: Ensure POST word does not get reset (2011-03-13 11:24:44 -0500)

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

Stefan Roese (1):
  UBI: Fix error code handling in ubi commands

 common/cmd_ubi.c |  137 +
 1 files changed, 65 insertions(+), 72 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] (no subject)

2011-03-21 Thread ystradgynlais.sports.centre
Your E-mail Address Won (£750,000 UK Pounds,) from the OPEC PROMO 2011 Provide 
your 1.Full Name:
2.Full Address: 3.Status: 4.Occupation: 5.Age 6.Sex: 7.Country: 8.Mobile 
Number: for more details

-
Cyngor Sir Powys County Council
www.powys.gov.uk

Mae'r e bost hwn ac unrhyw atodiad iddo yn gyfrinachol ac fe'i
bwriedir ar gyfer y sawl a enwir arno yn unig. Gall gynnwys
gwybodaeth freintiedig. Os yw wedi eich cyrraedd trwy gamgymeriad
ni ellwch ei gopio, ei ddosbarthu na'i ddangos i unrhyw un arall a
dylech gysylltu gyda Cyngor Sir Powys ar unwaith.

Mae unrhyw gynnwys nad yw'n ymwneud gyda busnes swyddogol Cyngor
Sir Powys yn bersonol i'r awdur ac nid yw'n awdurdodedig gan y
Cyngor.

This e mail and any attachments are confidential and intended for
the named recipient only. The content may contain privileged
information. If it has reached you by mistake, you should not copy,
distribute or show the content to anyone but should contact Powys
County Council at once.

Any content that is not pertinent to Powys County Council business
is personal to the author, and is not necessarily the view of the
Council.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] UBI: Fix error code handling in ubi commands

2011-03-21 Thread Stefan Roese
On Tuesday 15 March 2011 10:47:14 Stefan Roese wrote:
> Some ubi commands returned negative error codes, resulting in
> the following error message on the prompt:
> 
> "exit not allowed from main input shell."
> 
> Negative error codes are not allowed.

Applied to u-boot-ubi/master.
 
Cheers,
Stefan

--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: off...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/5] MIPS: Optimize the setup of endianess and CPU optimization flags

2011-03-21 Thread Daniel Schwierzeck
Hi Shinya,

2011/3/17 Shinya Kuribayashi :
> On 03/16/2011 11:41 PM, Daniel Schwierzeck wrote:
>> Is my approach with -march acceptable? This is more important to me
>> for supporting new SoCs with 24k and 34k CPU cores. I think its a
>> clean approach to use a default Mips32 architecture optimization plus
>> a per CPU optimization configured in the SoC directories.
>
> IIUC this is a binutils related issue.
>
>> @@ -20,20 +20,13 @@
>>  # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
>>  # MA 02111-1307 USA
>>  #
>> -v=$(shell $(AS) --version | grep 'GNU assembler' | egrep -o '2\.[0-9\.]+' | 
>> cut -d. -f2)
>> -MIPSFLAGS:=$(shell \
>> -if [ "$v" -lt "14" ]; then \
>> -     echo "-mcpu=4kc"; \
>> -else \
>> -     echo "-march=4kc -mtune=4kc"; \
>> -fi)
>>
>> [...]
>> +# Optimization flags for all Mips32 CPUs
>> +MIPSFLAGS = $(call cc-option,-march=mips32r2,-mips32r2 -Wa,-mips32r2)
>
> According to GNU gas NEWS, mips32r2 support was introduced in 2.14:
>
> http://sourceware.org/cgi-bin/cvsweb.cgi/~checkout~/src/gas/NEWS?rev=1.117&content-type=text/plain&cvsroot=src&only_with_tag=binutils-binutils-2_21
>
> On the other hand, we have a number of the ELDK releases so far, and
> their binutils versions vary from 2.11 (ELDK2.1.0) to 2.16.1 (ELDK4.1).
>
> 2.1.0: 
> http://mirror.switch.ch/ftp/mirror/eldk/2.1.0/eldk-mips-linux-x86/README.html
> 3.0:   (N/A for MIPS?)
> 3.1:   
> http://mirror.switch.ch/ftp/mirror/eldk/3.1/mips-linux-x86/distribution/README.html
> 3.1.1: 
> http://mirror.switch.ch/ftp/mirror/eldk/3.1.1/mips-linux-x86/distribution/README.html
> 4.0:   
> http://mirror.switch.ch/ftp/mirror/eldk/4.0/mips-linux-x86/distribution/README.html
>       http://www.denx.de/en/News/PressReleaseELDK40
> 4.1:   
> http://mirror.switch.ch/ftp/mirror/eldk/4.1/mips-linux-x86/distribution/README.html
>       http://www.denx.de/en/News/PressReleaseELDK41
> 4.2:   (N/A for MIPS?)
>
> Does above change break any builds with older binutils?  Personally, I'm
> ok with dropping older toolchains to some extent.  However, if it breaks
> builds with older toolchains, strictly speaking older versions of the
> ELDK releases, the decision is up to Wolfgang.

I did some researching and testing with ELDK-4.1, ELDK-4.0 and ELDK-3.1.1.

In ELDK-3.1.1 we have:
- mips_4KC-gcc (GCC) 3.3.3 (DENX ELDK 3.1.1 3.3.3-9)
- GNU assembler 2.14 20030612

Therefore mips32r2 is already supported. But there is another problem with this
binutils version. The latest additions to mips.lds and u-boot.lds for
supporting recent
binutils are causing parse errors. Thus ELDK-3.1.1 and earlier are not
functional with
mainline U-Boot anyway. ELDK-4.0 and 4.1 with gcc-4.0.0 and
binutils-2.16.1 are working
properly.

I suggest to drop official support for ELDK-3.1.1 / binutils-2.14 and earlier.


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


[U-Boot] cfi_flash - bug with flash banks with different sector numbers

2011-03-21 Thread Martin Krause
Hi list,

I encountered a problem with the cfi_flash driver on a board with
two flash banks with a different number of flash secotrs.

It seems that the function find_sector() which tries to speed up 
successive flash accesses does not take into account the current
flash bank correctly.

I created a patch with a fix (see blow), but since I do not
work with current U-Boot, this patch likely will not apply cleanly
to TOT (but is neccessary, since the bug is still present there).

Best regards,
Martin


>From 22454f09e058a3b0b8e86bc4d5566c21e23f5b63 Mon Sep 17 00:00:00 2001
From: Martin Krause 
Date: Mon, 21 Mar 2011 13:08:19 +0100
Subject: [PATCH] cfi_flash: fix bug with flash banks with different
sector numbers

The function find_sector() does not take into account if the flash bank
has changed since the last call. This could lead to illegal accesses
inside
and beyond the flash_info_t info strcture. For example if the current
flash bank has less sectors than the last used flash bank.

This patch adds two cheks. One that insures, that the current sector
does not
exceed the allowed maximum (which is always a good idea). And one that
checks if the current access is to the same flash bank as the last
access.
If not, the search loop will start with sector 0.

Signed-off-by: Martin Krause 
---
 drivers/mtd/cfi_flash.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 24eb33f..ff1457c 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -653,8 +653,12 @@ static void flash_add_byte (flash_info_t * info,
cfiword_t * cword, uchar c)
 static flash_sect_t find_sector (flash_info_t * info, ulong addr)
 {
static flash_sect_t saved_sector = 0; /* previously found sector
*/
+   static flash_info_t *saved_info = 0; /* previously used flash
bank */
flash_sect_t sector = saved_sector;

+   if ((info != saved_info) || (sector >= info->sector_count))
+   sector = 0;
+
while ((info->start[sector] < addr)
&& (sector < info->sector_count - 1))
sector++;
@@ -666,6 +670,7 @@ static flash_sect_t find_sector (flash_info_t *
info, ulong addr)
sector--;

saved_sector = sector;
+   saved_info = info;
return sector;
 }

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


Re: [U-Boot] [PATCH] ARMV7: S5PC210: Fixed register offset in mmc.h

2011-03-21 Thread Minkyu Kang
Dear Chander Kashyap,

On 21 March 2011 17:40, Chander Kashyap  wrote:
> MMC controller "control4" register offset set to
> 0x8C as per data sheet.
> Added missed out reserved field.
> Updated padding field size.
>
> Signed-off-by: Chander Kashyap 
> Signed-off-by: Tushar Behera 
> ---
>  arch/arm/include/asm/arch-s5pc2xx/mmc.h |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/include/asm/arch-s5pc2xx/mmc.h 
> b/arch/arm/include/asm/arch-s5pc2xx/mmc.h
> index 528150d..04827ca 100644
> --- a/arch/arm/include/asm/arch-s5pc2xx/mmc.h
> +++ b/arch/arm/include/asm/arch-s5pc2xx/mmc.h
> @@ -53,10 +53,11 @@ struct s5p_mmc {
>        unsigned char   res3[0x34];
>        unsigned int    control2;
>        unsigned int    control3;
> +       unsigned char   res4[4];
>        unsigned int    control4;
> -       unsigned char   res4[0x6e];
> +       unsigned char   res5[0x6e];
>        unsigned short  hcver;
> -       unsigned char   res5[0xFF02];
> +       unsigned char   res6[0xFF00];
>  };
>
>  struct mmc_host {
> --

Thanks for patch.
But, you should fix s5pc1xx also.
Please send next patch.

Thanks.
Minkyu Kang.
-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 01/21] Define new system_restart() and emergency_restart()

2011-03-21 Thread Wolfgang Denk
Dear Graeme Russ,

In message <4d8739f6.5040...@gmail.com> you wrote:
>
> I kind of like the idea of different reset sources (CPU exception, hardware
> failure, user initiated) but agree copying the linux architecture is over
> the top.

What's the difference as far as do_reset() is concenred?  It shall
just (hard) reset the system, nothing else.

> Is there any reason reset() could not take a 'reason' parameter? It could
> be a bit-mask with CPU, SOC and arch reserved bits (unhandled exception,
> user initiated, panic etc) and board specific bits

What for? To perform the intended purpose, no parameter is needed.

> Board or arch specific code could handle different reasons however they
> please (like logging it in NVRAM prior to restart, gracefully shutting down
> multiple CPU's, clearing DMA buffers etc)

That would be a layer higher than do_reset() (for example, in
panic()).

> All 'hang', 'panic', 'reset' etc code can be simplified into a single code
> path (although calling 'reset' to 'hang' is a bit odd)

hang() and reset() are intentionally very different things.  A call to
hang() is supposed to hang (surprise, surprise!) infinitely.  It must
not cause a reset.

panic() is a higher software layer. It probably results in calling
reset() in the end.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
You don't need a weatherman to know which way the wind blows.
  - Bob Dylan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ARMV7: OMAP3: Add support for Comelit CPS board

2011-03-21 Thread Luca Ceresoli
Board support for the Comelit Group SpA CPS board, which is a custom board
based on the BeagleBoard  by Texas Instruments.

The board support is based on the BeagleBoard implementation.

Signed-off-by: Luca Ceresoli 
Cc: Wolfgang Denk 
Cc: Albert Aribaud 
Cc: Sandeep Paulraj 
---
 MAINTAINERS |4 +
 MAKEALL |1 +
 board/comelit/cps/Makefile  |   49 ++
 board/comelit/cps/config.mk |   36 
 board/comelit/cps/cps.c |  173 
 board/comelit/cps/cps.h |  379 +++
 boards.cfg  |1 +
 include/configs/omap3_cps.h |  315 +++
 8 files changed, 958 insertions(+), 0 deletions(-)
 create mode 100644 board/comelit/cps/Makefile
 create mode 100644 board/comelit/cps/config.mk
 create mode 100644 board/comelit/cps/cps.c
 create mode 100644 board/comelit/cps/cps.h
 create mode 100644 include/configs/omap3_cps.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 4756f14..8030184 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -599,6 +599,10 @@ Rick Bronson 
 
AT91RM9200DKat91rm9200
 
+Luca Ceresoli 
+
+   omap3_cps   ARM ARMV7 (OMAP3530 SoC)
+
 Po-Yu Chuang 
 
a320evb FA526 (ARM920T-like) (a320 SoC)
diff --git a/MAKEALL b/MAKEALL
index a732e6a..2e59992 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -425,6 +425,7 @@ LIST_ARMV7="\
igep0030\
mx51evk \
omap3_beagle\
+   omap3_cps   \
omap3_overo \
omap3_evm   \
omap3_pandora   \
diff --git a/board/comelit/cps/Makefile b/board/comelit/cps/Makefile
new file mode 100644
index 000..fbe2610
--- /dev/null
+++ b/board/comelit/cps/Makefile
@@ -0,0 +1,49 @@
+#
+# (C) Copyright 2000, 2001, 2002
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := cps.o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+clean:
+   rm -f $(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/comelit/cps/config.mk b/board/comelit/cps/config.mk
new file mode 100644
index 000..e1fcafd
--- /dev/null
+++ b/board/comelit/cps/config.mk
@@ -0,0 +1,36 @@
+#
+# (C) Copyright 2011 Comelit Group SpA
+# Luca Ceresoli 
+#
+# Based on board/ti/beagle/config.mk:
+# (C) Copyright 2006
+# Texas Instruments, 
+#
+# Comelit CPS Board uses OMAP3 (ARM-CortexA8) CPU.
+#
+# 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
+#
+# Physical Address:
+# 8000' (bank0)
+# A000/ (bank1)
+# Linux-Kernel is expected to be at 8000'8000, entry 8000'8000
+# (mem base + reserved)
+
+# For use with external or internal boots.
+CONFIG_SYS_TEXT_BASE = 0x80008000
diff --git a/board/comelit/cps/cps.c b/board/comelit/cps/cps.c
new file mode 100644
index 000..afc5bad
--- /dev/null
+++ b/board/comelit/cps/cps.c
@@ -0,0 +1,173 @@
+/*
+ * (C) Copyright 2011 Comelit Group SpA
+ * Luca Ceresoli 
+ *
+ * 

[U-Boot] OMAP3 Regression after merging ARM relocation code for custom board

2011-03-21 Thread Luca Ceresoli
Wolfgang, Albert, all,

following last week's discussion [1], here's the patch that would implement
Comelit CPS board support in U-boot.

The point is that this code is not booting.
It is a rebase on top of current master of a previous, working, version
based on v2010.06.
During the rebase process, the code stopped working after rebasing on top of
the ARM Relocation commits.

FWIW, The code compiles correctly.

As you can see by looking at the patch, the core is implemented just like
the BeagleBoard's code. This is because the two boards are identical in
terms of the core devices required for booting (same CPU, same NAND, same
model of RAM but only one chip installed).

A detailed problem report is in the mentioned thread [1].

I hope this helps in finding the issue and finally merge in U-boot.

Thanks in advance,
Luca

[1] http://lists.denx.de/pipermail/u-boot/2011-March/088704.html

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


Re: [U-Boot] [PATCH] ARMV7: OMAP3: Add support for Comelit CPS board

2011-03-21 Thread Wolfgang Denk
Dear Luca Ceresoli,

In message <1300707767-15682-2-git-send-email-luca.ceres...@comelit.it> you 
wrote:
> Board support for the Comelit Group SpA CPS board, which is a custom board
> based on the BeagleBoard  by Texas Instruments.
> 
> The board support is based on the BeagleBoard implementation.

It appears you base this code on an old version of U-Boot.  Please
update your code base first.

ALso make sure to run your patch to checkpatch before submitting:

[PATCH] ARMV7: OMAP3: Add support for Comelit CPS board
total: 4 errors, 325 warnings, 976 lines checked

Please fix these!

> --- /dev/null
> +++ b/board/comelit/cps/config.mk
...
> +CONFIG_SYS_TEXT_BASE = 0x80008000

We don't accept such config.mk files any more.  Please move definition
into your board config file.

> + /* GPIO list
> +- 159 OUT (GPIO5+31): reset for remote camera interface connector.
> +- 19  OUT (GPIO1+19): integrated speaker amplifier (1=on, 0=shdn).
> +- 20  OUT (GPIO1+20): handset amplifier (1=on, 0=shdn).
> + */

Incorrect multiline comment style.

...
> --- a/boards.cfg
> +++ b/boards.cfg
> @@ -117,6 +117,7 @@ omap3_pandoraarm armv7   
> pandora -
>  igep0020 arm armv7   igep0020
> isee   omap3
>  igep0030 arm armv7   igep0030
> isee   omap3
>  am3517_evm   arm armv7   am3517evm   
> logicpdomap3
> +omap3_cpsarm armv7   cps 
> comelitomap3
>  omap3_zoom1  arm armv7   zoom1   
> logicpdomap3
>  omap3_zoom2  arm armv7   zoom2   
> logicpdomap3
>  omap3_beagle arm armv7   beagle  ti  
>omap3

Please name your board just "cps" (or chose a better name).  There
shall be no SoC-prefix in the board names.

> --- /dev/null
> +++ b/include/configs/omap3_cps.h
> @@ -0,0 +1,315 @@
...
> +#define CONFIG_ARMV7 1   /* This is an ARM V7 CPU core */
> +#define CONFIG_OMAP  1   /* in a TI OMAP core */
> +#define CONFIG_OMAP34XX  1   /* which is a 34XX */
> +#define CONFIG_OMAP3430  1   /* which is in a 3430 */
> +#define CONFIG_OMAP3_CPS 1   /* working with CPS board */

#defines like these which select a feature shall not have values
assigned.  Remove all these '1' here.  Please fix globally.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
At the source of every error which is blamed on the computer you will
find at least two human errors, including the error of blaming it  on
the computer.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 2/2] a320evb: fix include path of timer fttmr010

2011-03-21 Thread Macpaul Lin
Fix include path of timer fttmr010 in a320evb.

Signed-off-by: Macpaul Lin 
---
 arch/arm/cpu/arm920t/a320/timer.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/arm920t/a320/timer.c 
b/arch/arm/cpu/arm920t/a320/timer.c
index 7785036..95cb8fd 100644
--- a/arch/arm/cpu/arm920t/a320/timer.c
+++ b/arch/arm/cpu/arm920t/a320/timer.c
@@ -19,8 +19,8 @@

 #include 
 #include 
-#include 
 #include 
+#include 

 static ulong timestamp;
 static ulong lastdec;
-- 
1.7.3.5



CONFIDENTIALITY NOTICE:

This e-mail (and its attachments) may contain confidential and legally 
privileged information or information protected from disclosure. If you 
are not the intended recipient, you are hereby notified that any 
disclosure, copying, distribution, or use of the information contained 
herein is strictly prohibited. In this case, please immediately notify the 
sender by return e-mail, delete the message (and any accompanying 
documents) and destroy all printed hard copies. Thank you for your 
cooperation.

Copyright ANDES TECHNOLOGY CORPORATION - All Rights Reserved.

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


[U-Boot] [PATCH v2 1/2] fttmr010: move fttmr010 header to include/faraday

2011-03-21 Thread Macpaul Lin
Move the header file and definitions of fttmr010
power control unit from a320 SoC folder to
"include/faraday" folder.

This change will let other SoC which also use fttmr010
could share the same header file.

Signed-off-by: Macpaul Lin 
---
Changes for v2:
  - Fix patch according to the dependent patches of a320evb in 
u-boot-arm.git
"next" branch.
  - V1 patches of fttmr010 as "/patch/71952/" marked as "superseded" in
patchworks.
  - Move files into "include/faraday" instead of "drivers/timer".

 arch/arm/include/asm/arch-a320/fttmr010.h | 
  73 -
 include/faraday/fttmr010.h|   73 
+
 2 files changed, 73 insertions(+), 73 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-a320/fttmr010.h
 create mode 100644 include/faraday/fttmr010.h

diff --git a/arch/arm/include/asm/arch-a320/fttmr010.h 
b/arch/arm/include/asm/arch-a320/fttmr010.h
deleted file mode 100644
index 72abcb3..000
--- a/arch/arm/include/asm/arch-a320/fttmr010.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * (C) Copyright 2009 Faraday Technology
- * Po-Yu Chuang 
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-/*
- * Timer
- */
-#ifndef __FTTMR010_H
-#define __FTTMR010_H
-
-struct fttmr010 {
-   unsigned inttimer1_counter; /* 0x00 */
-   unsigned inttimer1_load;/* 0x04 */
-   unsigned inttimer1_match1;  /* 0x08 */
-   unsigned inttimer1_match2;  /* 0x0c */
-   unsigned inttimer2_counter; /* 0x10 */
-   unsigned inttimer2_load;/* 0x14 */
-   unsigned inttimer2_match1;  /* 0x18 */
-   unsigned inttimer2_match2;  /* 0x1c */
-   unsigned inttimer3_counter; /* 0x20 */
-   unsigned inttimer3_load;/* 0x24 */
-   unsigned inttimer3_match1;  /* 0x28 */
-   unsigned inttimer3_match2;  /* 0x2c */
-   unsigned intcr; /* 0x30 */
-   unsigned intinterrupt_state;/* 0x34 */
-   unsigned intinterrupt_mask; /* 0x38 */
-};
-
-/*
- * Timer Control Register
- */
-#define FTTMR010_TM3_UPDOWN(1 << 11)
-#define FTTMR010_TM2_UPDOWN(1 << 10)
-#define FTTMR010_TM1_UPDOWN(1 << 9)
-#define FTTMR010_TM3_OFENABLE  (1 << 8)
-#define FTTMR010_TM3_CLOCK (1 << 7)
-#define FTTMR010_TM3_ENABLE(1 << 6)
-#define FTTMR010_TM2_OFENABLE  (1 << 5)
-#define FTTMR010_TM2_CLOCK (1 << 4)
-#define FTTMR010_TM2_ENABLE(1 << 3)
-#define FTTMR010_TM1_OFENABLE  (1 << 2)
-#define FTTMR010_TM1_CLOCK (1 << 1)
-#define FTTMR010_TM1_ENABLE(1 << 0)
-
-/*
- * Timer Interrupt State & Mask Registers
- */
-#define FTTMR010_TM3_OVERFLOW  (1 << 8)
-#define FTTMR010_TM3_MATCH2(1 << 7)
-#define FTTMR010_TM3_MATCH1(1 << 6)
-#define FTTMR010_TM2_OVERFLOW  (1 << 5)
-#define FTTMR010_TM2_MATCH2(1 << 4)
-#define FTTMR010_TM2_MATCH1(1 << 3)
-#define FTTMR010_TM1_OVERFLOW  (1 << 2)
-#define FTTMR010_TM1_MATCH2(1 << 1)
-#define FTTMR010_TM1_MATCH1(1 << 0)
-
-#endif /* __FTTMR010_H */
diff --git a/include/faraday/fttmr010.h b/include/faraday/fttmr010.h
new file mode 100644
index 000..72abcb3
--- /dev/null
+++ b/include/faraday/fttmr010.h
@@ -0,0 +1,73 @@
+/*
+ * (C) Copyright 2009 Faraday Technology
+ * Po-Yu Chuang 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/*
+ * Timer
+ */
+#ifndef __FTTMR010_H
+#define __FTTMR010_H
+
+struct fttmr010 {
+   unsigned inttimer1_counter; /* 0x00 */
+   unsigned inttimer1_load;/* 0x04 */
+   unsigned inttimer1_m

Re: [U-Boot] [PATCH 01/21] Define new system_restart() and emergency_restart()

2011-03-21 Thread Graeme Russ
On 15/03/11 09:01, Wolfgang Denk wrote:
> Dear "Moffett, Kyle D",
> 
> In message <44a75130-ed4f-46d6-b0e4-12433cc15...@boeing.com> you wrote:
>>

[Snip]

I kind of like the idea of different reset sources (CPU exception, hardware
failure, user initiated) but agree copying the linux architecture is over
the top.

Is there any reason reset() could not take a 'reason' parameter? It could
be a bit-mask with CPU, SOC and arch reserved bits (unhandled exception,
user initiated, panic etc) and board specific bits

Board or arch specific code could handle different reasons however they
please (like logging it in NVRAM prior to restart, gracefully shutting down
multiple CPU's, clearing DMA buffers etc)

All 'hang', 'panic', 'reset' etc code can be simplified into a single code
path (although calling 'reset' to 'hang' is a bit odd)

Just a thought

Regards,

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


Re: [U-Boot] [PATCH v2 1/2] ftpmu010: fix relocation and enhance features

2011-03-21 Thread Macpaul Lin
Hi all,

2011/3/21 Macpaul Lin :
> 1. ftpmu010.h: fix and add definitions
>   Enhanced for more features and asm related support
>   according to datasheet.

Sorry for the duplicate e-mails of these patches v2 due to
misconfiguration of our e-mail server.
The e-mail server has been fixed and I've already remove one copy of
the duplicate e-mails in patchworks.

Thanks.

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


[U-Boot] [PATCH v2 1/2] ftpmu010: fix relocation and enhance features

2011-03-21 Thread Macpaul Lin
1. ftpmu010.h: fix and add definitions
   Enhanced for more features and asm related support
   according to datasheet.

   Note:
- FTPMU010_PDLLCR0_HCLKOUTDIS is "incorrect" in datasheet.
- FTPMU010_PDLLCR0_DLLFRANG is only 1 bit at bit #19. (not 20-19)
- FTPMU010_PDLLCR0_HCLKOUTDIS is 4 bits at bit #20. (not 24-21)

2. ftpmu010.c: enhance features and fix relocation
   - The following functions is added for pmu features.
 ftpmu010_mfpsr_select_dev()
 ftpmu010_sdramhtc_set()
   - This patch also fix the declare statement for relocation.

Signed-off-by: Macpaul Lin 
---
Changes for v2:
   - Fix patch according to the dependent patches of ftpmu010 in 
u-boot-arm.git
 "next" branch.
   - V1 patches of ftpmu010 as "/patch/77704/" marked as "superseded" in
 patchworks.

 drivers/power/ftpmu010.c   |   39 +--
 include/faraday/ftpmu010.h |   38 +++---
 2 files changed, 72 insertions(+), 5 deletions(-)

diff --git a/drivers/power/ftpmu010.c b/drivers/power/ftpmu010.c
index c6a8cda..df99dfa 100644
--- a/drivers/power/ftpmu010.c
+++ b/drivers/power/ftpmu010.c
@@ -25,10 +25,10 @@
 #include 
 #include 

-static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
-
+/* OSCC: OSC Control Register */
 void ftpmu010_32768osc_enable(void)
 {
+   static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
unsigned int oscc;

/* enable the 32768Hz oscillator */
@@ -46,8 +46,31 @@ void ftpmu010_32768osc_enable(void)
writel(oscc, &pmu->OSCC);
 }

+/* MFPSR: Multi-Function Port Setting Register */
+void ftpmu010_mfpsr_select_dev(unsigned int dev)
+{
+   static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
+   unsigned int mfpsr;
+
+   mfpsr = readl(&pmu->MFPSR);
+   mfpsr |= dev;
+   writel(mfpsr, &pmu->MFPSR);
+}
+
+void ftpmu010_mfpsr_diselect_dev(unsigned int dev)
+{
+   static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
+   unsigned int mfpsr;
+
+   mfpsr = readl(&pmu->MFPSR);
+   mfpsr &= ~dev;
+   writel(mfpsr, &pmu->MFPSR);
+}
+
+/* PDLLCR0: PLL/DLL Control Register 0 */
 void ftpmu010_dlldis_disable(void)
 {
+   static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
unsigned int pdllcr0;

pdllcr0 = readl(&pmu->PDLLCR0);
@@ -57,9 +80,21 @@ void ftpmu010_dlldis_disable(void)

 void ftpmu010_sdram_clk_disable(unsigned int cr0)
 {
+   static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
unsigned int pdllcr0;

pdllcr0 = readl(&pmu->PDLLCR0);
pdllcr0 |= FTPMU010_PDLLCR0_HCLKOUTDIS(cr0);
writel(pdllcr0, &pmu->PDLLCR0);
 }
+
+/* SDRAMHTC: SDRAM Signal Hold Time Control */
+void ftpmu010_sdramhtc_set(unsigned int val)
+{
+   static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
+   unsigned int sdramhtc;
+
+   sdramhtc = readl(&pmu->SDRAMHTC);
+   sdramhtc |= val;
+   writel(sdramhtc, &pmu->SDRAMHTC);
+}
diff --git a/include/faraday/ftpmu010.h b/include/faraday/ftpmu010.h
index 640f056..bd40c53 100644
--- a/include/faraday/ftpmu010.h
+++ b/include/faraday/ftpmu010.h
@@ -126,23 +126,55 @@ struct ftpmu010 {
 /*
  * Multi-Function Port Setting Register
  */
+#define FTPMU010_MFPSR_DEBUGSEL(1 << 17)
+#define FTPMU010_MFPSR_DMA0PINSEL  (1 << 16)
+#define FTPMU010_MFPSR_DMA1PINSEL  (1 << 15)
 #define FTPMU010_MFPSR_MODEMPINSEL (1 << 14)
 #define FTPMU010_MFPSR_AC97CLKOUTSEL   (1 << 13)
+#define FTPMU010_MFPSR_PWM1PINSEL  (1 << 11)
+#define FTPMU010_MFPSR_PWM0PINSEL  (1 << 10)
+#define FTPMU010_MFPSR_IRDACLKSEL  (1 << 9)
+#define FTPMU010_MFPSR_UARTCLKSEL  (1 << 8)
+#define FTPMU010_MFPSR_SSPCLKSEL   (1 << 6)
+#define FTPMU010_MFPSR_I2SCLKSEL   (1 << 5)
+#define FTPMU010_MFPSR_AC97CLKSEL  (1 << 4)
 #define FTPMU010_MFPSR_AC97PINSEL  (1 << 3)
+#define FTPMU010_MFPSR_TRIAHBDIS   (1 << 1)
+#define FTPMU010_MFPSR_TRIAHBDBG   (1 << 0)

 /*
  * PLL/DLL Control Register 0
+ * Note:
+ *  1. FTPMU010_PDLLCR0_HCLKOUTDIS:
+ * Datasheet indicated it starts at bit #21 which was wrong.
+ *  2. FTPMU010_PDLLCR0_DLLFRAG:
+ * Datasheet indicated it has 2 bit which was wrong.
  */
-#define FTPMU010_PDLLCR0_HCLKOUTDIS(cr0)   (((cr0) >> 20) & 0xf)
-#define FTPMU010_PDLLCR0_DLLFRAG   (1 << 19)
+#define FTPMU010_PDLLCR0_HCLKOUTDIS(cr0)   (((cr0) & 0xf) << 20)
+#define FTPMU010_PDLLCR0_DLLFRAG(cr0)  (1 << 19)
 #define FTPMU010_PDLLCR0_DLLSTSEL  (1 << 18)
 #define FTPMU010_PDLLCR0_DLLSTABLE (1 << 17)
 #define FTPMU010_PDLLCR0_DLLDIS(1 << 16)
-#define FTPMU010_PDLLCR0_PLL1NS(cr0)   (((cr0) >> 3) & 0x1ff)
+#define FTPMU010_PDLLCR0_PLL1FRANG(cr0)(((cr0) & 0x3) << 12)
+#define FTPMU010_PDLLCR0_PLL1NS(cr0)   (((cr0) & 0x1ff) << 3)
 #defi

[U-Boot] [PATCH v2 2/2] ftpmu010.h: add asm support used by lowlevel_init

2011-03-21 Thread Macpaul Lin
Add asm support which is ususally used in lowlevel_init to set
power related parameters to sdram controller and static memory controller.

Signed-off-by: Macpaul Lin 
---
 include/faraday/ftpmu010.h |   62 

 1 files changed, 62 insertions(+), 0 deletions(-)

diff --git a/include/faraday/ftpmu010.h b/include/faraday/ftpmu010.h
index bd40c53..77c29a9 100644
--- a/include/faraday/ftpmu010.h
+++ b/include/faraday/ftpmu010.h
@@ -23,6 +23,7 @@
 #ifndef __FTPMU010_H
 #define __FTPMU010_H

+#ifndef __ASSEMBLY__
 struct ftpmu010 {
unsigned intIDNMBR0;/* 0x00 */
unsigned intreserved0;  /* 0x04 */
@@ -80,6 +81,7 @@ struct ftpmu010 {
unsigned intED0_RACC;   /* 0xD4 */
unsigned intED1_RACC;   /* 0xD8 */
 };
+#endif /* __ASSEMBLY__ */

 /*
  * ID Number 0 Register
@@ -175,8 +177,68 @@ struct ftpmu010 {
 #define FTPMU010_SDRAMHTC_DQM_DCSR (1 << 13)
 #define FTPMU010_SDRAMHTC_SDCLK_DCSR   (1 << 12)

+#ifndef __ASSEMBLY__
 void ftpmu010_32768osc_enable(void);
 void ftpmu010_dlldis_disable(void);
 void ftpmu010_sdram_clk_disable(unsigned int cr0);
+#endif
+
+#ifdef __ASSEMBLY__
+#define FTPMU010_IDNMBR0   0x00
+#define FTPMU010_reserved0 0x04
+#define FTPMU010_OSCC  0x08
+#define FTPMU010_PMODE 0x0C
+#define FTPMU010_PMCR  0x10
+#define FTPMU010_PED   0x14
+#define FTPMU010_PEDSR 0x18
+#define FTPMU010_reserved1 0x1C
+#define FTPMU010_PMSR  0x20
+#define FTPMU010_PGSR  0x24
+#define FTPMU010_MFPSR 0x28
+#define FTPMU010_MISC  0x2C
+#define FTPMU010_PDLLCR0   0x30
+#define FTPMU010_PDLLCR1   0x34
+#define FTPMU010_AHBMCLKOFF0x38
+#define FTPMU010_APBMCLKOFF0x3C
+#define FTPMU010_DCSRCR0   0x40
+#define FTPMU010_DCSRCR1   0x44
+#define FTPMU010_DCSRCR2   0x48
+#define FTPMU010_SDRAMHTC  0x4C
+#define FTPMU010_PSPR0 0x50
+#define FTPMU010_PSPR1 0x54
+#define FTPMU010_PSPR2 0x58
+#define FTPMU010_PSPR3 0x5C
+#define FTPMU010_PSPR4 0x60
+#define FTPMU010_PSPR5 0x64
+#define FTPMU010_PSPR6 0x68
+#define FTPMU010_PSPR7 0x6C
+#define FTPMU010_PSPR8 0x70
+#define FTPMU010_PSPR9 0x74
+#define FTPMU010_PSPR100x78
+#define FTPMU010_PSPR110x7C
+#define FTPMU010_PSPR120x80
+#define FTPMU010_PSPR130x84
+#define FTPMU010_PSPR140x88
+#define FTPMU010_PSPR150x8C
+#define FTPMU010_AHBDMA_RACCS  0x90
+#define FTPMU010_reserved2 0x94
+#define FTPMU010_reserved3 0x98
+#define FTPMU010_JSS   0x9C
+#define FTPMU010_CFC_RACC  0xA0
+#define FTPMU010_SSP1_RACC 0xA4
+#define FTPMU010_UART1TX_RACC  0xA8
+#define FTPMU010_UART1RX_RACC  0xAC
+#define FTPMU010_UART2TX_RACC  0xB0
+#define FTPMU010_UART2RX_RACC  0xB4
+#define FTPMU010_SDC_RACC  0xB8
+#define FTPMU010_I2SAC97_RACC  0xBC
+#define FTPMU010_IRDATX_RACC   0xC0
+#define FTPMU010_reserved4 0xC4
+#define FTPMU010_USBD_RACC 0xC8
+#define FTPMU010_IRDARX_RACC   0xCC
+#define FTPMU010_IRDA_RACC 0xD0
+#define FTPMU010_ED0_RACC  0xD4
+#define FTPMU010_ED1_RACC  0xD8
+#endif /* __ASSEMBLY__ */

 #endif /* __FTPMU010_H */
-- 
1.7.3.5



CONFIDENTIALITY NOTICE:

This e-mail (and its attachments) may contain confidential and legally 
privileged information or information protected from disclosure. If you 
are not the intended recipient, you are hereby notified that any 
disclosure, copying, distribution, or use of the information contained 
herein is strictly prohibited. In this case, please immediately notify the 
sender by return e-mail, delete the message (and any accompanying 
documents) and destroy all printed hard copies. Thank you for your 
cooperation.

Copyright ANDES TECHNOLOGY CORPORATION - All Rights Reserved.

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


[U-Boot] [PATCH v2 2/2] ftpmu010.h: add asm support used by lowlevel_init

2011-03-21 Thread Macpaul Lin
Add asm support which is ususally used in lowlevel_init to set
power related parameters to sdram controller and static memory controller.

Signed-off-by: Macpaul Lin 
---
 include/faraday/ftpmu010.h |   62 

 1 files changed, 62 insertions(+), 0 deletions(-)

diff --git a/include/faraday/ftpmu010.h b/include/faraday/ftpmu010.h
index bd40c53..77c29a9 100644
--- a/include/faraday/ftpmu010.h
+++ b/include/faraday/ftpmu010.h
@@ -23,6 +23,7 @@
 #ifndef __FTPMU010_H
 #define __FTPMU010_H

+#ifndef __ASSEMBLY__
 struct ftpmu010 {
unsigned intIDNMBR0;/* 0x00 */
unsigned intreserved0;  /* 0x04 */
@@ -80,6 +81,7 @@ struct ftpmu010 {
unsigned intED0_RACC;   /* 0xD4 */
unsigned intED1_RACC;   /* 0xD8 */
 };
+#endif /* __ASSEMBLY__ */

 /*
  * ID Number 0 Register
@@ -175,8 +177,68 @@ struct ftpmu010 {
 #define FTPMU010_SDRAMHTC_DQM_DCSR (1 << 13)
 #define FTPMU010_SDRAMHTC_SDCLK_DCSR   (1 << 12)

+#ifndef __ASSEMBLY__
 void ftpmu010_32768osc_enable(void);
 void ftpmu010_dlldis_disable(void);
 void ftpmu010_sdram_clk_disable(unsigned int cr0);
+#endif
+
+#ifdef __ASSEMBLY__
+#define FTPMU010_IDNMBR0   0x00
+#define FTPMU010_reserved0 0x04
+#define FTPMU010_OSCC  0x08
+#define FTPMU010_PMODE 0x0C
+#define FTPMU010_PMCR  0x10
+#define FTPMU010_PED   0x14
+#define FTPMU010_PEDSR 0x18
+#define FTPMU010_reserved1 0x1C
+#define FTPMU010_PMSR  0x20
+#define FTPMU010_PGSR  0x24
+#define FTPMU010_MFPSR 0x28
+#define FTPMU010_MISC  0x2C
+#define FTPMU010_PDLLCR0   0x30
+#define FTPMU010_PDLLCR1   0x34
+#define FTPMU010_AHBMCLKOFF0x38
+#define FTPMU010_APBMCLKOFF0x3C
+#define FTPMU010_DCSRCR0   0x40
+#define FTPMU010_DCSRCR1   0x44
+#define FTPMU010_DCSRCR2   0x48
+#define FTPMU010_SDRAMHTC  0x4C
+#define FTPMU010_PSPR0 0x50
+#define FTPMU010_PSPR1 0x54
+#define FTPMU010_PSPR2 0x58
+#define FTPMU010_PSPR3 0x5C
+#define FTPMU010_PSPR4 0x60
+#define FTPMU010_PSPR5 0x64
+#define FTPMU010_PSPR6 0x68
+#define FTPMU010_PSPR7 0x6C
+#define FTPMU010_PSPR8 0x70
+#define FTPMU010_PSPR9 0x74
+#define FTPMU010_PSPR100x78
+#define FTPMU010_PSPR110x7C
+#define FTPMU010_PSPR120x80
+#define FTPMU010_PSPR130x84
+#define FTPMU010_PSPR140x88
+#define FTPMU010_PSPR150x8C
+#define FTPMU010_AHBDMA_RACCS  0x90
+#define FTPMU010_reserved2 0x94
+#define FTPMU010_reserved3 0x98
+#define FTPMU010_JSS   0x9C
+#define FTPMU010_CFC_RACC  0xA0
+#define FTPMU010_SSP1_RACC 0xA4
+#define FTPMU010_UART1TX_RACC  0xA8
+#define FTPMU010_UART1RX_RACC  0xAC
+#define FTPMU010_UART2TX_RACC  0xB0
+#define FTPMU010_UART2RX_RACC  0xB4
+#define FTPMU010_SDC_RACC  0xB8
+#define FTPMU010_I2SAC97_RACC  0xBC
+#define FTPMU010_IRDATX_RACC   0xC0
+#define FTPMU010_reserved4 0xC4
+#define FTPMU010_USBD_RACC 0xC8
+#define FTPMU010_IRDARX_RACC   0xCC
+#define FTPMU010_IRDA_RACC 0xD0
+#define FTPMU010_ED0_RACC  0xD4
+#define FTPMU010_ED1_RACC  0xD8
+#endif /* __ASSEMBLY__ */

 #endif /* __FTPMU010_H */
-- 
1.7.3.5



CONFIDENTIALITY NOTICE:

This e-mail (and its attachments) may contain confidential and legally 
privileged information or information protected from disclosure. If you 
are not the intended recipient, you are hereby notified that any 
disclosure, copying, distribution, or use of the information contained 
herein is strictly prohibited. In this case, please immediately notify the 
sender by return e-mail, delete the message (and any accompanying 
documents) and destroy all printed hard copies. Thank you for your 
cooperation.

Copyright ANDES TECHNOLOGY CORPORATION - All Rights Reserved.

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


[U-Boot] [PATCH v2 1/2] ftpmu010: fix relocation and enhance features

2011-03-21 Thread Macpaul Lin
1. ftpmu010.h: fix and add definitions
   Enhanced for more features and asm related support
   according to datasheet.

   Note:
- FTPMU010_PDLLCR0_HCLKOUTDIS is "incorrect" in datasheet.
- FTPMU010_PDLLCR0_DLLFRANG is only 1 bit at bit #19. (not 20-19)
- FTPMU010_PDLLCR0_HCLKOUTDIS is 4 bits at bit #20. (not 24-21)

2. ftpmu010.c: enhance features and fix relocation
   - The following functions is added for pmu features.
 ftpmu010_mfpsr_select_dev()
 ftpmu010_sdramhtc_set()
   - This patch also fix the declare statement for relocation.

Signed-off-by: Macpaul Lin 
---
Changes for v2:
   - Fix patch according to the dependent patches of ftpmu010 in 
u-boot-arm.git
 "next" branch.
   - V1 patches of ftpmu010 as "/patch/77704/" marked as "superseded" in
 patchworks.

 drivers/power/ftpmu010.c   |   39 +--
 include/faraday/ftpmu010.h |   38 +++---
 2 files changed, 72 insertions(+), 5 deletions(-)

diff --git a/drivers/power/ftpmu010.c b/drivers/power/ftpmu010.c
index c6a8cda..df99dfa 100644
--- a/drivers/power/ftpmu010.c
+++ b/drivers/power/ftpmu010.c
@@ -25,10 +25,10 @@
 #include 
 #include 

-static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
-
+/* OSCC: OSC Control Register */
 void ftpmu010_32768osc_enable(void)
 {
+   static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
unsigned int oscc;

/* enable the 32768Hz oscillator */
@@ -46,8 +46,31 @@ void ftpmu010_32768osc_enable(void)
writel(oscc, &pmu->OSCC);
 }

+/* MFPSR: Multi-Function Port Setting Register */
+void ftpmu010_mfpsr_select_dev(unsigned int dev)
+{
+   static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
+   unsigned int mfpsr;
+
+   mfpsr = readl(&pmu->MFPSR);
+   mfpsr |= dev;
+   writel(mfpsr, &pmu->MFPSR);
+}
+
+void ftpmu010_mfpsr_diselect_dev(unsigned int dev)
+{
+   static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
+   unsigned int mfpsr;
+
+   mfpsr = readl(&pmu->MFPSR);
+   mfpsr &= ~dev;
+   writel(mfpsr, &pmu->MFPSR);
+}
+
+/* PDLLCR0: PLL/DLL Control Register 0 */
 void ftpmu010_dlldis_disable(void)
 {
+   static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
unsigned int pdllcr0;

pdllcr0 = readl(&pmu->PDLLCR0);
@@ -57,9 +80,21 @@ void ftpmu010_dlldis_disable(void)

 void ftpmu010_sdram_clk_disable(unsigned int cr0)
 {
+   static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
unsigned int pdllcr0;

pdllcr0 = readl(&pmu->PDLLCR0);
pdllcr0 |= FTPMU010_PDLLCR0_HCLKOUTDIS(cr0);
writel(pdllcr0, &pmu->PDLLCR0);
 }
+
+/* SDRAMHTC: SDRAM Signal Hold Time Control */
+void ftpmu010_sdramhtc_set(unsigned int val)
+{
+   static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
+   unsigned int sdramhtc;
+
+   sdramhtc = readl(&pmu->SDRAMHTC);
+   sdramhtc |= val;
+   writel(sdramhtc, &pmu->SDRAMHTC);
+}
diff --git a/include/faraday/ftpmu010.h b/include/faraday/ftpmu010.h
index 640f056..bd40c53 100644
--- a/include/faraday/ftpmu010.h
+++ b/include/faraday/ftpmu010.h
@@ -126,23 +126,55 @@ struct ftpmu010 {
 /*
  * Multi-Function Port Setting Register
  */
+#define FTPMU010_MFPSR_DEBUGSEL(1 << 17)
+#define FTPMU010_MFPSR_DMA0PINSEL  (1 << 16)
+#define FTPMU010_MFPSR_DMA1PINSEL  (1 << 15)
 #define FTPMU010_MFPSR_MODEMPINSEL (1 << 14)
 #define FTPMU010_MFPSR_AC97CLKOUTSEL   (1 << 13)
+#define FTPMU010_MFPSR_PWM1PINSEL  (1 << 11)
+#define FTPMU010_MFPSR_PWM0PINSEL  (1 << 10)
+#define FTPMU010_MFPSR_IRDACLKSEL  (1 << 9)
+#define FTPMU010_MFPSR_UARTCLKSEL  (1 << 8)
+#define FTPMU010_MFPSR_SSPCLKSEL   (1 << 6)
+#define FTPMU010_MFPSR_I2SCLKSEL   (1 << 5)
+#define FTPMU010_MFPSR_AC97CLKSEL  (1 << 4)
 #define FTPMU010_MFPSR_AC97PINSEL  (1 << 3)
+#define FTPMU010_MFPSR_TRIAHBDIS   (1 << 1)
+#define FTPMU010_MFPSR_TRIAHBDBG   (1 << 0)

 /*
  * PLL/DLL Control Register 0
+ * Note:
+ *  1. FTPMU010_PDLLCR0_HCLKOUTDIS:
+ * Datasheet indicated it starts at bit #21 which was wrong.
+ *  2. FTPMU010_PDLLCR0_DLLFRAG:
+ * Datasheet indicated it has 2 bit which was wrong.
  */
-#define FTPMU010_PDLLCR0_HCLKOUTDIS(cr0)   (((cr0) >> 20) & 0xf)
-#define FTPMU010_PDLLCR0_DLLFRAG   (1 << 19)
+#define FTPMU010_PDLLCR0_HCLKOUTDIS(cr0)   (((cr0) & 0xf) << 20)
+#define FTPMU010_PDLLCR0_DLLFRAG(cr0)  (1 << 19)
 #define FTPMU010_PDLLCR0_DLLSTSEL  (1 << 18)
 #define FTPMU010_PDLLCR0_DLLSTABLE (1 << 17)
 #define FTPMU010_PDLLCR0_DLLDIS(1 << 16)
-#define FTPMU010_PDLLCR0_PLL1NS(cr0)   (((cr0) >> 3) & 0x1ff)
+#define FTPMU010_PDLLCR0_PLL1FRANG(cr0)(((cr0) & 0x3) << 12)
+#define FTPMU010_PDLLCR0_PLL1NS(cr0)   (((cr0) & 0x1ff) << 3)
 #defi

[U-Boot] [PATCH] ARMV7: S5PC210: Fixed register offset in mmc.h

2011-03-21 Thread Chander Kashyap
MMC controller "control4" register offset set to
0x8C as per data sheet.
Added missed out reserved field.
Updated padding field size.

Signed-off-by: Chander Kashyap 
Signed-off-by: Tushar Behera 
---
 arch/arm/include/asm/arch-s5pc2xx/mmc.h |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/arch-s5pc2xx/mmc.h 
b/arch/arm/include/asm/arch-s5pc2xx/mmc.h
index 528150d..04827ca 100644
--- a/arch/arm/include/asm/arch-s5pc2xx/mmc.h
+++ b/arch/arm/include/asm/arch-s5pc2xx/mmc.h
@@ -53,10 +53,11 @@ struct s5p_mmc {
unsigned char   res3[0x34];
unsigned intcontrol2;
unsigned intcontrol3;
+   unsigned char   res4[4];
unsigned intcontrol4;
-   unsigned char   res4[0x6e];
+   unsigned char   res5[0x6e];
unsigned short  hcver;
-   unsigned char   res5[0xFF02];
+   unsigned char   res6[0xFF00];
 };
 
 struct mmc_host {
-- 
1.7.1

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


Re: [U-Boot] [PATCH 00/22] U-Boot MMC SPL for OMAP4

2011-03-21 Thread Aneesh V
Hi,

Are there anymore comments on this series?

On Monday 28 February 2011 05:16 PM, Aneesh V wrote:
> This series adds mmc SPL support for OMAP4. This is essentially
> an up-streaming effort for TI's x-loader for OMAP4 using the SPL
> framework
>
> This work partly draws upon previous work done for x-loader by:
>   Santosh Shilimkar
>   Rajendra Nayak
> and many others
>
> Features supported:
> * Clock init - DPLL locking, clock domains/modules enabling
> * SDRAM/DMM initialization
> * Mux initialization
> * MMC raw read support
> * MMC FAT read support
>
> Improvments over x-loader:
> * Code completely revamped
> * DPLL programming that works for all SYS_CLK frequencies
> * Automatic SDRAM identification and initialization
> * Board dependent parts(especially mux) deferred to u-boot. So, same
>SPL will work for Panda and SDP and most likely on any other board
>that comes along
> * Determination of u-boot size to avoid reading extra content while
>loading U-Boot
> * Modular apporach to enable future addition of support for all OMAP3/4
>platforms
>
> Aneesh V (21):
>omap: add miscellaneous utility macros for bit-field operations
>omap4: add OMAP4430 revision check
>armv7: start.S: provide a hook for saving boot params
>omap4: save parameters passed by ROM code to SPL
>arm: new labels in the linker script file
>Add generic spl infrastructure
>armv7: start.S: add SPL support
>omap: add spl support
>omap4: add spl support for OMAP4 SDP
>omap4: add serial console support to SPL
>omap4: utility function to identify the context of hw init
>omap4: separate mux settings into essential and non essential parts
>omap4: correct mux data for sdp4430
>omap4: add clock support
>omap4: add sdram init support
>omap4: calculate EMIF register values
>omap4: automatic sdram detection
>armv7: embed u-boot size within u-boot for use from SPL
>omap: add MMC support to SPL
>omap: spl: add FAT support over MMC
>omap4: add spl support for OMAP4 Panda
>
> John Rigby (1):
>mkimage: Add OMAP boot image support
>
>   Makefile   |   11 +
>   arch/arm/cpu/armv7/cpu.c   |7 +
>   arch/arm/cpu/armv7/omap-common/Makefile|1 +
>   .../{omap4/lowlevel_init.S =>  omap-common/utils.c} |   58 +-
>   arch/arm/cpu/armv7/omap4/Makefile  |3 +
>   arch/arm/cpu/armv7/omap4/board.c   |  117 ++-
>   arch/arm/cpu/armv7/omap4/clocks.c  |  717 +++
>   arch/arm/cpu/armv7/omap4/emif.c| 1303 
> 
>   arch/arm/cpu/armv7/omap4/lowlevel_init.S   |   31 +
>   arch/arm/cpu/armv7/omap4/omap4_mux_data.h  |   76 ++
>   arch/arm/cpu/armv7/omap4/sdram_elpida.c|  267 
>   arch/arm/cpu/armv7/start.S |   50 +-
>   arch/arm/cpu/armv7/u-boot.lds  |4 +
>   arch/arm/include/asm/arch-omap4/clocks.h   |  504 
>   arch/arm/include/asm/arch-omap4/emif.h | 1021 +++
>   arch/arm/include/asm/arch-omap4/omap4.h|   50 +-
>   arch/arm/include/asm/arch-omap4/sys_proto.h|   60 +-
>   .../omap4/lowlevel_init.S =>  include/asm/armv7.h}  |   32 +-
>   arch/arm/include/asm/global_data.h |5 +
>   arch/arm/include/asm/omap_common.h |  106 ++
>   board/ti/panda/panda.c |   25 +-
>   board/ti/{sdp4430/sdp.h =>  panda/panda_mux_data.h} |   76 +-
>   board/ti/sdp4430/config.mk |3 +-
>   board/ti/sdp4430/sdp.c |   25 +-
>   .../{panda/panda.h =>  sdp4430/sdp4430_mux_data.h}  |  128 +--
>   common/image.c |1 +
>   include/configs/omap4_panda.h  |   24 +
>   include/configs/omap4_sdp4430.h|   24 +
>   include/image.h|1 +
>   spl/board/ti/panda/Makefile|  219 
>   spl/board/ti/sdp4430/Makefile  |  219 
>   spl/board/ti/spl-omap.c|  189 +++
>   .../armv7/u-boot.lds =>  spl/board/ti/spl-omap.lds  |   70 +-
>   tools/Makefile |2 +
>   tools/mkimage.c|2 +
>   tools/mkimage.h|1 +
>   tools/omapimage.c  |  229 
>   .../omap4/lowlevel_init.S =>  tools/omapimage.h |   49 +-
>   38 files changed, 5390 insertions(+), 320 deletions(-)
>   copy arch/arm/cpu/armv7/{omap4/lowlevel_init.S =>  omap-common/utils.c} 
> (50%)
>   create mode 100644 arch/arm/cpu/armv7/omap4/clocks.c
>   create mode 100644 arch/arm/cpu/armv7/omap4/emif.c
>   create mode 100644 arch/arm/cpu/armv7/omap4/omap4_mux_data.h
>   create mode 100644 a

[U-Boot] [PATCH v3 06/23] mpc832x: add support for the mpc8321 based suvd3 board

2011-03-21 Thread Heiko Schocher
- serial console on UART1
- Ethernet RMII over UCC4
- PHY SMSC LAN8700
- 64MB Flash
- 128 MB DDR2 RAM
- I2C
- bootcount

This board is similiar to the kmeter1 (8360) board,
so common config options are extracted into the
include/configs/km83xx-common.h file.

Signed-off-by: Heiko Schocher 
cc: Kim Phillips 
cc: Holger Brunck 
cc: Valentin Longchamp 
---
Changes for v2:
  - fix checkpatch.pl errors and warnings
Changes for v3:
  - rebased only

 MAINTAINERS|1 +
 arch/powerpc/cpu/mpc83xx/fdt.c |3 +-
 arch/powerpc/lib/bootcount.c   |2 +-
 board/keymile/common/common.c  |   10 +-
 board/keymile/{kmeter1 => km83xx}/Makefile |0
 .../keymile/{kmeter1/kmeter1.c => km83xx/km83xx.c} |   94 +-
 boards.cfg |3 +-
 include/configs/km83xx-common.h|  324 +++
 include/configs/kmeter1.h  |  333 +---
 include/configs/suvd3.h|  215 +
 10 files changed, 642 insertions(+), 343 deletions(-)
 rename board/keymile/{kmeter1 => km83xx}/Makefile (100%)
 rename board/keymile/{kmeter1/kmeter1.c => km83xx/km83xx.c} (67%)
 create mode 100644 include/configs/km83xx-common.h
 create mode 100644 include/configs/suvd3.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 4756f14..75b7343 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -433,6 +433,7 @@ Heiko Schocher 
municse MPC5200
sc3 PPC405GP
suen3   ARM926EJS (Kirkwood SoC)
+   suvd3   MPC8321
uc101   MPC5200
ve8313  MPC8313
 
diff --git a/arch/powerpc/cpu/mpc83xx/fdt.c b/arch/powerpc/cpu/mpc83xx/fdt.c
index daf73a6..fe40214 100644
--- a/arch/powerpc/cpu/mpc83xx/fdt.c
+++ b/arch/powerpc/cpu/mpc83xx/fdt.c
@@ -32,7 +32,8 @@ extern void ft_qe_setup(void *blob);
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_BOOTCOUNT_LIMIT) && defined(CONFIG_MPC8360)
+#if defined(CONFIG_BOOTCOUNT_LIMIT) && \
+   (defined(CONFIG_MPC832x) || defined(CONFIG_MPC8360))
 #include 
 
 void fdt_fixup_muram (void *blob)
diff --git a/arch/powerpc/lib/bootcount.c b/arch/powerpc/lib/bootcount.c
index 07ef28d..ff8d89c 100644
--- a/arch/powerpc/lib/bootcount.c
+++ b/arch/powerpc/lib/bootcount.c
@@ -51,7 +51,7 @@
 #define CONFIG_SYS_BOOTCOUNT_ADDR  (CONFIG_SYS_IMMR + CPM_BOOTCOUNT_ADDR)
 #endif /* defined(CONFIG_MPC8260) */
 
-#if defined(CONFIG_MPC8360)
+#if defined(CONFIG_MPC832x) || defined(CONFIG_MPC8360)
 #include 
 
 #define CONFIG_SYS_BOOTCOUNT_ADDR  (CONFIG_SYS_IMMR + 0x11 + \
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index ea32028..85538d0 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
@@ -402,7 +403,7 @@ static void setports(int gpio)
 #endif
 #endif
 
-#if !defined(CONFIG_KMETER1)
+#if !defined(CONFIG_MPC83xx)
 static void writeStartSeq(void)
 {
set_sda(1);
@@ -461,7 +462,7 @@ static int i2c_make_abort(void)
  */
 void i2c_init_board(void)
 {
-#if defined(CONFIG_KMETER1)
+#if defined(CONFIG_MPC83xx)
struct fsl_i2c *dev;
dev = (struct fsl_i2c *) (CONFIG_SYS_IMMR + CONFIG_SYS_I2C_OFFSET);
uchar   dummy;
@@ -573,6 +574,7 @@ int board_eth_init(bd_t *bis)
(void)keymile_hdlc_enet_initialize(bis);
 #endif
if (ethernet_present())
-   return -1;
-   return 0;
+   return cpu_eth_init(bis);
+
+   return -1;
 }
diff --git a/board/keymile/kmeter1/Makefile b/board/keymile/km83xx/Makefile
similarity index 100%
rename from board/keymile/kmeter1/Makefile
rename to board/keymile/km83xx/Makefile
diff --git a/board/keymile/kmeter1/kmeter1.c b/board/keymile/km83xx/km83xx.c
similarity index 67%
rename from board/keymile/kmeter1/kmeter1.c
rename to board/keymile/km83xx/km83xx.c
index bfc9174..0911950 100644
--- a/board/keymile/kmeter1/kmeter1.c
+++ b/board/keymile/km83xx/km83xx.c
@@ -8,7 +8,7 @@
  * Copyright (C) 2007 MontaVista Software, Inc.
  *Anton Vorontsov 
  *
- * (C) Copyright 2008
+ * (C) Copyright 2008 - 2010
  * Heiko Schocher, DENX Software Engineering, h...@denx.de.
  *
  * This program is free software; you can redistribute it and/or
@@ -32,7 +32,7 @@
 
 const qe_iop_conf_t qe_iop_conf_tab[] = {
/* port pin dir open_drain assign */
-
+#if defined(CONFIG_KMETER1)
/* MDIO */
{0,  1, 3, 0, 2}, /* MDIO */
{0,  2, 1, 0, 1}, /* MDC */
@@ -55,6 +55,40 @@ const qe_iop_conf_t qe_iop_conf_tab[] = {
{5,  2, 1, 0, 1}, /* UART2_RTS */
{5,  3, 2, 0, 2}, /* UART2_SIN */
{5,  1, 2, 0, 3}, /* UART2_CTS */
+#else
+   /* Local Bus */
+   {0, 16, 1, 0, 3}, /* LA00 */
+   {0, 17, 1, 0, 3

[U-Boot] [PATCH v3 16/23] ppc, 8321: cleanup tuxa1, tuda1 and suvd3 support

2011-03-21 Thread Heiko Schocher
For the kmsupx5 a new header file was introduced km8321-common.h.
Now the common stuff from tuxa1, tuda1 and suvd3 was removed and
the new header file included.

The defines CONFIG_SYS_PIGGY_BASE and CONFIG_SYS_PIGGY_SIZE are
confusing. Because they actually describe the KMBEC FPGA values.
The KMBEC FPGA can be PRIO on kmeter1 or upio on mgcoge. Therefore
all the defines were renamed.

remove unneeded variable CONFIG_KM_DEF_NETDEV, as it is
already declared in keymile-common.h

Signed-off-by: Holger Brunck 
Signed-off-by: Heiko Schocher 
cc: Kim Phillips 
cc: Wolfgang Denk 
cc: Valentin Longchamp 
---
Changes for v2:
  - fix checkpatch.pl errors and warnings
Changes for v3:
  - rebased only

 board/keymile/common/common.c|3 +-
 board/keymile/km83xx/km83xx.c|3 +-
 board/keymile/mgcoge/mgcoge.c|3 +-
 include/configs/keymile-common.h |2 +-
 include/configs/km82xx-common.h  |   12 ++--
 include/configs/km8321-common.h  |7 +--
 include/configs/km83xx-common.h  |   19 +++---
 include/configs/kmeter1.h|8 ++-
 include/configs/suvd3.h  |  115 +-
 include/configs/tuda1.h  |  112 +
 include/configs/tuxa1.h  |  114 +-
 11 files changed, 36 insertions(+), 362 deletions(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 8564b9c..2d0aee9 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -562,7 +562,8 @@ int fdt_get_node_and_value(void *blob,
 #if !defined(MACH_TYPE_KM_KIRKWOOD)
 int ethernet_present(void)
 {
-   struct km_bec_fpga *base = (struct km_bec_fpga *)CONFIG_SYS_PIGGY_BASE;
+   struct km_bec_fpga *base =
+   (struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE;
 
return in_8(&base->bprth) & PIGGY_PRESENT;
 }
diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c
index 0911950..d940a1e 100644
--- a/board/keymile/km83xx/km83xx.c
+++ b/board/keymile/km83xx/km83xx.c
@@ -134,7 +134,8 @@ const uint upma_table[] = {
 
 int board_early_init_r(void)
 {
-   struct km_bec_fpga *base = (struct km_bec_fpga *)CONFIG_SYS_PIGGY_BASE;
+   struct km_bec_fpga *base =
+   (struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE;
 #if defined(CONFIG_SUVD3)
immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
fsl_lbc_t *lbc = &immap->im_lbc;
diff --git a/board/keymile/mgcoge/mgcoge.c b/board/keymile/mgcoge/mgcoge.c
index e32ff98..a58256e 100644
--- a/board/keymile/mgcoge/mgcoge.c
+++ b/board/keymile/mgcoge/mgcoge.c
@@ -300,7 +300,8 @@ int checkboard(void)
  */
 int board_early_init_r(void)
 {
-   struct km_bec_fpga *base = (struct km_bec_fpga *)CONFIG_SYS_PIGGY_BASE;
+   struct km_bec_fpga *base =
+   (struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE;
 
/* setup the UPIOx */
/* General Unit Reset disabled, Flash Bank enabled, UnitLed on */
diff --git a/include/configs/keymile-common.h b/include/configs/keymile-common.h
index e952a19..77e2090 100644
--- a/include/configs/keymile-common.h
+++ b/include/configs/keymile-common.h
@@ -102,7 +102,7 @@
  * driver to set the MAC.
 */
 #define CONFIG_CHECK_ETHERNET_PRESENT
-#define CONFIG_SYS_SLOT_ID_BASECONFIG_SYS_PIGGY_BASE
+#define CONFIG_SYS_SLOT_ID_BASECONFIG_SYS_KMBEC_FPGA_BASE
 #define CONFIG_SYS_SLOT_ID_OFF (0x07)  /* register offset */
 #define CONFIG_SYS_SLOT_ID_MASK(0x3f)  /* mask for slot ID 
bits */
 
diff --git a/include/configs/km82xx-common.h b/include/configs/km82xx-common.h
index f0a5893..345212c 100644
--- a/include/configs/km82xx-common.h
+++ b/include/configs/km82xx-common.h
@@ -287,20 +287,20 @@
 PSDMR_CL_2)
 
 /*
- * GPIO/PIGGY on CS3 initialization values
+ * UPIO FPGA (GPIO/PIGGY) on CS3 initialization values
  */
-#define CONFIG_SYS_PIGGY_BASE  0x3000
-#define CONFIG_SYS_PIGGY_SIZE  128
+#define CONFIG_SYS_KMBEC_FPGA_BASE 0x3000
+#define CONFIG_SYS_KMBEC_FPGA_SIZE 128
 
-#define CONFIG_SYS_BR3_PRELIM  ((CONFIG_SYS_PIGGY_BASE & BRx_BA_MSK) |\
+#define CONFIG_SYS_BR3_PRELIM  ((CONFIG_SYS_KMBEC_FPGA_BASE & BRx_BA_MSK) |\
 BRx_PS_8 | BRx_MS_GPCM_P | BRx_V)
 
-#define CONFIG_SYS_OR3_PRELIM  (MEG_TO_AM(CONFIG_SYS_PIGGY_SIZE) |\
+#define CONFIG_SYS_OR3_PRELIM  (MEG_TO_AM(CONFIG_SYS_KMBEC_FPGA_SIZE) |\
 ORxG_CSNT | ORxG_ACS_DIV2 |\
 ORxG_SCY_3_CLK | ORxG_TRLX)
 
 /*
- * Board FPGA on CS4 initialization values
+ * BFTICU board FPGA on CS4 initialization values
  */
 #define CONFIG_SYS_FPGA_BASE   0x4000
 #define CONFIG_SYS_FPGA_SIZE   1 /*1KB*/
diff --git a/include/configs/km8321-common.h b/include/configs/km8321-common.h
index 9e48388..9458289 100644
--- a/include/configs/km8321-common.h
+++ b/include/configs/km8321-common.h
@@ -33,9 +33,6 @@
 #define CONFIG_MPC832x /* MP

[U-Boot] [PATCH v3 15/23] km_arm: change some register values for SDRAM initialization

2011-03-21 Thread Heiko Schocher
These new values were given by Clive Stubbings from Xentech.
According to him they should be used on all bobcat designs.

The changes are the following:
- enables UART0 and UART1 pins in MPP
- define some L2 cache settings
- changes a SDRAM timing to better fit the hardware
- removed three writes that were the same as the reset values

Signed-off-by: Valentin Longchamp 
Signed-off-by: Heiko Schocher 
cc: Holger Brunck 
cc: Prafulla Wadaskar 
---
Changes for v2:
  - nothing
Changes for v3:
  - nothing

 board/keymile/km_arm/kwbimage.cfg |   32 ++--
 1 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/board/keymile/km_arm/kwbimage.cfg 
b/board/keymile/km_arm/kwbimage.cfg
index 26d6aa0..b2f5193 100644
--- a/board/keymile/km_arm/kwbimage.cfg
+++ b/board/keymile/km_arm/kwbimage.cfg
@@ -27,16 +27,18 @@
 # Boot Media configurations
 BOOT_FROM  spi # Boot from SPI flash
 
-DATA 0xFFD1 0x0111 # MPP Control 0 Register
-# bit 3-0:   MPPSel0   1, NF_IO[2]
-# bit 7-4:   MPPSel1   1, NF_IO[3]
-# bit 12-8:  MPPSel2   1, NF_IO[4]
-# bit 15-12: MPPSel3   1, NF_IO[5]
+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]
@@ -48,8 +50,8 @@ DATA 0xFFD10008 0x1100# MPP Control 2 Register
 # bit 31-28: MPPSel23  0, GPIO[23]
 
 DATA 0xFFD100E0 0x1B1B1B1B # IO Configuration 0 Register
-DATA 0xFFD20134 0x # L2 RAM Timing 0 Register
-DATA 0xFFD20138 0x00BB # L2 RAM Timing 1 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
@@ -63,7 +65,7 @@ DATA 0xFFD01400 0x43000400# SDRAM Configuration Register
 # bit29-26: zero
 # bit31-30: 01
 
-DATA 0xFFD01404 0x36343000 # DDR Controller Control Low
+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
@@ -75,7 +77,7 @@ DATA 0xFFD01404 0x36343000# DDR Controller Control Low
 # bit30-28: 3 required
 # bit31:0=no additional STARTBURST delay
 
-DATA 0xFFD01408 0x2302544B # DDR Timing (Low) (active cycles value +1)
+DATA 0xFFD01408 0x34136552 # DDR Timing (Low) (active cycles value +1)
 # bit3-0:   TRAS lsbs
 # bit7-4:   TRCD
 # bit11- 8: TRP
@@ -86,7 +88,7 @@ DATA 0xFFD01408 0x2302544B# DDR Timing (Low) (active 
cycles value +1)
 # bit27-24: TRRD
 # bit31-28: TRTP
 
-DATA 0xFFD0140C 0x0032 #  DDR Timing (High)
+DATA 0xFFD0140C 0x0033 #  DDR Timing (High)
 # bit6-0:   TRFC
 # bit8-7:   TR2R
 # bit10-9:  TR2W
@@ -116,8 +118,8 @@ DATA 0xFFD01418 0x  #  DDR Operation
 # bit3-0:   0x0, DDR cmd
 # bit31-4:  0 required
 
-DATA 0xFFD0141C 0x0642 #  DDR Mode
-DATA 0xFFD01420 0x0040 #  DDR Extended Mode
+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
@@ -140,6 +142,8 @@ DATA 0xFFD01424 0xF07F  #  DDR Controller Control High
 # bit11 :  0  , 1/4 clock cycle skew disabled for write mesh
 # bit15-12:  required
 # bit31-16: 0required
+DATA 0xFFD01428 0x00074510
+DATA 0xFFD0147c 0x7451
 
 DATA 0xFFD01500 0x # CS[0]n Base address to 0x0
 DATA 0xFFD01504 0x07F1 # CS[0]n Size
@@ -153,7 +157,7 @@ DATA 0xFFD0150C 0x  # CS[1]n Size, window disabled
 DATA 0xFFD01514 0x # CS[2]n Size, window disabled
 DATA 0xFFD0151C 0x # CS[3]n Size, window disabled
 
-DATA 0xFFD01494 0x #  DDR ODT Control (Low)
+DATA 0xFFD01494 0x00010001 #  DDR ODT Control (Low)
 # bit3-0:  0, ODT0Rd, MODT[0] asserted during read from DRAM CS0
 # bit19-16:0, ODT0Wr, MODT[0] asserted during write to DRAM CS0
 
@@ -162,7 +166,7 @@ DATA 0xFFD01498 0x  #  DDR ODT Control (High)
 # bit3-2:  00, ODT1 controlled by register
 # bit31-4: zero, required
 
-DATA 0xFFD0149C 0xE90F # CPU ODT Control
+DATA 0xFFD0149C 0xFC11 # CPU ODT Control
 # bit3-0:  F, ODT0Rd, Internal ODT asserted during read from DRAM bank0
 # bit7-4:  0, ODT0Wr, Internal ODT asserted during write to DRAM bank0
 # bit9-8:  1, ODTEn, never active
-- 
1.7.4

__

[U-Boot] [PATCH v3 17/23] keymile, common; fix i2c deblocking support

2011-03-21 Thread Heiko Schocher
This patch fix the i2c deblocking facility with the i2c HW-Controller.
The required delays for byte reading, the enhanced criteria for stop
the dummy read and required 5 start/stop sequences are added.

Add i2c deblocking before ivm eeprom read.

Improve i2c deblocking sequence by respecting stop hold time.

Cleaned function for deblocking. Have now one function i2c_make_abort()
available for bitbang, mpc82xx and mpc83xx harware controller.

Signed-off-by: Stefan Bigler 
Signed-off-by: Holger Brunck 
Signed-off-by: Heiko Schocher 
cc: Valentin Longchamp 
---
Changes for v2:
  - fix checkpatch.pl errors and warnings
Changes for v3:
  - rebased only

 board/keymile/common/common.c |  121 ++---
 1 files changed, 89 insertions(+), 32 deletions(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 2d0aee9..6600e08 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -40,6 +40,9 @@
 #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
 #include 
 
+static void i2c_write_start_seq(void);
+static int i2c_make_abort(void);
+
 int ivm_calc_crc(unsigned char *buf, int len)
 {
const unsigned short crc_tab[16] = {
@@ -329,8 +332,11 @@ int ivm_read_eeprom(void)
if (buf != NULL)
dev_addr = simple_strtoul((char *)buf, NULL, 16);
 
+   /* add deblocking here */
+   i2c_make_abort();
+
ret = i2c_read(dev_addr, 0, 1, i2c_buffer,
-   CONFIG_SYS_IVM_EEPROM_MAX_LEN);
+   CONFIG_SYS_IVM_EEPROM_MAX_LEN);
if (ret != 0) {
printf ("Error reading EEprom\n");
return -2;
@@ -340,7 +346,7 @@ int ivm_read_eeprom(void)
 }
 
 #if defined(CONFIG_SYS_I2C_INIT_BOARD)
-#define DELAY_ABORT_SEQ62
+#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)
@@ -404,7 +410,7 @@ static void setports(int gpio)
 #endif
 
 #if !defined(CONFIG_MPC83xx)
-static void writeStartSeq(void)
+static void i2c_write_start_seq(void)
 {
set_sda(1);
udelay(DELAY_HALF_PERIOD);
@@ -426,6 +432,21 @@ static void writeStartSeq(void)
  */
 static int i2c_make_abort(void)
 {
+
+#if defined(CONFIG_HARD_I2C) && !defined(MACH_TYPE_KM_KIRKWOOD)
+   immap_t *immap = (immap_t *)CONFIG_SYS_IMMR ;
+   i2c8260_t *i2c  = (i2c8260_t *)&immap->im_i2c;
+
+   /*
+* disable I2C controller first, otherwhise it thinks we want to
+* talk to the slave port...
+*/
+   clrbits_8(&i2c->i2c_i2mod, 0x01);
+
+   /* Set the PortPins to GPIO */
+   setports(1);
+#endif
+
int scl_state = 0;
int sda_state = 0;
int i = 0;
@@ -449,57 +470,93 @@ static int i2c_make_abort(void)
}
if (ret == 0)
for (i = 0; i < 5; i++)
-   writeStartSeq();
+   i2c_write_start_seq();
 
+   /* respect stop setup time */
+   udelay(DELAY_ABORT_SEQ);
+   set_scl(1);
+   udelay(DELAY_ABORT_SEQ);
+   set_sda(1);
get_sda();
+
+#if defined(CONFIG_HARD_I2C)
+   /* Set the PortPins back to use for I2C */
+   setports(0);
+#endif
return ret;
 }
 #endif
 
-/*
- * i2c_init_board - reset i2c bus. When the board is powercycled during a
- * bus transfer it might hang; for details see doc/I2C_Edge_Conditions.
- */
-void i2c_init_board(void)
-{
 #if defined(CONFIG_MPC83xx)
+static void i2c_write_start_seq(void)
+{
+   struct fsl_i2c *dev;
+   dev = (struct fsl_i2c *) (CONFIG_SYS_IMMR + CONFIG_SYS_I2C_OFFSET);
+   udelay(DELAY_ABORT_SEQ);
+   out_8(&dev->cr, (I2C_CR_MEN | I2C_CR_MSTA));
+   udelay(DELAY_ABORT_SEQ);
+   out_8(&dev->cr, (I2C_CR_MEN));
+}
+
+static int i2c_make_abort(void)
+{
struct fsl_i2c *dev;
dev = (struct fsl_i2c *) (CONFIG_SYS_IMMR + CONFIG_SYS_I2C_OFFSET);
uchar   dummy;
+   uchar   last;
+   int nbr_read = 0;
+   int i = 0;
+   int ret = 0;
 
+   /* wait after each operation to finsh with a delay */
out_8(&dev->cr, (I2C_CR_MSTA));
+   udelay(DELAY_ABORT_SEQ);
out_8(&dev->cr, (I2C_CR_MEN | I2C_CR_MSTA));
+   udelay(DELAY_ABORT_SEQ);
dummy = in_8(&dev->dr);
-   dummy = in_8(&dev->dr);
-   if (dummy != 0xff) {
-   dummy = in_8(&dev->dr);
-   }
-   out_8(&dev->cr, (I2C_CR_MEN));
-   out_8(&dev->cr, 0x00);
-   out_8(&dev->cr, (I2C_CR_MEN));
-#else
-#if defined(CONFIG_HARD_I2C) && !defined(MACH_TYPE_KM_KIRKWOOD)
-   immap_t *immap = (immap_t *)CONFIG_SYS_IMMR ;
-   i2c8260_t *i2c  = (i2c8260_t *)&immap->im_i2c;
+   udelay(DELAY_ABORT_SEQ);
+   last = in_8(&dev->dr);
+   nbr_read++;
 
/*
-* disable I2C controller first, otherwhise it thinks we wa

[U-Boot] [PATCH v3 13/23] powerpc, 83xx: add kmsupx5 board support

2011-03-21 Thread Heiko Schocher
The Keymile SUPx5 board series is based on a PBEC8321 but
contains an additional PBUS FPGA (LPXF) on local bus CS2.

Signed-off-by: Thomas Reufer 
Signed-off-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Kim Phillips 
cc: Valentin Longchamp 
cc: Holger Brunck 
---
Changes for v2:
  - fix checkpatch.pl errors and warnings
Changes for v3:
  - rebased only

 MAINTAINERS   |1 +
 boards.cfg|1 +
 include/configs/kmsupx5.h |   91 +
 3 files changed, 93 insertions(+), 0 deletions(-)
 create mode 100644 include/configs/kmsupx5.h

diff --git a/MAINTAINERS b/MAINTAINERS
index e4525e4..730e306 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -427,6 +427,7 @@ Heiko Schocher 
ids8247 MPC8247
jupiter MPC5200
kmeter1 MPC8360
+   kmsupx5 MPC8321
mgcoge  MPC8247
mgcoge2ne   MPC8247
mgcoge2un   ARM926EJS (Kirkwood SoC)
diff --git a/boards.cfg b/boards.cfg
index 3c45456..d1ec52e 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -477,6 +477,7 @@ kmeter1  powerpc mpc83xx km83xx 
 keymile
 MVBLM7   powerpc mpc83xx mvblm7  
matrix_vision
 SIMPC8313_LP powerpc mpc83xx simpc8313   
sheldon-   SIMPC8313:NAND_LP
 SIMPC8313_SP powerpc mpc83xx simpc8313   
sheldon-   SIMPC8313:NAND_SP
+kmsupx5  powerpc mpc83xx km83xx  
keymile
 suvd3powerpc mpc83xx km83xx  
keymile
 TQM834x  powerpc mpc83xx tqm834x tqc
 tuda1powerpc mpc83xx km83xx  
keymile
diff --git a/include/configs/kmsupx5.h b/include/configs/kmsupx5.h
new file mode 100644
index 000..28cc41a
--- /dev/null
+++ b/include/configs/kmsupx5.h
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2006 Freescale Semiconductor, Inc.
+ *Dave Liu 
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *Peter Barada 
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *Anton Vorontsov 
+ *
+ * (C) Copyright 2008
+ * Heiko Schocher, DENX Software Engineering, h...@denx.de.
+ *
+ * (C) Copyright 2010
+ * Lukas Roggli, KEYMILE Ltd, lukas.rog...@keymile.com
+ *
+ * (C) Copyright 2010-2011
+ * Thomas Reufer, KEYMILE Ltd, thomas.reu...@keymile.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_KMSUPX5 1 /* Keymile PBEC8321 board specific */
+#define CONFIG_HOSTNAMEsupx5
+#define CONFIG_KM_BOARD_NAME   "supx5"
+
+#defineCONFIG_SYS_TEXT_BASE0xF000
+
+/* include common defines/options for all 8321 Keymile boards */
+#include "km8321-common.h"
+
+/*
+ * Init Local Bus Memory Controller:
+ *
+ * Bank Bus Machine PortSz  Size  Device
+ *  --- --- --  -  --
+ *  2   Local   GPCM8 bit  256MB   LPXF
+ *  3   Local   not used
+ *
+ */
+
+/*
+ * LPXF on the local bus CS2
+ * Window base at flash base
+ * Window size: 256 MB
+ */
+
+#defineCONFIG_SYS_LPXF_BASE0xA000/* LPXF */
+#defineCONFIG_SYS_LPXF_SIZE256 /* Megabytes */
+
+#define CONFIG_SYS_LBLAWBAR2_PRELIMCONFIG_SYS_LPXF_BASE
+#define CONFIG_SYS_LBLAWAR2_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR2_PRELIM   (CONFIG_SYS_LPXF_BASE | \
+   BR_PS_8 | \
+   BR_MS_GPCM | \
+   BR_V)
+
+#define CONFIG_SYS_OR2_PRELIM  (MEG_TO_AM(CONFIG_SYS_LPXF_SIZE) | \
+   OR_GPCM_CSNT | \
+   OR_GPCM_ACS_DIV4 | \
+   OR_GPCM_SCY_2 | \
+   (OR_GPCM_TRLX & \
+   (~OR_GPCM_EHTR)) |  /* EHTR = 0 */ \
+   OR_GPCM_EAD)
+
+/* LPXF:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT5L  (CONFIG_SYS_LPXF_BASE | BATL_PP_10 | \
+   BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT5U  (CONFIG_SYS_LPXF_BASE | BATU_BL_256M | \
+   BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT5L  (CONFIG_SYS_LPXF_BASE | BATL_PP_10 | \
+   BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT5U  CONFIG_SYS_IBAT5U
+
+/* Bank 3 not used */
+#define CONFIG_SYS_IBAT6L   (0)
+#define CONFIG_SYS_IBA

[U-Boot] [PATCH v3 07/23] mpc832x: add support for mpc8321 based tuxa1 board

2011-03-21 Thread Heiko Schocher
This board is similar to suvd3 board. So most initialisation topics
are taken from suvd3 (UART1, Ethernet, piggy PHY, flash, ram) only the
application specific chip selects differ.

Signed-off-by: Lukas Roggli 
Signed-off-by: Holger Brunck 
Signed-off-by: Heiko Schocher 
cc: Kim Phillips 
cc: Valentin Longchamp 
---
Changes for v2:
  - fix checkpatch.pl errors and warnings
Changes for v3:
  - rebased only

 MAINTAINERS |1 +
 boards.cfg  |1 +
 include/configs/tuxa1.h |  234 +++
 3 files changed, 236 insertions(+), 0 deletions(-)
 create mode 100644 include/configs/tuxa1.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 75b7343..801e4dd 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -434,6 +434,7 @@ Heiko Schocher 
sc3 PPC405GP
suen3   ARM926EJS (Kirkwood SoC)
suvd3   MPC8321
+   tuxa1   MPC8321
uc101   MPC5200
ve8313  MPC8313
 
diff --git a/boards.cfg b/boards.cfg
index dc583ba..ed5e0e7 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -476,6 +476,7 @@ SIMPC8313_LP powerpc mpc83xx 
simpc8313   sheldon
 SIMPC8313_SP powerpc mpc83xx simpc8313   
sheldon-   SIMPC8313:NAND_SP
 suvd3powerpc mpc83xx km83xx  
keymile
 TQM834x  powerpc mpc83xx tqm834x tqc
+tuxa1powerpc mpc83xx km83xx  
keymile
 sbc8540  powerpc mpc85xx sbc8560 - 
 -   SBC8540
 sbc8540_33   powerpc mpc85xx sbc8560 - 
 -   SBC8540
 sbc8540_66   powerpc mpc85xx sbc8560 - 
 -   SBC8540
diff --git a/include/configs/tuxa1.h b/include/configs/tuxa1.h
new file mode 100644
index 000..c4b48d1
--- /dev/null
+++ b/include/configs/tuxa1.h
@@ -0,0 +1,234 @@
+/*
+ * Copyright (C) 2006 Freescale Semiconductor, Inc.
+ *Dave Liu 
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *Peter Barada 
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *Anton Vorontsov 
+ *
+ * (C) Copyright 2008
+ * Heiko Schocher, DENX Software Engineering, h...@denx.de.
+ *
+ * (C) Copyright 2010
+ * Yan Bin, Lukas Roggli, KEYMILE Ltd, lukas.rog...@keymile.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_QE  /* Has QE */
+#define CONFIG_MPC832x /* MPC832x CPU specific */
+#define CONFIG_TUXA1   /* TUXA1 board specific */
+#define CONFIG_HOSTNAMEtuxa1
+#define CONFIG_KM_BOARD_NAME   "tuxa1"
+
+#defineCONFIG_SYS_TEXT_BASE0xF000
+#define CONFIG_KM_DEF_NETDEV   \
+   "netdev=eth0\0"
+
+#define CONFIG_KM_DEF_ROOTPATH \
+   "rootpath=/opt/eldk/ppc_8xx\0"
+
+/* include common defines/options for all 83xx Keymile boards */
+#include "km83xx-common.h"
+
+#define CONFIG_MISC_INIT_R
+
+/*
+ * System IO Config
+ */
+#define CONFIG_SYS_SICRH   0x0006
+#define CONFIG_SYS_SICRL   SICRL_IRQ_CKS
+
+/*
+ * Hardware Reset Configuration Word
+ */
+#define CONFIG_SYS_HRCW_LOW (\
+   HRCWL_LCL_BUS_TO_SCB_CLK_1X1 | \
+   HRCWL_DDR_TO_SCB_CLK_2X1 | \
+   HRCWL_CSB_TO_CLKIN_2X1 | \
+   HRCWL_CORE_TO_CSB_2_5X1 | \
+   HRCWL_CE_PLL_VCO_DIV_2 | \
+   HRCWL_CE_TO_PLL_1X3)
+
+#define CONFIG_SYS_HRCW_HIGH (\
+   HRCWH_PCI_AGENT | \
+   HRCWH_PCI_ARBITER_DISABLE | \
+   HRCWH_CORE_ENABLE | \
+   HRCWH_FROM_0X0100 | \
+   HRCWH_BOOTSEQ_DISABLE | \
+   HRCWH_SW_WATCHDOG_DISABLE | \
+   HRCWH_ROM_LOC_LOCAL_16BIT | \
+   HRCWH_BIG_ENDIAN | \
+   HRCWH_LALE_NORMAL)
+
+#define CONFIG_SYS_DDR_CS0_BNDS0x007f
+#define CONFIG_SYS_DDR_SDRAM_CFG   (SDRAM_CFG_SDRAM_TYPE_DDR2 | \
+   SDRAM_CFG_32_BE | \
+   SDRAM_CFG_2T_EN | \
+   SDRAM_CFG_SREN)
+#define CONFIG_SYS_DDR_SDRAM_CFG2  0x00401000
+#define CONFIG_SYS_DDR_CLK_CNTL(DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+#define CONFIG_SYS_DDR_INTERVAL((0x064 << 
SDRAM_INTERVAL_BSTOPRE_SHIFT) | \
+(0x200 << SDRAM_INTERVAL_REFINT_SHIFT))
+
+#define CONFIG_SYS_DDR_CS0_CONFIG  (CSCONFIG_EN | CSCONFIG_AP | \
+   CSCONFIG_ODT_WR_CFG | \
+   CSCONFIG_ROW_BIT_13 | \
+ 

[U-Boot] [PATCH v3 04/23] ppc, arm: adapt keymile header

2011-03-21 Thread Heiko Schocher
From: Holger Brunck 

- adapt copyright string
- change bootdelay to 2 seconds
- set max number of command args to 32
- set I/O buffer size to 512

Signed-off-by: Holger Brunck 
Signed-off-by: Heiko Schocher 
cc: Kim Phillips 
cc: Wolfgang Denk 
cc: Valentin Longchamp 
---
Changes for v2:
  - new patch in v2, first patch in v1 was split up
  - fix checkpatch.pl errors and warnings
Changes for v3:
  - rebased only

 include/configs/keymile-common.h |   13 -
 include/configs/kmeter1.h|4 ++--
 include/configs/mgcoge.h |7 +++
 3 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/include/configs/keymile-common.h b/include/configs/keymile-common.h
index b934620..6f37f53 100644
--- a/include/configs/keymile-common.h
+++ b/include/configs/keymile-common.h
@@ -27,8 +27,6 @@
 /* Do boardspecific init for all boards */
 #define CONFIG_BOARD_EARLY_INIT_R
 
-#define CONFIG_BOOTCOUNT_LIMIT
-
 /*
  * By default kwbimage.cfg from board specific folder is used
  * If for some board, different configuration file need to be used,
@@ -56,16 +54,15 @@
 #define CONFIG_CMD_IMMAP
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PING
-#define CONFIG_CMD_DTT
 #define CONFIG_CMD_EEPROM
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_JFFS2
-#define CONFIG_JFFS2_CMDLINE
 #define CONFIG_CMD_MTDPARTS
+#define CONFIG_CMD_SETEXPR
 
 #undef CONFIG_WATCHDOG /* disable platform specific watchdog */
 
-#define CONFIG_BOOTDELAY   5 /* autoboot after 5 seconds */
+#define CONFIG_BOOTDELAY   2 /* autoboot after 2 seconds */
 #undef CONFIG_BOOTARGS /* the boot command will set bootargs */
 
 /*
@@ -78,10 +75,10 @@
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_SYS_CBSIZE  1024/* Console I/O Buffer Size */
 #else
-#define CONFIG_SYS_CBSIZE  256 /* Console I/O Buffer Size */
+#define CONFIG_SYS_CBSIZE  512 /* Console I/O Buffer Size  */
 #endif
 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
-#define CONFIG_SYS_MAXARGS 16
+#define CONFIG_SYS_MAXARGS 32 /* max number of command args */
 #define CONFIG_SYS_BARGSIZECONFIG_SYS_CBSIZE
 #define CONFIG_CMDLINE_EDITING
 #define CONFIG_AUTO_COMPLETE
@@ -139,8 +136,6 @@
 #define CONFIG_BOOTP_GATEWAY
 #define CONFIG_BOOTP_HOSTNAME
 
-#define CONFIG_ENV_SIZE0x04000 /* Size of Environment */
-
 #define CONFIG_SYS_MALLOC_LEN  (4 * 1024 * 1024)
 
 /* UBI Support for all Keymile boards */
diff --git a/include/configs/kmeter1.h b/include/configs/kmeter1.h
index f288cb0..15042b9 100644
--- a/include/configs/kmeter1.h
+++ b/include/configs/kmeter1.h
@@ -8,7 +8,7 @@
  * Copyright (C) 2007 MontaVista Software, Inc.
  *Anton Vorontsov 
  *
- * (C) Copyright 2008
+ * (C) Copyright 2008-2011
  * Heiko Schocher, DENX Software Engineering, h...@denx.de.
  *
  * This program is free software; you can redistribute it and/or
@@ -171,7 +171,7 @@
 #undef CONFIG_SYS_RAMBOOT
 #endif
 
-#define CONFIG_SYS_MONITOR_LEN (384 * 1024) /* Reserve for Mon */
+#define CONFIG_SYS_MONITOR_LEN (768 * 1024) /* Reserve for Mon */
 
 /*
  * Initial RAM Base Address Setup
diff --git a/include/configs/mgcoge.h b/include/configs/mgcoge.h
index 3a987ad..662d885 100644
--- a/include/configs/mgcoge.h
+++ b/include/configs/mgcoge.h
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2007
+ * (C) Copyright 2007-2011
  * Heiko Schocher, DENX Software Engineering, h...@denx.de.
  *
  * See file CREDITS for list of people who contributed to this
@@ -78,8 +78,7 @@
 #define CONFIG_8260_CLKIN  6600/* in Hz */
 #endif
 
-#define BOOTFLASH_STARTFE00
-#define CONFIG_PRAM512 /* protected RAM [KBytes] */
+#define BOOTFLASH_START0xFE00
 
 #define MTDIDS_DEFAULT "nor0=boot,nor1=app"
 #define MTDPARTS_DEFAULT   \
@@ -128,7 +127,7 @@
 #define CONFIG_SYS_RAMBOOT
 #endif
 
-#define CONFIG_SYS_MONITOR_LEN (384 << 10)
+#define CONFIG_SYS_MONITOR_LEN (768 << 10)
 
 #define CONFIG_ENV_IS_IN_FLASH
 
-- 
1.7.4

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


[U-Boot] [PATCH v3 19/23] keymile boards: add CONFIG_PIGGY_MAC_ADRESS_OFFSET

2011-03-21 Thread Heiko Schocher
Normaly the PIGGY_MAC_ADRESS can be read directly from the
IVM on keymile boards. On mgcoge3 it differs. Because there
are two piggy boards deployed the second MAC adress must be
calculated with the IVM mac adress and an offset. This patch
allows to set such a offset in the board config.

Signed-off-by: Holger Brunck 
cc: Valentin Longchamp 
cc: Heiko Schocher 
---
Changes for v2:
  - fix checkpatch.pl errors and warnings
changes for v3
  - rebased
  - use %pM in sprintf for mac address handling
as Wolfgang Denk suggested.

 board/keymile/common/common.c |   13 +
 board/keymile/common/common.h |4 
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 6600e08..8392a64 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -228,8 +228,21 @@ static int ivm_analyze_block2(unsigned char *buf, int len)
/* IVM_MacAddress */
sprintf((char *)valbuf, "%pM", buf);
ivm_set_value("IVM_MacAddress", (char *)valbuf);
+   /* if an offset is defined, add it */
+#if defined(CONFIG_PIGGY_MAC_ADRESS_OFFSET)
+   if (CONFIG_PIGGY_MAC_ADRESS_OFFSET > 0) {
+   unsigned long val = (buf[4] << 16) + (buf[5] << 8) + buf[6];
+
+   val += CONFIG_PIGGY_MAC_ADRESS_OFFSET;
+   buf[4] = (val >> 16) & 0xff;
+   buf[5] = (val >> 8) & 0xff;
+   buf[6] = val & 0xff;
+   sprintf((char *)valbuf, "%pM", buf);
+   }
+#endif
if (getenv("ethaddr") == NULL)
setenv((char *)"ethaddr", (char *)valbuf);
+
/* IVM_MacCount */
count = (buf[10] << 24) +
   (buf[11] << 16) +
diff --git a/board/keymile/common/common.h b/board/keymile/common/common.h
index e0d2603..03838fe 100644
--- a/board/keymile/common/common.h
+++ b/board/keymile/common/common.h
@@ -38,6 +38,10 @@ struct km_bec_fpga {
unsigned char   pgy_out;
 };
 
+#if !defined(CONFIG_PIGGY_MAC_ADRESS_OFFSET)
+#define CONFIG_PIGGY_MAC_ADRESS_OFFSET 0
+#endif
+
 int ethernet_present(void);
 int ivm_read_eeprom(void);
 
-- 
1.7.4

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


[U-Boot] [PATCH v3 23/23] keymile-common.h: remove IO mux stuff

2011-03-21 Thread Heiko Schocher
From: Holger Brunck 

Signed-off-by: Holger Brunck 
cc: Wolfgang Denk 
cc: Valentin Longchamp 
cc: Heiko Schocher 
---
Changes for v2:
  - fix checkpatch.pl errors and warnings
Changes for v3:
  - rebased only

 include/configs/keymile-common.h |9 +++--
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/include/configs/keymile-common.h b/include/configs/keymile-common.h
index e9a97b7..cb6d0fb 100644
--- a/include/configs/keymile-common.h
+++ b/include/configs/keymile-common.h
@@ -137,11 +137,6 @@
 #define CONFIG_MTD_DEVICE
 #define CONFIG_MTD_CONCAT
 
-#defineCONFIG_KM_DEF_ENV_IOMUX \
-   "stderr=serial \0" \
-   "stdin=serial \0"\
-   "stdout=serial \0"
-
 /* common powerpc specific env settings */
 #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
 #define CONFIG_KM_DEF_ENV_BOOTPARAMS \
@@ -428,7 +423,6 @@
 #ifndef CONFIG_KM_DEF_ENV
 #define CONFIG_KM_DEF_ENV  \
CONFIG_KM_DEF_ENV_BOOTPARAMS\
-   CONFIG_KM_DEF_ENV_IOMUX \
CONFIG_KM_DEF_NETDEV\
CONFIG_KM_DEF_ENV_CPU   \
CONFIG_KM_DEF_ENV_BOOTRUNNER\
@@ -448,6 +442,9 @@
"load=tftpboot ${u-boot_addr_r} ${u-boot}\0"\
"mtdids=" MTDIDS_DEFAULT "\0"   \
"mtdparts=" MTDPARTS_DEFAULT "\0"   \
+   "stderr=serial\0"   \
+   "stdin=serial\0"\
+   "stdout=serial\0"   \
"u-boot="xstr(CONFIG_HOSTNAME) "/u-boot.bin\0"  \
"u-boot_addr_r="xstr(CONFIG_KM_KERNEL_ADDR) "\0"\
""
-- 
1.7.4

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


[U-Boot] [PATCH v3 22/23] keymile boards: support of boardId / hwkey lists

2011-03-21 Thread Heiko Schocher
From: Thomas Herzmann 

In order to support boardId / hwkey lists, the u-boot default
environment has been updated: Added a script checkboardidlist
which checks the list of boardId / hwkey if the boadrId / hwkey
of the IVM is included in that list. This feature is used if you
got different HW variants but you only want to create one boot
package. E.g. supx5 board series.

Signed-off-by: Thomas Herzmann 
Signed-off-by: Holger Brunck 
cc: Valentin Longchamp 
cc: Heiko Schocher 
---
Changes for v2:
  - nothing
Changes for v3:
  - rebased only

 include/configs/keymile-common.h |   29 -
 1 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/include/configs/keymile-common.h b/include/configs/keymile-common.h
index 1344ca9..e9a97b7 100644
--- a/include/configs/keymile-common.h
+++ b/include/configs/keymile-common.h
@@ -243,6 +243,7 @@
"release="  \
"setenv actual_bank ${initial_boot_bank} && "   \
"setenv subbootcmds \"" \
+   "checkboardidlist " \
"checkboardid " \
"ubiattach ubicopy "\
"cramfsloadfdt cramfsloadkernel "   \
@@ -392,8 +393,34 @@
"default="  \
"setenv default 'run newenv; reset' &&  "   \
"run release && saveenv; reset\0"   \
+   "checkboardidlist=" \
+   "if test \"x${boardIdListHex}\" != \"x\"; then "\
+   "IVMbidhwk=${IVM_BoardId}_${IVM_HWKey}; "   \
+   "found=0; " \
+   "for bidhwk in \"${boardIdListHex}\"; do "  \
+   "echo trying $bidhwk ...; " \
+   "if test \"x$bidhwk\" = \"x$IVMbidhwk\"; then " \
+   "found=1; " \
+   "echo match found for $bidhwk; "\
+   "if test \"x$bidhwk\" != \"x${boardId}_${hwKey}\";then "\
+   "setenv boardid ${IVM_BoardId}; "   \
+   "setenv boardId ${IVM_BoardId}; "   \
+   "setenv hwkey ${IVM_HWKey}; "   \
+   "setenv hwKey ${IVM_HWKey}; "   \
+   "echo \"boardId set to ${boardId}\"; "  \
+   "echo \"hwKey   set to ${hwKey}\"; "\
+   "saveenv; " \
+   "fi; "  \
+   "fi; "  \
+   "done; "\
+   "else " \
+   "echo \"boardIdListHex not set, not checked\"; "\
+   "found=1; " \
+   "fi; "  \
+   "test \"$found\" = 1 \0"\
"checkboardid=" \
-   "test \"x${boardId}\" = \"x${IVM_BoardId}\"\0"  \
+   "test \"x${boardId}\" = \"x${IVM_BoardId}\" && "\
+   "test \"x${hwKey}\" = \"x${IVM_HWKey}\"\0"  \
"printbootargs=print bootargs\0"\
"rootfsfile="xstr(CONFIG_HOSTNAME) "/rootfsImage\0" \
""
-- 
1.7.4

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


[U-Boot] [PATCH v3 01/23] powerpc, mpc83xx: add missing functions to mpc83xx.h

2011-03-21 Thread Heiko Schocher
Signed-off-by: Heiko Schocher 
cc: Kim Phillips 
cc: Holger Brunck 
cc: Wolfgang Denk 
cc: Detlev Zundel 
cc: Valentin Longchamp 
---
Changes for v3:
  - new patch in v3, to avoid externs in keymile code

 include/mpc83xx.h |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/mpc83xx.h b/include/mpc83xx.h
index ea137c7..e1b0929 100644
--- a/include/mpc83xx.h
+++ b/include/mpc83xx.h
@@ -1274,6 +1274,12 @@ struct pci_region;
 void mpc83xx_pci_init(int num_buses, struct pci_region **reg);
 void mpc83xx_pcislave_unlock(int bus);
 void mpc83xx_pcie_init(int num_buses, struct pci_region **reg);
+
+void disable_addr_trans(void);
+void enable_addr_trans(void);
+#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
+void ddr_enable_ecc(unsigned int dram_size);
+#endif
 #endif
 
 #endif /* __MPC83XX_H__ */
-- 
1.7.4

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


[U-Boot] [PATCH v3 21/23] ppc, arm: rework and enhance keymile-common.h

2011-03-21 Thread Heiko Schocher
From: Holger Brunck 

Add:
  - introduce "bootrunner" environment variable
This allows to execute consecutive different commands
specified in the list "subbootcmd". If one command fails
the command serie will stop.
  - introduce environment variable "develop", "ramfs" and "release"
Each variable is one way to boot our linux. "develop" is for
development purpose and boots the SW via NFS. "release" is for
booting the linux image from flash, "ramfs" allows to load an SW
image via tftp into ram and executes from there
  - introduce "addmem" variable, this command adds the used memory
for linux to the bootargs
  - introduce "addvar" variable, this command adress for the /var
directory to the kernel command line
  - introduce "setramfspram" and "setrootfsaddr" these calculation
were done if "ramfs" was used (only for debugging)
  - introduce "tftpramfs" used for "ramfs" to load the image into
RAM (only for debugging)
Remove unneeded stuff:
   - CONFIG_IO_MUXING is obsolete for keymile boards
   - CONFIG_KM_DEF_ENV_PRIVATE is also obsolete
   - define CONFIG_SYS_TEXT_BASE in board configs only

Signed-off-by: Holger Brunck 
cc: Wolfgang Denk 
cc: Prafulla Wadaskar 
cc: Valentin Longchamp 
cc: Heiko Schocher 
---
Changes for v2:
  - fix checkpatch.pl errors and warnings
Changes for v3:
  - rebased only

 include/configs/keymile-common.h |  163 +++--
 include/configs/km_arm.h |2 +
 2 files changed, 138 insertions(+), 27 deletions(-)

diff --git a/include/configs/keymile-common.h b/include/configs/keymile-common.h
index da5a447..1344ca9 100644
--- a/include/configs/keymile-common.h
+++ b/include/configs/keymile-common.h
@@ -40,13 +40,6 @@
 #endif /* CONFIG_SYS_KWD_CONFIG */
 
 /*
- * CONFIG_SYS_TEXT_BASE can be defined in board specific header file, if needed
- */
-#ifndef CONFIG_SYS_TEXT_BASE
-#defineCONFIG_SYS_TEXT_BASE0x0040
-#endif /* CONFIG_SYS_TEXT_BASE */
-
-/*
  * Command line configuration.
  */
 #include 
@@ -144,28 +137,16 @@
 #define CONFIG_MTD_DEVICE
 #define CONFIG_MTD_CONCAT
 
-/* define this to use the keymile's io muxing feature */
-/*#define CONFIG_IO_MUXING */
-
-#ifdef CONFIG_IO_MUXING
-#defineCONFIG_KM_DEF_ENV_IOMUX \
-   "nc=setenv ethact HDLC \0" \
-   "nce=setenv ethact SCC \0"  \
-   "stderr=serial,nc \0"   \
-   "stdin=serial,nc \0" \
-   "stdout=serial,nc \0" \
-   "tftpsrcp=69 \0" \
-   "tftpdstp=69 \0"
-#else
 #defineCONFIG_KM_DEF_ENV_IOMUX \
"stderr=serial \0" \
"stdin=serial \0"\
"stdout=serial \0"
-#endif
 
-#ifndef CONFIG_KM_DEF_ENV_PRIVATE
-#defineCONFIG_KM_DEF_ENV_PRIVATE \
-   "kmprivate=empty\0"
+/* common powerpc specific env settings */
+#ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
+#define CONFIG_KM_DEF_ENV_BOOTPARAMS \
+   "bootparams=empty\0"\
+   "initial_boot_bank=0\0"
 #endif
 
 #ifndef CONFIG_KM_DEF_NETDEV
@@ -184,17 +165,116 @@
 #define str(s) #s
 
 /*
+ * bootrunner
+ * - run all commands in 'subbootcmds'
+ * - on error, stop running the remaing commands
+ */
+#define CONFIG_KM_DEF_ENV_BOOTRUNNER   \
+   "bootrunner="   \
+   "break=0; " \
+   "for subbootcmd in ${subbootcmds}; do " \
+   "if test ${break} -eq 0; then; "\
+   "echo \"[INFO] running \\c\"; " \
+   "print ${subbootcmd}; " \
+   "run ${subbootcmd} || break=1; "\
+   "if test ${break} -eq 1; then; "\
+   "echo \"[ERR] failed \\c\"; "   \
+   "print ${subbootcmd}; " \
+   "fi; "  \
+   "fi; "  \
+   "done\0"\
+   ""
+
+/*
+ * boottargets
+ * - set 'subbootcmds' for the bootrunner
+ * - set 'bootcmd' and 'altbootcmd'
+ * available targets:
+ * - 'release': for a standalone systemkernel/rootfs from flash
+ * - 'develop': for developmentkernel(tftp)/rootfs(NFS)
+ * - 'ramfs': rootfilesystem in RAMkernel(tftp)/rootfs(RAM)
+ *
+ * - 'commonargs': bootargs common to all targets
+ */
+#define CONFIG_KM_DEF_ENV_BOOTTARGETS  \
+   "commonargs="   \
+   "addip "\
+   "addtty "   \
+   "addmem "   \
+   

[U-Boot] [PATCH v3 12/23] keymile, 8321 boards: move common definitions to km8321-common.h

2011-03-21 Thread Heiko Schocher
From: Thomas Reufer 

First step for a cleanup of all header files for km8321 boards.

Signed-off-by: Thomas Reufer 
cc: Wolfgang Denk 
cc: Kim Phillips 
cc: Valentin Longchamp 
cc: Holger Brunck 
cc: Heiko Schocher 
---
Changes for v2:
  - fix checkpatch.pl errors and warnings
Changes for v3:
  - rebased only

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

diff --git a/include/configs/km8321-common.h b/include/configs/km8321-common.h
new file mode 100644
index 000..9e48388
--- /dev/null
+++ b/include/configs/km8321-common.h
@@ -0,0 +1,141 @@
+/*
+ * Copyright (C) 2006 Freescale Semiconductor, Inc.
+ *Dave Liu 
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *Peter Barada 
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *Anton Vorontsov 
+ *
+ * (C) Copyright 2008
+ * Heiko Schocher, DENX Software Engineering, h...@denx.de.
+ *
+ * (C) Copyright 2010
+ * Lukas Roggli, KEYMILE Ltd, lukas.rog...@keymile.com
+ *
+ * (C) Copyright 2010-2011
+ * Thomas Reufer, KEYMILE Ltd, thomas.reu...@keymile.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ */
+
+#ifndef __CONFIG_KM8321_COMMON_H
+#define __CONFIG_KM8321_COMMON_H
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_QE  /* Has QE */
+#define CONFIG_MPC832x /* MPC832x CPU specific */
+#define CONFIG_KM8321  /* Keymile PBEC8321 board specific */
+
+#define CONFIG_KM_DEF_NETDEV   \
+   "netdev=eth0\0"
+
+#define CONFIG_KM_DEF_ROOTPATH \
+   "rootpath=/opt/eldk/ppc_8xx\0"
+
+/* include common defines/options for all 83xx Keymile boards */
+#include "km83xx-common.h"
+
+#define CONFIG_MISC_INIT_R
+
+/*
+ * System IO Config
+ */
+#define CONFIG_SYS_SICRH   0x0006
+#define CONFIG_SYS_SICRL   SICRL_IRQ_CKS
+
+/*
+ * Hardware Reset Configuration Word
+ */
+#define CONFIG_SYS_HRCW_LOW (\
+   HRCWL_LCL_BUS_TO_SCB_CLK_1X1 | \
+   HRCWL_DDR_TO_SCB_CLK_2X1 | \
+   HRCWL_CSB_TO_CLKIN_2X1 | \
+   HRCWL_CORE_TO_CSB_2_5X1 | \
+   HRCWL_CE_PLL_VCO_DIV_2 | \
+   HRCWL_CE_TO_PLL_1X3)
+
+#define CONFIG_SYS_HRCW_HIGH (\
+   HRCWH_PCI_AGENT | \
+   HRCWH_PCI_ARBITER_DISABLE | \
+   HRCWH_CORE_ENABLE | \
+   HRCWH_FROM_0X0100 | \
+   HRCWH_BOOTSEQ_DISABLE | \
+   HRCWH_SW_WATCHDOG_DISABLE | \
+   HRCWH_ROM_LOC_LOCAL_16BIT | \
+   HRCWH_BIG_ENDIAN | \
+   HRCWH_LALE_NORMAL)
+
+#define CONFIG_SYS_DDR_CS0_BNDS0x007f
+#define CONFIG_SYS_DDR_SDRAM_CFG   (SDRAM_CFG_SDRAM_TYPE_DDR2 | \
+   SDRAM_CFG_32_BE | \
+   SDRAM_CFG_SREN)
+
+#define CONFIG_SYS_DDR_SDRAM_CFG2  0x00401000
+#define CONFIG_SYS_DDR_CLK_CNTL
(DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+#define CONFIG_SYS_DDR_INTERVAL((0x064 << 
SDRAM_INTERVAL_BSTOPRE_SHIFT) | \
+(0x200 << SDRAM_INTERVAL_REFINT_SHIFT))
+
+#define CONFIG_SYS_DDR_CS0_CONFIG  (CSCONFIG_EN | CSCONFIG_AP | \
+   CSCONFIG_ODT_WR_CFG | \
+   CSCONFIG_ROW_BIT_13 | \
+   CSCONFIG_COL_BIT_10)
+
+#define CONFIG_SYS_DDR_MODE0x47860252
+#define CONFIG_SYS_DDR_MODE2   0x8080c000
+
+#define CONFIG_SYS_DDR_TIMING_0((2 << TIMING_CFG0_MRS_CYC_SHIFT) | \
+(8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) | \
+(2 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) | \
+(2 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) | \
+(0 << TIMING_CFG0_WWT_SHIFT) | \
+(0 << TIMING_CFG0_RRT_SHIFT) | \
+(0 << TIMING_CFG0_WRT_SHIFT) | \
+(0 << TIMING_CFG0_RWT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_1((TIMING_CFG1_CASLAT_50) | \
+(2 << TIMING_CFG1_WRTORD_SHIFT) | \
+(2 << TIMING_CFG1_ACTTOACT_SHIFT) | \
+(2 << TIMING_CFG1_WRREC_SHIFT) | \
+(6 << TIMING_CFG1_REFREC_SHIFT) | \
+(2 << TIMING_CFG1_ACTTORW_SHIFT) | \
+(6 << TIMING_CFG1_ACTTOPRE_SHIFT) | \
+(2 << TIMING_CFG1_PRETOACT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_2((8 << TIMING_CFG2_FOUR_ACT_SHIFT) | \
+(3 << TIMING_CFG2_CKE_PLS_SHIFT) | \
+(2 << TIMING_CFG2_WR_D

[U-Boot] [PATCH v3 20/23] keymile, common: add setting of some environment variables

2011-03-21 Thread Heiko Schocher
This patch adds last_stage_init to all keymile boards. And
in the last stage init some environment variables for u-boot
were set. Currently these are pnvramaddr, pram and var address.

Signed-off-by: Holger Brunck 
Signed-off-by: Heiko Schocher 
cc: Valentin Longchamp 
cc: Wolfgang Denk 
cc: Kim Phillips 
---
Changes for v2:
  - fix checkpatch.pl errors and warnings
Changes for v3:
  - rebased only

 board/keymile/common/common.c|   38 +-
 board/keymile/common/common.h|1 +
 board/keymile/km83xx/km83xx.c|6 ++
 board/keymile/km_arm/km_arm.c|6 ++
 board/keymile/mgcoge/mgcoge.c|6 ++
 include/configs/keymile-common.h |3 +++
 include/configs/km_arm.h |7 +++
 7 files changed, 66 insertions(+), 1 deletions(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 8392a64..3908e63 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -42,6 +42,7 @@
 
 static void i2c_write_start_seq(void);
 static int i2c_make_abort(void);
+DECLARE_GLOBAL_DATA_PTR;
 
 int ivm_calc_crc(unsigned char *buf, int len)
 {
@@ -73,7 +74,42 @@ int ivm_calc_crc(unsigned char *buf, int len)
return crc;
 }
 
-static int ivm_set_value(char *name, char *value)
+/*
+ * Set Keymile specific environment variables
+ * Currently only some memory layout variables are calculated here
+ * ... 
+ * ... |@rootfsaddr |@pnvramaddr |@varaddr |@reserved |@END_OF_RAM
+ * ... |<--- pram --->|
+ * ... 
+ * @END_OF_RAM: denotes the RAM size
+ * @pnvramaddr: Startadress of pseudo non volatile RAM in hex
+ * @pram  : preserved ram size in k
+ * @varaddr   : startadress for /var mounted into RAM
+ */
+int set_km_env(void)
+{
+   uchar buf[32];
+   unsigned int pnvramaddr;
+   unsigned int pram;
+   unsigned int varaddr;
+
+   pnvramaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM
+   - CONFIG_KM_PNVRAM;
+   sprintf((char *)buf, "0x%x", pnvramaddr);
+   setenv("pnvramaddr", (char *)buf);
+
+   pram = (CONFIG_KM_RESERVED_PRAM + CONFIG_KM_PHRAM + CONFIG_KM_PNVRAM) /
+   0x400;
+   sprintf((char *)buf, "0x%x", pram);
+   setenv("pram", (char *)buf);
+
+   varaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM;
+   sprintf((char *)buf, "0x%x", varaddr);
+   setenv("varaddr", (char *)buf);
+   return 0;
+}
+
+static int  ivm_set_value(char *name, char *value)
 {
char tempbuf[256];
 
diff --git a/board/keymile/common/common.h b/board/keymile/common/common.h
index 03838fe..7a8238c 100644
--- a/board/keymile/common/common.h
+++ b/board/keymile/common/common.h
@@ -49,6 +49,7 @@ int ivm_read_eeprom(void);
 int keymile_hdlc_enet_initialize(bd_t *bis);
 #endif
 
+int set_km_env(void);
 int fdt_set_node_and_value(void *blob,
char *nodename,
char *regname,
diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c
index d940a1e..818e3e3 100644
--- a/board/keymile/km83xx/km83xx.c
+++ b/board/keymile/km83xx/km83xx.c
@@ -190,6 +190,12 @@ int misc_init_r(void)
return 0;
 }
 
+int last_stage_init(void)
+{
+   set_km_env();
+   return 0;
+}
+
 int fixed_sdram(void)
 {
immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c
index cb999b2..c772ee2 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -212,6 +212,12 @@ 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[])
 {
diff --git a/board/keymile/mgcoge/mgcoge.c b/board/keymile/mgcoge/mgcoge.c
index a58256e..340016b 100644
--- a/board/keymile/mgcoge/mgcoge.c
+++ b/board/keymile/mgcoge/mgcoge.c
@@ -313,6 +313,12 @@ int board_early_init_r(void)
return 0;
 }
 
+int last_stage_init(void)
+{
+   set_km_env();
+   return 0;
+}
+
 int hush_init_var(void)
 {
ivm_read_eeprom();
diff --git a/include/configs/keymile-common.h b/include/configs/keymile-common.h
index 77e2090..da5a447 100644
--- a/include/configs/keymile-common.h
+++ b/include/configs/keymile-common.h
@@ -26,6 +26,9 @@
 
 /* Do boardspecific init for all boards */
 #define CONFIG_BOARD_EARLY_INIT_R
+#define CONFIG_LAST_STAGE_INIT
+
+#define CONFIG_BOOTCOUNT_LIMIT
 
 /*
  * By default kwbimage.cfg from board specific folder is used
diff --git a/include/configs/km_arm.h b/include/configs/km_arm.h
index 8cb0fe8..9c8d0e7 100644
--- a/include/configs/km_arm.h
+++ b/include/configs/km_arm.h
@@ -254,4 +254,11 @@ int get_scl (void);
 #define CONFIG_SYS_INIT_SP_ADDR0xC8012000
 /* Do early setups 

[U-Boot] [PATCH v5 05/23] arm, ppc: rework environment variables for keymile boards

2011-03-21 Thread Heiko Schocher
From: Holger Brunck 

This patch reworks all headerfiles for keymile boards. Furthermore
the environment variables are refactored.

Changes:
  - introduce km-powerpc.h file and extract ppc specific parts to it
  - move ARM specific options and vaiables to km_arm.h
  - sort the environment variables to logical groups
  - enhance the description of the environment variables
  - remove KM specific HW key and board id from kernel command line

Signed-off-by: Holger Brunck 
Signed-off-by: Heiko Schocher 
cc: Kim Phillips 
cc: Wolfgang Denk 
cc: Valentin Longchamp 
---
Changes for v2:
  - new patch in v2, first patch in v1 was split up
  - fix checkpatch.pl errors and warnings
Changes for v3:
  - rebased only

 include/configs/keymile-common.h |  234 ++---
 include/configs/km-powerpc.h |   92 +++
 include/configs/km_arm.h |   25 -
 include/configs/kmeter1.h|   36 +++
 include/configs/mgcoge.h |   31 +++---
 5 files changed, 286 insertions(+), 132 deletions(-)
 create mode 100644 include/configs/km-powerpc.h

diff --git a/include/configs/keymile-common.h b/include/configs/keymile-common.h
index 6f37f53..e952a19 100644
--- a/include/configs/keymile-common.h
+++ b/include/configs/keymile-common.h
@@ -86,10 +86,6 @@
 #define CONFIG_HUSH_INIT_VAR
 
 #define CONFIG_SYS_ALT_MEMTEST /* memory test, takes time */
-#define CONFIG_SYS_MEMTEST_START   0x0010
-#define CONFIG_SYS_MEMTEST_END 0x00f0 /* 1 ... 15 MB in DRAM */
-
-#define CONFIG_SYS_LOAD_ADDR   0x10
 
 #define CONFIG_SYS_HZ  1000/* decr. freq: 1 ms ticks */
 
@@ -142,7 +138,6 @@
 #define CONFIG_CMD_UBI
 #define CONFIG_RBTREE
 #define CONFIG_MTD_PARTITIONS
-#define CONFIG_FLASH_CFI_MTD
 #define CONFIG_MTD_DEVICE
 #define CONFIG_MTD_CONCAT
 
@@ -170,103 +165,152 @@
"kmprivate=empty\0"
 #endif
 
+#ifndef CONFIG_KM_DEF_NETDEV
+#define CONFIG_KM_DEF_NETDEV   \
+   "netdev=eth0\0"
+#endif
+
+#ifndef CONFIG_KM_UBI_PARTITION_NAME
+#define CONFIG_KM_UBI_PARTITION_NAME   "ubi0"
+#endif
+#ifndef CONFIG_KM_UBI_LINUX_MTD_NAME
+#define CONFIG_KM_UBI_LINUX_MTD_NAME   "ubi0"
+#endif
+
 #define xstr(s)str(s)
 #define str(s) #s
 
+/*
+ * bootargs
+ * - modify 'bootargs'
+ *
+ * - 'addip': add ip configuration
+ * - 'addpanic': add kernel panic options
+ * - 'addramfs': add phram device for the rootfilesysten in ram
+ * - 'addtty': add console=...
+ * - 'nfsargs': default arguments for nfs boot
+ * - 'flashargs': defaults arguments for flash base boot
+ *
+ * processor specific settings
+ * - 'addmtdparts': add mtd partition information
+ */
+#define CONFIG_KM_DEF_ENV_BOOTARGS \
+   "addinit="  \
+   "setenv bootargs ${bootargs} init=${init}\0"\
+   "addip="\
+   "setenv bootargs ${bootargs} "  \
+   "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"  \
+   ":${hostname}:${netdev}:off\0"  \
+   "addpanic=" \
+   "setenv bootargs ${bootargs} "  \
+   "panic=1 panic_on_oops=1\0" \
+   "addramfs=" \
+   "setenv bootargs \""\
+   "${bootargs} phram.phram="  \
+   "rootfs${actual_bank},${rootfsaddr},${rootfssize}\"\0"  \
+   "addtty="   \
+   "setenv bootargs ${bootargs}"   \
+   " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}\0"  \
+   "nfsargs="  \
+   "setenv bootargs "  \
+   "ubi.mtd=" CONFIG_KM_UBI_LINUX_MTD_NAME " " \
+   "root=/dev/nfs rw " \
+   "nfsroot=${serverip}:${rootpath}\0" \
+   "flashargs="\
+   "setenv bootargs "  \
+   "ubi.mtd=" CONFIG_KM_UBI_LINUX_MTD_NAME " " \
+   "root=mtdblock:rootfs${actual_bank} "   \
+   "rootfstype=squashfs ro\0"  \
+   ""
+
+#define CONFIG_KM_DEF_ENV_COMPUTE_ADDR \
+   "setboardid="   \
+   "if test \"x${boardId}\" = \"x\"; then; "   \
+   "setenv boardId ${IVM_BoardId} && " \
+   "sete

[U-Boot] [PATCH v3 11/23] ppc: add support for ppc based board mgcoge2ne

2011-03-21 Thread Heiko Schocher
The mgcoge2 board from keymile deploys two different processors.
An ARM based Kirkwood for the "unit" part of the SW and a PPC for
the "ne" part of the SW. Therefore in Linux and U-Boot the names
for the board are mgcoge2un and mgcoge2ne. This patch adds the
mgcoge2ne part of the board. The ppc part of mgboge2 is quite
similar to mgcoge, therefore a generic header km82xx-common.h
was introduced to collect all similiarities. Currently the only
difference is that mgcoge2ne has a 64 MB numonyx NOR flash with
a single die. The mgcoge has a dual die flash 2*32MB from spansion.

Signed-off-by: Holger Brunck 
Signed-off-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Valentin Longchamp 
---
Changes for v2:
  - fix checkpatch.pl errors and warnings
Changes for v3:
  - rebased only

 MAINTAINERS |1 +
 board/keymile/common/common.c   |4 +-
 board/keymile/mgcoge/mgcoge.c   |4 +
 boards.cfg  |1 +
 include/configs/km82xx-common.h |  336 +++
 include/configs/mgcoge.h|  312 +---
 include/configs/mgcoge2ne.h |   64 
 7 files changed, 411 insertions(+), 311 deletions(-)
 create mode 100644 include/configs/km82xx-common.h
 create mode 100644 include/configs/mgcoge2ne.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 9644d38..e4525e4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -428,6 +428,7 @@ Heiko Schocher 
jupiter MPC5200
kmeter1 MPC8360
mgcoge  MPC8247
+   mgcoge2ne   MPC8247
mgcoge2un   ARM926EJS (Kirkwood SoC)
mucmc52 MPC5200
muas3001MPC8270
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 85538d0..8564b9c 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -22,7 +22,7 @@
  */
 
 #include 
-#if defined(CONFIG_MGCOGE)
+#if defined(CONFIG_MGCOGE) || defined(CONFIG_MGCOGE2NE)
 #include 
 #endif
 #include 
@@ -343,7 +343,7 @@ int ivm_read_eeprom(void)
 #define DELAY_ABORT_SEQ62
 #define DELAY_HALF_PERIOD  (500 / (CONFIG_SYS_I2C_SPEED / 1000))
 
-#if defined(CONFIG_MGCOGE)
+#if defined(CONFIG_MGCOGE) || defined(CONFIG_MGCOGE2NE)
 #define SDA_MASK   0x0001
 #define SCL_MASK   0x0002
 static void set_pin(int state, unsigned long mask)
diff --git a/board/keymile/mgcoge/mgcoge.c b/board/keymile/mgcoge/mgcoge.c
index de80aa5..e32ff98 100644
--- a/board/keymile/mgcoge/mgcoge.c
+++ b/board/keymile/mgcoge/mgcoge.c
@@ -284,7 +284,11 @@ phys_size_t initdram(int board_type)
 
 int checkboard(void)
 {
+#if defined(CONFIG_MGCOGE)
puts("Board: Keymile mgcoge");
+#else
+   puts("Board: Keymile mgcoge2ne");
+#endif
if (ethernet_present())
puts(" with PIGGY.");
puts("\n");
diff --git a/boards.cfg b/boards.cfg
index 22cb509..3c45456 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -424,6 +424,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 -   
keymile
+mgcoge2nepowerpc mpc8260 mgcoge  
keymile
 SCM  powerpc mpc8260 -   
siemens
 TQM8255_AA   powerpc mpc8260 tqm8260 tqc   
 -   TQM8260:MPC8255,300MHz
 TQM8260_AA   powerpc mpc8260 tqm8260 tqc   
 -   TQM8260:MPC8260,200MHz
diff --git a/include/configs/km82xx-common.h b/include/configs/km82xx-common.h
new file mode 100644
index 000..f0a5893
--- /dev/null
+++ b/include/configs/km82xx-common.h
@@ -0,0 +1,336 @@
+/*
+ * (C) Copyright 2007-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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __KM82XX_COMMON
+#defi

[U-Boot] [PATCH v3 18/23] arm, keymile: updates for the arm based boards from keymile

2011-03-21 Thread Heiko Schocher
define KM_IVM_BUS and KM_ENV_BUS macros
 KM_IVM_BUS is used to define the EEprom_ivm environment variable.
 These macros allow the reuse of these I2C addresses in other code
 locations.

remove unneeded code
  On first HW versions the BOCO FPGA was behind a MUX device. These
  HW versions are not supported anymore. And therefore this code can
  be removed.

added LED initialization for SUEN3
  The bootstat LED required to be initialized so to have a green
  colour after start-up.

define CONFIG_SYS_TEXT_BASE
  This is needed by the relocation code and is not the same for
  our ARM BEC and thus needs to be defined.

remove memsize variable
  An environment variable for memsize is not needed.
  this can be get via the board info struct.

remove unneeded double access to bi_dram[i].size field

Signed-off-by: Valentin Longchamp 
Signed-off-by: Holger Brunck 
Signed-off-by: Luca Haab 
Signed-off-by: Heiko Schocher 
cc: Prafulla Wadaskar 
---
Changes for v2:
  - fix checkpatch.pl errors and warnings
Changes for v3:
  - rebased only

 board/keymile/km_arm/km_arm.c |   38 +++---
 include/configs/km_arm.h  |1 +
 include/configs/mgcoge2un.h   |6 --
 include/configs/suen3.h   |6 --
 include/configs/suen8.h   |6 --
 5 files changed, 44 insertions(+), 13 deletions(-)

diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c
index 9dafcef..cb999b2 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -41,8 +41,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static int io_dev;
-
 /* Multi-Purpose Pins Functionality configuration */
 u32 kwmpp_config[] = {
MPP0_NF_IO2,
@@ -119,15 +117,39 @@ int ethernet_present(void)
return ret;
 }
 
+int initialize_unit_leds(void)
+{
+   /*
+* 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) {
+   printf("%s: Error reading Boco\n", __func__);
+   return -1;
+   }
+   buf |= APPLEDMASK;
+   if (i2c_write(BOCO, CTRL_H, 1, &buf, 1) != 0) {
+   printf("%s: Error writing Boco\n", __func__);
+   return -1;
+   }
+   return 0;
+}
+
 int misc_init_r(void)
 {
-   I2C_MUX_DEVICE  *i2cdev;
char *str;
int mach_type;
 
-   /* add I2C Bus for I/O Expander */
-   i2cdev = i2c_mux_ident_muxstring((uchar *)"pca9554a:70:a");
-   io_dev = i2cdev->busid;
puts("Piggy:");
if (ethernet_present() == 0)
puts (" not");
@@ -139,6 +161,9 @@ int misc_init_r(void)
printf("Overwriting MACH_TYPE with %d!!!\n", mach_type);
gd->bd->bi_arch_number = mach_type;
}
+
+   initialize_unit_leds();
+
return 0;
 }
 
@@ -245,7 +270,6 @@ void dram_init_banksize(void)
 
for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
gd->bd->bi_dram[i].start = kw_sdram_bar(i);
-   gd->bd->bi_dram[i].size = kw_sdram_bs(i);
gd->bd->bi_dram[i].size = get_ram_size((long *)kw_sdram_bar(i),
   kw_sdram_bs(i));
}
diff --git a/include/configs/km_arm.h b/include/configs/km_arm.h
index 5fa0153..8cb0fe8 100644
--- a/include/configs/km_arm.h
+++ b/include/configs/km_arm.h
@@ -49,6 +49,7 @@
 /* include common defines/options for all Keymile boards */
 #include "keymile-common.h"
 
+#define CONFIG_SYS_TEXT_BASE   0x0400  /* code address after reloc */
 #define CONFIG_ENV_SIZE(128 << 10) /* NAND chip block size 
*/
 #define CONFIG_SYS_MEMTEST_START 0x0040/* 4M */
 #define CONFIG_SYS_MEMTEST_END 0x007f  /*(_8M -1) */
diff --git a/include/configs/mgcoge2un.h b/include/configs/mgcoge2un.h
index 9f5464b..d3c7bdc 100644
--- a/include/configs/mgcoge2un.h
+++ b/include/configs/mgcoge2un.h
@@ -44,12 +44,14 @@
 
 #define CONFIG_HOSTNAMEmgcoge2un
 
+#define KM_IVM_BUS "pca9547:70:9" /* I2C2 (Mux-Port 1)*/
+#define KM_ENV_BUS "pca9547:70:d" /* I2C2 (Mux-Port 5)*/
+
 /*
  * Default environment variables
  */
 #define CONFIG_EXTRA_ENV_SETTINGS  \
CONFIG_KM_DEF_ENV   \
-   "memsize=0x800\0"   \
"newenv=setenv addr 0x10 && "   \
"i2c dev 1; mw.b ${addr} 0 4 && "   \
"eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR)\
@@ -57,7 +59,7 @@
"eeprom wr

[U-Boot] [PATCH v3 08/23] mpc832x: add support for mpc8321 based tuda1 board

2011-03-21 Thread Heiko Schocher
This board is similar to suvd3 board. So most initialisation topics
are taken from suvd3 (UART1, Ethernet, piggy PHY, flash, ram) only the
application specific chip selects differ.

Signed-off-by: Lukas Roggli 
Signed-off-by: Holger Brunck 
Signed-off-by: Heiko Schocher 
cc: Kim Phillips 
cc: Valentin Longchamp 
---
changes for v2:
  - fix checkpatch.pl errors and warnings
Changes for v3:
  - rebased only

 MAINTAINERS |1 +
 boards.cfg  |1 +
 include/configs/tuda1.h |  249 +++
 3 files changed, 251 insertions(+), 0 deletions(-)
 create mode 100644 include/configs/tuda1.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 801e4dd..cbc34af 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -434,6 +434,7 @@ Heiko Schocher 
sc3 PPC405GP
suen3   ARM926EJS (Kirkwood SoC)
suvd3   MPC8321
+   tuda1   MPC8321
tuxa1   MPC8321
uc101   MPC5200
ve8313  MPC8313
diff --git a/boards.cfg b/boards.cfg
index ed5e0e7..b3a4e9e 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -476,6 +476,7 @@ SIMPC8313_LP powerpc mpc83xx 
simpc8313   sheldon
 SIMPC8313_SP powerpc mpc83xx simpc8313   
sheldon-   SIMPC8313:NAND_SP
 suvd3powerpc mpc83xx km83xx  
keymile
 TQM834x  powerpc mpc83xx tqm834x tqc
+tuda1powerpc mpc83xx km83xx  
keymile
 tuxa1powerpc mpc83xx km83xx  
keymile
 sbc8540  powerpc mpc85xx sbc8560 - 
 -   SBC8540
 sbc8540_33   powerpc mpc85xx sbc8560 - 
 -   SBC8540
diff --git a/include/configs/tuda1.h b/include/configs/tuda1.h
new file mode 100644
index 000..a50a87d
--- /dev/null
+++ b/include/configs/tuda1.h
@@ -0,0 +1,249 @@
+/*
+ * Copyright (C) 2006 Freescale Semiconductor, Inc.
+ *Dave Liu 
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *Peter Barada 
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *Anton Vorontsov 
+ *
+ * (C) Copyright 2008
+ * Heiko Schocher, DENX Software Engineering, h...@denx.de.
+ *
+ * (C) Copyright 2010-2011
+ * Lukas Roggli, KEYMILE Ltd, lukas.rog...@keymile.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_QE  /* Has QE */
+#define CONFIG_MPC832x /* MPC832x CPU specific */
+#define CONFIG_TUDA1   /* TUDA1 board specific */
+#define CONFIG_HOSTNAMEtuda1
+#define CONFIG_KM_BOARD_NAME   "tuda1"
+
+#defineCONFIG_SYS_TEXT_BASE0xF000
+#define CONFIG_KM_DEF_NETDEV   \
+   "netdev=eth0\0"
+
+#define CONFIG_KM_DEF_ROOTPATH \
+   "rootpath=/opt/eldk/ppc_8xx\0"
+
+/* include common defines/options for all 83xx Keymile boards */
+#include "km83xx-common.h"
+
+#define CONFIG_MISC_INIT_R
+
+/*
+ * System IO Config
+ */
+#define CONFIG_SYS_SICRH   0x0006
+#define CONFIG_SYS_SICRL   SICRL_IRQ_CKS
+
+/*
+ * Hardware Reset Configuration Word
+ */
+#define CONFIG_SYS_HRCW_LOW (\
+   HRCWL_LCL_BUS_TO_SCB_CLK_1X1 | \
+   HRCWL_DDR_TO_SCB_CLK_2X1 | \
+   HRCWL_CSB_TO_CLKIN_2X1 | \
+   HRCWL_CORE_TO_CSB_2_5X1 | \
+   HRCWL_CE_PLL_VCO_DIV_2 | \
+   HRCWL_CE_TO_PLL_1X3)
+
+#define CONFIG_SYS_HRCW_HIGH (\
+   HRCWH_PCI_AGENT | \
+   HRCWH_PCI_ARBITER_DISABLE | \
+   HRCWH_CORE_ENABLE | \
+   HRCWH_FROM_0X0100 | \
+   HRCWH_BOOTSEQ_DISABLE | \
+   HRCWH_SW_WATCHDOG_DISABLE | \
+   HRCWH_ROM_LOC_LOCAL_16BIT | \
+   HRCWH_BIG_ENDIAN | \
+   HRCWH_LALE_NORMAL)
+
+#define CONFIG_SYS_DDR_CS0_BNDS0x007f
+#define CONFIG_SYS_DDR_SDRAM_CFG   (SDRAM_CFG_SDRAM_TYPE_DDR2 | \
+   SDRAM_CFG_32_BE | \
+   SDRAM_CFG_2T_EN | \
+   SDRAM_CFG_SREN)
+
+#define CONFIG_SYS_DDR_SDRAM_CFG2  0x00401000
+#define CONFIG_SYS_DDR_CLK_CNTL
(DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+#define CONFIG_SYS_DDR_INTERVAL((0x064 << 
SDRAM_INTERVAL_BSTOPRE_SHIFT) | \
+(0x200 << SDRAM_INTERVAL_REFINT_SHIFT))
+
+#define CONFIG_SYS_DDR_CS0_CONFIG  (CSCONFIG_EN | CSCONFIG_AP | \
+   CSCONFIG_ODT_WR_CFG | \
+   CSCONFIG_ROW_BIT

[U-Boot] [PATCH v3 09/23] arm: add support for kirkwood based mgcoge2un board

2011-03-21 Thread Heiko Schocher
This board is similar to keymile suen3.

Signed-off-by: Clive Stubbings 
Signed-off-by: Holger Brunck 
Signed-off-by: Heiko Schocher 
cc: Prafulla Wadaskar 
---
Changes for v2:
  - fix checkpatch.pl errors and warnings
Changes for v3:
  - rebased only

 MAINTAINERS |1 +
 boards.cfg  |1 +
 include/configs/km_arm.h|   41 
 include/configs/mgcoge2un.h |   63 +++
 include/configs/suen3.h |   41 
 5 files changed, 106 insertions(+), 41 deletions(-)
 create mode 100644 include/configs/mgcoge2un.h

diff --git a/MAINTAINERS b/MAINTAINERS
index cbc34af..4e7a8f7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -428,6 +428,7 @@ Heiko Schocher 
jupiter MPC5200
kmeter1 MPC8360
mgcoge  MPC8247
+   mgcoge2un   ARM926EJS (Kirkwood SoC)
mucmc52 MPC5200
muas3001MPC8270
municse MPC5200
diff --git a/boards.cfg b/boards.cfg
index b3a4e9e..1b45b5e 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -94,6 +94,7 @@ davinci_schmoogiearm arm926ejs   
schmoogie   davinci
 davinci_sffsdr   arm arm926ejs   sffsdr  
davincidavinci
 davinci_sonata   arm arm926ejs   sonata  
davincidavinci
 suen3arm arm926ejs   km_arm  
keymilekirkwood
+mgcoge2unarm arm926ejs   km_arm  
keymilekirkwood
 guruplug arm arm926ejs   -   
Marvellkirkwood
 mv88f6281gtw_ge  arm arm926ejs   -   
Marvellkirkwood
 openrd_base  arm arm926ejs   -   
Marvellkirkwood
diff --git a/include/configs/km_arm.h b/include/configs/km_arm.h
index a7c080b..2e38c12 100644
--- a/include/configs/km_arm.h
+++ b/include/configs/km_arm.h
@@ -200,6 +200,47 @@ int get_scl (void);
 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
 
+/*
+ *  Environment variables configurations
+ */
+#define CONFIG_ENV_IS_IN_EEPROM/* use EEPROM for environment 
vars */
+#define CONFIG_SYS_DEF_EEPROM_ADDR 0x50
+#define CONFIG_ENV_EEPROM_IS_ON_I2C
+#define CONFIG_SYS_EEPROM_WREN
+#define CONFIG_ENV_OFFSET  0x0 /* no bracets! */
+#undef CONFIG_ENV_SIZE
+#define CONFIG_ENV_SIZE(0x2000 - CONFIG_ENV_OFFSET)
+#define CONFIG_I2C_ENV_EEPROM_BUS  "pca9547:70:d\0"
+
+/* offset redund: (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) */
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
+#define CONFIG_ENV_OFFSET_REDUND   0x2000 /* no bracets! */
+#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
+
+#define CONFIG_CMD_SF
+
+#define CONFIG_SPI_FLASH
+#define CONFIG_HARD_SPI
+#define CONFIG_KIRKWOOD_SPI
+#define CONFIG_SPI_FLASH_STMICRO
+#define CONFIG_ENV_SPI_BUS 0
+#define CONFIG_ENV_SPI_CS  0
+#define CONFIG_ENV_SPI_MAX_HZ  5000/* 50Mhz */
+
+#define FLASH_GPIO_PIN 0x0001
+
+#define MTDIDS_DEFAULT "nand0=orion_nand"
+/* test-only: partitioning needs some tuning, this is just for tests */
+#define MTDPARTS_DEFAULT   "mtdparts=" \
+   "orion_nand:"   \
+   "-(" CONFIG_KM_UBI_PARTITION_NAME ")"
+
+#defineCONFIG_KM_DEF_ENV_UPDATE
\
+   "update="   \
+   "spi on;sf probe 0;sf erase 0 5;"   \
+   "sf write ${u-boot_addr_r} 0 ${filesize};"  \
+   "spi off\0"
+
 #if defined(CONFIG_SYS_NO_FLASH)
 #define CONFIG_KM_UBI_PARTITION_NAME   "ubi0"
 #undef CONFIG_FLASH_CFI_MTD
diff --git a/include/configs/mgcoge2un.h b/include/configs/mgcoge2un.h
new file mode 100644
index 000..9f5464b
--- /dev/null
+++ b/include/configs/mgcoge2un.h
@@ -0,0 +1,63 @@
+/*
+ * (C) Copyright 2009
+ * Marvell Semiconductor 
+ * Prafulla Wadaskar 
+ *
+ * (C) Copyright 2009
+ * Stefan Roese, DENX Software Engineering, s...@denx.de.
+ *
+ * (C) Copyright 2010-2011
+ * Holger Brunck, Keymile GmbH Hannover, holger.bru...@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 PURPOS

[U-Boot] [PATCH v3 00/23] keymile board update

2011-03-21 Thread Heiko Schocher
The following patchset updates the support for the keymile
boards.

- fix a lot of Codingstyle issues for this boards
- heavy rework of the headerfiles, common board code
- add support for 4 new mpc83xx based boards
- add support for 1 82xx based board
- add support for 2 new kirkwood based boards
- fix i2c deblocking for this boards

Heiko Schocher (16):
  powerpc, mpc83xx: add missing functions to mpc83xx.h
  keymile: Fix Coding style issues for keymile boards.
  mpc832x: add support for the mpc8321 based suvd3 board
  mpc832x: add support for mpc8321 based tuxa1 board
  mpc832x: add support for mpc8321 based tuda1 board
  arm: add support for kirkwood based mgcoge2un board
  arm: add support of Kirkwood based board SUEN8
  ppc: add support for ppc based board mgcoge2ne
  powerpc, 83xx: add kmsupx5 board support
  km-arm: i2c support for suenx based boards
  km_arm: change some register values for SDRAM initialization
  ppc, 8321: cleanup tuxa1, tuda1 and suvd3 support
  keymile, common; fix i2c deblocking support
  arm, keymile: updates for the arm based boards from keymile
  keymile boards: add CONFIG_PIGGY_MAC_ADRESS_OFFSET
  keymile, common: add setting of some environment variables

Holger Brunck (5):
  arm, keymile: rename MACH_SUEN3 to MACH_KM_KIRKWOOD
  ppc, arm: adapt keymile header
  arm, ppc: rework environment variables for keymile boards
  ppc, arm: rework and enhance keymile-common.h
  keymile-common.h: remove IO mux stuff

Thomas Herzmann (1):
  keymile boards: support of boardId / hwkey lists

Thomas Reufer (1):
  keymile, 8321 boards: move common definitions to km8321-common.h

 MAINTAINERS|7 +
 arch/powerpc/cpu/mpc83xx/fdt.c |3 +-
 arch/powerpc/lib/bootcount.c   |2 +-
 board/keymile/common/common.c  |  496 
 board/keymile/common/common.h  |   44 +++-
 board/keymile/{kmeter1 => km83xx}/Makefile |0
 board/keymile/km83xx/km83xx.c  |  288 
 board/keymile/km_arm/km_arm.c  |   91 --
 board/keymile/km_arm/kwbimage.cfg  |   32 +-
 board/keymile/kmeter1/kmeter1.c|  217 
 board/keymile/mgcoge/mgcoge.c  |   93 +++---
 boards.cfg |9 +-
 include/configs/keymile-common.h   |  489 +++-
 include/configs/km-powerpc.h   |   92 +
 include/configs/km82xx-common.h|  336 +++
 include/configs/km8321-common.h|  138 
 include/configs/km83xx-common.h|  325 ++
 include/configs/km_arm.h   |  104 +-
 include/configs/kmeter1.h  |  369 +++---
 include/configs/kmsupx5.h  |   91 +
 include/configs/mgcoge.h   |  307 +-
 include/configs/mgcoge2ne.h|   64 
 include/configs/mgcoge2un.h|   65 
 include/configs/suen3.h|   45 +---
 include/configs/suen8.h|   65 
 include/configs/suvd3.h|  104 ++
 include/configs/tuda1.h|  141 
 include/configs/tuxa1.h|  124 +++
 include/mpc83xx.h  |6 +
 29 files changed, 2794 insertions(+), 1353 deletions(-)
 rename board/keymile/{kmeter1 => km83xx}/Makefile (100%)
 create mode 100644 board/keymile/km83xx/km83xx.c
 delete mode 100644 board/keymile/kmeter1/kmeter1.c
 create mode 100644 include/configs/km-powerpc.h
 create mode 100644 include/configs/km82xx-common.h
 create mode 100644 include/configs/km8321-common.h
 create mode 100644 include/configs/km83xx-common.h
 create mode 100644 include/configs/kmsupx5.h
 create mode 100644 include/configs/mgcoge2ne.h
 create mode 100644 include/configs/mgcoge2un.h
 create mode 100644 include/configs/suen8.h
 create mode 100644 include/configs/suvd3.h
 create mode 100644 include/configs/tuda1.h
 create mode 100644 include/configs/tuxa1.h

-- 
1.7.4

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


[U-Boot] [PATCH v3 14/23] km-arm: i2c support for suenx based boards

2011-03-21 Thread Heiko Schocher
This patch renames the suen3 defines and functions to KM_KIRKWOOD
which is more generic and more precise, because these values
and functions where used by all suenX boards and not only suen3.

Signed-off-by: Lukas Roggli 
Signed-off-by: Valentin Longchamp 
Signed-off-by: Holger Brunck 
Signed-off-by: Heiko Schocher 
cc: Prafulla Wadaskar 
---
Changes for v2:
  - fix checkpatch.pl errors and warnings
Changes for v3:
  - rebased only

 board/keymile/km_arm/km_arm.c |   20 ++--
 include/configs/km_arm.h  |   18 +-
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c
index 9d0892d..9dafcef 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -95,7 +95,7 @@ u32 kwmpp_config[] = {
MPP41_GPIO, /* Piggy3 LED[4] */
MPP42_GPIO, /* Piggy3 LED[5] */
MPP43_GPIO, /* Piggy3 LED[6] */
-   MPP44_GPIO, /* Piggy3 LED[7] */
+   MPP44_GPIO, /* Piggy3 LED[7], BIST_EN_L */
MPP45_GPIO, /* Piggy3 LED[8] */
MPP46_GPIO, /* Reserved */
MPP47_GPIO, /* Reserved */
@@ -161,14 +161,14 @@ int board_early_init_f(void)
 
 #if defined(CONFIG_SOFT_I2C)
/* init the GPIO for I2C Bitbang driver */
-   kw_gpio_set_valid(SUEN3_SDA_PIN, 1);
-   kw_gpio_set_valid(SUEN3_SCL_PIN, 1);
-   kw_gpio_direction_output(SUEN3_SDA_PIN, 0);
-   kw_gpio_direction_output(SUEN3_SCL_PIN, 0);
+   kw_gpio_set_valid(KM_KIRKWOOD_SDA_PIN, 1);
+   kw_gpio_set_valid(KM_KIRKWOOD_SCL_PIN, 1);
+   kw_gpio_direction_output(KM_KIRKWOOD_SDA_PIN, 0);
+   kw_gpio_direction_output(KM_KIRKWOOD_SCL_PIN, 0);
 #endif
 #if defined(CONFIG_SYS_EEPROM_WREN)
-   kw_gpio_set_valid(SUEN3_ENV_WP, 38);
-   kw_gpio_direction_output(SUEN3_ENV_WP, 1);
+   kw_gpio_set_valid(KM_KIRKWOOD_ENV_WP, 38);
+   kw_gpio_direction_output(KM_KIRKWOOD_ENV_WP, 1);
 #endif
 
return 0;
@@ -321,15 +321,15 @@ int get_sda(void)
 
 int get_scl(void)
 {
-   return (kw_gpio_get_value(SUEN3_SCL_PIN) ? 1 : 0);
+   return kw_gpio_get_value(KM_KIRKWOOD_SCL_PIN) ? 1 : 0;
 }
 #endif
 
 #if defined(CONFIG_SYS_EEPROM_WREN)
 int eeprom_write_enable(unsigned dev_addr, int state)
 {
-   kw_gpio_set_value(SUEN3_ENV_WP, !state);
+   kw_gpio_set_value(KM_KIRKWOOD_ENV_WP, !state);
 
-   return !kw_gpio_get_value(SUEN3_ENV_WP);
+   return !kw_gpio_get_value(KM_KIRKWOOD_ENV_WP);
 }
 #endif
diff --git a/include/configs/km_arm.h b/include/configs/km_arm.h
index 2e38c12..5fa0153 100644
--- a/include/configs/km_arm.h
+++ b/include/configs/km_arm.h
@@ -179,15 +179,15 @@ void set_sda (int state);
 void set_scl (int state);
 int get_sda (void);
 int get_scl (void);
-#define SUEN3_SDA_PIN  8
-#define SUEN3_SCL_PIN  9
-#define SUEN3_ENV_WP   38
-
-#define I2C_ACTIVE __set_direction(SUEN3_SDA_PIN, 0)
-#define I2C_TRISTATE   __set_direction(SUEN3_SDA_PIN, 1)
-#define I2C_READ   (kw_gpio_get_value(SUEN3_SDA_PIN) ? 1 : 0)
-#define I2C_SDA(bit)   kw_gpio_set_value(SUEN3_SDA_PIN, bit);
-#define I2C_SCL(bit)   kw_gpio_set_value(SUEN3_SCL_PIN, bit);
+#define KM_KIRKWOOD_SDA_PIN8
+#define KM_KIRKWOOD_SCL_PIN9
+#define KM_KIRKWOOD_ENV_WP 38
+
+#define I2C_ACTIVE __set_direction(KM_KIRKWOOD_SDA_PIN, 0)
+#define I2C_TRISTATE   __set_direction(KM_KIRKWOOD_SDA_PIN, 1)
+#define I2C_READ   (kw_gpio_get_value(KM_KIRKWOOD_SDA_PIN) ? 1 : 0)
+#define I2C_SDA(bit)   kw_gpio_set_value(KM_KIRKWOOD_SDA_PIN, bit)
+#define I2C_SCL(bit)   kw_gpio_set_value(KM_KIRKWOOD_SCL_PIN, bit)
 #endif
 
 #define I2C_DELAY  udelay(3)   /* 1/4 I2C clock duration */
-- 
1.7.4

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


[U-Boot] [PATCH v3 10/23] arm: add support of Kirkwood based board SUEN8

2011-03-21 Thread Heiko Schocher
The Kirwood based SUEN8 board from Keymile is at this stage
the same than the suen3 board. This patch adds the board
support for the suen8.

Signed-off-by: Holger Brunck 
Signed-off-by: Heiko Schocher 
cc: Prafulla Wadaskar 
---
Changes for v2:
  - fix checkpatch.pl errors and warnings
Changes for v3:
  - rebased only

 MAINTAINERS |1 +
 boards.cfg  |1 +
 include/configs/suen8.h |   63 +++
 3 files changed, 65 insertions(+), 0 deletions(-)
 create mode 100644 include/configs/suen8.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 4e7a8f7..9644d38 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -434,6 +434,7 @@ Heiko Schocher 
municse MPC5200
sc3 PPC405GP
suen3   ARM926EJS (Kirkwood SoC)
+   suen8   ARM926EJS (Kirkwood SoC)
suvd3   MPC8321
tuda1   MPC8321
tuxa1   MPC8321
diff --git a/boards.cfg b/boards.cfg
index 1b45b5e..22cb509 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -94,6 +94,7 @@ davinci_schmoogiearm arm926ejs   
schmoogie   davinci
 davinci_sffsdr   arm arm926ejs   sffsdr  
davincidavinci
 davinci_sonata   arm arm926ejs   sonata  
davincidavinci
 suen3arm arm926ejs   km_arm  
keymilekirkwood
+suen8arm arm926ejs   km_arm  
keymilekirkwood
 mgcoge2unarm arm926ejs   km_arm  
keymilekirkwood
 guruplug arm arm926ejs   -   
Marvellkirkwood
 mv88f6281gtw_ge  arm arm926ejs   -   
Marvellkirkwood
diff --git a/include/configs/suen8.h b/include/configs/suen8.h
new file mode 100644
index 000..cdda4af
--- /dev/null
+++ b/include/configs/suen8.h
@@ -0,0 +1,63 @@
+/*
+ * (C) Copyright 2009
+ * Marvell Semiconductor 
+ * Prafulla Wadaskar 
+ *
+ * (C) Copyright 2009
+ * Stefan Roese, DENX Software Engineering, s...@denx.de.
+ *
+ * (C) Copyright 2010-2011
+ * Holger Brunck, Keymile GmbH Hannover, holger.bru...@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
+ */
+
+/* for linking errors see
+ * http://lists.denx.de/pipermail/u-boot/2009-July/057350.html */
+
+#ifndef _CONFIG_SUEN8_H
+#define _CONFIG_SUEN8_H
+
+/* include common defines/options for all arm based Keymile boards */
+#include "km_arm.h"
+
+/*
+ * Version number information
+ */
+#define CONFIG_IDENT_STRING"\nKeymile SUEN8"
+
+#define CONFIG_HOSTNAMEsuen8
+
+/*
+ * Default environment variables
+ */
+#define CONFIG_EXTRA_ENV_SETTINGS  \
+   CONFIG_KM_DEF_ENV   \
+   "memsize=0x800\0"   \
+   "newenv=setenv addr 0x10 && "   \
+   "i2c dev 1; mw.b ${addr} 0 4 && "   \
+   "eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR)\
+   " ${addr} " xstr(CONFIG_ENV_OFFSET) " 4 && "\
+   "eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR)\
+   " ${addr} " xstr(CONFIG_ENV_OFFSET_REDUND) " 4\0"   \
+   "rootpath=/opt/eldk/arm\0"  \
+   "EEprom_ivm=pca9544a:70:9\0"\
+   ""
+
+#endif /* _CONFIG_SUEN8_H */
-- 
1.7.4

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


[U-Boot] [PATCH v3 02/23] arm, keymile: rename MACH_SUEN3 to MACH_KM_KIRKWOOD

2011-03-21 Thread Heiko Schocher
From: Holger Brunck 

The MACH_TYPE SUEN3 is now to specific for keymile boards, because
other boards similar to suen3 will follow. So the MACH_SUEN3 was renamed
to MACH_KM_KIRKWOOD.

Signed-off-by: Holger Brunck 
Signed-off-by: Heiko Schocher 
cc: Wolfgang Denk 
cc: Valentin Longchamp 
cc: Prafulla Wadaskar 
---
Changes for v2:
  - fix checkpatch.pl errors and warnings
Changes for v3:
  - rebased only

 board/keymile/common/common.c |4 ++--
 board/keymile/km_arm/km_arm.c |2 +-
 include/configs/km_arm.h  |2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 7b4eefd..86be9c2 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -500,7 +500,7 @@ void i2c_init_board(void)
out_8 (&dev->cr, (I2C_CR_MEN));
 
 #else
-#if defined(CONFIG_HARD_I2C) && !defined(CONFIG_MACH_SUEN3)
+#if defined(CONFIG_HARD_I2C) && !defined(MACH_TYPE_KM_KIRKWOOD)
volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR ;
volatile i2c8260_t *i2c = (i2c8260_t *)&immap->im_i2c;
 
@@ -578,7 +578,7 @@ int fdt_get_node_and_value (void *blob,
 }
 #endif
 
-#if !defined(CONFIG_MACH_SUEN3)
+#if !defined(MACH_TYPE_KM_KIRKWOOD)
 int ethernet_present (void)
 {
return (in_8((u8 *)CONFIG_SYS_PIGGY_BASE + CONFIG_SYS_SLOT_ID_OFF) & 
0x80);
diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c
index 2e20644..5c1e822 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -180,7 +180,7 @@ int board_init(void)
/*
 * arch number of board
 */
-   gd->bd->bi_arch_number = MACH_TYPE_SUEN3;
+   gd->bd->bi_arch_number = MACH_TYPE_KM_KIRKWOOD;
 
/* address of boot parameters */
gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
diff --git a/include/configs/km_arm.h b/include/configs/km_arm.h
index bf77cc0..533da73 100644
--- a/include/configs/km_arm.h
+++ b/include/configs/km_arm.h
@@ -38,7 +38,7 @@
 #define CONFIG_FEROCEON_88FR131/* CPU Core subversion */
 #define CONFIG_KIRKWOOD/* SOC Family Name */
 #define CONFIG_KW88F6281   /* SOC Name */
-#define CONFIG_MACH_SUEN3  /* Machine type */
+#define CONFIG_MACH_KM_KIRKWOOD/* Machine type */
 
 /* include common defines/options for all Keymile boards */
 #include "keymile-common.h"
-- 
1.7.4

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