Changeset 17398


Ignore:
Timestamp:
07/26/11 01:02:36 (22 months ago)
Author:
BrainSlayer
Message:

to make some devices work correct with ath9k, we need some workarounds here

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linux/pb42/linux-2.6.34.6/arch/mips/pci/pci-ar7100.c

    r15773 r17398  
    195195} 
    196196DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID, PCI_ANY_ID, ar71xx_pci_fixup); 
    197   
     197 
     198#ifdef CONFIG_DIR825 
     199#define STARTSCAN 0x1f660000 
     200#define DIR825B1_MAC_LOCATION_0                 0x2ffa81b8 
     201#define DIR825B1_MAC_LOCATION_1                 0x2ffa8370 
     202static u8 mac0[6]; 
     203static u8 mac1[6]; 
     204#else   
     205#define STARTSCAN 0x1f000000 
     206#endif   
     207 
     208#ifdef CONFIG_WNDR3700 
     209#define WNDR3700_MAC_LOCATION_0                 0x1fff0000 
     210#define WNDR3700_MAC_LOCATION_1                 0x1fff000c 
     211#endif  
    198212static void *getCalData(int slot) 
    199213{ 
    200214u8 *base; 
    201 for (base=(u8 *) KSEG1ADDR(0x1f000000);base<KSEG1ADDR (0x1fff0000);base+=0x1000) { 
     215for (base=(u8 *) KSEG1ADDR(STARTSCAN);base<KSEG1ADDR (0x1fff0000);base+=0x1000) { 
    202216    u32 *cal = (u32 *)base; 
    203217    if (*cal==0xa55a0000 || *cal==0x5aa50000) { //protection bit is always zero on inflash devices, so we can use for match it 
     
    213227static struct ath9k_platform_data wmac_data[2]; 
    214228 
     229 
    215230static void ath_pci_fixup(struct pci_dev *dev) 
    216231{ 
     
    229244                if (cal_data) { 
    230245                memcpy(wmac_data[0].eeprom_data,cal_data,sizeof(wmac_data[0].eeprom_data)); 
     246                #ifdef CONFIG_DIR825 
     247                memcpy(mac0,KSEG1ADDR(DIR825B1_MAC_LOCATION_0),6); 
     248                wmac_data[0].macaddr = mac0; 
     249                #endif 
     250                #ifdef CONFIG_WNDR3700 
     251                memcpy(mac0,KSEG1ADDR(WNDR3700_MAC_LOCATION_0),6); 
     252                wmac_data[0].macaddr = mac0; 
     253                /* 2.4 GHz uses the first fixed antenna group (1, 0, 1, 0) */ 
     254                wmac_data[0].gpio_mask = (0xf << 6); 
     255                wmac_data[0].gpio_val = (0xa << 6); 
     256                #endif 
    231257                dev->dev.platform_data = &wmac_data[0]; 
    232258                } 
     
    236262                if (cal_data) { 
    237263                memcpy(wmac_data[1].eeprom_data,cal_data,sizeof(wmac_data[1].eeprom_data)); 
     264                #ifdef CONFIG_DIR825 
     265                memcpy(mac1,KSEG1ADDR(DIR825B1_MAC_LOCATION_1),6); 
     266                wmac_data[1].macaddr = mac1; 
     267                #endif 
     268                #ifdef CONFIG_WNDR3700 
     269                memcpy(mac1,KSEG1ADDR(WNDR3700_MAC_LOCATION_1),6); 
     270                wmac_data[1].macaddr = mac1; 
     271                /* 5 GHz uses the second fixed antenna group (0, 1, 1, 0) */ 
     272                wmac_data[1].gpio_mask = (0xf << 6); 
     273                wmac_data[1].gpio_val = (0x6 << 6); 
     274                #endif 
    238275                dev->dev.platform_data = &wmac_data[1]; 
    239276                } 
Note: See TracChangeset for help on using the changeset viewer.