Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1655861rdb; Mon, 8 Jan 2024 06:24:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IHCpHqAR7xubYoJDjmb9Yto5A1F7dd5osyhF41bTyu/8kSGaCUX4rAWGjOJ5D5/09SozSA/ X-Received: by 2002:a17:90b:1051:b0:28a:ebfa:cb83 with SMTP id gq17-20020a17090b105100b0028aebfacb83mr1068750pjb.11.1704723861061; Mon, 08 Jan 2024 06:24:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704723861; cv=none; d=google.com; s=arc-20160816; b=n36VoYSoLnzwY7pSVbjsfOsRs3i2mEhYgiC1KVSsJcPP70zx8qTP/0bDAEjadbFav2 TjNEqDkQxtyyWiEuNDpQX+YZ9C5xFL51BD45nfF6I7MDwoe8teLx6GdO+dc6N6YsNfYx QZL3rJ8RslJwwGhWze1BE79gKDxOQGyCt7MGS3Sf4++2VJ7k9XKTtqekBC3hMY5QLtVI Dc7HgH2b3blA9S5plYPHJ80V4zsADsVrfACvkqtTnjZ6rbpQL7uUToKukyd3JvltWSdu JhdstgBWoceHanEUDV+2SAqvL5NDAYVLK15ssUYWnVusHQhkPdRMiqt9Ah8oHznkP0d+ rifQ== 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=LRR/AX/Ad0QtJHcBfyTON92y1gdHqlvl0b4nc8KLN/Y=; fh=wTzoAENfCB/gKsmSkSDDyvfgqn+GQlBYg6NbKvG4olk=; b=qQ5cXHOF+u2pdRxze+A3ex794lJM5ae5lgpaMtSMZv0BJizVTZTLuTNMJ4hDi/PqxQ qTY95bwbirLlcUnwvVuOCOKa+IHz+xnjY/B3Am40lB0quOHb3CDWL74UZiQw+vQp+Xv6 HP5x84WID7tejtyXPYuXPB3a5fT1nkejEBuMpXcLhCQu0E5Jfv+NIOKlWyHjxr4HKTDO iH8AsVIxUeO1i42fPuxdZAN8CG9RKlO/RAnTY1SGorFjya9Jm9+WsAblUoFfbbNpPbfn Vz79xNke9hJuM05A04zYG5tklB3JRP1PvwGk9b+1QA/8RiXIJAb49FvXINov4GtA2ZWg U0Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=xJJewCu+; spf=pass (google.com: domain of linux-kernel+bounces-19702-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19702-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 bw4-20020a17090af60400b0028cdf3bffbasi5547905pjb.13.2024.01.08.06.24.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 06:24:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19702-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=xJJewCu+; spf=pass (google.com: domain of linux-kernel+bounces-19702-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19702-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 B62CB284174 for ; Mon, 8 Jan 2024 14:24:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0BCB34654B; Mon, 8 Jan 2024 14:24:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="xJJewCu+" 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 B348B405C7; Mon, 8 Jan 2024 14:24:13 +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=1704723851; bh=mc5HOamFYriYeumJK9D1W6NJdUvkZnUeuFa4C5EjT4U=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=xJJewCu+KvPzQrBNi+2a5MFjUmLSwERs67kGfo1ETpOrHxyqcC/pvQ1aC81P+0ueT QzBhhgaJOZuK1Jxt4/Hs32Lvf7xkh8rwihSifMjxAOFoRc38cvnj4CBOcP9dhtAiuz x2Wwov8BJSQ7tupXjNr4FiQQ5jaaZ2TzxMk4u05yo9DJ3Y2nPH9nI1jq05DRXJ9Rhh B33nCnK2BY9X+2QtZ9sdje4H3hZmWwpZja7F/bMLT68WeXyZUprXTaRFGL0DKX+yJv leYmMEsERtm04zjCvL5LNDTUx983NBAvkT/xSe22QqS+LuRUdMyoEIKO6plMBUJ/4S XR5gaOweUb/FQ== 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 64BFF378003D; Mon, 8 Jan 2024 14:24:10 +0000 (UTC) Message-ID: <19f5ef6e-ecc1-4f6c-b6f1-8a729d170ef6@collabora.com> Date: Mon, 8 Jan 2024 15:24:09 +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-w@public-files.de, Frank Wunderlich , Michael Turquette , Stephen Boyd , Matthias Brugger , Philipp Zabel , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: 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> <717a21bb-de39-4f7d-913c-f2a20d8b02bd@collabora.com> From: AngeloGioacchino Del Regno In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Il 08/01/24 14:46, Frank Wunderlich ha scritto: > Am 8. Januar 2024 11:12:26 MEZ schrieb AngeloGioacchino Del Regno : >> 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, > > Yes you are right...i have only rst1 as screenshot,need to get the full datasheet or can you tell me base address for rst0? Need to change value of INFRA_RST_SET_OFFSET then to rst0 and check RST_NR_PER_BANK to be correct. The datasheet is public ... [1] has it in the Resources paragraph :-) Anyway, since I already have it here in front of me... 10001070 INFRA_GLOBALCON_RST0_SET 10001080 INFRA_GLOBALCON_RST1_SET [1]: https://wiki.banana-pi.org/Banana_Pi_BPI-R4 Cheers, Angelo