From nobody Sun Feb 8 11:41:14 2026 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 02F2D3815DE; Wed, 14 Jan 2026 10:05:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385136; cv=none; b=XjJm4qrmLB4aKzrTSfVBeqUnmPzMm7Mn3KNgznOyqIPmLJv6FlXW0JuAmW3MV1SLSrD7Y6h0Qgupm0JV5/gzQHxU9joAPC4MB9JusoMCRK3QIynUWRsd3lcBKvyVJIZhI0MtJEowvGTNv+ccD6/Bjxtmbs4k5dmA/yCKVveNfD4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385136; c=relaxed/simple; bh=cA1WEzcDbm7efcrQgvYNPjO2dtJx9V99HJRMolKapts=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HbGknmw5QdPLoMC97PK7EB4W+R14XBz3XHZsq8pM8ttQiVfsLzIpjZVwkKCLwXTG3+EfvBKTL072SqgZtaaxV0YJObv/mIvERrJ6QQp+eHyckCYIV3FEzrSSNvCHHnV+WUOn4agIdoDVNcCoW6xQ1w3FHOErtG6+4OgLajkm+tI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=KnnR5lvc; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="KnnR5lvc" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id C21271A285E; Wed, 14 Jan 2026 10:05:33 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 930286074A; Wed, 14 Jan 2026 10:05:33 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 92EB1103C89BA; Wed, 14 Jan 2026 11:05:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1768385132; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=Pp7EB6XLKCBlO59ZfIW1uTY7jsF8Ywjc+/oUh/iQFuY=; b=KnnR5lvcvoxFiGCBnrQ5MiiuUSPzpWjoodl2t6yGhkyEbeF2NeeN/L8ga3LEhLRlkmBu3s 34g7tcwnTL2dqJG3RMkjZ8qBgnue1/8akIF+bA1jnf4kvzXlB+1xF13wSu92qpjc0/yw4o h5x2nDYwIwk1RkPcS3pewdGqiCUp3YqwAakiERdQ9itDF+4B01+TIfzg2AbNpOL3cx4lkJ GvTBa0inrksfBqcrPpSTGOBD/ueIluunQOZDc63GTPYUJgQyUWhNP6wYA9Cg3zw2lFr0Bo 5W1nFlTaCVBYLaIiWVfFD2sy0lRHyQrogYyhXndWHWyKxcZCURBKloCG9iH4xQ== From: =?utf-8?q?Beno=C3=AEt_Monin?= Date: Wed, 14 Jan 2026 11:05:05 +0100 Subject: [PATCH v3 01/10] dt-bindings: soc: mobileye: Add EyeQ7H OLB Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260114-clk-eyeq7-v3-1-8ebdba7b0133@bootlin.com> References: <20260114-clk-eyeq7-v3-0-8ebdba7b0133@bootlin.com> In-Reply-To: <20260114-clk-eyeq7-v3-0-8ebdba7b0133@bootlin.com> To: Vladimir Kondratiev , Gregory CLEMENT , =?utf-8?q?Th=C3=A9o_Lebrun?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , Philipp Zabel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: Thomas Petazzoni , Tawfik Bayouk , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-mips@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Monin?= , Krzysztof Kozlowski X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 The Other Logic Blocks (OLB) found in Mobileye SoCs contain hardware sub-functions grouped in a logical device. The EyeQ7H features 14 such OLB. The main differences with the previous generation of SoC are that some blocks have two clock sources instead of one and that the clock source can be the one of the clock output of another OLB instead of the main oscillator. For the blocks with a single parent clock, the name of that clock is "ref", similar to what is done for the OLB of the previous SoC. The blocks with two parent clocks use either "ref" for the main oscillator, "ref_100p0" for a 100MHz reference clock or "ref_106p6" for 106.6MHz reference clock. Some OLB also contain a reset controller with one or more reset domain, like the blocks found in the EyeQ6H. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Beno=C3=AEt Monin --- .../bindings/soc/mobileye/mobileye,eyeq7h-olb.yaml | 192 +++++++++++++++++= ++++ include/dt-bindings/clock/mobileye,eyeq7h-clk.h | 119 +++++++++++++ 2 files changed, 311 insertions(+) diff --git a/Documentation/devicetree/bindings/soc/mobileye/mobileye,eyeq7h= -olb.yaml b/Documentation/devicetree/bindings/soc/mobileye/mobileye,eyeq7h-= olb.yaml new file mode 100644 index 000000000000..2958ca9e330b --- /dev/null +++ b/Documentation/devicetree/bindings/soc/mobileye/mobileye,eyeq7h-olb.ya= ml @@ -0,0 +1,192 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/mobileye/mobileye,eyeq7h-olb.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Mobileye EyeQ7H SoC system controller + +maintainers: + - Beno=C3=AEt Monin + - Gr=C3=A9gory Clement + - Th=C3=A9o Lebrun + - Vladimir Kondratiev + +description: + OLB ("Other Logic Block") is a hardware system controller grouping + smaller blocks. Clocks and resets are generated by those blocks and + used by internal controllers of the SoC. The EyeQ7H SoC hosts 14 + different OLB. + +properties: + compatible: + items: + - enum: + - mobileye,eyeq7h-acc0-olb + - mobileye,eyeq7h-acc1-olb + - mobileye,eyeq7h-ddr0-olb + - mobileye,eyeq7h-ddr1-olb + - mobileye,eyeq7h-east-olb + - mobileye,eyeq7h-mips0-olb + - mobileye,eyeq7h-mips1-olb + - mobileye,eyeq7h-mips2-olb + - mobileye,eyeq7h-periph-east-olb + - mobileye,eyeq7h-periph-west-olb + - mobileye,eyeq7h-south-olb + - mobileye,eyeq7h-west-olb + - mobileye,eyeq7h-xnn0-olb + - mobileye,eyeq7h-xnn1-olb + - const: syscon + + reg: + maxItems: 1 + + '#reset-cells': + description: + First cell is domain and optional if compatible has a single reset d= omain. + Second cell is reset index inside that domain. + enum: [ 1, 2 ] + + '#clock-cells': + const: 1 + + clocks: + minItems: 1 + maxItems: 2 + + clock-names: + minItems: 1 + maxItems: 2 + +required: + - compatible + - reg + - '#clock-cells' + - clocks + - clock-names + +allOf: + - if: + properties: + compatible: + contains: + enum: + - mobileye,eyeq7h-ddr0-olb + - mobileye,eyeq7h-ddr1-olb + - mobileye,eyeq7h-mips0-olb + - mobileye,eyeq7h-mips1-olb + - mobileye,eyeq7h-mips2-olb + - mobileye,eyeq7h-periph-east-olb + - mobileye,eyeq7h-south-olb + then: + properties: + clocks: + items: + - description: Reference input clock. + clock-names: + items: + - const: ref + + - if: + properties: + compatible: + contains: + enum: + - mobileye,eyeq7h-east-olb + - mobileye,eyeq7h-west-olb + then: + properties: + clocks: + items: + - description: Reference input clock from the main oscillator. + - description: 100MHz reference input clock. + clock-names: + items: + - const: ref + - const: ref_100p0 + + - if: + properties: + compatible: + contains: + enum: + - mobileye,eyeq7h-acc0-olb + - mobileye,eyeq7h-acc1-olb + - mobileye,eyeq7h-periph-west-olb + - mobileye,eyeq7h-xnn0-olb + - mobileye,eyeq7h-xnn1-olb + then: + properties: + clocks: + items: + - description: 100MHz reference input clock. + - description: 106.6MHz reference input clock. + clock-names: + items: + - const: ref_100p0 + - const: ref_106p6 + + - if: + properties: + compatible: + contains: + enum: + - mobileye,eyeq7h-ddr0-olb + - mobileye,eyeq7h-ddr1-olb + - mobileye,eyeq7h-east-olb + - mobileye,eyeq7h-periph-east-olb + - mobileye,eyeq7h-periph-west-olb + - mobileye,eyeq7h-west-olb + then: + properties: + '#reset-cells': + const: 1 + required: + - '#reset-cells' + + - if: + properties: + compatible: + contains: + enum: + - mobileye,eyeq7h-acc0-olb + - mobileye,eyeq7h-acc1-olb + - mobileye,eyeq7h-south-olb + - mobileye,eyeq7h-xnn0-olb + - mobileye,eyeq7h-xnn1-olb + then: + properties: + '#reset-cells': + const: 2 + required: + - '#reset-cells' + + - if: + properties: + compatible: + contains: + enum: + - mobileye,eyeq7h-mips0-olb + - mobileye,eyeq7h-mips1-olb + - mobileye,eyeq7h-mips2-olb + then: + properties: + '#reset-cells': false + +additionalProperties: false + +examples: + - | + soc { + #address-cells =3D <2>; + #size-cells =3D <2>; + + system-controller0@45000000 { + compatible =3D "mobileye,eyeq7h-acc0-olb", "syscon"; + reg =3D <0x0 0x45000000 0x0 0x1000>; + #reset-cells =3D <2>; + #clock-cells =3D <1>; + clocks =3D <&olb_south 7>, <&olb_east 5>; + clock-names =3D "ref_100p0", "ref_106p6"; + }; + }; diff --git a/include/dt-bindings/clock/mobileye,eyeq7h-clk.h b/include/dt-b= indings/clock/mobileye,eyeq7h-clk.h new file mode 100644 index 000000000000..76e06a0abd02 --- /dev/null +++ b/include/dt-bindings/clock/mobileye,eyeq7h-clk.h @@ -0,0 +1,119 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ +/* + * Copyright (C) 2025 Mobileye Vision Technologies Ltd. + */ + +#ifndef _DT_BINDINGS_CLOCK_MOBILEYE_EYEQ7H_CLK_H +#define _DT_BINDINGS_CLOCK_MOBILEYE_EYEQ7H_CLK_H + +/* ACC0 and ACC1 OLBs PLL and dividers */ +#define EQ7HC_ACC_PLL_VMP 0 +#define EQ7HC_ACC_PLL_MPC 1 +#define EQ7HC_ACC_PLL_PMA 2 +#define EQ7HC_ACC_PLL_NOC 3 +#define EQ7HC_ACC_DIV_PMA 4 +#define EQ7HC_ACC_DIV_NCORE 5 +#define EQ7HC_ACC_DIV_CFG 6 + +/* DDR0 and DDR1 OLBs PLL and dividers */ +#define EQ7HC_DDR_PLL 0 +#define EQ7HC_DDR_DIV_APB 1 +#define EQ7HC_DDR_DIV_PLLREF 2 +#define EQ7HC_DDR_DIV_DFI 3 + +/* east OLB PLL and dividers */ +#define EQ7HC_EAST_PLL_106P6 0 +#define EQ7HC_EAST_DIV_REF_106P6 1 +#define EQ7HC_EAST_PLL_NOC 2 +#define EQ7HC_EAST_PLL_ISP 3 +#define EQ7HC_EAST_PLL_VEU 4 +#define EQ7HC_EAST_DIV_REF_DDR_PHY 5 +#define EQ7HC_EAST_DIV_CORE 6 +#define EQ7HC_EAST_DIV_CORE_MBIST 7 +#define EQ7HC_EAST_DIV_ISRAM_MBIST 8 +#define EQ7HC_EAST_DIV_CFG 9 +#define EQ7HC_EAST_DIV_VEU_CORE 10 +#define EQ7HC_EAST_DIV_VEU_MBIST 11 +#define EQ7HC_EAST_DIV_VEU_OCP 12 +#define EQ7HC_EAST_DIV_LBITS 13 +#define EQ7HC_EAST_DIV_ISP0_CORE 14 + +/* MIPS0, MIPS1 and MIPS2 OLBs PLL and dividers */ +#define EQ7HC_MIPS_PLL_CPU 0 +#define EQ7HC_MIPS_DIV_CM 1 + +/* periph east OLB PLL and dividers */ +#define EQ7HC_PERIPH_EAST_PLL_PER 0 +#define EQ7HC_PERIPH_EAST_DIV_PER 1 + +/* periph west OLB PLL and dividers */ +#define EQ7HC_PERIPH_WEST_PLL_PER 0 +#define EQ7HC_PERIPH_WEST_PLL_I2S 1 +#define EQ7HC_PERIPH_WEST_DIV_PER 2 +#define EQ7HC_PERIPH_WEST_DIV_I2S 3 + +/* south OLB PLL and dividers */ +#define EQ7HC_SOUTH_PLL_100P0 0 +#define EQ7HC_SOUTH_DIV_REF_100P0 1 +#define EQ7HC_SOUTH_PLL_XSPI 2 +#define EQ7HC_SOUTH_PLL_VDIO 3 +#define EQ7HC_SOUTH_PLL_PER 4 +#define EQ7HC_SOUTH_DIV_VDO_DSI_SYS 5 +#define EQ7HC_SOUTH_DIV_PMA_CMN_REF 6 +#define EQ7HC_SOUTH_DIV_REF_UFS 7 +#define EQ7HC_SOUTH_DIV_XSPI_SYS 8 +#define EQ7HC_SOUTH_DIV_XSPI_MBIST 9 +#define EQ7HC_SOUTH_DIV_NOC_S 10 +#define EQ7HC_SOUTH_DIV_PCIE_SYS 11 +#define EQ7HC_SOUTH_DIV_PCIE_SYS_MBIST 12 +#define EQ7HC_SOUTH_DIV_PCIE_GBE_PHY 13 +#define EQ7HC_SOUTH_DIV_UFS_CORE 14 +#define EQ7HC_SOUTH_DIV_UFS_SMS 15 +#define EQ7HC_SOUTH_DIV_UFS_ROM_SMS 16 +#define EQ7HC_SOUTH_DIV_ETH_SYS 17 +#define EQ7HC_SOUTH_DIV_ETH_MBIST 18 +#define EQ7HC_SOUTH_DIV_CFG_S 19 +#define EQ7HC_SOUTH_DIV_TSU 20 +#define EQ7HC_SOUTH_DIV_VDIO 21 +#define EQ7HC_SOUTH_DIV_VDIO_CORE 22 +#define EQ7HC_SOUTH_DIV_VDIO_CORE_MBIST 23 +#define EQ7HC_SOUTH_DIV_VDO_CORE_MBIST 24 +#define EQ7HC_SOUTH_DIV_VDO_P 25 +#define EQ7HC_SOUTH_DIV_VDIO_CFG 26 +#define EQ7HC_SOUTH_DIV_VDIO_TXCLKESC 27 + +/* west OLB PLL and dividers */ +#define EQ7HC_WEST_PLL_106P6 0 +#define EQ7HC_WEST_DIV_REF_106P6 1 +#define EQ7HC_WEST_PLL_NOC 2 +#define EQ7HC_WEST_PLL_GPU 3 +#define EQ7HC_WEST_PLL_SSI 4 +#define EQ7HC_WEST_DIV_GPU 5 +#define EQ7HC_WEST_DIV_GPU_MBIST 6 +#define EQ7HC_WEST_DIV_LBITS 7 +#define EQ7HC_WEST_DIV_MIPS_TIMER 8 +#define EQ7HC_WEST_DIV_SSI_CORE 9 +#define EQ7HC_WEST_DIV_SSI_CORE_MBIST 10 +#define EQ7HC_WEST_DIV_SSI_ROM 11 +#define EQ7HC_WEST_DIV_SSI_ROM_MBIST 12 +#define EQ7HC_WEST_DIV_REF_DDR_PHY 13 +#define EQ7HC_WEST_DIV_CORE 14 +#define EQ7HC_WEST_DIV_CORE_MBIST 15 +#define EQ7HC_WEST_DIV_CFG 16 +#define EQ7HC_WEST_DIV_CAU 17 +#define EQ7HC_WEST_DIV_CAU_MBIST 18 + +/* XNN0 and XNN1 OLBs PLL and dividers */ +#define EQ7HC_XNN_PLL_XNN0 0 +#define EQ7HC_XNN_PLL_XNN1 1 +#define EQ7HC_XNN_PLL_XNN2 2 +#define EQ7HC_XNN_PLL_CLSTR 3 +#define EQ7HC_XNN_DIV_XNN0 4 +#define EQ7HC_XNN_DIV_XNN1 5 +#define EQ7HC_XNN_DIV_XNN2 6 +#define EQ7HC_XNN_DIV_CLSTR 7 +#define EQ7HC_XNN_DIV_I2 8 +#define EQ7HC_XNN_DIV_I2_SMS 9 +#define EQ7HC_XNN_DIV_CFG 10 + +#endif --=20 2.52.0 From nobody Sun Feb 8 11:41:14 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 0D1D838A703; Wed, 14 Jan 2026 10:05:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385139; cv=none; b=PY4AZSlqe6/D9ryihiRa6pQTihjTmRcoXaxeOn9e8xcTu+kcrCglSln6kHM7G55HcWV94PjMgEB3Wz9ZzH0zVVVcdL9ZymqmSfLAQwTVZSlhsJ5vRVwzmcWiPM3DfloxKsFvRSvbteX+kf+V007lNtndfANGSdFQYbGWZSMtzg4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385139; c=relaxed/simple; bh=m4G5maSbzGyX8r1heCvQ8Ic/iCduEpxuClnuy1t3j4E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RhueCv5cfjOwpdewTKkE/0R4hoJc6KEGTAcwbzWHoU0b++YkLhor7PtqlPCp4LJ3LUBRsP70YQbpU7bI/QW2LyQZZcufRzNnzvWZu68WRDPnyfCLsu2MbuInti20TGiVraiHipRZgdDqArB7dFIrTK8rTiNy4pFFJ7dDJzGu4kE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=UFwHGOUj; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="UFwHGOUj" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 1991CC1F1C3; Wed, 14 Jan 2026 10:05:09 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id B0E666074A; Wed, 14 Jan 2026 10:05:35 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id C569B103C89C2; Wed, 14 Jan 2026 11:05:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1768385134; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=lFlZihqeUTC2MwC0VkH2enbRZ4VRiTf9eGKAYdM5pD8=; b=UFwHGOUjeISnb+umPOUQWZs+1lPOrsyc4qnrBqXSfYyIdOtRSYZlpQLdGNFAK0crex4NyI Nk9MGtu+WgKta9YMqlh6fnR4ZAJfKO7QHDnzGxwcxowHV2tv4+HOwpCLPYIl+achw7mDm8 Rs0K/Le62SCNcNc8o1nZ7shmcd0vl/Nuvl5L2CZnDHQVrdm3ZKpRW5xDm4L18AnIvdpr05 mLapNOBoa6sEW89giG+P6PkQOydr8w2wZC1Wr6hF+yAyHczV8m2MUmhhIgtb/M7iBIS0S7 sLANgDYEiznXsuWDMeUhYJO1q+Pe6RQgpfkESebO+1nb6av+rnzFAJrTHqDRXA== From: =?utf-8?q?Beno=C3=AEt_Monin?= Date: Wed, 14 Jan 2026 11:05:06 +0100 Subject: [PATCH v3 02/10] reset: eyeq: Add EyeQ7H compatibles Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260114-clk-eyeq7-v3-2-8ebdba7b0133@bootlin.com> References: <20260114-clk-eyeq7-v3-0-8ebdba7b0133@bootlin.com> In-Reply-To: <20260114-clk-eyeq7-v3-0-8ebdba7b0133@bootlin.com> To: Vladimir Kondratiev , Gregory CLEMENT , =?utf-8?q?Th=C3=A9o_Lebrun?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , Philipp Zabel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: Thomas Petazzoni , Tawfik Bayouk , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-mips@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Monin?= , Sari Khoury X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Add support for the reset controllers found in the EyeQ7H OLB. For this, three new types of reset domain are added to the driver. The EQR_EYEQ7H_ACRP reset domain is similar to the EQR_EYEQ5_ACRP domain, sharing the same register address calculation but featuring a different register layout. When writing to the register, MBIST bits are set to zero to ensure normal device operation. The EQR_EYEQ7H_CFG reset domain is similar to the EQR_EYEQ5_PCIE domain, with two bits per device instead of one. These two bits, clock enable and nreset, are kept in sync when asserting and deasserting the device reset. The EQR_EYEQ7H_ACC reset domain is similar to the EQR_EYEQ6H_SARCR domain, with a different registers layout and no busy waiting. Alongside these new reset domains, add EQR_NB_DOM_TYPES at the end of the eqr_domain_type enumeration and use it to declare the eqr_timings array. This ensures that we have the expected number of entries when using the timings in eqr_busy_wait_locked(). Add and order the auxiliary_device_id entries in eqr_id_table. Originally-by: Sari Khoury Signed-off-by: Beno=C3=AEt Monin --- drivers/reset/reset-eyeq.c | 268 +++++++++++++++++++++++++++++++++++++++++= ++-- 1 file changed, 259 insertions(+), 9 deletions(-) diff --git a/drivers/reset/reset-eyeq.c b/drivers/reset/reset-eyeq.c index 791b7283111e..9c396fe7f48c 100644 --- a/drivers/reset/reset-eyeq.c +++ b/drivers/reset/reset-eyeq.c @@ -1,10 +1,11 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Reset driver for the Mobileye EyeQ5, EyeQ6L and EyeQ6H platforms. + * Reset driver for the Mobileye EyeQ5, EyeQ6L, EyeQ6H and EyeQ7H platform= s. * * Controllers live in a shared register region called OLB. EyeQ5 and EyeQ= 6L * have a single OLB instance for a single reset controller. EyeQ6H has se= ven - * OLB instances; three host reset controllers. + * OLB instances; three host reset controllers. EyeQ7H has fourteen OLB in= stances; + * eleven host reset controllers. * * Each reset controller has one or more domain. Domains are of a given ty= pe * (see enum eqr_domain_type), with a valid offset mask (up to 32 resets p= er @@ -73,6 +74,40 @@ * 9. PMA0 10. PMA1 11. MPC0 12. MPC1 * 13. MPC2 14. MPC3 15. PERIPH * + * Known resets in EyeQ7H acc domain 0 (type EQR_EYEQ7H_ACRP) + * 1. VMP0 2. XVMP1 3. VMP2 4. VMP3 + * 5. MPC0 6. MPC1 7. PMA0 8. PMA1 + * + * Known resets in EyeQ7H acc domain 1 (type EQR_EYEQ7H_ACC) + * 1. NCORE0 2. NCORE1 3. NCORE0_M 4. NCORE1_M + * 5. NCORE_NOC 6. VMP_NOC 7. MPC_NOC 8. PMA_NOC + * + * Known resets in EyeQ7H ddr (type EQR_EYEQ7H_CFG) + * 0. APB 2. DMI 3. DFI 4. PHY_SMS + * 5. CTL_SMS + * + * Known resets in EyeQ7H east (type EQR_EYEQ7H_CFG) + * 0. ISP 2. VEU 3. LBIST + * + * Known resets in EyeQ7H periph (type EQR_EYEQ6H_SARCR) + * 0. gpio 1.EXT TIMER 3.UART 4. SPI + * 5. I2C0 6. I2C1 7.I2C2 8. I2S + * + * Known resets in EyeQ7H south (type EQR_EYEQ7H_CFG) + * 0. PCI_PHY 1. PCI_CTL 2. S_NOC 3. GBE_PHY + * 4. GBE_CTL 5. XSPI 6. UFS 7. VDIO + * + * Known resets in EyeQ7H west (type EQR_EYEQ7H_CFG) + * 0. GPU 2. CAU 3. LBIST 4. GPU_LBIST + * + * Known resets in EyeQ7H xnn domain 0 (type EQR_EYEQ7H_ACRP) + * 1. XNN0 2. XNN1 3.XNN2 + * + * Known resets in EyeQ7H xnn domain 1 (type EQR_EYEQ7H_ACC) + * 1. XNN0 2. XNN1 3. XNN2 4. XNN3 + * 5. NCORE 6. I2_0 7. I2_1 8. SMS_0 + * 9. SMS_1 + * * Abbreviations: * - PMA: Programmable Macro Array * - MPC: Multi-threaded Processing Clusters @@ -114,6 +149,11 @@ enum eqr_domain_type { EQR_EYEQ5_ACRP, EQR_EYEQ5_PCIE, EQR_EYEQ6H_SARCR, + EQR_EYEQ7H_ACC, + EQR_EYEQ7H_ACRP, + EQR_EYEQ7H_CFG, + + EQR_NB_DOM_TYPES /* number of domain types, keep at the end */ }; =20 /* @@ -138,16 +178,34 @@ enum eqr_domain_type { #define EQR_EYEQ6H_SARCR_RST_STATUS (0x008) #define EQR_EYEQ6H_SARCR_CLK_REQUEST (0x00C) =20 +/* + * Domain type EQR_EYEQ7H_ACC register offsets. + */ +#define EQR_EYEQ7H_ACC_CLK_EN (0x000) +#define EQR_EYEQ7H_ACC_RST_EN (0x004) + +/* + * Domain type EQR_EYEQ7H_ACRP register masks. + * Registers are: base + 4 * offset. + */ +#define EQR_EYEQ7H_ACRP_PD_REQ BIT(0) +#define EQR_EYEQ7H_ACRP_MBIST_CFG GENMASK(3, 1) +#define EQR_EYEQ7H_ACRP_ST_POWER_DOWN BIT(13) +#define EQR_EYEQ7H_ACRP_ST_ACTIVE BIT(14) + struct eqr_busy_wait_timings { unsigned long sleep_us; unsigned long timeout_us; }; =20 -static const struct eqr_busy_wait_timings eqr_timings[] =3D { +static const struct eqr_busy_wait_timings eqr_timings[EQR_NB_DOM_TYPES] = =3D { [EQR_EYEQ5_SARCR] =3D {1, 10}, [EQR_EYEQ5_ACRP] =3D {1, 40 * USEC_PER_MSEC}, /* LBIST implies long timeo= ut. */ /* EQR_EYEQ5_PCIE does no busy waiting. */ [EQR_EYEQ6H_SARCR] =3D {1, 400}, + /* EQR_EYEQ7H_ACC does no busy waiting. */ + [EQR_EYEQ7H_ACRP] =3D {1, 40 * USEC_PER_MSEC}, + /* EQR_EYEQ7H_CFG does no busy waiting. */ }; =20 #define EQR_MAX_DOMAIN_COUNT 3 @@ -221,10 +279,6 @@ static int eqr_busy_wait_locked(struct eqr_private *pr= iv, struct device *dev, sleep_us, timeout_us); break; =20 - case EQR_EYEQ5_PCIE: - ret =3D 0; /* No busy waiting. */ - break; - case EQR_EYEQ6H_SARCR: /* * Wait until both bits change: @@ -241,6 +295,23 @@ static int eqr_busy_wait_locked(struct eqr_private *pr= iv, struct device *dev, &rst_status, &clk_status); break; =20 + case EQR_EYEQ7H_ACRP: + reg =3D base + 4 * offset; + if (assert) + mask =3D EQR_EYEQ7H_ACRP_ST_POWER_DOWN; + else + mask =3D EQR_EYEQ7H_ACRP_ST_ACTIVE; + + ret =3D readl_poll_timeout(reg, val, !!(val & mask), + sleep_us, timeout_us); + break; + + case EQR_EYEQ5_PCIE: + case EQR_EYEQ7H_ACC: + case EQR_EYEQ7H_CFG: + ret =3D 0; /* No busy waiting. */ + break; + default: WARN_ON(1); ret =3D -EINVAL; @@ -285,6 +356,28 @@ static void eqr_assert_locked(struct eqr_private *priv= , u32 domain, u32 offset) writel(val, base + EQR_EYEQ6H_SARCR_CLK_REQUEST); break; =20 + case EQR_EYEQ7H_ACC: + /* RST_REQUEST and CLK_REQUEST must be kept in sync. */ + val =3D readl(base + EQR_EYEQ7H_ACC_RST_EN); + val &=3D ~BIT(offset); + writel(val, base + EQR_EYEQ7H_ACC_RST_EN); + writel(val, base + EQR_EYEQ7H_ACC_CLK_EN); + break; + + case EQR_EYEQ7H_ACRP: + /* set powerdown and leave MBIST bits at zero */ + reg =3D base + 4 * offset; + val =3D readl(reg) & ~EQR_EYEQ7H_ACRP_MBIST_CFG; + writel(val | EQR_EYEQ7H_ACRP_PD_REQ, reg); + break; + + case EQR_EYEQ7H_CFG: + /* clear clock enable and NRESET bits */ + val =3D readl(base); + val &=3D ~GENMASK(2 * offset + 1, 2 * offset); + writel(val, base); + break; + default: WARN_ON(1); break; @@ -339,6 +432,28 @@ static void eqr_deassert_locked(struct eqr_private *pr= iv, u32 domain, writel(val, base + EQR_EYEQ6H_SARCR_CLK_REQUEST); break; =20 + case EQR_EYEQ7H_ACC: + /* RST_REQUEST and CLK_REQUEST must be kept in sync. */ + val =3D readl(base + EQR_EYEQ7H_ACC_RST_EN); + val |=3D BIT(offset); + writel(val, base + EQR_EYEQ7H_ACC_RST_EN); + writel(val, base + EQR_EYEQ7H_ACC_CLK_EN); + break; + + case EQR_EYEQ7H_ACRP: + /* clear powerdown and leave MBIST bits at zero */ + reg =3D base + 4 * offset; + val =3D readl(reg) & ~EQR_EYEQ7H_ACRP_MBIST_CFG; + writel(val & ~EQR_EYEQ7H_ACRP_PD_REQ, reg); + break; + + case EQR_EYEQ7H_CFG: + /* set clock enable and NRESET bits */ + val =3D readl(base); + val |=3D GENMASK(2 * offset + 1, 2 * offset); + writel(val, base); + break; + default: WARN_ON(1); break; @@ -385,6 +500,14 @@ static int eqr_status(struct reset_controller_dev *rcd= ev, unsigned long id) case EQR_EYEQ6H_SARCR: reg =3D base + EQR_EYEQ6H_SARCR_RST_STATUS; return !(readl(reg) & BIT(offset)); + case EQR_EYEQ7H_ACC: + reg =3D base + EQR_EYEQ7H_ACC_RST_EN; + return !(readl(reg) & BIT(offset)); + case EQR_EYEQ7H_ACRP: + reg =3D base + 4 * offset; + return !(readl(reg) & EQR_EYEQ7H_ACRP_ST_ACTIVE); + case EQR_EYEQ7H_CFG: + return !(readl(base) & BIT(2 * offset)); default: return -EINVAL; } @@ -578,6 +701,113 @@ static const struct eqr_match_data eqr_eyeq6h_acc_dat= a =3D { .domains =3D eqr_eyeq6h_acc_domains, }; =20 +static const struct eqr_domain_descriptor eqr_eyeq7h_acc_domains[] =3D { + { + .type =3D EQR_EYEQ7H_ACRP, + .valid_mask =3D 0xFF, + .offset =3D 0x000, + }, + { + .type =3D EQR_EYEQ7H_ACC, + .valid_mask =3D 0xFF, + .offset =3D 0x060, + }, +}; + +static const struct eqr_match_data eqr_eyeq7h_acc_data =3D { + .domain_count =3D ARRAY_SIZE(eqr_eyeq7h_acc_domains), + .domains =3D eqr_eyeq7h_acc_domains, +}; + +static const struct eqr_domain_descriptor eqr_eyeq7h_ddr_domains[] =3D { + { + .type =3D EQR_EYEQ7H_ACRP, + .valid_mask =3D 0x1F, + .offset =3D 0x008, + }, +}; + +static const struct eqr_match_data eqr_eyeq7h_ddr_data =3D { + .domain_count =3D ARRAY_SIZE(eqr_eyeq7h_ddr_domains), + .domains =3D eqr_eyeq7h_ddr_domains, +}; + +static const struct eqr_domain_descriptor eqr_eyeq7h_east_domains[] =3D { + { + .type =3D EQR_EYEQ7H_CFG, + .valid_mask =3D 0x7, + .offset =3D 0x060, + }, +}; + +static const struct eqr_match_data eqr_eyeq7h_east_data =3D { + .domain_count =3D ARRAY_SIZE(eqr_eyeq7h_east_domains), + .domains =3D eqr_eyeq7h_east_domains, +}; + +/* Periph OLBs each have an instance. */ +static const struct eqr_domain_descriptor eqr_eyeq7h_per_domains[] =3D { + { + .type =3D EQR_EYEQ6H_SARCR, + .valid_mask =3D 0xFF, + .offset =3D 0x030, + }, +}; + +static const struct eqr_match_data eqr_eyeq7h_per_data =3D { + .domain_count =3D ARRAY_SIZE(eqr_eyeq7h_per_domains), + .domains =3D eqr_eyeq7h_per_domains, +}; + +static const struct eqr_domain_descriptor eqr_eyeq7h_south_domains[] =3D { + { + .type =3D EQR_EYEQ7H_CFG, + .valid_mask =3D 0x1F, + .offset =3D 0x070, + }, + { + .type =3D EQR_EYEQ7H_CFG, + .valid_mask =3D 0x7, + .offset =3D 0x074, + }, +}; + +static const struct eqr_match_data eqr_eyeq7h_south_data =3D { + .domain_count =3D ARRAY_SIZE(eqr_eyeq7h_south_domains), + .domains =3D eqr_eyeq7h_south_domains, +}; + +static const struct eqr_domain_descriptor eqr_eyeq7h_west_domains[] =3D { + { + .type =3D EQR_EYEQ7H_CFG, + .valid_mask =3D 0xf, + .offset =3D 0x068, + }, +}; + +static const struct eqr_match_data eqr_eyeq7h_west_data =3D { + .domain_count =3D ARRAY_SIZE(eqr_eyeq7h_west_domains), + .domains =3D eqr_eyeq7h_west_domains, +}; + +static const struct eqr_domain_descriptor eqr_eyeq7h_xnn_domains[] =3D { + { + .type =3D EQR_EYEQ7H_ACRP, + .valid_mask =3D 0x7, + .offset =3D 0x000, + }, + { + .type =3D EQR_EYEQ7H_ACC, + .valid_mask =3D 0x1FF, + .offset =3D 0x060, + }, +}; + +static const struct eqr_match_data eqr_eyeq7h_xnn_data =3D { + .domain_count =3D ARRAY_SIZE(eqr_eyeq7h_xnn_domains), + .domains =3D eqr_eyeq7h_xnn_domains, +}; + /* * Table describes OLB system-controller compatibles. * It does not get used to match against devicetree node. @@ -589,15 +819,35 @@ static const struct of_device_id eqr_match_table[] = =3D { { .compatible =3D "mobileye,eyeq6h-west-olb", .data =3D &eqr_eyeq6h_we_da= ta }, { .compatible =3D "mobileye,eyeq6h-east-olb", .data =3D &eqr_eyeq6h_we_da= ta }, { .compatible =3D "mobileye,eyeq6h-acc-olb", .data =3D &eqr_eyeq6h_acc_da= ta }, + { .compatible =3D "mobileye,eyeq7h-acc0-olb", .data =3D &eqr_eyeq7h_acc_d= ata }, + { .compatible =3D "mobileye,eyeq7h-acc1-olb", .data =3D &eqr_eyeq7h_acc_d= ata }, + { .compatible =3D "mobileye,eyeq7h-ddr0-olb", .data =3D &eqr_eyeq7h_ddr_d= ata }, + { .compatible =3D "mobileye,eyeq7h-ddr1-olb", .data =3D &eqr_eyeq7h_ddr_d= ata }, + { .compatible =3D "mobileye,eyeq7h-east-olb", .data =3D &eqr_eyeq7h_east_= data }, + { .compatible =3D "mobileye,eyeq7h-periph-east-olb", .data =3D &eqr_eyeq7= h_per_data }, + { .compatible =3D "mobileye,eyeq7h-periph-west-olb", .data =3D &eqr_eyeq7= h_per_data }, + { .compatible =3D "mobileye,eyeq7h-south-olb", .data =3D &eqr_eyeq7h_sout= h_data }, + { .compatible =3D "mobileye,eyeq7h-west-olb", .data =3D &eqr_eyeq7h_west_= data }, + { .compatible =3D "mobileye,eyeq7h-xnn0-olb", .data =3D &eqr_eyeq7h_xnn_d= ata }, + { .compatible =3D "mobileye,eyeq7h-xnn1-olb", .data =3D &eqr_eyeq7h_xnn_d= ata }, {} }; MODULE_DEVICE_TABLE(of, eqr_match_table); =20 static const struct auxiliary_device_id eqr_id_table[] =3D { { .name =3D "clk_eyeq.reset" }, - { .name =3D "clk_eyeq.reset_west" }, - { .name =3D "clk_eyeq.reset_east" }, { .name =3D "clk_eyeq.reset_acc" }, + { .name =3D "clk_eyeq.reset_acc0" }, + { .name =3D "clk_eyeq.reset_acc1" }, + { .name =3D "clk_eyeq.reset_ddr0" }, + { .name =3D "clk_eyeq.reset_ddr1" }, + { .name =3D "clk_eyeq.reset_east" }, + { .name =3D "clk_eyeq.reset_periph_east" }, + { .name =3D "clk_eyeq.reset_periph_west" }, + { .name =3D "clk_eyeq.reset_south" }, + { .name =3D "clk_eyeq.reset_west" }, + { .name =3D "clk_eyeq.reset_xnn0" }, + { .name =3D "clk_eyeq.reset_xnn1" }, {} }; MODULE_DEVICE_TABLE(auxiliary, eqr_id_table); --=20 2.52.0 From nobody Sun Feb 8 11:41:14 2026 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 E400E38A72E; Wed, 14 Jan 2026 10:05:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385140; cv=none; b=pYL9mC/6hHwKOpoQQIlOrA7UzeGBLkd26b0j4r4TxAEl6tfeq0UG6LUthiig8mWWaLZ1OXbDF1FbHN5sYs1YzVr5fe05XyWFQs43INRGxVd71xgLbEUvxczOwg0SrN8rYgcdmclX8k5Z/LimPoXcgMkBy9KrYYD4VNA2cd2wEkg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385140; c=relaxed/simple; bh=EKVg88+rOfU6IBSekC8pnT+bypbtFSFkwvN72GA69wY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YRUB5zuiJg70jTd91mJZnkaeYVdIQFTeC4k3FlNgb8AULNckHP6OIWFvBHf18XyglWpl6CAoIAt2FpYCnr0VqDlA59ptrJvc4PFouzy4ak6E6VIzGxohmItwXRb3MPRgPHbFOyqbpAF2bGJqwX5ER9IusyX+gZodbyBm5FPbMjU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=i1MoCC9w; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="i1MoCC9w" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 926C14E420B6; Wed, 14 Jan 2026 10:05:37 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 65BD56074A; Wed, 14 Jan 2026 10:05:37 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 0C775103C895C; Wed, 14 Jan 2026 11:05:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1768385136; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=N7RyILljdMQfZkiQ7TRm3/JaE4XCEFcEURo9J0hqJe8=; b=i1MoCC9wXljtm5S02Ax+xfBD3bfZ4TrezEHmOvOLo9mfIuPMRqvz8iqGJpIH1J+z8DXMMJ hFyGiHG1raFGDTyLEe3bHL42a1xFXVaprDtkV1I4Wz5gTwQEZe9wr0kX3DrvHE/3IFqUc3 totiopnATIOMatGUZbCFi5b8Rp4iTWmxYXDkdoPfwAx1Xj94jK0IHSPu7wkC50ZSF1b5h7 kHVNNvywdEQzrDJEv/8eZNRv4oB/ge1PVAopvBq0OpfX0mUHvM52W5C0WLJzhjJyAlc+LW aPYQpKFggZFxBcopMhB4Bjo8gMg0p/y9r5HGLufvM47sMAdkHbZYZmrS8vEkRA== From: =?utf-8?q?Beno=C3=AEt_Monin?= Date: Wed, 14 Jan 2026 11:05:07 +0100 Subject: [PATCH v3 03/10] clk: fixed-factor: Rework initialization with parent clocks Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260114-clk-eyeq7-v3-3-8ebdba7b0133@bootlin.com> References: <20260114-clk-eyeq7-v3-0-8ebdba7b0133@bootlin.com> In-Reply-To: <20260114-clk-eyeq7-v3-0-8ebdba7b0133@bootlin.com> To: Vladimir Kondratiev , Gregory CLEMENT , =?utf-8?q?Th=C3=A9o_Lebrun?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , Philipp Zabel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: Thomas Petazzoni , Tawfik Bayouk , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-mips@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Monin?= X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Use the same sequence as clk-divider, clk-gate and other to set the parent_names, parent_hws and parent_data in the init struct when registering a fixed-factor clock. The number of parent clocks is now only set to one if a parent clock is provided. Previously the number of parent clocks was always one, forcing callers of __clk_hw_register_fixed_factor() to provide a dummy parent_data struct with an invalid clock index in case they were not provided with a non-NULL parent_name or parent_hw. Drop this dummy parent_data as is not necessary anymore. This change only has a small impact on mis-configured fixed-factor. Now a call to clk_hw_register_fixed_factor() with a NULL parent will register a fixed-factor with zero parent while previously it was registered with one invalid parent. In both cases the rate of the fixed-factor is 0Hz but it is no longer shown as orphaned. This has no impact on properly configured fixed-factors clocks. Signed-off-by: Beno=C3=AEt Monin --- drivers/clk/clk-fixed-factor.c | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c index de658c9e4c53..63082115fd25 100644 --- a/drivers/clk/clk-fixed-factor.c +++ b/drivers/clk/clk-fixed-factor.c @@ -124,13 +124,13 @@ __clk_hw_register_fixed_factor(struct device *dev, st= ruct device_node *np, init.name =3D name; init.ops =3D &clk_fixed_factor_ops; init.flags =3D flags; - if (parent_name) - init.parent_names =3D &parent_name; - else if (parent_hw) - init.parent_hws =3D &parent_hw; + init.parent_names =3D parent_name ? &parent_name : NULL; + init.parent_hws =3D parent_hw ? &parent_hw : NULL; + init.parent_data =3D pdata; + if (parent_name || parent_hw || pdata) + init.num_parents =3D 1; else - init.parent_data =3D pdata; - init.num_parents =3D 1; + init.num_parents =3D 0; =20 hw =3D &fix->hw; if (dev) @@ -190,10 +190,8 @@ struct clk_hw *devm_clk_hw_register_fixed_factor_paren= t_hw(struct device *dev, const char *name, const struct clk_hw *parent_hw, unsigned long flags, unsigned int mult, unsigned int div) { - const struct clk_parent_data pdata =3D { .index =3D -1 }; - return __clk_hw_register_fixed_factor(dev, NULL, name, NULL, parent_hw, - &pdata, flags, mult, div, 0, 0, true); + NULL, flags, mult, div, 0, 0, true); } EXPORT_SYMBOL_GPL(devm_clk_hw_register_fixed_factor_parent_hw); =20 @@ -201,10 +199,8 @@ struct clk_hw *clk_hw_register_fixed_factor_parent_hw(= struct device *dev, const char *name, const struct clk_hw *parent_hw, unsigned long flags, unsigned int mult, unsigned int div) { - const struct clk_parent_data pdata =3D { .index =3D -1 }; - return __clk_hw_register_fixed_factor(dev, NULL, name, NULL, parent_hw, - &pdata, flags, mult, div, 0, 0, false); + NULL, flags, mult, div, 0, 0, false); } EXPORT_SYMBOL_GPL(clk_hw_register_fixed_factor_parent_hw); =20 @@ -212,10 +208,8 @@ struct clk_hw *clk_hw_register_fixed_factor(struct dev= ice *dev, const char *name, const char *parent_name, unsigned long flags, unsigned int mult, unsigned int div) { - const struct clk_parent_data pdata =3D { .index =3D -1 }; - return __clk_hw_register_fixed_factor(dev, NULL, name, parent_name, NULL, - &pdata, flags, mult, div, 0, 0, false); + NULL, flags, mult, div, 0, 0, false); } EXPORT_SYMBOL_GPL(clk_hw_register_fixed_factor); =20 @@ -296,10 +290,8 @@ struct clk_hw *devm_clk_hw_register_fixed_factor(struc= t device *dev, const char *name, const char *parent_name, unsigned long flags, unsigned int mult, unsigned int div) { - const struct clk_parent_data pdata =3D { .index =3D -1 }; - return __clk_hw_register_fixed_factor(dev, NULL, name, parent_name, NULL, - &pdata, flags, mult, div, 0, 0, true); + NULL, flags, mult, div, 0, 0, true); } EXPORT_SYMBOL_GPL(devm_clk_hw_register_fixed_factor); =20 --=20 2.52.0 From nobody Sun Feb 8 11:41:14 2026 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 532A138A9D9 for ; Wed, 14 Jan 2026 10:05:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385145; cv=none; b=hF08vZLQ13Ekn5MawzIg+NA6w6unzqztOAGRUFi24efXe574H+U8zzwre5sKdBY3AY/wOFOReHsLo9AKa2ecFhCVjuImZkNyoNS14DvU5KtnteYXDRZxqP4SuNsv5dMjmqvVhkXT8sHxT193N66e7xqkfco5pweYm+IMJgzgFqM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385145; c=relaxed/simple; bh=rShCcThCOnPkCF9UW4uNpzfDIPm15l/NaCNH52W57hA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Buzg6e7FGVl7s6CRYGS6iQsERBXH51h7AId+yeRrQbJWZgf0KrxjVxfywL/PEVi9M23dvb4Tb4o5c3vHIRloBKJXD8xs74d17f4JuihsVA9lME4NEgrrIgRsUZCU8c+EfJXTpzKpFz2ziXYcdwVagdzDJRaxzzTGm8TOLHaeCFw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=JUXY9aCs; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="JUXY9aCs" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id CAC7F1A285E; Wed, 14 Jan 2026 10:05:39 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 9E7E56074A; Wed, 14 Jan 2026 10:05:39 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id C4F13103C89BA; Wed, 14 Jan 2026 11:05:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1768385138; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=p7abIbbRvpSqMhCGCTKHWciu/aq461NaY7BaEGPYWZw=; b=JUXY9aCs90AdyX6Is0xNF1/yP02QqSQmJVxkOV1++9oOAy9fbfc8V859IANFMJTndljA+c BZ3xPNOx4h84QB5vUcUD43964Z35IDCKOycTRjDOLj6rwfGIoFK+z4AwC7LxTLyT91uzPm CU66iocPh/9H7AIMlcJFEpbyVNg7wenLBjpGAyhXBG0/FRFTerSuU/AcqUCMw/h62AfA3k ozNAhRZuIiDoMlVcMJ2oanrfvANtfQ+zOKjORZkn07uaOaaJ+sfzX5wiP8XqcRCozAXvxR 6Tu40A8vsIchIL7j7YnkGGuTwOta/46Z2dfz9NZzNLZcccVNflCLSWQL97s92w== From: =?utf-8?q?Beno=C3=AEt_Monin?= Date: Wed, 14 Jan 2026 11:05:08 +0100 Subject: [PATCH v3 04/10] clk: fixed-factor: Export __clk_hw_register_fixed_factor() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260114-clk-eyeq7-v3-4-8ebdba7b0133@bootlin.com> References: <20260114-clk-eyeq7-v3-0-8ebdba7b0133@bootlin.com> In-Reply-To: <20260114-clk-eyeq7-v3-0-8ebdba7b0133@bootlin.com> To: Vladimir Kondratiev , Gregory CLEMENT , =?utf-8?q?Th=C3=A9o_Lebrun?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , Philipp Zabel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: Thomas Petazzoni , Tawfik Bayouk , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-mips@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Monin?= X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Make the base registration function for fixed-factor clocks public and re-implement the various registration functions that are a direct call to __clk_hw_register_fixed_factor() as macros. This is similar to how the registration functions of divider, mux and other clocks are implemented. Add a new macro clk_hw_register_fixed_factor_pdata() to register a fixed-factor clock with its parent clock passed as a struct clk_parent_data. Signed-off-by: Beno=C3=AEt Monin --- drivers/clk/clk-fixed-factor.c | 52 ++------------------------------------- include/linux/clk-provider.h | 56 +++++++++++++++++++++++++++++++++-----= ---- 2 files changed, 46 insertions(+), 62 deletions(-) diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c index 63082115fd25..f70378fa807a 100644 --- a/drivers/clk/clk-fixed-factor.c +++ b/drivers/clk/clk-fixed-factor.c @@ -90,7 +90,7 @@ static void devm_clk_hw_register_fixed_factor_release(str= uct device *dev, void * clk_hw_unregister(&fix->hw); } =20 -static struct clk_hw * +struct clk_hw * __clk_hw_register_fixed_factor(struct device *dev, struct device_node *np, const char *name, const char *parent_name, const struct clk_hw *parent_hw, const struct clk_parent_data *pdata, @@ -148,6 +148,7 @@ __clk_hw_register_fixed_factor(struct device *dev, stru= ct device_node *np, =20 return hw; } +EXPORT_SYMBOL_GPL(__clk_hw_register_fixed_factor); =20 /** * devm_clk_hw_register_fixed_factor_index - Register a fixed factor clock= with @@ -173,46 +174,6 @@ struct clk_hw *devm_clk_hw_register_fixed_factor_index= (struct device *dev, } EXPORT_SYMBOL_GPL(devm_clk_hw_register_fixed_factor_index); =20 -/** - * devm_clk_hw_register_fixed_factor_parent_hw - Register a fixed factor c= lock with - * pointer to parent clock - * @dev: device that is registering this clock - * @name: name of this clock - * @parent_hw: pointer to parent clk - * @flags: fixed factor flags - * @mult: multiplier - * @div: divider - * - * Return: Pointer to fixed factor clk_hw structure that was registered or - * an error pointer. - */ -struct clk_hw *devm_clk_hw_register_fixed_factor_parent_hw(struct device *= dev, - const char *name, const struct clk_hw *parent_hw, - unsigned long flags, unsigned int mult, unsigned int div) -{ - return __clk_hw_register_fixed_factor(dev, NULL, name, NULL, parent_hw, - NULL, flags, mult, div, 0, 0, true); -} -EXPORT_SYMBOL_GPL(devm_clk_hw_register_fixed_factor_parent_hw); - -struct clk_hw *clk_hw_register_fixed_factor_parent_hw(struct device *dev, - const char *name, const struct clk_hw *parent_hw, - unsigned long flags, unsigned int mult, unsigned int div) -{ - return __clk_hw_register_fixed_factor(dev, NULL, name, NULL, parent_hw, - NULL, flags, mult, div, 0, 0, false); -} -EXPORT_SYMBOL_GPL(clk_hw_register_fixed_factor_parent_hw); - -struct clk_hw *clk_hw_register_fixed_factor(struct device *dev, - const char *name, const char *parent_name, unsigned long flags, - unsigned int mult, unsigned int div) -{ - return __clk_hw_register_fixed_factor(dev, NULL, name, parent_name, NULL, - NULL, flags, mult, div, 0, 0, false); -} -EXPORT_SYMBOL_GPL(clk_hw_register_fixed_factor); - struct clk_hw *clk_hw_register_fixed_factor_fwname(struct device *dev, struct device_node *np, const char *name, const char *fw_name, unsigned long flags, unsigned int mult, unsigned int div) @@ -286,15 +247,6 @@ void clk_hw_unregister_fixed_factor(struct clk_hw *hw) } EXPORT_SYMBOL_GPL(clk_hw_unregister_fixed_factor); =20 -struct clk_hw *devm_clk_hw_register_fixed_factor(struct device *dev, - const char *name, const char *parent_name, unsigned long flags, - unsigned int mult, unsigned int div) -{ - return __clk_hw_register_fixed_factor(dev, NULL, name, parent_name, NULL, - NULL, flags, mult, div, 0, 0, true); -} -EXPORT_SYMBOL_GPL(devm_clk_hw_register_fixed_factor); - struct clk_hw *devm_clk_hw_register_fixed_factor_fwname(struct device *dev, struct device_node *np, const char *name, const char *fw_name, unsigned long flags, unsigned int mult, unsigned int div) diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 630705a47129..614abb396a6e 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -1146,13 +1146,16 @@ struct clk_fixed_factor { #define to_clk_fixed_factor(_hw) container_of(_hw, struct clk_fixed_factor= , hw) =20 extern const struct clk_ops clk_fixed_factor_ops; +struct clk_hw * +__clk_hw_register_fixed_factor(struct device *dev, struct device_node *np, + const char *name, const char *parent_name, + const struct clk_hw *parent_hw, const struct clk_parent_data *pdata, + unsigned long flags, unsigned int mult, unsigned int div, + unsigned long acc, unsigned int fixflags, bool devm); struct clk *clk_register_fixed_factor(struct device *dev, const char *name, const char *parent_name, unsigned long flags, unsigned int mult, unsigned int div); void clk_unregister_fixed_factor(struct clk *clk); -struct clk_hw *clk_hw_register_fixed_factor(struct device *dev, - const char *name, const char *parent_name, unsigned long flags, - unsigned int mult, unsigned int div); struct clk_hw *clk_hw_register_fixed_factor_fwname(struct device *dev, struct device_node *np, const char *name, const char *fw_name, unsigned long flags, unsigned int mult, unsigned int div); @@ -1164,9 +1167,6 @@ struct clk_hw *clk_hw_register_fixed_factor_index(str= uct device *dev, const char *name, unsigned int index, unsigned long flags, unsigned int mult, unsigned int div); void clk_hw_unregister_fixed_factor(struct clk_hw *hw); -struct clk_hw *devm_clk_hw_register_fixed_factor(struct device *dev, - const char *name, const char *parent_name, unsigned long flags, - unsigned int mult, unsigned int div); struct clk_hw *devm_clk_hw_register_fixed_factor_fwname(struct device *dev, struct device_node *np, const char *name, const char *fw_name, unsigned long flags, unsigned int mult, unsigned int div); @@ -1178,13 +1178,45 @@ struct clk_hw *devm_clk_hw_register_fixed_factor_in= dex(struct device *dev, const char *name, unsigned int index, unsigned long flags, unsigned int mult, unsigned int div); =20 -struct clk_hw *devm_clk_hw_register_fixed_factor_parent_hw(struct device *= dev, - const char *name, const struct clk_hw *parent_hw, - unsigned long flags, unsigned int mult, unsigned int div); +# define clk_hw_register_fixed_factor(dev, name, parent_name, = \ + flags, mult, div) \ + __clk_hw_register_fixed_factor((dev), NULL, (name), (parent_name), \ + NULL, NULL, (flags), (mult), (div), \ + 0, 0, false) +#define clk_hw_register_fixed_factor_pdata(dev, np, name, pdata, = \ + flags, mult, div, acc, fixflags) \ + __clk_hw_register_fixed_factor((dev), (np), (name), NULL, NULL, \ + (pdata), (flags), (mult), (div), \ + (acc), (fixflags), false) +#define devm_clk_hw_register_fixed_factor(dev, name, parent_name, flags, = \ + mult, div) \ + __clk_hw_register_fixed_factor((dev), NULL, (name), (parent_name), \ + NULL, NULL, (flags), (mult), (div), 0, \ + 0, true) +/** + * devm_clk_hw_register_fixed_factor_parent_hw - Register a fixed factor c= lock with + * pointer to parent clock + * @dev: device that is registering this clock + * @name: name of this clock + * @parent_hw: pointer to parent clk + * @flags: fixed factor flags + * @mult: multiplier + * @div: divider + * + * Return: Pointer to fixed factor clk_hw structure that was registered or + * an error pointer. + */ +#define devm_clk_hw_register_fixed_factor_parent_hw(dev, name, parent_hw, = \ + flags, mult, div) \ + __clk_hw_register_fixed_factor((dev), NULL, (name), NULL, \ + (parent_hw), NULL, (flags), (mult), \ + (div), 0, 0, true) =20 -struct clk_hw *clk_hw_register_fixed_factor_parent_hw(struct device *dev, - const char *name, const struct clk_hw *parent_hw, - unsigned long flags, unsigned int mult, unsigned int div); +#define clk_hw_register_fixed_factor_parent_hw(dev, name, parent_hw, flags= , \ + mult, div) \ + __clk_hw_register_fixed_factor((dev), NULL, (name), NULL, \ + (parent_hw), NULL, (flags), (mult), \ + (div), 0, 0, false) /** * struct clk_fractional_divider - adjustable fractional divider clock * --=20 2.52.0 From nobody Sun Feb 8 11:41:14 2026 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 F34A238B7A3; Wed, 14 Jan 2026 10:05:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385148; cv=none; b=LakEHJDBTGWKVO9/f4GIt+yz2j0/PLUwysstkU+TFKEodC7/LoEhz0UQOYO/OWf7TRbUaPLs9nVZGCczUUrBU8BtI7uxQ4EXBiPV2rkapSHylbpypfh8cQ0nDHCj+8OLUQIfB+l4MVZyCXVrBQFHCBwKrwZVey6wuVXS4d6GJJM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385148; c=relaxed/simple; bh=lgk2/qGA0b1VR+HeBS6kRZx98XsK1BUY0rAJ3bstsd0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=t2evSfvB8TnC9iLU6S9oDHI9ac1FsgnfxLCTFyBA1xAzVTG7mmU+mnAKniG0XULoGX0YVUfvsXNY1AirHJIehNu9H7oVkECN7NMomyY9ISnOOZF67B6lhN17zJ8oIIG2h9hyQ/T0iASIRQ4LtH4rRb7IulYssACAIQcsKemKPkI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=eTHpaZx9; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="eTHpaZx9" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id E13551A285F; Wed, 14 Jan 2026 10:05:41 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id B6D7E6074A; Wed, 14 Jan 2026 10:05:41 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id F0370103C89EC; Wed, 14 Jan 2026 11:05:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1768385140; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=aQLX+1ngliWY6MSGKZYIJumX9M1R29gapzwXl6Cw1fM=; b=eTHpaZx9KOH1FLchHSLEXkFE1KL7o6DIfZYCoYxNqPoGgpeXbtX6Jq5gmzmXu+FzkyARIW u/w0O8+s33B4M+d98cNW3CKl1u/NXay2zFdXh+Kct4YKoHGRUBFNNBQHm1RPtoQ9WeOeC1 dfmWGKPXT0GEpaOGXNAp7YKA8FLXBjPIuvoAV0GCAixKwZO/kCK9Q2BmxHpAVx6wt6Nhsf XJ5FPtpgv64VqZQ2qfC9qjn6kePtXDl5jEKLCPUVl1H3//bepKFT+MYSeQpWSWUZrFqUhQ 7qF3ho7pCAzTVmc7D8QGVU/b3+nXd4RwLWGhtjdKwGUcpIfmoBjd6msk6385VQ== From: =?utf-8?q?Beno=C3=AEt_Monin?= Date: Wed, 14 Jan 2026 11:05:09 +0100 Subject: [PATCH v3 05/10] clk: eyeq: Prefix the PLL registers with the PLL type Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260114-clk-eyeq7-v3-5-8ebdba7b0133@bootlin.com> References: <20260114-clk-eyeq7-v3-0-8ebdba7b0133@bootlin.com> In-Reply-To: <20260114-clk-eyeq7-v3-0-8ebdba7b0133@bootlin.com> To: Vladimir Kondratiev , Gregory CLEMENT , =?utf-8?q?Th=C3=A9o_Lebrun?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , Philipp Zabel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: Thomas Petazzoni , Tawfik Bayouk , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-mips@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Monin?= X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Rename the PLL registers to make room for other PLL types that are present in the eyeQ7H. Move the access to the PLL register inside the function parsing it as both call sites were doing the same thing. Signed-off-by: Beno=C3=AEt Monin --- drivers/clk/clk-eyeq.c | 76 +++++++++++++++++++++++-----------------------= ---- 1 file changed, 35 insertions(+), 41 deletions(-) diff --git a/drivers/clk/clk-eyeq.c b/drivers/clk/clk-eyeq.c index 239ddcb59383..20046e8d4713 100644 --- a/drivers/clk/clk-eyeq.c +++ b/drivers/clk/clk-eyeq.c @@ -48,28 +48,28 @@ #include =20 /* In frac mode, it enables fractional noise canceling DAC. Else, no funct= ion. */ -#define PCSR0_DAC_EN BIT(0) +#define FRACG_PCSR0_DAC_EN BIT(0) /* Fractional or integer mode */ -#define PCSR0_DSM_EN BIT(1) -#define PCSR0_PLL_EN BIT(2) +#define FRACG_PCSR0_DSM_EN BIT(1) +#define FRACG_PCSR0_PLL_EN BIT(2) /* All clocks output held at 0 */ -#define PCSR0_FOUTPOSTDIV_EN BIT(3) -#define PCSR0_POST_DIV1 GENMASK(6, 4) -#define PCSR0_POST_DIV2 GENMASK(9, 7) -#define PCSR0_REF_DIV GENMASK(15, 10) -#define PCSR0_INTIN GENMASK(27, 16) -#define PCSR0_BYPASS BIT(28) +#define FRACG_PCSR0_FOUTPOSTDIV_EN BIT(3) +#define FRACG_PCSR0_POST_DIV1 GENMASK(6, 4) +#define FRACG_PCSR0_POST_DIV2 GENMASK(9, 7) +#define FRACG_PCSR0_REF_DIV GENMASK(15, 10) +#define FRACG_PCSR0_INTIN GENMASK(27, 16) +#define FRACG_PCSR0_BYPASS BIT(28) /* Bits 30..29 are reserved */ -#define PCSR0_PLL_LOCKED BIT(31) +#define FRACG_PCSR0_PLL_LOCKED BIT(31) =20 -#define PCSR1_RESET BIT(0) -#define PCSR1_SSGC_DIV GENMASK(4, 1) +#define FRACG_PCSR1_RESET BIT(0) +#define FRACG_PCSR1_SSGC_DIV GENMASK(4, 1) /* Spread amplitude (% =3D 0.1 * SPREAD[4:0]) */ -#define PCSR1_SPREAD GENMASK(9, 5) -#define PCSR1_DIS_SSCG BIT(10) +#define FRACG_PCSR1_SPREAD GENMASK(9, 5) +#define FRACG_PCSR1_DIS_SSCG BIT(10) /* Down-spread or center-spread */ -#define PCSR1_DOWN_SPREAD BIT(11) -#define PCSR1_FRAC_IN GENMASK(31, 12) +#define FRACG_PCSR1_DOWN_SPREAD BIT(11) +#define FRACG_PCSR1_FRAC_IN GENMASK(31, 12) =20 struct eqc_pll { unsigned int index; @@ -161,34 +161,40 @@ static void eqc_pll_downshift_factors(unsigned long *= mult, unsigned long *div) *div >>=3D shift; } =20 -static int eqc_pll_parse_registers(u32 r0, u32 r1, unsigned long *mult, - unsigned long *div, unsigned long *acc) +static int eqc_pll_parse_fracg(void __iomem *base, unsigned long *mult, + unsigned long *div, unsigned long *acc) { unsigned long spread; + u32 r0, r1; + u64 val; =20 - if (r0 & PCSR0_BYPASS) { + val =3D readq(base); + r0 =3D val; + r1 =3D val >> 32; + + if (r0 & FRACG_PCSR0_BYPASS) { *mult =3D 1; *div =3D 1; *acc =3D 0; return 0; } =20 - if (!(r0 & PCSR0_PLL_LOCKED)) + if (!(r0 & FRACG_PCSR0_PLL_LOCKED)) return -EINVAL; =20 - *mult =3D FIELD_GET(PCSR0_INTIN, r0); - *div =3D FIELD_GET(PCSR0_REF_DIV, r0); + *mult =3D FIELD_GET(FRACG_PCSR0_INTIN, r0); + *div =3D FIELD_GET(FRACG_PCSR0_REF_DIV, r0); =20 /* Fractional mode, in 2^20 (0x100000) parts. */ - if (r0 & PCSR0_DSM_EN) { + if (r0 & FRACG_PCSR0_DSM_EN) { *div *=3D (1ULL << 20); - *mult =3D *mult * (1ULL << 20) + FIELD_GET(PCSR1_FRAC_IN, r1); + *mult =3D *mult * (1ULL << 20) + FIELD_GET(FRACG_PCSR1_FRAC_IN, r1); } =20 if (!*mult || !*div) return -EINVAL; =20 - if (r1 & (PCSR1_RESET | PCSR1_DIS_SSCG)) { + if (r1 & (FRACG_PCSR1_RESET | FRACG_PCSR1_DIS_SSCG)) { *acc =3D 0; return 0; } @@ -203,10 +209,10 @@ static int eqc_pll_parse_registers(u32 r0, u32 r1, un= signed long *mult, * * Care is taken to avoid overflowing or losing precision. */ - spread =3D FIELD_GET(PCSR1_SPREAD, r1); + spread =3D FIELD_GET(FRACG_PCSR1_SPREAD, r1); *acc =3D DIV_ROUND_CLOSEST(spread * 1000000000, 1024 * 2); =20 - if (r1 & PCSR1_DOWN_SPREAD) { + if (r1 & FRACG_PCSR1_DOWN_SPREAD) { /* * Downspreading: the central frequency is half a * spread lower. @@ -231,18 +237,12 @@ static void eqc_probe_init_plls(struct device *dev, c= onst struct eqc_match_data const struct eqc_pll *pll; struct clk_hw *hw; unsigned int i; - u32 r0, r1; - u64 val; int ret; =20 for (i =3D 0; i < data->pll_count; i++) { pll =3D &data->plls[i]; =20 - val =3D readq(base + pll->reg64); - r0 =3D val; - r1 =3D val >> 32; - - ret =3D eqc_pll_parse_registers(r0, r1, &mult, &div, &acc); + ret =3D eqc_pll_parse_fracg(base + pll->reg64, &mult, &div, &acc); if (ret) { dev_warn(dev, "failed parsing state of %s\n", pll->name); cells->hws[pll->index] =3D ERR_PTR(ret); @@ -829,14 +829,8 @@ static void __init eqc_early_init(struct device_node *= np, const struct eqc_pll *pll =3D &early_data->early_plls[i]; unsigned long mult, div, acc; struct clk_hw *hw; - u32 r0, r1; - u64 val; =20 - val =3D readq(base + pll->reg64); - r0 =3D val; - r1 =3D val >> 32; - - ret =3D eqc_pll_parse_registers(r0, r1, &mult, &div, &acc); + ret =3D eqc_pll_parse_fracg(base + pll->reg64, &mult, &div, &acc); if (ret) { pr_err("failed parsing state of %s\n", pll->name); goto err; --=20 2.52.0 From nobody Sun Feb 8 11:41:14 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 4F39B38B7B1 for ; Wed, 14 Jan 2026 10:05:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385151; cv=none; b=djNNgef3v5e49Itkg/DqAB38Bg6UXMC1w2clcbo6cw5AgKsE/5jLKN92O+UikB340wdW1pQ3FXOdz8ohm63aYlakJ4Fbp7Egw3riAu7G4+73FeIWll0ouoH4GgZE3NSRAuoi/6gzzDxcUwTLhifnks8F2Zs9HYO6yyzzq4yQMZo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385151; c=relaxed/simple; bh=3y7N2kmP84LrzRCn7KASbw7y1n4t0D5QagCtuBBNiTI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=l+RHM+KWs0SeuQAmAi3C1pMvDepm3AIBHSjJNSLBxwNpGKrsj5jSWtc1L+B8kRR9l0LytA72cXkkwTYjNV6D8Y9QCTK+A6+uF+3YAX9OK7ShrpKSC35aI7YqTZDMoaId7HP0pYcSwQUBvFWsO8hMmRmQTpHd4tt7qe0tyKGGcJU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=ENE0fyfa; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="ENE0fyfa" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 3DF65C1F1C3; Wed, 14 Jan 2026 10:05:17 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id D81CC6074A; Wed, 14 Jan 2026 10:05:43 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id F4169103C89F4; Wed, 14 Jan 2026 11:05:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1768385142; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=0u8zn5SVsgsbUW22/EktpM9DDoj4XnL9G6kWR7e+CuM=; b=ENE0fyfaisurrhURA5NQy9oqd0P5qS2nA7jQKrVHckaYz1MVxzTVzzGgwbpV1x0/2jKXb9 hb+vsEbP/wfdxFrDAC0UJJzGjeWD0TU/K2K/eSGZsgSU7vIOp+sUBnBnByTDa83316/zBs DLQHaSUyDNmuGBBVF3JBS/VogAxQ8q85i+6kebUJyRJsuUOnaVQnx6455usmMyFDekb3d/ YD+H2PXEVP8isjchu3Iyvn+Ko1exO4SggcKtAoDkxi/qCVzr/ZxGWcAEoo1jqwjFUyDjuB ZVMh2n0JMCp+17JVYovqwGW4Z03deD6baDiLptbg8BlFCXiGTBWotKfQlUcitA== From: =?utf-8?q?Beno=C3=AEt_Monin?= Date: Wed, 14 Jan 2026 11:05:10 +0100 Subject: [PATCH v3 06/10] clk: eyeq: Introduce a generic clock type Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260114-clk-eyeq7-v3-6-8ebdba7b0133@bootlin.com> References: <20260114-clk-eyeq7-v3-0-8ebdba7b0133@bootlin.com> In-Reply-To: <20260114-clk-eyeq7-v3-0-8ebdba7b0133@bootlin.com> To: Vladimir Kondratiev , Gregory CLEMENT , =?utf-8?q?Th=C3=A9o_Lebrun?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , Philipp Zabel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: Thomas Petazzoni , Tawfik Bayouk , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-mips@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Monin?= X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Currently, the clocks contained in the OLB are represented as three separate structures: PLL, dividers and fixed factors. These clock objects are stored in three separate arrays in the match data and registered in a fixed order: first the PLL, then the dividers, and finally the fixed factors. While this is sufficient for the clocks found in the OLB of the EyeQ5 and EyeQ6, it does not allow declaring the more complex clock interdependencies for those found in the OLB of the EyeQ7H. We add a new type of clock represented by the struct eqc_clock that covers all types of clocks found in OLB. It contains the clock index and its name, alongside the parent clock index and name. The index refers to the position in the array of clk_hw in the struct clk_hw_onecell_data that is filled when registering the clocks. The parent name is optional and can refer to the parent clock either via the device tree or via its globally unique name. Two special index values are used to select which type of lookup is done. The function eqc_fill_parent_data() fill a clk_parent_data structure based on the parent index and name values. The struct eqc_clock also contains two function pointers: .probe() and .unregister(). The probe() function parses the eqc_clock structure, registers a new clock as a clk_hw and adds it to the clk_hw_onecell_data structure. It can be called during probe and early init. The unregister() function unregisters the clk_hw. This patch adds the probe functions for the PLLs, the dividers and the fixed factors found in the EyeQ OLB. Finally, a union is also part of the eqc_clock structure to store the data specific to each type of clock. To help in declaring struct eqc_clock, three macros are added. They set the correct function pointers for .probe() and .unregister() based on the type of clock being declared. An array of eqc_clock is added to the match data and early match data. They are parsed during probe and early initialization respectively. There is no user yet of the eqc_clock structure. Signed-off-by: Beno=C3=AEt Monin --- drivers/clk/clk-eyeq.c | 211 +++++++++++++++++++++++++++++++++++++++++++++= +++- 1 file changed, 208 insertions(+), 3 deletions(-) diff --git a/drivers/clk/clk-eyeq.c b/drivers/clk/clk-eyeq.c index 20046e8d4713..bcf36c434049 100644 --- a/drivers/clk/clk-eyeq.c +++ b/drivers/clk/clk-eyeq.c @@ -71,6 +71,13 @@ #define FRACG_PCSR1_DOWN_SPREAD BIT(11) #define FRACG_PCSR1_FRAC_IN GENMASK(31, 12) =20 +/* + * Special index values to lookup a parent clock by its name + * from the device tree or by its globally unique name. + */ +#define PARENT_BY_FWNAME (-1) +#define PARENT_BY_NAME (-2) + struct eqc_pll { unsigned int index; const char *name; @@ -98,6 +105,32 @@ struct eqc_fixed_factor { unsigned int parent; }; =20 +struct eqc_clock { + int index; + int parent_idx; + const char *name; + const char *parent_name; + int (*probe)(struct device *dev, struct device_node *np, + const struct eqc_clock *clk, void __iomem *base, + struct clk_hw_onecell_data *cells); + void (*unregister)(struct clk_hw *hw); + union { + struct { + unsigned int reg; + u8 shift; + u8 width; + const struct clk_div_table *table; + } div; + struct { + unsigned int mult; + unsigned int div; + } ff; + struct { + unsigned int reg; + } pll; + }; +}; + struct eqc_match_data { unsigned int pll_count; const struct eqc_pll *plls; @@ -108,6 +141,9 @@ struct eqc_match_data { unsigned int fixed_factor_count; const struct eqc_fixed_factor *fixed_factors; =20 + unsigned int clk_count; + const struct eqc_clock *clks; + const char *reset_auxdev_name; const char *pinctrl_auxdev_name; =20 @@ -121,6 +157,9 @@ struct eqc_early_match_data { unsigned int early_fixed_factor_count; const struct eqc_fixed_factor *early_fixed_factors; =20 + unsigned int early_clk_count; + const struct eqc_clock *early_clks; + /* * We want our of_xlate callback to EPROBE_DEFER instead of dev_err() * and EINVAL. For that, we must know the total clock count. @@ -355,6 +394,101 @@ static int eqc_auxdev_create(struct device *dev, void= __iomem *base, return ret; } =20 +static int eqc_fill_parent_data(const struct eqc_clock *clk, + struct clk_hw_onecell_data *cells, + struct clk_parent_data *parent_data) +{ + int pidx =3D clk->parent_idx; + + memset(parent_data, 0, sizeof(struct clk_parent_data)); + + if (pidx =3D=3D PARENT_BY_FWNAME) { + /* lookup the parent clock by its fw_name */ + parent_data->index =3D -1; + parent_data->fw_name =3D clk->parent_name; + } else if (pidx =3D=3D PARENT_BY_NAME) { + /* lookup the parent clock by its global name */ + parent_data->index =3D -1; + parent_data->name =3D clk->parent_name; + } else if (pidx >=3D 0 && pidx < cells->num && !IS_ERR(cells->hws[pidx]))= { + /* get the parent hw directly */ + parent_data->hw =3D cells->hws[pidx]; + } else { + return -EINVAL; + } + + return 0; +} + +static int eqc_probe_divider(struct device *dev, struct device_node *np, + const struct eqc_clock *clk, void __iomem *base, + struct clk_hw_onecell_data *cells) +{ + struct clk_parent_data parent_data; + struct clk_hw *hw; + int ret; + + ret =3D eqc_fill_parent_data(clk, cells, &parent_data); + if (ret) + return ret; + + hw =3D clk_hw_register_divider_table_parent_data(dev, clk->name, + &parent_data, 0, base + clk->div.reg, clk->div.shift, clk->div.width, + clk->div.table ? 0 : CLK_DIVIDER_EVEN_INTEGERS, clk->div.table, NULL); + if (IS_ERR(hw)) + return IS_ERR(hw); + + cells->hws[clk->index] =3D hw; + return 0; +} + +static int eqc_probe_fixed_factor(struct device *dev, struct device_node *= np, + const struct eqc_clock *clk, void __iomem *base, + struct clk_hw_onecell_data *cells) +{ + struct clk_parent_data parent_data; + struct clk_hw *hw; + int ret; + + ret =3D eqc_fill_parent_data(clk, cells, &parent_data); + if (ret) + return ret; + + hw =3D clk_hw_register_fixed_factor_pdata(dev, np, clk->name, &parent_dat= a, 0, + clk->ff.mult, clk->ff.div, 0, 0); + if (IS_ERR(hw)) + return IS_ERR(hw); + + cells->hws[clk->index] =3D hw; + return 0; +} + +static int eqc_probe_pll_fracg(struct device *dev, struct device_node *np, + const struct eqc_clock *clk, void __iomem *base, + struct clk_hw_onecell_data *cells) +{ + struct clk_parent_data parent_data; + unsigned long mult, div, acc; + struct clk_hw *hw; + int ret; + + ret =3D eqc_pll_parse_fracg(base + clk->pll.reg, &mult, &div, &acc); + if (ret) + return ret; + + ret =3D eqc_fill_parent_data(clk, cells, &parent_data); + if (ret) + return ret; + + hw =3D clk_hw_register_fixed_factor_pdata(dev, np, clk->name, &parent_dat= a, 0, mult, + div, acc, CLK_FIXED_FACTOR_FIXED_ACCURACY); + if (IS_ERR(hw)) + return IS_ERR(hw); + + cells->hws[clk->index] =3D hw; + return 0; +} + static int eqc_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; @@ -394,11 +528,12 @@ static int eqc_probe(struct platform_device *pdev) KBUILD_MODNAME, data->pinctrl_auxdev_name, ret); } =20 - if (data->pll_count + data->div_count + data->fixed_factor_count =3D=3D 0) + if (data->pll_count + data->div_count + data->fixed_factor_count + data->= clk_count =3D=3D 0) return 0; /* Zero clocks, we are done. */ =20 clk_count =3D data->pll_count + data->div_count + - data->fixed_factor_count + data->early_clk_count; + data->fixed_factor_count + data->clk_count + + data->early_clk_count; cells =3D kzalloc(struct_size(cells, hws, clk_count), GFP_KERNEL); if (!cells) return -ENOMEM; @@ -415,9 +550,58 @@ static int eqc_probe(struct platform_device *pdev) =20 eqc_probe_init_fixed_factors(dev, data, cells); =20 + for (i =3D 0; i < data->clk_count; i++) { + const struct eqc_clock *clk =3D &data->clks[i]; + + if (clk->probe) + ret =3D clk->probe(dev, NULL, clk, base, cells); + else + ret =3D -EINVAL; + if (ret) + dev_warn(dev, "failed probing clock %s: %d\n", clk->name, ret); + } + return of_clk_add_hw_provider(np, of_clk_hw_onecell_get, cells); } =20 +#define DIV(_index, _parent_idx, _name, _parent_name, \ + _reg, _shift, _width, _table) \ + { \ + .index =3D _index, \ + .parent_idx =3D _parent_idx, \ + .name =3D _name, \ + .parent_name =3D _parent_name, \ + .probe =3D eqc_probe_divider, \ + .unregister =3D clk_hw_unregister_divider, \ + .div.reg =3D _reg, \ + .div.shift =3D _shift, \ + .div.width =3D _width, \ + .div.table =3D _table, \ + } + +#define FF(_index, _parent_idx, _name, _parent_name, _mult, _div) \ + { \ + .index =3D _index, \ + .parent_idx =3D _parent_idx, \ + .name =3D _name, \ + .parent_name =3D _parent_name, \ + .probe =3D eqc_probe_fixed_factor, \ + .unregister =3D clk_hw_unregister_fixed_factor, \ + .ff.mult =3D _mult, \ + .ff.div =3D _div, \ + } + +#define PLL_FRACG(_index, _parent_idx, _name, _parent_name, _reg) \ + { \ + .index =3D _index, \ + .parent_idx =3D _parent_idx, \ + .name =3D _name, \ + .parent_name =3D _parent_name, \ + .probe =3D eqc_probe_pll_fracg, \ + .unregister =3D clk_hw_unregister_fixed_factor, \ + .pll.reg =3D _reg, \ + } + /* Required early for GIC timer (pll-cpu) and UARTs (pll-per). */ static const struct eqc_pll eqc_eyeq5_early_plls[] =3D { { .index =3D EQ5C_PLL_CPU, .name =3D "pll-cpu", .reg64 =3D 0x02C }, @@ -799,7 +983,7 @@ static void __init eqc_early_init(struct device_node *n= p, int ret; =20 clk_count =3D early_data->early_pll_count + early_data->early_fixed_facto= r_count + - early_data->late_clk_count; + early_data->early_clk_count + early_data->late_clk_count; cells =3D kzalloc(struct_size(cells, hws, clk_count), GFP_KERNEL); if (!cells) { ret =3D -ENOMEM; @@ -861,6 +1045,19 @@ static void __init eqc_early_init(struct device_node = *np, } } =20 + for (i =3D 0; i < early_data->early_clk_count; i++) { + const struct eqc_clock *clk =3D &early_data->early_clks[i]; + + if (clk->probe) + ret =3D clk->probe(NULL, np, clk, base, cells); + else + ret =3D -EINVAL; + if (ret) { + pr_err("failed registering %s\n", clk->name); + goto err; + } + } + ret =3D of_clk_add_hw_provider(np, of_clk_hw_onecell_get, cells); if (ret) { pr_err("failed registering clk provider: %d\n", ret); @@ -890,6 +1087,14 @@ static void __init eqc_early_init(struct device_node = *np, clk_hw_unregister_fixed_factor(hw); } =20 + for (i =3D 0; i < early_data->early_clk_count; i++) { + const struct eqc_clock *clk =3D &early_data->early_clks[i]; + struct clk_hw *hw =3D cells->hws[clk->index]; + + if (!IS_ERR_OR_NULL(hw) && clk->unregister) + clk->unregister(hw); + } + kfree(cells); } } --=20 2.52.0 From nobody Sun Feb 8 11:41:14 2026 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 928AD318B8F; Wed, 14 Jan 2026 10:05:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385151; cv=none; b=qG1l/QBZhP6QJNhzye+j6jnvEmUBjaJE+MGZLrsK0Vx2nu3PI2b80KBejbIxjCc9U6hWrybsYAj2YDnlW1GY68cEk1n7GjjnofwZjyvqTQW1ENyRRzLuxjSk5FEBTEoIbtyXJManASLlab3/RjANj+Vg1xeOqbYnmw2cdJ2UW0k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385151; c=relaxed/simple; bh=svD+5KyAqkRFvnG2jJijODfAy18ad6nEqRjo3dRSip4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Nqkzkcrkj+RU4i4f2i0A6B7mon+FWV3vbqC4ZvAn5Dg3TUAsDgd8q27yJVz4qQMkL7CVW1ow6T3Tb5fGRgpOm8kE+kcbGmn4ZYJR9pOV4DiWRrr9oFNZUkFTWmvsAkg5M+3EpOAa8Aj0vG/BPVH4CC8vlrutcg5GVlGEPlKPkFc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=cFvQ+iSC; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="cFvQ+iSC" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 19FD74E420D5; Wed, 14 Jan 2026 10:05:46 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id E4B606074A; Wed, 14 Jan 2026 10:05:45 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 33423103C89ED; Wed, 14 Jan 2026 11:05:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1768385145; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=wABO3Fy8D5m/TOZY/gk+GKos+5kpgv17bjgRdHH8RIk=; b=cFvQ+iSC9cyYEoX0qZWWwTleQYS5tFuX5LARrYn41ojnPNNkxLovGL9qgdiuvkprsmQnoZ V2wOrPro0vA5mdDrg3B3CHMz44A45b4iNGbEGyvKxvDbDV/MjmK5n/sFjQxwpYbXiBRXUB +hcMuMQfpg8GDbA304Ez7B4M9Vcps5oCzhALKDg8DSycctYXTu1Df/5d7VNzIWg26/UvD2 4GYPrUxOeDCI0FRxqwnUoIE1HDaRlepQy0JZyOGJL/BBG21Cdljr38dluD28OCvPuVQc1s lim0stGyiwC0JlZKgIMMofbhttFUrDyNvlnI4qFwQITm63bmA9HGp/QiH5uMUQ== From: =?utf-8?q?Beno=C3=AEt_Monin?= Date: Wed, 14 Jan 2026 11:05:11 +0100 Subject: [PATCH v3 07/10] clk: eyeq: Convert clocks declaration to eqc_clock Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260114-clk-eyeq7-v3-7-8ebdba7b0133@bootlin.com> References: <20260114-clk-eyeq7-v3-0-8ebdba7b0133@bootlin.com> In-Reply-To: <20260114-clk-eyeq7-v3-0-8ebdba7b0133@bootlin.com> To: Vladimir Kondratiev , Gregory CLEMENT , =?utf-8?q?Th=C3=A9o_Lebrun?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , Philipp Zabel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: Thomas Petazzoni , Tawfik Bayouk , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-mips@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Monin?= X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Convert all declarations of PLLs, dividers, and fixed factors to struct eqc_clock for the EyeQ5, EyeQ6H, EyeQ6L, and EyeQ6Lplus, both for the match data used during probe and the early match data used in early initialization. Tested on the EyeQ5, EyeQ6H and EyeQ6Lplus evaluation boards. For the EyeQ6Lplus and EyeQ6H, the clock tree is unchanged. For the EyeQ5, this change allows us to set the parent of some probed dividers and fixed factors by name as they refer to clocks registered in early init. While these clocks were previously orphaned, they were not yet used by a peripheral. Signed-off-by: Beno=C3=AEt Monin --- drivers/clk/clk-eyeq.c | 354 +++++++++++++++++++--------------------------= ---- 1 file changed, 135 insertions(+), 219 deletions(-) diff --git a/drivers/clk/clk-eyeq.c b/drivers/clk/clk-eyeq.c index bcf36c434049..7a4b465d87fb 100644 --- a/drivers/clk/clk-eyeq.c +++ b/drivers/clk/clk-eyeq.c @@ -602,23 +602,6 @@ static int eqc_probe(struct platform_device *pdev) .pll.reg =3D _reg, \ } =20 -/* Required early for GIC timer (pll-cpu) and UARTs (pll-per). */ -static const struct eqc_pll eqc_eyeq5_early_plls[] =3D { - { .index =3D EQ5C_PLL_CPU, .name =3D "pll-cpu", .reg64 =3D 0x02C }, - { .index =3D EQ5C_PLL_PER, .name =3D "pll-per", .reg64 =3D 0x05C }, -}; - -static const struct eqc_pll eqc_eyeq5_plls[] =3D { - { .index =3D EQ5C_PLL_VMP, .name =3D "pll-vmp", .reg64 =3D 0x034 }, - { .index =3D EQ5C_PLL_PMA, .name =3D "pll-pma", .reg64 =3D 0x03C }, - { .index =3D EQ5C_PLL_VDI, .name =3D "pll-vdi", .reg64 =3D 0x044 }, - { .index =3D EQ5C_PLL_DDR0, .name =3D "pll-ddr0", .reg64 =3D 0x04C }, - { .index =3D EQ5C_PLL_PCI, .name =3D "pll-pci", .reg64 =3D 0x054 }, - { .index =3D EQ5C_PLL_PMAC, .name =3D "pll-pmac", .reg64 =3D 0x064 }, - { .index =3D EQ5C_PLL_MPC, .name =3D "pll-mpc", .reg64 =3D 0x06C }, - { .index =3D EQ5C_PLL_DDR1, .name =3D "pll-ddr1", .reg64 =3D 0x074 }, -}; - enum { /* * EQ5C_PLL_CPU children. @@ -656,262 +639,205 @@ enum { EQ5C_PER_FCMU_A, }; =20 -static const struct eqc_fixed_factor eqc_eyeq5_early_fixed_factors[] =3D { - /* EQ5C_PLL_CPU children */ - { EQ5C_CPU_OCC, "occ-cpu", 1, 1, EQ5C_PLL_CPU }, - { EQ5C_CPU_SI_CSS0, "si-css0", 1, 1, EQ5C_CPU_OCC }, - { EQ5C_CPU_CORE0, "core0", 1, 1, EQ5C_CPU_SI_CSS0 }, - { EQ5C_CPU_CORE1, "core1", 1, 1, EQ5C_CPU_SI_CSS0 }, - { EQ5C_CPU_CORE2, "core2", 1, 1, EQ5C_CPU_SI_CSS0 }, - { EQ5C_CPU_CORE3, "core3", 1, 1, EQ5C_CPU_SI_CSS0 }, +/* Required early for GIC timer (pll-cpu) and UARTs (pll-per). */ +static const struct eqc_clock eqc_eyeq5_early_clks[] =3D { + PLL_FRACG(EQ5C_PLL_CPU, PARENT_BY_FWNAME, "pll-cpu", "ref", 0x02C), + PLL_FRACG(EQ5C_PLL_PER, PARENT_BY_FWNAME, "pll-per", "ref", 0x05C), =20 - /* EQ5C_PLL_PER children */ - { EQ5C_PER_OCC, "occ-periph", 1, 16, EQ5C_PLL_PER }, - { EQ5C_PER_UART, "uart", 1, 1, EQ5C_PER_OCC }, + FF(EQ5C_CPU_OCC, EQ5C_PLL_CPU, "occ-cpu", NULL, 1, 1), + FF(EQ5C_CPU_SI_CSS0, EQ5C_CPU_OCC, "si-css0", NULL, 1, 1), + FF(EQ5C_CPU_CORE0, EQ5C_CPU_SI_CSS0, "core0", NULL, 1, 1), + FF(EQ5C_CPU_CORE1, EQ5C_CPU_SI_CSS0, "core1", NULL, 1, 1), + FF(EQ5C_CPU_CORE2, EQ5C_CPU_SI_CSS0, "core2", NULL, 1, 1), + FF(EQ5C_CPU_CORE3, EQ5C_CPU_SI_CSS0, "core3", NULL, 1, 1), + + FF(EQ5C_PER_OCC, EQ5C_PLL_PER, "occ-periph", NULL, 1, 16), + FF(EQ5C_PER_UART, EQ5C_PER_OCC, "uart", NULL, 1, 1), }; =20 -static const struct eqc_fixed_factor eqc_eyeq5_fixed_factors[] =3D { - /* EQ5C_PLL_CPU children */ - { EQ5C_CPU_CPC, "cpc", 1, 1, EQ5C_CPU_SI_CSS0 }, - { EQ5C_CPU_CM, "cm", 1, 1, EQ5C_CPU_SI_CSS0 }, - { EQ5C_CPU_MEM, "mem", 1, 1, EQ5C_CPU_SI_CSS0 }, - { EQ5C_CPU_OCC_ISRAM, "occ-isram", 1, 2, EQ5C_PLL_CPU }, - { EQ5C_CPU_ISRAM, "isram", 1, 1, EQ5C_CPU_OCC_ISRAM }, - { EQ5C_CPU_OCC_DBU, "occ-dbu", 1, 10, EQ5C_PLL_CPU }, - { EQ5C_CPU_SI_DBU_TP, "si-dbu-tp", 1, 1, EQ5C_CPU_OCC_DBU }, +static const struct eqc_clock eqc_eyeq5_clks[] =3D { + PLL_FRACG(EQ5C_PLL_VMP, PARENT_BY_FWNAME, "pll-vmp", "ref", 0x034), + PLL_FRACG(EQ5C_PLL_PMA, PARENT_BY_FWNAME, "pll-pma", "ref", 0x03C), + PLL_FRACG(EQ5C_PLL_VDI, PARENT_BY_FWNAME, "pll-vdi", "ref", 0x044), + PLL_FRACG(EQ5C_PLL_DDR0, PARENT_BY_FWNAME, "pll-ddr0", "ref", 0x04C), + PLL_FRACG(EQ5C_PLL_PCI, PARENT_BY_FWNAME, "pll-pci", "ref", 0x054), + PLL_FRACG(EQ5C_PLL_PMAC, PARENT_BY_FWNAME, "pll-pmac", "ref", 0x064), + PLL_FRACG(EQ5C_PLL_MPC, PARENT_BY_FWNAME, "pll-mpc", "ref", 0x06C), + PLL_FRACG(EQ5C_PLL_DDR1, PARENT_BY_FWNAME, "pll-ddr1", "ref", 0x074), =20 - /* EQ5C_PLL_VDI children */ - { EQ5C_VDI_OCC_VDI, "occ-vdi", 1, 2, EQ5C_PLL_VDI }, - { EQ5C_VDI_VDI, "vdi", 1, 1, EQ5C_VDI_OCC_VDI }, - { EQ5C_VDI_OCC_CAN_SER, "occ-can-ser", 1, 16, EQ5C_PLL_VDI }, - { EQ5C_VDI_CAN_SER, "can-ser", 1, 1, EQ5C_VDI_OCC_CAN_SER }, - { EQ5C_VDI_I2C_SER, "i2c-ser", 1, 20, EQ5C_PLL_VDI }, + DIV(EQ5C_DIV_OSPI, PARENT_BY_NAME, "div-ospi", "pll-per", 0x11C, 0, 4, NU= LL), =20 - /* EQ5C_PLL_PER children */ - { EQ5C_PER_PERIPH, "periph", 1, 1, EQ5C_PER_OCC }, - { EQ5C_PER_CAN, "can", 1, 1, EQ5C_PER_OCC }, - { EQ5C_PER_SPI, "spi", 1, 1, EQ5C_PER_OCC }, - { EQ5C_PER_I2C, "i2c", 1, 1, EQ5C_PER_OCC }, - { EQ5C_PER_TIMER, "timer", 1, 1, EQ5C_PER_OCC }, - { EQ5C_PER_GPIO, "gpio", 1, 1, EQ5C_PER_OCC }, - { EQ5C_PER_EMMC, "emmc-sys", 1, 10, EQ5C_PLL_PER }, - { EQ5C_PER_CCF, "ccf-ctrl", 1, 4, EQ5C_PLL_PER }, - { EQ5C_PER_OCC_MJPEG, "occ-mjpeg", 1, 2, EQ5C_PLL_PER }, - { EQ5C_PER_HSM, "hsm", 1, 1, EQ5C_PER_OCC_MJPEG }, - { EQ5C_PER_MJPEG, "mjpeg", 1, 1, EQ5C_PER_OCC_MJPEG }, - { EQ5C_PER_FCMU_A, "fcmu-a", 1, 20, EQ5C_PLL_PER }, - { EQ5C_PER_OCC_PCI, "occ-pci-sys", 1, 8, EQ5C_PLL_PER }, -}; + FF(EQ5C_CPU_CPC, PARENT_BY_NAME, "cpc", "si-css0", 1, 1), + FF(EQ5C_CPU_CM, PARENT_BY_NAME, "cm", "si-css0", 1, 1), + FF(EQ5C_CPU_MEM, PARENT_BY_NAME, "mem", "si-css0", 1, 1), + FF(EQ5C_CPU_OCC_ISRAM, PARENT_BY_NAME, "occ-isram", "pll-cpu", 1, 2), + FF(EQ5C_CPU_ISRAM, EQ5C_CPU_OCC_ISRAM, "isram", NULL, 1, 1), + FF(EQ5C_CPU_OCC_DBU, PARENT_BY_NAME, "occ-dbu", "pll-cpu", 1, 10), + FF(EQ5C_CPU_SI_DBU_TP, EQ5C_CPU_OCC_DBU, "si-dbu-tp", NULL, 1, 1), =20 -static const struct eqc_div eqc_eyeq5_divs[] =3D { - { - .index =3D EQ5C_DIV_OSPI, - .name =3D "div-ospi", - .parent =3D EQ5C_PLL_PER, - .reg =3D 0x11C, - .shift =3D 0, - .width =3D 4, - }, + FF(EQ5C_VDI_OCC_VDI, PARENT_BY_NAME, "occ-vdi", "pll-vdi", 1, 2), + FF(EQ5C_VDI_VDI, EQ5C_VDI_OCC_VDI, "vdi", NULL, 1, 1), + FF(EQ5C_VDI_OCC_CAN_SER, PARENT_BY_NAME, "occ-can-ser", "pll-vdi", 1, 16), + FF(EQ5C_VDI_CAN_SER, EQ5C_VDI_OCC_CAN_SER, "can-ser", NULL, 1, 1), + FF(EQ5C_VDI_I2C_SER, PARENT_BY_NAME, "i2c-ser", "pll-vdi", 1, 20), + + FF(EQ5C_PER_PERIPH, PARENT_BY_NAME, "periph", "occ-periph", 1, 1), + FF(EQ5C_PER_CAN, PARENT_BY_NAME, "can", "occ-periph", 1, 1), + FF(EQ5C_PER_SPI, PARENT_BY_NAME, "spi", "occ-periph", 1, 1), + FF(EQ5C_PER_I2C, PARENT_BY_NAME, "i2c", "occ-periph", 1, 1), + FF(EQ5C_PER_TIMER, PARENT_BY_NAME, "timer", "occ-periph", 1, 1), + FF(EQ5C_PER_GPIO, PARENT_BY_NAME, "gpio", "occ-periph", 1, 1), + FF(EQ5C_PER_EMMC, PARENT_BY_NAME, "emmc-sys", "pll-per", 1, 10), + FF(EQ5C_PER_CCF, PARENT_BY_NAME, "ccf-ctrl", "pll-per", 1, 4), + FF(EQ5C_PER_OCC_MJPEG, PARENT_BY_NAME, "occ-mjpeg", "pll-per", 1, 2), + FF(EQ5C_PER_HSM, EQ5C_PER_OCC_MJPEG, "hsm", NULL, 1, 1), + FF(EQ5C_PER_MJPEG, EQ5C_PER_OCC_MJPEG, "mjpeg", NULL, 1, 1), + FF(EQ5C_PER_FCMU_A, PARENT_BY_NAME, "fcmu-a", "pll-per", 1, 20), + FF(EQ5C_PER_OCC_PCI, PARENT_BY_NAME, "occ-pci-sys", "pll-per", 1, 8), }; =20 static const struct eqc_early_match_data eqc_eyeq5_early_match_data __init= const =3D { - .early_pll_count =3D ARRAY_SIZE(eqc_eyeq5_early_plls), - .early_plls =3D eqc_eyeq5_early_plls, + .early_clk_count =3D ARRAY_SIZE(eqc_eyeq5_early_clks), + .early_clks =3D eqc_eyeq5_early_clks, =20 - .early_fixed_factor_count =3D ARRAY_SIZE(eqc_eyeq5_early_fixed_factors), - .early_fixed_factors =3D eqc_eyeq5_early_fixed_factors, - - .late_clk_count =3D ARRAY_SIZE(eqc_eyeq5_plls) + ARRAY_SIZE(eqc_eyeq5_di= vs) + - ARRAY_SIZE(eqc_eyeq5_fixed_factors), + .late_clk_count =3D ARRAY_SIZE(eqc_eyeq5_clks), }; =20 static const struct eqc_match_data eqc_eyeq5_match_data =3D { - .pll_count =3D ARRAY_SIZE(eqc_eyeq5_plls), - .plls =3D eqc_eyeq5_plls, - - .div_count =3D ARRAY_SIZE(eqc_eyeq5_divs), - .divs =3D eqc_eyeq5_divs, - - .fixed_factor_count =3D ARRAY_SIZE(eqc_eyeq5_fixed_factors), - .fixed_factors =3D eqc_eyeq5_fixed_factors, + .clk_count =3D ARRAY_SIZE(eqc_eyeq5_clks), + .clks =3D eqc_eyeq5_clks, =20 .reset_auxdev_name =3D "reset", .pinctrl_auxdev_name =3D "pinctrl", =20 - .early_clk_count =3D ARRAY_SIZE(eqc_eyeq5_early_plls) + - ARRAY_SIZE(eqc_eyeq5_early_fixed_factors), + .early_clk_count =3D ARRAY_SIZE(eqc_eyeq5_early_clks), }; =20 -static const struct eqc_pll eqc_eyeq6l_plls[] =3D { - { .index =3D EQ6LC_PLL_DDR, .name =3D "pll-ddr", .reg64 =3D 0x02C }, - { .index =3D EQ6LC_PLL_CPU, .name =3D "pll-cpu", .reg64 =3D 0x034 }, /* a= lso acc */ - { .index =3D EQ6LC_PLL_PER, .name =3D "pll-per", .reg64 =3D 0x03C }, - { .index =3D EQ6LC_PLL_VDI, .name =3D "pll-vdi", .reg64 =3D 0x044 }, +static const struct eqc_clock eqc_eyeq6l_clks[] =3D { + PLL_FRACG(EQ6LC_PLL_DDR, PARENT_BY_FWNAME, "pll-ddr", "ref", 0x02C), + PLL_FRACG(EQ6LC_PLL_CPU, PARENT_BY_FWNAME, "pll-cpu", "ref", 0x034), + PLL_FRACG(EQ6LC_PLL_PER, PARENT_BY_FWNAME, "pll-per", "ref", 0x03C), + PLL_FRACG(EQ6LC_PLL_VDI, PARENT_BY_FWNAME, "pll-vdi", "ref", 0x044), }; =20 static const struct eqc_match_data eqc_eyeq6l_match_data =3D { - .pll_count =3D ARRAY_SIZE(eqc_eyeq6l_plls), - .plls =3D eqc_eyeq6l_plls, + .clk_count =3D ARRAY_SIZE(eqc_eyeq6l_clks), + .clks =3D eqc_eyeq6l_clks, =20 .reset_auxdev_name =3D "reset", }; =20 -static const struct eqc_pll eqc_eyeq6lplus_early_plls[] =3D { - { .index =3D EQ6LPC_PLL_CPU, .name =3D "pll-cpu", .reg64 =3D 0x058 }, +static const struct eqc_clock eqc_eyeq6lplus_early_clks[] =3D { + PLL_FRACG(EQ6LPC_PLL_CPU, PARENT_BY_FWNAME, "pll-cpu", "ref", 0x058), + + FF(EQ6LPC_CPU_OCC, EQ6LPC_PLL_CPU, "occ-cpu", NULL, 1, 1), }; =20 -static const struct eqc_pll eqc_eyeq6lplus_plls[] =3D { - { .index =3D EQ6LPC_PLL_DDR, .name =3D "pll-ddr", .reg64 =3D 0x02C }, - { .index =3D EQ6LPC_PLL_ACC, .name =3D "pll-acc", .reg64 =3D 0x034 }, - { .index =3D EQ6LPC_PLL_PER, .name =3D "pll-per", .reg64 =3D 0x03C }, - { .index =3D EQ6LPC_PLL_VDI, .name =3D "pll-vdi", .reg64 =3D 0x044 }, -}; +static const struct eqc_clock eqc_eyeq6lplus_clks[] =3D { + PLL_FRACG(EQ6LPC_PLL_DDR, PARENT_BY_FWNAME, "pll-ddr", "ref", 0x02C), + PLL_FRACG(EQ6LPC_PLL_ACC, PARENT_BY_FWNAME, "pll-acc", "ref", 0x034), + PLL_FRACG(EQ6LPC_PLL_PER, PARENT_BY_FWNAME, "pll-per", "ref", 0x03C), + PLL_FRACG(EQ6LPC_PLL_VDI, PARENT_BY_FWNAME, "pll-vdi", "ref", 0x044), =20 -static const struct eqc_fixed_factor eqc_eyeq6lplus_early_fixed_factors[] = =3D { - { EQ6LPC_CPU_OCC, "occ-cpu", 1, 1, EQ6LPC_PLL_CPU }, -}; + FF(EQ6LPC_DDR_OCC, EQ6LPC_PLL_DDR, "occ-ddr", NULL, 1, 1), =20 -static const struct eqc_fixed_factor eqc_eyeq6lplus_fixed_factors[] =3D { - { EQ6LPC_DDR_OCC, "occ-ddr", 1, 1, EQ6LPC_PLL_DDR }, + FF(EQ6LPC_ACC_VDI, EQ6LPC_PLL_ACC, "vdi-div", NULL, 1, 10), + FF(EQ6LPC_ACC_OCC, EQ6LPC_PLL_ACC, "occ-acc", NULL, 1, 1), + FF(EQ6LPC_ACC_FCMU, EQ6LPC_ACC_OCC, "fcmu-a-clk", NULL, 1, 10), =20 - { EQ6LPC_ACC_VDI, "vdi-div", 1, 10, EQ6LPC_PLL_ACC }, - { EQ6LPC_ACC_OCC, "occ-acc", 1, 1, EQ6LPC_PLL_ACC }, - { EQ6LPC_ACC_FCMU, "fcmu-a-clk", 1, 10, EQ6LPC_ACC_OCC }, + FF(EQ6LPC_PER_OCC, EQ6LPC_PLL_PER, "occ-per", NULL, 1, 1), + FF(EQ6LPC_PER_I2C_SER, EQ6LPC_PER_OCC, "i2c-ser-clk", NULL, 1, 10), + FF(EQ6LPC_PER_PCLK, EQ6LPC_PER_OCC, "pclk", NULL, 1, 4), + FF(EQ6LPC_PER_TSU, EQ6LPC_PER_OCC, "tsu-clk", NULL, 1, 8), + FF(EQ6LPC_PER_OSPI, EQ6LPC_PER_OCC, "ospi-ref-clk", NULL, 1, 10), + FF(EQ6LPC_PER_GPIO, EQ6LPC_PER_OCC, "gpio-clk", NULL, 1, 4), + FF(EQ6LPC_PER_TIMER, EQ6LPC_PER_OCC, "timer-clk", NULL, 1, 4), + FF(EQ6LPC_PER_I2C, EQ6LPC_PER_OCC, "i2c-clk", NULL, 1, 4), + FF(EQ6LPC_PER_UART, EQ6LPC_PER_OCC, "uart-clk", NULL, 1, 4), + FF(EQ6LPC_PER_SPI, EQ6LPC_PER_OCC, "spi-clk", NULL, 1, 4), + FF(EQ6LPC_PER_PERIPH, EQ6LPC_PER_OCC, "periph-clk", NULL, 1, 1), =20 - { EQ6LPC_PER_OCC, "occ-per", 1, 1, EQ6LPC_PLL_PER }, - { EQ6LPC_PER_I2C_SER, "i2c-ser-clk", 1, 10, EQ6LPC_PER_OCC }, - { EQ6LPC_PER_PCLK, "pclk", 1, 4, EQ6LPC_PER_OCC }, - { EQ6LPC_PER_TSU, "tsu-clk", 1, 8, EQ6LPC_PER_OCC }, - { EQ6LPC_PER_OSPI, "ospi-ref-clk", 1, 10, EQ6LPC_PER_OCC }, - { EQ6LPC_PER_GPIO, "gpio-clk", 1, 4, EQ6LPC_PER_OCC }, - { EQ6LPC_PER_TIMER, "timer-clk", 1, 4, EQ6LPC_PER_OCC }, - { EQ6LPC_PER_I2C, "i2c-clk", 1, 4, EQ6LPC_PER_OCC }, - { EQ6LPC_PER_UART, "uart-clk", 1, 4, EQ6LPC_PER_OCC }, - { EQ6LPC_PER_SPI, "spi-clk", 1, 4, EQ6LPC_PER_OCC }, - { EQ6LPC_PER_PERIPH, "periph-clk", 1, 1, EQ6LPC_PER_OCC }, - - { EQ6LPC_VDI_OCC, "occ-vdi", 1, 1, EQ6LPC_PLL_VDI }, + FF(EQ6LPC_VDI_OCC, EQ6LPC_PLL_VDI, "occ-vdi", NULL, 1, 1), }; =20 static const struct eqc_early_match_data eqc_eyeq6lplus_early_match_data _= _initconst =3D { - .early_pll_count =3D ARRAY_SIZE(eqc_eyeq6lplus_early_plls), - .early_plls =3D eqc_eyeq6lplus_early_plls, + .early_clk_count =3D ARRAY_SIZE(eqc_eyeq6lplus_early_clks), + .early_clks =3D eqc_eyeq6lplus_early_clks, =20 - .early_fixed_factor_count =3D ARRAY_SIZE(eqc_eyeq6lplus_early_fixed= _factors), - .early_fixed_factors =3D eqc_eyeq6lplus_early_fixed_factors, - - .late_clk_count =3D ARRAY_SIZE(eqc_eyeq6lplus_plls) + - ARRAY_SIZE(eqc_eyeq6lplus_fixed_factors), + .late_clk_count =3D ARRAY_SIZE(eqc_eyeq6lplus_clks), }; =20 static const struct eqc_match_data eqc_eyeq6lplus_match_data =3D { - .pll_count =3D ARRAY_SIZE(eqc_eyeq6lplus_plls), - .plls =3D eqc_eyeq6lplus_plls, - - .fixed_factor_count =3D ARRAY_SIZE(eqc_eyeq6lplus_fixed_factors), - .fixed_factors =3D eqc_eyeq6lplus_fixed_factors, + .clk_count =3D ARRAY_SIZE(eqc_eyeq6lplus_clks), + .clks =3D eqc_eyeq6lplus_clks, =20 .reset_auxdev_name =3D "reset", .pinctrl_auxdev_name =3D "pinctrl", =20 - .early_clk_count =3D ARRAY_SIZE(eqc_eyeq6lplus_early_plls) + - ARRAY_SIZE(eqc_eyeq6lplus_early_fixed_factors), + .early_clk_count =3D ARRAY_SIZE(eqc_eyeq6lplus_early_clks), }; =20 static const struct eqc_match_data eqc_eyeq6h_west_match_data =3D { .reset_auxdev_name =3D "reset_west", }; =20 -static const struct eqc_pll eqc_eyeq6h_east_plls[] =3D { - { .index =3D 0, .name =3D "pll-east", .reg64 =3D 0x074 }, +static const struct eqc_clock eqc_eyeq6h_east_clks[] =3D { + PLL_FRACG(0, PARENT_BY_FWNAME, "pll-east", "ref", 0x074), }; =20 static const struct eqc_match_data eqc_eyeq6h_east_match_data =3D { - .pll_count =3D ARRAY_SIZE(eqc_eyeq6h_east_plls), - .plls =3D eqc_eyeq6h_east_plls, + .clk_count =3D ARRAY_SIZE(eqc_eyeq6h_east_clks), + .clks =3D eqc_eyeq6h_east_clks, =20 .reset_auxdev_name =3D "reset_east", }; =20 -static const struct eqc_pll eqc_eyeq6h_south_plls[] =3D { - { .index =3D EQ6HC_SOUTH_PLL_VDI, .name =3D "pll-vdi", .reg64 =3D 0x000= }, - { .index =3D EQ6HC_SOUTH_PLL_PCIE, .name =3D "pll-pcie", .reg64 =3D 0x008= }, - { .index =3D EQ6HC_SOUTH_PLL_PER, .name =3D "pll-per", .reg64 =3D 0x010= }, - { .index =3D EQ6HC_SOUTH_PLL_ISP, .name =3D "pll-isp", .reg64 =3D 0x018= }, -}; +static const struct eqc_clock eqc_eyeq6h_south_clks[] =3D { + PLL_FRACG(EQ6HC_SOUTH_PLL_VDI, PARENT_BY_FWNAME, "pll-vdi", "ref", 0x000), + PLL_FRACG(EQ6HC_SOUTH_PLL_PCIE, PARENT_BY_FWNAME, "pll-pcie", "ref", 0x00= 8), + PLL_FRACG(EQ6HC_SOUTH_PLL_PER, PARENT_BY_FWNAME, "pll-per", "ref", 0x010), + PLL_FRACG(EQ6HC_SOUTH_PLL_ISP, PARENT_BY_FWNAME, "pll-isp", "ref", 0x018), =20 -static const struct eqc_div eqc_eyeq6h_south_divs[] =3D { - { - .index =3D EQ6HC_SOUTH_DIV_EMMC, - .name =3D "div-emmc", - .parent =3D EQ6HC_SOUTH_PLL_PER, - .reg =3D 0x070, - .shift =3D 4, - .width =3D 4, - }, - { - .index =3D EQ6HC_SOUTH_DIV_OSPI_REF, - .name =3D "div-ospi-ref", - .parent =3D EQ6HC_SOUTH_PLL_PER, - .reg =3D 0x090, - .shift =3D 4, - .width =3D 4, - }, - { - .index =3D EQ6HC_SOUTH_DIV_OSPI_SYS, - .name =3D "div-ospi-sys", - .parent =3D EQ6HC_SOUTH_PLL_PER, - .reg =3D 0x090, - .shift =3D 8, - .width =3D 1, - }, - { - .index =3D EQ6HC_SOUTH_DIV_TSU, - .name =3D "div-tsu", - .parent =3D EQ6HC_SOUTH_PLL_PCIE, - .reg =3D 0x098, - .shift =3D 4, - .width =3D 8, - }, + DIV(EQ6HC_SOUTH_DIV_EMMC, EQ6HC_SOUTH_PLL_PER, "div-emmc", NULL, 0x070, 4= , 4, NULL), + DIV(EQ6HC_SOUTH_DIV_OSPI_REF, EQ6HC_SOUTH_PLL_PER, "div-ospi-ref", NULL, = 0x090, 4, 4, NULL), + DIV(EQ6HC_SOUTH_DIV_OSPI_SYS, EQ6HC_SOUTH_PLL_PER, "div-ospi-sys", NULL, = 0x090, 8, 1, NULL), + DIV(EQ6HC_SOUTH_DIV_TSU, EQ6HC_SOUTH_PLL_PCIE, "div-tsu", NULL, 0x098, 4,= 8, NULL), }; =20 static const struct eqc_match_data eqc_eyeq6h_south_match_data =3D { - .pll_count =3D ARRAY_SIZE(eqc_eyeq6h_south_plls), - .plls =3D eqc_eyeq6h_south_plls, - - .div_count =3D ARRAY_SIZE(eqc_eyeq6h_south_divs), - .divs =3D eqc_eyeq6h_south_divs, + .clk_count =3D ARRAY_SIZE(eqc_eyeq6h_south_clks), + .clks =3D eqc_eyeq6h_south_clks, }; =20 -static const struct eqc_pll eqc_eyeq6h_ddr0_plls[] =3D { - { .index =3D 0, .name =3D "pll-ddr0", .reg64 =3D 0x074 }, +static const struct eqc_clock eqc_eyeq6h_ddr0_clks[] =3D { + PLL_FRACG(0, PARENT_BY_FWNAME, "pll-ddr0", "ref", 0x074), }; =20 static const struct eqc_match_data eqc_eyeq6h_ddr0_match_data =3D { - .pll_count =3D ARRAY_SIZE(eqc_eyeq6h_ddr0_plls), - .plls =3D eqc_eyeq6h_ddr0_plls, + .clk_count =3D ARRAY_SIZE(eqc_eyeq6h_ddr0_clks), + .clks =3D eqc_eyeq6h_ddr0_clks, }; =20 -static const struct eqc_pll eqc_eyeq6h_ddr1_plls[] =3D { - { .index =3D 0, .name =3D "pll-ddr1", .reg64 =3D 0x074 }, +static const struct eqc_clock eqc_eyeq6h_ddr1_clks[] =3D { + PLL_FRACG(0, PARENT_BY_FWNAME, "pll-ddr1", "ref", 0x074), }; =20 static const struct eqc_match_data eqc_eyeq6h_ddr1_match_data =3D { - .pll_count =3D ARRAY_SIZE(eqc_eyeq6h_ddr1_plls), - .plls =3D eqc_eyeq6h_ddr1_plls, + .clk_count =3D ARRAY_SIZE(eqc_eyeq6h_ddr1_clks), + .clks =3D eqc_eyeq6h_ddr1_clks, }; =20 -static const struct eqc_pll eqc_eyeq6h_acc_plls[] =3D { - { .index =3D EQ6HC_ACC_PLL_XNN, .name =3D "pll-xnn", .reg64 =3D 0x040 }, - { .index =3D EQ6HC_ACC_PLL_VMP, .name =3D "pll-vmp", .reg64 =3D 0x050 }, - { .index =3D EQ6HC_ACC_PLL_PMA, .name =3D "pll-pma", .reg64 =3D 0x05C }, - { .index =3D EQ6HC_ACC_PLL_MPC, .name =3D "pll-mpc", .reg64 =3D 0x068 }, - { .index =3D EQ6HC_ACC_PLL_NOC, .name =3D "pll-noc", .reg64 =3D 0x070 }, +static const struct eqc_clock eqc_eyeq6h_acc_clks[] =3D { + PLL_FRACG(EQ6HC_ACC_PLL_XNN, PARENT_BY_FWNAME, "pll-xnn", "ref", 0x040), + PLL_FRACG(EQ6HC_ACC_PLL_VMP, PARENT_BY_FWNAME, "pll-vmp", "ref", 0x050), + PLL_FRACG(EQ6HC_ACC_PLL_PMA, PARENT_BY_FWNAME, "pll-pma", "ref", 0x05C), + PLL_FRACG(EQ6HC_ACC_PLL_MPC, PARENT_BY_FWNAME, "pll-mpc", "ref", 0x068), + PLL_FRACG(EQ6HC_ACC_PLL_NOC, PARENT_BY_FWNAME, "pll-noc", "ref", 0x070), }; =20 static const struct eqc_match_data eqc_eyeq6h_acc_match_data =3D { - .pll_count =3D ARRAY_SIZE(eqc_eyeq6h_acc_plls), - .plls =3D eqc_eyeq6h_acc_plls, + .clk_count =3D ARRAY_SIZE(eqc_eyeq6h_acc_clks), + .clks =3D eqc_eyeq6h_acc_clks, =20 .reset_auxdev_name =3D "reset_acc", }; @@ -940,38 +866,28 @@ static struct platform_driver eqc_driver =3D { builtin_platform_driver(eqc_driver); =20 /* Required early for GIC timer. */ -static const struct eqc_pll eqc_eyeq6h_central_early_plls[] =3D { - { .index =3D EQ6HC_CENTRAL_PLL_CPU, .name =3D "pll-cpu", .reg64 =3D 0x02C= }, -}; +static const struct eqc_clock eqc_eyeq6h_central_early_clks[] =3D { + PLL_FRACG(EQ6HC_CENTRAL_PLL_CPU, PARENT_BY_FWNAME, "pll-cpu", "ref", 0x02= C), =20 -static const struct eqc_fixed_factor eqc_eyeq6h_central_early_fixed_factor= s[] =3D { - { EQ6HC_CENTRAL_CPU_OCC, "occ-cpu", 1, 1, EQ6HC_CENTRAL_PLL_CPU }, + FF(EQ6HC_CENTRAL_CPU_OCC, EQ6HC_CENTRAL_PLL_CPU, "occ-cpu", NULL, 1, 1), }; =20 static const struct eqc_early_match_data eqc_eyeq6h_central_early_match_da= ta __initconst =3D { - .early_pll_count =3D ARRAY_SIZE(eqc_eyeq6h_central_early_plls), - .early_plls =3D eqc_eyeq6h_central_early_plls, - - .early_fixed_factor_count =3D ARRAY_SIZE(eqc_eyeq6h_central_early_fixed_f= actors), - .early_fixed_factors =3D eqc_eyeq6h_central_early_fixed_factors, + .early_clk_count =3D ARRAY_SIZE(eqc_eyeq6h_central_early_clks), + .early_clks =3D eqc_eyeq6h_central_early_clks, }; =20 /* Required early for UART. */ -static const struct eqc_pll eqc_eyeq6h_west_early_plls[] =3D { - { .index =3D EQ6HC_WEST_PLL_PER, .name =3D "pll-west", .reg64 =3D 0x074 }, -}; +static const struct eqc_clock eqc_eyeq6h_west_early_clks[] =3D { + PLL_FRACG(EQ6HC_WEST_PLL_PER, PARENT_BY_FWNAME, "pll-west", "ref", 0x074), =20 -static const struct eqc_fixed_factor eqc_eyeq6h_west_early_fixed_factors[]= =3D { - { EQ6HC_WEST_PER_OCC, "west-per-occ", 1, 10, EQ6HC_WEST_PLL_PER }, - { EQ6HC_WEST_PER_UART, "west-per-uart", 1, 1, EQ6HC_WEST_PER_OCC }, + FF(EQ6HC_WEST_PER_OCC, EQ6HC_WEST_PLL_PER, "west-per-occ", NULL, 1, 10), + FF(EQ6HC_WEST_PER_UART, EQ6HC_WEST_PER_OCC, "west-per-uart", NULL, 1, 1), }; =20 static const struct eqc_early_match_data eqc_eyeq6h_west_early_match_data = __initconst =3D { - .early_pll_count =3D ARRAY_SIZE(eqc_eyeq6h_west_early_plls), - .early_plls =3D eqc_eyeq6h_west_early_plls, - - .early_fixed_factor_count =3D ARRAY_SIZE(eqc_eyeq6h_west_early_fixed_fact= ors), - .early_fixed_factors =3D eqc_eyeq6h_west_early_fixed_factors, + .early_clk_count =3D ARRAY_SIZE(eqc_eyeq6h_west_early_clks), + .early_clks =3D eqc_eyeq6h_west_early_clks, }; =20 static void __init eqc_early_init(struct device_node *np, --=20 2.52.0 From nobody Sun Feb 8 11:41:14 2026 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 9B61B38B7CB; Wed, 14 Jan 2026 10:05:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385152; cv=none; b=orKMqzVPjNU1da1G98Pl5uN71lX0FkE2XChfuJBlc6Pg3bn3jjWhKsLTQroxibrgJgcybMez7ZV8nvUO/zuWwe2dEbf5kUlUkosssBAd7KOPSuIwxfJ/HF2oOnlrdWcQpNCP4ZucYUAYXJTT8LTB5r/dTWbcPTVeG9TtvnC5TvQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385152; c=relaxed/simple; bh=BLD8W7ClmHDW/ZXycM/zlyhMswKAsP2V0GhTHkhbva8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nzmMqqiFKsW8Rekx9aYBUrk3x+MxUor4vkwbdF8HGv2iPgDBt5u7ZAp+kgBqrSCKjJrfhNZLKA6m9maJj61IK7nuW+T7425fHQ9Z+lFSPtJZZRK7UqBY/aHEzO1YMm2NTOluiywLwJ7aMaPeoNUz+rWLBi0NikHR9uhK/+nOHBA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=I3F5Oj7L; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="I3F5Oj7L" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 1EBC71A285E; Wed, 14 Jan 2026 10:05:48 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id E2B9E6074A; Wed, 14 Jan 2026 10:05:47 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 45CAB103C89F1; Wed, 14 Jan 2026 11:05:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1768385147; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=aVE7hnu1txQ+OMtXUHZgmd5s4b19QEw+eL/+H0f5ckk=; b=I3F5Oj7LRIgtjuwauCPzjv31mQW/LC6bqM43oot1YAoujmwUEsVOkyMWuPU8+WkeNIc7GJ 9Sx4Ov3ENoBPC5TbT/1uKfcErjMlbYtjRHDa3hiueWE4u4dNTym5wVXGnwkCD/nDTosCgp MfS0VTVyW+wqd3fOqN1aSQOLH7Th/EkMxxJAHf1s3C6Len4qbqZtHuuODuHQle+vfrNXsl H+5q1j6jBapbC9n2mdoBA+UceATrp6socnxR+Fq6rwuUhKTNB9Sr9bywBPKdkwlujGOu+j 4IpRpm3P3QNGchiTbrcu4GsJVrzc1f4vbdUbP4nQ0fzcshWQDKpXmTjXvXjVKQ== From: =?utf-8?q?Beno=C3=AEt_Monin?= Date: Wed, 14 Jan 2026 11:05:12 +0100 Subject: [PATCH v3 08/10] clk: eyeq: Drop PLL, dividers, and fixed factors structs Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260114-clk-eyeq7-v3-8-8ebdba7b0133@bootlin.com> References: <20260114-clk-eyeq7-v3-0-8ebdba7b0133@bootlin.com> In-Reply-To: <20260114-clk-eyeq7-v3-0-8ebdba7b0133@bootlin.com> To: Vladimir Kondratiev , Gregory CLEMENT , =?utf-8?q?Th=C3=A9o_Lebrun?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , Philipp Zabel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: Thomas Petazzoni , Tawfik Bayouk , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-mips@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Monin?= X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Now that there are no users of the eqc_pll, eqc_div, and eqc_fixed_factor structures since they have been converted to eqc_clock, remove these structs and the code related to their parsing in probe and early initialization. Signed-off-by: Beno=C3=AEt Monin --- drivers/clk/clk-eyeq.c | 192 +--------------------------------------------= ---- 1 file changed, 3 insertions(+), 189 deletions(-) diff --git a/drivers/clk/clk-eyeq.c b/drivers/clk/clk-eyeq.c index 7a4b465d87fb..a1221f30c16b 100644 --- a/drivers/clk/clk-eyeq.c +++ b/drivers/clk/clk-eyeq.c @@ -78,33 +78,6 @@ #define PARENT_BY_FWNAME (-1) #define PARENT_BY_NAME (-2) =20 -struct eqc_pll { - unsigned int index; - const char *name; - unsigned int reg64; -}; - -/* - * Divider clock. Divider is 2*(v+1), with v the register value. - * Min divider is 2, max is 2*(2^width). - */ -struct eqc_div { - unsigned int index; - const char *name; - unsigned int parent; - unsigned int reg; - u8 shift; - u8 width; -}; - -struct eqc_fixed_factor { - unsigned int index; - const char *name; - unsigned int mult; - unsigned int div; - unsigned int parent; -}; - struct eqc_clock { int index; int parent_idx; @@ -132,15 +105,6 @@ struct eqc_clock { }; =20 struct eqc_match_data { - unsigned int pll_count; - const struct eqc_pll *plls; - - unsigned int div_count; - const struct eqc_div *divs; - - unsigned int fixed_factor_count; - const struct eqc_fixed_factor *fixed_factors; - unsigned int clk_count; const struct eqc_clock *clks; =20 @@ -151,12 +115,6 @@ struct eqc_match_data { }; =20 struct eqc_early_match_data { - unsigned int early_pll_count; - const struct eqc_pll *early_plls; - - unsigned int early_fixed_factor_count; - const struct eqc_fixed_factor *early_fixed_factors; - unsigned int early_clk_count; const struct eqc_clock *early_clks; =20 @@ -269,97 +227,6 @@ static int eqc_pll_parse_fracg(void __iomem *base, uns= igned long *mult, return 0; } =20 -static void eqc_probe_init_plls(struct device *dev, const struct eqc_match= _data *data, - void __iomem *base, struct clk_hw_onecell_data *cells) -{ - unsigned long mult, div, acc; - const struct eqc_pll *pll; - struct clk_hw *hw; - unsigned int i; - int ret; - - for (i =3D 0; i < data->pll_count; i++) { - pll =3D &data->plls[i]; - - ret =3D eqc_pll_parse_fracg(base + pll->reg64, &mult, &div, &acc); - if (ret) { - dev_warn(dev, "failed parsing state of %s\n", pll->name); - cells->hws[pll->index] =3D ERR_PTR(ret); - continue; - } - - hw =3D clk_hw_register_fixed_factor_with_accuracy_fwname(dev, - dev->of_node, pll->name, "ref", 0, mult, div, acc); - cells->hws[pll->index] =3D hw; - if (IS_ERR(hw)) - dev_warn(dev, "failed registering %s: %pe\n", pll->name, hw); - } -} - -static void eqc_probe_init_divs(struct device *dev, const struct eqc_match= _data *data, - void __iomem *base, struct clk_hw_onecell_data *cells) -{ - struct clk_parent_data parent_data =3D { }; - const struct eqc_div *div; - struct clk_hw *parent; - void __iomem *reg; - struct clk_hw *hw; - unsigned int i; - - for (i =3D 0; i < data->div_count; i++) { - div =3D &data->divs[i]; - reg =3D base + div->reg; - parent =3D cells->hws[div->parent]; - - if (IS_ERR(parent)) { - /* Parent is in early clk provider. */ - parent_data.index =3D div->parent; - parent_data.hw =3D NULL; - } else { - /* Avoid clock lookup when we already have the hw reference. */ - parent_data.index =3D 0; - parent_data.hw =3D parent; - } - - hw =3D clk_hw_register_divider_table_parent_data(dev, div->name, - &parent_data, 0, reg, div->shift, div->width, - CLK_DIVIDER_EVEN_INTEGERS, NULL, NULL); - cells->hws[div->index] =3D hw; - if (IS_ERR(hw)) - dev_warn(dev, "failed registering %s: %pe\n", - div->name, hw); - } -} - -static void eqc_probe_init_fixed_factors(struct device *dev, - const struct eqc_match_data *data, - struct clk_hw_onecell_data *cells) -{ - const struct eqc_fixed_factor *ff; - struct clk_hw *hw, *parent_hw; - unsigned int i; - - for (i =3D 0; i < data->fixed_factor_count; i++) { - ff =3D &data->fixed_factors[i]; - parent_hw =3D cells->hws[ff->parent]; - - if (IS_ERR(parent_hw)) { - /* Parent is in early clk provider. */ - hw =3D clk_hw_register_fixed_factor_index(dev, ff->name, - ff->parent, 0, ff->mult, ff->div); - } else { - /* Avoid clock lookup when we already have the hw reference. */ - hw =3D clk_hw_register_fixed_factor_parent_hw(dev, ff->name, - parent_hw, 0, ff->mult, ff->div); - } - - cells->hws[ff->index] =3D hw; - if (IS_ERR(hw)) - dev_warn(dev, "failed registering %s: %pe\n", - ff->name, hw); - } -} - static void eqc_auxdev_release(struct device *dev) { struct auxiliary_device *adev =3D to_auxiliary_dev(dev); @@ -528,12 +395,10 @@ static int eqc_probe(struct platform_device *pdev) KBUILD_MODNAME, data->pinctrl_auxdev_name, ret); } =20 - if (data->pll_count + data->div_count + data->fixed_factor_count + data->= clk_count =3D=3D 0) + if (data->clk_count =3D=3D 0) return 0; /* Zero clocks, we are done. */ =20 - clk_count =3D data->pll_count + data->div_count + - data->fixed_factor_count + data->clk_count - + data->early_clk_count; + clk_count =3D data->clk_count + data->early_clk_count; cells =3D kzalloc(struct_size(cells, hws, clk_count), GFP_KERNEL); if (!cells) return -ENOMEM; @@ -544,12 +409,6 @@ static int eqc_probe(struct platform_device *pdev) for (i =3D 0; i < clk_count; i++) cells->hws[i] =3D ERR_PTR(-EINVAL); =20 - eqc_probe_init_plls(dev, data, base, cells); - - eqc_probe_init_divs(dev, data, base, cells); - - eqc_probe_init_fixed_factors(dev, data, cells); - for (i =3D 0; i < data->clk_count; i++) { const struct eqc_clock *clk =3D &data->clks[i]; =20 @@ -898,8 +757,7 @@ static void __init eqc_early_init(struct device_node *n= p, void __iomem *base; int ret; =20 - clk_count =3D early_data->early_pll_count + early_data->early_fixed_facto= r_count + - early_data->early_clk_count + early_data->late_clk_count; + clk_count =3D early_data->early_clk_count + early_data->late_clk_count; cells =3D kzalloc(struct_size(cells, hws, clk_count), GFP_KERNEL); if (!cells) { ret =3D -ENOMEM; @@ -925,42 +783,6 @@ static void __init eqc_early_init(struct device_node *= np, goto err; } =20 - for (i =3D 0; i < early_data->early_pll_count; i++) { - const struct eqc_pll *pll =3D &early_data->early_plls[i]; - unsigned long mult, div, acc; - struct clk_hw *hw; - - ret =3D eqc_pll_parse_fracg(base + pll->reg64, &mult, &div, &acc); - if (ret) { - pr_err("failed parsing state of %s\n", pll->name); - goto err; - } - - hw =3D clk_hw_register_fixed_factor_with_accuracy_fwname(NULL, - np, pll->name, "ref", 0, mult, div, acc); - cells->hws[pll->index] =3D hw; - if (IS_ERR(hw)) { - pr_err("failed registering %s: %pe\n", pll->name, hw); - ret =3D PTR_ERR(hw); - goto err; - } - } - - for (i =3D 0; i < early_data->early_fixed_factor_count; i++) { - const struct eqc_fixed_factor *ff =3D &early_data->early_fixed_factors[i= ]; - struct clk_hw *parent_hw =3D cells->hws[ff->parent]; - struct clk_hw *hw; - - hw =3D clk_hw_register_fixed_factor_parent_hw(NULL, ff->name, - parent_hw, 0, ff->mult, ff->div); - cells->hws[ff->index] =3D hw; - if (IS_ERR(hw)) { - pr_err("failed registering %s: %pe\n", ff->name, hw); - ret =3D PTR_ERR(hw); - goto err; - } - } - for (i =3D 0; i < early_data->early_clk_count; i++) { const struct eqc_clock *clk =3D &early_data->early_clks[i]; =20 @@ -995,14 +817,6 @@ static void __init eqc_early_init(struct device_node *= np, if (cells) { of_clk_del_provider(np); =20 - for (i =3D 0; i < early_data->early_pll_count; i++) { - const struct eqc_pll *pll =3D &early_data->early_plls[i]; - struct clk_hw *hw =3D cells->hws[pll->index]; - - if (!IS_ERR_OR_NULL(hw)) - clk_hw_unregister_fixed_factor(hw); - } - for (i =3D 0; i < early_data->early_clk_count; i++) { const struct eqc_clock *clk =3D &early_data->early_clks[i]; struct clk_hw *hw =3D cells->hws[clk->index]; --=20 2.52.0 From nobody Sun Feb 8 11:41:14 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 3D4D038B7DC; Wed, 14 Jan 2026 10:05:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385154; cv=none; b=qRwHUuJ8n9R5BkdY6N8QbsicmrNsBml0ul3o91PfHVUSRySPvbT+Vg+Wls08m5fssDDZ1bXEzCEajpNUeaAYmIIgq0U/IvamHc6H9dPGwLrfamL0y3ueXTw+BbvTm4a3SzhbZ9HNV0Z2l1w4N/FJ9dEdB0pE2sL9RPElQE0q/Ts= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385154; c=relaxed/simple; bh=BbURIiZY46GxEL5Y1Wcc8+DtjIs2CQpM+K8yiac2jvU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NSAZLPnDtdVBWGdyuuKbmT9rs4hJsgrvt9sGfJ/lmYXsWtCvMI6ILhONbPWGGY0Mbc7MAD3rQzzShduThWSLwa+3ydOWslgj7m9+D3leLi2pzbP0S4GfrdD1TN6MdnmDACr+nu7KdlRDX/s1ahUrC3LBewIk9ki9eBmZoU3m+Ho= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=mDXkZ34D; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="mDXkZ34D" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id F0B2FC1F1C5; Wed, 14 Jan 2026 10:05:22 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 969876074A; Wed, 14 Jan 2026 10:05:49 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 408E1103C89D0; Wed, 14 Jan 2026 11:05:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1768385148; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=TJhjKcsiz0Gu1wluUbfKT08L4DEsVxc2BF0oj9+w4Kg=; b=mDXkZ34DJIzOkr7bVGnWn1lal5BYjyfg5125NYmVBlKhZ+UdpBRlMr2a6CGgxpxtLpwQ7O 1mKVl3h1NwtE7wmSQgP9EWsqjOqwjONwltMVrChCykzCGFmnSDiD/OggM6ivQ4IzisVS/t Z3Ss4UBeOEKdGsvp0Gu+WahL/CPCscaWsfnjKxu3WkKFLiLqWuthrDnOExU0baA+bNhUSs dH0iW7ACP+Yr35fAZiDHzFWVdXdkTwSanMEcZrbqAFptgeQjtQ2ruNQVRn6XMTc41Ke9XO PG6VN5FDjASRsKpY4yhwr/BMRirLw07BNrkr8iavsqyonQJ37SzeOzzJ9X2y6Q== From: =?utf-8?q?Beno=C3=AEt_Monin?= Date: Wed, 14 Jan 2026 11:05:13 +0100 Subject: [PATCH v3 09/10] clk: eyeq: Add EyeQ7H compatibles Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260114-clk-eyeq7-v3-9-8ebdba7b0133@bootlin.com> References: <20260114-clk-eyeq7-v3-0-8ebdba7b0133@bootlin.com> In-Reply-To: <20260114-clk-eyeq7-v3-0-8ebdba7b0133@bootlin.com> To: Vladimir Kondratiev , Gregory CLEMENT , =?utf-8?q?Th=C3=A9o_Lebrun?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , Philipp Zabel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: Thomas Petazzoni , Tawfik Bayouk , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-mips@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Monin?= X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Add the entries for the 14 Other Logic Blocks found in the EyeQ7H SoC. The clock tree is more complex than the previous generation of SoC, as some OLB depend on the clock output of other OLB instead of all referring to the main oscillator. The OLB south, east and west generate those reference clocks used by other blocks. They also use the reference clock internally. The reference clock provided by OLB south is named "ref_100p0", "ref_106p6_e" by OLB east and "ref_106p6_w" by OLB west. For the OLB with a single parent clock, We use the same logic as the blocks found in previous SoC and refer to it with the name "ref". The OLB with two parent clocks use the reference clock provided by the OLB south, east and west as "ref_100p0" and "ref_106p6" and the main oscillator as "ref". The reset controllers found is 11 of the OLB are declared as auxiliary device attached to the clock device. Also add the functions to parse the registers of the two types of PLL in the EyeQ7H OLB. The JFRACR PLL have similar properties as the FRACG PLL, but its configuration is spread on three registers instead of two. It also have a wider fractional part for the multiplier on 24 bits instead of 20. The AINTP PLL does not support spread spectrum and uses a single register. It is registered as a fixed factor without the flag CLK_FIXED_FACTOR_FIXED_ACCURACY and thus inherit the accuracy of its parent clock. Signed-off-by: Beno=C3=AEt Monin --- drivers/clk/clk-eyeq.c | 495 +++++++++++++++++++++++++++++++++++++++++++++= +++- 1 file changed, 494 insertions(+), 1 deletion(-) diff --git a/drivers/clk/clk-eyeq.c b/drivers/clk/clk-eyeq.c index a1221f30c16b..4ae3e8ba63d9 100644 --- a/drivers/clk/clk-eyeq.c +++ b/drivers/clk/clk-eyeq.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * PLL clock driver for the Mobileye EyeQ5, EyeQ6L and EyeQ6H platforms. + * PLL clock driver for the Mobileye EyeQ platforms. * * This controller handles: * - Read-only PLLs, all derived from the same main crystal clock. @@ -46,6 +46,7 @@ =20 #include #include +#include =20 /* In frac mode, it enables fractional noise canceling DAC. Else, no funct= ion. */ #define FRACG_PCSR0_DAC_EN BIT(0) @@ -71,6 +72,41 @@ #define FRACG_PCSR1_DOWN_SPREAD BIT(11) #define FRACG_PCSR1_FRAC_IN GENMASK(31, 12) =20 +#define JFRACR_PCSR0_BYPASS BIT(0) +#define JFRACR_PCSR0_PLL_EN BIT(1) +#define JFRACR_PCSR0_FOUTVCO_EN BIT(2) +#define JFRACR_PCSR0_FOUTPOSTDIV_EN BIT(3) +#define JFRACR_PCSR0_POST_DIV1 GENMASK(6, 4) +#define JFRACR_PCSR0_POST_DIV2 GENMASK(9, 7) +#define JFRACR_PCSR0_REF_DIV GENMASK(15, 10) +#define JFRACR_PCSR0_FB_DIV GENMASK(27, 16) +#define JFRACR_PCSR0_VCO_SEL GENMASK(29, 28) +#define JFRACR_PCSR0_PLL_LOCKED GENMASK(31, 30) + +#define JFRACR_PCSR1_FRAC_IN GENMASK(23, 0) +#define JFRACR_PCSR1_FOUT4PHASE_EN BIT(24) +#define JFRACR_PCSR1_DAC_EN BIT(25) +#define JFRACR_PCSR1_DSM_EN BIT(26) +/* Bits 31..27 are reserved */ +#define JFRACR_PCSR2_RESET BIT(0) +#define JFRACR_PCSR2_DIS_SSCG BIT(1) +#define JFRACR_PCSR2_DOWN_SPREAD BIT(2) +#define JFRACR_PCSR2_SSGC_DIV GENMASK(7, 4) +#define JFRACR_PCSR2_SPREAD GENMASK(12, 8) +/* Bits 31..13 are reserved */ + +#define AINTP_PCSR_BYPASS BIT(0) +#define AINTP_PCSR_PLL_EN BIT(1) +#define AINTP_PCSR_FOUTVCO_EN BIT(2) +#define AINTP_PCSR_FOUTPOSTDIV_EN BIT(3) +#define AINTP_PCSR_POST_DIV1 GENMASK(6, 4) +#define AINTP_PCSR_POST_DIV2 GENMASK(9, 7) +#define AINTP_PCSR_REF_DIV GENMASK(15, 10) +#define AINTP_PCSR_FB_DIV GENMASK(27, 16) +#define AINTP_PCSR_VCO_SEL GENMASK(29, 28) +/* bit 30 is reserved */ +#define AINTP_PCSR_PLL_LOCKED BIT(31) + /* * Special index values to lookup a parent clock by its name * from the device tree or by its globally unique name. @@ -158,6 +194,29 @@ static void eqc_pll_downshift_factors(unsigned long *m= ult, unsigned long *div) *div >>=3D shift; } =20 +static int eqc_pll_parse_aintp(void __iomem *base, unsigned long *mult, un= signed long *div) +{ + u32 r0; + + r0 =3D readl(base); + if (r0 & AINTP_PCSR_BYPASS) { + *mult =3D 1; + *div =3D 1; + return 0; + } + + if (!(r0 & AINTP_PCSR_PLL_LOCKED)) + return -EINVAL; + + *mult =3D FIELD_GET(AINTP_PCSR_FB_DIV, r0); + *div =3D FIELD_GET(AINTP_PCSR_REF_DIV, r0); + + if (!*mult || !*div) + return -EINVAL; + + return 0; +} + static int eqc_pll_parse_fracg(void __iomem *base, unsigned long *mult, unsigned long *div, unsigned long *acc) { @@ -227,6 +286,60 @@ static int eqc_pll_parse_fracg(void __iomem *base, uns= igned long *mult, return 0; } =20 +static int eqc_pll_parse_jfracr(void __iomem *base, unsigned long *mult, + unsigned long *div, unsigned long *acc) +{ + unsigned long spread; + u32 r0, r1, r2; + u64 val; + + val =3D readq(base); + r0 =3D val; + r1 =3D val >> 32; + r2 =3D readl(base + 8); + + if (r0 & JFRACR_PCSR0_BYPASS) { + *mult =3D 1; + *div =3D 1; + *acc =3D 0; + return 0; + } + + if (!(r0 & JFRACR_PCSR0_PLL_LOCKED)) + return -EINVAL; + + *mult =3D FIELD_GET(JFRACR_PCSR0_FB_DIV, r0); + *div =3D FIELD_GET(JFRACR_PCSR0_REF_DIV, r0); + + /* fractional part on 24 bits */ + if (r1 & JFRACR_PCSR1_DSM_EN) { + *div *=3D (1ULL << 24); + *mult =3D *mult * (1ULL << 24) + FIELD_GET(JFRACR_PCSR1_FRAC_IN, r1); + } + + if (!*mult || !*div) + return -EINVAL; + + if (r2 & (JFRACR_PCSR2_RESET | JFRACR_PCSR2_DIS_SSCG)) { + *acc =3D 0; + return 0; + } + + /* spread spectrum is identical to FRACG PLL */ + spread =3D FIELD_GET(JFRACR_PCSR2_SPREAD, r2); + *acc =3D DIV_ROUND_CLOSEST(spread * 1000000000, 1024 * 2); + + if (r2 & JFRACR_PCSR2_DOWN_SPREAD) { + *mult *=3D 2048 - spread; + *div *=3D 2048; + } + + /* make sure mult and div fit in 32 bits */ + eqc_pll_downshift_factors(mult, div); + + return 0; +} + static void eqc_auxdev_release(struct device *dev) { struct auxiliary_device *adev =3D to_auxiliary_dev(dev); @@ -330,6 +443,33 @@ static int eqc_probe_fixed_factor(struct device *dev, = struct device_node *np, return 0; } =20 +static int eqc_probe_pll_aintp(struct device *dev, struct device_node *np, + const struct eqc_clock *clk, void __iomem *base, + struct clk_hw_onecell_data *cells) +{ + struct clk_parent_data parent_data =3D { }; + unsigned long mult, div; + struct clk_hw *hw; + int ret; + + ret =3D eqc_pll_parse_aintp(base + clk->pll.reg, &mult, &div); + if (ret) + return ret; + + ret =3D eqc_fill_parent_data(clk, cells, &parent_data); + if (ret) + return ret; + + hw =3D clk_hw_register_fixed_factor_pdata(dev, np, clk->name, &parent_dat= a, + 0, mult, div, 0, 0); + + if (IS_ERR(hw)) + return IS_ERR(hw); + + cells->hws[clk->index] =3D hw; + return 0; +} + static int eqc_probe_pll_fracg(struct device *dev, struct device_node *np, const struct eqc_clock *clk, void __iomem *base, struct clk_hw_onecell_data *cells) @@ -356,6 +496,32 @@ static int eqc_probe_pll_fracg(struct device *dev, str= uct device_node *np, return 0; } =20 +static int eqc_probe_pll_jfracr(struct device *dev, struct device_node *np, + const struct eqc_clock *clk, void __iomem *base, + struct clk_hw_onecell_data *cells) +{ + struct clk_parent_data parent_data =3D { }; + unsigned long mult, div, acc; + struct clk_hw *hw; + int ret; + + ret =3D eqc_pll_parse_jfracr(base + clk->pll.reg, &mult, &div, &acc); + if (ret) + return ret; + + ret =3D eqc_fill_parent_data(clk, cells, &parent_data); + if (ret) + return ret; + + hw =3D clk_hw_register_fixed_factor_pdata(dev, np, clk->name, &parent_dat= a, 0, mult, + div, acc, CLK_FIXED_FACTOR_FIXED_ACCURACY); + if (IS_ERR(hw)) + return IS_ERR(hw); + + cells->hws[clk->index] =3D hw; + return 0; +} + static int eqc_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; @@ -450,6 +616,17 @@ static int eqc_probe(struct platform_device *pdev) .ff.div =3D _div, \ } =20 +#define PLL_AINTP(_index, _parent_idx, _name, _parent_name, _reg) \ + { \ + .index =3D _index, \ + .parent_idx =3D _parent_idx, \ + .name =3D _name, \ + .parent_name =3D _parent_name, \ + .probe =3D eqc_probe_pll_aintp, \ + .unregister =3D clk_hw_unregister_fixed_factor, \ + .pll.reg =3D _reg, \ + } + #define PLL_FRACG(_index, _parent_idx, _name, _parent_name, _reg) \ { \ .index =3D _index, \ @@ -461,6 +638,17 @@ static int eqc_probe(struct platform_device *pdev) .pll.reg =3D _reg, \ } =20 +#define PLL_JFRACR(_index, _parent_idx, _name, _parent_name, _reg) \ + { \ + .index =3D _index, \ + .parent_idx =3D _parent_idx, \ + .name =3D _name, \ + .parent_name =3D _parent_name, \ + .probe =3D eqc_probe_pll_jfracr, \ + .unregister =3D clk_hw_unregister_fixed_factor, \ + .pll.reg =3D _reg, \ + } + enum { /* * EQ5C_PLL_CPU children. @@ -701,6 +889,295 @@ static const struct eqc_match_data eqc_eyeq6h_acc_mat= ch_data =3D { .reset_auxdev_name =3D "reset_acc", }; =20 +static const struct eqc_clock eqc_eyeq7h_acc0_clks[] =3D { + PLL_AINTP(EQ7HC_ACC_PLL_VMP, PARENT_BY_FWNAME, "pll-acc0-vmp", "ref_100p0= ", 0x400), + PLL_AINTP(EQ7HC_ACC_PLL_MPC, PARENT_BY_FWNAME, "pll-acc0-mpc", "ref_100p0= ", 0x404), + PLL_AINTP(EQ7HC_ACC_PLL_PMA, PARENT_BY_FWNAME, "pll-acc0-pma", "ref_100p0= ", 0x408), + PLL_AINTP(EQ7HC_ACC_PLL_NOC, PARENT_BY_FWNAME, "pll-acc0-noc-acc", "ref_1= 06p6", 0x40c), + + FF(EQ7HC_ACC_DIV_PMA, EQ7HC_ACC_PLL_PMA, "acc0_pma", NULL, 1, 2), + FF(EQ7HC_ACC_DIV_NCORE, EQ7HC_ACC_PLL_NOC, "acc0_ncore", NULL, 1, 2), + FF(EQ7HC_ACC_DIV_CFG, EQ7HC_ACC_PLL_NOC, "acc0_cfg", NULL, 1, 8), +}; + +static const struct eqc_match_data eqc_eyeq7h_acc0_match_data =3D { + .clk_count =3D ARRAY_SIZE(eqc_eyeq7h_acc0_clks), + .clks =3D eqc_eyeq7h_acc0_clks, + + .reset_auxdev_name =3D "reset_acc0", +}; + +static const struct eqc_clock eqc_eyeq7h_acc1_clks[] =3D { + PLL_AINTP(EQ7HC_ACC_PLL_VMP, PARENT_BY_FWNAME, "pll-acc1-vmp", "ref_100p0= ", 0x400), + PLL_AINTP(EQ7HC_ACC_PLL_MPC, PARENT_BY_FWNAME, "pll-acc1-mpc", "ref_100p0= ", 0x404), + PLL_AINTP(EQ7HC_ACC_PLL_PMA, PARENT_BY_FWNAME, "pll-acc1-pma", "ref_100p0= ", 0x408), + PLL_AINTP(EQ7HC_ACC_PLL_NOC, PARENT_BY_FWNAME, "pll-acc1-noc-acc", "ref_1= 06p6", 0x40c), +}; + +static const struct eqc_match_data eqc_eyeq7h_acc1_match_data =3D { + .clk_count =3D ARRAY_SIZE(eqc_eyeq7h_acc1_clks), + .clks =3D eqc_eyeq7h_acc1_clks, + + .reset_auxdev_name =3D "reset_acc1", +}; + +static const struct clk_div_table eqc_eyeq7h_ddr_apb_div_table[] =3D { + { .val =3D 0, .div =3D 8 }, + { .val =3D 1, .div =3D 128 }, + { .val =3D 0, .div =3D 0 }, +}; + +static const struct clk_div_table eqc_eyeq7h_ddr_ref_div_table[] =3D { + { .val =3D 0, .div =3D 2 }, + { .val =3D 1, .div =3D 8 }, + { .val =3D 0, .div =3D 0 }, +}; + +static const struct clk_div_table eqc_eyeq7h_ddr_dfi_div_table[] =3D { + { .val =3D 0, .div =3D 2 }, + { .val =3D 1, .div =3D 32 }, + { .val =3D 0, .div =3D 0 }, +}; + +static const struct eqc_clock eqc_eyeq7h_ddr0_clks[] =3D { + PLL_AINTP(EQ7HC_DDR_PLL, PARENT_BY_FWNAME, "pll-ddr0", "ref", 0x0), + + DIV(EQ7HC_DDR_DIV_APB, EQ7HC_DDR_PLL, "div-ddr0_apb", NULL, + 0x08, 10, 1, eqc_eyeq7h_ddr_apb_div_table), + DIV(EQ7HC_DDR_DIV_PLLREF, EQ7HC_DDR_PLL, "div-ddr0_pllref", NULL, + 0x08, 10, 1, eqc_eyeq7h_ddr_ref_div_table), + DIV(EQ7HC_DDR_DIV_DFI, EQ7HC_DDR_PLL, "div-ddr0-dfi", NULL, + 0x08, 10, 1, eqc_eyeq7h_ddr_dfi_div_table), +}; + +static const struct eqc_match_data eqc_eyeq7h_ddr0_match_data =3D { + .clk_count =3D ARRAY_SIZE(eqc_eyeq7h_ddr0_clks), + .clks =3D eqc_eyeq7h_ddr0_clks, + + .reset_auxdev_name =3D "reset_ddr0", +}; + +static const struct eqc_clock eqc_eyeq7h_ddr1_clks[] =3D { + PLL_AINTP(EQ7HC_DDR_PLL, PARENT_BY_FWNAME, "pll-ddr1", "ref", 0x0), + + DIV(EQ7HC_DDR_DIV_APB, EQ7HC_DDR_PLL, "div-ddr1_apb", NULL, + 0x08, 10, 1, eqc_eyeq7h_ddr_apb_div_table), + DIV(EQ7HC_DDR_DIV_PLLREF, EQ7HC_DDR_PLL, "div-ddr1_pllref", NULL, + 0x08, 10, 1, eqc_eyeq7h_ddr_ref_div_table), + DIV(EQ7HC_DDR_DIV_DFI, EQ7HC_DDR_PLL, "div-ddr1-dfi", NULL, + 0x08, 10, 1, eqc_eyeq7h_ddr_dfi_div_table), +}; + +static const struct eqc_match_data eqc_eyeq7h_ddr1_match_data =3D { + .clk_count =3D ARRAY_SIZE(eqc_eyeq7h_ddr1_clks), + .clks =3D eqc_eyeq7h_ddr1_clks, + + .reset_auxdev_name =3D "reset_ddr1", +}; + +static const struct eqc_clock eqc_eyeq7h_east_clocks[] =3D { + PLL_JFRACR(EQ7HC_EAST_PLL_106P6, PARENT_BY_FWNAME, "pll-106p6-e", "ref", = 0x00), + + FF(EQ7HC_EAST_DIV_REF_106P6, EQ7HC_EAST_PLL_106P6, "ref_106p6_e", NULL, 1= , 40), + + PLL_AINTP(EQ7HC_EAST_PLL_NOC, EQ7HC_EAST_DIV_REF_106P6, "pll-noc-e", NULL= , 0x30), + PLL_AINTP(EQ7HC_EAST_PLL_ISP, PARENT_BY_FWNAME, "pll-isp", "ref_100p0", 0= x38), + PLL_AINTP(EQ7HC_EAST_PLL_VEU, PARENT_BY_FWNAME, "pll-veu", "ref_100p0", 0= x40), + + FF(EQ7HC_EAST_DIV_REF_DDR_PHY, EQ7HC_EAST_PLL_106P6, "ref_ddr_phy_e", NUL= L, 1, 2), + + FF(EQ7HC_EAST_DIV_CORE, EQ7HC_EAST_PLL_NOC, "core_e", NULL, 1, 2), + FF(EQ7HC_EAST_DIV_CORE_MBIST, EQ7HC_EAST_PLL_NOC, "core_mbist_e", NULL, 1= , 2), + FF(EQ7HC_EAST_DIV_ISRAM_MBIST, EQ7HC_EAST_PLL_NOC, "isram_mbist_e", NULL,= 1, 2), + FF(EQ7HC_EAST_DIV_CFG, EQ7HC_EAST_PLL_NOC, "cfg_e", NULL, 1, 4), + + FF(EQ7HC_EAST_DIV_VEU_CORE, EQ7HC_EAST_PLL_VEU, "veu_core", NULL, 1, 4), + FF(EQ7HC_EAST_DIV_VEU_MBIST, EQ7HC_EAST_PLL_VEU, "veu_mbist", NULL, 1, 4), + FF(EQ7HC_EAST_DIV_VEU_OCP, EQ7HC_EAST_PLL_VEU, "veu_ocp", NULL, 1, 16), + + FF(EQ7HC_EAST_DIV_LBITS, EQ7HC_EAST_PLL_ISP, "lbits_e", NULL, 1, 48), + FF(EQ7HC_EAST_DIV_ISP0_CORE, EQ7HC_EAST_PLL_ISP, "isp0_core", NULL, 1, 2), +}; + +static const struct eqc_match_data eqc_eyeq7h_east_match_data =3D { + .clk_count =3D ARRAY_SIZE(eqc_eyeq7h_east_clocks), + .clks =3D eqc_eyeq7h_east_clocks, + + .reset_auxdev_name =3D "reset_east", +}; + +static const struct eqc_clock eqc_eyeq7h_mips0_clks[] =3D { + PLL_AINTP(EQ7HC_MIPS_PLL_CPU, PARENT_BY_FWNAME, "pll-cpu0", "ref", 0x0), + + FF(EQ7HC_MIPS_DIV_CM, EQ7HC_MIPS_PLL_CPU, "mips0_cm", NULL, 1, 2), +}; + +static const struct eqc_match_data eqc_eyeq7h_mips0_match_data =3D { + .clk_count =3D ARRAY_SIZE(eqc_eyeq7h_mips0_clks), + .clks =3D eqc_eyeq7h_mips0_clks, +}; + +static const struct eqc_clock eqc_eyeq7h_mips1_clks[] =3D { + PLL_AINTP(EQ7HC_MIPS_PLL_CPU, PARENT_BY_FWNAME, "pll-cpu1", "ref", 0x0), + + FF(EQ7HC_MIPS_DIV_CM, EQ7HC_MIPS_PLL_CPU, "mips1_cm", NULL, 1, 2), +}; + +static const struct eqc_match_data eqc_eyeq7h_mips1_match_data =3D { + .clk_count =3D ARRAY_SIZE(eqc_eyeq7h_mips1_clks), + .clks =3D eqc_eyeq7h_mips1_clks, +}; + +static const struct eqc_clock eqc_eyeq7h_mips2_clks[] =3D { + PLL_AINTP(EQ7HC_MIPS_PLL_CPU, PARENT_BY_FWNAME, "pll-cpu2", "ref", 0x0), + + FF(EQ7HC_MIPS_DIV_CM, EQ7HC_MIPS_PLL_CPU, "mips2_cm", NULL, 1, 2), +}; + +static const struct eqc_match_data eqc_eyeq7h_mips2_match_data =3D { + .clk_count =3D ARRAY_SIZE(eqc_eyeq7h_mips2_clks), + .clks =3D eqc_eyeq7h_mips2_clks, +}; + +static const struct eqc_clock eqc_eyeq7h_periph_east_clks[] =3D { + PLL_AINTP(EQ7HC_PERIPH_EAST_PLL_PER, PARENT_BY_FWNAME, "pll-periph_east_p= er", "ref", 0x0), + + FF(EQ7HC_PERIPH_EAST_DIV_PER, EQ7HC_PERIPH_EAST_PLL_PER, "periph_e", NULL= , 1, 10), +}; + +static const struct eqc_match_data eqc_eyeq7h_periph_east_match_data =3D { + .clk_count =3D ARRAY_SIZE(eqc_eyeq7h_periph_east_clks), + .clks =3D eqc_eyeq7h_periph_east_clks, + + .reset_auxdev_name =3D "reset_periph_east", +}; + +static const struct eqc_clock eqc_eyeq7h_periph_west_clks[] =3D { + PLL_AINTP(EQ7HC_PERIPH_WEST_PLL_PER, PARENT_BY_FWNAME, + "pll-periph_west_per", "ref_100p0", 0x0), + PLL_AINTP(EQ7HC_PERIPH_WEST_PLL_I2S, PARENT_BY_FWNAME, + "pll-periph_west_i2s", "ref_106p6", 0x4), + + FF(EQ7HC_PERIPH_WEST_DIV_PER, EQ7HC_PERIPH_WEST_PLL_PER, "periph_w", NULL= , 1, 10), + FF(EQ7HC_PERIPH_WEST_DIV_I2S, EQ7HC_PERIPH_WEST_PLL_I2S, "periph_i2s_ser_= w", NULL, 1, 100), +}; + +static const struct eqc_match_data eqc_eyeq7h_periph_west_match_data =3D { + .clk_count =3D ARRAY_SIZE(eqc_eyeq7h_periph_west_clks), + .clks =3D eqc_eyeq7h_periph_west_clks, + + .reset_auxdev_name =3D "reset_periph_west", +}; + +static const struct eqc_clock eqc_eyeq7h_south_clks[] =3D { + PLL_JFRACR(EQ7HC_SOUTH_PLL_100P0, PARENT_BY_FWNAME, "pll-100p0", "ref", 0= x40), + + FF(EQ7HC_SOUTH_DIV_REF_100P0, EQ7HC_SOUTH_PLL_100P0, "ref_100p0", NULL, 1= , 48), + + PLL_AINTP(EQ7HC_SOUTH_PLL_XSPI, EQ7HC_SOUTH_DIV_REF_100P0, "pll-xspi", NU= LL, 0x10), + PLL_AINTP(EQ7HC_SOUTH_PLL_VDIO, EQ7HC_SOUTH_DIV_REF_100P0, "pll-vdio", NU= LL, 0x18), + PLL_AINTP(EQ7HC_SOUTH_PLL_PER, EQ7HC_SOUTH_DIV_REF_100P0, "pll-per-s", NU= LL, 0x20), + + FF(EQ7HC_SOUTH_DIV_VDO_DSI_SYS, EQ7HC_SOUTH_PLL_100P0, "vdo_dsi_sys", NUL= L, 1, 9), + FF(EQ7HC_SOUTH_DIV_PMA_CMN_REF, EQ7HC_SOUTH_PLL_100P0, "pma_cmn_ref", NUL= L, 1, 48), + FF(EQ7HC_SOUTH_DIV_REF_UFS, EQ7HC_SOUTH_PLL_100P0, "ref_ufs", NULL, 1, 25= 0), + FF(EQ7HC_SOUTH_DIV_XSPI_SYS, EQ7HC_SOUTH_PLL_XSPI, "xspi_sys", NULL, 1, 8= ), + FF(EQ7HC_SOUTH_DIV_XSPI_MBIST, EQ7HC_SOUTH_PLL_XSPI, "xspi_mbist", NULL, = 1, 8), + FF(EQ7HC_SOUTH_DIV_NOC_S, EQ7HC_SOUTH_PLL_PER, "noc_s", NULL, 1, 2), + FF(EQ7HC_SOUTH_DIV_PCIE_SYS, EQ7HC_SOUTH_PLL_PER, "pcie_sys", NULL, 1, 4), + FF(EQ7HC_SOUTH_DIV_PCIE_SYS_MBIST, EQ7HC_SOUTH_PLL_PER, "pcie_sys_mbist",= NULL, 1, 4), + FF(EQ7HC_SOUTH_DIV_PCIE_GBE_PHY, EQ7HC_SOUTH_PLL_PER, "pcie_gbe_phy_apb",= NULL, 1, 16), + FF(EQ7HC_SOUTH_DIV_UFS_CORE, EQ7HC_SOUTH_PLL_PER, "ufs_core", NULL, 1, 8), + FF(EQ7HC_SOUTH_DIV_UFS_SMS, EQ7HC_SOUTH_PLL_PER, "ufs_sms", NULL, 1, 5), + FF(EQ7HC_SOUTH_DIV_UFS_ROM_SMS, EQ7HC_SOUTH_PLL_PER, "ufs_rom_sms", NULL,= 1, 5), + FF(EQ7HC_SOUTH_DIV_ETH_SYS, EQ7HC_SOUTH_PLL_PER, "eth_sys", NULL, 1, 8), + FF(EQ7HC_SOUTH_DIV_ETH_MBIST, EQ7HC_SOUTH_PLL_PER, "eth_mbist", NULL, 1, = 8), + FF(EQ7HC_SOUTH_DIV_CFG_S, EQ7HC_SOUTH_PLL_PER, "cfg_s", NULL, 1, 8), + FF(EQ7HC_SOUTH_DIV_TSU, EQ7HC_SOUTH_PLL_PER, "tsu", NULL, 1, 64), + FF(EQ7HC_SOUTH_DIV_VDIO, EQ7HC_SOUTH_PLL_VDIO, "vdio", NULL, 1, 4), + FF(EQ7HC_SOUTH_DIV_VDIO_CORE, EQ7HC_SOUTH_PLL_VDIO, "vdio_core", NULL, 1,= 4), + FF(EQ7HC_SOUTH_DIV_VDIO_CORE_MBIST, EQ7HC_SOUTH_PLL_VDIO, "vdio_core_mbis= t", NULL, 1, 4), + FF(EQ7HC_SOUTH_DIV_VDO_CORE_MBIST, EQ7HC_SOUTH_PLL_VDIO, "vdo_core_mbist"= , NULL, 1, 4), + FF(EQ7HC_SOUTH_DIV_VDO_P, EQ7HC_SOUTH_PLL_VDIO, "vdo_p", NULL, 1, 40), + FF(EQ7HC_SOUTH_DIV_VDIO_CFG, EQ7HC_SOUTH_PLL_VDIO, "vdio_cfg", NULL, 1, 1= 50), + FF(EQ7HC_SOUTH_DIV_VDIO_TXCLKESC, EQ7HC_SOUTH_PLL_VDIO, "vdio_txclkesc", = NULL, 1, 8), +}; + +static const struct eqc_match_data eqc_eyeq7h_south_match_data =3D { + .clk_count =3D ARRAY_SIZE(eqc_eyeq7h_south_clks), + .clks =3D eqc_eyeq7h_south_clks, + + .reset_auxdev_name =3D "reset_south", +}; + +static const struct eqc_clock eqc_eyeq7h_west_clks[] =3D { + PLL_JFRACR(EQ7HC_WEST_PLL_106P6, PARENT_BY_FWNAME, "pll-106p6-w", "ref", = 0x0), + + FF(EQ7HC_WEST_DIV_REF_106P6, EQ7HC_WEST_PLL_106P6, "ref_106p6_w", NULL, 1= , 40), + + PLL_AINTP(EQ7HC_WEST_PLL_NOC, EQ7HC_WEST_DIV_REF_106P6, "pll-noc-w", NULL= , 0x30), + PLL_AINTP(EQ7HC_WEST_PLL_GPU, PARENT_BY_FWNAME, "pll-gpu", "ref_100p0", 0= x38), + PLL_AINTP(EQ7HC_WEST_PLL_SSI, PARENT_BY_FWNAME, "pll-ssi", "ref_100p0", 0= x40), + + FF(EQ7HC_WEST_DIV_GPU, EQ7HC_WEST_PLL_GPU, "gpu", NULL, 1, 2), + FF(EQ7HC_WEST_DIV_GPU_MBIST, EQ7HC_WEST_PLL_GPU, "gpu_mbist", NULL, 1, 2), + FF(EQ7HC_WEST_DIV_LBITS, EQ7HC_WEST_PLL_GPU, "lbits_w", NULL, 1, 40), + FF(EQ7HC_WEST_DIV_MIPS_TIMER, EQ7HC_WEST_PLL_SSI, "mips_timer", NULL, 1, = 24), + FF(EQ7HC_WEST_DIV_SSI_CORE, EQ7HC_WEST_PLL_SSI, "ssi_core", NULL, 1, 2), + FF(EQ7HC_WEST_DIV_SSI_CORE_MBIST, EQ7HC_WEST_PLL_SSI, "ssi_core_mbist", N= ULL, 1, 2), + FF(EQ7HC_WEST_DIV_SSI_ROM, EQ7HC_WEST_PLL_SSI, "ssi_rom", NULL, 1, 8), + FF(EQ7HC_WEST_DIV_SSI_ROM_MBIST, EQ7HC_WEST_PLL_SSI, "ssi_rom_mbist", NUL= L, 1, 8), + FF(EQ7HC_WEST_DIV_REF_DDR_PHY, EQ7HC_WEST_PLL_106P6, "ref_ddr_phy_w", NUL= L, 1, 2), + FF(EQ7HC_WEST_DIV_CORE, EQ7HC_WEST_PLL_NOC, "core_w", NULL, 1, 2), + FF(EQ7HC_WEST_DIV_CORE_MBIST, EQ7HC_WEST_PLL_NOC, "core_mbist_w", NULL, 1= , 2), + FF(EQ7HC_WEST_DIV_CFG, EQ7HC_WEST_PLL_NOC, "cfg_w", NULL, 1, 4), + FF(EQ7HC_WEST_DIV_CAU, EQ7HC_WEST_PLL_NOC, "cau_w", NULL, 1, 8), + FF(EQ7HC_WEST_DIV_CAU_MBIST, EQ7HC_WEST_PLL_NOC, "cau_mbist_w", NULL, 1, = 8), +}; + +static const struct eqc_match_data eqc_eyeq7h_west_match_data =3D { + .clk_count =3D ARRAY_SIZE(eqc_eyeq7h_west_clks), + .clks =3D eqc_eyeq7h_west_clks, + + .reset_auxdev_name =3D "reset_west", +}; + +static const struct eqc_clock eqc_eyeq7h_xnn0_clks[] =3D { + PLL_AINTP(EQ7HC_XNN_PLL_XNN0, PARENT_BY_FWNAME, "pll-xnn0-0", "ref_100p0"= , 0x400), + PLL_AINTP(EQ7HC_XNN_PLL_XNN1, PARENT_BY_FWNAME, "pll-xnn0-1", "ref_100p0"= , 0x404), + PLL_AINTP(EQ7HC_XNN_PLL_XNN2, PARENT_BY_FWNAME, "pll-xnn0-2", "ref_100p0"= , 0x408), + PLL_AINTP(EQ7HC_XNN_PLL_CLSTR, PARENT_BY_FWNAME, "pll-xnn0-clstr", "ref_1= 06p6", 0x410), + + FF(EQ7HC_XNN_DIV_XNN0, EQ7HC_XNN_PLL_XNN0, "xnn0", NULL, 1, 2), + FF(EQ7HC_XNN_DIV_XNN1, EQ7HC_XNN_PLL_XNN1, "xnn1", NULL, 1, 2), + FF(EQ7HC_XNN_DIV_XNN2, EQ7HC_XNN_PLL_XNN2, "xnn2", NULL, 1, 2), + FF(EQ7HC_XNN_DIV_CLSTR, EQ7HC_XNN_PLL_CLSTR, "xnn0_clstr", NULL, 1, 2), + FF(EQ7HC_XNN_DIV_I2, EQ7HC_XNN_PLL_CLSTR, "xnn0_i2", NULL, 1, 4), + FF(EQ7HC_XNN_DIV_I2_SMS, EQ7HC_XNN_PLL_CLSTR, "xnn0_i2_sms", NULL, 1, 4), + FF(EQ7HC_XNN_DIV_CFG, EQ7HC_XNN_PLL_CLSTR, "xnn0_cfg", NULL, 1, 8), +}; + +static const struct eqc_match_data eqc_eyeq7h_xnn0_match_data =3D { + .clk_count =3D ARRAY_SIZE(eqc_eyeq7h_xnn0_clks), + .clks =3D eqc_eyeq7h_xnn0_clks, + + .reset_auxdev_name =3D "reset_xnn0", +}; + +static const struct eqc_clock eqc_eyeq7h_xnn1_clks[] =3D { + PLL_AINTP(EQ7HC_XNN_PLL_XNN0, PARENT_BY_FWNAME, "pll-xnn1-0", "ref_100p0"= , 0x400), + PLL_AINTP(EQ7HC_XNN_PLL_XNN1, PARENT_BY_FWNAME, "pll-xnn1-1", "ref_100p0"= , 0x404), + PLL_AINTP(EQ7HC_XNN_PLL_XNN2, PARENT_BY_FWNAME, "pll-xnn1-2", "ref_100p0"= , 0x408), + PLL_AINTP(EQ7HC_XNN_PLL_CLSTR, PARENT_BY_FWNAME, "pll-xnn1-clstr", "ref_1= 06p6", 0x410), +}; + +static const struct eqc_match_data eqc_eyeq7h_xnn1_match_data =3D { + .clk_count =3D ARRAY_SIZE(eqc_eyeq7h_xnn1_clks), + .clks =3D eqc_eyeq7h_xnn1_clks, + + .reset_auxdev_name =3D "reset_xnn1", +}; + static const struct of_device_id eqc_match_table[] =3D { { .compatible =3D "mobileye,eyeq5-olb", .data =3D &eqc_eyeq5_match_data }, { .compatible =3D "mobileye,eyeq6l-olb", .data =3D &eqc_eyeq6l_match_data= }, @@ -711,6 +1188,22 @@ static const struct of_device_id eqc_match_table[] = =3D { { .compatible =3D "mobileye,eyeq6h-ddr0-olb", .data =3D &eqc_eyeq6h_ddr0_= match_data }, { .compatible =3D "mobileye,eyeq6h-ddr1-olb", .data =3D &eqc_eyeq6h_ddr1_= match_data }, { .compatible =3D "mobileye,eyeq6h-acc-olb", .data =3D &eqc_eyeq6h_acc_ma= tch_data }, + { .compatible =3D "mobileye,eyeq7h-acc0-olb", .data =3D &eqc_eyeq7h_acc0_= match_data }, + { .compatible =3D "mobileye,eyeq7h-acc1-olb", .data =3D &eqc_eyeq7h_acc1_= match_data }, + { .compatible =3D "mobileye,eyeq7h-ddr0-olb", .data =3D &eqc_eyeq7h_ddr0_= match_data }, + { .compatible =3D "mobileye,eyeq7h-ddr1-olb", .data =3D &eqc_eyeq7h_ddr1_= match_data }, + { .compatible =3D "mobileye,eyeq7h-east-olb", .data =3D &eqc_eyeq7h_east_= match_data }, + { .compatible =3D "mobileye,eyeq7h-mips0-olb", .data =3D &eqc_eyeq7h_mips= 0_match_data }, + { .compatible =3D "mobileye,eyeq7h-mips1-olb", .data =3D &eqc_eyeq7h_mips= 1_match_data }, + { .compatible =3D "mobileye,eyeq7h-mips2-olb", .data =3D &eqc_eyeq7h_mips= 2_match_data }, + { .compatible =3D "mobileye,eyeq7h-periph-east-olb", + .data =3D &eqc_eyeq7h_periph_east_match_data }, + { .compatible =3D "mobileye,eyeq7h-periph-west-olb", + .data =3D &eqc_eyeq7h_periph_west_match_data }, + { .compatible =3D "mobileye,eyeq7h-south-olb", .data =3D &eqc_eyeq7h_sout= h_match_data }, + { .compatible =3D "mobileye,eyeq7h-west-olb", .data =3D &eqc_eyeq7h_west_= match_data }, + { .compatible =3D "mobileye,eyeq7h-xnn0-olb", .data =3D &eqc_eyeq7h_xnn0_= match_data }, + { .compatible =3D "mobileye,eyeq7h-xnn1-olb", .data =3D &eqc_eyeq7h_xnn1_= match_data }, {} }; =20 --=20 2.52.0 From nobody Sun Feb 8 11:41:14 2026 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 E15ED38B9B1; Wed, 14 Jan 2026 10:05:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385154; cv=none; b=T6abvNN6hDvh4KmZn7uDGBPthocZoxjcd2thGLSZ1sPnrtJbU/6PU25xKErrsQPl6XaCh9dZHAUjDogTPLN16d+y9hrl5vw0Qi0q3TZeiFiCm+r9/vtITZ4q0kZdDq35xcXqg80LSZAQ1AUz2yfMbkFaqryODN9YnsZjGAbk+r0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385154; c=relaxed/simple; bh=vn9WQj9VhG7AviNjexEImiEIi/iAGVf/ODoubgj8esg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VksiZuWNt4Hx4fcVdWCWcje6uPOs4rfHo7N0+jePM37R9xBUQLNhgBUdwGotO6TIF43tLoEdlLF0eyfKXOt+UkK/8cGtcYVHTF+WN66dPqek6mw77Va2oepI5SNOAdJQEIkUI9HGNlVAK8tiT9UVArJnX11XU75DXdyaknj0PKU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=hdfbGTc3; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="hdfbGTc3" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 848B64E420D4; Wed, 14 Jan 2026 10:05:51 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 593046074A; Wed, 14 Jan 2026 10:05:51 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id E0045103C89F6; Wed, 14 Jan 2026 11:05:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1768385150; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=cI1JQH6Wxakl2cHxkxeZUP6cWNzaIt5ffNvTU0ZKfI0=; b=hdfbGTc3zLFHQsrfj3a+R/1bCMFqPb2m7wcFInciJspN5WcU5JSXT3D4chNPvKJzivJ0Fi xqvT3gV1gz6Nu0Ld6ASC2Ts2u4399zJcN1U7iuWO0uS4Zxm6QGut42EeIPOULga6KjJhfA Ad+ahGuY44dNAdOu6QNH0nJ0tmb8WORG2EA6QWyzLi/yWvdPYEv7zpuCVHDpHu/nQeRiMA vRHXlSMmHQ0kLNgGG/JtmX8UzpmrdIrW6ZpY52yfE6ekJhnGR1NWg2K18eFCbWhk1eOVch uffXSwxrf/8CQMS8xFWp8ymBm/5lx6LTIe8GHo3KIc7VEQmGP0Xf1D5bTU3RZw== From: =?utf-8?q?Beno=C3=AEt_Monin?= Date: Wed, 14 Jan 2026 11:05:14 +0100 Subject: [PATCH v3 10/10] MAINTAINERS: Add entry for Mobileye RISC-V SoCs Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260114-clk-eyeq7-v3-10-8ebdba7b0133@bootlin.com> References: <20260114-clk-eyeq7-v3-0-8ebdba7b0133@bootlin.com> In-Reply-To: <20260114-clk-eyeq7-v3-0-8ebdba7b0133@bootlin.com> To: Vladimir Kondratiev , Gregory CLEMENT , =?utf-8?q?Th=C3=A9o_Lebrun?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , Philipp Zabel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: Thomas Petazzoni , Tawfik Bayouk , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-mips@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Monin?= X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Add Vlad, Gregory, Th=C3=A9o and myself as co-maintainers for the Mobileye RISC-V SoCs, and clarify the dt-bindings entries between MIPS and RISC-V SoCs. Signed-off-by: Beno=C3=AEt Monin --- MAINTAINERS | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 670e93ddf2f1..bc675d62d567 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -17601,7 +17601,8 @@ M: Th=C3=A9o Lebrun L: linux-mips@vger.kernel.org S: Maintained F: Documentation/devicetree/bindings/mips/mobileye.yaml -F: Documentation/devicetree/bindings/soc/mobileye/ +F: Documentation/devicetree/bindings/soc/mobileye/mobileye,eyeq5-olb.yaml +F: Documentation/devicetree/bindings/soc/mobileye/mobileye,eyeq6lplus-olb.= yaml F: arch/mips/boot/dts/mobileye/ F: arch/mips/configs/eyeq*_defconfig F: arch/mips/mobileye/board-epm5.its.S @@ -17611,6 +17612,16 @@ F: drivers/reset/reset-eyeq.c F: include/dt-bindings/clock/mobileye,eyeq5-clk.h F: include/dt-bindings/clock/mobileye,eyeq6lplus-clk.h =20 +MOBILEYE RISC-V SOCS +M: Vladimir Kondratiev +M: Beno=C3=AEt Monin +M: Gregory CLEMENT +M: Th=C3=A9o Lebrun +L: linux-riscv@lists.infradead.org +S: Maintained +F: Documentation/devicetree/bindings/soc/mobileye/mobileye,eyeq7h-olb.yaml +F: include/dt-bindings/clock/mobileye,eyeq7h-clk.h + MODULE SUPPORT M: Luis Chamberlain M: Petr Pavlu --=20 2.52.0