- Timestamp:
- 07/03/2009 04:48:37 PM (9 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/dwc_otg_driver.c
r11800 r12433 1 1 /* ========================================================================== 2 2 * $File: //dwh/usb_iip/dev/software/otg_ipmate/linux/drivers/dwc_otg_driver.c $ 3 * $Revision: 1. 2$4 * $Date: 200 7-11-30 08:32:28$3 * $Revision: 1.7 $ 4 * $Date: 2008-11-21 05:39:15 $ 5 5 * $Change: 791271 $ 6 6 * … … 8 8 * "Software") is an Unsupported proprietary work of Synopsys, Inc. unless 9 9 * otherwise expressly agreed to in writing between Synopsys and you. 10 * 10 * 11 11 * The Software IS NOT an item of Licensed Software or Licensed Product under 12 12 * any End User Software License Agreement or Agreement for Licensed Product … … 18 18 * Synopsys. If you do not agree with this notice, including the disclaimer 19 19 * below, then you are not authorized to use the Software. 20 * 20 * 21 21 * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS 22 22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE … … 38 38 * installed, the dwc_otg_driver_init function is called. When the module is 39 39 * removed (using rmmod), the dwc_otg_driver_cleanup function is called. 40 * 40 * 41 41 * This module also defines a data structure for the dwc_otg_driver, which is 42 42 * used in conjunction with the standard ARM lm_device structure. These … … 57 57 #include <linux/types.h> 58 58 #include <linux/stat.h> /* permission constants */ 59 #include <linux/version.h> 60 61 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 62 # include <linux/irq.h> 63 #endif 59 64 60 65 #include <asm/io.h> 66 67 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) 68 # include <asm/irq.h> 69 #endif 70 61 71 //#include <asm/arch/lm.h> 62 72 #include <asm/rt2880/lm.h> … … 72 82 #include "dwc_otg_hcd.h" 73 83 74 #define DWC_DRIVER_VERSION "2. 60a 22-NOV-2006"84 #define DWC_DRIVER_VERSION "2.72a 24-JUN-2008" 75 85 #define DWC_DRIVER_DESC "HS OTG USB Controller driver" 76 86 77 87 static const char dwc_driver_name[] = "dwc_otg"; 78 79 88 80 89 /*-------------------------------------------------------------------------*/ … … 85 94 .otg_cap = -1, 86 95 .dma_enable = -1, 96 .dma_desc_enable = -1, 87 97 .dma_burst_size = -1, 88 98 .speed = -1, … … 93 103 .dev_rx_fifo_size = -1, 94 104 .dev_nperio_tx_fifo_size = -1, 95 .dev_perio_tx_fifo_size = 96 { /* dev_perio_tx_fifo_size_1 */ 97 -1, 98 -1, 99 -1, 100 -1, 101 -1, 102 -1, 103 -1, 104 -1, 105 -1, 106 -1, 107 -1, 108 -1, 109 -1, 110 -1, 111 -1 112 }, /* 15 */ 105 .dev_perio_tx_fifo_size = { 106 /* dev_perio_tx_fifo_size_1 */ 107 -1, 108 -1, 109 -1, 110 -1, 111 -1, 112 -1, 113 -1, 114 -1, 115 -1, 116 -1, 117 -1, 118 -1, 119 -1, 120 -1, 121 -1 122 /* 15 */ 123 }, 113 124 .host_rx_fifo_size = -1, 114 125 .host_nperio_tx_fifo_size = -1, … … 126 137 .ts_dline = -1, 127 138 .en_multiple_tx_fifo = -1, 128 .dev_tx_fifo_size = 129 { /* dev_tx_fifo_size */ 130 -1, 131 -1, 132 -1, 133 -1, 134 -1, 135 -1, 136 -1, 137 -1, 138 -1, 139 -1, 140 -1, 141 -1, 142 -1, 143 -1, 144 -1 145 }, /* 15 */ 139 .dev_tx_fifo_size = { 140 /* dev_tx_fifo_size */ 141 -1, 142 -1, 143 -1, 144 -1, 145 -1, 146 -1, 147 -1, 148 -1, 149 -1, 150 -1, 151 -1, 152 -1, 153 -1, 154 -1, 155 -1 156 /* 15 */ 157 }, 146 158 .thr_ctl = -1, 147 159 .tx_thr_length = -1, 148 160 .rx_thr_length = -1, 161 .pti_enable = -1, 162 .mpi_enable = -1, 149 163 }; 150 164 … … 154 168 static ssize_t version_show(struct device_driver *dev, char *buf) 155 169 { 156 return snprintf(buf, sizeof(DWC_DRIVER_VERSION)+2, "%s\n",157 DWC_DRIVER_VERSION);170 return snprintf(buf, sizeof(DWC_DRIVER_VERSION)+2, "%s\n", 171 DWC_DRIVER_VERSION); 158 172 } 159 173 static DRIVER_ATTR(version, S_IRUGO, version_show, NULL); … … 167 181 * This function shows the driver Debug Level. 168 182 */ 169 static ssize_t dbg_level_show(struct device_driver * _drv, char *_buf)183 static ssize_t dbg_level_show(struct device_driver *drv, char *buf) 170 184 { 171 return sprintf( _buf, "0x%0x\n", g_dbg_lvl);185 return sprintf(buf, "0x%0x\n", g_dbg_lvl); 172 186 } 187 173 188 /** 174 189 * This function stores the driver Debug Level. 175 190 */ 176 static ssize_t dbg_level_store(struct device_driver * _drv, const char *_buf,177 size_t _count)191 static ssize_t dbg_level_store(struct device_driver *drv, const char *buf, 192 size_t count) 178 193 { 179 g_dbg_lvl = simple_strtoul( _buf, NULL, 16);180 return _count;194 g_dbg_lvl = simple_strtoul(buf, NULL, 16); 195 return count; 181 196 } 182 197 static DRIVER_ATTR(debuglevel, S_IRUGO|S_IWUSR, dbg_level_show, dbg_level_store); 183 184 198 185 199 /** … … 191 205 int i; 192 206 int retval = 0; 193 207 194 208 /* Checks if the parameter is outside of its valid range of values */ 195 #define DWC_OTG_PARAM_TEST(_param_, _low_,_high_) \209 #define DWC_OTG_PARAM_TEST(_param_, _low_, _high_) \ 196 210 ((dwc_otg_module_params._param_ < (_low_)) || \ 197 211 (dwc_otg_module_params._param_ > (_high_))) … … 199 213 /* If the parameter has been set by the user, check that the parameter value is 200 214 * within the value range of values. If not, report a module error. */ 201 #define DWC_OTG_PARAM_ERR(_param_, _low_,_high_,_string_) \215 #define DWC_OTG_PARAM_ERR(_param_, _low_, _high_, _string_) \ 202 216 do { \ 203 217 if (dwc_otg_module_params._param_ != -1) { \ 204 if (DWC_OTG_PARAM_TEST(_param_, (_low_),(_high_))) { \218 if (DWC_OTG_PARAM_TEST(_param_, (_low_), (_high_))) { \ 205 219 DWC_ERROR("`%d' invalid for parameter `%s'\n", \ 206 dwc_otg_module_params._param_, _string_); \220 dwc_otg_module_params._param_, _string_); \ 207 221 dwc_otg_module_params._param_ = dwc_param_##_param_##_default; \ 208 retval ++; \222 retval++; \ 209 223 } \ 210 224 } \ … … 214 228 DWC_OTG_PARAM_ERR(otg_cap,0,2,"otg_cap"); 215 229 DWC_OTG_PARAM_ERR(dma_enable,0,1,"dma_enable"); 230 DWC_OTG_PARAM_ERR(dma_desc_enable,0,1,"dma_desc_enable"); 216 231 DWC_OTG_PARAM_ERR(speed,0,1,"speed"); 217 232 DWC_OTG_PARAM_ERR(host_support_fs_ls_low_power,0,1,"host_support_fs_ls_low_power"); … … 235 250 DWC_OTG_PARAM_ERR(ts_dline,0,1,"ts_dline"); 236 251 237 if (dwc_otg_module_params.dma_burst_size != -1) 238 { 252 if (dwc_otg_module_params.dma_burst_size != -1) { 239 253 if (DWC_OTG_PARAM_TEST(dma_burst_size,1,1) && 240 DWC_OTG_PARAM_TEST(dma_burst_size,4,4) && 241 DWC_OTG_PARAM_TEST(dma_burst_size,8,8) && 242 DWC_OTG_PARAM_TEST(dma_burst_size,16,16) && 243 DWC_OTG_PARAM_TEST(dma_burst_size,32,32) && 244 DWC_OTG_PARAM_TEST(dma_burst_size,64,64) && 245 DWC_OTG_PARAM_TEST(dma_burst_size,128,128) && 246 DWC_OTG_PARAM_TEST(dma_burst_size,256,256)) 247 { 248 DWC_ERROR("`%d' invalid for parameter `dma_burst_size'\n", 254 DWC_OTG_PARAM_TEST(dma_burst_size,4,4) && 255 DWC_OTG_PARAM_TEST(dma_burst_size,8,8) && 256 DWC_OTG_PARAM_TEST(dma_burst_size,16,16) && 257 DWC_OTG_PARAM_TEST(dma_burst_size,32,32) && 258 DWC_OTG_PARAM_TEST(dma_burst_size,64,64) && 259 DWC_OTG_PARAM_TEST(dma_burst_size,128,128) && 260 DWC_OTG_PARAM_TEST(dma_burst_size,256,256)) { 261 DWC_ERROR("`%d' invalid for parameter `dma_burst_size'\n", 249 262 dwc_otg_module_params.dma_burst_size); 250 263 dwc_otg_module_params.dma_burst_size = 32; 251 retval ++;264 retval++; 252 265 } 253 } 254 255 if (dwc_otg_module_params.phy_utmi_width != -1) 256 { 257 if (DWC_OTG_PARAM_TEST(phy_utmi_width,8,8) && 258 DWC_OTG_PARAM_TEST(phy_utmi_width,16,16)) 266 259 267 { 260 DWC_ERROR("`%d' invalid for parameter `phy_utmi_width'\n", 268 uint8_t brst_sz = 0; 269 while(dwc_otg_module_params.dma_burst_size > 1) { 270 brst_sz ++; 271 dwc_otg_module_params.dma_burst_size >>= 1; 272 } 273 dwc_otg_module_params.dma_burst_size = brst_sz; 274 } 275 } 276 277 if (dwc_otg_module_params.phy_utmi_width != -1) { 278 if (DWC_OTG_PARAM_TEST(phy_utmi_width, 8, 8) && 279 DWC_OTG_PARAM_TEST(phy_utmi_width, 16, 16)) { 280 DWC_ERROR("`%d' invalid for parameter `phy_utmi_width'\n", 261 281 dwc_otg_module_params.phy_utmi_width); 262 282 dwc_otg_module_params.phy_utmi_width = 16; 263 retval ++;283 retval++; 264 284 } 265 285 } 266 286 267 for (i=0; i<15; i++) 268 { 287 for (i = 0; i < 15; i++) { 269 288 /** @todo should be like above */ 270 //DWC_OTG_PARAM_ERR(dev_perio_tx_fifo_size[i],4,768,"dev_perio_tx_fifo_size"); 271 if (dwc_otg_module_params.dev_perio_tx_fifo_size[i] != -1) 272 { 273 if (DWC_OTG_PARAM_TEST(dev_perio_tx_fifo_size[i],4,768)) 274 { 289 //DWC_OTG_PARAM_ERR(dev_perio_tx_fifo_size[i], 4, 768, "dev_perio_tx_fifo_size"); 290 if (dwc_otg_module_params.dev_perio_tx_fifo_size[i] != -1) { 291 if (DWC_OTG_PARAM_TEST(dev_perio_tx_fifo_size[i], 4, 768)) { 275 292 DWC_ERROR("`%d' invalid for parameter `%s_%d'\n", 276 293 dwc_otg_module_params.dev_perio_tx_fifo_size[i], "dev_perio_tx_fifo_size", i); 277 294 dwc_otg_module_params.dev_perio_tx_fifo_size[i] = dwc_param_dev_perio_tx_fifo_size_default; 278 retval ++;295 retval++; 279 296 } 280 297 } 281 298 } 282 299 283 DWC_OTG_PARAM_ERR(en_multiple_tx_fifo,0,1,"en_multiple_tx_fifo"); 284 285 for (i=0; i<15; i++) 286 { 300 DWC_OTG_PARAM_ERR(en_multiple_tx_fifo, 0, 1, "en_multiple_tx_fifo"); 301 302 for (i = 0; i < 15; i++) { 287 303 /** @todo should be like above */ 288 //DWC_OTG_PARAM_ERR(dev_tx_fifo_size[i],4,768,"dev_tx_fifo_size"); 289 if (dwc_otg_module_params.dev_tx_fifo_size[i] != -1) 290 { 291 if (DWC_OTG_PARAM_TEST(dev_tx_fifo_size[i],4,768)) 292 { 304 //DWC_OTG_PARAM_ERR(dev_tx_fifo_size[i], 4, 768, "dev_tx_fifo_size"); 305 if (dwc_otg_module_params.dev_tx_fifo_size[i] != -1) { 306 if (DWC_OTG_PARAM_TEST(dev_tx_fifo_size[i], 4, 768)) { 293 307 DWC_ERROR("`%d' invalid for parameter `%s_%d'\n", 294 308 dwc_otg_module_params.dev_tx_fifo_size[i], "dev_tx_fifo_size", i); 295 309 dwc_otg_module_params.dev_tx_fifo_size[i] = dwc_param_dev_tx_fifo_size_default; 296 retval ++;310 retval++; 297 311 } 298 312 } … … 302 316 DWC_OTG_PARAM_ERR(tx_thr_length, 8, 128, "tx_thr_length"); 303 317 DWC_OTG_PARAM_ERR(rx_thr_length, 8, 128, "rx_thr_length"); 304 305 318 319 DWC_OTG_PARAM_ERR(pti_enable,0,1,"pti_enable"); 320 DWC_OTG_PARAM_ERR(mpi_enable,0,1,"mpi_enable"); 321 306 322 /* At this point, all module parameters that have been set by the user 307 323 * are valid, and those that have not are left unset. Now set their 308 324 * default values and/or check the parameters against the hardware 309 325 * configurations of the OTG core. */ 310 311 312 326 313 327 /* This sets the parameter to the default value if it has not been set by the … … 324 338 325 339 /* This checks the macro agains the hardware configuration to see if it is 326 * valid. It is possible that the default value could be invalid. In this340 * valid. It is possible that the default value could be invalid. In this 327 341 * case, it will report a module error if the user touched the parameter. 328 342 * Otherwise it will adjust the value without any error. */ 329 #define DWC_OTG_PARAM_CHECK_VALID(_param_, _str_,_is_valid_,_set_valid_) \343 #define DWC_OTG_PARAM_CHECK_VALID(_param_, _str_, _is_valid_, _set_valid_) \ 330 344 ({ \ 331 int changed = DWC_OTG_PARAM_SET_DEFAULT(_param_); \345 int changed = DWC_OTG_PARAM_SET_DEFAULT(_param_); \ 332 346 int error = 0; \ 333 347 if (!(_is_valid_)) { \ 334 348 if (changed) { \ 335 DWC_ERROR("`%d' invalid for parameter `%s'. Check HW configuration.\n", dwc_otg_module_params._param_,_str_); \349 DWC_ERROR("`%d' invalid for parameter `%s'. Check HW configuration.\n", dwc_otg_module_params._param_, _str_); \ 336 350 error = 1; \ 337 351 } \ … … 342 356 343 357 /* OTG Cap */ 344 retval += DWC_OTG_PARAM_CHECK_VALID(otg_cap, "otg_cap",345 ({346 int valid;347 valid = 1;348 switch (dwc_otg_module_params.otg_cap) {349 case DWC_OTG_CAP_PARAM_HNP_SRP_CAPABLE:350 if (core_if->hwcfg2.b.op_mode != DWC_HWCFG2_OP_MODE_HNP_SRP_CAPABLE_OTG) valid = 0;351 break;352 case DWC_OTG_CAP_PARAM_SRP_ONLY_CAPABLE:353 if ((core_if->hwcfg2.b.op_mode != DWC_HWCFG2_OP_MODE_HNP_SRP_CAPABLE_OTG) &&354 (core_if->hwcfg2.b.op_mode != DWC_HWCFG2_OP_MODE_SRP_ONLY_CAPABLE_OTG) &&355 (core_if->hwcfg2.b.op_mode != DWC_HWCFG2_OP_MODE_SRP_CAPABLE_DEVICE) &&356 (core_if->hwcfg2.b.op_mode != DWC_HWCFG2_OP_MODE_SRP_CAPABLE_HOST))357 {358 valid = 0;359 }360 break;361 case DWC_OTG_CAP_PARAM_NO_HNP_SRP_CAPABLE:362 /* always valid */363 break;364 }365 valid;366 }),367 (((core_if->hwcfg2.b.op_mode == DWC_HWCFG2_OP_MODE_HNP_SRP_CAPABLE_OTG) ||368 (core_if->hwcfg2.b.op_mode == DWC_HWCFG2_OP_MODE_SRP_ONLY_CAPABLE_OTG) ||369 (core_if->hwcfg2.b.op_mode == DWC_HWCFG2_OP_MODE_SRP_CAPABLE_DEVICE) ||370 (core_if->hwcfg2.b.op_mode == DWC_HWCFG2_OP_MODE_SRP_CAPABLE_HOST)) ?371 DWC_OTG_CAP_PARAM_SRP_ONLY_CAPABLE :372 DWC_OTG_CAP_PARAM_NO_HNP_SRP_CAPABLE));373 374 retval += DWC_OTG_PARAM_CHECK_VALID(dma_enable, "dma_enable",375 ((dwc_otg_module_params.dma_enable == 1) && (core_if->hwcfg2.b.architecture == 0)) ? 0 : 1, 358 retval += DWC_OTG_PARAM_CHECK_VALID(otg_cap, "otg_cap", 359 ({ 360 int valid; 361 valid = 1; 362 switch (dwc_otg_module_params.otg_cap) { 363 case DWC_OTG_CAP_PARAM_HNP_SRP_CAPABLE: 364 if (core_if->hwcfg2.b.op_mode != DWC_HWCFG2_OP_MODE_HNP_SRP_CAPABLE_OTG) 365 valid = 0; 366 break; 367 case DWC_OTG_CAP_PARAM_SRP_ONLY_CAPABLE: 368 if ((core_if->hwcfg2.b.op_mode != DWC_HWCFG2_OP_MODE_HNP_SRP_CAPABLE_OTG) && 369 (core_if->hwcfg2.b.op_mode != DWC_HWCFG2_OP_MODE_SRP_ONLY_CAPABLE_OTG) && 370 (core_if->hwcfg2.b.op_mode != DWC_HWCFG2_OP_MODE_SRP_CAPABLE_DEVICE) && 371 (core_if->hwcfg2.b.op_mode != DWC_HWCFG2_OP_MODE_SRP_CAPABLE_HOST)) { 372 valid = 0; 373 } 374 break; 375 case DWC_OTG_CAP_PARAM_NO_HNP_SRP_CAPABLE: 376 /* always valid */ 377 break; 378 } 379 valid; 380 }), 381 (((core_if->hwcfg2.b.op_mode == DWC_HWCFG2_OP_MODE_HNP_SRP_CAPABLE_OTG) || 382 (core_if->hwcfg2.b.op_mode == DWC_HWCFG2_OP_MODE_SRP_ONLY_CAPABLE_OTG) || 383 (core_if->hwcfg2.b.op_mode == DWC_HWCFG2_OP_MODE_SRP_CAPABLE_DEVICE) || 384 (core_if->hwcfg2.b.op_mode == DWC_HWCFG2_OP_MODE_SRP_CAPABLE_HOST)) ? 385 DWC_OTG_CAP_PARAM_SRP_ONLY_CAPABLE : 386 DWC_OTG_CAP_PARAM_NO_HNP_SRP_CAPABLE)); 387 388 retval += DWC_OTG_PARAM_CHECK_VALID(dma_enable, "dma_enable", 389 ((dwc_otg_module_params.dma_enable == 1) && (core_if->hwcfg2.b.architecture == 0)) ? 0 : 1, 376 390 0); 377 391 378 retval += DWC_OTG_PARAM_CHECK_VALID(opt,"opt", 379 1, 392 retval += DWC_OTG_PARAM_CHECK_VALID(dma_desc_enable, "dma_desc_enable", 393 ((dwc_otg_module_params.dma_desc_enable == 1) && 394 ((dwc_otg_module_params.dma_enable == 0) || (core_if->hwcfg4.b.desc_dma == 0))) ? 0 : 1, 380 395 0); 396 397 retval += DWC_OTG_PARAM_CHECK_VALID(opt, "opt", 1, 0); 381 398 382 399 DWC_OTG_PARAM_SET_DEFAULT(dma_burst_size); … … 390 407 ((dwc_otg_module_params.enable_dynamic_fifo == 0) || 391 408 (core_if->hwcfg2.b.dynamic_fifo == 1)), 0); 392 393 409 394 410 retval += DWC_OTG_PARAM_CHECK_VALID(data_fifo_size, … … 412 428 dwc_read_reg32(&core_if->core_global_regs->grxfsiz)); 413 429 414 415 430 retval += DWC_OTG_PARAM_CHECK_VALID(host_nperio_tx_fifo_size, 416 431 "host_nperio_tx_fifo_size", … … 447 462 * internal testing only. 448 463 * 449 * #define NO_FS_PHY_HW_CHECKS 464 * #define NO_FS_PHY_HW_CHECKS 450 465 */ 451 466 … … 459 474 int valid = 0; 460 475 if ((dwc_otg_module_params.phy_type == DWC_PHY_TYPE_PARAM_UTMI) && 461 ((core_if->hwcfg2.b.hs_phy_type == 1) || 462 (core_if->hwcfg2.b.hs_phy_type == 3))) 463 { 476 ((core_if->hwcfg2.b.hs_phy_type == 1) || 477 (core_if->hwcfg2.b.hs_phy_type == 3))) { 464 478 valid = 1; 465 479 } 466 480 else if ((dwc_otg_module_params.phy_type == DWC_PHY_TYPE_PARAM_ULPI) && 467 ((core_if->hwcfg2.b.hs_phy_type == 2) || 468 (core_if->hwcfg2.b.hs_phy_type == 3))) 469 { 481 ((core_if->hwcfg2.b.hs_phy_type == 2) || 482 (core_if->hwcfg2.b.hs_phy_type == 3))) { 470 483 valid = 1; 471 484 } 472 485 else if ((dwc_otg_module_params.phy_type == DWC_PHY_TYPE_PARAM_FS) && 473 (core_if->hwcfg2.b.fs_phy_type == 1)) 474 { 486 (core_if->hwcfg2.b.fs_phy_type == 1)) { 475 487 valid = 1; 476 488 } … … 479 491 ({ 480 492 int set = DWC_PHY_TYPE_PARAM_FS; 481 if (core_if->hwcfg2.b.hs_phy_type) { 482 if ((core_if->hwcfg2.b.hs_phy_type == 3) || 493 if (core_if->hwcfg2.b.hs_phy_type) { 494 if ((core_if->hwcfg2.b.hs_phy_type == 3) || 483 495 (core_if->hwcfg2.b.hs_phy_type == 1)) { 484 496 set = DWC_PHY_TYPE_PARAM_UTMI; … … 492 504 #endif 493 505 494 retval += DWC_OTG_PARAM_CHECK_VALID(speed, "speed",506 retval += DWC_OTG_PARAM_CHECK_VALID(speed, "speed", 495 507 (dwc_otg_module_params.speed == 0) && (dwc_otg_module_params.phy_type == DWC_PHY_TYPE_PARAM_FS) ? 0 : 1, 496 508 dwc_otg_module_params.phy_type == DWC_PHY_TYPE_PARAM_FS ? 1 : 0); … … 508 520 509 521 #ifdef NO_FS_PHY_HW_CHECKS 510 retval += DWC_OTG_PARAM_CHECK_VALID(i2c_enable, 511 "i2c_enable", 1, 0); 522 retval += DWC_OTG_PARAM_CHECK_VALID(i2c_enable, "i2c_enable", 1, 0); 512 523 #else 513 524 retval += DWC_OTG_PARAM_CHECK_VALID(i2c_enable, … … 517 528 #endif 518 529 519 for (i=0; i<15; i++) 520 { 530 for (i = 0; i < 15; i++) { 521 531 int changed = 1; 522 532 int error = 0; 523 533 524 if (dwc_otg_module_params.dev_perio_tx_fifo_size[i] == -1) 525 { 534 if (dwc_otg_module_params.dev_perio_tx_fifo_size[i] == -1) { 526 535 changed = 0; 527 536 dwc_otg_module_params.dev_perio_tx_fifo_size[i] = dwc_param_dev_perio_tx_fifo_size_default; 528 537 } 529 if (!(dwc_otg_module_params.dev_perio_tx_fifo_size[i] <= (dwc_read_reg32(&core_if->core_global_regs->dptxfsiz_dieptxf[i])))) 530 { 531 if (changed) 532 { 533 DWC_ERROR("`%d' invalid for parameter `dev_perio_fifo_size_%d'. Check HW configuration.\n", dwc_otg_module_params.dev_perio_tx_fifo_size[i],i); 538 if (!(dwc_otg_module_params.dev_perio_tx_fifo_size[i] <= (dwc_read_reg32(&core_if->core_global_regs->dptxfsiz_dieptxf[i])))) { 539 if (changed) { 540 DWC_ERROR("`%d' invalid for parameter `dev_perio_fifo_size_%d'. Check HW configuration.\n", dwc_otg_module_params.dev_perio_tx_fifo_size[i], i); 534 541 error = 1; 535 542 } … … 539 546 } 540 547 541 542 retval += DWC_OTG_PARAM_CHECK_VALID(en_multiple_tx_fifo,"en_multiple_tx_fifo", 543 ((dwc_otg_module_params.en_multiple_tx_fifo == 1) && (core_if->hwcfg4.b.ded_fifo_en == 0)) ? 0 : 1, 548 retval += DWC_OTG_PARAM_CHECK_VALID(en_multiple_tx_fifo, "en_multiple_tx_fifo", 549 ((dwc_otg_module_params.en_multiple_tx_fifo == 1) && (core_if->hwcfg4.b.ded_fifo_en == 0)) ? 0 : 1, 544 550 0); 545 551 546 547 for (i=0; i<15; i++) 548 { 549 552 for (i = 0; i < 15; i++) { 550 553 int changed = 1; 551 554 int error = 0; 552 555 553 if (dwc_otg_module_params.dev_tx_fifo_size[i] == -1) 554 { 556 if (dwc_otg_module_params.dev_tx_fifo_size[i] == -1) { 555 557 changed = 0; 556 558 dwc_otg_module_params.dev_tx_fifo_size[i] = dwc_param_dev_tx_fifo_size_default; 557 559 } 558 if (!(dwc_otg_module_params.dev_tx_fifo_size[i] <= (dwc_read_reg32(&core_if->core_global_regs->dptxfsiz_dieptxf[i])))) 559 { 560 if (changed) 561 { 562 DWC_ERROR("%d' invalid for parameter `dev_perio_fifo_size_%d'. Check HW configuration.\n", dwc_otg_module_params.dev_tx_fifo_size[i],i); 560 if (!(dwc_otg_module_params.dev_tx_fifo_size[i] <= (dwc_read_reg32(&core_if->core_global_regs->dptxfsiz_dieptxf[i])))) { 561 if (changed) { 562 DWC_ERROR("%d' invalid for parameter `dev_perio_fifo_size_%d'. Check HW configuration.\n", dwc_otg_module_params.dev_tx_fifo_size[i], i); 563 563 error = 1; 564 564 } … … 566 566 } 567 567 retval += error; 568 569 570 } 571 572 DWC_OTG_PARAM_SET_DEFAULT(thr_ctl); 568 } 569 570 retval += DWC_OTG_PARAM_CHECK_VALID(thr_ctl, "thr_ctl", 571 ((dwc_otg_module_params.thr_ctl != 0) && ((dwc_otg_module_params.dma_enable == 0) || (core_if->hwcfg4.b.ded_fifo_en == 0))) ? 0 : 1, 572 0); 573 573 574 DWC_OTG_PARAM_SET_DEFAULT(tx_thr_length); 574 575 DWC_OTG_PARAM_SET_DEFAULT(rx_thr_length); 575 576 577 retval += DWC_OTG_PARAM_CHECK_VALID(pti_enable, "pti_enable", 578 ((dwc_otg_module_params.pti_enable == 0) || ((dwc_otg_module_params.pti_enable == 1) && (core_if->snpsid >= 0x4F54272A))) ? 1 : 0, 579 0); 580 581 retval += DWC_OTG_PARAM_CHECK_VALID(mpi_enable, "mpi_enable", 582 ((dwc_otg_module_params.mpi_enable == 0) || ((dwc_otg_module_params.mpi_enable == 1) && (core_if->hwcfg2.b.multi_proc_int == 1))) ? 1 : 0, 583 0); 576 584 return retval; 577 585 } 578 586 579 /** 587 /** 580 588 * This function is the top level interrupt handler for the Common 581 589 * (Device and host modes) interrupts. 582 590 */ 583 static irqreturn_t dwc_otg_common_irq(int _irq, void *_dev) 591 static irqreturn_t dwc_otg_common_irq(int irq, void *dev 592 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) 593 , struct pt_regs *r 594 #endif 595 ) 584 596 { 585 dwc_otg_device_t *otg_dev = _dev;597 dwc_otg_device_t *otg_dev = dev; 586 598 int32_t retval = IRQ_NONE; 587 599 588 retval = dwc_otg_handle_common_intr( otg_dev->core_if);600 retval = dwc_otg_handle_common_intr(otg_dev->core_if); 589 601 return IRQ_RETVAL(retval); 590 602 } … … 597 609 * of this device are freed. 598 610 * 599 * @param[in] _lmdev611 * @param[in] lmdev 600 612 */ 601 static void dwc_otg_driver_remove(struct lm_device * _lmdev)613 static void dwc_otg_driver_remove(struct lm_device *lmdev) 602 614 { 603 dwc_otg_device_t *otg_dev = lm_get_drvdata(_lmdev); 604 DWC_DEBUGPL(DBG_ANY, "%s(%p)\n", __func__, _lmdev); 605 606 if (otg_dev == NULL) 607 { 615 dwc_otg_device_t *otg_dev = lm_get_drvdata(lmdev); 616 DWC_DEBUGPL(DBG_ANY, "%s(%p)\n", __func__, lmdev); 617 618 if (!otg_dev) { 608 619 /* Memory allocation for the dwc_otg_device failed. */ 620 DWC_DEBUGPL(DBG_ANY, "%s: otg_dev NULL!\n", __func__); 609 621 return; 610 622 } 611 623 612 624 /* 613 * Free the IRQ 614 */ 615 if (otg_dev->common_irq_installed) 616 { 617 free_irq( _lmdev->irq, otg_dev ); 625 * Free the IRQ 626 */ 627 if (otg_dev->common_irq_installed) { 628 free_irq(lmdev->irq, otg_dev); 618 629 } 619 630 620 631 #ifndef DWC_DEVICE_ONLY 621 if (otg_dev->hcd != NULL) 622 { 623 dwc_otg_hcd_remove( _lmdev ); 632 if (otg_dev->hcd) { 633 dwc_otg_hcd_remove(lmdev); 634 } else { 635 DWC_DEBUGPL(DBG_ANY, "%s: otg_dev->hcd NULL!\n", __func__); 636 return; 624 637 } 625 638 #endif 626 639 627 640 #ifndef DWC_HOST_ONLY 628 if (otg_dev->pcd != NULL) 629 { 630 dwc_otg_pcd_remove( _lmdev ); 641 if (otg_dev->pcd) { 642 dwc_otg_pcd_remove(lmdev); 631 643 } 632 644 #endif 633 if (otg_dev->core_if != NULL) 634 { 635 dwc_otg_cil_remove( otg_dev->core_if ); 645 if (otg_dev->core_if) { 646 dwc_otg_cil_remove(otg_dev->core_if); 636 647 } 637 648 … … 639 650 * Remove the device attributes 640 651 */ 641 dwc_otg_attr_remove( _lmdev);652 dwc_otg_attr_remove(lmdev); 642 653 643 654 /* 644 655 * Return the memory. 645 656 */ 646 if (otg_dev->base != NULL) 647 { 657 if (otg_dev->base) { 648 658 iounmap(otg_dev->base); 649 659 } 650 660 kfree(otg_dev); 651 661 652 662 /* 653 663 * Clear the drvdata pointer. 654 664 */ 655 lm_set_drvdata( _lmdev, 0);665 lm_set_drvdata(lmdev, 0); 656 666 } 657 667 … … 665 675 * structure on subsequent calls to driver methods for this device. 666 676 * 667 * @param[in] _lmdev lm_device definition677 * @param[in] lmdev lm_device definition 668 678 */ 669 static int dwc_otg_driver_probe(struct lm_device * _lmdev)679 static int dwc_otg_driver_probe(struct lm_device *lmdev) 670 680 { 671 681 int retval = 0; 682 uint32_t snpsid; 672 683 dwc_otg_device_t *dwc_otg_device; 673 int32_t snpsid; 674 675 dev_dbg(&_lmdev->dev, "dwc_otg_driver_probe(%p)\n", _lmdev); 676 dev_dbg(&_lmdev->dev, "start=0x%08x\n", (unsigned)_lmdev->resource.start); 684 685 dev_dbg(&lmdev->dev, "dwc_otg_driver_probe(%p)\n", lmdev); 686 dev_dbg(&lmdev->dev, "start=0x%08x\n", (unsigned)lmdev->resource.start); 677 687 678 688 dwc_otg_device = kmalloc(sizeof(dwc_otg_device_t), GFP_KERNEL); 679 680 if (dwc_otg_device == 0) 681 { 682 dev_err(&_lmdev->dev, "kmalloc of dwc_otg_device failed\n"); 689 690 if (!dwc_otg_device) { 691 dev_err(&lmdev->dev, "kmalloc of dwc_otg_device failed\n"); 683 692 retval = -ENOMEM; 684 693 goto fail; 685 694 } 686 695 687 696 memset(dwc_otg_device, 0, sizeof(*dwc_otg_device)); 688 697 dwc_otg_device->reg_offset = 0xFFFFFFFF; … … 691 700 * Map the DWC_otg Core memory into virtual address space. 692 701 */ 693 dwc_otg_device->base = ioremap(_lmdev->resource.start, SZ_256K); 694 695 if (dwc_otg_device->base == NULL) 696 { 697 dev_err(&_lmdev->dev, "ioremap() failed\n"); 702 dwc_otg_device->base = ioremap(lmdev->resource.start, SZ_256K); 703 704 if (!dwc_otg_device->base) { 705 dev_err(&lmdev->dev, "ioremap() failed\n"); 698 706 retval = -ENOMEM; 699 707 goto fail; 700 708 } 701 dev_dbg(& _lmdev->dev, "base=0x%08x\n", (unsigned)dwc_otg_device->base);709 dev_dbg(&lmdev->dev, "base=0x%08x\n", (unsigned)dwc_otg_device->base); 702 710 703 711 /* … … 707 715 */ 708 716 snpsid = dwc_read_reg32((uint32_t *)((uint8_t *)dwc_otg_device->base + 0x40)); 709 710 if ((snpsid & 0xFFFFF000) != 0x4F542000) 711 { 712 dev_err(&_lmdev->dev, "Bad value for SNPSID: 0x%08x\n", snpsid); 717 718 if ((snpsid & 0xFFFFF000) != OTG_CORE_REV_2_00) { 719 dev_err(&lmdev->dev, "Bad value for SNPSID: 0x%08x\n", snpsid); 713 720 retval = -EINVAL; 714 721 goto fail; 715 722 } 716 723 724 DWC_PRINT("Core Release: %x.%x%x%x\n", 725 (snpsid >> 12 & 0xF), 726 (snpsid >> 8 & 0xF), 727 (snpsid >> 4 & 0xF), 728 (snpsid & 0xF)); 729 717 730 /* 718 731 * Initialize driver data to point to the global DWC_otg 719 732 * Device structure. 720 733 */ 721 lm_set_drvdata( _lmdev, dwc_otg_device ); 722 dev_dbg(&_lmdev->dev, "dwc_otg_device=0x%p\n", dwc_otg_device); 734 lm_set_drvdata(lmdev, dwc_otg_device); 735 dev_dbg(&lmdev->dev, "dwc_otg_device=0x%p\n", dwc_otg_device); 736 737 dwc_otg_device->core_if = dwc_otg_cil_init(dwc_otg_device->base, 738 &dwc_otg_module_params); 723 739 724 dwc_otg_device->core_if = dwc_otg_cil_init( dwc_otg_device->base, 725 &dwc_otg_module_params); 726 if (dwc_otg_device->core_if == 0) 727 { 728 dev_err(&_lmdev->dev, "CIL initialization failed!\n"); 740 dwc_otg_device->core_if->snpsid = snpsid; 741 742 if (!dwc_otg_device->core_if) { 743 dev_err(&lmdev->dev, "CIL initialization failed!\n"); 729 744 retval = -ENOMEM; 730 745 goto fail; 731 746 } 732 747 733 748 /* 734 749 * Validate parameter values. 735 750 */ 736 if (check_parameters(dwc_otg_device->core_if) != 0) 737 { 751 if (check_parameters(dwc_otg_device->core_if)) { 738 752 retval = -EINVAL; 739 753 goto fail; … … 742 756 /* 743 757 * Create Device Attributes in sysfs 744 */ 745 dwc_otg_attr_create (_lmdev);758 */ 759 dwc_otg_attr_create(lmdev); 746 760 747 761 /* … … 749 763 * handlers are installed. 750 764 */ 751 dwc_otg_disable_global_interrupts( dwc_otg_device->core_if ); 765 dwc_otg_disable_global_interrupts(dwc_otg_device->core_if); 766 752 767 /* 753 768 * Install the interrupt handler for the common interrupts before 754 769 * enabling common interrupts in core_init below. 755 770 */ 756 DWC_DEBUGPL( DBG_CIL, "registering (common) handler for irq%d\n",757 _lmdev->irq);758 retval = request_irq( _lmdev->irq, dwc_otg_common_irq,SA_SHIRQ, "dwc_otg", dwc_otg_device );759 if (retval != 0)760 {761 DWC_ERROR("request of irq%d failed\n", _lmdev->irq);771 DWC_DEBUGPL(DBG_CIL, "registering (common) handler for irq%d\n", 772 lmdev->irq); 773 retval = request_irq(lmdev->irq, dwc_otg_common_irq, 774 SA_SHIRQ, "dwc_otg", dwc_otg_device); 775 if (retval) { 776 DWC_ERROR("request of irq%d failed\n", lmdev->irq); 762 777 retval = -EBUSY; 763 778 goto fail; 764 } 765 else 766 { 779 } else { 767 780 dwc_otg_device->common_irq_installed = 1; 768 781 } 769 782 770 #ifdef CONFIG_MACH_IPMATE771 set_irq_type(_lmdev->irq, IRQT_LOW);772 #endif773 774 783 /* 775 784 * Initialize the DWC_otg core. 776 785 */ 777 dwc_otg_core_init( dwc_otg_device->core_if);786 dwc_otg_core_init(dwc_otg_device->core_if); 778 787 779 788 #ifndef DWC_HOST_ONLY … … 781 790 * Initialize the PCD 782 791 */ 783 retval = dwc_otg_pcd_init( _lmdev ); 784 if (retval != 0) 785 { 792 retval = dwc_otg_pcd_init(lmdev); 793 if (retval != 0) { 786 794 DWC_ERROR("dwc_otg_pcd_init failed\n"); 787 795 dwc_otg_device->pcd = NULL; … … 793 801 * Initialize the HCD 794 802 */ 795 retval = dwc_otg_hcd_init(_lmdev); 796 if (retval != 0) 797 { 803 retval = dwc_otg_hcd_init(lmdev); 804 if (retval != 0) { 798 805 DWC_ERROR("dwc_otg_hcd_init failed\n"); 799 806 dwc_otg_device->hcd = NULL; … … 806 813 * handlers are installed. 807 814 */ 808 dwc_otg_enable_global_interrupts( dwc_otg_device->core_if);815 dwc_otg_enable_global_interrupts(dwc_otg_device->core_if); 809 816 810 817 return 0; 811 818 812 819 fail: 813 dwc_otg_driver_remove( _lmdev);820 dwc_otg_driver_remove(lmdev); 814 821 return retval; 815 822 } 816 823 817 /** 824 /** 818 825 * This structure defines the methods to be called by a bus driver 819 826 * during the lifecycle of a device on that bus. Both drivers and … … 826 833 * unregistered with the bus driver. 827 834 */ 828 static struct lm_driver dwc_otg_driver = 829 { 830 .drv = 831 { 832 . name = (char*)dwc_driver_name, 833 }, 835 static struct lm_driver dwc_otg_driver = { 836 .drv = { 837 .name = (char *)dwc_driver_name, 838 }, 834 839 .probe = dwc_otg_driver_probe, 835 840 .remove = dwc_otg_driver_remove, 836 841 }; 837 842 #define RALINK_PIO_BASE 0xA0300600 843 844 #define RALINK_PRGIO_ADDR RALINK_PIO_BASE // Programmable I/O 845 846 #define RALINK_REG_PIOINT (RALINK_PRGIO_ADDR + 0) 847 #define RALINK_REG_PIOEDGE (RALINK_PRGIO_ADDR + 0x04) 848 #define RALINK_REG_PIORENA (RALINK_PRGIO_ADDR + 0x08) 849 #define RALINK_REG_PIOFENA (RALINK_PRGIO_ADDR + 0x0C) 850 #define RALINK_REG_PIODATA (RALINK_PRGIO_ADDR + 0x20) 851 #define RALINK_REG_PIODIR (RALINK_PRGIO_ADDR + 0x24) 852 #define RALINK_REG_PIOSET (RALINK_PRGIO_ADDR + 0x2C) 853 #define RALINK_REG_PIORESET (RALINK_PRGIO_ADDR + 0x30) 854 855 void ralink_gpio_control(int gpio,int level) 856 { 857 unsigned long piodir,piodata; 858 859 piodir = le32_to_cpu(*(volatile u32 *)(RALINK_REG_PIODIR)); 860 piodir |= (1L << gpio); 861 *(volatile u32 *)(RALINK_REG_PIODIR) = cpu_to_le32(piodir); 862 piodata = le32_to_cpu(*(volatile u32 *)(RALINK_REG_PIODATA)); 863 864 if(level) 865 piodata |= (1L << gpio); 866 else 867 piodata &= ~(1L << gpio); 868 869 *(volatile u32 *)(RALINK_REG_PIODATA) = cpu_to_le32(piodata); 870 } 838 871 839 872 /** … … 847 880 * @return 848 881 */ 849 static int __init dwc_otg_driver_init(void) 882 static int __init dwc_otg_driver_init(void) 850 883 { 851 884 int retval = 0; 852 885 struct lm_device *lmdev; 853 886 int error; 887 854 888 *(unsigned long *)(KSEG1ADDR(RALINK_USB_OTG_BASE+0xE00)) = 0x0; //Enable USB Port 855 889 ralink_gpio_control(6,1); // turn on 5V 856 890 lmdev = kzalloc(sizeof(struct lm_device), GFP_KERNEL); 857 858 891 if (!lmdev) 859 892 { … … 871 904 printk(KERN_INFO "%s: version %s\n", dwc_driver_name, DWC_DRIVER_VERSION); 872 905 retval = lm_driver_register(&dwc_otg_driver); 873 if (retval < 0) 874 { 906 if (retval < 0) { 875 907 printk(KERN_ERR "%s retval=%d\n", __func__, retval); 876 908 return retval; 877 909 } 878 driver_create_file(&dwc_otg_driver.drv, &driver_attr_version);879 driver_create_file(&dwc_otg_driver.drv, &driver_attr_debuglevel);910 error = driver_create_file(&dwc_otg_driver.drv, &driver_attr_version); 911 error = driver_create_file(&dwc_otg_driver.drv, &driver_attr_debuglevel); 880 912 881 913 return retval; … … 883 915 module_init(dwc_otg_driver_init); 884 916 885 /** 917 /** 886 918 * This function is called when the driver is removed from the kernel 887 919 * with the rmmod command. The driver unregisters itself with its bus … … 897 929 898 930 lm_driver_unregister(&dwc_otg_driver); 899 931 ralink_gpio_control(6,0); // turn off 5V 900 932 *(unsigned long *)(KSEG1ADDR(RALINK_USB_OTG_BASE+0xE00)) = 0xF; //Disable USB Port 901 933 printk(KERN_INFO "%s module removed\n", dwc_driver_name); … … 913 945 module_param_named(dma_enable, dwc_otg_module_params.dma_enable, int, 0444); 914 946 MODULE_PARM_DESC(dma_enable, "DMA Mode 0=Slave 1=DMA enabled"); 947 948 module_param_named(dma_desc_enable, dwc_otg_module_params.dma_desc_enable, int, 0444); 949 MODULE_PARM_DESC(dma_desc_enable, "DMA Desc Mode 0=Address DMA 1=DMA Descriptor enabled"); 950 915 951 module_param_named(dma_burst_size, dwc_otg_module_params.dma_burst_size, int, 0444); 916 952 MODULE_PARM_DESC(dma_burst_size, "DMA Burst Size 1, 4, 8, 16, 32, 64, 128, 256"); … … 1030 1066 module_param_named(rx_thr_length, dwc_otg_module_params.rx_thr_length, int, 0444); 1031 1067 MODULE_PARM_DESC(rx_thr_length, "Rx Threshold length in 32 bit DWORDs"); 1068 1069 module_param_named(pti_enable, dwc_otg_module_params.pti_enable, int, 0444); 1070 MODULE_PARM_DESC(pti_enable, "Per Transfer Interrupt mode 0=disabled 1=enabled"); 1071 1072 module_param_named(mpi_enable, dwc_otg_module_params.mpi_enable, int, 0444); 1073 MODULE_PARM_DESC(mpi_enable, "Multiprocessor Interrupt mode 0=disabled 1=enabled"); 1074 1032 1075 /** @page "Module Parameters" 1033 1076 * 1034 1077 * The following parameters may be specified when starting the module. 1035 1078 * These parameters define how the DWC_otg controller should be 1036 * configured. Parameter values are passed to the CIL initialization1079 * configured. Parameter values are passed to the CIL initialization 1037 1080 * function dwc_otg_cil_init 1038 1081 * 1039 1082 * Example: <code>modprobe dwc_otg speed=1 otg_cap=1</code> 1040 1083 * 1041 1084 1042 1085 <table> 1043 <tr><td>Parameter Name</td><td>Meaning</td></tr> 1044 1086 <tr><td>Parameter Name</td><td>Meaning</td></tr> 1087 1045 1088 <tr> 1046 1089 <td>otg_cap</td> … … 1051 1094 - 2: No HNP/SRP capable 1052 1095 </td></tr> 1053 1096 1054 1097 <tr> 1055 1098 <td>dma_enable</td> … … 1060 1103 - 1: DMA (default, if available) 1061 1104 </td></tr> 1062 1105 1063 1106 <tr> 1064 1107 <td>dma_burst_size</td> … … 1066 1109 - Values: 1, 4, 8 16, 32, 64, 128, 256 (default 32) 1067 1110 </td></tr> 1068 1111 1069 1112 <tr> 1070 1113 <td>speed</td> … … 1075 1118 - 1: Full Speed 1076 1119 </td></tr> 1077 1120 1078 1121 <tr> 1079 1122 <td>host_support_fs_ls_low_power</td> … … 1083 1126 - 1: Support low power mode 1084 1127 </td></tr> 1085 1128 1086 1129 <tr> 1087 1130 <td>host_ls_low_power_phy_clk</td> … … 1092 1135 - 1: 6 MHz 1093 1136 </td></tr> 1094 1137 1095 1138 <tr> 1096 1139 <td>enable_dynamic_fifo</td> … … 1099 1142 - 1: Allow dynamic FIFO sizing (default) 1100 1143 </td></tr> 1101 1144 1102 1145 <tr> 1103 1146 <td>data_fifo_size</td> … … 1108 1151 Note: The total FIFO memory depth in the FPGA configuration is 8192. 1109 1152 </td></tr> 1110 1153 1111 1154 <tr> 1112 1155 <td>dev_rx_fifo_size</td> … … 1115 1158 - Values: 16 to 32768 (default 1064) 1116 1159 </td></tr> 1117 1160 1118 1161 <tr> 1119 1162 <td>dev_nperio_tx_fifo_size</td> … … 1122 1165 - Values: 16 to 32768 (default 1024) 1123 1166 </td></tr> 1124 1167 1125 1168 <tr> 1126 1169 <td>dev_perio_tx_fifo_size_n (n = 1 to 15)</td> … … 1129 1172 - Values: 4 to 768 (default 256) 1130 1173 </td></tr> 1131 1174 1132 1175 <tr> 1133 1176 <td>host_rx_fifo_size</td> … … 1136 1179 - Values: 16 to 32768 (default 1024) 1137 1180 </td></tr> 1138 1181 1139 1182 <tr> 1140 1183 <td>host_nperio_tx_fifo_size</td> … … 1143 1186 - Values: 16 to 32768 (default 1024) 1144 1187 </td></tr> 1145 1188 1146 1189 <tr> 1147 1190 <td>host_perio_tx_fifo_size</td> … … 1150 1193 - Values: 16 to 32768 (default 1024) 1151 1194 </td></tr> 1152 1195 1153 1196 <tr> 1154 1197 <td>max_transfer_size</td> … … 1156 1199 - Values: 2047 to 65,535 (default 65,535) 1157 1200 </td></tr> 1158 1201 1159 1202 <tr> 1160 1203 <td>max_packet_count</td> … … 1162 1205 - Values: 15 to 511 (default 511) 1163 1206 </td></tr> 1164 1207 1165 1208 <tr> 1166 1209 <td>host_channels</td> … … 1170 1213 Note: The FPGA configuration supports a maximum of 12 host channels. 1171 1214 </td></tr> 1172 1215 1173 1216 <tr> 1174 1217 <td>dev_endpoints</td> … … 1180 1223 addition to EP0. 1181 1224 </td></tr> 1182 1225 1183 1226 <tr> 1184 1227 <td>phy_type</td> … … 1189 1232 - 2: ULPI 1190 1233 </td></tr> 1191 1234 1192 1235 <tr> 1193 1236 <td>phy_utmi_width</td> … … 1198 1241 - Values: 8 or 16 bits (default 16) 1199 1242 </td></tr> 1200 1243 1201 1244 <tr> 1202 1245 <td>phy_ulpi_ddr</td>
