1 /*****************************************************************************
2 ** FILE NAME : ifxusb_driver.c
3 ** PROJECT : IFX USB sub-system V3
4 ** MODULES : IFX USB sub-system Host and Device driver
7 ** AUTHOR : Chen, Howard
8 ** DESCRIPTION : The provides the initialization and cleanup entry
9 ** points for the IFX USB driver. This module can be
10 ** dynamically loaded with insmod command or built-in
11 ** with kernel. When loaded or executed the ifxusb_driver_init
12 ** function is called. When the module is removed (using rmmod),
13 ** the ifxusb_driver_cleanup function is called.
14 *****************************************************************************/
18 \brief This file contains the loading/unloading interface to the Linux driver.
21 #include <linux/version.h>
22 #include "ifxusb_version.h"
24 #include <linux/kernel.h>
25 #include <linux/module.h>
26 #include <linux/moduleparam.h>
27 #include <linux/init.h>
29 #include <linux/device.h>
30 #include <linux/platform_device.h>
32 #include <linux/errno.h>
33 #include <linux/types.h>
34 #include <linux/stat.h> /* permission constants */
35 #include <linux/gpio.h>
36 #include <lantiq_soc.h>
38 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
39 #include <linux/irq.h>
44 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
48 #include "ifxusb_plat.h"
50 #include "ifxusb_cif.h"
55 #define USB_DRIVER_DESC "IFX USB HCD driver"
56 const char ifxusb_driver_name
[] = "ifxusb_hcd";
59 ifxhcd_hcd_t ifxusb_hcd_1
;
60 ifxhcd_hcd_t ifxusb_hcd_2
;
61 const char ifxusb_hcd_name_1
[] = "ifxusb_hcd_1";
62 const char ifxusb_hcd_name_2
[] = "ifxusb_hcd_2";
64 ifxhcd_hcd_t ifxusb_hcd
;
65 const char ifxusb_hcd_name
[] = "ifxusb_hcd";
68 #if defined(__DO_OC_INT__)
69 static unsigned int oc_int_installed
=0;
70 static ifxhcd_hcd_t
*oc_int_id
=NULL
;
77 #define USB_DRIVER_DESC "IFX USB PCD driver"
78 const char ifxusb_driver_name
[] = "ifxusb_pcd";
80 ifxpcd_pcd_t ifxusb_pcd
;
81 const char ifxusb_pcd_name
[] = "ifxusb_pcd";
84 /* Global Debug Level Mask. */
86 uint32_t h_dbg_lvl
= 0x00;
90 uint32_t d_dbg_lvl
= 0x00;
93 ifxusb_params_t ifxusb_module_params
;
95 static void parse_parms(void);
98 #include <lantiq_irq.h>
99 #define IFX_USB0_IR (INT_NUM_IM1_IRL0 + 22)
100 #define IFX_USB1_IR (INT_NUM_IM2_IRL0 + 19)
103 \brief This function is called when a driver is unregistered. This happens when
104 the rmmod command is executed. The device may or may not be electrically
105 present. If it is present, the driver stops device processing. Any resources
106 used on behalf of this device are freed.
108 static int ifxusb_driver_remove(struct platform_device
*_dev
)
110 IFX_DEBUGPL(DBG_ENTRY
, "%s() %d\n", __func__
, __LINE__
);
112 #if defined(__DO_OC_INT__)
113 #if defined(__DO_OC_INT_ENABLE__)
117 if(oc_int_installed
&& oc_int_id
)
118 free_irq((unsigned int)IFXUSB_OC_IRQ
, oc_int_id
);
123 #if defined(__IS_DUAL__)
124 ifxhcd_remove(&ifxusb_hcd_1
);
125 ifxusb_core_if_remove(&ifxusb_hcd_1
.core_if
);
126 ifxhcd_remove(&ifxusb_hcd_2
);
127 ifxusb_core_if_remove(&ifxusb_hcd_2
.core_if
);
129 ifxhcd_remove(&ifxusb_hcd
);
130 ifxusb_core_if_remove(&ifxusb_hcd
.core_if
);
136 ifxusb_core_if_remove(&ifxusb_pcd
.core_if
);
139 /* Remove the device attributes */
141 ifxusb_attr_remove(&_dev
->dev
);
147 /* Function to setup the structures to control one usb core running as host*/
150 \brief inlined by ifxusb_driver_probe(), handling host mode probing. Run at each host core.
152 static inline int ifxusb_driver_probe_h(ifxhcd_hcd_t
*_hcd
,
161 IFX_DEBUGPL(DBG_ENTRY
, "%s() %d\n", __func__
, __LINE__
);
164 ifxusb_power_off (&_hcd
->core_if
);
165 ifxusb_phy_power_off (&_hcd
->core_if
); // Test
168 ifxusb_power_on (&_hcd
->core_if
);
170 ifxusb_phy_power_on (&_hcd
->core_if
); // Test
172 ifxusb_hard_reset(&_hcd
->core_if
);
173 retval
=ifxusb_core_if_init(&_hcd
->core_if
,
181 ifxusb_host_core_init(&_hcd
->core_if
,&ifxusb_module_params
);
183 ifxusb_disable_global_interrupts( &_hcd
->core_if
);
185 /* The driver is now initialized and need to be registered into Linux USB sub-system */
187 retval
= ifxhcd_init(_hcd
); // hook the hcd into usb ss
191 IFX_ERROR("_hcd_init failed\n");
195 //ifxusb_enable_global_interrupts( _hcd->core_if ); // this should be done at hcd_start , including hcd_interrupt
202 \brief inlined by ifxusb_driver_probe(), handling device mode probing.
204 static inline int ifxusb_driver_probe_d(ifxpcd_pcd_t
*_pcd
,
213 IFX_DEBUGPL(DBG_ENTRY
, "%s() %d\n", __func__
, __LINE__
);
215 ifxusb_power_off (&_pcd
->core_if
);
216 ifxusb_phy_power_off (&_pcd
->core_if
); // Test
218 #endif // __DEV_NEW__
219 ifxusb_power_on (&_pcd
->core_if
);
221 ifxusb_phy_power_on (&_pcd
->core_if
); // Test
223 ifxusb_hard_reset(&_pcd
->core_if
);
224 retval
=ifxusb_core_if_init(&_pcd
->core_if
,
232 IFX_DEBUGPL(DBG_ENTRY
, "%s() %d\n", __func__
, __LINE__
);
233 ifxusb_dev_core_init(&_pcd
->core_if
,&ifxusb_module_params
);
235 IFX_DEBUGPL(DBG_ENTRY
, "%s() %d\n", __func__
, __LINE__
);
236 ifxusb_disable_global_interrupts( &_pcd
->core_if
);
238 /* The driver is now initialized and need to be registered into
239 Linux USB Gadget sub-system
241 retval
= ifxpcd_init();
242 IFX_DEBUGPL(DBG_ENTRY
, "%s() %d\n", __func__
, __LINE__
);
246 IFX_ERROR("_pcd_init failed\n");
249 //ifxusb_enable_global_interrupts( _pcd->core_if ); // this should be done at gadget bind or start
252 #endif //__IS_DEVICE__
257 \brief This function is called by module management in 2.6 kernel or by ifxusb_driver_init with 2.4 kernel
258 It is to probe and setup IFXUSB core(s).
260 static int ifxusb_driver_probe(struct platform_device
*_dev
)
263 int *pins
= _dev
->dev
.platform_data
;
265 gpio_request(6, "id1");
266 gpio_request(9, "id2");
267 gpio_direction_input(6);
268 gpio_direction_input(9);
272 gpio_request(pins
[0], "vbus1");
273 gpio_direction_output(pins
[0], 1);
275 if (pins
[1] && ltq_is_vr9()) {
276 gpio_request(pins
[1], "vbus2");
277 gpio_direction_output(pins
[1], 1);
280 // Parsing and store the parameters
281 IFX_DEBUGPL(DBG_ENTRY
, "%s() %d\n", __func__
, __LINE__
);
285 #if defined(__IS_DUAL__)
286 memset(&ifxusb_hcd_1
, 0, sizeof(ifxhcd_hcd_t
));
287 memset(&ifxusb_hcd_2
, 0, sizeof(ifxhcd_hcd_t
));
289 ifxusb_hcd_1
.core_if
.core_no
=0;
290 ifxusb_hcd_2
.core_if
.core_no
=1;
291 ifxusb_hcd_1
.core_if
.core_name
=(char *)ifxusb_hcd_name_1
;
292 ifxusb_hcd_2
.core_if
.core_name
=(char *)ifxusb_hcd_name_2
;
294 ifxusb_hcd_1
.dev
=&_dev
->dev
;
295 ifxusb_hcd_2
.dev
=&_dev
->dev
;
297 retval
= ifxusb_driver_probe_h(&ifxusb_hcd_1
,
300 IFXUSB1_FIFOMEM_BASE
,
304 goto ifxusb_driver_probe_fail
;
306 retval
= ifxusb_driver_probe_h(&ifxusb_hcd_2
,
309 IFXUSB2_FIFOMEM_BASE
,
313 goto ifxusb_driver_probe_fail
;
315 #elif defined(__IS_FIRST__)
316 memset(&ifxusb_hcd
, 0, sizeof(ifxhcd_hcd_t
));
318 ifxusb_hcd
.core_if
.core_no
=0;
319 ifxusb_hcd
.core_if
.core_name
=(char *)ifxusb_hcd_name
;
321 ifxusb_hcd
.dev
=&_dev
->dev
;
323 retval
= ifxusb_driver_probe_h(&ifxusb_hcd
,
326 IFXUSB1_FIFOMEM_BASE
,
330 goto ifxusb_driver_probe_fail
;
332 #elif defined(__IS_SECOND__)
333 memset(&ifxusb_hcd
, 0, sizeof(ifxhcd_hcd_t
));
335 ifxusb_hcd
.core_if
.core_no
=1;
336 ifxusb_hcd
.core_if
.core_name
=(char *)ifxusb_hcd_name
;
338 ifxusb_hcd
.dev
=&_dev
->dev
;
340 retval
= ifxusb_driver_probe_h(&ifxusb_hcd
,
343 IFXUSB2_FIFOMEM_BASE
,
347 goto ifxusb_driver_probe_fail
;
350 memset(&ifxusb_hcd
, 0, sizeof(ifxhcd_hcd_t
));
352 ifxusb_hcd
.core_if
.core_no
=0;
353 ifxusb_hcd
.core_if
.core_name
=(char *)ifxusb_hcd_name
;
355 ifxusb_hcd
.dev
=&_dev
->dev
;
357 retval
= ifxusb_driver_probe_h(&ifxusb_hcd
,
364 goto ifxusb_driver_probe_fail
;
367 #if defined(__DO_OC_INT__)
368 IFXUSB_DEBUGPL( DBG_CIL
, "registering (overcurrent) handler for irq%d\n", IFXUSB_OC_IRQ
);
369 #if defined(__IS_DUAL__)
370 request_irq((unsigned int)IFXUSB_OC_IRQ
, &ifx_hcd_oc_irq
,
371 // SA_INTERRUPT|SA_SHIRQ, "ifxusb_oc", (void *)&ifxusb_hcd_1);
372 IRQF_DISABLED
| IRQF_SHARED
, "ifxusb_oc", (void *)&ifxusb_hcd_1
);
373 oc_int_id
=&ifxusb_hcd_1
;
375 request_irq((unsigned int)IFXUSB_OC_IRQ
, &ifx_hcd_oc_irq
,
376 // SA_INTERRUPT|SA_SHIRQ, "ifxusb_oc", (void *)&ifxusb_hcd);
377 IRQF_DISABLED
| IRQF_SHARED
, "ifxusb_oc", (void *)&ifxusb_hcd
);
378 oc_int_id
=&ifxusb_hcd
;
382 #if defined(__DO_OC_INT_ENABLE__)
390 memset(&ifxusb_pcd
, 0, sizeof(ifxpcd_pcd_t
));
391 ifxusb_pcd
.core_if
.core_name
=(char *)&ifxusb_pcd_name
[0];
393 ifxusb_pcd
.dev
=&_dev
->dev
;
395 #if defined(__IS_FIRST__)
396 ifxusb_pcd
.core_if
.core_no
=0;
397 retval
= ifxusb_driver_probe_d(&ifxusb_pcd
,
400 IFXUSB1_FIFOMEM_BASE
,
403 #elif defined(__IS_SECOND__)
404 ifxusb_pcd
.core_if
.core_no
=1;
405 retval
= ifxusb_driver_probe_d(&ifxusb_pcd
,
408 IFXUSB2_FIFOMEM_BASE
,
412 ifxusb_pcd
.core_if
.core_no
=0;
413 retval
= ifxusb_driver_probe_d(&ifxusb_pcd
,
421 goto ifxusb_driver_probe_fail
;
424 ifxusb_attr_create(&_dev
->dev
);
428 ifxusb_driver_probe_fail
:
429 ifxusb_driver_remove(_dev
);
436 \brief This function is called when the ifxusb_driver is installed with the insmod command.
440 static struct platform_driver ifxusb_driver
= {
442 .name
= ifxusb_driver_name
,
443 .owner
= THIS_MODULE
,
445 .probe
= ifxusb_driver_probe
,
446 .remove
= ifxusb_driver_remove
,
449 int __init
ifxusb_driver_init(void)
453 IFX_DEBUGPL(DBG_ENTRY
, "%s() %d\n", __func__
, __LINE__
);
454 IFX_PRINT("%s: version %s\n", ifxusb_driver_name
, IFXUSB_VERSION
);
456 retval
= platform_driver_register(&ifxusb_driver
);
459 IFX_ERROR("%s retval=%d\n", __func__
, retval
);
466 int __init
ifxusb_driver_init(void)
469 IFX_DEBUGPL(DBG_ENTRY
, "%s() %d\n", __func__
, __LINE__
);
470 IFX_PRINT("%s: version %s\n", ifxusb_driver_name
, IFXUSB_VERSION
);
471 retval
= ifxusb_driver_probe();
474 IFX_ERROR("%s retval=%d\n", __func__
, retval
);
482 module_init(ifxusb_driver_init
);
486 \brief This function is called when the driver is removed from the kernel
487 with the rmmod command. The driver unregisters itself with its bus
491 void __exit
ifxusb_driver_cleanup(void)
493 IFX_DEBUGPL(DBG_ENTRY
, "%s() %d\n", __func__
, __LINE__
);
495 platform_driver_unregister(&ifxusb_driver
);
497 IFX_PRINT("%s module removed\n", ifxusb_driver_name
);
500 void __exit
ifxusb_driver_cleanup(void)
502 IFX_DEBUGPL(DBG_ENTRY
, "%s() %d\n", __func__
, __LINE__
);
503 ifxusb_driver_remove();
504 IFX_PRINT("%s module removed\n", ifxusb_driver_name
);
507 module_exit(ifxusb_driver_cleanup
);
511 MODULE_DESCRIPTION(USB_DRIVER_DESC
);
512 MODULE_AUTHOR("Infineon");
513 MODULE_LICENSE("GPL");
517 // Parameters set when loaded
518 //static long dbg_lvl =0xFFFFFFFF;
519 static long dbg_lvl
=0;
520 static short dma_burst_size
=-1;
521 static short speed
=-1;
522 static long data_fifo_size
=-1;
524 static long rx_fifo_size
=-1;
526 static long tx_fifo_size_00
=-1;
527 static long tx_fifo_size_01
=-1;
528 static long tx_fifo_size_02
=-1;
529 static long tx_fifo_size_03
=-1;
530 static long tx_fifo_size_04
=-1;
531 static long tx_fifo_size_05
=-1;
532 static long tx_fifo_size_06
=-1;
533 static long tx_fifo_size_07
=-1;
534 static long tx_fifo_size_08
=-1;
535 static long tx_fifo_size_09
=-1;
536 static long tx_fifo_size_10
=-1;
537 static long tx_fifo_size_11
=-1;
538 static long tx_fifo_size_12
=-1;
539 static long tx_fifo_size_13
=-1;
540 static long tx_fifo_size_14
=-1;
541 static long tx_fifo_size_15
=-1;
542 static short thr_ctl
=-1;
543 static long tx_thr_length
=-1;
544 static long rx_thr_length
=-1;
546 static long nperio_tx_fifo_size
=-1;
547 static long perio_tx_fifo_size_01
=-1;
548 static long perio_tx_fifo_size_02
=-1;
549 static long perio_tx_fifo_size_03
=-1;
550 static long perio_tx_fifo_size_04
=-1;
551 static long perio_tx_fifo_size_05
=-1;
552 static long perio_tx_fifo_size_06
=-1;
553 static long perio_tx_fifo_size_07
=-1;
554 static long perio_tx_fifo_size_08
=-1;
555 static long perio_tx_fifo_size_09
=-1;
556 static long perio_tx_fifo_size_10
=-1;
557 static long perio_tx_fifo_size_11
=-1;
558 static long perio_tx_fifo_size_12
=-1;
559 static long perio_tx_fifo_size_13
=-1;
560 static long perio_tx_fifo_size_14
=-1;
561 static long perio_tx_fifo_size_15
=-1;
563 static short dev_endpoints
=-1;
567 static long rx_fifo_size
=-1;
568 static long nperio_tx_fifo_size
=-1;
569 static long perio_tx_fifo_size
=-1;
570 static short host_channels
=-1;
573 static long max_transfer_size
=-1;
574 static long max_packet_count
=-1;
575 static long phy_utmi_width
=-1;
576 static long turn_around_time_hs
=-1;
577 static long turn_around_time_fs
=-1;
578 static long timeout_cal_hs
=-1;
579 static long timeout_cal_fs
=-1;
582 \brief Parsing the parameters taken when module load
584 static void parse_parms(void)
587 IFX_DEBUGPL(DBG_ENTRY
, "%s() %d\n", __func__
, __LINE__
);
595 switch(dma_burst_size
)
602 ifxusb_module_params
.dma_burst_size
=dma_burst_size
;
605 ifxusb_module_params
.dma_burst_size
=default_param_dma_burst_size
;
608 if(speed
==0 || speed
==1)
609 ifxusb_module_params
.speed
=speed
;
611 ifxusb_module_params
.speed
=default_param_speed
;
613 if(max_transfer_size
>=2048 && max_transfer_size
<=65535)
614 ifxusb_module_params
.max_transfer_size
=max_transfer_size
;
616 ifxusb_module_params
.max_transfer_size
=default_param_max_transfer_size
;
618 if(max_packet_count
>=15 && max_packet_count
<=511)
619 ifxusb_module_params
.max_packet_count
=max_packet_count
;
621 ifxusb_module_params
.max_packet_count
=default_param_max_packet_count
;
623 switch(phy_utmi_width
)
627 ifxusb_module_params
.phy_utmi_width
=phy_utmi_width
;
630 ifxusb_module_params
.phy_utmi_width
=default_param_phy_utmi_width
;
633 if(turn_around_time_hs
>=0 && turn_around_time_hs
<=7)
634 ifxusb_module_params
.turn_around_time_hs
=turn_around_time_hs
;
636 ifxusb_module_params
.turn_around_time_hs
=default_param_turn_around_time_hs
;
638 if(turn_around_time_fs
>=0 && turn_around_time_fs
<=7)
639 ifxusb_module_params
.turn_around_time_fs
=turn_around_time_fs
;
641 ifxusb_module_params
.turn_around_time_fs
=default_param_turn_around_time_fs
;
643 if(timeout_cal_hs
>=0 && timeout_cal_hs
<=7)
644 ifxusb_module_params
.timeout_cal_hs
=timeout_cal_hs
;
646 ifxusb_module_params
.timeout_cal_hs
=default_param_timeout_cal_hs
;
648 if(timeout_cal_fs
>=0 && timeout_cal_fs
<=7)
649 ifxusb_module_params
.timeout_cal_fs
=timeout_cal_fs
;
651 ifxusb_module_params
.timeout_cal_fs
=default_param_timeout_cal_fs
;
653 if(data_fifo_size
>=32 && data_fifo_size
<=32768)
654 ifxusb_module_params
.data_fifo_size
=data_fifo_size
;
656 ifxusb_module_params
.data_fifo_size
=default_param_data_fifo_size
;
659 if(host_channels
>=1 && host_channels
<=16)
660 ifxusb_module_params
.host_channels
=host_channels
;
662 ifxusb_module_params
.host_channels
=default_param_host_channels
;
664 if(rx_fifo_size
>=16 && rx_fifo_size
<=32768)
665 ifxusb_module_params
.rx_fifo_size
=rx_fifo_size
;
667 ifxusb_module_params
.rx_fifo_size
=default_param_rx_fifo_size
;
669 if(nperio_tx_fifo_size
>=16 && nperio_tx_fifo_size
<=32768)
670 ifxusb_module_params
.nperio_tx_fifo_size
=nperio_tx_fifo_size
;
672 ifxusb_module_params
.nperio_tx_fifo_size
=default_param_nperio_tx_fifo_size
;
674 if(perio_tx_fifo_size
>=16 && perio_tx_fifo_size
<=32768)
675 ifxusb_module_params
.perio_tx_fifo_size
=perio_tx_fifo_size
;
677 ifxusb_module_params
.perio_tx_fifo_size
=default_param_perio_tx_fifo_size
;
681 if(rx_fifo_size
>=16 && rx_fifo_size
<=32768)
682 ifxusb_module_params
.rx_fifo_size
=rx_fifo_size
;
684 ifxusb_module_params
.rx_fifo_size
=default_param_rx_fifo_size
;
686 if(tx_fifo_size_00
>=16 && tx_fifo_size_00
<=32768)
687 ifxusb_module_params
.tx_fifo_size
[ 0]=tx_fifo_size_00
;
689 ifxusb_module_params
.tx_fifo_size
[ 0]=default_param_tx_fifo_size_00
;
690 if(tx_fifo_size_01
>=0 && tx_fifo_size_01
<=32768)
691 ifxusb_module_params
.tx_fifo_size
[ 1]=tx_fifo_size_01
;
693 ifxusb_module_params
.tx_fifo_size
[ 1]=default_param_tx_fifo_size_01
;
694 if(tx_fifo_size_02
>=0 && tx_fifo_size_02
<=32768)
695 ifxusb_module_params
.tx_fifo_size
[ 2]=tx_fifo_size_02
;
697 ifxusb_module_params
.tx_fifo_size
[ 2]=default_param_tx_fifo_size_02
;
698 if(tx_fifo_size_03
>=0 && tx_fifo_size_03
<=32768)
699 ifxusb_module_params
.tx_fifo_size
[ 3]=tx_fifo_size_03
;
701 ifxusb_module_params
.tx_fifo_size
[ 3]=default_param_tx_fifo_size_03
;
702 if(tx_fifo_size_04
>=0 && tx_fifo_size_04
<=32768)
703 ifxusb_module_params
.tx_fifo_size
[ 4]=tx_fifo_size_04
;
705 ifxusb_module_params
.tx_fifo_size
[ 4]=default_param_tx_fifo_size_04
;
706 if(tx_fifo_size_05
>=0 && tx_fifo_size_05
<=32768)
707 ifxusb_module_params
.tx_fifo_size
[ 5]=tx_fifo_size_05
;
709 ifxusb_module_params
.tx_fifo_size
[ 5]=default_param_tx_fifo_size_05
;
710 if(tx_fifo_size_06
>=0 && tx_fifo_size_06
<=32768)
711 ifxusb_module_params
.tx_fifo_size
[ 6]=tx_fifo_size_06
;
713 ifxusb_module_params
.tx_fifo_size
[ 6]=default_param_tx_fifo_size_06
;
714 if(tx_fifo_size_07
>=0 && tx_fifo_size_07
<=32768)
715 ifxusb_module_params
.tx_fifo_size
[ 7]=tx_fifo_size_07
;
717 ifxusb_module_params
.tx_fifo_size
[ 7]=default_param_tx_fifo_size_07
;
718 if(tx_fifo_size_08
>=0 && tx_fifo_size_08
<=32768)
719 ifxusb_module_params
.tx_fifo_size
[ 8]=tx_fifo_size_08
;
721 ifxusb_module_params
.tx_fifo_size
[ 8]=default_param_tx_fifo_size_08
;
722 if(tx_fifo_size_09
>=0 && tx_fifo_size_09
<=32768)
723 ifxusb_module_params
.tx_fifo_size
[ 9]=tx_fifo_size_09
;
725 ifxusb_module_params
.tx_fifo_size
[ 9]=default_param_tx_fifo_size_09
;
726 if(tx_fifo_size_10
>=0 && tx_fifo_size_10
<=32768)
727 ifxusb_module_params
.tx_fifo_size
[10]=tx_fifo_size_10
;
729 ifxusb_module_params
.tx_fifo_size
[10]=default_param_tx_fifo_size_10
;
730 if(tx_fifo_size_11
>=0 && tx_fifo_size_11
<=32768)
731 ifxusb_module_params
.tx_fifo_size
[11]=tx_fifo_size_11
;
733 ifxusb_module_params
.tx_fifo_size
[11]=default_param_tx_fifo_size_11
;
734 if(tx_fifo_size_12
>=0 && tx_fifo_size_12
<=32768)
735 ifxusb_module_params
.tx_fifo_size
[12]=tx_fifo_size_12
;
737 ifxusb_module_params
.tx_fifo_size
[12]=default_param_tx_fifo_size_12
;
738 if(tx_fifo_size_13
>=0 && tx_fifo_size_13
<=32768)
739 ifxusb_module_params
.tx_fifo_size
[13]=tx_fifo_size_13
;
741 ifxusb_module_params
.tx_fifo_size
[13]=default_param_tx_fifo_size_13
;
742 if(tx_fifo_size_14
>=0 && tx_fifo_size_14
<=32768)
743 ifxusb_module_params
.tx_fifo_size
[14]=tx_fifo_size_14
;
745 ifxusb_module_params
.tx_fifo_size
[14]=default_param_tx_fifo_size_14
;
746 if(tx_fifo_size_15
>=0 && tx_fifo_size_15
<=32768)
747 ifxusb_module_params
.tx_fifo_size
[15]=tx_fifo_size_15
;
749 ifxusb_module_params
.tx_fifo_size
[15]=default_param_tx_fifo_size_15
;
750 if(thr_ctl
==0 || thr_ctl
==1)
751 ifxusb_module_params
.thr_ctl
=thr_ctl
;
753 ifxusb_module_params
.thr_ctl
=default_param_thr_ctl
;
754 if(tx_thr_length
>=16 && tx_thr_length
<=511)
755 ifxusb_module_params
.tx_thr_length
=tx_thr_length
;
757 ifxusb_module_params
.tx_thr_length
=default_param_tx_thr_length
;
758 if(rx_thr_length
>=16 && rx_thr_length
<=511)
759 ifxusb_module_params
.rx_thr_length
=rx_thr_length
;
761 ifxusb_module_params
.rx_thr_length
=default_param_rx_thr_length
;
763 if(nperio_tx_fifo_size
>=16 && nperio_tx_fifo_size
<=32768)
764 ifxusb_module_params
.tx_fifo_size
[ 0]=nperio_tx_fifo_size
;
766 ifxusb_module_params
.tx_fifo_size
[ 0]=default_param_nperio_tx_fifo_size
;
767 if(perio_tx_fifo_size_01
>=0 && perio_tx_fifo_size_01
<=32768)
768 ifxusb_module_params
.tx_fifo_size
[ 1]=perio_tx_fifo_size_01
;
770 ifxusb_module_params
.tx_fifo_size
[ 1]=default_param_perio_tx_fifo_size_01
;
771 if(perio_tx_fifo_size_02
>=0 && perio_tx_fifo_size_02
<=32768)
772 ifxusb_module_params
.tx_fifo_size
[ 2]=perio_tx_fifo_size_02
;
774 ifxusb_module_params
.tx_fifo_size
[ 2]=default_param_perio_tx_fifo_size_02
;
775 if(perio_tx_fifo_size_03
>=0 && perio_tx_fifo_size_03
<=32768)
776 ifxusb_module_params
.tx_fifo_size
[ 3]=perio_tx_fifo_size_03
;
778 ifxusb_module_params
.tx_fifo_size
[ 3]=default_param_perio_tx_fifo_size_03
;
779 if(perio_tx_fifo_size_04
>=0 && perio_tx_fifo_size_04
<=32768)
780 ifxusb_module_params
.tx_fifo_size
[ 4]=perio_tx_fifo_size_04
;
782 ifxusb_module_params
.tx_fifo_size
[ 4]=default_param_perio_tx_fifo_size_04
;
783 if(perio_tx_fifo_size_05
>=0 && perio_tx_fifo_size_05
<=32768)
784 ifxusb_module_params
.tx_fifo_size
[ 5]=perio_tx_fifo_size_05
;
786 ifxusb_module_params
.tx_fifo_size
[ 5]=default_param_perio_tx_fifo_size_05
;
787 if(perio_tx_fifo_size_06
>=0 && perio_tx_fifo_size_06
<=32768)
788 ifxusb_module_params
.tx_fifo_size
[ 6]=perio_tx_fifo_size_06
;
790 ifxusb_module_params
.tx_fifo_size
[ 6]=default_param_perio_tx_fifo_size_06
;
791 if(perio_tx_fifo_size_07
>=0 && perio_tx_fifo_size_07
<=32768)
792 ifxusb_module_params
.tx_fifo_size
[ 7]=perio_tx_fifo_size_07
;
794 ifxusb_module_params
.tx_fifo_size
[ 7]=default_param_perio_tx_fifo_size_07
;
795 if(perio_tx_fifo_size_08
>=0 && perio_tx_fifo_size_08
<=32768)
796 ifxusb_module_params
.tx_fifo_size
[ 8]=perio_tx_fifo_size_08
;
798 ifxusb_module_params
.tx_fifo_size
[ 8]=default_param_perio_tx_fifo_size_08
;
799 if(perio_tx_fifo_size_09
>=0 && perio_tx_fifo_size_09
<=32768)
800 ifxusb_module_params
.tx_fifo_size
[ 9]=perio_tx_fifo_size_09
;
802 ifxusb_module_params
.tx_fifo_size
[ 9]=default_param_perio_tx_fifo_size_09
;
803 if(perio_tx_fifo_size_10
>=0 && perio_tx_fifo_size_10
<=32768)
804 ifxusb_module_params
.tx_fifo_size
[10]=perio_tx_fifo_size_10
;
806 ifxusb_module_params
.tx_fifo_size
[10]=default_param_perio_tx_fifo_size_10
;
807 if(perio_tx_fifo_size_11
>=0 && perio_tx_fifo_size_11
<=32768)
808 ifxusb_module_params
.tx_fifo_size
[11]=perio_tx_fifo_size_11
;
810 ifxusb_module_params
.tx_fifo_size
[11]=default_param_perio_tx_fifo_size_11
;
811 if(perio_tx_fifo_size_12
>=0 && perio_tx_fifo_size_12
<=32768)
812 ifxusb_module_params
.tx_fifo_size
[12]=perio_tx_fifo_size_12
;
814 ifxusb_module_params
.tx_fifo_size
[12]=default_param_perio_tx_fifo_size_12
;
815 if(perio_tx_fifo_size_13
>=0 && perio_tx_fifo_size_13
<=32768)
816 ifxusb_module_params
.tx_fifo_size
[13]=perio_tx_fifo_size_13
;
818 ifxusb_module_params
.tx_fifo_size
[13]=default_param_perio_tx_fifo_size_13
;
819 if(perio_tx_fifo_size_14
>=0 && perio_tx_fifo_size_14
<=32768)
820 ifxusb_module_params
.tx_fifo_size
[14]=perio_tx_fifo_size_14
;
822 ifxusb_module_params
.tx_fifo_size
[14]=default_param_perio_tx_fifo_size_14
;
823 if(perio_tx_fifo_size_15
>=0 && perio_tx_fifo_size_15
<=32768)
824 ifxusb_module_params
.tx_fifo_size
[15]=perio_tx_fifo_size_15
;
826 ifxusb_module_params
.tx_fifo_size
[15]=default_param_perio_tx_fifo_size_15
;
827 #endif //__DED_FIFO__
828 #endif //__IS_DEVICE__
837 module_param(dbg_lvl
, long, 0444);
838 MODULE_PARM_DESC(dbg_lvl
, "Debug level.");
840 module_param(dma_burst_size
, short, 0444);
841 MODULE_PARM_DESC(dma_burst_size
, "DMA Burst Size 0, 1, 4, 8, 16");
843 module_param(speed
, short, 0444);
844 MODULE_PARM_DESC(speed
, "Speed 0=High Speed 1=Full Speed");
846 module_param(data_fifo_size
, long, 0444);
847 MODULE_PARM_DESC(data_fifo_size
, "Total number of words in the data FIFO memory 32-32768");
850 module_param(rx_fifo_size
, long, 0444);
851 MODULE_PARM_DESC(rx_fifo_size
, "Number of words in the Rx FIFO 16-32768");
854 module_param(tx_fifo_size_00
, long, 0444);
855 MODULE_PARM_DESC(tx_fifo_size_00
, "Number of words in the Tx FIFO #00 16-32768");
856 module_param(tx_fifo_size_01
, long, 0444);
857 MODULE_PARM_DESC(tx_fifo_size_01
, "Number of words in the Tx FIFO #01 0-32768");
858 module_param(tx_fifo_size_02
, long, 0444);
859 MODULE_PARM_DESC(tx_fifo_size_02
, "Number of words in the Tx FIFO #02 0-32768");
860 module_param(tx_fifo_size_03
, long, 0444);
861 MODULE_PARM_DESC(tx_fifo_size_03
, "Number of words in the Tx FIFO #03 0-32768");
862 module_param(tx_fifo_size_04
, long, 0444);
863 MODULE_PARM_DESC(tx_fifo_size_04
, "Number of words in the Tx FIFO #04 0-32768");
864 module_param(tx_fifo_size_05
, long, 0444);
865 MODULE_PARM_DESC(tx_fifo_size_05
, "Number of words in the Tx FIFO #05 0-32768");
866 module_param(tx_fifo_size_06
, long, 0444);
867 MODULE_PARM_DESC(tx_fifo_size_06
, "Number of words in the Tx FIFO #06 0-32768");
868 module_param(tx_fifo_size_07
, long, 0444);
869 MODULE_PARM_DESC(tx_fifo_size_07
, "Number of words in the Tx FIFO #07 0-32768");
870 module_param(tx_fifo_size_08
, long, 0444);
871 MODULE_PARM_DESC(tx_fifo_size_08
, "Number of words in the Tx FIFO #08 0-32768");
872 module_param(tx_fifo_size_09
, long, 0444);
873 MODULE_PARM_DESC(tx_fifo_size_09
, "Number of words in the Tx FIFO #09 0-32768");
874 module_param(tx_fifo_size_10
, long, 0444);
875 MODULE_PARM_DESC(tx_fifo_size_10
, "Number of words in the Tx FIFO #10 0-32768");
876 module_param(tx_fifo_size_11
, long, 0444);
877 MODULE_PARM_DESC(tx_fifo_size_11
, "Number of words in the Tx FIFO #11 0-32768");
878 module_param(tx_fifo_size_12
, long, 0444);
879 MODULE_PARM_DESC(tx_fifo_size_12
, "Number of words in the Tx FIFO #12 0-32768");
880 module_param(tx_fifo_size_13
, long, 0444);
881 MODULE_PARM_DESC(tx_fifo_size_13
, "Number of words in the Tx FIFO #13 0-32768");
882 module_param(tx_fifo_size_14
, long, 0444);
883 MODULE_PARM_DESC(tx_fifo_size_14
, "Number of words in the Tx FIFO #14 0-32768");
884 module_param(tx_fifo_size_15
, long, 0444);
885 MODULE_PARM_DESC(tx_fifo_size_15
, "Number of words in the Tx FIFO #15 0-32768");
887 module_param(thr_ctl
, short, 0444);
888 MODULE_PARM_DESC(thr_ctl
, "0=Without 1=With Theshold Ctrl");
890 module_param(tx_thr_length
, long, 0444);
891 MODULE_PARM_DESC(tx_thr_length
, "TX Threshold length");
893 module_param(rx_thr_length
, long, 0444);
894 MODULE_PARM_DESC(rx_thr_length
, "RX Threshold length");
897 module_param(nperio_tx_fifo_size
, long, 0444);
898 MODULE_PARM_DESC(nperio_tx_fifo_size
, "Number of words in the non-periodic Tx FIFO 16-32768");
900 module_param(perio_tx_fifo_size_01
, long, 0444);
901 MODULE_PARM_DESC(perio_tx_fifo_size_01
, "Number of words in the periodic Tx FIFO #01 0-32768");
902 module_param(perio_tx_fifo_size_02
, long, 0444);
903 MODULE_PARM_DESC(perio_tx_fifo_size_02
, "Number of words in the periodic Tx FIFO #02 0-32768");
904 module_param(perio_tx_fifo_size_03
, long, 0444);
905 MODULE_PARM_DESC(perio_tx_fifo_size_03
, "Number of words in the periodic Tx FIFO #03 0-32768");
906 module_param(perio_tx_fifo_size_04
, long, 0444);
907 MODULE_PARM_DESC(perio_tx_fifo_size_04
, "Number of words in the periodic Tx FIFO #04 0-32768");
908 module_param(perio_tx_fifo_size_05
, long, 0444);
909 MODULE_PARM_DESC(perio_tx_fifo_size_05
, "Number of words in the periodic Tx FIFO #05 0-32768");
910 module_param(perio_tx_fifo_size_06
, long, 0444);
911 MODULE_PARM_DESC(perio_tx_fifo_size_06
, "Number of words in the periodic Tx FIFO #06 0-32768");
912 module_param(perio_tx_fifo_size_07
, long, 0444);
913 MODULE_PARM_DESC(perio_tx_fifo_size_07
, "Number of words in the periodic Tx FIFO #07 0-32768");
914 module_param(perio_tx_fifo_size_08
, long, 0444);
915 MODULE_PARM_DESC(perio_tx_fifo_size_08
, "Number of words in the periodic Tx FIFO #08 0-32768");
916 module_param(perio_tx_fifo_size_09
, long, 0444);
917 MODULE_PARM_DESC(perio_tx_fifo_size_09
, "Number of words in the periodic Tx FIFO #09 0-32768");
918 module_param(perio_tx_fifo_size_10
, long, 0444);
919 MODULE_PARM_DESC(perio_tx_fifo_size_10
, "Number of words in the periodic Tx FIFO #10 0-32768");
920 module_param(perio_tx_fifo_size_11
, long, 0444);
921 MODULE_PARM_DESC(perio_tx_fifo_size_11
, "Number of words in the periodic Tx FIFO #11 0-32768");
922 module_param(perio_tx_fifo_size_12
, long, 0444);
923 MODULE_PARM_DESC(perio_tx_fifo_size_12
, "Number of words in the periodic Tx FIFO #12 0-32768");
924 module_param(perio_tx_fifo_size_13
, long, 0444);
925 MODULE_PARM_DESC(perio_tx_fifo_size_13
, "Number of words in the periodic Tx FIFO #13 0-32768");
926 module_param(perio_tx_fifo_size_14
, long, 0444);
927 MODULE_PARM_DESC(perio_tx_fifo_size_14
, "Number of words in the periodic Tx FIFO #14 0-32768");
928 module_param(perio_tx_fifo_size_15
, long, 0444);
929 MODULE_PARM_DESC(perio_tx_fifo_size_15
, "Number of words in the periodic Tx FIFO #15 0-32768");
931 module_param(dev_endpoints
, short, 0444);
932 MODULE_PARM_DESC(dev_endpoints
, "The number of endpoints in addition to EP0 available for device mode 1-15");
936 module_param(rx_fifo_size
, long, 0444);
937 MODULE_PARM_DESC(rx_fifo_size
, "Number of words in the Rx FIFO 16-32768");
939 module_param(nperio_tx_fifo_size
, long, 0444);
940 MODULE_PARM_DESC(nperio_tx_fifo_size
, "Number of words in the non-periodic Tx FIFO 16-32768");
942 module_param(perio_tx_fifo_size
, long, 0444);
943 MODULE_PARM_DESC(perio_tx_fifo_size
, "Number of words in the host periodic Tx FIFO 16-32768");
945 module_param(host_channels
, short, 0444);
946 MODULE_PARM_DESC(host_channels
, "The number of host channel registers to use 1-16");
949 module_param(max_transfer_size
, long, 0444);
950 MODULE_PARM_DESC(max_transfer_size
, "The maximum transfer size supported in bytes 2047-65535");
952 module_param(max_packet_count
, long, 0444);
953 MODULE_PARM_DESC(max_packet_count
, "The maximum number of packets in a transfer 15-511");
955 module_param(phy_utmi_width
, long, 0444);
956 MODULE_PARM_DESC(phy_utmi_width
, "Specifies the UTMI+ Data Width 8 or 16 bits");
958 module_param(turn_around_time_hs
, long, 0444);
959 MODULE_PARM_DESC(turn_around_time_hs
, "Turn-Around time for HS");
961 module_param(turn_around_time_fs
, long, 0444);
962 MODULE_PARM_DESC(turn_around_time_fs
, "Turn-Around time for FS");
964 module_param(timeout_cal_hs
, long, 0444);
965 MODULE_PARM_DESC(timeout_cal_hs
, "Timeout Cal for HS");
967 module_param(timeout_cal_fs
, long, 0444);
968 MODULE_PARM_DESC(timeout_cal_fs
, "Timeout Cal for FS");