Commit aedc0e52 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by Stephen Hemminger

Fix RTL8019AS init for Toshiba RBTX49xx boards

    Ensure that 8-bit mode is selected for the on-board Realtek RTL8019AS chip
on Toshiba RBHMA4x00, get rid of the duplicate #ifdef's when setting
ei_status.word16.
    The chip's datasheet says that the PSTOP register shouldn't exceed 0x60 in
8-bit mode -- ensure this too.
Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
parent 8cd35da0
...@@ -139,8 +139,9 @@ bad_clone_list[] __initdata = { ...@@ -139,8 +139,9 @@ bad_clone_list[] __initdata = {
#if defined(CONFIG_PLAT_MAPPI) #if defined(CONFIG_PLAT_MAPPI)
# define DCR_VAL 0x4b # define DCR_VAL 0x4b
#elif defined(CONFIG_PLAT_OAKS32R) #elif defined(CONFIG_PLAT_OAKS32R) || \
# define DCR_VAL 0x48 defined(CONFIG_TOSHIBA_RBTX4927) || defined(CONFIG_TOSHIBA_RBTX4938)
# define DCR_VAL 0x48 /* 8-bit mode */
#else #else
# define DCR_VAL 0x49 # define DCR_VAL 0x49
#endif #endif
...@@ -396,10 +397,22 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr) ...@@ -396,10 +397,22 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr)
/* We must set the 8390 for word mode. */ /* We must set the 8390 for word mode. */
outb_p(DCR_VAL, ioaddr + EN0_DCFG); outb_p(DCR_VAL, ioaddr + EN0_DCFG);
start_page = NESM_START_PG; start_page = NESM_START_PG;
stop_page = NESM_STOP_PG;
/*
* Realtek RTL8019AS datasheet says that the PSTOP register
* shouldn't exceed 0x60 in 8-bit mode.
* This chip can be identified by reading the signature from
* the remote byte count registers (otherwise write-only)...
*/
if ((DCR_VAL & 0x01) == 0 && /* 8-bit mode */
inb(ioaddr + EN0_RCNTLO) == 0x50 &&
inb(ioaddr + EN0_RCNTHI) == 0x70)
stop_page = 0x60;
else
stop_page = NESM_STOP_PG;
} else { } else {
start_page = NE1SM_START_PG; start_page = NE1SM_START_PG;
stop_page = NE1SM_STOP_PG; stop_page = NE1SM_STOP_PG;
} }
#if defined(CONFIG_PLAT_MAPPI) || defined(CONFIG_PLAT_OAKS32R) #if defined(CONFIG_PLAT_MAPPI) || defined(CONFIG_PLAT_OAKS32R)
...@@ -509,15 +522,9 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr) ...@@ -509,15 +522,9 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr)
ei_status.name = name; ei_status.name = name;
ei_status.tx_start_page = start_page; ei_status.tx_start_page = start_page;
ei_status.stop_page = stop_page; ei_status.stop_page = stop_page;
#if defined(CONFIG_TOSHIBA_RBTX4927) || defined(CONFIG_TOSHIBA_RBTX4938)
wordlength = 1;
#endif
#ifdef CONFIG_PLAT_OAKS32R /* Use 16-bit mode only if this wasn't overridden by DCR_VAL */
ei_status.word16 = 0; ei_status.word16 = (wordlength == 2 && (DCR_VAL & 0x01));
#else
ei_status.word16 = (wordlength == 2);
#endif
ei_status.rx_start_page = start_page + TX_PAGES; ei_status.rx_start_page = start_page + TX_PAGES;
#ifdef PACKETBUF_MEMSIZE #ifdef PACKETBUF_MEMSIZE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment