Add a little more

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3201 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2010-12-20 20:59:12 +00:00
parent 4566137cb8
commit 857a6111bc
3 changed files with 372 additions and 48 deletions
+16 -7
View File
@@ -144,7 +144,12 @@
#if CONFIG_USBHOST_TDBUFFERS > 0 && !defined(CONFIG_USBHOST_TDBUFSIZE) #if CONFIG_USBHOST_TDBUFFERS > 0 && !defined(CONFIG_USBHOST_TDBUFSIZE)
# define CONFIG_USBHOST_TDBUFSIZE 128 # define CONFIG_USBHOST_TDBUFSIZE 128
#endif #endif
#define LPC17_TDBUFFER_SIZE (CONFIG_USBHOST_TDBUFFERS * CONFIG_USBHOST_TDBUFSIZE)
#if (CONFIG_USBHOST_TDBUFSIZE & 3) != 0
# error "TD buffer size must be an even number of 32-bit words"
#endif
#define LPC17_TDFREE_SIZE (CONFIG_USBHOST_TDBUFFERS * CONFIG_USBHOST_TDBUFSIZE)
/* Configurable size of an IO buffer. The number of IO buffers will be determined /* Configurable size of an IO buffer. The number of IO buffers will be determined
* by what is left at the end of the BANK1 memory setup aside of OHCI RAM. * by what is left at the end of the BANK1 memory setup aside of OHCI RAM.
@@ -154,6 +159,10 @@
# define CONFIG_USBHOST_IOBUFSIZE 512 # define CONFIG_USBHOST_IOBUFSIZE 512
#endif #endif
#if (CONFIG_USBHOST_IOBUFSIZE & 3) != 0
# error "IO buffer size must be an even number of 32-bit words"
#endif
/* OHCI Memory Layout ***************************************************************/ /* OHCI Memory Layout ***************************************************************/
/* Example: /* Example:
* Hardware: * Hardware:
@@ -171,8 +180,8 @@
* Sizes of things * Sizes of things
* CONFIG_USBHOST_NEDS 2 * CONFIG_USBHOST_NEDS 2
* LPC17_EDFREE_SIZE 48 * LPC17_EDFREE_SIZE 48
* LPC17_TDBUFFER_SIZE 128 * LPC17_TDFREE_SIZE 128
* LPC17_TDBUFFER_SIZE 512 * LPC17_IOFREE_SIZE 512
* *
* Memory Layout * Memory Layout
* LPC17_OHCIRAM_END (0x20008000 + 16384) = 0x2000c000 * LPC17_OHCIRAM_END (0x20008000 + 16384) = 0x2000c000
@@ -186,8 +195,8 @@
* LPC17_TDTAIL_ADDR 0x2000bd10 * LPC17_TDTAIL_ADDR 0x2000bd10
* LPC17_EDCTRL_ADDR 0x2000bd20 * LPC17_EDCTRL_ADDR 0x2000bd20
* LPC17_EDFREE_BASE 0x2000bd30 * LPC17_EDFREE_BASE 0x2000bd30
* LPC17_TDBUFFER_BASE 0x2000bd50 * LPC17_TDFREE_BASE 0x2000bd50
* LPC17_IOBUFFER_BASE 0x2000bdd0 * LPC17_IOFREE_BASE 0x2000bdd0
* LPC17_IOBUFFERS (0x2000c000 + 0x2000bdd0) / 512 = 560/512 = 1 * LPC17_IOBUFFERS (0x2000c000 + 0x2000bdd0) / 512 = 560/512 = 1
* *
* Wasted memory: 560-512 = 48 bytes * Wasted memory: 560-512 = 48 bytes
@@ -198,8 +207,8 @@
#define LPC17_TDTAIL_ADDR (LPC17_TDHEAD_ADDR + LPC17_TD_SIZE) #define LPC17_TDTAIL_ADDR (LPC17_TDHEAD_ADDR + LPC17_TD_SIZE)
#define LPC17_EDCTRL_ADDR (LPC17_TDTAIL_ADDR + LPC17_TD_SIZE) #define LPC17_EDCTRL_ADDR (LPC17_TDTAIL_ADDR + LPC17_TD_SIZE)
#define LPC17_EDFREE_BASE (LPC17_EDCTRL_ADDR + LPC17_ED_SIZE) #define LPC17_EDFREE_BASE (LPC17_EDCTRL_ADDR + LPC17_ED_SIZE)
#define LPC17_TDBUFFER_BASE (LPC17_EDFREE_BASE + LPC17_EDFREE_SIZE) #define LPC17_TDFREE_BASE (LPC17_EDFREE_BASE + LPC17_EDFREE_SIZE)
#define LPC17_IOBUFFER_BASE (LPC17_TDBUFFER_BASE + LPC17_TDBUFFER_SIZE) #define LPC17_IOFREE_BASE (LPC17_TDFREE_BASE + LPC17_TDFREE_SIZE)
/* Finally, use the remainder of the allocated OHCI for IO buffers */ /* Finally, use the remainder of the allocated OHCI for IO buffers */
File diff suppressed because it is too large Load Diff
+7 -7
View File
@@ -227,7 +227,7 @@
* *
* Description: * Description:
* Process a IN or OUT request on the control endpoint. These methods * Process a IN or OUT request on the control endpoint. These methods
* will enqueue the request and return immediately. Only one transfer may be * will enqueue the request and wait for it to complete. Only one transfer may be
* queued; Neither these methods nor the transfer() method can be called again * queued; Neither these methods nor the transfer() method can be called again
* until the control transfer functions returns. * until the control transfer functions returns.
* *
@@ -261,8 +261,8 @@
* *
* Description: * Description:
* Process a request to handle a transfer descriptor. This method will * Process a request to handle a transfer descriptor. This method will
* enqueue the transfer request and return immediately. Only one transfer may be * enqueue the transfer request and rwait for it to complete. Only one transfer may
* queued; Neither this method nor the ctrlin or ctrlout methods can be called * be queued; Neither this method nor the ctrlin or ctrlout methods can be called
* again until this function returns. * again until this function returns.
* *
* This is a blocking method; this functions will not return until the * This is a blocking method; this functions will not return until the
@@ -414,8 +414,8 @@ struct usbhost_driver_s
int (*free)(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer); int (*free)(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer);
/* Process a IN or OUT request on the control endpoint. These methods /* Process a IN or OUT request on the control endpoint. These methods
* will enqueue the request and return immediately. Only one transfer may be * will enqueue the request and wait for it to complete. Only one transfer may
* queued; Neither these methods nor the transfer() method can be called again * be queued; Neither these methods nor the transfer() method can be called again
* until the control transfer functions returns. * until the control transfer functions returns.
* *
* These are blocking methods; these functions will not return until the * These are blocking methods; these functions will not return until the
@@ -430,8 +430,8 @@ struct usbhost_driver_s
FAR const uint8_t *buffer); FAR const uint8_t *buffer);
/* Process a request to handle a transfer descriptor. This method will /* Process a request to handle a transfer descriptor. This method will
* enqueue the transfer request and return immediately. Only one transfer may be * enqueue the transfer request and wait for it to complete. Only one transfer may
* queued; Neither this method nor the ctrlin or ctrlout methods can be called * be queued; Neither this method nor the ctrlin or ctrlout methods can be called
* again until this function returns. * again until this function returns.
* *
* This is a blocking method; this functions will not return until the * This is a blocking method; this functions will not return until the