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 {
6 struct bcm63xx_usbd_platform_data usbd;
7 + unsigned int num_usbh_ports:2;
10 struct bcm63xx_dsp_platform_data dsp;
11 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h
12 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h
14 #ifndef BCM63XX_DEV_USB_EHCI_H_
15 #define BCM63XX_DEV_USB_EHCI_H_
17 -int bcm63xx_ehci_register(void);
18 +int bcm63xx_ehci_register(unsigned int num_ports);
20 #endif /* BCM63XX_DEV_USB_EHCI_H_ */
21 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h
22 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h
24 #ifndef BCM63XX_DEV_USB_OHCI_H_
25 #define BCM63XX_DEV_USB_OHCI_H_
27 -int bcm63xx_ohci_register(void);
28 +int bcm63xx_ohci_register(unsigned int num_ports);
30 #endif /* BCM63XX_DEV_USB_OHCI_H_ */
31 --- a/arch/mips/bcm63xx/boards/board_common.c
32 +++ b/arch/mips/bcm63xx/boards/board_common.c
33 @@ -181,6 +181,7 @@ int __init board_register_devices(void)
40 bcm63xx_uart_register(0);
41 @@ -203,14 +204,21 @@ int __init board_register_devices(void)
42 !board_get_mac_address(board.enetsw.mac_addr))
43 bcm63xx_enetsw_register(&board.enetsw);
45 + if ((board.has_ohci0 || board.has_ehci0)) {
46 + usbh_ports = board.num_usbh_ports;
48 + if (!usbh_ports || WARN_ON(usbh_ports > 1 && board.has_usbd))
53 bcm63xx_usbd_register(&board.usbd);
56 - bcm63xx_ehci_register();
57 + bcm63xx_ehci_register(usbh_ports);
60 - bcm63xx_ohci_register();
61 + bcm63xx_ohci_register(usbh_ports);
64 bcm63xx_dsp_register(&board.dsp);
65 --- a/arch/mips/bcm63xx/dev-usb-ehci.c
66 +++ b/arch/mips/bcm63xx/dev-usb-ehci.c
67 @@ -79,12 +79,14 @@ static struct platform_device bcm63xx_eh
71 -int __init bcm63xx_ehci_register(void)
72 +int __init bcm63xx_ehci_register(unsigned int num_ports)
74 if (!BCMCPU_IS_6318() && !BCMCPU_IS_6328() && !BCMCPU_IS_6358() &&
75 !BCMCPU_IS_6362() && !BCMCPU_IS_6368() && !BCMCPU_IS_63268())
78 + bcm63xx_ehci_pdata.num_ports = num_ports;
80 ehci_resources[0].start = bcm63xx_regset_address(RSET_EHCI0);
81 ehci_resources[0].end = ehci_resources[0].start;
82 ehci_resources[0].end += RSET_EHCI_SIZE - 1;
83 --- a/arch/mips/bcm63xx/dev-usb-ohci.c
84 +++ b/arch/mips/bcm63xx/dev-usb-ohci.c
85 @@ -62,7 +62,6 @@ static struct usb_ohci_pdata bcm63xx_ohc
90 .power_on = bcm63xx_ohci_power_on,
91 .power_off = bcm63xx_ohci_power_off,
92 .power_suspend = bcm63xx_ohci_power_off,
93 @@ -80,11 +79,13 @@ static struct platform_device bcm63xx_oh
97 -int __init bcm63xx_ohci_register(void)
98 +int __init bcm63xx_ohci_register(unsigned int num_ports)
100 if (BCMCPU_IS_6345() || BCMCPU_IS_6338())
103 + bcm63xx_ohci_pdata.num_ports = num_ports;
105 ohci_resources[0].start = bcm63xx_regset_address(RSET_OHCI0);
106 ohci_resources[0].end = ohci_resources[0].start;
107 ohci_resources[0].end += RSET_OHCI_SIZE - 1;