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

RE: tc hacking and more

To: linux-mips@fnet.fr
Subject: RE: tc hacking and more
From: Harald Koerfgen <harald.koerfgen@netcologne.de>
Date: Mon, 15 Jun 1998 18:22:08 +0200 (MEST)
In-reply-to: <Pine.LNX.3.95.980612215807.632A-100000@whale.dutch.mountain>
Organization: none
Reply-to: "Harald Koerfgen" <harald.koerfgen@netcologne.de>
Sender: harry@franz.no.dom
Hi all,

On 12-Jun-98 Richard van den Berg wrote:
> Hello Harald,
> 
> Thank you very much for your bright and clear explanation. After
> configuring and compiling the kernel with the appropiate settings to
> boot from ram no kernel panic is shown. :-) Also with CONFIG_VT set goes
> allright now. So officially to me Linux runs on the DECstation and that's
> not to bad at all indeed!
> 
> If I understand it correctly, with tc probing the device_base_addr is
> obtained, just like the address of the "system slot". This makes me
> conclude that before initializing any driver, the turbochannel has to
> be initialized. 

Yes, Richard, you're right. Although there is no real initialization, the code
simply scans for installed TURBOchannel Option Modules and fills a data 
structure
which might be of use for device driver writers.

I suggest code like (be warned! this is pure armchair engineering):

--- cut here if think this might be useful ---

#include <asm/dec/tc.h>
#include <asm/bootinfo.h>

/*
 * I don't know of any TURBOchannel machine with more than three slots,
 */
#define MAX_DEVICES 3

unsigned char *my_devices[MAX_DEVICES];

int found_devices = 0;

..

__initfunc(int my_device_init(void))
{
        int slot;
        ...

        ...
        if (TURBOCHANNEL)
                for (slot = 0; slot <= MAXSLOT; slot++)
                        if strncmp(tc_bus[slot], "PMAZ-AA", 8) {
                                my_devices[found_devices] = 
tc_bus[slot].base_addr;
                                found_devices++;
                        }
        ...
}

--- cut here if think this might be useful ---

to scan for TURBOchannel Option Modules.

> Currently I am studying the sunlance.c code and the more
> I start to understand things the more I like it.

Welcome to the club :-).

> Meanwhile I received a message that I am subsribed to linux-mips, so
> shall we continu discussions on that channel?

linux-mips is a quite low traffic list and I guess a little DECstation 
discussion
doesn't harm.
 
> Happy hacking regards,
> 
> Richard

---
Regards,
Harald

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