blob: 8ac95b89f7292a3f29dc6d413f478b5bbff21ba8 [file] [log] [blame]
Li Qiangd8dd1092020-09-21 09:06:05 -07001/*
Paolo Bonziniaf05fff2021-03-19 04:44:42 -04002 * QTest testcases for ich9 case
Li Qiangd8dd1092020-09-21 09:06:05 -07003 *
4 * Copyright (c) 2020 Li Qiang <liq3ea@gmail.com>
5 *
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
8 */
9
10#include "qemu/osdep.h"
11
Marc-André Lureau907b5102022-03-30 13:39:05 +040012#include "libqtest.h"
Li Qiangd8dd1092020-09-21 09:06:05 -070013
Alexander Bulekovfd250172020-11-02 11:33:36 -050014static void test_lp1878642_pci_bus_get_irq_level_assert(void)
15{
16 QTestState *s;
17
18 s = qtest_init("-M pc-q35-5.0 "
Alexander Bulekovc8ffacb2021-02-16 13:13:15 -050019 "-nographic -monitor none -serial none");
Alexander Bulekovfd250172020-11-02 11:33:36 -050020
Paolo Bonziniaf05fff2021-03-19 04:44:42 -040021 qtest_outl(s, 0xcf8, 0x8000f840); /* PMBASE */
22 qtest_outl(s, 0xcfc, 0x5d00);
23 qtest_outl(s, 0xcf8, 0x8000f844); /* ACPI_CTRL */
24 qtest_outl(s, 0xcfc, 0xeb);
25 qtest_outw(s, 0x5d02, 0x205d);
Philippe Mathieu-Daudé6536c9e2020-12-01 20:10:23 +010026 qtest_quit(s);
Alexander Bulekovfd250172020-11-02 11:33:36 -050027}
28
Li Qiangd8dd1092020-09-21 09:06:05 -070029int main(int argc, char **argv)
30{
31 const char *arch = qtest_get_arch();
32
33 g_test_init(&argc, &argv, NULL);
34
35 if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
Paolo Bonziniaf05fff2021-03-19 04:44:42 -040036 qtest_add_func("ich9/test_lp1878642_pci_bus_get_irq_level_assert",
Alexander Bulekovfd250172020-11-02 11:33:36 -050037 test_lp1878642_pci_bus_get_irq_level_assert);
Li Qiangd8dd1092020-09-21 09:06:05 -070038 }
39
40 return g_test_run();
41}