Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp364839lqp; Wed, 12 Jun 2024 04:09:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX7lNg6i1Jom3TJG4kLP5H8PjJxgQdI3tcNwUVTtA4iD3Mh2YbmqiF82lmRB2kkoj4ZUGIZOfcZCG7CPfUeyd2x9QAJjjOg+AboGAV32A== X-Google-Smtp-Source: AGHT+IG3+b0n5Ezm1KG5yMVZeyUxooz0BElpBUqKHLkx1YBMEMhBt+5howprd2MnlCYTvCuF0hb9 X-Received: by 2002:a50:a451:0:b0:57c:6ba4:3d89 with SMTP id 4fb4d7f45d1cf-57caaac735cmr1017341a12.40.1718190557633; Wed, 12 Jun 2024 04:09:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718190557; cv=pass; d=google.com; s=arc-20160816; b=y7KFc0J/yrRuQWdlyrWoejXlfvoGKaO9mp1sdLB/z+z+r10Ro8iOblm74GheukSKEm yN/y3sx73Ih+nRelCTl1gvFLIAVu6F5TZbpYeS7L3IgC0hFL51LfJCYLd0mVHZWgiMfA H/urGd5VGLrd464eS3YPb0Viayp28mHJACs9DcvVzlhK9fsEMGLFLx+FgL6RoPdQmzEo 3QUd6LkOJEqpetNN0Coy4oaRcb0B1tluv7y0x1BSLHdhtUTIinHTTuYo0J4lj7w+0Pjx Z+4FzMhy4smkJRWTXU+lv7klC3SdJ+dRCMpPwUNLMT+m+M7dIq8UW39n0Ja5x9xbnZdH 8law== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=FVufAAxvtUUMGRL44tiXFFEKX+k8XmzfFmNbgBw0Ezg=; fh=CiUN9c9gmdTPUj1pUVfBJVJHIHgmFU9s0Gv45rgKm08=; b=GC0JfAcZEzHvq5YsTIa4CIgczvpRiRPFu7KqIQJAYiMSWhNYrx03+VjRdgmHlqMmSF 60Z8i0Q/1oZCI1qqOyKbOyOc+3G0PQngUUJpGEYHjfoRoH2M/zlEn7yykiidK2z3qBu/ EDRnOmli5hfbHicQ7ENcqgudAbnuPn7ZMu8YXmE8FnpEsOFjtQ510kW+VtKdLzir2JWF xrcMPZkE1ok5tn0+nqBrkL3VTpQ+9ln6ebXlmTdqqCdjerCWF1sxiIVNOphRXx6YLK3o LBooW9bIpccOJLxZI0WxtL+XGbsNX6iNVqq649TKSa4XH7XCJbk7CPMnETxtGfQcRwGW y5cA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=l+FKGIyT; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-211394-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211394-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57ca46f8327si1030147a12.447.2024.06.12.04.09.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 04:09:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211394-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=l+FKGIyT; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-211394-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211394-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 291741F23F2C for ; Wed, 12 Jun 2024 11:09:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E5F1B16F267; Wed, 12 Jun 2024 11:08:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="l+FKGIyT" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A55D716D4C0; Wed, 12 Jun 2024 11:08:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718190536; cv=none; b=C7Cc87p3U3H/b1vhYUAH4ge1wTP5KZihGHUUywdq16uaFXmSdKJT1XURvsRqq8DKkN0Fs23gEU7dbQ+5CK2H5S3g7F2VfZMeborydEF3gSx8qlYBrDOebpqPXW6TKpjMKDYY+gjvDbwkOSZwDcIc6OSaeqAX8gD7UhPyEc0LiLQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718190536; c=relaxed/simple; bh=rIcjMBSXazBqcvGy8BmCrNvAHJfeSwQxdHLUIYD3Zak=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=E13jUlJgBFXA7l0g5BNOfiAoAd7LVdt6fNzY+GgAzU1AdmJP8rN8LaS/diownfUv5BeC4R/pr6Bpeaf5BR2uRRqQu1pGNyPDniixrwolRylJ8rZWjKl4Cxkf7A+jQxL/OcZZJzWUCek1FtkVjraK2H0UTthRK2H6rol6u76pqYE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=l+FKGIyT; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45C63GM2000770; Wed, 12 Jun 2024 11:08:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= FVufAAxvtUUMGRL44tiXFFEKX+k8XmzfFmNbgBw0Ezg=; b=l+FKGIyT5wO7ZrdG 55B/ddTUqW1dUZGe9fY6D97W/aZZRxydJ5ZXzN1v/4x5iCabe3sq6AbNW/KiyT51 iE/ma7TQ1a26XKwBH5Y4b1RVz86gtk5yBDHeLTSyKvOV9jfEDQV47h1axPC0fLUL vrd+2fwvR6YIfWEjJRi9kV5ehf7hFoeBXcPQ/HesveWrtqi+MZPZtSCIZ4/Skmxu HIMAlI6pTAVWwu/20VqAfDfKxTrqMFHS8JhN4wZMsE+PmbTXMK5YrEJthi3TTrdl ViYmtM6EV3XXdMoe/x/2STQiMjImByZkI31hZLzvL4Sm1Sk2rW6iokKVWxT27H32 WpTaDA== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3yphsaupjk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Jun 2024 11:08:49 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 45CB8m1a021192 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Jun 2024 11:08:48 GMT Received: from hu-tdas-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Wed, 12 Jun 2024 04:08:45 -0700 From: Taniya Das Date: Wed, 12 Jun 2024 16:38:22 +0530 Subject: [PATCH v2 2/6] clk: qcom: gcc-sa8775p: Update the GDSC wait_val fields and flags Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-ID: <20240612-sa8775p-v2-gcc-gpucc-fixes-v2-2-adcc756a23df@quicinc.com> References: <20240612-sa8775p-v2-gcc-gpucc-fixes-v2-0-adcc756a23df@quicinc.com> In-Reply-To: <20240612-sa8775p-v2-gcc-gpucc-fixes-v2-0-adcc756a23df@quicinc.com> To: Bjorn Andersson , Michael Turquette , Stephen Boyd , Konrad Dybcio , Bartosz Golaszewski , Shazad Hussain CC: , , , , , Taniya Das X-Mailer: b4 0.14-dev-f7c49 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: oN7JFJkOcSyc6HMxj19jLAU56NLabeNu X-Proofpoint-GUID: oN7JFJkOcSyc6HMxj19jLAU56NLabeNu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-12_06,2024-06-12_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 malwarescore=0 adultscore=0 spamscore=0 mlxlogscore=710 impostorscore=0 lowpriorityscore=0 clxscore=1015 phishscore=0 mlxscore=0 priorityscore=1501 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406120081 Update the GDSC wait_val fields as per the default hardware values as otherwise they would lead to GDSC FSM state to be stuck and causing failures to power on/off. Also add the GDSC flags as applicable and add support to control PCIE GDSC's using collapse vote registers. Fixes: 08c51ceb12f7 ("clk: qcom: add the GCC driver for sa8775p") Signed-off-by: Taniya Das --- drivers/clk/qcom/gcc-sa8775p.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/drivers/clk/qcom/gcc-sa8775p.c b/drivers/clk/qcom/gcc-sa8775p.c index 7bb7aa3a7be5..71fa95f59a0a 100644 --- a/drivers/clk/qcom/gcc-sa8775p.c +++ b/drivers/clk/qcom/gcc-sa8775p.c @@ -4203,74 +4203,114 @@ static struct clk_branch gcc_video_axi1_clk = { static struct gdsc pcie_0_gdsc = { .gdscr = 0xa9004, + .collapse_ctrl = 0x4b104, + .collapse_mask = BIT(0), + .en_rest_wait_val = 0x2, + .en_few_wait_val = 0x2, + .clk_dis_wait_val = 0xf, .pd = { .name = "pcie_0_gdsc", }, .pwrsts = PWRSTS_OFF_ON, + .flags = VOTABLE | RETAIN_FF_ENABLE | POLL_CFG_GDSCR, }; static struct gdsc pcie_1_gdsc = { .gdscr = 0x77004, + .collapse_ctrl = 0x4b104, + .collapse_mask = BIT(1), + .en_rest_wait_val = 0x2, + .en_few_wait_val = 0x2, + .clk_dis_wait_val = 0xf, .pd = { .name = "pcie_1_gdsc", }, .pwrsts = PWRSTS_OFF_ON, + .flags = VOTABLE | RETAIN_FF_ENABLE | POLL_CFG_GDSCR, }; static struct gdsc ufs_card_gdsc = { .gdscr = 0x81004, + .en_rest_wait_val = 0x2, + .en_few_wait_val = 0x2, + .clk_dis_wait_val = 0xf, .pd = { .name = "ufs_card_gdsc", }, .pwrsts = PWRSTS_OFF_ON, + .flags = RETAIN_FF_ENABLE | POLL_CFG_GDSCR, }; static struct gdsc ufs_phy_gdsc = { .gdscr = 0x83004, + .en_rest_wait_val = 0x2, + .en_few_wait_val = 0x2, + .clk_dis_wait_val = 0xf, .pd = { .name = "ufs_phy_gdsc", }, .pwrsts = PWRSTS_OFF_ON, + .flags = RETAIN_FF_ENABLE | POLL_CFG_GDSCR, }; static struct gdsc usb20_prim_gdsc = { .gdscr = 0x1c004, + .en_rest_wait_val = 0x2, + .en_few_wait_val = 0x2, + .clk_dis_wait_val = 0xf, .pd = { .name = "usb20_prim_gdsc", }, .pwrsts = PWRSTS_OFF_ON, + .flags = RETAIN_FF_ENABLE | POLL_CFG_GDSCR, }; static struct gdsc usb30_prim_gdsc = { .gdscr = 0x1b004, + .en_rest_wait_val = 0x2, + .en_few_wait_val = 0x2, + .clk_dis_wait_val = 0xf, .pd = { .name = "usb30_prim_gdsc", }, .pwrsts = PWRSTS_OFF_ON, + .flags = RETAIN_FF_ENABLE | POLL_CFG_GDSCR, }; static struct gdsc usb30_sec_gdsc = { .gdscr = 0x2f004, + .en_rest_wait_val = 0x2, + .en_few_wait_val = 0x2, + .clk_dis_wait_val = 0xf, .pd = { .name = "usb30_sec_gdsc", }, .pwrsts = PWRSTS_OFF_ON, + .flags = RETAIN_FF_ENABLE | POLL_CFG_GDSCR, }; static struct gdsc emac0_gdsc = { .gdscr = 0xb6004, + .en_rest_wait_val = 0x2, + .en_few_wait_val = 0x2, + .clk_dis_wait_val = 0xf, .pd = { .name = "emac0_gdsc", }, .pwrsts = PWRSTS_OFF_ON, + .flags = RETAIN_FF_ENABLE | POLL_CFG_GDSCR, }; static struct gdsc emac1_gdsc = { .gdscr = 0xb4004, + .en_rest_wait_val = 0x2, + .en_few_wait_val = 0x2, + .clk_dis_wait_val = 0xf, .pd = { .name = "emac1_gdsc", }, .pwrsts = PWRSTS_OFF_ON, + .flags = RETAIN_FF_ENABLE | POLL_CFG_GDSCR, }; static struct clk_regmap *gcc_sa8775p_clocks[] = { -- 2.45.2