s5pc110: disable support for end points >3 to reduce uboot image size
authorMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 22 Feb 2010 11:17:05 +0000 (12:17 +0100)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 22 Feb 2010 11:18:53 +0000 (12:18 +0100)
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
common/cmd_misc.c
drivers/usb/gadget/s3c_udc.h
drivers/usb/gadget/s3c_udc_otg.c
drivers/usb/gadget/s3c_udc_otg_xfer_dma.c

index d5b759d..b0ced2f 100644 (file)
@@ -27,7 +27,7 @@
 #include <common.h>
 #include <command.h>
 
-int do_sleep1 (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        ulong start = get_timer(0);
        ulong delay;
@@ -50,7 +50,7 @@ int do_sleep1 (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 }
 
 U_BOOT_CMD(
-       wait ,    2,    1,     do_sleep1,
+       sleep ,    2,    1,     do_sleep,
        "delay execution for some time",
        "N\n"
        "    - delay execution for N seconds (N is _decimal_ !!!)"
index b2ac008..69174a9 100644 (file)
@@ -46,7 +46,8 @@
 #define EP0_FIFO_SIZE          64
 #define EP_FIFO_SIZE           512
 #define EP_FIFO_SIZE2          1024
-#define S3C_MAX_ENDPOINTS      16
+#define S3C_MAX_ENDPOINTS      4 /* ep0-control, ep1in-bulk, ep2out-bulk, ep3in-int */
+#define S3C_MAX_HW_ENDPOINTS   16
 /*
 #else
 #define EP0_FIFO_SIZE          64
index fb0cf1e..34a8329 100644 (file)
@@ -65,6 +65,7 @@ typedef int   irqreturn_t;
 #define EXPORT_SYMBOL(x)
 
 #define dma_cache_maint(addr, size, mode) cache_flush()
+void cache_flush(void);
 
 #define kmalloc(size, type) malloc(size)
 #define kfree(addr) free(addr)
@@ -611,13 +612,13 @@ static void reconfig_usbd(void)
        writel((NPTX_FIFO_SIZE >> 2) << 16 | ((RX_FIFO_SIZE >> 2)) << 0,
                S3C_UDC_OTG_GNPTXFSIZ);
 
-       for (i = 1; i < S3C_MAX_ENDPOINTS; i++) 
+       for (i = 1; i < S3C_MAX_HW_ENDPOINTS; i++) 
                writel((PTX_FIFO_SIZE >> 2) << 16 |
                        ((RX_FIFO_SIZE + NPTX_FIFO_SIZE + PTX_FIFO_SIZE*(i-1)) >> 2) << 0,
                        S3C_UDC_OTG_DIEPTXF(i));
 
 /* check if defined tx fifo sizes fits in SPRAM (S5PC110 fifo has 7936 entries */
-#if (((RX_FIFO_SIZE + NPTX_FIFO_SIZE + PTX_FIFO_SIZE*(S3C_MAX_ENDPOINTS-1)) >> 2) >= 7936)
+#if (((RX_FIFO_SIZE + NPTX_FIFO_SIZE + PTX_FIFO_SIZE*(S3C_MAX_HW_ENDPOINTS-1)) >> 2) >= 7936)
 #error Too large tx fifo size defined!
 #endif
 
@@ -857,6 +858,7 @@ static void s3c_fifo_flush(struct usb_ep *_ep)
        DEBUG("%s: %d\n", __FUNCTION__, ep_index(ep));
 }
 
+#if 0
 /* ---------------------------------------------------------------------------
  *     device-scoped parts of the api to the usb controller hardware
  * ---------------------------------------------------------------------------
@@ -876,18 +878,12 @@ static int s3c_udc_wakeup(struct usb_gadget *_gadget)
        DEBUG("%s: %p\n", __FUNCTION__, _gadget);
        return -ENOTSUPP;
 }
+#endif
 
 static const struct usb_gadget_ops s3c_udc_ops = {
-       .get_frame = s3c_udc_get_frame,
-       .wakeup = s3c_udc_wakeup,
        /* current versions must always be self-powered */
 };
 
-static void nop_release(struct device *dev)
-{
-//     DEBUG("%s %s\n", __FUNCTION__, dev->bus_id);
-}
-
 static struct s3c_udc memory = {
        .usb_address = 0,
 
@@ -962,6 +958,7 @@ static struct s3c_udc memory = {
                  .ep_type = ep_interrupt,
                  .fifo_num = 3,
                  },
+#if 0
        .ep[4] = {
                  .ep = {
                         .name = "ep4out-bulk",
@@ -1130,6 +1127,7 @@ static struct s3c_udc memory = {
                  .ep_type = ep_interrupt,
                  .fifo_num = 15,
                  },
+#endif
 };
 
 /*
index 41efe5d..f463b32 100644 (file)
@@ -241,7 +241,7 @@ static void complete_tx(struct s3c_udc *dev, u8 ep_num)
 {
        struct s3c_ep *ep = &dev->ep[ep_num];
        struct s3c_request *req;
-       u32 ep_tsr = 0, xfer_size = 0, xfer_length, is_short = 0;
+       u32 ep_tsr = 0, xfer_size = 0, is_short = 0;
        u32 last;
 
        if (list_empty(&ep->queue)) {