Re: [U-Boot] [PATCH v8] usb: align buffers at cacheline

2012-04-03 Thread puneets

Hi Marek/Tom,
As I understood correctly.
I would merge my changes in denx-uboot-arm/master as 
u-boot-tegra/master, where actually I tested my patch, is

pulled in denx-uboot-arm/master.

Will that work...

Thanks  Regards,
Puneet

On Monday 02 April 2012 10:02 PM, Marek Vasut wrote:

Dear Tom Warren,


Marek,


-Original Message-
From: Marek Vasut [mailto:ma...@denx.de]
Sent: Monday, April 02, 2012 9:12 AM
To: Tom Warren
Cc: Puneet Saxena; Mike Frysinger; u-boot@lists.denx.de;
s...@chromium.org; li...@bohmer.net; tr...@ti.com;
albert.u.b...@aribaud.net
Subject: Re: [PATCH v8] usb: align buffers at cacheline

Dear Tom Warren,


Marek, Puneet, et al.,


-Original Message-
From: Marek Vasut [mailto:ma...@denx.de]
Sent: Monday, March 19, 2012 8:47 AM
To: Tom Warren
Cc: Puneet Saxena; Mike Frysinger; u-boot@lists.denx.de;
s...@chromium.org; li...@bohmer.net; tr...@ti.com;
albert.u.b...@aribaud.net
Subject: Re: [PATCH v8] usb: align buffers at cacheline

Dear Tom Warren,


Marek,


-Original Message-
From: Marek Vasut [mailto:marek.va...@gmail.com]
Sent: Monday, March 19, 2012 7:43 AM
To: Puneet Saxena
Cc: Mike Frysinger; u-boot@lists.denx.de; s...@chromium.org;
li...@bohmer.net; tr...@ti.com; Tom Warren
Subject: Re: [PATCH v8] usb: align buffers at cacheline

Dear Puneet Saxena,


Hi Marek,
I adapted my patch for git://git.denx.de/u-boot-usb.git master
branch. As the build for target Seaboard is broken once I
enable USB in Seaboard.h, I am unable to test my changes on u-

boot-usb.


u-boot-usb is forked off the mainline u-boot.git ... tegra stuff
likely isn't pulled there. Simon, can you tell me when this is
gonna be

there?


Simon's USB/fdt patch set will be pulled into -arm first, then
-main, when he adapts the 'panic' putc patchset (implement
pre-console putc for fdt
warning) to meet with Wolfgang's approval. Once that's done
(hopefully early this week), I can submit another pull request to
finally get this series in.

Simon - can we have an ETA?

I'd love to see some ETA on u-boot-arm push from Albert Aribaud :-(
Albert, how're you doing ?

Thanks!

u-boot-tegra/master has the fdt/USB patches, and has been pulled into
ARM master.

We need the cacheline/buffer alignment patch now, to remove the
volcanic spew whenever you do any USB commands.

Can you guys (Puneet  Marek, and Mike/Simon if necessary) work
together to get this in soon?

Ain't you gonna help us? I believe the patch is really close to be
usable, it just needs some easy debugging, won't you volunteer, it'd
really help? :)

I can apply the latest patch (v8?) and see how much spew is still present,
but I (a) have no expertise in cache/USB issues and (b) have a ton of
patches to apply/push for Tegra2 and (as soon as those are in) Tegra3, so
my BW is limited, and finally (c) this is Puneet's work, and I'd like to
see him complete it (with help from the list).

Well, everyone does. And that's how FOSS works -- you scratch your own itch by
sending a patch, thus helping everyone else ;-)

And hey, my boards don't have caches enabled (yet) so this is low-prio for me.
Sure, if someone has this as a high-prio thing, patch is very welcome :)


Tom


Thanks,

Tom


Tom


I would have to merge lots of changes from denx-uboot-tegra
to make it working for u-boot-usb.git master branch.
I can send the adapted patch if it's needed.

The problem I see is that there are important USB patches in
mainline, though they are not in -tegra. So the approach I'd
take if I were you would be to rebase -tegra atop of mainline
for yourself and then apply your patch. Does that work for you?


Thanks,
Puneet

Thanks!

Best regards,
Marek Vasut

Best regards,
Marek Vasut



---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
---
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] cm-t35: add I2C multi-bus support

2012-04-03 Thread Igor Grinberg
Hi Tom,

On 04/02/12 17:18, Tom Rini wrote:
 On 04/02/2012 05:29 AM, Igor Grinberg wrote:
 From: Nikita Kiryanovnik...@compulab.co.il

 Enable I2C multi-bus support and config I2C muxes for I2C2 and I2C3.

 Signed-off-by: Nikita Kiryanovnik...@compulab.co.il
 Signed-off-by: Igor Grinberggrinb...@compulab.co.il
 
 Have you confirmed this is sufficient and there's no changes required in 
 omap24xx_i2c.c ?  Thanks!

I don't know what do you mean by sufficient...
I've tested this patch on bus 0 and 2 by reading/writing to eeproms and
it is working fine, so IMO it is sufficient.

Some time ago, I've seen a problem with Ethernet initialization
and tracked it down to:
0607e2b ARMV7: OMAP: Write more than 1 byte at a time in i2c_write

cm-t35 and cm-t3730 have Ethernet reset signal wired to TPS65930 GPIO,
so I2C transaction is needed to reset the Ethernet.

So my conclusion was that the commit above changed the timings and
that broke the Ethernet reset code.

After examining the Ethernet reset code, the fix was obvious,
as the reset code had wrong timing for the reset pulse.
So I've fixed this locally, but forgot to send a patch.
Sending in a moment...


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


[U-Boot] [PATCH] cm-t35: fix Ethernet reset timing

2012-04-03 Thread Igor Grinberg
The reset_net_chip() function has wrong timings for the reset pulse.

This appeared to work until:
0607e2b (ARMV7: OMAP: Write more than 1 byte at a time in i2c_write)

Fix the Ethernet support by introducing right timings.

Signed-off-by: Igor Grinberg grinb...@compulab.co.il
---
 board/cm_t35/cm_t35.c |   11 ++-
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/board/cm_t35/cm_t35.c b/board/cm_t35/cm_t35.c
index bc991c4..ee7d5a0 100644
--- a/board/cm_t35/cm_t35.c
+++ b/board/cm_t35/cm_t35.c
@@ -362,16 +362,17 @@ static void reset_net_chip(void)
 {
/* Set GPIO1 of TPS65930 as output */
twl4030_i2c_write_u8(TWL4030_CHIP_GPIO, 0x02,
-TWL4030_BASEADD_GPIO+0x03);
+   TWL4030_BASEADD_GPIO + 0x03);
/* Send a pulse on the GPIO pin */
twl4030_i2c_write_u8(TWL4030_CHIP_GPIO, 0x02,
-TWL4030_BASEADD_GPIO+0x0C);
+   TWL4030_BASEADD_GPIO + 0x0C);
udelay(1);
twl4030_i2c_write_u8(TWL4030_CHIP_GPIO, 0x02,
-TWL4030_BASEADD_GPIO+0x09);
-   udelay(1);
+   TWL4030_BASEADD_GPIO + 0x09);
+   mdelay(40);
twl4030_i2c_write_u8(TWL4030_CHIP_GPIO, 0x02,
-TWL4030_BASEADD_GPIO+0x0C);
+   TWL4030_BASEADD_GPIO + 0x0C);
+   mdelay(1);
 }
 #else
 static inline void reset_net_chip(void) {}
-- 
1.7.3.4

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


Re: [U-Boot] [PATCH v2] spi/kirkwood: add weak functions board_spi_bus_claim/release

2012-04-03 Thread Prafulla Wadaskar


 -Original Message-
 From: Valentin Longchamp [mailto:valentin.longch...@keymile.com]
 Sent: 02 April 2012 19:07
 To: Prafulla Wadaskar
 Cc: u-boot@lists.denx.de; Gerlando Falauto; Holger Brunck
 Subject: Re: [PATCH v2] spi/kirkwood: add weak functions
 board_spi_bus_claim/release
 
 Dear Prafulla,
 
 On 03/30/2012 02:58 PM, Prafulla Wadaskar wrote:
  -Original Message-
  From: Valentin Longchamp [mailto:valentin.longch...@keymile.com]
  Sent: 30 March 2012 17:45
  To: Prafulla Wadaskar
  Cc: u-boot@lists.denx.de; Gerlando Falauto; Holger Brunck
  Subject: Re: [PATCH v2] spi/kirkwood: add weak functions
  board_spi_bus_claim/release
 
  Hi Prafulla,
 
  For the simplicity of the discussion, I have removed everything in
 the
  discussion that is not relevant for the current open point.
 
  On 03/30/2012 01:34 PM, Prafulla Wadaskar wrote:
  In Kirkwood specific claim_bus API, you will backup default
  configuration (which is NF in your case) for these particular pins
  (SPI_SI, SPI_SCK, SPI_CSn, MOSI, MISO).
 
  But which MPP are these particular pins ?
 
  Let's have a look at a single signal, SPI_SCK for instance. From
 the
  88F6281
  Hardware Spec [1], page 53, SPI_SCK can be MPP[2], MPP[10]. How can
  the generic
  driver know which one actually is wired to the SPI device SCK pin
 on
  the
  currently running hardware (when none is configured as then, since
 by
  default
  for us MPP[2] is NF_IO[4] and MPP[10] is UA0_TXD ) ? This is a
 board
  specific !
 
  If you tell me how I easily can find this out in the kirkwood
 driver,
 
  Dear Valentin
 
  Please make a use of CONFIG_SF_DEFAULT_CS for this.
 
 Is this really the correct #define to use ? From the documentation,
 this is
 supposed to set the Serial Flash CS. OK our SPI controller is used for
 serial
 flash access, but this may be used for something else.

Dear Valentin

I don't think there should be any issue, finally those are defined to configure 
CS (one of mpp) for arch specific SPI driver. And we are just extending its 
usage for other SPI signals.

 
 So I would not use this #define, nor any that is related to Serial
 Flash support.
 
  By default this is defined to 0, lets map it to our default use case
 i.e. using MPP0-3 for default SPI signals
 
  One may pre-define this in his board config as per specific need,
 and we can use this effectively in Kirkwood_spi driver.
  i.e.
   bit0 to be used to configure SPI_CSn
   bit1 to be used to configure SPI_MOSI... and so on
 
  so if my needs are to use
  1. MPP7 as SPI_CSn I will define CONFIG_SF_DEFAULT_CS to 0x01
  2. MPP6 as SPI_MOSI I will define CONFIG_SF_DEFAULT_CS to 0x02
  2. MPP6 as SPI_MOSI and MPP7 as SPI_CSn, I will define
 CONFIG_SF_DEFAULT_CS to 0x03
  .. and so on.
 
 
 Yeah I see what you mean and that's what I had figured out. But I
 don't think
 this is a simple solution:

But this is better than providing weak APIs to avoid code duplication.

 
 1) We would have to add another CONFIG_SYS_XY for this purpose (as
 explained above)

Okay, this is also a better solution.

 
 2) The two spi_claim_bus and spi_release_bus functions should
 implement some bit
 masking on the new CONFIG_SYS_XY to determine 4 pins that have to be
 configured.
 The number of code lines would not be huge, but that would still be a
 lot more
 than the 10 lines that my board specific functions would require. 10
 sequencial
 c line codes/board are from my point of view acceptable (and it would
 be only
 for our board, since I see no other board using this).

I don't think just from your board point of view, just think if there are 15 
more boards being mainlined needs this support.

 
 OK genericity is nice, but I guess we would be the only ones using
 this code,

Today... who knows tomorrow :-), if I would have supported this feature in the 
beginning, I would have followed this method to expose this feature, that you 
would have used :-)

 and it would not be worth it in this case. Additionnaly, I like the
 fact that
 anything that has to do with the mpp configurations stays in one
 single board
 specific .c file.

I agree, but this is dynamic usage of MPPs, spi_claim/release are SPI 
functions, so let SPI driver handle it.

Even I can say : you should not have designed a board which shares the same 
mpps for two peripheral which are actively used (not either/or)

Any ways, these are requirements, s/w has framework in place, so why not to use 
it in generic way?

Regards..
Prafulla . . .

 
 Regards
 
 --
 Valentin Longchamp
 Embedded Software Engineer
 Hardware and Chip Integration
 __
 KEYMILE AG
 Schwarzenburgstr. 73
 CH-3097 Liebefeld
 Phone +41 31 377 1318
 Fax   +41 31 377 1212
 valentin.longch...@keymile.com
 www.keymile.com
 __
 KEYMILE: A Specialist as a Partner
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 0/2] misc:pmic: Support for MAX8997 PMIC at Trats Samsung device

2012-04-03 Thread Minkyu Kang
On 29 March 2012 20:29, Lukasz Majewski l.majew...@samsung.com wrote:
 This patch series adds support for MAX8997 PMIC device. This device has
 been used at Trats Samsung target board.

 ---
 Changes for v2:
 - function for converting voltage to register value has been removed

 ---
 Lukasz Majewski (2):
  misc:pmic:max8997 MAX8997 support for PMIC driver
  misc:pmic:samsung Convert TRATS target to use MAX8997 instead of
    MAX8998

  board/samsung/trats/trats.c |   27 +++
  drivers/misc/Makefile       |    1 +
  drivers/misc/pmic_max8997.c |   43 ++
  include/configs/trats.h     |    2 +-
  include/max8997_pmic.h      |  190 
 +++
  5 files changed, 245 insertions(+), 18 deletions(-)
  create mode 100644 drivers/misc/pmic_max8997.c
  create mode 100644 include/max8997_pmic.h


applied to u-boot-samsung.

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


[U-Boot] [PATCH v9] usb: align buffers at cacheline

2012-04-03 Thread Puneet Saxena
This avoids cache-alignment warnings shown in console
when a usb command is entered.

Whenever X bytes of unaligned buffer is invalidated, arm core
invalidates X + Y bytes as per the cache line size and throws
these warnings.

Signed-off-by: Puneet Saxena pune...@nvidia.com
---

This patch is tested on denx-uboot-arm/master. 
Stop address alignment warnings still seen which should not 
be suppressed. See further discussion on this @
http://lists.denx.de/pipermail/u-boot/2012-March/120031.html  

Changes for V7:
- Trivial change, missed removing memcpy. Removed now.
Changes for V8:
- Corrected setup_packet allocation using ALLOC_CACHE_ALIGN_BUFFER.


 common/cmd_usb.c |3 +-
 common/usb.c |   22 +-
 common/usb_hub.c |   27 +++---
 common/usb_storage.c |   59 +++--
 disk/part_dos.c  |2 +-
 include/scsi.h   |4 ++-
 include/usb.h|4 ++-
 7 files changed, 62 insertions(+), 59 deletions(-)

diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index 9eba271..a8e3ae5 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -150,7 +150,8 @@ void usb_display_class_sub(unsigned char dclass, unsigned 
char subclass,
 
 void usb_display_string(struct usb_device *dev, int index)
 {
-   char buffer[256];
+   ALLOC_CACHE_ALIGN_BUFFER(char, buffer, 256);
+
if (index != 0) {
if (usb_string(dev, index, buffer[0], 256)  0)
printf(String: \%s\, buffer);
diff --git a/common/usb.c b/common/usb.c
index 1ec30bc..87ffb79 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -169,7 +169,7 @@ int usb_control_msg(struct usb_device *dev, unsigned int 
pipe,
unsigned short value, unsigned short index,
void *data, unsigned short size, int timeout)
 {
-   struct devrequest setup_packet;
+   ALLOC_CACHE_ALIGN_BUFFER(struct devrequest, setup_packet, 1);
 
if ((timeout == 0)  (!asynch_allowed)) {
/* request for a asynch control pipe is not allowed */
@@ -177,17 +177,17 @@ int usb_control_msg(struct usb_device *dev, unsigned int 
pipe,
}
 
/* set setup command */
-   setup_packet.requesttype = requesttype;
-   setup_packet.request = request;
-   setup_packet.value = cpu_to_le16(value);
-   setup_packet.index = cpu_to_le16(index);
-   setup_packet.length = cpu_to_le16(size);
+   setup_packet-requesttype = requesttype;
+   setup_packet-request = request;
+   setup_packet-value = cpu_to_le16(value);
+   setup_packet-index = cpu_to_le16(index);
+   setup_packet-length = cpu_to_le16(size);
USB_PRINTF(usb_control_msg: request: 0x%X, requesttype: 0x%X,  \
   value 0x%X index 0x%X length 0x%X\n,
   request, requesttype, value, index, size);
dev-status = USB_ST_NOT_PROC; /*not yet processed */
 
-   submit_control_msg(dev, pipe, data, size, setup_packet);
+   submit_control_msg(dev, pipe, data, size, setup_packet);
if (timeout == 0)
return (int)size;
 
@@ -681,7 +681,7 @@ static int usb_string_sub(struct usb_device *dev, unsigned 
int langid,
  */
 int usb_string(struct usb_device *dev, int index, char *buf, size_t size)
 {
-   unsigned char mybuf[USB_BUFSIZ];
+   ALLOC_CACHE_ALIGN_BUFFER(unsigned char, mybuf, USB_BUFSIZ);
unsigned char *tbuf;
int err;
unsigned int u, idx;
@@ -781,7 +781,7 @@ int usb_new_device(struct usb_device *dev)
 {
int addr, err;
int tmp;
-   unsigned char tmpbuf[USB_BUFSIZ];
+   ALLOC_CACHE_ALIGN_BUFFER(unsigned char, tmpbuf, USB_BUFSIZ);
 
/* We still haven't set the Address yet */
addr = dev-devnum;
@@ -908,8 +908,8 @@ int usb_new_device(struct usb_device *dev)
le16_to_cpus(dev-descriptor.idProduct);
le16_to_cpus(dev-descriptor.bcdDevice);
/* only support for one config for now */
-   usb_get_configuration_no(dev, tmpbuf[0], 0);
-   usb_parse_config(dev, tmpbuf[0], 0);
+   usb_get_configuration_no(dev, tmpbuf, 0);
+   usb_parse_config(dev, tmpbuf, 0);
usb_set_maxpacket(dev);
/* we set the default configuration here */
if (usb_set_configuration(dev, dev-config.desc.bConfigurationValue)) {
diff --git a/common/usb_hub.c b/common/usb_hub.c
index e0edaad..f35ad95 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -153,7 +153,7 @@ int hub_port_reset(struct usb_device *dev, int port,
unsigned short *portstat)
 {
int tries;
-   struct usb_port_status portsts;
+   ALLOC_CACHE_ALIGN_BUFFER(struct usb_port_status, portsts, 1);
unsigned short portstatus, portchange;
 
USB_HUB_PRINTF(hub_port_reset: resetting port %d...\n, port);
@@ -162,13 +162,13 @@ int hub_port_reset(struct usb_device *dev, int port,
usb_set_port_feature(dev, port + 1, 

Re: [U-Boot] [PATCH 0/6] add zip command support for uboot

2012-04-03 Thread Lei Wen
Hi Mike,

On Tue, Apr 3, 2012 at 3:17 AM, Mike Frysinger vap...@gentoo.org wrote:
 On Tue, Mar 27, 2012 at 04:04, Lei Wen adrian.w...@gmail.com wrote:
 On Sun, Mar 25, 2012 at 11:53 PM,  adrian.w...@gmail.com wrote:
 From: Lei Wen lei...@marvell.com

 This patch set add zip command support for uboot.
 The first two patches import deflate and trees functions from zlib 1.2.5
 without any change. While the third patch did the necessary change to
 make the import file could be built passed in uboot environment.

 Any comments to this series?

 did you forward port the misc fixes/optimization that were done ?  or
 did you just drop in the new code ?

The fixes/optimization is already separated in different patch, as the
0004 in current series.
Other file is just import as intact from zlib1.2.5, the 0001 and 0002 patch.



 for example, cd514aeb996e2f7aefbe1f78481965d9d074aed4 is pretty important

I see. I try my best to keep the current modification history adding
to the original zlib code.


 you can view other fixes by:
  git log -p -- lib_generic/zlib.c
  git log -p -- lib/zlib.c
  git log -p -- lib/zlib/
 -mike

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


[U-Boot] [PATCH] bootm: fix usage of lmb_reserve()

2012-04-03 Thread Andreas Bießmann
From: Andreas Bießmann biessm...@corscience.de

commit 44f074c771c4b70d250b0d7ed2f7513488c678bb brakes compiling avr32 boards
which do not have CONFIG_LMB. This patch re-add the empty lmb_reserve() define
to opt-out respective code parts in do_bootm() and do_bootm_subcommand().

This patch fixes errors like this:
---8---
cmd_bootm.c: In function 'do_bootm_subcommand':
cmd_bootm.c:518: error: 'bootm_headers_t' has no member named 'lmb'
cmd_bootm.c: In function 'do_bootm':
cmd_bootm.c:665: error: 'bootm_headers_t' has no member named 'lmb'
---8---

Signed-off-by: Andreas Bießmann biessm...@corscience.de
---
 common/cmd_bootm.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 9ad2535..7d72c7a 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -186,6 +186,8 @@ static void boot_start_lmb(bootm_headers_t *images)
board_lmb_reserve(images-lmb);
 }
 #else
+/* we want to opt-out access to images.lmb by precompiler !*/
+# define lmb_reserve(lmb, base, size)
 static inline void boot_start_lmb(bootm_headers_t *images) { }
 #endif
 
-- 
1.7.9.1

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


Re: [U-Boot] [PATCH] bootm: fix usage of lmb_reserve()

2012-04-03 Thread Andreas Bießmann
Hi,

On 03.04.2012 12:16, Andreas Bießmann wrote:
 From: Andreas Bießmann biessm...@corscience.de
 
 commit 44f074c771c4b70d250b0d7ed2f7513488c678bb brakes compiling avr32 boards
 which do not have CONFIG_LMB. This patch re-add the empty lmb_reserve() define
 to opt-out respective code parts in do_bootm() and do_bootm_subcommand().
 
 This patch fixes errors like this:
 ---8---
 cmd_bootm.c: In function 'do_bootm_subcommand':
 cmd_bootm.c:518: error: 'bootm_headers_t' has no member named 'lmb'
 cmd_bootm.c: In function 'do_bootm':
 cmd_bootm.c:665: error: 'bootm_headers_t' has no member named 'lmb'
 ---8---

again days to late and about half an hour unnecessary work ... should
really check ML more often.

http://patchwork.ozlabs.org/patch/149924/ was before.

 Signed-off-by: Andreas Bießmann biessm...@corscience.de
 ---
  common/cmd_bootm.c |2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)
 
 diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
 index 9ad2535..7d72c7a 100644
 --- a/common/cmd_bootm.c
 +++ b/common/cmd_bootm.c
 @@ -186,6 +186,8 @@ static void boot_start_lmb(bootm_headers_t *images)
   board_lmb_reserve(images-lmb);
  }
  #else
 +/* we want to opt-out access to images.lmb by precompiler !*/

I would like to have some comment like this in the other patch.

regards

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


Re: [U-Boot] [PATCH] Prevent malloc with size 0

2012-04-03 Thread Graeme Russ
On 04/03/2012 09:35 AM, Graeme Russ wrote:
 Hi Jocke

 And I really need to check, but I have a sneaking suspicion that as the
 code currently stands in U-Boot/x86 dereferencing a NULL pointer won't
 cause an exception. In x86, U-Boot configures all protected mode segments
 to be 4GB starting at physical address 0x with no virtual address
 translation. Accessing physical address 0x is just as valid as
 accessing 0x0001 (or any other address).
 
 Now if I set segments to start at 0x0002 then I can trap a segmentation
 fault for accesses to 0x (NULL) and 0x0001 (malloc(0) pointer)
 
 That will mean that U-Boot cannot ever access those two bytes of memory,
 but I doubt that I would ever want to. And I will need to set the segments
 to base address 0x before jumping into Linux...

OK, this is not as easy as it sounds. Detecting NULL pointer dereferences
will involve enabling paging[1] which is something I really do not want to
do in U-Boot. Flat Protected Mode with a 4GB linear map is perfectly fit
for purpose, and that is how the Linux kernel expects things to be
configured so it will be a major PITA to change.

In short, returning non-NULL from malloc(0) and expecting a CPU exception
when it is de-referenced is not going to fly.

If we choose this path, at least put a debug() statement in to warn when
malloc(0) is called.

Regards,

Graeme

[1] Apparently the way do do it is to reserve the entire first 4kB page and
mark it as 'not-present' so any access causes a page-fault.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] MIPS: Add initial support for EMMA3SL/LP

2012-04-03 Thread Shinya Kuribayashi
On Sun, Apr 1, 2012 at 4:40 AM, Marek Vasut marek.va...@gmail.com wrote:
 This patch adds initial support for EMMA3SL/LP board.
 Network and USB support will be added as follow up patches.

 Signed-off-by: Serge Ziryukin ftrvxm...@gmail.com

 Would you care to resubmit updated version of this patch please? Or shall I
 discard it?

This was posted by mistake, he was not allowed to make it public.  Also we
(Renesas) have no intention of mainlining it at the moment.

Please discard it.  I would give an official NACK, if necessary.

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


Re: [U-Boot] [PATCH 0/3] MIPS: fixes for 2012.04-rc1

2012-04-03 Thread Shinya Kuribayashi
 this series collects the bugfix patches from the open patches at patchwork
 delegated to you. Only these patches should be merged for the release.
 The other patches are superseeded for now.

 The series is rebased against v2012.04-rc1 and needs your patch
 http://patchwork.ozlabs.org/patch/149924/ to run MAKEALL -a mips.

 Shinya-san, you ok with these patches hitting .04?

Suggestions/comments from Mike to the last submission are not reflected in
[PATCH 2/3] (MIPS: fix inconsistency in config option for cache operation mode),
but other than that these three patches are Ok with me.

 I'll roll then through my -staging if it's fine.

Thanks in advance, I don't have enough bandwidth to catch up with the latest
tree/discussion, nor doing build tests and/or boot tests.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] tricorder: Load kernel from ubifs

2012-04-03 Thread Thomas Weber
From: Bernhard Walle wa...@corscience.de

Signed-off-by: Bernhard Walle wa...@corscience.de
---
 include/configs/tricorder.h |9 +++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/configs/tricorder.h b/include/configs/tricorder.h
index d826e19..801a24f 100644
--- a/include/configs/tricorder.h
+++ b/include/configs/tricorder.h
@@ -182,7 +182,8 @@
setenv bootargs ${bootargs}  \
omapfb.mode=lcd:${lcdmode}  \
omapdss.def_disp=${defaultdisplay}  \
-   root=ubi0:rootfs  \
+   root=ubi0:root  \
+   ubi.mtd=4  \
rootfstype=ubifs  \
${kernelopts}\0 \
loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0 \
@@ -193,9 +194,13 @@
mmcboot=echo Booting from mmc ...;  \
run mmcargs;  \
bootm ${loadaddr}\0 \
+   loaduimage_ubi=mtd default;  \
+   ubi part fs;  \
+   ubifsmount root;  \
+   ubifsload ${loadaddr} /boot/uImage\0 \
nandboot=echo Booting from nand ...;  \
run nandargs;  \
-   nand read ${loadaddr} 28 40;  \
+   run loaduimage_ubi;  \
bootm ${loadaddr}\0 \
autoboot=if mmc rescan ${mmcdev}; then  \
if run loadbootscript; then  \
-- 
1.7.8.5

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


[U-Boot] [PATCH 1/2] tricorder: Add UBIFS

2012-04-03 Thread Thomas Weber
From: Bernhard Walle wa...@corscience.de

Since kernel should be in a ubifs partition, we need UBIFS.
The greater malloc size is needed for UBIFS.

Signed-off-by: Bernhard Walle wa...@corscience.de

Squashed two commits (UBIFS enabled and malloc size increased) into one.
Signed-off-by: Thomas Weber we...@corscience.de
---
 include/configs/tricorder.h |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/configs/tricorder.h b/include/configs/tricorder.h
index ba8847b..d826e19 100644
--- a/include/configs/tricorder.h
+++ b/include/configs/tricorder.h
@@ -71,7 +71,7 @@
 /* Size of malloc() pool */
 #define CONFIG_ENV_SIZE(128  10) /* 128 KiB */
/* Sector */
-#define CONFIG_SYS_MALLOC_LEN  (CONFIG_ENV_SIZE + (512  10))
+#define CONFIG_SYS_MALLOC_LEN  (1024*1024)
 
 /* Hardware drivers */
 
@@ -139,7 +139,9 @@
 #define CONFIG_CMD_MTDPARTS/* Enable MTD parts commands */
 #define CONFIG_CMD_NAND/* NAND support */
 #define CONFIG_CMD_NAND_LOCK_UNLOCK/* nand (un)lock commands */
-#define CONFIG_CMD_UBI /* UBIFS commands */
+#define CONFIG_CMD_UBI /* UBI commands */
+#define CONFIG_CMD_UBIFS   /* UBIFS commands */
+#define CONFIG_LZO /* LZO is needed for UBIFS */
 
 #undef CONFIG_CMD_NET
 #undef CONFIG_CMD_NFS
-- 
1.7.8.5

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


Re: [U-Boot] [PATCH v2] Correct corrupted NAND Flash access on KARO TX25 modules

2012-04-03 Thread Stefano Babic
On 03/04/2012 07:26, Gachet Daniel wrote:
 Hi Stefano,

Hi Daniel,

 
 No problem, I will do it with the inverse logic, using a
 CONFIG_NAND_MXC_NFC_TWO_CYCLES, and adapt the tx25.h file. But could
 you tell me in which README file I should add the description for
 that switch? I have a look at all README, but no one has any
 description about NAND flash configuration flags (like
 CONFIG_NAND_MXC, CONFIG_NAND_MXC_V1_1  or CONFIG_MXC_NAND_HWECC).

You have found missing documentation ;-(. Maybe it was not checked
before, but you're right: there is no documentation for this driver.
Even worse, there is no NAND Support at all.

Please feel free to add a section. I think the right place is under Low
Level (hardware related) configuration options, adding a part for the
MXC Nand driver. And if you want to integrate it with the missing
documentation for the other CONFIG_NAND_MXC options, it will be highly
appreciated.

Thanks,
Stefano Babic

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


Re: [U-Boot] [PATCH 2/3] MIPS: fix inconsistency in config option for cache operation mode

2012-04-03 Thread Marek Vasut
Mike, there was some issue with this patch?

 Commit ab2a98b11716364bc5a8c43cdfa7fee176cda1d8 missed to
 use the new config option in dcache_enable().
 
 Fix this to avoid inconsistencies if someone wants to disable
 and enable D-caches.
 
 Signed-off-by: Daniel Schwierzeck daniel.schwierz...@googlemail.com
 ---
  arch/mips/cpu/mips32/cache.S |6 +-
  1 file changed, 5 insertions(+), 1 deletion(-)
 
 diff --git a/arch/mips/cpu/mips32/cache.S b/arch/mips/cpu/mips32/cache.S
 index 5ce0ec4..e683e8b 100644
 --- a/arch/mips/cpu/mips32/cache.S
 +++ b/arch/mips/cpu/mips32/cache.S
 @@ -30,6 +30,10 @@
  #include asm/addrspace.h
  #include asm/cacheops.h
 
 +#ifndef CONFIG_SYS_MIPS_CACHE_MODE
 +#define CONFIG_SYS_MIPS_CACHE_MODE CONF_CM_CACHABLE_NONCOHERENT
 +#endif
 +
  #define RA   t8
 
  /*
 @@ -224,7 +228,7 @@ LEAF(dcache_enable)
   mfc0t0, CP0_CONFIG
   ori t0, CONF_CM_CMASK
   xorit0, CONF_CM_CMASK
 - ori t0, CONF_CM_CACHABLE_NONCOHERENT
 + ori t0, CONFIG_SYS_MIPS_CACHE_MODE
   mtc0t0, CP0_CONFIG
   jr  ra
   END(dcache_enable)

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


Re: [U-Boot] [PATCH] bootm: fix usage of lmb_reserve()

2012-04-03 Thread Marek Vasut
Dear Andreas Bießmann,

 Hi,
 
 On 03.04.2012 12:16, Andreas Bießmann wrote:
  From: Andreas Bießmann biessm...@corscience.de
  
  commit 44f074c771c4b70d250b0d7ed2f7513488c678bb brakes compiling avr32
  boards which do not have CONFIG_LMB. This patch re-add the empty
  lmb_reserve() define to opt-out respective code parts in do_bootm() and
  do_bootm_subcommand().
  
  This patch fixes errors like this:
  ---8---
  cmd_bootm.c: In function 'do_bootm_subcommand':
  cmd_bootm.c:518: error: 'bootm_headers_t' has no member named 'lmb'
  cmd_bootm.c: In function 'do_bootm':
  cmd_bootm.c:665: error: 'bootm_headers_t' has no member named 'lmb'
  ---8---
 
 again days to late and about half an hour unnecessary work ... should
 really check ML more often.
 
 http://patchwork.ozlabs.org/patch/149924/ was before.
 
  Signed-off-by: Andreas Bießmann biessm...@corscience.de
  ---
  
   common/cmd_bootm.c |2 ++
   1 files changed, 2 insertions(+), 0 deletions(-)
  
  diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
  index 9ad2535..7d72c7a 100644
  --- a/common/cmd_bootm.c
  +++ b/common/cmd_bootm.c
  @@ -186,6 +186,8 @@ static void boot_start_lmb(bootm_headers_t *images)
  
  board_lmb_reserve(images-lmb);
   
   }
   #else
  
  +/* we want to opt-out access to images.lmb by precompiler !*/
 
 I would like to have some comment like this in the other patch.

Errr ... I believe we should have a subsequent fix that removes the aftereffect 
of the macro altogether.

 
 regards
 
 Andreas Bießmann

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


Re: [U-Boot] [PATCH] MIPS: Add initial support for EMMA3SL/LP

2012-04-03 Thread Marek Vasut
Dear Shinya Kuribayashi,

 On Sun, Apr 1, 2012 at 4:40 AM, Marek Vasut marek.va...@gmail.com wrote:
  This patch adds initial support for EMMA3SL/LP board.
  Network and USB support will be added as follow up patches.
  
  Signed-off-by: Serge Ziryukin ftrvxm...@gmail.com
  
  Would you care to resubmit updated version of this patch please? Or shall
  I discard it?
 
 This was posted by mistake, he was not allowed to make it public.  Also we
 (Renesas) have no intention of mainlining it at the moment.
 
 Please discard it.  I would give an official NACK, if necessary.

All right, discarding. Mistakes happen, don't be angry at him ;-)

 
   Shinya

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


[U-Boot] [PATCH V2] USB:gadget:designware USB OTG implementation

2012-04-03 Thread Amit Virdi
From: Pratyush Anand pratyush.an...@st.com

Driver for designware otg device only implements device functionality
and is meant to be used with usbtty interface.
This driver will work mainly for Control and Bulk endpoints. Periodic
transfer has not been verified using these drivers.

Signed-off-by: Pratyush Anand pratyush.an...@st.com
Signed-off-by: Amit Virdi amit.vi...@st.com
---
 drivers/serial/usbtty.h |2 +
 drivers/usb/gadget/Makefile |1 +
 drivers/usb/gadget/designware_otg.c |  990 +++
 include/usb/designware_otg.h|  523 ++
 4 files changed, 1516 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/gadget/designware_otg.c
 create mode 100644 include/usb/designware_otg.h

diff --git a/drivers/serial/usbtty.h b/drivers/serial/usbtty.h
index eb670da..bd3bcbc 100644
--- a/drivers/serial/usbtty.h
+++ b/drivers/serial/usbtty.h
@@ -35,6 +35,8 @@
 #include usb/pxa27x_udc.h
 #elif defined(CONFIG_DW_UDC)
 #include usb/designware_udc.h
+#elif defined(CONFIG_DW_OTG)
+#include usb/designware_otg.h
 #endif
 
 #include version.h
diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index 87d1918..ede367e 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -40,6 +40,7 @@ ifdef CONFIG_USB_DEVICE
 COBJS-y += core.o
 COBJS-y += ep0.o
 COBJS-$(CONFIG_DW_UDC) += designware_udc.o
+COBJS-$(CONFIG_DW_OTG) += designware_otg.o
 COBJS-$(CONFIG_OMAP1510) += omap1510_udc.o
 COBJS-$(CONFIG_OMAP1610) += omap1510_udc.o
 COBJS-$(CONFIG_MPC885_FAMILY) += mpc8xx_udc.o
diff --git a/drivers/usb/gadget/designware_otg.c 
b/drivers/usb/gadget/designware_otg.c
new file mode 100644
index 000..5af6940
--- /dev/null
+++ b/drivers/usb/gadget/designware_otg.c
@@ -0,0 +1,990 @@
+/*
+ * Based on drivers/usb/gadget/designware_otg.c
+ * Synopsys DW OTG Device bus interface driver
+ *
+ * (C) Copyright 2011
+ * Pratyush Anand, ST Micoelectronics, pratyush.an...@st.com.
+ *
+ * (C) Copyright 2012
+ * Amit Virdi, ST Micoelectronics, amit.vi...@st.com.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include common.h
+#include asm/io.h
+#include usbdevice.h
+#include watchdog.h
+#include ep0.h
+#include usb/designware_otg.h
+#include asm/arch/hardware.h
+
+#define UDC_INIT_MDELAY80  /* Device settle delay */
+
+static struct urb *ep0_urb;
+static struct usb_device_instance *udc_device;
+
+static struct device_ifdevice_if_mem;
+static struct device_if*dev_if = device_if_mem;
+
+#if defined(CONFIG_USBD_HS)
+#define CONFIG_USBD_SERIAL_BULK_PKTSIZEUDC_BULK_HS_PACKET_SIZE
+#endif
+
+void udc_set_nak(int epid)
+{
+   setbits_le32(dev_if-out_ep_regs[epid]-doepctl, SNAK);
+   setbits_le32(dev_if-in_ep_regs[epid]-diepctl, SNAK);
+}
+
+void udc_unset_nak(int epid)
+{
+   setbits_le32(dev_if-out_ep_regs[epid]-doepctl, CNAK);
+   setbits_le32(dev_if-in_ep_regs[epid]-diepctl, CNAK);
+}
+
+static void udc_set_stall(int epid, int dir)
+{
+   if (dir)
+   setbits_le32(dev_if-in_ep_regs[epid]-diepctl, SSTALL);
+   else
+   setbits_le32(dev_if-out_ep_regs[epid]-doepctl, SSTALL);
+}
+
+/*
+ * This function enables EP0 OUT to receive SETUP packets and configures EP0
+ * IN for transmitting packets. It is normally called when the Enumeration
+ * Done interrupt occurs.
+ */
+static void dwc_otg_ep0_activate(void)
+{
+   struct device_in_ep_regs *in_ep_regs = dev_if-in_ep_regs[0];
+   struct device_out_ep_regs *out_ep_regs = dev_if-out_ep_regs[0];
+
+   /* Read the Device Status and Endpoint 0 Control registers */
+   clrsetbits_le32(in_ep_regs-diepctl, MPSMSK0, DWC_DEP0CTL_MPS_64);
+
+   /* Enable OUT EP for receive */
+   setbits_le32(out_ep_regs-doepctl, EPENA);
+}
+
+static struct usb_endpoint_instance *dw_find_ep(int ep)
+{
+   int i;
+
+   for (i = 0; i  udc_device-bus-max_endpoints; i++) {
+   if ((udc_device-bus-endpoint_array[i].endpoint_address 
+   USB_ENDPOINT_NUMBER_MASK) == ep)
+   return udc_device-bus-endpoint_array[i];
+   }
+   return NULL;
+}
+
+/*
+ * This function 

Re: [U-Boot] [PATCH 1/2] Build u-boot.imx by default when board uses it

2012-04-03 Thread Stefano Babic
On 02/04/2012 20:25, Mike Frysinger wrote:

 
 the suggested ALL-$(CONFIG_xxx) syntax should be usable in the
 arch/soc config.mk files

Right. I push a new version ;-)

Stefano

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


[U-Boot] [PATCH] mmc:fix Call mmc_init() when executing mmc_get_dev()

2012-04-03 Thread Lukasz Majewski
This code adds call to mmc_init(), for partition related commands (e.g.
fatls, fatinfo etc.).

It is safe to call mmc_init() multiple times since mmc-has_init flag
prevents from multiple initialization.

The FAT related code calls get_dev high level method and then uses
elements from mmc-block_dev, which is uninitialized until the mmc_init
(and thereof mmc_startup) is called.

This problem appears on boards, which don't use mmc as the default
place for envs

Signed-off-by: Lukasz Majewski l.majew...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Andy Fleming aflem...@gmail.com

---
Test HW:
- GONI S5PC110
- Universal C210 (Exynos4)
---
 drivers/mmc/mmc.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 618960e..1fa90e7 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1305,8 +1305,12 @@ int mmc_register(struct mmc *mmc)
 block_dev_desc_t *mmc_get_dev(int dev)
 {
struct mmc *mmc = find_mmc_device(dev);
+   if (mmc) {
+   mmc_init(mmc);
+   return mmc-block_dev;
+   }
 
-   return mmc ? mmc-block_dev : NULL;
+   return NULL;
 }
 #endif
 
-- 
1.7.2.3

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


[U-Boot] [PATCH] ARM: add u-boot.imx as target for i.MX SOCs

2012-04-03 Thread Stefano Babic
Freescale SOCs require an header to u-boot.bin

The patch adds u-boot.imx to the default targets
if the imx file is set (IMX_CONFIG).

Signed-off-by: Stefano Babic sba...@denx.de
Cc: Albert ARIBAUD albert.u.b...@aribaud.net
CC: Loïc Minier loic.min...@linaro.org
CC: Mike Frysinger vap...@gentoo.org
---
 arch/arm/cpu/armv7/config.mk |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/config.mk b/arch/arm/cpu/armv7/config.mk
index 83ddf10..f532d62 100644
--- a/arch/arm/cpu/armv7/config.mk
+++ b/arch/arm/cpu/armv7/config.mk
@@ -31,3 +31,6 @@ PLATFORM_CPPFLAGS += -march=armv5
 # =
 PF_RELFLAGS_SLB_AT := $(call cc-option,-mshort-load-bytes,$(call 
cc-option,-malignment-traps,))
 PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT)
+ifneq ($(CONFIG_IMX_CONFIG),)
+ALL-y  += $(obj)u-boot.imx
+endif
-- 
1.7.5.4

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


[U-Boot] [PATCH] cmd_sf: add size checking to spi flash commands

2012-04-03 Thread Gerlando Falauto
SPI flash operations inadvertently stretching beyond the flash size will
result in a wraparound. This may be particularly dangerous when burning
u-boot, because the flash contents will be corrupted rendering the board
unusable, without any warning being issued.
So add a consistency checking so not to overflow past the flash size.

Signed-off-by: Gerlando Falauto gerlando.fala...@keymile.com
Cc: Valentin Longchamp valentin.longch...@keymile.com
Cc: Holger Brunck holger.bru...@keymile.com
---
 common/cmd_sf.c |   14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/common/cmd_sf.c b/common/cmd_sf.c
index 9c76464..3cfedde 100644
--- a/common/cmd_sf.c
+++ b/common/cmd_sf.c
@@ -211,6 +211,13 @@ static int do_spi_flash_read_write(int argc, char * const 
argv[])
if (*argv[3] == 0 || *endp != 0)
return -1;
 
+   /* Consistency checking */
+   if (offset + len  flash-size) {
+   printf(ERROR: Attempting SPI flash %s past flash size 
(0x%x)\n,
+   argv[0], flash-size);
+   return 1;
+   }
+
buf = map_physmem(addr, len, MAP_WRBACK);
if (!buf) {
puts(Failed to map physical memory\n);
@@ -252,6 +259,13 @@ static int do_spi_flash_erase(int argc, char * const 
argv[])
if (ret != 1)
return -1;
 
+   /* Consistency checking */
+   if (offset + len  flash-size) {
+   printf(ERROR: Attempting SPI flash %s past flash size 
(0x%x)\n,
+   argv[0], flash-size);
+   return 1;
+   }
+
ret = spi_flash_erase(flash, offset, len);
if (ret) {
printf(SPI flash %s failed\n, argv[0]);
-- 
1.7.1

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


[U-Boot] [REFERENCE DON'T APPLY 1/3] dfu: Add default value for bwPollTimeout

2012-04-03 Thread Stefan Schmidt
---
 drivers/usb/gadget/dfu.c |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/dfu.c b/drivers/usb/gadget/dfu.c
index 535e194..7aed344 100644
--- a/drivers/usb/gadget/dfu.c
+++ b/drivers/usb/gadget/dfu.c
@@ -47,6 +47,10 @@
 #include malloc.h
 #include dfu.h
 
+#ifndef POLL_TIMEOUT_MILLISECONDS
+#define POLL_TIMEOUT_MILLISECONDS 5
+#endif
+
 static struct flash_entity *flash_ents;
 static int num_flash_ents;
 
@@ -271,9 +275,14 @@ static void handle_getstatus(struct usb_request *req)
 
/* send status response */
dstat-bStatus = dev-dfu_status;
-   /* FIXME: set dstat-bwPollTimeout */
dstat-bState = dev-dfu_state;
dstat-iString = 0;
+   /* FIXME: Use real values from flash subsystem here instead a hardcoded
+* value */
+   dstat-bwPollTimeout[0] = POLL_TIMEOUT_MILLISECONDS  0xff;
+   dstat-bwPollTimeout[1] = (POLL_TIMEOUT_MILLISECONDS  8)  0xff;
+   dstat-bwPollTimeout[2] = (POLL_TIMEOUT_MILLISECONDS  16)  0xff;
+   //req-actual = MIN(sizeof(*dstat), max);
 }
 
 static void handle_getstate(struct usb_request *req)
-- 
1.7.9.5

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


[U-Boot] [REFERENCE DON'T APPLY 2/3] usb/gadget: Add Device Firmware Upgrade (DFU) support.

2012-04-03 Thread Stefan Schmidt
A vendor independent standard from the USB forum to upgrade firmware on
devices over USB. U-Boot is seen as the device to be upgraded here and
exposes the functionality over the USB gadget framework.

Signed-off-by: Stefan Schmidt ste...@datenfreihafen.org
---
 drivers/serial/usbtty.c|   22 +-
 drivers/serial/usbtty.h|6 +
 drivers/usb/dfu/nand.c |  386 +
 drivers/usb/gadget/Makefile|4 +-
 drivers/usb/gadget/core.c  |   19 ++
 drivers/usb/gadget/dfu.c   |   57 -
 drivers/usb/gadget/dfu_old.c   |  521 
 drivers/usb/gadget/ep0.c   |   50 +++-
 include/configs/omap3_beagle.h |3 +
 include/dfu_backend.h  |   16 ++
 include/usb_dfu.h  |   97 
 include/usb_dfu_descriptors.h  |   94 
 include/usbdevice.h|   13 +
 13 files changed, 1274 insertions(+), 14 deletions(-)
 create mode 100644 drivers/usb/dfu/nand.c
 create mode 100644 drivers/usb/gadget/dfu_old.c
 create mode 100644 include/usb_dfu.h
 create mode 100644 include/usb_dfu_descriptors.h

diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c
index cffd5a2..b13b497 100644
--- a/drivers/serial/usbtty.c
+++ b/drivers/serial/usbtty.c
@@ -22,6 +22,8 @@
  */
 
 #include common.h
+#include usb_dfu_descriptors.h
+#include usb_dfu.h
 #include config.h
 #include circbuf.h
 #include stdio_dev.h
@@ -101,7 +103,7 @@ extern struct usb_string_descriptor **usb_strings;
 static unsigned short rx_endpoint = 0;
 static unsigned short tx_endpoint = 0;
 static unsigned short interface_count = 0;
-static struct usb_string_descriptor *usbtty_string_table[STR_COUNT];
+static struct usb_string_descriptor *usbtty_string_table[NUM_STRINGS];
 
 /* USB Descriptor Strings */
 static u8 wstrLang[4] = {4,USB_DT_STRING,0x9,0x4};
@@ -151,6 +153,10 @@ struct acm_config_desc {
/* Slave Interface */
struct usb_interface_descriptor data_class_interface;
struct usb_endpoint_descriptor data_endpoints[NUM_ENDPOINTS-1];
+#ifdef CONFIG_USBD_DFU
+   struct usb_interface_descriptor uif_dfu;
+   struct usb_dfu_func_descriptor func_dfu;
+#endif
 } __attribute__((packed));
 
 static struct acm_config_desc acm_configuration_descriptors[NUM_CONFIGS] = {
@@ -161,7 +167,11 @@ static struct acm_config_desc 
acm_configuration_descriptors[NUM_CONFIGS] = {
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength =
cpu_to_le16(sizeof(struct acm_config_desc)),
+#ifdef CONFIG_USBD_DFU
+   .bNumInterfaces = NUM_ACM_INTERFACES + 1,
+#else
.bNumInterfaces = NUM_ACM_INTERFACES,
+#endif
.bConfigurationValue = 1,
.iConfiguration = STR_CONFIG,
.bmAttributes =
@@ -260,6 +270,11 @@ static struct acm_config_desc 
acm_configuration_descriptors[NUM_CONFIGS] = {
.bInterval  = 0xFF,
},
},
+#ifdef CONFIG_USBD_DFU
+   /* Interface 3 */
+   .uif_dfu = DFU_RT_IF_DESC,
+   .func_dfu = DFU_FUNC_DESC,
+#endif
},
 };
 
@@ -370,7 +385,7 @@ static int fill_buffer (circbuf_t * buf);
 void usbtty_poll (void);
 
 /* utility function for converting char* to wide string used by USB */
-static void str2wide (char *str, u16 * wide)
+void str2wide (char *str, u16 * wide)
 {
int i;
for (i = 0; i  strlen (str)  str[i]; i++){
@@ -639,6 +654,9 @@ static void usbtty_init_instances (void)
device_instance-bus = bus_instance;
device_instance-configurations = NUM_CONFIGS;
device_instance-configuration_instance_array = config_instance;
+#ifdef CONFIG_USBD_DFU
+   dfu_init_instance(device_instance);
+#endif
 
/* initialize bus instance */
memset (bus_instance, 0, sizeof (struct usb_bus_instance));
diff --git a/drivers/serial/usbtty.h b/drivers/serial/usbtty.h
index 14961c1..16ae86e 100644
--- a/drivers/serial/usbtty.h
+++ b/drivers/serial/usbtty.h
@@ -84,4 +84,10 @@
 #define STR_CTRL_INTERFACE 0x06
 #define STR_COUNT  0x07
 
+#ifdef CONFIG_USBD_DFU
+#define NUM_STRINGSDFU_STR_COUNT
+#else
+#define NUM_STRINGSSTR_COUNT
+#endif
+
 #endif
diff --git a/drivers/usb/dfu/nand.c b/drivers/usb/dfu/nand.c
new file mode 100644
index 000..619ba0f
--- /dev/null
+++ b/drivers/usb/dfu/nand.c
@@ -0,0 +1,386 @@
+#include common.h
+#include nand.h
+#include jffs2/load_kernel.h
+#include dfu_backend.h
+#include flash_entity.h
+int mtdparts_init(void);
+extern struct list_head devices;
+
+};
+
+static struct flash_entity_ctx ctx;
+
+/* Return the 'net size' of the partition (i.e. excluding any bad blocks) */
+unsigned int nand_net_part_size(struct part_info *part)
+{
+   struct mtd_info *mtd;
+   unsigned int offs;
+   unsigned int bb_delta = 0;

[U-Boot] [REFERENCE DON'T APPLY 3/3] beagle: Enable DFU support with stub functions for now

2012-04-03 Thread Stefan Schmidt
---
 board/ti/beagle/beagle.c   |   17 +
 board/ti/beagle/config.mk  |4 
 include/configs/omap3_beagle.h |9 -
 3 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index 9482c5e..e904b10 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -528,3 +528,20 @@ U_BOOT_CMD(
Return the status of the BeagleBoard USER button,

 );
+
+void register_flash_areas(void);
+void unregister_flash_areas(void);
+
+void board_dfu_init(void)
+{
+   register_flash_areas();
+}
+
+void board_dfu_cleanup(void)
+{
+   unregister_flash_areas();
+}
+
+void dfu_init(void) {}
+void dfu_cleanup(void){}
+void usb_gadget_handle_interrupts(void){}
diff --git a/board/ti/beagle/config.mk b/board/ti/beagle/config.mk
index cf055db..203d920 100644
--- a/board/ti/beagle/config.mk
+++ b/board/ti/beagle/config.mk
@@ -31,3 +31,7 @@
 
 # For use with external or internal boots.
 CONFIG_SYS_TEXT_BASE = 0x80008000
+
+CONFIG_USB_DFU_VENDOR=0x1457
+CONFIG_USB_DFU_PRODUCT=0x5119
+CONFIG_USB_DFU_REVISION=0x0230
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index 6be4d10..08c4699 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -139,8 +139,15 @@
 #define CONFIG_USB_ETHER_ASIX
 
 #define CONFIG_DFU_GADGET
+#define CONFIG_CMD_DEVICE_FIRMWARE_UPGRADE
 //#define CONFIG_USB_ETHER
 
+#define CONFIG_USBD_DFU1
+#define CONFIG_USBD_DFU_XFER_SIZE  0x1000
+#define CONFIG_USBD_DFU_INTERFACE  2
+
+#define DFU_NUM_ALTERNATES 6
+
 
 /* commands to include */
 #include config_cmd_default.h
@@ -341,7 +348,7 @@
  */
 #define CONFIG_STACKSIZE   (128  10) /* regular stack 128 KiB */
 #ifdef CONFIG_USE_IRQ
-#define CONFIG_STACKSIZE_IRQ   (4  10)   /* IRQ stack 4 KiB */
+#define CONFIG_STACKSIZE_IRQ   (8  10)   /* IRQ stack 8 KiB */
 #define CONFIG_STACKSIZE_FIQ   (4  10)   /* FIQ stack 4 KiB */
 #endif
 
-- 
1.7.9.5

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


Re: [U-Boot] [PATCH 2/4] dfu: generic backend parts

2012-04-03 Thread Stefan Schmidt
Hello.

On Mon, 2012-01-09 at 08:50, Andrzej Pietrasiewicz wrote:
 
 Thank you for your review. As far as I remember this patch series
 was a quick-and-dirty attempt at splitting the implementation into
 parts so that Stefan Shmidt could continue his work with his own
 dfu backends.

Time run out for me on this project and I'm going to relocate to
another country for new job this months. In short I want have time to
work on this the next months.

Personally I'm still interested in this and may start working on it
when everything else settled down. Can not tell when this is though.
If anyone else wants to pick this up and push it forward that would be
more then welcome. A small patchset with my current state will follow
this mail.

Some words about it. As I don't have hardware which is working with
U-boot mainline and provides a UDC driver for the new gadget framework
I could not directly test your code. Having a DFU implementation for
both the old and the new gadget framework turned out to be more
trouble then expected. I split the nand backend part out, but it
still needs some fixing and especially testing.

For systems with old gadget framework UDC drivers, like the
beagleboard with musb, it might still be wise to use the original
version I posted earlier here for reference.

Lets hope someone, or maybe myself in some months, will pick this up
and finally bring it into mainline.

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


Re: [U-Boot] [PATCH] usb: increase delay after port reset

2012-04-03 Thread Stefano Babic
On 02/04/2012 21:00, Ilya Yanok wrote:
 Hi Marek, Stefano,

Hi Marek,

 
 On 02.04.2012 21:29, Marek Vasut wrote:
 In our setup (OMAP3 EHCI host, keyboard, mouse mass storage and BT
 dongle devices connected via several hubs) keyboard fails to initialize
 during the bus scan (stalled endpoint while get_descriptor/64) and after
 that keyboard is unusable (even in Linux) until power off/on.

 Increasing the delay after port reset from 200ms to 260ms solves this
 problem.

 Do we still have this problem?
 
 Sorry, I'm not working with this board any more. I'm ccing Stefano,
 probably he can answer.

USB seems not working on this board, but the patch does not help. No
peripheral are found after bus scan, even if the delay is increased by
the patch. I will suggest to not apply this patch for the release and I
will try to investigate what is gone wrong on this board.

Best regards,
Stefano Babic

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


[U-Boot] [PATCH 0/2] SPI flash update command

2012-04-03 Thread Gerlando Falauto
Hi,

this patchset allows sf update to erase+write a number of bytes which is not a
multiple of the sector size.  Start address must still be sector-aligned though.

The first patch trivially makes it such it will always erase an entire sector
before writing, regardless of the amount of data to write (i.e. the last sector
is erased completely before writing it only partially).

The second patch just makes sure that the original data at the end of the sector
is written back so to apparently remain unchanged.

I anticipate two potential objections already:

- whether it is really worth writing back the portion of the sector which was
  erased but shouldn't have been overwritten (whole purpose of the second patch)

- these changes make the semantics of sf update and sf erase somewhat
  different, in that sf erase needs a + to deal with odd lengths, whereas
  sf update does not.  I think this is only partially true.  After all, sf
  update is already somehow special.  It's not a standard operation for a flash
  (erase, read, write).  It combines two of those operations, and takes care of
  optimizing the process by removing unneeded erase/write operations.  So it
  might as well deserve to be special, in my opinion.  Plus, it makes the
  command for updating u-boot as easy as

 sf update ${load_addr_r} 0 ${filesize}

Feedback and criticism more than welcome, of course.

Thank you,
Gerlando

Gerlando Falauto (2):
  cmd_sf: let sf update erase last sector as a whole
  cmd_sf: sf update preserve the final part of the last sector

 common/cmd_sf.c |   18 --
 1 files changed, 16 insertions(+), 2 deletions(-)

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


[U-Boot] [PATCH 1/2] cmd_sf: let sf update erase last sector as a whole

2012-04-03 Thread Gerlando Falauto
make sf update work with unaligned `len' parameter, by deleting the
whole last sector before writing, so to allow for:

 sf update ${load_addr_r} 0 ${filesize}

Signed-off-by: Gerlando Falauto gerlando.fala...@keymile.com
Cc: Valentin Longchamp valentin.longch...@keymile.com
Cc: Holger Brunck holger.bru...@keymile.com
---
 common/cmd_sf.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/common/cmd_sf.c b/common/cmd_sf.c
index 3cfedde..d97d4a5 100644
--- a/common/cmd_sf.c
+++ b/common/cmd_sf.c
@@ -142,7 +142,8 @@ static const char *spi_flash_update_block(struct spi_flash 
*flash, u32 offset,
*skipped += len;
return NULL;
}
-   if (spi_flash_erase(flash, offset, len))
+   /* Erase the entire sector */
+   if (spi_flash_erase(flash, offset, flash-sector_size))
return erase;
if (spi_flash_write(flash, offset, len, buf))
return write;
-- 
1.7.1

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


[U-Boot] [PATCH 2/2] cmd_sf: sf update preserve the final part of the last sector

2012-04-03 Thread Gerlando Falauto
Since sf update erases the last block as a whole, but only rewrites
the meaningful initial part of it, the rest would be left erased,
potentially erasing meaningful information.
So, as a safety measure, have it rewrite the original content.

Signed-off-by: Gerlando Falauto gerlando.fala...@keymile.com
Cc: Valentin Longchamp valentin.longch...@keymile.com
Cc: Holger Brunck holger.bru...@keymile.com
---
 common/cmd_sf.c |   15 ++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/common/cmd_sf.c b/common/cmd_sf.c
index d97d4a5..0666f52 100644
--- a/common/cmd_sf.c
+++ b/common/cmd_sf.c
@@ -134,8 +134,10 @@ static const char *spi_flash_update_block(struct spi_flash 
*flash, u32 offset,
 {
debug(offset=%#x, sector_size=%#x, len=%#zx\n,
offset, flash-sector_size, len);
-   if (spi_flash_read(flash, offset, len, cmp_buf))
+   /* Read the entire sector so to allow for rewriting */
+   if (spi_flash_read(flash, offset, flash-sector_size, cmp_buf))
return read;
+   /* Compare only what is meningful (len) */
if (memcmp(cmp_buf, buf, len) == 0) {
debug(Skip region %x size %zx: no change\n,
offset, len);
@@ -145,6 +147,17 @@ static const char *spi_flash_update_block(struct spi_flash 
*flash, u32 offset,
/* Erase the entire sector */
if (spi_flash_erase(flash, offset, flash-sector_size))
return erase;
+   /* If it's a partial sector, preserve the existing part */
+   if (len != flash-sector_size) {
+   /* Overwrite the first part of the sector with input data */
+   memcpy(cmp_buf, buf, len);
+   /* Rewrite the whole sector with original data at the end */
+   if (spi_flash_write(flash, offset, flash-sector_size,
+   cmp_buf))
+   return write;
+   return NULL;
+   }
+   /* Rewrite the whole block from the source */
if (spi_flash_write(flash, offset, len, buf))
return write;
return NULL;
-- 
1.7.1

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


Re: [U-Boot] [PATCH 2/3] MIPS: fix inconsistency in config option for cache operation mode

2012-04-03 Thread Daniel Schwierzeck
Hi,

On Tue, Apr 3, 2012 at 3:40 PM, Marek Vasut ma...@denx.de wrote:
 Mike, there was some issue with this patch?

 Commit ab2a98b11716364bc5a8c43cdfa7fee176cda1d8 missed to
 use the new config option in dcache_enable().

this commit refers to a patch that I sent a while ago as preparation
for supporting Lantiq SoCs.
Some Lantiq SoCs wants CONF_CM_CACHABLE_NO_WA  instead of the
hard-coded CONF_CM_CACHABLE_NONCOHERENT.
So I created a config option for the required cache mode.


 Fix this to avoid inconsistencies if someone wants to disable
 and enable D-caches.

 Signed-off-by: Daniel Schwierzeck daniel.schwierz...@googlemail.com
 ---
  arch/mips/cpu/mips32/cache.S |    6 +-
  1 file changed, 5 insertions(+), 1 deletion(-)

 diff --git a/arch/mips/cpu/mips32/cache.S b/arch/mips/cpu/mips32/cache.S
 index 5ce0ec4..e683e8b 100644
 --- a/arch/mips/cpu/mips32/cache.S
 +++ b/arch/mips/cpu/mips32/cache.S
 @@ -30,6 +30,10 @@
  #include asm/addrspace.h
  #include asm/cacheops.h

 +#ifndef CONFIG_SYS_MIPS_CACHE_MODE
 +#define CONFIG_SYS_MIPS_CACHE_MODE CONF_CM_CACHABLE_NONCOHERENT
 +#endif
 +
  #define RA           t8

  /*
 @@ -224,7 +228,7 @@ LEAF(dcache_enable)
       mfc0    t0, CP0_CONFIG
       ori     t0, CONF_CM_CMASK
       xori    t0, CONF_CM_CMASK
 -     ori     t0, CONF_CM_CACHABLE_NONCOHERENT
 +     ori     t0, CONFIG_SYS_MIPS_CACHE_MODE
       mtc0    t0, CP0_CONFIG
       jr      ra
       END(dcache_enable)

 Best regards,
 Marek Vasut

I only changed start.S and forgot to change this code part too. That is why I
created this patch to fix this inconsistency.

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


Re: [U-Boot] [PATCH 2/3] MIPS: fix inconsistency in config option for cache operation mode

2012-04-03 Thread Marek Vasut
Dear Daniel Schwierzeck,

 Hi,
 
 On Tue, Apr 3, 2012 at 3:40 PM, Marek Vasut ma...@denx.de wrote:
  Mike, there was some issue with this patch?
  
  Commit ab2a98b11716364bc5a8c43cdfa7fee176cda1d8 missed to
  use the new config option in dcache_enable().
 
 this commit refers to a patch that I sent a while ago as preparation
 for supporting Lantiq SoCs.
 Some Lantiq SoCs wants CONF_CM_CACHABLE_NO_WA  instead of the
 hard-coded CONF_CM_CACHABLE_NONCOHERENT.
 So I created a config option for the required cache mode.
 
  Fix this to avoid inconsistencies if someone wants to disable
  and enable D-caches.
  
  Signed-off-by: Daniel Schwierzeck daniel.schwierz...@googlemail.com
  ---
   arch/mips/cpu/mips32/cache.S |6 +-
   1 file changed, 5 insertions(+), 1 deletion(-)
  
  diff --git a/arch/mips/cpu/mips32/cache.S b/arch/mips/cpu/mips32/cache.S
  index 5ce0ec4..e683e8b 100644
  --- a/arch/mips/cpu/mips32/cache.S
  +++ b/arch/mips/cpu/mips32/cache.S
  @@ -30,6 +30,10 @@
   #include asm/addrspace.h
   #include asm/cacheops.h
  
  +#ifndef CONFIG_SYS_MIPS_CACHE_MODE
  +#define CONFIG_SYS_MIPS_CACHE_MODE CONF_CM_CACHABLE_NONCOHERENT
  +#endif
  +
   #define RA   t8
  
   /*
  @@ -224,7 +228,7 @@ LEAF(dcache_enable)
mfc0t0, CP0_CONFIG
ori t0, CONF_CM_CMASK
xorit0, CONF_CM_CMASK
  - ori t0, CONF_CM_CACHABLE_NONCOHERENT
  + ori t0, CONFIG_SYS_MIPS_CACHE_MODE
mtc0t0, CP0_CONFIG
jr  ra
END(dcache_enable)
  
  Best regards,
  Marek Vasut
 
 I only changed start.S and forgot to change this code part too. That is why
 I created this patch to fix this inconsistency.

I see ... so this fixes some other commit. What was Shinya-san's concern, that 
you only changed this file?

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


Re: [U-Boot] [PATCH] usb: increase delay after port reset

2012-04-03 Thread Marek Vasut
Dear Stefano Babic,

 On 02/04/2012 21:00, Ilya Yanok wrote:
  Hi Marek, Stefano,
 
 Hi Marek,
 
  On 02.04.2012 21:29, Marek Vasut wrote:
  In our setup (OMAP3 EHCI host, keyboard, mouse mass storage and BT
  dongle devices connected via several hubs) keyboard fails to initialize
  during the bus scan (stalled endpoint while get_descriptor/64) and
  after that keyboard is unusable (even in Linux) until power off/on.
  
  Increasing the delay after port reset from 200ms to 260ms solves this
  problem.
  
  Do we still have this problem?
  
  Sorry, I'm not working with this board any more. I'm ccing Stefano,
  probably he can answer.
 
 USB seems not working on this board, but the patch does not help. No
 peripheral are found after bus scan, even if the delay is increased by
 the patch. I will suggest to not apply this patch for the release and I
 will try to investigate what is gone wrong on this board.
 
 Best regards,
 Stefano Babic

Ok, discarding from patchwork. Thanks!

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


Re: [U-Boot] [PATCH] cm-t35: add I2C multi-bus support

2012-04-03 Thread Tom Rini
On Mon, Apr 02, 2012 at 03:29:31PM +0300, Igor Grinberg wrote:

 From: Nikita Kiryanov nik...@compulab.co.il
 
 Enable I2C multi-bus support and config I2C muxes for I2C2 and I2C3.
 
 Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
 Signed-off-by: Igor Grinberg grinb...@compulab.co.il

Queued up for u-boot-ti/next (which I intend to PR Friday).

-- 
Tom


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


Re: [U-Boot] [PATCH] hawkboard: Add CONFIG_SPL_LIBGENERIC_SUPPORT

2012-04-03 Thread Tom Rini
On Mon, Apr 02, 2012 at 09:33:43AM -0700, Tom Rini wrote:

 With older toolchains we need CONFIG_SPL_LIBGENERIC_SUPPORT in order for
 CONFIG_SPL_NAND_SUPPORT to link.
 
 Signed-off-by: Tom Rini tr...@ti.com

Queued up for u-boot-ti/master (which I intend to PR Friday).

-- 
Tom


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


Re: [U-Boot] [PATCH v2] mvgbe: remove warning for unused methods

2012-04-03 Thread Joe Hershberger
Hi Prafulla,

On Mon, Apr 2, 2012 at 7:44 AM, Prafulla Wadaskar prafu...@marvell.com wrote:
 May you please pull this patch in u-boot-net.git?

 This does not have any further dependency, whereas it is a dependency for 
 some other patchset

Applied, Thanks!

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


Re: [U-Boot] [PATCH v3 05/23] Add AES crypto library

2012-04-03 Thread Yen Lin
Hi Simon,

On Mon, 2012-04-02 at 16:18 -0700, Simon Glass wrote:
 From: Yen Lin ye...@nvidia.com
 
 Add support for AES using an implementation form Karl Malbrain.
 This offers small code size (around 5KB on ARM) and supports 128-bit
 AES only.
 

Could you fix form to from?

Signed-off-by: Yen Lin ye...@nvidia.com

Regards,
Yen


---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
---
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 08/23] tegra: Add crypto library for warmboot code

2012-04-03 Thread Yen Lin
On Mon, 2012-04-02 at 16:18 -0700, Simon Glass wrote:
 From: Yen Lin ye...@nvidia.com
 
 Provides an interface to aes.c for the warmboot code.
 

Signed-off-by: Yen Lin ye...@nvidia.com

 Signed-off-by: Simon Glass s...@chromium.org
 ---
 Changes in v2:
 - Rely on compiler to optimise out debug_print_vector()
 - Remove unused crypto code from crypto.c



---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
---
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 09/23] tegra: Add flow, gp_padctl, fuse, sdram headers

2012-04-03 Thread Yen Lin
On Mon, 2012-04-02 at 16:18 -0700, Simon Glass wrote:
 From: Yen Lin ye...@nvidia.com
 
 These headers provide access to additional Tegra features.
 
 flow - start/stop CPUs
 sdram - parameters for SDRAM
 fuse - access to on-chip fuses / security settings
 gp_padctl - pad control and general purpose registers
 

Signed-off-by: Yen Lin ye...@nvidia.com

 Signed-off-by: Simon Glass s...@chromium.org
 ---



---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
---
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 15/23] tegra: Add warmboot implementation

2012-04-03 Thread Yen Lin
On Mon, 2012-04-02 at 16:18 -0700, Simon Glass wrote:
 From: Yen Lin ye...@nvidia.com
 
 Add code to set up the warm boot area in the Tegra CPU ready for a
 resume after suspend.
 

Signed-off-by: Yen Lin ye...@nvidia.com

 Signed-off-by: Simon Glass s...@chromium.org
 Acked-by: Stephen Warren swar...@nvidia.com
 ---
 Changes in v2:
 - Move structs shared between A9 and AVP into warmboot.h header file
 - Remove unused crypto code
 - Tidy SDRAM range check in warmboot_prepare_code()
 - Use low-level clock functions in warmboot code instead of register access



---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
---
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 16/23] tegra: Setup PMC scratch info from ap20 setup

2012-04-03 Thread Yen Lin
On Mon, 2012-04-02 at 16:18 -0700, Simon Glass wrote:
 From: Yen Lin ye...@nvidia.com
 
 Save SDRAM parameters into the warmboot scratch registers
 

Signed-off-by: Yen Lin ye...@nvidia.com

 Signed-off-by: Simon Glass s...@chromium.org
 ---
 



---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
---
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: add u-boot.imx as target for i.MX SOCs

2012-04-03 Thread Mike Frysinger
On Tue, Apr 3, 2012 at 07:32, Stefano Babic wrote:
 --- a/arch/arm/cpu/armv7/config.mk
 +++ b/arch/arm/cpu/armv7/config.mk

 +ifneq ($(CONFIG_IMX_CONFIG),)
 +ALL-y  += $(obj)u-boot.imx
 +endif

i guess CONFIG_IMX_CONFIG is a free-form string and not just boolean, so:
Acked-by: Mike Frysinger vap...@gentoo.org
-mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] cmd_sf: add size checking to spi flash commands

2012-04-03 Thread Mike Frysinger
On Tue, Apr 3, 2012 at 07:34, Gerlando Falauto wrote:
 SPI flash operations inadvertently stretching beyond the flash size will
 result in a wraparound. This may be particularly dangerous when burning
 u-boot, because the flash contents will be corrupted rendering the board
 unusable, without any warning being issued.
 So add a consistency checking so not to overflow past the flash size.

looks OK to me.  i'll test it locally and merge it into my SF branch.  cheers!
-mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/3] MIPS: fix endianess handling

2012-04-03 Thread Mike Frysinger
On Monday 02 April 2012 08:57:56 Daniel Schwierzeck wrote:
 Make endianess of target CPU configurable. Use the new config
 option for dbau1550_el and pb1000 boards.
 
 Adapt linking of standalone applications to pass through
 endianess options to LD.

Acked-by: Mike Frysinger vap...@gentoo.org

note: we could unify the -EL/-EB handling in the top level as those options 
are the same for linkers.  it's only the CFLAGS that differ :(.
-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 2/3] MIPS: fix inconsistency in config option for cache operation mode

2012-04-03 Thread Mike Frysinger
On Tuesday 03 April 2012 09:40:08 Marek Vasut wrote:
 Mike, there was some issue with this patch?

i had feedback on the endian flags last time Daniel posted it, but i don't 
think i ever gave feedback on this ... i certainly don't know mips asm beyond 
the extreme basics ;).

was there a patchwork URL or mailing list archive for me to check ?
-mike


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


Re: [U-Boot] [PATCH 1/3] net/eth: set status to active before calling init

2012-04-03 Thread Mike Frysinger
On Friday 23 March 2012 16:11:17 Sebastian Andrzej Siewior wrote:
 If we set the status after successful init call then we get in trouble
 if stdout (or setderr) is set to netconsole. If we are going to use one
 of those (lets say printf) during -init() the following happens:
 - network is of (state passive)
 - we switch on netconsole
 - nc_getc() gets called
 - in NetLoop() we switch on ethernet via eth_init()
 - we end up in tsec_init() (inc case we use the tsec driver). Here we
   call a printf()

considering your followup patches convert printf() to serial_printf(), is this 
patch still needed ?

 --- a/net/eth.c
 +++ b/net/eth.c
 @@ -380,14 +380,17 @@ int eth_init(bd_t *bis)
 
   old_current = eth_current;
   do {
 + int old_state;
 +
   debug(Trying %s\n, eth_current-name);
 
 - if (eth_current-init(eth_current,bis) = 0) {
 - eth_current-state = ETH_STATE_ACTIVE;
 -
 + old_state = eth_current-state;
 + eth_current-state = ETH_STATE_ACTIVE;
 + if (eth_current-init(eth_current,bis) = 0)
   return 0;
 - }
 +
   debug(FAIL\n);
 + eth_current-state = old_state;
 
   eth_try_another(0);
   } while (old_current != eth_current);

this needs a comment in the code explaining why you're setting things active 
early and then turning it off
-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 3/3] net/tsec: Don't tell the link status if used with netconsole

2012-04-03 Thread Mike Frysinger
On Friday 23 March 2012 16:11:19 Sebastian Andrzej Siewior wrote:
 --- a/drivers/net/tsec.c
 +++ b/drivers/net/tsec.c
 
 + if (strcmp(getenv(stdout), nc))

i really don't like special casing devices like this

 - serial_printf(Speed: %d, %s duplex%s\n, phydev-speed,
 - (phydev-duplex) ? full : half,
 - (phydev-port == PORT_FIBRE) ? , fiber mode : );
 + serial_printf(Speed: %d, %s duplex%s\n, phydev-speed,
 + (phydev-duplex) ? full : half,
 + (phydev-port == PORT_FIBRE) ? , fiber mode
 + : );

why not just delete this line completely ?
-mike


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


Re: [U-Boot] [PATCH 1/3] net/eth: set status to active before calling init

2012-04-03 Thread Sebastian Andrzej Siewior

On 04/03/2012 10:41 PM, Mike Frysinger wrote:

On Friday 23 March 2012 16:11:17 Sebastian Andrzej Siewior wrote:

If we set the status after successful init call then we get in trouble
if stdout (or setderr) is set to netconsole. If we are going to use one
of those (lets say printf) during -init() the following happens:
- network is of (state passive)
- we switch on netconsole
- nc_getc() gets called
- in NetLoop() we switch on ethernet via eth_init()
- we end up in tsec_init() (inc case we use the tsec driver). Here we
   call a printf()


considering your followup patches convert printf() to serial_printf(), is this
patch still needed ?


Not for the tsec driver but it is possible that other driver do have
the same problem. I haven't also checked all the phy devices which
might do some prints. Therefore I would prefer to have this in.


--- a/net/eth.c
+++ b/net/eth.c
@@ -380,14 +380,17 @@ int eth_init(bd_t *bis)

old_current = eth_current;
do {
+   int old_state;
+
debug(Trying %s\n, eth_current-name);

-   if (eth_current-init(eth_current,bis)= 0) {
-   eth_current-state = ETH_STATE_ACTIVE;
-
+   old_state = eth_current-state;
+   eth_current-state = ETH_STATE_ACTIVE;
+   if (eth_current-init(eth_current,bis)= 0)
return 0;
-   }
+
debug(FAIL\n);
+   eth_current-state = old_state;

eth_try_another(0);
} while (old_current != eth_current);


this needs a comment in the code explaining why you're setting things active
early and then turning it off


Okay.


-mike


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


Re: [U-Boot] [PATCH 3/3] net/tsec: Don't tell the link status if used with netconsole

2012-04-03 Thread Sebastian Andrzej Siewior

On 04/03/2012 10:42 PM, Mike Frysinger wrote:

On Friday 23 March 2012 16:11:19 Sebastian Andrzej Siewior wrote:

--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c

+   if (strcmp(getenv(stdout), nc))


i really don't like special casing devices like this


-   serial_printf(Speed: %d, %s duplex%s\n, phydev-speed,
-   (phydev-duplex) ? full : half,
-   (phydev-port == PORT_FIBRE) ? , fiber mode : );
+   serial_printf(Speed: %d, %s duplex%s\n, phydev-speed,
+   (phydev-duplex) ? full : half,
+   (phydev-port == PORT_FIBRE) ? , fiber mode
+   : );


why not just delete this line completely ?


*I* don't mind but others might complain about missing important
information. So in my re-do of the series I remove it instead and see
what happens.


-mike


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


Re: [U-Boot] [RFC v0 08/11] omap3: Consolidate UART information in omap3_common.h

2012-04-03 Thread Mike Frysinger
On Thursday 22 March 2012 15:09:14 Tom Rini wrote:
 Unless a board defines CONFIG_SERIAL_MULTI we assume it is using an
 on-module UART somewhere.  We leave the exact configuration per-board.
 
 Start an environment section in omap3_common.h and default to allowing
 the environment to override console/ethaddr.  omap3_mvblx retains its
 behavior via opt-out.

not a big deal, but it seems like the env settings slipped in after the fact

 --- a/include/configs/omap3_common.h
 +++ b/include/configs/omap3_common.h
 
 +/*
 + * Default serial port configuration is an NS16550-compatible UART.
 + * Boards can override this as needed with CONFIG_SERIAL_MULTI
 + */
 +#ifndef CONFIG_SERIAL_MULTI
 +#define CONFIG_SYS_NS16550
 +#define CONFIG_SYS_NS16550_SERIAL
 +#define CONFIG_SYS_NS16550_REG_SIZE  (-4)
 +#define CONFIG_SYS_NS16550_CLK   4800
 +#define CONFIG_SYS_BAUDRATE_TABLE{4800, 9600, 19200, 38400, 57600,\
 + 115200}
 +#endif

the baudrate table is fairly independent of the serial driver.  might want to 
split that out into its own ifndef/define/endif check.
-mike


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


Re: [U-Boot] [RFC v0 0/11]: Add configs/omap3_common.h

2012-04-03 Thread Mike Frysinger
On Thursday 22 March 2012 15:09:06 Tom Rini wrote:
 Here's something I've talked about a bit before.  This series adds
 include/configs/omap3_common.h and makes all CONFIG_OMAP34XX boards use
 it.  This particular round of posting doesn't directly apply as I'm
 working off of a series of cleanups that I'll post once I'm sure I don't
 find any others from doing this (unused CONFIG options) general series.
 What I'm really looking for is feedback on the implementation, namely
 what I lay out in the first patch of a section to set before using
 omap3_common.h, including, and a section for after omap3_common.h.  The
 series isn't nearly complete but introduces at least one example of a
 our board isn't like all the others in each of the sections.

seems like for the most part this is soc-specific default configs, and one or 
two might be a vendor (TI) specific defaults (which aren't really harmful).  
the patches as-is generally look OK, but i wonder if we shouldn't expand the 
arm asm/config.h to tail into an asm/arch/config.h so these soc-specific 
defaults 
can live there rather than include/configs/.
-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 3/5] mx5: Add clock config interface

2012-04-03 Thread Fabio Estevam
Hi Stefano,

On Tue, Mar 20, 2012 at 6:40 PM, Fabio Estevam
fabio.este...@freescale.com wrote:
 mx5: Add clock config interface

 Add clock config interface support, so that we
 can configure CPU or DDR clock in the later init

 Signed-off-by: Jason Liu jason@linaro.org
 Signed-off-by: Eric Miao eric.m...@linaro.org
 Signed-off-by: Fabio Estevam fabio.este...@freescale.com

I saw that you applied this series into your next branch.

I am observing some problems with this patch in particular and I will
have to rework it.

Please drop patches 3, 4 and 5 from the series for now.

Thanks,

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


Re: [U-Boot] [PATCH v4 0/6] Enable Thumb build for ARM platforms

2012-04-03 Thread Allen Martin
 Tom, Albert,
 
 Does this series look good?

Hi Aneesh,

The assembly files (like arch/arm/cpu/armv7/start.S) are still compiled ARM 32 
with this patch series, but they call into C files that are compiled -mthumb.  
Shouldn't the branches be changed into thumb state changing branches (bx/blx) ? 
 In particular I'm looking at the call into board_init_f()

-Allen


 
 On Thursday 08 March 2012 10:50 PM, Aneesh V wrote:
  Thumb is an alternate instruction set available in many
  ARM processors. Below is a detailed description from ARM
  specs:
 
  The Thumb instruction set is a re-encoded subset of the
  ARM instruction set. Thumb instructions execute in their
  own processor state, with the architecture defining the
  mechanisms required to transition between ARM and Thumb
  states. The key difference is that Thumb instructions are
  half the size of ARM instructions(16 bits compared with 32
  bits). Greater code density can usually be achieved by using
  the Thumb instruction set in preference to the ARM instruction
  set, at a cost of some reduction in performance
 
  In ARMv6T2, Thumb-2 technology is introduced. This technology
  makes it possible to extend the original Thumb instruction set
  with many 32-bit instructions. The range of 32-bit Thumb instructions
  included in ARMv6T2 permits Thumb code to achieve performance
  similar to ARM code, with code density better than that of earlier
  Thumb code. From ARMv6T2, the ARM and Thumb instruction sets provide
  almost identical functionality
 
  This series adds Thumb support in U-Boot and enables it for
  OMAP4. It also fixes issues faced while booting OMAP4 with
  Thumb-2 images of U-Boot and SPL.
 
  Thumb mode is becoming increasingly relevant for U-Boot with
  the advent of SPL. It's very important to keep SPL size smaller
  considering the internal RAM size constraints on many platforms.
  On OMAP4 the size reduction enables us to use SPL on secure devices
  that have smaller internal RAM available for non-secure world.
 
  To enable support for new platforms you just need to add
  CONFIG_SYS_THUMB_BUILD in your config file.
 
  Tool-chains tried:
  1. Sourcery G++ Lite 2010q1-202
  arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2010q1-202) 4.4.1
  GNU ld (Sourcery G++ Lite 2010q1-202) - binutils 2.19.51.20090709
 
  2. Linaro 4.6-2012.01
  arm-linux-gnueabi-gcc (crosstool-NG linaro-1.13.1-2012.01-20120125 -
  Linaro GCC 2012.01) 4.6.3 20120105 (prerelease)
  GNU ld (crosstool-NG linaro-1.13.1-2012.01-20120125 - Linaro GCC
 2012.01) 2.22
 
  Code-size reduction:
  Image   ARM build   Thumb build % Reduction
  u-boot.bin  190408  144676  24.01%
  u-boot-spl.bin  33200   25096   24.40%
 
  Performance(timestamp just before the main loop):
  ARM build   Thumb build % Reduction
  898510us878247us-2.25%
 
  Performance actually improved marginally for the Thumb
  build, maybe because of the reduced image sizes.
 
  Aneesh V (6):
 arm: adapt asm/linkage.h from Linux
 armv7: add appropriate headers for assembly functions
 ARM: enable Thumb build
 armv7: Use -march=armv7-a and thereby enable Thumb-2
 omap4+: Avoid using __attribute__ ((__packed__))
 OMAP4: enable Thumb build
 
README |8 +
arch/arm/config.mk |   22 +
arch/arm/cpu/armv7/config.mk   |7 +++-
arch/arm/cpu/armv7/mx5/lowlevel_init.S |5 ++-
arch/arm/cpu/armv7/mx6/lowlevel_init.S |5 ++-
arch/arm/cpu/armv7/omap-common/lowlevel_init.S |   14 
arch/arm/cpu/armv7/omap-common/reset.S |5 ++-
arch/arm/cpu/armv7/omap3/lowlevel_init.S   |   41 --
 -
arch/arm/cpu/armv7/s5pc1xx/cache.S |   10 +++--
arch/arm/cpu/armv7/s5pc1xx/reset.S |5 ++-
arch/arm/cpu/armv7/start.S |   13 ---
arch/arm/cpu/armv7/tegra2/lowlevel_init.S  |5 ++-
arch/arm/cpu/armv7/u8500/lowlevel.S|9 +++--
arch/arm/include/asm/arch-omap4/mux_omap4.h|2 +-
arch/arm/include/asm/arch-omap5/mux_omap5.h|2 +-
arch/arm/include/asm/linkage.h |7 
include/configs/omap4_common.h |2 +
include/linux/linkage.h|7 +++-
18 files changed, 106 insertions(+), 63 deletions(-)
create mode 100644 arch/arm/include/asm/linkage.h
 
 
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot

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


Re: [U-Boot] [PATCH v4 0/6] Enable Thumb build for ARM platforms

2012-04-03 Thread Måns Rullgård
Allen Martin amar...@nvidia.com writes:

 Tom, Albert,
 
 Does this series look good?

 Hi Aneesh,

 The assembly files (like arch/arm/cpu/armv7/start.S) are still
 compiled ARM 32 with this patch series, but they call into C files
 that are compiled -mthumb.  Shouldn't the branches be changed into
 thumb state changing branches (bx/blx) ?  In particular I'm looking at
 the call into board_init_f()

The linker should take care of that.

-- 
Måns Rullgård
m...@mansr.com

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


Re: [U-Boot] [RFC v0 0/11]: Add configs/omap3_common.h

2012-04-03 Thread Tom Rini
On Tue, Apr 03, 2012 at 05:37:37PM -0400, Mike Frysinger wrote:
 On Thursday 22 March 2012 15:09:06 Tom Rini wrote:
  Here's something I've talked about a bit before.  This series adds
  include/configs/omap3_common.h and makes all CONFIG_OMAP34XX boards use
  it.  This particular round of posting doesn't directly apply as I'm
  working off of a series of cleanups that I'll post once I'm sure I don't
  find any others from doing this (unused CONFIG options) general series.
  What I'm really looking for is feedback on the implementation, namely
  what I lay out in the first patch of a section to set before using
  omap3_common.h, including, and a section for after omap3_common.h.  The
  series isn't nearly complete but introduces at least one example of a
  our board isn't like all the others in each of the sections.
 
 seems like for the most part this is soc-specific default configs, and one or 
 two might be a vendor (TI) specific defaults (which aren't really harmful).  

There is a certain amount of this that can be shared with
omap4/5/am33xx/davinci (since the IP is shared).  I'm not sure of the
best way to share that yet, but I wanted to do it in steps.

 the patches as-is generally look OK, but i wonder if we shouldn't expand the 
 arm asm/config.h to tail into an asm/arch/config.h so these soc-specific 
 defaults 
 can live there rather than include/configs/.

That's a good idea, I think.  I'll give that a spin and see how it
looks.

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


Re: [U-Boot] [RFC v0 08/11] omap3: Consolidate UART information in omap3_common.h

2012-04-03 Thread Tom Rini
On Tue, Apr 03, 2012 at 05:35:25PM -0400, Mike Frysinger wrote:
 On Thursday 22 March 2012 15:09:14 Tom Rini wrote:
  Unless a board defines CONFIG_SERIAL_MULTI we assume it is using an
  on-module UART somewhere.  We leave the exact configuration per-board.
  
  Start an environment section in omap3_common.h and default to allowing
  the environment to override console/ethaddr.  omap3_mvblx retains its
  behavior via opt-out.
 
 not a big deal, but it seems like the env settings slipped in after the fact

Yeah, I had to think a few times about how to split-up some of the
serial/console related stuff.

  --- a/include/configs/omap3_common.h
  +++ b/include/configs/omap3_common.h
  
  +/*
  + * Default serial port configuration is an NS16550-compatible UART.
  + * Boards can override this as needed with CONFIG_SERIAL_MULTI
  + */
  +#ifndef CONFIG_SERIAL_MULTI
  +#define CONFIG_SYS_NS16550
  +#define CONFIG_SYS_NS16550_SERIAL
  +#define CONFIG_SYS_NS16550_REG_SIZE(-4)
  +#define CONFIG_SYS_NS16550_CLK 4800
  +#define CONFIG_SYS_BAUDRATE_TABLE  {4800, 9600, 19200, 38400, 57600,\
  +   115200}
  +#endif
 
 the baudrate table is fairly independent of the serial driver.  might want to 
 split that out into its own ifndef/define/endif check.

What I really wanted here was a test for not using the SoM UART.
Looking at the examples we have today, it's either the SoM and the above
table but differing in which UART is physically exposed or it's
SERIAL_MULTI and wants it's own baudrate table.

Part of me thinks I should whack at include/config_defaults.h and add
something like #ifndef CONFIG_SYS_BAUDRATE_TABLE, standard rates,
#endif.  And same for CONFIG_SYS_PROMPT_HUSH_PS2 and probably a few
others.

-- 
Tom


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


Re: [U-Boot] [PATCH 1/2] cmd_sf: let sf update erase last sector as a whole

2012-04-03 Thread Simon Glass
On Tue, Apr 3, 2012 at 8:14 AM, Gerlando Falauto
gerlando.fala...@keymile.com wrote:
 make sf update work with unaligned `len' parameter, by deleting the
 whole last sector before writing, so to allow for:

  sf update ${load_addr_r} 0 ${filesize}

 Signed-off-by: Gerlando Falauto gerlando.fala...@keymile.com
 Cc: Valentin Longchamp valentin.longch...@keymile.com
 Cc: Holger Brunck holger.bru...@keymile.com

Acked-by: Simon Glass s...@chromium.org

 ---
  common/cmd_sf.c |    3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)

 diff --git a/common/cmd_sf.c b/common/cmd_sf.c
 index 3cfedde..d97d4a5 100644
 --- a/common/cmd_sf.c
 +++ b/common/cmd_sf.c
 @@ -142,7 +142,8 @@ static const char *spi_flash_update_block(struct 
 spi_flash *flash, u32 offset,
                *skipped += len;
                return NULL;
        }
 -       if (spi_flash_erase(flash, offset, len))
 +       /* Erase the entire sector */
 +       if (spi_flash_erase(flash, offset, flash-sector_size))
                return erase;
        if (spi_flash_write(flash, offset, len, buf))
                return write;
 --
 1.7.1

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


Re: [U-Boot] [PATCH 2/2] cmd_sf: sf update preserve the final part of the last sector

2012-04-03 Thread Simon Glass
Hi Gerlando,

On Tue, Apr 3, 2012 at 8:14 AM, Gerlando Falauto
gerlando.fala...@keymile.com wrote:
 Since sf update erases the last block as a whole, but only rewrites
 the meaningful initial part of it, the rest would be left erased,
 potentially erasing meaningful information.
 So, as a safety measure, have it rewrite the original content.

 Signed-off-by: Gerlando Falauto gerlando.fala...@keymile.com
 Cc: Valentin Longchamp valentin.longch...@keymile.com
 Cc: Holger Brunck holger.bru...@keymile.com

Acked-by: Simon Glass s...@chromium.org

 ---
  common/cmd_sf.c |   15 ++-
  1 files changed, 14 insertions(+), 1 deletions(-)

 diff --git a/common/cmd_sf.c b/common/cmd_sf.c
 index d97d4a5..0666f52 100644
 --- a/common/cmd_sf.c
 +++ b/common/cmd_sf.c
 @@ -134,8 +134,10 @@ static const char *spi_flash_update_block(struct 
 spi_flash *flash, u32 offset,
  {
        debug(offset=%#x, sector_size=%#x, len=%#zx\n,
                offset, flash-sector_size, len);
 -       if (spi_flash_read(flash, offset, len, cmp_buf))
 +       /* Read the entire sector so to allow for rewriting */
 +       if (spi_flash_read(flash, offset, flash-sector_size, cmp_buf))
                return read;
 +       /* Compare only what is meningful (len) */
        if (memcmp(cmp_buf, buf, len) == 0) {
                debug(Skip region %x size %zx: no change\n,
                        offset, len);
 @@ -145,6 +147,17 @@ static const char *spi_flash_update_block(struct 
 spi_flash *flash, u32 offset,
        /* Erase the entire sector */
        if (spi_flash_erase(flash, offset, flash-sector_size))
                return erase;
 +       /* If it's a partial sector, preserve the existing part */
 +       if (len != flash-sector_size) {
 +               /* Overwrite the first part of the sector with input data */
 +               memcpy(cmp_buf, buf, len);
 +               /* Rewrite the whole sector with original data at the end */
 +               if (spi_flash_write(flash, offset, flash-sector_size,
 +                                       cmp_buf))
 +                       return write;
 +               return NULL;

If you wrote just the last part of the sector here then you could
perhaps avoid the memcpy() and the return NULL.

 +       }
 +       /* Rewrite the whole block from the source */
        if (spi_flash_write(flash, offset, len, buf))
                return write;
        return NULL;
 --
 1.7.1


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


Re: [U-Boot] A few things for the release?

2012-04-03 Thread Joe Hershberger
On Tue, Mar 13, 2012 at 12:21 AM, Simon Glass s...@chromium.org wrote:
 Hi Dirk,

 On Fri, Mar 9, 2012 at 9:35 AM, Dirk Behme dirk.be...@googlemail.com wrote:
 5. I'm still hoping that we could get

 http://patchwork.ozlabs.org/patch/136789/

 into 2012.0{3,4}.

 Yes, I'm not sure. I think we have a new network maintainer now...

Applied.

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


Re: [U-Boot] [PATCH v3 22/23] tegra: fdt: Add EMC data for Tegra2 Seaboard

2012-04-03 Thread Simon Glass
Hi Olof,

On Mon, Apr 2, 2012 at 10:22 PM, Olof Johansson o...@lixom.net wrote:
 On Mon, Apr 2, 2012 at 4:19 PM, Simon Glass s...@chromium.org wrote:
 This adds timings for T20 and T25 Seaboards, using the bindings found here:

 http://patchwork.ozlabs.org/patch/132928/

 We supply both full speed options for normal running, and half speed options
 for testing / development.

 Signed-off-by: Simon Glass s...@chromium.org

 This seems incorrect to me. You provide both T20 and T25 EMC tables in
 the same device tree with no way to determine which one to use.

 Unfortunately nvidia didn't use the boot straps to tell if they were
 on a t20 or t25 seaboard, so you'll just have to know. At the kernel
 side we chose to just ditch T20 since most boards still in use are
 T25.

The selection of memory speed is down to the board. There is a later
patch in this series (just cc'd to you) which looks at the SOC ID to
determine whether it is T20 or T25, and selects the speed accordingly.
This speed is used to look up the correct table in the device tree




 -Olof

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


Re: [U-Boot] [PATCH v2 06/18] net: Refactor ping receive handler

2012-04-03 Thread Simon Glass
On Tue, Mar 27, 2012 at 4:42 PM, Joe Hershberger joe.hershber...@ni.com wrote:
 There is no need to call through the handler... inline it

 Signed-off-by: Joe Hershberger joe.hershber...@ni.com
 Cc: Joe Hershberger joe.hershber...@gmail.com
 Cc: Simon Glass s...@chromium.org
 Cc: Mike Frysinger vap...@gentoo.org

Acked-by: Simon Glass s...@chromium.org

 ---
  net/ping.c |   18 ++
  1 files changed, 2 insertions(+), 16 deletions(-)

 diff --git a/net/ping.c b/net/ping.c
 index 93942bc..eb0f0cc 100644
 --- a/net/ping.c
 +++ b/net/ping.c
 @@ -75,20 +75,10 @@ static void ping_timeout(void)
        NetState = NETLOOP_FAIL;        /* we did not get the reply */
  }

 -static void ping_handler(uchar *pkt, unsigned dest, IPaddr_t sip,
 -           unsigned src, unsigned len)
 -{
 -       if (sip != NetPingIP)
 -               return;
 -
 -       NetState = NETLOOP_SUCCESS;
 -}
 -
  void ping_start(void)
  {
        printf(Using %s device\n, eth_get_name());
        NetSetTimeout(1UL, ping_timeout);
 -       NetSetHandler(ping_handler);

        ping_send();
  }
 @@ -100,13 +90,9 @@ void ping_receive(struct Ethernet_hdr *et, struct 
 IP_UDP_hdr *ip, int len)

        switch (icmph-type) {
        case ICMP_ECHO_REPLY:
 -               /*
 -                * IP header OK.  Pass the packet to the
 -                * current handler.
 -                */
 -               /* XXX point to ip packet */
                src_ip = NetReadIP((void *)ip-ip_src);
 -               NetGetHandler()((uchar *)ip, 0, src_ip, 0, 0);
 +               if (src_ip == NetPingIP)
 +                       NetState = NETLOOP_SUCCESS;
                return;
        case ICMP_ECHO_REQUEST:
                debug(Got ICMP ECHO REQUEST, return 
 --
 1.6.0.2

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


Re: [U-Boot] [PATCH v2 07/18] net: Refactor to use NetSendPacket instead of eth_send directly

2012-04-03 Thread Simon Glass
On Tue, Mar 27, 2012 at 4:42 PM, Joe Hershberger joe.hershber...@ni.com wrote:
 Use this entry-point consistently across the net/ code
 Use a static inline function to preserve code size

 Signed-off-by: Joe Hershberger joe.hershber...@ni.com
 Cc: Joe Hershberger joe.hershber...@gmail.com
 Cc: Simon Glass s...@chromium.org
 Cc: Mike Frysinger vap...@gentoo.org

Acked-by: Simon Glass s...@chromium.org

 ---
 Changes for v2:
   - Change NetSendPacket into a static inline

  include/net.h |    5 -
  net/arp.c     |    6 +++---
  net/cdp.c     |    2 +-
  net/net.c     |    9 +
  net/ping.c    |    3 +--
  5 files changed, 10 insertions(+), 15 deletions(-)

 diff --git a/include/net.h b/include/net.h
 index 6eb25ee..f84511c 100644
 --- a/include/net.h
 +++ b/include/net.h
 @@ -466,7 +466,10 @@ extern void net_set_icmp_handler(rxhand_icmp_f *f); /* 
 Set ICMP RX handler */
  extern void    NetSetTimeout(ulong, thand_f *);/* Set timeout handler */

  /* Transmit NetTxPacket */
 -extern void NetSendPacket(uchar *, int);
 +static inline void NetSendPacket(uchar *pkt, int len)
 +{
 +       (void) eth_send(pkt, len);
 +}

  /* Transmit UDP packet, performing ARP request if needed */
  extern int     NetSendUDPPacket(uchar *ether, IPaddr_t dest, int dport,
 diff --git a/net/arp.c b/net/arp.c
 index 6cb3c10..90a6b01 100644
 --- a/net/arp.c
 +++ b/net/arp.c
 @@ -88,7 +88,7 @@ void ArpRequest(void)
        }

        NetWriteIP(arp-ar_tpa, NetArpWaitReplyIP);
 -       (void) eth_send(NetTxPacket, eth_hdr_size + ARP_HDR_SIZE);
 +       NetSendPacket(NetTxPacket, eth_hdr_size + ARP_HDR_SIZE);
  }

  void ArpTimeoutCheck(void)
 @@ -165,7 +165,7 @@ void ArpReceive(struct Ethernet_hdr *et, struct 
 IP_UDP_hdr *ip, int len)
                NetCopyIP(arp-ar_tpa, arp-ar_spa);
                memcpy(arp-ar_sha, NetOurEther, ARP_HLEN);
                NetCopyIP(arp-ar_spa, NetOurIP);
 -               (void) eth_send((uchar *)et, eth_hdr_size + ARP_HDR_SIZE);
 +               NetSendPacket((uchar *)et, eth_hdr_size + ARP_HDR_SIZE);
                return;

        case ARPOP_REPLY:               /* arp reply */
 @@ -198,7 +198,7 @@ void ArpReceive(struct Ethernet_hdr *et, struct 
 IP_UDP_hdr *ip, int len)
                        /* modify header, and transmit it */
                        memcpy(((struct Ethernet_hdr *)NetArpWaitTxPacket)-
                                et_dest, NetArpWaitPacketMAC, ARP_HLEN);
 -                       (void) eth_send(NetArpWaitTxPacket,
 +                       NetSendPacket(NetArpWaitTxPacket,
                                        NetArpWaitTxPacketSize);

                        /* no arp request pending now */
 diff --git a/net/cdp.c b/net/cdp.c
 index 5c4b3e8..34c5401 100644
 --- a/net/cdp.c
 +++ b/net/cdp.c
 @@ -215,7 +215,7 @@ CDPSendTrigger(void)
                chksum = 0x;
        *cp = htons(chksum);

 -       (void) eth_send(NetTxPacket, (uchar *)s - NetTxPacket);
 +       NetSendPacket(NetTxPacket, (uchar *)s - NetTxPacket);
        return 0;
  }

 diff --git a/net/net.c b/net/net.c
 index d5e6e54..0d14e2c 100644
 --- a/net/net.c
 +++ b/net/net.c
 @@ -586,13 +586,6 @@ NetSetTimeout(ulong iv, thand_f *f)
        }
  }

 -
 -void
 -NetSendPacket(uchar *pkt, int len)
 -{
 -       (void) eth_send(pkt, len);
 -}
 -
  int
  NetSendUDPPacket(uchar *ether, IPaddr_t dest, int dport, int sport,
                int payload_len)
 @@ -649,7 +642,7 @@ NetSendUDPPacket(uchar *ether, IPaddr_t dest, int dport, 
 int sport,
                return 1;       /* waiting */
        } else {
                debug(sending UDP to %pI4/%pM\n, dest, ether);
 -               eth_send(NetTxPacket, pkt_hdr_size + payload_len);
 +               NetSendPacket(NetTxPacket, pkt_hdr_size + payload_len);
                return 0;       /* transmitted */
        }
  }
 diff --git a/net/ping.c b/net/ping.c
 index eb0f0cc..4896bce 100644
 --- a/net/ping.c
 +++ b/net/ping.c
 @@ -112,8 +112,7 @@ void ping_receive(struct Ethernet_hdr *et, struct 
 IP_UDP_hdr *ip, int len)
                icmph-checksum = 0;
                icmph-checksum = ~NetCksum((uchar *)icmph,
                        (len - IP_HDR_SIZE)  1);
 -               (void) eth_send((uchar *)et,
 -                               ETHER_HDR_SIZE + len);
 +               NetSendPacket((uchar *)et, ETHER_HDR_SIZE + len);
                return;
  /*     default:
                return;*/
 --
 1.6.0.2

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


Re: [U-Boot] [PATCH v2 08/18] net: Refactor to protect access to the NetState variable

2012-04-03 Thread Simon Glass
Hi Joe,

On Tue, Mar 27, 2012 at 4:42 PM, Joe Hershberger joe.hershber...@ni.com wrote:
 Changes to NetState now go through an accessor function called
 net_set_state()

 Signed-off-by: Joe Hershberger joe.hershber...@ni.com
 Cc: Joe Hershberger joe.hershber...@gmail.com
 Cc: Simon Glass s...@chromium.org
 Cc: Mike Frysinger vap...@gentoo.org
 ---
 Changes for v2:
   - net_set_state changed to static inline
   - States changed to an enum
   - Eliminate CamelCase in new functions.

  drivers/net/netconsole.c |    6 +++---
  include/net.h            |   16 ++--
  net/cdp.c                |    2 +-
  net/dns.c                |    8 
  net/net.c                |   21 -
  net/nfs.c                |    8 
  net/ping.c               |    4 ++--
  net/sntp.c               |    4 ++--
  net/tftp.c               |    8 
  9 files changed, 42 insertions(+), 35 deletions(-)

 diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
 index ba02fd7..28bb955 100644
 --- a/drivers/net/netconsole.c
 +++ b/drivers/net/netconsole.c
 @@ -44,19 +44,19 @@ static void nc_wait_arp_handler(uchar *pkt, unsigned dest,
                                 IPaddr_t sip, unsigned src,
                                 unsigned len)
  {
 -       NetState = NETLOOP_SUCCESS; /* got arp reply - quit net loop */
 +       net_set_state(NETLOOP_SUCCESS); /* got arp reply - quit net loop */
  }

  static void nc_handler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,
                        unsigned len)
  {
        if (input_size)
 -               NetState = NETLOOP_SUCCESS; /* got input - quit net loop */
 +               net_set_state(NETLOOP_SUCCESS); /* got input - quit net loop 
 */
  }

  static void nc_timeout(void)
  {
 -       NetState = NETLOOP_SUCCESS;
 +       net_set_state(NETLOOP_SUCCESS);
  }

  void NcStart(void)
 diff --git a/include/net.h b/include/net.h
 index f84511c..c33cd28 100644
 --- a/include/net.h
 +++ b/include/net.h
 @@ -390,12 +390,6 @@ extern uchar               NetEtherNullAddr[6];
  extern ushort          NetOurVLAN;             /* Our VLAN */
  extern ushort          NetOurNativeVLAN;       /* Our Native VLAN */

 -extern int             NetState;               /* Network loop state */
 -#define NETLOOP_CONTINUE       1
 -#define NETLOOP_RESTART                2
 -#define NETLOOP_SUCCESS                3
 -#define NETLOOP_FAIL           4
 -
  extern int             NetRestartWrap;         /* Tried all network devices 
 */

  enum proto_t {
 @@ -465,6 +459,16 @@ extern void        NetSetHandler(rxhand_f *);      /* 
 Set RX packet handler */
  extern void net_set_icmp_handler(rxhand_icmp_f *f); /* Set ICMP RX handler */
  extern void    NetSetTimeout(ulong, thand_f *);/* Set timeout handler */

 +/* Network loop state */
 +enum net_loop_state {
 +       NETLOOP_CONTINUE, NETLOOP_RESTART, NETLOOP_SUCCESS, NETLOOP_FAIL

Do we need these all on one line?

 +};
 +static inline void net_set_state(enum net_loop_state state)
 +{
 +       extern enum net_loop_state net_state;

blank line?

 +       net_state = state;
 +}
 +
  /* Transmit NetTxPacket */
  static inline void NetSendPacket(uchar *pkt, int len)
  {
 diff --git a/net/cdp.c b/net/cdp.c
 index 34c5401..f1c1c14 100644
 --- a/net/cdp.c
 +++ b/net/cdp.c
 @@ -234,7 +234,7 @@ CDPTimeout(void)
        if (!CDPOK)
                NetStartAgain();
        else
 -               NetState = NETLOOP_SUCCESS;
 +               net_set_state(NETLOOP_SUCCESS);
  }

  static void
 diff --git a/net/dns.c b/net/dns.c
 index cc7ed51..cc0aa0a 100644
 --- a/net/dns.c
 +++ b/net/dns.c
 @@ -98,7 +98,7 @@ static void
  DnsTimeout(void)
  {
        puts(Timeout\n);
 -       NetState = NETLOOP_FAIL;
 +       net_set_state(NETLOOP_FAIL);
  }

  static void
 @@ -128,7 +128,7 @@ DnsHandler(uchar *pkt, unsigned dest, IPaddr_t sip, 
 unsigned src, unsigned len)
        /* Received 0 answers */
        if (header-nanswers == 0) {
                puts(DNS: host not found\n);
 -               NetState = NETLOOP_SUCCESS;
 +               net_set_state(NETLOOP_SUCCESS);
                return;
        }

 @@ -141,7 +141,7 @@ DnsHandler(uchar *pkt, unsigned dest, IPaddr_t sip, 
 unsigned src, unsigned len)
        /* We sent query class 1, query type 1 */
        if (p[5]  e || get_unaligned_be16(p+1) != DNS_A_RECORD) {
                puts(DNS: response was not an A record\n);
 -               NetState = NETLOOP_SUCCESS;
 +               net_set_state(NETLOOP_SUCCESS);
                return;
        }

 @@ -191,7 +191,7 @@ DnsHandler(uchar *pkt, unsigned dest, IPaddr_t sip, 
 unsigned src, unsigned len)
                        puts(server responded with invalid IP number\n);
        }

 -       NetState = NETLOOP_SUCCESS;
 +       net_set_state(NETLOOP_SUCCESS);
  }

  void
 diff --git a/net/net.c b/net/net.c
 index 0d14e2c..8076e5f 100644
 --- a/net/net.c
 +++ b/net/net.c
 @@ -149,7 +149,7 @@ uchar               

Re: [U-Boot] [RFC v0 08/11] omap3: Consolidate UART information in omap3_common.h

2012-04-03 Thread Mike Frysinger
On Tuesday 03 April 2012 19:45:11 Tom Rini wrote:
 On Tue, Apr 03, 2012 at 05:35:25PM -0400, Mike Frysinger wrote:
  On Thursday 22 March 2012 15:09:14 Tom Rini wrote:
   --- a/include/configs/omap3_common.h
   +++ b/include/configs/omap3_common.h
   
   +/*
   + * Default serial port configuration is an NS16550-compatible UART.
   + * Boards can override this as needed with CONFIG_SERIAL_MULTI
   + */
   +#ifndef CONFIG_SERIAL_MULTI
   +#define CONFIG_SYS_NS16550
   +#define CONFIG_SYS_NS16550_SERIAL
   +#define CONFIG_SYS_NS16550_REG_SIZE  (-4)
   +#define CONFIG_SYS_NS16550_CLK   4800
   +#define CONFIG_SYS_BAUDRATE_TABLE{4800, 9600, 19200, 38400, 
   57600,\
   + 115200}
   +#endif
  
  the baudrate table is fairly independent of the serial driver.  might
  want to split that out into its own ifndef/define/endif check.
 
 What I really wanted here was a test for not using the SoM UART.
 Looking at the examples we have today, it's either the SoM and the above
 table but differing in which UART is physically exposed or it's
 SERIAL_MULTI and wants it's own baudrate table.

not sure what you mean.  CONFIG_SYS_BAUDRATE_TABLE is used in 
common/cmd_nvedit.c, so i'm not sure what you mean by having diff values 
depending on the diff uart setups ...

 Part of me thinks I should whack at include/config_defaults.h and add
 something like #ifndef CONFIG_SYS_BAUDRATE_TABLE, standard rates,
 #endif.  And same for CONFIG_SYS_PROMPT_HUSH_PS2 and probably a few
 others.

would make sense to me, although i'd cut out 4800 from the default list
-mike


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


Re: [U-Boot] [RFC v0 0/11]: Add configs/omap3_common.h

2012-04-03 Thread Mike Frysinger
On Tuesday 03 April 2012 19:35:05 Tom Rini wrote:
 On Tue, Apr 03, 2012 at 05:37:37PM -0400, Mike Frysinger wrote:
  On Thursday 22 March 2012 15:09:06 Tom Rini wrote:
   Here's something I've talked about a bit before.  This series adds
   include/configs/omap3_common.h and makes all CONFIG_OMAP34XX boards use
   it.  This particular round of posting doesn't directly apply as I'm
   working off of a series of cleanups that I'll post once I'm sure I
   don't find any others from doing this (unused CONFIG options) general
   series. What I'm really looking for is feedback on the implementation,
   namely what I lay out in the first patch of a section to set before
   using omap3_common.h, including, and a section for after
   omap3_common.h.  The series isn't nearly complete but introduces at
   least one example of a our board isn't like all the others in each
   of the sections.
  
  seems like for the most part this is soc-specific default configs, and
  one or two might be a vendor (TI) specific defaults (which aren't really
  harmful).
 
 There is a certain amount of this that can be shared with
 omap4/5/am33xx/davinci (since the IP is shared).  I'm not sure of the
 best way to share that yet, but I wanted to do it in steps.

sure.  this is an improvement, so might as well merge it since you've done the 
work.

  the patches as-is generally look OK, but i wonder if we shouldn't expand
  the arm asm/config.h to tail into an asm/arch/config.h so these
  soc-specific defaults can live there rather than include/configs/.
 
 That's a good idea, I think.  I'll give that a spin and see how it
 looks.

i've got the ADI (vendor) common stuff in include/configs/bfin_adi_common.h, 
but 
i've put quite a lot of sane stuff into the arch/blackfin/include/asm/config.h 
that makes sense at the arch level.
-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 2/3] MIPS: fix inconsistency in config option for cache operation mode

2012-04-03 Thread Shinya Kuribayashi
On Wed, Apr 4, 2012 at 1:09 AM, Marek Vasut ma...@denx.de wrote:
 I only changed start.S and forgot to change this code part too. That is why
 I created this patch to fix this inconsistency.

 I see ... so this fixes some other commit. What was Shinya-san's concern, that
 you only changed this file?

On Wed, Apr 4, 2012 at 5:33 AM, Mike Frysinger vap...@gentoo.org wrote:
 On Tuesday 03 April 2012 09:40:08 Marek Vasut wrote:
 Mike, there was some issue with this patch?

 i had feedback on the endian flags last time Daniel posted it, but i don't
 think i ever gave feedback on this ... i certainly don't know mips asm beyond
 the extreme basics ;).

Apologies for confusing, I intended to refer to PATCH 3/3, not 2/3.
If everybody is Ok with 3/3 as-is, I'm fine.

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


Re: [U-Boot] [PATCH] ARM: add u-boot.imx as target for i.MX SOCs

2012-04-03 Thread Dirk Behme

On 03.04.2012 16:32, Stefano Babic wrote:

Freescale SOCs require an header to u-boot.bin

The patch adds u-boot.imx to the default targets
if the imx file is set (IMX_CONFIG).

Signed-off-by: Stefano Babic sba...@denx.de
Cc: Albert ARIBAUD albert.u.b...@aribaud.net
CC: Loïc Minier loic.min...@linaro.org
CC: Mike Frysinger vap...@gentoo.org
---
 arch/arm/cpu/armv7/config.mk |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/config.mk b/arch/arm/cpu/armv7/config.mk
index 83ddf10..f532d62 100644
--- a/arch/arm/cpu/armv7/config.mk
+++ b/arch/arm/cpu/armv7/config.mk
@@ -31,3 +31,6 @@ PLATFORM_CPPFLAGS += -march=armv5
 # =
 PF_RELFLAGS_SLB_AT := $(call cc-option,-mshort-load-bytes,$(call 
cc-option,-malignment-traps,))
 PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT)
+ifneq ($(CONFIG_IMX_CONFIG),)
+ALL-y  += $(obj)u-boot.imx
+endif


Not tested yet, but I like the idea:

Acked-by: Dirk Behme dirk.be...@de.bosch.com

Any chance to still get this into 2012.04?

Thanks!

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