[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 16/16] tco-test: fix up config accesses and re-ena
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL v2 16/16] tco-test: fix up config accesses and re-enable |
Date: |
Wed, 8 Jul 2015 12:42:17 +0300 |
The mistake that made the test fail was that it tried to
use a BAR address as an offset for config accesses to LPC.
Config accesses don't need a BAR, and LPC does not have one. Don't
attempt to map it.
With this change applied, TCO test passes, so re-enable it.
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
tests/tco-test.c | 15 +++------------
tests/Makefile | 2 +-
2 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/tests/tco-test.c b/tests/tco-test.c
index 6a48188..419f7cf 100644
--- a/tests/tco-test.c
+++ b/tests/tco-test.c
@@ -44,7 +44,6 @@ typedef struct {
const char *args;
bool noreboot;
QPCIDevice *dev;
- void *lpc_base;
void *tco_io_base;
} TestData;
@@ -65,22 +64,14 @@ static void test_init(TestData *d)
d->dev = qpci_device_find(bus, QPCI_DEVFN(0x1f, 0x00));
g_assert(d->dev != NULL);
- /* map PCI-to-LPC bridge interface BAR */
- d->lpc_base = qpci_iomap(d->dev, 0, NULL);
-
qpci_device_enable(d->dev);
- g_assert(d->lpc_base != NULL);
-
/* set ACPI PM I/O space base address */
- qpci_config_writel(d->dev, (uintptr_t)d->lpc_base + ICH9_LPC_PMBASE,
- PM_IO_BASE_ADDR | 0x1);
+ qpci_config_writel(d->dev, ICH9_LPC_PMBASE, PM_IO_BASE_ADDR | 0x1);
/* enable ACPI I/O */
- qpci_config_writeb(d->dev, (uintptr_t)d->lpc_base + ICH9_LPC_ACPI_CTRL,
- 0x80);
+ qpci_config_writeb(d->dev, ICH9_LPC_ACPI_CTRL, 0x80);
/* set Root Complex BAR */
- qpci_config_writel(d->dev, (uintptr_t)d->lpc_base + ICH9_LPC_RCBA,
- RCBA_BASE_ADDR | 0x1);
+ qpci_config_writel(d->dev, ICH9_LPC_RCBA, RCBA_BASE_ADDR | 0x1);
d->tco_io_base = (void *)((uintptr_t)PM_IO_BASE_ADDR + 0x60);
}
diff --git a/tests/Makefile b/tests/Makefile
index 52ae178..ef1e981 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -152,7 +152,7 @@ check-qtest-i386-y += tests/i440fx-test$(EXESUF)
check-qtest-i386-y += tests/fw_cfg-test$(EXESUF)
check-qtest-i386-y += tests/drive_del-test$(EXESUF)
check-qtest-i386-y += tests/wdt_ib700-test$(EXESUF)
-#check-qtest-i386-y += tests/tco-test$(EXESUF)
+check-qtest-i386-y += tests/tco-test$(EXESUF)
gcov-files-i386-y += hw/watchdog/watchdog.c hw/watchdog/wdt_ib700.c
check-qtest-i386-y += $(check-qtest-pci-y)
gcov-files-i386-y += $(gcov-files-pci-y)
--
MST
- [Qemu-devel] [PULL v2 05/16] tests: add testcase for TCO watchdog emulation, (continued)
- [Qemu-devel] [PULL v2 05/16] tests: add testcase for TCO watchdog emulation, Michael S. Tsirkin, 2015/07/08
- [Qemu-devel] [PULL v2 07/16] hw/i386/pc: factor out pc_cmos_init_floppy(), Michael S. Tsirkin, 2015/07/08
- [Qemu-devel] [PULL v2 08/16] hw/i386/pc: reflect any FDC @ ioport 0x3f0 in the CMOS, Michael S. Tsirkin, 2015/07/08
- [Qemu-devel] [PULL v2 09/16] hw/i386/pc: don't carry FDC from pc_basic_device_init() to pc_cmos_init(), Michael S. Tsirkin, 2015/07/08
- [Qemu-devel] [PULL v2 10/16] virtio_net: reuse constants from linux, Michael S. Tsirkin, 2015/07/08
- [Qemu-devel] [PULL v2 12/16] pcie: Set the "link active" in the link status register, Michael S. Tsirkin, 2015/07/08
- [Qemu-devel] [PULL v2 13/16] virtio: define virtio_pci_cfg_cap in header., Michael S. Tsirkin, 2015/07/08
- [Qemu-devel] [PULL v2 15/16] virtio fix cfg endian-ness for BE targets, Michael S. Tsirkin, 2015/07/08
- [Qemu-devel] [PULL v2 14/16] virtio-pci: implement cfg capability, Michael S. Tsirkin, 2015/07/08
- [Qemu-devel] [PULL v2 11/16] pci_regs.h: import from linux, Michael S. Tsirkin, 2015/07/08
- [Qemu-devel] [PULL v2 16/16] tco-test: fix up config accesses and re-enable,
Michael S. Tsirkin <=
- Re: [Qemu-devel] [PULL v2 00/16] pc,virtio,pci: fixes and updates, Peter Maydell, 2015/07/08