From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bin Meng Date: Thu, 11 Oct 2018 21:41:52 +0800 Subject: [U-Boot] [PATCH 25/27] virtio: pci: Support non-legacy PCI transport device In-Reply-To: References: <1537710145-1888-1-git-send-email-bmeng.cn@gmail.com> <1537710145-1888-26-git-send-email-bmeng.cn@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Simon, On Thu, Sep 27, 2018 at 9:43 PM Simon Glass wrote: > > On 23 September 2018 at 06:42, Bin Meng wrote: > > By default QEMU creates legacy PCI transport devices, but we can > > ask QEMU to create non-legacy one if we pass additional device > > property/value pairs in the command line: > > > > -device virtio-blk-pci,disable-legacy=true,disable-modern=false > > > > This adds a new driver driver to support non-legacy (modern) device > > mode. Previous driver/file name is changed accordingly. > > > > Signed-off-by: Bin Meng > > --- > > > > drivers/virtio/Makefile | 2 +- > > .../virtio/{virtio_pci.c => virtio_pci_legacy.c} | 6 +- > > drivers/virtio/virtio_pci_modern.c | 612 +++++++++++++++++++++ > > 3 files changed, 616 insertions(+), 4 deletions(-) > > rename drivers/virtio/{virtio_pci.c => virtio_pci_legacy.c} (98%) > > create mode 100644 drivers/virtio/virtio_pci_modern.c > > Reviewed-by: Simon Glass > > Isn't there some common code between the two? Unfortunately the legacy and modern PCI devices are quite different, so we have to use 2 drivers which is how Linux does. For the virtio-mmio driver, the difference are not that big so we can use one driver to support both. Regards, Bin