mame icon indicating copy to clipboard operation
mame copied to clipboard

Convert drivers using PCI to latest MAME PCI interface.

Open andrew-gardner opened this issue 10 years ago • 15 comments

MAME currently has two PCI systems: the older “legacy PCI” system and its successor. A number of drivers are still using the legacy system. This situation has persisted for over half a decade now, and really needs to be addressed. If we’re missing new-style PCI device implementations for any components, they need to be created, and drivers need to be migrated. There is to be no further development on legacy PCI devices – it’s wasted effort.

Drivers using legacy PCI include:

  • [ ] src/mame/pc/at.cpp (ficpio2 VT82C496G, probably others)
  • [ ] src/mame/pc/atpci.cpp (i430hx, SiS 85C501, i430tx)
  • [ ] src/mame/be/bebox.cpp (mpc105)
  • [ ] src/mame/pc/calchase.cpp (via vpx clone)
  • [x] src/mame/misc/comebaby.cpp (i440bx)
  • [ ] src/mame/konami/cobra.cpp (mpc106)
  • [x] src/mame/pc/fruitpc.cpp (ST STPCD0166BTC3 SoC)
  • [ ] src/mame/misc/funkball.cpp (Cyrix CX5520)
  • [x] ~~src/mame/drivers/gamecstl.cpp~~ moved to src/mame/pc/sis630.cpp
  • [x] src/mame/misc/gammagic.cpp (i430hx, one of the M55Hi-Plus BIOSes with El Torito BIOS)
  • [ ] src/mame/misc/magictg.cpp (Galileo GT-64010A-B-0)
  • [ ] src/mame/atari/mediagx.cpp (P5GX-LG MediaGX)
  • [x] src/mame/midway/midqslvr.cpp (i440bx)
  • [ ] src/mame/sega/model3.cpp (mpc105/mpc106)
  • [x] src/mame/pc/nforcepc.cpp
  • [x] src/mame/funworld/photoply.cpp (SiS85C496 + SiS85C497)
  • [ ] src/mame/midway/pinball2k.cpp (MediaGX + CX5520)
  • [ ] src/mame/pc/queen.cpp (VIA Apollo VXPro)
  • [x] src/mame/misc/savquest.cpp (i440bx)
  • [x] src/mame/taito/taitowlf.cpp (i82439TX + i82371AB)
  • [ ] src/mame/konami/viper.cpp (mpc8240)
  • [x] src/mame/misc/voyager.cpp (VIA KT133a)
  • [x] src/mame/misc/xtom3d.cpp (i440zx)
  • [ ] src/mame/konami/gticlub.cpp (k033906 PCI bridge)
  • [ ] src/mame/konami/hornet.cpp (k033906 PCI bridge)
  • [ ] src/mame/konami/nwk-tr.cpp (k033906 PCI bridge)
  • [ ] get rid of bus/lpci

There are relatively few legacy PCI devices, mainly contained within the src/devices/bus/lpci directory.

andrew-gardner avatar Oct 15 '15 05:10 andrew-gardner

This interface is incomplete for the purposes of at586, as there are devices required by at586 which need to be able to hook up custom registers in the configuration space. The new interface can't do this as far as I can tell.

fuel-pcbox avatar Mar 01 '16 03:03 fuel-pcbox

Huh? The configuration memory map is virtual for that reason. Look at i82875p for instance, it adds a bunch of registers.

OG.

On Tue, Mar 1, 2016 at 4:51 AM, MoochMcGee [email protected] wrote:

This interface is incomplete for the purposes of at586, as there are devices required by at586 which need to be able to hook up custom registers in the configuration space. The new interface can't do this as far as I can tell.

— Reply to this email directly or view it on GitHub https://github.com/mamedev/mame/issues/391#issuecomment-190527535.

galibert avatar Mar 01 '16 05:03 galibert

Got an hard time understanding what's "Legacy" PCI, nowadays, my best guess is anything prefixed by L (lpci) therefore any class in lpci.h should be marked with the [[deprecated("use non-legacy PCI device")] marker?

angelosa avatar Jan 27 '21 17:01 angelosa

Break down OP message with tasks, marked drivers as resolved where #include "machine/lpci.h" is not found with current tree.

angelosa avatar Mar 30 '22 16:03 angelosa

Errata: there are THREE PCI bus implementations, the proper one is actually in src/devices/machine/pci.cpp

angelosa avatar Apr 15 '22 02:04 angelosa

Added model3.cpp: does its own PCI bus implementation, which for all purposes fits here.

angelosa avatar May 01 '22 10:05 angelosa

Mind adding any drivers using the k033906.cpp PCI bridge device. The three drivers that use this are gticlub.cpp, nwk-tr.cpp and hornet.cpp.

Hydreigon223 avatar Nov 10 '22 23:11 Hydreigon223

Good call, added. Also I'll change directory entry over the new format later on.

angelosa avatar Nov 10 '22 23:11 angelosa

Converted misc\comebaby.cpp to base PCI driver in PR #10830 , it wasn't doing anything useful to warrant using the legacy hookup. I'll deal with full conversion later since being i440bx.

ETA: same deal for pc\quakeat.cpp, a driver that doesn't even have a BIOS hooked up ...

angelosa avatar Jan 18 '23 02:01 angelosa

Updated OP message with easy to track base chipsets for x86 based systems.

angelosa avatar Jan 26 '23 16:01 angelosa

Updated OP with the (mostly) i440bx additions from PR#11037. As for the others:

  • queen.cpp can be converted to stub PCI driver (as per voyager.cpp), unless anybody wants to tackle VIA architecture. That will be needed by calchase.cpp anyway;
  • taitowlf.cpp can now be completely wiped off, since we have everything necessary to emulate a base P5TX-LA including the Winbond Super I/O and the onboard ATI Rage II. pf2012 parallel/game port loading is special but I guess we cross that bridge after we have a solid i82439TX and not the other way around.

angelosa avatar May 30 '23 16:05 angelosa

  • konami/viper.cpp should be easy now, given its limited PCI use beyond Voodoo itself.
  • funworld/photoply.cpp tracked by sis85c496 in https://github.com/mamedev/mame/blob/master/src/mame/pc/pcipc_sis.cpp
  • misc/savquest.cpp tracked by pciagp in https://github.com/mamedev/mame/blob/master/src/mame/pc/pcipc.cpp

angelosa avatar Feb 27 '24 01:02 angelosa

Edited OP with remaining blanks (in particular PPC chipset targets).

angelosa avatar Mar 05 '24 15:03 angelosa

https://github.com/mamedev/mame/commit/6e1f17f676b772944049d5bfebda82bf51b228d4 takes care of funworld/photoply.cpp

angelosa avatar Mar 11 '24 00:03 angelosa