summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/ibm21s850.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/ibm21s850.cpp')
-rw-r--r--src/devices/machine/ibm21s850.cpp67
1 files changed, 48 insertions, 19 deletions
diff --git a/src/devices/machine/ibm21s850.cpp b/src/devices/machine/ibm21s850.cpp
index fdd8d9c662d..227d997f70f 100644
--- a/src/devices/machine/ibm21s850.cpp
+++ b/src/devices/machine/ibm21s850.cpp
@@ -2,8 +2,8 @@
// copyright-holders:Ryan Holtz
/*************************************************************
- IBM 21S850 IEEE 1394 400Mb/s Physical Layer
- Transceiver (PHY)
+ IBM 21S850 IEEE-1394 400Mb/s 1-Port PHY
+ IBM 21S851 IEEE-1394 400Mb/s 3-Port PHY
Skeleton device
@@ -17,18 +17,29 @@
#define LOG_UNKNOWNS (1 << 3)
#define LOG_ALL (LOG_READS | LOG_WRITES | LOG_UNKNOWNS)
-#define VERBOSE (0)
+#define VERBOSE (LOG_ALL)
#include "logmacro.h"
-DEFINE_DEVICE_TYPE(IBM21S850, ibm21s850_device, "ibm21s850", "IBM 21S850 IEEE 1394 PHY")
+DEFINE_DEVICE_TYPE(IBM21S850, ibm21s850_device, "ibm21s850", "IBM 21S850 IEEE-1394 1-Port PHY")
+DEFINE_DEVICE_TYPE(IBM21S851, ibm21s851_device, "ibm21s851", "IBM 21S850 IEEE-1394 3-Port PHY")
-ibm21s850_device::ibm21s850_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, IBM21S850, tag, owner, clock)
+ibm21s85x_base_device::ibm21s85x_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, type, tag, owner, clock)
, m_reset_cb(*this)
{
}
-void ibm21s850_device::device_start()
+ibm21s850_device::ibm21s850_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : ibm21s85x_base_device(mconfig, IBM21S850, tag, owner, clock)
+{
+}
+
+ibm21s851_device::ibm21s851_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : ibm21s85x_base_device(mconfig, IBM21S851, tag, owner, clock)
+{
+}
+
+void ibm21s85x_base_device::device_start()
{
save_item(NAME(m_regs));
@@ -37,22 +48,40 @@ void ibm21s850_device::device_start()
m_reset_cb.resolve_safe();
}
-void ibm21s850_device::device_reset()
+void ibm21s85x_base_device::device_reset()
{
memset(m_regs, 0, 0x10);
- m_regs[ROOT_OFFS] |= ROOT_MASK; // Root node
- m_regs[CABLE_PWR_OFFS] |= CABLE_PWR_MASK; // Cable is powered
- m_regs[NUM_PORTS_OFFS] |= 0x01; // 1 port available
- m_regs[CONNECTION1_OFFS] |= CONNECTION1_MASK; // Port 1 connected
- m_regs[ENV_OFFS] |= 1 << ENV_SHIFT; // Cable PHY environment
- m_regs[REG_COUNT_OFFS] |= 0x09; // 9 registers following the standard block on 21S850
- m_regs[ARB_PHASE_OFFS] |= 2 << ARB_PHASE_OFFS; // Normal arbitration phase (we skip bus reset for now)
+ m_regs[ROOT_OFFS] |= ROOT_MASK; // Root node
+ m_regs[GAP_COUNT_OFFS] |= 0x3f; // Initial reset value
+ m_regs[SPEED_OFFS] |= SPEED_400MBIT << SPEED_SHIFT; // 21S850 and 21S851 both indicate maximum 400Mb/s rate
+ m_regs[ENHANCED_REGS_OFFS] |= ENHANCED_REGS_MASK; // 21S850 and 21S851 both have an enhanced register map
+ m_regs[CABLE_PWR_OFFS] |= CABLE_PWR_MASK; // Cable is powered
+ m_regs[CONNECTION1_OFFS] |= CONNECTION1_MASK; // Port 1 connected
+ m_regs[ARB_PHASE_OFFS] |= PHASE_BUS_RESET << ARB_PHASE_OFFS; // Power up in Bus Reset phase
power_on_reset();
}
-void ibm21s850_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+void ibm21s850_device::device_reset()
+{
+ ibm21s85x_base_device::device_reset();
+
+ m_regs[NUM_PORTS_OFFS] |= 0x01; // 1 port available
+ m_regs[ENV_OFFS] |= 1 << ENV_SHIFT; // Cable PHY environment
+ m_regs[REG_COUNT_OFFS] |= 0x09; // 9 registers following the standard block on 21S850
+}
+
+void ibm21s851_device::device_reset()
+{
+ ibm21s85x_base_device::device_reset();
+
+ m_regs[NUM_PORTS_OFFS] |= 0x03; // 3 port available
+ m_regs[ENV_OFFS] |= 1 << ENV_SHIFT; // Cable PHY environment
+ m_regs[REG_COUNT_OFFS] |= 0x0b; // 11 registers following the standard block on 21S851
+}
+
+void ibm21s85x_base_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
if (id == TIMER_RESET)
{
@@ -69,7 +98,7 @@ void ibm21s850_device::device_timer(emu_timer &timer, device_timer_id id, int pa
}
}
-uint8_t ibm21s850_device::read(offs_t offset)
+uint8_t ibm21s85x_base_device::read(offs_t offset)
{
if (offset < 0x10)
{
@@ -80,12 +109,12 @@ uint8_t ibm21s850_device::read(offs_t offset)
return 0;
}
-void ibm21s850_device::power_on_reset()
+void ibm21s85x_base_device::power_on_reset()
{
m_reset_timer->adjust(attotime::zero, 0);
}
-void ibm21s850_device::write(offs_t offset, uint8_t data)
+void ibm21s85x_base_device::write(offs_t offset, uint8_t data)
{
switch (offset)
{