Re: [U-Boot] [PATCH V2 1/2] USB-CDC: correct wrong alignment in ether.c

2010-08-15 Thread Stefano Babic
Sergei Shtylyov wrote:
 Hello.
 
 Stefano Babic wrote:
 
 The buffer for the status request must be word aligned
 because it is accessed with 32 bit pointer in the
 eth_status_complete function.
 
 Signed-off-by: Stefano Babic sba...@denx.de
 [...]
 diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
 index 313f15f..0b4ed18 100644
 --- a/drivers/usb/gadget/ether.c
 +++ b/drivers/usb/gadget/ether.c
 @@ -684,7 +684,7 @@ static struct usb_gadget_stringsstringtab = {
  
  
 /**/

  static u8 control_req[USB_BUFSIZ];
 -static u8 status_req[STATUS_BYTECOUNT];
 +static u8 status_req[STATUS_BYTECOUNT] __attribute__ ((aligned(32)));
 
You're aligning to 32 *bytes* -- is that what you meant by 32 bit
 pointer?

Oooopsss ! Thanks, I fix it

Best regards,
Stefano

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


Re: [U-Boot] [PATCH V2 2/2] USB-CDC: called handle_interrupts inside usb_eth_send

2010-08-15 Thread Stefano Babic
Remy Bohmer wrote:
 Hi,
 
 2010/8/14 Stefano Babic sba...@denx.de:
 The patch removes an endless loop  in the usb_eth_send
 if the tx_complete is not called before going
 in the loop. The driver interrupt routine is called
 allowing the driver to check if the TX is completed.

 Signed-off-by: Stefano Babic sba...@denx.de
 ---

 Changes from V1:
 - Comments by Remy Bohmer: moved usb_ep_queue inside timeout
 to not break at91 code
 
 Sorry, patch does not apply any more after applying the series from
 Vitaly yesterday. please rebase.

No problem, I rebase it.

Best regards,
Stefano

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


[U-Boot] [PATCH V3 2/2] USB-CDC: called handle_interrupts inside usb_eth_send

2010-08-15 Thread Stefano Babic
The patch removes an endless loop  in the usb_eth_send
if the tx_complete is not called before going
in the loop. The driver interrupt routine is called
allowing the driver to check if the TX is completed.

Signed-off-by: Stefano Babic sba...@denx.de
---
 drivers/usb/gadget/ether.c |   10 +-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 9fc6a36..2965299 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -1801,6 +1801,8 @@ static int usb_eth_send(struct eth_device* netdev, 
volatile void* packet, int le
int retval;
struct usb_request  *req = NULL;
struct eth_dev  *dev = l_ethdev;
+   unsigned long ts;
+   unsigned long timeout = USB_CONNECT_TIMEOUT;
 
debug(%s:...\n, __func__);
 
@@ -1826,6 +1828,8 @@ static int usb_eth_send(struct eth_device* netdev, 
volatile void* packet, int le
? ((dev-tx_qlen % qmult) != 0) : 0;
 #endif
dev-tx_qlen=1;
+   ts = get_timer(0);
+   packet_sent = 0;
 
retval = usb_ep_queue (dev-in_ep, req, GFP_ATOMIC);
 
@@ -1833,7 +1837,11 @@ static int usb_eth_send(struct eth_device* netdev, 
volatile void* packet, int le
debug(%s: packet queued\n, __func__);
while(!packet_sent)
{
-   packet_sent=0;
+   if (get_timer(ts)  timeout) {
+   printf(timeout sending packets to usb ethernet\n);
+   return -1;
+   }
+   usb_gadget_handle_interrupts();
}
 
return 0;
-- 
1.6.3.3

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


[U-Boot] [PATCH V3 1/2] USB-CDC: correct wrong alignment in ether.c

2010-08-15 Thread Stefano Babic
The buffer for the status request must be word aligned
because it is accessed with 32 bit pointer in the
eth_status_complete function.

Signed-off-by: Stefano Babic sba...@denx.de
---
 drivers/usb/gadget/ether.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index c601d4a..9fc6a36 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -677,7 +677,7 @@ static struct usb_gadget_stringsstringtab = {
 
 
/**/
 static u8 control_req[USB_BUFSIZ];
-static u8 status_req[STATUS_BYTECOUNT];
+static u8 status_req[STATUS_BYTECOUNT] __attribute__ ((aligned(4)));
 
 
 
-- 
1.6.3.3

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


Re: [U-Boot] [PATCH V3 2/2] USB-CDC: called handle_interrupts inside usb_eth_send

2010-08-15 Thread Remy Bohmer
Hi,

2010/8/15 Stefano Babic sba...@denx.de:
 The patch removes an endless loop  in the usb_eth_send
 if the tx_complete is not called before going
 in the loop. The driver interrupt routine is called
 allowing the driver to check if the TX is completed.

 Signed-off-by: Stefano Babic sba...@denx.de
 ---
  drivers/usb/gadget/ether.c |   10 +-
  1 files changed, 9 insertions(+), 1 deletions(-)

Applied to u-boot-usb/cdc
Thanks.

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


Re: [U-Boot] [PATCH V3 1/2] USB-CDC: correct wrong alignment in ether.c

2010-08-15 Thread Remy Bohmer
Hi,

2010/8/15 Stefano Babic sba...@denx.de:
 The buffer for the status request must be word aligned
 because it is accessed with 32 bit pointer in the
 eth_status_complete function.

 Signed-off-by: Stefano Babic sba...@denx.de
 ---
  drivers/usb/gadget/ether.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

Applied to u-boot-usb/cdc
Thanks.

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


[U-Boot] [PATCH] IDE: Don't assume there are always two devices per bus

2010-08-15 Thread Rogan Dawes
Some SATA controllers can operate in an IDE compatible mode (e.g. mvsata)
but will only ever have a single device per bus.

This allows the upcoming DNS323 port to properly identify and use
a drive on both SATA interfaces.
---
 include/ide.h |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/ide.h b/include/ide.h
index 6a1b7ae..85a48f8 100644
--- a/include/ide.h
+++ b/include/ide.h
@@ -24,7 +24,8 @@
 #ifndef_IDE_H
 #define _IDE_H
 
-#defineIDE_BUS(dev)(dev  1)
+#defineIDE_BUS(dev)(dev  (CONFIG_SYS_IDE_MAXDEVICE / \
+   CONFIG_SYS_IDE_MAXBUS - 1))
 
 #defineATA_CURR_BASE(dev)  
(CONFIG_SYS_ATA_BASE_ADDR+ide_bus_offset[IDE_BUS(dev)])
 
-- 
1.7.0.4

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


Re: [U-Boot] [PATCH] IDE: Don't assume there are always two devices per bus

2010-08-15 Thread Wolfgang Denk
Dear Rogan Dawes,

In message 1281904542-11694-1-git-send-email-ro...@dawes.za.net you wrote:

 -#define  IDE_BUS(dev)(dev  1)
 +#define  IDE_BUS(dev)(dev  (CONFIG_SYS_IDE_MAXDEVICE / \
 + CONFIG_SYS_IDE_MAXBUS - 1))

Please add parens to make clear you really mean what you write.
Especially with the line wrapping this could easily be misread.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
In Christianity neither morality nor religion come into contact with
reality at any point.  - Friedrich Nietzsche
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2a] AT91: add SD/MMC support

2010-08-15 Thread Xu, Hong
Hi Alex,

Thanks to Reinhard, his previous work does well on SAM9260 SAM9G20 SAM9XE 
SAM9RL (I tested all of them). Since he said he'll provide a more fancy one, 
I'm just on hold :-)

For your issue, could you try (If you're using the original EK board from Atmel)

Remove R42

- or -

In at91_mci_hw_init() @ arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c ,
Add a line

at91_set_pio_input(AT91_PIO_PORTA, 2, 0);

This will let the CLK line of dataflash appear high resistance state. (By 
default, the CLK line of dataflash and SD slot are connected together by a 0R 
resistor)

BR,
Eric

 -Original Message-
 From: u-boot-boun...@lists.denx.de 
 [mailto:u-boot-boun...@lists.denx.de] On Behalf Of asc0
 Sent: 2010?8?13? 18:19
 To: u-boot@lists.denx.de
 Subject: Re: [U-Boot] [PATCH v2a] AT91: add SD/MMC support
 
 
 Hello! I have successfully applied your patch on a 
 AT91SAM9G20 cpu and it reads the correct CID  CSD info.
 At the end of initialization the bread function fails with 
 the following
 error:
 
 mmc: bread failed, status = 0040c0e5, card status = 0900
 
 Does someone else received this error or have a hint on this 
 error message?
 
 Thanks,
   Alex
 --
 View this message in context: 
 http://old.nabble.com/-U-Boot---PATCH--AT91SAM9260-9XE%3A-add-
 support-for-MultiMedia-Card-Interface-%28MCI%29-tp29068839p294
 27373.html
 Sent from the Uboot - Users mailing list archive at Nabble.com.
 
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot
 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] UNS: [Nios2-dev] [PATCH] nios2: fix out of reach case for do_reset

2010-08-15 Thread Thomas Chou
On 08/14/2010 07:51 AM, Brad Parker wrote:
 As a comment, that patch looks pretty ugly.  I might suggest an inline
 function (called callr or nios2_callr) which
 encapsulates the __asm__.   That would make the code much easier to read.

 You could put the inline function in one of the asm headers.

 -brad

Hi Brad,

Thanks. I will add a macro for the inline asm.

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


[U-Boot] [PATCH v2] nios2: fix out of reach case for do_reset

2010-08-15 Thread Thomas Chou
There is a limitation (or bug?) of nios2 toolchain. The nios2 gcc
didn't generate correct code when the reset vector is passed as a
constant. It just generated a direct call, which was wrong when
the reset vector was not located in the same 256MB span as u-boot.

The Nios II Processor Reference Handbook said,
call can transfer execution anywhere within the 256 MByte range
determined by PC31..28. The Nios II GNU linker does not automatically
handle cases in which the address is out of this range.

So we have to use registered callr instruction to do the job.

Signed-off-by: Thomas Chou tho...@wytron.com.tw
---
v2, add a macro for the inlince asm nios2_callr.

 arch/nios2/cpu/cpu.c|   11 +--
 arch/nios2/include/asm/system.h |5 +
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/arch/nios2/cpu/cpu.c b/arch/nios2/cpu/cpu.c
index 6379534..d9c6544 100644
--- a/arch/nios2/cpu/cpu.c
+++ b/arch/nios2/cpu/cpu.c
@@ -40,11 +40,10 @@ int checkcpu (void)
return (0);
 }
 
-
-int do_reset (void)
+int do_reset(void)
 {
-   void (*rst)(void) = (void(*)(void))CONFIG_SYS_RESET_ADDR;
-   disable_interrupts ();
-   rst();
-   return(0);
+   disable_interrupts();
+   /* indirect call to go beyond 256MB limitation of toolchain */
+   nios2_callr(CONFIG_SYS_RESET_ADDR);
+   return 0;
 }
diff --git a/arch/nios2/include/asm/system.h b/arch/nios2/include/asm/system.h
index bb03ca5..086d92b 100644
--- a/arch/nios2/include/asm/system.h
+++ b/arch/nios2/include/asm/system.h
@@ -56,4 +56,9 @@
((flags  NIOS2_STATUS_PIE_MSK) == 0x0);\
 })
 
+/* indirect call to go beyond 256MB limitation of toolchain */
+#define nios2_callr(addr) __asm__ __volatile__ (   \
+   callr  %0 \
+   : : r (addr))
+
 #endif /* __ASM_NIOS2_SYSTEM_H */
-- 
1.7.2.1

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


[U-Boot] [PATCH 0/7] patch set for P1021MDS support

2010-08-15 Thread Haiying Wang
The patchset supports SRAM boot, P1021MDS NAND boot, P1021MDS QE/UEC, it
is against the git://git.denx.de/u-boot-mpc85xx. 

Thanks.

Haiying


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


Re: [U-Boot] [PATCH 0/7] patch set for P1021MDS support

2010-08-15 Thread Wolfgang Denk
Dear Haiying Wang,

In message 1281928450.3071.0.ca...@localhost.localdomain you wrote:
 The patchset supports SRAM boot, P1021MDS NAND boot, P1021MDS QE/UEC, it
 is against the git://git.denx.de/u-boot-mpc85xx. 

Please keep in mind that patches shall be submitted against the
mainline repository, NOPT against any custodian branches.
This is to make sure everybody can apply and test these without
addinitional compatibility issues.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Steal five dollars and you were a petty  thief.  Steal  thousands  of
dollars and you are either a government or a hero.
   - Terry Pratchett, _Going_Postal_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] IDE: Don't assume there are always two devices per bus

2010-08-15 Thread Rogan Dawes
This addresses Wolfgang's suggestion to use additional parens

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


[U-Boot] [PATCH] IDE: Don't assume there are always two devices per bus

2010-08-15 Thread Rogan Dawes
From: Rogan Dawes ro...@dawes.za.net

Some SATA controllers can operate in an IDE compatible mode (e.g. mvsata)
but will only ever have a single device per bus.

This allows the upcoming DNS323 port to properly identify and use
a drive on both SATA interfaces.
---
 include/ide.h |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/ide.h b/include/ide.h
index 6a1b7ae..c812b28 100644
--- a/include/ide.h
+++ b/include/ide.h
@@ -24,7 +24,8 @@
 #ifndef_IDE_H
 #define _IDE_H
 
-#defineIDE_BUS(dev)(dev  1)
+#defineIDE_BUS(dev)(dev  ((CONFIG_SYS_IDE_MAXDEVICE / \
+   CONFIG_SYS_IDE_MAXBUS) - 1))
 
 #defineATA_CURR_BASE(dev)  
(CONFIG_SYS_ATA_BASE_ADDR+ide_bus_offset[IDE_BUS(dev)])
 
-- 
1.7.0.4

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