aboutsummaryrefslogtreecommitdiffstats
path: root/src/hw
diff options
context:
space:
mode:
authorSam Eiderman <shmuel.eiderman@oracle.com>2019-06-26 15:38:16 +0300
committerGerd Hoffmann <kraxel@redhat.com>2019-11-18 14:58:37 +0100
commitc9ba5276e3217ac6a1ec772dbebf568ba3a8a55d (patch)
treedaecbceedb55af887db6135c400493da702abb99 /src/hw
parentd49496f94ed469e18f9aeea4c014d1ab968ff940 (diff)
downloadseabios-c9ba5276e3217ac6a1ec772dbebf568ba3a8a55d.tar.gz
geometry: Apply LCHS values for boot devices
Boot devices which use overriden LCHS values are: * ata * ahci * scsi * esp * lsi * megasas * mpt * pvscsi * virtio * virtio-blk We use these values in get_translation() and setup_translation() by introducing a new translation type: "TRANSLATION_HOST". We treat this translation as TRANSLATION_NONE in fill_ata_edd(), although this does not really matter since now the translation between physical and logical geometry does not exist. Reviewed-by: Karl Heubaum <karl.heubaum@oracle.com> Reviewed-by: Arbel Moshe <arbel.moshe@oracle.com> Signed-off-by: Sam Eiderman <shmuel.eiderman@oracle.com> Message-Id: <20190626123816.8907-6-shmuel.eiderman@oracle.com>
Diffstat (limited to 'src/hw')
-rw-r--r--src/hw/ahci.c1
-rw-r--r--src/hw/ata.c8
-rw-r--r--src/hw/esp-scsi.c2
-rw-r--r--src/hw/lsi-scsi.c2
-rw-r--r--src/hw/megasas.c1
-rw-r--r--src/hw/mpt-scsi.c2
-rw-r--r--src/hw/pvscsi.c1
-rw-r--r--src/hw/virtio-blk.c2
-rw-r--r--src/hw/virtio-scsi.c2
9 files changed, 21 insertions, 0 deletions
diff --git a/src/hw/ahci.c b/src/hw/ahci.c
index 45dc6613..d45b4307 100644
--- a/src/hw/ahci.c
+++ b/src/hw/ahci.c
@@ -594,6 +594,7 @@ static int ahci_port_setup(struct ahci_port_s *port)
, ata_extract_version(buffer));
port->prio = bootprio_find_ata_device(ctrl->pci_tmp, pnr, 0);
}
+ boot_lchs_find_ata_device(ctrl->pci_tmp, pnr, 0, &(port->drive.lchs));
return 0;
}
diff --git a/src/hw/ata.c b/src/hw/ata.c
index b6e073cf..f788ce71 100644
--- a/src/hw/ata.c
+++ b/src/hw/ata.c
@@ -755,6 +755,10 @@ init_drive_atapi(struct atadrive_s *dummy, u16 *buffer)
int prio = bootprio_find_ata_device(adrive->chan_gf->pci_tmp,
adrive->chan_gf->chanid,
adrive->slave);
+ boot_lchs_find_ata_device(adrive->chan_gf->pci_tmp,
+ adrive->chan_gf->chanid,
+ adrive->slave,
+ &(adrive->drive.lchs));
boot_add_cd(&adrive->drive, desc, prio);
}
@@ -805,6 +809,10 @@ init_drive_ata(struct atadrive_s *dummy, u16 *buffer)
int prio = bootprio_find_ata_device(adrive->chan_gf->pci_tmp,
adrive->chan_gf->chanid,
adrive->slave);
+ boot_lchs_find_ata_device(adrive->chan_gf->pci_tmp,
+ adrive->chan_gf->chanid,
+ adrive->slave,
+ &(adrive->drive.lchs));
// Register with bcv system.
boot_add_hd(&adrive->drive, desc, prio);
diff --git a/src/hw/esp-scsi.c b/src/hw/esp-scsi.c
index ffd86d0f..cc25f227 100644
--- a/src/hw/esp-scsi.c
+++ b/src/hw/esp-scsi.c
@@ -181,6 +181,8 @@ esp_scsi_add_lun(u32 lun, struct drive_s *tmpl_drv)
char *name = znprintf(MAXDESCSIZE, "esp %pP %d:%d",
llun->pci, llun->target, llun->lun);
+ boot_lchs_find_scsi_device(llun->pci, llun->target, llun->lun,
+ &(llun->drive.lchs));
int prio = bootprio_find_scsi_device(llun->pci, llun->target, llun->lun);
int ret = scsi_drive_setup(&llun->drive, name, prio);
free(name);
diff --git a/src/hw/lsi-scsi.c b/src/hw/lsi-scsi.c
index d5fc3e45..cbaa2acd 100644
--- a/src/hw/lsi-scsi.c
+++ b/src/hw/lsi-scsi.c
@@ -158,6 +158,8 @@ lsi_scsi_add_lun(u32 lun, struct drive_s *tmpl_drv)
lsi_scsi_init_lun(llun, tmpl_llun->pci, tmpl_llun->iobase,
tmpl_llun->target, lun);
+ boot_lchs_find_scsi_device(llun->pci, llun->target, llun->lun,
+ &(llun->drive.lchs));
char *name = znprintf(MAXDESCSIZE, "lsi %pP %d:%d",
llun->pci, llun->target, llun->lun);
int prio = bootprio_find_scsi_device(llun->pci, llun->target, llun->lun);
diff --git a/src/hw/megasas.c b/src/hw/megasas.c
index d2675804..87b8beec 100644
--- a/src/hw/megasas.c
+++ b/src/hw/megasas.c
@@ -225,6 +225,7 @@ megasas_add_lun(struct pci_device *pci, u32 iobase, u8 target, u8 lun)
free(mlun);
return -1;
}
+ boot_lchs_find_scsi_device(pci, target, lun, &(mlun->drive.lchs));
name = znprintf(MAXDESCSIZE, "MegaRAID SAS (PCI %pP) LD %d:%d"
, pci, target, lun);
prio = bootprio_find_scsi_device(pci, target, lun);
diff --git a/src/hw/mpt-scsi.c b/src/hw/mpt-scsi.c
index 1faede6a..570b2126 100644
--- a/src/hw/mpt-scsi.c
+++ b/src/hw/mpt-scsi.c
@@ -221,6 +221,8 @@ mpt_scsi_add_lun(u32 lun, struct drive_s *tmpl_drv)
mpt_scsi_init_lun(llun, tmpl_llun->pci, tmpl_llun->iobase,
tmpl_llun->target, lun);
+ boot_lchs_find_scsi_device(llun->pci, llun->target, llun->lun,
+ &(llun->drive.lchs));
char *name = znprintf(MAXDESCSIZE, "mpt %pP %d:%d",
llun->pci, llun->target, llun->lun);
int prio = bootprio_find_scsi_device(llun->pci, llun->target, llun->lun);
diff --git a/src/hw/pvscsi.c b/src/hw/pvscsi.c
index 9d7d68d8..3e5171ad 100644
--- a/src/hw/pvscsi.c
+++ b/src/hw/pvscsi.c
@@ -273,6 +273,7 @@ pvscsi_add_lun(struct pci_device *pci, void *iobase,
plun->iobase = iobase;
plun->ring_dsc = ring_dsc;
+ boot_lchs_find_scsi_device(pci, target, lun, &(plun->drive.lchs));
char *name = znprintf(MAXDESCSIZE, "pvscsi %pP %d:%d", pci, target, lun);
int prio = bootprio_find_scsi_device(pci, target, lun);
int ret = scsi_drive_setup(&plun->drive, name, prio);
diff --git a/src/hw/virtio-blk.c b/src/hw/virtio-blk.c
index 88d7e54a..3e615b26 100644
--- a/src/hw/virtio-blk.c
+++ b/src/hw/virtio-blk.c
@@ -183,6 +183,8 @@ init_virtio_blk(void *data)
status |= VIRTIO_CONFIG_S_DRIVER_OK;
vp_set_status(&vdrive->vp, status);
+
+ boot_lchs_find_pci_device(pci, &vdrive->drive.lchs);
return;
fail:
diff --git a/src/hw/virtio-scsi.c b/src/hw/virtio-scsi.c
index a87cad88..e1e2f5d4 100644
--- a/src/hw/virtio-scsi.c
+++ b/src/hw/virtio-scsi.c
@@ -121,6 +121,8 @@ virtio_scsi_add_lun(u32 lun, struct drive_s *tmpl_drv)
virtio_scsi_init_lun(vlun, tmpl_vlun->pci, tmpl_vlun->vp, tmpl_vlun->vq,
tmpl_vlun->target, lun);
+ boot_lchs_find_scsi_device(vlun->pci, vlun->target, vlun->lun,
+ &(vlun->drive.lchs));
int prio = bootprio_find_scsi_device(vlun->pci, vlun->target, vlun->lun);
int ret = scsi_drive_setup(&vlun->drive, "virtio-scsi", prio);
if (ret)