[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] spapr: Adjust firmware path of PCI devices
From: |
David Gibson |
Subject: |
Re: [PATCH] spapr: Adjust firmware path of PCI devices |
Date: |
Mon, 25 Jan 2021 19:21:38 +1100 |
On Fri, Jan 22, 2021 at 06:01:57PM +0100, Greg Kurz wrote:
> It is currently not possible to perform a strict boot from USB storage:
>
> $ qemu-system-ppc64 -accel kvm -nodefaults -nographic -serial stdio \
> -boot strict=on \
> -device qemu-xhci \
> -device usb-storage,drive=disk,bootindex=0 \
> -blockdev driver=file,node-name=disk,filename=fedora-ppc64le.qcow2
>
>
> SLOF **********************************************************************
> QEMU Starting
> Build Date = Jul 17 2020 11:15:24
> FW Version = git-e18ddad8516ff2cf
> Press "s" to enter Open Firmware.
>
> Populating /vdevice methods
> Populating /vdevice/vty@71000000
> Populating /vdevice/nvram@71000001
> Populating /pci@800000020000000
> 00 0000 (D) : 1b36 000d serial bus [ usb-xhci ]
> No NVRAM common partition, re-initializing...
> Scanning USB
> XHCI: Initializing
> USB Storage
> SCSI: Looking for devices
> 101000000000000 DISK : "QEMU QEMU HARDDISK 2.5+"
> Using default console: /vdevice/vty@71000000
>
> Welcome to Open Firmware
>
> Copyright (c) 2004, 2017 IBM Corporation All rights reserved.
> This program and the accompanying materials are made available
> under the terms of the BSD License available at
> http://www.opensource.org/licenses/bsd-license.php
>
>
> Trying to load: from:
> /pci@800000020000000/usb@0/storage@1/disk@101000000000000 ...
> E3405: No such device
>
> E3407: Load failed
>
> Type 'boot' and press return to continue booting the system.
> Type 'reset-all' and press return to reboot the system.
>
>
> Ready!
> 0 >
>
> The device tree handed over by QEMU to SLOF indeed contains:
>
> qemu,boot-list =
> "/pci@800000020000000/usb@0/storage@1/disk@101000000000000 HALT";
>
> but the device node is named usb-xhci@0, not usb@0.
>
> This happens because the firmware names of PCI devices returned
> by get_boot_devices_list() come from pcibus_get_fw_dev_path(),
> while the sPAPR PHB code uses a different naming scheme for
> device nodes. This inconsistency has always been there but it was
> hidden for a long time because SLOF used to rename USB device
> nodes, until this commit, merged in QEMU 4.2.0 :
>
> commit 85164ad4ed9960cac842fa4cc067c6b6699b0994
> Author: Alexey Kardashevskiy <aik@ozlabs.ru>
> Date: Wed Sep 11 16:24:32 2019 +1000
>
> pseries: Update SLOF firmware image
>
> This fixes USB host bus adapter name in the device tree to match QEMU's
> one.
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
>
> Fortunately, sPAPR implements the firmware path provider interface.
> This provides a way to override the default firmware paths.
>
> Just factor out the sPAPR PHB naming logic from spapr_dt_pci_device()
> to a helper, and use it in the sPAPR firmware path provider hook.
>
> Fixes: 85164ad4ed99 ("pseries: Update SLOF firmware image")
> Signed-off-by: Greg Kurz <groug@kaod.org>
Nice work. Applied to ppc-for-6.0.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature