From nobody Mon Feb 9 01:21:00 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615831383; cv=none; d=zohomail.com; s=zohoarc; b=YECzLmNog3Rjqm1ihttbvwHFXcO71sspJ/WohtNp/oN8vA+iEAclBncLQEbdyCDXM111YRFfnOQKy1M+FrOvmyEjoWkFsqzyWPiwCt6VJyoGNx3gMz+8fz2r+r8tnFdauknk7kLHT9QR39SHT2AD2H1IVd4xhZnDZGUdd9+34Ug= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615831383; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MzAN2TIAtzKIQCHNs4ewubbNW0R4HXiUsBmusDUXPrg=; b=HbRs2Ej/DySe6gzduAybzqzS99bUhsPV5n0hdnGXheE+iMnqaEI9MMzXYBJLplvL0EE6WkSvHMiYXHwf4pUTFh5ksqc6kiZo9W06qlWGFyHpZWEe1u0BuQK2p5ny8g0Xa0stHGqZTn6TyU1gUM97KAlgKwLW/yUlUdFwuOyeHD4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1615831383806281.1923401730015; Mon, 15 Mar 2021 11:03:03 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-56-BZ2z3xTQOW644pN3mTkXEg-1; Mon, 15 Mar 2021 14:02:59 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 46B118042C3; Mon, 15 Mar 2021 18:02:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 216A61C4; Mon, 15 Mar 2021 18:02:54 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D26371800B72; Mon, 15 Mar 2021 18:02:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12FI2pq3007502 for ; Mon, 15 Mar 2021 14:02:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 53A361B49F; Mon, 15 Mar 2021 18:02:51 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-141.ams2.redhat.com [10.36.112.141]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DC8D96060F; Mon, 15 Mar 2021 18:02:50 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 6C2FE18007BE; Mon, 15 Mar 2021 19:02:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615831382; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=MzAN2TIAtzKIQCHNs4ewubbNW0R4HXiUsBmusDUXPrg=; b=Bb6X/gz5/itNALEjSztb1TvUs6Y6pT9nMTgrR660DkywEwSUFnlnXApTlQR2wqt9iI331f zpbt4/9tDqzYPKFW34bFX59wEk2NWWgjyAQztD3KafcHFy/pE7F7nOVLLP/Ca1kP9nGiDL TI+L9OZ8yBRHDzWcaRFmuHKSPKzgLYU= X-MC-Unique: BZ2z3xTQOW644pN3mTkXEg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 08/13] hw/usb: Extract VT82C686 UHCI PCI function into a new unit Date: Mon, 15 Mar 2021 19:02:35 +0100 Message-Id: <20210315180240.1597240-9-kraxel@redhat.com> In-Reply-To: <20210315180240.1597240-1-kraxel@redhat.com> References: <20210315180240.1597240-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Huacai Chen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Gerd Hoffmann , Paolo Bonzini , Samuel Thibault X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 Extract the VT82C686 PCI UHCI function into a new unit so it is only build when the VT82C686 south bridge is selected. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20210309190802.830969-4-f4bug@amsat.org> Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-uhci.c | 23 -------------------- hw/usb/vt82c686-uhci-pci.c | 43 ++++++++++++++++++++++++++++++++++++++ MAINTAINERS | 1 + hw/usb/meson.build | 1 + 4 files changed, 45 insertions(+), 23 deletions(-) create mode 100644 hw/usb/vt82c686-uhci-pci.c diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index d6338c33d863..0cb02a643214 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -1207,21 +1207,6 @@ void usb_uhci_common_realize(PCIDevice *dev, Error *= *errp) pci_register_bar(&s->dev, 4, PCI_BASE_ADDRESS_SPACE_IO, &s->io_bar); } =20 -static void usb_uhci_vt82c686b_realize(PCIDevice *dev, Error **errp) -{ - UHCIState *s =3D UHCI(dev); - uint8_t *pci_conf =3D s->dev.config; - - /* USB misc control 1/2 */ - pci_set_long(pci_conf + 0x40,0x00001000); - /* PM capability */ - pci_set_long(pci_conf + 0x80,0x00020001); - /* USB legacy support */ - pci_set_long(pci_conf + 0xc0,0x00002000); - - usb_uhci_common_realize(dev, errp); -} - static void usb_uhci_exit(PCIDevice *dev) { UHCIState *s =3D UHCI(dev); @@ -1318,14 +1303,6 @@ static UHCIInfo uhci_info[] =3D { .revision =3D 0x01, .irq_pin =3D 3, .unplug =3D true, - },{ - .name =3D "vt82c686b-usb-uhci", - .vendor_id =3D PCI_VENDOR_ID_VIA, - .device_id =3D PCI_DEVICE_ID_VIA_UHCI, - .revision =3D 0x01, - .irq_pin =3D 3, - .realize =3D usb_uhci_vt82c686b_realize, - .unplug =3D true, },{ .name =3D "ich9-usb-uhci1", /* 00:1d.0 */ .vendor_id =3D PCI_VENDOR_ID_INTEL, diff --git a/hw/usb/vt82c686-uhci-pci.c b/hw/usb/vt82c686-uhci-pci.c new file mode 100644 index 000000000000..b109c2160335 --- /dev/null +++ b/hw/usb/vt82c686-uhci-pci.c @@ -0,0 +1,43 @@ +#include "qemu/osdep.h" +#include "hcd-uhci.h" + +static void usb_uhci_vt82c686b_realize(PCIDevice *dev, Error **errp) +{ + UHCIState *s =3D UHCI(dev); + uint8_t *pci_conf =3D s->dev.config; + + /* USB misc control 1/2 */ + pci_set_long(pci_conf + 0x40, 0x00001000); + /* PM capability */ + pci_set_long(pci_conf + 0x80, 0x00020001); + /* USB legacy support */ + pci_set_long(pci_conf + 0xc0, 0x00002000); + + usb_uhci_common_realize(dev, errp); +} + +static UHCIInfo uhci_info[] =3D { + { + .name =3D "vt82c686b-usb-uhci", + .vendor_id =3D PCI_VENDOR_ID_VIA, + .device_id =3D PCI_DEVICE_ID_VIA_UHCI, + .revision =3D 0x01, + .irq_pin =3D 3, + .realize =3D usb_uhci_vt82c686b_realize, + .unplug =3D true, + } +}; + +static const TypeInfo vt82c686b_usb_uhci_type_info =3D { + .parent =3D TYPE_UHCI, + .name =3D "vt82c686b-usb-uhci", + .class_init =3D uhci_data_class_init, + .class_data =3D uhci_info, +}; + +static void vt82c686b_usb_uhci_register_types(void) +{ + type_register_static(&vt82c686b_usb_uhci_type_info); +} + +type_init(vt82c686b_usb_uhci_register_types) diff --git a/MAINTAINERS b/MAINTAINERS index 5ca3c9f851f9..b6ab3d25a751 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1180,6 +1180,7 @@ S: Odd Fixes F: hw/mips/fuloong2e.c F: hw/isa/vt82c686.c F: hw/pci-host/bonito.c +F: hw/usb/vt82c686-uhci-pci.c F: include/hw/isa/vt82c686.h =20 Loongson-3 virtual platforms diff --git a/hw/usb/meson.build b/hw/usb/meson.build index 653192cff6fa..6e3159798e93 100644 --- a/hw/usb/meson.build +++ b/hw/usb/meson.build @@ -32,6 +32,7 @@ softmmu_ss.add(when: 'CONFIG_USB_DWC3', if_true: files('h= cd-dwc3.c')) softmmu_ss.add(when: 'CONFIG_TUSB6010', if_true: files('tusb6010.c')) softmmu_ss.add(when: 'CONFIG_IMX', if_true: files('chipidea.c')) softmmu_ss.add(when: 'CONFIG_IMX_USBPHY', if_true: files('imx-usb-phy.c')) +softmmu_ss.add(when: 'CONFIG_VT82C686', if_true: files('vt82c686-uhci-pci.= c')) specific_ss.add(when: 'CONFIG_XLNX_VERSAL', if_true: files('xlnx-versal-us= b2-ctrl-regs.c')) specific_ss.add(when: 'CONFIG_XLNX_USB_SUBSYS', if_true: files('xlnx-usb-s= ubsystem.c')) =20 --=20 2.29.2