Re: [U-Boot] p4080ds starts OS with MSR[EE]=1 and DEC armed?

2011-03-15 Thread Kumar Gala

On Mar 14, 2011, at 4:37 PM, Scott Wood wrote:

 On Mon, 14 Mar 2011 16:25:54 -0500
 Kumar Gala ga...@kernel.crashing.org wrote:
 
 
 On Mar 14, 2011, at 1:09 PM, Scott Wood wrote:
 
 On Sat, 12 Mar 2011 16:56:09 -0600
 Kumar Gala ga...@kernel.crashing.org wrote:
 
 
 On Mar 3, 2011, at 8:59 AM, Jimi Xenidis wrote:
 
 I was surprised to find myself at the decrement interrupt when running my 
 new stuff.
 That is against ePAPR, right?
 Does u-boot at least make sure that the DEC is set to some large value 
 before it leaps at me?
 I don't mind forcing EE=0 but I'd like to make sure I make it that far 
 into the code :)
 -JX
 
 Jimi,
 
 Not sure how or why you are seeing this, but u-boot should disable 
 interrupts in common/cmd_bootm.c
 
 Look for disable_interrupts() - this should set MSR[EE] = 0.
 
 What about the rest of MSR -- ME/CE/DE?
 
 I dont think we ever turn on CE in u-boot, DE would only get set in some 
 weird external debugger build.
 
 From arch/powerpc/cpu/mpc85xx/start.S:
 
/* switch back to AS = 0 */
lis r3,(MSR_CE|MSR_ME|MSR_DE)@h
ori r3,r3,(MSR_CE|MSR_ME|MSR_DE)@l
mtmsr   r3
isync
 
bl  cpu_init_f
bl  board_init_f
isync
 
 -Scott

commit 15fba3279b56333bdb65ead366f82c945ed320d1
Author: Kumar Gala ga...@kernel.crashing.org
Date:   Fri Sep 11 15:28:41 2009 -0500

ppc/85xx: Disable all async interrupt sources when we boot

We should make sure to clear MSR[ME, CE, DE] when we boot an OS image
since we have changed the exception vectors and the OSes vectors might
not be setup we should avoid async interrupts at all costs.

Signed-off-by: Kumar Gala ga...@kernel.crashing.org

diff --git a/cpu/mpc85xx/cpu_init.c b/cpu/mpc85xx/cpu_init.c
index 48a82ed..a6d1e99 100644
--- a/cpu/mpc85xx/cpu_init.c
+++ b/cpu/mpc85xx/cpu_init.c
@@ -364,5 +364,16 @@ extern void setup_ivors(void);
 
 void arch_preboot_os(void)
 {
+   u32 msr;
+
+   /*
+* We are changing interrupt offsets and are about to boot the OS so
+* we need to make sure we disable all async interrupts. EE is already
+* disabled by the time we get called.
+*/
+   msr = mfmsr();
+   msr = ~(MSR_ME|MSR_CE|MSR_DE);
+   mtmsr(msr);
+
setup_ivors();
 }

-

:)

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


[U-Boot] [PATCH] powerpc/85xx: Fix synchronization of timebase on MP boot

2011-03-15 Thread Kumar Gala
There is a small ordering issue in the master core in that we need to
make sure the disabling of the timebase in the SoC is visible before we
set the value to 0.  We can simply just read back the value to
synchronizatize the write, before we set TB to 0.

Reported-by: Dan Hettena
Tested-by: Dan Hettena
Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
 arch/powerpc/cpu/mpc85xx/mp.c |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/mp.c b/arch/powerpc/cpu/mpc85xx/mp.c
index 6c0da83..758e6d7 100644
--- a/arch/powerpc/cpu/mpc85xx/mp.c
+++ b/arch/powerpc/cpu/mpc85xx/mp.c
@@ -276,8 +276,13 @@ static void plat_mp_up(unsigned long bootpg)
 
/* enable time base at the platform */
out_be32(rcpm-ctbenrl, 0);
+
+   /* readback to sync write */
+   in_be32(rcpm-ctbenrl);
+
mtspr(SPRN_TBWU, 0);
mtspr(SPRN_TBWL, 0);
+
out_be32(rcpm-ctbenrl, (1  nr_cpus) - 1);
 
 #ifdef CONFIG_MPC8xxx_DISABLE_BPTR
@@ -347,6 +352,10 @@ static void plat_mp_up(unsigned long bootpg)
else
devdisr |= MPC85xx_DEVDISR_TB0;
out_be32(gur-devdisr, devdisr);
+
+   /* readback to sync write */
+   in_be32(gur-devdisr);
+
mtspr(SPRN_TBWU, 0);
mtspr(SPRN_TBWL, 0);
 
-- 
1.7.2.3

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


Re: [U-Boot] Uboot- Nor flash

2011-03-15 Thread Hebbar, Gururaja
Hi,

On Tue, Mar 15, 2011 at 11:07:46, Sanjeeva Kumara wrote:
 Hi pls help me...
 How the boot image is read into memory from where exactly execution 
 starts...
 

1. what is your board configuration (memory, Processor, ram, etc..)
2. Is your board inside u-boot repository ?. what is the board config name 

Regards
Gururaja




 
 -Original Message-
 From: Hebbar, Gururaja [mailto:gururaja.heb...@ti.com]
 Sent: Friday, March 11, 2011 6:14 PM
 To: Sanjeeva Kumara; u-boot@lists.denx.de
 Subject: RE: Uboot- Nor flash
 
 Hi,
 
 On Fri, Mar 11, 2011 at 14:02:20, Sanjeeva Kumara wrote:
  Hi
  My self Sanjeev.  I'm working on marvell's processor ( PXA ). I'm using NOR 
  flash to port Uboot. I want to do partition in NOR flash so that in one 
  partition I can keep my master copy and provide Uboot upgrade option. 
  Please suggest me how can I achieve this.
 
 
 The quickest would be to use CONFIG_SYS_FLASH_AUTOPROTECT_LIST. Search for 
 this config and this will help you setup autoprotect options for various 
 partitions.
 
 
 Regards,
 Gururaja
 
 
 Larsen  Toubro Limited
 
 www.larsentoubro.com
 
 This Email may contain confidential or privileged information for the 
 intended recipient (s) If you are not the intended recipient, please do not 
 use or disseminate the information, notify the sender and delete it from your 
 system.
 


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


Re: [U-Boot] [PATCH] powerpc/85xx: Fix synchronization of timebase on MP boot

2011-03-15 Thread Kumar Gala

On Mar 15, 2011, at 1:25 AM, Kumar Gala wrote:

 There is a small ordering issue in the master core in that we need to
 make sure the disabling of the timebase in the SoC is visible before we
 set the value to 0.  We can simply just read back the value to
 synchronizatize the write, before we set TB to 0.
 
 Reported-by: Dan Hettena
 Tested-by: Dan Hettena
 Signed-off-by: Kumar Gala ga...@kernel.crashing.org
 ---
 arch/powerpc/cpu/mpc85xx/mp.c |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

applied

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


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

2011-03-15 Thread Kumar Gala
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(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 2/5] mvi2c: use structure to replace the direclty define

2011-03-15 Thread Heiko Schocher
Hello Lei,

Lei Wen wrote:
 Signed-off-by: Lei Wen lei...@marvell.com
 ---
  arch/arm/cpu/pxa/cpu.c   |   11 +++
  arch/arm/include/asm/arch-pxa/pxa-regs.h |   56 
  board/innokom/innokom.c  |9 +--
  drivers/i2c/mvi2c.c  |  139 
 +-
  include/configs/innokom.h|1 +
  include/configs/xm250.h  |1 +
  6 files changed, 111 insertions(+), 106 deletions(-)
 
 diff --git a/arch/arm/cpu/pxa/cpu.c b/arch/arm/cpu/pxa/cpu.c
 index 7d49cbb..24b59e7 100644
 --- a/arch/arm/cpu/pxa/cpu.c
 +++ b/arch/arm/cpu/pxa/cpu.c
 @@ -318,3 +318,14 @@ int arch_cpu_init(void)
   pxa_clock_setup();
   return 0;
  }
 +
 +void i2c_clk_enable(void)
 +{
 +#ifdef CONFIG_CPU_MONAHANS
 + /* | CKENB_1_PWM1 | CKENB_0_PWM0); */
 + writel(readl(CKENB) | (CKENB_4_I2C), CKENB);
 +#else /* CONFIG_CPU_MONAHANS */
 + /* set the global I2C clock on */
 + writel(readl(CKEN) | CKEN14_I2C, CKEN);
 +#endif
 +}
 diff --git a/arch/arm/include/asm/arch-pxa/pxa-regs.h 
 b/arch/arm/include/asm/arch-pxa/pxa-regs.h
 index 65a387f..109fdc0 100644
 --- a/arch/arm/include/asm/arch-pxa/pxa-regs.h
 +++ b/arch/arm/include/asm/arch-pxa/pxa-regs.h
 @@ -456,62 +456,6 @@ typedef void (*ExcpHndlr) (void) ;
   IrSR_XMITIR_IR_MODE)
  
  /*
 - * I2C registers
 - */
 -#define IBMR 0x40301680  /* I2C Bus Monitor Register - IBMR */
 -#define IDBR 0x40301688  /* I2C Data Buffer Register - IDBR */
 -#define ICR  0x40301690  /* I2C Control Register - ICR */
 -#define ISR  0x40301698  /* I2C Status Register - ISR */
 -#define ISAR 0x403016A0  /* I2C Slave Address Register - ISAR */
 -
 -#ifdef CONFIG_CPU_MONAHANS
 -#define PWRIBMR  0x40f500C0  /* Power I2C Bus Monitor 
 Register-IBMR */
 -#define PWRIDBR  0x40f500C4  /* Power I2C Data Buffer 
 Register-IDBR */
 -#define PWRICR   0x40f500C8  /* Power I2C Control Register - ICR 
 */
 -#define PWRISR   0x40f500CC  /* Power I2C Status Register - ISR 
 */
 -#define PWRISAR  0x40f500D0  /* Power I2C Slave Address 
 Register-ISAR */
 -#else
 -#define PWRIBMR  0x40f00180  /* Power I2C Bus Monitor 
 Register-IBMR */
 -#define PWRIDBR  0x40f00188  /* Power I2C Data Buffer 
 Register-IDBR */
 -#define PWRICR   0x40f00190  /* Power I2C Control Register - ICR 
 */
 -#define PWRISR   0x40f00198  /* Power I2C Status Register - ISR 
 */
 -#define PWRISAR  0x40f001A0  /* Power I2C Slave Address 
 Register-ISAR */
 -#endif
 -
 -/* - Control register bits  */
 -
 -#define ICR_START0x1 /* start bit */
 -#define ICR_STOP 0x2 /* stop bit */
 -#define ICR_ACKNAK   0x4 /* send ACK(0) or NAK(1) */
 -#define ICR_TB   0x8 /* transfer byte bit */
 -#define ICR_MA   0x10/* master abort */
 -#define ICR_SCLE 0x20/* master clock enable, mona SCLEA */
 -#define ICR_IUE  0x40/* unit enable */
 -#define ICR_GCD  0x80/* general call disable */
 -#define ICR_ITEIE0x100   /* enable tx interrupts */
 -#define ICR_IRFIE0x200   /* enable rx interrupts, mona: DRFIE */
 -#define ICR_BEIE 0x400   /* enable bus error ints */
 -#define ICR_SSDIE0x800   /* slave STOP detected int enable */
 -#define ICR_ALDIE0x1000  /* enable arbitration interrupt */
 -#define ICR_SADIE0x2000  /* slave address detected int enable */
 -#define ICR_UR   0x4000  /* unit reset */
 -#define ICR_FM   0x8000  /* Fast Mode */
 -
 -/* - Status register bits - */
 -
 -#define ISR_RWM  0x1 /* read/write mode */
 -#define ISR_ACKNAK   0x2 /* ack/nak status */
 -#define ISR_UB   0x4 /* unit busy */
 -#define ISR_IBB  0x8 /* bus busy */
 -#define ISR_SSD  0x10/* slave stop detected */
 -#define ISR_ALD  0x20/* arbitration loss detected */
 -#define ISR_ITE  0x40/* tx buffer empty */
 -#define ISR_IRF  0x80/* rx buffer full */
 -#define ISR_GCAD 0x100   /* general call address detected */
 -#define ISR_SAD  0x200   /* slave address detected */
 -#define ISR_BED  0x400   /* bus error no ACK/NAK */
 -
 -/*
   * Serial Audio Controller
   */
  /* FIXME the audio defines collide w/ the SA defines.  I don't like these
 diff --git a/board/innokom/innokom.c b/board/innokom/innokom.c
 index e658c35..22de7e3 100644
 --- a/board/innokom/innokom.c
 +++ b/board/innokom/innokom.c
 @@ -45,12 +45,7 @@ 

Re: [U-Boot] [PATCH v2 3/5] I2C: add i2c support for Pantheon platform

2011-03-15 Thread Heiko Schocher
Hello Lei,

Lei Wen wrote:
 Add i2c support to dkb board with pantheon soc.
 
 Signed-off-by: Lei Wen lei...@marvell.com
 ---
  arch/arm/cpu/arm926ejs/pantheon/cpu.c|   10 ++
  arch/arm/include/asm/arch-pantheon/cpu.h |4 +++-
  arch/arm/include/asm/arch-pantheon/mfp.h |2 ++
  board/Marvell/dkb/dkb.c  |4 
  include/configs/dkb.h|   11 +++
  5 files changed, 30 insertions(+), 1 deletions(-)
 
 diff --git a/arch/arm/cpu/arm926ejs/pantheon/cpu.c 
 b/arch/arm/cpu/arm926ejs/pantheon/cpu.c
 index 9ddc77c..88ecfae 100644
 --- a/arch/arm/cpu/arm926ejs/pantheon/cpu.c
 +++ b/arch/arm/cpu/arm926ejs/pantheon/cpu.c
 @@ -59,6 +59,10 @@ int arch_cpu_init(void)
   /* Enable GPIO clock */
   writel(APBC_APBCLK, apbclkres-gpio);
  
 + /* Enable I2C clock */
 + writel(APBC_RST | APBC_FNCLK | APBC_APBCLK, apbclkres-twsi);
 + writel(APBC_FNCLK | APBC_APBCLK, apbclkres-twsi);
 +
   icache_enable();
  
   return 0;
 @@ -76,3 +80,9 @@ int print_cpuinfo(void)
   return 0;
  }
  #endif
 +
 +#ifdef CONFIG_I2C_MV
 +void i2c_clk_enable (void)
 +{
 +}
 +#endif
 diff --git a/arch/arm/include/asm/arch-pantheon/cpu.h 
 b/arch/arm/include/asm/arch-pantheon/cpu.h
 index 30f4393..60955c5 100644
 --- a/arch/arm/include/asm/arch-pantheon/cpu.h
 +++ b/arch/arm/include/asm/arch-pantheon/cpu.h
 @@ -50,7 +50,9 @@ struct panthapb_registers {
   u32 uart0;  /*0x000*/
   u32 uart1;  /*0x004*/
   u32 gpio;   /*0x008*/
 - u8 pad0[0x034 - 0x08 - 4];
 + u8 pad0[0x02c - 0x08 - 4];
 + u32 twsi;   /*0x02c*/
 + u8 pad1[0x034 - 0x2c - 4];
   u32 timers; /*0x034*/
  };
  
 diff --git a/arch/arm/include/asm/arch-pantheon/mfp.h 
 b/arch/arm/include/asm/arch-pantheon/mfp.h
 index fb291cf..041e64c 100644
 --- a/arch/arm/include/asm/arch-pantheon/mfp.h
 +++ b/arch/arm/include/asm/arch-pantheon/mfp.h
 @@ -34,6 +34,8 @@
  /* UART2 */
  #define MFP47_UART2_RXD  MFP_REG(0x198) | MFP_AF6 | 
 MFP_DRIVE_MEDIUM
  #define MFP48_UART2_TXD  MFP_REG(0x19c) | MFP_AF6 | 
 MFP_DRIVE_MEDIUM
 +#define MFP53_CI2C_SCL   MFP_REG(0x1b0) | MFP_AF2 | 
 MFP_DRIVE_MEDIUM
 +#define MFP54_CI2C_SDA   MFP_REG(0x1b4) | MFP_AF2 | 
 MFP_DRIVE_MEDIUM

Please add braces around this multiple or concatenation

  /* More macros can be defined here... */
  
 diff --git a/board/Marvell/dkb/dkb.c b/board/Marvell/dkb/dkb.c
 index 72a2d2a..00f73e7 100644
 --- a/board/Marvell/dkb/dkb.c
 +++ b/board/Marvell/dkb/dkb.c
 @@ -36,6 +36,10 @@ int board_early_init_f(void)
   MFP47_UART2_RXD,
   MFP48_UART2_TXD,
  
 + /* I2C */
 + MFP53_CI2C_SCL,
 + MFP54_CI2C_SDA,
 +
   MFP_EOC /*End of configureation*/
   };
   /* configure MFP's */
 diff --git a/include/configs/dkb.h b/include/configs/dkb.h
 index 638af5e..75c4b99 100644
 --- a/include/configs/dkb.h
 +++ b/include/configs/dkb.h
 @@ -56,6 +56,17 @@
  #include mv-common.h
  
  #undef CONFIG_ARCH_MISC_INIT
 +
 +/*
 + * I2C definition
 + */
 +#define CONFIG_CMD_I2C
 +#define CONFIG_I2C_MV1
 +#define CONFIG_PXA_I2C_REG   0xd4011000
 +#define CONFIG_HARD_I2C  1
 +#define CONFIG_SYS_I2C_SPEED 0
 +#define CONFIG_SYS_I2C_SLAVE 0xfe
 +
  /*
   * Environment variables configurations
   */

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 v2 4/5] I2C: mvi2c: add multi bus support

2011-03-15 Thread Heiko Schocher
Hello Lei,

Lei Wen wrote:
 Signed-off-by: Lei Wen lei...@marvell.com
 ---
  drivers/i2c/mvi2c.c |   37 -
  1 files changed, 36 insertions(+), 1 deletions(-)
 
 diff --git a/drivers/i2c/mvi2c.c b/drivers/i2c/mvi2c.c
 index 0e37417..ca1add8 100644
 --- a/drivers/i2c/mvi2c.c
 +++ b/drivers/i2c/mvi2c.c
 @@ -131,9 +131,38 @@ struct pxa_i2c {
   u32 isar;
  };
  
 -static struct pxa_i2c *base = (struct pxa_i2c *)CONFIG_PXA_I2C_REG;
  #define PXAI2C_AND(reg, val) writel(readl(reg)  val, reg)
  #define PXAI2C_OR(reg, val)  writel(readl(reg) | val, reg)
 +static struct pxa_i2c *base;
 +
 +#ifdef CONFIG_I2C_MULTI_BUS
 +static u32 i2c_regs[CONFIG_PXA_I2C_NUM] = CONFIG_PXA_I2C_REG;
 +static unsigned int bus_initialized[CONFIG_PXA_I2C_NUM];
 +static unsigned int current_bus = 0;
 +
 +int i2c_set_bus_num(unsigned int bus)
 +{
 + if ((bus  0) || (bus = CONFIG_PXA_I2C_NUM)) {
 + printf(Bad bus: %d\n, bus);
 + return -1;
 + }
 +
 + base = (struct pxa_i2c *)i2c_regs[bus];
 + current_bus = bus;
 +
 + if(!bus_initialized[current_bus]) {
  ^
  add a space here, thanks

 + i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 + bus_initialized[current_bus] = 1;
 + }
 +
 + return 0;
 +}
 +
 +unsigned int i2c_get_bus_num(void)
 +{
 + return current_bus;
 +}
 +#endif
  
  /**
   * i2c_pxa_reset: - reset the host controller
 @@ -311,6 +340,12 @@ i2c_transfer_finish:
  
  void i2c_init(int speed, int slaveaddr)
  {
 +#ifdef CONFIG_I2C_MULTI_BUS
 + base = (struct pxa_i2c *)i2c_regs[current_bus];
 +#else
 + base = (struct pxa_i2c *)CONFIG_PXA_I2C_REG;
 +#endif
 +
  #ifdef CONFIG_SYS_I2C_INIT_BOARD
   u32 icr;
   /* call board specific i2c bus reset routine before accessing the   */

beside of that, your patch looks good.

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


[U-Boot] [PATCH v3] This patch fix the usage of the CE don't care-type NAND chips

2011-03-15 Thread Michael Trimarchi
atmel_nand: don't require CONFIG_SYS_NAND_ENABLE_PIN
If NCE is hooked up to NCS3, we don't need to (and can't)
explicitly set the state of the NCE pin. Instead, the
controller asserts it automatically as part of a
command/data access. Only CE don't care-type NAND chips
can be used in this manner.

Signed-off-by: Michael Trimarchi mich...@amarulasolutions.com
Cc: Scott Wood scottw...@freescale.com
Cc: Reinhard Meyer u-b...@emk-elektronik.de

---
Change since V1
- add a better description
Change since V2:
- change commit message

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index ab8bbb3..818d362 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -249,8 +249,10 @@ static void at91_nand_hwcontrol(struct mtd_info *mtd,
if (ctrl  NAND_ALE)
IO_ADDR_W |= CONFIG_SYS_NAND_MASK_ALE;
 
+#ifdef CONFIG_SYS_NAND_ENABLE_PIN
at91_set_gpio_value(CONFIG_SYS_NAND_ENABLE_PIN,
!(ctrl  NAND_NCE));
+#endif
this-IO_ADDR_W = (void *) IO_ADDR_W;
}
 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 5/5] I2C: add i2c support for Armada100 platform

2011-03-15 Thread Heiko Schocher
Hello Lei,

Lei Wen wrote:
 Signed-off-by: Lei Wen lei...@marvell.com
 ---
  arch/arm/cpu/arm926ejs/armada100/cpu.c|   14 ++
  arch/arm/include/asm/arch-armada100/mfp.h |4 
  board/Marvell/aspenite/aspenite.c |5 +
  include/configs/aspenite.h|   12 
  4 files changed, 35 insertions(+), 0 deletions(-)
 
 diff --git a/arch/arm/cpu/arm926ejs/armada100/cpu.c 
 b/arch/arm/cpu/arm926ejs/armada100/cpu.c
 index 62aa175..8039ad2 100644
 --- a/arch/arm/cpu/arm926ejs/armada100/cpu.c
 +++ b/arch/arm/cpu/arm926ejs/armada100/cpu.c
 @@ -62,6 +62,14 @@ int arch_cpu_init(void)
   /* Enable GPIO clock */
   writel(APBC_APBCLK, apb1clkres-gpio);
  
 + /* Enable general I2C clock */
 + writel(APBC_RST | APBC_FNCLK | APBC_APBCLK, apb1clkres-twsi0);
 + writel(APBC_FNCLK | APBC_APBCLK, apb1clkres-twsi0);
 +
 + /* Enable power I2C clock */
 + writel(APBC_RST | APBC_FNCLK | APBC_APBCLK, apb1clkres-twsi1);
 + writel(APBC_FNCLK | APBC_APBCLK, apb1clkres-twsi1);
 +

If boards based on this cpu type don;t use i2c, i2c clock and
power would be enabled ... wouldn;t it be better, if we enable
this only if CONFIG_I2C_MV is defined?

Hmm.. are the comments OK? In the first block you only
use twsi0 register, in the second block only twsi1 ...?

   /*
* Enable Functional and APB clock at 14.7456MHz
* for configured UART console
 @@ -90,3 +98,9 @@ int print_cpuinfo(void)
   return 0;
  }
  #endif
 +
 +#ifdef CONFIG_I2C_MV
 +void i2c_clk_enable (void)
 +{
 +}
 +#endif
 diff --git a/arch/arm/include/asm/arch-armada100/mfp.h 
 b/arch/arm/include/asm/arch-armada100/mfp.h
 index d21a79f..f22b5e7 100644
 --- a/arch/arm/include/asm/arch-armada100/mfp.h
 +++ b/arch/arm/include/asm/arch-armada100/mfp.h
 @@ -60,6 +60,10 @@
  #define MFPO8_UART3_RXD  MFP_REG(0x06c) | MFP_AF2 | 
 MFP_DRIVE_MEDIUM
  #define MFPO9_UART3_TXD  MFP_REG(0x070) | MFP_AF2 | 
 MFP_DRIVE_MEDIUM
  
 +/* I2c */
 +#define MFP105_CI2C_SDA  MFP_REG(0x1a4) | MFP_AF1 | 
 MFP_DRIVE_MEDIUM
 +#define MFP106_CI2C_SCL  MFP_REG(0x1a8) | MFP_AF1 | 
 MFP_DRIVE_MEDIUM
 +

Please add braces around this multiple or concatenation

  /* More macros can be defined here... */
  
  #define MFP_PIN_MAX  117
 diff --git a/board/Marvell/aspenite/aspenite.c 
 b/board/Marvell/aspenite/aspenite.c
 index 046ffd6..34ac7aa 100644
 --- a/board/Marvell/aspenite/aspenite.c
 +++ b/board/Marvell/aspenite/aspenite.c
 @@ -33,9 +33,14 @@ DECLARE_GLOBAL_DATA_PTR;
  int board_early_init_f(void)
  {
   u32 mfp_cfg[] = {
 + /* I2C */
 + MFP105_CI2C_SDA,
 + MFP106_CI2C_SCL,
 +
   /* Enable Console on UART1 */
   MFP107_UART1_RXD,
   MFP108_UART1_TXD,
 +
   MFP_EOC /*End of configureation*/
   };
   /* configure MFP's */
 diff --git a/include/configs/aspenite.h b/include/configs/aspenite.h
 index fd35f3e..50f8ed7 100644
 --- a/include/configs/aspenite.h
 +++ b/include/configs/aspenite.h
 @@ -63,6 +63,18 @@
  #undef CONFIG_ARCH_MISC_INIT
  
  /*
 + * I2C definition
 + */
 +#define CONFIG_CMD_I2C   1
 +#define CONFIG_I2C_MV1
 +#define CONFIG_PXA_I2C_NUM   2
 +#define CONFIG_I2C_MULTI_BUS 1
 +#define CONFIG_PXA_I2C_REG   {0xd4011000, 0xd4025000}
 +#define CONFIG_HARD_I2C  1
 +#define CONFIG_SYS_I2C_SPEED 0
 +#define CONFIG_SYS_I2C_SLAVE 0xfe
 +
 +/*
   * Environment variables configurations
   */
  #define CONFIG_ENV_IS_NOWHERE1   /* if env in SDRAM */

Thanks!

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


Re: [U-Boot] [WIP/PATCH 0/4] unify SPI flash drivers

2011-03-15 Thread Xie Shaohui-B21989
Hello Mike,

I'm working on put our espi controller related patches to open source, 
I noticed your unify patches several days ago, and I rebased my patches on these
Unify patches, and tested it on my board, it works as expect, so should 
I wait until your unify patches been merged to main tree? And will these unify 
patch be
Merged into next release?

Any comment would be appreciated.


Thanks  Best Regards, 
Shaohui Xie 


-Original Message-
From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
On Behalf Of Mike Frysinger
Sent: Monday, January 10, 2011 3:20 PM
To: u-boot@lists.denx.de
Subject: [U-Boot] [WIP/PATCH 0/4] unify SPI flash drivers

The amount of duplication across SPI flash driver has always annoyed me,
and we've seen bugs that affect multiple drivers fixed in only some, and I
figure if the Linux kernel driver can unify these things, then there is
really no reason we can't too.

So this here are a few incremental patches to get us closer to a unified
driver.  I think the diffstat speaks for itself, and there are even more
pieces here which could possibly be merged.  But I got bored for now.

I've only lightly tested them so far with one SPI flash driver, so for now
they're not for merging.  Once I can get more testing on our side, I'll
send out a pull request.

For you adventurous/bored types, you can grab these from my sf branch:
   git://git.denx.de/u-boot-blackfin.git
Any feedback as to success/failure would be great.

Mike Frysinger (4):
  sf: unify read/write helpers
  sf: unify status polling for ready bit
  sf: unify erase functions
  sf: unify read functions

 drivers/mtd/spi/atmel.c  |   49 +-
 drivers/mtd/spi/eon.c|  121 ++---
 drivers/mtd/spi/macronix.c   |  126 ++
 drivers/mtd/spi/spansion.c   |  120 +---
 drivers/mtd/spi/spi_flash.c  |  170 +
-
 drivers/mtd/spi/spi_flash_internal.h |   23 +
 drivers/mtd/spi/sst.c|  116 +--
 drivers/mtd/spi/stmicro.c|  125 +
 drivers/mtd/spi/winbond.c|  148 +
 9 files changed, 190 insertions(+), 808 deletions(-)

--
1.7.4.rc1

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


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


Re: [U-Boot] [PATCH] echi: add ULI1575 PCI ID

2011-03-15 Thread Kumar Gala

On Mar 13, 2011, at 10:07 AM, Kumar Gala wrote:

 From: Zhao Chenhui b35...@freescale.com
 
 Add ULI1575 EHCI controller to the list of the supported devices.
 
 Signed-off-by: Zhao Chenhui b35...@freescale.com
 Signed-off-by: Kumar Gala ga...@kernel.crashing.org
 ---
 * replaces previous patch for 8572ds
 * adds feedback from Remy
 
 drivers/usb/host/ehci-pci.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
 index cff3438..bf490b0 100644
 --- a/drivers/usb/host/ehci-pci.c
 +++ b/drivers/usb/host/ehci-pci.c
 @@ -29,6 +29,7 @@
 static struct pci_device_id ehci_pci_ids[] = {
   /* Please add supported PCI EHCI controller ids here */
   {0x1033, 0x00E0},
 + {0x10b9, 0x5239},   /* ULI1575 PCI EHCI module ids */
   {0, 0}
 };
 #endif
 -- 
 1.7.2.3

Remy, do you mind Ack and if are you ok if this goes via u-boot-85xx tree to 
keep it in sync with the board patch?

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


Re: [U-Boot] [PATCH v5 1/3] mpc8xxx: DDR2/DDR3: Clean up DIMM-type switch statements

2011-03-15 Thread Kumar Gala

On Mar 14, 2011, at 11:38 AM, Kyle Moffett wrote:

 The numeric constants in the switch statements are replaced by #defines
 added to the common ddr_spd.h header.  This dramatically improves the
 readability of the switch statments.
 
 In addition, a few of the longer lines were cleaned up, and the DDR2
 type for an SO-RDIMM module was added to the DDR2 switch statement.
 
 Signed-off-by: Kyle Moffett kyle.d.moff...@boeing.com
 Cc: Andy Fleming aflem...@gmail.com
 Cc: Kumar Gala kumar.g...@freescale.com
 Cc: Kim Phillips kim.phill...@freescale.com
 ---
 arch/powerpc/cpu/mpc8xxx/ddr/ddr2_dimm_params.c |   23 +++-
 arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c |   43 ++
 common/ddr_spd.c|2 +-
 include/ddr_spd.h   |   28 ++-
 4 files changed, 53 insertions(+), 43 deletions(-)

Can you rebase on 'next' branch of git://git.denx.de/u-boot-mpc85xx.git

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


Re: [U-Boot] [PATCHv2] fsl_ddr: Don't use full 64-bit divides on 32-bit PowerPC

2011-03-15 Thread Kumar Gala

On Feb 23, 2011, at 10:35 AM, Kyle Moffett wrote:

 The current FreeScale MPC-8xxx DDR SPD interpreter is using full 64-bit
 integer divide operations to convert between nanoseconds and DDR clock
 cycles given arbitrary DDR clock frequencies.
 
 Since all of the inputs to this are 32-bit (nanoseconds, clock cycles,
 and DDR frequencies), we can easily restructure the computation to use
 the do_div() function to perform 64-bit/32-bit divide operations.
 
 This decreases compute time rather significantly for each conversion and
 avoids bringing in a very complicated function from libgcc.
 
 It should be noted that nothing else in U-Boot or the Linux kernel seems
 to require a full 64-bit divide on any 32-bit PowerPC.
 
 Build-and-boot-tested on the HWW-1U-1A board using DDR2 SPD detection.
 
 Signed-off-by: Kyle Moffett kyle.d.moff...@boeing.com
 Cc: Andy Fleming aflem...@gmail.com
 Cc: Kumar Gala kumar.g...@freescale.com
 Cc: Wolfgang Denk w...@denx.de
 Cc: Kim Phillips kim.phill...@freescale.com
 ---
 
 Ok, so this patch touches a rather sensitive part of the fsl_ddr logic.
 
 I spent a fair amount of time trying to verify that the resulting math is
 exactly the same as it was before, but the consequences of a mistake are
 insideous timing problems.  Additional in-depth review would be much
 appreciated.
 
 Cheers,
 Kyle Moffett
 
 Changelog:
  v2: Resubmitted separately from the other HWW-1U-1A patches
 
 arch/powerpc/cpu/mpc8xxx/ddr/util.c |   58 --
 1 files changed, 41 insertions(+), 17 deletions(-)

Can you rebase on 'next' branch of git://git.denx.de/u-boot-mpc85xx.git

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


Re: [U-Boot] [PATCH V2 1/5] pxa: move i2c driver to the common place

2011-03-15 Thread Wolfgang Denk
Dear Lei Wen,

In message 1300160443-12552-2-git-send-email-lei...@marvell.com you wrote:
 For better sharing with other platform other than pxa's,
 it is more convenient to put the driver to the common place.
 
 Signed-off-by: Lei Wen lei...@marvell.com
 ---
 Changelog:
 v2: rename previous pxa_i2c to mvi2c.
 
  arch/arm/cpu/pxa/Makefile |1 -
  arch/arm/cpu/pxa/i2c.c|  469 
 -
  drivers/i2c/Makefile  |1 +
  drivers/i2c/mvi2c.c   |  469 
 +

I object against the name mvi2c - it's impossible to understand what
this is supposed to mean.  Please make this mv_i2c or marvell_i2c or
similar, so we can see that mv or marvell is just a prefix.

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
Testing can show the presense of bugs, but not their absence.
   -- Edsger Dijkstra
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/5] add i2c support to pantheon and aramada100

2011-03-15 Thread Wolfgang Denk
Dear Lei Wen,

In message 1300160443-12552-1-git-send-email-lei...@marvell.com you wrote:
 V2:
 rename the previous pxa_i2c to mvi2c, since this driver would be shared
 by many other Marvell platforms.
 
 Lei Wen (5):
   pxa: move i2c driver to the common place
   mvi2c: use structure to replace the direclty define
   I2C: add i2c support for Pantheon platform
   I2C: mvi2c: add multi bus support
   I2C: add i2c support for Armada100 platform

Checkpatch says:

[U-Boot] [PATCH V2 1/5] pxa: move i2c driver to the common place
total: 57 errors, 7 warnings, 497 lines checked
[U-Boot] [PATCH v2 2/5] mvi2c: use structure to replace the
total: 2 errors, 1 warnings, 333 lines checked
[U-Boot] [PATCH v2 3/5] I2C: add i2c support for Pantheon platform
total: 2 errors, 1 warnings, 64 lines checked
[U-Boot] [PATCH v2 4/5] I2C: mvi2c: add multi bus support
total: 2 errors, 0 warnings, 51 lines checked
[U-Boot] [PATCH v2 5/5] I2C: add i2c support for Armada100 platform
total: 2 errors, 1 warnings, 65 lines checked

Please cleanup!

and next time please run checkpatch _before_ submitting!

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
There is, however, a strange, musty smell in the air that reminds  me
of something...hmm...yes...I've got it...there's a VMS nearby, or I'm
a Blit.  - Larry Wall in Configure from the perl distribution
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] Don't grab memory for LCD if FB address is defined

2011-03-15 Thread Minkyu Kang
f FB address is defined specific address then don't grab memory for LCD

Signed-off-by: Minkyu Kang mk7.k...@samsung.com
Cc: Albert Aribaud albert.arib...@free.fr
Cc: Wolfgang Denk w...@denx.de
Cc: Stefan Roese s...@denx.de
Cc: Kim Phillips kim.phill...@freescale.com
Cc: Andy Fleming aflem...@gmail.com
Cc: Kumar Gala kumar.g...@freescale.com
---
v2
 add document

 arch/arm/lib/board.c |4 
 arch/m68k/lib/board.c|4 
 arch/powerpc/lib/board.c |4 
 doc/README.fb_addr   |   17 +
 4 files changed, 29 insertions(+), 0 deletions(-)
 create mode 100644 doc/README.fb_addr

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index c620d2c..5a4d2bd 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -356,9 +356,13 @@ void board_init_f (ulong bootflag)
 #endif /* CONFIG_VFD */
 
 #ifdef CONFIG_LCD
+#ifdef CONFIG_FB_ADDR
+   gd-fb_base = CONFIG_FB_ADDR;
+#else
/* reserve memory for LCD display (always full pages) */
addr = lcd_setmem (addr);
gd-fb_base = addr;
+#endif /* CONFIG_FB_ADDR */
 #endif /* CONFIG_LCD */
 
/*
diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c
index 7867ba5..a6cd9b8 100644
--- a/arch/m68k/lib/board.c
+++ b/arch/m68k/lib/board.c
@@ -277,9 +277,13 @@ board_init_f (ulong bootflag)
debug (Top of RAM usable for U-Boot at: %08lx\n, addr);
 
 #ifdef CONFIG_LCD
+#ifdef CONFIG_FB_ADDR
+   gd-fb_base = CONFIG_FB_ADDR;
+#else
/* reserve memory for LCD display (always full pages) */
addr = lcd_setmem (addr);
gd-fb_base = addr;
+#endif /* CONFIG_FB_ADDR */
 #endif /* CONFIG_LCD */
 
/*
diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index b88cf6b..09c20e9 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -453,9 +453,13 @@ void board_init_f (ulong bootflag)
debug (Top of RAM usable for U-Boot at: %08lx\n, addr);
 
 #ifdef CONFIG_LCD
+#ifdef CONFIG_FB_ADDR
+   gd-fb_base = CONFIG_FB_ADDR;
+#else
/* reserve memory for LCD display (always full pages) */
addr = lcd_setmem (addr);
gd-fb_base = addr;
+#endif /* CONFIG_FB_ADDR */
 #endif /* CONFIG_LCD */
 
 #if defined(CONFIG_VIDEO)  defined(CONFIG_8xx)
diff --git a/doc/README.fb_addr b/doc/README.fb_addr
new file mode 100644
index 000..ea8bca6
--- /dev/null
+++ b/doc/README.fb_addr
@@ -0,0 +1,17 @@
+Define CONFIG_FB_ADDR if you want to use specific address for frame buffer.
+Then system will reserve the frame buffer address to defined address instead of
+lcd_setmem (this function grab the memory for frame buffer by panel's size).
+
+Please see below code (in board_init_f function from arch/arm/lib/board.c)
+
+#ifdef CONFIG_FB_ADDR
+   gd-fb_base = CONFIG_FB_ADDR;
+#else
+   /* reserve memory for LCD display (always full pages) */
+   addr = lcd_setmem (addr);
+   gd-fb_base = addr;
+#endif /* CONFIG_FB_ADDR */
+
+If you want this config option then please define it at your board config file
+
+#define CONFIG_FB_ADDR 0x
-- 
1.7.1

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


Re: [U-Boot] [PATCH] [v2] powerpc: 'monitor' environment variable contains full video configuration

2011-03-15 Thread Wolfgang Denk
Dear Tabi Timur-B04825,

In message 4d7ea72c.9040...@freescale.com you wrote:

  Can this not be turned into generic code, usable for other boards /
  systems as well?
 
 Possibly, but I would like to fix one bug at a time.

Agreed, but please not by introducing lots of new, probably later
incompatible code.

  Please see the discussion we had about video modes for the i.MX
  systems.
 
 Can you point me to the thread or at least tell me the subject line?  I have
 no idea what you're talking about.

See http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/88169/focus=88240

  I want to see handled most of this with generic code, not with
  processor / architecture specific one.
 
 This patch also cleans up a lot of the DIU code to make it handle more gene-
 ric options.

OK, so please split that patch:  one patch should do this cleanup, and
another one should contain the rest.

Instead of a non-standard and undocumented 'diubootargs' environment
variable please use something (probably called video-mode :-) that
can be passed as video-mode= boot argument to Linux.

At this point I wonder which use ther eis left for your monitor
variable - it should be completely redundant now?

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
A Freudian slip is when you say one thing but mean your mother.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 07/21] arm: add support for kirkwood based mgcoge2un board

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

Signed-off-by: Clive Stubbings clive.stubbi...@xentech.co.uk
Signed-off-by: Holger Brunck holger.bru...@keymile.com
Signed-off-by: Heiko Schocher h...@denx.de
cc: Prafulla Wadaskar prafu...@marvell.com
---
Changes for v2:
  - fix checkpatch.pl errors and warnings

 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 h...@denx.de
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 8221579..6e8e8b7 100644
--- a/include/configs/km_arm.h
+++ b/include/configs/km_arm.h
@@ -198,6 +198,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 www.marvell.com
+ * Prafulla Wadaskar prafu...@marvell.com
+ *
+ * (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 

[U-Boot] [PATCH v2 06/21] mpc832x: add support for mpc8321 based tuda1 board

2011-03-15 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 lukas.rog...@keymile.com
Signed-off-by: Holger Brunck holger.bru...@keymile.com
Signed-off-by: Heiko Schocher h...@denx.de
cc: Kim Phillips kim.phill...@freescale.com
cc: Valentin Longchamp valentin.longch...@keymile.com
---
changes for v2:
  - fix checkpatch.pl errors and warnings

 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 h...@denx.de
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 dave...@freescale.com
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *Peter Barada pet...@logicpd.com
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *Anton Vorontsov avoront...@ru.mvista.com
+ *
+ * (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  

[U-Boot] [PATCH v2 15/21] keymile, common; fix i2c deblocking support

2011-03-15 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 stefan.big...@keymile.com
Signed-off-by: Holger Brunck holger.bru...@keymile.com
Signed-off-by: Heiko Schocher h...@denx.de
cc: Valentin Longchamp valentin.longch...@keymile.com
---
Changes for v2:
  - fix checkpatch.pl errors and warnings

 board/keymile/common/common.c |  148 -
 board/keymile/common/common.h |6 +-
 2 files changed, 105 insertions(+), 49 deletions(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index e84c214..5bb18a8 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -325,6 +325,9 @@ int ivm_read_eeprom (void)
if (buf != NULL)
dev_addr = simple_strtoul ((char *)buf, NULL, 16);
 
+   /* add deblocking here */
+   i2c_make_abort();
+
if (i2c_read(dev_addr, 0, 1, i2c_buffer, CONFIG_SYS_IVM_EEPROM_MAX_LEN) 
!= 0) {
printf (Error reading EEprom\n);
return -2;
@@ -334,7 +337,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)
@@ -426,16 +429,16 @@ static int get_scl (void)
 #endif
 
 #if !defined(CONFIG_MPC83xx)
-static void writeStartSeq (void)
+void writeStartSeq(void)
 {
-   set_sda (1);
-   udelay (DELAY_HALF_PERIOD);
-   set_scl (1);
-   udelay (DELAY_HALF_PERIOD);
-   set_sda (0);
-   udelay (DELAY_HALF_PERIOD);
-   set_scl (0);
-   udelay (DELAY_HALF_PERIOD);
+   set_sda(1);
+   udelay(DELAY_HALF_PERIOD);
+   set_scl(1);
+   udelay(DELAY_HALF_PERIOD);
+   set_sda(0);
+   udelay(DELAY_HALF_PERIOD);
+   set_scl(0);
+   udelay(DELAY_HALF_PERIOD);
 }
 
 /* I2C is a synchronous protocol and resets of the processor in the middle
@@ -445,14 +448,27 @@ static void writeStartSeq (void)
This I2C Deblocking mechanism was developed by Keymile in association
with Anatech and Atmel in 1998.
  */
-static int i2c_make_abort (void)
+int i2c_make_abort(void)
 {
+
+#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;
+
+   /* disable I2C controller first, otherwhise it thinks we want to*/
+   /* talk to the slave port...*/
+   i2c-i2c_i2mod = ~0x01;
+
+   /* Set the PortPins to GPIO */
+   setports(1);
+#endif
+
int scl_state = 0;
int sda_state = 0;
int i = 0;
int ret = 0;
 
-   if (!get_sda ()) {
+   if (!get_sda()) {
ret = -1;
while (i  16) {
i++;
@@ -469,58 +485,96 @@ static int i2c_make_abort (void)
}
}
if (ret == 0) {
-   for (i =0; i  5; i++) {
+   for (i = 0; i  5; i++)
writeStartSeq ();
-   }
}
-   get_sda ();
+
+   /* 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)
+void writeStartSeq(void)
+{
struct fsl_i2c *dev;
dev = (struct fsl_i2c *) (CONFIG_SYS_IMMR + CONFIG_SYS_I2C_OFFSET);
-   uchar   dummy;
+   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));
+}
 
-   out_8 (dev-cr, (I2C_CR_MSTA));
-   out_8 (dev-cr, (I2C_CR_MEN | I2C_CR_MSTA));
-   dummy = in_8(dev-dr);
+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, 

[U-Boot] [PATCH v2 01/21] arm, keymile: rename MACH_SUEN3 to MACH_KM_KIRKWOOD

2011-03-15 Thread Heiko Schocher
From: Holger Brunck holger.bru...@keymile.com

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 holger.bru...@keymile.com
Signed-off-by: Heiko Schocher h...@denx.de
cc: Wolfgang Denk w...@denx.de
cc: Valentin Longchamp valentin.longch...@keymile.com
---
Changes for v2:
  - new patch in v2, first patch of v1 serie was split up

 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


[U-Boot] [PATCH v2 02/21] ppc, arm: adapt keymile header

2011-03-15 Thread Heiko Schocher
From: Holger Brunck holger.bru...@keymile.com

- adapt copyright string
- remove numeric values for defines which only select functions
- change bootdelay to 2 seconds
- set max number of command args to 32
- set I/O buffer size to 512
- remove CONFIG_E300 and CONFIG_MPC83xx, as the added
  through PLATFORM_CPPFLAGS

Signed-off-by: Holger Brunck holger.bru...@keymile.com
Signed-off-by: Heiko Schocher h...@denx.de
cc: Kim Phillips kim.phill...@freescale.com
cc: Wolfgang Denk w...@denx.de
cc: Valentin Longchamp valentin.longch...@keymile.com
---
Changes for v2:
  - new patch in v2, first patch in v1 was split up
  - fix checkpatch.pl errors and warnings

 include/configs/keymile-common.h |   49 +-
 include/configs/km_arm.h |6 -
 include/configs/kmeter1.h|   24 +-
 include/configs/mgcoge.h |   37 ++--
 4 files changed, 57 insertions(+), 59 deletions(-)

diff --git a/include/configs/keymile-common.h b/include/configs/keymile-common.h
index e3bd264..242a3c6 100644
--- a/include/configs/keymile-common.h
+++ b/include/configs/keymile-common.h
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2008
+ * (C) Copyright 2008-2011
  * Heiko Schocher, DENX Software Engineering, h...@denx.de.
  *
  * See file CREDITS for list of people who contributed to this
@@ -25,9 +25,7 @@
 #define __CONFIG_KEYMILE_H
 
 /* Do boardspecific init for all boards */
-#define CONFIG_BOARD_EARLY_INIT_R   1
-
-#define CONFIG_BOOTCOUNT_LIMIT
+#define CONFIG_BOARD_EARLY_INIT_R
 
 /*
  * By default kwbimage.cfg from board specific folder is 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,15 +75,15 @@
 #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) 
/* Print Buffer Size  */
-#define CONFIG_SYS_MAXARGS 16  /* max number of command args */
-#define CONFIG_SYS_BARGSIZECONFIG_SYS_CBSIZE   /* Boot 
Argument Buffer Size  */
-#define CONFIG_CMDLINE_EDITING 1   /* add command line history 
*/
+#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT) + 16)
+#define CONFIG_SYS_MAXARGS 32 /* max number of command args */
+#define CONFIG_SYS_BARGSIZECONFIG_SYS_CBSIZE
+#define CONFIG_CMDLINE_EDITING /* add command line history   */
 #define CONFIG_AUTO_COMPLETE   /* add autocompletion support   */
 
-#define CONFIG_HUSH_INIT_VAR   1
+#define CONFIG_HUSH_INIT_VAR
 
 #define CONFIG_SYS_ALT_MEMTEST /* memory test, takes time */
 #define CONFIG_SYS_MEMTEST_START   0x0010  /* memtest works on */
@@ -96,11 +93,11 @@
 
 #define CONFIG_SYS_HZ  1000/* decrementer freq: 1 ms ticks 
*/
 
-#define CONFIG_BAUDRATE115200
+#define CONFIG_BAUDRATE115200
 #define CONFIG_SYS_BAUDRATE_TABLE  { 9600, 19200, 38400, 57600, 115200, 
230400 }
 
-#define CONFIG_LOADS_ECHO  1   /* echo on for serial download */
-#define CONFIG_SYS_LOADS_BAUD_CHANGE   1   /* allow baudrate change */
+#define CONFIG_LOADS_ECHO  /* echo on for serial download */
+#define CONFIG_SYS_LOADS_BAUD_CHANGE   /* allow baudrate change */
 #define CONFIG_SYS_BOARD_DRAM_INIT /* Used board specific dram_init */
 
 /*
@@ -108,28 +105,28 @@
  * to modify in a centralized location.  This is used in the HDLC
  * driver to set the MAC.
 */
-#define CONFIG_CHECK_ETHERNET_PRESENT  1
+#define CONFIG_CHECK_ETHERNET_PRESENT
 #define CONFIG_SYS_SLOT_ID_BASECONFIG_SYS_PIGGY_BASE
 #define CONFIG_SYS_SLOT_ID_OFF (0x07)  /* register offset */
 #define CONFIG_SYS_SLOT_ID_MASK(0x3f)  /* mask for slot ID 
bits */
 
-#define CONFIG_I2C_MULTI_BUS   1
+#define CONFIG_I2C_MULTI_BUS
 #define CONFIG_SYS_MAX_I2C_BUS 1
-#define CONFIG_SYS_I2C_INIT_BOARD  1
-#define CONFIG_I2C_MUX 1
+#define CONFIG_SYS_I2C_INIT_BOARD
+#define CONFIG_I2C_MUX
 
 /* EEprom support */
-#define CONFIG_SYS_I2C_MULTI_EEPROMS   1
+#define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_ENABLE
-#define 

[U-Boot] [PATCH v2 18/21] keymile, common: add setting of some environment variables

2011-03-15 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 holger.bru...@keymile.com
Signed-off-by: Heiko Schocher h...@denx.de
cc: Valentin Longchamp valentin.longch...@keymile.com
cc: Wolfgang Denk w...@denx.de
cc: Kim Phillips kim.phill...@freescale.com
---
Changes for v2:
  - fix checkpatch.pl errors and warnings

 board/keymile/common/common.c|   36 ++--
 board/keymile/common/common.h|2 ++
 board/keymile/km83xx/km83xx.c|   13 +
 board/keymile/km_arm/km_arm.c|   11 +++
 board/keymile/mgcoge/mgcoge.c|   13 +
 include/configs/keymile-common.h |3 +++
 include/configs/km_arm.h |5 +
 7 files changed, 81 insertions(+), 2 deletions(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index ecb9664..8f3910e 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -40,8 +40,6 @@
 #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
 #include i2c.h
 
-extern int i2c_soft_read_pin (void);
-
 int ivm_calc_crc (unsigned char *buf, int len)
 {
const unsigned short crc_tab[16] = {
@@ -72,6 +70,40 @@ int ivm_calc_crc (unsigned char *buf, int len)
return crc;
 }
 
+/* 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 = arch_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 = arch_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 a2adf1d..b5f603a 100644
--- a/board/keymile/common/common.h
+++ b/board/keymile/common/common.h
@@ -18,11 +18,13 @@ int ethernet_present(void);
 int ivm_read_eeprom(void);
 void writeStartSeq(void);
 int i2c_make_abort(void);
+unsigned int arch_ram_size(void);
 
 #ifdef CONFIG_KEYMILE_HDLC_ENET
 int keymile_hdlc_enet_initialize (bd_t *bis);
 #endif
 
+int set_km_env(void);
 int fdt_set_node_and_value (void *blob,
char *nodename,
char *regname,
diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c
index a085d7e..02be714 100644
--- a/board/keymile/km83xx/km83xx.c
+++ b/board/keymile/km83xx/km83xx.c
@@ -30,6 +30,8 @@
 
 #include ../common/common.h
 
+DECLARE_GLOBAL_DATA_PTR;
+
 extern void disable_addr_trans(void);
 extern void enable_addr_trans(void);
 const qe_iop_conf_t qe_iop_conf_tab[] = {
@@ -178,6 +180,17 @@ int misc_init_r(void)
return 0;
 }
 
+unsigned int arch_ram_size(void)
+{
+   return gd-bd-bi_memsize;
+}
+
+int last_stage_init(void)
+{
+   set_km_env();
+   return 0;
+}
+
 int fixed_sdram(void)
 {
volatile 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 ba8f833..bf52867 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -210,6 +210,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[])
 {
@@ -273,6 +279,11 @@ void dram_init_banksize(void)
}
 }
 
+unsigned int arch_ram_size(void)
+{
+   return gd-ram_size;
+}
+
 /* Configure and enable MV88E1118 PHY */
 void reset_phy(void)
 {
diff --git a/board/keymile/mgcoge/mgcoge.c b/board/keymile/mgcoge/mgcoge.c
index f973b8d..38f25d4 100644
--- a/board/keymile/mgcoge/mgcoge.c
+++ b/board/keymile/mgcoge/mgcoge.c
@@ -37,6 +37,8 @@
 
 #include ../common/common.h
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * I/O Port configuration table
  *
@@ -310,6 +312,17 @@ int board_early_init_r (void)
  

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

2011-03-15 Thread Heiko Schocher
From: Holger Brunck holger.bru...@keymile.com

Signed-off-by: Holger Brunck holger.bru...@keymile.com
cc: Wolfgang Denk w...@denx.de
cc: Valentin Longchamp valentin.longch...@keymile.com
cc: Heiko Schocher h...@denx.de
---
Changes for v2:
  - fix checkpatch.pl errors and warnings

 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 4597ee9..5b54c80 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 v2 13/21] km_arm: change some register values for SDRAM initialization

2011-03-15 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 valentin.longch...@keymile.com
Signed-off-by: Heiko Schocher h...@denx.de
cc: Holger Brunck holger.bru...@keymile.com
cc: Prafulla Wadaskar prafu...@marvell.com
---
Changes for v2:
  - 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 

[U-Boot] [PATCH v2 11/21] powerpc, 83xx: add kmsupx5 board support

2011-03-15 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 thomas.reu...@keymile.com
Signed-off-by: Heiko Schocher h...@denx.de
cc: Wolfgang Denk w...@denx.de
cc: Kim Phillips kim.phill...@freescale.com
cc: Valentin Longchamp valentin.longch...@keymile.com
cc: Holger Brunck holger.bru...@keymile.com
---
Changes for v2:
  - fix checkpatch.pl errors and warnings

 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 h...@denx.de
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 dave...@freescale.com
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *Peter Barada pet...@logicpd.com
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *Anton Vorontsov avoront...@ru.mvista.com
+ *
+ * (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 | \
+   

[U-Boot] [PATCH v2 14/21] ppc, 8321: cleanup tuxa1, tuda1 and suvd3 support

2011-03-15 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 holger.bru...@keymile.com
Signed-off-by: Heiko Schocher h...@denx.de
cc: Kim Phillips kim.phill...@freescale.com
cc: Wolfgang Denk w...@denx.de
cc: Valentin Longchamp valentin.longch...@keymile.com
---
Changes for v2:
  - fix checkpatch.pl errors and warnings

 board/keymile/common/common.c|3 +-
 board/keymile/km83xx/km83xx.c|4 +-
 board/keymile/mgcoge/mgcoge.c|4 +-
 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(+), 364 deletions(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index f723cfa..e84c214 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -582,7 +582,8 @@ int fdt_get_node_and_value (void *blob,
 #if !defined(MACH_TYPE_KM_KIRKWOOD)
 int ethernet_present (void)
 {
-   return (in_8((u8 *)CONFIG_SYS_PIGGY_BASE + CONFIG_SYS_SLOT_ID_OFF)  
0x80);
+   return in_8((u8 *)CONFIG_SYS_KMBEC_FPGA_BASE + CONFIG_SYS_SLOT_ID_OFF)
+0x80;
 }
 #endif
 
diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c
index d85bbe7..a085d7e 100644
--- a/board/keymile/km83xx/km83xx.c
+++ b/board/keymile/km83xx/km83xx.c
@@ -158,9 +158,9 @@ int board_early_init_r(void)
break;
}
/* enable the PHY on the PIGGY */
-   setbits(8, (void *)(CONFIG_SYS_PIGGY_BASE + 0x10003), 0x01);
+   setbits(8, (void *)(CONFIG_SYS_KMBEC_FPGA_BASE + 0x10003), 0x01);
/* enable the Unit LED (green) */
-   setbits(8, (void *)(CONFIG_SYS_PIGGY_BASE + 0x2), 0x01);
+   setbits(8, (void *)(CONFIG_SYS_KMBEC_FPGA_BASE + 0x2), 0x01);
 
 #if defined(CONFIG_SUVD3)
/* configure UPMA for APP1 */
diff --git a/board/keymile/mgcoge/mgcoge.c b/board/keymile/mgcoge/mgcoge.c
index 1a6bdd8..f973b8d 100644
--- a/board/keymile/mgcoge/mgcoge.c
+++ b/board/keymile/mgcoge/mgcoge.c
@@ -304,9 +304,9 @@ int board_early_init_r (void)
 {
/* setup the UPIOx */
/* General Unit Reset disabled, Flash Bank enabled, UnitLed on */
-   out_8((u8 *)(CONFIG_SYS_PIGGY_BASE + 0x02), 0xc2);
+   out_8((u8 *)(CONFIG_SYS_KMBEC_FPGA_BASE + 0x02), 0xc2);
/* SCC4 enable, halfduplex, FCC1 powerdown */
-   out_8((u8 *)(CONFIG_SYS_PIGGY_BASE + 0x03), 0x15);
+   out_8((u8 *)(CONFIG_SYS_KMBEC_FPGA_BASE + 0x03), 0x15);
return 0;
 }
 
diff --git a/include/configs/keymile-common.h b/include/configs/keymile-common.h
index f548994..0927ce3 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 262536c..47d5437 100644
--- a/include/configs/km82xx-common.h
+++ b/include/configs/km82xx-common.h
@@ -271,19 +271,19 @@
 PSDMR_WRC_1C   |\
 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 

[U-Boot] [PATCH v2 09/21] ppc: add support for ppc based board mgcoge2ne

2011-03-15 Thread Heiko Schocher
The mgcoge2 board from keymile deploys two different porcessors.
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 holger.bru...@keymile.com
Signed-off-by: Heiko Schocher h...@denx.de
cc: Wolfgang Denk w...@denx.de
cc: Valentin Longchamp valentin.longch...@keymile.com
---
Changes for v2:
  - fix checkpatch.pl errors and warnings

 MAINTAINERS |1 +
 board/keymile/common/common.c   |4 +-
 board/keymile/mgcoge/mgcoge.c   |   10 +-
 boards.cfg  |1 +
 include/configs/km82xx-common.h |  318 +++
 include/configs/mgcoge.h|  294 +---
 include/configs/mgcoge2ne.h |   66 
 7 files changed, 398 insertions(+), 296 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 h...@denx.de
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 f0b99ed..f723cfa 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -22,7 +22,7 @@
  */
 
 #include common.h
-#if defined(CONFIG_MGCOGE)
+#if defined(CONFIG_MGCOGE) || defined(CONFIG_MGCOGE2NE)
 #include mpc8260.h
 #endif
 #include ioports.h
@@ -337,7 +337,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 5c9496c..1a6bdd8 100644
--- a/board/keymile/mgcoge/mgcoge.c
+++ b/board/keymile/mgcoge/mgcoge.c
@@ -286,10 +286,14 @@ phys_size_t initdram (int board_type)
 
 int checkboard(void)
 {
-   puts (Board: Keymile mgcoge);
+#if defined(CONFIG_MGCOGE)
+   puts(Board: Keymile mgcoge);
+#else
+   puts(Board: Keymile mgcoge2ne);
+#endif
if (ethernet_present ())
-   puts ( with PIGGY.);
-   puts (\n);
+   puts( with PIGGY.);
+   puts(\n);
return 0;
 }
 
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..262536c
--- /dev/null
+++ b/include/configs/km82xx-common.h
@@ -0,0 +1,318 @@
+/*
+ * (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 

[U-Boot] [PATCH v2 12/21] km-arm: i2c support for suenx based boards

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

Signed-off-by: Lukas Roggli lukas.rog...@keymile.com
Signed-off-by: Valentin Longchamp valentin.longch...@keymile.com
Signed-off-by: Holger Brunck holger.bru...@keymile.com
Signed-off-by: Heiko Schocher h...@denx.de
cc: Prafulla Wadaskar prafu...@marvell.com
---
Changes for v2:
  - fix checkpatch.pl errors and warnings

 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 5c1e822..2ba1cbe 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -96,7 +96,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 */
@@ -162,14 +162,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(SUENx_SDA_PIN, 1);
+   kw_gpio_set_valid(SUENx_SCL_PIN, 1);
+   kw_gpio_direction_output(SUENx_SDA_PIN, 0);
+   kw_gpio_direction_output(SUENx_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(SUENx_ENV_WP, 38);
+   kw_gpio_direction_output(SUENx_ENV_WP, 1);
 #endif
 
return 0;
@@ -322,15 +322,15 @@ int get_sda (void)
 
 int get_scl (void)
 {
-   return (kw_gpio_get_value(SUEN3_SCL_PIN) ? 1 : 0);
+   return kw_gpio_get_value(SUENx_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(SUENx_ENV_WP, !state);
 
-   return !kw_gpio_get_value(SUEN3_ENV_WP);
+   return !kw_gpio_get_value(SUENx_ENV_WP);
 }
 #endif
diff --git a/include/configs/km_arm.h b/include/configs/km_arm.h
index 6e8e8b7..8b429a1 100644
--- a/include/configs/km_arm.h
+++ b/include/configs/km_arm.h
@@ -177,15 +177,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 SUENx_SDA_PIN  8
+#define SUENx_SCL_PIN  9
+#define SUENx_ENV_WP   38
+
+#define I2C_ACTIVE __set_direction(SUENx_SDA_PIN, 0)
+#define I2C_TRISTATE   __set_direction(SUENx_SDA_PIN, 1)
+#define I2C_READ   (kw_gpio_get_value(SUENx_SDA_PIN) ? 1 : 0)
+#define I2C_SDA(bit)   kw_gpio_set_value(SUENx_SDA_PIN, bit);
+#define I2C_SCL(bit)   kw_gpio_set_value(SUENx_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 v2 10/21] keymile, 8321 boards: move common definitions to km8321-common.h

2011-03-15 Thread Heiko Schocher
From: Thomas Reufer thomas.reu...@keymile.com

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

Signed-off-by: Thomas Reufer thomas.reu...@keymile.com
cc: Wolfgang Denk w...@denx.de
cc: Kim Phillips kim.phill...@freescale.com
cc: Valentin Longchamp valentin.longch...@keymile.com
cc: Holger Brunck holger.bru...@keymile.com
cc: Heiko Schocher h...@denx.de
---
Changes for v2:
  - fix checkpatch.pl errors and warnings

 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 dave...@freescale.com
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *Peter Barada pet...@logicpd.com
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *Anton Vorontsov avoront...@ru.mvista.com
+ *
+ * (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  

[U-Boot] [PATCH v2 08/21] arm: add support of Kirkwood based board SUEN8

2011-03-15 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 holger.bru...@keymile.com
Signed-off-by: Heiko Schocher h...@denx.de
cc: Prafulla Wadaskar prafu...@marvell.com
---
Changes for v2:
  - fix checkpatch.pl errors and warnings

 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 h...@denx.de
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 www.marvell.com
+ * Prafulla Wadaskar prafu...@marvell.com
+ *
+ * (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 v2 05/21] mpc832x: add support for mpc8321 based tuxa1 board

2011-03-15 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 lukas.rog...@keymile.com
Signed-off-by: Holger Brunck holger.bru...@keymile.com
Signed-off-by: Heiko Schocher h...@denx.de
cc: Kim Phillips kim.phill...@freescale.com
cc: Valentin Longchamp valentin.longch...@keymile.com
---
Changes for v2:
  - fix checkpatch.pl errors and warnings

 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 h...@denx.de
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 dave...@freescale.com
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *Peter Barada pet...@logicpd.com
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *Anton Vorontsov avoront...@ru.mvista.com
+ *
+ * (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 

[U-Boot] [PATCH v2 16/21] arm, keymile: updates for the arm based boards from keymile

2011-03-15 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 valentin.longch...@keymile.com
Signed-off-by: Holger Brunck holger.bru...@keymile.com
Signed-off-by: Luca Haab luca.h...@keymile.com
Signed-off-by: Heiko Schocher h...@denx.de
cc: Prafulla Wadaskar prafu...@marvell.com
---
Changes for v2:
  - fix checkpatch.pl errors and warnings

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

diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c
index 2ba1cbe..ba8f833 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -41,9 +41,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static int io_dev;
-extern I2C_MUX_DEVICE *i2c_mux_ident_muxstring (uchar *buf);
-
 /* Multi-Purpose Pins Functionality configuration */
 u32 kwmpp_config[] = {
MPP0_NF_IO2,
@@ -111,7 +108,7 @@ int ethernet_present(void)
int ret = 0;
 
if (i2c_read(0x10, 2, 1, buf, 1) != 0) {
-   printf (%s: Error reading Boco\n, __FUNCTION__);
+   printf(%s: Error reading Boco\n, __func__);
return -1;
}
if ((buf  0x40) == 0x40) {
@@ -120,15 +117,37 @@ 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);
@@ -140,6 +159,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;
 }
 
@@ -246,7 +268,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 8b429a1..762f0cf 100644
--- a/include/configs/km_arm.h
+++ b/include/configs/km_arm.h
@@ -47,6 +47,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  

[U-Boot] [PATCH v2 00/21] keymile board update

2011-03-15 Thread Heiko Schocher
The following patchset updates the support for the keymile
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 (14):
  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  |  220 +++---
 board/keymile/common/common.h  |   11 +-
 board/keymile/{kmeter1 = km83xx}/Makefile |0
 .../keymile/{kmeter1/kmeter1.c = km83xx/km83xx.c} |  162 +--
 board/keymile/km_arm/km_arm.c  |   72 +++-
 board/keymile/km_arm/kwbimage.cfg  |   32 +-
 board/keymile/mgcoge/mgcoge.c  |   27 +-
 boards.cfg |9 +-
 include/configs/keymile-common.h   |  475 +--
 include/configs/km-powerpc.h   |   92 
 include/configs/km82xx-common.h|  318 +
 include/configs/km8321-common.h|  138 ++
 include/configs/km83xx-common.h|  325 +
 include/configs/km_arm.h   |  100 -
 include/configs/kmeter1.h  |  353 ++-
 include/configs/kmsupx5.h  |   91 
 include/configs/mgcoge.h   |  302 +
 include/configs/mgcoge2ne.h|   66 +++
 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 +
 27 files changed, 2378 insertions(+), 971 deletions(-)
 rename board/keymile/{kmeter1 = km83xx}/Makefile (100%)
 rename board/keymile/{kmeter1/kmeter1.c = km83xx/km83xx.c} (52%)
 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 v2 19/21] ppc, arm: rework and enhance keymile-common.h

2011-03-15 Thread Heiko Schocher
From: Holger Brunck holger.bru...@keymile.com

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 holger.bru...@keymile.com
cc: Wolfgang Denk w...@denx.de
cc: Prafulla Wadaskar prafu...@marvell.com
cc: Valentin Longchamp valentin.longch...@keymile.com
cc: Heiko Schocher h...@denx.de
---
Changes for v2:
  - fix checkpatch.pl errors and warnings

 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 e4699e2..6c6169b 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 config_cmd_default.h
@@ -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 v2 20/21] keymile boards: support of boardId / hwkey lists

2011-03-15 Thread Heiko Schocher
From: Thomas Herzmann thomas.herzm...@keymile.com

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 thomas.herzm...@keymile.com
Signed-off-by: Holger Brunck holger.bru...@keymile.com
cc: Valentin Longchamp valentin.longch...@keymile.com
cc: Heiko Schocher h...@denx.de
---
Changes for v2:
  - nothing

 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 6c6169b..4597ee9 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 v2 03/21] arm, ppc: rework environment variables for keymile boards

2011-03-15 Thread Heiko Schocher
From: Holger Brunck holger.bru...@keymile.com

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 holger.bru...@keymile.com
Signed-off-by: Heiko Schocher h...@denx.de
cc: Kim Phillips kim.phill...@freescale.com
cc: Wolfgang Denk w...@denx.de
cc: Valentin Longchamp valentin.longch...@keymile.com
---
Changes for v2:
  - new patch in v2, first patch in v1 was split up
  - fix checkpatch.pl errors and warnings

 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 242a3c6..f548994 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  /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END 0x00f0  /* 1 ... 15 MB in DRAM  
*/
-
-#define CONFIG_SYS_LOAD_ADDR   0x10/* default load address 
*/
 
 #define CONFIG_SYS_HZ  1000/* decrementer 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;

[U-Boot] [PATCH v2 04/21] mpc832x: add support for the mpc8321 based suvd3 board

2011-03-15 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 h...@denx.de
cc: Kim Phillips kim.phill...@freescale.com
cc: Holger Brunck holger.bru...@keymile.com
cc: Valentin Longchamp valentin.longch...@keymile.com
---
Changes for v2:
  - fix checkpatch.pl errors and warnings

 MAINTAINERS|1 +
 arch/powerpc/cpu/mpc83xx/fdt.c |3 +-
 arch/powerpc/lib/bootcount.c   |2 +-
 board/keymile/common/common.c  |9 +-
 board/keymile/{kmeter1 = km83xx}/Makefile |0
 .../keymile/{kmeter1/kmeter1.c = km83xx/km83xx.c} |  149 ++---
 boards.cfg |3 +-
 include/configs/km83xx-common.h|  324 +++
 include/configs/kmeter1.h  |  327 +--
 include/configs/suvd3.h|  215 +
 10 files changed, 669 insertions(+), 364 deletions(-)
 rename board/keymile/{kmeter1 = km83xx}/Makefile (100%)
 rename board/keymile/{kmeter1/kmeter1.c = km83xx/km83xx.c} (53%)
 create mode 100644 include/configs/km83xx-common.h
 create mode 100644 include/configs/suvd3.h
 delete mode 100644 post/lib_powerpc/fpu/Makefile

diff --git a/MAINTAINERS b/MAINTAINERS
index 4756f14..75b7343 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -433,6 +433,7 @@ Heiko Schocher h...@denx.de
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..54c4acd 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 asm/immap_qe.h
 
 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 asm/immap_qe.h
 
 #define CONFIG_SYS_BOOTCOUNT_ADDR  (CONFIG_SYS_IMMR + 0x11 + \
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 86be9c2..f0b99ed 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -29,6 +29,7 @@
 #include malloc.h
 #include hush.h
 #include net.h
+#include netdev.h
 #include asm/io.h
 
 #if defined(CONFIG_OF_BOARD_SETUP)  defined(CONFIG_OF_LIBFDT)
@@ -424,7 +425,7 @@ static int get_scl (void)
 }
 #endif
 
-#if !defined(CONFIG_KMETER1)
+#if !defined(CONFIG_MPC83xx)
 static void writeStartSeq (void)
 {
set_sda (1);
@@ -483,7 +484,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;
@@ -591,7 +592,7 @@ int board_eth_init (bd_t *bis)
(void)keymile_hdlc_enet_initialize (bis);
 #endif
if (ethernet_present ()) {
-   return -1;
+   return cpu_eth_init(bis);
}
-   return 0;
+   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 53%
rename from board/keymile/kmeter1/kmeter1.c
rename to board/keymile/km83xx/km83xx.c
index bbcaf5d..d85bbe7 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 avoront...@ru.mvista.com
  *
- * (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
@@ -30,11 +30,11 @@
 
 #include ../common/common.h
 
-extern void disable_addr_trans (void);
-extern void enable_addr_trans (void);
+extern void disable_addr_trans(void);
+extern void enable_addr_trans(void);
 const qe_iop_conf_t qe_iop_conf_tab[] = {
/* port pin dir open_drain assign */
-
+#if 

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

2011-03-15 Thread Stefan Roese
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.

This patch now changes the UBI code to return positive error codes.
Additionally better error codes are used, for example ENOMEM when
no memory is available for the UBI volume creation any more.

Also the output of some commands is enhanced:

Before:

= ubi read 10 testvol 10
Volume testvol found at volume id 0
read 1048576 bytes from volume 0 to 10(buf address)
= ubi write 10 testvol 1000
Volume testvol found at volume id 0

After:

= ubi read 10 testvol 10
Read 1048576 bytes from volume testvol to 0010
= ubi write 10 testvol 1000
4096 bytes written to volume testvol

Signed-off-by: Stefan Roese s...@denx.de
Cc: Wolfgang Denk w...@denx.de
---
v2:
- More negative return codes replaced
- Enhancements to some command outputs
- Common code extraced into function ubi_find_volume() to reduce code size

 common/cmd_ubi.c |  137 +
 1 files changed, 65 insertions(+), 72 deletions(-)

diff --git a/common/cmd_ubi.c b/common/cmd_ubi.c
index b486ca8..629758f 100644
--- a/common/cmd_ubi.c
+++ b/common/cmd_ubi.c
@@ -123,7 +123,7 @@ static int ubi_info(int layout)
 static int verify_mkvol_req(const struct ubi_device *ubi,
const struct ubi_mkvol_req *req)
 {
-   int n, err = -EINVAL;
+   int n, err = EINVAL;
 
if (req-bytes  0 || req-alignment  0 || req-vol_type  0 ||
req-name_len  0)
@@ -136,8 +136,11 @@ static int verify_mkvol_req(const struct ubi_device *ubi,
if (req-alignment == 0)
goto bad;
 
-   if (req-bytes == 0)
+   if (req-bytes == 0) {
+   printf(No space left in UBI device!\n);
+   err = ENOMEM;
goto bad;
+   }
 
if (req-vol_type != UBI_DYNAMIC_VOLUME 
req-vol_type != UBI_STATIC_VOLUME)
@@ -151,13 +154,13 @@ static int verify_mkvol_req(const struct ubi_device *ubi,
goto bad;
 
if (req-name_len  UBI_VOL_NAME_MAX) {
-   err = -ENAMETOOLONG;
+   printf(Name too long!\n);
+   err = ENAMETOOLONG;
goto bad;
}
 
return 0;
 bad:
-   printf(bad volume creation request);
return err;
 }
 
@@ -191,34 +194,39 @@ static int ubi_create_vol(char *volume, int size, int 
dynamic)
return ubi_create_volume(ubi, req);
 }
 
-static int ubi_remove_vol(char *volume)
+static struct ubi_volume *ubi_find_volume(char *volume)
 {
-   int i, err, reserved_pebs;
-   int found = 0, vol_id = 0;
struct ubi_volume *vol = NULL;
+   int i;
 
for (i = 0; i  ubi-vtbl_slots; i++) {
vol = ubi-volumes[i];
-   if (vol  !strcmp(vol-name, volume)) {
-   printf(Volume %s found at valid %d\n, volume, i);
-   vol_id = i;
-   found = 1;
-   break;
-   }
+   if (vol  !strcmp(vol-name, volume))
+   return vol;
}
-   if (!found) {
-   printf(%s volume not found\n, volume);
-   return -ENODEV;
-   }
-   printf(remove UBI volume %s (id %d)\n, vol-name, vol-vol_id);
+
+   printf(Volume %s not found!\n, volume);
+   return NULL;
+}
+
+static int ubi_remove_vol(char *volume)
+{
+   int err, reserved_pebs, i;
+   struct ubi_volume *vol;
+
+   vol = ubi_find_volume(volume);
+   if (vol == NULL)
+   return ENODEV;
+
+   printf(Remove UBI volume %s (id %d)\n, vol-name, vol-vol_id);
 
if (ubi-ro_mode) {
printf(It's read-only mode\n);
-   err = -EROFS;
+   err = EROFS;
goto out_err;
}
 
-   err = ubi_change_vtbl_record(ubi, vol_id, NULL);
+   err = ubi_change_vtbl_record(ubi, vol-vol_id, NULL);
if (err) {
printf(Error changing Vol tabel record err=%x\n, err);
goto out_err;
@@ -231,8 +239,8 @@ static int ubi_remove_vol(char *volume)
}
 
kfree(vol-eba_tbl);
-   ubi-volumes[vol_id]-eba_tbl = NULL;
-   ubi-volumes[vol_id] = NULL;
+   ubi-volumes[vol-vol_id]-eba_tbl = NULL;
+   ubi-volumes[vol-vol_id] = NULL;
 
ubi-rsvd_pebs -= reserved_pebs;
ubi-avail_pebs += reserved_pebs;
@@ -249,56 +257,46 @@ static int ubi_remove_vol(char *volume)
 
return 0;
 out_err:
-   ubi_err(cannot remove volume %d, error %d, vol_id, err);
+   ubi_err(cannot remove volume %s, error %d, volume, err);
+   if (err  0)
+   err = -err;
return err;
 }
 
 static int ubi_volume_write(char *volume, void *buf, size_t size)
 {
-   int i = 0, err = -1;
+   int err = 1;
int rsvd_bytes = 0;
-   int found = 

Re: [U-Boot] Uboot- Nor flash

2011-03-15 Thread Hebbar, Gururaja
On Tue, Mar 15, 2011 at 12:14:40, Sanjeeva Kumara wrote:
 
 Board - PXA168 from Marvell
 Nor Flash - 64MB
 Nand Flash - 2Gb
 Clock - 1Ghz
 RAM 128MB

Don't top-post.
Maintain cc list

There are lot of pxa ports in u-boot. Kindly follow the nearest one. 

pxa u-boot starts execution from u-boot-src/arch/arm/cpu/pxa/start.S -- 
_start function

regards
Gururaja

 -Original Message-
 From: Hebbar, Gururaja [mailto:gururaja.heb...@ti.com]
 Sent: Tuesday, March 15, 2011 11:55 AM
 To: Sanjeeva Kumara
 Cc: u-boot@lists.denx.de
 Subject: RE: Uboot- Nor flash
 
 Hi,
 
 On Tue, Mar 15, 2011 at 11:07:46, Sanjeeva Kumara wrote:
  Hi pls help me...
  How the boot image is read into memory from where exactly execution 
  starts...
 
 
 1. what is your board configuration (memory, Processor, ram, etc..) 2. Is 
 your board inside u-boot repository ?. what is the board config name
 
 Regards
 Gururaja
 
 
 
 
 
  -Original Message-
  From: Hebbar, Gururaja [mailto:gururaja.heb...@ti.com]
  Sent: Friday, March 11, 2011 6:14 PM
  To: Sanjeeva Kumara; u-boot@lists.denx.de
  Subject: RE: Uboot- Nor flash
 
  Hi,
 
  On Fri, Mar 11, 2011 at 14:02:20, Sanjeeva Kumara wrote:
   Hi
   My self Sanjeev.  I'm working on marvell's processor ( PXA ). I'm using 
   NOR flash to port Uboot. I want to do partition in NOR flash so that in 
   one partition I can keep my master copy and provide Uboot upgrade option. 
   Please suggest me how can I achieve this.
  
 
  The quickest would be to use CONFIG_SYS_FLASH_AUTOPROTECT_LIST. Search for 
  this config and this will help you setup autoprotect options for various 
  partitions.
 
 
  Regards,
  Gururaja
 
 
  Larsen  Toubro Limited
 
  www.larsentoubro.com
 
  This Email may contain confidential or privileged information for the 
  intended recipient (s) If you are not the intended recipient, please do not 
  use or disseminate the information, notify the sender and delete it from 
  your system.
 
 
 
 Regards,
 Gururaja
 
 
 Larsen  Toubro Limited
 
 www.larsentoubro.com
 
 This Email may contain confidential or privileged information for the 
 intended recipient (s) If you are not the intended recipient, please do not 
 use or disseminate the information, notify the sender and delete it from your 
 system.
 


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


[U-Boot] [PATCH AT91] Add watchdog reset to the at91samx SOC family

2011-03-15 Thread Michael Trimarchi
This patch add the watchdog reset function to the atmel atsam9x architectures.

Signed-off-by: Michael Trimarchi mich...@amarulasolutions.com
Cc: Reinhard Meyer u-b...@emk-elektronik.de

---
diff --git a/arch/arm/cpu/arm926ejs/at91/timer.c 
b/arch/arm/cpu/arm926ejs/at91/timer.c
index 82b8d7e..2e4ff02 100644
--- a/arch/arm/cpu/arm926ejs/at91/timer.c
+++ b/arch/arm/cpu/arm926ejs/at91/timer.c
@@ -26,6 +26,7 @@
 #include asm/arch/hardware.h
 #include asm/arch/at91_pit.h
 #include asm/arch/at91_pmc.h
+#include asm/arch/at91_wdt.h
 #include asm/arch/clk.h
 #include asm/arch/io.h
 #include div64.h
@@ -139,3 +140,18 @@ ulong get_tbclk(void)
 {
return gd-timer_rate_hz;
 }
+
+#if defined(CONFIG_WATCHDOG)
+
+void watchdog_reset(void)
+{
+   at91_wdt_t *wdt = (at91_wdt_t *) AT91_WDT_BASE;
+   int re_enable = disable_interrupts();
+
+   writel(AT91_WDT_CR_WDRSTT | AT91_WDT_CR_KEY, wdt-cr);
+
+   if (re_enable)
+   enable_interrupts();
+}
+
+#endif
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH AT91] Add watchdog reset to the at91samx SOC family

2011-03-15 Thread Reinhard Meyer
Dear Michael Trimarchi,
 This patch add the watchdog reset function to the atmel atsam9x architectures.

NAK.

Watchdog already exists at drivers/watchdog/at91sam9_wdt.c :)

Maybe its a bit of an obscure location... But it is already invented ;)

 + int re_enable = disable_interrupts();
 +
 + writel(AT91_WDT_CR_WDRSTT | AT91_WDT_CR_KEY, wdt-cr);
 +
 + if (re_enable)
 + enable_interrupts();

Besides... why would we need to disable IRQs here, writel() is using one 
instruction
to write to the address?

Best Regards,

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


Re: [U-Boot] [RFC PATCH 1/2] armv7: enable Thumb build for armv7

2011-03-15 Thread Loïc Minier
On Tue, Mar 15, 2011, Aneesh V wrote:
 Please note that I am enabling armv7-a in the second patch in omap4
 config.mk file. The reason I didn't do this here was some ARMv7 SoCs do
 not want to use -march=armv7-a even if the compiler supports it. Tegra2
 is an example. Please see the below from Tegra2 config.mk:
 
 # Use ARMv4 for Tegra2 - initial code runs on the AVP, which is an ARM7TDI.
 PLATFORM_CPPFLAGS += -march=armv4

 Good point, I wonder whether it would make sense to have
 arch/arm/cpu/armv7/config.mk default to -march=armv7 and Tegra2 to
 override this with -march=armv4.  Maybe this code doesn't belong under
 armv7 though; or perhaps -march=armv4 should only be set when building
 a subset of the files rather than by default.

 This being the case I would have had to define another CONFIG flag if I
 had to add -march=armv7-a in arch/arm/cpu/armv7/config.mk. I thought it
 un-necessary and instead put it in the SoC specific file. So, Tegra2
 can continue to use -march=armv4 and will get Thumb-1 if they enable
 CONFIG_SYS_THUMB_BUILD. Or do you think we should define something like
 CONFIG_SYS_MARCH_ARMV7

 Up to you, but I would expect that code udner arch/arm/cpu/armv7/ would
 build with -march=armv7 (maybe not -a though), with specific overrides
 where that's not the case; it would feel a bit odd to me to have this
 as a config option.

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


[U-Boot] [PATCH] Updated code to print OMAP4 cpu info.

2011-03-15 Thread Asad Akbar
---
 arch/arm/cpu/armv7/omap4/sys_
info.c |  150 +--
 1 files changed, 144 insertions(+), 6 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap4/sys_info.c
b/arch/arm/cpu/armv7/omap4/sys_info.c
index b9e5765..14145fb 100644
--- a/arch/arm/cpu/armv7/omap4/sys_info.c
+++ b/arch/arm/cpu/armv7/omap4/sys_info.c
@@ -3,8 +3,9 @@
 * Texas Instruments, www.ti.com
 *
 * Author :
- * Aneesh Vane...@ti.com
- * Steve Sakoman   st...@sakoman.com
+ *  Aneesh Vane...@ti.com
+ *  Steve Sakoman   st...@sakoman.com
+ *  Asad Akbar  asadak...@gmail.com
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
@@ -25,12 +26,40 @@
 #include common.h
 #include asm/arch/sys_proto.h

+/**
+ * Registers addresses.
+ */
+#define DEVICE_IDENTIFICATION_BASE  0x4A002000
+#define DIE_ID_00x200
+#define ID_CODE 0x204
+#define DIE_ID_10x208
+#define DIE_ID_20x20C
+#define DIE_ID_30x210
+#define PROD_ID_0   0x214
+#define PROD_ID_1   0x218
+
+/**
+ * Device types
+ */
+#define DEVICE_TYPE_GP  0xF0
+#define DEVICE_TYPE_HS  0xF1/* TODO: It has to be
updated. */
+#define DEVICE_TYPE_EMU 0xF2/* TODO: It has to be
updated. */
+#define DEVICE_TYPE_TST 0xF3/* TODO: It has to be
updated. */
+
 /*
 *  get_device_type(): tell if GP/HS/EMU/TST
 */
 u32 get_device_type(void)
 {
-   return 0;
+u32 val32;
+
+/* Reader PROD_ID_0 register. */
+val32 = __raw_readl (DEVICE_IDENTIFICATION_BASE + PROD_ID_0);
+
+/* Get only device type bits. */
+val32 = 0xFF;
+
+return (val32);
 }

 /*
@@ -38,7 +67,7 @@ u32 get_device_type(void)
 */
 u32 get_board_rev(void)
 {
-   return 0x20;
+return 0x20;
 }

 /*
@@ -46,8 +75,117 @@ u32 get_board_rev(void)
 */
 int print_cpuinfo(void)
 {
+u32 val32;
+u32 id[4] = { 0 };
+
+/* Reader ID_CODE register. */
+val32 = __raw_readl (DEVICE_IDENTIFICATION_BASE + ID_CODE);
+
+/* Make sure that it is as per documentation. */
+if (val32  0x1)
+{
+/**
+ * Get silicon type.
+ */
+if (val32 == 0x0B85202F)
+{
+printf(Silicon Type:   OMAP4430 ES1.0\n);
+}
+else if (val32 == 0x1B85202F)
+{
+printf(Silicon Type:   OMAP4430 ES2.0\n);
+}
+else if (val32 == 0x3B95C02F)
+{
+printf(Silicon Type:   OMAP4430 ES2.1\n);
+}
+else
+{
+printf(Silicon Type:   Unknown\n);
+}
+
+/**
+ * Get version.
+ */
+u8 version = (val32  28)  0xFF;
+
+switch(version)
+{
+case 0:
+printf(Version:OMAP4430 ES1.0\n);
+break;
+
+case 1:
+printf(Version:OMAP4430 ES2.0\n);
+break;
+
+case 3:
+printf(Version:OMAP4430 ES2.1\n);
+break;
+
+default:
+printf(Version:Unknown\n);
+break;
+}
+
+/**
+ * Get Hawkeye
+ */
+u16 hawkeye = (val32  12)  0xF;
+
+if (hawkeye == 0xB852)
+{
+printf(Hawkeye:OMAP4430 ES1.0 and
ES2.0\n);
+}
+else if (hawkeye == 0xB95C)
+{
+printf(Hawkeye:OMAP4430 ES2.1\n);
+}
+
+/**
+ * Get TI IDM.
+ */
+printf(Manufacturer Identity (TI): 0x%X\n, (val32  1));
+}
+else
+{
+printf(%s\n, omap_silicon_revision: TI_IDM bit is not found.);
+}
+
+/* Get device type. */
+u8 device_type = get_device_type();
+
+switch (device_type)
+{
+case DEVICE_TYPE_TST:
+printf(Device Type:%s\n, TST);
+break;
+case DEVICE_TYPE_EMU:
+printf(Device Type:%s\n, EMU);
+break;
+case DEVICE_TYPE_HS:
+printf(Device Type:%s\n, HS);
+break;
+case DEVICE_TYPE_GP:
+printf(Device Type:%s\n, GP);
+break;
+default:
+printf(Device Type:%s\n, ???);
+}
+
+/* Get Die-id */
+id[0] = __raw_readl(DEVICE_IDENTIFICATION_BASE + DIE_ID_0);
+id[1] = __raw_readl(DEVICE_IDENTIFICATION_BASE + DIE_ID_1);
+id[2] = __raw_readl(DEVICE_IDENTIFICATION_BASE + DIE_ID_2);
+id[3] = __raw_readl(DEVICE_IDENTIFICATION_BASE + DIE_ID_3);
+
+printf(Die-ID: %08X-%08X-%08X-%08X\n, id[3],
id[2], id[1], id[0]);
+
+/* Get prod-id */
+id[0] = 

Re: [U-Boot] [PATCH AT91] Add watchdog reset to the at91samx SOC family

2011-03-15 Thread Michael Trimarchi
HI

On 03/15/2011 01:01 PM, Reinhard Meyer wrote:
 Dear Michael Trimarchi,
 This patch add the watchdog reset function to the atmel atsam9x 
 architectures.
 
 NAK.
 
 Watchdog already exists at drivers/watchdog/at91sam9_wdt.c :)
 
 Maybe its a bit of an obscure location... But it is already invented ;)
 
 +int re_enable = disable_interrupts();
 +
 +writel(AT91_WDT_CR_WDRSTT | AT91_WDT_CR_KEY, wdt-cr);
 +
 +if (re_enable)
 +enable_interrupts();
 

Yes was obscured, and it is the only one :) there

Michael

 Besides... why would we need to disable IRQs here, writel() is using one 
 instruction
 to write to the address?
 
 Best Regards,
 
 Reinhard
 

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


Re: [U-Boot] [PATCH AT91] Add watchdog reset to the at91samx SOC family

2011-03-15 Thread Michael Trimarchi
Hi

On 03/15/2011 01:01 PM, Reinhard Meyer wrote:
 Dear Michael Trimarchi,
 This patch add the watchdog reset function to the atmel atsam9x 
 architectures.
 
 NAK.
 
 Watchdog already exists at drivers/watchdog/at91sam9_wdt.c :)
 

I'm getting confused because I have seen other implementation of the watchdog 
reset function and I was thinking
that was the correct location of the function. Some board initialize it in the 
sturtup.

 Maybe its a bit of an obscure location... But it is already invented ;)
 
 +int re_enable = disable_interrupts();
 +
 +writel(AT91_WDT_CR_WDRSTT | AT91_WDT_CR_KEY, wdt-cr);
 +
 +if (re_enable)
 +enable_interrupts();
 
 Besides... why would we need to disable IRQs here, writel() is using one 
 instruction
 to write to the address?
 

:(, Ok, I'm porting a new board and I have done it too fase without checking to 
much the code
but the final result. Anyway I have seen the driver but I don't understand how 
the HW_WATCHDOG interface match the hw_watchdog_init.


Michael Trimarchi


 Best Regards,
 
 Reinhard
 

___
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-15 Thread Daniel Schwierzeck
Hi Shinya,

2011/3/15 Shinya Kuribayashi skuri...@pobox.com:
 On 3/15/11 6:14 AM, daniel.schwierz...@googlemail.com wrote:

 Replace the current MIPSFLAGS code by cc-option macro and use
 -march=mips32r2 as default optimization level for all Mips32 CPUs.
 Replace the endianess determination code from toolchain prefix by
 a more generic one inspired by the Linux arch/mips/Makefile.

 [...]

 -ifneq (,$(findstring 4KCle,$(CROSS_COMPILE)))
 -ENDIANNESS = -EL
 -else
 -ENDIANNESS = -EB
 -endif
 +# Optimization flags for all Mips32 CPUs
 +MIPSFLAGS = $(call cc-option,-march=mips32r2,-mips32r2 -Wa,-mips32r2)

 -MIPSFLAGS += $(ENDIANNESS)
 +# Determine endianess from toolchain prefix
 +ENDIANESS = $(shell $(CC) -dumpmachine | \
 +               grep -q 'mips.*el-.*'  echo -EL || echo -EB)
 +
 +PLATFORM_CPPFLAGS += $(MIPSFLAGS) $(ENDIANESS)

 -PLATFORM_CPPFLAGS += $(MIPSFLAGS)

 This trick can not work with the ELDK toolchain, which also I don't
 want to think about and be involved in discussion any more.   See:

 http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/81572/focus=81735

sorry, I missed that discussion

 Users who need to dig into this area should install the ELDK first,
 build little-endian targets with it by yourself, then find a way
 to handle endianness appropriately which works for both the ELDK and
 non-ELDK toolchains.

 Or I may miss something.  If it's already verified with the ELDK,
 please let me know, thanks.


The following code works with ELDK (mips_4KC and mips_4KCle) and my
non-ELDK BE toolchain.

ifneq (,$(findstring 4KCle,$(CROSS_COMPILE)))
ENDIANESS = -EL
else ifneq (,$(findstring 4KC,$(CROSS_COMPILE)))
ENDIANESS = -EB
else
ENDIANESS = $(shell $(CC) -dumpmachine | \
grep -q 'mips.*el-.*'  echo -EL || echo -EB)
endif

Do we need this endianess flag stuff at all? Each toolchain that is
built with a specific
endinaness does not really need the extra setting of -EB/-EL or am I
miss something?

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


[U-Boot] some question about fat file system

2011-03-15 Thread loody
Dear all:
I try to port the fat file system on my platform but i cannot figure
out what and where the getfatent come from.
The comment said it try to get the entry at index entry in a FAT  table.

Is there any formula in the white paper of Microsoft FAT mentioned about this?


-- 
Thank you in advance,
miloody
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] [v2] powerpc: 'monitor' environment variable contains full video configuration

2011-03-15 Thread Timur Tabi
Wolfgang Denk wrote:
 Agreed, but please not by introducing lots of new, probably later
 incompatible code.

Fair enough.

  Can you point me to the thread or at least tell me the subject line?  I 
  have
  no idea what you're talking about.

 See http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/88169/focus=88240

Ok, so what I get from that thread is to change the name of the variables
(monitor - video and diubootargs - something else more generic) and
update the videomodes.c code to parse the same video string that the kernel
uses.  I also gathered that no one has chosen to update videomodes.c, so I would
have to do it.

Do I have that right?

 OK, so please split that patch:  one patch should do this cleanup, and
 another one should contain the rest.

I can't make any promises, since a lot of the code is intermingled.

 Instead of a non-standard and undocumented 'diubootargs' environment
 variable please use something (probably called video-mode :-) that
 can be passed as video-mode= boot argument to Linux.
 
 At this point I wonder which use ther eis left for your monitor
 variable - it should be completely redundant now?

Well, it may still be necessary to have two variables.  One for the mode that
U-Boot parses, and one for the string that is passed to the kernel.  This is
because the kernel also needs to see console=tty0 on the command line only if
video is supposed to be enabled.  I want to make video mode completely dynamic,
so that if the 'video-mode' variable is set, then the console is switched to the
video device, and the kernel is told to do the same.  Otherwise, all output will
go to the serial port.

-- 
Timur Tabi
Linux kernel developer at Freescale

-- 
Timur Tabi
Linux kernel developer at Freescale

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


Re: [U-Boot] [PATCH] [v2] powerpc: 'monitor' environment variable contains full video configuration

2011-03-15 Thread Wolfgang Denk
Dear Timur Tabi,

In message 4d7f7cb9.8090...@freescale.com you wrote:

 (monitor - video and diubootargs - something else more generic) and

video-mode ?

 update the videomodes.c code to parse the same video string that the kernel
 uses.  I also gathered that no one has chosen to update videomodes.c, so I 
 would
 have to do it.
 
 Do I have that right?

I think so.

Anatolij?
Stefano?

  At this point I wonder which use ther eis left for your monitor
  variable - it should be completely redundant now?
 
 Well, it may still be necessary to have two variables.  One for the mode that

No, this is exactly what should be avoided.

 U-Boot parses, and one for the string that is passed to the kernel.  This is

U-Boot and the Kernel should parse exactly the same variable.

 because the kernel also needs to see console=tty0 on the command line only 
 if

This may or may not be the case.  Frequently we still use a serial
console even when booting with a graphics display enabled.

This is a different option, and does not belong into that setting.

 video is supposed to be enabled.  I want to make video mode completely 
 dynamic,
 so that if the 'video-mode' variable is set, then the console is switched to 
 the
 video device, and the kernel is told to do the same.  Otherwise, all output 
 will
 go to the serial port.

NAK. video-mode settings and console settings are two separate things
and must not be mangled into a single variable.

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
And now remains  That we find out the cause of this effect, Or rather
say, the cause of this defect...   -- Hamlet, Act II, Scene 2
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] [v2] powerpc: 'monitor' environment variable contains full video configuration

2011-03-15 Thread Timur Tabi
Wolfgang Denk wrote:
  because the kernel also needs to see console=tty0 on the command line 
  only if
 This may or may not be the case.  Frequently we still use a serial
 console even when booting with a graphics display enabled.
 
 This is a different option, and does not belong into that setting.
 
  video is supposed to be enabled.  I want to make video mode completely 
  dynamic,
  so that if the 'video-mode' variable is set, then the console is switched 
  to the
  video device, and the kernel is told to do the same.  Otherwise, all 
  output will
  go to the serial port.

 NAK. video-mode settings and console settings are two separate things
 and must not be mangled into a single variable.

Well, that's why I have two variables.  My patch has the ability to set the
kernel command line appropriately if the video display is configured and enabled
in U-Boot.  The second variable is used to assist in setting the actual kernel
command-line, because that's the easiest and safest way to do it.  An
alternative that I tried to implement is to have do_bootm_linux() edit the
kernel command line directly, removing any existing video= option and putting a
new one in, but I found that to be too intrusive, especially since we don't have
any good string editing functions already in U-Boot.

There are three things that need to be done:

1) The video mode needs to be configured
2) The video display needs to be enabled and the U-Boot console needs to be
routed to it
3) The kernel command line needs to be set

For #1, we use video-mode.  How do you want #2 and #3 handled?

-- 
Timur Tabi
Linux kernel developer at Freescale

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


[U-Boot] [PATCH v3] fsl_ddr: Don't use full 64-bit divides on 32-bit PowerPC

2011-03-15 Thread Kyle Moffett
The current FreeScale MPC-8xxx DDR SPD interpreter is using full 64-bit
integer divide operations to convert between nanoseconds and DDR clock
cycles given arbitrary DDR clock frequencies.

Since all of the inputs to this are 32-bit (nanoseconds, clock cycles,
and DDR frequencies), we can easily restructure the computation to use
the do_div() function to perform 64-bit/32-bit divide operations.

On 64-bit this change is basically a no-op, because do_div is
implemented as a literal 64-bit divide operation and the instruction
scheduling works out almost the same.

On 32-bit PowerPC a fully accurate 64/64 divide (__udivdi3 in libgcc) is
over 1.1kB of code and thousands of heavily dependent cycles to compute,
all of which is linked from libgcc.  Another 1.2kB of code comes in for
the function __umoddi3.

It should be noted that nothing else in U-Boot or the Linux kernel seems
to require a full 64-bit divide on my 32-bit PowerPC.

Build-and-boot-tested on the HWW-1U-1A board using DDR2 SPD detection.

Signed-off-by: Kyle Moffett kyle.d.moff...@boeing.com
Acked-by: York Sun york...@freescale.com
Cc: Andy Fleming aflem...@gmail.com
Cc: Kumar Gala kumar.g...@freescale.com

--
Changelog:
v2: Resubmitted separately from the other HWW-1U-1A patches
v3: Rebased on the 'next' branch of git://git.denx.de/u-boot-mpc85xx.git

 arch/powerpc/cpu/mpc8xxx/ddr/util.c |   56 +--
 1 files changed, 40 insertions(+), 16 deletions(-)

diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/util.c 
b/arch/powerpc/cpu/mpc8xxx/ddr/util.c
index b9a5a69..02908b4 100644
--- a/arch/powerpc/cpu/mpc8xxx/ddr/util.c
+++ b/arch/powerpc/cpu/mpc8xxx/ddr/util.c
@@ -8,9 +8,17 @@
 
 #include common.h
 #include asm/fsl_law.h
+#include div64.h
 
 #include ddr.h
 
+/* To avoid 64-bit full-divides, we factor this here */
+#define ULL_2e12 2ULL
+#define UL_5pow12 244140625UL
+#define UL_2pow13 (1UL  13)
+
+#define ULL_8Fs 0xULL
+
 /*
  * Round mclk_ps to nearest 10 ps in memory controller code.
  *
@@ -20,35 +28,51 @@
  */
 unsigned int get_memory_clk_period_ps(void)
 {
-   unsigned int mclk_ps;
+   unsigned int data_rate = get_ddr_freq(0);
+   unsigned int result;
+
+   /* Round to nearest 10ps, being careful about 64-bit multiply/divide */
+   unsigned long long mclk_ps = ULL_2e12;
 
-   mclk_ps = 2ULL / get_ddr_freq(0);
-   /* round to nearest 10 ps */
-   return 10 * ((mclk_ps + 5) / 10);
+   /* Add 5*data_rate, for rounding */
+   mclk_ps += 5*(unsigned long long)data_rate;
+
+   /* Now perform the big divide, the result fits in 32-bits */
+   do_div(mclk_ps, data_rate);
+   result = mclk_ps;
+
+   /* We still need to round to 10ps */
+   return 10 * (result/10);
 }
 
 /* Convert picoseconds into DRAM clock cycles (rounding up if needed). */
 unsigned int picos_to_mclk(unsigned int picos)
 {
-   const unsigned long long ULL_2e12 = 2ULL;
-   const unsigned long long ULL_8Fs = 0xULL;
-   unsigned long long clks;
-   unsigned long long clks_temp;
+   unsigned long long clks, clks_rem;
 
+   /* Short circuit for zero picos */
if (!picos)
return 0;
 
-   clks = get_ddr_freq(0) * (unsigned long long) picos;
-   clks_temp = clks;
-   clks = clks / ULL_2e12;
-   if (clks_temp % ULL_2e12) {
+   /* First multiply the time by the data rate (32x32 = 64) */
+   clks = picos * (unsigned long long)get_ddr_freq(0);
+
+   /*
+* Now divide by 5^12 and track the 32-bit remainder, then divide
+* by 2*(2^12) using shifts (and updating the remainder).
+*/
+   clks_rem = do_div(clks, UL_5pow12);
+   clks_rem = 13;
+   clks_rem |= clks  (UL_2pow13-1);
+   clks = 13;
+
+   /* If we had a remainder, then round up */
+   if (clks_rem)
clks++;
-   }
 
-   if (clks  ULL_8Fs) {
+   /* Clamp to the maximum representable value */
+   if (clks  ULL_8Fs)
clks = ULL_8Fs;
-   }
-
return (unsigned int) clks;
 }
 
-- 
1.7.2.3

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


Re: [U-Boot] [PATCH] [v2] powerpc: 'monitor' environment variable contains full video configuration

2011-03-15 Thread Wolfgang Denk
Dear Timur Tabi,

In message 4d7f83ec.4050...@freescale.com you wrote:

  NAK. video-mode settings and console settings are two separate things
  and must not be mangled into a single variable.
 
 Well, that's why I have two variables.  My patch has the ability to set the
 kernel command line appropriately if the video display is configured and 
 enabled
 in U-Boot.  The second variable is used to assist in setting the actual kernel
 command-line, because that's the easiest and safest way to do it.  An

Don't try to be more clever than the user.  Instead of helping, you
restrict him. That's bad.

 alternative that I tried to implement is to have do_bootm_linux() edit the
 kernel command line directly, removing any existing video= option and putting 
 a

NAK, NAK, NAK.  All such automatic and unconditional editing is bad
and should strictly be avoided.

Leave the decision which device to use as console to the user.

 There are three things that need to be done:
 
 1) The video mode needs to be configured

ACK.

 2) The video display needs to be enabled and the U-Boot console needs to be
 routed to it

NAK.

Wether the U-Boot console is attached to the serial port or the video
console or netconsole or anything else should be left to the user.

A default setting is OK, but the user must be able to set anything he
likes.

 3) The kernel command line needs to be set

ACK.  Again, the user must have free choice of options.

 For #1, we use video-mode.  How do you want #2 and #3 handled?

See above.

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
The alternative to genuflecting before the  god  of  code-bumming  is
finding  a  better  algorithm.  It should be clear that none such was
available. If your code is too slow, you must make it faster.  If  no
better algorithm is available, you must trim cycles.
 - t...@alice.uucp (Tom Duff) 29 Aug 88
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] [v2] powerpc: 'monitor' environment variable contains full video configuration

2011-03-15 Thread Timur Tabi
Wolfgang Denk wrote:
 Well, that's why I have two variables.  My patch has the ability to set the
  kernel command line appropriately if the video display is configured and 
  enabled
  in U-Boot.  The second variable is used to assist in setting the actual 
  kernel
  command-line, because that's the easiest and safest way to do it.  An

 Don't try to be more clever than the user.  Instead of helping, you
 restrict him. That's bad.

I'm not being more clever.  The code is setting a variable (diubootargs) that is
guaranteed to be the same video mode that U-Boot is running.  If you want to
ensure that Linux set to the same video mode, then use the variable.  Otherwise,
don't use the variable and set the command line manually.

  alternative that I tried to implement is to have do_bootm_linux() edit the
  kernel command line directly, removing any existing video= option and 
  putting a

 NAK, NAK, NAK.  All such automatic and unconditional editing is bad
 and should strictly be avoided.

You didn't understand my post.  I was saying that I tried to implement it, but
gave up because it got too complicated.

 Leave the decision which device to use as console to the user.

That's what the 'monitor' environment variable is for.

  There are three things that need to be done:
  
  1) The video mode needs to be configured
 ACK.
 
  2) The video display needs to be enabled and the U-Boot console needs to be
  routed to it
 NAK.
 
 Wether the U-Boot console is attached to the serial port or the video
 console or netconsole or anything else should be left to the user.

Again, that's what the variable is for.  What's the point of configuring the
video display if you're not going to enable it?

 A default setting is OK, but the user must be able to set anything he
 likes.

Are we speaking the same language?  It doesn't appear that you're understanding
anything I'm saying.

  3) The kernel command line needs to be set
 ACK.  Again, the user must have free choice of options.
 
  For #1, we use video-mode.  How do you want #2 and #3 handled?
 See above.

I still don't understand what you actually want.

-- 
Timur Tabi
Linux kernel developer at Freescale

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


Re: [U-Boot] p4080ds starts OS with MSR[EE]=1 and DEC armed?

2011-03-15 Thread Scott Wood
On Tue, 15 Mar 2011 00:39:17 -0500
Kumar Gala ga...@kernel.crashing.org wrote:

 diff --git a/cpu/mpc85xx/cpu_init.c b/cpu/mpc85xx/cpu_init.c
 index 48a82ed..a6d1e99 100644
 --- a/cpu/mpc85xx/cpu_init.c
 +++ b/cpu/mpc85xx/cpu_init.c
 @@ -364,5 +364,16 @@ extern void setup_ivors(void);
  
  void arch_preboot_os(void)
  {
 +   u32 msr;
 +
 +   /*
 +* We are changing interrupt offsets and are about to boot the OS so
 +* we need to make sure we disable all async interrupts. EE is already
 +* disabled by the time we get called.
 +*/
 +   msr = mfmsr();
 +   msr = ~(MSR_ME|MSR_CE|MSR_DE);
 +   mtmsr(msr);
 +
 setup_ivors();
  }
 
 -
 
 :)

Ah, thanks.  Not sure why my previous grep found the other one but not
this. :-)

-Scott

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


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

2011-03-15 Thread Luca Ceresoli
Hi,

I ported U-boot to a custom BeagleBoard-derivative board, which is running
fine so far.

Now I'm trying to upgrade from the current codebase (v2010.06) to a more
recent one. My custom U-boot stopped booting after merging the
ARM relocation code implemented in september 2010 by Heiko Schocher,
even though I think I've changed my code where needed.

More in detail, my code base works perfectly if merged with the upstream
code (from git://git.denx.de/u-boot.git) until the commit before the ARM
relocation series:
 4fff329 nand_boot_fsl_nfc.c: make nfc a static const pointer

It stops working when I merge these 3 commits (plus an arbitrarily large
amount of the following ones):
 f1d2b31 ARM: add relocation support
 e48b7c0 ARM: implement relocation for ARM11
 561142a ARM: implement relocation for ARM V7 (OMAP)
plus this patch to my code (copied from the Beagle code changes in commit
561142a above):

diff --git a/board/mycompany/myboard/config.mk 
b/board/mycompany/myboard/config.mk
index 150b30c..a9c88d2 100644
--- a/board/mycompany/myboard/config.mk
+++ b/board/mycompany/myboard/config.mk
@@ -30,4 +30,4 @@
 # (mem base + reserved)
 
 # For use with external or internal boots.
-TEXT_BASE = 0x80e8
+TEXT_BASE = 0x80008000
diff --git a/include/configs/omap3_myboard.h b/include/configs/omap3_myboard.h
index c62febd..be0d9a9 100644
--- a/include/configs/omap3_myboard.h
+++ b/include/configs/omap3_myboard.h
@@ -333,4 +333,9 @@ extern unsigned int boot_flash_sec;
 extern unsigned int boot_flash_type;
 #endif
 
+/* additions for new relocation code, must added to all boards */
+#undef CONFIG_SYS_ARM_WITHOUT_RELOC /* This board is tested with relocation 
support */
+#define CONFIG_SYS_SDRAM_BASE  PHYS_SDRAM_1
+#define CONFIG_SYS_INIT_SP_ADDR(LOW_LEVEL_SRAM_STACK - 
CONFIG_SYS_GBL_DATA_SIZE)
+
 #endif /* __CONFIG_H */


The result is that U-boot does not print any single character on the serial
console, and I'm lost since I can't use a JTAG emulator.

As I am not expert in the low-level U-boot code, I don't know where to look
at. Any suggestion would be appreciated.


Here are a few more details that might be relevant.

The board is a BeagleBoard derivative, with the same CPU (OMAP3530,
Cortex-A8) and NAND flash chip.
The RAM chip is the same model, but we have only one 128 MB chip instead of
two.
There's also a LAN chip (SMC911x family).

I started my porting from the upstream repository at
git://git.denx.de/u-boot.git and created a branch.

Here I added a new board, initially equal to Beagle, then I removed some
unwanted features (JFFS2, board detection), added some wanted ones
(UBI/UBIFS, LAN driver, CONFIG_CMD_NET) and adapdet the default environment.

I also changed CONFIG_SYS_MALLOC_LEN from 128kB to 1MB, as it was not enough
for UBI to work.

Thanks in advance,
Luca


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


[U-Boot] [PATCH v6 0/4] Board support series for the eXMeritus HWW-1U-1A

2011-03-15 Thread Kyle Moffett
This is the latest respin of the eXMeritus HWW-1U-1A board support patches,
rebased onto the 'next' branch of git://git.denx.de/u-boot-mpc85xx.git

As Wolfgang NAKed the more involved reset rework, I've moved the patch for a
simple board-specific restart hook back into this series.

I believe these 4 patches are ready to be merged, as all concerns presented
so far have been addressed.

Cheers,
Kyle Moffett

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


[U-Boot] [PATCH v6 2/4] mpc85xx: Add inline GPIO acessor functions

2011-03-15 Thread Kyle Moffett
To ease the implementation of other MPC85xx board ports, several common
GPIO helpers are added to asm/mpc85xx_gpio.h.

Since each of these compiles to no more than 4-5 instructions it would
be very inefficient to call them out of line, therefore we put them
entirely in the header file.

The HWW-1U-1A board port which these were written for strongly prefers
to set multiple GPIOs as a single batch operation, so the API is
designed around that basis.

To assist other board ports, a small set of wrappers are used which
provides a standard gpio_request() interface around the MPC85xx-specific
functions.  This can be enabled with CONFIG_MPC85XX_GENERIC_GPIO

Signed-off-by: Kyle Moffett kyle.d.moff...@boeing.com
Cc: Andy Fleming aflem...@gmail.com
Cc: Kumar Gala kumar.g...@freescale.com
Cc: Peter Tyser pty...@xes-inc.com

---
Changelog:
v2: Moved the inline functions to a non-board-specific header
v3: Added generic Linux-standard GPIO wrappers
v4: Improved comments and fixed minor bugs in the wrapper functions
v5: No changes
v6: Rebased onto the 'next' branch of git://git.denx.de/u-boot-mpc85xx.git

 arch/powerpc/include/asm/mpc85xx_gpio.h |  120 +++
 1 files changed, 120 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/include/asm/mpc85xx_gpio.h

diff --git a/arch/powerpc/include/asm/mpc85xx_gpio.h 
b/arch/powerpc/include/asm/mpc85xx_gpio.h
new file mode 100644
index 000..ad54b4e
--- /dev/null
+++ b/arch/powerpc/include/asm/mpc85xx_gpio.h
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2010 eXMeritus, A Boeing Company
+ *
+ * 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 asm/immap_85xx.h
+
+/*
+ * The following internal functions are an MPC85XX-specific GPIO API which
+ * allows setting and querying multiple GPIOs in a single operation.
+ *
+ * All of these look relatively large, but the arguments are almost always
+ * constants, so they compile down to just a few instructions and a
+ * memory-mapped IO operation or two.
+ */
+static inline void mpc85xx_gpio_set(unsigned int mask,
+   unsigned int dir, unsigned int val)
+{
+   ccsr_gpio_t *gpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR + 0xc00);
+
+   /* First mask off the unwanted parts of dir and val */
+   dir = mask;
+   val = mask;
+
+   /* Now read in the values we're supposed to preserve */
+   dir |= (in_be32(gpio-gpdir)  ~mask);
+   val |= (in_be32(gpio-gpdat)  ~mask);
+
+   /*
+* Poke the new output values first, then set the direction.  This
+* helps to avoid transient data when switching from input to output
+* and vice versa.
+*/
+   out_be32(gpio-gpdat, val);
+   out_be32(gpio-gpdir, dir);
+}
+
+static inline void mpc85xx_gpio_set_in(unsigned int gpios)
+{
+   mpc85xx_gpio_set(gpios, 0x, 0x);
+}
+
+static inline void mpc85xx_gpio_set_low(unsigned int gpios)
+{
+   mpc85xx_gpio_set(gpios, 0x, 0x);
+}
+
+static inline void mpc85xx_gpio_set_high(unsigned int gpios)
+{
+   mpc85xx_gpio_set(gpios, 0x, 0x);
+}
+
+static inline unsigned int mpc85xx_gpio_get(unsigned int mask)
+{
+   ccsr_gpio_t *gpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR + 0xc00);
+
+   /* Read the requested values */
+   return in_be32(gpio-gpdat)  mask;
+}
+
+/*
+ * These implement the generic Linux GPIO API on top of the other functions
+ * in this header.
+ */
+#ifdef CONFIG_MPC85XX_GENERIC_GPIO
+static inline int gpio_request(unsigned gpio, const char *label)
+{
+   /* Compatibility shim */
+   return 0;
+}
+
+static inline void gpio_free(unsigned gpio)
+{
+   /* Compatibility shim */
+}
+
+static inline int gpio_direction_input(unsigned gpio)
+{
+   mpc85xx_gpio_set_in(1U  gpio);
+   return 0;
+}
+
+static inline int gpio_direction_output(unsigned gpio, int value)
+{
+   mpc85xx_gpio_set_low(1U  gpio);
+   return 0;
+}
+
+static inline int gpio_get_value(unsigned gpio)
+{
+   return !!mpc85xx_gpio_get(1U  gpio)
+}
+
+static inline void gpio_set_value(unsigned gpio, int value)
+{
+   if (value)
+   mpc85xx_gpio_set_high(1U  gpio);
+   else
+   mpc85xx_gpio_set_low(1U  gpio);
+}
+
+static inline int gpio_is_valid(int gpio)
+{
+   return (gpio 

[U-Boot] [PATCH v6 1/4] mpc8xxx: DDR2/DDR3: Clean up DIMM-type switch statements

2011-03-15 Thread Kyle Moffett
The numeric constants in the switch statements are replaced by #defines
added to the common ddr_spd.h header.  This dramatically improves the
readability of the switch statments.

In addition, a few of the longer lines were cleaned up, and the DDR2
type for an SO-RDIMM module was added to the DDR2 switch statement.

Signed-off-by: Kyle Moffett kyle.d.moff...@boeing.com
Cc: Andy Fleming aflem...@gmail.com
Cc: Kumar Gala kumar.g...@freescale.com
Cc: Kim Phillips kim.phill...@freescale.com

---
Changelog:
v2: Moved the constants to include/ddr_spd.h and also fixed DDR3
v3: No changes
v4: Fixed up excessively long lines
v5: No changes
v6: Rebased onto the 'next' branch of git://git.denx.de/u-boot-mpc85xx.git

 arch/powerpc/cpu/mpc8xxx/ddr/ddr2_dimm_params.c |   23 +++-
 arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c |   43 ++
 common/ddr_spd.c|2 +-
 include/ddr_spd.h   |   28 ++-
 4 files changed, 53 insertions(+), 43 deletions(-)

diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/ddr2_dimm_params.c 
b/arch/powerpc/cpu/mpc8xxx/ddr/ddr2_dimm_params.c
index dcb37ce..b565e33 100644
--- a/arch/powerpc/cpu/mpc8xxx/ddr/ddr2_dimm_params.c
+++ b/arch/powerpc/cpu/mpc8xxx/ddr/ddr2_dimm_params.c
@@ -250,24 +250,27 @@ ddr_compute_dimm_parameters(const ddr2_spd_eeprom_t *spd,
pdimm-primary_sdram_width = spd-primw;
pdimm-ec_sdram_width = spd-ecw;
 
-   /* FIXME: what about registered SO-DIMM? */
+   /* These are all the types defined by the JEDEC DDR2 SPD 1.3 spec */
switch (spd-dimm_type) {
-   case 0x01:  /* RDIMM */
-   case 0x10:  /* Mini-RDIMM */
-   pdimm-registered_dimm = 1; /* register buffered */
+   case DDR2_SPD_DIMMTYPE_RDIMM:
+   case DDR2_SPD_DIMMTYPE_72B_SO_RDIMM:
+   case DDR2_SPD_DIMMTYPE_MINI_RDIMM:
+   /* Registered/buffered DIMMs */
+   pdimm-registered_dimm = 1;
break;
 
-   case 0x02:  /* UDIMM */
-   case 0x04:  /* SO-DIMM */
-   case 0x08:  /* Micro-DIMM */
-   case 0x20:  /* Mini-UDIMM */
-   pdimm-registered_dimm = 0; /* unbuffered */
+   case DDR2_SPD_DIMMTYPE_UDIMM:
+   case DDR2_SPD_DIMMTYPE_SO_DIMM:
+   case DDR2_SPD_DIMMTYPE_MICRO_DIMM:
+   case DDR2_SPD_DIMMTYPE_MINI_UDIMM:
+   /* Unbuffered DIMMs */
+   pdimm-registered_dimm = 0;
break;
 
+   case DDR2_SPD_DIMMTYPE_72B_SO_CDIMM:
default:
printf(unknown dimm_type 0x%02X\n, spd-dimm_type);
return 1;
-   break;
}
 
/* SDRAM device parameters */
diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c 
b/arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c
index 29cea53..756b15f 100644
--- a/arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c
+++ b/arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c
@@ -128,24 +128,32 @@ ddr_compute_dimm_parameters(const ddr3_spd_eeprom_t *spd,
pdimm-data_width = pdimm-primary_sdram_width
  + pdimm-ec_sdram_width;
 
-   switch (spd-module_type  0xf) {
-   case 0x01:  /* RDIMM */
-   case 0x05:  /* Mini-RDIMM */
-   pdimm-registered_dimm = 1; /* register buffered */
+   /* These are the types defined by the JEDEC DDR3 SPD spec */
+   pdimm-mirrored_dimm = 0;
+   pdimm-registered_dimm = 0;
+   switch (spd-module_type  DDR3_SPD_MODULETYPE_MASK) {
+   case DDR3_SPD_MODULETYPE_RDIMM:
+   case DDR3_SPD_MODULETYPE_MINI_RDIMM:
+   /* Registered/buffered DIMMs */
+   pdimm-registered_dimm = 1;
for (i = 0; i  16; i += 2) {
-   pdimm-rcw[i] = spd-mod_section.registered.rcw[i/2]  
0x0F;
-   pdimm-rcw[i+1] = (spd-mod_section.registered.rcw[i/2] 
 4)  0x0F;
+   u8 rcw = spd-mod_section.registered.rcw[i/2];
+   pdimm-rcw[i]   = (rcw  0)  0x0F;
+   pdimm-rcw[i+1] = (rcw  4)  0x0F;
}
break;
-   case 0x02:  /* UDIMM */
-   case 0x03:  /* SO-DIMM */
-   case 0x04:  /* Micro-DIMM */
-   case 0x06:  /* Mini-UDIMM */
-   pdimm-registered_dimm = 0; /* unbuffered */
+
+   case DDR3_SPD_MODULETYPE_UDIMM:
+   case DDR3_SPD_MODULETYPE_SO_DIMM:
+   case DDR3_SPD_MODULETYPE_MICRO_DIMM:
+   case DDR3_SPD_MODULETYPE_MINI_UDIMM:
+   /* Unbuffered DIMMs */
+   if (spd-mod_section.unbuffered.addr_mapping  0x1)
+   pdimm-mirrored_dimm = 1;
break;
 
default:
-   printf(unknown dimm_type 0x%02X\n, spd-module_type);
+   printf(unknown module_type 0x%02X\n, spd-module_type);
return 1;
}
 
@@ -303,16 +311,5 @@ ddr_compute_dimm_parameters(const 

[U-Boot] [PATCH v6 3/4] mpc85xx: Add a board-specific restart hook

2011-03-15 Thread Kyle Moffett
The HWW-1U-1A board needs to be able to override the reset command due
to hardware design limitations.

Signed-off-by: Kyle Moffett kyle.d.moff...@boeing.com
Cc: Andy Fleming aflem...@gmail.com
Cc: Kumar Gala kumar.g...@freescale.com

---
Changelog:
v2: Removed in favor of more involved reset rework
v6: Resurrected again (the more involved rework was NAKed)

 arch/powerpc/cpu/mpc85xx/cpu.c |   27 ++-
 1 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c
index 49ea6cc..75e4aab 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu.c
@@ -203,11 +203,17 @@ int checkcpu (void)
 
 /* - */
 
-int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+/* Board-specific reset stub */
+__attribute__((__weak__))
+int __board_restart(void)
 {
-/* Everything after the first generation of PQ3 parts has RSTCR */
+   return 0;
+}
+
 #if defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || \
 defined(CONFIG_MPC8555) || defined(CONFIG_MPC8560)
+int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
unsigned long val, msr;
 
/*
@@ -221,14 +227,25 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char 
* const argv[])
val = mfspr(DBCR0);
val |= 0x7000;
mtspr(DBCR0,val);
+}
 #else
-   volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+   /* Everything after the first generation of PQ3 parts has RSTCR */
+   ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+
+   /* Allow boards to override the reset */
+   int err = __board_restart();
+   if (err)
+   return err;
+
out_be32(gur-rstcr, 0x2); /* HRESET_REQ */
udelay(100);
-#endif
-
return 1;
 }
+#endif
+
+
 
 
 /*
-- 
1.7.2.3

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


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

2011-03-15 Thread Kyle Moffett
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.

High-level hardware overview:
  * DO-160 certified for passenger aircraft (noncritical)
  * TEMPEST ceritified for RED/BLACK separation
  * 3 zones per chassis, 2 computers per zone (total of 6)
  * Dual-core 1.066GHz P2020 per computer
  * One 2GB DDR2 SO-RDIMM module per computer (upgradable to 4GB)
  * Removable 80GB or 160GB Intel X18-M SSD per computer
  * Front-accessible dual-port E1000E per computer
  * Front-accessible serial console per computer
  * Front-accessible USB port per computer
  * Internal Gigabit crossover within each TEMPEST zone
  * Internal unidirectional fiber links across TEMPEST zones
  * Battery-backed DS1339 I2C RTC on each CPU.

Combined, each 13lb 1U chassis contains 12GB RAM, 12 cores @ 1.066GHz,
12 front-accessible Gigabit Ethernet ports and 960GB of solid-state
storage with a total power consumption of ~200W.

Additional notes:
  * SPD detection is only known to work with the DO-160-certified DIMMs

  * A U-Boot built with 36-bit address-space seems to work, but I don't
yet have a usable 36-bit kernel or DTB, so it's mostly untested.

  * CPU reset is a little quirky due to hardware misfeature, see the
extensive comments in the board_reset() function in hww1u1a.c

Signed-off-by: Kyle Moffett kyle.d.moff...@boeing.com
Cc: Andy Fleming aflem...@gmail.com
Cc: Kumar Gala kumar.g...@freescale.com
---
 MAINTAINERS   |4 +
 board/exmeritus/hww1u1a/Makefile  |   54 
 board/exmeritus/hww1u1a/ddr.c |   34 +++
 board/exmeritus/hww1u1a/gpios.h   |   67 +
 board/exmeritus/hww1u1a/hww1u1a.c |  543 +
 board/exmeritus/hww1u1a/law.c |   34 +++
 board/exmeritus/hww1u1a/tlb.c |  106 +++
 boards.cfg|2 +
 include/configs/HWW1U1A.h |  474 
 9 files changed, 1318 insertions(+), 0 deletions(-)
 create mode 100644 board/exmeritus/hww1u1a/Makefile
 create mode 100644 board/exmeritus/hww1u1a/ddr.c
 create mode 100644 board/exmeritus/hww1u1a/gpios.h
 create mode 100644 board/exmeritus/hww1u1a/hww1u1a.c
 create mode 100644 board/exmeritus/hww1u1a/law.c
 create mode 100644 board/exmeritus/hww1u1a/tlb.c
 create mode 100644 include/configs/HWW1U1A.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 4756f14..6644baf 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -320,6 +320,10 @@ Reinhard Meyer reinhard.me...@emk-elektronik.de
TOP5200 MPC5200
TOP9000 ARM926EJS (AT91SAM9xxx SoC)
 
+Kyle Moffett kyle.d.moff...@boeing.com
+
+   HWW1U1A P2020
+
 Tolunay Orkun tor...@nextio.com
 
csb272  PPC405GP
diff --git a/board/exmeritus/hww1u1a/Makefile b/board/exmeritus/hww1u1a/Makefile
new file mode 100644
index 000..b927f59
--- /dev/null
+++ b/board/exmeritus/hww1u1a/Makefile
@@ -0,0 +1,54 @@
+#
+# Copyright 2007-2009 Freescale Semiconductor, Inc.
+# (C) Copyright 2001-2006
+# 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-y+= $(BOARD).o
+COBJS-y+= law.o
+COBJS-y+= tlb.o
+COBJS-$(CONFIG_DDR_SPD) += ddr.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+clean:
+   rm -f $(OBJS) $(SOBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak .depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/exmeritus/hww1u1a/ddr.c b/board/exmeritus/hww1u1a/ddr.c
new file mode 100644
index 000..36d02ad
--- /dev/null
+++ b/board/exmeritus/hww1u1a/ddr.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2009-2010 eXMeritus, A Boeing Company
+ * Copyright 

[U-Boot] [PATCH] powerpc/85xx: Fix setting of LIODN prop in PCIe nodes on P3041/P5020

2011-03-15 Thread Kumar Gala
From: Laurentiu TUDOR laurentiu.tu...@freescale.com

We utilize the compatible string to find the node to add fsl,liodn
property to.  However P3041  P5020 don't have fsl,p4080-pcie
compatible for their PCIe controllers as they aren't backwards compatible.

Allow the macro's to specify the PCIe compatible to use to allow SoC
uniqueness.  On P3041  P5020 we utilize fsl,qoriq-pcie-v2.2 for the
PCIe controllers.

Signed-off-by: Laurentiu TUDOR laurentiu.tu...@freescale.com
Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
 arch/powerpc/cpu/mpc85xx/p3041_ids.c |   10 +-
 arch/powerpc/cpu/mpc85xx/p4080_ids.c |8 
 arch/powerpc/cpu/mpc85xx/p5020_ids.c |   10 +-
 arch/powerpc/include/asm/fsl_liodn.h |4 ++--
 4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/p3041_ids.c 
b/arch/powerpc/cpu/mpc85xx/p3041_ids.c
index febbee9..1255898 100644
--- a/arch/powerpc/cpu/mpc85xx/p3041_ids.c
+++ b/arch/powerpc/cpu/mpc85xx/p3041_ids.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010 Freescale Semiconductor, Inc.
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -52,10 +52,10 @@ struct liodn_id_table liodn_tbl[] = {
SET_SATA_LIODN(1, 127),
SET_SATA_LIODN(2, 128),
 
-   SET_PCI_LIODN(1, 193),
-   SET_PCI_LIODN(2, 194),
-   SET_PCI_LIODN(3, 195),
-   SET_PCI_LIODN(4, 196),
+   SET_PCI_LIODN(fsl,qoriq-pcie-v2.2, 1, 193),
+   SET_PCI_LIODN(fsl,qoriq-pcie-v2.2, 2, 194),
+   SET_PCI_LIODN(fsl,qoriq-pcie-v2.2, 3, 195),
+   SET_PCI_LIODN(fsl,qoriq-pcie-v2.2, 4, 196),
 
SET_DMA_LIODN(1, 197),
SET_DMA_LIODN(2, 198),
diff --git a/arch/powerpc/cpu/mpc85xx/p4080_ids.c 
b/arch/powerpc/cpu/mpc85xx/p4080_ids.c
index df25048..fd155c8 100644
--- a/arch/powerpc/cpu/mpc85xx/p4080_ids.c
+++ b/arch/powerpc/cpu/mpc85xx/p4080_ids.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010 Freescale Semiconductor, Inc.
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -44,9 +44,9 @@ struct liodn_id_table liodn_tbl[] = {
 
SET_SDHC_LIODN(1, 156),
 
-   SET_PCI_LIODN(1, 193),
-   SET_PCI_LIODN(2, 194),
-   SET_PCI_LIODN(3, 195),
+   SET_PCI_LIODN(fsl,p4080-pcie, 1, 193),
+   SET_PCI_LIODN(fsl,p4080-pcie, 2, 194),
+   SET_PCI_LIODN(fsl,p4080-pcie, 3, 195),
 
SET_DMA_LIODN(1, 196),
SET_DMA_LIODN(2, 197),
diff --git a/arch/powerpc/cpu/mpc85xx/p5020_ids.c 
b/arch/powerpc/cpu/mpc85xx/p5020_ids.c
index febbee9..1255898 100644
--- a/arch/powerpc/cpu/mpc85xx/p5020_ids.c
+++ b/arch/powerpc/cpu/mpc85xx/p5020_ids.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010 Freescale Semiconductor, Inc.
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -52,10 +52,10 @@ struct liodn_id_table liodn_tbl[] = {
SET_SATA_LIODN(1, 127),
SET_SATA_LIODN(2, 128),
 
-   SET_PCI_LIODN(1, 193),
-   SET_PCI_LIODN(2, 194),
-   SET_PCI_LIODN(3, 195),
-   SET_PCI_LIODN(4, 196),
+   SET_PCI_LIODN(fsl,qoriq-pcie-v2.2, 1, 193),
+   SET_PCI_LIODN(fsl,qoriq-pcie-v2.2, 2, 194),
+   SET_PCI_LIODN(fsl,qoriq-pcie-v2.2, 3, 195),
+   SET_PCI_LIODN(fsl,qoriq-pcie-v2.2, 4, 196),
 
SET_DMA_LIODN(1, 197),
SET_DMA_LIODN(2, 198),
diff --git a/arch/powerpc/include/asm/fsl_liodn.h 
b/arch/powerpc/include/asm/fsl_liodn.h
index f76676c..0ec5c0a 100644
--- a/arch/powerpc/include/asm/fsl_liodn.h
+++ b/arch/powerpc/include/asm/fsl_liodn.h
@@ -70,8 +70,8 @@ extern void fdt_fixup_liodn(void *blob);
SET_GUTS_LIODN(fsl,pq-sata-v2, liodn, sata##sataNum##liodnr,\
CONFIG_SYS_MPC85xx_SATA##sataNum##_OFFSET)
 
-#define SET_PCI_LIODN(pciNum, liodn) \
-   SET_GUTS_LIODN(fsl,p4080-pcie, liodn, pex##pciNum##liodnr,\
+#define SET_PCI_LIODN(compat, pciNum, liodn) \
+   SET_GUTS_LIODN(compat, liodn, pex##pciNum##liodnr,\
CONFIG_SYS_MPC85xx_PCIE##pciNum##_OFFSET)
 
 /* reg nodes for DMA start @ 0x300 */
-- 
1.7.2.3

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


Re: [U-Boot] [PATCH] [v2] powerpc: 'monitor' environment variable contains full video configuration

2011-03-15 Thread Wolfgang Denk
Dear Timur Tabi,

In message 4d7f8b3c.4080...@freescale.com you wrote:

  Don't try to be more clever than the user.  Instead of helping, you
  restrict him. That's bad.
 
 I'm not being more clever.  The code is setting a variable (diubootargs) that 
 is
 guaranteed to be the same video mode that U-Boot is running.  If you want to
 ensure that Linux set to the same video mode, then use the variable.  
 Otherwise,
 don't use the variable and set the command line manually.

You don't need another variable for setting the video mode, because we
(will) have video-mode for that very purpose, that can and shall be
used both in U-Boot and Linux.

  NAK, NAK, NAK.  All such automatic and unconditional editing is bad
  and should strictly be avoided.
 
 You didn't understand my post.  I was saying that I tried to implement it, but
 gave up because it got too complicated.

I did understand your posting. I wanted to tell you that you should
not even try doing such things.

  Leave the decision which device to use as console to the user.
 
 That's what the 'monitor' environment variable is for.

monitor has nothing to do with the console, right?

typically we (here at DENX) use helper macros like

setenv addcons 'setenv bootargs ${bootargs} 
console=${consdev},${baudrate}'
setenv consdev ttyS0

Then you can have the addcons in some command sequence that builds
up the bootargs.

monitor? No, this has _nothing_ to do with any console settings.

   2) The video display needs to be enabled and the U-Boot console needs to 
   be
   routed to it
  NAK.
  
  Wether the U-Boot console is attached to the serial port or the video
  console or netconsole or anything else should be left to the user.
 
 Again, that's what the variable is for.  What's the point of configuring the
 video display if you're not going to enable it?

You misinterpret what I wrote.  Of course we're going to enable the
video display then.

But there is no reason to always and unconditionally put the console
on that device - that is a completely separate and independent
decision.

  A default setting is OK, but the user must be able to set anything he
  likes.
 
 Are we speaking the same language?  It doesn't appear that you're 
 understanding
 anything I'm saying.

And vice versa.  Probably you don't read what I'm writing either.

 I still don't understand what you actually want.

I want that you keep the console settings out of this topic. It has
nothing to do with it.

And I want to make sure that we don't have several environment
variables doing more or less the same thing.

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
A Chairman was as necessary to a Board planet  as  the  zero  was  in
mathematics, but being a zero had big disadvantages...
 - Terry Pratchett, _The Dark Side of the Sun_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

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

In message LI3YLF$9f2aac61c7a1bf5365f194ad91372...@aruba.it you wrote:
 
 I ported U-boot to a custom BeagleBoard-derivative board, which is running
 fine so far.
 
 Now I'm trying to upgrade from the current codebase (v2010.06) to a more
 recent one. My custom U-boot stopped booting after merging the
 ARM relocation code implemented in september 2010 by Heiko Schocher,
 even though I think I've changed my code where needed.

That is one of the problems you will be facing again and again with
out-of-tree ports.  As we don't even know your code, we could not even
help you if we wanted to.

 --- a/board/mycompany/myboard/config.mk
 +++ b/board/mycompany/myboard/config.mk
 @@ -30,4 +30,4 @@
  # (mem base + reserved)
  
  # For use with external or internal boots.
 -TEXT_BASE = 0x80e8
 +TEXT_BASE = 0x80008000

If you still have such definitions in your code you are still so far
away from current top of tree that any comments are in vain as more
changes are still to be applied.


Maintaining out-of-tree ports _is_ a continuing pain.  Don't do that.
Push your changes upstream in time, i. e. when they are current.

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
Just think of a computer as hardware you can program.
- Nigel de la Tierre
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] [v2] powerpc: 'monitor' environment variable contains full video configuration

2011-03-15 Thread Timur Tabi
Wolfgang Denk wrote:

 You misinterpret what I wrote.  Of course we're going to enable the
 video display then.
 
 But there is no reason to always and unconditionally put the console
 on that device - that is a completely separate and independent
 decision.

I still don't understand the point of enabling the video display in U-Boot if
we're not going to put the U-Boot console on it.  The monitor will just have a
blank screen.

We don't need to enable it for Linux' sake, because Linux can enable the monitor
itself if it wants to.  It just needs to be told what resolution to use.

-- 
Timur Tabi
Linux kernel developer at Freescale

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


Re: [U-Boot] [PATCH v6 3/4] mpc85xx: Add a board-specific restart hook

2011-03-15 Thread Wolfgang Denk
Dear Kyle Moffett,

In message 1300208664-18339-4-git-send-email-kyle.d.moff...@boeing.com you 
wrote:
 The HWW-1U-1A board needs to be able to override the reset command due
 to hardware design limitations.
 
 Signed-off-by: Kyle Moffett kyle.d.moff...@boeing.com
 Cc: Andy Fleming aflem...@gmail.com
 Cc: Kumar Gala kumar.g...@freescale.com

Please run checkpatch on your submissions!

  #if defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || \
  defined(CONFIG_MPC8555) || defined(CONFIG_MPC8560)
 +int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 +{
   unsigned long val, msr;

WARNING: space prohibited between function name and open parenthesis '('
#114: FILE: arch/powerpc/cpu/mpc85xx/cpu.c:215:
+int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])

 - volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
 +int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 +{

WARNING: space prohibited between function name and open parenthesis '('
#126: FILE: arch/powerpc/cpu/mpc85xx/cpu.c:232:
+int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])

 +#endif
 +
 +

Please don't add trailing empty lines.

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
Humanity has the  stars  in  its  future,  and  that  future  is  too
important  to be lost under the burden of juvenile folly and ignorant
superstition.  - Isaac Asimov
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2011-03-15 Thread Albert ARIBAUD
Le 15/03/2011 17:46, Luca Ceresoli a écrit :
 Hi,

 I ported U-boot to a custom BeagleBoard-derivative board, which is running
 fine so far.

 Now I'm trying to upgrade from the current codebase (v2010.06) to a more
 recent one. My custom U-boot stopped booting after merging the
 ARM relocation code implemented in september 2010 by Heiko Schocher,
 even though I think I've changed my code where needed.

 More in detail, my code base works perfectly if merged with the upstream
 code (from git://git.denx.de/u-boot.git) until the commit before the ARM
 relocation series:
   4fff329 nand_boot_fsl_nfc.c: make nfc a static const pointer

 It stops working when I merge these 3 commits (plus an arbitrarily large
 amount of the following ones):
   f1d2b31 ARM: add relocation support
   e48b7c0 ARM: implement relocation for ARM11
   561142a ARM: implement relocation for ARM V7 (OMAP)
 plus this patch to my code (copied from the Beagle code changes in commit
 561142a above):

 diff --git a/board/mycompany/myboard/config.mk 
 b/board/mycompany/myboard/config.mk
 index 150b30c..a9c88d2 100644
 --- a/board/mycompany/myboard/config.mk
 +++ b/board/mycompany/myboard/config.mk
 @@ -30,4 +30,4 @@
   # (mem base + reserved)

   # For use with external or internal boots.
 -TEXT_BASE = 0x80e8
 +TEXT_BASE = 0x80008000
 diff --git a/include/configs/omap3_myboard.h b/include/configs/omap3_myboard.h
 index c62febd..be0d9a9 100644
 --- a/include/configs/omap3_myboard.h
 +++ b/include/configs/omap3_myboard.h
 @@ -333,4 +333,9 @@ extern unsigned int boot_flash_sec;
   extern unsigned int boot_flash_type;
   #endif

 +/* additions for new relocation code, must added to all boards */
 +#undef CONFIG_SYS_ARM_WITHOUT_RELOC /* This board is tested with relocation 
 support */
 +#define CONFIG_SYS_SDRAM_BASEPHYS_SDRAM_1
 +#define CONFIG_SYS_INIT_SP_ADDR  (LOW_LEVEL_SRAM_STACK - 
 CONFIG_SYS_GBL_DATA_SIZE)
 +
   #endif /* __CONFIG_H */


 The result is that U-boot does not print any single character on the serial
 console, and I'm lost since I can't use a JTAG emulator.

 As I am not expert in the low-level U-boot code, I don't know where to look
 at. Any suggestion would be appreciated.


 Here are a few more details that might be relevant.

 The board is a BeagleBoard derivative, with the same CPU (OMAP3530,
 Cortex-A8) and NAND flash chip.
 The RAM chip is the same model, but we have only one 128 MB chip instead of
 two.
 There's also a LAN chip (SMC911x family).

 I started my porting from the upstream repository at
 git://git.denx.de/u-boot.git and created a branch.

 Here I added a new board, initially equal to Beagle, then I removed some
 unwanted features (JFFS2, board detection), added some wanted ones
 (UBI/UBIFS, LAN driver, CONFIG_CMD_NET) and adapdet the default environment.

 I also changed CONFIG_SYS_MALLOC_LEN from 128kB to 1MB, as it was not enough
 for UBI to work.

 Thanks in advance,
 Luca

Hi Luca,

As several fixes were introduced after the ARM relocation commits you 
are talking about, I would suggest not to try and progressively merge 
U-boot into your changes, but rather to rebase your branch  directly on 
top of the current master of u-boot or u-boot-arm, so that you have all 
fixes which followed ARM relocation work.

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


Re: [U-Boot] p4080ds starts OS with MSR[EE]=1 and DEC armed?

2011-03-15 Thread Timur Tabi
On Sun, Mar 13, 2011 at 10:46 AM, Jimi Xenidis ji...@watson.ibm.com wrote:

 Turns out that TSR[DIS] was on when my program took over, and this is ePAPR 
 legal.
 I need to reset the DEC in my code.

I wonder if it should be legal.  What value does it have to leave a
pending decrementer interrupt when booting the OS?  That just forces
every OS to program the decrementer and clear DIS before enabling
interrupts.

-- 
Timur Tabi
Linux kernel developer at Freescale
___
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-15 Thread Wolfgang Denk
Dear Kyle Moffett,

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!

...
 + /* 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,

 + /*
 +  * 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.

 +/*
 + * 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[])

 +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,
 + /*  */  command-if-true\n
 + hww1u1a_test_cpu_a || command-if-false\n

What is this empty comment needed for?

 + /* 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.

...
 + /* 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?

...
 +/* 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?


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
News is what a chap who doesn't care much  about  anything  wants  to
read. And it's only news until he's read it. After that it's dead.
   - Evelyn Waugh _Scoop_ (1938) bk. 1, ch. 5
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] [v2] powerpc: 'monitor' environment variable contains full video configuration

2011-03-15 Thread Wolfgang Denk
Dear Timur Tabi,

In message 4d7fb987.20...@freescale.com you wrote:
 
  But there is no reason to always and unconditionally put the console
  on that device - that is a completely separate and independent
  decision.
 
 I still don't understand the point of enabling the video display in U-Boot if
 we're not going to put the U-Boot console on it.  The monitor will just have a
 blank screen.

It may be a blank screen, or a (previously loaded) splash screen, or
(a bit later) some graphics application outputting data.

It's up to the user to decide 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
I've finally learned what `upward compatible' means. It means we get
to keep all our old mistakes. - Dennie van Tassel
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] [v2] powerpc: 'monitor' environment variable contains full video configuration

2011-03-15 Thread Timur Tabi
Wolfgang Denk wrote:
 It may be a blank screen, or a (previously loaded) splash screen, or
 (a bit later) some graphics application outputting data.
 
 It's up to the user to decide that.

Ok, I think I get it.  But I'm going to miss this merge window, because now I
have to rewrite half of my patch.

What is the standard mechanism for enabling the console on the video display?
From what I can tell, if video_hw_init() returns non-NULL, then the console is
set to the video display, regardless as to what the stdout environment
variable says.

-- 
Timur Tabi
Linux kernel developer at Freescale

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


Re: [U-Boot] p4080ds starts OS with MSR[EE]=1 and DEC armed?

2011-03-15 Thread Scott Wood
On Tue, 15 Mar 2011 14:21:03 -0500
Timur Tabi ti...@freescale.com wrote:

 On Sun, Mar 13, 2011 at 10:46 AM, Jimi Xenidis ji...@watson.ibm.com wrote:
 
  Turns out that TSR[DIS] was on when my program took over, and this is ePAPR 
  legal.
  I need to reset the DEC in my code.
 
 I wonder if it should be legal.  What value does it have to leave a
 pending decrementer interrupt when booting the OS?  That just forces
 every OS to program the decrementer and clear DIS before enabling
 interrupts.

The OS should ensure that timer interrupts are functioning the way it wants
before it enables interrupts -- but in any case, once it enables interrupts
it should be able to handle any interrupt that is enabled.  There's no
general need to clear DIS.

There's actually no good way for boot software to ensure that TSR[DIS] is
clear, other than stopping the timebase (not allowed, or at least shouldn't
be), or assuming that the OS will take control of the decrementer within a
reasonable amount of time.  We could require that TCR[DIE] be clear, but
that just imposes an extra requirement on boot software for no good reason
-- and in general, we want to minimize the extent to which we trust boot
software to do something specific.  Especially if it's something that won't
show up as a problem with most client software, until someone decides to
rely on it.

-Scot

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


Re: [U-Boot] [PATCH] [v2] powerpc: 'monitor' environment variable contains full video configuration

2011-03-15 Thread Wolfgang Denk
Dear Timur Tabi,

In message 4d7fc2c5.2020...@freescale.com you wrote:

 Ok, I think I get it.  But I'm going to miss this merge window, because now I
 have to rewrite half of my patch.

You won't. We have a delay of at least 2 weeks.

 What is the standard mechanism for enabling the console on the video display?
 From what I can tell, if video_hw_init() returns non-NULL, then the console is
 set to the video display, regardless as to what the stdout environment
 variable says.

That's the default. Users can overwrite it, for example in preboot.
See also CONFIG_ENV_OVERWRITE

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
People are very flexible and learn to adjust to strange  surroundings
--  they can become accustomed to read Lisp and Fortran programs, for
example.   - Leon Sterling and Ehud Shapiro, Art of Prolog, MIT Press
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [STATUS] Delay of release

2011-03-15 Thread Wolfgang Denk
Hi,

as you all probably are alreasy aware of we are late with our release
once again.  I still have a huge backlog, and we haven't even reached
-rc2 yet.

Next target date for this release is March 29, 2011, i. e. two weeks
from now.

Sorry for the delay.

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
Mistakes are often the stepping stones to utter failure.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] [v2] powerpc: 'monitor' environment variable contains full video configuration

2011-03-15 Thread Timur Tabi
Wolfgang Denk wrote:
  What is the standard mechanism for enabling the console on the video 
  display?
  From what I can tell, if video_hw_init() returns non-NULL, then the 
  console is
  set to the video display, regardless as to what the stdout environment
  variable says.

 That's the default. Users can overwrite it, for example in preboot.
 See also CONFIG_ENV_OVERWRITE

Then I'm confused, because video_hw_init() is what configures and enables the
video display.  So if that function succeeds (i.e. returns non-NULL), then
U-Boot will put the console onto the video display.  You said you wanted me to
implement some mechanism where I enable the display, based on the value of the
video-mode variable, without putting console on the display.  However, from you
just said, it appears that this mechanism already exists.

-- 
Timur Tabi
Linux kernel developer at Freescale

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


Re: [U-Boot] [STATUS] Delay of release

2011-03-15 Thread Mike Frysinger
On Tuesday, March 15, 2011 16:44:58 Wolfgang Denk wrote:
 as you all probably are alreasy aware of we are late with our release
 once again.  I still have a huge backlog, and we haven't even reached
 -rc2 yet.
 
 Next target date for this release is March 29, 2011, i. e. two weeks
 from now.

this is good anyways considering linux-2.6.38 just came out.  i need to focus 
on that too.
-mike


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


Re: [U-Boot] p4080ds starts OS with MSR[EE]=1 and DEC armed?

2011-03-15 Thread Jimi Xenidis
On Mar 15, 2011, at 3:24 PM, Scott Wood wrote:
 
 On Tue, 15 Mar 2011 14:21:03 -0500
 Timur Tabi ti...@freescale.com wrote:
 
 On Sun, Mar 13, 2011 at 10:46 AM, Jimi Xenidis ji...@watson.ibm.com wrote:
 
 Turns out that TSR[DIS] was on when my program took over, and this is ePAPR 
 legal.
 I need to reset the DEC in my code.
 
 I wonder if it should be legal.  What value does it have to leave a
 pending decrementer interrupt when booting the OS?  That just forces
 every OS to program the decrementer and clear DIS before enabling
 interrupts.
 
 The OS should ensure that timer interrupts are functioning the way it wants
 before it enables interrupts -- but in any case, once it enables interrupts
 it should be able to handle any interrupt that is enabled.  There's no
 general need to clear DIS.

I guess I could go either way on this.

 
 There's actually no good way for boot software to ensure that TSR[DIS] is
 clear, other than stopping the timebase (not allowed, or at least shouldn't
 be), or assuming that the OS will take control of the decrementer within a
 reasonable amount of time.  We could require that TCR[DIE] be clear, but
 that just imposes an extra requirement on boot software for no good reason

That is true for server and classic because they do not necessarily stop at 
0.
for embedded you can just:
/* u-boot leaves decrementer enabled */
mtspr(SPRN_DECAR, 0); /* paranoia */
mtspr(SPRN_DEC, 0);
mtspr(SPRN_TCR, 0);
mtspr(SPRN_TSR, 0);

And there is no way in hell any timer will go off, right?
-JX





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


Re: [U-Boot] p4080ds starts OS with MSR[EE]=1 and DEC armed?

2011-03-15 Thread Timur Tabi
Jimi Xenidis wrote:
 That is true for server and classic because they do not necessarily stop 
 at 0.
 for embedded you can just:
   /* u-boot leaves decrementer enabled */
   mtspr(SPRN_DECAR, 0); /* paranoia */
   mtspr(SPRN_DEC, 0);
   mtspr(SPRN_TCR, 0);
   mtspr(SPRN_TSR, 0);

I think you mean

mtspr(SPRN_TSR, 0x);

since it's write-1-to-clear.  Other than that, this is exactly what I was
talking about.  I just think it makes sense for the boot loader to try to
disable as many interrupt sources as possible, and force the OS to enable the
ones it wants.

On the other hand, Scott's points are completely valid.

-- 
Timur Tabi
Linux kernel developer at Freescale

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


Re: [U-Boot] p4080ds starts OS with MSR[EE]=1 and DEC armed?

2011-03-15 Thread Jimi Xenidis
On Mar 15, 2011, at 4:21 PM, Timur Tabi wrote:
 
 Jimi Xenidis wrote:
 That is true for server and classic because they do not necessarily stop 
 at 0.
 for embedded you can just:
  /* u-boot leaves decrementer enabled */
  mtspr(SPRN_DECAR, 0); /* paranoia */
  mtspr(SPRN_DEC, 0);
  mtspr(SPRN_TCR, 0);
  mtspr(SPRN_TSR, 0);
 
 I think you mean
 
   mtspr(SPRN_TSR, 0x);
 

Ahh yes.. thank you :)
-JX

 since it's write-1-to-clear.  Other than that, this is exactly what I was
 talking about.  I just think it makes sense for the boot loader to try to
 disable as many interrupt sources as possible, and force the OS to enable the
 ones it wants.
 
 On the other hand, Scott's points are completely valid.



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


Re: [U-Boot] p4080ds starts OS with MSR[EE]=1 and DEC armed?

2011-03-15 Thread Scott Wood
On Tue, 15 Mar 2011 16:16:39 -0500
Jimi Xenidis ji...@pobox.com wrote:

 That is true for server and classic because they do not necessarily stop 
 at 0.
 for embedded you can just:
   /* u-boot leaves decrementer enabled */
   mtspr(SPRN_DECAR, 0); /* paranoia */
   mtspr(SPRN_DEC, 0);
   mtspr(SPRN_TCR, 0);
   mtspr(SPRN_TSR, 0);
 
 And there is no way in hell any timer will go off, right?

Ah, right.  Forgot it stopped at zero.

-Scott

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


Re: [U-Boot] p4080ds starts OS with MSR[EE]=1 and DEC armed?

2011-03-15 Thread Scott Wood
On Tue, 15 Mar 2011 16:22:50 -0500
Scott Wood scottw...@freescale.com wrote:

 On Tue, 15 Mar 2011 16:16:39 -0500
 Jimi Xenidis ji...@pobox.com wrote:
 
  That is true for server and classic because they do not necessarily 
  stop at 0.
  for embedded you can just:
  /* u-boot leaves decrementer enabled */
  mtspr(SPRN_DECAR, 0); /* paranoia */
  mtspr(SPRN_DEC, 0);
  mtspr(SPRN_TCR, 0);
  mtspr(SPRN_TSR, 0);
  
  And there is no way in hell any timer will go off, right?
 
 Ah, right.  Forgot it stopped at zero.

Though that last line should be something like mtspr(SPRN_TSR, 0x);

-Scott

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


Re: [U-Boot] [PATCH] [v2] powerpc: 'monitor' environment variable contains full video configuration

2011-03-15 Thread Wolfgang Denk
Dear Timur Tabi,

In message 4d7fd08c.2020...@freescale.com you wrote:

 Then I'm confused, because video_hw_init() is what configures and enables the
 video display.  So if that function succeeds (i.e. returns non-NULL), then
 U-Boot will put the console onto the video display.  You said you wanted me to
 implement some mechanism where I enable the display, based on the value of the
 video-mode variable, without putting console on the display.  However, from 
 you
 just said, it appears that this mechanism already exists.

Please re-read the conversation then. Mind the context (U-Boot versus
Linux). Mind what I wrote about defaults and users being able to
chose the behaviour they want. And keep in mind what I wrote about
enforcing desicions in the best interest of your users (who may
happen to disagree).

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
News is what a chap who doesn't care much  about  anything  wants  to
read. And it's only news until he's read it. After that it's dead.
   - Evelyn Waugh _Scoop_ (1938) bk. 1, ch. 5
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

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

In message 4d7fdd06.5080...@lucaceresoli.net you wrote:
 
 Nevertheless, the board will never be publicly available unless one buys 
 a quite expensive product, and I don't think detailed hardware 
 specifications will ever be available (this definitely does not depend 
 on me...). It's a product, not a development board or similar.

This really doesn't matter at all in regards of wether you can push
your code upstream to have it maintained with the rest of the mainline
code.

 Do you think it would be feasible to give support even with such 
 restrictions, if the software were publicly available?

I'm not talking about publicly available.  I'm talking about coe
that has been merged into the mainline U-Boot distribution. That's the
only code that gets free community support.

 Pardon the question, I'm just trying to understand how the U-boot 
 community does things as I'm pretty new here.

It works like other, similar communites, too.  Take Linux for example.


 Merging little pieces at a time was my divide et impera approach to 
 merge ~1 year of upstream history without facing a huge mountain of 
 merge conflicts, compilation issues and runtime failures all at a time 
 on a codebase that I'm not familiar with. On one hand, it allowed me to 
 learn a bit about U-boot, but I understand it makes it difficult to 
 obtain support.

Such an approach is painful.  Learn a lesson from it.  Sync against
mainline frequently, eventually even on a daily base, or at least
every few days.  Use tools (git - like pulling mainline into your
repository, or maintaining your code in a brnch that you rebase
against mainline).

 I'll try the other way around with a big merge-all.

No.  Create a branch, and try to rebase your branch.


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
Good manners are the settled  medium  of  social,  as  specie  is  of
commercial, life; returns are equally expected for both.
   - Lord Chesterfield _Letters to his Son_, 25 December 1753
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] [v2] powerpc: 'monitor' environment variable contains full video configuration

2011-03-15 Thread Timur Tabi
Wolfgang Denk wrote:
 Please re-read the conversation then. Mind the context (U-Boot versus
 Linux). Mind what I wrote about defaults and users being able to
 chose the behaviour they want. And keep in mind what I wrote about
 enforcing desicions in the best interest of your users (who may
 happen to disagree).

After re-reading it, I've come to the conclusion is that as far as my patch is
concerned, I just need to make the following changes:

1) Modify video_get_params() (in videomodes.c) to parse the video-mode
environment variable, using the same format that Linux uses.  Right now, it
parses the variable video, so that variable is now deprecated.

2) Update the DIU driver to use this feature of videomodes.c.  This means taking
the functionality of my function diu_get_video_params() and putting it into
video_get_params().

3) Remove the code that sets diubootargs.  If the user wants to pass parameters
to Linux, he has to add video=$video-mode console=tty0 to his command-line.
If video-mode is not set, then he must *not* add video=$video-mode
console=tty0 to his command-line, otherwise the kernel will get confused.
There is no way to automate this for the user.

And that's it.  If this is wrong, please be detailed in what I have wrong,
because I can't guess any more what you want.

So I have one concern:

My patch has a function called diu_get_video_params() which is like
video_get_params(), but it returns a lot more information.  video_get_params()
is currently used by several other drivers, none of which I can test.  I'm very
hesitant to rewrite video_get_params() so that it returns the same data that
diu_get_video_params() returns, because I can't test these other boards.

-- 
Timur Tabi
Linux kernel developer at Freescale

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


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

2011-03-15 Thread Nobuhiro Iwamatsu
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 -0500)

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


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


[U-Boot] [PATCH 1/2] P4080/PBL: add support for boot from SPI flash.

2011-03-15 Thread Shaohui Xie
PBL(pre-boot loader): SPI flash used as RCW(Reset Configuration Word) and
PBI(pre-boot initialization) source, CPC(CoreNet Platform Cache) used as 1M SRAM
where PBL will copy whole U-BOOT image to, U-boot can boot from CPC after PBL
completes RCW and PBI phases.

Signed-off-by: Chunhe Lan b25...@freescale.com
Signed-off-by: Mingkai Hu mingkai...@freescale.com
Signed-off-by: Shaohui Xie b21...@freescale.com
Signed-off-by: Roy Zang tie-fei.z...@freescale.com
---
 arch/powerpc/cpu/mpc85xx/cpu_init.c |   19 +++
 board/freescale/corenet_ds/tlb.c|   12 +++-
 boards.cfg  |1 +
 include/configs/corenet_ds.h|   27 ++-
 4 files changed, 57 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c 
b/arch/powerpc/cpu/mpc85xx/cpu_init.c
index 8ece970..a977000 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c
@@ -141,6 +141,22 @@ static void enable_cpc(void)
for (i = 0; i  CONFIG_SYS_NUM_CPC; i++, cpc++) {
u32 cpccfg0 = in_be32(cpc-cpccfg0);
size += CPC_CFG0_SZ_K(cpccfg0);
+#ifdef CONFIG_RAMBOOT_PBL
+   if (in_be32(cpc-cpcsrcr0)  CPC_SRCR0_SRAMEN) {
+   /* find and disable LAW of SRAM */
+   struct law_entry law = 
find_law(CONFIG_SYS_INIT_L3_ADDR);
+
+   if (law.index == -1) {
+   printf(\nFatal error happened\n);
+   return;
+   }
+   disable_law(law.index);
+
+   clrbits_be32(cpc-cpchdbcr0, CPC_HDBCR0_CDQ_SPEC_DIS);
+   out_be32(cpc-cpccsr0, 0);
+   out_be32(cpc-cpcsrcr0, 0);
+   }
+#endif
 
 #ifdef CONFIG_SYS_FSL_ERRATUM_CPC_A002
setbits_be32(cpc-cpchdbcr0, CPC_HDBCR0_TAG_ECC_SCRUB_DIS);
@@ -164,6 +180,9 @@ void invalidate_cpc(void)
cpc_corenet_t *cpc = (cpc_corenet_t *)CONFIG_SYS_FSL_CPC_ADDR;
 
for (i = 0; i  CONFIG_SYS_NUM_CPC; i++, cpc++) {
+   /* skip CPC when it used as all SRAM */
+   if (in_be32(cpc-cpcsrcr0)  CPC_SRCR0_SRAMEN)
+   continue;
/* Flash invalidate the CPC and clear all the locks */
out_be32(cpc-cpccsr0, CPC_CSR0_FI | CPC_CSR0_LFC);
while (in_be32(cpc-cpccsr0)  (CPC_CSR0_FI | CPC_CSR0_LFC))
diff --git a/board/freescale/corenet_ds/tlb.c b/board/freescale/corenet_ds/tlb.c
index 1ae0416..fe77e79 100644
--- a/board/freescale/corenet_ds/tlb.c
+++ b/board/freescale/corenet_ds/tlb.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2010 Freescale Semiconductor, Inc.
+ * Copyright 2008-2011 Freescale Semiconductor, Inc.
  *
  * (C) Copyright 2000
  * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
@@ -51,9 +51,19 @@ struct fsl_e_tlb_entry tlb_table[] = {
 
/* TLB 1 */
/* *I*** - Covers boot page */
+#if defined(CONFIG_SYS_RAMBOOT)  defined(CONFIG_SYS_INIT_L3_ADDR)
+   /*
+* *I*G - L3SRAM. When L3 is used as 1M SRAM, the address of the
+* SRAM is at 0xfff0, it covered the 0xf000.
+*/
+   SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L3_ADDR, CONFIG_SYS_INIT_L3_ADDR,
+   MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+   0, 0, BOOKE_PAGESZ_1M, 1),
+#else
SET_TLB_ENTRY(1, 0xf000, 0xf000,
  MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  0, 0, BOOKE_PAGESZ_4K, 1),
+#endif
 
/* *I*G* - CCSRBAR */
SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
diff --git a/boards.cfg b/boards.cfg
index 45c3102..f19cc34 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -529,6 +529,7 @@ P2020RDB_NANDpowerpc mpc85xx 
p1_p2_rdb   freesca
 P2020RDB_SDCARD  powerpc mpc85xx p1_p2_rdb   
freescale  -   P1_P2_RDB:P2020RDB,SDCARD
 P2020RDB_SPIFLASHpowerpc mpc85xx p1_p2_rdb   
freescale  -   P1_P2_RDB:P2020RDB,SPIFLASH
 P4080DS  powerpc mpc85xx corenet_ds  
freescale
+P4080DS_RAMBOOT_PBL  powerpc mpc85xx corenet_ds  
freescale  -   P4080DS:RAMBOOT_PBL,SYS_TEXT_BASE=0xFFF8
 mpq101   powerpc mpc85xx mpq101  
mercury-   mpq101
 stxgp3   powerpc mpc85xx stxgp3  stx
 stxssa   powerpc mpc85xx stxssa  stx   
 -   stxssa
diff --git a/include/configs/corenet_ds.h b/include/configs/corenet_ds.h
index bff212e..8d10862 100644
--- a/include/configs/corenet_ds.h
+++ b/include/configs/corenet_ds.h
@@ -28,6 +28,11 @@
 
 #include ../board/freescale/common/ics307_clk.h
 
+#ifdef CONFIG_RAMBOOT_PBL
+#define CONFIG_RAMBOOT_TEXT_BASE 

[U-Boot] [PATCH 2/2] P4080/PBL: add tool to support pbl image build.

2011-03-15 Thread Shaohui Xie
The tool can build u-boot image which can be used by PBL,
run make P4080DS_RAMBOOT_PBL can make all works done,
the default output image is u-boot.pbl, for more details
please refer to doc/README.pblimage.

Signed-off-by: Shaohui Xie b21...@freescale.com
---
 Makefile|5 +
 board/freescale/corenet_ds/config.mk|   26 +++
 board/freescale/corenet_ds/pblimage.cfg |   59 ++
 common/image.c  |1 +
 doc/README.pblimage |   83 
 include/image.h |1 +
 tools/Makefile  |2 +
 tools/mkimage.c |5 +
 tools/mkimage.h |2 +
 tools/pblimage.c|  329 +++
 tools/pblimage.h|   36 
 11 files changed, 549 insertions(+), 0 deletions(-)
 create mode 100644 board/freescale/corenet_ds/config.mk
 create mode 100644 board/freescale/corenet_ds/pblimage.cfg
 create mode 100644 doc/README.pblimage
 create mode 100644 tools/pblimage.c
 create mode 100644 tools/pblimage.h

diff --git a/Makefile b/Makefile
index dc2e3d8..ca6078e 100644
--- a/Makefile
+++ b/Makefile
@@ -361,6 +361,10 @@ $(obj)u-boot.kwb:   $(obj)u-boot.bin
$(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
-a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $ $@
 
+$(obj)u-boot.pbl:   $(obj)u-boot.bin
+   $(obj)tools/mkimage -n $(PBL_CONFIG) -T pblimage \
+   -d $ $@
+
 $(obj)u-boot.sha1: $(obj)u-boot.bin
$(obj)tools/ubsha1 $(obj)u-boot.bin
 
@@ -1156,6 +1160,7 @@ clobber:  clean
$(obj)cscope.* $(obj)*.*~
@rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL)
@rm -f $(obj)u-boot.kwb
+   @rm -f $(obj)u-boot.pbl
@rm -f $(obj)u-boot.imx
@rm -f $(obj)tools/{env/crc32.c,inca-swap-bytes}
@rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c
diff --git a/board/freescale/corenet_ds/config.mk 
b/board/freescale/corenet_ds/config.mk
new file mode 100644
index 000..c94938f
--- /dev/null
+++ b/board/freescale/corenet_ds/config.mk
@@ -0,0 +1,26 @@
+#
+# Copyright 2011 Freescale Semiconductor, Inc.
+#
+# 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
+#
+
+ifeq ($(CONFIG_RAMBOOT_PBL), y)
+PBL_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/pblimage.cfg
+ALL += $(obj)u-boot.pbl
+endif
diff --git a/board/freescale/corenet_ds/pblimage.cfg 
b/board/freescale/corenet_ds/pblimage.cfg
new file mode 100644
index 000..96c55ee
--- /dev/null
+++ b/board/freescale/corenet_ds/pblimage.cfg
@@ -0,0 +1,59 @@
+#
+# Copyright 2011 Freescale Semiconductor, Inc.
+# Written-by: Shaohui Xieb21...@freescale.com
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+# Refer docs/README.pblimage for more details about how-to configure
+# and create PBL boot image
+#
+
+#PBL preamble and RCW header
+aa55aa55 010e0100
+#64 bytes RCW data
+4c58  18185218 
+40464000 3c3c2000 5800 6100
+   008b6000
+   
+
+#PBI commands
+#Initialize CPC1
+0901 00200400
+09138000 
+091380c0 0100
+09010100 
+09010104 fffb
+09010f00 0800
+0901 8000
+#Configure LAW for CPC1
+09000d00 
+09000d04 fff0
+09000d08 8113
+0910 
+0914 ff00
+0918 8100
+#Initialize eSPI 

[U-Boot] [PATCH 1/2] powerpc: eSPI and eSPI controller support

2011-03-15 Thread Shaohui Xie
From: Mingkai Hu mingkai...@freescale.com

This patch add espi support which is from MPC8536, and fixed some hunk
failed error, and rebased on Mike's sf unify patches.

Signed-off-by: Mingkai Hu mingkai...@freescale.com
Singed-off-by: Jerry Huang chang-ming.hu...@freescale.com
Signed-off-by: Shaohui Xie b21...@freescale.com
Cc: Mike Frysinger vap...@gentoo.org
---
this patch is rebased on Mike's sf unify patches.

 drivers/mtd/spi/spi_flash.c |   45 
 drivers/spi/Makefile|1 +
 drivers/spi/fsl_espi.c  |  237 +++
 include/spi.h   |   26 +-
 4 files changed, 308 insertions(+), 1 deletions(-)
 create mode 100644 drivers/spi/fsl_espi.c

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 5c261f1..f745def 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -1,6 +1,8 @@
 /*
  * SPI flash interface
+ * Add support for Freescale eSPI controller
  *
+ * Copyright 2009-2011 Freescale Semiconductor, Inc.
  * Copyright (C) 2008 Atmel Corporation
  * Copyright (C) 2010 Reinhard Meyer, EMK Elektronik
  *
@@ -30,6 +32,7 @@ static int spi_flash_read_write(struct spi_slave *spi,
unsigned long flags = SPI_XFER_BEGIN;
int ret;
 
+#ifndef CONFIG_FSL_ESPI
if (data_len == 0)
flags |= SPI_XFER_END;
 
@@ -43,6 +46,48 @@ static int spi_flash_read_write(struct spi_slave *spi,
debug(SF: Failed to transfer %zu bytes of data: %d\n,
data_len, ret);
}
+#else
+   struct espi_transfer transfer[1];
+   unsigned char *buffer;
+   size_t buf_len;
+
+   if (data_in == NULL)
+   buf_len = cmd_len;
+   else
+   buf_len = 2 * cmd_len;
+
+   buffer = (unsigned char *)malloc(data_len + buf_len);
+   if (!buffer) {
+   debug(SF: Failed to malloc memory.\n);
+   return 1;
+   }
+
+   memcpy(buffer, cmd, cmd_len);
+   if (data_in == NULL)
+   memcpy(buffer + cmd_len, data_out, data_len);
+
+   transfer[0].cmd_len = cmd_len;
+   transfer[0].data_len = data_len;
+   transfer[0].tx_buf = buffer;
+   if (data_in == NULL)
+   transfer[0].rx_buf = NULL;
+   else
+   transfer[0].rx_buf = buffer + cmd_len;
+
+   transfer[0].flags = flags | SPI_XFER_END;
+
+   spi-transfer = transfer[0];
+   ret = spi_xfer(spi, 0, NULL, NULL, 0);
+   if (ret) {
+   debug(SF: Failed to send command %02x: %d\n, cmd, ret);
+   return ret;
+   }
+
+   if (data_in)
+   memcpy(data_in, transfer[0].rx_buf + cmd_len, data_len);
+
+   free(buffer);
+#endif
 
return ret;
 }
diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index d582fbb..74f1293 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -38,6 +38,7 @@ COBJS-$(CONFIG_MXC_SPI) += mxc_spi.o
 COBJS-$(CONFIG_OMAP3_SPI) += omap3_spi.o
 COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
 COBJS-$(CONFIG_SH_SPI) += sh_spi.o
+COBJS-$(CONFIG_FSL_ESPI) += fsl_espi.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/spi/fsl_espi.c b/drivers/spi/fsl_espi.c
new file mode 100644
index 000..f4ff884
--- /dev/null
+++ b/drivers/spi/fsl_espi.c
@@ -0,0 +1,237 @@
+/*
+ * eSPI controller driver.
+ *
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ * Author: Mingkai Hu (mingkai...@freescale.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include common.h
+
+#include malloc.h
+#include spi.h
+#include asm/immap_85xx.h
+
+#define ESPI_MAX_CS_NUM4
+
+#define ESPI_EV_RNE(1  9)
+#define ESPI_EV_TNF(1  8)
+
+#define ESPI_MODE_EN   (1  31)   /* Enable interface */
+#define ESPI_MODE_TXTHR(x) ((x)  8)  /* Tx FIFO threshold */
+#define ESPI_MODE_RXTHR(x) ((x)  0)  /* Rx FIFO threshold */
+
+#define ESPI_COM_CS(x) ((x)  30)
+#define ESPI_COM_TRANLEN(x)((x)  0)
+
+#define ESPI_CSMODE_CI_INACTIVEHIGH(1  31)
+#define ESPI_CSMODE_CP_BEGIN_EDGCLK(1  30)
+#define ESPI_CSMODE_REV_MSB_FIRST  (1  29)
+#define ESPI_CSMODE_DIV16  (1  28)
+#define ESPI_CSMODE_PM(x)  ((x)  24)
+#define 

Re: [U-Boot] [PATCH 1/2] powerpc: eSPI and eSPI controller support

2011-03-15 Thread Mike Frysinger
On Tuesday, March 15, 2011 22:53:20 Shaohui Xie wrote:
 --- a/drivers/mtd/spi/spi_flash.c
 +++ b/drivers/mtd/spi/spi_flash.c
 @@ -1,6 +1,8 @@
  /*
   * SPI flash interface
 + * Add support for Freescale eSPI controller

this is not the place for changelogs

 @@ -30,6 +32,7 @@ static int spi_flash_read_write(struct spi_slave *spi,
   unsigned long flags = SPI_XFER_BEGIN;
   int ret;
 
 +#ifndef CONFIG_FSL_ESPI
   if (data_len == 0)
   flags |= SPI_XFER_END;
 
 @@ -43,6 +46,48 @@ static int spi_flash_read_write(struct spi_slave *spi,
   debug(SF: Failed to transfer %zu bytes of data: %d\n,
   data_len, ret);
   }
 +#else
 + struct espi_transfer transfer[1];
 + unsigned char *buffer;
 + size_t buf_len;
 +
 + if (data_in == NULL)
 + buf_len = cmd_len;
 + else
 + buf_len = 2 * cmd_len;
 +
 + buffer = (unsigned char *)malloc(data_len + buf_len);
 + if (!buffer) {
 + debug(SF: Failed to malloc memory.\n);
 + return 1;
 + }
 +
 + memcpy(buffer, cmd, cmd_len);
 + if (data_in == NULL)
 + memcpy(buffer + cmd_len, data_out, data_len);
 +
 + transfer[0].cmd_len = cmd_len;
 + transfer[0].data_len = data_len;
 + transfer[0].tx_buf = buffer;
 + if (data_in == NULL)
 + transfer[0].rx_buf = NULL;
 + else
 + transfer[0].rx_buf = buffer + cmd_len;
 +
 + transfer[0].flags = flags | SPI_XFER_END;
 +
 + spi-transfer = transfer[0];
 + ret = spi_xfer(spi, 0, NULL, NULL, 0);
 + if (ret) {
 + debug(SF: Failed to send command %02x: %d\n, cmd, ret);
 + return ret;
 + }
 +
 + if (data_in)
 + memcpy(data_in, transfer[0].rx_buf + cmd_len, data_len);
 +
 + free(buffer);
 +#endif
 
   return ret;
  }

yikes, this cant be right
-mike


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