OpenWrt – Diff between revs 2 and 3

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 2 Rev 3
Line 19... Line 19...
19 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 19 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 * 20 *
21 */ 21 */
Line 22... Line 22...
22   22  
-   23 #include <linux/gpio.h>
23 #include <linux/gpio.h> 24 #include <linux/pci.h>
24 #include <linux/phy.h> 25 #include <linux/phy.h>
25 #include <linux/platform_device.h> 26 #include <linux/platform_device.h>
26 #include <linux/ath9k_platform.h> 27 #include <linux/ath9k_platform.h>
Line 27... Line 28...
27 #include <linux/ar8216_platform.h> 28 #include <linux/ar8216_platform.h>
28   29  
Line 29... Line 30...
29 #include <asm/mach-ath79/ar71xx_regs.h> 30 #include <asm/mach-ath79/ar71xx_regs.h>
-   31 #include <asm/mach-ath79/ath79.h>
30 #include <asm/mach-ath79/ath79.h> 32  
31   33 #include "common.h"
32 #include "common.h" 34 #include "dev-ap9x-pci.h"
33 #include "dev-eth.h" 35 #include "dev-eth.h"
34 #include "dev-gpio-buttons.h" 36 #include "dev-gpio-buttons.h"
Line 54... Line 56...
54   56  
55 #define CR3000_MAC0_OFFSET 0 57 #define CR3000_MAC0_OFFSET 0
56 #define CR3000_MAC1_OFFSET 6 58 #define CR3000_MAC1_OFFSET 6
57 #define CR3000_WMAC_CALDATA_OFFSET 0x1000 59 #define CR3000_WMAC_CALDATA_OFFSET 0x1000
-   60 #define CR3000_WMAC_MAC_OFFSET 0x1002
Line 58... Line 61...
58 #define CR3000_WMAC_MAC_OFFSET 0x1002 61 #define CR3000_PCIE_CALDATA_OFFSET 0x5000
59   62  
60 static struct gpio_led cr3000_leds_gpio[] __initdata = { 63 static struct gpio_led cr3000_leds_gpio[] __initdata = {
61 { 64 {
Line 127... Line 130...
127 ARRAY_SIZE(cr3000_gpio_keys), 130 ARRAY_SIZE(cr3000_gpio_keys),
128 cr3000_gpio_keys); 131 cr3000_gpio_keys);
Line 129... Line 132...
129   132  
130 /* WLAN 2GHz onboard */ 133 /* WLAN 2GHz onboard */
131 ath79_register_wmac(art + CR3000_WMAC_CALDATA_OFFSET, art + CR3000_WMAC_MAC_OFFSET); 134 ath79_register_wmac(art + CR3000_WMAC_CALDATA_OFFSET, art + CR3000_WMAC_MAC_OFFSET);
132   -  
133 /* FE Lan on first 4-ports of internal switch and attached to GMAC1 -  
134 * WAN Fast Ethernet interface attached to GMAC0 -  
135 * Could be configured as a 5-port switch, but we use -  
136 * the SoC capabilities to attach port 5 to a separate PHY/MAC -  
137 * theoretically this leaves future possibility of using SoC -  
138 * acceleration/offloading. -  
139 */ -  
140 ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_PHY_SWAP); -  
141   -  
142 /* GMAC0 attached to PHY4 (port 5 of the internal switch) */ -  
143 ath79_switch_data.phy4_mii_en = 1; -  
144 /* For switch carrier ignore port 5 (wan) */ -  
145 ath79_switch_data.phy_poll_mask = 0x1; -  
146   -  
147 /* Register MII bus */ 135
-   136 ath79_register_mdio(1, 0x0);
Line 148... Line -...
148 ath79_register_mdio(1, 0x0); -  
149   -  
150 /* GMAC0 attached to PHY4 (port 5 of the internal switch) */ 137 ath79_register_mdio(0, 0x0);
Line 151... Line 138...
151 ath79_switch_data.phy4_mii_en = 1; 138  
152 ath79_switch_data.phy_poll_mask = 0x1; 139 ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_PHY_SWAP);
-   140  
153   141 /* Lan 4-port switch attached to GMAC1 internal switch */
-   142 ath79_init_mac(ath79_eth1_data.mac_addr, art + CR3000_MAC0_OFFSET, 0);
-   143  
154 /* LAN */ 144 ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
Line 155... Line -...
155 ath79_init_mac(ath79_eth1_data.mac_addr, art + CR3000_MAC0_OFFSET, 0); -  
156 ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; 145 ath79_eth1_data.speed = SPEED_1000;
-   146 ath79_eth1_data.duplex = DUPLEX_FULL;
-   147 ath79_register_eth(1);
-   148  
157 ath79_register_eth(1); 149 ath79_init_mac(ath79_eth0_data.mac_addr, art + CR3000_MAC1_OFFSET, 0);
158   150  
-   151 /* WAN Fast Ethernet interface attached to GMAC0 */
159 /* Wan */ 152 ath79_switch_data.phy4_mii_en = 1;
160 ath79_init_mac(ath79_eth0_data.mac_addr, art + CR3000_MAC0_OFFSET, 1); 153 ath79_switch_data.phy_poll_mask = BIT(0);
161 ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; 154 ath79_eth0_data.phy_mask = BIT(0);
Line 162... Line 155...
162 ath79_eth0_data.phy_mask = BIT(0); 155 ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
163 ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev; 156 ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev;