From patchwork Fri Feb 2 14:57:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 13542971 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5AC5AC47DB3 for ; Fri, 2 Feb 2024 14:57:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=IArVQbAOZsTK7SRlCAzBdx9BxzN0/Aam1/67/jeT/fw=; b=HGUv3sVuS//pG5 klY4QGOZq1gA6Jc0zlq5AXKYhgZvZ2tLNrxLHQUc3Cijz8r8V9L4Y5xFsX46QkOtbo0duN7sifql8 UpoeW4i6CQpbUcXLmlU/mq1LbJ7QCysB0vya1c6oatf/2pPwGPLbiuhHnqmiGsr5hvnZHwr+6R7ko M8iO1CMH6N+8LS+tPYU/WiQFtWw/0/y/UDFxwdcd6NW1t1sKO64QdIyCq+RpbWduUbYyu/QRlbFWE 7chtK8JQTK+8disdypsE0TNQ5U6carGYJUAc6aookqi1St9CM/kCBLBLMTRZNoxqBXRCxd+Gj1Ws4 ROwitUnx/D9PJuHCWPqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rVuzF-0000000Bs3y-34lp; Fri, 02 Feb 2024 14:57:49 +0000 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rVuzC-0000000Bs1P-17to for linux-arm-kernel@lists.infradead.org; Fri, 02 Feb 2024 14:57:47 +0000 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-55fc7f63639so2439231a12.1 for ; Fri, 02 Feb 2024 06:57:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706885861; x=1707490661; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=l52rEpkUwMDo2Zba4o6n3vS7Nj2bBzY4EMwlY5C0Lrw=; b=v6NvcogE6Y9ya9DpUl3aGu/awnV6uFCj61xMQ5+iMi/neyaUk7XQRghqU+CAuCe8QM moYSbSrIENWnhNXNJuGadPguuB0aIM6bonZrzCcS6PqyhihAH39Db/uwwvRsgbyRFeR9 uSHW9KTxISlF6A3/+Lc1YCqJe1ydP8P+IOevn45x87ja96+Cd4iAVfK5w+IKE8O7VKaa Cux4AJAKLa+KeldHVrE5I90AMd3dBHhXtLrG8OIjsmS4i1zWlGvQI0RXqqvDCURBPMWG oGqmj1CIALXWz0wlSwgZ2ilGIE/erUc4Otc1VwiL8iETPmGWoZgyz08YJd2QYpPMlCqq klOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706885861; x=1707490661; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=l52rEpkUwMDo2Zba4o6n3vS7Nj2bBzY4EMwlY5C0Lrw=; b=PE7GLgUheRHD1M/ZL4hUeEz3N/2UJS7jygNpavbMs17okNnzSzxTS5y/7IYLxaXtyB dtXBgY4c6Bga0yE7ep+Z88GNzAnG0ZLT/oyxu4a7R8RhG5fMtpbXi8apNbq3E/MLiIhq Dxy7SNlS5yKOA+lW3h2GgkGqkGYPGJB7RPnqe6nEyNdA9RGH23uqjheljhpwZSCBg5Ym PCxGFUgeiV2yzIIEj2CQpgLnnhT14vQmcPHwDc24D/C8oBLxKeZoaW/pQsPp0lbLndvu 1zXCS8AVmWz9QF/KGQ/qBpqztIev4vt4ItwZ07k49FJH8kt0o6d3G+97cB7xEB7p9XiZ ftGw== X-Gm-Message-State: AOJu0YzndwUR74jdd0uiSDKi2L2uBEbB/cmbDCCXzmQT2qpADL71QLPj H+ruHonT3CNmQxX6ZSVjwdzb1lS7vCKGJ/xYOTZsWy05X5D/k57fehKNJE2qjOg= X-Google-Smtp-Source: AGHT+IHEu+WRz2st0ESBNeC3bE/RmWl191TOnOii2JKPU1M/EGJJnhU1WgKnxBh3SyYSBjWm7TGUJg== X-Received: by 2002:a17:906:e81:b0:a36:47fa:4b8c with SMTP id p1-20020a1709060e8100b00a3647fa4b8cmr3882383ejf.9.1706885861548; Fri, 02 Feb 2024 06:57:41 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCW4Iv63M/sjFwyyZ1Yu7E+K3YAMIe1KCna8PUJk0ZmO0ce1i2Rn/R+uTov2FgTh8yK0bj2GwDkaEy7jlYd5Cnb1HeLqb1wJmaJfFsd0A6Vx5Q1TGqtTFKxcB6NJ78G9cOaMvk03bz0v73YDKz9cFnCNVPYU//cKkkpm1vCEQ18xTR5GV+bZTygz57akm1li4rjnGL+KiXmHhDcvqzB2vFnIk1VzxNVOyiFkgAaqQP7P/WkvvVfwOJSohxwL11G5hJUXv+SXZVHVYyZgDtLiKYJ/7myzmDUIVInFXWPXpLfb3AKmcesoVd36DVav68luW4IlngpXcYHek8+gkuIPc5Vjquok8g+DIRDmtDrRcBdeenBhmKAu39XVDFyb3Q6AyiXVZAzMSTRnz7u7kQgFVKDOxEmlnwslHEVW4b+T36YHoWTUTfljbNVUyWObqqZE8XlkgEsjRieRrAVKI1heQe09kB0KaE/Ty0VwvZXE3T7qvEQPrslhht2qF2QkPMiWCB8id731HiKTPpcFSq3J+LZh0JqkT744LAB6scIVn5HNHjOR1fGesgT60SDOtiq500F+18lwkgw0ysFpqQ3jEY3h62B9YC+kkY+aTKpBvVQppC3ohOZW3OCDM3AU4nfGm/ll2UVgWl/9hIex2gAYigTNeGlgzFNMjTQKe+PX1WSgYWNkA6Vdi6XIEMC4MWZWGRJX6+q6L8tjpw== Received: from gpeter-l.lan (host-92-21-139-67.as13285.net. [92.21.139.67]) by smtp.gmail.com with ESMTPSA id t8-20020a17090616c800b00a36c60180aesm957200ejd.60.2024.02.02.06.57.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 06:57:40 -0800 (PST) From: Peter Griffin To: arnd@arndb.de, krzysztof.kozlowski@linaro.org, linux@roeck-us.net, wim@linux-watchdog.org, alim.akhtar@samsung.com, jaewon02.kim@samsung.com, semen.protsenko@linaro.org Cc: kernel-team@android.com, peter.griffin@linaro.org, alexey.klimov@linaro.org, tudor.ambarus@linaro.org, andre.draszik@linaro.org, saravanak@google.com, willmcvicker@google.com, linux-fsd@tesla.com, linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v3 0/2] Add regmap support to exynos-pmu for protected PMU regs Date: Fri, 2 Feb 2024 14:57:29 +0000 Message-ID: <20240202145731.4082033-1-peter.griffin@linaro.org> X-Mailer: git-send-email 2.43.0.594.gd9cf4e227d-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240202_065746_373720_278BF760 X-CRM114-Status: GOOD ( 13.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi folks, This is a v3 of the series to add support for protected PMU registers found on gs101 and derivative SoCs. In v2 and later it was re-worked to be based on a regmap abstraction that I think leads to a much neater overall solution. The advantage of the regmap abstraction is that most leaf drivers that read/write PMU registers need minimal changes. Example of Exynos drivers that require PMU register access are: * watchdog * usb phy * mipi phy * ufs phy This series has been tested on Pixel 6 / gs101. If the various maintainers/ contributors of other Exynos SoCs like exynos850, exynosautov9, exynos5422 etc can test these patches on your respective systems that would be most appreciated! The expectation is this series would be merged via Krzysztofs Samsung Exynos tree. regards, Peter Changes since v2 - Add select REGMAP to Kconfig - Add constant for SET/CLEAR bits - Replace kerneldoc with one line comment - Fix kerneldoc for EXPORT_SYMBOL_GPL funcs - remove superflous extern keyword - dev_err_probe() on probe error - shorten regmcfg name - no compatibles inside probe, use match data - don't mix declarations with/without initializations - tensor_sec_reg_read() use mmio to avoid access restrictions - Collect up Reviewed-by - const for regmap_config structs Changes since v1: - Refactor to use custom regmap to abstract SMC register access (Sam / Guenter) - Add deferred probing support (Saravana / Krzysztof) v2 lore: https://lore.kernel.org/lkml/20240129211912.3068411-1-peter.griffin@linaro.org/ v1 lore: https://lore.kernel.org/all/20240122225710.1952066-1-peter.griffin@linaro.org/ Peter Griffin (2): soc: samsung: exynos-pmu: Add regmap support for SoCs that protect PMU regs watchdog: s3c2410_wdt: use exynos_get_pmu_regmap_by_phandle() for PMU regs drivers/soc/samsung/Kconfig | 1 + drivers/soc/samsung/exynos-pmu.c | 233 ++++++++++++++++++++++++- drivers/soc/samsung/exynos-pmu.h | 1 + drivers/watchdog/Kconfig | 1 - drivers/watchdog/s3c2410_wdt.c | 8 +- include/linux/soc/samsung/exynos-pmu.h | 11 +- 6 files changed, 245 insertions(+), 10 deletions(-)