linux-mips-fnet
[Top] [All Lists]

Re: DC7085

To: linux-mips@fnet.fr
Subject: Re: DC7085
From: Harald Koerfgen <harald.koerfgen@netcologne.de>
Date: Sun, 30 Aug 1998 16:30:52 +0200 (MEST)
In-reply-to: <Pine.LNX.3.96.980829172851.10141G-100000@apt4g.a3nyc.com>
Organization: none
Reply-to: "Harald Koerfgen" <harald.koerfgen@netcologne.de>
Sender: harry@franz.no.dom
Hi all,

On 29-Aug-98 Thomas Riemer wrote:
> Here are patches give the vanilla
> 2.1.100 from the web site +
> the patch at http://www.inter.nl.net/users/schnecke/html/mips/lance.html
> 
> It prints out correctly eth0: LANCE 08:00:2b:15:44:45 
> (hardware address is actually correct)
> 
> -Tom Riemer
> 

[some snippage]

> + /* On decstation 2/3100s without tc.c included system_base
> +    is not defined  - triemer */ 
> + #ifndef CONFIG_TC
> + 
> + /* Base address on decstation 2100/3100 of LANCE ethernet board */
> + static unsigned long system_base = 0xb8000000;
> + 
> + /* Base Address of RTC address space + 1 */
> + #define RTC_OFFSET (0xBD000001)
> + #endif

[...]

> + #ifdef CONFIG_TC
>       dev->base_addr = system_base + 0xc0000;
> + #else
> +     dev->base_addr = system_base;
> + #endif
>   
>       dev->irq = 5;

[...]

>       for (i = 0; i < 6; i++){
> + #ifdef CONFIG_TC
>               dev->dev_addr[i] = esar_base[system_base + 0x80002 + i * 4];
> + #else
> +             dev->dev_addr[i] = esar_base[RTC_OFFSET + i *4];
> + #endif
>               printk("%2.2x%c", dev->dev_addr[i], i == 5 ? ' ': ':');
>       }
>   

A maybe better way to achieve this, could be:

[TURBOCHANNEL and IOASIC are defined in asm/dec/tc.h]

        if (TURBOCHANNEL) {
                if (IOASIC) {
                        esar_base = (char *)(system_base + 0x80000);
                        dev->base_addr = system_base + 0xc0000;
                }
        } else {                /* dunno if that works on DS5100 */
                esar_base = (char *)0xbd000001;
                dev->base_addr = 0xb8000000;
        }

        [...]

        for (i = 0; i < 6; i++) {
                dev->dev_addr[i] = esar_base[i * 4];
                printk("%2.2x%c", dev->dev_addr[i], i == 5 ? ' ': ':');
        }

This should work on all DECstations and such the kernel would work regardless
if a particular DECstation has a TURBOchannel or not. On the other hand,
consider this as a temporary fix, because this code isn't aware of TURBOchannel
option modules and thus will not work on DS5k/200.

---
Regards,
Harald

<Prev in Thread] Current Thread [Next in Thread>