This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

AT91 USB driver fix


Hi Folks

The AT91 USB driver can use a GPIO line to control the pullup used to
indicate to the host that the device is ready to start work. This GPIO
line can either be active high or active low. There was CDL to control
this. However the CDL was broken. The C code was similarly broken so
that it worked on the AT91SAM7S-EK development board where the code
was developed. I've now been using the code on a custom board where i
needed to use the invert and the bugs came to light. This patch fixes
the problems.

    Andrew
? devs/usb/at91/current/src/usbs_at91.c.asl
Index: devs/usb/at91/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/usb/at91/current/ChangeLog,v
retrieving revision 1.4
diff -u -r1.4 ChangeLog
--- devs/usb/at91/current/ChangeLog	7 Sep 2006 12:38:34 -0000	1.4
+++ devs/usb/at91/current/ChangeLog	20 Nov 2007 10:59:05 -0000
@@ -1,3 +1,13 @@
+2007-11-20  Andrew Lunn  <andrew.lunn@ascom.ch>
+
+	* cdl/usbs_at91.cdl: Fixed typos in
+	CYGNUM_DEVS_USB_AT91_GPIO_PULLUP_INVERTED and
+	CYGNUM_DEVS_USB_AT91_GPIO_READ_POWER_INVERTED. Fixing the typo.
+
+	* src/usbs_at91.c (usbs_at91_set_pullup): Change the logic so that
+	CYGNUM_DEVS_USB_AT91_GPIO_PULLUP_INVERTED does actually cause an
+	invert when set true.
+	
 2006-09-07  John Eigelaar  <jeigelaar@mweb.co.za>
 
 	* cdl/usbs_at91.c: Read actual EP addresses from the EP configuartion
Index: devs/usb/at91/current/cdl/usbs_at91.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/usb/at91/current/cdl/usbs_at91.cdl,v
retrieving revision 1.3
diff -u -r1.3 usbs_at91.cdl
--- devs/usb/at91/current/cdl/usbs_at91.cdl	6 Jun 2006 13:30:11 -0000	1.3
+++ devs/usb/at91/current/cdl/usbs_at91.cdl	20 Nov 2007 10:59:06 -0000
@@ -103,13 +103,14 @@
                    then select NONE"
         }
 
-        cdl_option CYGNUM_DEVS_USB_AT91_PIO_SET_PULLUP_INVERTED {
+        cdl_option CYGNUM_DEVS_USB_AT91_GPIO_SET_PULLUP_INVERTED {
             display       "Has the signal to be inverted?"
             flavor        bool
             default_value 1
             description "
                    This option indicates that the pullup pin should
-                   be inverted. ie VDD is active, VCC is inactive."
+                   be inverted. ie VDD is active, VCC is inactive. For the
+                   AT91SAM7SEK it needs to be inverted, hence this default."
         }
 
         cdl_option CYGDAT_DEVS_USB_AT91_GPIO_READ_POWER_PIN {
@@ -121,7 +122,7 @@
                    a pin then select NONE"
         }
 
-        cdl_option CYGNUM_DEVS_USB_AT91_PIO_READ_POWER_INVERTED {
+        cdl_option CYGNUM_DEVS_USB_AT91_GPIO_READ_POWER_INVERTED {
             display       "Has the signal to be inverted?"
             flavor        bool
             default_value 0
@@ -206,4 +207,4 @@
                     devices on the target hardware to prevent a name clash."
             }
     }
-}
\ No newline at end of file
+}
Index: devs/usb/at91/current/src/usbs_at91.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/usb/at91/current/src/usbs_at91.c,v
retrieving revision 1.3
diff -u -r1.3 usbs_at91.c
--- devs/usb/at91/current/src/usbs_at91.c	7 Sep 2006 12:38:34 -0000	1.3
+++ devs/usb/at91/current/src/usbs_at91.c	20 Nov 2007 10:59:06 -0000
@@ -285,9 +285,9 @@
       set
 #endif
       ) {
-    HAL_ARM_AT91_GPIO_RESET(CYGDAT_DEVS_USB_AT91_GPIO_SET_PULLUP_PIN);
+     HAL_ARM_AT91_GPIO_SET(CYGDAT_DEVS_USB_AT91_GPIO_SET_PULLUP_PIN);
   } else {
-    HAL_ARM_AT91_GPIO_SET(CYGDAT_DEVS_USB_AT91_GPIO_SET_PULLUP_PIN);
+     HAL_ARM_AT91_GPIO_RESET(CYGDAT_DEVS_USB_AT91_GPIO_SET_PULLUP_PIN);
   }
 #endif
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]