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 {
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 @@ -167,6 +167,8 @@ static struct platform_device bcm63xx_gp
35 int __init board_register_devices(void)
40 bcm63xx_uart_register(0);
42 @@ -188,14 +190,21 @@ int __init board_register_devices(void)
43 !board_get_mac_address(board.enetsw.mac_addr))
44 bcm63xx_enetsw_register(&board.enetsw);
46 + if ((board.has_ohci0 || board.has_ehci0)) {
47 + usbh_ports = board.num_usbh_ports;
49 + if (!usbh_ports || WARN_ON(usbh_ports > 1 && board.has_usbd))
54 bcm63xx_usbd_register(&board.usbd);
57 - bcm63xx_ehci_register();
58 + bcm63xx_ehci_register(usbh_ports);
61 - bcm63xx_ohci_register();
62 + bcm63xx_ohci_register(usbh_ports);
65 bcm63xx_dsp_register(&board.dsp);
66 --- a/arch/mips/bcm63xx/dev-usb-ehci.c
67 +++ b/arch/mips/bcm63xx/dev-usb-ehci.c
68 @@ -79,12 +79,14 @@ static struct platform_device bcm63xx_eh
72 -int __init bcm63xx_ehci_register(void)
73 +int __init bcm63xx_ehci_register(unsigned int num_ports)
75 if (!BCMCPU_IS_6318() && !BCMCPU_IS_6328() && !BCMCPU_IS_6358() &&
76 !BCMCPU_IS_6362() && !BCMCPU_IS_6368() && !BCMCPU_IS_63268())
79 + bcm63xx_ehci_pdata.num_ports = num_ports;
81 ehci_resources[0].start = bcm63xx_regset_address(RSET_EHCI0);
82 ehci_resources[0].end = ehci_resources[0].start;
83 ehci_resources[0].end += RSET_EHCI_SIZE - 1;
84 --- a/arch/mips/bcm63xx/dev-usb-ohci.c
85 +++ b/arch/mips/bcm63xx/dev-usb-ohci.c
86 @@ -62,7 +62,6 @@ static struct usb_ohci_pdata bcm63xx_ohc
91 .power_on = bcm63xx_ohci_power_on,
92 .power_off = bcm63xx_ohci_power_off,
93 .power_suspend = bcm63xx_ohci_power_off,
94 @@ -80,11 +79,13 @@ static struct platform_device bcm63xx_oh
98 -int __init bcm63xx_ohci_register(void)
99 +int __init bcm63xx_ohci_register(unsigned int num_ports)
101 if (BCMCPU_IS_6345() || BCMCPU_IS_6338())
104 + bcm63xx_ohci_pdata.num_ports = num_ports;
106 ohci_resources[0].start = bcm63xx_regset_address(RSET_OHCI0);
107 ohci_resources[0].end = ohci_resources[0].start;
108 ohci_resources[0].end += RSET_OHCI_SIZE - 1;