[RFC,v2,1/5] dt-bindings: clock: histb-clock: Add missing common clock and Hi3798MV200 specific clock definition
Message ID | 20240217-clk-mv200-v2-1-b782e4eb66f7@outlook.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-69845-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp303110dyc; Sat, 17 Feb 2024 04:53:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVRR7nqmffH1AJbVPjwSsVBD1A1ujsYCpp49GRaixHhDEDrPSyaLywfFrpfZ72KeGATVxHAvUvDnSPvO+UBEh5WhqPBQA== X-Google-Smtp-Source: AGHT+IHlTRoVSo5Jg3B1xQt+Ow+9K48qMAZnm1Eigoqr4ZJ7Iufmjh+vQk1ohEq+SFKf5OcxP3Br X-Received: by 2002:a05:6808:4482:b0:3c1:381a:f89c with SMTP id eq2-20020a056808448200b003c1381af89cmr9376148oib.43.1708174389261; Sat, 17 Feb 2024 04:53:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708174389; cv=pass; d=google.com; s=arc-20160816; b=S2eTPkjwhCgrxAKCXT8ftGiH/RAIj3GamYd/CCw1VVAjeHpwDGzvhfp6vnuZLRF27l gcyaGizmmNiDRjP1Hjy0vbWpO8KoQnOlpEsZi2kbsk3xQJv5eKJpThqXdgZW3FJ3hE6D zBw0xe4goqypjtBr1Kx1kCa+fU5r1ZSx6T5kGEMI3E3DVD/Fg+APPQ8WCt23+zTJ+Iz6 zR7dFuT1a0TGBJUKMXEHLZEADVCoiD3ZeGFqEozjB4XRkkr/OcKKbAMH3gAmbunfCdjY iYFvas7+2BTnxtD/+1s/60lu+B2gulNI35eHjzNqSic+Zyn2wVPSXRoHIdowYIbL7ypX ST4w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=Yi382ulXDoBUpTXXFS6yAyIi94FJWiy5sjf+4S/iq+8=; fh=61jQp11ptjJt97TUxWe8+hyuLMCiql6kVojnsyhWm9A=; b=cSYI8JAcFL0RUyzv6ALwdjThUAT9gD45L33KyNHGxSdhznO2bPQhtN9ezT0eXBjyAf 4j0qyg/Fyf6aP0MYFkOGdkZw8+GJsAGVXyfPNkH1aOUazK1iid35CR975dChOdXGbbSm Pd0gtTNHuvs++brcRzzC8KljB2vl3May6YuB6OHqw4bj84aeqFB5Ivd5hedatFg0rEPG Kq9Gi8U2ARYbAvglUF0r5vA4EH/A379Lrqi+RqxOt2Tc84Y96SoHsDIlnJbB0GYzH/W6 6MvN4xBpJixUctz5DoI9G/2N32nGKThF7O+muH3YrlFHOqFVPbEGApFIRrzfmdX3CyKM iWhQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YxdbM24u; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-69845-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69845-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id q2-20020a656a82000000b005dcae4c1ff4si1535591pgu.172.2024.02.17.04.53.08 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 04:53:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69845-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YxdbM24u; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-69845-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69845-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 47EBBB22210 for <ouuuleilei@gmail.com>; Sat, 17 Feb 2024 12:53:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B5EC47C082; Sat, 17 Feb 2024 12:52:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YxdbM24u" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 ED14E6A025; Sat, 17 Feb 2024 12:52:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708174337; cv=none; b=fF55UPsOVTEZdlDSB2kUPPQFsS+filkrPXsR5abT/lRT9h9Tzf40dOy0jEypn6oMWpeqEPkXHX+3QgMnUcQmfNkZzMIlsEcCSUAuEFFkhOezzRMiYjB5aL+AEVkGh+jpyirWR0+tHZc6N0DHrzKwwAlifrS0R/nv/41tdY4P6LE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708174337; c=relaxed/simple; bh=Ee3XDJNpfdTjv5LyZOoehAGlyXESSiYI284+s3xfG5o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SYWi5KxDRSePPkE42bJL4rA64oU5RhGGU894nL1of2pBbA5o/B6d4GpYsO/4BK6uZwRaUpCYKrx/rltoGT8dAh0Njl3jkh9HHkMI2NhKmLElFu5o8EXBx15We+1ZvrtP2AH0HqH5BwFy6K5fmKtckRYqkHRQPUWZDrxGuwlxnjc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YxdbM24u; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 94FB2C433C7; Sat, 17 Feb 2024 12:52:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708174336; bh=Ee3XDJNpfdTjv5LyZOoehAGlyXESSiYI284+s3xfG5o=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=YxdbM24uAzVsleuKMhT7QdHR6XFlGj8dICGqhRBRabSBx26SRIID3xfJ1BbBOca8E RabV4x4w+4aJIccqpGoWNJD/9YYdlWqVKvPKVvO8M1nzWSknJ3P9jUOBEmICxjC5wb evCjRuBrzgG6vYGLW/mu63xhN9RStCBlyFTeCoOEPSmkzYShg9cj6jtwzBF3it0/4O UkKU11xqVMagrGqfDgFjt/FyJqiIZBceynQAAUqqm7qndbSjCk16+/Eldr7USb253a B2ahLtx3vzizvuEhxO8CFFzk8Xwexxy06fwC9BuogOTu0v5TJc//sErnYu2t2Z1Pjs IRK5K8bDdPs7w== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 760AEC48BF5; Sat, 17 Feb 2024 12:52:16 +0000 (UTC) From: Yang Xiwen via B4 Relay <devnull+forbidden405.outlook.com@kernel.org> Date: Sat, 17 Feb 2024 20:52:06 +0800 Subject: [PATCH RFC v2 1/5] dt-bindings: clock: histb-clock: Add missing common clock and Hi3798MV200 specific clock definition Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240217-clk-mv200-v2-1-b782e4eb66f7@outlook.com> References: <20240217-clk-mv200-v2-0-b782e4eb66f7@outlook.com> In-Reply-To: <20240217-clk-mv200-v2-0-b782e4eb66f7@outlook.com> To: Michael Turquette <mturquette@baylibre.com>, Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org> Cc: David Yang <mmyangfl@gmail.com>, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Xiwen <forbidden405@outlook.com> X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708174332; l=1498; i=forbidden405@outlook.com; s=20230724; h=from:subject:message-id; bh=tAwhkwf2RTqZatW50V1J+QSR6rpA9D5O9tBXY261zlg=; b=Wd4NvzYkBjaJB8dBpsrrkE8Gp7ildNtAqBwU4yBYpdyeqle9YokQaZBaZsx2cDuJ8kNaJQ231 adt6aXJIFTKB6GQJn8m4LtiU6fz/9iFOtuSNY1AXpwKDZvI8/AJEzYp X-Developer-Key: i=forbidden405@outlook.com; a=ed25519; pk=qOD5jhp891/Xzc+H/PZ8LWVSWE3O/XCQnAg+5vdU2IU= X-Endpoint-Received: by B4 Relay for forbidden405@outlook.com/20230724 with auth_id=67 X-Original-From: Yang Xiwen <forbidden405@outlook.com> Reply-To: <forbidden405@outlook.com> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791150668200949582 X-GMAIL-MSGID: 1791150668200949582 |
Series |
clk: hisilicon: add support for Hi3798MV200
|
|
Commit Message
Yang Xiwen via B4 Relay
Feb. 17, 2024, 12:52 p.m. UTC
From: Yang Xiwen <forbidden405@outlook.com> According to the datasheet, some clocks are missing, add their definitions first. Some aliases for hi3798mv200 are also introduced. Signed-off-by: Yang Xiwen <forbidden405@outlook.com> --- include/dt-bindings/clock/histb-clock.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
Comments
On 17/02/2024 13:52, Yang Xiwen via B4 Relay wrote: > From: Yang Xiwen <forbidden405@outlook.com> > > According to the datasheet, some clocks are missing, add their > definitions first. > > Some aliases for hi3798mv200 are also introduced. > > Signed-off-by: Yang Xiwen <forbidden405@outlook.com> > --- > include/dt-bindings/clock/histb-clock.h | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/include/dt-bindings/clock/histb-clock.h b/include/dt-bindings/clock/histb-clock.h > index e64e5770ada6..68a53053586a 100644 > --- a/include/dt-bindings/clock/histb-clock.h > +++ b/include/dt-bindings/clock/histb-clock.h > @@ -58,6 +58,27 @@ > #define HISTB_USB3_UTMI_CLK1 48 > #define HISTB_USB3_PIPE_CLK1 49 > #define HISTB_USB3_SUSPEND_CLK1 50 > +#define HISTB_SDIO1_BIU_CLK 51 > +#define HISTB_SDIO1_CIU_CLK 52 > +#define HISTB_SDIO1_DRV_CLK 53 > +#define HISTB_SDIO1_SAMPLE_CLK 54 > +#define HISTB_ETH0_PHY_CLK 55 > +#define HISTB_ETH1_PHY_CLK 56 > +#define HISTB_WDG0_CLK 57 > +#define HISTB_USB2_UTMI0_CLK HISTB_USB2_UTMI_CLK Why? It's anyway placed oddly, the entries are ordered by number/value. > +#define HISTB_USB2_UTMI1_CLK 58 > +#define HISTB_USB3_REF_CLK 59 > +#define HISTB_USB3_GM_CLK 60 > +#define HISTB_USB3_GS_CLK 61 > + > +/* Hi3798MV200 specific clocks */ > + > +// reuse clocks of histb Don't mix comment styles. > +#define HI3798MV200_GMAC_CLK HISTB_ETH0_MAC_CLK > +#define HI3798MV200_GMACIF_CLK HISTB_ETH0_MACIF_CLK > +#define HI3798MV200_FEMAC_CLK HISTB_ETH1_MAC_CLK > +#define HI3798MV200_FEMACIF_CLK HISTB_ETH1_MACIF_CLK > +#define HI3798MV200_FEPHY_CLK HISTB_ETH1_PHY_CLK I don't understand what do you want to achieve here. Clock IDs start from 0 or 1. Best regards, Krzysztof
On 2/20/2024 6:10 PM, Krzysztof Kozlowski wrote: > On 17/02/2024 13:52, Yang Xiwen via B4 Relay wrote: >> From: Yang Xiwen <forbidden405@outlook.com> >> >> According to the datasheet, some clocks are missing, add their >> definitions first. >> >> Some aliases for hi3798mv200 are also introduced. >> >> Signed-off-by: Yang Xiwen <forbidden405@outlook.com> >> --- >> include/dt-bindings/clock/histb-clock.h | 21 +++++++++++++++++++++ >> 1 file changed, 21 insertions(+) >> >> diff --git a/include/dt-bindings/clock/histb-clock.h b/include/dt-bindings/clock/histb-clock.h >> index e64e5770ada6..68a53053586a 100644 >> --- a/include/dt-bindings/clock/histb-clock.h >> +++ b/include/dt-bindings/clock/histb-clock.h >> @@ -58,6 +58,27 @@ >> #define HISTB_USB3_UTMI_CLK1 48 >> #define HISTB_USB3_PIPE_CLK1 49 >> #define HISTB_USB3_SUSPEND_CLK1 50 >> +#define HISTB_SDIO1_BIU_CLK 51 >> +#define HISTB_SDIO1_CIU_CLK 52 >> +#define HISTB_SDIO1_DRV_CLK 53 >> +#define HISTB_SDIO1_SAMPLE_CLK 54 >> +#define HISTB_ETH0_PHY_CLK 55 >> +#define HISTB_ETH1_PHY_CLK 56 >> +#define HISTB_WDG0_CLK 57 >> +#define HISTB_USB2_UTMI0_CLK HISTB_USB2_UTMI_CLK > Why? It's anyway placed oddly, the entries are ordered by number/value. > >> +#define HISTB_USB2_UTMI1_CLK 58 >> +#define HISTB_USB3_REF_CLK 59 >> +#define HISTB_USB3_GM_CLK 60 >> +#define HISTB_USB3_GS_CLK 61 >> + >> +/* Hi3798MV200 specific clocks */ >> + >> +// reuse clocks of histb > Don't mix comment styles. > >> +#define HI3798MV200_GMAC_CLK HISTB_ETH0_MAC_CLK >> +#define HI3798MV200_GMACIF_CLK HISTB_ETH0_MACIF_CLK >> +#define HI3798MV200_FEMAC_CLK HISTB_ETH1_MAC_CLK >> +#define HI3798MV200_FEMACIF_CLK HISTB_ETH1_MACIF_CLK >> +#define HI3798MV200_FEPHY_CLK HISTB_ETH1_PHY_CLK > I don't understand what do you want to achieve here. Clock IDs start > from 0 or 1. They are aliases. A friendlier name compared to ETH0/1. > > > > Best regards, > Krzysztof >
On 20/02/2024 11:12, Yang Xiwen wrote: > On 2/20/2024 6:10 PM, Krzysztof Kozlowski wrote: >> On 17/02/2024 13:52, Yang Xiwen via B4 Relay wrote: >>> From: Yang Xiwen <forbidden405@outlook.com> >>> >>> According to the datasheet, some clocks are missing, add their >>> definitions first. >>> >>> Some aliases for hi3798mv200 are also introduced. >>> >>> Signed-off-by: Yang Xiwen <forbidden405@outlook.com> >>> --- >>> include/dt-bindings/clock/histb-clock.h | 21 +++++++++++++++++++++ >>> 1 file changed, 21 insertions(+) >>> >>> diff --git a/include/dt-bindings/clock/histb-clock.h b/include/dt-bindings/clock/histb-clock.h >>> index e64e5770ada6..68a53053586a 100644 >>> --- a/include/dt-bindings/clock/histb-clock.h >>> +++ b/include/dt-bindings/clock/histb-clock.h >>> @@ -58,6 +58,27 @@ >>> #define HISTB_USB3_UTMI_CLK1 48 >>> #define HISTB_USB3_PIPE_CLK1 49 >>> #define HISTB_USB3_SUSPEND_CLK1 50 >>> +#define HISTB_SDIO1_BIU_CLK 51 >>> +#define HISTB_SDIO1_CIU_CLK 52 >>> +#define HISTB_SDIO1_DRV_CLK 53 >>> +#define HISTB_SDIO1_SAMPLE_CLK 54 >>> +#define HISTB_ETH0_PHY_CLK 55 >>> +#define HISTB_ETH1_PHY_CLK 56 >>> +#define HISTB_WDG0_CLK 57 >>> +#define HISTB_USB2_UTMI0_CLK HISTB_USB2_UTMI_CLK >> Why? It's anyway placed oddly, the entries are ordered by number/value. >> >>> +#define HISTB_USB2_UTMI1_CLK 58 >>> +#define HISTB_USB3_REF_CLK 59 >>> +#define HISTB_USB3_GM_CLK 60 >>> +#define HISTB_USB3_GS_CLK 61 >>> + >>> +/* Hi3798MV200 specific clocks */ >>> + >>> +// reuse clocks of histb >> Don't mix comment styles. >> >>> +#define HI3798MV200_GMAC_CLK HISTB_ETH0_MAC_CLK >>> +#define HI3798MV200_GMACIF_CLK HISTB_ETH0_MACIF_CLK >>> +#define HI3798MV200_FEMAC_CLK HISTB_ETH1_MAC_CLK >>> +#define HI3798MV200_FEMACIF_CLK HISTB_ETH1_MACIF_CLK >>> +#define HI3798MV200_FEPHY_CLK HISTB_ETH1_PHY_CLK >> I don't understand what do you want to achieve here. Clock IDs start >> from 0 or 1. > They are aliases. A friendlier name compared to ETH0/1. Fix your email client, so it will not remove line breaks before/after quotes. Your email client makes it unreadable. Aliases do not bind anything, so you can drop these. Best regards, Krzysztof
On 2/20/2024 6:10 PM, Krzysztof Kozlowski wrote: > On 17/02/2024 13:52, Yang Xiwen via B4 Relay wrote: >> From: Yang Xiwen <forbidden405@outlook.com> >> >> According to the datasheet, some clocks are missing, add their >> definitions first. >> >> Some aliases for hi3798mv200 are also introduced. >> >> Signed-off-by: Yang Xiwen <forbidden405@outlook.com> >> --- >> include/dt-bindings/clock/histb-clock.h | 21 +++++++++++++++++++++ >> 1 file changed, 21 insertions(+) >> >> diff --git a/include/dt-bindings/clock/histb-clock.h b/include/dt-bindings/clock/histb-clock.h >> index e64e5770ada6..68a53053586a 100644 >> --- a/include/dt-bindings/clock/histb-clock.h >> +++ b/include/dt-bindings/clock/histb-clock.h >> @@ -58,6 +58,27 @@ >> #define HISTB_USB3_UTMI_CLK1 48 >> #define HISTB_USB3_PIPE_CLK1 49 >> #define HISTB_USB3_SUSPEND_CLK1 50 >> +#define HISTB_SDIO1_BIU_CLK 51 >> +#define HISTB_SDIO1_CIU_CLK 52 >> +#define HISTB_SDIO1_DRV_CLK 53 >> +#define HISTB_SDIO1_SAMPLE_CLK 54 >> +#define HISTB_ETH0_PHY_CLK 55 >> +#define HISTB_ETH1_PHY_CLK 56 >> +#define HISTB_WDG0_CLK 57 >> +#define HISTB_USB2_UTMI0_CLK HISTB_USB2_UTMI_CLK > Why? It's anyway placed oddly, the entries are ordered by number/value. So this is somewhat broken at the beginning. It named after histb-clock.h but actually they are all clocks for Hi3798CV200 SoC. For Hi3798MV200(also a HiSTB SoC), there is one additional UTMI clock. What solution do you prefer? rename UTMI_CLK to UTMI0_CLK, add UTMI1_CLK after it and increment all the indexes after it? Then the diff would be very ugly. > >> +#define HISTB_USB2_UTMI1_CLK 58 >> +#define HISTB_USB3_REF_CLK 59 >> +#define HISTB_USB3_GM_CLK 60 >> +#define HISTB_USB3_GS_CLK 61 >> + >> +/* Hi3798MV200 specific clocks */ >> + >> +// reuse clocks of histb > Don't mix comment styles. > >> +#define HI3798MV200_GMAC_CLK HISTB_ETH0_MAC_CLK >> +#define HI3798MV200_GMACIF_CLK HISTB_ETH0_MACIF_CLK >> +#define HI3798MV200_FEMAC_CLK HISTB_ETH1_MAC_CLK >> +#define HI3798MV200_FEMACIF_CLK HISTB_ETH1_MACIF_CLK >> +#define HI3798MV200_FEPHY_CLK HISTB_ETH1_PHY_CLK > I don't understand what do you want to achieve here. Clock IDs start > from 0 or 1. > > > > Best regards, > Krzysztof >
On 20/02/2024 15:06, Yang Xiwen wrote: > On 2/20/2024 6:10 PM, Krzysztof Kozlowski wrote: >> On 17/02/2024 13:52, Yang Xiwen via B4 Relay wrote: >>> From: Yang Xiwen <forbidden405@outlook.com> >>> >>> According to the datasheet, some clocks are missing, add their >>> definitions first. >>> >>> Some aliases for hi3798mv200 are also introduced. >>> >>> Signed-off-by: Yang Xiwen <forbidden405@outlook.com> >>> --- >>> include/dt-bindings/clock/histb-clock.h | 21 +++++++++++++++++++++ >>> 1 file changed, 21 insertions(+) >>> >>> diff --git a/include/dt-bindings/clock/histb-clock.h b/include/dt-bindings/clock/histb-clock.h >>> index e64e5770ada6..68a53053586a 100644 >>> --- a/include/dt-bindings/clock/histb-clock.h >>> +++ b/include/dt-bindings/clock/histb-clock.h >>> @@ -58,6 +58,27 @@ >>> #define HISTB_USB3_UTMI_CLK1 48 >>> #define HISTB_USB3_PIPE_CLK1 49 >>> #define HISTB_USB3_SUSPEND_CLK1 50 >>> +#define HISTB_SDIO1_BIU_CLK 51 >>> +#define HISTB_SDIO1_CIU_CLK 52 >>> +#define HISTB_SDIO1_DRV_CLK 53 >>> +#define HISTB_SDIO1_SAMPLE_CLK 54 >>> +#define HISTB_ETH0_PHY_CLK 55 >>> +#define HISTB_ETH1_PHY_CLK 56 >>> +#define HISTB_WDG0_CLK 57 >>> +#define HISTB_USB2_UTMI0_CLK HISTB_USB2_UTMI_CLK >> Why? It's anyway placed oddly, the entries are ordered by number/value. > > > So this is somewhat broken at the beginning. It named after > histb-clock.h but actually they are all clocks for Hi3798CV200 SoC. For > Hi3798MV200(also a HiSTB SoC), there is one additional UTMI clock. > > > What solution do you prefer? rename UTMI_CLK to UTMI0_CLK, add UTMI1_CLK > after it and increment all the indexes after it? Then the diff would be > very ugly. I still don't understand what is the problem you are trying to solve here. Your commit msg says add missing ID, but that ID - HISTB_USB2_UTMI_CLK - is already there. I also do not get why there is a need to rename anything. Best regards, Krzysztof
On 2/21/2024 12:13 AM, Krzysztof Kozlowski wrote: > On 20/02/2024 15:06, Yang Xiwen wrote: >> On 2/20/2024 6:10 PM, Krzysztof Kozlowski wrote: >>> On 17/02/2024 13:52, Yang Xiwen via B4 Relay wrote: >>>> From: Yang Xiwen <forbidden405@outlook.com> >>>> >>>> According to the datasheet, some clocks are missing, add their >>>> definitions first. >>>> >>>> Some aliases for hi3798mv200 are also introduced. >>>> >>>> Signed-off-by: Yang Xiwen <forbidden405@outlook.com> >>>> --- >>>> include/dt-bindings/clock/histb-clock.h | 21 +++++++++++++++++++++ >>>> 1 file changed, 21 insertions(+) >>>> >>>> diff --git a/include/dt-bindings/clock/histb-clock.h b/include/dt-bindings/clock/histb-clock.h >>>> index e64e5770ada6..68a53053586a 100644 >>>> --- a/include/dt-bindings/clock/histb-clock.h >>>> +++ b/include/dt-bindings/clock/histb-clock.h >>>> @@ -58,6 +58,27 @@ >>>> #define HISTB_USB3_UTMI_CLK1 48 >>>> #define HISTB_USB3_PIPE_CLK1 49 >>>> #define HISTB_USB3_SUSPEND_CLK1 50 >>>> +#define HISTB_SDIO1_BIU_CLK 51 >>>> +#define HISTB_SDIO1_CIU_CLK 52 >>>> +#define HISTB_SDIO1_DRV_CLK 53 >>>> +#define HISTB_SDIO1_SAMPLE_CLK 54 >>>> +#define HISTB_ETH0_PHY_CLK 55 >>>> +#define HISTB_ETH1_PHY_CLK 56 >>>> +#define HISTB_WDG0_CLK 57 >>>> +#define HISTB_USB2_UTMI0_CLK HISTB_USB2_UTMI_CLK >>> Why? It's anyway placed oddly, the entries are ordered by number/value. >> >> So this is somewhat broken at the beginning. It named after >> histb-clock.h but actually they are all clocks for Hi3798CV200 SoC. For >> Hi3798MV200(also a HiSTB SoC), there is one additional UTMI clock. >> >> >> What solution do you prefer? rename UTMI_CLK to UTMI0_CLK, add UTMI1_CLK >> after it and increment all the indexes after it? Then the diff would be >> very ugly. > I still don't understand what is the problem you are trying to solve > here. Your commit msg says add missing ID, but that ID - > HISTB_USB2_UTMI_CLK - is already there. > > I also do not get why there is a need to rename anything. Because there are two USB2_UTMI_CLKs in total, at least for Hi3798MV200. UTMI1 is missing here. For other HiSTB SoCs, there could be even more. If we add USB2_UTMI1_CLK, it looks silly to keep USB2_UTMI_CLK without renaming it to UTMI0. Just like all the other clocks. E.g. I2Cn_CLK(n=0,1,2,3,4) etc.., so the same for USB2_UTMI_CLK. > > > > Best regards, > Krzysztof >
On 20/02/2024 17:19, Yang Xiwen wrote: > On 2/21/2024 12:13 AM, Krzysztof Kozlowski wrote: >> On 20/02/2024 15:06, Yang Xiwen wrote: >>> On 2/20/2024 6:10 PM, Krzysztof Kozlowski wrote: >>>> On 17/02/2024 13:52, Yang Xiwen via B4 Relay wrote: >>>>> From: Yang Xiwen <forbidden405@outlook.com> >>>>> >>>>> According to the datasheet, some clocks are missing, add their >>>>> definitions first. >>>>> >>>>> Some aliases for hi3798mv200 are also introduced. >>>>> >>>>> Signed-off-by: Yang Xiwen <forbidden405@outlook.com> >>>>> --- >>>>> include/dt-bindings/clock/histb-clock.h | 21 +++++++++++++++++++++ >>>>> 1 file changed, 21 insertions(+) >>>>> >>>>> diff --git a/include/dt-bindings/clock/histb-clock.h b/include/dt-bindings/clock/histb-clock.h >>>>> index e64e5770ada6..68a53053586a 100644 >>>>> --- a/include/dt-bindings/clock/histb-clock.h >>>>> +++ b/include/dt-bindings/clock/histb-clock.h >>>>> @@ -58,6 +58,27 @@ >>>>> #define HISTB_USB3_UTMI_CLK1 48 >>>>> #define HISTB_USB3_PIPE_CLK1 49 >>>>> #define HISTB_USB3_SUSPEND_CLK1 50 >>>>> +#define HISTB_SDIO1_BIU_CLK 51 >>>>> +#define HISTB_SDIO1_CIU_CLK 52 >>>>> +#define HISTB_SDIO1_DRV_CLK 53 >>>>> +#define HISTB_SDIO1_SAMPLE_CLK 54 >>>>> +#define HISTB_ETH0_PHY_CLK 55 >>>>> +#define HISTB_ETH1_PHY_CLK 56 >>>>> +#define HISTB_WDG0_CLK 57 >>>>> +#define HISTB_USB2_UTMI0_CLK HISTB_USB2_UTMI_CLK >>>> Why? It's anyway placed oddly, the entries are ordered by number/value. >>> >>> So this is somewhat broken at the beginning. It named after >>> histb-clock.h but actually they are all clocks for Hi3798CV200 SoC. For >>> Hi3798MV200(also a HiSTB SoC), there is one additional UTMI clock. >>> >>> >>> What solution do you prefer? rename UTMI_CLK to UTMI0_CLK, add UTMI1_CLK >>> after it and increment all the indexes after it? Then the diff would be >>> very ugly. >> I still don't understand what is the problem you are trying to solve >> here. Your commit msg says add missing ID, but that ID - >> HISTB_USB2_UTMI_CLK - is already there. >> >> I also do not get why there is a need to rename anything. > > > Because there are two USB2_UTMI_CLKs in total, at least for Hi3798MV200. > UTMI1 is missing here. For other HiSTB SoCs, there could be even more. My comment was under UTMI0. We do not talk about UTMI1... > > > If we add USB2_UTMI1_CLK, it looks silly to keep USB2_UTMI_CLK without > renaming it to UTMI0. Just like all the other clocks. E.g. > I2Cn_CLK(n=0,1,2,3,4) etc.., so the same for USB2_UTMI_CLK. Then place it next to old name and explain why it is deprecated with comment. Best regards, Krzysztof
On 2/21/2024 12:25 AM, Krzysztof Kozlowski wrote: > On 20/02/2024 17:19, Yang Xiwen wrote: >> On 2/21/2024 12:13 AM, Krzysztof Kozlowski wrote: >>> On 20/02/2024 15:06, Yang Xiwen wrote: >>>> On 2/20/2024 6:10 PM, Krzysztof Kozlowski wrote: >>>>> On 17/02/2024 13:52, Yang Xiwen via B4 Relay wrote: >>>>>> From: Yang Xiwen <forbidden405@outlook.com> >>>>>> >>>>>> According to the datasheet, some clocks are missing, add their >>>>>> definitions first. >>>>>> >>>>>> Some aliases for hi3798mv200 are also introduced. >>>>>> >>>>>> Signed-off-by: Yang Xiwen <forbidden405@outlook.com> >>>>>> --- >>>>>> include/dt-bindings/clock/histb-clock.h | 21 +++++++++++++++++++++ >>>>>> 1 file changed, 21 insertions(+) >>>>>> >>>>>> diff --git a/include/dt-bindings/clock/histb-clock.h b/include/dt-bindings/clock/histb-clock.h >>>>>> index e64e5770ada6..68a53053586a 100644 >>>>>> --- a/include/dt-bindings/clock/histb-clock.h >>>>>> +++ b/include/dt-bindings/clock/histb-clock.h >>>>>> @@ -58,6 +58,27 @@ >>>>>> #define HISTB_USB3_UTMI_CLK1 48 >>>>>> #define HISTB_USB3_PIPE_CLK1 49 >>>>>> #define HISTB_USB3_SUSPEND_CLK1 50 >>>>>> +#define HISTB_SDIO1_BIU_CLK 51 >>>>>> +#define HISTB_SDIO1_CIU_CLK 52 >>>>>> +#define HISTB_SDIO1_DRV_CLK 53 >>>>>> +#define HISTB_SDIO1_SAMPLE_CLK 54 >>>>>> +#define HISTB_ETH0_PHY_CLK 55 >>>>>> +#define HISTB_ETH1_PHY_CLK 56 >>>>>> +#define HISTB_WDG0_CLK 57 >>>>>> +#define HISTB_USB2_UTMI0_CLK HISTB_USB2_UTMI_CLK >>>>> Why? It's anyway placed oddly, the entries are ordered by number/value. >>>> So this is somewhat broken at the beginning. It named after >>>> histb-clock.h but actually they are all clocks for Hi3798CV200 SoC. For >>>> Hi3798MV200(also a HiSTB SoC), there is one additional UTMI clock. >>>> >>>> >>>> What solution do you prefer? rename UTMI_CLK to UTMI0_CLK, add UTMI1_CLK >>>> after it and increment all the indexes after it? Then the diff would be >>>> very ugly. >>> I still don't understand what is the problem you are trying to solve >>> here. Your commit msg says add missing ID, but that ID - >>> HISTB_USB2_UTMI_CLK - is already there. >>> >>> I also do not get why there is a need to rename anything. >> >> Because there are two USB2_UTMI_CLKs in total, at least for Hi3798MV200. >> UTMI1 is missing here. For other HiSTB SoCs, there could be even more. > My comment was under UTMI0. We do not talk about UTMI1... > >> >> If we add USB2_UTMI1_CLK, it looks silly to keep USB2_UTMI_CLK without >> renaming it to UTMI0. Just like all the other clocks. E.g. >> I2Cn_CLK(n=0,1,2,3,4) etc.., so the same for USB2_UTMI_CLK. > Then place it next to old name and explain why it is deprecated with > comment. Do we need to keep the old name? I can fix all the users (only hi3798cv200.dtsi) in next version and drop this name directly. Is that okay? Should i insert UTMI1_CLK to the middle and re-index all the macros after it? Or simply add it to the tail? > > Best regards, > Krzysztof >
On 20/02/2024 17:31, Yang Xiwen wrote: > On 2/21/2024 12:25 AM, Krzysztof Kozlowski wrote: >> On 20/02/2024 17:19, Yang Xiwen wrote: >>> On 2/21/2024 12:13 AM, Krzysztof Kozlowski wrote: >>>> On 20/02/2024 15:06, Yang Xiwen wrote: >>>>> On 2/20/2024 6:10 PM, Krzysztof Kozlowski wrote: >>>>>> On 17/02/2024 13:52, Yang Xiwen via B4 Relay wrote: >>>>>>> From: Yang Xiwen <forbidden405@outlook.com> >>>>>>> >>>>>>> According to the datasheet, some clocks are missing, add their >>>>>>> definitions first. >>>>>>> >>>>>>> Some aliases for hi3798mv200 are also introduced. >>>>>>> >>>>>>> Signed-off-by: Yang Xiwen <forbidden405@outlook.com> >>>>>>> --- >>>>>>> include/dt-bindings/clock/histb-clock.h | 21 +++++++++++++++++++++ >>>>>>> 1 file changed, 21 insertions(+) >>>>>>> >>>>>>> diff --git a/include/dt-bindings/clock/histb-clock.h b/include/dt-bindings/clock/histb-clock.h >>>>>>> index e64e5770ada6..68a53053586a 100644 >>>>>>> --- a/include/dt-bindings/clock/histb-clock.h >>>>>>> +++ b/include/dt-bindings/clock/histb-clock.h >>>>>>> @@ -58,6 +58,27 @@ >>>>>>> #define HISTB_USB3_UTMI_CLK1 48 >>>>>>> #define HISTB_USB3_PIPE_CLK1 49 >>>>>>> #define HISTB_USB3_SUSPEND_CLK1 50 >>>>>>> +#define HISTB_SDIO1_BIU_CLK 51 >>>>>>> +#define HISTB_SDIO1_CIU_CLK 52 >>>>>>> +#define HISTB_SDIO1_DRV_CLK 53 >>>>>>> +#define HISTB_SDIO1_SAMPLE_CLK 54 >>>>>>> +#define HISTB_ETH0_PHY_CLK 55 >>>>>>> +#define HISTB_ETH1_PHY_CLK 56 >>>>>>> +#define HISTB_WDG0_CLK 57 >>>>>>> +#define HISTB_USB2_UTMI0_CLK HISTB_USB2_UTMI_CLK >>>>>> Why? It's anyway placed oddly, the entries are ordered by number/value. >>>>> So this is somewhat broken at the beginning. It named after >>>>> histb-clock.h but actually they are all clocks for Hi3798CV200 SoC. For >>>>> Hi3798MV200(also a HiSTB SoC), there is one additional UTMI clock. >>>>> >>>>> >>>>> What solution do you prefer? rename UTMI_CLK to UTMI0_CLK, add UTMI1_CLK >>>>> after it and increment all the indexes after it? Then the diff would be >>>>> very ugly. >>>> I still don't understand what is the problem you are trying to solve >>>> here. Your commit msg says add missing ID, but that ID - >>>> HISTB_USB2_UTMI_CLK - is already there. >>>> >>>> I also do not get why there is a need to rename anything. >>> >>> Because there are two USB2_UTMI_CLKs in total, at least for Hi3798MV200. >>> UTMI1 is missing here. For other HiSTB SoCs, there could be even more. >> My comment was under UTMI0. We do not talk about UTMI1... >> >>> >>> If we add USB2_UTMI1_CLK, it looks silly to keep USB2_UTMI_CLK without >>> renaming it to UTMI0. Just like all the other clocks. E.g. >>> I2Cn_CLK(n=0,1,2,3,4) etc.., so the same for USB2_UTMI_CLK. >> Then place it next to old name and explain why it is deprecated with >> comment. > > > Do we need to keep the old name? I can fix all the users (only > hi3798cv200.dtsi) in next version and drop this name directly. Is that All users in all projects? That might be tricky. And even for Linux kernel, how can you do it in a bisectable way? Just keep old name. > okay? Should i insert UTMI1_CLK to the middle and re-index all the > macros after it? Or simply add it to the tail? Bindings and header constants are ABI, so you cannot change them. Best regards, Krzysztof
On 2/21/2024 1:06 AM, Krzysztof Kozlowski wrote: > On 20/02/2024 17:31, Yang Xiwen wrote: >> On 2/21/2024 12:25 AM, Krzysztof Kozlowski wrote: >>> On 20/02/2024 17:19, Yang Xiwen wrote: >>>> On 2/21/2024 12:13 AM, Krzysztof Kozlowski wrote: >>>>> On 20/02/2024 15:06, Yang Xiwen wrote: >>>>>> On 2/20/2024 6:10 PM, Krzysztof Kozlowski wrote: >>>>>>> On 17/02/2024 13:52, Yang Xiwen via B4 Relay wrote: >>>>>>>> From: Yang Xiwen <forbidden405@outlook.com> >>>>>>>> >>>>>>>> According to the datasheet, some clocks are missing, add their >>>>>>>> definitions first. >>>>>>>> >>>>>>>> Some aliases for hi3798mv200 are also introduced. >>>>>>>> >>>>>>>> Signed-off-by: Yang Xiwen <forbidden405@outlook.com> >>>>>>>> --- >>>>>>>> include/dt-bindings/clock/histb-clock.h | 21 +++++++++++++++++++++ >>>>>>>> 1 file changed, 21 insertions(+) >>>>>>>> >>>>>>>> diff --git a/include/dt-bindings/clock/histb-clock.h b/include/dt-bindings/clock/histb-clock.h >>>>>>>> index e64e5770ada6..68a53053586a 100644 >>>>>>>> --- a/include/dt-bindings/clock/histb-clock.h >>>>>>>> +++ b/include/dt-bindings/clock/histb-clock.h >>>>>>>> @@ -58,6 +58,27 @@ >>>>>>>> #define HISTB_USB3_UTMI_CLK1 48 >>>>>>>> #define HISTB_USB3_PIPE_CLK1 49 >>>>>>>> #define HISTB_USB3_SUSPEND_CLK1 50 >>>>>>>> +#define HISTB_SDIO1_BIU_CLK 51 >>>>>>>> +#define HISTB_SDIO1_CIU_CLK 52 >>>>>>>> +#define HISTB_SDIO1_DRV_CLK 53 >>>>>>>> +#define HISTB_SDIO1_SAMPLE_CLK 54 >>>>>>>> +#define HISTB_ETH0_PHY_CLK 55 >>>>>>>> +#define HISTB_ETH1_PHY_CLK 56 >>>>>>>> +#define HISTB_WDG0_CLK 57 >>>>>>>> +#define HISTB_USB2_UTMI0_CLK HISTB_USB2_UTMI_CLK >>>>>>> Why? It's anyway placed oddly, the entries are ordered by number/value. >>>>>> So this is somewhat broken at the beginning. It named after >>>>>> histb-clock.h but actually they are all clocks for Hi3798CV200 SoC. For >>>>>> Hi3798MV200(also a HiSTB SoC), there is one additional UTMI clock. >>>>>> >>>>>> >>>>>> What solution do you prefer? rename UTMI_CLK to UTMI0_CLK, add UTMI1_CLK >>>>>> after it and increment all the indexes after it? Then the diff would be >>>>>> very ugly. >>>>> I still don't understand what is the problem you are trying to solve >>>>> here. Your commit msg says add missing ID, but that ID - >>>>> HISTB_USB2_UTMI_CLK - is already there. >>>>> >>>>> I also do not get why there is a need to rename anything. >>>> Because there are two USB2_UTMI_CLKs in total, at least for Hi3798MV200. >>>> UTMI1 is missing here. For other HiSTB SoCs, there could be even more. >>> My comment was under UTMI0. We do not talk about UTMI1... >>> >>>> If we add USB2_UTMI1_CLK, it looks silly to keep USB2_UTMI_CLK without >>>> renaming it to UTMI0. Just like all the other clocks. E.g. >>>> I2Cn_CLK(n=0,1,2,3,4) etc.., so the same for USB2_UTMI_CLK. >>> Then place it next to old name and explain why it is deprecated with >>> comment. >> >> Do we need to keep the old name? I can fix all the users (only >> hi3798cv200.dtsi) in next version and drop this name directly. Is that > All users in all projects? That might be tricky. And even for Linux > kernel, how can you do it in a bisectable way? Just keep old name. > > >> okay? Should i insert UTMI1_CLK to the middle and re-index all the >> macros after it? Or simply add it to the tail? > Bindings and header constants are ABI, so you cannot change them. This file should be renamed to hi3798cv200-clock.h, it shouldn't be called histb-clock.h from the beginning. Now I have to workaround this in a dirty way. What if another HiSTB SoC has 3 or more UTMI_CLKs? Do we need to add more definitions to the end of the file? The file is gonna to be more and more unreadable with scattered clock definitions. Do you think it's acceptable to create a new header file instead? I think we don't need a generic histb-clock.h. Each SoC should maintain their own clock indexes header file. Maybe we can rename it to hi3798cv200-clock.h and include it from a new histb-clock.h (also mark this generic header file deprecated and only for hi3798cv200). Then I'll create hi3798mv200-clock.h header file instead. So we don't have to workaround this. > > Best regards, > Krzysztof >
On 20/02/2024 18:29, Yang Xiwen wrote: > On 2/21/2024 1:06 AM, Krzysztof Kozlowski wrote: >> On 20/02/2024 17:31, Yang Xiwen wrote: >>> On 2/21/2024 12:25 AM, Krzysztof Kozlowski wrote: >>>> On 20/02/2024 17:19, Yang Xiwen wrote: >>>>> On 2/21/2024 12:13 AM, Krzysztof Kozlowski wrote: >>>>>> On 20/02/2024 15:06, Yang Xiwen wrote: >>>>>>> On 2/20/2024 6:10 PM, Krzysztof Kozlowski wrote: >>>>>>>> On 17/02/2024 13:52, Yang Xiwen via B4 Relay wrote: >>>>>>>>> From: Yang Xiwen <forbidden405@outlook.com> >>>>>>>>> >>>>>>>>> According to the datasheet, some clocks are missing, add their >>>>>>>>> definitions first. >>>>>>>>> >>>>>>>>> Some aliases for hi3798mv200 are also introduced. >>>>>>>>> >>>>>>>>> Signed-off-by: Yang Xiwen <forbidden405@outlook.com> >>>>>>>>> --- >>>>>>>>> include/dt-bindings/clock/histb-clock.h | 21 +++++++++++++++++++++ >>>>>>>>> 1 file changed, 21 insertions(+) >>>>>>>>> >>>>>>>>> diff --git a/include/dt-bindings/clock/histb-clock.h b/include/dt-bindings/clock/histb-clock.h >>>>>>>>> index e64e5770ada6..68a53053586a 100644 >>>>>>>>> --- a/include/dt-bindings/clock/histb-clock.h >>>>>>>>> +++ b/include/dt-bindings/clock/histb-clock.h >>>>>>>>> @@ -58,6 +58,27 @@ >>>>>>>>> #define HISTB_USB3_UTMI_CLK1 48 >>>>>>>>> #define HISTB_USB3_PIPE_CLK1 49 >>>>>>>>> #define HISTB_USB3_SUSPEND_CLK1 50 >>>>>>>>> +#define HISTB_SDIO1_BIU_CLK 51 >>>>>>>>> +#define HISTB_SDIO1_CIU_CLK 52 >>>>>>>>> +#define HISTB_SDIO1_DRV_CLK 53 >>>>>>>>> +#define HISTB_SDIO1_SAMPLE_CLK 54 >>>>>>>>> +#define HISTB_ETH0_PHY_CLK 55 >>>>>>>>> +#define HISTB_ETH1_PHY_CLK 56 >>>>>>>>> +#define HISTB_WDG0_CLK 57 >>>>>>>>> +#define HISTB_USB2_UTMI0_CLK HISTB_USB2_UTMI_CLK >>>>>>>> Why? It's anyway placed oddly, the entries are ordered by number/value. >>>>>>> So this is somewhat broken at the beginning. It named after >>>>>>> histb-clock.h but actually they are all clocks for Hi3798CV200 SoC. For >>>>>>> Hi3798MV200(also a HiSTB SoC), there is one additional UTMI clock. >>>>>>> >>>>>>> >>>>>>> What solution do you prefer? rename UTMI_CLK to UTMI0_CLK, add UTMI1_CLK >>>>>>> after it and increment all the indexes after it? Then the diff would be >>>>>>> very ugly. >>>>>> I still don't understand what is the problem you are trying to solve >>>>>> here. Your commit msg says add missing ID, but that ID - >>>>>> HISTB_USB2_UTMI_CLK - is already there. >>>>>> >>>>>> I also do not get why there is a need to rename anything. >>>>> Because there are two USB2_UTMI_CLKs in total, at least for Hi3798MV200. >>>>> UTMI1 is missing here. For other HiSTB SoCs, there could be even more. >>>> My comment was under UTMI0. We do not talk about UTMI1... >>>> >>>>> If we add USB2_UTMI1_CLK, it looks silly to keep USB2_UTMI_CLK without >>>>> renaming it to UTMI0. Just like all the other clocks. E.g. >>>>> I2Cn_CLK(n=0,1,2,3,4) etc.., so the same for USB2_UTMI_CLK. >>>> Then place it next to old name and explain why it is deprecated with >>>> comment. >>> >>> Do we need to keep the old name? I can fix all the users (only >>> hi3798cv200.dtsi) in next version and drop this name directly. Is that >> All users in all projects? That might be tricky. And even for Linux >> kernel, how can you do it in a bisectable way? Just keep old name. >> >> >>> okay? Should i insert UTMI1_CLK to the middle and re-index all the >>> macros after it? Or simply add it to the tail? >> Bindings and header constants are ABI, so you cannot change them. > > > This file should be renamed to hi3798cv200-clock.h, it shouldn't be > called histb-clock.h from the beginning. Now I have to workaround this > in a dirty way. What if another HiSTB SoC has 3 or more UTMI_CLKs? Do we > need to add more definitions to the end of the file? The file is gonna That's not a big problem, but indeed shows poor design of the driver and bindings. > to be more and more unreadable with scattered clock definitions. > > > Do you think it's acceptable to create a new header file instead? I This depends on the purpose of it. In general every SoC follows that concept - binding headers are per given clock controller, not even per SoC. > think we don't need a generic histb-clock.h. Each SoC should maintain > their own clock indexes header file. Maybe we can rename it to > hi3798cv200-clock.h and include it from a new histb-clock.h (also mark > this generic header file deprecated and only for hi3798cv200). Then I'll > create hi3798mv200-clock.h header file instead. So we don't have to > workaround this. Best regards, Krzysztof
diff --git a/include/dt-bindings/clock/histb-clock.h b/include/dt-bindings/clock/histb-clock.h index e64e5770ada6..68a53053586a 100644 --- a/include/dt-bindings/clock/histb-clock.h +++ b/include/dt-bindings/clock/histb-clock.h @@ -58,6 +58,27 @@ #define HISTB_USB3_UTMI_CLK1 48 #define HISTB_USB3_PIPE_CLK1 49 #define HISTB_USB3_SUSPEND_CLK1 50 +#define HISTB_SDIO1_BIU_CLK 51 +#define HISTB_SDIO1_CIU_CLK 52 +#define HISTB_SDIO1_DRV_CLK 53 +#define HISTB_SDIO1_SAMPLE_CLK 54 +#define HISTB_ETH0_PHY_CLK 55 +#define HISTB_ETH1_PHY_CLK 56 +#define HISTB_WDG0_CLK 57 +#define HISTB_USB2_UTMI0_CLK HISTB_USB2_UTMI_CLK +#define HISTB_USB2_UTMI1_CLK 58 +#define HISTB_USB3_REF_CLK 59 +#define HISTB_USB3_GM_CLK 60 +#define HISTB_USB3_GS_CLK 61 + +/* Hi3798MV200 specific clocks */ + +// reuse clocks of histb +#define HI3798MV200_GMAC_CLK HISTB_ETH0_MAC_CLK +#define HI3798MV200_GMACIF_CLK HISTB_ETH0_MACIF_CLK +#define HI3798MV200_FEMAC_CLK HISTB_ETH1_MAC_CLK +#define HI3798MV200_FEMACIF_CLK HISTB_ETH1_MACIF_CLK +#define HI3798MV200_FEPHY_CLK HISTB_ETH1_PHY_CLK /* clocks provided by mcu CRG */ #define HISTB_MCE_CLK 1