From 0b1d815933431b74e1d88bb1c9fdab81716b160a Mon Sep 17 00:00:00 2001 From: angelosa Date: Sun, 16 Feb 2025 14:17:01 +0100 Subject: [PATCH] pci/zr36057.cpp: sort out header notes --- hash/ibm5170_cdrom.xml | 2 +- src/devices/bus/pci/zr36057.cpp | 100 +++++++++++++++++--------------- 2 files changed, 55 insertions(+), 47 deletions(-) diff --git a/hash/ibm5170_cdrom.xml b/hash/ibm5170_cdrom.xml index 43f678cb21d..3cf79d255d9 100644 --- a/hash/ibm5170_cdrom.xml +++ b/hash/ibm5170_cdrom.xml @@ -9482,7 +9482,7 @@ Installation and Open Circulation CDs are bootable. Pinnacle Systems diff --git a/src/devices/bus/pci/zr36057.cpp b/src/devices/bus/pci/zr36057.cpp index 87187bbc462..b7aacba98b2 100644 --- a/src/devices/bus/pci/zr36057.cpp +++ b/src/devices/bus/pci/zr36057.cpp @@ -7,12 +7,10 @@ Zoran ZR36057 / ZR36067 PCI-based chipsets PCI glue logic for multimedia MJPEG, MPEG1 & DVD. Paired with every single TV standard for video capture in the fairly decent number of subvendor iterations. -- https://www.kernel.org/doc/html/v4.14/media/v4l-drivers/zoran.html +- https://www.kernel.org/doc/html/v6.13/driver-api/media/drivers/zoran.html - Currently using DC10+ configuration: ZR36067 + ZR36060 (ZR36050 + ZR36016 glued together) - SAA7110a (TV decoder) + adv7176 (TV encoder) -- misc/sliver.cpp uses ZR36050 + ZR36011 -- misc/magictg.cpp uses ZR36120 + ZR36050 + ZR36016 + SAA7110a (TV decoder, PAL B/G / NTSC M / SECAM) + adv7176 (TV encoder, Linux driver name is adv7175) ZR36057 is known to have two HW quirks that are been fixed with ZR36067. TODO: @@ -21,6 +19,15 @@ TODO: - Stub, eventually decouple AV PCI controller part from the actual client cards; - Soft Reset & Write lock mechanisms (each register have separate macro-groups); +Known mix-ins: +- s3virge.cpp uses SAA7110 for Scenic Highway overlay available with its S3 LPB connector; +- apple/pippin.cpp uses bt856, reused by LML33 as TV encoder; +- jaleco/tetrisp2.cpp stepstag uses adv7176; +- misc/sliver.cpp uses ZR36050 + ZR36011 + MD0208 (alias for something else?); +- misc/magictg.cpp uses ZR36120 + ZR36050 + ZR36016; +- namco/namcos23.cpp gunwars camera uses VPX3220A, shared with DC10(old) and DC30/DC30+; +- nintendo/cham24.cpp has SAA7111A on-board, reused with Iomega Buz cards in non-A variant; + **************************************************************************************************/ #include "emu.h" @@ -44,11 +51,12 @@ zr36057_device::zr36057_device(const machine_config &mconfig, device_type type, { // ZR36057PQC Video cutting chipset // device ID reportedly same for ZR36057 and ZR36067, revision 0x02 for latter. - // Four known subvendors: + // Known subvendors list (earlier cards don't define one): // - 0x10317efe: Pinnacle/Miro DC10+ + // - 0x1031d801: Pinnacle/Miro DC30+ // - 0x1031fc00: Pinnacle/Miro DC50, Motion JPEG Capture/CODEC Board - // - 0x12f88a02: Electronic Design GmbH Tekram Video Kit - // - 0x13ca4231: Iomega JPEG/TV Card + // - 0x12f88a02: Electronic Design GmbH Tekram Video Kit a.k.a. Linux Media Labs LML33R10 + // - 0x13ca4231: Iomega Buz JPEG/TV Card // NOTE: subvendor is omitted in '36057 design (missing?), driven at PCIRST time to 32 pins in // '36067 thru pull-up or pull-down resistors (subvendor responsibility?) set_ids(0x11de6057, 0x02, 0x040000, 0x10317efe); @@ -99,10 +107,10 @@ void zr36057_device::software_reset() m_pci_waitstate_control = 0; m_gpio_ddr = 0xff; // all inputs - // GuestBus ID default - // m_gpio_data = 0xf0; - for (int i = 0; i < 4; i++) - m_guestbus.time[i] = 0; + // GuestBus ID default + // m_gpio_data = 0xf0; + for (int i = 0; i < 4; i++) + m_guestbus.time[i] = 0; } void zr36057_device::config_map(address_map &map) @@ -117,8 +125,8 @@ void zr36057_device::asr_map(address_map &map) { map(0x000, 0x003).lrw32( NAME([this] (offs_t offset) { - // NOTE: wants to read-back here, throws "Bus Master ASIC error" otherwise (?) - LOG("Video Front End Horizontal Configuration R\n"); + // NOTE: wants to read-back here, throws "Bus Master ASIC error" otherwise (?) + LOG("Video Front End Horizontal Configuration R\n"); return m_video_frontend.horizontal_config; }), NAME([this] (offs_t offset, u32 data, u32 mem_mask) { @@ -128,7 +136,7 @@ void zr36057_device::asr_map(address_map &map) ); map(0x004, 0x007).lrw32( NAME([this] (offs_t offset) { - LOG("Video Front End Vertical Configuration R\n"); + LOG("Video Front End Vertical Configuration R\n"); return m_video_frontend.vertical_config; }), NAME([this] (offs_t offset, u32 data, u32 mem_mask) { @@ -137,7 +145,7 @@ void zr36057_device::asr_map(address_map &map) }) ); - // ... + // ... map(0x028, 0x02b).lrw32( NAME([this] (offs_t offset) { @@ -149,7 +157,7 @@ void zr36057_device::asr_map(address_map &map) { m_softreset = !!BIT(data, 24); // TODO: will lock all writes in config_map but this bit - // (inclusive of the "all" group?) + // (inclusive of the "all" group?) if (!m_softreset) { software_reset(); @@ -163,39 +171,39 @@ void zr36057_device::asr_map(address_map &map) m_gpio_ddr = data & 0xff; }) ); - map(0x02c, 0x02f).lrw32( - NAME([this] (offs_t offset) { - LOG("General Purpose Pins and GuestBus Control R\n"); + map(0x02c, 0x02f).lrw32( + NAME([this] (offs_t offset) { + LOG("General Purpose Pins and GuestBus Control R\n"); - // The doc claims 0xf0 default for GPIO, but win98 driver will throw "subvendor ID failed" - // while testing various ID combinations here - return (0x7e << 24) | (m_guestbus.time[3] << 12) | (m_guestbus.time[2] << 8) | (m_guestbus.time[1] << 4) | (m_guestbus.time[0] << 0); - }), - NAME([this] (offs_t offset, u32 data, u32 mem_mask) { - LOG("General Purpose Pins and GuestBus Control W %08x & %08x\n", data, mem_mask); + // The doc claims 0xf0 default for GPIO, but win98 driver will throw "subvendor ID failed" + // while testing various ID combinations here + return (0x7e << 24) | (m_guestbus.time[3] << 12) | (m_guestbus.time[2] << 8) | (m_guestbus.time[1] << 4) | (m_guestbus.time[0] << 0); + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + LOG("General Purpose Pins and GuestBus Control W %08x & %08x\n", data, mem_mask); - // if (ACCESSING_BITS_24_31) - // GenPurIO writes, TBD + // if (ACCESSING_BITS_24_31) + // GenPurIO writes, TBD - if (ACCESSING_BITS_8_15) - { - m_guestbus.time[3] = (data >> 12) & 0xf; - m_guestbus.time[2] = (data >> 8) & 0xf; - } + if (ACCESSING_BITS_8_15) + { + m_guestbus.time[3] = (data >> 12) & 0xf; + m_guestbus.time[2] = (data >> 8) & 0xf; + } - if (ACCESSING_BITS_0_7) - { - m_guestbus.time[1] = (data >> 4) & 0xf; - m_guestbus.time[0] = (data >> 0) & 0xf; - } - }) - ); + if (ACCESSING_BITS_0_7) + { + m_guestbus.time[1] = (data >> 4) & 0xf; + m_guestbus.time[0] = (data >> 0) & 0xf; + } + }) + ); - map(0x044, 0x047).lr32( - NAME([this] (offs_t offset) { - LOG("I2C R\n"); - // avoid win98 stall for now - return 0x3; - }) - ); + map(0x044, 0x047).lr32( + NAME([this] (offs_t offset) { + LOG("I2C R\n"); + // avoid win98 stall for now + return 0x3; + }) + ); }