From patchwork Mon Jun 19 08:53:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Schneider-Pargmann X-Patchwork-Id: 13284162 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 AEF5EEB64D9 for ; Mon, 19 Jun 2023 08:54:39 +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=+SdjiZRr2df1hyyFgd19KX1PiCvopKN0l8oP14EY1ss=; b=PNfYgUDaOUaOZJ axhZ5eo9pV9yEbMD1cnRfAUudA7NuLsuMzFmaRXPRoPyk50Din06WaAbs2DySHJLZivJHDrg1cBfU bGFtXqKEpMifWEvIfUDnolq4t62L0zZfbwd++fzdrHIv0K0C99ySl+TvCH8S1umP3IMhx//IMTv1b bqFEVyr9yzP06HmC+GKdWflf5gCFmm7JD+2hTo+M0hpVz7N31asa98i+J6CnkNVCeOrqJlLgfwMz8 aWqWliQch0KqgBadV7Yy+3XIZjjt7zR2gbZD2zFiF4yvIqygzn6gWloRld5SYoStZjGSNpJV1oSg3 aR/2ptO55BcUDG4KhKZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qBAeS-007tw7-14; Mon, 19 Jun 2023 08:54:20 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qBAeN-007ts9-1h for linux-arm-kernel@lists.infradead.org; Mon, 19 Jun 2023 08:54:18 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-988c30a540aso73716166b.3 for ; Mon, 19 Jun 2023 01:54:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1687164853; x=1689756853; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=vNfLZEQpEJM6SLdl/oNvPckqX8L420p+TQXEM5LPmq4=; b=PVmhu++S5wpRNZuSpOYT3rHVUnDHTWcGd9UA4VSR/m/hBUysbxr+DPe0Cz8siwxKyY +oEAiVsodJBKJrHz1HUAYr6EN+AiO1xyPzcE9CakFrP4pvy72WcPMKupb3VbJgMPtnB4 kn0q55ZGdoZzh0MU166NhnV/pda0z65Qb31Zj+btQPrNBO9BmTrVdcpNV+V1B4Wqf6TV XXH96WnmcqlKMVbSQRUYMKmK3iRYzH1rsAuaKEIlKyMtYGXWkWstwKpK32kKwKzuD/si APbHTsT0L7UYxhc6Gsbj5t2Bg6QgLjDuqMxzo8wYu5jlRR6MIVZHu4KY1V6hYJ299f2F pH3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687164853; x=1689756853; 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=vNfLZEQpEJM6SLdl/oNvPckqX8L420p+TQXEM5LPmq4=; b=ZzK8Gp7ezARDD5AnBBhXmAoAD0hNCZ8/G8g+wTEMS4ig4CpT47SgRn8Xa2W5FSUTUs OV5+k625TsABBNv3OHZlDw4YZnRRR2ImMd+MAnCdry22WQgv+pGPyUs2BNNawS3ey8k/ DV1hELVc277+9vc/ilDIDOAnzRPKJEzF6p3OS7N+dh3B6JHnZK/plkq1VTkXkdRhTfOB VTZBHvWSCVpw6Qzo0aHhDC93nFG+u7JuJY9nV94JWeUpQPH0buy0pSYnhHAU7zbBv8xc aIxTOS92LCuhje4NJ4L5cOLoNRWA+GRWggH7BP3K7i2aC9yqHEvqJ9a3OiHYp3nKGJ+e kqaA== X-Gm-Message-State: AC+VfDwPdZ9V87p716NzqRSeu8qdJkWoNDVP7sc5USs81ZRF8YC2RulT eYhJnTORrdJbghsLLyph40K9QQ== X-Google-Smtp-Source: ACHHUZ5oaIcF5DxxRNDyvSnDYqO/7XTf0vp9USKjQrqAMYxRJW6BG1m/HQ+hMmwXcB1tdobu3o28eg== X-Received: by 2002:a17:907:3f17:b0:978:8f29:8c85 with SMTP id hq23-20020a1709073f1700b009788f298c85mr8139030ejc.32.1687164852389; Mon, 19 Jun 2023 01:54:12 -0700 (PDT) Received: from blmsp.fritz.box ([2001:4090:a245:802c:bc2b:8db8:9210:41eb]) by smtp.gmail.com with ESMTPSA id h27-20020a17090619db00b00987a6e01e94sm2994339ejd.214.2023.06.19.01.54.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 01:54:11 -0700 (PDT) From: Markus Schneider-Pargmann To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger Cc: Chun-Jie Chen , AngeloGioacchino Del Regno , Tinghan Shen , Fabien Parent , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Markus Schneider-Pargmann Subject: [PATCH v5 0/8] soc: mediatek: MT8365 power support Date: Mon, 19 Jun 2023 10:53:36 +0200 Message-Id: <20230619085344.2885311-1-msp@baylibre.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230619_015415_564579_9CB5DC12 X-CRM114-Status: GOOD ( 15.14 ) 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, Thanks for the feedback of last round. As requested I replaced all hex values with defines and redesigned the data format and regmap passing. Thanks for any feedback! Best, Markus Based on v6.4-rc1 Changes in v5: - Create defines for all registers and bits in mt8365 power domain patch - Redesign scpsys_bus_prot_data to use flags to store reg_update, clr_ack as well as the difference between SMI and INFRACFG. The code uses the appropriate regmap depending on the flags. - The WAY_EN patch now uses two flags, one for inverted operations 'BUS_PROT_INVERTED' and one to use infracfg-nao for the status flags 'BUS_PROT_STA_COMPONENT_INFRA_NAO'. Changes in v4: - Redesigned WAY_EN patch and split it up in smaller patches. - Added two documentation patches. - Added mediatek,infracfg-nao field to the binding. Changes in v3: - Mainly redesigned WAY_EN patch to be easier to understand - Rebased onto v6.0-rc1 - Several other stuff that is described in the individual patches Changes in v2: - Updated error handling path for scpsys_power_on() - Minor updates described in each patch Previous versions: v1 - https://lore.kernel.org/linux-mediatek/20220530204214.913251-1-fparent@baylibre.com/ v2 - https://lore.kernel.org/linux-mediatek/20220725081853.1636444-1-msp@baylibre.com/ v3 - https://lore.kernel.org/linux-mediatek/20220822144303.3438467-1-msp@baylibre.com/ v4 - https://lore.kernel.org/linux-arm-kernel/20230105170735.1637416-1-msp@baylibre.com/ Alexandre Bailon (2): soc: mediatek: Add support for WAY_EN operations soc: mediatek: Add support for MTK_SCPD_STRICT_BUS_PROTECTION cap Fabien Parent (2): dt-bindings: power: Add MT8365 power domains soc: mediatek: pm-domains: Add support for MT8365 Markus Schneider-Pargmann (4): soc: mediatek: pm-domains: Move bools to a flags field soc: mediatek: pm-domains: Split bus_prot_mask soc: mediatek: pm-domains: Create bus protection operation functions soc: mediatek: pm-domains: Unify configuration for infracfg and smi .../power/mediatek,power-controller.yaml | 6 + drivers/soc/mediatek/mt6795-pm-domains.h | 16 +- drivers/soc/mediatek/mt8167-pm-domains.h | 20 +- drivers/soc/mediatek/mt8173-pm-domains.h | 16 +- drivers/soc/mediatek/mt8183-pm-domains.h | 198 +++---- drivers/soc/mediatek/mt8186-pm-domains.h | 212 +++---- drivers/soc/mediatek/mt8188-pm-domains.h | 518 +++++++++--------- drivers/soc/mediatek/mt8192-pm-domains.h | 262 ++++----- drivers/soc/mediatek/mt8195-pm-domains.h | 464 ++++++++-------- drivers/soc/mediatek/mt8365-pm-domains.h | 197 +++++++ drivers/soc/mediatek/mtk-pm-domains.c | 157 ++++-- drivers/soc/mediatek/mtk-pm-domains.h | 60 +- .../dt-bindings/power/mediatek,mt8365-power.h | 19 + include/linux/soc/mediatek/infracfg.h | 41 ++ 14 files changed, 1267 insertions(+), 919 deletions(-) create mode 100644 drivers/soc/mediatek/mt8365-pm-domains.h create mode 100644 include/dt-bindings/power/mediatek,mt8365-power.h