![]() |
![]() |
#1 | |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 603
|
Prometheus, OpenPCI, AHI
Hi,
I recently got interested in the Hese's Firebird A3000 daughterboard. I installed the Firestorm firmware and prometheus.library. I got a S3Virge and Voodoo3 card running as RTG card using P96 (3.3.3). I read about a Radeon driver also being available for the Prometheus/OpenPCI framework, but apparently it was pulled because of copyright claims and never resurfaced. Does anyone have updates on this? I attempted to get a Realtek8139 card running, and the driver seems to load and do something after I added the "DMASize=512kb" tooltype to the Prometheus monitor driver. Unfortunately, it doesn't really work for networking. Something somehow gets "stuck" and no real sustainable networking seems to work. I also dabbled in trying to get a SbLive! PCI Audiocard going, but no luck so far. Playing a test sound in the AHI prefs just causes the card to produce some form of horrible squeal. This lead me to a rabbit hole of "how hard can it be?", so I scoured the interwebs for sources... I eventually found out that AHI was open sourced almost 20 years ago and its sources have lived on at https://sourceforge.net/projects/arp2/ The AHI sources are part of a very large repository that seems to contain lots of Martin Bloms (creator of AHI) source. I took the liberty to move just the AHI part over to GitHub: https://github.com/mheyer32/AHI preserving history, credits and licensing. I also started working on make this pile of code compile with Bebbo's GCC toolchain, which was really not hard to do. The hardest parts was to make various tools that generate the documentation (.guide .doc etc) compile and work on the host machine. Now to my real questions. I am now able to modify compile & test the AHI driver, in particular the emu10kx one. The way it is written is that it'll use the opencpi.library to talk to various PCI bridgeboards. Internally, openpci.library just forwards most calls to prometheus.library. I found the source of openpci.library on GitHub: https://github.com/jeperk/OpenPCI But it seems to be incomplete. It doesn't contain any source to talk to any bridge board other than the prometheus. I read that, again, Mediator support had been removed for legal reasons, but I don't know why all the other backends are missing. The OpenPCI repo contains the Prometheus SDK (i.e. headers), but no Prometheus source code. I have found no traces of the actual Prometheus code anywhere. Didn't Prometheus go "Open Source" a decade ago? (I have been absent from the Amiga scene back then, so forgive my ignorance of the whole PCI landscape around the Amiga). Without it, it'll be hard o know for sure what the prometheus.library does and its hard to inspect it for bugs. Back to the SbLive... I have been looking at the source and trying to understand how it works. My current hunch is that the buggy behavior might stem from either a) not placing data that the card needs to access into PCI memory b) programming pagetable pointers or registers with wrong values due to big/little endian conversion issues. The big/little endian issue is a real head scratcher for me. The OpenPCI documentation states: Quote:
There are a few places in the driver, though, where the code does not go through these functions and instead does the BE-LE conversion on the spot. In particular the code to write the EMU10KX page table. Superficially this might look correct, but then I read a Prometheus document stating that the Prometheus hardware will auto-convert BE to LE and back, so the software would not have to do _any_ conversion, turning the above mentioned pagetable writes into wrong values! I changed the code accordingly, but so far had no luck... Still only getting a squeal out of the card. Another piece of code tried to translate addresses _inside_ a PCI allocation from virtual to physical (PCI) addresses. It is correct to assume that a linear range of virtual addresses maps to non-linear fragmented physical addresses. But again, the openpci/prometheus documentation are lacking information if querying an address _inside_ an allocation will work. It seems it does not. Is there any more in-depth information on prometheus and openpci? Is the source for prometheus.library available anywhere? Is there any documentation describing the EMU10KX registers? Thanks in advance for sharing your knowledge! |
|
![]() |
![]() |
#2 |
Semi-Retired
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 1,895
|
Prometheus went open source on HW, not SW more than a decade ago.
And I did some work on the SW here based on earlier work from Tobias Seiler: https://github.com/Sakura-IT/Prometheus |
![]() |
![]() |
#3 |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 603
|
That is awesome! Is this a reimplementation of the Prometheus.library then?
It’s also cool to see the Prometheus.card and the chip P96 drivers! The good thing is that I was able to confirm that the library should be able to translate addresses inside a PCI allocation just fine. Looks like the mapping is as simple as subtracting the ZorroIII base address - I had feared there was some complex page based mapping going on :-) I’m still dubious about the hardware BE/LE conversion. Do you have a definite answer if this is implemented in the firestorm FW? |
![]() |
![]() |
#4 |
Semi-Retired
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 1,895
|
Not totally sure. I think the config space is LE and all the rest is BE. As I seem to write normal to any PCI address and use swap to configure, like in
https://github.com/Sakura-IT/PowerPC...ster/libinit.c I think Toni knows more as he has the HW programmed into WinUAE. |
![]() |
![]() |
#5 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 48
Posts: 26,080
|
Prometheus emulation in UAE: PCI config space is not swapped, PCI IO and memory is always hardware endian swapped. Address is not changed (some other PCI bridges also do address "XOR" operation)
|
![]() |
![]() |
#6 |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 603
|
So, as long as I’m not writing to config space, no writes to PCI memory need to be swapped?
I wonder, though, how the driver can transparently handle this when it needs to write to PCI memory directly. OpenPCI does not expose this PCI bridge behavior and it’s documentation encourages to always do the conversion when not going through it’s pci_outX() functions. In case of the SbLive the driver needs to manage pagetable entries that point to PCI memory addresses. The pagetable itself lives in PCI memory and it currently gets manipulated by directly writing to the pagetable (and converting each write to LE - which should be wrong on the Prometheus) |
![]() |
![]() |
#7 | |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 603
|
I'm confused.
https://wiki.osdev.org/PCI states: Quote:
|
|
![]() |
![]() |
#8 |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 603
|
This is getting more and more confusing.
It looks like access to IO space is not getting byte swapped. I confirmed this with the SbLive's WC register: Code:
#define WC 0x10 /* Wall Clock register */ #define WC_SAMPLECOUNTER_MASK 0x03FFFFC0 /* Sample periods elapsed since reset */ #define WC_SAMPLECOUNTER 0x14060010 #define WC_CURRENTCHANNEL 0x0000003F /* Channel [0..63] currently being serviced */ /* NOTE: Each channel takes 1/64th of a sample */ /* period to be serviced. */ |
![]() |
![]() |
#9 |
Hardware Designer
Join Date: Aug 2018
Location: Bialystok/Poland
Age: 50
Posts: 156
|
|
![]() |
![]() |
#10 |
Semi-Retired
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 1,895
|
Yeah, It looks like that. I think that everything from 0x1fc00000 to 0x20000000 on the Firestorm/Firebird is not swapped. So that is config0, config1 and I/O space. At the very least everything looks LE in this area :-)
|
![]() |
![]() |
#11 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 48
Posts: 26,080
|
I'd say "not enough information" without including result of long read, 2x word reads and 4x byte reads from same addresses.
|
![]() |
![]() |
#12 | |
Semi-Retired
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 1,895
|
Quote:
As the address map got changed http://www.e3b.de/prometheus/prometheus_V05.txt |
|
![]() |
![]() |
#13 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 48
Posts: 26,080
|
Quote:
![]() Does Firestorm/Firebird have any existing software? I don't emulate hardware that does not have any software. |
|
![]() |
![]() |
#14 |
Semi-Retired
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 1,895
|
It brought the Prometheus more in-line with the Mediator. So PCI to PCI DMA is now possible (Using gfx card memory; So RTL8139 and EMU10K1 is now possible through OpenPCI). Also you can add more bridges now to the Prometheus (e.g. a PCIe bridge). However, no software yet for that :-)
|
![]() |
![]() |
#15 |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 603
|
I wouldn’t say there is no software. There’s Prometheus.card to hook up existing .chip drivers for P96 with PCI graphics cards (supporting Voodoo3+, Permedia2 and S3Virge).
There are RTL8029 and RTL8139 network drivers and there’s AHI drivers for PCI sound cards (Emu10kx based). |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenPCI - P96 overview | Ratte | Coders. System | 3 | 28 January 2015 01:32 |
OpenPCI Radeon driver released | Ratte | News | 16 | 18 August 2014 12:27 |
Rattes OpenPCI Radeon drivers | JohnFante | request.Other | 1 | 16 May 2013 23:00 |
AHI 6 error: can't open openpci.library | keropi | support.Apps | 7 | 11 May 2009 16:32 |
new AHI pages layout and AHI-archive | Bamiga2002 | Amiga scene | 12 | 20 December 2007 14:44 |
|
|