diff options
author | Alexander Yarygin <yarygin@linux.vnet.ibm.com> | 2015-07-31 17:04:51 +0300 |
---|---|---|
committer | Cornelia Huck <cornelia.huck@de.ibm.com> | 2016-05-17 15:50:29 +0200 |
commit | d046c51dad3bda03e4c012c83411842b92271542 (patch) | |
tree | 1e23abd83114274998f2dc6f3cad2c9127cbf822 /pc-bios/s390-ccw/main.c | |
parent | 3041e3bead8df443e5212ae8a608cbec81bc90bd (diff) |
pc-bios/s390-ccw: Get device address via diag 308/6
To IPL from a device, pc-bios receives from qemu a device address via
general register 7. The better way to do it is to use diag308/6
instruction which returns so called
"IplParameterBlock". IplParameterBlock contains the device address for
IPL and additional parameters that can be used by pc-bios.
This patch allows pc-bios to get device address via diag308/6 and
doesn't use gr7 passed boot information anymore.
Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'pc-bios/s390-ccw/main.c')
-rw-r--r-- | pc-bios/s390-ccw/main.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c index 1c9e0791ab..9446ecc235 100644 --- a/pc-bios/s390-ccw/main.c +++ b/pc-bios/s390-ccw/main.c @@ -12,8 +12,8 @@ #include "virtio.h" char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE))); -uint64_t boot_value; static SubChannelId blk_schid = { .one = 1 }; +IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE))); /* * Priniciples of Operations (SA22-7832-09) chapter 17 requires that @@ -61,7 +61,7 @@ static bool find_dev(Schib *schib, int dev_no) return false; } -static void virtio_setup(uint64_t dev_info) +static void virtio_setup(void) { Schib schib; int ssid; @@ -75,12 +75,18 @@ static void virtio_setup(uint64_t dev_info) */ enable_mss_facility(); - if (dev_info != -1) { - dev_no = dev_info & 0xffff; - debug_print_int("device no. ", dev_no); - blk_schid.ssid = (dev_info >> 16) & 0x3; - debug_print_int("ssid ", blk_schid.ssid); - found = find_dev(&schib, dev_no); + if (store_iplb(&iplb)) { + switch (iplb.pbt) { + case S390_IPL_TYPE_CCW: + dev_no = iplb.ccw.devno; + debug_print_int("device no. ", dev_no); + blk_schid.ssid = iplb.ccw.ssid & 0x3; + debug_print_int("ssid ", blk_schid.ssid); + found = find_dev(&schib, dev_no); + break; + default: + panic("List-directed IPL not supported yet!\n"); + } } else { for (ssid = 0; ssid < 0x3; ssid++) { blk_schid.ssid = ssid; @@ -101,8 +107,7 @@ static void virtio_setup(uint64_t dev_info) int main(void) { sclp_setup(); - debug_print_int("boot reg[7] ", boot_value); - virtio_setup(boot_value); + virtio_setup(); zipl_load(); /* no return */ |