summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/i82371eb_usb.cpp
blob: 4a3a74caaddf0f88d1dcd3e95a9992beed0d553a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// license: BSD-3-Clause
// copyright-holders: Angelo Salese
/**************************************************************************************************

    PIIX4E USB interface

    TODO:
    - Actual USB ports;

**************************************************************************************************/

#include "emu.h"
#include "i82371eb_usb.h"

#define LOG_IO     (1U << 1) // log PCI register accesses
#define LOG_TODO   (1U << 2) // log unimplemented registers
#define LOG_MAP    (1U << 3) // log full remaps

#define VERBOSE (LOG_GENERAL | LOG_IO | LOG_TODO | LOG_MAP)
//#define LOG_OUTPUT_FUNC osd_printf_warning

#include "logmacro.h"

#define LOGIO(...)     LOGMASKED(LOG_IO,   __VA_ARGS__)
#define LOGMAP(...)    LOGMASKED(LOG_MAP,  __VA_ARGS__)
#define LOGTODO(...)   LOGMASKED(LOG_TODO, __VA_ARGS__)

DEFINE_DEVICE_TYPE(I82371EB_USB, i82371eb_usb_device, "i82371eb_usb", "Intel 82371EB PIIX4E USB Host Controller")

i82371eb_usb_device::i82371eb_usb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
	: pci_device(mconfig, I82371EB_USB, tag, owner, clock)

{
	// 0x0c0300 - Serial Bus Controller, USB, UHCI Host
	// rev PIIX4E A-0 / PIIX4M A-0 = 0x01
	set_ids(0x80867112, 0x01, 0x0c0300, 0x00);
}

void i82371eb_usb_device::device_add_mconfig(machine_config &config)
{

}

void i82371eb_usb_device::config_map(address_map &map)
{
	pci_device::config_map(map);
	// 0x60 sbrnum - serial bus release number
	// 0xc0-0xc1 legsup - Legacy Support Register
	map(0x60, 0xff).rw(FUNC(i82371eb_usb_device::unmap_log_r), FUNC(i82371eb_usb_device::unmap_log_w));
}

void i82371eb_usb_device::io_map(address_map &map)
{

}

void i82371eb_usb_device::map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space,
							uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space)
{
//  io_space->install_device(0, 0x03ff, *this, &i82371eb_usb_device::io_map);
}

void i82371eb_usb_device::device_start()
{
	pci_device::device_start();

	skip_map_regs(4);
	add_map(32, M_IO, FUNC(i82371eb_usb_device::io_map));

	// INTD#
	intr_pin = 4;
}


void i82371eb_usb_device::device_reset()
{
	pci_device::device_reset();

	command = 0x0000;
	status = 0x0280;
}

/*
 * Debugging
 */

u8 i82371eb_usb_device::unmap_log_r(offs_t offset)
{
	LOGTODO("I82371EB_USB Unemulated [%02x] R\n", offset + 0x60);
	return 0;
}

void i82371eb_usb_device::unmap_log_w(offs_t offset, u8 data)
{
	LOGTODO("I82371EB_USB Unemulated [%02x] %02x W\n", offset + 0x60, data);
}