From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:60385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goTSj-0000C3-1T for qemu-devel@nongnu.org; Tue, 29 Jan 2019 08:30:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1goTSh-0000Pm-5y for qemu-devel@nongnu.org; Tue, 29 Jan 2019 08:30:01 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:58042 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1goTSh-0000FB-1K for qemu-devel@nongnu.org; Tue, 29 Jan 2019 08:29:59 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x0TDRRaU036462 for ; Tue, 29 Jan 2019 08:29:47 -0500 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0a-001b2d01.pphosted.com with ESMTP id 2qaqp08bbv-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 29 Jan 2019 08:29:47 -0500 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 29 Jan 2019 13:29:46 -0000 From: "Jason J. Herne" Date: Tue, 29 Jan 2019 08:29:20 -0500 In-Reply-To: <1548768562-20007-1-git-send-email-jjherne@linux.ibm.com> References: <1548768562-20007-1-git-send-email-jjherne@linux.ibm.com> Message-Id: <1548768562-20007-14-git-send-email-jjherne@linux.ibm.com> Subject: [Qemu-devel] [PATCH 13/15] s390-bios: Use control unit type to determine boot method List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, cohuck@redhat.com, pasic@linux.ibm.com, alifm@linux.ibm.com, borntraeger@de.ibm.com The boot method is different depending on which device type we are booting from. Let's examine the control unit type to determine if we're a virtio device. We'll eventually add a case to check for a real dasd device here as well. Signed-off-by: Jason J. Herne --- pc-bios/s390-ccw/main.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c index fa90aa3..5ee02c3 100644 --- a/pc-bios/s390-ccw/main.c +++ b/pc-bios/s390-ccw/main.c @@ -200,13 +200,24 @@ static void virtio_setup(void) int main(void) { + uint16_t cutype; + sclp_setup(); css_setup(); boot_setup(); find_boot_device(); + enable_subchannel(blk_schid); - virtio_setup(); - zipl_load(); /* no return */ + cutype = cu_type(blk_schid) ; + switch (cutype) { + case CU_TYPE_VIRTIO: + virtio_setup(); + zipl_load(); /* no return */ + break; + default: + print_int("Attempting to boot from unexpected device type", cutype); + panic(""); + } panic("Failed to load OS from hard disk\n"); return 0; /* make compiler happy */ -- 2.7.4