From nobody Mon Sep 28 17:48:03 2026 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 656D63D3498 for ; Wed, 19 Aug 2026 22:15:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787177714; cv=none; b=WCl5FKFFxZUQntSMIlP6BzMfZKgOEHPh1Ct8N7Rscgp/AmfX8ZrZXBLZkHrvHA/PmqAAYxJmhOmI3/mMKXgC2gQ1/f1r60azLW0g+QZEnlrsFGgd1bFCifvuKJKVHlSil2tR4rFP60em3AyJ0YtrR3NE6lkBmzYGeEdppgXSgZQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787177714; c=relaxed/simple; bh=7txVex1YKsBI07yDFKbwJTfHfLkjP2vFWNMOmdjl6zU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rVK8wJA17+X/ktFqpptFNHilnHli/IM9rUgyTL1aFq9imS83KDqon5nvfQSon4ui0wLmCj2a55aqidSH/dGChiKFuXdRyj9SMQQmaWB4fmUsCW+if0A2JkgW4v6xDTo89swJ3N6wPDZNmCbVmIs2oJ9KLDWGVnrktcMa2Wr46Fw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=puGV6GVT; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="puGV6GVT" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-47362928f65so1443319f8f.2 for ; Wed, 19 Aug 2026 15:15:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787177711; x=1787782511; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=sA0r2GQyCCtQoQ8S7Fp2dZh+KlreJQPZUV/cexVXnbE=; b=puGV6GVTQ5mLmLS4gLlJ2aT61et8OSbzH8kYIJLH+jZuDD/IU1BWzzbNcaSJjVpjzK w3X4V6WE+4RywcSDUgCkgwLAoRKWrgo9++kl8Pd7yzI8qI4G5/TxTG1iSrYRNhiRubBm K8py9Z9bBjplNn+0r8ySX9PYCWvkrAFQqRU7bVeixLor9eiYcMu8DJy+m48vopDkBw/N QhGp/H3Nr2CC9yhIv6nUsTL6edk2Lavk7lQhQFOWhcMx4o3Y0+8imoqPbige3KpgNSXC TMg9t760MZMQQSpfN3cQoO+1FcU5KLenkk+ujFigTe7hAsM6q+lHj/MT9+TCtAUPOilX FN1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787177711; x=1787782511; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=sA0r2GQyCCtQoQ8S7Fp2dZh+KlreJQPZUV/cexVXnbE=; b=PhX+EkiST5wCDh4BqbdsRFVzhq0I8SbwJ/wQNAyewsYErDAJXhmUW/o1JFH2tXGnd7 iCsLrcbGNuV47+mB1wgLmyXPOSwwhpN0kiFp+AmKYezjzPLTMxDvvpusCBqBhdR+zCUV 6MLBaShznysUMccgQDrq6t9dk5/ptvVAQWYDQavVuIcuFqHl+PuudgJl6r25+Cqb0NWv HGvjnlq9gDgRMs7qfrZeWiYSrqcIbzhdUM81dPuF0MZdfmJ1o2IrZbPj3vKDniaZ0a0j 7aDTylZ3WZzoRuxq+2gkf5LCheSevSaE/+ZjSqD9el7y9MYwo18NLQGzV/2pJsRe5rft K8Ug== X-Forwarded-Encrypted: i=1; AHgh+RqvwD9iHwP4i483nXIRojtTxk5AXtJOKdaKffFg8n6+YLfMQr51GeOwSazPy0CqhJ+Cf6V3t0c9NyUxQY0=@vger.kernel.org X-Gm-Message-State: AFuF++lgAcGlZu/AN/mU5XUULBXQWBzRpJByJ1iMxY1tVLokVrrU21/E ON6uGOepOjrg4OFePUiv855PuHrEFDfVlqnUpQOWrt1E+gd8aYAwCcs+ X-Gm-Gg: AR+sD10MpAPzmzulDuyUpHjbjGYPY0X+PydZwSNM5thoukl7mJzZkhp0xBROKWTFJ3g xN67q/GwEa2D7fr7rMKN9I5T2IblEG9MlDffiTZS8edNTlUt8/VUFrxa+W/6/DVfIQCx87mfs8q QJbzyt3QPlC/72lGkwujlHgIJKAIUTkF36yGc0Go9Xl6pC5Tb1gZETFCqsHxhnKs8oJEN5Fd2UO nW6d6QFlzFVU46NIDJKlH5YHBQL0K9cvgG6QDmqwyrldpVtSx7WIo8EAGhWwjHSSaa3TX1GzCFG OE3mRsIaW/0ZjedUU7uOX9Cu+pSks3gPGrmA2CW2qQIHLbF/0wEWwtqwixg/pujSNKXi+YuJmt2 KAK7UjwUFuUd44SyDkaThKcdqAKLSnlc002L8ZPu15zopkoWDP2twB1rltZqE5tq+CiSDmdRS7m zhYfnW5MmcS+QXtcz2vbZgULi73wqhp912uiunK7H1xLIdIg46ipMir/Oyt+vE1EgSeF4Im2KfE qNVaxk+9QSap02h6ghSZG3vMUoh1I6znm5oxqOkSzM4Pu3f2GcWzn8= X-Received: by 2002:a05:6000:480e:b0:481:5edd:1b6c with SMTP id ffacd0b85a97d-482b1e976bbmr15302612f8f.7.1787177710505; Wed, 19 Aug 2026 15:15:10 -0700 (PDT) Received: from Ansuel-XPS24.localdomain (host-213-45-7-219.pool21345.interbusiness.it. [213.45.7.219]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-482b14c46f2sm9732950f8f.29.2026.08.19.15.15.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2026 15:15:09 -0700 (PDT) From: Christian Marangi To: Stephen Boyd , Brian Masney , Jerome Brunet , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , Felix Fietkau , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christian Marangi Subject: [PATCH v6 1/3] dt-bindings: clock: airoha: Document support for AN7583 clock Date: Thu, 20 Aug 2026 00:14:54 +0200 Message-ID: <20260819221458.30040-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260819221458.30040-1-ansuelsmth@gmail.com> References: <20260819221458.30040-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Document support for Airoha AN7583 clock. This is based on the EN7523 clock schema with the new requirement of the "airoha,chip-scu". Add additional binding for additional clock and reset lines. Signed-off-by: Christian Marangi --- .../bindings/clock/airoha,en7523-scu.yaml | 20 ++++++ include/dt-bindings/clock/en7523-clk.h | 3 + .../dt-bindings/reset/airoha,an7583-reset.h | 65 +++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 include/dt-bindings/reset/airoha,an7583-reset.h diff --git a/Documentation/devicetree/bindings/clock/airoha,en7523-scu.yaml= b/Documentation/devicetree/bindings/clock/airoha,en7523-scu.yaml index eb24a5687639..edecc635807b 100644 --- a/Documentation/devicetree/bindings/clock/airoha,en7523-scu.yaml +++ b/Documentation/devicetree/bindings/clock/airoha,en7523-scu.yaml @@ -30,6 +30,7 @@ properties: compatible: items: - enum: + - airoha,an7583-scu - airoha,en7523-scu - airoha,en7581-scu - econet,en751221-scu @@ -50,12 +51,30 @@ properties: description: ID of the controller reset line const: 1 =20 + airoha,chip-scu: + $ref: /schemas/types.yaml#/definitions/phandle + description: phandle to the Chip SCU providing the registers required + for configuring the PCIe related clocks and resets. + required: - compatible - reg - '#clock-cells' =20 allOf: + - if: + properties: + compatible: + const: airoha,an7583-scu + + then: + required: + - airoha,chip-scu + + else: + properties: + airoha,chip-scu: false + - if: properties: compatible: @@ -69,6 +88,7 @@ allOf: properties: compatible: enum: + - airoha,an7583-scu - airoha,en7581-scu - econet,en751221-scu then: diff --git a/include/dt-bindings/clock/en7523-clk.h b/include/dt-bindings/c= lock/en7523-clk.h index edfa64045f52..0fbbcb7b1b25 100644 --- a/include/dt-bindings/clock/en7523-clk.h +++ b/include/dt-bindings/clock/en7523-clk.h @@ -14,4 +14,7 @@ =20 #define EN7581_CLK_EMMC 8 =20 +#define AN7583_CLK_MDIO0 9 +#define AN7583_CLK_MDIO1 10 + #endif /* _DT_BINDINGS_CLOCK_AIROHA_EN7523_H_ */ diff --git a/include/dt-bindings/reset/airoha,an7583-reset.h b/include/dt-b= indings/reset/airoha,an7583-reset.h new file mode 100644 index 000000000000..410e19802cf7 --- /dev/null +++ b/include/dt-bindings/reset/airoha,an7583-reset.h @@ -0,0 +1,65 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ +/* + * Copyright (c) 2024 AIROHA Inc + * Author: Christian Marangi + */ + +#ifndef __DT_BINDINGS_RESET_CONTROLLER_AIROHA_AN7583_H_ +#define __DT_BINDINGS_RESET_CONTROLLER_AIROHA_AN7583_H_ + +/* RST_CTRL2 */ +#define AN7583_XPON_PHY_RST 0 +#define AN7583_GPON_OLT_RST 1 +#define AN7583_CPU_TIMER2_RST 2 +#define AN7583_HSUART_RST 3 +#define AN7583_UART4_RST 4 +#define AN7583_UART5_RST 5 +#define AN7583_I2C2_RST 6 +#define AN7583_XSI_MAC_RST 7 +#define AN7583_XSI_PHY_RST 8 +#define AN7583_NPU_RST 9 +#define AN7583_TRNG_MSTART_RST 10 +#define AN7583_DUAL_HSI0_RST 11 +#define AN7583_DUAL_HSI1_RST 12 +#define AN7583_DUAL_HSI0_MAC_RST 13 +#define AN7583_DUAL_HSI1_MAC_RST 14 +#define AN7583_XPON_XFI_RST 15 +#define AN7583_WDMA_RST 16 +#define AN7583_WOE0_RST 17 +#define AN7583_HSDMA_RST 18 +#define AN7583_TDMA_RST 19 +#define AN7583_EMMC_RST 20 +#define AN7583_SOE_RST 21 +#define AN7583_XFP_MAC_RST 22 +#define AN7583_MDIO0_RST 23 +#define AN7583_MDIO1_RST 24 +/* RST_CTRL1 */ +#define AN7583_PCM1_ZSI_ISI_RST 25 +#define AN7583_FE_PDMA_RST 26 +#define AN7583_FE_QDMA_RST 27 +#define AN7583_PCM_SPIWP_RST 28 +#define AN7583_CRYPTO_RST 29 +#define AN7583_TIMER_RST 30 +#define AN7583_PCM1_RST 31 +#define AN7583_UART_RST 32 +#define AN7583_GPIO_RST 33 +#define AN7583_GDMA_RST 34 +#define AN7583_I2C_MASTER_RST 35 +#define AN7583_PCM2_ZSI_ISI_RST 36 +#define AN7583_SFC_RST 37 +#define AN7583_UART2_RST 38 +#define AN7583_GDMP_RST 39 +#define AN7583_FE_RST 40 +#define AN7583_USB_HOST_P0_RST 41 +#define AN7583_GSW_RST 42 +#define AN7583_SFC2_PCM_RST 43 +#define AN7583_PCIE0_RST 44 +#define AN7583_PCIE1_RST 45 +#define AN7583_CPU_TIMER_RST 46 +#define AN7583_PCIE_HB_RST 47 +#define AN7583_XPON_MAC_RST 48 +/* RST_PCIC */ +#define AN7583_PCIC_PERSTOUT0_RST 49 +#define AN7583_PCIC_PERSTOUT1_RST 50 + +#endif /* __DT_BINDINGS_RESET_CONTROLLER_AIROHA_AN7583_H_ */ --=20 2.53.0 From nobody Mon Sep 28 17:48:03 2026 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 765843D6CD9 for ; Wed, 19 Aug 2026 22:15:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787177716; cv=none; b=lUFmUfqqEfQ7TfM+5b5eKoJG+UuXJOC/RG5Way5a9zvKSuMRcO1DgU+TjDzonDfSUO0rSt6olfMxozutB2nA5htjnfAB46R9ITH/YKXvNwE9jcxP+zTI7cqc7K7qbg73hy0DeMP1m2+4SYVMaGvlrm3CbniZMna4lf1fM7aaQoY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787177716; c=relaxed/simple; bh=Rv6whItDIcmUGSMIuRgbHjmoSSgoD1ibtk6GYIWC/CA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JHe0waVnllYhFws5rlonoSL/ZAslxtuw2CNqpSlKgmhHSjL9BqvmqmVLhYk+f2Jo3Zlt/4zarBulgx+TAJrWg5JBy+qKEXE4FqC7BALao9lgGfFnddZFgXFH2bLkSBLPimF8itvoOIqYs+6jD4nRHVs8RzuRtrdZwKLXCPbsGns= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=COU4le52; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="COU4le52" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-47f7027ca11so915217f8f.3 for ; Wed, 19 Aug 2026 15:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787177713; x=1787782513; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=jqWAE3/FZNMZVbcob+bjMAEwhBq6UWoejE3YQhxncXM=; b=COU4le525IY9jZ7ENVJ1TX8NKR+TWfvM118Ge+G66OyTzYo0gUKROwlh5stB6MALRE uXa/ZH0RAqjidOjUYkuPDLeqZez2uz/Kvbjbscui9q3UBMe+SDfTUYfxeOKQfqbGtFwW iNGamoXD44zEf/oLFa+K6mDMqZzspksTHmN4LP5/P9T77SDVaeaF4XoY/m3WhGixfCmo 2jzW+Qtyffz0hpRrZJNa8wVL70mL5rm8XqVsJ8EYO3CnriV5187lBemJqCI4yZRn9sqv csD7vMmR7xoYNIfXevEF9tX15+uDtElZp4aYc74tdJrd2SLOC99H1eOdN3UzA1WhqJDu YLFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787177713; x=1787782513; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=jqWAE3/FZNMZVbcob+bjMAEwhBq6UWoejE3YQhxncXM=; b=af6u1KCk4UC+jjArB0BIui/ploVuBg0onOxZ08BoYIMO5noLXGxqWfz2DCU9mZnv2u 40J+/9HuVvO61cR1z3HxZDsasmxnNwTmC5zUk9kc1PsgET0lzGGZ2GyBrN5EHDh5Om4X vUxFbsiWqlTCUBoVy9J1QuzKNuvVEqeX/A6K6IfKG/S+Xm8QCYm+7sWY52d34Q+noseO mn5cYC2AqUKpduu01th/E7Q87po46EXaDaGw57gETWDVZh7pHxVDfiYlILXaX0kUiyh6 qrRmvCWxl9Clu+ZDvfv7WaojI2k1evHMtHq3GMRfeCeYCANmZLedJD0TBMa957Fl1qSj m0sA== X-Forwarded-Encrypted: i=1; AHgh+Rpl0SziVlrulKuFI2NKwmx7+aZZjjINg/pQC69VaD47uW1cYKBG060wC4fvcGK5X4unNQub+k+GAwv3laU=@vger.kernel.org X-Gm-Message-State: AFuF++kg755+ejdpLwcb5Ad9/GIIbSXR2CnsE+B50WXoF9VGaer2pXJl hzMWjbDwXnO4HGicIL4CKR2im/k08GqreRY0jhBG6TQJPMKVOt9nqyM5 X-Gm-Gg: AR+sD13TAievdnW89Vk8ck9Kjc3eigkdljYO7WCZ0li6XmOcyTivpm99OodMMWOXRA0 Wdq5Oeu3geLAB2tD2dkg3R7Z1icCzLW1w+etCHfAWQmIEcM6tzN4nss5thjYb7yEvYPs/ZAtxHZ Sehu0pAqxVYWxHUu7kQNdF6K5XsA2SgvrY2wz8EE/xau7TTcFRVr+xRGLznno64qb/IMdnP6T5q R+0DZ31B0iTkO6UQsPvUjH9Q83KSky83QuicmeED9S4LMuv/iGQlSt3Gy1g2tv7s52On/JAxxrf KjJNpS1OIAeKKKzOYqgETHCzzyvTUj5GezgmeW7v+yp3DpdezhNuE88AyVj5+ef5FkYF0HQnxxn 7lKmuW+9pw0WI1+NrLo62eB77Jx+aTGbHs3VvH/wS21Uk8fCz9GFELW1KUtyWBe9KMfF+3uwRhi TclT+fn0ZjaowNGn9ZJCdXT84bBeF0prGwbHRuU+B0Empv/33EZwX5qc7Y5o9aYrec3wmOlS1Q6 UCUQ1xt0WJqRoz7gHp4Od8viH62l68vuqAl68laM4377Fk9v0T+rLue/OiDfNHJsA== X-Received: by 2002:a05:6000:4619:b0:47f:5b52:5579 with SMTP id ffacd0b85a97d-482b1fe8a4bmr14796270f8f.18.1787177712697; Wed, 19 Aug 2026 15:15:12 -0700 (PDT) Received: from Ansuel-XPS24.localdomain (host-213-45-7-219.pool21345.interbusiness.it. [213.45.7.219]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-482b14c46f2sm9732950f8f.29.2026.08.19.15.15.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2026 15:15:11 -0700 (PDT) From: Christian Marangi To: Stephen Boyd , Brian Masney , Jerome Brunet , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , Felix Fietkau , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christian Marangi Subject: [PATCH v6 2/3] clk: en7523: generalize register clocks function Date: Thu, 20 Aug 2026 00:14:55 +0200 Message-ID: <20260819221458.30040-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260819221458.30040-1-ansuelsmth@gmail.com> References: <20260819221458.30040-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Airoha AN7583 SoC will use the same logic used by Airoha EN7581 SoC to register clocks. Generalize it to register clocks defined in soc_data. Add the clocks definition in EN7581 SoC to support this new implementation. Signed-off-by: Christian Marangi --- drivers/clk/clk-en7523.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk-en7523.c b/drivers/clk/clk-en7523.c index 5c45aacb6409..924e4f3e36b6 100644 --- a/drivers/clk/clk-en7523.c +++ b/drivers/clk/clk-en7523.c @@ -116,6 +116,7 @@ struct en_rst_data { =20 struct en_clk_soc_data { u32 num_clocks; + const struct en_clk_desc *base_clks; const struct clk_ops pcie_ops; int (*hw_init)(struct platform_device *pdev, struct clk_hw_onecell_data *clk_data); @@ -714,12 +715,15 @@ static int en7523_clk_hw_init(struct platform_device = *pdev, static void en7581_register_clocks(struct device *dev, struct clk_hw_onece= ll_data *clk_data, struct regmap *map, void __iomem *base) { + const struct en_clk_soc_data *soc_data; struct clk_hw *hw; u32 rate; int i; =20 - for (i =3D 0; i < ARRAY_SIZE(en7581_base_clks); i++) { - const struct en_clk_desc *desc =3D &en7581_base_clks[i]; + soc_data =3D device_get_match_data(dev); + + for (i =3D 0; i < soc_data->num_clocks - 1; i++) { + const struct en_clk_desc *desc =3D &soc_data->base_clks[i]; u32 val, reg =3D desc->div_reg ? desc->div_reg : desc->base_reg; int err; =20 @@ -1014,6 +1018,7 @@ static const struct en_clk_soc_data en7523_data =3D { }; =20 static const struct en_clk_soc_data en7581_data =3D { + .base_clks =3D en7581_base_clks, /* We increment num_clocks by 1 to account for additional PCIe clock */ .num_clocks =3D ARRAY_SIZE(en7581_base_clks) + 1, .pcie_ops =3D { --=20 2.53.0 From nobody Mon Sep 28 17:48:03 2026 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A4C63E4500 for ; Wed, 19 Aug 2026 22:15:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787177719; cv=none; b=RIrbNgpjw2QfjBlqS4ARQ1m2lVpPHvtbJ6RJS+cxL6Xe6HePMfv5+VPTJAyoDzZLHc9xDkFhZaY5bCYKDX2+sj5tEf1vC/rI/NZi7IDhUc999EVLJhyY52xsbORQqBvh/39OCVNkQQvzubztfZ+fkJXU4KCKmlGzeStm/KZBZkc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787177719; c=relaxed/simple; bh=6Qx6kfMw9tSQYqsPf3PiHLUvAQeX+4N7U0MspCV5iXU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eG+wfOTz40XS2G2UoNpqSPZAjbiCGvtKbHPtOJC2X0a5bSwUeW5USBcaJjmsTOaHchEkr09VY4WGT4Zg5XYZRHKAPKcLcO+e3ZbLZS2QEKU3z0kW1RKuy8RZbEF8DgLuoCe44P4+tn9ssqDyesA0Ihx41PvJ+Yo4MY1YryzvU8M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=V8Ov+1YF; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="V8Ov+1YF" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-490cf322ed0so13512725e9.1 for ; Wed, 19 Aug 2026 15:15:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787177715; x=1787782515; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=4po/BpuVMmSH7orjF22R2xSAn8xfUnzmnHH811uV0xM=; b=V8Ov+1YFUrAgNpPEmasDNZ2OcKonM3F5bTBIjFdwOXenRibAGdfHIkzKx8qM6Fuz2z M2T7GHNNt8hiqkMmMyyXQ6E3JObBGJeL+wRi6FOLQtZuV8SgU5zCESg76mjAUlTIGqCn 6QG92EC2qZk8XZlPWNG/26XZWaY3a91WF0OKGK2fGTSrs9gqhwOy1mOh4H2Vnof6sQmY Vd8DmNDYI5/jC84H4OiJE58kYVvxZ4FxF7132ToNZ29oSd0zRNvCtCw1OkkB+HLw1Wim UpjU0+aliJPkrrVjtoUx1IkFpg//UkaaKokQ9cxadyYqh1DdcABmgJ4ttfMU9Y+TtqsC XLsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787177715; x=1787782515; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=4po/BpuVMmSH7orjF22R2xSAn8xfUnzmnHH811uV0xM=; b=CU6wV2re57jrml/FukEKpoma7dBhlRZjgkKXm2hsIyjk3DHLCeiK+1gV6j3TN8Psay qUlSD/BJ9Mj22KeN7jt60dKFEYmHzK4pzPx2wsJtf1yl8LdM3PPAOKyVf6zS5BhiF8Az j1LgKNOIrBVjprxjaIYHgSXeI8hpL4u00xLZRZIURnkQ0Zd3mLwkVvy0xi/meWbIIdPm XpYjQ7uI3XHspYCM8AK/KkrSplqg9YzqTNpqKf6eVpzULFaAvoSv5bZgJfNbNJ+aQ0mV O0Q1ZBbIEKm6t9irnmUDCex+rs2X/AKcbQalySISl4yTvsONPZsBMk4q3PGxafilUzIO emQQ== X-Forwarded-Encrypted: i=1; AHgh+Rrm53Jv0AijD4f2TRZ8WlTY7A6rDemCqPC6Y4pGXW4fc+0OQc5l42JAuicnRj88EM+XImev8ZMVoNZ/Vho=@vger.kernel.org X-Gm-Message-State: AOJu0YyWK+NIFW4BK4q1hIOqHqW+3n25X1eAY1CIK9xp1fATcePs7/Fc EBkZ2XNvuJGk6waA1cYWTtmgcJcoeJaifOq/2SVqn25PJ4JWPk/gnv/W X-Gm-Gg: AR+sD1114LQLtQwIpsB+b8dPXjFmrCyA9SuT4WXtuIgOzgMXTZMLWwKx5YbKc5bVJNJ ITQQ+Hfn4598mibKRQt1JeciUz1cEBpnhHaos88R1JvoQZBZ9AcYDZOkWyJ6h9abExU56psBToP XL1LaVuQ+UNMUWOOKUCeSBSlMSFgcfXwxMexZBQb2jVoD1TgGwPjtCjde6i0NjbAbsGBxLiCktC 1Hey71dx6FAXjdPzi7IXauo8alLPNrKA2nP2e5sB4FUNAb6aIYuUSPjwsfkE3YmDx7Z++/wXA3O jJZEjyosBuEt2zMUb677kD8iO4DYWkVPXQg8tkcl7/PHbViiQHND7uK46hlaGleCDB9wa115xKY isGdjMJcuAHr4RZTZpDwwu16YRY0KyviFE/+s03cs21PnmkR5yWOwTwxXn0dRQBzKGEtjMY8+oi ubU1IrtrLmSt0cefE4LmwlshEM16h+YgoeEDNLCpFoviobHSgslWb8Ezfaiw5STrnH2HMl0gBno QkLC7Dj0sy+QAaBZiib0JgU6VO70a0gcVdGrfH9c4InipKz8NpPtFc= X-Received: by 2002:a05:600c:a47:b0:499:726a:a017 with SMTP id 5b1f17b1804b1-499aa14a6ebmr119885875e9.1.1787177714707; Wed, 19 Aug 2026 15:15:14 -0700 (PDT) Received: from Ansuel-XPS24.localdomain (host-213-45-7-219.pool21345.interbusiness.it. [213.45.7.219]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-482b14c46f2sm9732950f8f.29.2026.08.19.15.15.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2026 15:15:13 -0700 (PDT) From: Christian Marangi To: Stephen Boyd , Brian Masney , Jerome Brunet , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , Felix Fietkau , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christian Marangi Subject: [PATCH v6 3/3] clk: en7523: add support for Airoha AN7583 clock Date: Thu, 20 Aug 2026 00:14:56 +0200 Message-ID: <20260819221458.30040-4-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260819221458.30040-1-ansuelsmth@gmail.com> References: <20260819221458.30040-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add support for Airoha AN7583 clock and reset. Airoha AN7583 SoC have the same register address of EN7581 but implement different bits and additional base clocks. Also reset are different with the introduction of 2 dedicated MDIO line and drop of some reset lines. Signed-off-by: Christian Marangi --- drivers/clk/clk-en7523.c | 241 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 241 insertions(+) diff --git a/drivers/clk/clk-en7523.c b/drivers/clk/clk-en7523.c index 924e4f3e36b6..f57541ecef84 100644 --- a/drivers/clk/clk-en7523.c +++ b/drivers/clk/clk-en7523.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -135,6 +136,14 @@ static const u32 crypto_base[] =3D { 540000000, 480000= 000 }; static const u32 emmc7581_base[] =3D { 200000000, 150000000 }; /* EN751221 */ static const u32 gsw751221_base[] =3D { 500000000, 250000000, 400000000, 2= 00000000 }; +/* AN7583 */ +static const u32 gsw7583_base[] =3D { 540672000, 270336000, 400000000, 200= 000000 }; +static const u32 emi7583_base[] =3D { 540672000, 480000000, 400000000, 300= 000000 }; +static const u32 bus7583_base[] =3D { 600000000, 540672000, 480000000, 400= 000000 }; +static const u32 spi7583_base[] =3D { 400000000, 12500000 }; +static const u32 npu7583_base[] =3D { 666000000, 800000000, 720000000, 600= 000000 }; +static const u32 crypto7583_base[] =3D { 540672000, 400000000 }; +static const u32 emmc7583_base[] =3D { 150000000, 200000000 }; =20 static const struct en_clk_desc en7523_base_clks[] =3D { { @@ -337,6 +346,138 @@ static const struct en_clk_desc en7581_base_clks[] = =3D { } }; =20 +static const struct en_clk_desc an7583_base_clks[] =3D { + { + .id =3D EN7523_CLK_GSW, + .name =3D "gsw", + + .base_reg =3D REG_GSW_CLK_DIV_SEL, + .base_bits =3D 2, + .base_shift =3D 8, + .base_values =3D gsw7583_base, + .n_base_values =3D ARRAY_SIZE(gsw7583_base), + + .div_bits =3D 3, + .div_shift =3D 0, + .div_step =3D 1, + .div_offset =3D 1, + }, { + .id =3D EN7523_CLK_EMI, + .name =3D "emi", + + .base_reg =3D REG_EMI_CLK_DIV_SEL, + .base_bits =3D 2, + .base_shift =3D 8, + .base_values =3D emi7583_base, + .n_base_values =3D ARRAY_SIZE(emi7583_base), + + .div_bits =3D 3, + .div_shift =3D 0, + .div_step =3D 1, + .div_offset =3D 1, + }, { + .id =3D EN7523_CLK_BUS, + .name =3D "bus", + + .base_reg =3D REG_BUS_CLK_DIV_SEL, + .base_bits =3D 2, + .base_shift =3D 8, + .base_values =3D bus7583_base, + .n_base_values =3D ARRAY_SIZE(bus7583_base), + + .div_bits =3D 3, + .div_shift =3D 0, + .div_step =3D 1, + .div_offset =3D 1, + }, { + .id =3D EN7523_CLK_SLIC, + .name =3D "slic", + + .base_reg =3D REG_SPI_CLK_FREQ_SEL, + .base_bits =3D 1, + .base_shift =3D 1, + .base_values =3D slic_base, + .n_base_values =3D ARRAY_SIZE(slic_base), + + .div_reg =3D REG_SPI_CLK_DIV_SEL, + .div_bits =3D 5, + .div_shift =3D 24, + .div_val0 =3D 20, + .div_step =3D 2, + }, { + .id =3D EN7523_CLK_SPI, + .name =3D "spi", + + .base_reg =3D REG_SPI_CLK_FREQ_SEL, + .base_bits =3D 1, + .base_shift =3D 0, + .base_values =3D spi7583_base, + .n_base_values =3D ARRAY_SIZE(spi7583_base), + + .div_reg =3D REG_SPI_CLK_DIV_SEL, + .div_bits =3D 5, + .div_shift =3D 8, + .div_val0 =3D 40, + .div_step =3D 2, + }, { + .id =3D EN7523_CLK_NPU, + .name =3D "npu", + + .base_reg =3D REG_NPU_CLK_DIV_SEL, + .base_bits =3D 2, + .base_shift =3D 9, + .base_values =3D npu7583_base, + .n_base_values =3D ARRAY_SIZE(npu7583_base), + + .div_bits =3D 3, + .div_shift =3D 0, + .div_step =3D 1, + .div_offset =3D 1, + }, { + .id =3D EN7523_CLK_CRYPTO, + .name =3D "crypto", + + .base_reg =3D REG_CRYPTO_CLKSRC2, + .base_bits =3D 1, + .base_shift =3D 0, + .base_values =3D crypto7583_base, + .n_base_values =3D ARRAY_SIZE(crypto7583_base), + }, { + .id =3D EN7581_CLK_EMMC, + .name =3D "emmc", + + .base_reg =3D REG_CRYPTO_CLKSRC2, + .base_bits =3D 1, + .base_shift =3D 13, + .base_values =3D emmc7583_base, + .n_base_values =3D ARRAY_SIZE(emmc7583_base), + }, { + .id =3D AN7583_CLK_MDIO0, + .name =3D "mdio0", + + .base_reg =3D REG_CRYPTO_CLKSRC2, + + .base_value =3D 25000000, + + .div_bits =3D 4, + .div_shift =3D 15, + .div_step =3D 1, + .div_offset =3D 1, + }, { + .id =3D AN7583_CLK_MDIO1, + .name =3D "mdio1", + + .base_reg =3D REG_CRYPTO_CLKSRC2, + + .base_value =3D 25000000, + + .div_bits =3D 4, + .div_shift =3D 19, + .div_step =3D 1, + .div_offset =3D 1, + } +}; + static const u16 en7581_rst_ofs[] =3D { REG_RST_CTRL2, REG_RST_CTRL1, @@ -512,6 +653,64 @@ static const u16 en751221_rst_map[] =3D { [EN751221_USB_PHY_P1_RST] =3D 3 * RST_NR_PER_BANK + 7, }; =20 +static const u16 an7583_rst_map[] =3D { + /* RST_CTRL2 */ + [AN7583_XPON_PHY_RST] =3D 0, + [AN7583_GPON_OLT_RST] =3D 1, + [AN7583_CPU_TIMER2_RST] =3D 2, + [AN7583_HSUART_RST] =3D 3, + [AN7583_UART4_RST] =3D 4, + [AN7583_UART5_RST] =3D 5, + [AN7583_I2C2_RST] =3D 6, + [AN7583_XSI_MAC_RST] =3D 7, + [AN7583_XSI_PHY_RST] =3D 8, + [AN7583_NPU_RST] =3D 9, + [AN7583_TRNG_MSTART_RST] =3D 12, + [AN7583_DUAL_HSI0_RST] =3D 13, + [AN7583_DUAL_HSI1_RST] =3D 14, + [AN7583_DUAL_HSI0_MAC_RST] =3D 16, + [AN7583_DUAL_HSI1_MAC_RST] =3D 17, + [AN7583_XPON_XFI_RST] =3D 18, + [AN7583_WDMA_RST] =3D 19, + [AN7583_WOE0_RST] =3D 20, + [AN7583_HSDMA_RST] =3D 22, + [AN7583_TDMA_RST] =3D 24, + [AN7583_EMMC_RST] =3D 25, + [AN7583_SOE_RST] =3D 26, + [AN7583_XFP_MAC_RST] =3D 28, + [AN7583_MDIO0_RST] =3D 30, + [AN7583_MDIO1_RST] =3D 31, + /* RST_CTRL1 */ + [AN7583_PCM1_ZSI_ISI_RST] =3D RST_NR_PER_BANK + 0, + [AN7583_FE_PDMA_RST] =3D RST_NR_PER_BANK + 1, + [AN7583_FE_QDMA_RST] =3D RST_NR_PER_BANK + 2, + [AN7583_PCM_SPIWP_RST] =3D RST_NR_PER_BANK + 4, + [AN7583_CRYPTO_RST] =3D RST_NR_PER_BANK + 6, + [AN7583_TIMER_RST] =3D RST_NR_PER_BANK + 8, + [AN7583_PCM1_RST] =3D RST_NR_PER_BANK + 11, + [AN7583_UART_RST] =3D RST_NR_PER_BANK + 12, + [AN7583_GPIO_RST] =3D RST_NR_PER_BANK + 13, + [AN7583_GDMA_RST] =3D RST_NR_PER_BANK + 14, + [AN7583_I2C_MASTER_RST] =3D RST_NR_PER_BANK + 16, + [AN7583_PCM2_ZSI_ISI_RST] =3D RST_NR_PER_BANK + 17, + [AN7583_SFC_RST] =3D RST_NR_PER_BANK + 18, + [AN7583_UART2_RST] =3D RST_NR_PER_BANK + 19, + [AN7583_GDMP_RST] =3D RST_NR_PER_BANK + 20, + [AN7583_FE_RST] =3D RST_NR_PER_BANK + 21, + [AN7583_USB_HOST_P0_RST] =3D RST_NR_PER_BANK + 22, + [AN7583_GSW_RST] =3D RST_NR_PER_BANK + 23, + [AN7583_SFC2_PCM_RST] =3D RST_NR_PER_BANK + 25, + [AN7583_PCIE0_RST] =3D RST_NR_PER_BANK + 26, + [AN7583_PCIE1_RST] =3D RST_NR_PER_BANK + 27, + [AN7583_CPU_TIMER_RST] =3D RST_NR_PER_BANK + 28, + [AN7583_PCIE_HB_RST] =3D RST_NR_PER_BANK + 29, + [AN7583_XPON_MAC_RST] =3D RST_NR_PER_BANK + 31, + + /* RST_PCIC */ + [AN7583_PCIC_PERSTOUT0_RST] =3D 2 * RST_NR_PER_BANK + 29, + [AN7583_PCIC_PERSTOUT1_RST] =3D 2 * RST_NR_PER_BANK + 26, +}; + static int en7581_reset_register(struct device *dev, void __iomem *base, const u16 *rst_map, int nr_resets, const u16 *rst_reg_ofs); @@ -885,6 +1084,35 @@ static int en7581_clk_hw_init(struct platform_device = *pdev, en7581_rst_ofs); } =20 +static int an7583_clk_hw_init(struct platform_device *pdev, + struct clk_hw_onecell_data *clk_data) +{ + struct device *dev =3D &pdev->dev; + struct regmap *map; + void __iomem *base; + u32 val; + + map =3D syscon_regmap_lookup_by_phandle(dev->of_node, "airoha,chip-scu"); + if (IS_ERR(map)) + return PTR_ERR(map); + + base =3D devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(base)) + return PTR_ERR(base); + + en7581_register_clocks(dev, clk_data, map, base); + + val =3D readl(base + REG_RST_CTRL1); + val |=3D REG_PCIE_HB_RST; + writel(val, base + REG_RST_CTRL1); + val &=3D ~REG_PCIE_HB_RST; + writel(val, base + REG_RST_CTRL1); + + return en7581_reset_register(dev, base, an7583_rst_map, + ARRAY_SIZE(an7583_rst_map), + en7581_rst_ofs); +} + static enum en_hir get_hw_id(void __iomem *np_base) { u32 val =3D FIELD_GET(REG_HIR_MASK, readl(np_base + REG_HIR)); @@ -1029,6 +1257,18 @@ static const struct en_clk_soc_data en7581_data =3D { .hw_init =3D en7581_clk_hw_init, }; =20 +static const struct en_clk_soc_data an7583_data =3D { + .base_clks =3D an7583_base_clks, + /* We increment num_clocks by 1 to account for additional PCIe clock */ + .num_clocks =3D ARRAY_SIZE(an7583_base_clks) + 1, + .pcie_ops =3D { + .is_enabled =3D en7581_pci_is_enabled, + .enable =3D en7581_pci_enable, + .disable =3D en7581_pci_disable, + }, + .hw_init =3D an7583_clk_hw_init, +}; + static const struct en_clk_soc_data en751221_data =3D { .num_clocks =3D EN751221_MAX_CLKS, .pcie_ops =3D { @@ -1042,6 +1282,7 @@ static const struct en_clk_soc_data en751221_data =3D= { static const struct of_device_id of_match_clk_en7523[] =3D { { .compatible =3D "airoha,en7523-scu", .data =3D &en7523_data }, { .compatible =3D "airoha,en7581-scu", .data =3D &en7581_data }, + { .compatible =3D "airoha,an7583-scu", .data =3D &an7583_data }, { .compatible =3D "econet,en751221-scu", .data =3D &en751221_data }, { /* sentinel */ } }; --=20 2.53.0