From patchwork Thu Feb 22 19:40:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Xiwen via B4 Relay X-Patchwork-Id: 205036 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp187099dyb; Thu, 22 Feb 2024 12:16:32 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXQwk3q6fVqSvt3sgBAofCZRUhVPnoI1yx6ESaCoBUIfos07Rjn6SF/OZM8lEAK5Tym2qQdAdOjpKHjSuGF+lU+dogZqA== X-Google-Smtp-Source: AGHT+IHkdVYHSSodTE/TNMRgYRq33hqFwPOzA6Wc4lDU10vyM/1tdQ2XY0vxQaAkYDiOzvidM3Zr X-Received: by 2002:a17:90b:3104:b0:299:4a62:548a with SMTP id gc4-20020a17090b310400b002994a62548amr17557624pjb.34.1708632992248; Thu, 22 Feb 2024 12:16:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708632992; cv=pass; d=google.com; s=arc-20160816; b=00BSJh6CFolonGFDjf4qYZcBTm30mfcjDg8/RdmbyRW1L6OktVJagwntlo4cOMJgbR v0PwtZmKLsf2bTqtcSiBAy5ncb2v4/YZVywUq5QwuIkb7vd++gNvnJOdIx6kwEsaFVk9 ouLdCqsNvkPP38ggyaaLZoBnsuewrfWIsYQO7uZpWteS1/QRiM9Xbo+TmwhR+ZGYoEyY qzMgHedFSCQtxsUNdcMRyYOHgCQXik5d5xPc4JobhpONng2DOQNzPSVa8z23GclxA9qC bw9A9h9bmtxurgjFaFT3+xw5tveFYguG6mdxW+Gykrb4K5Hi/b48ktz5KySzooO21oGr eAcQ== 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=629of4EViNXVbcTs1SDHYuRjb8VqyWuGZu+85ZT3wWY=; fh=DLO0P2PQ5CtomTdk1etlLUiRQEb9s0WDNKWTOXo9XHk=; b=cIbubdfKRkjvsj37rFjSt6c335BYry41ugrBLB00KMy6QI9hLWTpklJRNuUeTWVHio 5sqOwwG2dLoIsI1YuK/BnPwLOedHxY7TTXJI7n7vj7RAH7TPJzfA8PLAORBTZKM6T3Mx u0nS4DoRNX5cqciMxmI8rEcr3URojENF/jqo7F4b0Vp6YhAu3O0sR1B2BHGn+XRXMbmb aa33BOje5Acu0YNavRJ9ypDrQGAN1ay3T1OjZK702LLkEs/JS+zo7rQxt1sdmoWT+R53 cQIK6SgM5EGYMYGiMLFDe3MsV5x8KaE8BKe2QCK+NeoJDYnnmZO+tRDPyykDwrb8hzpE HsUQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DHB5GBya; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77270-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77270-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 4-20020a17090a08c400b002993c2454d6si10963115pjn.136.2024.02.22.12.16.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 12:16:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77270-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=DHB5GBya; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77270-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77270-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 C9E00B2BB91 for ; Thu, 22 Feb 2024 19:41:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA26973F0C; Thu, 22 Feb 2024 19:40:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DHB5GBya" 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 0CABD1DFD9; Thu, 22 Feb 2024 19:40:36 +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=1708630837; cv=none; b=MPz7x4T5BtBUY66ZyPmNntaNg2MKVR/tLV6hqBfr3lp8W086v8pcpqBHxudvVIJfRU8gFhdKn7oVkXpY7rmrHgaQ4s8jbsQ+HscXYWc5EIQNZikzIcqVRZ5xS4MN1CH2JpVfVy+zvwWOF77SFA9dHqcFU+sO8veuyW8i8gmtdhg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708630837; c=relaxed/simple; bh=Jxi0eH5d/wxrUnu4Tc7jAelZsPK6EWewjca31DP3sFU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ODD1P0C2CAUaPX8Y6FsnUaecROug8zG0WHRQ11Cc1NlLqktf9kFwhFHTKuS0C44BzIS3w+1QtunZtcPg+Dz4Nnmlip++s1D0MyuqvGdZDsp7pvH5lkG7OBj9Oi3V00/qDvt9HIxGCi6VEKFA0KpjrDipIczY0KP9YNJBJdSAz38= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DHB5GBya; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id A4EE6C433A6; Thu, 22 Feb 2024 19:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708630836; bh=Jxi0eH5d/wxrUnu4Tc7jAelZsPK6EWewjca31DP3sFU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=DHB5GBya/9yZoUDZMQB+Qp/Glf67aTncmzFpAbzBujvn1kU9Sl8vLOpGKbivEFYn+ P4YM9rmmt74HbvVuYpC4h2QgNrZFi6vD9mMpW1lYmYuKbCa1GFRaRVtoJAL3h05lmi ZrXJmPfNt4AW1Ku92SWl0Rf94qCbVsIRTEY29knWQSyLqApx7maeTHlMfzCz532FiU cCyAg6+tiv3uAmvZSY7ftx2TxoaztJTaOe45Ds6UDx/OPSFH9iJojPApAPplKAmYjs 3RG0u8S05K7q2kaA4dNMQRIIOHjIr/B5lcatBy85biNCzkOf/ZvUd1dWTx+pqUlw/W fBi4mWrVZwBFA== 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 87DDCC54E49; Thu, 22 Feb 2024 19:40:36 +0000 (UTC) From: Yang Xiwen via B4 Relay Date: Fri, 23 Feb 2024 03:40:12 +0800 Subject: [PATCH v4 2/7] dt-bindings: clock: histb-clock: split into two header files Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240223-clk-mv200-v4-2-3e37e501d407@outlook.com> References: <20240223-clk-mv200-v4-0-3e37e501d407@outlook.com> In-Reply-To: <20240223-clk-mv200-v4-0-3e37e501d407@outlook.com> To: 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, Yang Xiwen , Krzysztof Kozlowski X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708630834; l=6799; i=forbidden405@outlook.com; s=20230724; h=from:subject:message-id; bh=q6FKPdvaS6C7lfP0l8tnfTtASXs4iYngzwzghiX3fYg=; b=xsWP2baBK8ZgXG28WQqNTELicam4HcM3elw4A5PGCA3Gv5VBdzMbiRKehXQorgRns/mfmrBEf /+dVh8veghQCwiS4Gjp3+lCLsRlNwZ0LqqDWLm4kfpaiDycFl4/TU1O 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 Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791631548027788035 X-GMAIL-MSGID: 1791631548027788035 From: Yang Xiwen The CRG driver between different SoCs provides different clocks and resets. We should not provide a generic header file across all HiSTB SoCs, instead each CRG driver should provide its own. Split histb-clock.h into two files: hisilicon,hi3798cv200-crg.h and hisilicon,hi3798cv200-sysctrl.h. This header file is for Hi3798CV200 only actually. For other HiSTB SoCs, some clock definitions are missing. Create a new histb-clock.h to include these two files for backward compatibility only. Deprecate this file as well. Acked-by: Krzysztof Kozlowski Signed-off-by: Yang Xiwen --- .../dt-bindings/clock/hisilicon,hi3798cv200-crg.h | 62 +++++++++++++++++++ .../clock/hisilicon,hi3798cv200-sysctrl.h | 17 ++++++ include/dt-bindings/clock/histb-clock.h | 70 +++------------------- 3 files changed, 88 insertions(+), 61 deletions(-) diff --git a/include/dt-bindings/clock/hisilicon,hi3798cv200-crg.h b/include/dt-bindings/clock/hisilicon,hi3798cv200-crg.h new file mode 100644 index 000000000000..7cd8b5d053de --- /dev/null +++ b/include/dt-bindings/clock/hisilicon,hi3798cv200-crg.h @@ -0,0 +1,62 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Copyright (c) 2016 HiSilicon Technologies Co., Ltd. + */ + +#ifndef __DT_BINDINGS_CLOCK_HI3798CV200_CRG_H +#define __DT_BINDINGS_CLOCK_HI3798CV200_CRG_H + +/* clocks provided by core CRG */ +#define HISTB_OSC_CLK 0 +#define HISTB_APB_CLK 1 +#define HISTB_AHB_CLK 2 +#define HISTB_UART1_CLK 3 +#define HISTB_UART2_CLK 4 +#define HISTB_UART3_CLK 5 +#define HISTB_I2C0_CLK 6 +#define HISTB_I2C1_CLK 7 +#define HISTB_I2C2_CLK 8 +#define HISTB_I2C3_CLK 9 +#define HISTB_I2C4_CLK 10 +#define HISTB_I2C5_CLK 11 +#define HISTB_SPI0_CLK 12 +#define HISTB_SPI1_CLK 13 +#define HISTB_SPI2_CLK 14 +#define HISTB_SCI_CLK 15 +#define HISTB_FMC_CLK 16 +#define HISTB_MMC_BIU_CLK 17 +#define HISTB_MMC_CIU_CLK 18 +#define HISTB_MMC_DRV_CLK 19 +#define HISTB_MMC_SAMPLE_CLK 20 +#define HISTB_SDIO0_BIU_CLK 21 +#define HISTB_SDIO0_CIU_CLK 22 +#define HISTB_SDIO0_DRV_CLK 23 +#define HISTB_SDIO0_SAMPLE_CLK 24 +#define HISTB_PCIE_AUX_CLK 25 +#define HISTB_PCIE_PIPE_CLK 26 +#define HISTB_PCIE_SYS_CLK 27 +#define HISTB_PCIE_BUS_CLK 28 +#define HISTB_ETH0_MAC_CLK 29 +#define HISTB_ETH0_MACIF_CLK 30 +#define HISTB_ETH1_MAC_CLK 31 +#define HISTB_ETH1_MACIF_CLK 32 +#define HISTB_COMBPHY1_CLK 33 +#define HISTB_USB2_BUS_CLK 34 +#define HISTB_USB2_PHY_CLK 35 +#define HISTB_USB2_UTMI_CLK 36 +#define HISTB_USB2_12M_CLK 37 +#define HISTB_USB2_48M_CLK 38 +#define HISTB_USB2_OTG_UTMI_CLK 39 +#define HISTB_USB2_PHY1_REF_CLK 40 +#define HISTB_USB2_PHY2_REF_CLK 41 +#define HISTB_COMBPHY0_CLK 42 +#define HISTB_USB3_BUS_CLK 43 +#define HISTB_USB3_UTMI_CLK 44 +#define HISTB_USB3_PIPE_CLK 45 +#define HISTB_USB3_SUSPEND_CLK 46 +#define HISTB_USB3_BUS_CLK1 47 +#define HISTB_USB3_UTMI_CLK1 48 +#define HISTB_USB3_PIPE_CLK1 49 +#define HISTB_USB3_SUSPEND_CLK1 50 + +#endif /* __DT_BINDINGS_CLOCK_HI3798CV200_CRG_H */ diff --git a/include/dt-bindings/clock/hisilicon,hi3798cv200-sysctrl.h b/include/dt-bindings/clock/hisilicon,hi3798cv200-sysctrl.h new file mode 100644 index 000000000000..e908b30bb8ce --- /dev/null +++ b/include/dt-bindings/clock/hisilicon,hi3798cv200-sysctrl.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Copyright (c) 2016 HiSilicon Technologies Co., Ltd. + */ + +#ifndef __DT_BINDINGS_CLOCK_HI3798CV200_SYSCTRL_H +#define __DT_BINDINGS_CLOCK_HI3798CV200_SYSCTRL_H + +/* clocks provided by mcu CRG */ +#define HISTB_MCE_CLK 1 +#define HISTB_IR_CLK 2 +#define HISTB_TIMER01_CLK 3 +#define HISTB_LEDC_CLK 4 +#define HISTB_UART0_CLK 5 +#define HISTB_LSADC_CLK 6 + +#endif /* __DT_BINDINGS_CLOCK_HI3798CV200_SYSCTRL_H */ diff --git a/include/dt-bindings/clock/histb-clock.h b/include/dt-bindings/clock/histb-clock.h index e64e5770ada6..def617ebe852 100644 --- a/include/dt-bindings/clock/histb-clock.h +++ b/include/dt-bindings/clock/histb-clock.h @@ -1,70 +1,18 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ /* - * Copyright (c) 2016 HiSilicon Technologies Co., Ltd. + * DEPRECATED + * + * Each CRG driver should have its own clock number definitions header file. + * This file is only reserved for backward compatibility for Hi3798CV200 */ #ifndef __DTS_HISTB_CLOCK_H #define __DTS_HISTB_CLOCK_H -/* clocks provided by core CRG */ -#define HISTB_OSC_CLK 0 -#define HISTB_APB_CLK 1 -#define HISTB_AHB_CLK 2 -#define HISTB_UART1_CLK 3 -#define HISTB_UART2_CLK 4 -#define HISTB_UART3_CLK 5 -#define HISTB_I2C0_CLK 6 -#define HISTB_I2C1_CLK 7 -#define HISTB_I2C2_CLK 8 -#define HISTB_I2C3_CLK 9 -#define HISTB_I2C4_CLK 10 -#define HISTB_I2C5_CLK 11 -#define HISTB_SPI0_CLK 12 -#define HISTB_SPI1_CLK 13 -#define HISTB_SPI2_CLK 14 -#define HISTB_SCI_CLK 15 -#define HISTB_FMC_CLK 16 -#define HISTB_MMC_BIU_CLK 17 -#define HISTB_MMC_CIU_CLK 18 -#define HISTB_MMC_DRV_CLK 19 -#define HISTB_MMC_SAMPLE_CLK 20 -#define HISTB_SDIO0_BIU_CLK 21 -#define HISTB_SDIO0_CIU_CLK 22 -#define HISTB_SDIO0_DRV_CLK 23 -#define HISTB_SDIO0_SAMPLE_CLK 24 -#define HISTB_PCIE_AUX_CLK 25 -#define HISTB_PCIE_PIPE_CLK 26 -#define HISTB_PCIE_SYS_CLK 27 -#define HISTB_PCIE_BUS_CLK 28 -#define HISTB_ETH0_MAC_CLK 29 -#define HISTB_ETH0_MACIF_CLK 30 -#define HISTB_ETH1_MAC_CLK 31 -#define HISTB_ETH1_MACIF_CLK 32 -#define HISTB_COMBPHY1_CLK 33 -#define HISTB_USB2_BUS_CLK 34 -#define HISTB_USB2_PHY_CLK 35 -#define HISTB_USB2_UTMI_CLK 36 -#define HISTB_USB2_12M_CLK 37 -#define HISTB_USB2_48M_CLK 38 -#define HISTB_USB2_OTG_UTMI_CLK 39 -#define HISTB_USB2_PHY1_REF_CLK 40 -#define HISTB_USB2_PHY2_REF_CLK 41 -#define HISTB_COMBPHY0_CLK 42 -#define HISTB_USB3_BUS_CLK 43 -#define HISTB_USB3_UTMI_CLK 44 -#define HISTB_USB3_PIPE_CLK 45 -#define HISTB_USB3_SUSPEND_CLK 46 -#define HISTB_USB3_BUS_CLK1 47 -#define HISTB_USB3_UTMI_CLK1 48 -#define HISTB_USB3_PIPE_CLK1 49 -#define HISTB_USB3_SUSPEND_CLK1 50 +#warning "This header file is deprecated, include hisilicon,hi3798cv200-crg.h \ +and hisilicon,hi3798cv200-sysctrl.h directly instead" -/* clocks provided by mcu CRG */ -#define HISTB_MCE_CLK 1 -#define HISTB_IR_CLK 2 -#define HISTB_TIMER01_CLK 3 -#define HISTB_LEDC_CLK 4 -#define HISTB_UART0_CLK 5 -#define HISTB_LSADC_CLK 6 +#include "hisilicon,hi3798cv200-crg.h" +#include "hisilicon,hi3798cv200-sysctrl.h" -#endif /* __DTS_HISTB_CLOCK_H */ +#endif /* __DTS_HISTB_CLOCK_H */