From patchwork Tue Jan 8 15:53:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 154980 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp5032533jaa; Tue, 8 Jan 2019 07:54:31 -0800 (PST) X-Google-Smtp-Source: ALg8bN4dDuSFnkcb5xwt7iIxkuHHQRRMPMIWb6T5/LNxlJXN+QqrAjfscnq+OPtMQ9ypbbT9VxSA X-Received: by 2002:adf:8464:: with SMTP id 91mr1975042wrf.251.1546962871817; Tue, 08 Jan 2019 07:54:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546962871; cv=none; d=google.com; s=arc-20160816; b=REgrCuHA70Rp/nNFEWApbm0QKpegjeJDdX/QLQFgn+4nti6dlyKfqoyzBf7kUTmAdN NJWnGk+g39AP3rgb2LCY2su/GJt7MWIC42WfhQjDX2mcR/BoQNcnvnNRPxDNV4bXfxd1 BuicvhSBT+21m58BYRjCIAxB4lWJYT9FmwmiEsBVUzwxvnSfoEIjVOMsXLumqzdTDKVZ eurYuIIg/jx2HxfPgmtehNamie0+FLJX9J8snJqT71jlT1/C//7GVm5d2scNpxr+s6Sq ZXSeP/W8dLjjrSHx/bizuGVdng1qw4YFLwLVTUb0QRScw+sY/MPgebib3T+0Io8PoaVs u3qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from; bh=JoKzpluZPZYER0EkTPQlC/bHIczhiF8IpVUsBXHCdk0=; b=WKgaoCmY/pOwM83dfr6wUaIAJrB3lvnmEORGAbG57uYr2Mkd2TBlPb3DZ0Lg1vH+Py EiApD09h+Lz7F0CMg3o/ylhrUbDYsqtjPXmVDNedibfJXdmYyW3YcKBzpmg6zffRUpJx Gc4Wv2RyBopUOC0FAR2uKEXrpENrhZl+H3KMF9vkO599ka1MICwEAItVkJnxAuph8tT6 IlijvyZqop3wVsAaeSBLzCPJK2AQARNIEK3uhSW4cgkjFDVJDA4r+h8414rx+7mXnukB FPs5jqBY1n0XDRmhZsOwQ4M3EosORTG4X91+R4UvOq0roy0kIFlcWBzFo6r9q2VXnBm6 GZ0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f196si6904599wme.198.2019.01.08.07.54.31 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 08 Jan 2019 07:54:31 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([127.0.0.1]:50872 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggti1-0003se-Q4 for patch@linaro.org; Tue, 08 Jan 2019 10:54:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggthd-0003rl-AJ for qemu-devel@nongnu.org; Tue, 08 Jan 2019 10:54:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggthc-0006Ze-7c for qemu-devel@nongnu.org; Tue, 08 Jan 2019 10:54:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58542) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ggtha-0006S3-Aq for qemu-devel@nongnu.org; Tue, 08 Jan 2019 10:54:03 -0500 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 mx1.redhat.com (Postfix) with ESMTPS id 7BF6A7F6C7; Tue, 8 Jan 2019 15:54:00 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-98.ams2.redhat.com [10.36.116.98]) by smtp.corp.redhat.com (Postfix) with ESMTP id C051B5C21C; Tue, 8 Jan 2019 15:53:55 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0D02E981C; Tue, 8 Jan 2019 16:53:55 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 8 Jan 2019 16:53:53 +0100 Message-Id: <20190108155354.8591-5-kraxel@redhat.com> In-Reply-To: <20190108155354.8591-1-kraxel@redhat.com> References: <20190108155354.8591-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 08 Jan 2019 15:54:00 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/5] hw/usb: Add generic sys-bus EHCI controller X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hongbo Zhang , Eduardo Habkost , "Michael S. Tsirkin" , Gerd Hoffmann , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Hongbo Zhang This patch introduces a new system bus generic EHCI controller. For the system bus EHCI controller, we've already had "xlnx", "exynos4210", "tegra2", "ppc4xx" and "fusbh200", they are specific and only suitable for their own platforms, platforms such as an Arm server, may need a generic system bus EHCI controller, this patch creates it, and the kernel driver ehci_platform.c works well on it. Signed-off-by: Hongbo Zhang Message-id: 1546077657-22637-1-git-send-email-hongbo.zhang@linaro.org Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.h | 1 + hw/usb/hcd-ehci-sysbus.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) -- 2.9.3 diff --git a/hw/usb/hcd-ehci.h b/hw/usb/hcd-ehci.h index 0bc364b286..cd30b5d5e0 100644 --- a/hw/usb/hcd-ehci.h +++ b/hw/usb/hcd-ehci.h @@ -342,6 +342,7 @@ typedef struct EHCIPCIState { #define TYPE_SYS_BUS_EHCI "sysbus-ehci-usb" +#define TYPE_PLATFORM_EHCI "platform-ehci-usb" #define TYPE_EXYNOS4210_EHCI "exynos4210-ehci-usb" #define TYPE_TEGRA2_EHCI "tegra2-ehci-usb" #define TYPE_PPC4xx_EHCI "ppc4xx-ehci-usb" diff --git a/hw/usb/hcd-ehci-sysbus.c b/hw/usb/hcd-ehci-sysbus.c index 3b83beb140..331faf8bc3 100644 --- a/hw/usb/hcd-ehci-sysbus.c +++ b/hw/usb/hcd-ehci-sysbus.c @@ -94,6 +94,22 @@ static const TypeInfo ehci_type_info = { .class_size = sizeof(SysBusEHCIClass), }; +static void ehci_platform_class_init(ObjectClass *oc, void *data) +{ + SysBusEHCIClass *sec = SYS_BUS_EHCI_CLASS(oc); + DeviceClass *dc = DEVICE_CLASS(oc); + + sec->capsbase = 0x0; + sec->opregbase = 0x20; + set_bit(DEVICE_CATEGORY_USB, dc->categories); +} + +static const TypeInfo ehci_platform_type_info = { + .name = TYPE_PLATFORM_EHCI, + .parent = TYPE_SYS_BUS_EHCI, + .class_init = ehci_platform_class_init, +}; + static void ehci_xlnx_class_init(ObjectClass *oc, void *data) { SysBusEHCIClass *sec = SYS_BUS_EHCI_CLASS(oc); @@ -245,6 +261,7 @@ static const TypeInfo ehci_fusbh200_type_info = { static void ehci_sysbus_register_types(void) { type_register_static(&ehci_type_info); + type_register_static(&ehci_platform_type_info); type_register_static(&ehci_xlnx_type_info); type_register_static(&ehci_exynos4210_type_info); type_register_static(&ehci_tegra2_type_info);