diff options
author | Farhan Ali <alifm@linux.vnet.ibm.com> | 2016-04-18 13:45:32 +0200 |
---|---|---|
committer | Cornelia Huck <cornelia.huck@de.ibm.com> | 2017-05-02 15:08:54 +0200 |
commit | 82ca394194342dd050034e25c5a61a854d82911a (patch) | |
tree | 8e3916ecd04cf299674abf537e9d38031b34ecf3 /pc-bios/s390-ccw | |
parent | 9dd7823b70ccbc812b4a977345dd0a28be0c4b3e (diff) |
pc-bios/s390-ccw: add boot entry selection for ECKD DASD
1. change a bit definition of ScsiMbr to allow an array of pointers
2. add loadparm fetch to boot script processing
3. apply loadparm index to boot entry selection, if any
Initial patch from Eugene (jno) Dvurechenski.
Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com>
Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'pc-bios/s390-ccw')
-rw-r--r-- | pc-bios/s390-ccw/bootmap.c | 16 | ||||
-rw-r--r-- | pc-bios/s390-ccw/bootmap.h | 2 |
2 files changed, 12 insertions, 6 deletions
diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c index e39e67e07b..e974350b6f 100644 --- a/pc-bios/s390-ccw/bootmap.c +++ b/pc-bios/s390-ccw/bootmap.c @@ -183,15 +183,21 @@ static block_number_t load_eckd_segments(block_number_t blk, uint64_t *address) static void run_eckd_boot_script(block_number_t mbr_block_nr) { int i; + unsigned int loadparm = get_loadparm_index(); block_number_t block_nr; uint64_t address; - ScsiMbr *scsi_mbr = (void *)sec; + ScsiMbr *bte = (void *)sec; /* Eckd bootmap table entry */ BootMapScript *bms = (void *)sec; + debug_print_int("loadparm", loadparm); + IPL_assert(loadparm < 31, "loadparm value greater than" + " maximum number of boot entries allowed"); + memset(sec, FREE_SPACE_FILLER, sizeof(sec)); read_block(mbr_block_nr, sec, "Cannot read MBR"); - block_nr = eckd_block_num((void *)&(scsi_mbr->blockptr)); + block_nr = eckd_block_num((void *)&(bte->blockptr[loadparm])); + IPL_assert(block_nr != -1, "No Boot Map"); memset(sec, FREE_SPACE_FILLER, sizeof(sec)); read_block(block_nr, sec, "Cannot read Boot Map Script"); @@ -459,11 +465,11 @@ static void ipl_scsi(void) debug_print_int("MBR Version", mbr->version_id); IPL_check(mbr->version_id == 1, "Unknown MBR layout version, assuming version 1"); - debug_print_int("program table", mbr->blockptr.blockno); - IPL_assert(mbr->blockptr.blockno, "No Program Table"); + debug_print_int("program table", mbr->blockptr[0].blockno); + IPL_assert(mbr->blockptr[0].blockno, "No Program Table"); /* Parse the program table */ - read_block(mbr->blockptr.blockno, sec, + read_block(mbr->blockptr[0].blockno, sec, "Error reading Program Table"); IPL_assert(magic_match(sec, ZIPL_MAGIC), "No zIPL magic in PT"); diff --git a/pc-bios/s390-ccw/bootmap.h b/pc-bios/s390-ccw/bootmap.h index 9073de2238..7f367820f3 100644 --- a/pc-bios/s390-ccw/bootmap.h +++ b/pc-bios/s390-ccw/bootmap.h @@ -70,7 +70,7 @@ typedef struct ScsiMbr { uint8_t magic[4]; uint32_t version_id; uint8_t reserved[8]; - ScsiBlockPtr blockptr; + ScsiBlockPtr blockptr[]; } __attribute__ ((packed)) ScsiMbr; #define ZIPL_MAGIC "zIPL" |