Re: [U-Boot] Best way of making some drivers common across kirkwood and orion5x SoCs?

2009-10-31 Thread Prafulla Wadaskar
Copying Tom
I will replay latter

Regards..
Prafulla . .

> -Original Message-
> From: Albert ARIBAUD [mailto:albert.arib...@free.fr] 
> Sent: Saturday, October 31, 2009 2:42 PM
> To: u-boot@lists.denx.de
> Cc: Jean-Christophe PLAGNIOL-VILLARD; Prafulla Wadaskar
> Subject: Best way of making some drivers common across 
> kirkwood and orion5x SoCs?
> 
> Hi,
> 
> I am working on adding mainline support for Orion5x family of Marvell 
> SoCs in U-boot, based on the Kirkwood support already present.
> 
> I believe these are different enough families to justify adding an 
> 'orion5x' SoC along the existing 'kirkwood' one.
> 
> Several kirkwood drivers could actually be reused almost as-is and 
> should thus be shared between both SoC families. For instance, 
> kirkwood_egiga.c and ehci-kirkwood.c would only differ by the 
> number of 
> ports and kirkwood_i2c.c could be reused as-is.
> 
> However, these drivers have hard-coded numbers of ports, and 'hard' 
> references to 'kirkwood.h' for their register definitions. 
> Making them 
> cross-SoC would require moving the numbers of ports to some 
> SoC-specific 
> header file, and that this header file *not* be named after a 
> specific SoC.
> 
> I've searched for a layer between CPU and Core where cross-SoC code 
> could fit, but I haven't seen one, and I don't think one 
> would be needed.
> 
> Instead, I have thought of replacing the #include "kirkwood.h" with a 
> #include "soc.h", where soc.h would exist in both SoC's header files 
> include/asm-arm/arch-kirkwood and include/asm-arm/arch-orion5x. This 
> soc.h file would either include the specific soc header file 
> (kirkwood.h 
> or orion5x.h) or, better yet, be a symlink to it, or better again, 
> replace it.
> 
> This could be done in a two-step approach, each step being one commit.
> 
> 1) introduce "soc.h" by:
> 
> - 1a) renaming, symlinking or including kirkwood.h into soc.h and 
> changing kirkwood drivers that #include "kirkwood.h" accordingly;
> 
> - 1b) turning all kirkwood-specific namings in these kirkwood drivers 
> into marvell-non-soc-specific ones (remove "KW_" prefixes and such).
> 
> (steps 1a and 1b are independent)
> 
> 2) add orion5x support with its own "soc.h" file.
> 
> Would this approach be clean enough to be considered for inclusion in 
> mainline?
> 
> Amicalement,
> -- 
> Albert.
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 09/10] OMAP3 USB Initialize twl4030 only if required

2009-10-31 Thread Tom
Mike Frysinger wrote:
> On Saturday 31 October 2009 13:37:46 Tom Rix wrote:
>> OMAP3EVM uses ISP1504 phy and so twl4030 related init is not required.
>>
>> --- a/drivers/usb/musb/omap3.c
>> +++ b/drivers/usb/musb/omap3.c
>> @@ -94,12 +94,17 @@ int musb_platform_init(void)
>>  if (platform_needs_initialization) {
>>  u32 stdby;
>>
>> +/*
>> + * OMAP3EVM uses ISP1504 phy and so
>> + * twl4030 related init is not required.
>> + */
>> +#ifdef CONFIG_TWL4030_USB
>>  if (twl4030_usb_ulpi_init()) {
>>  serial_printf("ERROR: %s Could not initialize PHY\n",
>>  __PRETTY_FUNCTION__);
>>  goto end;
>>  }
>> -
>> +#endif
> 
> shouldnt this be abstracted away (weaks/phy-common name/etc...) instead of 
> sprinkling ifdef's everywhere ?
> -mike

I do not think this change has spinkled if-defs' everywhere

As far as I know only the omap3_evm does not use a twl4030.
There is no sense making this more complicated than an if-def.

Tom

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


Re: [U-Boot] [PATCH 08/10] OMAP3 zoom2 Use usbtty if the debug board is not connected.

2009-10-31 Thread Tom
Mike Frysinger wrote:
> On Saturday 31 October 2009 13:37:45 Tom Rix wrote:
>> +} else {
>> +usbtty_putc(c);
>>  }
> 
> dont need those braces (same goes for a few other hunks here)
> -mike
This is done because if-statement above use braces.
If this was a simple
if (foo)
smt_1
else
smt_2

I would have not use braces.

Tom

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


Re: [U-Boot] [PATCH 02/10] USB add macros for debugging usb device setup.

2009-10-31 Thread Tom
Mike Frysinger wrote:
> On Saturday 31 October 2009 13:37:39 Tom Rix wrote:
>> +#ifdef DEBUG
>> +static inline void print_device_descriptor(struct usb_device_descriptor
>>  *d) +{
>> +serial_printf("usb device descriptor \n");
> 
> do you really need serial_printf() ?  what's wrong with debug() ?  then you 
> dont even really need "#ifdef DEBUG" around all the functions ...
> -mike

The explicit serial_printf is done because this patch set changes the
stdin and stdout for serial to usbtty.

When you use printf to debug printf, you regress into a bad state.

Tom

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


[U-Boot] [PATCH] Add I2C multibus support for OMAP2/3 boards

2009-10-31 Thread Tom Rix
From: Syed Mohammed Khasim 

This was cherry-picked from

repo: http://www.beagleboard.org/u-boot-arm.git
commit: 52eddcd07c2e7ad61d15bab2cf2d0d21466eaca2

In addition to adding multibus support, this patch
also cleans up the register access.  The register
access has been changed from #defines to a structure.

Signed-off-by: Syed Mohammed Khasim 
Signed-off-by: Jason Kridner 
Signed-off-by: Tom Rix 
---
 drivers/i2c/omap24xx_i2c.c  |  220 ++-
 include/asm-arm/arch-omap24xx/i2c.h |   52 ++---
 include/asm-arm/arch-omap3/i2c.h|   48 +---
 include/configs/omap3_beagle.h  |1 +
 4 files changed, 209 insertions(+), 112 deletions(-)

diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c
index 1a4c8c9..763d2f8 100644
--- a/drivers/i2c/omap24xx_i2c.c
+++ b/drivers/i2c/omap24xx_i2c.c
@@ -1,7 +1,7 @@
 /*
  * Basic I2C functions
  *
- * Copyright (c) 2004 Texas Instruments
+ * Copyright (c) 2004, 2009 Texas Instruments
  *
  * This package is free software;  you can redistribute it and/or
  * modify it under the terms of the license found in the file
@@ -25,10 +25,18 @@
 #include 
 #include 
 
+#ifdef CONFIG_OMAP34XX
+#define I2C_NUM_IF 3
+#else
+#define I2C_NUM_IF 2
+#endif
+
 static void wait_for_bb (void);
 static u16 wait_for_pin (void);
 static void flush_fifo(void);
 
+static i2c_t *i2c = (i2c_t *)I2C_DEFAULT_BASE;
+
 void i2c_init (int speed, int slaveadd)
 {
int psc, fsscll, fssclh;
@@ -95,30 +103,30 @@ void i2c_init (int speed, int slaveadd)
sclh = (unsigned int)fssclh;
}
 
-   writew(0x2, I2C_SYSC); /* for ES2 after soft reset */
+   writew(0x2, &i2c->sysc);/* for ES2 after soft reset */
udelay(1000);
-   writew(0x0, I2C_SYSC); /* will probably self clear but */
+   writew(0x0, &i2c->sysc);/* will probably self clear but 
*/
 
-   if (readw (I2C_CON) & I2C_CON_EN) {
-   writew (0, I2C_CON);
-   udelay (5);
+   if (readw(&i2c->con) & I2C_CON_EN) {
+   writew(0, &i2c->con);
+   udelay(5);
}
 
-   writew(psc, I2C_PSC);
-   writew(scll, I2C_SCLL);
-   writew(sclh, I2C_SCLH);
+   writew(psc, &i2c->psc);
+   writew(scll, &i2c->scll);
+   writew(sclh, &i2c->sclh);
 
/* own address */
-   writew (slaveadd, I2C_OA);
-   writew (I2C_CON_EN, I2C_CON);
+   writew(slaveadd, &i2c->oa);
+   writew(I2C_CON_EN, &i2c->con);
 
/* have to enable intrrupts or OMAP i2c module doesn't work */
-   writew (I2C_IE_XRDY_IE | I2C_IE_RRDY_IE | I2C_IE_ARDY_IE |
-   I2C_IE_NACK_IE | I2C_IE_AL_IE, I2C_IE);
-   udelay (1000);
+   writew(I2C_IE_XRDY_IE | I2C_IE_RRDY_IE | I2C_IE_ARDY_IE |
+   I2C_IE_NACK_IE | I2C_IE_AL_IE, &i2c->ie);
+   udelay(1000);
flush_fifo();
-   writew (0x, I2C_STAT);
-   writew (0, I2C_CNT);
+   writew(0x, &i2c->stat);
+   writew(0, &i2c->cnt);
 }
 
 static int i2c_read_byte (u8 devaddr, u8 regoffset, u8 * value)
@@ -130,19 +138,19 @@ static int i2c_read_byte (u8 devaddr, u8 regoffset, u8 * 
value)
wait_for_bb ();
 
/* one byte only */
-   writew (1, I2C_CNT);
+   writew(1, &i2c->cnt);
/* set slave address */
-   writew (devaddr, I2C_SA);
+   writew(devaddr, &i2c->sa);
/* no stop bit needed here */
-   writew (I2C_CON_EN | I2C_CON_MST | I2C_CON_STT | I2C_CON_TRX, I2C_CON);
+   writew(I2C_CON_EN | I2C_CON_MST | I2C_CON_STT | I2C_CON_TRX, &i2c->con);
 
status = wait_for_pin ();
 
if (status & I2C_STAT_XRDY) {
/* Important: have to use byte access */
-   writeb (regoffset, I2C_DATA);
-   udelay (2);
-   if (readw (I2C_STAT) & I2C_STAT_NACK) {
+   writeb(regoffset, &i2c->data);
+   udelay(2);
+   if (readw(&i2c->stat) & I2C_STAT_NACK) {
i2c_error = 1;
}
} else {
@@ -151,28 +159,28 @@ static int i2c_read_byte (u8 devaddr, u8 regoffset, u8 * 
value)
 
if (!i2c_error) {
/* free bus, otherwise we can't use a combined transction */
-   writew (0, I2C_CON);
-   while (readw (I2C_STAT) || (readw (I2C_CON) & I2C_CON_MST)) {
+   writew(0, &i2c->con);
+   while (readw(&i2c->stat) || (readw(&i2c->con) & I2C_CON_MST)) {
udelay (1);
/* Have to clear pending interrupt to clear I2C_STAT */
-   writew (0x, I2C_STAT);
+   writew(0x, &i2c->stat);
}
 
wait_for_bb ();
/* set slave address */
-   writew (devaddr, I2C_SA);
+   writew(devaddr, &i2c->sa);
/* read one byte from slave */
-   writew (1, I2C_CNT);

[U-Boot] Better I2C support for OMAP

2009-10-31 Thread Tom Rix

> 
> Hugo Vincent wrote:
> > Hi everyone,
> > 
> > This patch improves I2C support on OMAP3 platforms, including  
> > supporting the second and third I2C controllers (mainline only  
> > supports the first controller), and supporting writes where alen=0  
> > (i.e. no register address - this was needed for some I2C devices I  
> > needed to drive from u-boot).
> > 
> > Tested on Gumstix Overo with several I2C devices, on I2C1 and 3.
> > 
> > The multi-bus support is mostly from this patch:
> > http://www.beagleboard.org/gitweb/?p=u-boot-arm.git;a=commit;h=52eddcd07c2e7ad61d15bab2cf2d0d21466eaca2
> > 
> > Best regards,
> > Hugo Vincent
> > 
> > Signed-off-by: Hugo Vincent 
>
> Does anybody have an up to date version of this patch? Seems we need 
> it for Beagle Zippy, too.
> 
> Thanks
> 
> Dirk

I have cherry picked this change from the above git repo. 

There was some cleanup. 

The omap24xx version changes were done.

The structure elements were changed from unsigned int to 
unsigned shorts + pads to make the elements consistent with
the writew/readw 's used in the driver. 

The cmd_i2c changes that did not seem to fit were removed.

I have run tested this on beagle and zoom1.

Since I don't have a zippy board handy I did not get anything
meaningfull when switching to i2c dev 2.  The default i2c dev
worked as expected.

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


Re: [U-Boot] Best way of making some drivers common across kirkwood and orion5x SoCs?

2009-10-31 Thread Albert ARIBAUD
Wolfgang Denk a écrit :
> Dear Albert ARIBAUD,
> 
> In message <4aec53db.6050...@free.fr> you wrote:
>> Would a name such as "marvell.h" be more acceptable? This would be
> 
> Hm... I expect there will be little chance to see MAarvell IP blocks
> in non-Marvell SoCs, so this should work indeed. On the other hand,
> why not chose a name that works for other CPUs / SoCs as well. [So on
> second thought maybe your "soc.h" was not that bad a name.]
> 
> Let's see what others suggest.

While we wait for others' opinion, one quick question: do you prefer me
to submit this rework of the Marvell IP/drivers as individual patches,
one for each IP/driver, or as a single patch for the whole rework?

Amicalement,
-- 
Albert.

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


Re: [U-Boot] [PATCH] mkconfig: deny messed up ARCH definition

2009-10-31 Thread Menon, Nishanth
> -Original Message-
> From: Mike Frysinger [mailto:vap...@gentoo.org]
> Sent: Saturday, October 31, 2009 11:41 PM
> To: u-boot@lists.denx.de
> Cc: Menon, Nishanth; Gadiyar, Anand
> Subject: Re: [U-Boot] [PATCH] mkconfig: deny messed up ARCH definition
> 
> On Saturday 31 October 2009 10:12:01 Nishanth Menon wrote:
> > Refuse to setup a platform if the command
> > line ARCH= is not the same as the one
> > required for the board. This prevents
> > any user with prehistoric aliases from
> > messing up thier builds
> 
> seems like excessive line wrapping
Ok.. will stick with 70 chars..

> 
> > +if [ ! -z "$ARCH" -a "$ARCH" != "$2" ]; then
> 
> is the !-z really needed ?
We don't want the check to trigger if ARCH is not defined.
[ "$ARCH" != "$2" ] will trigger as "" != "arm"

> 
> > +   echo "ARCH=$ARCH while ${BOARD_NAME} arch=$2: fail"
> 
> should be sent to stderr: 1>&2
Ack.

Regards,
Nishanth Menon

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


Re: [U-Boot] [PATCH 09/10] OMAP3 USB Initialize twl4030 only if required

2009-10-31 Thread Mike Frysinger
On Saturday 31 October 2009 13:37:46 Tom Rix wrote:
> OMAP3EVM uses ISP1504 phy and so twl4030 related init is not required.
> 
> --- a/drivers/usb/musb/omap3.c
> +++ b/drivers/usb/musb/omap3.c
> @@ -94,12 +94,17 @@ int musb_platform_init(void)
>   if (platform_needs_initialization) {
>   u32 stdby;
> 
> + /*
> +  * OMAP3EVM uses ISP1504 phy and so
> +  * twl4030 related init is not required.
> +  */
> +#ifdef CONFIG_TWL4030_USB
>   if (twl4030_usb_ulpi_init()) {
>   serial_printf("ERROR: %s Could not initialize PHY\n",
>   __PRETTY_FUNCTION__);
>   goto end;
>   }
> -
> +#endif

shouldnt this be abstracted away (weaks/phy-common name/etc...) instead of 
sprinkling ifdef's everywhere ?
-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 08/10] OMAP3 zoom2 Use usbtty if the debug board is not connected.

2009-10-31 Thread Mike Frysinger
On Saturday 31 October 2009 13:37:45 Tom Rix wrote:
> + } else {
> + usbtty_putc(c);
>   }

dont need those braces (same goes for a few other hunks here)
-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 02/10] USB add macros for debugging usb device setup.

2009-10-31 Thread Mike Frysinger
On Saturday 31 October 2009 13:37:39 Tom Rix wrote:
> +#ifdef DEBUG
> +static inline void print_device_descriptor(struct usb_device_descriptor
>  *d) +{
> + serial_printf("usb device descriptor \n");

do you really need serial_printf() ?  what's wrong with debug() ?  then you 
dont even really need "#ifdef DEBUG" around all the functions ...
-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] mkconfig: deny messed up ARCH definition

2009-10-31 Thread Mike Frysinger
On Saturday 31 October 2009 10:12:01 Nishanth Menon wrote:
> Refuse to setup a platform if the command
> line ARCH= is not the same as the one
> required for the board. This prevents
> any user with prehistoric aliases from
> messing up thier builds

seems like excessive line wrapping

> +if [ ! -z "$ARCH" -a "$ARCH" != "$2" ]; then

is the !-z really needed ?

> + echo "ARCH=$ARCH while ${BOARD_NAME} arch=$2: fail"

should be sent to stderr: 1>&2
-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/RFC] Better I2C support for OMAP3

2009-10-31 Thread Dirk Behme

Tom Rix wrote:

Dirk Behme wrote:

Hugo Vincent wrote:

Hi everyone,

This patch improves I2C support on OMAP3 platforms, including  
supporting the second and third I2C controllers (mainline only  
supports the first controller), and supporting writes where alen=0  
(i.e. no register address - this was needed for some I2C devices I  
needed to drive from u-boot).


Tested on Gumstix Overo with several I2C devices, on I2C1 and 3.

The multi-bus support is mostly from this patch:
http://www.beagleboard.org/gitweb/?p=u-boot-arm.git;a=commit;h=52eddcd07c2e7ad61d15bab2cf2d0d21466eaca2 



Best regards,
Hugo Vincent

Signed-off-by: Hugo Vincent 


Does anybody have an up to date version of this patch? Seems we need 
it for Beagle Zippy, too.




Thanks for the pointer.
I have cherry picked this commit and am testing it now.
I will post it once it is done, likely today.


I'm currently working on (compile tested only) patch in attachment.

Cheers

Dirk

Subject: [PATCH] OMAP2/3: I2C: Add support for second and third bus
From: Dirk Behme 

Add support to use second and on OMAP3 third I2C bus, too.

Bus 0 is still the default, but by calling i2c_set_bus_num(1/2) before doing
I2C accesses, code can switch to bus 1 and 2, too. Don't forget to switch
back afterwards, then. 

Signed-off-by: Dirk Behme 
---

Based on Hugo Vincent's patch

http://lists.denx.de/pipermail/u-boot/2009-June/055029.html

(this patch only contains the multibus support)

 drivers/i2c/omap24xx_i2c.c   |  166 +++
 include/asm-arm/arch-omap3/i2c.h |   54 +---
 2 files changed, 138 insertions(+), 82 deletions(-)

Index: u-boot-main/drivers/i2c/omap24xx_i2c.c
===
--- u-boot-main.orig/drivers/i2c/omap24xx_i2c.c
+++ u-boot-main/drivers/i2c/omap24xx_i2c.c
@@ -29,6 +29,11 @@ static void wait_for_bb (void);
 static u16 wait_for_pin (void);
 static void flush_fifo(void);
 
+static struct i2c *i2c_base = (struct i2c *)I2C_DEFAULT_BASE;
+
+static unsigned int bus_initialized[3] = {0, 0, 0};
+static unsigned int current_bus = 0;
+
 void i2c_init (int speed, int slaveadd)
 {
int psc, fsscll, fssclh;
@@ -95,30 +100,32 @@ void i2c_init (int speed, int slaveadd)
sclh = (unsigned int)fssclh;
}
 
-   writew(0x2, I2C_SYSC); /* for ES2 after soft reset */
+   writew(0x2, &i2c_base->sysc); /* for ES2 after soft reset */
udelay(1000);
-   writew(0x0, I2C_SYSC); /* will probably self clear but */
+   writew(0x0, &i2c_base->sysc); /* will probably self clear but */
 
-   if (readw (I2C_CON) & I2C_CON_EN) {
-   writew (0, I2C_CON);
+   if (readw (&i2c_base->con) & I2C_CON_EN) {
+   writew (0, &i2c_base->con);
udelay (5);
}
 
-   writew(psc, I2C_PSC);
-   writew(scll, I2C_SCLL);
-   writew(sclh, I2C_SCLH);
+   writew(psc, &i2c_base->psc);
+   writew(scll, &i2c_base->scll);
+   writew(sclh, &i2c_base->sclh);
 
/* own address */
-   writew (slaveadd, I2C_OA);
-   writew (I2C_CON_EN, I2C_CON);
+   writew (slaveadd, &i2c_base->oa);
+   writew (I2C_CON_EN, &i2c_base->con);
 
/* have to enable intrrupts or OMAP i2c module doesn't work */
writew (I2C_IE_XRDY_IE | I2C_IE_RRDY_IE | I2C_IE_ARDY_IE |
-   I2C_IE_NACK_IE | I2C_IE_AL_IE, I2C_IE);
+   I2C_IE_NACK_IE | I2C_IE_AL_IE, &i2c_base->ie);
udelay (1000);
flush_fifo();
-   writew (0x, I2C_STAT);
-   writew (0, I2C_CNT);
+   writew (0x, &i2c_base->stat);
+   writew (0, &i2c_base->cnt);
+
+   bus_initialized[current_bus] = 1;
 }
 
 static int i2c_read_byte (u8 devaddr, u8 regoffset, u8 * value)
@@ -130,19 +137,19 @@ static int i2c_read_byte (u8 devaddr, u8
wait_for_bb ();
 
/* one byte only */
-   writew (1, I2C_CNT);
+   writew (1, &i2c_base->cnt);
/* set slave address */
-   writew (devaddr, I2C_SA);
+   writew (devaddr, &i2c_base->sa);
/* no stop bit needed here */
-   writew (I2C_CON_EN | I2C_CON_MST | I2C_CON_STT | I2C_CON_TRX, I2C_CON);
+   writew (I2C_CON_EN | I2C_CON_MST | I2C_CON_STT | I2C_CON_TRX, 
&i2c_base->con);
 
status = wait_for_pin ();
 
if (status & I2C_STAT_XRDY) {
/* Important: have to use byte access */
-   writeb (regoffset, I2C_DATA);
+   writeb (regoffset, &i2c_base->data);
udelay (2);
-   if (readw (I2C_STAT) & I2C_STAT_NACK) {
+   if (readw (&i2c_base->stat) & I2C_STAT_NACK) {
i2c_error = 1;
}
} else {
@@ -151,28 +158,28 @@ static int i2c_read_byte (u8 devaddr, u8
 
if (!i2c_error) {
/* free bus, otherwise we can't use a combined transction */
-   writew (0, I2C_CON);
-   while (readw (I2C_STAT) || (read

Re: [U-Boot] [PATCH/RFC] Better I2C support for OMAP3

2009-10-31 Thread Tom Rix
Dirk Behme wrote:
> Hugo Vincent wrote:
>> Hi everyone,
>>
>> This patch improves I2C support on OMAP3 platforms, including  
>> supporting the second and third I2C controllers (mainline only  
>> supports the first controller), and supporting writes where alen=0  
>> (i.e. no register address - this was needed for some I2C devices I  
>> needed to drive from u-boot).
>>
>> Tested on Gumstix Overo with several I2C devices, on I2C1 and 3.
>>
>> The multi-bus support is mostly from this patch:
>> http://www.beagleboard.org/gitweb/?p=u-boot-arm.git;a=commit;h=52eddcd07c2e7ad61d15bab2cf2d0d21466eaca2
>>
>> Best regards,
>> Hugo Vincent
>>
>> Signed-off-by: Hugo Vincent 
> 
> Does anybody have an up to date version of this patch? Seems we need 
> it for Beagle Zippy, too.
> 

Thanks for the pointer.
I have cherry picked this commit and am testing it now.
I will post it once it is done, likely today.
Tom

> Thanks
> 
> Dirk
> 
> ___
> 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 10/10] ARM Add New Board GEC2410

2009-10-31 Thread Wolfgang Denk
Dear "Hui.Tang",

In message 
 
you wrote:
> Add gec2410 in MAKEALL.
> 
> Signed-off-by: Hui.Tang 
> ---
>  MAKEALL |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)

This belongs into the single commit that adds board support.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
You!  What PLANET is this!
-- McCoy, "The City on the Edge of Forever", stardate 3134.0
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 09/10] ARM Add New Board GEC2410

2009-10-31 Thread Wolfgang Denk
Dear "Hui.Tang",

In message 
 
you wrote:
> Add GEC2410 Maintainers.
> 
> Signed-off-by: Hui.Tang 
> ---
>  MAINTAINERS |4 
>  1 files changed, 4 insertions(+), 0 deletions(-)

This belongs into the single commit that adds board support.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
"The X11 source code style is ATROCIOUS and should not be used  as  a
model."   - Doug Gwyn
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 08/10] ARM Add New Board GEC2410

2009-10-31 Thread Wolfgang Denk
Dear "Hui.Tang",

In message 
 
you wrote:
> Add missing function for CONFIG_NAND_SPL
...
> - printf("s3c2410_nand_correct_data: not implemented\n");
> + debugX(1, "s3c2410_nand_correct_data: not implemented\n");

I think this should remain a printf().


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Another Armenia, Belgium ... the weak innocents who always seem to be
located on a natural invasion route.
-- Kirk, "Errand of Mercy", stardate 3198.4
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 06/10] ARM Add New Board GEC2410

2009-10-31 Thread Wolfgang Denk
Dear "Hui.Tang",

In message 
<28c8c0b4de93d8f48e61ff560c4537768b4e1455.1256898456.git.zetal...@gmail.com> 
you wrote:
> GEC2410 Boot from NAND FLASH.
> 
> Signed-off-by: Hui.Tang 
> ---
>  cpu/arm920t/start.S |   36 
>  1 files changed, 36 insertions(+), 0 deletions(-)
> 
> diff --git a/cpu/arm920t/start.S b/cpu/arm920t/start.S
> index 114427a..d8b832a 100644
> --- a/cpu/arm920t/start.S
> +++ b/cpu/arm920t/start.S
> @@ -27,6 +27,10 @@
>  #include 
>  #include 
>  
> +#if !defined(CONFIG_ENABLE_MMU) && !defined(CONFIG_SYS_PHY_UBOOT_BASE)
> +#define CONFIG_SYS_PHY_UBOOT_BASECONFIG_SYS_UBOOT_BASE
> +#endif

Please don't add such defines to global code. Also, CONFIG_SYS_*
variables get set in board config files, not in some low level source
code.

> +/*
> + * Below variable is very important because we use MMU in U-Boot.

do we?

> + * Without it, we cannot run code correctly before MMU is ON.
> + * by scsuh.

What does "by scsuh." mean?

> +_TEXT_PHY_BASE:
> + .word   CONFIG_SYS_PHY_UBOOT_BASE

Why would that be needed?

> +#ifndef CONFIG_NAND_SPL
>   bl  coloured_LED_init
>   bl  red_LED_on
> +#endif

in which way do LED's depend on NAND booting?

> +#ifndef CONFIG_NAND_SPL
>  #ifndef CONFIG_SKIP_RELOCATE_UBOOT
>  relocate:/* relocate U-Boot to RAM   */
>   adr r0, _start  /* r0 <- current position of code   */
> @@ -194,9 +216,13 @@ copy_loop:
>   cmp r0, r2  /* until source end addreee [r2]*/
>   ble copy_loop
>  #endif   /* CONFIG_SKIP_RELOCATE_UBOOT */
> +#endif   /* CONFIG_NAND_SPL */
>  
>   /* Set up the stack */
>  stack_setup:
> +#ifdef CONFIG_MEMORY_UPPER_CODE
> + ldr sp, =(CONFIG_SYS_UBOOT_BASE + CONFIG_SYS_UBOOT_SIZE - 0xc)
> +#else

I don;t really like this growing amount of #ifdefs in this global
code. Isn't there some better way to implement this?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Far back in the mists of ancient time, in the great and glorious days
of the former Galactic Empire, life was wild, rich  and  largely  tax
free. - Douglas Adams, _The Hitchhiker's Guide to the Galaxy_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 05/10] ARM Add New Board GEC2410

2009-10-31 Thread Wolfgang Denk
Dear "Hui.Tang",

In message 
 
you wrote:
> Add GEC2410 Clock Setting.
> 
> Signed-off-by: Hui.Tang 
> ---
>  cpu/arm920t/s3c24x0/timer.c |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/cpu/arm920t/s3c24x0/timer.c b/cpu/arm920t/s3c24x0/timer.c
> index 20cedd4..d4787b9 100644
> --- a/cpu/arm920t/s3c24x0/timer.c
> +++ b/cpu/arm920t/s3c24x0/timer.c
> @@ -188,6 +188,7 @@ ulong get_tbclk(void)
>   tbclk = timer_load_val * 100;
>  #elif defined(CONFIG_SBC2410X) || \
>defined(CONFIG_SMDK2410) || \
> +  defined(CONFIG_GEC2410) || \
>defined(CONFIG_VCMA9)
>   tbclk = CONFIG_SYS_HZ;

Instead of adding more and more board names here, we should define a
feature dependency instead - I understand this is s3c2400 versus
x3c2410 code, right? So why don't we use this instead? In any case,
such lists should always be kept sorted.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The biggest difference between time and space is that you can't reuse
time. - Merrick Furst
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 04/10] ARM Add New Board GEC2410

2009-10-31 Thread Wolfgang Denk
Dear "Hui.Tang",

In message 
<6c7a9a5dcafb1f535ed33cb29d579db993846325.1256898456.git.zetal...@gmail.com> 
you wrote:
> Add gec2410_config option for GEC2410
> 
> Signed-off-by: Hui.Tang 
> ---
>  Makefile |7 +++
>  1 files changed, 7 insertions(+), 0 deletions(-)

This belongs all in one commit.

> index bcb3fe9..2de0b1d 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -2951,6 +2951,13 @@ davinci_dm365evm_config :  unconfig
>  davinci_dm6467evm_config :   unconfig
>   @$(MKCONFIG) $(@:_config=) arm arm926ejs dm6467evm davinci davinci
>  
> +gec2410_config   :   unconfig
> + @mkdir -p $(obj)include $(obj)board/gec/gec2410
> + @mkdir -p $(obj)nand_spl/board/gec/gec2410
> + @echo "RAM_TEXT = 0x33e0" >> $(obj)board/gec/gec2410/config.tmp
> + @$(MKCONFIG) $(@:_config=) arm arm920t gec2410 gec s3c24x0
> + @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
> +
>  imx27lite_config:unconfig
>   @$(MKCONFIG) $(@:_config=) arm arm926ejs imx27lite logicpd mx27

An ARM920 board does not belong into the arm926ejs block.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
"It was the Law of the Sea, they said. Civilization ends at  the  wa-
terline.  Beyond  that,  we  all enter the food chain, and not always
right at the top."   - Hunter S. Thompson
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 03/10] ARM Add New Board GEC2410

2009-10-31 Thread Wolfgang Denk
Dear "Hui.Tang",

In message 
 
you wrote:
> Add GEC2410 default config.

Note: it makes no sense to split board support in so many separate
patches. Submit it as one commit, please.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
If I can have honesty, it's easier to overlook mistakes.
-- Kirk, "Space Seed", stardate 3141.9
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 03/10] ARM Add New Board GEC2410

2009-10-31 Thread Wolfgang Denk
Dear "Hui.Tang",

In message 
 
you wrote:
> Add GEC2410 default config.
...
> diff --git a/include/configs/gec2410.h b/include/configs/gec2410.h
> new file mode 100644
> index 000..98c8040
> --- /dev/null
> +++ b/include/configs/gec2410.h
...
> +#undef CONFIG_USE_IRQ/* we don't need IRQ/FIQ stuff 
> */
> +
> +#undef CONFIG_SKIP_RELOCATE_UBOOT

Don't #undef what is not defined anyway.


> +/*#define CONFIG_BOOTARGS"root=ramfs devfs=mount console=ttySA0,9600" */

Don;t add dead code.

> +#define CONFIG_ETHADDR   08:00:3e:26:0a:5b
> +#define CONFIG_NETMASK  255.255.255.0
> +#define CONFIG_IPADDR192.168.1.10
> +#define CONFIG_SERVERIP  192.168.1.254

As Ben already commented: strict NAK on this.

> +/*#define CONFIG_BOOTFILE"elinos-lart" */
> +/*#define CONFIG_BOOTCOMMAND "tftp; bootm" */

Don';t add dead code - please fix globally.

> +/* what's this ? it's not used anywhere */
> +#define CONFIG_KGDB_SER_INDEX1   /* which serial port to 
> use */

Then why do you add it?

> +/* the PWM TImer 4 uses a counter of 15625 for 10 ms, so we need */
> +/* it to wrap 100 times (total 1562500) to get 1 sec. */
> +#define CONFIG_SYS_HZ1562500

NAK.

CONFIG_SYS_HZ is a constant and must be defined as 1000 on all
systems.


> +/* Use drivers/cfi_flash.c, even though the flash is not CFI-compliant   
> */



Didn't you add your own driver board/gec/gec2410/flash.c ?

So does the CFI driver work, or not? And if not, then why exactly not?

> +#define CONFIG_ENV_SIZE  0x4000  /* Total Size of Environment 
> Sector */

Wrong comment? CONFIG_ENV_SIZE is the size of the envrionment, NOT
the sector size.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Anything free is worth what you pay for it.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 01/10] ARM Add New Board GEC2410

2009-10-31 Thread Wolfgang Denk
Dear "Hui.Tang",

In message 
 
you wrote:
> New Board GEC2410 Setup.


Please see below for checkpatch.pl output for your patch series
(note that you should have resolved all tehse issues _before_
submitting the patches).

> Signed-off-by: Hui.Tang 
> ---
>  board/gec/gec2410/Makefile|   54 +
>  board/gec/gec2410/README  |   85 
>  board/gec/gec2410/config.mk   |   32 +++
>  board/gec/gec2410/flash.c |  417 
> +
>  board/gec/gec2410/gec2410.c   |  150 +
>  board/gec/gec2410/lowlevel_init.S |  171 +++
>  board/gec/gec2410/u-boot-nand.lds |   61 ++
>  7 files changed, 970 insertions(+), 0 deletions(-)
>  create mode 100644 board/gec/gec2410/Makefile
>  create mode 100644 board/gec/gec2410/README
>  create mode 100644 board/gec/gec2410/config.mk
>  create mode 100644 board/gec/gec2410/flash.c
>  create mode 100644 board/gec/gec2410/gec2410.c
>  create mode 100644 board/gec/gec2410/lowlevel_init.S
>  create mode 100644 board/gec/gec2410/u-boot-nand.lds

For a new board support, entries to the top level Makefile and to the
MAINTAINERS and MAKEALL files are missing.

> diff --git a/board/gec/gec2410/flash.c b/board/gec/gec2410/flash.c
> new file mode 100644
> index 000..ab418b1
> --- /dev/null
> +++ b/board/gec/gec2410/flash.c

This looks very much like a CFI compatible flash device. Why do you
think you need a custom flash driver?

> diff --git a/board/gec/gec2410/gec2410.c b/board/gec/gec2410/gec2410.c
> new file mode 100644
> index 000..543ceeb
> --- /dev/null
> +++ b/board/gec/gec2410/gec2410.c
> @@ -0,0 +1,150 @@
> +/*
> + * (C) Copyright 2002
> + * Sysgo Real-Time Solutions, GmbH 
> + * Marius Groeger 
> + *
> + * (C) Copyright 2002
> + * David Mueller, ELSOFT AG, 
> + *
> + * (C) Copyright 2009
> + * Hui Tang, 
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +#include 
> +#include 
> +#include 
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +#define FCLK_SPEED 1
> +
> +#if FCLK_SPEED == 0  /* Fout = 203MHz, Fin = 12MHz for Audio */
> +#define M_MDIV   0xC3
> +#define M_PDIV   0x4
> +#define M_SDIV   0x1
> +#elif FCLK_SPEED == 1/* Fout = 202.8MHz */
> +#define M_MDIV   0xA1
> +#define M_PDIV   0x3
> +#define M_SDIV   0x1
> +#endif
> +
> +#define USB_CLOCK 1
> +
> +#if USB_CLOCK == 0
> +#define U_M_MDIV 0xA1
> +#define U_M_PDIV 0x3
> +#define U_M_SDIV 0x1
> +#elif USB_CLOCK == 1
> +#define U_M_MDIV 0x48
> +#define U_M_PDIV 0x3
> +#define U_M_SDIV 0x2
> +#endif
> +
> +static inline void delay(unsigned long loops)
> +{
> + __asm__ volatile ("1:\n"
> +   "subs %0, %1, #1\n"
> +   "bne 1b" : "=r" (loops) : "0" (loops));
> +}
> +
> +/*
> + * Miscellaneous platform dependent initialisations
> + */
> +
> +int board_init(void)
> +{
> + struct s3c24x0_clock_power * const clk_power =
> + s3c24x0_get_base_clock_power();
> + struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
> +
> + /* to reduce PLL lock time, adjust the LOCKTIME register */
> + clk_power->LOCKTIME = 0xFF;
> +
> + /* configure MPLL */
> + clk_power->MPLLCON = ((M_MDIV << 12) + (M_PDIV << 4) + M_SDIV);
> +
> + /* some delay between MPLL and UPLL */
> + delay(4000);
> +
> + /* configure UPLL */
> + clk_power->UPLLCON = ((U_M_MDIV << 12) + (U_M_PDIV << 4) + U_M_SDIV);

Please use I/O accessors to access device registers, here and
everwhere else in this patch series.

> + /* set up the I/O ports */
> + gpio->GPACON = 0x007F;
> + gpio->GPBCON = 0x00044555;
> + gpio->GPBUP = 0x07FF;
> + gpio->GPCCON = 0x;
> + gpio->GPCUP = 0x;
> + gpio->GPDCON = 0x;
> + gpio->GPDUP = 0x;
> + gpio->GPECON = 0x;
> + gpio->GPEUP = 0x;
> + gpio->GPFCON = 0x55AA;
> + gpio->GPFUP = 0x00FF;
> + gpio->GPGCON = 0xFF95FFBA;
> + gpio->GPGUP = 0x;
> + gpio->GPHCON = 0x002AFAAA;
> + gpio->GPHUP = 0x07FF;

Please define some symbolic constants for these data (in your board
conf

Re: [U-Boot] How to enable 2 FCC Ports while booting using CONFIG_NET_MULTI

2009-10-31 Thread Wolfgang Denk
Dear "Gurumurthy Gowdar",

In message 
<1256635330.s.5998.34271.f4mail-235-215.rediffmail.com.1257012487.28...@webmail.rediffmail.com>
 you wrote:
>
>i have enabled CONFIG_NET_MULTI , after enabling this it is 
> showing no ethernet 
> found under ethernet section.
> 
> Net: No Ethernet found

Do you have valid MAC addresses set in your environment?


And: please make sure to read
http://www.netmeister.org/news/learn2quote.html

Don't top post / full quote!

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Making files is easy under  the  UNIX  operating  system.  Therefore,
users  tend  to  create  numerous  files  using large amounts of file
space. It has been said that the only standard thing about  all  UNIX
systems  is  the  message-of-the-day  telling users to clean up their
files. - System V.2 administrator's guide
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] How to enable 2 FCC Ports while booting using CONFIG_NET_MULTI

2009-10-31 Thread Gurumurthy Gowdar
Dear Sir,
   i have enabled CONFIG_NET_MULTI , after enabling this it is 
showing no ethernet 
found under ethernet section.

Net: No Ethernet found

just i want to ping for one of the two FCC ports at runtime based on setenv 
ethact command 
& ping for the particular port. so please let me know how to do this.

Eagerly waiting for the reply

With Regards,
Gurumurthy

On Tue, 27 Oct 2009 14:52:10 +0530  wrote
>Dear Sir,
 i want only one ethernet port active at a time. so to acheive this how to 
use 
CONFIG_NET_MULTI. i have enabled one ethernet port at present i.e. FCC2. how to 
enable 
two ports so that when i ping or give network command its should ping depending 
upon 
selected port.

With Regards,
Gurumurthy

On Tue, 27 Oct 2009 14:09:51 +0530 wrote
>Dear "Gurumurthy Gowdar",

In message you wrote:
> 
> 
>   please let me know how to enable two Ethernet Ports in
> U-boot for MPC8280 at booting time. After booting i should be able to
> ping the two ports i.e. FCC1 and FCC2 only by connecting the ethernet
> cable to the repective port (FCC1 & FCC2.

You don't. You don;t do this at all.

U-Boot does not enable any peripherals "at booting time". This is a
design principle, see
http://www.denx.de/wiki/view/U-Boot/DesignPrinciples#2_Keep_it_Fast

Ethernet ininitlization is only done when U-Boot attempts to perform a
network command, and then only that single interface gets initialized
which U-Boot is going to use.

> currently i have enabled one port FCC2 as ethact port, can i change
> this depending by which port i want to ping.

Yes, you can toggle between several ports. But keep in mind that only
one of them will be active at any time, if any at all.

> i came to know about CONFIG_NET_MULTI whether this will be the
> solution for using two ports at a time.

You cannot use two ports at the same time, only one or the other. But
it is possible to switch at runtime (either automatically when a
download fails or manually by setting the "ethact" environment
variable accordingly).

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
If it went on at this rate, in several billion years he'd be rich
beyond his wildest dreams!   - Terry Pratchett, _Soul Music_
___
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] [STATUS] v2009.11-rc1 is out

2009-10-31 Thread Tom
Paulraj, Sandeep wrote:
 2) TNY_A9260.ERR, TNY_A9G20.ERR:

   nand_util.c:45:2: warning: #warning Please define
 CONFIG_SYS_64BIT_VSPRINTF for correct output!
>>> Same here, I can submit simple 1 line patches for these
>> Thanks, but this is also Albin's bailiwick.
> 
> I submitted two 1 line patches
> 
> [PATCH] Fix Compliation warning for TNY-A9260 and TNY-A9G20
> 
> And
> 
> [PATCH] Fix Compliation warning for SBC35-A9G20 board
> 
> Tom you can apply these 2 your tree.
>>
>> Best regards,
>>
>> Wolfgang Denk
>>
> 
Since these are part of the mainline master,  I will get these when
arm/master is updated.  I was planning on doing this when 2009.11 was
released on Nov 18.

Do you need this sooner ?
Tom

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


[U-Boot] [PATCH 09/10] OMAP3 USB Initialize twl4030 only if required

2009-10-31 Thread Tom Rix
OMAP3EVM uses ISP1504 phy and so twl4030 related init is not required.

Submitted-by: Ajay Kumar Gupta 
Signed-off-by: Tom Rix 
---
 drivers/usb/musb/omap3.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/musb/omap3.c b/drivers/usb/musb/omap3.c
index 3e502e7..ea98c3c 100644
--- a/drivers/usb/musb/omap3.c
+++ b/drivers/usb/musb/omap3.c
@@ -94,12 +94,17 @@ int musb_platform_init(void)
if (platform_needs_initialization) {
u32 stdby;
 
+   /*
+* OMAP3EVM uses ISP1504 phy and so
+* twl4030 related init is not required.
+*/
+#ifdef CONFIG_TWL4030_USB
if (twl4030_usb_ulpi_init()) {
serial_printf("ERROR: %s Could not initialize PHY\n",
__PRETTY_FUNCTION__);
goto end;
}
-
+#endif
otg = (struct omap3_otg_regs *)OMAP3_OTG_BASE;
 
/* Set OTG to always be on */
-- 
1.6.0.6

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


[U-Boot] [PATCH 08/10] OMAP3 zoom2 Use usbtty if the debug board is not connected.

2009-10-31 Thread Tom Rix
The preferred serial output comes from the debug board.
When the debug board is disconnected, fall back on using
usbtty from the usb connector on the Zoom2 board.

This shows up as /dev/ttyACM0 in a linux host.

Signed-off-by: Tom Rix 
---
 board/logicpd/zoom2/zoom2_serial.c |   12 
 include/configs/omap3_zoom2.h  |   17 +
 include/serial.h   |   12 
 3 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/board/logicpd/zoom2/zoom2_serial.c 
b/board/logicpd/zoom2/zoom2_serial.c
index a3d777d..ba58e39 100644
--- a/board/logicpd/zoom2/zoom2_serial.c
+++ b/board/logicpd/zoom2/zoom2_serial.c
@@ -86,6 +86,8 @@ void quad_putc_dev (unsigned long base, const char c)
quad_putc_dev (base, '\r');
 
NS16550_putc ((NS16550_t) base, c);
+   } else {
+   usbtty_putc(c);
}
 }
 
@@ -94,6 +96,8 @@ void quad_puts_dev (unsigned long base, const char *s)
if (zoom2_debug_board_connected ()) {
while ((s != NULL) && (*s != '\0'))
quad_putc_dev (base, *s++);
+   } else {
+   usbtty_puts(s);
}
 }
 
@@ -101,16 +105,16 @@ int quad_getc_dev (unsigned long base)
 {
if (zoom2_debug_board_connected ())
return NS16550_getc ((NS16550_t) base);
-   else
-   return 0;
+
+   return usbtty_getc();
 }
 
 int quad_tstc_dev (unsigned long base)
 {
if (zoom2_debug_board_connected ())
return NS16550_tstc ((NS16550_t) base);
-   else
-   return 0;
+
+   return usbtty_tstc();
 }
 
 void quad_setbrg_dev (unsigned long base)
diff --git a/include/configs/omap3_zoom2.h b/include/configs/omap3_zoom2.h
index 32cd6fd..dd287ed 100644
--- a/include/configs/omap3_zoom2.h
+++ b/include/configs/omap3_zoom2.h
@@ -122,6 +122,20 @@
 #define CONFIG_OMAP3_GPIO_3 /* board revision */
 #define CONFIG_OMAP3_GPIO_5 /* debug board detection, ZOOM2_LED_BLUE */
 
+/* USB */
+#define CONFIG_MUSB_UDC1
+#define CONFIG_USB_OMAP3   1
+#define CONFIG_TWL4030_USB 1
+
+/* USB device configuration */
+#define CONFIG_USB_DEVICE  1
+#define CONFIG_USB_TTY 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   "Zoom2"
+
 /* commands to include */
 #include 
 
@@ -169,6 +183,9 @@
 /* Environment information */
 #define CONFIG_BOOTDELAY   10
 
+#define CONFIG_EXTRA_ENV_SETTINGS \
+   "usbtty=cdc_acm\0" \
+
 /*
  * Miscellaneous configurable options
  */
diff --git a/include/serial.h b/include/serial.h
index 43451a3..f2638ec 100644
--- a/include/serial.h
+++ b/include/serial.h
@@ -67,9 +67,21 @@ extern int serial_assign(char * name);
 extern void serial_reinit_all(void);
 
 /* For usbtty */
+#ifdef CONFIG_USB_TTY
+
 extern int usbtty_getc(void);
 extern void usbtty_putc(const char c);
 extern void usbtty_puts(const char *str);
 extern int usbtty_tstc(void);
 
+#else
+
+/* stubs */
+#define usbtty_getc() 0
+#define usbtty_putc(a)
+#define usbtty_puts(a)
+#define usbtty_tstc() 0
+
+#endif /* CONFIG_USB_TTY */
+
 #endif
-- 
1.6.0.6

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


[U-Boot] [PATCH 07/10] USBTTY make some function declarations easier to use.

2009-10-31 Thread Tom Rix
Zoom2 needs to use these declarations and the include directory is a
better place from them than in the middle of the driver directory.
It did not make sense to create a new file for just a couple of
lines so they were appended to the serial.h

Signed-off-by: Tom Rix 
---
 include/serial.h |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/serial.h b/include/serial.h
index bbda3f0..43451a3 100644
--- a/include/serial.h
+++ b/include/serial.h
@@ -66,4 +66,10 @@ extern void serial_stdio_init(void);
 extern int serial_assign(char * name);
 extern void serial_reinit_all(void);
 
+/* For usbtty */
+extern int usbtty_getc(void);
+extern void usbtty_putc(const char c);
+extern void usbtty_puts(const char *str);
+extern int usbtty_tstc(void);
+
 #endif
-- 
1.6.0.6

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


[U-Boot] [PATCH 10/10] omap3evm: musb: add USB config

2009-10-31 Thread Tom Rix
From: Ajay Kumar Gupta 

Added USB host and device config for host (MSC, Keyboard) and
device (ACM) functionalities.

Signed-off-by: Ajay Kumar Gupta 
---
 include/configs/omap3_evm.h |   39 +++
 1 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index a5514ae..cbefbb1 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -101,6 +101,44 @@
 #define CONFIG_OMAP3_MMC   1
 #define CONFIG_DOS_PARTITION   1
 
+/* USB
+ * Enable CONFIG_MUSB_HCD for Host functionalities MSC, keyboard
+ * Enable CONFIG_MUSB_UDD for Device functionalities.
+ */
+#define CONFIG_USB_OMAP3   1
+#define CONFIG_MUSB_HCD1
+/* #define CONFIG_MUSB_UDC 1 */
+
+#ifdef CONFIG_USB_OMAP3
+
+#ifdef CONFIG_MUSB_HCD
+#define CONFIG_CMD_USB
+
+#define CONFIG_USB_STORAGE
+#define CONGIG_CMD_STORAGE
+#define CONFIG_CMD_FAT
+
+#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   "EVM"
+#endif /* CONFIG_MUSB_UDC */
+
+#endif /* CONFIG_USB_OMAP3 */
+
 /* commands to include */
 #include 
 
@@ -159,6 +197,7 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
"loadaddr=0x8200\0" \
+   "usbtty=cdc_acm\0" \
"console=ttyS2,115200n8\0" \
"mmcargs=setenv bootargs console=${console} " \
"root=/dev/mmcblk0p2 rw " \
-- 
1.6.0.6

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


[U-Boot] [PATCH 05/10] OMAP3 zoom1 Add usbtty configuration

2009-10-31 Thread Tom Rix
The primary console of zoom1 is the serial out from the jumpers
accessed by removing the back panel.

A secondary console is to use the usbtty.  The user can set this
manually by doing

setenv stdout usbtty; setenv stdin usbtty; setenv stderr usbtty
saveenv

usbtty will be usable by accessing the /dev/ttyACM0 on a linux host.

Signed-off-by: Tom Rix 
---
 include/configs/omap3_zoom1.h |   16 
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/include/configs/omap3_zoom1.h b/include/configs/omap3_zoom1.h
index da4b677..2f8ebb4 100644
--- a/include/configs/omap3_zoom1.h
+++ b/include/configs/omap3_zoom1.h
@@ -98,6 +98,21 @@
 #define CONFIG_OMAP3_MMC   1
 #define CONFIG_DOS_PARTITION   1
 
+/* USB */
+#define CONFIG_MUSB_UDC1
+#define CONFIG_USB_OMAP3   1
+#define CONFIG_TWL4030_USB 1
+
+/* 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   "Zoom1"
+
 /* commands to include */
 #include 
 
@@ -160,6 +175,7 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
"loadaddr=0x8200\0" \
+   "usbtty=cdc_acm\0" \
"console=ttyS2,115200n8\0" \
"videomode=1024x...@60,vxres=1024,vyres=768\0" \
"videospec=omapfb:vram:2M,vram:4M\0" \
-- 
1.6.0.6

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


[U-Boot] [PATCH 04/10] OMAP3 Add usb device support

2009-10-31 Thread Tom Rix
This change adds the usb device support for musb.

Omap3 platform support added at the same level as davinci.

The interface for usbtty to use the musb device support was added.

Verified on omap3 beagle, zoom1 and zoom2.

Signed-off-by: Tom Rix 
---
 drivers/serial/usbtty.h   |2 +
 drivers/usb/musb/Makefile |2 +
 drivers/usb/musb/musb_core.c  |8 +-
 drivers/usb/musb/musb_core.h  |   40 ++
 drivers/usb/musb/musb_debug.h |  205 +
 drivers/usb/musb/musb_udc.c   |  963 +
 drivers/usb/musb/omap3.c  |  129 ++
 drivers/usb/musb/omap3.h  |   48 ++
 include/usb.h |3 +-
 include/usb/musb_udc.h|   54 +++
 10 files changed, 1451 insertions(+), 3 deletions(-)
 create mode 100644 drivers/usb/musb/musb_debug.h
 create mode 100644 drivers/usb/musb/musb_udc.c
 create mode 100644 drivers/usb/musb/omap3.c
 create mode 100644 drivers/usb/musb/omap3.h
 create mode 100644 include/usb/musb_udc.h

diff --git a/drivers/serial/usbtty.h b/drivers/serial/usbtty.h
index f746d63..6b6c4a1 100644
--- a/drivers/serial/usbtty.h
+++ b/drivers/serial/usbtty.h
@@ -29,6 +29,8 @@
 #include 
 #elif defined(CONFIG_OMAP1510)
 #include 
+#elif defined(CONFIG_MUSB_UDC)
+#include 
 #elif defined(CONFIG_PXA27X)
 #include 
 #endif
diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile
index 09e0a5f..f2ccd9f 100644
--- a/drivers/usb/musb/Makefile
+++ b/drivers/usb/musb/Makefile
@@ -26,7 +26,9 @@ include $(TOPDIR)/config.mk
 LIB:= $(obj)libusb_musb.a
 
 COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
+COBJS-$(CONFIG_MUSB_UDC) += musb_udc.o musb_core.o
 COBJS-$(CONFIG_USB_DAVINCI) += davinci.o
+COBJS-$(CONFIG_USB_OMAP3) += omap3.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index ec57fc8..22f3dba 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -32,7 +32,9 @@ struct musb_regs *musbr;
  */
 void musb_start(void)
 {
+#if defined(CONFIG_MUSB_HCD)
u8 devctl;
+#endif
 
/* disable all interrupts */
writew(0, &musbr->intrtxe);
@@ -74,9 +76,10 @@ void musb_configure_ep(struct musb_epinfo *epinfo, u8 cnt)
/* Configure fifo size and fifo base address */
writeb(idx, &musbr->txfifosz);
writew(fifoaddr >> 3, &musbr->txfifoadd);
+
+   csr = readw(&musbr->txcsr);
 #if defined(CONFIG_MUSB_HCD)
/* clear the data toggle bit */
-   csr = readw(&musbr->txcsr);
writew(csr | MUSB_TXCSR_CLRDATATOG, &musbr->txcsr);
 #endif
/* Flush fifo if required */
@@ -87,9 +90,10 @@ void musb_configure_ep(struct musb_epinfo *epinfo, u8 cnt)
/* Configure fifo size and fifo base address */
writeb(idx, &musbr->rxfifosz);
writew(fifoaddr >> 3, &musbr->rxfifoadd);
+
+   csr = readw(&musbr->rxcsr);
 #if defined(CONFIG_MUSB_HCD)
/* clear the data toggle bit */
-   csr = readw(&musbr->rxcsr);
writew(csr | MUSB_RXCSR_CLRDATATOG, &musbr->rxcsr);
 #endif
/* Flush fifo if required */
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index f9da3f0..15c7f49 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -40,6 +40,36 @@
 
 #define MUSB_EP0_FIFOSIZE  64  /* This is non-configurable */
 
+/* EP0 */
+struct musb_ep0_regs {
+   u16 reserved4;
+   u16 csr0;
+   u16 reserved5;
+   u16 reserved6;
+   u16 count0;
+   u8  host_type0;
+   u8  host_naklimit0;
+   u8  reserved7;
+   u8  reserved8;
+   u8  reserved9;
+   u8  configdata;
+};
+
+/* EP 1-15 */
+struct musb_epN_regs {
+   u16 txmaxp;
+   u16 txcsr;
+   u16 rxmaxp;
+   u16 rxcsr;
+   u16 rxcount;
+   u8  txtype;
+   u8  txinterval;
+   u8  rxtype;
+   u8  rxinterval;
+   u8  reserved0;
+   u8  fifosize;
+};
+
 /* Mentor USB core register overlay structure */
 struct musb_regs {
/* common registers */
@@ -97,6 +127,16 @@ struct musb_regs {
u8  rxhubaddr;
u8  rxhubport;
} tar[16];
+   /*
+* end point registers
+* ep0 elements are valid when array index is 0
+* otherwise epN is valid
+*/
+   union musb_ep_regs {
+   struct musb_ep0_regs ep0;
+   struct musb_epN_regs epN;
+   } ep[16];
+
 } __attribute__((aligned(32)));
 
 /*
diff --git a/drivers/usb/musb/musb_debug.h b/drivers/usb/musb/musb_debug.h
new file mode 100644
index 000..62380ff
--- /dev/null
+++ b/drivers/usb/musb/musb_de

[U-Boot] [PATCH 06/10] OMAP3 beagle Add usbtty configuration

2009-10-31 Thread Tom Rix
The primary console of beagle is the serial header.

A secondary console is to use the usbtty.  The user can set this
manually by doing

setenv stdout usbtty; setenv stdin usbtty; setenv stderr usbtty
saveenv

usbtty will be usable by accessing the /dev/ttyACM0 on a linux host.

Signed-off-by: Tom Rix 
---
 include/configs/omap3_beagle.h |   16 
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index 19a5ec9..3ebf1bb 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -97,6 +97,21 @@
 #define CONFIG_OMAP3_MMC   1
 #define CONFIG_DOS_PARTITION   1
 
+/* USB */
+#define CONFIG_MUSB_UDC1
+#define CONFIG_USB_OMAP3   1
+#define CONFIG_TWL4030_USB 1
+
+/* 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   "Beagle"
+
 /* commands to include */
 #include 
 
@@ -163,6 +178,7 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
"loadaddr=0x8200\0" \
+   "usbtty=cdc_acm\0" \
"console=ttyS2,115200n8\0" \
"vram=12M\0" \
"dvimode=1024x768mr...@60\0" \
-- 
1.6.0.6

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


[U-Boot] [PATCH 03/10] TWL4030 Add usb PHY support

2009-10-31 Thread Tom Rix
The twl4030 provides a PHY device for connecting a link device,
like musb, to physical connection.

This change adds the twl4030 usb registers and functions for
initializing the PHY as required by omap3.

Signed-off-by: Tom Rix 
---
 Makefile  |1 +
 drivers/usb/phy/Makefile  |   44 +++
 drivers/usb/phy/twl4030.c |  189 +
 include/twl4030.h |  143 ++
 4 files changed, 362 insertions(+), 15 deletions(-)
 create mode 100644 drivers/usb/phy/Makefile
 create mode 100644 drivers/usb/phy/twl4030.c

diff --git a/Makefile b/Makefile
index a69e6d5..ce2c7e0 100644
--- a/Makefile
+++ b/Makefile
@@ -243,6 +243,7 @@ LIBS += drivers/twserial/libtws.a
 LIBS += drivers/usb/gadget/libusb_gadget.a
 LIBS += drivers/usb/host/libusb_host.a
 LIBS += drivers/usb/musb/libusb_musb.a
+LIBS += drivers/usb/phy/libusb_phy.a
 LIBS += drivers/video/libvideo.a
 LIBS += drivers/watchdog/libwatchdog.a
 LIBS += common/libcommon.a
diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile
new file mode 100644
index 000..200b907
--- /dev/null
+++ b/drivers/usb/phy/Makefile
@@ -0,0 +1,44 @@
+#
+# Copyright (c) 2009 Wind River Systems, Inc.
+# Tom Rix 
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB:= $(obj)libusb_phy.a
+
+COBJS-$(CONFIG_TWL4030_USB) += twl4030.o
+COBJS-y := twl4030.o
+
+COBJS  := $(COBJS-y)
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+all:   $(LIB)
+
+$(LIB):$(obj).depend $(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/drivers/usb/phy/twl4030.c b/drivers/usb/phy/twl4030.c
new file mode 100644
index 000..54d2e61
--- /dev/null
+++ b/drivers/usb/phy/twl4030.c
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2009 Wind River Systems, Inc.
+ * Tom Rix 
+ *
+ * This is file is based on
+ * repository git.gitorious.org/u-boot-omap3/mainline.git,
+ * branch omap3-dev-usb, file drivers/usb/gadget/twl4030_usb.c
+ *
+ * This is the unique part of its copyright :
+ *
+ * 
+ *
+ *  * (C) Copyright 2009 Atin Malaviya (atin.malav...@gmail.com)
+ *
+ * Based on: twl4030_usb.c in linux 2.6 (drivers/i2c/chips/twl4030_usb.c)
+ * Copyright (C) 2004-2007 Texas Instruments
+ * Copyright (C) 2008 Nokia Corporation
+ * Contact: Felipe Balbi 
+ *
+ * Author: Atin Malaviya (atin.malav...@gmail.com)
+ *
+ * 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+
+/* Defines for bits in registers */
+#define OPMODE_MASK(3 << 3)
+#define XCVRSELECT_MASK(3 << 0)
+#define CARKITMODE (1 << 2)
+#define OTG_ENAB   (1 << 5)
+#define PHYPWD (1 << 0)
+#define CLOCKGATING_EN (1 << 2)
+#define CLK32K_EN  (1 << 1)
+#define REQ_PHY_DPLL_CLK   (1 << 0)
+#define PHY_DPLL_CLK   (1 << 0)
+
+static int twl4030_usb_write(u8 address, u8 data)
+{
+   int ret;
+
+   ret = twl4030_i2c_write_u8(TWL4030_CHIP_USB, data, address);
+   if (ret != 0)
+   printf("TWL4030:USB:Write[0x%x] Error %d\n", address, ret);
+
+   return ret;
+}
+
+static int twl4030_usb_read(u8 address)
+{
+   u8 data;
+   int ret;
+
+   ret = twl4030

[U-Boot] v3 OMAP USB

2009-10-31 Thread Tom Rix

The is version 3 of the patchset to enable usb device support on OMAP.

The changes from the last revision are.

Per Remy's request 

> > USB_CONFIG_DESCRIPTOR_DEFINITION
> > USB_INTERFACE_DESCRIPTOR_DEFINITION

> Personally I do not like the macros for these kind of definitions, I
> would prefer a solution by nesting the structures.
> What do you think?

I have exchanged the first patch to an earlier version that used
a nested structure 'desc' instead of the macros.

At the other end of the patch set I have added Ajay's changes to
condition initialization of twl4030 and enabling in omap3_evm.

I have runtested this on Beagle.

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


[U-Boot] [PATCH 01/10] USB Consolidate descriptor definitions

2009-10-31 Thread Tom Rix
The header files usb.h and usbdescriptors.h have the same nameed
structure definitions for

usb_config_descriptor
usb_interface_descriptor
usb_endpoint_descriptor
usb_device_descriptor
usb_string_descriptor

These are out right duplicates in usb.h

usb_device_descriptor
usb_string_descriptor

This one has extra unused elements

usb_endpoint_descriptor

unsigned char   bRefresh
unsigned char   bSynchAddress;

These in usb.h have extra elements at the end of the usb 2.0
specified descriptor and are used.

usb_config_descriptor
usb_interface_descriptor

The change is to consolidate the definition of the descriptors
to usbdescriptors.h.  The dublicates in usb.h are removed.
The extra element structure will have their name shorted by
removing the '_descriptor' suffix.

So

usb_config_descriptor -> usb_config
usb_interface_descriptor -> usb_interface

For these, the common descriptor elements are accessed now
by an element 'desc'.

As an example

-   if (iface->bInterfaceClass != USB_CLASS_HUB)
+   if (iface->desc.bInterfaceClass != USB_CLASS_HUB)

This has been compile tested on MAKEALL arm, ppc and mips.

Signed-off-by: Tom Rix 
---
 common/cmd_usb.c|   20 ++--
 common/usb.c|   35 ++---
 common/usb_kbd.c|   22 -
 common/usb_storage.c|   16 +-
 cpu/ppc4xx/usbdev.c |4 +-
 drivers/usb/host/ehci-hcd.c |2 +-
 drivers/usb/musb/musb_hcd.c |2 +-
 include/usb.h   |   70 +-
 8 files changed, 61 insertions(+), 110 deletions(-)

diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index 7b8ee6b..1e297d5 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -157,7 +157,7 @@ void usb_display_desc(struct usb_device *dev)
 {
if (dev->descriptor.bDescriptorType == USB_DT_DEVICE) {
printf("%d: %s,  USB Revision %x.%x\n", dev->devnum,
-   usb_get_class_desc(dev->config.if_desc[0].bInterfaceClass),
+   usb_get_class_desc(dev->config.if_desc[0].desc.bInterfaceClass),
   (dev->descriptor.bcdUSB>>8) & 0xff,
   dev->descriptor.bcdUSB & 0xff);
 
@@ -174,7 +174,7 @@ void usb_display_desc(struct usb_device *dev)
} else {
printf(" - Class: (from Interface) %s\n",
   usb_get_class_desc(
-   dev->config.if_desc[0].bInterfaceClass));
+   dev->config.if_desc[0].desc.bInterfaceClass));
}
printf(" - PacketSize: %d  Configurations: %d\n",
dev->descriptor.bMaxPacketSize0,
@@ -187,14 +187,14 @@ void usb_display_desc(struct usb_device *dev)
 
 }
 
-void usb_display_conf_desc(struct usb_config_descriptor *config,
+void usb_display_conf_desc(struct usb_configuration_descriptor *config,
   struct usb_device *dev)
 {
printf("   Configuration: %d\n", config->bConfigurationValue);
printf("   - Interfaces: %d %s%s%dmA\n", config->bNumInterfaces,
   (config->bmAttributes & 0x40) ? "Self Powered " : "Bus Powered ",
   (config->bmAttributes & 0x20) ? "Remote Wakeup " : "",
-   config->MaxPower*2);
+   config->bMaxPower*2);
if (config->iConfiguration) {
printf("   - ");
usb_display_string(dev, config->iConfiguration);
@@ -246,16 +246,16 @@ void usb_display_ep_desc(struct usb_endpoint_descriptor 
*epdesc)
 /* main routine to diasplay the configs, interfaces and endpoints */
 void usb_display_config(struct usb_device *dev)
 {
-   struct usb_config_descriptor *config;
-   struct usb_interface_descriptor *ifdesc;
+   struct usb_config *config;
+   struct usb_interface *ifdesc;
struct usb_endpoint_descriptor *epdesc;
int i, ii;
 
config = &dev->config;
-   usb_display_conf_desc(config, dev);
+   usb_display_conf_desc(&config->desc, dev);
for (i = 0; i < config->no_of_if; i++) {
ifdesc = &config->if_desc[i];
-   usb_display_if_desc(ifdesc, dev);
+   usb_display_if_desc(&ifdesc->desc, dev);
for (ii = 0; ii < ifdesc->no_of_ep; ii++) {
epdesc = &ifdesc->ep_desc[ii];
usb_display_ep_desc(epdesc);
@@ -319,9 +319,9 @@ void usb_show_tree_graph(struct usb_device *dev, char *pre)
pre[index++] = has_child ? '|' : ' ';
pre[index] = 0;
printf(" %s (%s, %dmA)\n", usb_get_class_desc(
-   dev->config.if_desc[0].bInterfaceClass),
+   
dev->config.if_desc[0].desc.bInterfaceClass),
portspeed(dev->speed),
-   dev->config.MaxPower * 2);
+   

[U-Boot] [PATCH 02/10] USB add macros for debugging usb device setup.

2009-10-31 Thread Tom Rix
When developing usb device features, it is useful to print out
common usb structures.

Signed-off-by: Tom Rix 
---
 include/usbdescriptors.h |   26 
 include/usbdevice.h  |  103 ++
 2 files changed, 129 insertions(+), 0 deletions(-)

diff --git a/include/usbdescriptors.h b/include/usbdescriptors.h
index a752097..2dec3b9 100644
--- a/include/usbdescriptors.h
+++ b/include/usbdescriptors.h
@@ -504,4 +504,30 @@ struct usb_class_descriptor {
 
 } __attribute__ ((packed));
 
+#ifdef DEBUG
+static inline void print_device_descriptor(struct usb_device_descriptor *d)
+{
+   serial_printf("usb device descriptor \n");
+   serial_printf("\tbLength %2.2x\n", d->bLength);
+   serial_printf("\tbDescriptorType %2.2x\n", d->bDescriptorType);
+   serial_printf("\tbcdUSB %4.4x\n", d->bcdUSB);
+   serial_printf("\tbDeviceClass %2.2x\n", d->bDeviceClass);
+   serial_printf("\tbDeviceSubClass %2.2x\n", d->bDeviceSubClass);
+   serial_printf("\tbDeviceProtocol %2.2x\n", d->bDeviceProtocol);
+   serial_printf("\tbMaxPacketSize0 %2.2x\n", d->bMaxPacketSize0);
+   serial_printf("\tidVendor %4.4x\n", d->idVendor);
+   serial_printf("\tidProduct %4.4x\n", d->idProduct);
+   serial_printf("\tbcdDevice %4.4x\n", d->bcdDevice);
+   serial_printf("\tiManufacturer %2.2x\n", d->iManufacturer);
+   serial_printf("\tiProduct %2.2x\n", d->iProduct);
+   serial_printf("\tiSerialNumber %2.2x\n", d->iSerialNumber);
+   serial_printf("\tbNumConfigurations %2.2x\n", d->bNumConfigurations);
+}
+
+#else
+
+/* stubs */
+#define print_device_descriptor(d)
+
+#endif /* DEBUG */
 #endif
diff --git a/include/usbdevice.h b/include/usbdevice.h
index 206dbbc..4171636 100644
--- a/include/usbdevice.h
+++ b/include/usbdevice.h
@@ -663,4 +663,107 @@ int usbd_endpoint_halted (struct usb_device_instance 
*device, int endpoint);
 void usbd_rcv_complete(struct usb_endpoint_instance *endpoint, int len, int 
urb_bad);
 void usbd_tx_complete (struct usb_endpoint_instance *endpoint);
 
+/* These are macros used in debugging */
+#ifdef DEBUG
+static inline void print_urb(struct urb *u)
+{
+   serial_printf("urb %p\n", (u));
+   serial_printf("\tendpoint %p\n", u->endpoint);
+   serial_printf("\tdevice %p\n", u->device);
+   serial_printf("\tbuffer %p\n", u->buffer);
+   serial_printf("\tbuffer_length %d\n", u->buffer_length);
+   serial_printf("\tactual_length %d\n", u->actual_length);
+   serial_printf("\tstatus %d\n", u->status);
+   serial_printf("\tdata %d\n", u->data);
+}
+
+static inline void print_usb_device_request(struct usb_device_request *r)
+{
+   serial_printf("usb request\n");
+   serial_printf("\tbmRequestType 0x%2.2x\n", r->bmRequestType);
+   if ((r->bmRequestType & USB_REQ_DIRECTION_MASK) == 0)
+   serial_printf("\t\tDirection : To device\n");
+   else
+   serial_printf("\t\tDirection : To host\n");
+   if ((r->bmRequestType & USB_TYPE_STANDARD) == USB_TYPE_STANDARD)
+   serial_printf("\t\tType  : Standard\n");
+   if ((r->bmRequestType & USB_TYPE_CLASS) == USB_TYPE_CLASS)
+   serial_printf("\t\tType  : Standard\n");
+   if ((r->bmRequestType & USB_TYPE_VENDOR) == USB_TYPE_VENDOR)
+   serial_printf("\t\tType  : Standard\n");
+   if ((r->bmRequestType & USB_TYPE_RESERVED) == USB_TYPE_RESERVED)
+   serial_printf("\t\tType  : Standard\n");
+   if ((r->bmRequestType & USB_REQ_RECIPIENT_MASK) ==
+   USB_REQ_RECIPIENT_DEVICE)
+   serial_printf("\t\tRecipient : Device\n");
+   if ((r->bmRequestType & USB_REQ_RECIPIENT_MASK) ==
+   USB_REQ_RECIPIENT_INTERFACE)
+   serial_printf("\t\tRecipient : Interface\n");
+   if ((r->bmRequestType & USB_REQ_RECIPIENT_MASK) ==
+   USB_REQ_RECIPIENT_ENDPOINT)
+   serial_printf("\t\tRecipient : Endpoint\n");
+   if ((r->bmRequestType & USB_REQ_RECIPIENT_MASK) ==
+   USB_REQ_RECIPIENT_OTHER)
+   serial_printf("\t\tRecipient : Other\n");
+   serial_printf("\tbRequest  0x%2.2x\n", r->bRequest);
+   if (r->bRequest == USB_REQ_GET_STATUS)
+   serial_printf("\t\tGET_STATUS\n");
+   else if (r->bRequest == USB_REQ_SET_ADDRESS)
+   serial_printf("\t\tSET_ADDRESS\n");
+   else if (r->bRequest == USB_REQ_SET_FEATURE)
+   serial_printf("\t\tSET_FEATURE\n");
+   else if (r->bRequest == USB_REQ_GET_DESCRIPTOR)
+   serial_printf("\t\tGET_DESCRIPTOR\n");
+   else if (r->bRequest == USB_REQ_SET_CONFIGURATION)
+   serial_printf("\t\tSET_CONFIGURATION\n");
+   else if (r->bRequest == USB_REQ_SET_INTERFACE)
+   serial_printf("\t\tUSB_REQ_SET_INTERFACE\n");
+   else
+   serial_printf("\tUNKNOWN %d\n", r->bRequest);
+   serial_printf("\twValue0x%4.4x\n",

Re: [U-Boot] [PATCH v4 2/2] NET: Base support for etsec2.0

2009-10-31 Thread Kumar Gala

On Oct 30, 2009, at 2:05 PM, Sandeep Gopalpet wrote:

> 1. Modified the tsec_mdio structure to include the new regs
> 2. Modified the MDIO_BASE_ADDR so that it will handle both
> older version and new version of etsec.
>
> Signed-off-by: Sandeep Gopalpet 
> ---
> include/asm-ppc/immap_83xx.h |2 +-
> include/asm-ppc/immap_85xx.h |6 +-
> include/asm-ppc/immap_86xx.h |2 +-
> include/configs/P1_P2_RDB.h  |5 +
> include/tsec.h   |7 +++
> 5 files changed, 19 insertions(+), 3 deletions(-)

applied to 8xxx-next w/following changes:

* Moved TSECV2 out of P1_P2_RDB.h and into asm-ppc/config.h
* Fixes for previous patch

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


Re: [U-Boot] [PATCH v4 1/2] NET: Move MDIO regs out of TSEC Space

2009-10-31 Thread Kumar Gala

On Oct 30, 2009, at 2:05 PM, Sandeep Gopalpet wrote:

> Moved the mdio regs out of the tsec structure,and
> provided different offsets for tsec base and mdio
> base so that provision for etsec2.0 can be provided.
>
> This patch helps in providing the support for etsec2.0
> In etsec2.0, the MDIO register space and the etsec reg
> space are different.
>
> Also, moved the TSEC_BASE_ADDR and MDIO_BASE_ADDR definitons into
> platform specific files.
>
> Signed-off-by: Sandeep Gopalpet 
> ---
> drivers/net/tsec.c   |   21 +--
> include/asm-ppc/immap_83xx.h |   11 +-
> include/asm-ppc/immap_85xx.h |9 
> include/asm-ppc/immap_86xx.h |   10 -
> include/tsec.h   |   44  
> +-
> 5 files changed, 60 insertions(+), 35 deletions(-)

applied to 8xxx-next w/some minor changes:

* removed TSEC_SIZE from immap_83xx.h
* moved TSEC_MDIO_OFFSET into tsec.h out of immap_*.h
* matched style in immap_85xx.h

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


Re: [U-Boot] Pull request: u-boot-video next

2009-10-31 Thread Anatolij Gustschin
Dear Wolfgang,

Wolfgang Denk  wrote:

> Dear Anatolij Gustschin,
> 
> In message <20091031130444.06efc...@wker> you wrote:
> > Dear Wolfgang,
> > 
> > The following changes since commit f2b4bc04d6aed6be712d236dab48ac4c4da22cbf:
> >   Wolfgang Denk (1):
> > Merge branch 'master' of git://git.denx.de/u-boot-cfi-flash
> > 
> > are available in the git repository at:
> > 
> >   git://git.denx.de/u-boot-video.git next
> > 
> > Anatolij Gustschin (1):
> >   video: mb862xx: add option CONFIG_VIDEO_MB862xx_ACCEL for 32bpp mode
> > 
> > Wolfgang Grandegger (2):
> >   video: mb862xx: improve board-specific Lime configuration
> >   video: mb862xx: add option VIDEO_FB_16BPP_WORD_SWAP for IPEK01
> > 
> >  board/lwmon5/lwmon5.c   |7 --
> >  board/socrates/socrates.c   |   46 ++-
> >  drivers/video/cfb_console.c |4 ++-
> >  drivers/video/mb862xx.c |   50 
> > +-
> >  include/configs/lwmon5.h|   12 +-
> >  include/configs/socrates.h  |7 ++
> >  include/mb862xx.h   |5 
> >  7 files changed, 76 insertions(+), 55 deletions(-)
> 
> I understand this was intended for the "next" branch?  Applied.
> Thanks.

yes, this is correct. Thanks.

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


Re: [U-Boot] Best way of making some drivers common across kirkwood and orion5x SoCs?

2009-10-31 Thread Wolfgang Denk
Dear Albert ARIBAUD,

In message <4aec53db.6050...@free.fr> you wrote:
>
> Would a name such as "marvell.h" be more acceptable? This would be

Hm... I expect there will be little chance to see MAarvell IP blocks
in non-Marvell SoCs, so this should work indeed. On the other hand,
why not chose a name that works for other CPUs / SoCs as well. [So on
second thought maybe your "soc.h" was not that bad a name.]

Let's see what others suggest.

> consistent with my intent to replace kirkwood references with marvell
> ones in all non-kirkwood-specific symbols, e.g. kikwood_egiga_initialize
> would become marvell_egiga_initialize etc.

Do we need this "kirkwood_" or "marvell_" prefix at all? Where e4lse
do we expect to see for example "egiga_" show up?

We do not use "intel_e1000_..." or "realtek_rtl8139_..." etc. either,

Just drop that part. Nobody will miss it.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Our way is peace.
-- Septimus, the Son Worshiper, "Bread and Circuses",
   stardate 4040.7.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] omap3evm: musb: add USB config

2009-10-31 Thread Tom
Ajay Kumar Gupta wrote:
> Added USB host and device config for host (MSC, Keyboard) and
> device (ACM) functionalities.
> 

I will add this to the omap usb patch set.
Thanks
Tom

> Signed-off-by: Ajay Kumar Gupta 
> ---
> This patch is intended to be applied on top of recent OMAP3 musb
> patches from Tom Rix.
> 
>  include/configs/omap3_evm.h |   39 +++
>  1 files changed, 39 insertions(+), 0 deletions(-)
> 
> diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
> index a5514ae..cbefbb1 100644
> --- a/include/configs/omap3_evm.h
> +++ b/include/configs/omap3_evm.h
> @@ -101,6 +101,44 @@
>  #define CONFIG_OMAP3_MMC 1
>  #define CONFIG_DOS_PARTITION 1
>  
> +/* USB
> + * Enable CONFIG_MUSB_HCD for Host functionalities MSC, keyboard
> + * Enable CONFIG_MUSB_UDD for Device functionalities.
> + */
> +#define CONFIG_USB_OMAP3 1
> +#define CONFIG_MUSB_HCD  1
> +/* #define CONFIG_MUSB_UDC   1 */
> +
> +#ifdef CONFIG_USB_OMAP3
> +
> +#ifdef CONFIG_MUSB_HCD
> +#define CONFIG_CMD_USB
> +
> +#define CONFIG_USB_STORAGE
> +#define CONGIG_CMD_STORAGE
> +#define CONFIG_CMD_FAT
> +
> +#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_DEVICE1
> +#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_PRODUCTID0x5678
> +#define CONFIG_USBD_MANUFACTURER "Texas Instruments"
> +#define CONFIG_USBD_PRODUCT_NAME "EVM"
> +#endif /* CONFIG_MUSB_UDC */
> +
> +#endif /* CONFIG_USB_OMAP3 */
> +
>  /* commands to include */
>  #include 
>  
> @@ -159,6 +197,7 @@
>  
>  #define CONFIG_EXTRA_ENV_SETTINGS \
>   "loadaddr=0x8200\0" \
> + "usbtty=cdc_acm\0" \
>   "console=ttyS2,115200n8\0" \
>   "mmcargs=setenv bootargs console=${console} " \
>   "root=/dev/mmcblk0p2 rw " \

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


Re: [U-Boot] [PATCH v2 4/4] mpc52xx: add support for the IPEK01 board

2009-10-31 Thread Wolfgang Denk
Dear Wolfgang Grandegger,

In message <1256292196-20660-5-git-send-email...@grandegger.com> you wrote:
> From: Wolfgang Grandegger 
> 
> This patch adds support for the board IPEK01 based on the MPC5200.
> The Futjitsu Lime graphics controller is configured in 16 bpp mode.
> 
> Signed-off-by: Wolfgang Grandegger 
> ---
>  MAINTAINERS  |2 +
>  MAKEALL  |1 +
>  Makefile |3 +
>  board/ipek01/Makefile|   50 ++
>  board/ipek01/config.mk   |   30 
>  board/ipek01/ipek01.c|  282 
>  include/configs/ipek01.h |  408 
> ++
>  7 files changed, 776 insertions(+), 0 deletions(-)
>  create mode 100644 board/ipek01/Makefile
>  create mode 100644 board/ipek01/config.mk
>  create mode 100644 board/ipek01/ipek01.c
>  create mode 100644 include/configs/ipek01.h

Applied to "next" branch, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
To be a winner, all you need to give is all you have.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Pull request: u-boot-video next

2009-10-31 Thread Wolfgang Denk
Dear Anatolij Gustschin,

In message <20091031130444.06efc...@wker> you wrote:
> Dear Wolfgang,
> 
> The following changes since commit f2b4bc04d6aed6be712d236dab48ac4c4da22cbf:
>   Wolfgang Denk (1):
> Merge branch 'master' of git://git.denx.de/u-boot-cfi-flash
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-video.git next
> 
> Anatolij Gustschin (1):
>   video: mb862xx: add option CONFIG_VIDEO_MB862xx_ACCEL for 32bpp mode
> 
> Wolfgang Grandegger (2):
>   video: mb862xx: improve board-specific Lime configuration
>   video: mb862xx: add option VIDEO_FB_16BPP_WORD_SWAP for IPEK01
> 
>  board/lwmon5/lwmon5.c   |7 --
>  board/socrates/socrates.c   |   46 ++-
>  drivers/video/cfb_console.c |4 ++-
>  drivers/video/mb862xx.c |   50 +-
>  include/configs/lwmon5.h|   12 +-
>  include/configs/socrates.h  |7 ++
>  include/mb862xx.h   |5 
>  7 files changed, 76 insertions(+), 55 deletions(-)

I understand this was intended for the "next" branch?  Applied.
Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The use of COBOL cripples the mind; its teaching  should,  therefore,
be regarded as a criminal offence.
  -- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Best way of making some drivers common across kirkwood and orion5x SoCs?

2009-10-31 Thread Albert ARIBAUD
Wolfgang Denk a écrit :

 > "soc.h" is eventually a too generic name.

I'd actually chosen it "as generic as" the 'cpu.h' file which already 
exists in the kirkwood arch (and others), but making it more specific is 
ok, as long as it is not as specific as 'kirkwood' -- see below for an 
alternate proposal.

 > Please don't use symlinks.

I've already started with replacing the file rather than symlinking, so 
that's fine with me.

 >> Would this approach be clean enough to be considered for inclusion 
in mainline?
 >
 > Yes, except for the "soc.h" name. And no links, please.

Would a name such as "marvell.h" be more acceptable? This would be 
consistent with my intent to replace kirkwood references with marvell 
ones in all non-kirkwood-specific symbols, e.g. kikwood_egiga_initialize 
would become marvell_egiga_initialize etc.

Amicalement,
-- 
Albert.

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


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

2009-10-31 Thread Wolfgang Denk
Dear Heiko Schocher,

In message <4aeaf4eb.3050...@denx.de> you wrote:
> Hello Wolfgang,
> 
> The following changes since commit f2b4bc04d6aed6be712d236dab48ac4c4da22cbf:
>   Wolfgang Denk (1):
> Merge branch 'master' of git://git.denx.de/u-boot-cfi-flash
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-i2c.git next
> 
> Mike Frysinger (2):
>   Blackfin: TWI/I2C: add timeout to transfer
>   Blackfin: TWI/I2C: implement bus speed get/set functions
> 
> Valentin Yakovenkov (1):
>   new PCA9564 i2c bridge driver
> 
>  drivers/i2c/Makefile   |1 +
>  drivers/i2c/bfin-twi_i2c.c |   74 ++---
>  drivers/i2c/pca9564_i2c.c  |  189 
> 
>  include/pca9564.h  |   50 
>  4 files changed, 300 insertions(+), 14 deletions(-)
>  create mode 100644 drivers/i2c/pca9564_i2c.c
>  create mode 100644 include/pca9564.h

Is it correct to assume that you wanted me to pullk this into the "next"
branch?  This is at least what I did.  Hope it was OK.  Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
...the increased productivity fostered by a friendly environment  and
quality  tools  is  essential  to  meet  ever  increasing demands for
software.   - M. D. McIlroy, E. N. Pinson and B. A. Tague
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2009-10-31 Thread Wolfgang Denk
Dear Nobuhiro Iwamatsu,

In message <29ab51dc0910292128la85fabft88cbcccaa44dd...@mail.gmail.com> you 
wrote:
> Dear Wolfgang,
> 
> Could you pull from the master branch at git://git.denx.de/u-boot-sh.git ?
> 
> Best regards,
>   Nobuhiro
> 
> The following changes since commit f2b4bc04d6aed6be712d236dab48ac4c4da22cbf:
>   Wolfgang Denk (1):
> Merge branch 'master' of git://git.denx.de/u-boot-cfi-flash
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-sh.git master
> 
> Nobuhiro Iwamatsu (3):
>   sh: Remove malloc_bin_reloc from lib_sh, lib_nios2 and lib_nios.
>   sh: Move some defs to convince 'pcrel too far'
>   sh: Update lowlevel_init.S of espt-giga
> 
>  board/espt/lowlevel_init.S  |   10 +---
>  board/renesas/sh7785lcr/lowlevel_init.S |  107 
> +++
>  lib_nios/board.c|2 -
>  lib_nios2/board.c   |2 -
>  lib_sh/board.c  |2 -
>  5 files changed, 54 insertions(+), 69 deletions(-)

Done, thanks.


Do I understand correctly that "Update lowlevel_init.S of espt-giga"
obsoletes the patch "Fix build of sh7785lcr 32bit mode" of Mon, 24 Aug
2009 11:01:41 +0900 (which was marked as still open in my list) ?




Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
"Ada is PL/I trying to be Smalltalk. - Codoso diBlini
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Best way of making some drivers common across kirkwood and orion5x SoCs?

2009-10-31 Thread Wolfgang Denk
Dear Albert ARIBAUD,

In message <4aebff60.90...@free.fr> you wrote:
> 
> Several kirkwood drivers could actually be reused almost as-is and 
> should thus be shared between both SoC families. For instance, 
> kirkwood_egiga.c and ehci-kirkwood.c would only differ by the number of 
> ports and kirkwood_i2c.c could be reused as-is.
> 
> However, these drivers have hard-coded numbers of ports, and 'hard' 
> references to 'kirkwood.h' for their register definitions. Making them 
> cross-SoC would require moving the numbers of ports to some SoC-specific 
> header file, and that this header file *not* be named after a specific SoC.

... or to include the right SoC-specific header(s) only.

> Instead, I have thought of replacing the #include "kirkwood.h" with a 
> #include "soc.h", where soc.h would exist in both SoC's header files 

"soc.h" is eventually a too generic name.

> include/asm-arm/arch-kirkwood and include/asm-arm/arch-orion5x. This 
> soc.h file would either include the specific soc header file (kirkwood.h 
> or orion5x.h) or, better yet, be a symlink to it, or better again, 
> replace it.

Please don't use symlinks.

> This could be done in a two-step approach, each step being one commit.
> 
> 1) introduce "soc.h" by:
> 
> - 1a) renaming, symlinking or including kirkwood.h into soc.h and 
> changing kirkwood drivers that #include "kirkwood.h" accordingly;
> 
> - 1b) turning all kirkwood-specific namings in these kirkwood drivers 
> into marvell-non-soc-specific ones (remove "KW_" prefixes and such).
> 
> (steps 1a and 1b are independent)
> 
We do things like

#if defined(CONFIG_8xx)
#include 
...
#elif defined(CONFIG_5xx)
#include 
#elif defined(CONFIG_MPC5xxx)
#include 
#elif defined(CONFIG_MPC512X)
#include 
#elif defined(CONFIG_MPC8220)
#include 
...

even in pretty central files like "include/common.h". I don't want to
suggest that this is the most beautiful solution, though.

> 2) add orion5x support with its own "soc.h" file.
> 
> Would this approach be clean enough to be considered for inclusion in 
> mainline?

Yes, except for the "soc.h" name. And no links, please.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
"Obviously, a major malfunction has occurred."
  -- Steve Nesbitt, voice of Mission Control, January 28,
 1986, as the shuttle Challenger exploded within view
 of the grandstands.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] ads5121 - remove PSC serial console support

2009-10-31 Thread Wolfgang Denk
Dear Angelo,

In message <523536.75919...@web23108.mail.ird.yahoo.com> you wrote:
>
> I'm trying to reduce boot time and i don't want to omit anything!

Hm.. did you do any profiling and are you really sure that the initial
console messages really contribute a significant amount to the boot
time?

On the MPC5121ADS board, U-Boot prints some 340 characters before you
can turn off the conssole using the usual methods. At 115200 bps this
takes about 30 milliseconds.

Are you really sure that it makes sense to optimize on thislevel yet?
Have you solved / accelerated all the other slow parts yet?

> I know that console is fundamental, but i need to disable it. After some
> modifies it seems like u-boot execute an infinite loop, waiting for unknown
> something.

Attach a debugger. It should be trivial to see where U-Boot is
spinning.

> I suppose that should be a way to remove it completely. 

I am pretty sure that what you are trying to do makes little sense.

> --- Ven 30/10/09, Wolfgang Denk  ha scritto:
>
> Da: Wolfgang Denk 

Please also make sure to read
http://www.netmeister.org/news/learn2quote.html

Do not top post / full quote.  Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The ideal situation is to have massive computing power right at home.
Something that dims the streetlights and shrinks the picture  on  the
neighbours' TVs when you boot it up.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] mkconfig: deny messed up ARCH definition

2009-10-31 Thread Nishanth Menon
Refuse to setup a platform if the command
line ARCH= is not the same as the one
required for the board. This prevents
any user with prehistoric aliases from
messing up thier builds

Reported in thread:
http://old.nabble.com/-U-Boot--Build-breaks-on-some-OMAP3-configs-to26132721.html

Signed-off-by: Nishanth Menon 
---
 mkconfig |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/mkconfig b/mkconfig
index 4c5675b..87ac6d4 100755
--- a/mkconfig
+++ b/mkconfig
@@ -27,6 +27,11 @@ done
 [ $# -lt 4 ] && exit 1
 [ $# -gt 6 ] && exit 1
 
+if [ ! -z "$ARCH" -a "$ARCH" != "$2" ]; then
+   echo "ARCH=$ARCH while ${BOARD_NAME} arch=$2: fail" 
+   exit 1
+fi
+
 echo "Configuring for ${BOARD_NAME} board..."
 
 #
-- 
1.6.0.4

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


Re: [U-Boot] Build breaks on some OMAP3 configs

2009-10-31 Thread Menon, Nishanth
Nishanth Menon said the following on 10/31/2009 03:07 PM:
> Wolfgang Denk said the following on 10/30/2009 11:35 PM:
>   
>> Dear Nishanth Menon,
>>
>> In message <4aeb4dc5.9040...@gmail.com> you wrote:
>>   
>> 
>>> for some wierd reason, it does not seem to take the include/config.mk
>>> file (where the defines are present)..
>>>
>>> now, if i do a local clone of the cloned directory, it builds just fine!
>>> gotta dig at it a little more..
>>> 
>>>   
>> Maybe some files have been stored on or transferred through a Windoze
>> system which messed up the line endings with CR-LF sequences?
>>
>>   
>> 
> Nope, I cloned(the direct clone from git.denx) direct to my linux laptop
> - amd64, dual core ubuntu 9.10.
>
>   
Got the problem! duh.. I had ARCH=ARM instead of ARCH=arm in my alias!!!
"make -p" helped catch it... all is well now..
proper alias is now:
alias mymake='make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- V=1'
even better: I dont need to use the ARCH=arm in my alias anymore.. so to
prevent dumb asses like me, will send out a patch:
diff --git a/mkconfig b/mkconfig
index 4c5675b..87ac6d4 100755
--- a/mkconfig
+++ b/mkconfig
@@ -27,6 +27,11 @@ done
 [ $# -lt 4 ] && exit 1
 [ $# -gt 6 ] && exit 1
 
+if [ ! -z "$ARCH" -a "$ARCH" != "$2" ]; then
+   echo "ARCH=$ARCH while ${BOARD_NAME} arch=$2: fail"
+   exit 1
+fi
+
 echo "Configuring for ${BOARD_NAME} board..."
 
 #


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


Re: [U-Boot] Build breaks on some OMAP3 configs

2009-10-31 Thread Nishanth Menon
Wolfgang Denk said the following on 10/30/2009 11:35 PM:
> Dear Nishanth Menon,
>
> In message <4aeb4dc5.9040...@gmail.com> you wrote:
>   
>> for some wierd reason, it does not seem to take the include/config.mk
>> file (where the defines are present)..
>>
>> now, if i do a local clone of the cloned directory, it builds just fine!
>> gotta dig at it a little more..
>> 
>
> Maybe some files have been stored on or transferred through a Windoze
> system which messed up the line endings with CR-LF sequences?
>
>   
Nope, I cloned(the direct clone from git.denx) direct to my linux laptop
- amd64, dual core ubuntu 9.10.

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


[U-Boot] Pull request: u-boot-video next

2009-10-31 Thread Anatolij Gustschin
Dear Wolfgang,

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

are available in the git repository at:

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

Anatolij Gustschin (1):
  video: mb862xx: add option CONFIG_VIDEO_MB862xx_ACCEL for 32bpp mode

Wolfgang Grandegger (2):
  video: mb862xx: improve board-specific Lime configuration
  video: mb862xx: add option VIDEO_FB_16BPP_WORD_SWAP for IPEK01

 board/lwmon5/lwmon5.c   |7 --
 board/socrates/socrates.c   |   46 ++-
 drivers/video/cfb_console.c |4 ++-
 drivers/video/mb862xx.c |   50 +-
 include/configs/lwmon5.h|   12 +-
 include/configs/socrates.h  |7 ++
 include/mb862xx.h   |5 
 7 files changed, 76 insertions(+), 55 deletions(-)

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


Re: [U-Boot] [PATCH v2 3/4] video: mb862xx: add option VIDEO_FB_16BPP_WORD_SWAP for IPEK01

2009-10-31 Thread Anatolij Gustschin
On Fri, 23 Oct 2009 12:03:15 +0200
Wolfgang Grandegger  wrote:

> From: Wolfgang Grandegger 
> 
> In 16 bpp mode, the new IPEK01 board only requires swapping of D16 words
> for D32 accesses due to the diffferent connecting to the GDC bus. This
> patch introduces the configuration option VIDEO_FB_16BPP_WORD_SWAP,
> which should be set for all board using the mb862xx in 16 bpp mode. For
> the IPEK01, VIDEO_FB_16BPP_PIXEL_SWAP should not be set.
> 
> Signed-off-by: Wolfgang Grandegger 
> ---
>  drivers/video/cfb_console.c |2 +-
>  include/configs/lwmon5.h|1 +
>  include/configs/socrates.h  |1 +
>  3 files changed, 3 insertions(+), 1 deletions(-)

Applied to u-boot-video/next. Thanks!

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


Re: [U-Boot] [PATCH v2 2/4] video: mb862xx: add option CONFIG_VIDEO_MB862xx_ACCEL for 32bpp mode

2009-10-31 Thread Anatolij Gustschin
On Fri, 23 Oct 2009 12:03:14 +0200
Wolfgang Grandegger  wrote:

> From: Anatolij Gustschin 
> 
> The new IPEK01 board can use the 32 bpp mode for the Lime graphics
> controller. For this mode, video accelaration does not work. This patch
> makes the accelaration configurable via CONFIG_VIDEO_MB862xx_ACCEL,
> which is enabled for the lwmon5 and the socrates board for backward
> compatibility.
> 
> Signed-off-by: Anatolij Gustschin 
> Signed-off-by: Wolfgang Grandegger 
> ---
>  drivers/video/cfb_console.c |2 ++
>  drivers/video/mb862xx.c |   16 +++-
>  include/configs/lwmon5.h|1 +
>  include/configs/socrates.h  |1 +
>  4 files changed, 19 insertions(+), 1 deletions(-)

Applied to u-boot-video/next. Thanks!

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


Re: [U-Boot] [PATCH v2 1/4] video: mb862xx: improve board-specific Lime configuration

2009-10-31 Thread Anatolij Gustschin
On Fri, 23 Oct 2009 12:03:13 +0200
Wolfgang Grandegger  wrote:

> From: Wolfgang Grandegger 
> 
> To avoid board-specific code accessing the mb862xx registers directly,
> the public function mb862xx_probe() has been introduced. Furthermore,
> the "Change of Clock Frequency" and "Set Memory I/F Mode" registers
> are now defined by CONFIG_SYS_MB862xx_CCF and CONFIG_SYS_MB862xx__MMR,
> respectively. The BSPs for the socrates and lwmon5 boards have been
> adapted accordingly.
> 
> Signed-off-by: Wolfgang Grandegger 
> ---
>  board/lwmon5/lwmon5.c  |7 --
>  board/socrates/socrates.c  |   46 ++-
>  drivers/video/mb862xx.c|   34 +++-
>  include/configs/lwmon5.h   |   10 +++-
>  include/configs/socrates.h |5 
>  include/mb862xx.h  |5 
>  6 files changed, 54 insertions(+), 53 deletions(-)

Applied to u-boot-video/next. Thanks!

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


Re: [U-Boot] Best way of making some drivers common across kirkwood and orion5x SoCs?

2009-10-31 Thread Albert ARIBAUD
Albert ARIBAUD a écrit :

> I've searched for a layer between CPU and Core

Make that "CPU and SoC".

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


[U-Boot] Best way of making some drivers common across kirkwood and orion5x SoCs?

2009-10-31 Thread Albert ARIBAUD
Hi,

I am working on adding mainline support for Orion5x family of Marvell 
SoCs in U-boot, based on the Kirkwood support already present.

I believe these are different enough families to justify adding an 
'orion5x' SoC along the existing 'kirkwood' one.

Several kirkwood drivers could actually be reused almost as-is and 
should thus be shared between both SoC families. For instance, 
kirkwood_egiga.c and ehci-kirkwood.c would only differ by the number of 
ports and kirkwood_i2c.c could be reused as-is.

However, these drivers have hard-coded numbers of ports, and 'hard' 
references to 'kirkwood.h' for their register definitions. Making them 
cross-SoC would require moving the numbers of ports to some SoC-specific 
header file, and that this header file *not* be named after a specific SoC.

I've searched for a layer between CPU and Core where cross-SoC code 
could fit, but I haven't seen one, and I don't think one would be needed.

Instead, I have thought of replacing the #include "kirkwood.h" with a 
#include "soc.h", where soc.h would exist in both SoC's header files 
include/asm-arm/arch-kirkwood and include/asm-arm/arch-orion5x. This 
soc.h file would either include the specific soc header file (kirkwood.h 
or orion5x.h) or, better yet, be a symlink to it, or better again, 
replace it.

This could be done in a two-step approach, each step being one commit.

1) introduce "soc.h" by:

- 1a) renaming, symlinking or including kirkwood.h into soc.h and 
changing kirkwood drivers that #include "kirkwood.h" accordingly;

- 1b) turning all kirkwood-specific namings in these kirkwood drivers 
into marvell-non-soc-specific ones (remove "KW_" prefixes and such).

(steps 1a and 1b are independent)

2) add orion5x support with its own "soc.h" file.

Would this approach be clean enough to be considered for inclusion in 
mainline?

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


Re: [U-Boot] [PATCH/RFC] Better I2C support for OMAP3

2009-10-31 Thread Dirk Behme
Hugo Vincent wrote:
> Hi everyone,
> 
> This patch improves I2C support on OMAP3 platforms, including  
> supporting the second and third I2C controllers (mainline only  
> supports the first controller), and supporting writes where alen=0  
> (i.e. no register address - this was needed for some I2C devices I  
> needed to drive from u-boot).
> 
> Tested on Gumstix Overo with several I2C devices, on I2C1 and 3.
> 
> The multi-bus support is mostly from this patch:
> http://www.beagleboard.org/gitweb/?p=u-boot-arm.git;a=commit;h=52eddcd07c2e7ad61d15bab2cf2d0d21466eaca2
> 
> Best regards,
> Hugo Vincent
> 
> Signed-off-by: Hugo Vincent 

Does anybody have an up to date version of this patch? Seems we need 
it for Beagle Zippy, too.

Thanks

Dirk

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