Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1016062rdb; Mon, 19 Feb 2024 01:05:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV69U+MuC/0Lm9Z9JX2uAFRBkbnRytcwfLhCjpvJA3IqS2n+GzLYmWd+RQrkqjPUpvdNERw0T0mmMIm2OP3vgxdOBeooIyvaUtRfCUyfw== X-Google-Smtp-Source: AGHT+IGZLRnu85cJ9gqaDLUNTv66Fu7D3ms2JyhYyDc62RAhTZik3VsKCXabrwgPkS/TgyJuqQ14 X-Received: by 2002:a17:906:481b:b0:a3e:c1f5:836a with SMTP id w27-20020a170906481b00b00a3ec1f5836amr473194ejq.16.1708333526123; Mon, 19 Feb 2024 01:05:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708333526; cv=pass; d=google.com; s=arc-20160816; b=LeRs4XV9E1dql2W6p7In1svnV3n6IUtUrPmWHyExq86Zp0UJci7wi98wiWMaPM1gwk hwQrEknK5XItMTLWWCbnlh7LZVL1CJp6Yb5kd2IcFsRgVLQAviLA+e/WtUalfetadprK o/fIgm+FDoOkbyUcXkD9UPJ6Tlg2GevimLWaRiD1arJLsOpk2APO97vuGmluIzNBoU29 Y2Xf4chFFBs1XuwbykjZTSKzQoEW1xXIS0frv0aOnBAS6NHsgNEMh9JjCNZnJMCVaD0h IRBNfa0h2kg21YB0t15bkQIlkTito2qkGY1XKBGD34T03ucy7CrwpfwPqbltJQG957bf wz8Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=csW9r/4gQ0jxKhE2Wzu5kKeCgTzvE7WcFlLyXAHYs/4=; fh=1lz9BYmIsZ0HE9Gksnu6LwPL+olyJmgvHnys4LlB2XU=; b=hC8Do0JOR7fZKUN1z5t4bPPEOD3ta/wxsBp7ltQ4OVsQS7ZFrzhGyLwT3BhKaQ5GeN BoQ6wFKSxHH+uf36bdTAHTjzIu5HjITn/bL7wVQ3duVJfkD6MIPLGg1xExzZYYkt7QWz vvdjpfu11WwQobn7JPNtQ179MPbfBVMUbjm64P8kwxUY1xzLyXGIuOlNsVA4I2/00kXf XiTS02plWC2cdTZPEe5BSvU/2rr8oV1jxGF6613IbCivyxS9o23aMAbvbYyvK6K0zlDn 5RyABR5aKBtGmQdjrJ/HS3r8W7r+GfWV/VAy+e3S3AB5VyoPmI74HMSL6tfbpNtx/Vrj KMcw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=Ts8zPlFW; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-70994-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70994-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id jo25-20020a170906f6d900b00a3e874ba560si841874ejb.30.2024.02.19.01.05.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 01:05:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70994-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=Ts8zPlFW; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-70994-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70994-linux.lists.archive=gmail.com@vger.kernel.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 am.mirrors.kernel.org (Postfix) with ESMTPS id DCF991F23825 for ; Mon, 19 Feb 2024 09:05:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 634C9249ED; Mon, 19 Feb 2024 09:04:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="Ts8zPlFW" Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 BB88C22F17 for ; Mon, 19 Feb 2024 09:04:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708333495; cv=none; b=HCQTHIe2JPayGvLpVQ/kUZXjj1pW0QgleTRV+Bh21/2uswH2NcT3Wqy5yFsD+L0yIrbnuHGVSgu1SdiKOVJ9hybN1auz3dbWMIP5MNeQ9ldoUJmlwzkykEyl8Bl6Gr0i6NqAVb81U6m5wLYzMgQkTP0WMrcIJ7r3Sko9/af9CJs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708333495; c=relaxed/simple; bh=uQE+HBxhODMtSC9yhjOPxO99whbGm6VHOSreEDYTf6k=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=a6c3r7dDxHVUbx8ZALGDbvwR3oZF/LweqFx3Kf3Mep6cpCtsO9wpyOIqK6so1xILs5XnKJh0VjirYRFqRQX4XqBrE9LxA5YdkUec3RMPDUxLIjrlUP4T9F6L5XmR1m7bRGjQnl7Vpo27mdkTKSMwyiPD8BzI7ipNQvnGTCwhwKs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=Ts8zPlFW; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-412698cb496so1393335e9.1 for ; Mon, 19 Feb 2024 01:04:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1708333491; x=1708938291; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=csW9r/4gQ0jxKhE2Wzu5kKeCgTzvE7WcFlLyXAHYs/4=; b=Ts8zPlFWur583wkwssubCJdkSbUcvgDnfBSoMHRtPSeKEzkDh6P2q35A4DJjITan8S ILInzxTe3ScG6AlNsVH1vPqpx8Z9gDvwifnBwbjmvq1cwTn8GQHY4HnOskKgV3ur0KOO rBho06/gkdAD4Ku4aXDGxJUF2R9E4YK3U0EETheL4iqLvHeDcmkUB4UEs/zNsXthOfPD fwy2knNiamNL0M7Impr0amEGPTMfwfozshDaaWI4O6qV7CDA0A5Vqjd1W26IX1YkuHV0 /Zb+Kshs2Gwiy5oD0fKsSs5C+gStFMaBEOJRZTv95IpCuWDAFpC/mGWgXZ7ZMYu6wH5C AhLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708333491; x=1708938291; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=csW9r/4gQ0jxKhE2Wzu5kKeCgTzvE7WcFlLyXAHYs/4=; b=Nv16X2B7pH+lO85qx+DxdymMUxvpa9XPPPdU/JTHApi8KtnN+c8F9Z2xKD4/Smlb9L g9EESSTE00051WDENSV1s3luZxCmk2LniphX8fVObbuqnvHFR3r62DQl6e5+mCSavyXA Vi6E6Y4nO3JsnoZVjY76eCipWQ9A5nSGiBWNFqR6MZpJT8LKayzt2dDuhGEUS2nzhqnC Ohb8TfpcFo/hEc8+dK6NxGjA0iXZjhwel+qHgw39BPD47VPQVi1zCLdexoWY2tKGUhYp KjQobUMGGqc1icn+LO+g6q79SLuNn4D+ST5mMloWuz/uXs1IjtGsYKM5tl3dNJ4/y9DB kQeQ== X-Forwarded-Encrypted: i=1; AJvYcCV1QNfMzdjYYL9Y/8F0OsKhMzCW3WGxh4K1EYS7DxVcmXmkqDtI/LuZYZWzcVU/9dMDpy3UKZFl/TIJbDP3T4H9fHTaqfZ45k5L5HC8 X-Gm-Message-State: AOJu0Yz/tbTDq9cyF8qpc4yn3dPHRvp7LZda9DPM00dh25HIeWrhkjoL wjioEZIX8RwNEfgvkksukugOJ/hkOzkHXubuzNen+p5lVfXw4OB8jWvraJCqBYaEgG/vdk3YvLQ 1 X-Received: by 2002:a19:2d43:0:b0:511:7b37:1d26 with SMTP id t3-20020a192d43000000b005117b371d26mr7692205lft.13.1708333479889; Mon, 19 Feb 2024 01:04:39 -0800 (PST) Received: from [192.168.50.4] ([82.78.167.20]) by smtp.gmail.com with ESMTPSA id f7-20020a5d5687000000b0033ce727e728sm9611101wrv.94.2024.02.19.01.04.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Feb 2024 01:04:39 -0800 (PST) Message-ID: Date: Mon, 19 Feb 2024 11:04:36 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 07/17] clk: renesas: rzg2l: Extend power domain support Content-Language: en-US To: Geert Uytterhoeven Cc: mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, magnus.damm@gmail.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Claudiu Beznea References: <20240208124300.2740313-1-claudiu.beznea.uj@bp.renesas.com> <20240208124300.2740313-8-claudiu.beznea.uj@bp.renesas.com> <4098873b-a7e7-4c88-9af2-01f3c76424ab@tuxon.dev> From: claudiu beznea In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi, Geert, On 19.02.2024 10:48, Geert Uytterhoeven wrote: > Hi Claudiu, > > On Mon, Feb 19, 2024 at 9:24 AM claudiu beznea wrote: >> On 16.02.2024 16:08, Geert Uytterhoeven wrote: >>> On Thu, Feb 8, 2024 at 1:44 PM Claudiu wrote: >>>> From: Claudiu Beznea >>>> >>>> RZ/{G2L, V2L, G3S}-based CPG versions have support for saving extra >>>> power when clocks are disabled by activating module standby. This is done >>>> through MSTOP-specific registers that are part of CPG. Each individual >>>> module has one or more bits associated with one MSTOP register (see table >>>> "Registers for Module Standby Mode" from HW manuals). Hardware manual >>>> associates modules' clocks with one or more MSTOP bits. There are 3 mappings >>>> available (identified by researching RZ/G2L, RZ/G3S, RZ/V2L HW manuals): >>>> >>>> case 1: N clocks mapped to N MSTOP bits (with N={0, ..., X}) >>>> case 2: N clocks mapped to 1 MSTOP bit (with N={0, ..., X}) >>>> case 3: N clocks mapped to M MSTOP bits (with N={0, ..., X}, M={0, ..., Y}) >>>> >>>> Case 3 has been currently identified on RZ/V2L for the VCPL4 module. >>>> >>>> To cover all three cases, the individual platform drivers will provide to >>>> clock driver MSTOP register offset and associated bits in this register >>>> as a bitmask and the clock driver will apply this bitmask to proper >>>> MSTOP register. >>>> >>>> Apart from MSTOP support, RZ/G3S can save more power by powering down the >>>> individual IPs (after MSTOP has been set) if proper bits in >>>> CPG_PWRDN_IP{1,2} registers are set. >>>> >>>> The MSTOP and IP power down support were implemented through power >>>> domains. Platform-specific clock drivers will register an array of >>>> type struct rzg2l_cpg_pm_domain_init_data, which will be used to >>>> instantiate properly the power domains. >>>> >>>> Signed-off-by: Claudiu Beznea >>> >>> Thanks for your patch! >>> >>>> --- a/drivers/clk/renesas/rzg2l-cpg.c >>>> +++ b/drivers/clk/renesas/rzg2l-cpg.c >>>> @@ -1559,9 +1556,34 @@ static bool rzg2l_cpg_is_pm_clk(struct rzg2l_cpg_priv *priv, >>>> return true; >>>> } >> [ ... ] >> >>> >>>> @@ -234,6 +246,54 @@ struct rzg2l_reset { >>>> #define DEF_RST(_id, _off, _bit) \ >>>> DEF_RST_MON(_id, _off, _bit, -1) >>>> >>>> +/** >>>> + * struct rzg2l_cpg_pm_domain_conf - PM domain configuration data structure >>>> + * @mstop: MSTOP configuration (MSB = register offset, LSB = bitmask) >>>> + * @pwrdn: PWRDN configuration (MSB = register offset, LSB = register bit) >>>> + */ >>>> +struct rzg2l_cpg_pm_domain_conf { >>>> + u32 mstop; >>>> + u32 pwrdn; >>> >>> Why not >>> >>> u16 mstop_off; >>> u16 mstop_mask; >>> u16 pwrdn_off; >>> u16 pwrdn_mask; >>> >>> so you can drop the MSTOP*() and PWRDN*() macros below? >> >> I did it like this to align with the already existing approach for this >> kind of things available in this driver. I can do it as you proposed. > > The other fields do not align nicely with byte or word boundaries. > > I can see the value of the MSTOP(name, bitmask) and > PWRDN(name, bitmask) macros, but I'd rather get rid of the *_MASK() > and *_OFF() variants. Sure, I'll do proper adjustments in the next version. Thank you, Claudiu Beznea > >> For the rest of your comments on this patch: I agree and will adjust the >> patch in the next version. > > Thanks! > > Gr{oetje,eeting}s, > > Geert >