Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1879827rdb; Tue, 20 Feb 2024 09:33:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXv+nX28fqUYQso78JSCqMH5Y55eRvIiaP2YpKufNQRZ5A3SeRx2+RDrOlhc+lsRUhZKliF9P97cpVM+jsL2VtkaOmD6rbSFzoRfackZA== X-Google-Smtp-Source: AGHT+IFqKS7yhRchZGTKWGN9sGzPbUbIPcLHrigeJyOk9PDNFSfSkk0YT++cIjWkB8XfcH1C2GWh X-Received: by 2002:a05:6359:459d:b0:176:543c:8ef0 with SMTP id no29-20020a056359459d00b00176543c8ef0mr12195247rwb.21.1708450433410; Tue, 20 Feb 2024 09:33:53 -0800 (PST) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id n27-20020a63721b000000b005d549553c07si6305146pgc.598.2024.02.20.09.33.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 09:33:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73444-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=Po82oNDX; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-73444-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73444-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 2911CB22DC6 for ; Tue, 20 Feb 2024 17:29:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8CDED77639; Tue, 20 Feb 2024 17:29:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b="Po82oNDX" Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01olkn2021.outbound.protection.outlook.com [40.92.107.21]) (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 54E2C692EB; Tue, 20 Feb 2024 17:29:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.92.107.21 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708450182; cv=fail; b=EpSSv48bwKAUgD3zRHEGZj6wNKsxIxUUbswaGbL5CQAQ9GimCAlMVASYu/g+QEVvFToWasQVbcUCjgAGxullw5f2UbZpopIgULkQmuwzrBj9/zUpo/qYOV/dLbF0p5hv78IgtK0uljL4tYf1SbiC5wJY23A+3bTZrvx73k3qASg= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708450182; c=relaxed/simple; bh=1IjbZEIqSXivjdqAAzC+3/+1gqEiRSvvVdW+92nnsb4=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=nR+/VcktUrORL4ESxOu4KyY+P+iDsW1qXBzDckLGLRVZOPWMrB9W4UXFLeZLi3hYiZw89BvthafBIJmn0k5r2vxJ2W5XaxJLMVjkgv6MQM3+sfqVzkOpoChqafKcnBM4cFrF4Cs3h1DjHY9gIb4XQQWpBvy/qiLM9mZTLLv2lYA= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com; spf=pass smtp.mailfrom=outlook.com; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b=Po82oNDX; arc=fail smtp.client-ip=40.92.107.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=outlook.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j66Vm4mxy9ejguHPj/yDje8eawaT3PwGhtpMO34DMxkEQ0NFvLeGCiYMScdUjoCpbirI7nKEvo1ezQohZu+NyZ0S3E7OHfaZPdLGtTrCGzHrLvVkuZ/QYBKKTMMKAU7QOExPeLc0lMtlMYIpuYvAWdfsLHaNw6HxY4aq7x1wH7DBlpC5OdZPYnT8TUhrhhZy26Moj6K9zthn9KNyiveCRGvkWBt+detsiF90Bu/UvcJfcuoDdNxKKT0dW3A/90s1Ignsl5iyAtvMdVELKEK6zDN6XAFgEzzBuF+KfaaY37Sp+Y8+aFizy+fhfiqzD3WytoGgbUW2Hto6f3r1rX3Ngg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HhcqT6r1fm5iFddPdJK65+4y9bv1OIbZIs4p2KjXUmE=; b=DoqW/QePOPRDzuRJFDrqCpXloddHTudwIoiTUR8VP4wcRRwL315j/QhtkmcTBCx/i3LBMQXISSOe4orohyIRyYCygWU23y7TPk84Dl14FCy4oDZvlumQFKltj/6gMSWHxzQMq8u21HEE+TQszj51/5fqRMZpEt4QH7JdyxZwBmkJFvMO8ySNScXPfrWz9B+dF4QDwQXeEeHVPH+oCaG84eEjGDoqOoX8M90cP8J0NxmVFJQhT/PBYuXShEkfRjhZsJzlcRoOYEdtA4cGBzHC2M2w5wu2RrnTKlMtize0vl91LaHaSq5UC7PqZofYP7+i56u4J9lS13CoEqhtcLocQQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HhcqT6r1fm5iFddPdJK65+4y9bv1OIbZIs4p2KjXUmE=; b=Po82oNDX35lwlXYHXzXhBg5/b4Ufpg4YSI4urkdVlaGsKJUgHiw2szHNwbJC+t1mu/ww883RC9FTsRufTSlQTvQW0DthPfDIWLRGPnUi4d4+Tjy0V3UVV286mUzDROPiUhrkB22dEwkzId2lTgCZhS5T6f3tcOXnisef7jAgCbzMI797Kwv/t86bOBFswAOj6rTFe13AWoEEyOa/MakUdDjBNOvTCDgsekZjVkFpqoycDmRGVtQ6ivYb5UAiCyWWVotpUwKHgnRflEhDGRw7PtB5gNqSrq2ZS/m54H6Ffq/AJodFrlDaWB0M3NPeU3MAs5uIJssJ0gUvNFo4fU0EJQ== Received: from SEZPR06MB6959.apcprd06.prod.outlook.com (2603:1096:101:1ed::14) by TYZPR06MB4221.apcprd06.prod.outlook.com (2603:1096:400:22::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.29; Tue, 20 Feb 2024 17:29:36 +0000 Received: from SEZPR06MB6959.apcprd06.prod.outlook.com ([fe80::53da:a8a:83cb:b9ad]) by SEZPR06MB6959.apcprd06.prod.outlook.com ([fe80::53da:a8a:83cb:b9ad%4]) with mapi id 15.20.7292.036; Tue, 20 Feb 2024 17:29:35 +0000 Message-ID: Date: Wed, 21 Feb 2024 01:29:31 +0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC v2 1/5] dt-bindings: clock: histb-clock: Add missing common clock and Hi3798MV200 specific clock definition Content-Language: en-US To: Krzysztof Kozlowski , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Yang , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240217-clk-mv200-v2-0-b782e4eb66f7@outlook.com> <20240217-clk-mv200-v2-1-b782e4eb66f7@outlook.com> <875b706f-801a-4a4c-8806-411a67c5a5e7@linaro.org> <90e0dc10-8514-4827-998f-15b4d45d874e@linaro.org> <3b6ab055-360b-4f73-8d11-8f52b272b7a8@linaro.org> From: Yang Xiwen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TMN: [9ZeCBuQHAV3fTHxBegHczuWryCx57HXJ+jbeftx7/9+4jZ5fKiSqb1QR2qbABgv9] X-ClientProxiedBy: PU1PR01CA0019.apcprd01.prod.exchangelabs.com (2603:1096:803:15::31) To SEZPR06MB6959.apcprd06.prod.outlook.com (2603:1096:101:1ed::14) X-Microsoft-Original-Message-ID: <025f8bd8-41f9-4214-8fc4-e718dee18b0e@outlook.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB6959:EE_|TYZPR06MB4221:EE_ X-MS-Office365-Filtering-Correlation-Id: 19f4e7e0-a790-442b-f083-08dc323981e0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yFFMGqezZaSmieGMvWhM4tuGOQCIBYcU+BAAMM5Go+/CAnluKCzC5aCDgLd+6nIIRNL6mz4XaBP5eXTKtt3vemDU9KSNsFZ9mb3OnsEUR/4MSeTl5MR1IaDKhNbWFzrgpsFGiv3E+y0dMoWgygsxoqTlBVgn6VsyuBJLRVDLzNqywOLqPX0Cxsfsxmdadqm9juccw1GIlf9nYbr4uQLsBp47/7E4NxWS2p6vyDK+p3hsztyuTE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MvT3ZpUzZRYzV4SVk3dmxzakxXTlh4MTFNYjRnNFlE?= =?utf-8?B?ZWtRYTA0K1FRZ2ZLWU1udlNiemtaa2pJODZOZ0hWZnQrSE41cjYyK1Z4WWxG?= =?utf-8?B?S2VjZ0xFZHhiTGgxNDZFTzJBMGlxdmZCZFN3RW85aDNtWmV5Ui95RHRPUUlq?= =?utf-8?B?OFEwUXNoNkJVUGxwQm9SZkhYaUdVVkVnWEpieGxlMVpyZ1F3cEl6MHBmYTQ5?= =?utf-8?B?Tm93NndaN3g1M0VMVW81d0F0TjM2NU1jeXZ3UHY3RFo1dXl4QnZOMkZIOUVF?= =?utf-8?Q?gRXNg/Z5QhrcI3WpBs5Qa4LARzTRXOcOrxeadNS?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 19f4e7e0-a790-442b-f083-08dc323981e0 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB6959.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2024 17:29:35.4805 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB4221 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 >>>>>>>> >>>>>>>> According to the datasheet, some clocks are missing, add their >>>>>>>> definitions first. >>>>>>>> >>>>>>>> Some aliases for hi3798mv200 are also introduced. >>>>>>>> >>>>>>>> Signed-off-by: Yang Xiwen >>>>>>>> --- >>>>>>>> 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 > -- Regards, Yang Xiwen