summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorRob Herring <r.herring@freescale.com>2010-01-22 15:00:25 -0200
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2010-05-24 11:50:07 +0200
commit464b1e29cabf36a6f00909542bf3eb619e992b01 (patch)
tree25d325174d4326f531073eb2f511c9d060b9270d /drivers/usb/gadget
parentae4d4c8f9c8f8e9016eb0bce64667baaccde552e (diff)
ENGR00120393-4 arc usb: use iram allocator for iram work-around
Convert USB iram work-around to iram allocator functions. Signed-off-by: Rob Herring <r.herring@freescale.com> Signed-off-by: Alejandro Gonzalez <alex.gonzalez@digi.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/arcotg_udc.c9
-rw-r--r--drivers/usb/gadget/arcotg_udc.h6
2 files changed, 8 insertions, 7 deletions
diff --git a/drivers/usb/gadget/arcotg_udc.c b/drivers/usb/gadget/arcotg_udc.c
index 1532d6fc043f..363f5d1899b8 100644
--- a/drivers/usb/gadget/arcotg_udc.c
+++ b/drivers/usb/gadget/arcotg_udc.c
@@ -48,6 +48,7 @@
#include "arcotg_udc.h"
#include <mach/arc_otg.h>
+#include <linux/iram_alloc.h>
#define DRIVER_DESC "ARC USBOTG Device Controller driver"
#define DRIVER_AUTHOR "Freescale Semiconductor"
@@ -88,6 +89,8 @@ fsl_ep0_desc = {
.wMaxPacketSize = USB_MAX_CTRL_PAYLOAD,
};
static const size_t g_iram_size = IRAM_TD_PPH_SIZE;
+static unsigned long g_iram_base;
+static __iomem void *g_iram_addr;
typedef int (*dev_sus)(struct device *dev, pm_message_t state);
typedef int (*dev_res) (struct device *dev);
@@ -2847,9 +2850,9 @@ static int __init fsl_udc_probe(struct platform_device *pdev)
if (g_iram_size) {
for (i = 0; i < IRAM_PPH_NTD; i++) {
udc_controller->iram_buffer[i] =
- USB_IRAM_BASE_ADDR + i * g_iram_size;
+ g_iram_base + i * g_iram_size;
udc_controller->iram_buffer_v[i] =
- IO_ADDRESS(udc_controller->iram_buffer[i]);
+ g_iram_addr + i * g_iram_size;
}
}
#ifdef POSTPONE_FREE_LAST_DTD
@@ -2910,6 +2913,8 @@ static int __exit fsl_udc_remove(struct platform_device *pdev)
remove_proc_file();
/* Free allocated memory */
+ if (g_iram_size)
+ iram_free(g_iram_base, IRAM_PPH_NTD * g_iram_size);
kfree(udc_controller->status_req->req.buf);
kfree(udc_controller->status_req);
kfree(udc_controller->data_req->req.buf);
diff --git a/drivers/usb/gadget/arcotg_udc.h b/drivers/usb/gadget/arcotg_udc.h
index d8d33eb7156e..ef44caf21afa 100644
--- a/drivers/usb/gadget/arcotg_udc.h
+++ b/drivers/usb/gadget/arcotg_udc.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2009 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
@@ -43,10 +43,6 @@
#define IRAM_PPH_NTD 0
#endif
-#ifndef USB_IRAM_BASE_ADDR
-#define USB_IRAM_BASE_ADDR 0
-#endif
-
#define NEED_IRAM(ep) ((g_iram_size) && \
((ep)->desc->bmAttributes == USB_ENDPOINT_XFER_BULK))