From patchwork Wed Oct 2 20:15:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 13820335 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8EAD2141C4 for ; Wed, 2 Oct 2024 20:16:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727900177; cv=none; b=Q73/7baHNvhGLeGgmkPC6LPUm/yqVreNMlYmUBvYm2ilNRjgpq/eqTR43iq2z517a+o02ufHudB/YlTRacZaBk2p2dPuUID0zlowLRB/0R/akG7kfoE+Dyv3AHnL/2/oh6yBTEPm3mjGazq4R3tIUHR+XfVDPZv89e73VwKorrs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727900177; c=relaxed/simple; bh=jeQ1C5PHQbzYDTn/Z+W3aONfRVPLcQBP4SwmfKLBYow=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rjVYpPZAtkXwQih2NEg3PL2Wqtg0pTVQmTcgGZIxsAESM1s9wcsWw7J2P1wYRRWiopSgaPHKZ/jraCW3Q4n7PlkvVpDxGJHCrpIAMiHpz5dqEvVnio0N9JA4wxWnLZcO5wS7QXNhgeBedTHdfP9omW3/0772HR0BpSaA6UxgQeQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=VMMEfJB/; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VMMEfJB/" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-42cd46f3a26so1083615e9.2 for ; Wed, 02 Oct 2024 13:16:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727900174; x=1728504974; darn=vger.kernel.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=+jX211dAZAvJkuP8OIZ+el1p2Mcg021bO+6I10YA2EY=; b=VMMEfJB/jucF9fQukBehVXwL7dyO0Vafy/9sfEY07EavHRqJa9tiEg5Ln3S9GZFckg LTqo5YZwdlibl0oXAxVui4dYV02PnXN+zKL51SlusQy2s3hokIpBYr5CMgsIjIrRRcZq jUs4wtbXUQageTuqZEoFx17MRdoA93QCdmfrrGwwXeZNM821cAFQV1LUondKeqcPfA/l PFg1duRRHAZ3s1+yEC0udc+PpgUw9UIMEdiRlBTGL4JUTRLKVNbIUnLpvy0ThWAYA/n/ uWEhw7DGcrLs4YvwdLNk6llffPI/S5qSofyyo6wcQI6hcJOs3wycwrngfti+ylVyeXwQ 4C+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727900174; x=1728504974; 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=+jX211dAZAvJkuP8OIZ+el1p2Mcg021bO+6I10YA2EY=; b=hcXbDeSoEDL/b0PAmCzzbtIluht6Lv7Yzj2PgnNO3pFXRs5GRkCa6pzmzmKDR1brdw F/AG7F9twPWICmYyfe8qh5pndYFJsRy9oobuu8SccmBiDQkKa5NPZ39qT0stPr3p3uuB MUVvmC8IlTbvE75m6D5TNgY8gzS3//YgQNNgxLZ72wjQFYNKBMcJWIPI+CaOYxXQvpLU ESlFAmclPeh8SytvUrAR2Do8dZAe5WOD97guCUrOKHpvpaV1mfscQCX8P46ZU22SdrjW xniFz6t6Kkq7qjzQKwWHLgK6PQPix2aUtmxlyWVwnKxCZ1NuiNHChyozSr0pO+TBkl2S fh0Q== X-Forwarded-Encrypted: i=1; AJvYcCVDn3T179UFkeHgMMjD+sAPNLJQThfU8TCu8M6dvmPh2EDg5rvh2Sx32yCqdME3RCM72HqkIFmAOnjeihChWcl/VQ==@vger.kernel.org X-Gm-Message-State: AOJu0YzU7+J+QlK9SpTtRB/v9kXgcEE0/GDyxW3JyVnnPkqwn1RQ+iiT vHK3lnOsai716fOElVlzTA8NJRRPK4tSKeS8wBPeAXtHNmYPFvm0iQqoqI3ysdY= X-Google-Smtp-Source: AGHT+IHWRZVOeFFozi3DIiPiL+943vH2vaAy8MMudke5kiB5y6RE2CXPLw9EOtOlNRxTNhpGiUSfiA== X-Received: by 2002:a05:600c:3b05:b0:42c:b750:19ce with SMTP id 5b1f17b1804b1-42f777b628fmr32913575e9.1.1727900174107; Wed, 02 Oct 2024 13:16:14 -0700 (PDT) Received: from gpeter-l.lan ([145.224.66.77]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37cd564d2e8sm14850600f8f.18.2024.10.02.13.16.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 13:16:13 -0700 (PDT) From: Peter Griffin To: vkoul@kernel.org, kishon@kernel.org, krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com Cc: tudor.ambarus@linaro.org, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Peter Griffin Subject: [PATCH 1/3] phy: Add UFS phy hibernate modes Date: Wed, 2 Oct 2024 21:15:53 +0100 Message-ID: <20241002201555.3332138-2-peter.griffin@linaro.org> X-Mailer: git-send-email 2.46.1.824.gd892dcdcdd-goog In-Reply-To: <20241002201555.3332138-1-peter.griffin@linaro.org> References: <20241002201555.3332138-1-peter.griffin@linaro.org> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Some UFS phys need to write hibernation specific values when entering and exiting hibernate state. Add two new UFS phy modes to the phy framework so that this is possible. One such platform that requires this is Pixel 6 which uses the gs101 SoC. Signed-off-by: Peter Griffin --- include/linux/phy/phy.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index 03cd5bae92d3..1874e55e2bb9 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h @@ -42,7 +42,9 @@ enum phy_mode { PHY_MODE_MIPI_DPHY, PHY_MODE_SATA, PHY_MODE_LVDS, - PHY_MODE_DP + PHY_MODE_DP, + PHY_MODE_UFS_HIBERN8_ENTER, + PHY_MODE_UFS_HIBERN8_EXIT, }; enum phy_media { From patchwork Wed Oct 2 20:15:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 13820336 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B8BE216A22 for ; Wed, 2 Oct 2024 20:16:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727900178; cv=none; b=J67GXX8EMJkBz6WxqGiBO892dL0DGSy4zo5Y6De2xj2eb+pFcR4YzQyTqLLxe6Pj2m6gw5Vi8DJGjNtRHgwMKD0Ie0vhNIvUn7Ng2Kb/n/xUSTzahL8MB94hiQvP3+J9Nn10KIVCWO+1AmCdCkkhopXuCwE2K6tDo33c0oE54dU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727900178; c=relaxed/simple; bh=dXlbjZd+8YKtogCZ/dJtTJwwBRivMwtGgcmgRCO2fgw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F4TV5d52WSqK9IKl4jyID+Zk5kESfJbdt9oKmvO2J2VBgz8qqgPEb7ob5l7GxSik4WpQxPEF6Al8vFajsqXpJGlHqu0il0eGDmgbo+6Vm4W/VfiXCNAcuUfzY/IohBFrHHIMPO4Y3v9hP0h3HvDozLiVMeI+mEV59UlQUYEkgAs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=t1Lx0fic; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="t1Lx0fic" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-37cc846fbc4so156930f8f.2 for ; Wed, 02 Oct 2024 13:16:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727900175; x=1728504975; darn=vger.kernel.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=grqdGWxVlr6gg9Igkyge2iFlQEJRxUTK9OOJod+O8as=; b=t1Lx0ficGeXmAdfHUPa07dgNpJpmUOmPRNKv4huJcXPclo3o7yyplnZB+iquFqfkwq 7B6CVzaaDKlBUpYGwx1uFz8dvcYFO0kkxQ0DWxqyfShthodktnlVjHxLDQusgnok3dkr MEOJ+lTtzt0N+QXll6Mj27FciBcqqj4d3tWVbo0Z/o5gcaJR3r2C+EI6KhrydDtNNK1H a6Qq3ouuQl7QYOm2K1b+CAgY6/wE8oWFlGnb1075uF60KtBFezgyLGuawjXZrElp2vjM iRuYiGHmuKRKK0h5ypM3LaupDBfF/AsVzsLmk23RSkKuJ6XL3ptRNPLXs/6LLLKlksBb zUdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727900175; x=1728504975; 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=grqdGWxVlr6gg9Igkyge2iFlQEJRxUTK9OOJod+O8as=; b=ihA/vlunv0NFq+88rZkiXDAIWsIst93UOgifjThICFoD7dJ6QkM898QmIvyFfIoNEi LWqnWWJezE0Ypte3hWBMpojLrlaKEKiPIdm70FBsnmzJg93hf2+3JqXvroKTEGcYTVn7 BiLo1pZM97Emt1HZmJqVmvJVxyfUlYNYIkFMT+AOCwOB9HbxkSp+QEbExSl0pK2m4G+J d0PmeXcCber/0DZ7EquuPCXRXpmK+x2rKzqnwOBAWYnk6Vy7p6TSK+E0yKAO34G/HTUF wq6E6NL+7vy5Qfx4LywtRlJjsZDlyGYtZl/bbVMcvjfGut0JR79Yl60KtmmX9AOOoGf6 uewA== X-Forwarded-Encrypted: i=1; AJvYcCWF9JattkHacv9eUm++GvUs23PVGHZa91ypi6Qu9U/sPhWjOuMSJQwxO73VFyyj/uUUyAeZkAYITgFDD6qmKQjsKw==@vger.kernel.org X-Gm-Message-State: AOJu0YwSRPpc5JhbT9ReVRLPeHc/duUHR65pgIvMcOEo/XhXu1xcxOEj z9vDQb9tSygGFPJHOplmJpyHMo6zaKf5pqhc2Ra8jWmjatoE/620es3w6cKiJ74= X-Google-Smtp-Source: AGHT+IEQc2WmlGwouFQBkWQzt6fGr5tg/HyKqMkIdRZTfK8Hcv4Eq8Fi6eRvtniBCRuj83IQhPoGdQ== X-Received: by 2002:adf:f285:0:b0:368:37ac:3f95 with SMTP id ffacd0b85a97d-37cfb9d32d9mr2626016f8f.31.1727900175454; Wed, 02 Oct 2024 13:16:15 -0700 (PDT) Received: from gpeter-l.lan ([145.224.66.77]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37cd564d2e8sm14850600f8f.18.2024.10.02.13.16.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 13:16:15 -0700 (PDT) From: Peter Griffin To: vkoul@kernel.org, kishon@kernel.org, krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com Cc: tudor.ambarus@linaro.org, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Peter Griffin Subject: [PATCH 2/3] phy: samsung-ufs: add support for HIBERN8_ENTER and HIBERN8_EXIT Date: Wed, 2 Oct 2024 21:15:54 +0100 Message-ID: <20241002201555.3332138-3-peter.griffin@linaro.org> X-Mailer: git-send-email 2.46.1.824.gd892dcdcdd-goog In-Reply-To: <20241002201555.3332138-1-peter.griffin@linaro.org> References: <20241002201555.3332138-1-peter.griffin@linaro.org> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add two new states CFG_POST_HIBERN8_ENTER and CFG_PRE_HIBERN8_EXIT to the phy driver which map to the new PHY_MODE_UFS_HIBERN8_ENTER and PHY_MODE_UFS_HIBERN8_EXIT modes. These are used to program phy specific calibration values when entering and exiting hibern8. When exiting from hibern8 state we also update the logic to wait for cdr lock. Signed-off-by: Peter Griffin --- drivers/phy/samsung/phy-samsung-ufs.c | 18 ++++++++++++++++-- drivers/phy/samsung/phy-samsung-ufs.h | 2 ++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/phy/samsung/phy-samsung-ufs.c b/drivers/phy/samsung/phy-samsung-ufs.c index 6c5d41552649..7162ae5c7bc8 100644 --- a/drivers/phy/samsung/phy-samsung-ufs.c +++ b/drivers/phy/samsung/phy-samsung-ufs.c @@ -87,6 +87,12 @@ static int samsung_ufs_phy_calibrate(struct phy *phy) return -EINVAL; } + if (ufs_phy->mode == PHY_MODE_UFS_HIBERN8_ENTER) + ufs_phy->ufs_phy_state = CFG_POST_HIBERN8_ENTER; + + if (ufs_phy->mode == PHY_MODE_UFS_HIBERN8_EXIT) + ufs_phy->ufs_phy_state = CFG_PRE_HIBERN8_EXIT; + cfg = cfgs[ufs_phy->ufs_phy_state]; if (!cfg) goto out; @@ -105,8 +111,9 @@ static int samsung_ufs_phy_calibrate(struct phy *phy) goto out; } - if (ufs_phy->ufs_phy_state == CFG_POST_PWR_HS && - ufs_phy->drvdata->wait_for_cdr) { + if ((ufs_phy->ufs_phy_state == CFG_POST_PWR_HS || + ufs_phy->ufs_phy_state == CFG_PRE_HIBERN8_EXIT) && + ufs_phy->drvdata->wait_for_cdr) { err = ufs_phy->drvdata->wait_for_cdr(phy, i); if (err) goto out; @@ -137,6 +144,13 @@ static int samsung_ufs_phy_calibrate(struct phy *phy) /* Change back to INIT state */ ufs_phy->ufs_phy_state = CFG_PRE_INIT; break; + case CFG_POST_HIBERN8_ENTER: + ufs_phy->ufs_phy_state = CFG_PRE_HIBERN8_EXIT; + break; + case CFG_PRE_HIBERN8_EXIT: + /* Change back to INIT state */ + ufs_phy->ufs_phy_state = CFG_PRE_INIT; + break; default: dev_err(ufs_phy->dev, "wrong state for phy calibration\n"); } diff --git a/drivers/phy/samsung/phy-samsung-ufs.h b/drivers/phy/samsung/phy-samsung-ufs.h index 9b7deef6e10f..b42ed586aba8 100644 --- a/drivers/phy/samsung/phy-samsung-ufs.h +++ b/drivers/phy/samsung/phy-samsung-ufs.h @@ -89,6 +89,8 @@ enum { CFG_POST_INIT, CFG_PRE_PWR_HS, CFG_POST_PWR_HS, + CFG_POST_HIBERN8_ENTER, + CFG_PRE_HIBERN8_EXIT, CFG_TAG_MAX, }; From patchwork Wed Oct 2 20:15:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 13820337 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71B6021730E for ; Wed, 2 Oct 2024 20:16:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727900180; cv=none; b=bNWOK+uhmaMkxK45VOJSvcqptWTQRcK6dxjKtSqOZBA9L1SOjyjMz3XQMcizPuV6QUUm50kJov65rDhiMJOPLq/WnsSI0MJJzbt1p8zk8L9WOiu3adwMew+GS9pqsy6uzUEeH7TKuRNIhH+DexN/p9ZXWzRphc/vaLpRFexGFq8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727900180; c=relaxed/simple; bh=YFzA4DYtVbMxncovgmTezhmhuyWgqyPknSi8zHi1MWk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i/FuKkThdAsV6TdG67S/dAiNQ3p7fYB3haCPiZqOneeVvt0qR2uzq5SjL8F6Q4VRbNz2zr/Hi1s4N3nXFm5fdsJhpleYJrQg3MNtgvnlUJlLVaeHneM6ar5DWPoWKdqTscbi8R23Dvr/3Dyjj3m0Dilmqtn1Bf0/hlEH2FwxGaQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=BA9vEDTU; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BA9vEDTU" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-42cbbb1727eso1278825e9.2 for ; Wed, 02 Oct 2024 13:16:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727900177; x=1728504977; darn=vger.kernel.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=CkN9NRYd/noXKwaQRmVmIrVpTjpJo3NEqWIDvcUXohk=; b=BA9vEDTUZxzLYgp6qwopuXK21pJJje7qTq4ha89PVQ6g+SU/91dwLdgq8WcHswxjwV +fRqhbvkY7/aoZED+OP5DY0LAe3HrvuhD/MOPNwM6K48HmYaeELMEovKM9t+OWnWEiGx 1o198/+JkvBQUIP4DgSTmblIp7MtBNFPCmF2G6EyR2j+Sj6S/Xx/QL1nXXoPMXDYzXPh wIvWlXQtVA1sVvATfCTuAY9JEm+/8YO3edWLexuM1WZWKs6+BC3moQonaoFp8YfyIRT5 7ObLTNlUBdh6+IxlrIDlMQ8MNeXyqdF8rt33CIuP6IShdALstGoCdDOx19JQs94HEQss Dzzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727900177; x=1728504977; 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=CkN9NRYd/noXKwaQRmVmIrVpTjpJo3NEqWIDvcUXohk=; b=QgKG5kBTjVItHst0JOmnriOTjLVP3S4dbQlPW4bHU+Z4VyuV9DDqMDRv4xGCHZMVy6 r4VYo+LloVv5/m9ysMKZOS/Ea4NpGSzMQHeYV/kBnRDN06NihrsH9qwX3n8iNOoa7OEI uVBxe1Hk4XcpjBykiFOWZ9YfqNONQq4KfNeRRa1KhfFqmip/BUmbLisTgiTZo+CR+TTU S+MtDy6rWMcjb20d7a42l/By0PXlmYMwqyBppQY+W9OFbOeVCJKmd+YMgnt+VF+uXo4C P6tWsKFgPjJTWtPJijukJZNZNV3V1/4FVw0J0t91B9cksRFYjn6ROVssmkU4cDSzbgPc e5HQ== X-Forwarded-Encrypted: i=1; AJvYcCWmxTFR7n69J463dC0lDYHokFdh+0tRpIBlHbjTXox+o5obh4v86fUJSvU7EUc+LQUAMaaS+fFeURoW5aROoikX5Q==@vger.kernel.org X-Gm-Message-State: AOJu0YzFuL3PunNmfypb3+/0qzoRagq7+9oz/qBYqQzSvBDDZbtxedvZ OFcUsYF4A8cE1oQBWtuON8dsFTuj+5XvOENosZ0t2MLZt8dPjy7X+3UYtRL8ZdA= X-Google-Smtp-Source: AGHT+IFwyFuXYth7A8vslCHMAnUaIkp4wEUm+Zkv+c4fkaTohWk+qBC9lfK+MVzuhuapcRpBsdVkkA== X-Received: by 2002:adf:eac9:0:b0:374:b6f3:728d with SMTP id ffacd0b85a97d-37cfba07ac2mr2755315f8f.46.1727900176783; Wed, 02 Oct 2024 13:16:16 -0700 (PDT) Received: from gpeter-l.lan ([145.224.66.77]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37cd564d2e8sm14850600f8f.18.2024.10.02.13.16.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 13:16:16 -0700 (PDT) From: Peter Griffin To: vkoul@kernel.org, kishon@kernel.org, krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com Cc: tudor.ambarus@linaro.org, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Peter Griffin Subject: [PATCH 3/3] phy: samsung: gs101-ufs: Add hibern8 enter and exit specific tuning values Date: Wed, 2 Oct 2024 21:15:55 +0100 Message-ID: <20241002201555.3332138-4-peter.griffin@linaro.org> X-Mailer: git-send-email 2.46.1.824.gd892dcdcdd-goog In-Reply-To: <20241002201555.3332138-1-peter.griffin@linaro.org> References: <20241002201555.3332138-1-peter.griffin@linaro.org> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add the gs101 specific phy calibration values that need to be programmed when entering and exiting hibern8 state. Signed-off-by: Peter Griffin --- drivers/phy/samsung/phy-gs101-ufs.c | 31 ++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/drivers/phy/samsung/phy-gs101-ufs.c b/drivers/phy/samsung/phy-gs101-ufs.c index 17b798da5b57..5363d8be6c76 100644 --- a/drivers/phy/samsung/phy-gs101-ufs.c +++ b/drivers/phy/samsung/phy-gs101-ufs.c @@ -108,10 +108,35 @@ static const struct samsung_ufs_phy_cfg tensor_gs101_post_pwr_hs_config[] = { END_UFS_PHY_CFG, }; +static const struct samsung_ufs_phy_cfg tensor_gs101_post_h8_enter[] = { + PHY_TRSV_REG_CFG_GS101(0x262, 0x08, PWR_MODE_ANY), + PHY_TRSV_REG_CFG_GS101(0x265, 0x0A, PWR_MODE_ANY), + PHY_COMN_REG_CFG(0x1, 0x8, PWR_MODE_ANY), + PHY_COMN_REG_CFG(0x0, 0x86, PWR_MODE_ANY), + PHY_COMN_REG_CFG(0x8, 0x60, PWR_MODE_HS_ANY), + PHY_TRSV_REG_CFG_GS101(0x222, 0x08, PWR_MODE_HS_ANY), + PHY_TRSV_REG_CFG_GS101(0x246, 0x01, PWR_MODE_HS_ANY), + END_UFS_PHY_CFG, +}; + +static const struct samsung_ufs_phy_cfg tensor_gs101_pre_h8_exit[] = { + PHY_COMN_REG_CFG(0x0, 0xC6, PWR_MODE_ANY), + PHY_COMN_REG_CFG(0x1, 0x0C, PWR_MODE_ANY), + PHY_TRSV_REG_CFG_GS101(0x262, 0x00, PWR_MODE_ANY), + PHY_TRSV_REG_CFG_GS101(0x265, 0x00, PWR_MODE_ANY), + PHY_COMN_REG_CFG(0x8, 0xE0, PWR_MODE_HS_ANY), + PHY_TRSV_REG_CFG_GS101(0x246, 0x03, PWR_MODE_HS_ANY), + PHY_TRSV_REG_CFG_GS101(0x222, 0x18, PWR_MODE_HS_ANY), + END_UFS_PHY_CFG, +}; + + static const struct samsung_ufs_phy_cfg *tensor_gs101_ufs_phy_cfgs[CFG_TAG_MAX] = { - [CFG_PRE_INIT] = tensor_gs101_pre_init_cfg, - [CFG_PRE_PWR_HS] = tensor_gs101_pre_pwr_hs_config, - [CFG_POST_PWR_HS] = tensor_gs101_post_pwr_hs_config, + [CFG_PRE_INIT] = tensor_gs101_pre_init_cfg, + [CFG_PRE_PWR_HS] = tensor_gs101_pre_pwr_hs_config, + [CFG_POST_PWR_HS] = tensor_gs101_post_pwr_hs_config, + [CFG_POST_HIBERN8_ENTER] = tensor_gs101_post_h8_enter, + [CFG_PRE_HIBERN8_EXIT] = tensor_gs101_pre_h8_exit, }; static const char * const tensor_gs101_ufs_phy_clks[] = {