2011-08-25 23:38:59 +02:00
|
|
|
/*
|
|
|
|
* QEMU Alpha PCI support functions.
|
|
|
|
*
|
|
|
|
* Some of this isn't very Alpha specific at all.
|
|
|
|
*
|
|
|
|
* ??? Sparse memory access not implemented.
|
|
|
|
*/
|
|
|
|
|
2016-01-26 19:17:04 +01:00
|
|
|
#include "qemu/osdep.h"
|
2022-12-22 11:03:24 +01:00
|
|
|
#include "hw/pci/pci_host.h"
|
2013-03-18 17:36:02 +01:00
|
|
|
#include "alpha_sys.h"
|
2012-12-17 18:20:00 +01:00
|
|
|
#include "qemu/log.h"
|
2015-11-13 13:23:45 +01:00
|
|
|
#include "trace.h"
|
2011-08-25 23:38:59 +02:00
|
|
|
|
|
|
|
|
2013-07-09 00:46:37 +02:00
|
|
|
/* Fallback for unassigned PCI I/O operations. Avoids MCHK. */
|
|
|
|
|
|
|
|
static uint64_t ignore_read(void *opaque, hwaddr addr, unsigned size)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ignore_write(void *opaque, hwaddr addr, uint64_t v, unsigned size)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
const MemoryRegionOps alpha_pci_ignore_ops = {
|
|
|
|
.read = ignore_read,
|
|
|
|
.write = ignore_write,
|
|
|
|
.endianness = DEVICE_LITTLE_ENDIAN,
|
|
|
|
.valid = {
|
|
|
|
.min_access_size = 1,
|
|
|
|
.max_access_size = 8,
|
|
|
|
},
|
|
|
|
.impl = {
|
|
|
|
.min_access_size = 1,
|
|
|
|
.max_access_size = 8,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-08-25 23:38:59 +02:00
|
|
|
/* PCI config space reads/writes, to byte-word addressable memory. */
|
2012-10-23 12:30:10 +02:00
|
|
|
static uint64_t bw_conf1_read(void *opaque, hwaddr addr,
|
2011-08-25 23:38:59 +02:00
|
|
|
unsigned size)
|
|
|
|
{
|
|
|
|
PCIBus *b = opaque;
|
|
|
|
return pci_data_read(b, addr, size);
|
|
|
|
}
|
|
|
|
|
2012-10-23 12:30:10 +02:00
|
|
|
static void bw_conf1_write(void *opaque, hwaddr addr,
|
2011-08-25 23:38:59 +02:00
|
|
|
uint64_t val, unsigned size)
|
|
|
|
{
|
|
|
|
PCIBus *b = opaque;
|
|
|
|
pci_data_write(b, addr, val, size);
|
|
|
|
}
|
|
|
|
|
|
|
|
const MemoryRegionOps alpha_pci_conf1_ops = {
|
|
|
|
.read = bw_conf1_read,
|
|
|
|
.write = bw_conf1_write,
|
|
|
|
.endianness = DEVICE_LITTLE_ENDIAN,
|
|
|
|
.impl = {
|
|
|
|
.min_access_size = 1,
|
|
|
|
.max_access_size = 4,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* PCI/EISA Interrupt Acknowledge Cycle. */
|
|
|
|
|
2012-10-23 12:30:10 +02:00
|
|
|
static uint64_t iack_read(void *opaque, hwaddr addr, unsigned size)
|
2011-08-25 23:38:59 +02:00
|
|
|
{
|
|
|
|
return pic_read_irq(isa_pic);
|
|
|
|
}
|
|
|
|
|
2012-10-23 12:30:10 +02:00
|
|
|
static void special_write(void *opaque, hwaddr addr,
|
2011-08-25 23:38:59 +02:00
|
|
|
uint64_t val, unsigned size)
|
|
|
|
{
|
2015-11-13 13:23:45 +01:00
|
|
|
trace_alpha_pci_iack_write();
|
2011-08-25 23:38:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
const MemoryRegionOps alpha_pci_iack_ops = {
|
|
|
|
.read = iack_read,
|
|
|
|
.write = special_write,
|
|
|
|
.endianness = DEVICE_LITTLE_ENDIAN,
|
|
|
|
.valid = {
|
|
|
|
.min_access_size = 4,
|
|
|
|
.max_access_size = 4,
|
|
|
|
},
|
|
|
|
.impl = {
|
|
|
|
.min_access_size = 4,
|
|
|
|
.max_access_size = 4,
|
|
|
|
},
|
|
|
|
};
|