| 
      
      
      From: Geert U. <ge...@li...> - 2001-12-27 16:52:51
      
     | 
| [ I'm CC-ing the Linux/m68k and Linux/PPC on APUS development mailing lis=
ts
  since someone else there may be interested in my wordings...]
On Wed, 26 Dec 2001, Adam Kowalczyk wrote:
>     Hi,  I thought I would send you an email expressing my interest in
> assist with the development of the drivers for the Amiga Prometheus car=
d.
> My background is computer engineering and I have programmed in C for ma=
ny
> years, but it's been awhile since I've had to do anything really seriou=
s.
> I've been going over the code on the Amiga specific stuff that you've
> written with respect to the zorro initialization.  It's actually kinda
> scary, I had to get out some of my reference books to understand what y=
ou
> were doing as it seems to be pretty tight code.  I just needed a bit of
> refreshing.
>=20
>     I've also been looking into the PCI stuff and giving some thought o=
n how
> to implement the driver.  Matay's developer site describes the Promethe=
us
> card as a Zorro to PCI bridge and that it's simply a matter of reading =
and
> writing to addresses in Zorro 3 space.  The problem as I see it, is how=
 to
> tie in the standard PCI routines after a Prometheus driver is up and ru=
nning
> that has configured the PCI cards.  For your information, I'm running a
> Voodoo 3 3000 card in my Prometheus card.  I've also got a PowerMac 850=
0
> with a Voodoo 3 2000 running LinuxPPC with a 2.4.10 kernel (YDL 2.1).  =
I
> have compiled kernels in the past and have done modifications like gett=
ing
> my X-Surf card to work in my Amiga, but I wouldn't classify myself as a=
n
> expert hacker....more like a hack hacker.
If the Prometheus driver has initialized your Voodoo 3, the standard tdxf=
b
should work fine.
>     As previously mentioned, if there's anything I can do to help let m=
e
> know.  If you or someone else has started, let me know as well.
I don't have a Prometheus, so I cannot write the driver.
So how to write a PCI driver for the Prometheus:
 1. call zorro_find() to find the board and the 512 MB where it lives
 2. call request_mem_region() (actually z_request_mem_region(), but APUS
    doesn't have that yet) to request the 512 MB of the board and remembe=
r the
    returned pointer
 3. (z_)ioremap() the 512 MB of the board
 4. create a struct resource for the 960 kiB of PCI I/O space and call
    request_resource() with ioport_resource as the parent
 4a create another resource for the 960 kiB of PCI I/O space, so /proc/io=
mem
    shows you where it is as well
 5. create a struct resource for the 511 MiB of PCI memory space and call
    request_resource() with the pointer from step 2 as the parent
 6. write PCI access routines (struct pci_ops), for accessing the 64 kiB =
of
    configuration space.
 6a create another resource for the 960 kiB of PCI memory space, so /proc=
/iomem
    shows you where it is as well
 7. create a PCI bus, fill in the resources for PCI I/O (step 4) and memo=
ry
    space (step 6) as bus resources, and register it.
 8. Write {in,out}[bwl] and {read,write}[bwl] routines that access PCI I/=
O and
    memory space.
You may want to read arch/ppc/kernel/apus_pci.c as well.
Some of the accesses (PCI config, I/O and memory space) may need endianne=
ss
conversions. The best way to find out which is to have the hardware and d=
o some
experiments :-)
After that (almost) all Linux drivers for PCI cards will work out-of-the-=
box.
Good luck!
> ----- Original Message -----
> From: "Geert Uytterhoeven" <ge...@li...>
> To: "Roman Zippel" <zi...@xs...>
> Cc: "Michel D=E4nzer" <mic...@ii...>; "Adam Kowalczyk"
> <ako...@co...>; "Linux/PPC on APUS development"
> <lin...@li...>
> Sent: Wednesday, December 05, 2001 5:26 PM
> Subject: Re: Prometheus Card and Voodoo 3 3000
>=20
> > On Wed, 5 Dec 2001, Roman Zippel wrote:
> > > "Michel D=E4nzer" wrote:
> > > >
> > > > [ following up to the linux-apus-devel list, hope you don't mind =
]
> > > >
> > > > On Sun, 2001-12-02 at 01:55, Adam Kowalczyk wrote:
> > > >
> > > > > > Ever since I've installed my Prometheus card, I can't run Lin=
uxPPC
> (or
> > > > > > LinuxM68k).  The machine locks up after the fb devices prints=
 out
> a
> > > > > > few messages (I ECS and CLGen).  I'm under the impression the
> > > > > > Autoconfig routines may not like the fact that the Prometheus=
 card
> > > > > > requires 512MB of space allocated.
> > > > >
> > > > > Here is the site Matay has put together
> > > > > http://prometheus.amiga.pl/developer.html  it has some informat=
ion,
> > > > > but I'm not sure if there is enough for a Linux driver,
> > >
> > > >From the info only the pci card can generate that, so if the card =
was
> > > activated and not shutdown before booting into Linux.
> > >
> > > > Looks to me like it should be enough. If only there was informati=
on
> like
> > > > this about all hardware.
> > >
> > > I'm not overly familiar with PCI, accessing the pci devices shouldn=
't be
> > > difficult, but what about configuring them (irq, io addresses, ...)=
?
> >
> > They tell where PCI config space is and how it works.
> > They tell where PCI I/O and memory space are mapped, and how hardware
> > byteswapping is done.
> > They tell that all PCI interrupts of all slots (INT #A-#D) are mapped=
 to
> one
> > single Zorro interrupt.
> >
> > Code for configuring PCI devices already exists in the PPC tree.
> >
> > I guess now we know everything we need to know. Let's implement it :-=
)
Gr{oetje,eeting}s,
						Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m6=
8k.org
In personal conversations with technical people, I call myself a hacker. =
But
when I'm talking to journalists I just say "programmer" or something like=
 that.
							    -- Linus Torvalds
 |