From nobody Tue Nov 26 10:30:38 2024 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.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 384C818DF65 for ; Sat, 19 Oct 2024 16:26:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729355213; cv=none; b=gSIK2rA2qDD+wRQyEmEPQ+TcWbYeU4nvSeQTVXXrFDDrOKBaMpjCECEalWXknVD/9VYvd+IzDdDnehimJIxrnbXHvhEpn9ovGRrUnNziQn1U4c7DDG617u9J/9MR4gjqsge01gQtThtYPkwOIQkrPAZNlLcXXbcLSMcbcBi28/U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729355213; c=relaxed/simple; bh=9IJyzCE4GaHn616VyWC1aCINwEhMZfazYzFsYxs/DqI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=d6bKYP95HvLAtajknRWPpR/rcqk0I/Iy7xFHwkXOEz+XgjNS/djtdoHp0sLpEsN06O26xhsIKGXll0aOQ7QuEfQyRFDVdYDxjUbK7QLnN8/gWOqZII+QpCjrgxPTAdIxMxnDuNEp70bt5ijIyIKqmaR1kJI0gw4KojkHf/eh2WU= 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=qaWnqYaS; arc=none smtp.client-ip=209.85.167.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="qaWnqYaS" Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-539f4d8ef84so3329110e87.0 for ; Sat, 19 Oct 2024 09:26:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729355209; x=1729960009; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=16G8+YLdPReYNbCbPPpWhAvrlzQ+kcERenlbkmZcLtU=; b=qaWnqYaSLz/pThmGlvGHvxO7krkNniLKhC1J7TQ1iWffeiZl8bbFyIxW/zxNSHm717 lg0hSJGJX36jHGqwJh5i31CP/kj+P/zamu/mhSoskx/bH3fp9uKdN8yQOArL+LOfJb9s GVGmVPxrNhB4Ikh0xrhwmX1RBm5riIxBByFJCij7s4f4XTTg7TM+nFDC4/fOJGYT2f/N 2eNA05cQLl/4npCCImSMhIU0pZVO+G8IiFQNN6i4X7oV0ZYoHZTszl4j71ytPHj6I7FO cwjF0EhUu1mePeWK6KlJO8gPdY7IxAIlqjgM6pQUdeXsWDJosPKFBxDiljJzcJY426xX 02OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729355209; x=1729960009; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=16G8+YLdPReYNbCbPPpWhAvrlzQ+kcERenlbkmZcLtU=; b=Za3cwK5aL2daNDcPgMD4kgsN6WxbE3b6o/8DwlYNRBbuuHI02WcggBebaSpMuZR4Do 8/zlkePTIIFNEmV+s6+RxfBv4APrq6DwE4trBEm8w0zaN5XMF7GY2y9B/cwu8cbMYB0+ AyuvkbLcV/vDW8+4dWML0KGSQXEUlb5aDTc8yH5o2NsSL9Q7h/QqxLkVBrEmIQ5y2Iwy waQUZrIWM+W2D/hGIWr1TkwY3COUSeviv7SxqD5gIcjCphreT6MJoVB3zcioTlFY4PkM TeHq7P1VQUhiuXecsEmfonJ9P3h/40uB9u1LsLK1sXD2KWvQZhCoYTqFC0o/kpkN2B1X 2n0Q== X-Forwarded-Encrypted: i=1; AJvYcCXvoy+Ai3oVrVi67NLJ8t3OQGTpjZV2BNBHsGwFcn4++vtYvTjnOiryikGoWbEDYVLB/EMQZLxHCOHriD8=@vger.kernel.org X-Gm-Message-State: AOJu0YwPsDGqHswy7QjCe2r0FgZKDRpsIehNf9tK7/BEL/ZxP5gZOv0d Dw8tIpMQMVl2RMvpzTgdHats6YkeTC3GPilyPUT2PEdorUXZFezhJow3HoM7arU= X-Google-Smtp-Source: AGHT+IGtQFwyylIOslHO+u2spOzWxKXOJ59teT4Gen6bVfg+Wb60THn0JlAUqa8cgOhePPz2UUrssQ== X-Received: by 2002:a05:6512:3b82:b0:539:fc23:1497 with SMTP id 2adb3069b0e04-53a154410ebmr2984572e87.9.1729355209174; Sat, 19 Oct 2024 09:26:49 -0700 (PDT) Received: from [127.0.1.1] (2001-14ba-a0c3-3a00-70b-e6fc-b322-6a1b.rev.dnainternet.fi. [2001:14ba:a0c3:3a00:70b:e6fc:b322:6a1b]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53a151f0c65sm576590e87.125.2024.10.19.09.26.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Oct 2024 09:26:47 -0700 (PDT) From: Dmitry Baryshkov Date: Sat, 19 Oct 2024 19:26:42 +0300 Subject: [PATCH 2/2] soc: qcom: llcc: add support for SAR2130P and SAR1130P 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: quoted-printable Message-Id: <20241019-sar2130p-llcc-v1-2-4e09063d04f2@linaro.org> References: <20241019-sar2130p-llcc-v1-0-4e09063d04f2@linaro.org> In-Reply-To: <20241019-sar2130p-llcc-v1-0-4e09063d04f2@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Conor Dooley , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=14449; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=9IJyzCE4GaHn616VyWC1aCINwEhMZfazYzFsYxs/DqI=; b=owEBbQKS/ZANAwAKARTbcu2+gGW4AcsmYgBnE93ChdRgcGcy1StCcOqdbrzX1XQ7bAfWV7lXt QWzfprHOVeJAjMEAAEKAB0WIQRdB85SOKWMgfgVe+4U23LtvoBluAUCZxPdwgAKCRAU23LtvoBl uIjcD/91iaxwyPN09zf37Dw1Z9JD6lfhxpce9Mn1iqpdaIOQTlztbZQe5YuRxmrNEWRBBRdunJ5 lDB02e7xai2w3X2nqRBQKzcvzABkR344huF9EVNt2YvWXiepWaW9B/SQzxz3oggOx4EdUvBN3jE iiXi9lhOmNTLth2AUBcO/aBFkGIJ+ZJ3UWK8cJNnLPTKKOJzRv7GsxY+UqSSYaTynCNpKEFpMV1 GZG6TaQbxgVcMmAv3h2+TM5Jf/bEscKEH6CZ+eaRY+b32lbTJt7vzn7lJkrwRNaVzt9XTN4xcvC /C1K4R4GShUZ2IfNDJ91qnSY2GFZ87H818WjX8pZQWcsGNfhuiR+7IfadWXQrtsSTwk/0W3BlO8 yHKnsYZg/YihEiZ7yXl15ASg2XFiEiSa+EPQGG7lHgbNSBHYMhtAoJ0a9lZYBeIhOls7xDidJeh SHpRjKv6YFAr5dkcxU1XrmCTQmW3vSs/1u0oFRsHy8dkLJkItb6sl5KWKWKh/MMXjMS6NJZ2aRT fNVe6U9tKsytfSZY6Wi0MKy0NUd8amBwg3ojWpu5yKOHaZXzfaKOMhFDCm1ibxeurlFudl0/Kr+ DWDUfetQ8ukHayBU+qNg0fKQGqCZk7zIHhkRwSNxUAGpCd5bXo46c2/vBnplI0tvagC26UZVFdi +5b2GXSK04f5xMA== X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Implement necessary support for the LLCC control on the SAR1130P and SAR2130P platforms. These two platforms use different ATTR1_MAX_CAP shift and also require manual override for num_banks. Signed-off-by: Dmitry Baryshkov --- drivers/soc/qcom/llcc-qcom.c | 468 +++++++++++++++++++++++++++++++++= +++- include/linux/soc/qcom/llcc-qcom.h | 12 + 2 files changed, 474 insertions(+), 6 deletions(-) diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c index a470285f54a875bf2262aac7b0f84ed8fd028ef1..ef84fe3b2af4e777126a8308bfd= 4ec47b28aeae2 100644 --- a/drivers/soc/qcom/llcc-qcom.c +++ b/drivers/soc/qcom/llcc-qcom.c @@ -32,6 +32,7 @@ #define ATTR1_FIXED_SIZE_SHIFT 0x03 #define ATTR1_PRIORITY_SHIFT 0x04 #define ATTR1_MAX_CAP_SHIFT 0x10 +#define ATTR1_MAX_CAP_SHIFT_sar 0x0e #define ATTR0_RES_WAYS_MASK GENMASK(15, 0) #define ATTR0_BONUS_WAYS_MASK GENMASK(31, 16) #define ATTR0_BONUS_WAYS_SHIFT 0x10 @@ -140,6 +141,11 @@ struct qcom_llcc_config { bool need_llcc_cfg; bool no_edac; bool irq_configured; + /* + * special workarounds for SAR2130P and similar platforms which have + * slightly different register mapping. + */ + bool is_sar_chip; }; =20 struct qcom_sct_config { @@ -298,6 +304,408 @@ static const struct llcc_slice_config sa8775p_data[] = =3D { }, }; =20 +static const struct llcc_slice_config sar1130p_data[] =3D { + { + .usecase_id =3D LLCC_CPUSS, + .slice_id =3D 1, + .max_cap =3D 4096, + .priority =3D 1, + .bonus_ways =3D 0x1fff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + .activate_on_init =3D true, + }, { + .usecase_id =3D LLCC_VIDSC0, + .slice_id =3D 2, + .max_cap =3D 512, + .priority =3D 3, + .fixed_size =3D true, + .bonus_ways =3D 0x1fff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_AUDIO, + .slice_id =3D 6, + .max_cap =3D 1024, + .priority =3D 3, + .fixed_size =3D true, + .bonus_ways =3D 0x1fff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_CMPT, + .slice_id =3D 10, + .max_cap =3D 1024, + .priority =3D 1, + .fixed_size =3D true, + .bonus_ways =3D 0x1fff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_GPUHTW, + .slice_id =3D 11, + .max_cap =3D 0, + .priority =3D 1, + .fixed_size =3D true, + .bonus_ways =3D 0x1fff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_GPU, + .slice_id =3D 12, + .max_cap =3D 3072, + .priority =3D 3, + .fixed_size =3D true, + .bonus_ways =3D 0x1fff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + .write_scid_en =3D true, + }, { + .usecase_id =3D LLCC_MMUHWT, + .slice_id =3D 13, + .max_cap =3D 512, + .priority =3D 1, + .fixed_size =3D true, + .bonus_ways =3D 0x1fff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + }, { + .usecase_id =3D LLCC_DISP, + .slice_id =3D 16, + .max_cap =3D 12800, + .priority =3D 1, + .fixed_size =3D true, + .bonus_ways =3D 0x1fff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_CVP, + .slice_id =3D 28, + .max_cap =3D 256, + .priority =3D 3, + .fixed_size =3D true, + .bonus_ways =3D 0x1fff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_APTCM, + .slice_id =3D 26, + .max_cap =3D 2048, + .priority =3D 3, + .fixed_size =3D true, + .bonus_ways =3D 0x0, + .res_ways =3D 0x3, + .cache_mode =3D true, + .dis_cap_alloc =3D true, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_WRCACHE, + .slice_id =3D 31, + .max_cap =3D 256, + .priority =3D 1, + .fixed_size =3D true, + .bonus_ways =3D 0x1fff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .activate_on_init =3D true, + }, { + .usecase_id =3D LLCC_AENPU, + .slice_id =3D 30, + .max_cap =3D 3072, + .priority =3D 3, + .fixed_size =3D true, + .bonus_ways =3D 0x1fff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_DISP_LEFT, + .slice_id =3D 17, + .max_cap =3D 0, + .priority =3D 1, + .fixed_size =3D true, + .bonus_ways =3D 0x0, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_DISP_RIGHT, + .slice_id =3D 18, + .max_cap =3D 0, + .priority =3D 1, + .fixed_size =3D true, + .bonus_ways =3D 0x0, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_EVCS_LEFT, + .slice_id =3D 22, + .max_cap =3D 0, + .priority =3D 1, + .fixed_size =3D true, + .bonus_ways =3D 0x0, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_EVCS_RIGHT, + .slice_id =3D 23, + .max_cap =3D 0, + .priority =3D 1, + .fixed_size =3D true, + .bonus_ways =3D 0x0, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, +}; + +static const struct llcc_slice_config sar2130p_data[] =3D { + { + .usecase_id =3D LLCC_CPUSS, + .slice_id =3D 1, + .max_cap =3D 6144, + .priority =3D 1, + .fixed_size =3D 0, + .bonus_ways =3D 0x3fffffff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + .activate_on_init =3D true, + }, { + .usecase_id =3D LLCC_VIDSC0, + .slice_id =3D 2, + .max_cap =3D 128, + .priority =3D 2, + .fixed_size =3D true, + .bonus_ways =3D 0x3fffffff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_AUDIO, + .slice_id =3D 6, + .max_cap =3D 1024, + .priority =3D 3, + .fixed_size =3D true, + .bonus_ways =3D 0x3fffffff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_CMPT, + .slice_id =3D 10, + .max_cap =3D 1024, + .priority =3D 1, + .fixed_size =3D true, + .bonus_ways =3D 0x3fffffff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_GPUHTW, + .slice_id =3D 11, + .max_cap =3D 0, + .priority =3D 1, + .fixed_size =3D true, + .bonus_ways =3D 0x3fffffff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_GPU, + .slice_id =3D 12, + .max_cap =3D 1536, + .priority =3D 2, + .fixed_size =3D true, + .bonus_ways =3D 0x3fffffff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + .write_scid_en =3D true, + }, { + .usecase_id =3D LLCC_MMUHWT, + .slice_id =3D 13, + .max_cap =3D 1024, + .priority =3D 1, + .fixed_size =3D true, + .bonus_ways =3D 0x3fffffff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .activate_on_init =3D true, + }, { + .usecase_id =3D LLCC_DISP, + .slice_id =3D 16, + .max_cap =3D 0, + .priority =3D 1, + .fixed_size =3D true, + .bonus_ways =3D 0x3fffffff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_APTCM, + .slice_id =3D 26, + .max_cap =3D 2048, + .priority =3D 3, + .fixed_size =3D true, + .bonus_ways =3D 0x0, + .res_ways =3D 0x3, + .cache_mode =3D true, + .dis_cap_alloc =3D true, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_WRCACHE, + .slice_id =3D 31, + .max_cap =3D 256, + .priority =3D 1, + .fixed_size =3D true, + .bonus_ways =3D 0x3fffffff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .activate_on_init =3D true, + }, { + .usecase_id =3D LLCC_VIEYE, + .slice_id =3D 7, + .max_cap =3D 7168, + .priority =3D 4, + .fixed_size =3D true, + .bonus_ways =3D 0x3fffffff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_VIDPTH, + .slice_id =3D 8, + .max_cap =3D 7168, + .priority =3D 4, + .fixed_size =3D true, + .bonus_ways =3D 0x3fffffff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_GPUMV, + .slice_id =3D 9, + .max_cap =3D 2048, + .priority =3D 2, + .fixed_size =3D true, + .bonus_ways =3D 0x3fffffff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_EVA_LEFT, + .slice_id =3D 20, + .max_cap =3D 7168, + .priority =3D 5, + .fixed_size =3D true, + .bonus_ways =3D 0x3ffffffc, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_EVA_RIGHT, + .slice_id =3D 21, + .max_cap =3D 7168, + .priority =3D 5, + .fixed_size =3D true, + .bonus_ways =3D 0x3ffffffc, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_EVAGAIN, + .slice_id =3D 25, + .max_cap =3D 1024, + .priority =3D 2, + .fixed_size =3D true, + .bonus_ways =3D 0x3fffffff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_AENPU, + .slice_id =3D 30, + .max_cap =3D 3072, + .priority =3D 3, + .fixed_size =3D true, + .bonus_ways =3D 0x3fffffff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_VIPTH, + .slice_id =3D 29, + .max_cap =3D 1024, + .priority =3D 4, + .fixed_size =3D true, + .bonus_ways =3D 0x3fffffff, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_DISP_LEFT, + .slice_id =3D 17, + .max_cap =3D 0, + .priority =3D 1, + .fixed_size =3D true, + .bonus_ways =3D 0x0, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_DISP_RIGHT, + .slice_id =3D 18, + .max_cap =3D 0, + .priority =3D 1, + .fixed_size =3D true, + .bonus_ways =3D 0x0, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_EVCS_LEFT, + .slice_id =3D 22, + .max_cap =3D 0, + .priority =3D 1, + .fixed_size =3D true, + .bonus_ways =3D 0x0, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_EVCS_RIGHT, + .slice_id =3D 23, + .max_cap =3D 0, + .priority =3D 1, + .fixed_size =3D true, + .bonus_ways =3D 0x0, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, { + .usecase_id =3D LLCC_SPAD, + .slice_id =3D 24, + .max_cap =3D 7168, + .priority =3D 1, + .fixed_size =3D true, + .bonus_ways =3D 0x0, + .res_ways =3D 0x0, + .cache_mode =3D 0, + .retain_on_pc =3D true, + }, +}; + static const struct llcc_slice_config sc7180_data[] =3D { { .usecase_id =3D LLCC_CPUSS, @@ -2687,6 +3095,28 @@ static const struct qcom_llcc_config sa8775p_cfg[] = =3D { }, }; =20 +static const struct qcom_llcc_config sar1130p_cfg[] =3D { + { + .sct_data =3D sar1130p_data, + .size =3D ARRAY_SIZE(sar1130p_data), + .need_llcc_cfg =3D true, + .reg_offset =3D llcc_v2_1_reg_offset, + .edac_reg_offset =3D &llcc_v2_1_edac_reg_offset, + .is_sar_chip =3D true, + }, +}; + +static const struct qcom_llcc_config sar2130p_cfg[] =3D { + { + .sct_data =3D sar2130p_data, + .size =3D ARRAY_SIZE(sar2130p_data), + .need_llcc_cfg =3D true, + .reg_offset =3D llcc_v2_1_reg_offset, + .edac_reg_offset =3D &llcc_v2_1_edac_reg_offset, + .is_sar_chip =3D true, + }, +}; + static const struct qcom_llcc_config sc7180_cfg[] =3D { { .sct_data =3D sc7180_data, @@ -2839,6 +3269,16 @@ static const struct qcom_sct_config sa8775p_cfgs =3D= { .num_config =3D ARRAY_SIZE(sa8775p_cfg), }; =20 +static const struct qcom_sct_config sar1130p_cfgs =3D { + .llcc_config =3D sar1130p_cfg, + .num_config =3D ARRAY_SIZE(sar1130p_cfg), +}; + +static const struct qcom_sct_config sar2130p_cfgs =3D { + .llcc_config =3D sar2130p_cfg, + .num_config =3D ARRAY_SIZE(sar2130p_cfg), +}; + static const struct qcom_sct_config sc7180_cfgs =3D { .llcc_config =3D sc7180_cfg, .num_config =3D ARRAY_SIZE(sc7180_cfg), @@ -3146,7 +3586,10 @@ static int _qcom_llcc_cfg_program(const struct llcc_= slice_config *config, */ max_cap_cacheline =3D max_cap_cacheline / drv_data->num_banks; max_cap_cacheline >>=3D CACHE_LINE_SIZE_SHIFT; - attr1_val |=3D max_cap_cacheline << ATTR1_MAX_CAP_SHIFT; + if (cfg->is_sar_chip) + attr1_val |=3D max_cap_cacheline << ATTR1_MAX_CAP_SHIFT_sar; + else + attr1_val |=3D max_cap_cacheline << ATTR1_MAX_CAP_SHIFT; =20 attr1_cfg =3D LLCC_TRP_ATTR1_CFGn(config->slice_id); =20 @@ -3383,12 +3826,23 @@ static int qcom_llcc_probe(struct platform_device *= pdev) goto err; cfg =3D &cfgs->llcc_config[cfg_index]; =20 - ret =3D regmap_read(regmap, cfg->reg_offset[LLCC_COMMON_STATUS0], &num_ba= nks); - if (ret) - goto err; + /* + * For some reason register returns incorrect value here. + * List compatibles instead of using .is_sar_chip since there might be + * SAR-like chips which have other number of banks. + */ + if (of_device_is_compatible(dev->of_node, "qcom,sar1130p-llcc") || + of_device_is_compatible(dev->of_node, "qcom,sar2130p-llcc")) { + num_banks =3D 2; + } else { + ret =3D regmap_read(regmap, cfg->reg_offset[LLCC_COMMON_STATUS0], &num_b= anks); + if (ret) + goto err; + + num_banks &=3D LLCC_LB_CNT_MASK; + num_banks >>=3D LLCC_LB_CNT_SHIFT; + } =20 - num_banks &=3D LLCC_LB_CNT_MASK; - num_banks >>=3D LLCC_LB_CNT_SHIFT; drv_data->num_banks =3D num_banks; =20 drv_data->regmaps =3D devm_kcalloc(dev, num_banks, sizeof(*drv_data->regm= aps), GFP_KERNEL); @@ -3486,6 +3940,8 @@ static int qcom_llcc_probe(struct platform_device *pd= ev) static const struct of_device_id qcom_llcc_of_match[] =3D { { .compatible =3D "qcom,qdu1000-llcc", .data =3D &qdu1000_cfgs}, { .compatible =3D "qcom,sa8775p-llcc", .data =3D &sa8775p_cfgs }, + { .compatible =3D "qcom,sar1130p-llcc", .data =3D &sar1130p_cfgs }, + { .compatible =3D "qcom,sar2130p-llcc", .data =3D &sar2130p_cfgs }, { .compatible =3D "qcom,sc7180-llcc", .data =3D &sc7180_cfgs }, { .compatible =3D "qcom,sc7280-llcc", .data =3D &sc7280_cfgs }, { .compatible =3D "qcom,sc8180x-llcc", .data =3D &sc8180x_cfgs }, diff --git a/include/linux/soc/qcom/llcc-qcom.h b/include/linux/soc/qcom/ll= cc-qcom.h index 2f20281d4ad4352ef59e7b19148cd324c7991012..8e5d78fb4847a232ab17a66c277= 5552dcb287752 100644 --- a/include/linux/soc/qcom/llcc-qcom.h +++ b/include/linux/soc/qcom/llcc-qcom.h @@ -54,7 +54,19 @@ #define LLCC_CAMEXP4 52 #define LLCC_DISP_WB 53 #define LLCC_DISP_1 54 +#define LLCC_VIEYE 57 +#define LLCC_VIDPTH 58 +#define LLCC_GPUMV 59 +#define LLCC_EVA_LEFT 60 +#define LLCC_EVA_RIGHT 61 +#define LLCC_EVAGAIN 62 +#define LLCC_VIPTH 63 #define LLCC_VIDVSP 64 +#define LLCC_DISP_LEFT 65 +#define LLCC_DISP_RIGHT 66 +#define LLCC_EVCS_LEFT 67 +#define LLCC_EVCS_RIGHT 68 +#define LLCC_SPAD 69 =20 /** * struct llcc_slice_desc - Cache slice descriptor --=20 2.39.5