Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2704486lqo; Mon, 20 May 2024 14:01:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU4w3TZ0fJ1u7f8OvIC3e1iu0vmXA+WwCFd3jiYPgDSN2ddGPZFVl5fxI27VhQC4h0lj/GYlEV6tUV6eEA6w8wTAnGOKI9PeNDeTS8wdQ== X-Google-Smtp-Source: AGHT+IHx5Yv1uMbaHiOCAF3A9b4/qFihDB+9Qieqzpcn1q0/tGk3VY07GQW10o+35sgoIbe/ila1 X-Received: by 2002:a05:6e02:218a:b0:368:efa4:bdf8 with SMTP id e9e14a558f8ab-36cc14c0c98mr362986235ab.21.1716238863472; Mon, 20 May 2024 14:01:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716238863; cv=pass; d=google.com; s=arc-20160816; b=gtzY3iKBZ9CCc+D382+oWpIvFNgraOgrS3jYhJQ52lVQTw0UHHN8xgIy/yB/ukSBp1 IQqVdUCHajwTBbwexsissWAjbGmb9KsPjja8HazEcfW5Ctd9i9VX+858zpkyUZac9PgV 4BFlfSiGJR5E6NTDilGWKbJ3EHYjSbdakc4gSXSIkH8MQZvXUob28z+cDHuscrgTwb93 znluGy2RYqc7utQBb9SpwUwHXd8kNxc7X3mscD1SOBuHv77uZ/aIKECbOZflvS9+sr0d vKgHOUkx4uRddqfr64lE0z286Gj0AW8qnKUg4yYyflJVrSJl9s4V5GBbAof3VbPtPTz1 44iA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=djXFzQ2d0emsDYCFUwdXA11z4z5gEax25uReEAYLZ3g=; fh=VMcmivsg/376IkDn8/Mpo33eTQ1US8Qrfrep4aeiAsQ=; b=qOc4kbsmLcuINGC1snKVsxyprjAG1vZOhfZHdDdf8tlqM+xJXN+vHTrx/OSO8lGODA vI+XGfpzyvZ8TIyQtlXFRHZvSr+3rUmoiX8TlIVfj0AF3/93simPSGHPv6z/pp5e48/x Q3i1IQa4FZzlc6r1VOlyXlSX3nlpYSr5Ij6CHJEinv6IeNHuQbvVFFkpihcKm9x/HkEn Sl7BxjzbNMVnHwSBgtof8OH1MkJGVIhuWdBvkA07PRh5mo2gkqpv0UG8ZujA3pVl9shH TqVlCTHdLx4Tw0pAPtt+Dypv8fZTVsnLc4xYONnPKpQ4Qy0PXhQXtA0SPMFxGi2j0+zA fWyg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=OhTcgxFz; arc=pass (i=1 spf=pass spfdomain=qualcomm.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-184177-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184177-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-638b8059657si20832791a12.604.2024.05.20.14.01.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 14:01:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184177-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=OhTcgxFz; arc=pass (i=1 spf=pass spfdomain=qualcomm.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-184177-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184177-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 22A64281F4F for ; Mon, 20 May 2024 21:00:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A8D1013A268; Mon, 20 May 2024 21:00:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="OhTcgxFz" 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 526C81E48B; Mon, 20 May 2024 21:00:28 +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=1716238829; cv=none; b=nWP9HyjaXyX1JKa0weuxkTrgz05FN1ZkfslzvxESJuPZ/eIL1RHkn2qSwDIs58tEy5CPoMZ8vLfUMPLXle7pCFfcZTxjfgvdp7XCTIqvEngwpkK05YNn3qTynyNKHys+NkKtR+RNZkUTK9/uJMFjwjs/RPfBR7UMkuoqcU6A/cA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716238829; c=relaxed/simple; bh=QFlq0DXmtkTjW1Ku2vyCOjCe832OqT394crRAOfifu8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=eUZWN7Viyn678MfJJOwfXsRfeA+4IuCgQWcG8OEbHDlbq3GlZhfsxcHXeuYl0giZAlngyK5M9vn89Ss2gq8f/RVAjZZyItrDDqRTqKYafiwvE8zFkfBa6yAiXyCihtmpvCdWxQ92mjLvWO24lnoXZjEZbnGCa8UbBtsmoJ1R4gE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=qualcomm.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=OhTcgxFz; 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=qualcomm.com Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 44KCGReA031187; Mon, 20 May 2024 21:00:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=qcppdkim1; bh=djXFzQ2 d0emsDYCFUwdXA11z4z5gEax25uReEAYLZ3g=; b=OhTcgxFzKsDmG3+pQot+u4Z FTIjnZqaaldKmnthXd8etIhjbRNqg6dEPVw2ICAnR8yWLEEIOvO6bN97Z/TQX5dP OHZWzQb8ea73Hloi7zKqiC3rgoiuSld+9xr9kEfdzZwuJuoj9vJTeKvpIebp7JcT 9AOgT1Y3kF8RuqCWFwziC+FBcT56XFKzfrMPtkQZenySGx9hvlqeVkXyp1iqn685 0mxzkHTk1Z+dIWNLFlzWNghTQXuWVgtaNTSqQfEq9FBAkp0QFaYIqDo2Gn/OB08j h8r2G4V/fgZCAfNpk9rQEaBL/zBQP3WjxGfqhGg2t6A5Ukphg3Nsmq+IH8+2Dvw= = Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3y6pqc45hp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 May 2024 21:00:24 +0000 (GMT) Received: from pps.filterd (NALASPPMTA02.qualcomm.com [127.0.0.1]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 44KKwDpp004373; Mon, 20 May 2024 21:00:23 GMT Received: from pps.reinject (localhost [127.0.0.1]) by NALASPPMTA02.qualcomm.com (PPS) with ESMTPS id 3y6ndmseh7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 May 2024 21:00:23 +0000 Received: from NALASPPMTA02.qualcomm.com (NALASPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 44KKtMuD032172; Mon, 20 May 2024 21:00:23 GMT Received: from hu-devc-lv-u22-c.qualcomm.com (hu-uchalich-lv.qualcomm.com [10.81.89.1]) by NALASPPMTA02.qualcomm.com (PPS) with ESMTPS id 44KL0Nkv006635 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 May 2024 21:00:23 +0000 Received: by hu-devc-lv-u22-c.qualcomm.com (Postfix, from userid 4184210) id 4351EB08; Mon, 20 May 2024 14:00:21 -0700 (PDT) From: Unnathi Chalicheemala To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Unnathi Chalicheemala , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@quicinc.com, Bjorn Andersson Subject: [PATCH v5 2/5] soc: qcom: llcc: Add regmap for Broadcast_AND region Date: Mon, 20 May 2024 14:00:14 -0700 Message-Id: <2c7654492ee436b41acddf2edc65d6722c3ad6aa.1716228054.git.quic_uchalich@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: vjL-KeksJxdCbFLW5HtyEa6RzcAbP1rp X-Proofpoint-GUID: vjL-KeksJxdCbFLW5HtyEa6RzcAbP1rp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-20_11,2024-05-17_03,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 mlxlogscore=999 impostorscore=0 adultscore=0 lowpriorityscore=0 phishscore=0 spamscore=0 suspectscore=0 mlxscore=0 clxscore=1011 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405010000 definitions=main-2405200167 Define new regmap structure for Broadcast_AND region and initialize this regmap when HW block version is greater than 4.1, otherwise initialize as a NULL pointer for backwards compatibility. Switch from broadcast_OR to broadcast_AND region (when defined in DT) for checking status bit 1 as Broadcast_OR region checks only for bit 0. Signed-off-by: Unnathi Chalicheemala Reviewed-by: Bjorn Andersson --- drivers/soc/qcom/llcc-qcom.c | 16 +++++++++++++++- include/linux/soc/qcom/llcc-qcom.h | 4 +++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c index cbef0dea1d5d..5eac6aa567e7 100644 --- a/drivers/soc/qcom/llcc-qcom.c +++ b/drivers/soc/qcom/llcc-qcom.c @@ -821,6 +821,7 @@ EXPORT_SYMBOL_GPL(llcc_slice_putd); static int llcc_update_act_ctrl(u32 sid, u32 act_ctrl_reg_val, u32 status) { + struct regmap *regmap; u32 act_ctrl_reg; u32 act_clear_reg; u32 status_reg; @@ -849,7 +850,8 @@ static int llcc_update_act_ctrl(u32 sid, return ret; if (drv_data->version >= LLCC_VERSION_4_1_0_0) { - ret = regmap_read_poll_timeout(drv_data->bcast_regmap, status_reg, + regmap = drv_data->bcast_and_regmap ?: drv_data->bcast_regmap; + ret = regmap_read_poll_timeout(regmap, status_reg, slice_status, (slice_status & ACT_COMPLETE), 0, LLCC_STATUS_READ_DELAY); if (ret) @@ -1284,6 +1286,18 @@ static int qcom_llcc_probe(struct platform_device *pdev) drv_data->version = version; + /* Applicable only when drv_data->version >= 4.1 */ + if (drv_data->version >= LLCC_VERSION_4_1_0_0) { + drv_data->bcast_and_regmap = qcom_llcc_init_mmio(pdev, i + 1, "llcc_broadcast_and_base"); + if (IS_ERR(drv_data->bcast_and_regmap)) { + ret = PTR_ERR(drv_data->bcast_and_regmap); + if (ret == -EINVAL) + drv_data->bcast_and_regmap = NULL; + else + goto err; + } + } + llcc_cfg = cfg->sct_data; sz = cfg->size; diff --git a/include/linux/soc/qcom/llcc-qcom.h b/include/linux/soc/qcom/llcc-qcom.h index 1a886666bbb6..9e9f528b1370 100644 --- a/include/linux/soc/qcom/llcc-qcom.h +++ b/include/linux/soc/qcom/llcc-qcom.h @@ -115,7 +115,8 @@ struct llcc_edac_reg_offset { /** * struct llcc_drv_data - Data associated with the llcc driver * @regmaps: regmaps associated with the llcc device - * @bcast_regmap: regmap associated with llcc broadcast offset + * @bcast_regmap: regmap associated with llcc broadcast OR offset + * @bcast_and_regmap: regmap associated with llcc broadcast AND offset * @cfg: pointer to the data structure for slice configuration * @edac_reg_offset: Offset of the LLCC EDAC registers * @lock: mutex associated with each slice @@ -129,6 +130,7 @@ struct llcc_edac_reg_offset { struct llcc_drv_data { struct regmap **regmaps; struct regmap *bcast_regmap; + struct regmap *bcast_and_regmap; const struct llcc_slice_config *cfg; const struct llcc_edac_reg_offset *edac_reg_offset; struct mutex lock; -- 2.34.1