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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. --- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
  2. +++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
  3. @@ -42,6 +42,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. @@ -181,6 +181,7 @@ int __init board_register_devices(void)
  28. {
  29. int button_count = 0;
  30. int led_count = 0;
  31. + int usbh_ports = 0;
  32. if (board.has_uart0)
  33. bcm63xx_uart_register(0);
  34. @@ -203,14 +204,21 @@ int __init board_register_devices(void)
  35. !board_get_mac_address(board.enetsw.mac_addr))
  36. bcm63xx_enetsw_register(&board.enetsw);
  37. + if ((board.has_ohci0 || board.has_ehci0)) {
  38. + usbh_ports = board.num_usbh_ports;
  39. +
  40. + if (!usbh_ports || WARN_ON(usbh_ports > 1 && board.has_usbd))
  41. + usbh_ports = 1;
  42. + }
  43. +
  44. if (board.has_usbd)
  45. bcm63xx_usbd_register(&board.usbd);
  46. if (board.has_ehci0)
  47. - bcm63xx_ehci_register();
  48. + bcm63xx_ehci_register(usbh_ports);
  49. if (board.has_ohci0)
  50. - bcm63xx_ohci_register();
  51. + bcm63xx_ohci_register(usbh_ports);
  52. if (board.has_dsp)
  53. bcm63xx_dsp_register(&board.dsp);
  54. --- a/arch/mips/bcm63xx/dev-usb-ehci.c
  55. +++ b/arch/mips/bcm63xx/dev-usb-ehci.c
  56. @@ -79,12 +79,14 @@ static struct platform_device bcm63xx_eh
  57. },
  58. };
  59. -int __init bcm63xx_ehci_register(void)
  60. +int __init bcm63xx_ehci_register(unsigned int num_ports)
  61. {
  62. if (!BCMCPU_IS_6318() && !BCMCPU_IS_6328() && !BCMCPU_IS_6358() &&
  63. !BCMCPU_IS_6362() && !BCMCPU_IS_6368() && !BCMCPU_IS_63268())
  64. return 0;
  65. + bcm63xx_ehci_pdata.num_ports = num_ports;
  66. +
  67. ehci_resources[0].start = bcm63xx_regset_address(RSET_EHCI0);
  68. ehci_resources[0].end = ehci_resources[0].start;
  69. ehci_resources[0].end += RSET_EHCI_SIZE - 1;
  70. --- a/arch/mips/bcm63xx/dev-usb-ohci.c
  71. +++ b/arch/mips/bcm63xx/dev-usb-ohci.c
  72. @@ -62,7 +62,6 @@ static struct usb_ohci_pdata bcm63xx_ohc
  73. .big_endian_desc = 1,
  74. .big_endian_mmio = 1,
  75. .no_big_frame_no = 1,
  76. - .num_ports = 1,
  77. .power_on = bcm63xx_ohci_power_on,
  78. .power_off = bcm63xx_ohci_power_off,
  79. .power_suspend = bcm63xx_ohci_power_off,
  80. @@ -80,11 +79,13 @@ static struct platform_device bcm63xx_oh
  81. },
  82. };
  83. -int __init bcm63xx_ohci_register(void)
  84. +int __init bcm63xx_ohci_register(unsigned int num_ports)
  85. {
  86. if (BCMCPU_IS_6345() || BCMCPU_IS_6338())
  87. return -ENODEV;
  88. + bcm63xx_ohci_pdata.num_ports = num_ports;
  89. +
  90. ohci_resources[0].start = bcm63xx_regset_address(RSET_OHCI0);
  91. ohci_resources[0].end = ohci_resources[0].start;
  92. ohci_resources[0].end += RSET_OHCI_SIZE - 1;