Commit Graph

22 Commits

Author SHA1 Message Date
Andy Pei 27b573d4f5 virtio-blk: add feature VIRTIO_BLK_F_SIZE_MAX and VIRTIO_BLK_F_SEG_MAX
according to virtio spec, add feature VIRTIO_BLK_F_SIZE_MAX
and VIRTIO_BLK_F_SEG_MAX parse to virtio blk driver.

Signed-off-by: Andy Pei <andy.pei@intel.com>
Signed-off-by: Ding Limin <dinglimin@cmss.chinamobile.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
2021-12-18 11:52:22 -05:00
Sam Eiderman c9ba5276e3 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>
2019-11-18 14:58:37 +01:00
Gerd Hoffmann b6f8471534 Revert "geometry: Apply LCHS values for boot devices"
This reverts commit 9caa19be0e.
2019-11-18 14:58:37 +01:00
Sam Eiderman 9caa19be0e 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_MACHINE".

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: <20190612093704.47175-6-shmuel.eiderman@oracle.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-11-06 10:56:00 +01:00
Kevin O'Connor e5a0b61637 block: Rename disk_op_s->drive_gf to drive_fl
Now that the drive_s struct does not need to be in the f-segment,
rename references to drive_gf in the generic drive code to drive_fl.

This is just variable renames - no code changes.

Tested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-09-27 19:02:28 -04:00
Julian Stecklina c83e15b60b block: add NVMe boot support
This patch enables SeaBIOS to boot from NVMe. Finding namespaces and
basic I/O works. Testing has been done in qemu and so far it works with
Grub, syslinux, and the FreeBSD loader. You need a recent Qemu (>=
2.7.0), because older versions have buggy NVMe support.

The NVMe code is currently only enabled on Qemu due to lack of testing
on real hardware.

Signed-off-by: Julian Stecklina <jsteckli@amazon.de>
2017-02-20 10:47:53 -05:00
Kevin O'Connor 193632b63f block: Move send_disk_op() from block.c to disk.c
The send_disk_op() function is only called from the 16bit handlers
found in disk.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-03-31 14:33:20 -04:00
Don Slutz f2645a8cd6 Support for booting from LSI Logic LSI53C1030, SAS1068, SAS1068e
Also known as Fusion MPT disk; this controller model is supported
by VirtualBox and VMware, and QEMU support patches have been
posted.

Signed-off-by: Don Slutz <Don.Slutz@Gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-03-29 09:16:48 -04:00
Kevin O'Connor 7c4807671f block: Move drive setup to new function block_setup()
Move the list of drive setup calls from post.c to a new function in
block.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-02-04 12:53:05 -05:00
Kevin O'Connor 8aad64e22a edd: Pass the segment/offset from int 1348 calls using a 'struct segoff_s'
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-17 11:38:48 -04:00
Kevin O'Connor 4dbe829059 block: Route scsi style commands through 'struct disk_op_s'
Support sending scsi style "command data block" commands (cdbcmd)
through the 'struct disk_op_s' command request structure.  And change
the blockcmd.c and cdrom.c code to route these commands through the
process_op() code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14 14:40:07 -04:00
Kevin O'Connor 85c72c6feb block: Introduce default_process_op() with common command handling codes
Most disk drivers only implement a couple of the available bios
commands.  Unify the common fallback handling code into a new function
default_process_op() to reduce boiler-plate code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14 14:40:07 -04:00
Kevin O'Connor 72691a5299 sdcard: Initial support for SD cards on PCI SDHCI controllers on QEMU
This adds basic read/write support for SD cards emulated by QEMU.
This code is not expected to work on real hardware, because the
current controller and card initialization is not robust.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-12-29 09:17:06 -05:00
Kevin O'Connor c029a912d3 Move cdemu call interface and disk_ret helper code to disk.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-04 11:06:58 -04:00
Kevin O'Connor 02f7676421 cdemu: store internal cdemu fields in standard "el-torito" spec format.
Store the fields necessary to export the "el-torito" spec information
directly in an internal copy of the "el-torito" struct.  This
simplifies the interface and obviates the need for an internal home
grown struct with the same info.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-04 11:06:58 -04:00
Kevin O'Connor 39ca4988f8 edd: Move EDD get drive parameters (int 1348) logic from disk.c to block.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-04 11:06:58 -04:00
Kevin O'Connor de30dadb55 xhci: Run the XHCI driver entirely in 32bit mode.
Since the XHCI driver needs to jump into 32bit mode anyway, it is
simpler to just run all of the code in 32bit mode.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-01-29 12:57:01 -05:00
Kevin O'Connor d1bb7e52f5 Add space between DTYPE_* definitions.
Avoid consective numbering on the DTYPE_* definitions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-01-29 12:57:01 -05:00
Kevin O'Connor 1902c94de0 Convert op->drive_g from a 16bit pointer to a 32 bit "GLOBALFLAT" pointer.
The "drive" structure is always malloc'ed and therefore always starts
off described as a 32-bit "flat" pointer.  Instead of switching
to/from 16bit pointers, make all the code use the 32bit pointer.  This
eliminates the confusing 16/32 bit pointer switches.

This patch also removes the "_g" suffixes on local variables in
functions that are always called in 32bit mode.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-10-26 11:48:06 -04:00
Evgeny Budilovsky 83d60b3c47 Add pvscsi boot support
Testing was done on windows images (win 2008/2012) taken from esx with vmware
tools installed and boot disk configured to use pvscsi.
Also I've used linux (ubuntu 12.04) where pvscsi drivers are installed by
default and booted it using qemu cmd similar to this:

./x86_64-softmmu/qemu-system-x86_64 -snapshot -device pvscsi,id=pvscsi0 \
-device scsi-disk,bus=pvscsi0.0,drive=drive0 \
-drive id=drive0,if=none,file=ubuntu-12.04.qcow2 \
-bios roms/seabios/out/bios.bin

Signed-off-by: Evgeny Budilovsky <evgeny.budilovsky@ravellosystems.com>
2013-10-26 10:12:40 -04:00
Kevin O'Connor 8ab9a34d67 Rename fields of 'struct chs_s' and use in floppy lba2chs().
Rename the fields of 'struct chs_s' so that it can be used both to
describe a drive and to describe a particular sector on a drive.

Update floppy.c:lba2chs() to return a 'struct chs_s' instead of
passing the results via pointers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-10-14 21:37:56 -04:00
Kevin O'Connor 135f3f676d Split disk.h into block.h and std/disk.h.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18 20:48:34 -04:00