Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1537065rdb; Mon, 8 Jan 2024 02:20:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGx+TPisPnqU98BlTFGJhXJHR7AQEF5v6PJc9TfEauwUILkiI6yfG9+Ney7Sht4YUYsRBlG X-Received: by 2002:a05:6870:ac2a:b0:1fb:2c68:6c0b with SMTP id kw42-20020a056870ac2a00b001fb2c686c0bmr4866170oab.37.1704709207310; Mon, 08 Jan 2024 02:20:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704709207; cv=none; d=google.com; s=arc-20160816; b=nKOMhNtW2WtMopcRPfYe448IxeviwmJrx1BkO8ChY+h4pQC+/SHAf+jQJa2FFFJon9 +N/ns7nJT0a5k6GhgBwdCQwxekSAZcYG2Yi3g6+RA4N/uAcEbhQ8yMOiNuiInMag0raO 5e5EWKpa0DjQ31gJwLvhKTHoK5Z8qBlZxA++/mDBZdY3qfhyGBEQAYxPu6JafDKglU3V joo0/lKDj6FgtzLfnSqUYTcGRf1275/b7jdXPii19ZHxELljakkwRUYssJA5cwz79mkW VUDeH1hVBB28kiTTR7+wNT8ktZtBTVdnmLsuCGlVjxjOIpE0/33O6grblY4AG+HQhm6K D23A== ARC-Message-Signature: i=1; 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=YTByeeBisx+kAXBWal5SD/VDzVDsY0aOC3A+ZIzlKwo=; fh=dRyxTU18ghFd6MRQPk8xTHZ0C5CIsSIIl1GeyKas5xM=; b=bQ7uhyHGBC9jdmUP+hQnIrWPZS4JM3gHZ+WIkHhIx+q6Aly8RR+jM//GkLiv82pn84 aH31OvMk5vKxtvN/DVlRKCtFeUaCoXpzgFNstdNEhjG8QQe9kfdCGxKrOrB87VMJcPsu Lm80nMJqIL0U0jIlW6t3L4K/lTnlEYRtVna1pVJWVYOv1dS+XmU6K+B1PYyCCCQ1WhhR Si01vQhVYmsfKE/QJnYacdtE7gxRxvAQwnn8XZLS0k7k4rBexAg2vy1NCWebMqdTcyMt 8byp0fN1Q67Rk4sdFnIyVrP98rIWgUPg865VFeSasb/w4Ev7vJkcfp8L0oyb/kpeKlB/ qltQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=KxIykQWJ; spf=pass (google.com: domain of linux-kernel+bounces-19320-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19320-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id g10-20020a63564a000000b005ced65a49e7si5718064pgm.765.2024.01.08.02.20.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 02:20:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19320-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=KxIykQWJ; spf=pass (google.com: domain of linux-kernel+bounces-19320-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19320-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9A750283B09 for ; Mon, 8 Jan 2024 10:12:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CA6D013AE0; Mon, 8 Jan 2024 10:12:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="KxIykQWJ" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60C84134AC; Mon, 8 Jan 2024 10:12:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1704708748; bh=CUvDS7z0vaI7dKOLj6bDMDn82Ts3BKg1N9K5vuqjjVo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=KxIykQWJv9qPHoTN685bsqx/ZvJpaW5HT8TW6IaaeOu3furkgK8e+B7jfcScu7RSA EKmbZB1w5OdbHcw3FqdgvDKlVGt/6bNy5MsdggYfaxC7F6HZVnmSng1QvKSb6DetyC WjPLWzFktbECWAJ63+a8AE8pCwxu9BvHzEihqqJZAbToHzCMzyyI3fyjI5UHKqeuhc JjjSb+q66rQ51PdjzYsbrceEC4Z8vCdg5Z/oAsHOi95POXNHNl7cViQc2QxzkSObYu 4C6IG/dcUKEONXLAl5o3gaF2EAmF9xK3Yy7DpswnX19IqcoSC5barSp7J7pYath7rw BHyJS4FCMYgVw== Received: from [100.113.186.2] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id A4CDC3780625; Mon, 8 Jan 2024 10:12:27 +0000 (UTC) Message-ID: <717a21bb-de39-4f7d-913c-f2a20d8b02bd@collabora.com> Date: Mon, 8 Jan 2024 11:12:26 +0100 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 v2 2/2] clk: mediatek: add infracfg reset controller for mt7988 Content-Language: en-US To: Frank Wunderlich , Michael Turquette , Stephen Boyd , Matthias Brugger , Philipp Zabel , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Frank Wunderlich , Sam Shih , Daniel Golle , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org References: <20240105162056.43266-1-linux@fw-web.de> <20240105162056.43266-3-linux@fw-web.de> From: AngeloGioacchino Del Regno In-Reply-To: <20240105162056.43266-3-linux@fw-web.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Il 05/01/24 17:20, Frank Wunderlich ha scritto: > From: Frank Wunderlich > > Infracfg can also operate as reset controller, add support for it. > > Signed-off-by: Frank Wunderlich > --- > drivers/clk/mediatek/clk-mt7988-infracfg.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/drivers/clk/mediatek/clk-mt7988-infracfg.c b/drivers/clk/mediatek/clk-mt7988-infracfg.c > index 8011ef278bea..1660a45349ff 100644 > --- a/drivers/clk/mediatek/clk-mt7988-infracfg.c > +++ b/drivers/clk/mediatek/clk-mt7988-infracfg.c > @@ -14,6 +14,9 @@ > #include "clk-gate.h" > #include "clk-mux.h" > #include > +#include > + > +#define INFRA_RST_SET_OFFSET 0x80 > > static DEFINE_SPINLOCK(mt7988_clk_lock); > > @@ -249,12 +252,29 @@ static const struct mtk_gate infra_clks[] = { > GATE_INFRA3(CLK_INFRA_133M_PCIE_CK_P3, "infra_133m_pcie_ck_p3", "sysaxi_sel", 31), > }; > > +static u16 infra_rst_ofs[] = { > + INFRA_RST_SET_OFFSET, > +}; > + > +static u16 infra_idx_map[] = { > + [MT7988_INFRA_RST0_THERM_CTRL_SWRST] = 0 * RST_NR_PER_BANK + 9, The MT7988A datasheet says that INFRA_RST0 bit 9 is CONN2EMI_M0_GALS_SLV_SWRST, so this is wrong: THERM_CTRL_SWRST is in the RST1 register, bit 9. Also, I'm sure that you really want to add the PCIe MAC reset bit as well, to be used with the PCIe driver... [MT7988_INFRA_RST0_PEXTP_MAC_SWRST] = 0 * RST_NR_PER_BANK + 6, [MT7988_INFRA_RST1_THERM_CTRL_SWRST] = 1 * RST_NR_PER_BANK + 9, Enjoy... :-) Cheers, Angelo