Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp376768rdb; Thu, 8 Feb 2024 08:21:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IFBQn7di7WWtIJapLSW/SSso00l/LMWvW8VEJ82Pc+9A0XqaC3w9zrpRD5AKxV5i7Icz1Ye X-Received: by 2002:a0c:f5cf:0:b0:68c:c841:ac29 with SMTP id q15-20020a0cf5cf000000b0068cc841ac29mr2012237qvm.48.1707409300194; Thu, 08 Feb 2024 08:21:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707409300; cv=pass; d=google.com; s=arc-20160816; b=UJUU06HMEx41hoVIwOcA9td+ACAyaylOLr6EWLPL4W2X7hAZckB2h08IBBgWzszfdb KuXTmAYZaeHgvMSRgGszReoknP3gTVAiChuuSavxMUKwyWASH+xCkmUbV2O/E8QHB24h C9Zn8qWtRNQ9JTckP0IVLSkga6pGoEUPOdH6/TakmQnH+oy4AqB7vEvrXSc34cqgnoVC N3qg+CIsk2wwfNK7+1uitWVQm3NOWvq0EkwdrJopnRTmygWsRPP6xPQWeWGFjamGNFmG 38yycuhHv3Rk7e5/sFXAu0UdtXyZgQtjKT7JZ2dNZ5Ddy4gs25BVV1uGxxdqGnIxpaJ3 Kokg== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=4an9xpeJCw/uJKBtsN9iFQPLTnnjc49mN5XWvlsDwF0=; fh=S5CRB+AcQK1M+PBUGvP79T91fC1QDfIUVLy4w0bTkx8=; b=QNywh83oH+oirHOAIGdhycm+aeo53QQFbVh2hVr7SxqED0BeqqHCqf9u1f1xldFPQe OB8GyjTXKzwimR+wnwj1Xyul/cT1C4smYCjDHMxqZYFDXBCZY8OSnHjvvvVhgOc8tq2S uUFXdsTOsH0p/iEGapK2RypAYff9N6P18RIhp2OxzmN9cbbSWy+p/m9PC0WhXC816mAh lBsPjyADvA4HTy6+XB09okOu61cSZUtgb+xxjPn+RZRz11a1pHLaWB6HxT8K2pneIsPu td9RxohcrailGQHUKpyr7r9L3hu4iqQfN1yMH5JDJWNOz8TtcisAXzdocENMAgFjPjER yjhw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="OoL2/TIr"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-58340-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58340-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCVTPNOsKzZanFx7Ocb5B740LfYidytMK0k+50NlMrOrS7u0AZZs2VJ67nUaZTkncv+7+9gbc2gU+al6WGv8WcWCHsSfE9N6ePutLoSqTA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id q3-20020ad45ca3000000b0068c8b883c82si286206qvh.419.2024.02.08.08.21.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 08:21:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58340-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="OoL2/TIr"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-58340-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58340-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id DDCE11C20CE2 for ; Thu, 8 Feb 2024 16:21:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C2E7A7E56E; Thu, 8 Feb 2024 16:21:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="OoL2/TIr" Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (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 D98B87EEEA for ; Thu, 8 Feb 2024 16:21:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707409287; cv=none; b=mDyTCAk7xwJ7WS5GraHkFOHqL21JUTJMNEewhZPDW+VEVaztl3EV1wVayzW+ToigvLAl0ErzM/q0ZEE4xFqrwfh1RjR18J2nIa4k5AUDQI3HeReZkxT2Z3LbKpYfM8bFtn4S3Nka72QeqOJ0Ni5I6PJQGqO205PP6mLbZ3GAB8Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707409287; c=relaxed/simple; bh=U0uGEH2A3ci7wPLijr9npt5FveIBzfHdtcmd6JdmRNw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=P5Ix0Q1EQE1jPujj3iDlcLL3oz1VlAxYBAJhipltrLgv6Uwo7UfhmtvLP/0/4OHYCpcnRLU/8VwOz1q2D9uP1Uj11B97aGjEqdF/z4W5MpRdnxtOZzmE/tx6ix319GYAQSE5T8HbxwyBsQdfkPQ5gDSyPr/+kL2cVyxla1eU5nA= 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=OoL2/TIr; arc=none smtp.client-ip=209.85.221.49 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 Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-339289fead2so1411660f8f.3 for ; Thu, 08 Feb 2024 08:21:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707409284; x=1708014084; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=4an9xpeJCw/uJKBtsN9iFQPLTnnjc49mN5XWvlsDwF0=; b=OoL2/TIrgggorKI34MlT84bRnUcJ4vq0O88K1uzSeZBxYYXx6SNDMUNnMSu8xcDjAq X+1NI4o3z2nnqno4aumrz805T5Dl3PrFRCzAPlFJiZQ3+J/QAyvM7iBuoXGt/YE/HmTe seW30cchbL686CQ2gh8ihsGjcH95i7BsQCOjL3g++f4z064KLVJT/ceCArVguRWvzLLy 27P5rMNlqKnxjgrkg0amNd3/BALm7o5ygCcpuhzORi0rZk7r9ndgRhaVzmFdQ5KD2X94 Da3ooWkaFPOs2OhnwzDGg3EyhUcmakrJAxWjWjuShJGsTKaw5HbbI17J9uvQAq4X2zpr xNlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707409284; x=1708014084; 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=4an9xpeJCw/uJKBtsN9iFQPLTnnjc49mN5XWvlsDwF0=; b=Jl5ejKP8bv0sobE70mh5k3DzSGrUeIUqj85aUzJoBpFbQOu3fwM8voZTGMYO2ylwbO blqcwdk5x4SB3WehWAt/6Qjq5uI074GY4Oglh8GUJiu0oRKFXXNv3bfeTDgAxPsoMpNb ZHuq0/+Nx32EOQpEMpPnAyu6n+7I/fBYJK9HYCE9fgp73CyjTz/Ik+BaWnPjOh7xdyAs L4H6oU15Bq4wICqwOYyxePC3Q8q68l6VTlHPqwy4zTEQH5TnMQ6KyKifumMrrz20iXXT PsFheaGNuLs+tCvuQvsA8skUW1kaadvKCJp7O+sBRBnbQEufkLUIp2vNETO6SoALAfDY YSaw== X-Gm-Message-State: AOJu0YxcMzQIr/IA1gbxWXOioKSEK89/7aVzGo9F0WAY0Gqo55Rq5Tr/ yCv8528CIWkCD076U+Fw3jtGCizccbVgkiFZViSaANWoYNQNQytopJKQJKydQ4U= X-Received: by 2002:a5d:4576:0:b0:33b:2da1:fdd8 with SMTP id a22-20020a5d4576000000b0033b2da1fdd8mr6681327wrc.20.1707409284030; Thu, 08 Feb 2024 08:21:24 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCV03+8aVgx3AKPeTM7x+RaYghRyeTXMnpSXRgOrezPcwD4hs7+JjRP9fwFoxlj6fI0QEBHiqc82gDir2eFacWQIGQCc/bf2wKSm/RfHfRBatTRwP9bFuzpjKFl0jDzNf4HoGnhfjBkmgrr+pTzcrEvS8C3s82cng+4TFyB+wBtWmn8KuPbROZwON0EXWvY/ac03JpRj6kZ8Ma/dbMZccRjyXBhd5bRl4WoUKtaau3xRgwau0MW4iVW6xdFXz1NQaUoEPhJGVyILLauZdVmzBexjQ2Y0nJ9N9h7giwFXYtj6/FoSGbUSLooGypl5CmcFr7NJtQFUkfSSdhlzhlajGRSWSt9l8p5eguyKTRnDisoEe8K/39AWKzqg9CzdOYto/LlcgC+3lRA21PIX/MrtBtnqc9eZbjsXwHItWDdkRCQcZGPg8AYruTQfLvZZrC5xMDytduIvcZTa+9Jw9K5npcAy4/JDzRIx5JydXrxcZhkHIQ6MSm0oIUGDViR5YnyHW0IyZ17aEIalc+FeZ4HLXBLvw18uaQKPZqWurwDqz9u6KmuPGLlGEAUjMlUu1w+SQPDGKArbfTcJiteSGn5o49a/mlyHknRtWqj+29pGbaWWg9Svpvs9WYp1SX+OT4W0975vzF1YmId3mwAg/4d6Ccgc9JWSx1PDZtAprW0= Received: from gpeter-l.lan (host-92-21-139-67.as13285.net. [92.21.139.67]) by smtp.gmail.com with ESMTPSA id v18-20020adfe4d2000000b0033aedaea1b2sm3915846wrm.30.2024.02.08.08.21.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 08:21:23 -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: alexey.klimov@linaro.org, kernel-team@android.com, peter.griffin@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, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v4 0/2] Add regmap support to exynos-pmu for protected PMU regs Date: Thu, 8 Feb 2024 16:16:58 +0000 Message-ID: <20240208161700.268570-1-peter.griffin@linaro.org> X-Mailer: git-send-email 2.43.0.594.gd9cf4e227d-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi folks, This is a v4 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 v3: - Fix PMUALIVE_MASK - Add TENSOR_ prefix - clear SET_BITS bits on each loop iteration - change set_bit to set_bits func name - Fix some alignment - Add missing return on dev_err_probe - Reduce indentation in loop 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 superfluous 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) v3 lore: https://lore.kernel.org/linux-arm-kernel/20240202145731.4082033-1-peter.griffin@linaro.org/ 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 | 235 ++++++++++++++++++++++++- 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, 247 insertions(+), 10 deletions(-) -- 2.43.0.594.gd9cf4e227d-goog