Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 646B3C0015E for ; Fri, 28 Jul 2023 12:41:33 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4E71A8690A; Fri, 28 Jul 2023 14:41:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kwiboo.se header.i=@kwiboo.se header.b="gW08zD3U"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 14CC786894; Fri, 28 Jul 2023 14:40:27 +0200 (CEST) Received: from wfbtzhsv.outbound-mail.sendgrid.net (wfbtzhsv.outbound-mail.sendgrid.net [159.183.224.104]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1D0F3868EC for ; Fri, 28 Jul 2023 14:40:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bounces+31435339-7456-u-boot=lists.denx.de@em2124.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type:cc:content-type:from:subject:to; s=s1; bh=fFYbBGUhYmKxzA4fwpoi8eRNkGtDpfXQUyzAWdhST+s=; b=gW08zD3U2UGl66c7oFhcNh6e5xLf9zt0FuCeeP/iA70dkc7KRDiBa264z/cRQWH9Uoco IGsjeUrlpTuZadwr+siIfRGRvysVGPTY5w8wJ1SylGczq2F67jCtajQaft/CUL/R0fYaaj ZsdmuUtJaW5EBY6CoKsTYAGD+pSU8oBcA2CfemGIU5RnaZ+w81tgJQkZMMwJJfobEUB1Pk ZcJROJuA7sG5jH04db816L3IhzR6lNrJ5IkajHowZ7MWgmrlop7apqmmt7YU/2fKQ9lIDE gVvOeDWQ4XufSToyMea6w9YI6X9N6awRqsCzJM9S/6Mxd31Y1SVHN6cmUTLBxsSQ== Received: by filterdrecv-65f68489c8-qxj4s with SMTP id filterdrecv-65f68489c8-qxj4s-1-64C3B733-2F 2023-07-28 12:40:19.669672662 +0000 UTC m=+6786256.715564916 Received: from bionic.localdomain (unknown) by geopod-ismtpd-3 (SG) with ESMTP id eOLJ2QlSStONyvxBetzHDw Fri, 28 Jul 2023 12:40:19.469 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v4 4/5] usb: dwc3-generic: Add rk3568 support Date: Fri, 28 Jul 2023 12:40:20 +0000 (UTC) Message-ID: <20230728124011.1747408-5-jonas@kwiboo.se> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230728124011.1747408-1-jonas@kwiboo.se> References: <20230728124011.1747408-1-jonas@kwiboo.se> MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0h9sJP8CYMBsjJXwYY?= =?us-ascii?Q?YKTwSAzLzX04GooOFirgMHwRadv5Y5nO1hUNLLH?= =?us-ascii?Q?NeR+yzYxl+ZMHZNKm0tbR8p7g2JvhM92JeiytEE?= =?us-ascii?Q?Knni15aBcvtYHW5Qzg44q5dlBp0hjJxRfw3FRt8?= =?us-ascii?Q?dnejUr+HA1A=2F6NlIH6Uxp+3eyy71NVPc4d5FKu?= To: Kever Yang , Simon Glass , Philipp Tomsich , Marek Vasut Cc: Akash Gajjar , Jagan Teki , FUKAUMI Naoki , Tianling Shen , u-boot@lists.denx.de, Jonas Karlman X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean RK3568 share glue and ctrl in a single node. Use glue_get_ctrl_dev to return the glue node as the ctrl node. Signed-off-by: Jonas Karlman Reviewed-by: Jagan Teki --- v4: - No change v3: - No change v2: - No change - Collect r-b tag drivers/usb/dwc3/dwc3-generic.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c index 2331ac453132..f6d087722c9f 100644 --- a/drivers/usb/dwc3/dwc3-generic.c +++ b/drivers/usb/dwc3/dwc3-generic.c @@ -405,6 +405,22 @@ struct dwc3_glue_ops ti_ops = { .glue_configure = dwc3_ti_glue_configure, }; +static int dwc3_rk_glue_get_ctrl_dev(struct udevice *dev, ofnode *node) +{ + if (!device_is_compatible(dev, "snps,dwc3")) + return -EINVAL; + + *node = dev_ofnode(dev); + if (!ofnode_valid(*node)) + return -EINVAL; + + return 0; +} + +struct dwc3_glue_ops rk_ops = { + .glue_get_ctrl_dev = dwc3_rk_glue_get_ctrl_dev, +}; + static int dwc3_glue_bind_common(struct udevice *parent, ofnode node) { const char *name = ofnode_get_name(node); @@ -596,6 +612,7 @@ static const struct udevice_id dwc3_glue_ids[] = { { .compatible = "ti,am654-dwc3" }, { .compatible = "rockchip,rk3328-dwc3" }, { .compatible = "rockchip,rk3399-dwc3" }, + { .compatible = "rockchip,rk3568-dwc3", .data = (ulong)&rk_ops }, { .compatible = "qcom,dwc3" }, { .compatible = "fsl,imx8mp-dwc3", .data = (ulong)&imx8mp_ops }, { .compatible = "fsl,imx8mq-dwc3" }, -- 2.41.0