Re: [U-Boot] redundant code in common/cmd_i2c.

2009-11-12 Thread Heiko Schocher
Hello PratapChandu,

PratapChandu wrote:
> The following code fragment in the file common/cmd_i2c.c  seems to be 
> redundant.
> Is not good to delete  ?
> 
> Line 330 - 336 is like below
> 
> #if 0
> for (timeout = 0; timeout < 10; timeout++) {
> udelay(2000);
> if (i2c_probe(chip) == 0)
> break;
> }
> #endif

Yes, this seems to be dead code. Please provide a patch for removing
it.

Thanks.

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


Re: [U-Boot] [PATCH 2/5] smc911x: use dev->name in printfs

2009-11-12 Thread Mike Rapoport
Hi Mike,

On Thu, Nov 12, 2009 at 12:50 AM, Mike Frysinger  wrote:
>
> here's my [compile] tested change as the board i have with this part isnt
> readily accessible atm ...
> -mike

I've tested your changes, MAC register dumps works Ok. I needed to
make some changes to make it work, see the comments below.

> diff --git a/examples/standalone/smc911x_eeprom.c
> b/examples/standalone/smc911x_eeprom.c
> index bf22f0a..f2a6304 100644
> --- a/examples/standalone/smc911x_eeprom.c
> +++ b/examples/standalone/smc911x_eeprom.c
> @@ -17,8 +17,8 @@
>  #include 
>  #include 
>
> -#ifdef CONFIG_DRIVER_SMC911X
> -
> +/* the smc911x.h gets base addr through eth_device' iobase */
> +struct eth_device { const char *name; unsigned long iobase; };

Needed to add 'void *priv' needed for smc911x_detect_chip, otherwise
it does not compile with the latest U-Boot.

>  #include "../drivers/net/smc911x.h"
>
>  /**
> @@ -55,32 +55,32 @@ static void usage(void)
>  * Registers 0x00 - 0x50 are FIFOs.  The 0x50+ are the control registers
>  * and they're all 32bits long.  0xB8+ are reserved, so don't bother.
>  */
> -static void dump_regs(void)
> +static void dump_regs(struct eth_device *dev)
>  {
>        u8 i, j = 0;
>        for (i = 0x50; i < 0xB8; i += sizeof(u32))
>                printf("%02x: 0x%08x %c", i,
> -                       smc911x_reg_read(CONFIG_DRIVER_SMC911X_BASE + i),
> +                       smc911x_reg_read(dev, i),
>                        (j++ % 2 ? '\n' : ' '));
>  }
>
>  /**
>  *     do_eeprom_cmd - handle eeprom communication
>  */
> -static int do_eeprom_cmd(int cmd, u8 reg)
> +static int do_eeprom_cmd(struct eth_device *dev, int cmd, u8 reg)
>  {
> -       if (smc911x_reg_read(E2P_CMD) & E2P_CMD_EPC_BUSY) {
> +       if (smc911x_reg_read(dev, E2P_CMD) & E2P_CMD_EPC_BUSY) {
>                printf("eeprom_cmd: busy at start (E2P_CMD = 0x%08x)\n",
> -                       smc911x_reg_read(E2P_CMD));
> +                       smc911x_reg_read(dev, E2P_CMD));
>                return -1;
>        }
>
> -       smc911x_reg_write(E2P_CMD, E2P_CMD_EPC_BUSY | cmd | reg);
> +       smc911x_reg_write(dev, E2P_CMD, E2P_CMD_EPC_BUSY | cmd | reg);
>
> -       while (smc911x_reg_read(E2P_CMD) & E2P_CMD_EPC_BUSY)
> +       while (smc911x_reg_read(dev, E2P_CMD) & E2P_CMD_EPC_BUSY)
>                if (smsc_ctrlc()) {
>                        printf("eeprom_cmd: timeout (E2P_CMD = 0x%08x)\n",
> -                               smc911x_reg_read(E2P_CMD));
> +                               smc911x_reg_read(dev, E2P_CMD));
>                        return -1;
>                }
>
> @@ -90,37 +90,37 @@ static int do_eeprom_cmd(int cmd, u8 reg)
>  /**
>  *     read_eeprom_reg - read specified register in EEPROM
>  */
> -static u8 read_eeprom_reg(u8 reg)
> +static u8 read_eeprom_reg(struct eth_device *dev, u8 reg)
>  {
> -       int ret = do_eeprom_cmd(E2P_CMD_EPC_CMD_READ, reg);
> -       return (ret ? : smc911x_reg_read(E2P_DATA));
> +       int ret = do_eeprom_cmd(dev, E2P_CMD_EPC_CMD_READ, reg);
> +       return (ret ? : smc911x_reg_read(dev, E2P_DATA));
>  }
>
>  /**
>  *     write_eeprom_reg - write specified value into specified register in 
> EEPROM
>  */
> -static int write_eeprom_reg(u8 value, u8 reg)
> +static int write_eeprom_reg(struct eth_device *dev, u8 value, u8 reg)
>  {
>        int ret;
>
>        /* enable erasing/writing */
> -       ret = do_eeprom_cmd(E2P_CMD_EPC_CMD_EWEN, reg);
> +       ret = do_eeprom_cmd(dev, E2P_CMD_EPC_CMD_EWEN, reg);
>        if (ret)
>                goto done;
>
>        /* erase the eeprom reg */
> -       ret = do_eeprom_cmd(E2P_CMD_EPC_CMD_ERASE, reg);
> +       ret = do_eeprom_cmd(dev, E2P_CMD_EPC_CMD_ERASE, reg);
>        if (ret)
>                goto done;
>
>        /* write the eeprom reg */
> -       smc911x_reg_write(E2P_DATA, value);
> -       ret = do_eeprom_cmd(E2P_CMD_EPC_CMD_WRITE, reg);
> +       smc911x_reg_write(dev, E2P_DATA, value);
> +       ret = do_eeprom_cmd(dev, E2P_CMD_EPC_CMD_WRITE, reg);
>        if (ret)
>                goto done;
>
>        /* disable erasing/writing */
> -       ret = do_eeprom_cmd(E2P_CMD_EPC_CMD_EWDS, reg);
> +       ret = do_eeprom_cmd(dev, E2P_CMD_EPC_CMD_EWDS, reg);
>
>  done:
>        return ret;
> @@ -139,7 +139,7 @@ static char *skip_space(char *buf)
>  /**
>  *     write_stuff - handle writing of MAC registers / eeprom
>  */
> -static void write_stuff(char *line)
> +static void write_stuff(struct eth_device *dev, char *line)
>  {
>        char dest;
>        char *endp;
> @@ -182,39 +182,39 @@ static void write_stuff(char *line)
>        /* Finally, execute the command */
>        if (dest == 'E') {
>                printf("Writing EEPROM register %02x with %02x\n", reg, value);
> -               write_eeprom_reg(value, reg);
> +               write_eeprom_reg(dev, value, reg);
>        } else {
>                printf("Writing MAC register %02x with %08x\n", reg, value);
> -               smc911x_reg_write(CONFIG_DRIVER_S

[U-Boot] [PATCH v2] OMAP3: pandora: fix booting without serial attached

2009-11-12 Thread Grazvydas Ignotas
When the board is booted without serial cable attached (which
is how most of them will be used) UART RX is left floating and
sometimes picks noise, which interrupts countdown and enters
U-Boot prompt instead of booting the kernel.

Fix this by setting up internal pullup on UART RX pin. This
does not prevent serial from working as the internal pullup
is weak.

Signed-off-by: Grazvydas Ignotas 
---
It would be nice for this to go in as a fix for 2009.11,
else users without serial cable won't be able to boot it.

 board/pandora/pandora.h |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/board/pandora/pandora.h b/board/pandora/pandora.h
index 5bfa0f9..f0ad16b 100644
--- a/board/pandora/pandora.h
+++ b/board/pandora/pandora.h
@@ -219,7 +219,8 @@ const omap3_sysinfo sysinfo = {
MUX_VAL(CP(UART2_RX),   (IEN  | PTD | EN  | M4)) /*GPIO_147,*/\
 /*UART2_RX*/\
  /*Serial Interface (Peripheral boot, Linux console, on AV connector)*/\
-   MUX_VAL(CP(UART3_RX_IRRX),  (IEN  | PTD | DIS | M0)) /*UART3_RX*/\
+ /*RX pulled up to avoid noise when nothing is connected to serial port*/\
+   MUX_VAL(CP(UART3_RX_IRRX),  (IEN  | PTU | EN  | M0)) /*UART3_RX*/\
MUX_VAL(CP(UART3_TX_IRTX),  (IDIS | PTD | DIS | M0)) /*UART3_TX*/\
  /*LEDs (Controlled by OMAP)*/\
MUX_VAL(CP(MMC1_DAT6),  (IDIS | PTD | DIS | M4)) /*GPIO_128*/\
-- 
1.5.6.3

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


[U-Boot] [PATCH V4] Davinci: add a pin multiplexer configuration API

2009-11-12 Thread Nick Thompson
Davinci: add a pin multiplexer configuration API.

Creates a method allowing pin settings to be logically grouped into data
structure arrays and provides an API to configure the pinmux settings to
enable the relevant pin functions.

Signed-off-by: Nick Thompson 
---
Applies to: u-boot-ti

Changes from last patch:
Make example match current usage (in DA8xx code, to follow)
Error check all pin settings before applying any changes
Type correction

The number of mux fields per register and the width of the fields needs to
be set per SoC. The initial settings are appropriate for at least DA8xx
devices. These should be modified in misc.h to support other devices as
required.

 board/davinci/common/misc.c |   48 ++-
 board/davinci/common/misc.h |   12 ++
 2 files changed, 59 insertions(+), 1 deletions(-)

diff --git a/board/davinci/common/misc.c b/board/davinci/common/misc.c
index ffdc20b..9fab76f 100644
--- a/board/davinci/common/misc.c
+++ b/board/davinci/common/misc.c
@@ -1,6 +1,7 @@
 /*
  * Miscelaneous DaVinci functions.
  *
+ * Copyright (C) 2009 Nick Thompson, GE Fanuc Ltd, 
  * Copyright (C) 2007 Sergey Kubushyn 
  * Copyright (C) 2008 Lyrtech 
  * Copyright (C) 2004 Texas Instruments.
@@ -27,7 +28,8 @@
 #include 
 #include 
 #include 
-
+#include 
+#include "misc.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -109,3 +111,47 @@ void dv_configure_mac_address(uint8_t *rom_enetaddr)
 }
 
 #endif /* DAVINCI_EMAC */
+
+/*
+ * Change the setting of a pin multiplexer field.
+ *
+ * Takes an array of pinmux settings similar to:
+ *
+ * struct pinmux_config uart_pins[] = {
+ * { &davinci_syscfg_regs->pinmux[8], 2, 7 },
+ * { &davinci_syscfg_regs->pinmux[9], 2, 0 }
+ * };
+ *
+ * Stepping through the array, each pinmux[n] register has the given value
+ * set in the pin mux field specified.
+ *
+ * The number of pins in the array must be passed (ARRAY_SIZE can provide
+ * this value conveniently).
+ *
+ * Returns 0 if all field numbers and values are in the correct range,
+ * else returns -1.
+ */
+int davinci_configure_pin_mux(const struct pinmux_config *pins,
+ const int n_pins)
+{
+   int i;
+
+   /* check for invalid pinmux values */
+   for (i = 0; i < n_pins; i++) {
+   if (pins[i].field >= PIN_MUX_NUM_FIELDS ||
+   (pins[i].value & ~PIN_MUX_FIELD_MASK) != 0)
+   return -1;
+   }
+
+   /* configure the pinmuxes */
+   for (i = 0; i < n_pins; i++) {
+   const int offset = pins[i].field * PIN_MUX_FIELD_SIZE;
+   const unsigned int value = pins[i].value << offset;
+   const unsigned int mask = PIN_MUX_FIELD_MASK << offset;
+   const dv_reg *mux = pins[i].mux;
+
+   writel(value | (readl(mux) & (~mask)), mux);
+   }
+
+   return 0;
+}
diff --git a/board/davinci/common/misc.h b/board/davinci/common/misc.h
index dc3cc41..f6d8b1b 100644
--- a/board/davinci/common/misc.h
+++ b/board/davinci/common/misc.h
@@ -22,8 +22,20 @@
 #ifndef __MISC_H
 #define __MISC_H
 
+/* pin muxer definitions */
+#define PIN_MUX_NUM_FIELDS 8   /* Per register */
+#define PIN_MUX_FIELD_SIZE 4   /* n in bits */
+#define PIN_MUX_FIELD_MASK ((1 << PIN_MUX_FIELD_SIZE) - 1)
+
+/* pin definition */
+struct pinmux_config {
+   dv_reg  *mux;   /* Address of mux register */
+   unsigned char   value;  /* Value to set in field */
+   unsigned char   field;  /* field number */
+};
 
 int dvevm_read_mac_address(uint8_t *buf);
 void dv_configure_mac_address(uint8_t *rom_enetaddr);
+int davinci_configure_pin_mux(const struct pinmux_config *pins, int n_pins);
 
 #endif /* __MISC_H */
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5 0/4] add TI DA8xx support:

2009-11-12 Thread Nick Thompson
On 12/11/09 02:58, Tom wrote:
> Nick Thompson wrote:
>> Add initial support for DA8xx SoC's and the spectrum digital DA830 EVM board.

>> This patch set depends on "[PATCH V3] Davinci: add a pin multiplexer
>> configuration API" posted on 2009-11-04
> 
> Yes it is dependent.
> There is a compile error without the pin mux function.
> 
> Once the pin multiplex patch is ack-ed then
> Ack to this patch set.
> 
> Thanks
> Tom

I've submitted an update for the pinmux functions, based on your comments.

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


Re: [U-Boot] [PATCH v2] OMAP3: add CM-T35 board

2009-11-12 Thread Mike Rapoport
Dear Wolfgang,

Wolfgang Denk wrote:
> Dear Mike Rapoport,
> 
> In message <1257955131-16729-1-git-send-email-m...@compulab.co.il> you wrote:
>> Add CM-T35 board support
>>
>> --
>> v2 changes:
>> - rename board config file from omap3_cm-t35.h to cm-t35.h
>> - remove SZ_xx references
>> - add MAKEALL/MAINTEINERS entries
>> --
>>
>> Signed-off-by: Mike Rapoport 
> 
> The Signed-off-by: line belongs _above_ the "--" line.
> 
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -677,6 +677,10 @@ Stelian Pop 
>>  at91sam9263ek   ARM926EJS (AT91SAM9263 SoC)
>>  at91sam9rlekARM926EJS (AT91SAM9RL SoC)
>>  
>> +Mike Rapoport 
>> +
>> +omap3_cm-t35ARM CORTEX-A8 (OMAP3xx SoC)
> 
> Please fix the board name.
> 
>> diff --git a/board/cm-t35/cm-t35.c b/board/cm-t35/cm-t35.c
>> new file mode 100644
>> index 000..b3eb087
>> --- /dev/null
>> +++ b/board/cm-t35/cm-t35.c
>> +udelay(1);
>> +twl4030_i2c_write_u8(TWL4030_CHIP_GPIO, 0x02,
>> + TWL4030_BASEADD_GPIO+0x0C);
>> +
>> +}
> 
> Delete this empty line, please (please check globally).
> 
> 
>> +++ b/board/cm-t35/cm-t35.h
> ...
>> +#define MUX_CM_T35() \
>> + /*SDRC*/\
>> + MUX_VAL(CP(SDRC_D0),   (IEN  | PTD | DIS | M0)) /*SDRC_D0*/\
> ...
> Indentation by TAB, please.
> 
>> +++ b/board/cm-t35/config.mk
>> @@ -0,0 +1,30 @@
> ...
>> +# For use with external or internal boots.
>> +TEXT_BASE = 0x80e8
>> \ No newline at end of file
> ^^
> 
> Please fix.
> 
>> diff --git a/include/configs/cm-t35.h b/include/configs/cm-t35.h
>> new file mode 100755
>> index 000..b881112
>> --- /dev/null
>> +++ b/include/configs/cm-t35.h
> ...
>> +#ifndef __ASSEMBLY__
>> +extern struct gpmc *gpmc_cfg;
>> +extern unsigned int boot_flash_base;
>> +extern volatile unsigned int boot_flash_env_addr;
>> +extern unsigned int boot_flash_off;
>> +extern unsigned int boot_flash_sec;
>> +extern unsigned int boot_flash_type;
>> +#endif
> 
> These should not be needed in your board config file. Please move to a
> more appropriate header.

This is what all other omap3 board do... Moving these requires some rework of
common omap3 code and updates to all omap3 boards.

> 
> Best regards,
> 
> Wolfgang Denk
> 

-- 
Sincerely yours,
Mike.


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


[U-Boot] [PATCH] smc911x: make smc911x_initialize return correct value (Was: Re: [PATCH 1/5] smc911x: return -1 when initialization fails)

2009-11-12 Thread Mike Rapoport
Mike Frysinger wrote:
> On Wednesday 11 November 2009 03:03:00 Mike Rapoport wrote:
>> --- a/drivers/net/smc911x.c
>> +++ b/drivers/net/smc911x.c
>> @@ -243,7 +243,7 @@
>>  dev = malloc(sizeof(*dev));
>>  if (!dev) {
>>  free(dev);
>> -return 0;
>> +return -1;
>>  }
> 
> this is correct as this is an error
> 
>> @@ -252,7 +252,7 @@
>>  /* Try to detect chip. Will fail if not present. */
>>  if (smc911x_detect_chip(dev)) {
>>  free(dev);
>> -return 0;
>> +return -1;
>>  }
> 
> this is not -- we want it to return 0 if no parts are found.  see recent net 
> doc updates and discussions.
> -mike

Hope this one is better:

>From 4a9420704dd81a08f950017d365e0826880536ed Mon Sep 17 00:00:00 2001
From: Mike Rapoport 
Date: Tue, 10 Nov 2009 15:31:46 +0200
Subject: [PATCH] smc911x: make smc911x_initialize return correct value

Make smc911x_initialize return -1 on error and number of interfaces
detected otherwise.

Signed-off-by: Mike Rapoport 
---
 drivers/net/smc911x.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index acc2306..5d51406 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -243,7 +243,7 @@ int smc911x_initialize(u8 dev_num, int base_addr)
dev = malloc(sizeof(*dev));
if (!dev) {
free(dev);
-   return 0;
+   return -1;
}
memset(dev, 0, sizeof(*dev));

@@ -271,5 +271,5 @@ int smc911x_initialize(u8 dev_num, int base_addr)
sprintf(dev->name, "%s-%hu", DRIVERNAME, dev_num);

eth_register(dev);
-   return 0;
+   return 1;
 }
-- 
1.6.0.6



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

-- 
Sincerely yours,
Mike.

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


Re: [U-Boot] [PATCH V5 0/4] add TI DA8xx support:

2009-11-12 Thread Tom
Nick Thompson wrote:
> On 12/11/09 02:58, Tom wrote:
>> Nick Thompson wrote:
>>> Add initial support for DA8xx SoC's and the spectrum digital DA830 EVM 
>>> board.
> 
>>> This patch set depends on "[PATCH V3] Davinci: add a pin multiplexer
>>> configuration API" posted on 2009-11-04
>> Yes it is dependent.
>> There is a compile error without the pin mux function.
>>
>> Once the pin multiplex patch is ack-ed then
>> Ack to this patch set.
>>
>> Thanks
>> Tom
> 
> I've submitted an update for the pinmux functions, based on your comments.
> 
Yes. Your changes are fine.

Sandeep,
Can you push this the pinmux and then this change to the arm-ti ?

Tom

> Thanks for the Ack,
> Nick.

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


Re: [U-Boot] [PATCH v2] OMAP3: pandora: fix booting without serial attached

2009-11-12 Thread Tom
Grazvydas Ignotas wrote:
> When the board is booted without serial cable attached (which
> is how most of them will be used) UART RX is left floating and
> sometimes picks noise, which interrupts countdown and enters
> U-Boot prompt instead of booting the kernel.
> 
> Fix this by setting up internal pullup on UART RX pin. This
> does not prevent serial from working as the internal pullup
> is weak.
> 
> Signed-off-by: Grazvydas Ignotas 

Ack.
Thanks.

> ---
> It would be nice for this to go in as a fix for 2009.11,
> else users without serial cable won't be able to boot it.
> 

Wolfgang,
Can this fix be included in 2009.11 ?

Tom


>  board/pandora/pandora.h |3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/board/pandora/pandora.h b/board/pandora/pandora.h
> index 5bfa0f9..f0ad16b 100644
> --- a/board/pandora/pandora.h
> +++ b/board/pandora/pandora.h
> @@ -219,7 +219,8 @@ const omap3_sysinfo sysinfo = {
>   MUX_VAL(CP(UART2_RX),   (IEN  | PTD | EN  | M4)) /*GPIO_147,*/\
>/*UART2_RX*/\
>   /*Serial Interface (Peripheral boot, Linux console, on AV connector)*/\
> - MUX_VAL(CP(UART3_RX_IRRX),  (IEN  | PTD | DIS | M0)) /*UART3_RX*/\
> + /*RX pulled up to avoid noise when nothing is connected to serial port*/\
> + MUX_VAL(CP(UART3_RX_IRRX),  (IEN  | PTU | EN  | M0)) /*UART3_RX*/\
>   MUX_VAL(CP(UART3_TX_IRTX),  (IDIS | PTD | DIS | M0)) /*UART3_TX*/\
>   /*LEDs (Controlled by OMAP)*/\
>   MUX_VAL(CP(MMC1_DAT6),  (IDIS | PTD | DIS | M4)) /*GPIO_128*/\

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


Re: [U-Boot] [PATCH V4] Davinci: add a pin multiplexer configuration API

2009-11-12 Thread Tom
Nick Thompson wrote:
> Davinci: add a pin multiplexer configuration API.
> 
> Creates a method allowing pin settings to be logically grouped into data
> structure arrays and provides an API to configure the pinmux settings to
> enable the relevant pin functions.
> 
> Signed-off-by: Nick Thompson 
> ---
> Applies to: u-boot-ti
> 
> Changes from last patch:
>   Make example match current usage (in DA8xx code, to follow)
>   Error check all pin settings before applying any changes
>   Type correction
> 
> The number of mux fields per register and the width of the fields needs to
> be set per SoC. The initial settings are appropriate for at least DA8xx
> devices. These should be modified in misc.h to support other devices as
> required.
> 
>  board/davinci/common/misc.c |   48 
> ++-
>  board/davinci/common/misc.h |   12 ++
>  2 files changed, 59 insertions(+), 1 deletions(-)
> 
> 

Ack.
Thanks
Tom


diff --git a/board/davinci/common/misc.c b/board/davinci/common/misc.c
> index ffdc20b..9fab76f 100644
> --- a/board/davinci/common/misc.c
> +++ b/board/davinci/common/misc.c
> @@ -1,6 +1,7 @@
>  /*
>   * Miscelaneous DaVinci functions.
>   *
> + * Copyright (C) 2009 Nick Thompson, GE Fanuc Ltd, 
> 
>   * Copyright (C) 2007 Sergey Kubushyn 
>   * Copyright (C) 2008 Lyrtech 
>   * Copyright (C) 2004 Texas Instruments.
> @@ -27,7 +28,8 @@
>  #include 
>  #include 
>  #include 
> -
> +#include 
> +#include "misc.h"
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> @@ -109,3 +111,47 @@ void dv_configure_mac_address(uint8_t *rom_enetaddr)
>  }
>  
>  #endif   /* DAVINCI_EMAC */
> +
> +/*
> + * Change the setting of a pin multiplexer field.
> + *
> + * Takes an array of pinmux settings similar to:
> + *
> + * struct pinmux_config uart_pins[] = {
> + *   { &davinci_syscfg_regs->pinmux[8], 2, 7 },
> + *   { &davinci_syscfg_regs->pinmux[9], 2, 0 }
> + * };
> + *
> + * Stepping through the array, each pinmux[n] register has the given value
> + * set in the pin mux field specified.
> + *
> + * The number of pins in the array must be passed (ARRAY_SIZE can provide
> + * this value conveniently).
> + *
> + * Returns 0 if all field numbers and values are in the correct range,
> + * else returns -1.
> + */
> +int davinci_configure_pin_mux(const struct pinmux_config *pins,
> +   const int n_pins)
> +{
> + int i;
> +
> + /* check for invalid pinmux values */
> + for (i = 0; i < n_pins; i++) {
> + if (pins[i].field >= PIN_MUX_NUM_FIELDS ||
> + (pins[i].value & ~PIN_MUX_FIELD_MASK) != 0)
> + return -1;
> + }
> +
> + /* configure the pinmuxes */
> + for (i = 0; i < n_pins; i++) {
> + const int offset = pins[i].field * PIN_MUX_FIELD_SIZE;
> + const unsigned int value = pins[i].value << offset;
> + const unsigned int mask = PIN_MUX_FIELD_MASK << offset;
> + const dv_reg *mux = pins[i].mux;
> +
> + writel(value | (readl(mux) & (~mask)), mux);
> + }
> +
> + return 0;
> +}
> diff --git a/board/davinci/common/misc.h b/board/davinci/common/misc.h
> index dc3cc41..f6d8b1b 100644
> --- a/board/davinci/common/misc.h
> +++ b/board/davinci/common/misc.h
> @@ -22,8 +22,20 @@
>  #ifndef __MISC_H
>  #define __MISC_H
>  
> +/* pin muxer definitions */
> +#define PIN_MUX_NUM_FIELDS   8   /* Per register */
> +#define PIN_MUX_FIELD_SIZE   4   /* n in bits */
> +#define PIN_MUX_FIELD_MASK   ((1 << PIN_MUX_FIELD_SIZE) - 1)
> +
> +/* pin definition */
> +struct pinmux_config {
> + dv_reg  *mux;   /* Address of mux register */
> + unsigned char   value;  /* Value to set in field */
> + unsigned char   field;  /* field number */
> +};
>  
>  int dvevm_read_mac_address(uint8_t *buf);
>  void dv_configure_mac_address(uint8_t *rom_enetaddr);
> +int davinci_configure_pin_mux(const struct pinmux_config *pins, int n_pins);
>  
>  #endif /* __MISC_H */
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

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


[U-Boot] [PATCH] Removes dead code in the file common/cmd_i2c.c

2009-11-12 Thread Pratap Chandu
There is some dead code enclosed by #if 0  #endif in the file 
common/cmd_i2c.c
This patch removes the dead code.

Signed-off-by: Pratap Chandu 
---
 common/cmd_i2c.c |8 
 1 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index 8f0fc9e..8d6feda 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -326,14 +326,6 @@ int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
 #if !defined(CONFIG_SYS_I2C_FRAM)
udelay(11000);
 #endif
-
-#if 0
-   for (timeout = 0; timeout < 10; timeout++) {
-   udelay(2000);
-   if (i2c_probe(chip) == 0)
-   break;
-   }
-#endif
}
 
return (0);
-- 
1.5.6.5

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


Re: [U-Boot] [PATCH] ppc/85xx: Add PIB/ATM support for MPC8569mds

2009-11-12 Thread Kumar Gala

On Nov 6, 2009, at 2:27 AM, Liu Yu wrote:

> Signed-off-by: Liu Yu 
> ---
> board/freescale/common/pq-mds-pib.c |2 +-
> board/freescale/mpc8569mds/mpc8569mds.c |7 +++
> include/configs/MPC8569MDS.h|3 +++
> 3 files changed, 11 insertions(+), 1 deletions(-)
>
> diff --git a/board/freescale/common/pq-mds-pib.c b/board/freescale/ 
> common/pq-mds-pib.c
> index 6c72aa1..5f7a67d 100644
> --- a/board/freescale/common/pq-mds-pib.c
> +++ b/board/freescale/common/pq-mds-pib.c
> @@ -63,7 +63,7 @@ int pib_init(void)
> #endif
>
> #if defined(CONFIG_PQ_MDS_PIB_ATM)
> -#if defined(CONFIG_MPC8360EMDS)
> +#if defined(CONFIG_MPC8360EMDS) || defined(CONFIG_MPC8569MDS)
>   val8 = 0;
>   i2c_write(0x20, 0x6, 1, &val8, 1);
>   i2c_write(0x20, 0x7, 1, &val8, 1);
> diff --git a/board/freescale/mpc8569mds/mpc8569mds.c b/board/ 
> freescale/mpc8569mds/mpc8569mds.c
> index cdd7813..02e6920 100644
> --- a/board/freescale/mpc8569mds/mpc8569mds.c
> +++ b/board/freescale/mpc8569mds/mpc8569mds.c
> @@ -39,6 +39,9 @@
> #include 
>
> #include "bcsr.h"
> +#if defined(CONFIG_PQ_MDS_PIB)
> +#include "../common/pq-mds-pib.h"
> +#endif
>
> phys_size_t fixed_sdram(void);
>
> @@ -542,6 +545,10 @@ pci_init_board(void)
>   r = hose->regions;
>   pcie_configured = is_fsl_pci_cfg(LAW_TRGT_IF_PCIE_1, io_sel);
>
> +#if defined(CONFIG_PQ_MDS_PIB)
> + pib_init();
> +#endif
> +
>   if (pcie_configured && !(gur->devdisr & MPC85xx_DEVDISR_PCIE)){
>   printf ("\nPCIE connected to slot as %s (base address %x)",
>   pcie_ep ? "End Point" : "Root Complex",
> diff --git a/include/configs/MPC8569MDS.h b/include/configs/ 
> MPC8569MDS.h
> index 17ea3bb..7462abb 100644
> --- a/include/configs/MPC8569MDS.h
> +++ b/include/configs/MPC8569MDS.h
> @@ -44,6 +44,9 @@
> #define CONFIG_ENV_OVERWRITE
> #define CONFIG_FSL_LAW1   /* Use common FSL init code */
>
> +#define CONFIG_PQ_MDS_PIB
> +#define CONFIG_PQ_MDS_PIB_ATM

Shouldn't we set these based on the make target?

So something like MPC8569MDS_PIB and MPC8569MDS_PIB_ATM in top-level  
makefile?

- k

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


Re: [U-Boot] [PATCH v1] fsl-ddr: Fix the chip-select interleaving issue

2009-11-12 Thread Kumar Gala

On Nov 11, 2009, at 5:26 PM, Dave Liu wrote:

> commit 1542fbdeec0d1e2a6df13189df8dcb1ce8802be3
> introduced one new bug to chip-select interleaving.
>
> Single DDR controller also can do the chip-select
> interleaving if there is dual-rank or qual-rank DIMMs.
>
> Signed-off-by: Dave Liu 
> ---
> The v1 also address the cs_per_ctrl == 1 case
>
> cpu/mpc8xxx/ddr/options.c |6 ++
> 1 files changed, 2 insertions(+), 4 deletions(-)

applied to 85xx

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


[U-Boot] Pull request - mpc85xx (for v2009.11)

2009-11-12 Thread Kumar Gala
The following changes since commit 4f127980e0d4ba179b4628ebf8e8642210731055:
  Wolfgang Denk (1):
Merge branch 'master' of git://git.denx.de/u-boot-net

are available in the git repository at:

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

Dave Liu (1):
  fsl-ddr: Fix the chip-select interleaving issue

 cpu/mpc8xxx/ddr/options.c |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] redundant code in common/cmd_i2c.

2009-11-12 Thread Detlev Zundel
Hi Heiko,

> Hello PratapChandu,
>
> PratapChandu wrote:
>> The following code fragment in the file common/cmd_i2c.c  seems to be 
>> redundant.
>> Is not good to delete  ?
>> 
>> Line 330 - 336 is like below
>> 
>> #if 0
>> for (timeout = 0; timeout < 10; timeout++) {
>> udelay(2000);
>> if (i2c_probe(chip) == 0)
>> break;
>> }
>> #endif
>
> Yes, this seems to be dead code. Please provide a patch for removing
> it.

Ah uh, check the comment above which is directly related to this piece
of code.  if you remove only the code, you have a dangling comment.
Maybe this was meant to be an option but nobody cared to make it
optional?

Actually I do not know if this was ever used, but we should try to do
the change consistently.

Cheers
  Detlev

-- 
[Linux] USB consoles was a  bad hack written on a drunken dare.   I'm still
constantly amazed that the thing even works at all, let alone the fact that
people are actually using it :) 
-- Greg KH <20090420225358.gc28...@kroah.com>
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] How Would you Like To Say Goodbye To Your Power Bill...?

2009-11-12 Thread boss

Hello,

Have you found yourself frustrated due to the ever-rising power
bills?

 I have found myself struggling with the same problem as well,

But now, there is a solution. Did you know that you can generate your
own

 electric energy, using a magnetic energy generator.

 It works by itself, and it produces absolutely free energy.

It's called Magniwork, visit the following link to find out more : 

>>> Click Here!


It is getting widely popular and people are starting to massively
implement

 these generators, and completely eliminate their power bills.

 Proceed to:

>>> Click Here!


Also, They're currently running a special discount, and I have never
seen

 Magniwork being priced so low. However, I have some 'inside'
information 

 that this offer is only going to last for 

 a few days only, so you better take advantage of it, before the
price goes back up

>>> Click Here!


p.s They're so sure that this will slash your power bill, that
they're 

even offering an unconditonal 60 day money back guarantee!!



--
If you do not want to receive any more newsletters, 
http://www.solduk.com/design/mailer/?p=unsubscribe&uid=af86ba5c2aaa2d9e36cb3507d85fa01d

To update your preferences and to unsubscribe visit
http://www.solduk.com/design/mailer/?p=preferences&uid=af86ba5c2aaa2d9e36cb3507d85fa01d
Forward a Message to Someone
http://www.solduk.com/design/mailer/?p=forward&uid=af86ba5c2aaa2d9e36cb3507d85fa01d&mid=2


--
Powered by PHPlist, www.phplist.com --


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


Re: [U-Boot] [PATCH 1/2] ARM Conditionally compile board LED functions

2009-11-12 Thread Alessandro Rubini
> I withdraw this patch.
> I will rethink this and come up with something better.

I agree weak is better than ifdef. But the led situation on ARM isn't
really pleasant when you look in lib_arm/board.c .

When I proposed a simplification of board.c back on Jul 22 ("[RFC]
arm/board.c: avoid ifdef using weak default functions", I noticed the
led approach and thought it would need cleanup (for example, by moving
out of board.c to led.c or something).  However, the patch was
rejected by JC as he has initcalls as work in progress.

Since we still missing the initcalls (as missing JC), could that patch
be reconsidered? I can rebase if there's any interest.

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


Re: [U-Boot] [PATCH V5 0/4] add TI DA8xx support:

2009-11-12 Thread Paulraj, Sandeep

> -Original Message-
> From: Tom [mailto:tom@windriver.com]
> Sent: Thursday, November 12, 2009 8:42 AM
> To: Nick Thompson; Paulraj, Sandeep
> Cc: u-boot@lists.denx.de
> Subject: Re: [U-Boot] [PATCH V5 0/4] add TI DA8xx support:
> 
> Nick Thompson wrote:
> > On 12/11/09 02:58, Tom wrote:
> >> Nick Thompson wrote:
> >>> Add initial support for DA8xx SoC's and the spectrum digital DA830 EVM
> board.
> >
> >>> This patch set depends on "[PATCH V3] Davinci: add a pin multiplexer
> >>> configuration API" posted on 2009-11-04
> >> Yes it is dependent.
> >> There is a compile error without the pin mux function.
> >>
> >> Once the pin multiplex patch is ack-ed then
> >> Ack to this patch set.
> >>
> >> Thanks
> >> Tom
> >
> > I've submitted an update for the pinmux functions, based on your
> comments.
> >
> Yes. Your changes are fine.
> 
> Sandeep,
> Can you push this the pinmux and then this change to the arm-ti ?
> 
> Tom

Will do it this weekend.

> 
> > Thanks for the Ack,
> > Nick.
> 

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


[U-Boot] [PATCH 1/3] DA830: Add pinmux for USB0_DRVVBUS

2009-11-12 Thread Ajay Kumar Gupta
USB0_DRVVBUS pinmux configuration is required for USB functinality
in uboot.

Signed-off-by: Ajay Kumar Gupta 
Signed-off-by: Swaminathan S 
---
This patch set is created against Nick Thompson's latest patch set
(v5) on DA8xx support and another patch from him on Davinci pinmux.
[Davinci: add a pin multiplexer configuration API]

 board/davinci/da830evm/da830evm.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/board/davinci/da830evm/da830evm.c 
b/board/davinci/da830evm/da830evm.c
index bb8cc3c..7cf6013 100644
--- a/board/davinci/da830evm/da830evm.c
+++ b/board/davinci/da830evm/da830evm.c
@@ -65,6 +65,11 @@ const struct pinmux_config i2c_pins[] = {
{ pinmux[9], 2, 4 }
 };
 
+/* USB0_DRVVBUS pin muxer settings */
+const struct pinmux_config usb_pins[] = {
+   { pinmux[9], 1, 1 }
+};
+
 int board_init(void)
 {
 #ifndef CONFIG_USE_IRQ
@@ -118,6 +123,9 @@ int board_init(void)
if (davinci_configure_pin_mux(i2c_pins, ARRAY_SIZE(i2c_pins)) != 0)
return 1;
 
+   if (davinci_configure_pin_mux(usb_pins, ARRAY_SIZE(usb_pins)) != 0)
+   return 1;
+
/* enable the console UART */
writel((DAVINCI_UART_PWREMU_MGMT_FREE | DAVINCI_UART_PWREMU_MGMT_URRST |
DAVINCI_UART_PWREMU_MGMT_UTRST),
-- 
1.6.2.4

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


[U-Boot] [PATCH 2/3] DA8xx: Add MUSB host support

2009-11-12 Thread Ajay Kumar Gupta
Tested USB host functionality on DA830 EVM.

Signed-off-by: Ajay Kumar Gupta 
Signed-off-by: Swaminathan S 
---
 drivers/usb/musb/Makefile |1 +
 drivers/usb/musb/da8xx.c  |  143 +
 drivers/usb/musb/da8xx.h  |   83 ++
 include/usb.h |3 +-
 4 files changed, 229 insertions(+), 1 deletions(-)
 create mode 100644 drivers/usb/musb/da8xx.c
 create mode 100644 drivers/usb/musb/da8xx.h

diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile
index 09e0a5f..eb4d8fd 100644
--- a/drivers/usb/musb/Makefile
+++ b/drivers/usb/musb/Makefile
@@ -27,6 +27,7 @@ LIB   := $(obj)libusb_musb.a
 
 COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
 COBJS-$(CONFIG_USB_DAVINCI) += davinci.o
+COBJS-$(CONFIG_USB_DA8XX) += da8xx.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
new file mode 100644
index 000..9e4ba70
--- /dev/null
+++ b/drivers/usb/musb/da8xx.c
@@ -0,0 +1,143 @@
+/*
+ * da8xx.c - TI's DA8xx platform specific usb wrapper functions.
+ *
+ * Author: Ajay Kumar Gupta 
+ *
+ * Based on drivers/usb/musb/davinci.c
+ *
+ * Copyright (c) 2009 Texas Instruments Incorporated
+ *
+ * This package is free software;  you can redistribute it and/or
+ * modify it under the terms of the license found in the file
+ * named COPYING that should have accompanied this file.
+ *
+ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ */
+#include 
+
+#ifdef CONFIG_USB_DA8XX
+
+#include "da8xx.h"
+
+/* MUSB platform configuration */
+struct musb_config musb_cfg = {
+   (struct musb_regs *)DA8XX_USB_OTG_CORE_BASE,
+   DA8XX_USB_OTG_TIMEOUT,
+   0
+};
+
+/*
+ * This function enables VBUS by driving the GPIO Bank4 Pin 15 high.
+ */
+static void enable_vbus(void)
+{
+   u32 value;
+
+   /* configure GPIO bank4 pin 15 in output direction */
+   value = readl(DAVINCI_GPIO_BASE + BANK4_REG_DIR_ADDR);
+   writel((value & (~USB_VBUS_GPIO)),
+   (DAVINCI_GPIO_BASE + BANK4_REG_DIR_ADDR));
+
+   /* set GPIO bank4 pin 15 high to drive VBUS */
+   value = readl(DAVINCI_GPIO_BASE + BANK4_REG_SET_ADDR);
+   writel((value | USB_VBUS_GPIO),
+   (DAVINCI_GPIO_BASE + BANK4_REG_SET_ADDR));
+}
+
+/*
+ * Enable the usb0 phy. This initialization procedure is explained in
+ * the DA8xx USB user guide document.
+ */
+static u8 phy_on(void)
+{
+   u32 timeout;
+   u32 cfgchip2;
+
+   cfgchip2 = readl(DAVINCI_BOOTCFG_BASE + CFGCHIP2);
+
+   cfgchip2 &= ~(CFGCHIP2_RESET | CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN |
+   CFGCHIP2_OTGMODE | CFGCHIP2_REFFREQ);
+   cfgchip2 |= CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN | CFGCHIP2_PHY_PLLON |
+   CFGCHIP2_REFFREQ_24MHZ;
+
+   writel(cfgchip2, (DAVINCI_BOOTCFG_BASE + CFGCHIP2));
+
+   /* wait until the usb phy pll locks */
+   timeout = musb_cfg.timeout;
+   while (timeout--)
+   if (readl(DAVINCI_BOOTCFG_BASE + CFGCHIP2) & CFGCHIP2_PHYCLKGD)
+   return 1;
+
+   /* USB phy was not turned on */
+   return 0;
+}
+
+/*
+ * Disable the usb phy
+ */
+static void phy_off(void)
+{
+   u32 cfgchip2;
+
+   /*
+* Power down the on-chip PHY.
+*/
+   cfgchip2 = readl(DAVINCI_BOOTCFG_BASE + CFGCHIP2);
+
+   cfgchip2 &= ~CFGCHIP2_PHY_PLLON;
+   cfgchip2 |= CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN;
+   writel(cfgchip2, (DAVINCI_BOOTCFG_BASE + CFGCHIP2));
+}
+
+/*
+ * This function performs DA8xx platform specific initialization for usb0.
+ */
+int musb_platform_init(void)
+{
+   u32  revision;
+
+   /* enable psc for usb2.0 */
+   lpsc_on(33);
+
+   /* enable usb vbus */
+   enable_vbus();
+
+   /* reset the controller */
+   writel(0x1, (DA8XX_USB_OTG_BASE + DA8XX_USB_CTRL_REG));
+   udelay(5000);
+
+   /* start the on-chip usb phy and its pll */
+   if (phy_on() == 0)
+   return -1;
+
+   /* Returns zero if e.g. not clocked */
+   revision = readl(DA8XX_USB_OTG_BASE + DA8XX_USB_VERSION_REG);
+   if (revision == 0)
+   return -1;
+
+   /* Disable all interrupts */
+   writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK
+   | DA8XX_USB_RXINT_MASK),
+   (DA8XX_USB_OTG_BASE + DA8XX_USB_INT_MASK_SET_REG));
+   return 0;
+}
+
+/*
+ * This function performs DA8xx platform specific deinitialization for usb0.
+ */
+void musb_platform_deinit(void)
+{
+   /* Turn of the phy */
+   phy_off();
+
+   /* flush any interrupts */
+   writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK |
+   DA8XX_USB_RXINT_MASK),
+   (DA8XX_USB_OTG_BASE + DA8X

[U-Boot] [PATCH 3/3] DA830: Add usb config

2009-11-12 Thread Ajay Kumar Gupta
Signed-off-by: Ajay Kumar Gupta 
Signed-off-by: Swaminathan S 
---
 include/configs/da830evm.h |   35 +++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/include/configs/da830evm.h b/include/configs/da830evm.h
index 38e2ce1..52e6473 100644
--- a/include/configs/da830evm.h
+++ b/include/configs/da830evm.h
@@ -149,6 +149,11 @@
 #define CONFIG_SYS_ENV_SPI_MAX_HZ  CONFIG_SF_DEFAULT_SPEED
 #endif
 
+/*==*/
+/* USB  configuration   */
+/*==*/
+#define CONFIG_USB_DA8XX   /* Platform hookup to MUSB controller */
+#define CONFIG_MUSB_HCD
 
 /*
  * U-Boot general configuration
@@ -240,4 +245,34 @@
 #define CONFIG_DOS_PARTITION   /* include support for FAT/storage*/
 #endif
 
+#ifdef CONFIG_USB_DA8XX
+
+#ifdef CONFIG_MUSB_HCD
+#define CONFIG_CMD_USB /* inclue support for usb   */
+
+#define CONFIG_USB_STORAGE /* MSC class support */
+#define CONFIG_CMD_STORAGE /* inclue support for usb   */
+#define CONFIG_CMD_FAT /* inclue support for FAT/storage*/
+#define CONFIG_DOS_PARTITION   /* inclue support for FAT/storage*/
+
+#ifdef CONFIG_USB_KEYBOARD
+#define CONFIG_SYS_USB_EVENT_POLL
+#define CONFIG_PREBOOT "usb start"
+#endif /* CONFIG_USB_KEYBOARD */
+
+#endif /* CONFIG_MUSB_HCD */
+
+#ifdef CONFIG_MUSB_UDC
+/* USB device configuration */
+#define CONFIG_USB_DEVICE  1
+#define CONFIG_USB_TTY 1
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV   1
+/* Change these to suit your needs */
+#define CONFIG_USBD_VENDORID   0x0451
+#define CONFIG_USBD_PRODUCTID  0x5678
+#define CONFIG_USBD_MANUFACTURER   "Texas Instruments"
+#define CONFIG_USBD_PRODUCT_NAME   "DA830EVM"
+#endif /* CONFIG_MUSB_UDC */
+
+#endif /* CONFIG_USB_DA8XX */
 #endif /* __CONFIG_H */
-- 
1.6.2.4

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


Re: [U-Boot] [PATCH 1/3] DA830: Add pinmux for USB0_DRVVBUS

2009-11-12 Thread Tom
Ajay Kumar Gupta wrote:
> USB0_DRVVBUS pinmux configuration is required for USB functinality
> in uboot.
> 
> Signed-off-by: Ajay Kumar Gupta 
> Signed-off-by: Swaminathan S 
> ---
> This patch set is created against Nick Thompson's latest patch set
> (v5) on DA8xx support and another patch from him on Davinci pinmux.
> [Davinci: add a pin multiplexer configuration API]

It is difficult to review code that is dependent on other outstanding
patches.

The base DA8xx support will be in arm-ti branch shortly.
Please rebase these patches when this happens and resubmit.

Tom


> 
>  board/davinci/da830evm/da830evm.c |8 
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/board/davinci/da830evm/da830evm.c 
> b/board/davinci/da830evm/da830evm.c
> index bb8cc3c..7cf6013 100644
> --- a/board/davinci/da830evm/da830evm.c
> +++ b/board/davinci/da830evm/da830evm.c
> @@ -65,6 +65,11 @@ const struct pinmux_config i2c_pins[] = {
>   { pinmux[9], 2, 4 }
>  };
>  
> +/* USB0_DRVVBUS pin muxer settings */
> +const struct pinmux_config usb_pins[] = {
> + { pinmux[9], 1, 1 }
> +};
> +
>  int board_init(void)
>  {
>  #ifndef CONFIG_USE_IRQ
> @@ -118,6 +123,9 @@ int board_init(void)
>   if (davinci_configure_pin_mux(i2c_pins, ARRAY_SIZE(i2c_pins)) != 0)
>   return 1;
>  
> + if (davinci_configure_pin_mux(usb_pins, ARRAY_SIZE(usb_pins)) != 0)
> + return 1;
> +
>   /* enable the console UART */
>   writel((DAVINCI_UART_PWREMU_MGMT_FREE | DAVINCI_UART_PWREMU_MGMT_URRST |
>   DAVINCI_UART_PWREMU_MGMT_UTRST),

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


Re: [U-Boot] [PATCH 1/3] DA830: Add pinmux for USB0_DRVVBUS

2009-11-12 Thread Paulraj, Sandeep


> Ajay Kumar Gupta wrote:
> > USB0_DRVVBUS pinmux configuration is required for USB functinality
> > in uboot.
> >
> > Signed-off-by: Ajay Kumar Gupta 
> > Signed-off-by: Swaminathan S 
> > ---
> > This patch set is created against Nick Thompson's latest patch set
> > (v5) on DA8xx support and another patch from him on Davinci pinmux.
> > [Davinci: add a pin multiplexer configuration API]
> 
> It is difficult to review code that is dependent on other outstanding
> patches.
> 
> The base DA8xx support will be in arm-ti branch shortly.
> Please rebase these patches when this happens and resubmit.
> 
> Tom

I think he might have added it locally and then made his patches.
So he might not have to rebase.

Without Nick's patches da830evm.c would not even exist :-)

> 
> >
> >  board/davinci/da830evm/da830evm.c |8 
> >  1 files changed, 8 insertions(+), 0 deletions(-)
> >
> > diff --git a/board/davinci/da830evm/da830evm.c
> b/board/davinci/da830evm/da830evm.c
> > index bb8cc3c..7cf6013 100644
> > --- a/board/davinci/da830evm/da830evm.c
> > +++ b/board/davinci/da830evm/da830evm.c
> > @@ -65,6 +65,11 @@ const struct pinmux_config i2c_pins[] = {
> > { pinmux[9], 2, 4 }
> >  };
> >
> > +/* USB0_DRVVBUS pin muxer settings */
> > +const struct pinmux_config usb_pins[] = {
> > +   { pinmux[9], 1, 1 }
> > +};
> > +
> >  int board_init(void)
> >  {
> >  #ifndef CONFIG_USE_IRQ
> > @@ -118,6 +123,9 @@ int board_init(void)
> > if (davinci_configure_pin_mux(i2c_pins, ARRAY_SIZE(i2c_pins)) != 0)
> > return 1;
> >
> > +   if (davinci_configure_pin_mux(usb_pins, ARRAY_SIZE(usb_pins)) != 0)
> > +   return 1;
> > +
> > /* enable the console UART */
> > writel((DAVINCI_UART_PWREMU_MGMT_FREE |
> DAVINCI_UART_PWREMU_MGMT_URRST |
> > DAVINCI_UART_PWREMU_MGMT_UTRST),
> 
> ___
> 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 1/2] ARM Conditionally compile board LED functions

2009-11-12 Thread Tom
Alessandro Rubini wrote:
>> I withdraw this patch.
>> I will rethink this and come up with something better.
> 
> I agree weak is better than ifdef. But the led situation on ARM isn't
> really pleasant when you look in lib_arm/board.c .
> 
> When I proposed a simplification of board.c back on Jul 22 ("[RFC]
> arm/board.c: avoid ifdef using weak default functions", I noticed the
> led approach and thought it would need cleanup (for example, by moving
> out of board.c to led.c or something).  However, the patch was
> rejected by JC as he has initcalls as work in progress.
> 
> Since we still missing the initcalls (as missing JC), could that patch
> be reconsidered? I can rebase if there's any interest.
>

Yes I am interested.
Please rebase the RFC patch.

Here is the link to the old RFC
http://lists.denx.de/pipermail/u-boot/2009-July/057273.html

Thanks,
Tom


> /alessandro

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


Re: [U-Boot] [PATCH 1/3] DA830: Add pinmux for USB0_DRVVBUS

2009-11-12 Thread Tom
Paulraj, Sandeep wrote:
> 
>> Ajay Kumar Gupta wrote:
>>> USB0_DRVVBUS pinmux configuration is required for USB functinality
>>> in uboot.
>>>
>>> Signed-off-by: Ajay Kumar Gupta 
>>> Signed-off-by: Swaminathan S 
>>> ---
>>> This patch set is created against Nick Thompson's latest patch set
>>> (v5) on DA8xx support and another patch from him on Davinci pinmux.
>>> [Davinci: add a pin multiplexer configuration API]
>> It is difficult to review code that is dependent on other outstanding
>> patches.
>>
>> The base DA8xx support will be in arm-ti branch shortly.
>> Please rebase these patches when this happens and resubmit.
>>
>> Tom
> 
> I think he might have added it locally and then made his patches.
> So he might not have to rebase.
> 
> Without Nick's patches da830evm.c would not even exist :-)
> 
> 

My issue is not with how development continues, it is with how patches
are reviewed.  To really review this patchset someone would need to
apply the pin mux patch, the the 8xx patch set, then this set.
Reviewing patches against outstanding patches does not scale and should be
avoided.

Tom



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


Re: [U-Boot] [PATCH 2/3] DA8xx: Add MUSB host support

2009-11-12 Thread Nick Thompson
On 12/11/09 15:39, Ajay Kumar Gupta wrote:
> Tested USB host functionality on DA830 EVM.
> 
> Signed-off-by: Ajay Kumar Gupta 
> Signed-off-by: Swaminathan S 
> ---
>  drivers/usb/musb/Makefile |1 +
>  drivers/usb/musb/da8xx.c  |  143 
> +
>  drivers/usb/musb/da8xx.h  |   83 ++
>  include/usb.h |3 +-
>  4 files changed, 229 insertions(+), 1 deletions(-)
>  create mode 100644 drivers/usb/musb/da8xx.c
>  create mode 100644 drivers/usb/musb/da8xx.h

> +static void enable_vbus(void)
> +{
> + u32 value;
> +
> + /* configure GPIO bank4 pin 15 in output direction */
> + value = readl(DAVINCI_GPIO_BASE + BANK4_REG_DIR_ADDR);
> + writel((value & (~USB_VBUS_GPIO)),
> + (DAVINCI_GPIO_BASE + BANK4_REG_DIR_ADDR));

In general you should be using C structure pointers for all readl/writel
accessors in new code. #defines are no longer considered acceptable, but occur
through this patch. In case there is a compatibility issue with existing code,
I think the legacy form is acceptable.

Indentation is also wrong here (and elsewhere) I believe. Using underscores to
illustrate spaces, this should be:

writel((value | USB_VBUS_GPIO),
___(DAVINCI_GPIO_BASE + BANK4_REG_SET_ADDR));

This is a mix of tabs (8) and spaces (<= 7). Indentation should use tabs only,
alignment uses spaces as required.

> +static u8 phy_on(void)
> +{
> + u32 timeout;
> + u32 cfgchip2;
> +
> + cfgchip2 = readl(DAVINCI_BOOTCFG_BASE + CFGCHIP2);

C structures again, but in this case the initial da8xx patches provide the C
structure and pointer already, so you can already replace this with:

cfgchip2 = readl(&davinci_syscfg_regs->cfgchip2);

Please take a look at hardware.h after the initial da8xx patches are in.

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


Re: [U-Boot] [PATCH V4] Davinci: add a pin multiplexer configuration API

2009-11-12 Thread Paulraj, Sandeep

> Davinci: add a pin multiplexer configuration API.
> 
> Creates a method allowing pin settings to be logically grouped into data
> structure arrays and provides an API to configure the pinmux settings to
> enable the relevant pin functions.
> 
> Signed-off-by: Nick Thompson 
> ---
> Applies to: u-boot-ti
> 
> Changes from last patch:
>   Make example match current usage (in DA8xx code, to follow)
>   Error check all pin settings before applying any changes
>   Type correction
> 
> The number of mux fields per register and the width of the fields needs to
> be set per SoC. The initial settings are appropriate for at least DA8xx
> devices. These should be modified in misc.h to support other devices as
> required.
> 
>  board/davinci/common/misc.c |   48
> ++-
>  board/davinci/common/misc.h |   12 ++
>  2 files changed, 59 insertions(+), 1 deletions(-)
> 
> diff --git a/board/davinci/common/misc.c b/board/davinci/common/misc.c
> index ffdc20b..9fab76f 100644
> --- a/board/davinci/common/misc.c
> +++ b/board/davinci/common/misc.c
> @@ -1,6 +1,7 @@


Pushed to u-boot-ti/master

Minor mod to patch header

http://git.denx.de/?p=u-boot/u-boot-ti.git;a=commit;h=5ff9f0f6bf1110785c12511770d6d224d1983592

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


Re: [U-Boot] [PATCH V5 1/4] add TI DA8xx support: DA8xx includes

2009-11-12 Thread Paulraj, Sandeep

> 
> Provides initial support for TI OMAP-L1x/DA8xx SoC devices.
> See http://www.ti.com
> 
> The DA8xx devices are similar to DaVinci devices but have a differing
> memory map and updated peripheral versions.
> 
> Signed-off-by: Nick Thompson 
> Signed-off-by: Sekhar Nori 
> ---
> Applies to u-boot-ti
> 
>  include/asm-arm/arch-davinci/hardware.h |  237
> +++
>  include/asm-arm/arch-davinci/i2c_defs.h |5 +
>  2 files changed, 242 insertions(+), 0 deletions(-)



Pushed to u-boot-ti/master

http://git.denx.de/?p=u-boot/u-boot-ti.git;a=commit;h=32c39e2da8483093dea29858a234ab2ec54e75bd

modified the patch header a little.

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


Re: [U-Boot] [PATCH 2/3] DA8xx: Add MUSB host support

2009-11-12 Thread Paulraj, Sandeep


> On 12/11/09 15:39, Ajay Kumar Gupta wrote:
> > Tested USB host functionality on DA830 EVM.
> >
> > Signed-off-by: Ajay Kumar Gupta 
> > Signed-off-by: Swaminathan S 
> > ---
> >  drivers/usb/musb/Makefile |1 +
> >  drivers/usb/musb/da8xx.c  |  143
> +
> >  drivers/usb/musb/da8xx.h  |   83 ++
> >  include/usb.h |3 +-
> >  4 files changed, 229 insertions(+), 1 deletions(-)
> >  create mode 100644 drivers/usb/musb/da8xx.c
> >  create mode 100644 drivers/usb/musb/da8xx.h
> 
> > +static void enable_vbus(void)
> > +{
> > +   u32 value;
> > +
> > +   /* configure GPIO bank4 pin 15 in output direction */
> > +   value = readl(DAVINCI_GPIO_BASE + BANK4_REG_DIR_ADDR);
> > +   writel((value & (~USB_VBUS_GPIO)),
> > +   (DAVINCI_GPIO_BASE + BANK4_REG_DIR_ADDR));

And there is now a gpio_defs.h in /include/asm-arm/arch-davinci

So please use that.

Ideally a GPIO driver would be nice but it is not yet part of u-boot.

> 
> In general you should be using C structure pointers for all readl/writel
> accessors in new code. #defines are no longer considered acceptable, but
> occur
> through this patch. In case there is a compatibility issue with existing
> code,
> I think the legacy form is acceptable.
> 
> Indentation is also wrong here (and elsewhere) I believe. Using
> underscores to
> illustrate spaces, this should be:
> 
>   writel((value | USB_VBUS_GPIO),
>   ___(DAVINCI_GPIO_BASE + BANK4_REG_SET_ADDR));
> 
> This is a mix of tabs (8) and spaces (<= 7). Indentation should use tabs
> only,
> alignment uses spaces as required.
> 
> > +static u8 phy_on(void)
> > +{
> > +   u32 timeout;
> > +   u32 cfgchip2;
> > +
> > +   cfgchip2 = readl(DAVINCI_BOOTCFG_BASE + CFGCHIP2);
> 
> C structures again, but in this case the initial da8xx patches provide the
> C
> structure and pointer already, so you can already replace this with:
> 
>   cfgchip2 = readl(&davinci_syscfg_regs->cfgchip2);
> 
> Please take a look at hardware.h after the initial da8xx patches are in.
> 
> Thanks,
> Nick.
> ___
> 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 V5 3/4] add TI DA8xx support: Add new directory for da830evm board

2009-11-12 Thread Paulraj, Sandeep

> 
> From: Sekhar Nori 
> 
> Add new directory for da830evm board
> 
> Provides initial support for TI OMAP-L137/DA830 SoC devices on a Spectrum
> Digital EVM board. See http://www.spectrumdigital.com/
> 
> Provides:
> Initial boot and configuration.
> Support for i2c.
> UART support (console).
> 
> Signed-off-by: Nick Thompson 
> ---
> Applies to u-boot-ti
> 
>  board/davinci/da830evm/Makefile   |   51 +++
>  board/davinci/da830evm/config.mk  |   43 +
>  board/davinci/da830evm/da830evm.c |  127
> +


Pushed to u-boot-ti/master

http://git.denx.de/?p=u-boot/u-boot-ti.git;a=commit;h=1e9baa494a1901b4e4015454b486c2aa14954442

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


Re: [U-Boot] [PATCH 2/2] OMAP3:SDRC: introduce DDR types

2009-11-12 Thread Paulraj, Sandeep

> >> Introduce Micron DDR timings and provide
> >> CONFIG_OMAP3_INFINEON_DDR and CONFIG_OMAP3_MICRON_DDR config
> >> options to allow for platform files to setup their timings as
> >> per the type of DDR selected
> >>
> >> Reported-by: Steve Sakoman in
> >>
> http://www.nabble.com/forum/Permalink.jtp?root=25779518&post=25959734&page
> >> =y
> >>
> >> Signed-off-by: Nishanth Menon 
> >> ---
> >>  include/asm-arm/arch-omap3/mem.h |   88
> ++---
> >> -
> >>  include/configs/devkit8000.h |3 +
> >>  include/configs/omap3_beagle.h   |3 +
> >>  include/configs/omap3_evm.h  |3 +
> >>  include/configs/omap3_overo.h|3 +
> >>  include/configs/omap3_pandora.h  |3 +
> >>  include/configs/omap3_sdp3430.h  |3 +
> >>  include/configs/omap3_zoom1.h|3 +
> >>  include/configs/omap3_zoom2.h|3 +
> >>  9 files changed, 94 insertions(+), 18 deletions(-)
> >>
> >
> > Pushed to u-boot-ti/next
> >
> > I think this series from Nishanth needs some runtime tests.
> > I believe Steve had some issues with his EVM not booting everytime due
> to issues with DDR init.
> >
> > Thanks,
> > Sandeep
> 
> Maybe it should go on the testing branch?
> 
> I will give zoom2 a try..
> 
> Tom
> 

Tom, Dirk, Steve,

Did u get a chance to try?

I am seeing a lot of OMAP3 patches which seem to be touching the above 
mentioned headers files.

Thanks,
Sandeep



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


Re: [U-Boot] [PATCH v3] davinci timer.c: Remove volatiles and memory mapped structures

2009-11-12 Thread Paulraj, Sandeep


> 
> Remove volatiles and memory mapped structure accesses and replace with
> readl and writel macro usage.
> 
> Signed-off-by: Nick Thompson 
> ---
> This patch was originally part of the da830 support patch, but this
> effort is now being integrated into davinci. As a result, these
> changes would be have been lost, as no change is required for da830.
> The changes where request to be kept available however, so here they
> are.
> 
>  cpu/arm926ejs/davinci/timer.c |   28 +++-
>  1 files changed, 15 insertions(+), 13 deletions(-)
> 
> diff --git a/cpu/arm926ejs/davinci/timer.c b/cpu/arm926ejs/davinci/timer.c
> index 80751ad..7c2c208 100644
> --- a/cpu/arm926ejs/davinci/timer.c
> +++ b/cpu/arm926ejs/davinci/timer.c
> @@ -38,8 +38,9 @@
>   */
 
Pushed to u-boot-ti/master

Minor modification to patch header

http://git.denx.de/?p=u-boot/u-boot-ti.git;a=commit;h=5e9253f5857df4d52629778617a4104784afb0c0



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


Re: [U-Boot] [PATCH V5 4/4] add TI DA8xx support: Integrate DA830 EVM support into U-Boot

2009-11-12 Thread Paulraj, Sandeep


> 
> From: Sekhar Nori 
> 
> Integrate DA830 EVM support into U-Boot.
> 
> Provides initial support for TI OMAP-L137/DA830 SoC devices on a Spectrum
> Digital EVM board. See http://www.spectrumdigital.com/
> 
> Signed-off-by: Nick Thompson 
> ---
> Applies to u-boot-ti
> 
>  MAINTAINERS|4 +
>  MAKEALL|1 +
>  Makefile   |3 +
>  include/common.h   |3 +
>  include/configs/da830evm.h |  243



Pushed to u-boot-ti/master

http://git.denx.de/?p=u-boot/u-boot-ti.git;a=commit;h=39ed8bba648acadb04c843f388a323bd75fa2e73

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


Re: [U-Boot] [PATCH 1/3] DA830: Add pinmux for USB0_DRVVBUS

2009-11-12 Thread Paulraj, Sandeep


> 
> Paulraj, Sandeep wrote:
> >
> >> Ajay Kumar Gupta wrote:
> >>> USB0_DRVVBUS pinmux configuration is required for USB functinality
> >>> in uboot.
> >>>
> >>> Signed-off-by: Ajay Kumar Gupta 
> >>> Signed-off-by: Swaminathan S 
> >>> ---
> >>> This patch set is created against Nick Thompson's latest patch set
> >>> (v5) on DA8xx support and another patch from him on Davinci pinmux.
> >>> [Davinci: add a pin multiplexer configuration API]
> >> It is difficult to review code that is dependent on other outstanding
> >> patches.
> >>
> >> The base DA8xx support will be in arm-ti branch shortly.
> >> Please rebase these patches when this happens and resubmit.
> >>
> >> Tom
> >
> > I think he might have added it locally and then made his patches.
> > So he might not have to rebase.
> >
> > Without Nick's patches da830evm.c would not even exist :-)
> >
> >
> 
> My issue is not with how development continues, it is with how patches
> are reviewed.  To really review this patchset someone would need to
> apply the pin mux patch, the the 8xx patch set, then this set.
> Reviewing patches against outstanding patches does not scale and should be
> avoided.
> 
> Tom

Not any more :-)

Take a look at 
http://git.denx.de/?p=u-boot/u-boot-ti.git;a=shortlog;h=refs/heads/master

I have tested some other DaVincs SOCs as well after adding these patches and 
they seem to be working fine as of now.

Lets continue the review process for the USB support.

Thanks,
Sandeep

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


Re: [U-Boot] [PATCH V5 2/4] add TI DA8xx support: Add DA8xx cpu functions

2009-11-12 Thread Paulraj, Sandeep


> -Original Message-
> From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
> On Behalf Of Nick Thompson
> Sent: Tuesday, November 10, 2009 10:10 AM
> To: u-boot@lists.denx.de
> Subject: [U-Boot] [PATCH V5 2/4] add TI DA8xx support: Add DA8xx cpu
> functions
> 
> From: Sekhar Nori 
> 
> Provides initial support for TI OMAP-L1x/DA8xx SoC devices.
> See http://www.ti.com
> 
> Provides:
> Low level initialisation.
> System clock API.
> Timer control.
> 
> Signed-off-by: Nick Thompson 
> ---
> Applies to u-boot-ti


Pushed to u-boot-ti/master

http://git.denx.de/?p=u-boot/u-boot-ti.git;a=commit;h=0942803639e8d40aa5dc8d5cd99f9f7ba58c4033

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


Re: [U-Boot] [PATCH 3/3] DA830: Add usb config

2009-11-12 Thread Nick Thompson
On 12/11/09 15:39, Ajay Kumar Gupta wrote:
> Signed-off-by: Ajay Kumar Gupta 
> Signed-off-by: Swaminathan S 
> ---
>  include/configs/da830evm.h |   35 +++
>  1 files changed, 35 insertions(+), 0 deletions(-)
> 
> diff --git a/include/configs/da830evm.h b/include/configs/da830evm.h
> index 38e2ce1..52e6473 100644
> --- a/include/configs/da830evm.h
> +++ b/include/configs/da830evm.h
> @@ -149,6 +149,11 @@
>  #define CONFIG_SYS_ENV_SPI_MAX_HZCONFIG_SF_DEFAULT_SPEED
>  #endif
>  
> +/*==*/
> +/* USB  configuration   */
> +/*==*/

Block comments should be in this format:

/*
 * USB  configuration
 */

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


Re: [U-Boot] [PATCH 2/2] OMAP3:SDRC: introduce DDR types

2009-11-12 Thread Tom
Paulraj, Sandeep wrote:
 Introduce Micron DDR timings and provide
 CONFIG_OMAP3_INFINEON_DDR and CONFIG_OMAP3_MICRON_DDR config
 options to allow for platform files to setup their timings as
 per the type of DDR selected

 Reported-by: Steve Sakoman in

>> http://www.nabble.com/forum/Permalink.jtp?root=25779518&post=25959734&page
 =y

 Signed-off-by: Nishanth Menon 
 ---
  include/asm-arm/arch-omap3/mem.h |   88
>> ++---
 -
  include/configs/devkit8000.h |3 +
  include/configs/omap3_beagle.h   |3 +
  include/configs/omap3_evm.h  |3 +
  include/configs/omap3_overo.h|3 +
  include/configs/omap3_pandora.h  |3 +
  include/configs/omap3_sdp3430.h  |3 +
  include/configs/omap3_zoom1.h|3 +
  include/configs/omap3_zoom2.h|3 +
  9 files changed, 94 insertions(+), 18 deletions(-)

>>> Pushed to u-boot-ti/next
>>>
>>> I think this series from Nishanth needs some runtime tests.
>>> I believe Steve had some issues with his EVM not booting everytime due
>> to issues with DDR init.
>>> Thanks,
>>> Sandeep
>> Maybe it should go on the testing branch?
>>
>> I will give zoom2 a try..
>>
>> Tom
>>
> 
> Tom, Dirk, Steve,
> 
> Did u get a chance to try?
> 
> I am seeing a lot of OMAP3 patches which seem to be touching the above 
> mentioned headers files.
> 
> Thanks,
> Sandeep
> 
> 
> 
For zoom2.
I warm booted the kernel with ti/next.
So it looks ok for zoom2
Tom

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


Re: [U-Boot] [PATCH 2/2] OMAP3:SDRC: introduce DDR types

2009-11-12 Thread Menon, Nishanth
> From: Tom [mailto:tom@windriver.com]
> Sent: Thursday, November 12, 2009 11:30 AM
> 
> Paulraj, Sandeep wrote:
>  Introduce Micron DDR timings and provide
>  CONFIG_OMAP3_INFINEON_DDR and CONFIG_OMAP3_MICRON_DDR config
>  options to allow for platform files to setup their timings as
>  per the type of DDR selected
> 
>  Reported-by: Steve Sakoman in
> 
> >>
> http://www.nabble.com/forum/Permalink.jtp?root=25779518&post=25959734&page
>  =y
> 
>  Signed-off-by: Nishanth Menon 
>  ---
>   include/asm-arm/arch-omap3/mem.h |   88
> >> ++---
>  -
>   include/configs/devkit8000.h |3 +
>   include/configs/omap3_beagle.h   |3 +
>   include/configs/omap3_evm.h  |3 +
>   include/configs/omap3_overo.h|3 +
>   include/configs/omap3_pandora.h  |3 +
>   include/configs/omap3_sdp3430.h  |3 +
>   include/configs/omap3_zoom1.h|3 +
>   include/configs/omap3_zoom2.h|3 +
>   9 files changed, 94 insertions(+), 18 deletions(-)
> 
> >>> Pushed to u-boot-ti/next
> >>>
> >>> I think this series from Nishanth needs some runtime tests.
> >>> I believe Steve had some issues with his EVM not booting everytime due
> >> to issues with DDR init.
> >>> Thanks,
> >>> Sandeep
> >> Maybe it should go on the testing branch?
> >>
> >> I will give zoom2 a try..
> >>
> >> Tom
> >>
> >
> > Tom, Dirk, Steve,
> >
> > Did u get a chance to try?
> >
> > I am seeing a lot of OMAP3 patches which seem to be touching the above
> mentioned headers files.
> >
> For zoom2.
> I warm booted the kernel with ti/next.
> So it looks ok for zoom2
u-boot-ti Ok for SDP3430.

Regards,
Nishanth Menon

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


[U-Boot] [PATCH v2 3/3] MX31: Activate NAND support for i.MX31 Litekit board.

2009-11-12 Thread Magnus Lilja
Signed-off-by: Magnus Lilja 
---
 include/configs/imx31_litekit.h |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/include/configs/imx31_litekit.h b/include/configs/imx31_litekit.h
index 6131008..f413994 100644
--- a/include/configs/imx31_litekit.h
+++ b/include/configs/imx31_litekit.h
@@ -89,6 +89,7 @@
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_SPI
 #define CONFIG_CMD_DATE
+#define CONFIG_CMD_NAND
 
 #define CONFIG_BOOTDELAY   3
 
@@ -174,4 +175,13 @@
 #undef CONFIG_CMD_MTDPARTS
 #define CONFIG_JFFS2_DEV   "nor0"
 
+/*
+ * NAND
+ */
+#define CONFIG_NAND_MXC
+#define CONFIG_MXC_NAND_REGS_BASE  NFC_BASE_ADDR
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+#define CONFIG_SYS_NAND_BASE   NFC_BASE_ADDR
+#define CONFIG_MXC_NAND_HWECC
+
 #endif /* __CONFIG_H */
-- 
1.5.6

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


[U-Boot] [PATCH v2 0/3] MXC: Add NAND support for i.MX31

2009-11-12 Thread Magnus Lilja
Hi all,

This series adds NAND support for i.MX31 using the mxc_nand driver
that was added for i.MX27. The same NAND flash controller is used
in i.MX31.

Tested on i.MX31 Litekit. MAKEALL ARM11&ARM9 performed.

Changes since v1: Changed variable name in mxc_nand.c.

Regards, Magnus



Magnus Lilja (3):
  MX31: Add struct definition for clock control module in i.MX31.
  mxc_nand: Update driver to work with i.MX31.
  MX31: Activate NAND support for i.MX31 Litekit board.

 drivers/mtd/nand/mxc_nand.c   |   34 ++--
 include/asm-arm/arch-mx31/mx31-regs.h |   39 +
 include/configs/imx31_litekit.h   |   10 
 3 files changed, 80 insertions(+), 3 deletions(-)

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


[U-Boot] [PATCH v2 2/3] mxc_nand: Update driver to work with i.MX31.

2009-11-12 Thread Magnus Lilja
Tested on i.MX31 Litekit.

Signed-off-by: Magnus Lilja 
Acked-by: Scott Wood 
---

Change since v1: Renamed sc_regs variable for i.MX31 to cc_regs.

 drivers/mtd/nand/mxc_nand.c |   34 +++---
 1 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index eb0323f..3ce3adb 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -149,6 +149,36 @@ static struct nand_ecclayout nand_soft_eccoob = {
 };
 #endif
 
+#ifdef CONFIG_MX27
+static int is_16bit_nand(void)
+{
+   struct system_control_regs *sc_regs =
+   (struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
+
+   if (readl(&sc_regs->fmcr) & NF_16BIT_SEL)
+   return 1;
+   else
+   return 0;
+}
+#elif defined(CONFIG_MX31)
+static int is_16bit_nand(void)
+{
+   struct clock_control_regs *cc_regs =
+   (struct clock_control_regs *)CCM_BASE;
+
+   if (readl(&cc_regs->rcsr) & CCM_RCSR_NF16B)
+   return 1;
+   else
+   return 0;
+}
+#else
+#warning "8/16 bit NAND autodetection not supported"
+static int is_16bit_nand(void)
+{
+   return 0;
+}
+#endif
+
 static uint32_t *mxc_nand_memcpy32(uint32_t *dest, uint32_t *source, size_t 
size)
 {
uint32_t *d = dest;
@@ -808,8 +838,6 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned 
command,
 
 int board_nand_init(struct nand_chip *this)
 {
-   struct system_control_regs *sc_regs =
-   (struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
struct mtd_info *mtd;
uint16_t tmp;
int err = 0;
@@ -871,7 +899,7 @@ int board_nand_init(struct nand_chip *this)
writew(0x4, &host->regs->nfc_wrprot);
 
/* NAND bus width determines access funtions used by upper layer */
-   if (readl(&sc_regs->fmcr) & NF_16BIT_SEL)
+   if (is_16bit_nand())
this->options |= NAND_BUSWIDTH_16;
 
host->pagesize_2k = 0;
-- 
1.5.6

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


[U-Boot] [PATCH v2 1/3] MX31: Add struct definition for clock control module in i.MX31.

2009-11-12 Thread Magnus Lilja
Signed-off-by: Magnus Lilja 
---
 include/asm-arm/arch-mx31/mx31-regs.h |   39 +
 1 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/include/asm-arm/arch-mx31/mx31-regs.h 
b/include/asm-arm/arch-mx31/mx31-regs.h
index 51b02a2..6f6e9a4 100644
--- a/include/asm-arm/arch-mx31/mx31-regs.h
+++ b/include/asm-arm/arch-mx31/mx31-regs.h
@@ -24,6 +24,45 @@
 #ifndef __ASM_ARCH_MX31_REGS_H
 #define __ASM_ARCH_MX31_REGS_H
 
+#if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
+#include 
+
+/* Clock control module registers */
+struct clock_control_regs {
+   u32 ccmr;
+   u32 pdr0;
+   u32 pdr1;
+   u32 rcsr;
+   u32 mpctl;
+   u32 upctl;
+   u32 spctl;
+   u32 cosr;
+   u32 cgr0;
+   u32 cgr1;
+   u32 cgr2;
+   u32 wimr0;
+   u32 ldc;
+   u32 dcvr0;
+   u32 dcvr1;
+   u32 dcvr2;
+   u32 dcvr3;
+   u32 ltr0;
+   u32 ltr1;
+   u32 ltr2;
+   u32 ltr3;
+   u32 ltbr0;
+   u32 ltbr1;
+   u32 pmcr0;
+   u32 pmcr1;
+   u32 pdr2;
+};
+
+/* Bit definitions for RCSR register in CCM */
+#define CCM_RCSR_NF16B (1 << 31)
+#define CCM_RCSR_NFMS  (1 << 30)
+
+#endif
+
 #define __REG(x) (*((volatile u32 *)(x)))
 #define __REG16(x)   (*((volatile u16 *)(x)))
 #define __REG8(x)(*((volatile u8 *)(x)))
-- 
1.5.6

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


[U-Boot] Loam Program

2009-11-12 Thread ©Nationwide Loan
Dear Customer,

NationWide Loans to help you change the way you live. Arranging a loan with
us is simple and straightforward,loans from £10,000 to £5,000,000 over 5
to 35 years we make the process convenient and fast. Please if interested in
getting a loan from our bank do get back to us as soon as possible for more
information.

Kind Regards,

Mr James Whitehead
Manager Nationwide
Loan Company UK.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Loam Program

2009-11-12 Thread ©Nationwide Loan
Dear Customer,

NationWide Loans to help you change the way you live. Arranging a loan with
us is simple and straightforward,loans from £10,000 to £5,000,000 over 5
to 35 years we make the process convenient and fast. Please if interested in
getting a loan from our bank do get back to us as soon as possible for more
information.

Kind Regards,

Mr James Whitehead
Manager Nationwide
Loan Company UK.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/5] smc911x: use dev->name in printfs

2009-11-12 Thread Mike Frysinger
On Thursday 12 November 2009 04:13:48 Mike Rapoport wrote:
> On Thu, Nov 12, 2009 at 12:50 AM, Mike Frysinger wrote:
> > here's my [compile] tested change as the board i have with this part isnt
> > readily accessible atm ...
> 
> I've tested your changes, MAC register dumps works Ok. I needed to
> make some changes to make it work, see the comments below.
> 
> > --- a/examples/standalone/smc911x_eeprom.c
> > +++ b/examples/standalone/smc911x_eeprom.c
> > @@ -17,8 +17,8 @@
> >  #include 
> >  #include 
> >
> > -#ifdef CONFIG_DRIVER_SMC911X
> > -
> > +/* the smc911x.h gets base addr through eth_device' iobase */
> > +struct eth_device { const char *name; unsigned long iobase; };
> 
> Needed to add 'void *priv' needed for smc911x_detect_chip, otherwise
> it does not compile with the latest U-Boot.

i wrote it against last release which didnt need this.  looking at smc911x.h, 
obviously priv is needed now and shouldnt be a problem adding it.
-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


[U-Boot] [PATCH] smc911x_eeprom: fix building after smc911x overhaul

2009-11-12 Thread Mike Frysinger
When the smc911x driver was converted to NET_MULTI, the smc911x eeprom was
missed.  The config option needed updating as well as overhauling of the
rergister read/write functions.

Signed-off-by: Mike Frysinger 
Tested-by: Mike Rapoport 
---
 examples/standalone/smc911x_eeprom.c |  122 +-
 1 files changed, 62 insertions(+), 60 deletions(-)

diff --git a/examples/standalone/smc911x_eeprom.c 
b/examples/standalone/smc911x_eeprom.c
index bf22f0a..93d273e 100644
--- a/examples/standalone/smc911x_eeprom.c
+++ b/examples/standalone/smc911x_eeprom.c
@@ -2,7 +2,7 @@
  * smc911x_eeprom.c - EEPROM interface to SMC911x parts.
  * Only tested on SMSC9118 though ...
  *
- * Copyright 2004-2008 Analog Devices Inc.
+ * Copyright 2004-2009 Analog Devices Inc.
  *
  * Licensed under the GPL-2 or later.
  *
@@ -17,8 +17,12 @@
 #include 
 #include 
 
-#ifdef CONFIG_DRIVER_SMC911X
-
+/* the smc911x.h gets base addr through eth_device' iobase */
+struct eth_device {
+   const char *name;
+   unsigned long iobase;
+   void *priv;
+};
 #include "../drivers/net/smc911x.h"
 
 /**
@@ -55,32 +59,32 @@ static void usage(void)
  * Registers 0x00 - 0x50 are FIFOs.  The 0x50+ are the control registers
  * and they're all 32bits long.  0xB8+ are reserved, so don't bother.
  */
-static void dump_regs(void)
+static void dump_regs(struct eth_device *dev)
 {
u8 i, j = 0;
for (i = 0x50; i < 0xB8; i += sizeof(u32))
printf("%02x: 0x%08x %c", i,
-   smc911x_reg_read(CONFIG_DRIVER_SMC911X_BASE + i),
+   smc911x_reg_read(dev, i),
(j++ % 2 ? '\n' : ' '));
 }
 
 /**
  * do_eeprom_cmd - handle eeprom communication
  */
-static int do_eeprom_cmd(int cmd, u8 reg)
+static int do_eeprom_cmd(struct eth_device *dev, int cmd, u8 reg)
 {
-   if (smc911x_reg_read(E2P_CMD) & E2P_CMD_EPC_BUSY) {
+   if (smc911x_reg_read(dev, E2P_CMD) & E2P_CMD_EPC_BUSY) {
printf("eeprom_cmd: busy at start (E2P_CMD = 0x%08x)\n",
-   smc911x_reg_read(E2P_CMD));
+   smc911x_reg_read(dev, E2P_CMD));
return -1;
}
 
-   smc911x_reg_write(E2P_CMD, E2P_CMD_EPC_BUSY | cmd | reg);
+   smc911x_reg_write(dev, E2P_CMD, E2P_CMD_EPC_BUSY | cmd | reg);
 
-   while (smc911x_reg_read(E2P_CMD) & E2P_CMD_EPC_BUSY)
+   while (smc911x_reg_read(dev, E2P_CMD) & E2P_CMD_EPC_BUSY)
if (smsc_ctrlc()) {
printf("eeprom_cmd: timeout (E2P_CMD = 0x%08x)\n",
-   smc911x_reg_read(E2P_CMD));
+   smc911x_reg_read(dev, E2P_CMD));
return -1;
}
 
@@ -90,37 +94,37 @@ static int do_eeprom_cmd(int cmd, u8 reg)
 /**
  * read_eeprom_reg - read specified register in EEPROM
  */
-static u8 read_eeprom_reg(u8 reg)
+static u8 read_eeprom_reg(struct eth_device *dev, u8 reg)
 {
-   int ret = do_eeprom_cmd(E2P_CMD_EPC_CMD_READ, reg);
-   return (ret ? : smc911x_reg_read(E2P_DATA));
+   int ret = do_eeprom_cmd(dev, E2P_CMD_EPC_CMD_READ, reg);
+   return (ret ? : smc911x_reg_read(dev, E2P_DATA));
 }
 
 /**
  * write_eeprom_reg - write specified value into specified register in 
EEPROM
  */
-static int write_eeprom_reg(u8 value, u8 reg)
+static int write_eeprom_reg(struct eth_device *dev, u8 value, u8 reg)
 {
int ret;
 
/* enable erasing/writing */
-   ret = do_eeprom_cmd(E2P_CMD_EPC_CMD_EWEN, reg);
+   ret = do_eeprom_cmd(dev, E2P_CMD_EPC_CMD_EWEN, reg);
if (ret)
goto done;
 
/* erase the eeprom reg */
-   ret = do_eeprom_cmd(E2P_CMD_EPC_CMD_ERASE, reg);
+   ret = do_eeprom_cmd(dev, E2P_CMD_EPC_CMD_ERASE, reg);
if (ret)
goto done;
 
/* write the eeprom reg */
-   smc911x_reg_write(E2P_DATA, value);
-   ret = do_eeprom_cmd(E2P_CMD_EPC_CMD_WRITE, reg);
+   smc911x_reg_write(dev, E2P_DATA, value);
+   ret = do_eeprom_cmd(dev, E2P_CMD_EPC_CMD_WRITE, reg);
if (ret)
goto done;
 
/* disable erasing/writing */
-   ret = do_eeprom_cmd(E2P_CMD_EPC_CMD_EWDS, reg);
+   ret = do_eeprom_cmd(dev, E2P_CMD_EPC_CMD_EWDS, reg);
 
  done:
return ret;
@@ -139,7 +143,7 @@ static char *skip_space(char *buf)
 /**
  * write_stuff - handle writing of MAC registers / eeprom
  */
-static void write_stuff(char *line)
+static void write_stuff(struct eth_device *dev, char *line)
 {
char dest;
char *endp;
@@ -182,39 +186,39 @@ static void write_stuff(char *line)
/* Finally, execute the command */
if (dest == 'E') {
printf("Writing EEPROM register %02x with %02x\n", reg, value);
-   write_eeprom_reg(value, reg);
+   write_eeprom_reg(dev, value, reg);
} else {
printf("Writing MAC register %02x with %08x\n", r

Re: [U-Boot] [PATCH 3/3] DA830: Add usb config

2009-11-12 Thread Gupta, Ajay Kumar
> -Original Message-
> From: Nick Thompson [mailto:nick.thomp...@gefanuc.com]
> Sent: Thursday, November 12, 2009 10:25 PM
> To: Gupta, Ajay Kumar
> Cc: u-boot@lists.denx.de; Subbrathnam, Swaminathan
> Subject: Re: [PATCH 3/3] DA830: Add usb config
> 
> On 12/11/09 15:39, Ajay Kumar Gupta wrote:
> > Signed-off-by: Ajay Kumar Gupta 
> > Signed-off-by: Swaminathan S 
> > ---
> >  include/configs/da830evm.h |   35 +++
> >  1 files changed, 35 insertions(+), 0 deletions(-)
> >
> > diff --git a/include/configs/da830evm.h b/include/configs/da830evm.h
> > index 38e2ce1..52e6473 100644
> > --- a/include/configs/da830evm.h
> > +++ b/include/configs/da830evm.h
> > @@ -149,6 +149,11 @@
> >  #define CONFIG_SYS_ENV_SPI_MAX_HZ  CONFIG_SF_DEFAULT_SPEED
> >  #endif
> >
> > +/*==*/
> > +/* USB  configuration   */
> > +/*==*/
> 
> Block comments should be in this format:
> 
> /*
>  * USB  configuration
>  */

Thanks, I will update and post v2.

Regards,
Ajay
> 
> Thanks,
> Nick.

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


[U-Boot] [PATCH v2] smc911x_eeprom: fix building after smc911x overhaul

2009-11-12 Thread Mike Frysinger
When the smc911x driver was converted to NET_MULTI, the smc911x eeprom was
missed.  The config option needed updating as well as overhauling of the
rergister read/write functions.

Signed-off-by: Mike Frysinger 
Tested-by: Mike Rapoport 
---
v2
- fix building under certain gcc versions/compiler flags
(struct init on stack)

 examples/standalone/smc911x_eeprom.c |  122 +-
 1 files changed, 62 insertions(+), 60 deletions(-)

diff --git a/examples/standalone/smc911x_eeprom.c 
b/examples/standalone/smc911x_eeprom.c
index bf22f0a..fff3123 100644
--- a/examples/standalone/smc911x_eeprom.c
+++ b/examples/standalone/smc911x_eeprom.c
@@ -2,7 +2,7 @@
  * smc911x_eeprom.c - EEPROM interface to SMC911x parts.
  * Only tested on SMSC9118 though ...
  *
- * Copyright 2004-2008 Analog Devices Inc.
+ * Copyright 2004-2009 Analog Devices Inc.
  *
  * Licensed under the GPL-2 or later.
  *
@@ -17,8 +17,12 @@
 #include 
 #include 
 
-#ifdef CONFIG_DRIVER_SMC911X
-
+/* the smc911x.h gets base addr through eth_device' iobase */
+struct eth_device {
+   const char *name;
+   unsigned long iobase;
+   void *priv;
+};
 #include "../drivers/net/smc911x.h"
 
 /**
@@ -55,32 +59,32 @@ static void usage(void)
  * Registers 0x00 - 0x50 are FIFOs.  The 0x50+ are the control registers
  * and they're all 32bits long.  0xB8+ are reserved, so don't bother.
  */
-static void dump_regs(void)
+static void dump_regs(struct eth_device *dev)
 {
u8 i, j = 0;
for (i = 0x50; i < 0xB8; i += sizeof(u32))
printf("%02x: 0x%08x %c", i,
-   smc911x_reg_read(CONFIG_DRIVER_SMC911X_BASE + i),
+   smc911x_reg_read(dev, i),
(j++ % 2 ? '\n' : ' '));
 }
 
 /**
  * do_eeprom_cmd - handle eeprom communication
  */
-static int do_eeprom_cmd(int cmd, u8 reg)
+static int do_eeprom_cmd(struct eth_device *dev, int cmd, u8 reg)
 {
-   if (smc911x_reg_read(E2P_CMD) & E2P_CMD_EPC_BUSY) {
+   if (smc911x_reg_read(dev, E2P_CMD) & E2P_CMD_EPC_BUSY) {
printf("eeprom_cmd: busy at start (E2P_CMD = 0x%08x)\n",
-   smc911x_reg_read(E2P_CMD));
+   smc911x_reg_read(dev, E2P_CMD));
return -1;
}
 
-   smc911x_reg_write(E2P_CMD, E2P_CMD_EPC_BUSY | cmd | reg);
+   smc911x_reg_write(dev, E2P_CMD, E2P_CMD_EPC_BUSY | cmd | reg);
 
-   while (smc911x_reg_read(E2P_CMD) & E2P_CMD_EPC_BUSY)
+   while (smc911x_reg_read(dev, E2P_CMD) & E2P_CMD_EPC_BUSY)
if (smsc_ctrlc()) {
printf("eeprom_cmd: timeout (E2P_CMD = 0x%08x)\n",
-   smc911x_reg_read(E2P_CMD));
+   smc911x_reg_read(dev, E2P_CMD));
return -1;
}
 
@@ -90,37 +94,37 @@ static int do_eeprom_cmd(int cmd, u8 reg)
 /**
  * read_eeprom_reg - read specified register in EEPROM
  */
-static u8 read_eeprom_reg(u8 reg)
+static u8 read_eeprom_reg(struct eth_device *dev, u8 reg)
 {
-   int ret = do_eeprom_cmd(E2P_CMD_EPC_CMD_READ, reg);
-   return (ret ? : smc911x_reg_read(E2P_DATA));
+   int ret = do_eeprom_cmd(dev, E2P_CMD_EPC_CMD_READ, reg);
+   return (ret ? : smc911x_reg_read(dev, E2P_DATA));
 }
 
 /**
  * write_eeprom_reg - write specified value into specified register in 
EEPROM
  */
-static int write_eeprom_reg(u8 value, u8 reg)
+static int write_eeprom_reg(struct eth_device *dev, u8 value, u8 reg)
 {
int ret;
 
/* enable erasing/writing */
-   ret = do_eeprom_cmd(E2P_CMD_EPC_CMD_EWEN, reg);
+   ret = do_eeprom_cmd(dev, E2P_CMD_EPC_CMD_EWEN, reg);
if (ret)
goto done;
 
/* erase the eeprom reg */
-   ret = do_eeprom_cmd(E2P_CMD_EPC_CMD_ERASE, reg);
+   ret = do_eeprom_cmd(dev, E2P_CMD_EPC_CMD_ERASE, reg);
if (ret)
goto done;
 
/* write the eeprom reg */
-   smc911x_reg_write(E2P_DATA, value);
-   ret = do_eeprom_cmd(E2P_CMD_EPC_CMD_WRITE, reg);
+   smc911x_reg_write(dev, E2P_DATA, value);
+   ret = do_eeprom_cmd(dev, E2P_CMD_EPC_CMD_WRITE, reg);
if (ret)
goto done;
 
/* disable erasing/writing */
-   ret = do_eeprom_cmd(E2P_CMD_EPC_CMD_EWDS, reg);
+   ret = do_eeprom_cmd(dev, E2P_CMD_EPC_CMD_EWDS, reg);
 
  done:
return ret;
@@ -139,7 +143,7 @@ static char *skip_space(char *buf)
 /**
  * write_stuff - handle writing of MAC registers / eeprom
  */
-static void write_stuff(char *line)
+static void write_stuff(struct eth_device *dev, char *line)
 {
char dest;
char *endp;
@@ -182,39 +186,39 @@ static void write_stuff(char *line)
/* Finally, execute the command */
if (dest == 'E') {
printf("Writing EEPROM register %02x with %02x\n", reg, value);
-   write_eeprom_reg(value, reg);
+   write_eep

Re: [U-Boot] [PATCH] smc911x: make smc911x_initialize return correct value (Was: Re: [PATCH 1/5] smc911x: return -1 when initialization fails)

2009-11-12 Thread Mike Frysinger
On Thursday 12 November 2009 08:35:08 Mike Rapoport wrote:
> Mike Frysinger wrote:
> > On Wednesday 11 November 2009 03:03:00 Mike Rapoport wrote:
> >> --- a/drivers/net/smc911x.c
> >> +++ b/drivers/net/smc911x.c
> >> @@ -243,7 +243,7 @@
> >>dev = malloc(sizeof(*dev));
> >>if (!dev) {
> >>free(dev);
> >> -  return 0;
> >> +  return -1;
> >>}
> >
> > this is correct as this is an error
> >
> >> @@ -252,7 +252,7 @@
> >>/* Try to detect chip. Will fail if not present. */
> >>if (smc911x_detect_chip(dev)) {
> >>free(dev);
> >> -  return 0;
> >> +  return -1;
> >>}
> >
> > this is not -- we want it to return 0 if no parts are found.  see recent
> > net doc updates and discussions.
> 
> Hope this one is better:
> 
> From 4a9420704dd81a08f950017d365e0826880536ed Mon Sep 17 00:00:00 2001
> From: Mike Rapoport 
> Date: Tue, 10 Nov 2009 15:31:46 +0200
> Subject: [PATCH] smc911x: make smc911x_initialize return correct value
> 
> Make smc911x_initialize return -1 on error and number of interfaces
> detected otherwise.

Acked-by: Mike Frysinger 
-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] [PATCH 1/3] DA830: Add pinmux for USB0_DRVVBUS

2009-11-12 Thread Gupta, Ajay Kumar


> -Original Message-
> From: Paulraj, Sandeep
> Sent: Thursday, November 12, 2009 10:00 PM
> To: Tom; Nick Thompson
> Cc: Gupta, Ajay Kumar; u-boot@lists.denx.de; Subbrathnam, Swaminathan
> Subject: RE: [U-Boot] [PATCH 1/3] DA830: Add pinmux for USB0_DRVVBUS
> 
> 
> 
> >
> > Paulraj, Sandeep wrote:
> > >
> > >> Ajay Kumar Gupta wrote:
> > >>> USB0_DRVVBUS pinmux configuration is required for USB functinality
> > >>> in uboot.
> > >>>
> > >>> Signed-off-by: Ajay Kumar Gupta 
> > >>> Signed-off-by: Swaminathan S 
> > >>> ---
> > >>> This patch set is created against Nick Thompson's latest patch set
> > >>> (v5) on DA8xx support and another patch from him on Davinci pinmux.
> > >>> [Davinci: add a pin multiplexer configuration API]
> > >> It is difficult to review code that is dependent on other outstanding
> > >> patches.
> > >>
> > >> The base DA8xx support will be in arm-ti branch shortly.
> > >> Please rebase these patches when this happens and resubmit.
> > >>
> > >> Tom
> > >
> > > I think he might have added it locally and then made his patches.
> > > So he might not have to rebase.
> > >
> > > Without Nick's patches da830evm.c would not even exist :-)
> > >
> > >
> >
> > My issue is not with how development continues, it is with how patches
> > are reviewed.  To really review this patchset someone would need to
> > apply the pin mux patch, the the 8xx patch set, then this set.
> > Reviewing patches against outstanding patches does not scale and should
> be
> > avoided.
> >
> > Tom
> 
> Not any more :-)
> 
> Take a look at http://git.denx.de/?p=u-boot/u-boot-
> ti.git;a=shortlog;h=refs/heads/master
> 
> I have tested some other DaVincs SOCs as well after adding these patches
> and they seem to be working fine as of now.
> 
> Lets continue the review process for the USB support.

I had actually applied all dependent patches and then created the USB patches 
and tested. So it removes the rebase issue.

Regards,
Ajay
> 
> Thanks,
> Sandeep

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


[U-Boot] Pull request - net [for 2009.11]

2009-11-12 Thread Ben Warren
Wolfgang,

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

are available in the git repository at:

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

Mike Frysinger (1):
  smc911x_eeprom: fix building after smc911x overhaul

Mike Rapoport (1):
  smc911x: make smc911x_initialize return correct value

 drivers/net/smc911x.c|4 +-
 examples/standalone/smc911x_eeprom.c |  122 +-
 2 files changed, 64 insertions(+), 62 deletions(-)

regards,
Ben

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


[U-Boot] [PATCH 1/4 v2] DA830: Add pinmux for USB0_DRVVBUS

2009-11-12 Thread Ajay Kumar Gupta
USB0_DRVVBUS pinmux configuration is required for USB functinality
in uboot.

Signed-off-by: Ajay Kumar Gupta 
Signed-off-by: Swaminathan S 
---
Created and tested against latest uboot-ti/master branch.
Changes from v1:
- Added GPIO definitions
- Used GPIO register pointer to program GPIO
- Fixed alignment and tabs
- Used SYSCONFIG pointer to program USB PHY in chipcfg2 register

 board/davinci/da830evm/da830evm.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/board/davinci/da830evm/da830evm.c 
b/board/davinci/da830evm/da830evm.c
index bb8cc3c..7cf6013 100644
--- a/board/davinci/da830evm/da830evm.c
+++ b/board/davinci/da830evm/da830evm.c
@@ -65,6 +65,11 @@ const struct pinmux_config i2c_pins[] = {
{ pinmux[9], 2, 4 }
 };
 
+/* USB0_DRVVBUS pin muxer settings */
+const struct pinmux_config usb_pins[] = {
+   { pinmux[9], 1, 1 }
+};
+
 int board_init(void)
 {
 #ifndef CONFIG_USE_IRQ
@@ -118,6 +123,9 @@ int board_init(void)
if (davinci_configure_pin_mux(i2c_pins, ARRAY_SIZE(i2c_pins)) != 0)
return 1;
 
+   if (davinci_configure_pin_mux(usb_pins, ARRAY_SIZE(usb_pins)) != 0)
+   return 1;
+
/* enable the console UART */
writel((DAVINCI_UART_PWREMU_MGMT_FREE | DAVINCI_UART_PWREMU_MGMT_URRST |
DAVINCI_UART_PWREMU_MGMT_UTRST),
-- 
1.6.2.4

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


[U-Boot] [PATCH 2/4 v2] DA8xx: Add GPIO register definitions

2009-11-12 Thread Ajay Kumar Gupta
Added DA8xx GPIO base addresses in gpio_defs.h and pointers
to different BANKs which can be used to program GPIOs.

Signed-off-by: Ajay Kumar Gupta 
Signed-off-by: Swaminathan S 
---
 include/asm-arm/arch-davinci/gpio_defs.h |   14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/include/asm-arm/arch-davinci/gpio_defs.h 
b/include/asm-arm/arch-davinci/gpio_defs.h
index ff62976..1be2ac2 100644
--- a/include/asm-arm/arch-davinci/gpio_defs.h
+++ b/include/asm-arm/arch-davinci/gpio_defs.h
@@ -22,12 +22,21 @@
 #ifndef _GPIO_DEFS_H_
 #define _GPIO_DEFS_H_
 
+#ifndef CONFIG_SOC_DA8XX
 #define DAVINCI_GPIO_BINTEN0x01C67008
 #define DAVINCI_GPIO_BANK010x01C67010
 #define DAVINCI_GPIO_BANK230x01C67038
 #define DAVINCI_GPIO_BANK450x01C67060
 #define DAVINCI_GPIO_BANK670x01C67088
 
+#else /* CONFIG_SOC_DA8XX */
+#define DAVINCI_GPIO_BINTEN0x01E26008
+#define DAVINCI_GPIO_BANK010x01E26010
+#define DAVINCI_GPIO_BANK230x01E26038
+#define DAVINCI_GPIO_BANK450x01E26060
+#define DAVINCI_GPIO_BANK670x01E26088
+#endif /* CONFIG_SOC_DA8XX */
+
 struct davinci_gpio {
unsigned int dir;
unsigned int out_data;
@@ -49,4 +58,9 @@ struct davinci_gpio_bank {
unsigned long base;
 };
 
+#define davinci_gpio_bank01 ((struct davinci_gpio *)DAVINCI_GPIO_BANK01)
+#define davinci_gpio_bank23 ((struct davinci_gpio *)DAVINCI_GPIO_BANK23)
+#define davinci_gpio_bank45 ((struct davinci_gpio *)DAVINCI_GPIO_BANK45)
+#define davinci_gpio_bank67 ((struct davinci_gpio *)DAVINCI_GPIO_BANK67)
+
 #endif
-- 
1.6.2.4

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


[U-Boot] [PATCH 4/4 v2] DA830: Add usb config

2009-11-12 Thread Ajay Kumar Gupta
Adding USB configuration. Default is set for USB MSC host.

Signed-off-by: Ajay Kumar Gupta 
Signed-off-by: Swaminathan S 
---
 include/configs/da830evm.h |   38 +-
 1 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/include/configs/da830evm.h b/include/configs/da830evm.h
index 38e2ce1..432cd57 100644
--- a/include/configs/da830evm.h
+++ b/include/configs/da830evm.h
@@ -149,6 +149,11 @@
 #define CONFIG_SYS_ENV_SPI_MAX_HZ  CONFIG_SF_DEFAULT_SPEED
 #endif
 
+/*
+ * USB configuration
+ */
+#define CONFIG_USB_DA8XX   /* Platform hookup to MUSB controller */
+#define CONFIG_MUSB_HCD
 
 /*
  * U-Boot general configuration
@@ -234,10 +239,33 @@
 #endif
 
 #ifdef CONFIG_USB_DA8XX
-#define CONFIG_CMD_USB /* include support for usb  */
-#define CONFIG_CMD_STORAGE /* include support for usb  */
-#define CONFIG_CMD_FAT /* include support for FAT/storage*/
-#define CONFIG_DOS_PARTITION   /* include support for FAT/storage*/
-#endif
 
+#ifdef CONFIG_MUSB_HCD /* include support for usb host */
+#define CONFIG_CMD_USB /* include support for usb cmd */
+
+#define CONFIG_USB_STORAGE /* MSC class support */
+#define CONFIG_CMD_STORAGE /* inclue support for usb-storage cmd */
+#define CONFIG_CMD_FAT /* inclue support for FAT/storage */
+#define CONFIG_DOS_PARTITION   /* inclue support for FAT/storage */
+
+#ifdef CONFIG_USB_KEYBOARD /* HID class support */
+#define CONFIG_SYS_USB_EVENT_POLL
+#define CONFIG_PREBOOT "usb start"
+#endif /* CONFIG_USB_KEYBOARD */
+
+#endif /* CONFIG_MUSB_HCD */
+
+#ifdef CONFIG_MUSB_UDC
+/* USB device configuration */
+#define CONFIG_USB_DEVICE  1
+#define CONFIG_USB_TTY 1
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV   1
+/* Change these to suit your needs */
+#define CONFIG_USBD_VENDORID   0x0451
+#define CONFIG_USBD_PRODUCTID  0x5678
+#define CONFIG_USBD_MANUFACTURER   "Texas Instruments"
+#define CONFIG_USBD_PRODUCT_NAME   "DA830EVM"
+#endif /* CONFIG_MUSB_UDC */
+
+#endif /* CONFIG_USB_DA8XX */
 #endif /* __CONFIG_H */
-- 
1.6.2.4

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


[U-Boot] [PATCH 3/4 v2] DA8xx: Add MUSB host support

2009-11-12 Thread Ajay Kumar Gupta
Tested USB host functionality on DA830 EVM.

Signed-off-by: Ajay Kumar Gupta 
Signed-off-by: Swaminathan S 
---
 drivers/usb/musb/Makefile |1 +
 drivers/usb/musb/da8xx.c  |  138 +
 drivers/usb/musb/da8xx.h  |   79 ++
 include/usb.h |3 +-
 4 files changed, 220 insertions(+), 1 deletions(-)
 create mode 100644 drivers/usb/musb/da8xx.c
 create mode 100644 drivers/usb/musb/da8xx.h

diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile
index 09e0a5f..eb4d8fd 100644
--- a/drivers/usb/musb/Makefile
+++ b/drivers/usb/musb/Makefile
@@ -27,6 +27,7 @@ LIB   := $(obj)libusb_musb.a
 
 COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
 COBJS-$(CONFIG_USB_DAVINCI) += davinci.o
+COBJS-$(CONFIG_USB_DA8XX) += da8xx.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
new file mode 100644
index 000..5b02e33
--- /dev/null
+++ b/drivers/usb/musb/da8xx.c
@@ -0,0 +1,138 @@
+/*
+ * da8xx.c - TI's DA8xx platform specific usb wrapper functions.
+ *
+ * Author: Ajay Kumar Gupta 
+ *
+ * Based on drivers/usb/musb/davinci.c
+ *
+ * Copyright (c) 2009 Texas Instruments Incorporated
+ *
+ * This package is free software;  you can redistribute it and/or
+ * modify it under the terms of the license found in the file
+ * named COPYING that should have accompanied this file.
+ *
+ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ */
+#include 
+#include 
+#include 
+
+#include "da8xx.h"
+
+/* MUSB platform configuration */
+struct musb_config musb_cfg = {
+   (struct musb_regs *)DA8XX_USB_OTG_CORE_BASE,
+   DA8XX_USB_OTG_TIMEOUT,
+   0
+};
+
+/*
+ * This function enables VBUS by driving the GPIO Bank4 Pin 15 high.
+ */
+static void enable_vbus(void)
+{
+   u32 value;
+
+   /* configure GPIO bank4 pin 15 in output direction */
+   value = readl(&davinci_gpio_bank45->dir);
+   writel((value & (~DA8XX_USB_VBUS_GPIO)), &davinci_gpio_bank45->dir);
+
+   /* set GPIO bank4 pin 15 high to drive VBUS */
+   value = readl(&davinci_gpio_bank45->set_data);
+   writel((value | DA8XX_USB_VBUS_GPIO), &davinci_gpio_bank45->set_data);
+}
+
+/*
+ * Enable the usb0 phy. This initialization procedure is explained in
+ * the DA8xx USB user guide document.
+ */
+static u8 phy_on(void)
+{
+   u32 timeout;
+   u32 cfgchip2;
+
+   cfgchip2 = readl(&davinci_syscfg_regs->cfgchip2);
+
+   cfgchip2 &= ~(CFGCHIP2_RESET | CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN |
+ CFGCHIP2_OTGMODE | CFGCHIP2_REFFREQ);
+   cfgchip2 |= CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN | CFGCHIP2_PHY_PLLON |
+   CFGCHIP2_REFFREQ_24MHZ;
+
+   writel(cfgchip2, &davinci_syscfg_regs->cfgchip2);
+
+   /* wait until the usb phy pll locks */
+   timeout = musb_cfg.timeout;
+   while (timeout--)
+   if (readl(&davinci_syscfg_regs->cfgchip2) & CFGCHIP2_PHYCLKGD)
+   return 1;
+
+   /* USB phy was not turned on */
+   return 0;
+}
+
+/*
+ * Disable the usb phy
+ */
+static void phy_off(void)
+{
+   u32 cfgchip2;
+
+   /*
+* Power down the on-chip PHY.
+*/
+   cfgchip2 = readl(&davinci_syscfg_regs->cfgchip2);
+   cfgchip2 &= ~CFGCHIP2_PHY_PLLON;
+   cfgchip2 |= CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN;
+   writel(cfgchip2, &davinci_syscfg_regs->cfgchip2);
+}
+
+/*
+ * This function performs DA8xx platform specific initialization for usb0.
+ */
+int musb_platform_init(void)
+{
+   u32  revision;
+
+   /* enable psc for usb2.0 */
+   lpsc_on(33);
+
+   /* enable usb vbus */
+   enable_vbus();
+
+   /* reset the controller */
+   writel(0x1, (DA8XX_USB_OTG_BASE + DA8XX_USB_CTRL_REG));
+   udelay(5000);
+
+   /* start the on-chip usb phy and its pll */
+   if (phy_on() == 0)
+   return -1;
+
+   /* Returns zero if e.g. not clocked */
+   revision = readl(DA8XX_USB_OTG_BASE + DA8XX_USB_VERSION_REG);
+   if (revision == 0)
+   return -1;
+
+   /* Disable all interrupts */
+   writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK |
+   DA8XX_USB_RXINT_MASK),
+   (DA8XX_USB_OTG_BASE + DA8XX_USB_INT_MASK_SET_REG));
+   return 0;
+}
+
+/*
+ * This function performs DA8xx platform specific deinitialization for usb0.
+ */
+void musb_platform_deinit(void)
+{
+   /* Turn of the phy */
+   phy_off();
+
+   /* flush any interrupts */
+   writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK |
+   DA8XX_USB_RXINT_MASK),
+   (DA8XX_USB_OTG_BASE + DA8XX_USB_INT_MASK_CLR_REG));
+   writel(0, (DA8XX_USB_OTG_BASE + DA8XX_USB_EOI_REG));
+}
diff --git a/drivers/usb/musb/da8xx.h 

Re: [U-Boot] [PATCH] S3C6400/SMDK6400: fix stack_setup in start.S

2009-11-12 Thread Minkyu Kang
Dear Seunghyeon Rhee,

2009/11/10 Minkyu Kang :
> Dear Seunghyeon Rhee,
>
> 2009/11/2 "Seunghyeon Rhee (이승현)" :
>> Dear Minkyu Kang,
>>
>> 2009/11/2 Minkyu Kang :
>>> Dear Seunghyeon Rhee
>>>
>>> 2009/10/31 "Seunghyeon Rhee (이승현)" :
 stack_setup is modified to initialize the stack on the correct address in
 DRAM accroding to the typical memory configuration described in
 README and the related CONFIG_* macro definitions. This makes macro
 CONFIG_MEMORY_UPPER_CODE no longer necessry. This was introduced
 and used only by this board for some unclear reason. The definition of
 this macro is removed because it's not referenced elsewhere.

 Signed-off-by: Seunghyeon Rhee 
 ---
  cpu/arm1176/start.S        |    7 +--
  include/configs/smdk6400.h |    2 --
  2 files changed, 1 insertions(+), 8 deletions(-)

 diff --git a/cpu/arm1176/start.S b/cpu/arm1176/start.S
 index cb891df..1ecb3b9 100644
 --- a/cpu/arm1176/start.S
 +++ b/cpu/arm1176/start.S
 @@ -241,16 +241,11 @@ mmu_enable:
  skip_hw_init:
     /* Set up the stack                            */
  stack_setup:
 -#ifdef CONFIG_MEMORY_UPPER_CODE
 -    ldr    sp, =(CONFIG_SYS_UBOOT_BASE + CONFIG_SYS_UBOOT_SIZE - 0xc)
 -#else
 -    ldr    r0, _TEXT_BASE        /* upper 128 KiB: relocated uboot   */
 +    ldr    r0, =CONFIG_SYS_UBOOT_BASE    /* base of copy in
>> DRAM        */
>>>
>>> this change is unnecessary, TEXT_BASE and CONFIG_SYS_UBOOT_BASE must
>> be same.
>>
>> That's true for the body of U-Boot but not for SPL, where TEXT_BASE is
>> defined to be '0'.
>> Please refer to board/samsung/smdk6400/config.mk. On the other hand,
>> CONFIG_SYS_UBOOT_BASE is always dependent on DRAM's base.
>> In SPL, the base of the code should be '0' (the steppingstone memory)
>> and then the stack
>> is located below '0' - not a valid area. If SPL itself requires no
>> stack, it should be no
>> problem. But start.S calls nand_boot function right after the stack is
>> badly set up in the air.
>>
>> My test results are like the following:
>> with CONFIG_MEMORY_UPPER_CODE defined : OK
>> with CONFIG_MEMORY_UPPER_CODE undefined :
>>  - SPL bypassed (U-Boot downloaded to DRAM directly by USB monitor
>> program) : OK
>>  - through SPL : Not OK (seems to fail for SPL downloading the code to DRAM)
>>
>> I think CONFIG_MEMORY_UPPER_CODE was tested for the case it's defined
>> but not
>> enough for the case it's not defined. Would you check it again?
>>
>>> btw, is there need CONFIG_SYS_UBOOT_BASE define?
>>>
>>
>> If you are not sure, why did you use CONFIG_SYS_UBOOT_BASE for the
>> case CONFIG_MEMORY_UPPER_CODE is defined while you use TEXT_BASE
>> otherwise? I think the unnecessary macro definition here is not
>> CONFIG_..._BASE but
>> CONFIG_..._CODE. TEXT_BASE and CONFIG_..._BASE have their own meanings and
>> so both are necessary.
>>
>> Best regards,
>> Seunghyeon
>>
>>
     sub    r0, r0, #CONFIG_SYS_MALLOC_LEN    /* malloc
 area                      */
     sub    r0, r0, #CONFIG_SYS_GBL_DATA_SIZE /*
 bdinfo                        */
     sub    sp, r0, #12        /* leave 3 words for abort-stack    */

 -#endif
 -
  clear_bss:
     ldr    r0, _bss_start        /* find start of bss segment        */
     ldr    r1, _bss_end        /* stop here                        */
 diff --git a/include/configs/smdk6400.h b/include/configs/smdk6400.h
 index f6e1221..f644cd2 100644
 --- a/include/configs/smdk6400.h
 +++ b/include/configs/smdk6400.h
 @@ -49,8 +49,6 @@
  #define CONFIG_ENABLE_MMU
  #endif

 -#define CONFIG_MEMORY_UPPER_CODE
 -
  #define CONFIG_SETUP_MEMORY_TAGS
  #define CONFIG_CMDLINE_TAG
  #define CONFIG_INITRD_TAG
 --
 1.6.2.5


 --
 Seunghyeon Rhee, Ph.D. / Director
 LPM Technology Inc.
 T +82-70-8255-6007  F +82-2-6442-6462
 M +82-10-2790-0657
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot

>>>
>>> Thanks for patch :)
>>> Minkyu Kang
>>> --
>>> from. prom.
>>> www.promsoft.net
>>> ___
>>> U-Boot mailing list
>>> U-Boot@lists.denx.de
>>> http://lists.denx.de/mailman/listinfo/u-boot
>>>
>>
>>
>> --
>> Seunghyeon Rhee, Ph.D. / Director
>> LPM Technology Inc.
>> T +82-70-8255-6007  F +82-2-6442-6462
>> M +82-10-2790-0657
>> ___
>> U-Boot mailing list
>> U-Boot@lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
>>
>
> Tested on the NCP board (s3c6410), and It works fine.
> I'll wait few days more for this patch's review.
> Thanks!
>
> Tested-by: Minkyu Kang 
>
> Minkyu Kang
> --
> from. prom.
> www.promsoft.net
>

your patch is line wrapped and the tabs are stripped out.
please resend the patch

Thanks
Minkyu Kang
-- 
from. prom.
www.

Re: [U-Boot] s5pc1xx: serial: fix the error check logic

2009-11-12 Thread Minkyu Kang
2009/11/10 Minkyu Kang :
> Because of Frame error, Parity error and Overrun error are occured only 
> receive
> operation, need to masking when error checking.
>
> Signed-off-by: Minkyu Kang 
> ---
>  drivers/serial/serial_s5pc1xx.c |   24 +---
>  1 files changed, 17 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/serial/serial_s5pc1xx.c b/drivers/serial/serial_s5pc1xx.c
> index 68c06a9..e06234d 100644
> --- a/drivers/serial/serial_s5pc1xx.c
> +++ b/drivers/serial/serial_s5pc1xx.c
> @@ -98,14 +98,24 @@ int serial_init_dev(const int dev_index)
>        return 0;
>  }
>
> -static int serial_err_check(const int dev_index)
> +static int serial_err_check(const int dev_index, int op)
>  {
>        struct s5pc1xx_uart *const uart = s5pc1xx_get_base_uart(dev_index);
> +       unsigned int mask;
> +
> +       /*
> +        * UERSTAT
> +        * Break Detect [3]
> +        * Frame Err    [2] : receive operation
> +        * Parity Err   [1] : receive operation
> +        * Overrun Err  [0] : receive operation
> +        */
> +       if (op)
> +               mask = 0x8;
> +       else
> +               mask = 0xf;
>
> -       if (readl(&uart->uerstat) & 0xf)
> -               return 1;
> -
> -       return 0;
> +       return readl(&uart->uerstat) & mask;
>  }
>
>  /*
> @@ -119,7 +129,7 @@ int serial_getc_dev(const int dev_index)
>
>        /* wait for character to arrive */
>        while (!(readl(&uart->utrstat) & 0x1)) {
> -               if (serial_err_check(dev_index))
> +               if (serial_err_check(dev_index, 0))
>                        return 0;
>        }
>
> @@ -135,7 +145,7 @@ void serial_putc_dev(const char c, const int dev_index)
>
>        /* wait for room in the tx FIFO */
>        while (!(readl(&uart->utrstat) & 0x2)) {
> -               if (serial_err_check(dev_index))
> +               if (serial_err_check(dev_index, 1))
>                        return;
>        }
>
> --
> 1.5.4.3
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>

applied to u-boot-samsung

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


Re: [U-Boot] [PATCH ARM] Add a unified s3c24x0 header file

2009-11-12 Thread Minkyu Kang
Dear Kevin Morfitt

2009/11/10 kevin.morf...@fearnside-systems.co.uk
:
> This patch adds a unified s3c24x0 cpu header file that selects the header
> file for the specific s3c24x0 cpu from the SOC and CPU configs defined in
> board config file. This removes the current chain of s3c24-type #ifdef's
> from the s3c24x0 code.
>
> Signed-off-by: Kevin Morfitt 
> ---
>  board/mpl/vcma9/vcma9.c                    |    2 +-
>  board/mpl/vcma9/vcma9.h                    |    2 +-
>  board/samsung/smdk2400/smdk2400.c          |    2 +-
>  board/samsung/smdk2410/smdk2410.c          |    2 +-
>  board/sbc2410x/sbc2410x.c                  |    2 +-
>  board/trab/cmd_trab.c                      |    2 +-
>  board/trab/rs485.c                         |    2 +-
>  board/trab/rs485.h                         |    2 +-
>  board/trab/trab.c                          |    2 +-
>  board/trab/trab_fkt.c                      |    2 +-
>  board/trab/tsc2000.c                       |    2 +-
>  board/trab/vfd.c                           |    2 +-
>  cpu/arm920t/s3c24x0/interrupts.c           |    6 +-
>  cpu/arm920t/s3c24x0/speed.c                |   13 +++--
>  cpu/arm920t/s3c24x0/timer.c                |   15 +++
>  cpu/arm920t/s3c24x0/usb.c                  |   17 +++--
>  cpu/arm920t/s3c24x0/usb_ohci.c             |   11 +++
>  cpu/arm920t/start.S                        |    4 ++--
>  drivers/i2c/s3c24x0_i2c.c                  |    6 +-
>  drivers/mtd/nand/s3c2410_nand.c            |    2 +-
>  drivers/rtc/s3c24x0_rtc.c                  |    6 +-
>  drivers/serial/serial_s3c24x0.c            |    6 +-
>  drivers/usb/host/ohci-hcd.c                |    3 +--
>  include/asm-arm/arch-s3c24x0/s3c24x0_cpu.h |   27 +++
>  include/common.h                           |    5 +++--
>  include/configs/VCMA9.h                    |    7 ---
>  include/configs/sbc2410x.h                 |    7 ---
>  include/configs/smdk2400.h                 |    7 ---
>  include/configs/smdk2410.h                 |    7 ---
>  include/configs/trab.h                     |    9 +
>  30 files changed, 87 insertions(+), 95 deletions(-)
>  create mode 100644 include/asm-arm/arch-s3c24x0/s3c24x0_cpu.h
>
> diff --git a/board/mpl/vcma9/vcma9.c b/board/mpl/vcma9/vcma9.c
> index f3bd288..1835677 100644
> --- a/board/mpl/vcma9/vcma9.c
> +++ b/board/mpl/vcma9/vcma9.c
> @@ -27,7 +27,7 @@
>
>  #include 
>  #include 
> -#include 
> +#include 
>  #include 
>  #include 
>
> diff --git a/board/mpl/vcma9/vcma9.h b/board/mpl/vcma9/vcma9.h
> index 2c4305c..94fd2fa 100644
> --- a/board/mpl/vcma9/vcma9.h
> +++ b/board/mpl/vcma9/vcma9.h
> @@ -25,7 +25,7 @@
>  * Global routines used for VCMA9
>  */
>
> -#include 
> +#include 
>
>  extern int  mem_test(unsigned long start, unsigned long ramsize,int mode);
>
> diff --git a/board/samsung/smdk2400/smdk2400.c 
> b/board/samsung/smdk2400/smdk2400.c
> index be0c70a..1294d3f 100644
> --- a/board/samsung/smdk2400/smdk2400.c
> +++ b/board/samsung/smdk2400/smdk2400.c
> @@ -27,7 +27,7 @@
>
>  #include 
>  #include 
> -#include 
> +#include 
>
>  DECLARE_GLOBAL_DATA_PTR;
>
> diff --git a/board/samsung/smdk2410/smdk2410.c 
> b/board/samsung/smdk2410/smdk2410.c
> index a8cf287..5d1a8bb 100644
> --- a/board/samsung/smdk2410/smdk2410.c
> +++ b/board/samsung/smdk2410/smdk2410.c
> @@ -27,7 +27,7 @@
>
>  #include 
>  #include 
> -#include 
> +#include 
>
>  DECLARE_GLOBAL_DATA_PTR;
>
> diff --git a/board/sbc2410x/sbc2410x.c b/board/sbc2410x/sbc2410x.c
> index 6768c02..3a93677 100644
> --- a/board/sbc2410x/sbc2410x.c
> +++ b/board/sbc2410x/sbc2410x.c
> @@ -30,7 +30,7 @@
>
>  #include 
>  #include 
> -#include 
> +#include 
>
>  #if defined(CONFIG_CMD_NAND)
>  #include 
> diff --git a/board/trab/cmd_trab.c b/board/trab/cmd_trab.c
> index a01ffcc..472d7d8 100644
> --- a/board/trab/cmd_trab.c
> +++ b/board/trab/cmd_trab.c
> @@ -25,7 +25,7 @@
>
>  #include 
>  #include 
> -#include 
> +#include 
>  #include 
>
>  /*
> diff --git a/board/trab/rs485.c b/board/trab/rs485.c
> index f402c59..ad0c136 100644
> --- a/board/trab/rs485.c
> +++ b/board/trab/rs485.c
> @@ -22,7 +22,7 @@
>  */
>
>  #include 
> -#include 
> +#include 
>  #include "rs485.h"
>
>  static void rs485_setbrg (void);
> diff --git a/board/trab/rs485.h b/board/trab/rs485.h
> index 4a2d83f..16d69bb 100644
> --- a/board/trab/rs485.h
> +++ b/board/trab/rs485.h
> @@ -24,7 +24,7 @@
>  #ifndef _RS485_H_
>  #define _RS485_H_
>
> -#include 
> +#include 
>
>  int rs485_init (void);
>  int rs485_getc (void);
> diff --git a/board/trab/trab.c b/board/trab/trab.c
> index f8836ff..71fd22c 100644
> --- a/board/trab/trab.c
> +++ b/board/trab/trab.c
> @@ -26,7 +26,7 @@
>  #include 
>  #include 
>  #include 
> -#include 
> +#include 
>  #include 
>
>  DECLARE_GLOBAL_DATA_PTR;
> diff --git a/board/trab/trab_fkt.c b/board/trab/trab_fkt.c
> i

Re: [U-Boot] [PATCH] S3C6400/SMDK6400: fix stack_setup in start.S

2009-11-12 Thread 이승현
Fix stack_setup to place the stack on the correct address in DRAM
accroding to U-Boot standard and remove conditional compilation by
CONFIG_MEMORY_UPPER_CODE macro that is not necessry. This macro
was introduced and used only by this board for some unclear reason.

The definition of this macro is also removed because it's not
referenced elsewhere.

Signed-off-by: Seunghyeon Rhee 
---
 cpu/arm1176/start.S|7 +--
 include/configs/smdk6400.h |2 --
 2 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/cpu/arm1176/start.S b/cpu/arm1176/start.S
index cb891df..1ecb3b9 100644
--- a/cpu/arm1176/start.S
+++ b/cpu/arm1176/start.S
@@ -241,16 +241,11 @@ mmu_enable:
 skip_hw_init:
/* Set up the stack */
 stack_setup:
-#ifdef CONFIG_MEMORY_UPPER_CODE
-   ldr sp, =(CONFIG_SYS_UBOOT_BASE + CONFIG_SYS_UBOOT_SIZE - 0xc)
-#else
-   ldr r0, _TEXT_BASE  /* upper 128 KiB: relocated uboot   */
+   ldr r0, =CONFIG_SYS_UBOOT_BASE  /* base of copy in DRAM */
sub r0, r0, #CONFIG_SYS_MALLOC_LEN  /* malloc area  
*/
sub r0, r0, #CONFIG_SYS_GBL_DATA_SIZE /* bdinfo 
   */
sub sp, r0, #12 /* leave 3 words for abort-stack*/

-#endif
-
 clear_bss:
ldr r0, _bss_start  /* find start of bss segment*/
ldr r1, _bss_end/* stop here*/
diff --git a/include/configs/smdk6400.h b/include/configs/smdk6400.h
index f6e1221..f644cd2 100644
--- a/include/configs/smdk6400.h
+++ b/include/configs/smdk6400.h
@@ -49,8 +49,6 @@
 #define CONFIG_ENABLE_MMU
 #endif

-#define CONFIG_MEMORY_UPPER_CODE
-
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_CMDLINE_TAG
 #define CONFIG_INITRD_TAG
-- 
1.6.2.5
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot