350-MIPS-BCM63XX-support-settings-num-usbh-ports.patch 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. --- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
  2. +++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
  3. @@ -41,6 +41,7 @@ struct board_info {
  4. /* USB config */
  5. struct bcm63xx_usbd_platform_data usbd;
  6. + unsigned int num_usbh_ports:2;
  7. /* DSP config */
  8. struct bcm63xx_dsp_platform_data dsp;
  9. --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h
  10. +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h
  11. @@ -1,6 +1,6 @@
  12. #ifndef BCM63XX_DEV_USB_EHCI_H_
  13. #define BCM63XX_DEV_USB_EHCI_H_
  14. -int bcm63xx_ehci_register(void);
  15. +int bcm63xx_ehci_register(unsigned int num_ports);
  16. #endif /* BCM63XX_DEV_USB_EHCI_H_ */
  17. --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h
  18. +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h
  19. @@ -1,6 +1,6 @@
  20. #ifndef BCM63XX_DEV_USB_OHCI_H_
  21. #define BCM63XX_DEV_USB_OHCI_H_
  22. -int bcm63xx_ohci_register(void);
  23. +int bcm63xx_ohci_register(unsigned int num_ports);
  24. #endif /* BCM63XX_DEV_USB_OHCI_H_ */
  25. --- a/arch/mips/bcm63xx/boards/board_common.c
  26. +++ b/arch/mips/bcm63xx/boards/board_common.c
  27. @@ -167,6 +167,8 @@ static struct platform_device bcm63xx_gp
  28. */
  29. int __init board_register_devices(void)
  30. {
  31. + int usbh_ports = 0;
  32. +
  33. if (board.has_uart0)
  34. bcm63xx_uart_register(0);
  35. @@ -188,14 +190,21 @@ int __init board_register_devices(void)
  36. !board_get_mac_address(board.enetsw.mac_addr))
  37. bcm63xx_enetsw_register(&board.enetsw);
  38. + if ((board.has_ohci0 || board.has_ehci0)) {
  39. + usbh_ports = board.num_usbh_ports;
  40. +
  41. + if (!usbh_ports || WARN_ON(usbh_ports > 1 && board.has_usbd))
  42. + usbh_ports = 1;
  43. + }
  44. +
  45. if (board.has_usbd)
  46. bcm63xx_usbd_register(&board.usbd);
  47. if (board.has_ehci0)
  48. - bcm63xx_ehci_register();
  49. + bcm63xx_ehci_register(usbh_ports);
  50. if (board.has_ohci0)
  51. - bcm63xx_ohci_register();
  52. + bcm63xx_ohci_register(usbh_ports);
  53. if (board.has_dsp)
  54. bcm63xx_dsp_register(&board.dsp);
  55. --- a/arch/mips/bcm63xx/dev-usb-ehci.c
  56. +++ b/arch/mips/bcm63xx/dev-usb-ehci.c
  57. @@ -79,12 +79,14 @@ static struct platform_device bcm63xx_eh
  58. },
  59. };
  60. -int __init bcm63xx_ehci_register(void)
  61. +int __init bcm63xx_ehci_register(unsigned int num_ports)
  62. {
  63. if (!BCMCPU_IS_6318() && !BCMCPU_IS_6328() && !BCMCPU_IS_6358() &&
  64. !BCMCPU_IS_6362() && !BCMCPU_IS_6368() && !BCMCPU_IS_63268())
  65. return 0;
  66. + bcm63xx_ehci_pdata.num_ports = num_ports;
  67. +
  68. ehci_resources[0].start = bcm63xx_regset_address(RSET_EHCI0);
  69. ehci_resources[0].end = ehci_resources[0].start;
  70. ehci_resources[0].end += RSET_EHCI_SIZE - 1;
  71. --- a/arch/mips/bcm63xx/dev-usb-ohci.c
  72. +++ b/arch/mips/bcm63xx/dev-usb-ohci.c
  73. @@ -62,7 +62,6 @@ static struct usb_ohci_pdata bcm63xx_ohc
  74. .big_endian_desc = 1,
  75. .big_endian_mmio = 1,
  76. .no_big_frame_no = 1,
  77. - .num_ports = 1,
  78. .power_on = bcm63xx_ohci_power_on,
  79. .power_off = bcm63xx_ohci_power_off,
  80. .power_suspend = bcm63xx_ohci_power_off,
  81. @@ -80,11 +79,13 @@ static struct platform_device bcm63xx_oh
  82. },
  83. };
  84. -int __init bcm63xx_ohci_register(void)
  85. +int __init bcm63xx_ohci_register(unsigned int num_ports)
  86. {
  87. if (BCMCPU_IS_6345() || BCMCPU_IS_6338())
  88. return -ENODEV;
  89. + bcm63xx_ohci_pdata.num_ports = num_ports;
  90. +
  91. ohci_resources[0].start = bcm63xx_regset_address(RSET_OHCI0);
  92. ohci_resources[0].end = ohci_resources[0].start;
  93. ohci_resources[0].end += RSET_OHCI_SIZE - 1;