From patchwork Thu Dec 22 14:09:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 35775 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp348001wrn; Thu, 22 Dec 2022 06:13:56 -0800 (PST) X-Google-Smtp-Source: AMrXdXvHkUvxADwYONOPXij/0XIfA3CMaXG8uMm1Vu70G4rTENq+0ZvniEusNHKhcpR7dviiiP7r X-Received: by 2002:a17:906:9255:b0:7c0:d4fa:3151 with SMTP id c21-20020a170906925500b007c0d4fa3151mr8047893ejx.17.1671718435854; Thu, 22 Dec 2022 06:13:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671718435; cv=none; d=google.com; s=arc-20160816; b=lYEC/Of/avrC9l6lpsxGQXt8tWi9/4x8lmTpE1nt2wufCxYKRpdp9ICrz8DiiVrcmc /j5rB0FKfsQd8AqUlWbgWXTAAtBa4cXCpC8DCRvkoGS7/9mUa8e876C5T/C0tR9WX+Tv zakRBW8LPsLKVX/ruRwy1Hc9P6XRsylQpPSnbNA/e2pxH6nz1mPu6lFvSlKSfeRI14Pa MZsPTwsf7bmEl5Y6sP4sE0sr6nSdWyalH91L1KHvOV38cA+hHYgB41SISGrLDz8QQ2WD gkhbDjDQWo8G6G15kWBBB61eFS+nCghC4dPCArKgupkqHLRpFSjxYen2vpc49NrxDgi0 KROQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jJtmctAn+JbZO04zA2NymL/wNMdvFkipKZ36ajZk2HE=; b=DWfEZltkqWwRrAPzzC09oINieQon8dI8I47dgL+gx3XU+3rpFnTipP2RnzMxjIOFr2 8LDE7kmfZYlN+KJkoav84jkauUqtJe4vl/cE28txAuJ6q0hoHwlkNXOUk2b3bNJZzoXe omQjcgf2pQOVWj7P2p0SHugTzhv4dsLQvzi9PRZKWY8Lv9M+lFacIBELxda2fBBDRKm6 tVAkas+fcDagCOfqATxfMGW580wD+MYT7fbO5YArH38+fXB1j7m46HEqyfVokVSVIj7C xGapJNkPfTeTB8DB5CXn8bt6Rr534sqoigWlhWXIxr+Z0SHr3hboRuHkcIHoRhbOGyfb 7v6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LCHG59Lx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt30-20020a1709072d9e00b007c118b2d91dsi646845ejc.248.2022.12.22.06.13.28; Thu, 22 Dec 2022 06:13:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LCHG59Lx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235434AbiLVOLJ (ORCPT + 99 others); Thu, 22 Dec 2022 09:11:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235433AbiLVOKr (ORCPT ); Thu, 22 Dec 2022 09:10:47 -0500 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1237F2B for ; Thu, 22 Dec 2022 06:10:45 -0800 (PST) Received: by mail-pj1-x102e.google.com with SMTP id fy4so2054786pjb.0 for ; Thu, 22 Dec 2022 06:10:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=jJtmctAn+JbZO04zA2NymL/wNMdvFkipKZ36ajZk2HE=; b=LCHG59LxknVI6ftLVZAgsbjGQERawPN5kaQfdYLk5gx6j1xmSgrXT0llnfQeddfjYQ BxLdIqaffhBEQgVtmTJ7hiOmnCDf5Fy7cruF9UDCpg5SJlkwzSizc9qVf4A+O6c6QdbB T26R/zObGbvuC0SzdUMmrcsVtDcvJ/gtRtw8xOB1NkBoouAaHpNdStXHHQBViiY9PhOz KBc9dsmdJbq4tAGLIKOTh2V4KimVCeQliSp8V1L98FmlAAxaMLW+PM22U8aBScaNk/o7 JZpygPeurIuplNzO37DOr37Ayg/IoPs53eb0IMHr5iowSqyLFtwVVeopbqRcNL3Rjs9G /f1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=jJtmctAn+JbZO04zA2NymL/wNMdvFkipKZ36ajZk2HE=; b=dIBWKXVBapQyUpE6P3unhLqj0QPY9Cmtwz7wXkB8aHLpdr6V3Bp5hfS4Cg7NU1ULoJ 8FNUNRkL5HhXy/k6XjUWhChXzSjtKsM3rdYdyd+zrLXGhmN1QZmE9YO6GT08ohMdY17r NrNpXAxXMZ3ofQk4pmdPv/6431NLs0SxTjDRMQvmZOWx7RSf+v7rMFkG6bep8xveswfF /rXZs1NCGQpi3hPnLG0wKGigiTBlp0HrbVGrANKctLLHd+tqwbR0cyXXrH+YVEwVffTF AzxBuH6xol8JGjoRJ1Geq38rozE38gNCWf0gpeiFC8VxtNUlYX8NZsWArAUaZ0dIhyDU 5+UQ== X-Gm-Message-State: AFqh2krhHrm9n+M5WPZgl+AjjKryjJJ48MuM9qYHLrlRXhhugc98eATI ssguNGPRJ8nYjTkieZTePIB4 X-Received: by 2002:a17:90a:c717:b0:219:1338:ab14 with SMTP id o23-20020a17090ac71700b002191338ab14mr6710953pjt.22.1671718245249; Thu, 22 Dec 2022 06:10:45 -0800 (PST) Received: from localhost.localdomain ([117.217.177.177]) by smtp.gmail.com with ESMTPSA id f8-20020a655908000000b0047829d1b8eesm832031pgu.31.2022.12.22.06.10.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Dec 2022 06:10:44 -0800 (PST) From: Manivannan Sadhasivam To: martin.petersen@oracle.com, jejb@linux.ibm.com, andersson@kernel.org, vkoul@kernel.org Cc: quic_cang@quicinc.com, quic_asutoshd@quicinc.com, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-scsi@vger.kernel.org, dmitry.baryshkov@linaro.org, ahalaney@redhat.com, abel.vesa@linaro.org, alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, Manivannan Sadhasivam Subject: [PATCH v5 05/23] phy: qcom-qmp-ufs: Add support for configuring PHY in HS G4 mode Date: Thu, 22 Dec 2022 19:39:43 +0530 Message-Id: <20221222141001.54849-6-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221222141001.54849-1-manivannan.sadhasivam@linaro.org> References: <20221222141001.54849-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752923830227034987?= X-GMAIL-MSGID: =?utf-8?q?1752923830227034987?= Add separate tables_hs_g4 instance to allow the PHY driver to configure the PHY in HS G4 mode. The individual SoC configs need to supply the Rx, Tx and PCS register setting in tables_hs_g4 and the UFS driver can request the Hs G4 mode by calling phy_set_mode_ext() with submode set to UFS_HS_G4. Reviewed-by: Dmitry Baryshkov Tested-by: Andrew Halaney # Qdrive3/sa8540p-ride Signed-off-by: Manivannan Sadhasivam --- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c index 2d5dd336aeb2..82be9b754e8e 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c @@ -20,6 +20,7 @@ #include #include +#include #include "phy-qcom-qmp.h" /* QPHY_SW_RESET bit */ @@ -549,6 +550,8 @@ struct qmp_phy_cfg { const struct qmp_phy_cfg_tbls tbls; /* Additional sequence for HS Series B */ const struct qmp_phy_cfg_tbls tbls_hs_b; + /* Additional sequence for HS G4 */ + const struct qmp_phy_cfg_tbls tbls_hs_g4; /* clock ids to be requested */ const char * const *clk_list; @@ -583,6 +586,7 @@ struct qmp_ufs { struct phy *phy; u32 mode; + u32 submode; }; static inline void qphy_setbits(void __iomem *base, u32 offset, u32 val) @@ -847,7 +851,11 @@ static void qmp_ufs_init_registers(struct qmp_ufs *qmp, const struct qmp_phy_cfg if (qmp->mode == PHY_MODE_UFS_HS_B) qmp_ufs_serdes_init(qmp, &cfg->tbls_hs_b); qmp_ufs_lanes_init(qmp, &cfg->tbls); + if (qmp->submode == UFS_HS_G4) + qmp_ufs_lanes_init(qmp, &cfg->tbls_hs_g4); qmp_ufs_pcs_init(qmp, &cfg->tbls); + if (qmp->submode == UFS_HS_G4) + qmp_ufs_pcs_init(qmp, &cfg->tbls_hs_g4); } static int qmp_ufs_com_init(struct qmp_ufs *qmp) @@ -1021,6 +1029,7 @@ static int qmp_ufs_set_mode(struct phy *phy, enum phy_mode mode, int submode) struct qmp_ufs *qmp = phy_get_drvdata(phy); qmp->mode = mode; + qmp->submode = submode; return 0; }