diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-04-05 21:34:24 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-04-05 21:34:24 +0000 |
commit | 559f6b32a41c0f2a8f90cb1a70d4f94c5aabb42b (patch) | |
tree | b0f25ff2be4d2f5ad6d9c76f676e30a92596580f | |
parent | 7d6b25e17e4a83e7fd20cec47203fa897c53113a (diff) | |
download | nuttx-559f6b32a41c0f2a8f90cb1a70d4f94c5aabb42b.tar.gz nuttx-559f6b32a41c0f2a8f90cb1a70d4f94c5aabb42b.tar.bz2 nuttx-559f6b32a41c0f2a8f90cb1a70d4f94c5aabb42b.zip |
Add patch to build kconfig-frontends under Cygwin
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4561 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r-- | misc/tools/README.txt | 44 | ||||
-rw-r--r-- | misc/tools/kconfig-frontends-3.3.0-1-libintl.patch | 73 | ||||
-rw-r--r-- | misc/tools/kconfig-frontends-3.3.0-1.tar.gz | bin | 0 -> 504640 bytes | |||
-rwxr-xr-x | misc/tools/kconfig-frontends-3.3.0-1.tar.xz | bin | 317488 -> 0 bytes | |||
-rwxr-xr-x | nuttx/arch/arm/src/stm32/stm32_otgfsdev.c | 169 |
5 files changed, 243 insertions, 43 deletions
diff --git a/misc/tools/README.txt b/misc/tools/README.txt new file mode 100644 index 000000000..09a14c73f --- /dev/null +++ b/misc/tools/README.txt @@ -0,0 +1,44 @@ +misc/tools/README.txt +===================== + +genromfs-0.5.2.tar.gz + + This is a snapshot of the genromfs tarball taken from + http://sourceforge.net/projects/romfs/. This snapshot is provided to + assure that a working version of genromfs is always available for NuttX. + + This tool is also include in the buildroot and can be built automatically + from the buildroot. + +kconfig-frontends-3.3.0-1.tar.gz + + This is a snapshot of the kconfig-frontends tarball taken from + http://ymorin.is-a-geek.org/projects/kconfig-frontends on April 5, 2012. + This snapshot is provided so that a working version of the mconf + utility is always available. + + General build instructions: + + ./configure + make + make install + + To suppress the graphical interfaces: + + ./configure --disable-gconf --disable-qconf + make + make install + +kconfig-frontends-3.3.0-1-libintl.patch + + The above build instructions did not work for me under my Cygwin + installation. This patch is a awful hack but will successfully + build 'mconf' under Cygwin. + + cat kconfig-frontends-3.3.0-1-libintl.patch | patch -p0 + cd kconfig-frontends-3.3.0-1 + ./configure --disable-gconf --disable-qconf + make + make install + +
\ No newline at end of file diff --git a/misc/tools/kconfig-frontends-3.3.0-1-libintl.patch b/misc/tools/kconfig-frontends-3.3.0-1-libintl.patch new file mode 100644 index 000000000..28b4b052a --- /dev/null +++ b/misc/tools/kconfig-frontends-3.3.0-1-libintl.patch @@ -0,0 +1,73 @@ +diff -ru kconfig-frontends-3.3.0-1.orig//frontends/nconf/nconf.c kconfig-frontends-3.3.0-1/frontends/nconf/nconf.c +--- kconfig-frontends-3.3.0-1.orig//frontends/nconf/nconf.c 2012-03-20 16:07:45.000000000 -0600 ++++ kconfig-frontends-3.3.0-1/frontends/nconf/nconf.c 2012-04-05 15:16:06.590563200 -0600 +@@ -1503,7 +1503,7 @@ + } + + notimeout(stdscr, FALSE); +- ESCDELAY = 1; ++ //ESCDELAY = 1; + + /* set btns menu */ + curses_menu = new_menu(curses_menu_items); +diff -ru kconfig-frontends-3.3.0-1.orig//frontends/nconf/nconf.h kconfig-frontends-3.3.0-1/frontends/nconf/nconf.h +--- kconfig-frontends-3.3.0-1.orig//frontends/nconf/nconf.h 2012-03-20 16:07:45.000000000 -0600 ++++ kconfig-frontends-3.3.0-1/frontends/nconf/nconf.h 2012-04-05 15:13:36.189960800 -0600 +@@ -15,7 +15,7 @@ + #include <string.h> + #include <unistd.h> + #include <locale.h> +-#include <curses.h> ++#include <ncurses/curses.h> + #include <menu.h> + #include <panel.h> + #include <form.h> +diff -ru kconfig-frontends-3.3.0-1.orig//libs/lxdialog/dialog.h kconfig-frontends-3.3.0-1/libs/lxdialog/dialog.h +--- kconfig-frontends-3.3.0-1.orig//libs/lxdialog/dialog.h 2012-03-20 16:07:45.000000000 -0600 ++++ kconfig-frontends-3.3.0-1/libs/lxdialog/dialog.h 2012-04-05 14:58:35.010416300 -0600 +@@ -26,11 +26,7 @@ + #include <string.h> + #include <stdbool.h> + +-#ifndef KBUILD_NO_NLS +-# include <libintl.h> +-#else + # define gettext(Msgid) ((const char *) (Msgid)) +-#endif + + #ifdef __sun__ + #define CURS_MACROS +diff -ru kconfig-frontends-3.3.0-1.orig//libs/parser/lkc.h kconfig-frontends-3.3.0-1/libs/parser/lkc.h +--- kconfig-frontends-3.3.0-1.orig//libs/parser/lkc.h 2012-03-20 16:07:45.000000000 -0600 ++++ kconfig-frontends-3.3.0-1/libs/parser/lkc.h 2012-04-05 14:59:02.969015400 -0600 +@@ -8,14 +8,10 @@ + + #include "expr.h" + +-#ifndef KBUILD_NO_NLS +-# include <libintl.h> +-#else + static inline const char *gettext(const char *txt) { return txt; } + static inline void textdomain(const char *domainname) {} + static inline void bindtextdomain(const char *name, const char *dir) {} + static inline char *bind_textdomain_codeset(const char *dn, char *c) { return c; } +-#endif + + #ifdef __cplusplus + extern "C" { +diff -ru kconfig-frontends-3.3.0-1.orig//libs/parser/yconf.c kconfig-frontends-3.3.0-1/libs/parser/yconf.c +--- kconfig-frontends-3.3.0-1.orig//libs/parser/yconf.c 2012-03-22 16:34:21.000000000 -0600 ++++ kconfig-frontends-3.3.0-1/libs/parser/yconf.c 2012-04-05 14:59:40.732175300 -0600 +@@ -285,12 +285,6 @@ + #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + + #ifndef YY_ +-# if YYENABLE_NLS +-# if ENABLE_NLS +-# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ +-# define YY_(msgid) dgettext ("bison-runtime", msgid) +-# endif +-# endif + # ifndef YY_ + # define YY_(msgid) msgid + # endif diff --git a/misc/tools/kconfig-frontends-3.3.0-1.tar.gz b/misc/tools/kconfig-frontends-3.3.0-1.tar.gz Binary files differnew file mode 100644 index 000000000..2f2f4eb9c --- /dev/null +++ b/misc/tools/kconfig-frontends-3.3.0-1.tar.gz diff --git a/misc/tools/kconfig-frontends-3.3.0-1.tar.xz b/misc/tools/kconfig-frontends-3.3.0-1.tar.xz Binary files differdeleted file mode 100755 index ffe30991e..000000000 --- a/misc/tools/kconfig-frontends-3.3.0-1.tar.xz +++ /dev/null diff --git a/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c b/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c index 227489bb5..3e7fcbd15 100755 --- a/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c +++ b/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c @@ -2515,39 +2515,80 @@ static int stm32_usbinterrupt(int irq, FAR void *context) static int stm32_epoutconfigure(FAR struct usbdev_ep_s *privep, uint8_t eptype, uint16_t maxpacket) { - FAR struct stm32_ep_s *privep = (FAR struct stm32_ep_s *)ep; + uint32_t daintmsk; + uint32_t mpsiz; + uint32_t regaddr; + uint32_t regval; usbtrace(TRACE_EPCONFIGURE, privep->epphy); - DEBUGASSERT(desc->addr == ep->eplog); - /* Setup Endpoint Control Register */ + /* For EP0, the packet size is encoded */ - /* Reset the data toggles */ -#warning "Missing logic" + if (privep->epphy == EP0) + { + DEBUGASSERT(eptype == USB_EP_ATTR_XFER_CONTROL); - /* Set the endpoint type */ + /* Map the size in bytes to the encoded value in the register */ + + switch (maxpacket) + { + case 8: + mpsiz = OTGFS_DOEPCTL0_MPSIZ_8; + break; - switch (eptype) + case 16: + mpsiz = OTGFS_DOEPCTL0_MPSIZ_16; + break; + + case 32: + mpsiz = OTGFS_DOEPCTL0_MPSIZ_32; + break; + + case 64: + mpsiz = OTGFS_DOEPCTL0_MPSIZ_64; + break; + + default: + udbg("Unsupported maxpacket: %d\n", maxpacket); + return -EINVAL; + } + } + + /* For other endpoints, the packet size is in bytes */ + + else { - case USB_EP_ATTR_XFER_CONTROL: - break; - case USB_EP_ATTR_XFER_ISOC: - break; - case USB_EP_ATTR_XFER_BULK: - break; - case USB_EP_ATTR_XFER_INT: - break; + mpsiz = (maxpacket << OTGFS_DOEPCTL_MPSIZ_SHIFT); } -#warning "Missing logic" + + /* If the endpoint is already active don't change the endpoint control + * register. + */ - /* Reset endpoint status */ + regaddr = STM32_OTGFS_DOEPCTL(privep->epphy); + regval = stm32_getreg(regaddr); + if (!depctl.b.usbactep) + { + regval &= ~(OTGFS_DOEPCTL_MPSIZ_MASK | OTGFS_DIEPCTL_EPTYP_MASK | OTGFS_DIEPCTL_TXFNUM_MASK); + regval |= mpsiz; + regval |= (eptype << OTGFS_DOEPCTL_EPTYP_SHIFT); + regval |= (eptype << OTGFS_DIEPCTL_TXFNUM_SHIFT); + regval |= (OTGFS_DOEPCTL_SD0PID | OTGFS_DOEPCTL_USBAEP); + stm32_putreg(regval, regaddr); - privep->stalled = false; + /* Save the endpoint configuration */ + + privep->ep.maxpacket = maxpacket; + privep->eptype = eptype; + privep->stalled = false; + } - /* Enable the endpoint */ + /* Enable the interrupt for this endpoint */ -#warning "Missing logic" - return OK; + regval = stm32_getreg(STM32_OTGFS_DAINTMSK); + regval |= OTGFS_DAINT_OEP(privep->epphy); + stm32_putreg(regval, STM32_OTGFS_DAINTMSK); + return OK; } /******************************************************************************* @@ -2568,40 +2609,82 @@ static int stm32_epoutconfigure(FAR struct usbdev_ep_s *privep, uint8_t eptype, static int stm32_epinconfigure(FAR struct usbdev_ep_s *privep, uint8_t eptype, uint16_t maxpacket) { - FAR struct stm32_ep_s *privep = (FAR struct stm32_ep_s *)ep; + uint32_t daintmsk; + uint32_t mpsiz; + uint32_t regaddr; + uint32_t regval; usbtrace(TRACE_EPCONFIGURE, privep->epphy); - DEBUGASSERT(desc->addr == ep->eplog); - /* Setup Endpoint Control Register */ + /* For EP0, the packet size is encoded */ - /* Reset the data toggles */ -#warning "Missing logic" + if (privep->epphy == EP0) + { + DEBUGASSERT(eptype == USB_EP_ATTR_XFER_CONTROL); - /* Set the endpoint type */ + /* Map the size in bytes to the encoded value in the register */ + + switch (maxpacket) + { + case 8: + mpsiz = OTGFS_DIEPCTL0_MPSIZ_8; + break; - switch (eptype) + case 16: + mpsiz = OTGFS_DIEPCTL0_MPSIZ_16; + break; + + case 32: + mpsiz = OTGFS_DIEPCTL0_MPSIZ_32; + break; + + case 64: + mpsiz = OTGFS_DIEPCTL0_MPSIZ_64; + break; + + default: + udbg("Unsupported maxpacket: %d\n", maxpacket); + return -EINVAL; + } + } + + /* For other endpoints, the packet size is in bytes */ + + else { - case USB_EP_ATTR_XFER_CONTROL: - break; - case USB_EP_ATTR_XFER_ISOC: - break; - case USB_EP_ATTR_XFER_BULK: - break; - case USB_EP_ATTR_XFER_INT: - break; + mpsiz = (maxpacket << OTGFS_DIEPCTL_MPSIZ_SHIFT); } -#warning "Missing logic" + - /* Reset endpoint status */ + /* If the endpoint is already active don't change the endpoint control + * register. + */ - privep->stalled = false; + regaddr = STM32_OTGFS_DIEPCTL(privep->epphy); + regval = stm32_getreg(regaddr); + if (!depctl.b.usbactep) + { + regval &= ~(OTGFS_DIEPCTL_MPSIZ_MASK | OTGFS_DIEPCTL_EPTYP_MASK | OTGFS_DIEPCTL_TXFNUM_MASK); + regval |= mpsiz; + regval |= (eptype << OTGFS_DIEPCTL_EPTYP_SHIFT); + regval |= (eptype << OTGFS_DIEPCTL_TXFNUM_SHIFT); + regval |= (OTGFS_DIEPCTL_SD0PID | OTGFS_DIEPCTL_USBAEP); + stm32_putreg(regval, regaddr); - /* Enable the endpoint */ + /* Save the endpoint configuration */ -#warning "Missing logic" - - return OK; + privep->ep.maxpacket = maxpacket; + privep->eptype = eptype; + privep->stalled = false; + } + + /* Enable the interrupt for this endpoint */ + + regval = stm32_getreg(STM32_OTGFS_DAINTMSK); + regval |= OTGFS_DAINT_IEP(privep->epphy); + stm32_putreg(regval, STM32_OTGFS_DAINTMSK); + + return OK; } /******************************************************************************* |