Changeset 24332


Ignore:
Timestamp:
2010-12-08T11:15:04+01:00 (7 years ago)
Author:
juhosg
Message:

ramips: ramips_esw: don't touch GPIO_PURPOSE register

It must have been set by the board initialization code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ramips/files/drivers/net/ramips_esw.c

    r24331 r24332  
    44#include <rt305x_esw_platform.h> 
    55 
    6 #define GPIO_PRUPOSE           0x60 
    7 #define GPIO_MDIO_BIT          (1<<7) 
    86#define RT305X_ESW_PHY_WRITE            (1 << 13) 
    97#define RT305X_ESW_PHY_TOUT                     (5 * HZ) 
     
    2826} 
    2927 
    30 static void 
    31 ramips_enable_mdio(int s) 
    32 { 
    33         u32 gpio = rt305x_sysc_rr(GPIO_PRUPOSE); 
    34         if(s) 
    35                 gpio &= ~GPIO_MDIO_BIT; 
    36         else 
    37                 gpio |= GPIO_MDIO_BIT; 
    38         rt305x_sysc_wr(gpio, GPIO_PRUPOSE); 
    39 } 
    40  
    4128u32 
    4229mii_mgr_write(struct rt305x_esw *esw, u32 phy_addr, u32 phy_register, 
     
    4633        int ret = 0; 
    4734 
    48         ramips_enable_mdio(1); 
    4935        while(1) 
    5036        { 
     
    7157        } 
    7258out: 
    73         ramips_enable_mdio(0); 
    7459        if(ret) 
    7560                printk(KERN_ERR "ramips_eth: MDIO timeout\n"); 
     
    11196        mii_mgr_write(esw, 0, 14, 0x65);     //longer TP_IDL tail length 
    11297        mii_mgr_write(esw, 0, 31, 0x8000);   //select local register 
    113  
    114         /* Port 5 Disabled */ 
    115         rt305x_sysc_wr(rt305x_sysc_rr(0x60) | (1 << 9), 0x60); //set RGMII to GPIO mode (GPIO41-GPIO50) 
    116         rt305x_sysc_wr(0xfff, 0x674); //GPIO41-GPIO50 output mode 
    117         rt305x_sysc_wr(0x0, 0x670); //GPIO41-GPIO50 output low 
    11898 
    11999        /* set default vlan */ 
Note: See TracChangeset for help on using the changeset viewer.