From 293e41705c9e3e076e386e8f5517c4c6cc185c15 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Fri, 8 Sep 2006 13:56:11 +0300 Subject: [PATCH] MUSB: Add more TUSB endpoints Add a new fifo configuration that makes better use of the memory available for use as TUSB fifos, and all the endpoint hardware. Now almost every endpoint is available, and that's the default setup. Signed-off-by: David Brownell --- drivers/usb/musb/plat_uds.c | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/drivers/usb/musb/plat_uds.c b/drivers/usb/musb/plat_uds.c index 2d684c0870c..2b081c3c4bc 100644 --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -767,7 +767,11 @@ static void musb_shutdown(struct platform_device *pdev) #define can_dynfifo() 0 #endif +#ifdef CONFIG_USB_TUSB6010 +static ushort __devinitdata fifo_mode = 4; +#else static ushort __devinitdata fifo_mode = 2; +#endif /* "modprobe ... fifo_mode=1" etc */ module_param(fifo_mode, ushort, 0); @@ -829,6 +833,38 @@ static const struct fifo_cfg __devinitdata mode_3_cfg[] = { { .hw_ep_num = 4, .style = FIFO_RXTX, .maxpacket = 256, }, }; +/* mode 4 - fits in 16KB */ +static const struct fifo_cfg __devinitdata mode_4_cfg[] = { +{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, +{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, +{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, +{ .hw_ep_num = 2, .style = FIFO_RX, .maxpacket = 512, }, +{ .hw_ep_num = 3, .style = FIFO_TX, .maxpacket = 512, }, +{ .hw_ep_num = 3, .style = FIFO_RX, .maxpacket = 512, }, +{ .hw_ep_num = 4, .style = FIFO_TX, .maxpacket = 512, }, +{ .hw_ep_num = 4, .style = FIFO_RX, .maxpacket = 512, }, +{ .hw_ep_num = 5, .style = FIFO_TX, .maxpacket = 512, }, +{ .hw_ep_num = 5, .style = FIFO_RX, .maxpacket = 512, }, +{ .hw_ep_num = 6, .style = FIFO_TX, .maxpacket = 512, }, +{ .hw_ep_num = 6, .style = FIFO_RX, .maxpacket = 512, }, +{ .hw_ep_num = 7, .style = FIFO_TX, .maxpacket = 512, }, +{ .hw_ep_num = 7, .style = FIFO_RX, .maxpacket = 512, }, +{ .hw_ep_num = 8, .style = FIFO_TX, .maxpacket = 512, }, +{ .hw_ep_num = 8, .style = FIFO_RX, .maxpacket = 512, }, +{ .hw_ep_num = 9, .style = FIFO_TX, .maxpacket = 512, }, +{ .hw_ep_num = 9, .style = FIFO_RX, .maxpacket = 512, }, +{ .hw_ep_num = 10, .style = FIFO_TX, .maxpacket = 512, }, +{ .hw_ep_num = 10, .style = FIFO_RX, .maxpacket = 512, }, +{ .hw_ep_num = 11, .style = FIFO_TX, .maxpacket = 512, }, +{ .hw_ep_num = 11, .style = FIFO_RX, .maxpacket = 512, }, +{ .hw_ep_num = 12, .style = FIFO_TX, .maxpacket = 512, }, +{ .hw_ep_num = 12, .style = FIFO_RX, .maxpacket = 512, }, +{ .hw_ep_num = 13, .style = FIFO_TX, .maxpacket = 512, }, +{ .hw_ep_num = 13, .style = FIFO_RX, .maxpacket = 512, }, +{ .hw_ep_num = 14, .style = FIFO_RXTX, .maxpacket = 1024, }, +{ .hw_ep_num = 15, .style = FIFO_RXTX, .maxpacket = 1024, }, +}; + /* * configure a fifo; for non-shared endpoints, this may be called @@ -939,6 +975,10 @@ static int __devinit ep_config_from_table(struct musb *musb) cfg = mode_3_cfg; n = ARRAY_SIZE(mode_3_cfg); break; + case 4: + cfg = mode_4_cfg; + n = ARRAY_SIZE(mode_4_cfg); + break; } printk(KERN_DEBUG "%s: setup fifo_mode %d\n", -- 2.41.1