Changeset 27705


Ignore:
Timestamp:
2011-07-20T16:39:47+02:00 (5 years ago)
Author:
nbd
Message:

ar71xx: reinitialize global switch settings after reset on ar7240

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_ar7240.c

    r27704 r27705  
    419419} 
    420420 
    421 static int ar7240sw_reset(struct ar7240sw *as) 
    422 { 
    423         struct mii_bus *mii = as->mii_bus; 
    424         int ret; 
    425         int i; 
    426  
    427         /* Set all ports to disabled state. */ 
    428         for (i = 0; i < AR7240_NUM_PORTS; i++) 
    429                 ar7240sw_disable_port(as, i); 
    430  
    431         /* Wait for transmit queues to drain. */ 
    432         msleep(2); 
    433  
    434         /* Reset the switch. */ 
    435         ar7240sw_reg_write(mii, AR7240_REG_MASK_CTRL, 
    436                            AR7240_MASK_CTRL_SOFT_RESET); 
    437  
    438         ret = ar7240sw_reg_wait(mii, AR7240_REG_MASK_CTRL, 
    439                                 AR7240_MASK_CTRL_SOFT_RESET, 0, 1000); 
    440         return ret; 
    441 } 
    442  
    443421static void ar7240sw_setup(struct ar7240sw *as) 
    444422{ 
     
    470448        /* setup Service TAG */ 
    471449        ar7240sw_reg_rmw(mii, AR7240_REG_SERVICE_TAG, AR7240_SERVICE_TAG_M, 0); 
     450} 
     451 
     452static int ar7240sw_reset(struct ar7240sw *as) 
     453{ 
     454        struct mii_bus *mii = as->mii_bus; 
     455        int ret; 
     456        int i; 
     457 
     458        /* Set all ports to disabled state. */ 
     459        for (i = 0; i < AR7240_NUM_PORTS; i++) 
     460                ar7240sw_disable_port(as, i); 
     461 
     462        /* Wait for transmit queues to drain. */ 
     463        msleep(2); 
     464 
     465        /* Reset the switch. */ 
     466        ar7240sw_reg_write(mii, AR7240_REG_MASK_CTRL, 
     467                           AR7240_MASK_CTRL_SOFT_RESET); 
     468 
     469        ret = ar7240sw_reg_wait(mii, AR7240_REG_MASK_CTRL, 
     470                                AR7240_MASK_CTRL_SOFT_RESET, 0, 1000); 
     471 
     472        ar7240sw_setup(as); 
     473        return ret; 
    472474} 
    473475 
     
    868870 
    869871        ar7240sw_reset(as); 
    870         ar7240sw_setup(as); 
    871872 
    872873        ag->speed = SPEED_1000; 
Note: See TracChangeset for help on using the changeset viewer.