Commit 336b2f2069f58f8543005a1e39a563a7d7c696c0
1 parent
8014dc9022
Exists in
smarc_8mm-imx_v2019.04_4.19.35_1.1.0
and in
1 other branch
MLK-22045-6 imx8qm/qxp: Delete the Non-DM USB board level codes
Since now we use DM USB gadget driver, Some parts of the Non-DM USB gadget driver codes are not needed, so delete the Non-DM USB board level codes on imx8 platform. Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Showing 4 changed files with 2 additions and 325 deletions Side-by-side Diff
board/freescale/imx8qm_arm2/imx8qm_arm2.c
... | ... | @@ -481,99 +481,6 @@ |
481 | 481 | } |
482 | 482 | #endif |
483 | 483 | |
484 | -#ifdef CONFIG_USB_CDNS3_GADGET | |
485 | - | |
486 | -static struct cdns3_device cdns3_device_data = { | |
487 | - .none_core_base = 0x5B110000, | |
488 | - .xhci_base = 0x5B130000, | |
489 | - .dev_base = 0x5B140000, | |
490 | - .phy_base = 0x5B160000, | |
491 | - .otg_base = 0x5B120000, | |
492 | - .dr_mode = USB_DR_MODE_PERIPHERAL, | |
493 | - .index = 1, | |
494 | -}; | |
495 | - | |
496 | -int usb_gadget_handle_interrupts(int index) | |
497 | -{ | |
498 | - cdns3_uboot_handle_interrupt(index); | |
499 | - return 0; | |
500 | -} | |
501 | - | |
502 | -int board_usb_init(int index, enum usb_init_type init) | |
503 | -{ | |
504 | - int ret = 0; | |
505 | - | |
506 | - if (index == 1) { | |
507 | - if (init == USB_INIT_DEVICE) { | |
508 | -#ifdef CONFIG_SPL_BUILD | |
509 | - ret = sc_pm_set_resource_power_mode(-1, SC_R_USB_2, SC_PM_PW_MODE_ON); | |
510 | - if (ret != SC_ERR_NONE) | |
511 | - printf("conn_usb2 Power up failed! (error = %d)\n", ret); | |
512 | - | |
513 | - ret = sc_pm_set_resource_power_mode(-1, SC_R_USB_2_PHY, SC_PM_PW_MODE_ON); | |
514 | - if (ret != SC_ERR_NONE) | |
515 | - printf("conn_usb2_phy Power up failed! (error = %d)\n", ret); | |
516 | -#else | |
517 | - struct power_domain pd; | |
518 | - | |
519 | - if (!power_domain_lookup_name("conn_usb2_phy", &pd)) { | |
520 | - ret = power_domain_on(&pd); | |
521 | - if (ret) | |
522 | - printf("conn_usb2_phy Power up failed! (error = %d)\n", ret); | |
523 | - } | |
524 | - | |
525 | - /* Power on usb */ | |
526 | - if (!power_domain_lookup_name("conn_usb2", &pd)) { | |
527 | - ret = power_domain_on(&pd); | |
528 | - if (ret) | |
529 | - printf("conn_usb2 Power up failed! (error = %d)\n", ret); | |
530 | - } | |
531 | -#endif | |
532 | - ret = cdns3_uboot_init(&cdns3_device_data); | |
533 | - printf("%d cdns3_uboot_initmode %d\n", index, ret); | |
534 | - } | |
535 | - } | |
536 | - return ret; | |
537 | -} | |
538 | - | |
539 | -int board_usb_cleanup(int index, enum usb_init_type init) | |
540 | -{ | |
541 | - int ret = 0; | |
542 | - | |
543 | - if (index == 1) { | |
544 | - if (init == USB_INIT_DEVICE) { | |
545 | - cdns3_uboot_exit(1); | |
546 | - | |
547 | -#ifdef CONFIG_SPL_BUILD | |
548 | - ret = sc_pm_set_resource_power_mode(-1, SC_R_USB_2, SC_PM_PW_MODE_OFF); | |
549 | - if (ret != SC_ERR_NONE) | |
550 | - printf("conn_usb2 Power down failed! (error = %d)\n", ret); | |
551 | - | |
552 | - ret = sc_pm_set_resource_power_mode(-1, SC_R_USB_2_PHY, SC_PM_PW_MODE_OFF); | |
553 | - if (ret != SC_ERR_NONE) | |
554 | - printf("conn_usb2_phy Power down failed! (error = %d)\n", ret); | |
555 | -#else | |
556 | - struct power_domain pd; | |
557 | - | |
558 | - /* Power off usb */ | |
559 | - if (!power_domain_lookup_name("conn_usb2_phy", &pd)) { | |
560 | - ret = power_domain_off(&pd); | |
561 | - if (ret) | |
562 | - printf("conn_usb2_phy Power down failed! (error = %d)\n", ret); | |
563 | - } | |
564 | - | |
565 | - if (!power_domain_lookup_name("conn_usb2", &pd)) { | |
566 | - ret = power_domain_off(&pd); | |
567 | - if (ret) | |
568 | - printf("conn_usb2 Power down failed! (error = %d)\n", ret); | |
569 | - } | |
570 | -#endif | |
571 | - } | |
572 | - } | |
573 | - return ret; | |
574 | -} | |
575 | -#endif | |
576 | - | |
577 | 484 | int board_init(void) |
578 | 485 | { |
579 | 486 | board_gpio_init(); |
board/freescale/imx8qm_mek/imx8qm_mek.c
... | ... | @@ -318,24 +318,6 @@ |
318 | 318 | } |
319 | 319 | #endif |
320 | 320 | |
321 | -#ifdef CONFIG_USB_CDNS3_GADGET | |
322 | -static struct cdns3_device cdns3_device_data = { | |
323 | - .none_core_base = 0x5B110000, | |
324 | - .xhci_base = 0x5B130000, | |
325 | - .dev_base = 0x5B140000, | |
326 | - .phy_base = 0x5B160000, | |
327 | - .otg_base = 0x5B120000, | |
328 | - .dr_mode = USB_DR_MODE_PERIPHERAL, | |
329 | - .index = 1, | |
330 | -}; | |
331 | - | |
332 | -int usb_gadget_handle_interrupts(int index) | |
333 | -{ | |
334 | - cdns3_uboot_handle_interrupt(index); | |
335 | - return 0; | |
336 | -} | |
337 | -#endif | |
338 | - | |
339 | 321 | int board_usb_init(int index, enum usb_init_type init) |
340 | 322 | { |
341 | 323 | int ret = 0; |
342 | 324 | |
... | ... | @@ -347,39 +329,10 @@ |
347 | 329 | #endif |
348 | 330 | #ifdef CONFIG_USB_CDNS3_GADGET |
349 | 331 | } else { |
350 | -#ifdef CONFIG_SPL_BUILD | |
351 | - ret = sc_pm_set_resource_power_mode(-1, SC_R_USB_2, SC_PM_PW_MODE_ON); | |
352 | - if (ret != SC_ERR_NONE) | |
353 | - printf("conn_usb2 Power up failed! (error = %d)\n", ret); | |
354 | - | |
355 | - ret = sc_pm_set_resource_power_mode(-1, SC_R_USB_2_PHY, SC_PM_PW_MODE_ON); | |
356 | - if (ret != SC_ERR_NONE) | |
357 | - printf("conn_usb2_phy Power up failed! (error = %d)\n", ret); | |
358 | -#else | |
359 | - struct power_domain pd; | |
360 | - int ret; | |
361 | - | |
362 | - if (!power_domain_lookup_name("conn_usb2_phy", &pd)) { | |
363 | - ret = power_domain_on(&pd); | |
364 | - if (ret) | |
365 | - printf("conn_usb2_phy Power up failed! (error = %d)\n", ret); | |
366 | - } | |
367 | - | |
368 | - /* Power on usb */ | |
369 | - if (!power_domain_lookup_name("conn_usb2", &pd)) { | |
370 | - ret = power_domain_on(&pd); | |
371 | - if (ret) | |
372 | - printf("conn_usb2 Power up failed! (error = %d)\n", ret); | |
373 | - } | |
374 | -#endif | |
375 | - | |
376 | 332 | #ifdef CONFIG_USB_TCPC |
377 | 333 | ret = tcpc_setup_ufp_mode(&port); |
378 | 334 | printf("%d setufp mode %d\n", index, ret); |
379 | 335 | #endif |
380 | - | |
381 | - ret = cdns3_uboot_init(&cdns3_device_data); | |
382 | - printf("%d cdns3_uboot_initmode %d\n", index, ret); | |
383 | 336 | #endif |
384 | 337 | } |
385 | 338 | } |
... | ... | @@ -396,36 +349,6 @@ |
396 | 349 | if (init == USB_INIT_HOST) { |
397 | 350 | #ifdef CONFIG_USB_TCPC |
398 | 351 | ret = tcpc_disable_src_vbus(&port); |
399 | -#endif | |
400 | -#ifdef CONFIG_USB_CDNS3_GADGET | |
401 | - } else { | |
402 | - cdns3_uboot_exit(1); | |
403 | - | |
404 | -#ifdef CONFIG_SPL_BUILD | |
405 | - ret = sc_pm_set_resource_power_mode(-1, SC_R_USB_2, SC_PM_PW_MODE_OFF); | |
406 | - if (ret != SC_ERR_NONE) | |
407 | - printf("conn_usb2 Power down failed! (error = %d)\n", ret); | |
408 | - | |
409 | - ret = sc_pm_set_resource_power_mode(-1, SC_R_USB_2_PHY, SC_PM_PW_MODE_OFF); | |
410 | - if (ret != SC_ERR_NONE) | |
411 | - printf("conn_usb2_phy Power down failed! (error = %d)\n", ret); | |
412 | -#else | |
413 | - struct power_domain pd; | |
414 | - int ret; | |
415 | - | |
416 | - /* Power off usb */ | |
417 | - if (!power_domain_lookup_name("conn_usb2_phy", &pd)) { | |
418 | - ret = power_domain_off(&pd); | |
419 | - if (ret) | |
420 | - printf("conn_usb2_phy Power down failed! (error = %d)\n", ret); | |
421 | - } | |
422 | - | |
423 | - if (!power_domain_lookup_name("conn_usb2", &pd)) { | |
424 | - ret = power_domain_off(&pd); | |
425 | - if (ret) | |
426 | - printf("conn_usb2 Power down failed! (error = %d)\n", ret); | |
427 | - } | |
428 | -#endif | |
429 | 352 | #endif |
430 | 353 | } |
431 | 354 | } |
board/freescale/imx8qxp_arm2/imx8qxp_arm2.c
... | ... | @@ -492,60 +492,13 @@ |
492 | 492 | |
493 | 493 | #endif |
494 | 494 | |
495 | -#if defined(CONFIG_USB_CDNS3_GADGET) | |
496 | - | |
497 | -static struct cdns3_device cdns3_device_data = { | |
498 | - .none_core_base = 0x5B110000, | |
499 | - .xhci_base = 0x5B130000, | |
500 | - .dev_base = 0x5B140000, | |
501 | - .phy_base = 0x5B160000, | |
502 | - .otg_base = 0x5B120000, | |
503 | - .dr_mode = USB_DR_MODE_PERIPHERAL, | |
504 | - .index = 1, | |
505 | -}; | |
506 | - | |
507 | -int usb_gadget_handle_interrupts(int index) | |
508 | -{ | |
509 | - cdns3_uboot_handle_interrupt(index); | |
510 | - return 0; | |
511 | -} | |
512 | - | |
513 | 495 | int board_usb_init(int index, enum usb_init_type init) |
514 | 496 | { |
515 | 497 | int ret = 0; |
516 | 498 | |
517 | - if (index == 1) { | |
499 | + if (index == 0) { | |
518 | 500 | if (init == USB_INIT_DEVICE) { |
519 | 501 | #ifdef CONFIG_SPL_BUILD |
520 | - ret = sc_pm_set_resource_power_mode(-1, SC_R_USB_2, SC_PM_PW_MODE_ON); | |
521 | - if (ret != SC_ERR_NONE) | |
522 | - printf("conn_usb2 Power up failed! (error = %d)\n", ret); | |
523 | - | |
524 | - ret = sc_pm_set_resource_power_mode(-1, SC_R_USB_2_PHY, SC_PM_PW_MODE_ON); | |
525 | - if (ret != SC_ERR_NONE) | |
526 | - printf("conn_usb2_phy Power up failed! (error = %d)\n", ret); | |
527 | -#else | |
528 | - struct power_domain pd; | |
529 | - | |
530 | - if (!power_domain_lookup_name("conn_usb2_phy", &pd)) { | |
531 | - ret = power_domain_on(&pd); | |
532 | - if (ret) | |
533 | - printf("conn_usb2_phy Power up failed! (error = %d)\n", ret); | |
534 | - } | |
535 | - | |
536 | - /* Power on usb */ | |
537 | - if (!power_domain_lookup_name("conn_usb2", &pd)) { | |
538 | - ret = power_domain_on(&pd); | |
539 | - if (ret) | |
540 | - printf("conn_usb2 Power up failed! (error = %d)\n", ret); | |
541 | - } | |
542 | -#endif | |
543 | - ret = cdns3_uboot_init(&cdns3_device_data); | |
544 | - printf("%d cdns3_uboot_initmode %d\n", index, ret); | |
545 | - } | |
546 | - } else if (index == 0) { | |
547 | - if (init == USB_INIT_DEVICE) { | |
548 | -#ifdef CONFIG_SPL_BUILD | |
549 | 502 | ret = sc_pm_set_resource_power_mode(-1, SC_R_USB_0, SC_PM_PW_MODE_ON); |
550 | 503 | if (ret != SC_ERR_NONE) |
551 | 504 | printf("conn_usb0 Power up failed! (error = %d)\n", ret); |
552 | 505 | |
553 | 506 | |
... | ... | @@ -563,37 +516,9 @@ |
563 | 516 | { |
564 | 517 | int ret = 0; |
565 | 518 | |
566 | - if (index == 1) { | |
519 | + if (index == 0) { | |
567 | 520 | if (init == USB_INIT_DEVICE) { |
568 | - cdns3_uboot_exit(1); | |
569 | 521 | #ifdef CONFIG_SPL_BUILD |
570 | - ret = sc_pm_set_resource_power_mode(-1, SC_R_USB_2, SC_PM_PW_MODE_OFF); | |
571 | - if (ret != SC_ERR_NONE) | |
572 | - printf("conn_usb2 Power down failed! (error = %d)\n", ret); | |
573 | - | |
574 | - ret = sc_pm_set_resource_power_mode(-1, SC_R_USB_2_PHY, SC_PM_PW_MODE_OFF); | |
575 | - if (ret != SC_ERR_NONE) | |
576 | - printf("conn_usb2_phy Power down failed! (error = %d)\n", ret); | |
577 | -#else | |
578 | - struct power_domain pd; | |
579 | - | |
580 | - /* Power off usb */ | |
581 | - if (!power_domain_lookup_name("conn_usb2_phy", &pd)) { | |
582 | - ret = power_domain_off(&pd); | |
583 | - if (ret) | |
584 | - printf("conn_usb2_phy Power down failed! (error = %d)\n", ret); | |
585 | - } | |
586 | - | |
587 | - if (!power_domain_lookup_name("conn_usb2", &pd)) { | |
588 | - ret = power_domain_off(&pd); | |
589 | - if (ret) | |
590 | - printf("conn_usb2 Power down failed! (error = %d)\n", ret); | |
591 | - } | |
592 | -#endif | |
593 | - } | |
594 | - } else if (index == 0) { | |
595 | - if (init == USB_INIT_DEVICE) { | |
596 | -#ifdef CONFIG_SPL_BUILD | |
597 | 522 | ret = sc_pm_set_resource_power_mode(-1, SC_R_USB_0, SC_PM_PW_MODE_OFF); |
598 | 523 | if (ret != SC_ERR_NONE) |
599 | 524 | printf("conn_usb0 Power down failed! (error = %d)\n", ret); |
... | ... | @@ -606,7 +531,6 @@ |
606 | 531 | } |
607 | 532 | return ret; |
608 | 533 | } |
609 | -#endif | |
610 | 534 | |
611 | 535 | int board_init(void) |
612 | 536 | { |
board/freescale/imx8qxp_mek/imx8qxp_mek.c
... | ... | @@ -329,24 +329,6 @@ |
329 | 329 | } |
330 | 330 | #endif |
331 | 331 | |
332 | -#ifdef CONFIG_USB_CDNS3_GADGET | |
333 | -static struct cdns3_device cdns3_device_data = { | |
334 | - .none_core_base = 0x5B110000, | |
335 | - .xhci_base = 0x5B130000, | |
336 | - .dev_base = 0x5B140000, | |
337 | - .phy_base = 0x5B160000, | |
338 | - .otg_base = 0x5B120000, | |
339 | - .dr_mode = USB_DR_MODE_PERIPHERAL, | |
340 | - .index = 1, | |
341 | -}; | |
342 | - | |
343 | -int usb_gadget_handle_interrupts(int index) | |
344 | -{ | |
345 | - cdns3_uboot_handle_interrupt(index); | |
346 | - return 0; | |
347 | -} | |
348 | -#endif | |
349 | - | |
350 | 332 | int board_usb_init(int index, enum usb_init_type init) |
351 | 333 | { |
352 | 334 | int ret = 0; |
353 | 335 | |
... | ... | @@ -358,39 +340,10 @@ |
358 | 340 | #endif |
359 | 341 | #ifdef CONFIG_USB_CDNS3_GADGET |
360 | 342 | } else { |
361 | -#ifdef CONFIG_SPL_BUILD | |
362 | - ret = sc_pm_set_resource_power_mode(-1, SC_R_USB_2, SC_PM_PW_MODE_ON); | |
363 | - if (ret != SC_ERR_NONE) | |
364 | - printf("conn_usb2 Power up failed! (error = %d)\n", ret); | |
365 | - | |
366 | - ret = sc_pm_set_resource_power_mode(-1, SC_R_USB_2_PHY, SC_PM_PW_MODE_ON); | |
367 | - if (ret != SC_ERR_NONE) | |
368 | - printf("conn_usb2_phy Power up failed! (error = %d)\n", ret); | |
369 | -#else | |
370 | - struct power_domain pd; | |
371 | - int ret; | |
372 | - | |
373 | - if (!power_domain_lookup_name("conn_usb2_phy", &pd)) { | |
374 | - ret = power_domain_on(&pd); | |
375 | - if (ret) | |
376 | - printf("conn_usb2_phy Power up failed! (error = %d)\n", ret); | |
377 | - } | |
378 | - | |
379 | - /* Power on usb */ | |
380 | - if (!power_domain_lookup_name("conn_usb2", &pd)) { | |
381 | - ret = power_domain_on(&pd); | |
382 | - if (ret) | |
383 | - printf("conn_usb2 Power up failed! (error = %d)\n", ret); | |
384 | - } | |
385 | -#endif | |
386 | - | |
387 | 343 | #ifdef CONFIG_USB_TCPC |
388 | 344 | ret = tcpc_setup_ufp_mode(&port); |
389 | 345 | printf("%d setufp mode %d\n", index, ret); |
390 | 346 | #endif |
391 | - | |
392 | - ret = cdns3_uboot_init(&cdns3_device_data); | |
393 | - printf("%d cdns3_uboot_initmode %d\n", index, ret); | |
394 | 347 | #endif |
395 | 348 | } |
396 | 349 | } |
... | ... | @@ -407,36 +360,6 @@ |
407 | 360 | if (init == USB_INIT_HOST) { |
408 | 361 | #ifdef CONFIG_USB_TCPC |
409 | 362 | ret = tcpc_disable_src_vbus(&port); |
410 | -#endif | |
411 | -#ifdef CONFIG_USB_CDNS3_GADGET | |
412 | - } else { | |
413 | - cdns3_uboot_exit(1); | |
414 | - | |
415 | -#ifdef CONFIG_SPL_BUILD | |
416 | - ret = sc_pm_set_resource_power_mode(-1, SC_R_USB_2, SC_PM_PW_MODE_OFF); | |
417 | - if (ret != SC_ERR_NONE) | |
418 | - printf("conn_usb2 Power down failed! (error = %d)\n", ret); | |
419 | - | |
420 | - ret = sc_pm_set_resource_power_mode(-1, SC_R_USB_2_PHY, SC_PM_PW_MODE_OFF); | |
421 | - if (ret != SC_ERR_NONE) | |
422 | - printf("conn_usb2_phy Power down failed! (error = %d)\n", ret); | |
423 | -#else | |
424 | - struct power_domain pd; | |
425 | - int ret; | |
426 | - | |
427 | - /* Power off usb */ | |
428 | - if (!power_domain_lookup_name("conn_usb2_phy", &pd)) { | |
429 | - ret = power_domain_off(&pd); | |
430 | - if (ret) | |
431 | - printf("conn_usb2_phy Power down failed! (error = %d)\n", ret); | |
432 | - } | |
433 | - | |
434 | - if (!power_domain_lookup_name("conn_usb2", &pd)) { | |
435 | - ret = power_domain_off(&pd); | |
436 | - if (ret) | |
437 | - printf("conn_usb2 Power down failed! (error = %d)\n", ret); | |
438 | - } | |
439 | -#endif | |
440 | 363 | #endif |
441 | 364 | } |
442 | 365 | } |