5656#include "dwc_otg_core_if.h"
5757#include "dwc_otg_pcd_if.h"
5858#include "dwc_otg_hcd_if.h"
59+ #include "dwc_otg_fiq_fsm.h"
5960
6061#define DWC_DRIVER_VERSION "3.00a 10-AUG-2012"
6162#define DWC_DRIVER_DESC "HS OTG USB Controller driver"
@@ -64,7 +65,6 @@ bool microframe_schedule=true;
6465
6566static const char dwc_driver_name [] = "dwc_otg" ;
6667
67- extern void * dummy_send ;
6868
6969extern int pcd_init (
7070#ifdef LM_INTERFACE
@@ -240,13 +240,14 @@ static struct dwc_otg_driver_module_params dwc_otg_module_params = {
240240 .adp_enable = -1 ,
241241};
242242
243- //Global variable to switch the fiq fix on or off (declared in bcm2708.c)
244- extern bool fiq_fix_enable ;
243+ //Global variable to switch the fiq fix on or off
244+ bool fiq_enable = 1 ;
245245// Global variable to enable the split transaction fix
246- bool fiq_split_enable = true ;
247- //Global variable to switch the nak holdoff on or off
248- bool nak_holdoff_enable = true ;
246+ bool fiq_fsm_enable = false ;
247+ //Bulk split-transaction NAK holdoff in microframes
248+ uint16_t nak_holdoff = 8 ;
249249
250+ unsigned short fiq_fsm_mask = 0x01 ;
250251
251252/**
252253 * This function shows the Driver Version.
@@ -800,7 +801,7 @@ static int dwc_otg_driver_probe(
800801 dwc_otg_device -> os_dep .base = ioremap_nocache (_dev -> resource [0 ].start ,
801802 _dev -> resource [0 ].end -
802803 _dev -> resource [0 ].start + 1 );
803- if (fiq_fix_enable )
804+ if (fiq_enable )
804805 {
805806 if (!request_mem_region (_dev -> resource [1 ].start ,
806807 _dev -> resource [1 ].end - _dev -> resource [1 ].start + 1 ,
@@ -813,7 +814,6 @@ static int dwc_otg_driver_probe(
813814 dwc_otg_device -> os_dep .mphi_base = ioremap_nocache (_dev -> resource [1 ].start ,
814815 _dev -> resource [1 ].end -
815816 _dev -> resource [1 ].start + 1 );
816- dummy_send = (void * ) kmalloc (16 , GFP_ATOMIC );
817817 }
818818
819819#else
@@ -1071,9 +1071,9 @@ static int __init dwc_otg_driver_init(void)
10711071 int error ;
10721072 struct device_driver * drv ;
10731073
1074- if (fiq_split_enable && !fiq_fix_enable ) {
1075- printk (KERN_WARNING "dwc_otg: fiq_split_enable was set without fiq_fix_enable ! Correcting.\n" );
1076- fiq_fix_enable = 1 ;
1074+ if (fiq_fsm_enable && !fiq_enable ) {
1075+ printk (KERN_WARNING "dwc_otg: fiq_fsm_enable was set without fiq_enable ! Correcting.\n" );
1076+ fiq_enable = 1 ;
10771077 }
10781078
10791079 printk (KERN_INFO "%s: version %s (%s bus)\n" , dwc_driver_name ,
@@ -1095,9 +1095,9 @@ static int __init dwc_otg_driver_init(void)
10951095 printk (KERN_ERR "%s retval=%d\n" , __func__ , retval );
10961096 return retval ;
10971097 }
1098- printk (KERN_DEBUG "dwc_otg: FIQ %s\n" , fiq_fix_enable ? "enabled" :"disabled" );
1099- printk (KERN_DEBUG "dwc_otg: NAK holdoff %s\n" , nak_holdoff_enable ? "enabled" :"disabled" );
1100- printk (KERN_DEBUG "dwc_otg: FIQ split fix %s\n" , fiq_split_enable ? "enabled" :"disabled" );
1098+ printk (KERN_DEBUG "dwc_otg: FIQ %s\n" , fiq_enable ? "enabled" :"disabled" );
1099+ printk (KERN_DEBUG "dwc_otg: NAK holdoff %s\n" , nak_holdoff ? "enabled" :"disabled" );
1100+ printk (KERN_DEBUG "dwc_otg: FIQ split-transaction FSM %s\n" , fiq_fsm_enable ? "enabled" :"disabled" );
11011101
11021102 error = driver_create_file (drv , & driver_attr_version );
11031103#ifdef DEBUG
@@ -1378,12 +1378,19 @@ MODULE_PARM_DESC(otg_ver, "OTG revision supported 0=OTG 1.3 1=OTG 2.0");
13781378module_param (microframe_schedule , bool , 0444 );
13791379MODULE_PARM_DESC (microframe_schedule , "Enable the microframe scheduler" );
13801380
1381- module_param (fiq_fix_enable , bool , 0444 );
1382- MODULE_PARM_DESC (fiq_fix_enable , "Enable the fiq fix" );
1383- module_param (nak_holdoff_enable , bool , 0444 );
1384- MODULE_PARM_DESC (nak_holdoff_enable , "Enable the NAK holdoff" );
1385- module_param (fiq_split_enable , bool , 0444 );
1386- MODULE_PARM_DESC (fiq_split_enable , "Enable the FIQ fix on split transactions" );
1381+ module_param (fiq_enable , bool , 0444 );
1382+ MODULE_PARM_DESC (fiq_enable , "Enable the FIQ" );
1383+ module_param (nak_holdoff , ushort , 0644 );
1384+ MODULE_PARM_DESC (nak_holdoff , "Throttle duration for bulk split-transaction endpoints on a NAK. Default 8" );
1385+ module_param (fiq_fsm_enable , bool , 0444 );
1386+ MODULE_PARM_DESC (fiq_fsm_enable , "Enable the FIQ to perform split transactions as defined by fiq_fsm_mask" );
1387+ module_param (fiq_fsm_mask , ushort , 0444 );
1388+ MODULE_PARM_DESC (fiq_fsm_mask , "Bitmask of transactions to perform in the FIQ.\n"
1389+ "Bit 0 : Non-periodic split transactions\n"
1390+ "Bit 1 : Periodic split transactions\n"
1391+ "Bit 2 : High-speed multi-transfer isochronous\n"
1392+ "All other bits should be set 0." );
1393+
13871394
13881395/** @page "Module Parameters"
13891396 *
0 commit comments