From patchwork Thu Feb 13 14:41:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 183372 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp624893ile; Thu, 13 Feb 2020 06:58:51 -0800 (PST) X-Google-Smtp-Source: APXvYqzyL90U1EObzmQtephH8dkS7efTqRPECdq2BQeT4p76PmOq+4UOp8ZghfNK8Rz4n0f9wVj2 X-Received: by 2002:a37:a982:: with SMTP id s124mr12160706qke.496.1581605931820; Thu, 13 Feb 2020 06:58:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581605931; cv=none; d=google.com; s=arc-20160816; b=zVHjp+JbqoKDF6LA+8beJl/WcK3e/oqTvW/nlmMd5arAKte7XJF90F3mLQMXw7pjJM 3CFibNUDodadJ7vCydI7uoWO3oreB/IW8czKA2yRnjbUbwhRAPgYdkS/NK+k5NWOCZ82 7DP/7Xwo2kgH7Mv8+ER21OuXa4d+Mz2S7reHmeIdrCbU6qg7tWz5KMfCfiopnAHhAbni /IRSwwXNfok1DCvXWiCUWjuDTW5UMGDQRa2YxmaFVGPSWpNHNR0tClaUnxFZ93TGiQdw 6SGePc+OESS0K+T0VVYkFRKHe4rCHvw7yjZjhv1OjEq/yQlGoox6Vwuk6Fjzd4b0C0Uz ipyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=B4itb9kIDkgDxpdKjzasmbvHH8eIShpCoXlgDew/PyI=; b=Y0KMF1EJGcMWtR1nMjtxCrGTwQYVwR4naf2Xmldx26uLHOp9GXl61svbPUtl/KEUr4 Ip6KhkjtN+q1DjQfPFFsWcHM/AGYu5ErdfHZD01EVowhAFLxihPhAiW/cQ8SEk3j2IBV oBhT2uHxiWyV1fXLatNlxj0f1S8/quiAWZegQelV1dUXSyu+f785XzsgoGIgXEmL09oq oQaVBPUyRaFCpGItJgFfMd+u/fBw7PXxcCW0VvmiXl4AfwpA7jm3nuTv5xyo2ydBPHOK zkGFGbVR6IKutHMW609LL3XaLEcI/O3nJJYARnyuXRLRiX/cwlCXpU9l0V2m+ugo7C9W zjxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Won5PYxR; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v9si1245486qtk.351.2020.02.13.06.58.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Feb 2020 06:58:51 -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; dkim=pass header.i=@linaro.org header.s=google header.b=Won5PYxR; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54094 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2Fx5-0001Ew-A9 for patch@linaro.org; Thu, 13 Feb 2020 09:58:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60475) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2FhM-0004kU-TV for qemu-devel@nongnu.org; Thu, 13 Feb 2020 09:42:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2FhC-0002HH-Oa for qemu-devel@nongnu.org; Thu, 13 Feb 2020 09:42:32 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:35572) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2FhC-0002Ee-I2 for qemu-devel@nongnu.org; Thu, 13 Feb 2020 09:42:26 -0500 Received: by mail-wr1-x429.google.com with SMTP id w12so6997298wrt.2 for ; Thu, 13 Feb 2020 06:42:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=B4itb9kIDkgDxpdKjzasmbvHH8eIShpCoXlgDew/PyI=; b=Won5PYxRo25UM/ElpmKlqGBZOZhrYjMfXAHJJmpp96LwZMFFc4k2vT/+PPFXp3Ww1K TowLse4c00bLeW2WGYXwMab/2wjdYF9Pp42TE3lHWfcd8quf149KVEUVuP6L3E9q68fm OocJQAWpuIQTB+RP3UHFglhZ7CuRtgnHG6IEQKIJ7aPPru9uhjCsv53tQCHxLfbDr/5l yGF0RqURA1wRMr6rciMrZ8UUnpgtP2dx+YysbO+G46oo6GMcFFH7LOkBEWUmGPkFIUbx DO9EQ2jjYoeZssNL8Bwvq94XstmCO7pseCgbCTKekrZeLu/pfAw8f23Sokm1+0hof5mR mxgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=B4itb9kIDkgDxpdKjzasmbvHH8eIShpCoXlgDew/PyI=; b=alEahApgIuw8t5AJo/KNq3Z+oq39AqRG8poK/i4lHnv5CL9hV4qFZXvwgpnHK/mg10 bf1cYLCA8KeOVwJfGkrRH2XUudAx34sk8W6SWtRX0HPhB0C5yVbuuwxjLSv26e96Fm/7 5Zky/TBShZ+HEcwa9H9UG8yLGguC9QLDuxf/MN+IR1NLemLncKIpdtqCzlyRW4/9BpID /hVJaPmMv1tAML6RkrRRAaCdMz2MHxcG/ubm4Xu+36Vvzy0bmH7ybqwti0qPy+5QB58B sJHEJhCoogoIUWjPFOD7hRvSW8QRqEZ2OLHQwpeOvQpG2NVT33xKoxM1QEHp0WDPnt99 gFfA== X-Gm-Message-State: APjAAAVAbO2P3d547Tplwnhf1BFU5zpozoMbI3vktol2FRDH7lHwVfXr lYI9GHCNA5qcM1JXnYWLBveb9K0Dej8= X-Received: by 2002:a5d:4984:: with SMTP id r4mr21287909wrq.137.1581604943047; Thu, 13 Feb 2020 06:42:23 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id e22sm3362454wme.45.2020.02.13.06.42.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Feb 2020 06:42:22 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 31/46] hw/arm: ast2600: Wire up EHCI controllers Date: Thu, 13 Feb 2020 14:41:30 +0000 Message-Id: <20200213144145.818-32-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200213144145.818-1-peter.maydell@linaro.org> References: <20200213144145.818-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::429 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Guenter Roeck Initialize EHCI controllers on AST2600 using the existing TYPE_PLATFORM_EHCI. After this change, booting ast2600-evb into Linux successfully instantiates a USB interface after the necessary changes are made to its devicetree files. ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver ehci-platform: EHCI generic platform driver ehci-platform 1e6a3000.usb: EHCI Host Controller ehci-platform 1e6a3000.usb: new USB bus registered, assigned bus number 1 ehci-platform 1e6a3000.usb: irq 25, io mem 0x1e6a3000 ehci-platform 1e6a3000.usb: USB 2.0 started, EHCI 1.00 usb usb1: Manufacturer: Linux 5.5.0-09825-ga0802f2d0ef5-dirty ehci_hcd usb 1-1: new high-speed USB device number 2 using ehci-platform Reviewed-by: Cédric Le Goater Signed-off-by: Guenter Roeck Reviewed-by: Niek Linnenbank Message-id: 20200207174548.9087-1-linux@roeck-us.net Signed-off-by: Peter Maydell --- hw/arm/aspeed_ast2600.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) -- 2.20.1 diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c index 90cf1c755d3..446b44d31cf 100644 --- a/hw/arm/aspeed_ast2600.c +++ b/hw/arm/aspeed_ast2600.c @@ -31,6 +31,8 @@ static const hwaddr aspeed_soc_ast2600_memmap[] = { [ASPEED_FMC] = 0x1E620000, [ASPEED_SPI1] = 0x1E630000, [ASPEED_SPI2] = 0x1E641000, + [ASPEED_EHCI1] = 0x1E6A1000, + [ASPEED_EHCI2] = 0x1E6A3000, [ASPEED_MII1] = 0x1E650000, [ASPEED_MII2] = 0x1E650008, [ASPEED_MII3] = 0x1E650010, @@ -79,6 +81,8 @@ static const int aspeed_soc_ast2600_irqmap[] = { [ASPEED_ADC] = 78, [ASPEED_XDMA] = 6, [ASPEED_SDHCI] = 43, + [ASPEED_EHCI1] = 5, + [ASPEED_EHCI2] = 9, [ASPEED_EMMC] = 15, [ASPEED_GPIO] = 40, [ASPEED_GPIO_1_8V] = 11, @@ -166,6 +170,11 @@ static void aspeed_soc_ast2600_init(Object *obj) sizeof(s->spi[i]), typename); } + for (i = 0; i < sc->ehcis_num; i++) { + sysbus_init_child_obj(obj, "ehci[*]", OBJECT(&s->ehci[i]), + sizeof(s->ehci[i]), TYPE_PLATFORM_EHCI); + } + snprintf(typename, sizeof(typename), "aspeed.sdmc-%s", socname); sysbus_init_child_obj(obj, "sdmc", OBJECT(&s->sdmc), sizeof(s->sdmc), typename); @@ -416,6 +425,19 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp) s->spi[i].ctrl->flash_window_base); } + /* EHCI */ + for (i = 0; i < sc->ehcis_num; i++) { + object_property_set_bool(OBJECT(&s->ehci[i]), true, "realized", &err); + if (err) { + error_propagate(errp, err); + return; + } + sysbus_mmio_map(SYS_BUS_DEVICE(&s->ehci[i]), 0, + sc->memmap[ASPEED_EHCI1 + i]); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->ehci[i]), 0, + aspeed_soc_get_irq(s, ASPEED_EHCI1 + i)); + } + /* SDMC - SDRAM Memory Controller */ object_property_set_bool(OBJECT(&s->sdmc), true, "realized", &err); if (err) { @@ -534,6 +556,7 @@ static void aspeed_soc_ast2600_class_init(ObjectClass *oc, void *data) sc->silicon_rev = AST2600_A0_SILICON_REV; sc->sram_size = 0x10000; sc->spis_num = 2; + sc->ehcis_num = 2; sc->wdts_num = 4; sc->macs_num = 4; sc->irqmap = aspeed_soc_ast2600_irqmap;