OpenWrt – Diff between revs 2 and 3
?pathlinks?
Rev 2 | Rev 3 | |||
---|---|---|---|---|
1 | --- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h |
1 | --- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h |
|
2 | +++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h |
2 | +++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h |
|
3 | @@ -39,6 +39,7 @@ struct board_info { |
3 | @@ -41,6 +41,7 @@ struct board_info { |
|
4 | |
4 | |
|
5 | /* USB config */ |
5 | /* USB config */ |
|
6 | struct bcm63xx_usbd_platform_data usbd; |
6 | struct bcm63xx_usbd_platform_data usbd; |
|
7 | + unsigned int num_usbh_ports:2; |
7 | + unsigned int num_usbh_ports:2; |
|
8 | |
8 | |
|
9 | /* GPIO LEDs */ |
9 | /* DSP config */ |
|
10 | struct gpio_led leds[5]; |
10 | struct bcm63xx_dsp_platform_data dsp; |
|
11 | --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h |
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 |
12 | +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h |
|
13 | @@ -1,6 +1,6 @@ |
13 | @@ -1,6 +1,6 @@ |
|
14 | #ifndef BCM63XX_DEV_USB_EHCI_H_ |
14 | #ifndef BCM63XX_DEV_USB_EHCI_H_ |
|
15 | #define BCM63XX_DEV_USB_EHCI_H_ |
15 | #define BCM63XX_DEV_USB_EHCI_H_ |
|
16 | |
16 | |
|
17 | -int bcm63xx_ehci_register(void); |
17 | -int bcm63xx_ehci_register(void); |
|
18 | +int bcm63xx_ehci_register(unsigned int num_ports); |
18 | +int bcm63xx_ehci_register(unsigned int num_ports); |
|
19 | |
19 | |
|
20 | #endif /* BCM63XX_DEV_USB_EHCI_H_ */ |
20 | #endif /* BCM63XX_DEV_USB_EHCI_H_ */ |
|
21 | --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.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 |
22 | +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h |
|
23 | @@ -1,6 +1,6 @@ |
23 | @@ -1,6 +1,6 @@ |
|
24 | #ifndef BCM63XX_DEV_USB_OHCI_H_ |
24 | #ifndef BCM63XX_DEV_USB_OHCI_H_ |
|
25 | #define BCM63XX_DEV_USB_OHCI_H_ |
25 | #define BCM63XX_DEV_USB_OHCI_H_ |
|
26 | |
26 | |
|
27 | -int bcm63xx_ohci_register(void); |
27 | -int bcm63xx_ohci_register(void); |
|
28 | +int bcm63xx_ohci_register(unsigned int num_ports); |
28 | +int bcm63xx_ohci_register(unsigned int num_ports); |
|
29 | |
29 | |
|
30 | #endif /* BCM63XX_DEV_USB_OHCI_H_ */ |
30 | #endif /* BCM63XX_DEV_USB_OHCI_H_ */ |
|
31 | --- a/arch/mips/bcm63xx/boards/board_common.c |
31 | --- a/arch/mips/bcm63xx/boards/board_common.c |
|
32 | +++ b/arch/mips/bcm63xx/boards/board_common.c |
32 | +++ b/arch/mips/bcm63xx/boards/board_common.c |
|
33 | @@ -165,6 +165,8 @@ static struct platform_device bcm63xx_gp |
33 | @@ -166,6 +166,8 @@ static struct platform_device bcm63xx_gp |
|
34 | */ |
34 | */ |
|
35 | int __init board_register_devices(void) |
35 | int __init board_register_devices(void) |
|
36 | { |
36 | { |
|
37 | + int usbh_ports = 0; |
37 | + int usbh_ports = 0; |
|
38 | + |
38 | + |
|
39 | if (board.has_uart0) |
39 | if (board.has_uart0) |
|
40 | bcm63xx_uart_register(0); |
40 | bcm63xx_uart_register(0); |
|
41 | |
41 | |
|
42 | @@ -186,14 +188,21 @@ int __init board_register_devices(void) |
42 | @@ -187,14 +189,21 @@ int __init board_register_devices(void) |
|
43 | !board_get_mac_address(board.enetsw.mac_addr)) |
43 | !board_get_mac_address(board.enetsw.mac_addr)) |
|
44 | bcm63xx_enetsw_register(&board.enetsw); |
44 | bcm63xx_enetsw_register(&board.enetsw); |
|
45 | |
45 | |
|
46 | + if ((board.has_ohci0 || board.has_ehci0)) { |
46 | + if ((board.has_ohci0 || board.has_ehci0)) { |
|
47 | + usbh_ports = board.num_usbh_ports; |
47 | + usbh_ports = board.num_usbh_ports; |
|
48 | + |
48 | + |
|
49 | + if (!usbh_ports || WARN_ON(usbh_ports > 1 && board.has_usbd)) |
49 | + if (!usbh_ports || WARN_ON(usbh_ports > 1 && board.has_usbd)) |
|
50 | + usbh_ports = 1; |
50 | + usbh_ports = 1; |
|
51 | + } |
51 | + } |
|
52 | + |
52 | + |
|
53 | if (board.has_usbd) |
53 | if (board.has_usbd) |
|
54 | bcm63xx_usbd_register(&board.usbd); |
54 | bcm63xx_usbd_register(&board.usbd); |
|
55 | |
55 | |
|
56 | if (board.has_ehci0) |
56 | if (board.has_ehci0) |
|
57 | - bcm63xx_ehci_register(); |
57 | - bcm63xx_ehci_register(); |
|
58 | + bcm63xx_ehci_register(usbh_ports); |
58 | + bcm63xx_ehci_register(usbh_ports); |
|
59 | |
59 | |
|
60 | if (board.has_ohci0) |
60 | if (board.has_ohci0) |
|
61 | - bcm63xx_ohci_register(); |
61 | - bcm63xx_ohci_register(); |
|
62 | + bcm63xx_ohci_register(usbh_ports); |
62 | + bcm63xx_ohci_register(usbh_ports); |
|
63 | |
63 | |
|
64 | /* Generate MAC address for WLAN and register our SPROM, |
64 | if (board.has_dsp) |
|
65 | * do this after registering enet devices |
65 | bcm63xx_dsp_register(&board.dsp); |
|
66 | --- a/arch/mips/bcm63xx/dev-usb-ehci.c |
66 | --- a/arch/mips/bcm63xx/dev-usb-ehci.c |
|
67 | +++ b/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 |
68 | @@ -79,12 +79,14 @@ static struct platform_device bcm63xx_eh |
|
69 | }, |
69 | }, |
|
70 | }; |
70 | }; |
|
71 | |
71 | |
|
72 | -int __init bcm63xx_ehci_register(void) |
72 | -int __init bcm63xx_ehci_register(void) |
|
73 | +int __init bcm63xx_ehci_register(unsigned int num_ports) |
73 | +int __init bcm63xx_ehci_register(unsigned int num_ports) |
|
74 | { |
74 | { |
|
75 | if (!BCMCPU_IS_6318() && !BCMCPU_IS_6328() && !BCMCPU_IS_6358() && |
75 | if (!BCMCPU_IS_6318() && !BCMCPU_IS_6328() && !BCMCPU_IS_6358() && |
|
76 | !BCMCPU_IS_6362() && !BCMCPU_IS_6368() && !BCMCPU_IS_63268()) |
76 | !BCMCPU_IS_6362() && !BCMCPU_IS_6368() && !BCMCPU_IS_63268()) |
|
77 | return 0; |
77 | return 0; |
|
78 | |
78 | |
|
79 | + bcm63xx_ehci_pdata.num_ports = num_ports; |
79 | + bcm63xx_ehci_pdata.num_ports = num_ports; |
|
80 | + |
80 | + |
|
81 | ehci_resources[0].start = bcm63xx_regset_address(RSET_EHCI0); |
81 | ehci_resources[0].start = bcm63xx_regset_address(RSET_EHCI0); |
|
82 | ehci_resources[0].end = ehci_resources[0].start; |
82 | ehci_resources[0].end = ehci_resources[0].start; |
|
83 | ehci_resources[0].end += RSET_EHCI_SIZE - 1; |
83 | ehci_resources[0].end += RSET_EHCI_SIZE - 1; |
|
84 | --- a/arch/mips/bcm63xx/dev-usb-ohci.c |
84 | --- a/arch/mips/bcm63xx/dev-usb-ohci.c |
|
85 | +++ b/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 |
86 | @@ -62,7 +62,6 @@ static struct usb_ohci_pdata bcm63xx_ohc |
|
87 | .big_endian_desc = 1, |
87 | .big_endian_desc = 1, |
|
88 | .big_endian_mmio = 1, |
88 | .big_endian_mmio = 1, |
|
89 | .no_big_frame_no = 1, |
89 | .no_big_frame_no = 1, |
|
90 | - .num_ports = 1, |
90 | - .num_ports = 1, |
|
91 | .power_on = bcm63xx_ohci_power_on, |
91 | .power_on = bcm63xx_ohci_power_on, |
|
92 | .power_off = bcm63xx_ohci_power_off, |
92 | .power_off = bcm63xx_ohci_power_off, |
|
93 | .power_suspend = bcm63xx_ohci_power_off, |
93 | .power_suspend = bcm63xx_ohci_power_off, |
|
94 | @@ -80,11 +79,13 @@ static struct platform_device bcm63xx_oh |
94 | @@ -80,11 +79,13 @@ static struct platform_device bcm63xx_oh |
|
95 | }, |
95 | }, |
|
96 | }; |
96 | }; |
|
97 | |
97 | |
|
98 | -int __init bcm63xx_ohci_register(void) |
98 | -int __init bcm63xx_ohci_register(void) |
|
99 | +int __init bcm63xx_ohci_register(unsigned int num_ports) |
99 | +int __init bcm63xx_ohci_register(unsigned int num_ports) |
|
100 | { |
100 | { |
|
101 | if (BCMCPU_IS_6345() || BCMCPU_IS_6338()) |
101 | if (BCMCPU_IS_6345() || BCMCPU_IS_6338()) |
|
102 | return -ENODEV; |
102 | return -ENODEV; |
|
103 | |
103 | |
|
104 | + bcm63xx_ohci_pdata.num_ports = num_ports; |
104 | + bcm63xx_ohci_pdata.num_ports = num_ports; |
|
105 | + |
105 | + |
|
106 | ohci_resources[0].start = bcm63xx_regset_address(RSET_OHCI0); |
106 | ohci_resources[0].start = bcm63xx_regset_address(RSET_OHCI0); |
|
107 | ohci_resources[0].end = ohci_resources[0].start; |
107 | ohci_resources[0].end = ohci_resources[0].start; |
|
108 | ohci_resources[0].end += RSET_OHCI_SIZE - 1; |
108 | ohci_resources[0].end += RSET_OHCI_SIZE - 1; |
|
109 | |
109 | |