From patchwork Tue Apr 1 21:07:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Chen X-Patchwork-Id: 14035344 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 02EFAC36010 for ; Tue, 1 Apr 2025 21:16:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fh6IUA26lEyrJEifWIUg0Aon6jE68Po+06xiKRDzRZA=; b=GSBDStScImxeYzJ6l2leWmjaw2 fA794nGlaSzjByEzkgFcY3w7zGuSJx6LX6SrtzOtWOEQB6el0ztYQgjGdtkWF3gWeew5EgdRCpV0u K6e1sapwvkOgN5LdU/I4CxyV48UV5q2KWFzteAW12BxzefmSSQUPEPT78k9Mc9heScgX5dWNSVxIO l+6hWUlGl2yX8WoDYHag/GIno00oVtoOZ4YR/TMTN2KfFSCNXIUUvhpVtQoQR4p4sZaA6cPKQ2iq3 vcXRjBKKig8FD2pNODLPFqUn+Q9nIJ+R25tQjEzUDgJ5WRv4iA5RAgsXoFmvilXvFCki+tmrtiUi2 MtCd+d/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzixu-00000004QpV-18vA; Tue, 01 Apr 2025 21:16:10 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzipp-00000004P3v-3EXS for linux-arm-kernel@bombadil.infradead.org; Tue, 01 Apr 2025 21:07:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=fh6IUA26lEyrJEifWIUg0Aon6jE68Po+06xiKRDzRZA=; b=gjwanOdaKHehhGfBJDtCGVkvoA ctlw1R9BCcErUeJbbX1e1XIb0+4TEAAhirxr0EyVS6Kjf9vvsiH3GZ1WcKChqArTDeWCuiA+IjFYI 8PFxB/K4fAlp+YdHQJHFtEAvGxrLZq7Ncq+6IJ6zeZlPSQbkp8iwME+fxkrNg0q6deCxKYLbUWEA7 UeAhGgjMDenRtVsiVoQtMoqM88GkCMe53zqXR+eb4vSWLmsEqy/Nj4BzNj2EJQ0rAikfPF52rl+ai Ir2xYD/3LQdDdVw8UQJ7IGvFyskv7PwwHhsT1lmYZ7DCjKsWCR2uwZ7ILglzEBaW2IMKgTcaqX1yO Gz/URRag==; Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by desiato.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzipl-00000006sXe-1KG9 for linux-arm-kernel@lists.infradead.org; Tue, 01 Apr 2025 21:07:47 +0000 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-2254e0b4b79so155113355ad.2 for ; Tue, 01 Apr 2025 14:07:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1743541661; x=1744146461; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fh6IUA26lEyrJEifWIUg0Aon6jE68Po+06xiKRDzRZA=; b=VTdcog1jMqllPgZJjEt6TJ8tczN1HVc7ehAUUeiQ0OAXHM5Rdvp+1+Ogm2c1TGP44Q mQmZEZ6hItznFy79bK1e0uy0ASZVXCMSKVAKeQgMGV7R/WO6+p8Wf/SE2dFF8PEWS/Gv 3DOdCGARhxhd7YAp7KYc/7w5AwsBYyhSs5GsQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743541661; x=1744146461; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fh6IUA26lEyrJEifWIUg0Aon6jE68Po+06xiKRDzRZA=; b=ueixIFQgldg5rWuk9k36Cuvft0BWzhvfxaKbCgNusPsH5rEDa5p1cX3nTGHL3F85P9 poXL/0961D8yvMySIJ5zDQsYjH9TTKFOBoC87liixU/69qcHhbCvrMh+u3ctibvO1X7v d15BHJVcoJaQ32PpmRBAUcjwXH6MCPjUeL32qSW7k2x2fQysFJVeXHL7R7ABq1XFW3Zy m3XPhlPQzYusYZOj84R9C5ElEMU1XUAEuxWDzEtW4c+0io+KV2g/2uyOh//ggZhnrnVu P9j1opS2glBlwIn/MP0R4QuIcAwB86l4UJ049Vs5mMiA5xuchghCFZTVxTYR8WJASNcd X2kg== X-Gm-Message-State: AOJu0YxP+8LD+KQGbhKondiMHO83qVRESQZo5nes5WJmqZzLmBlbFpKy NyuFx6RsOaPrGu1V8Q2WW8XLzw3xdFXobdhZLAGEfYMPuZFL+CWUeGJ0apwRYQQ1QREB7eBXV0s ehfLy7kGSLfH05NBn73kmEEhH8CDhrkvus2BNRYqgdAm6odpRQ2WfeOgZyqSY3muZxq/3x5cCAy rBVjPN4aVpjsTtSFEUYne/A3IHohouSG0f24B2iMOYGkIwVDMsODbjV6jLZw== X-Gm-Gg: ASbGncte3VzITYEWpIGUBPrdZ3kjP5+6IZe7afETZBg3+qQ6v300pH9UllGoaeRBBcb O5pvmR0zje0RVTtHWD1hufL7Hp/yRsz4motEKGcszDQGwgfvaYDPD5mCSNvht4uBGIFS/tKr1Q2 gyESLmMRIXkXrXfORCKXZrcG6BSyMycRHFJPGS//JD74SnzOiU2XGVxOIcYFyGSDwd5Teh8uERb wOdl8GDPiGjLKtFb61yNwCF1SHFK9Ya5yNWkkGYBFPOEOD+Zwk8/DO1+/RUEHEaONpYfZD+0q9f stv6SkZ1ZtL6vbPYh2d1q/doj1JvRpFChXrkt8Xezm3dC1M3nhMr6o1sku/fAqKZuU/MZVpdmrG JKnCfAYmskmafSmxTtvmPBw== X-Google-Smtp-Source: AGHT+IGf9oq+B6UHqEuTrughCDWV/clMEy9Ly7iIk2+4GYzd43PWpBaNMRG0niwSdY027BBWwPy/rw== X-Received: by 2002:a05:6a00:2da1:b0:736:4b85:ee05 with SMTP id d2e1a72fcca58-739803c5d57mr21662614b3a.11.1743541661474; Tue, 01 Apr 2025 14:07:41 -0700 (PDT) Received: from stbirv-lnx-1.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73970deef7fsm9414995b3a.9.2025.04.01.14.07.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Apr 2025 14:07:41 -0700 (PDT) From: Justin Chen To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-phy@lists.infradead.org Cc: rafal@milecki.pl, alcooperx@gmail.com, bcm-kernel-feedback-list@broadcom.com, florian.fainelli@broadcom.com, conor+dt@kernel.org, krzk+dt@kernel.org, robh@kernel.org, kishon@kernel.org, vkoul@kernel.org, Justin Chen Subject: [PATCH v2 1/2] dt-bindings: phy: brcmstb-usb-phy: Add support for bcm74110 Date: Tue, 1 Apr 2025 14:07:35 -0700 Message-Id: <20250401210736.2613748-2-justin.chen@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250401210736.2613748-1-justin.chen@broadcom.com> References: <20250401210736.2613748-1-justin.chen@broadcom.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250401_220745_673424_26DCB727 X-CRM114-Status: GOOD ( 10.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org bcm74110 brcmstb usb phy adds further power savings during suspend states. Signed-off-by: Justin Chen --- v2: Sorted compat string odering Add new compat string to constraints .../devicetree/bindings/phy/brcm,brcmstb-usb-phy.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/phy/brcm,brcmstb-usb-phy.yaml b/Documentation/devicetree/bindings/phy/brcm,brcmstb-usb-phy.yaml index 580fbe37b37f..28906bb664f4 100644 --- a/Documentation/devicetree/bindings/phy/brcm,brcmstb-usb-phy.yaml +++ b/Documentation/devicetree/bindings/phy/brcm,brcmstb-usb-phy.yaml @@ -15,9 +15,10 @@ maintainers: properties: compatible: enum: - - brcm,bcm4908-usb-phy + - brcm,bcm74110-usb-phy - brcm,bcm7211-usb-phy - brcm,bcm7216-usb-phy + - brcm,bcm4908-usb-phy - brcm,brcmstb-usb-phy reg: @@ -139,7 +140,9 @@ allOf: properties: compatible: contains: - const: brcm,bcm7216-usb-phy + enum: + - brcm,bcm74110-usb-phy + - brcm,bcm7216-usb-phy then: properties: reg: From patchwork Tue Apr 1 21:07:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Chen X-Patchwork-Id: 14035343 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6B9F1C36010 for ; Tue, 1 Apr 2025 21:14:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9cGZNzTDySqtCe9xGXh3eTfbPIhI3Qq1UlfL9bUHRLY=; b=oy7RdpyiUL6IsuhAONHyVKVDxF cKQDfrrhRurJ0hdiCqwpHPuSBx2FM1s2lMYxK9jGQpLBB6cNyWmVEcIJMcxiFJK6ua1cI57l1EWUy QhaMdDU9GZPe+zsM8psdrRbOoV/QeIP+bJ+u3eVb0wyG7HWT3W66MRi8D/EFp7J6zTbMRXjY5pemG nSdJLr65WkyqXpYNXPERbr2LYUHTrYMGDd8IbRfa20zw7QC9YP9An6kBcp5rhubHrsCe3Pb4qYoTg oZxT0Y+Ar/PaqyZbWhYcjKNWeHW1oYoyjuUvlRWJ4LqlkvPpiMp3tLn2wt6Sk8J6TqUn+Vapp8GaV jVNDXDag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.1 #2 (Red Hat Linux)) id 1tziw8-00000004QeS-21S5; Tue, 01 Apr 2025 21:14:20 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzipk-00000004P3N-0NCv for linux-arm-kernel@lists.infradead.org; Tue, 01 Apr 2025 21:07:45 +0000 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-22438c356c8so117610645ad.1 for ; Tue, 01 Apr 2025 14:07:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1743541663; x=1744146463; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9cGZNzTDySqtCe9xGXh3eTfbPIhI3Qq1UlfL9bUHRLY=; b=J0YfW+FGF7jnAn1I6Ne7eAGV7xSakgYSWjglgI0SxVVwAMS6eEAqlxZPQ4H1Wrs5Uk AUtekcjErzSF/aCvdqotCKvpHxDUjZRRy8hditEc1FMNTGKZfAk/UpfC4QPGK5Yvr1vc Yy4Twlr2A+Bo7KLDdKptxqJtlVKEY4yGxPoLI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743541663; x=1744146463; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9cGZNzTDySqtCe9xGXh3eTfbPIhI3Qq1UlfL9bUHRLY=; b=o7745mpp7N3EteT2ohoJF3KAQJd8CUOGXHY4ojhD+PymSLYm8vjTWLeOX0GT+1GBdb 0ECDR1QSyd/V1Pj2G8TgAA6o+SEUKDjuIRDi/BV/u1ihxxILuZ3TeUQwXlFSB2Xmj+Tp LQThMOWcwi6CzMDT6iqcfIPeBBDkMCHaKGeUeFw356oZulmXqZU0WEcFFPyBkHW9Qjl9 DkZ/GzqDQrho2badDdpGvaq/FaUs0JfMvffnfvK7nui9NGhNjkNtygTDGZCU1Sb7HKs3 hX1vYcZo1x84OqvBqJMHgrmag7DPXQxyekC5K9Dgf5ZOiz96/VY6ru/TdVygpsAehKDy X6Gw== X-Gm-Message-State: AOJu0YwuF+Wjcjs85UY8CjL53QS1v9QodIdiuTUGO6ivX0XuCy/0yrPK 8lhCWn/P5QH982vunXvOMYodZcWsXULJGtVgWNDLm+KDv7PYznVJcxraDmcIcng253CHHhEhHni e9yCuVNY/7d4QY48DYuaHhdho4SDVH1qz9tZq11RG27KzuNATsOYmLCLSqz6WI7nG8UqxWx/AZD ALneg2c0wZv8TgWHXRSeiRVRtCwv8xl5YX5v4EENKmC2G8iSh+WdCkupumQA== X-Gm-Gg: ASbGncsKLDgGx1/e1dZQePygiLrUEU4lsKVAPW+tNOoB/rVhnQn+2fUlgePwcqQbWEV OFdas7itDF25Hvb8/zU3XoOxVoVgBTJUshg8xF16gysPf/E+PsmQtg02X3pc6Yi5+HcMMFBYcus GC0Y24eax+zx7BdNvPCtzy2279oOHWD415nj+cTgYhloGEpAjyRsyuAje1bF+X8PPcntuRy1x4h Gv3brqKVdqfhTCp+Q9DLxKfES9YvRLsJOyIifEI4CNMJEIKkdJg9v4846fNPoxGbZ3XrMU+PAsp LKdEzMOmOrYL+sd+hy4UdXCNXBel7xaH8qRDDwqUf3aXkrvuXQKEehWgOm/2b9XDsPEDlFT9HaP t3x59xAHMvPray2Xj7Fu5dw== X-Google-Smtp-Source: AGHT+IFLDrJLEatm7s+GAbwkMWcBogEjj61Fn4bw0eSDrWuf3LIpPvI8qKY0wpi06AoycTIkarChtw== X-Received: by 2002:a05:6a00:3c91:b0:736:53c5:33ba with SMTP id d2e1a72fcca58-7398043000fmr19821066b3a.16.1743541662774; Tue, 01 Apr 2025 14:07:42 -0700 (PDT) Received: from stbirv-lnx-1.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73970deef7fsm9414995b3a.9.2025.04.01.14.07.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Apr 2025 14:07:42 -0700 (PDT) From: Justin Chen To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-phy@lists.infradead.org Cc: rafal@milecki.pl, alcooperx@gmail.com, bcm-kernel-feedback-list@broadcom.com, florian.fainelli@broadcom.com, conor+dt@kernel.org, krzk+dt@kernel.org, robh@kernel.org, kishon@kernel.org, vkoul@kernel.org, Justin Chen Subject: [PATCH v2 2/2] phy: usb: add support for bcm74110 Date: Tue, 1 Apr 2025 14:07:36 -0700 Message-Id: <20250401210736.2613748-3-justin.chen@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250401210736.2613748-1-justin.chen@broadcom.com> References: <20250401210736.2613748-1-justin.chen@broadcom.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250401_140744_121141_A44AD4C1 X-CRM114-Status: GOOD ( 15.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org bcm74110 adds a freerun utmi/ref clock that saves further power during suspend states. A tune is also necessary to pass USB compliance test. Signed-off-by: Justin Chen Reviewed-by: Florian Fainelli --- .../phy/broadcom/phy-brcm-usb-init-synopsys.c | 61 +++++++++++++++++++ drivers/phy/broadcom/phy-brcm-usb-init.h | 1 + drivers/phy/broadcom/phy-brcm-usb.c | 14 +++++ 3 files changed, 76 insertions(+) diff --git a/drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c b/drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c index dc452610934a..8a5ed50f2da0 100644 --- a/drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c +++ b/drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c @@ -43,6 +43,8 @@ #define USB_CTRL_SETUP_tca_drv_sel_MASK BIT(24) #define USB_CTRL_SETUP_STRAP_IPP_SEL_MASK BIT(25) #define USB_CTRL_USB_PM 0x04 +#define USB_CTRL_USB_PM_REF_S2_CLK_SWITCH_EN_MASK BIT(1) +#define USB_CTRL_USB_PM_UTMI_S2_CLK_SWITCH_EN_MASK BIT(2) #define USB_CTRL_USB_PM_XHC_S2_CLK_SWITCH_EN_MASK BIT(3) #define USB_CTRL_USB_PM_XHC_PME_EN_MASK BIT(4) #define USB_CTRL_USB_PM_XHC_SOFT_RESETB_MASK BIT(22) @@ -61,6 +63,13 @@ #define USB_CTRL_CTLR_CSHCR_ctl_pme_en_MASK BIT(18) #define USB_CTRL_P0_U2PHY_CFG1 0x68 #define USB_CTRL_P0_U2PHY_CFG1_COMMONONN_MASK BIT(10) +#define USB_CTRL_P0_U2PHY_CFG2 0x6c +#define USB_CTRL_P0_U2PHY_CFG2_TXVREFTUNE0_MASK GENMASK(20, 17) +#define USB_CTRL_P0_U2PHY_CFG2_TXVREFTUNE0_SHIFT 17 +#define USB_CTRL_P0_U2PHY_CFG2_TXRESTUNE0_MASK GENMASK(24, 23) +#define USB_CTRL_P0_U2PHY_CFG2_TXRESTUNE0_SHIFT 23 +#define USB_CTRL_P0_U2PHY_CFG2_TXPREEMPAMPTUNE0_MASK GENMASK(26, 25) +#define USB_CTRL_P0_U2PHY_CFG2_TXPREEMPAMPTUNE0_SHIFT 25 /* Register definitions for the USB_PHY block in 7211b0 */ #define USB_PHY_PLL_CTL 0x00 @@ -369,6 +378,42 @@ static void usb_uninit_common_7216(struct brcm_usb_init_params *params) } } +static void usb_init_common_74110(struct brcm_usb_init_params *params) +{ + void __iomem *ctrl = params->regs[BRCM_REGS_CTRL]; + u32 reg; + + reg = brcm_usb_readl(USB_CTRL_REG(ctrl, USB_PM)); + reg &= ~(USB_CTRL_MASK(USB_PM, REF_S2_CLK_SWITCH_EN) | + USB_CTRL_MASK(USB_PM, UTMI_S2_CLK_SWITCH_EN)); + brcm_usb_writel(reg, USB_CTRL_REG(ctrl, USB_PM)); + + usb_init_common_7216(params); + + reg = brcm_usb_readl(USB_CTRL_REG(ctrl, P0_U2PHY_CFG2)); + reg &= ~(USB_CTRL_P0_U2PHY_CFG2_TXVREFTUNE0_MASK | + USB_CTRL_P0_U2PHY_CFG2_TXRESTUNE0_MASK | + USB_CTRL_P0_U2PHY_CFG2_TXPREEMPAMPTUNE0_MASK); + reg |= (0x6 << USB_CTRL_P0_U2PHY_CFG2_TXVREFTUNE0_SHIFT) | + (0x3 << USB_CTRL_P0_U2PHY_CFG2_TXRESTUNE0_SHIFT) | + (0x2 << USB_CTRL_P0_U2PHY_CFG2_TXPREEMPAMPTUNE0_SHIFT); + brcm_usb_writel(reg, USB_CTRL_REG(ctrl, P0_U2PHY_CFG2)); +} + +static void usb_uninit_common_74110(struct brcm_usb_init_params *params) +{ + void __iomem *ctrl = params->regs[BRCM_REGS_CTRL]; + u32 reg; + + if (params->wake_enabled) { + reg = brcm_usb_readl(USB_CTRL_REG(ctrl, USB_PM)); + reg |= (USB_CTRL_MASK(USB_PM, REF_S2_CLK_SWITCH_EN) | + USB_CTRL_MASK(USB_PM, UTMI_S2_CLK_SWITCH_EN)); + brcm_usb_writel(reg, USB_CTRL_REG(ctrl, USB_PM)); + } + usb_uninit_common_7216(params); +} + static void usb_uninit_common_7211b0(struct brcm_usb_init_params *params) { void __iomem *ctrl = params->regs[BRCM_REGS_CTRL]; @@ -426,6 +471,16 @@ static void usb_set_dual_select(struct brcm_usb_init_params *params) brcm_usb_writel(reg, USB_CTRL_REG(ctrl, USB_DEVICE_CTL1)); } +static const struct brcm_usb_init_ops bcm74110_ops = { + .init_ipp = usb_init_ipp, + .init_common = usb_init_common_74110, + .init_xhci = usb_init_xhci, + .uninit_common = usb_uninit_common_74110, + .uninit_xhci = usb_uninit_xhci, + .get_dual_select = usb_get_dual_select, + .set_dual_select = usb_set_dual_select, +}; + static const struct brcm_usb_init_ops bcm7216_ops = { .init_ipp = usb_init_ipp, .init_common = usb_init_common_7216, @@ -446,6 +501,12 @@ static const struct brcm_usb_init_ops bcm7211b0_ops = { .set_dual_select = usb_set_dual_select, }; +void brcm_usb_dvr_init_74110(struct brcm_usb_init_params *params) +{ + params->family_name = "74110"; + params->ops = &bcm74110_ops; +} + void brcm_usb_dvr_init_7216(struct brcm_usb_init_params *params) { diff --git a/drivers/phy/broadcom/phy-brcm-usb-init.h b/drivers/phy/broadcom/phy-brcm-usb-init.h index c1a88f5cd4cd..4c7be78d0b14 100644 --- a/drivers/phy/broadcom/phy-brcm-usb-init.h +++ b/drivers/phy/broadcom/phy-brcm-usb-init.h @@ -72,6 +72,7 @@ struct brcm_usb_init_params { bool wake_enabled; }; +void brcm_usb_dvr_init_74110(struct brcm_usb_init_params *params); void brcm_usb_dvr_init_4908(struct brcm_usb_init_params *params); void brcm_usb_dvr_init_7445(struct brcm_usb_init_params *params); void brcm_usb_dvr_init_7216(struct brcm_usb_init_params *params); diff --git a/drivers/phy/broadcom/phy-brcm-usb.c b/drivers/phy/broadcom/phy-brcm-usb.c index 6362ca5b7fb6..0666864c2f77 100644 --- a/drivers/phy/broadcom/phy-brcm-usb.c +++ b/drivers/phy/broadcom/phy-brcm-usb.c @@ -283,6 +283,16 @@ static const struct attribute_group brcm_usb_phy_group = { .attrs = brcm_usb_phy_attrs, }; +static const struct match_chip_info chip_info_74110 = { + .init_func = &brcm_usb_dvr_init_74110, + .required_regs = { + BRCM_REGS_CTRL, + BRCM_REGS_XHCI_EC, + BRCM_REGS_XHCI_GBL, + -1, + }, +}; + static const struct match_chip_info chip_info_4908 = { .init_func = &brcm_usb_dvr_init_4908, .required_regs = { @@ -325,6 +335,10 @@ static const struct match_chip_info chip_info_7445 = { }; static const struct of_device_id brcm_usb_dt_ids[] = { + { + .compatible = "brcm,bcm74110-usb-phy", + .data = &chip_info_74110, + }, { .compatible = "brcm,bcm4908-usb-phy", .data = &chip_info_4908,