Changeset 14637 for trunk


Ignore:
Timestamp:
2009-02-23T11:43:23+01:00 (8 years ago)
Author:
juhosg
Message:

[ar71xx] TL-WR941ND: add DSA device for the Marvell 88E6060 switch

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

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ar71xx/files/arch/mips/ar71xx/devices.c

    r14635 r14637  
    647647        platform_device_register(&ar91xx_wmac_device); 
    648648} 
     649 
     650static struct platform_device ar71xx_dsa_switch_device = { 
     651        .name           = "dsa", 
     652        .id             = 0, 
     653}; 
     654 
     655void __init ar71xx_add_device_dsa(unsigned int id, 
     656                                  struct dsa_platform_data *d) 
     657{ 
     658        switch (id) { 
     659        case 0: 
     660                d->netdev = &ar71xx_eth0_device.dev; 
     661                break; 
     662        case 1: 
     663                d->netdev = &ar71xx_eth1_device.dev; 
     664                break; 
     665        default: 
     666                printk(KERN_ERR 
     667                        "ar71xx: invalid ethernet id %d for DSA switch\n", 
     668                        id); 
     669                return; 
     670        } 
     671        d->mii_bus = &ar71xx_mdio_device.dev; 
     672        ar71xx_dsa_switch_device.dev.platform_data = d; 
     673 
     674        platform_device_register(&ar71xx_dsa_switch_device); 
     675} 
  • trunk/target/linux/ar71xx/files/arch/mips/ar71xx/devices.h

    r14635 r14637  
    1414 
    1515#include <asm/mach-ar71xx/platform.h> 
     16 
    1617#include <linux/leds.h> 
    1718#include <linux/gpio_buttons.h> 
     19#include <linux/gpio_buttons.h> 
     20#include <net/dsa.h> 
    1821 
    1922void ar71xx_add_device_spi(struct ar71xx_spi_platform_data *pdata, 
     
    4952void ar91xx_add_device_wmac(void) __init; 
    5053 
     54void ar71xx_add_device_dsa(unsigned int id, 
     55                           struct dsa_platform_data *d) __init; 
     56 
    5157#endif /* __AR71XX_DEVICES_H */ 
  • trunk/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr941nd.c

    r14635 r14637  
    109109}; 
    110110 
     111static struct dsa_platform_data tl_wr941nd_dsa_data = { 
     112        .port_names[0]  = "wan", 
     113        .port_names[1]  = "lan1", 
     114        .port_names[2]  = "lan2", 
     115        .port_names[3]  = "lan3", 
     116        .port_names[4]  = "lan4", 
     117        .port_names[5]  = "cpu", 
     118}; 
     119 
    111120static void __init tl_wr941nd_setup(void) 
    112121{ 
     
    123132 
    124133        ar71xx_add_device_eth(0); 
     134        ar71xx_add_device_dsa(0, &tl_wr941nd_dsa_data); 
    125135 
    126136        ar71xx_add_device_spi(NULL, tl_wr941nd_spi_info, 
Note: See TracChangeset for help on using the changeset viewer.