From patchwork Thu Feb 8 16:16:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 13550013 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 EC59CC48260 for ; Thu, 8 Feb 2024 16:21:41 +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=cGhyHMB2G5Wp1xh+fqeO+pIl1KLnzUIII3vzJwuYRIg=; b=I/YRtfHtcLsKtL LRtBgVdJOkY4dAwIo0028vhF4kTqCquRlOjg7DGACqekiYvjYhxDhGzW4WDQ1pnc0DcAdbKQq3YZq 1/PrkI0N/ugoR1ZQJnEY9Imzsc7403us9Js0zqggeNe/zIcxvLOrHxnnzIPN5IzZ5k1rYO3GLndU3 YsO+5kDth40fE1locKqZsK4I79ps7L6AkA4LavhQUqiLIHRI8mONNPZUjN/7H4cS5IYdwS+8ZhtT9 ptA59skoEmog1MDn2yrAhdK10hMm7ZeXMeAQTY2Z8/OKZvOIgFzwGOGbY/BwH1/OGVnFJ26OyH1j7 kM2DLYrTOfh3G+2mwNBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rY79U-0000000EIDE-3TcO; Thu, 08 Feb 2024 16:21:28 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rY79R-0000000EICM-2AcC for linux-arm-kernel@lists.infradead.org; Thu, 08 Feb 2024 16:21:27 +0000 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3392b045e0aso1261379f8f.2 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=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=4an9xpeJCw/uJKBtsN9iFQPLTnnjc49mN5XWvlsDwF0=; b=RD8MIl153komJ9PPG343wH99n2EsSHjDo6PRcniD4lUSb9TbXizcJAOz7JAAWhV7jz cN2TMvPRINIjCrNHKZYTHKLi25NpmrwFnGDhnwFcNWira5Ci2+2aC/4xkmV02PNbfVG6 VKG3B6yBuCG5U0FiPCqxM4Zd7W+Y8LgjtF3ClVmIznMrIcO4LbFBjx8MqovLvZaWLk2e YtoCNS/vumWF5+IggO4Es5OHPhPXKROe7lDmornqUiESunJosUnIx5dqMVWsXanHweA2 agoize7bXvBQDI8EOZWRV587uZ7WdbmIZPBX3HYGz7NAO6+9iD0geT+rnky/w51LH2z3 q26g== 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=XJWTQSD2eNC2KqVz07J8SZSLG74YjkJmFseKtLO+7GlVn7HhAgOYCUcPNGs4DPnt3B vkGwX2eA4weehPIi1ERt3FXXu6sbc7Z0nLG/1VdDntTSzJJdsajgcMdNpUwdDrKu6gCe QHOZSe4V1k9YHX3vNvFyChC7cX2jraX62eYD2vQMpWHEyIBPbHBbdm0Q72/kvEIROezV W82Y/ZnZnpjqcNe6dnPxOnfUtc3FWdVnKkPrkNszsck8czd+9xI8BsgwalAkXIuYLNR/ hf+k4v75rKOwHYvuCGX+hNgJdN7PUhsp4h+ppQ8nd6iEG9pmCyxOc4EgsOxbCSSAcrI/ iUWA== X-Gm-Message-State: AOJu0Yxu24DUSRj5IJ+BHMrOCAZgnWuMvhWi5XSjSkG+E2AXtD0OLezQ eA62KSV5dlerIYRp0EPnhZj32huwLDevioe46erjJ8Q+AHteAjdzL40lSrvIWTY= X-Google-Smtp-Source: AGHT+IEhIUssuh6f0tZ4cr8pY2KG5IU7kuCv0jWoMHYcV22kLSQkQnaQt7DRk8W9DfJgN2r32G0JUw== 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 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240208_082125_586779_39E6093F X-CRM114-Status: GOOD ( 13.81 ) 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 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(-)