|
@@ -173,8 +173,25 @@ enum musb_g_ep0_state {
|
|
|
|
|
|
/******************************** TYPES *************************************/
|
|
|
|
|
|
+struct musb_io;
|
|
|
+
|
|
|
/**
|
|
|
* struct musb_platform_ops - Operations passed to musb_core by HW glue layer
|
|
|
+ * @quirks: flags for platform specific quirks
|
|
|
+ * @enable: enable device
|
|
|
+ * @disable: disable device
|
|
|
+ * @ep_offset: returns the end point offset
|
|
|
+ * @ep_select: selects the specified end point
|
|
|
+ * @fifo_mode: sets the fifo mode
|
|
|
+ * @fifo_offset: returns the fifo offset
|
|
|
+ * @readb: read 8 bits
|
|
|
+ * @writeb: write 8 bits
|
|
|
+ * @readw: read 16 bits
|
|
|
+ * @writew: write 16 bits
|
|
|
+ * @readl: read 32 bits
|
|
|
+ * @writel: write 32 bits
|
|
|
+ * @read_fifo: reads the fifo
|
|
|
+ * @write_fifo: writes to fifo
|
|
|
* @init: turns on clocks, sets up platform-specific registers, etc
|
|
|
* @exit: undoes @init
|
|
|
* @set_mode: forcefully changes operating mode
|
|
@@ -184,12 +201,34 @@ enum musb_g_ep0_state {
|
|
|
* @adjust_channel_params: pre check for standard dma channel_program func
|
|
|
*/
|
|
|
struct musb_platform_ops {
|
|
|
+
|
|
|
+#define MUSB_DMA_UX500 BIT(6)
|
|
|
+#define MUSB_DMA_CPPI41 BIT(5)
|
|
|
+#define MUSB_DMA_CPPI BIT(4)
|
|
|
+#define MUSB_DMA_TUSB_OMAP BIT(3)
|
|
|
+#define MUSB_DMA_INVENTRA BIT(2)
|
|
|
+#define MUSB_IN_TUSB BIT(1)
|
|
|
+#define MUSB_INDEXED_EP BIT(0)
|
|
|
+ u32 quirks;
|
|
|
+
|
|
|
int (*init)(struct musb *musb);
|
|
|
int (*exit)(struct musb *musb);
|
|
|
|
|
|
void (*enable)(struct musb *musb);
|
|
|
void (*disable)(struct musb *musb);
|
|
|
|
|
|
+ u32 (*ep_offset)(u8 epnum, u16 offset);
|
|
|
+ void (*ep_select)(void __iomem *mbase, u8 epnum);
|
|
|
+ u16 fifo_mode;
|
|
|
+ u32 (*fifo_offset)(u8 epnum);
|
|
|
+ u8 (*readb)(const void __iomem *addr, unsigned offset);
|
|
|
+ void (*writeb)(void __iomem *addr, unsigned offset, u8 data);
|
|
|
+ u16 (*readw)(const void __iomem *addr, unsigned offset);
|
|
|
+ void (*writew)(void __iomem *addr, unsigned offset, u16 data);
|
|
|
+ u32 (*readl)(const void __iomem *addr, unsigned offset);
|
|
|
+ void (*writel)(void __iomem *addr, unsigned offset, u32 data);
|
|
|
+ void (*read_fifo)(struct musb_hw_ep *hw_ep, u16 len, u8 *buf);
|
|
|
+ void (*write_fifo)(struct musb_hw_ep *hw_ep, u16 len, const u8 *buf);
|
|
|
int (*set_mode)(struct musb *musb, u8 mode);
|
|
|
void (*try_idle)(struct musb *musb, unsigned long timeout);
|
|
|
int (*reset)(struct musb *musb);
|
|
@@ -292,6 +331,7 @@ struct musb {
|
|
|
/* device lock */
|
|
|
spinlock_t lock;
|
|
|
|
|
|
+ struct musb_io io;
|
|
|
const struct musb_platform_ops *ops;
|
|
|
struct musb_context_registers context;
|
|
|
|