From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnRyY-0000pg-SW for qemu-devel@nongnu.org; Fri, 14 Jun 2013 07:15:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UnRyU-0004pM-Sr for qemu-devel@nongnu.org; Fri, 14 Jun 2013 07:15:26 -0400 Received: from oxygen.pond.sub.org ([2a01:4f8:121:10e4::3]:44250) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnRyU-0004oX-LS for qemu-devel@nongnu.org; Fri, 14 Jun 2013 07:15:22 -0400 From: Markus Armbruster Date: Fri, 14 Jun 2013 13:15:13 +0200 Message-Id: <1371208516-7857-14-git-send-email-armbru@redhat.com> In-Reply-To: <1371208516-7857-1-git-send-email-armbru@redhat.com> References: <1371208516-7857-1-git-send-email-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v3 13/16] boot-order-test: Add tests for PowerPC PREP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, jan.kiszka@siemens.com, Alexander Graf , alex.williamson@redhat.com, qemu-ppc@nongnu.org, aviksil@linux.vnet.ibm.com, afaerber@suse.de Cc: Andreas F=C3=A4rber Cc: Alexander Graf Cc: qemu-ppc@nongnu.org Signed-off-by: Markus Armbruster --- tests/boot-order-test.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/boot-order-test.c b/tests/boot-order-test.c index 003140f..0060905 100644 --- a/tests/boot-order-test.c +++ b/tests/boot-order-test.c @@ -107,6 +107,32 @@ static void test_pc_boot_order(void) test_boot_orders(NULL, read_boot_order_pc, test_cases_pc); } =20 +static uint8_t read_m48t59(uint64_t addr, uint16_t reg) +{ + writeb(addr, reg & 0xff); + writeb(addr + 1, reg >> 8); + return readb(addr + 3); +} + +#define PREP_ISA_IO_BASE 0x80000000 + +static uint64_t read_boot_order_prep(void) +{ + return read_m48t59(PREP_ISA_IO_BASE + 0x74, 0x34); +} + +static const boot_order_test test_cases_prep[] =3D { + { "", '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 void read_fw_cfg(uint64_t cfg_addr, uint16_t cmd, void *buf, size_t len) { @@ -161,6 +187,7 @@ int main(int argc, char *argv[]) if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0= ) { qtest_add_func("boot-order/pc", test_pc_boot_order); } else if (strcmp(arch, "ppc") =3D=3D 0 || strcmp(arch, "ppc64") =3D= =3D 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", --=20 1.7.11.7