diff mbox

[RFC,12/15] s390-bios: Use control unit type to determine boot method

Message ID 1530811543-6881-13-git-send-email-jjherne@linux.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jason J. Herne July 5, 2018, 5:25 p.m. UTC
From: "Jason J. Herne" <jjherne@linux.vnet.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 <jjherne@linux.vnet.ibm.com>
Signed-off-by: Jason J. Herne <jjherne@linux.ibm.com>
---
 pc-bios/s390-ccw/main.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Comments

Thomas Huth July 17, 2018, 6:25 p.m. UTC | #1
On 05.07.2018 19:25, Jason J. Herne wrote:
> From: "Jason J. Herne" <jjherne@linux.vnet.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 <jjherne@linux.vnet.ibm.com>
> Signed-off-by: Jason J. Herne <jjherne@linux.ibm.com>
> ---
>  pc-bios/s390-ccw/main.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
> index 20c30c6..e4236c0 100644
> --- a/pc-bios/s390-ccw/main.c
> +++ b/pc-bios/s390-ccw/main.c
> @@ -204,9 +204,16 @@ int main(void)
>      cio_setup();
>      boot_setup();
>      find_boot_device();
> +    enable_subchannel(blk_schid);
>  
> -    virtio_setup();
> -    zipl_load(); /* no return */
> +    switch (cu_type(blk_schid)) {
> +    case 0x3832:  /* Virtio device */

Could we please get some #defines for the magic numbers?

 Thomas
diff mbox

Patch

diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
index 20c30c6..e4236c0 100644
--- a/pc-bios/s390-ccw/main.c
+++ b/pc-bios/s390-ccw/main.c
@@ -204,9 +204,16 @@  int main(void)
     cio_setup();
     boot_setup();
     find_boot_device();
+    enable_subchannel(blk_schid);
 
-    virtio_setup();
-    zipl_load(); /* no return */
+    switch (cu_type(blk_schid)) {
+    case 0x3832:  /* Virtio device */
+        virtio_setup();
+        zipl_load(); /* no return */
+        break;
+    default:
+        panic("Attempting to boot from unexpected device type\n");
+    }
 
     panic("Failed to load OS from hard disk\n");
     return 0; /* make compiler happy */