• Claudiu Manoil's avatar
    gianfar: Implement MAC reset and reconfig procedure · a328ac92
    Claudiu Manoil authored
    The main MAC config registers like: RCTRL/TCTRL, MRBLR,
    MAXFRM, RXIC/TXIC, most fields of MACCFG1/2, should not
    be changed on-the-fly, but at least after stopping the
    DMA and disabling the Rx/Tx blocks and, for increased
    reliability, after a MAC soft reset.
    
    Impelement a complete MAC soft reset and reconfig procedure
    following the latest HW advisories - gfar_mac_reset() - to
    replace gfar_mac_init() and (the confusing) init_registers()
    functions.
    
    Factor out separate config functions for RCTRL and TCTRL,
    insure programming order of the relevant config regs after
    MAC soft reset.
    
    Split gfar_hw_init() into gfar_mac_reset() and the remaining
    global regs that don't need to be reconfigured after MAC soft
    reset (FIFOCFG, ATTRELI, HW counters a.s.o).
    
    As gfar_hw_init() now makes all the register writes @probe()
    time, based on all the device flags and config options, it
    must be moved further down, just before register_netdev(),
    as the last config step when the config values are comitted
    to HW.  Also, move netif_carrier_off() after register_netdev(),
    because it has no effect if called before.
    Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@freescale.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    a328ac92
gianfar.c 88.6 KB