From patchwork Tue Feb 20 22:06:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 13564605 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 8B824C48BC3 for ; Tue, 20 Feb 2024 22:06:37 +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=8DxPdpKODWaMZjBsiT5FboWqeNfBJ2xuxxBwIJfN8Dc=; b=Ay7ifFbADoFk+Q 2whe6K7WFu448M2bM1s27oVs7UvIMifsyv8i7gUQlfcvTDAq6Lk8+8PP3SeUGvMiLYolqzla+hfuS fkaWQUM8MpBTph9EcvViePHzvTKjp9Ke4jW2CAt7ORVV2YMK/9fzrrF8sY9qADSStOJXfgcdH1NQW ZmM376F0ui4LA5zS1S35HBLWQFmqQtJ6BWwCjugP2NdnM+dBl229dTfBd0I5RKNCSyLEW6Z5NVocZ +MxUvMZ9FgJDvh7WZlhxCcdotVFWalWtACCrvscKq9ictFnxEQW/VEvze5kGjjc4j28VGlcr00gDT fQzEJykE3kKcHZd72o9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcYFr-0000000GJMd-01Lu; Tue, 20 Feb 2024 22:06:23 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcYFn-0000000GJKJ-3RBg for linux-arm-kernel@lists.infradead.org; Tue, 20 Feb 2024 22:06:21 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a3ee69976c9so238140166b.0 for ; Tue, 20 Feb 2024 14:06:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708466777; x=1709071577; 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=WayrAqJKlPUd9zETfUw1Ts8bEtutpMZwBNJvVgBjtaI=; b=pow0GzQocDMmT03T46faYs5lqySZF5rVbL2tRuSWDvzb+QPo+TRViySHS1nC8hfb51 b8fXUmCZS7uAss1DVWmwV8Fy6XBw7/IlVcmAytHqGeUa1aavXpewTWzW2b2HCToUIQxZ Bw6J0Uc6/EToQMzFELoivjysAKTd2Cijy3i7/JFjIfyjJZz0CILWYzGARtecWhjyYCi/ OeuzieOXlq+irZttEsZ1/iLOu0OG/dHN8xech43+YWdHD5Asf4EzfUFVxQbaxCQNFCCK Zsv1L6Qnh7pGfLMjiaFbcTE4c0ExYwb9cZTGmOfgegCBRinysEAdNDQsQX3DQEIp3WiM M+/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708466777; x=1709071577; 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=WayrAqJKlPUd9zETfUw1Ts8bEtutpMZwBNJvVgBjtaI=; b=FwEtgAyZauoZX4bICv1W+8Uu9LT3J+TchFXDEJI+qecRSike+gfGY4iWzDO/r9lVlB c7Soj/C7DKhmNZ8mlroWgI3Ff5rqRs4mGH1D6DRBUx7Ulcyfr7RhIsiGBKH9PrfWiHEr cXvp9lKw09F3CNF9F85FgjIglKOgn14WKF04pc622RlfxBmROwl9UZMeq/SCrkvGKthS SCi93r+6JAZUui5QuwmOyHZpk/q/xpyS/P0WCO35bQIJUu16dVcbgc7IqfggkaF0pNMO eEjZp+KLK0kKGwCOtKPvYUZwzG47lJoMEEDhVNufv38HYCxCzolTwbZvd/9lauN09MyQ Kg8g== X-Forwarded-Encrypted: i=1; AJvYcCVFNBPlj0gz/b/D6J3u4zgfak5KwIjrvZXKyyiy/2JYvZ/kSb2ATseb94L3fQ02kwYMoh18JqI2ivwT5WM1hbxgdnvUDKMMnoSZ1D+QZ//7l/yjYVk= X-Gm-Message-State: AOJu0YyALYH75uSeA75v6nnBf3nOnRN1pT8oWd1DASC7AZtOb4I6+HXq 9OKUNOvLt1RPA1MEiuhUV7qvskteBsx2MafFAtEs4qQ13S/hRHPwEwYww+7dNFk= X-Google-Smtp-Source: AGHT+IG3snKOIDgwa63ac2HZsTDoHUOHQJjsrhmM0VJAueATDqhQcjXoXx0E9aN1/Rc8QHgCkh4A/Q== X-Received: by 2002:a17:906:40ce:b0:a3e:69d7:3514 with SMTP id a14-20020a17090640ce00b00a3e69d73514mr5448019ejk.26.1708466777363; Tue, 20 Feb 2024 14:06:17 -0800 (PST) Received: from gpeter-l.lan (host-92-18-74-232.as13285.net. [92.18.74.232]) by smtp.gmail.com with ESMTPSA id r8-20020a170906364800b00a3e4e7ad9dbsm3413771ejb.68.2024.02.20.14.06.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 14:06:16 -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 v6 0/2] Add regmap support to exynos-pmu for protected PMU regs Date: Tue, 20 Feb 2024 22:06:11 +0000 Message-ID: <20240220220613.797068-1-peter.griffin@linaro.org> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240220_140619_884238_C89E86DF X-CRM114-Status: GOOD ( 15.56 ) 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 v6 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 Oriole / gs101 (by me), exynos850 (by Sam) and odroid xu3 (exynos 5422) by Alexey. That confirms that both the regmap mmio parts and regmap SMC parts are working correctly. The expectation is this series would be merged via Krzysztofs Samsung Exynos tree. regards, Peter Changes since v5: - Update kerneldoc comment property -> propname Changes since v4: - Use same argument names as in struct regmap_config - Remove inline keyword and rely on compiler - Update kerneldoc wording - property -> propname argument rename - reverse Xmas tree - Only call of_node_put() when of_parse_phandle() is called - Collect tags 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) v5 lore: https://lore.kernel.org/all/20240219204238.356942-1-peter.griffin@linaro.org/ v4 lore: https://lore.kernel.org/all/20240208161700.268570-1-peter.griffin@linaro.org/ v3 lore: https://lore.kernel.org/all/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, 249 insertions(+), 8 deletions(-)