summaryrefslogtreecommitdiff
path: root/tests/boot-order-test.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2013-06-26 15:52:20 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2013-07-18 13:27:47 -0500
commite99f87cc86ba57a57d2472342a51d21f1e8b4966 (patch)
tree8a8051778399ad09658c1e8274e7200059707be7 /tests/boot-order-test.c
parent484986e24282e922e5acb1db2c2b324e55c39ea4 (diff)
downloadqemu-e99f87cc86ba57a57d2472342a51d21f1e8b4966.tar.gz
boot-order-test: Add tests for PowerPC PREP
Cc: Andreas Färber <afaerber@suse.de> Cc: Alexander Graf <agraf@suse.de> Cc: qemu-ppc@nongnu.org Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1372254743-15808-10-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'tests/boot-order-test.c')
-rw-r--r--tests/boot-order-test.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/boot-order-test.c b/tests/boot-order-test.c
index c711c712f4..75b164219d 100644
--- a/tests/boot-order-test.c
+++ b/tests/boot-order-test.c
@@ -112,6 +112,30 @@ static void test_pc_boot_order(void)
test_boot_orders(NULL, read_boot_order_pc, test_cases_pc);
}
+static uint8_t read_m48t59(uint64_t addr, uint16_t reg)
+{
+ writeb(addr, reg & 0xff);
+ writeb(addr + 1, reg >> 8);
+ return readb(addr + 3);
+}
+
+static uint64_t read_boot_order_prep(void)
+{
+ return read_m48t59(0x80000000 + 0x74, 0x34);
+}
+
+static const boot_order_test test_cases_prep[] = {
+ { "", 'c', 'c' },
+ { "-boot c", 'c', 'c' },
+ { "-boot d", 'd', 'd' },
+ {}
+};
+
+static void test_prep_boot_order(void)
+{
+ test_boot_orders("prep", read_boot_order_prep, test_cases_prep);
+}
+
static uint64_t read_boot_order_pmac(void)
{
QFWCFG *fw_cfg = mm_fw_cfg_init(0xf0000510);
@@ -146,6 +170,7 @@ int main(int argc, char *argv[])
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
qtest_add_func("boot-order/pc", test_pc_boot_order);
} else if (strcmp(arch, "ppc") == 0 || strcmp(arch, "ppc64") == 0) {
+ qtest_add_func("boot-order/prep", test_prep_boot_order);
qtest_add_func("boot-order/pmac_oldworld",
test_pmac_oldworld_boot_order);
qtest_add_func("boot-order/pmac_newworld",