Changeset 29022


Ignore:
Timestamp:
2011-11-13T13:48:03+01:00 (6 years ago)
Author:
juhosg
Message:

ar71xx: fixup onboard PCIe chip registration on the DB120 board

Location:
trunk/target/linux/ar71xx/files/arch/mips/ar71xx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ar71xx/files/arch/mips/ar71xx/dev-db120-pci.c

    r26523 r29022  
    33 * 
    44 *  Copyright (C) 2010-2011 Jaiganesh Narayanan <jnarayanan@atheros.com> 
     5 *  Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org> 
    56 * 
    67 *  Parts of this file are based on Atheros linux 2.6.31 BSP 
     
    1213 
    1314#include <linux/pci.h> 
     15#include <linux/ath9k_platform.h> 
    1416 
    1517#include <asm/mach-ar71xx/ar71xx.h> 
     
    1719 
    1820#include "dev-db120-pci.h" 
     21 
     22static struct ath9k_platform_data db120_wmac_data = { 
     23        .led_pin = -1, 
     24}; 
     25static char db120_wmac_mac[6]; 
    1926 
    2027static struct ar71xx_pci_irq db120_pci_irqs[] __initdata = { 
     
    2633}; 
    2734 
    28 void __init db120_pci_init(void) 
     35static int db120_pci_plat_dev_init(struct pci_dev *dev) 
    2936{ 
     37        switch (PCI_SLOT(dev->devfn)) { 
     38        case 0: 
     39                dev->dev.platform_data = &db120_wmac_data; 
     40                break; 
     41        } 
     42 
     43        return 0; 
     44} 
     45 
     46void __init db120_pci_init(u8 *cal_data, u8 *mac_addr) 
     47{ 
     48        if (cal_data) 
     49                memcpy(db120_wmac_data.eeprom_data, cal_data, 
     50                       sizeof(db120_wmac_data.eeprom_data)); 
     51 
     52        if (mac_addr) { 
     53                memcpy(db120_wmac_mac, mac_addr, sizeof(db120_wmac_mac)); 
     54                db120_wmac_data.macaddr = db120_wmac_mac; 
     55        } 
     56 
     57        ar71xx_pci_plat_dev_init = db120_pci_plat_dev_init; 
    3058        ar71xx_pci_init(ARRAY_SIZE(db120_pci_irqs), db120_pci_irqs); 
    3159} 
  • trunk/target/linux/ar71xx/files/arch/mips/ar71xx/dev-db120-pci.h

    r26523 r29022  
    33 * 
    44 *  Copyright (C) 2010-2011 Jaiganesh Narayanan <jnarayanan@atheros.com> 
     5 *  Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org> 
    56 * 
    67 *  Parts of this file are based on Atheros linux 2.6.31 BSP 
     
    1516 
    1617#if defined(CONFIG_AR71XX_DEV_DB120_PCI) 
    17 void db120_pci_init(void); 
     18void db120_pci_init(u8 *cal_data, u8 *mac_addr); 
    1819#else 
    19 static inline void db120_pci_init(void) { } 
     20static inline void db120_pci_init(u8 *cal_data, u8 *mac_addr) { } 
    2021#endif 
    2122 
  • trunk/target/linux/ar71xx/files/arch/mips/ar71xx/mach-db120.c

    r29021 r29022  
    3333#define DB120_MAC0_OFFSET       0 
    3434#define DB120_MAC1_OFFSET       6 
    35 #define DB120_CALDATA_OFFSET    0x1000 
     35#define DB120_WMAC_CALDATA_OFFSET 0x1000 
     36#define DB120_PCIE_CALDATA_OFFSET 0x5000 
    3637 
    3738#define DB120_KEYS_POLL_INTERVAL        20      /* msecs */ 
     
    146147        ar71xx_add_device_eth(1); 
    147148 
    148         ar9xxx_add_device_wmac(art + DB120_CALDATA_OFFSET, NULL); 
     149        ar9xxx_add_device_wmac(art + DB120_WMAC_CALDATA_OFFSET, NULL); 
    149150 
    150         db120_pci_init(); 
     151        db120_pci_init(art + DB120_PCIE_CALDATA_OFFSET, NULL); 
    151152} 
    152153 
Note: See TracChangeset for help on using the changeset viewer.