aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2019-01-09 18:05:48 +0100
committerAlexey Kardashevskiy <aik@ozlabs.ru>2019-01-10 18:21:05 +1100
commit8ae76e0f117d56deb9f8a4f3ed4c36359bb08d4a (patch)
tree13b41fe2bb221c7d258e276078cbffc582d18367
parentcad96808d130bcc1fc36741cbedaaa3f8215e6c4 (diff)
downloadSLOF-8ae76e0f117d56deb9f8a4f3ed4c36359bb08d4a.zip
SLOF-8ae76e0f117d56deb9f8a4f3ed4c36359bb08d4a.tar.gz
SLOF-8ae76e0f117d56deb9f8a4f3ed4c36359bb08d4a.tar.bz2
vio-vscsi: Support multiple channels / buses
The spapr-vscsi device of QEMU supports multiple channels (a.k.a. buses). But when QEMU is started with a device on a bus > 0, SLOF fails to detect the device, so that the boot fails. For example: qemu-system-ppc64 -nodefaults -nographic -serial stdio -device spapr-vscsi \ -blockdev driver=file,filename=/path/to/cdrom.iso,node-name=d1,read-only=on \ -device scsi-cd,id=cd1,drive=d1,channel=6,scsi-id=5,lun=1 Thus SLOF should scan the various channels for bootable SCSI devices, too. Since the common SLOF code for scanning SCSI devices has no meaning of "channels" or "bus", we simply fake the bus ID to be part of the target ID, so instead of supporting 64 targets = 64 devices, we now support 8 channel * 64 targets = 512 devices instead. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1663160 Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
-rw-r--r--board-qemu/slof/vio-vscsi.fs16
1 files changed, 11 insertions, 5 deletions
diff --git a/board-qemu/slof/vio-vscsi.fs b/board-qemu/slof/vio-vscsi.fs
index be11b69..9395148 100644
--- a/board-qemu/slof/vio-vscsi.fs
+++ b/board-qemu/slof/vio-vscsi.fs
@@ -481,14 +481,19 @@ TRUE VALUE first-time-init?
\ SCSI scan at boot and child device support
\ -----------------------------------------------------------
-\ We use SRP luns of the form 8000 | (bus << 8) | (id << 5) | lun
-\ in the top 16 bits of the 64-bit LUN
: (set-target)
to current-target
;
-: dev-generate-srplun ( target lun -- )
- swap 8 << 8000 or or 30 <<
+\ We use SRP luns of the form 8000 | (target << 8) | (bus << 5) | lun
+\ in the top 16 bits of the 64-bit LUN (i.e. the "Logical unit addressing
+\ method" in SAM5). Since the generic scsi-probe code of SLOF does not
+\ really care about buses, we assume that the upper 3 bits of the "target"
+\ value are the "bus" field.
+: dev-generate-srplun ( bus+target lun -- srplun )
+ swap dup 1 >> e0 and ( lun bus+target bus )
+ swap 3f and 8 << ( lun bus target )
+ 8000 or or or 30 <<
;
\ We obtain here a unit address on the stack, since our #address-cells
@@ -508,8 +513,9 @@ TRUE VALUE first-time-init?
;
\ Report the amount of supported SCSI IDs - QEMU uses "max_target = 63"
+\ and "max_channel = 7", we combine both to 64 * 8 = 512 devices
: dev-max-target ( -- #max-target )
- 40
+ 200
;
" scsi-probe-helpers.fs" included