From nobody Mon Oct 6 20:58:59 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 EF12D2FD883 for ; Thu, 17 Jul 2025 17:11:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752772280; cv=none; b=KVqORls2Jbd6UoZJPdyqPSfjctOAS85cRpHJTGwcvKKbV1X85DIfkZ6g2/AXe0UWkUztgDrB5hBO6/6acF1gpDg2I7od0M6aEF+BerESsZjOzNpeX3s3nOw6P+9aKmKSLi932kPwezWQdWeECltzQ2+HTKu0Qnv8flFyRH6D3mo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752772280; c=relaxed/simple; bh=8qCq9OayXSySDMcO9kUVXO5iWHFCPIYqWEidFWXyRJQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Jd/b928QB1+JKYfyXu922rM2mn94hrfN3JS1PNEjoE0hjqUEp463QZk2xMAkvYqajjglPUUMWE/YDtaGS0MCb8KHxcJOg7VC8WqfiOWIFNtbz0yZYMAkM0KESCaFfbBet4L8j1h2MrDjKqp4zLOY1bstLnRv6c+vhA6r96UQkaw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=ZtEaWq3c; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZtEaWq3c" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752772278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xagYrAR0OP8mWYVE7CNmGAY9Ju20MBtsOAnBb9IfOoE=; b=ZtEaWq3c6oFHRaxquIst+hjZI0N9q/jE7UsMRAq/iWcvU8BoTSydnEWh7AElaRZT+D0PoL JBFZ4yhSKwQjk4Yul8HA3D46LSPqSiZ7o14yVCoMTNL6Kw9zrkuYi4S/mtVkt3PjAfhrDz 15obzWB0vTGbrOsofuGRxQLWP9+w3+s= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-449-p6SJ0MBHP4GRtDfmFaGs4w-1; Thu, 17 Jul 2025 13:11:14 -0400 X-MC-Unique: p6SJ0MBHP4GRtDfmFaGs4w-1 X-Mimecast-MFC-AGG-ID: p6SJ0MBHP4GRtDfmFaGs4w_1752772273 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8955118088B4; Thu, 17 Jul 2025 17:11:09 +0000 (UTC) Received: from p16v.luc.cera.cz (unknown [10.44.34.5]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9CD1F195609D; Thu, 17 Jul 2025 17:11:05 +0000 (UTC) From: Ivan Vecera To: netdev@vger.kernel.org Cc: Vadim Fedorenko , Arkadiusz Kubalewski , Jiri Pirko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Prathosh Satish , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Michal Schmidt , Petr Oros Subject: [PATCH net-next 1/2] dt-bindings: dpll: Add clock ID property Date: Thu, 17 Jul 2025 19:10:59 +0200 Message-ID: <20250717171100.2245998-2-ivecera@redhat.com> In-Reply-To: <20250717171100.2245998-1-ivecera@redhat.com> References: <20250717171100.2245998-1-ivecera@redhat.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 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Content-Type: text/plain; charset="utf-8" Add property to specify the ID of the clock that the DPLL device drives. The ID value represents Unique Clock Identified (EUI-64) defined by IEEE 1588 standard. The property is not mandatory because some DPLL devices can have an ability to read this from HW. The situation is very similar to network controllers without assigned MAC address. Signed-off-by: Ivan Vecera --- Documentation/devicetree/bindings/dpll/dpll-device.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/dpll/dpll-device.yaml b/Docu= mentation/devicetree/bindings/dpll/dpll-device.yaml index fb8d7a9a3693f..8e4ffe8ca279c 100644 --- a/Documentation/devicetree/bindings/dpll/dpll-device.yaml +++ b/Documentation/devicetree/bindings/dpll/dpll-device.yaml @@ -27,6 +27,11 @@ properties: "#size-cells": const: 0 =20 + clock-id: + description: Specifies ID of the clock that the DPLL device drives + $ref: /schemas/types.yaml#/definitions/uint64 + minimum: 1 + dpll-types: description: List of DPLL channel types, one per DPLL instance. $ref: /schemas/types.yaml#/definitions/non-unique-string-array --=20 2.49.1 From nobody Mon Oct 6 20:58:59 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 4EC472FE311 for ; Thu, 17 Jul 2025 17:11:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752772281; cv=none; b=Lrl6fnTcQ/lekKE+QsMOcMNvsQCiGws91WuCdzQH41ZZZrV/nTnBuzeFPK/NlEVpXhVR477Zs4Ao5WyyNV3r4Icmxx9f3DzeUGJF9+a/evcpzKc/fr5Ylhpp+Fpt3LUf7/1V7paKUoRPHjTtNPt0MxeFEUITnug3lIMUh+dRKbk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752772281; c=relaxed/simple; bh=DmkylwdM0lAAqKm4MO7YG+O67QtSLYCbav0RyGbAzYI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tenDrAgTdBrkad9pYR0mntC0Fiue0Fd1bNrMYNJgZiTGhTYYlhQDBPanuvOblHXqIDN8qNY6RIbnUVmsdrLhjsEyg160gnmdrCnbp47sSa5skeAwurfBnzyFhGQTYrpsVwXjEc/Rbdhr3AMC16RFpnizztq5KZdUQRxqFquCb5o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=ENwZTOCi; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ENwZTOCi" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752772279; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8SRtS+ULHXF2aDS6IuTFJjw62D9Wnccq0o5WziuZyN4=; b=ENwZTOCisOiIX04XG9QkAJS6ERmQICSd+yyq2VhYF0Tg5gH1p/SRu7xoB9X/Q6fkOGg7Rh 1rhoGJEtDwahHAXQhpXGusIo50Db9nZr3hMHndKQZMVTs3QQkx+gq7uiBu3cz3lFhgcaej IJitk7b43LrDFD/0DyfH19pbzQp+iaw= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-682-nd641XWnOjCk8vLbP9iwNA-1; Thu, 17 Jul 2025 13:11:15 -0400 X-MC-Unique: nd641XWnOjCk8vLbP9iwNA-1 X-Mimecast-MFC-AGG-ID: nd641XWnOjCk8vLbP9iwNA_1752772274 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D847D19560BE; Thu, 17 Jul 2025 17:11:13 +0000 (UTC) Received: from p16v.luc.cera.cz (unknown [10.44.34.5]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F0EE1195608D; Thu, 17 Jul 2025 17:11:09 +0000 (UTC) From: Ivan Vecera To: netdev@vger.kernel.org Cc: Prathosh Satish , Vadim Fedorenko , Arkadiusz Kubalewski , Jiri Pirko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Prathosh Satish , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Michal Schmidt , Petr Oros Subject: [PATCH net-next 2/2] dpll: zl3073x: Initialize clock ID from device property Date: Thu, 17 Jul 2025 19:11:00 +0200 Message-ID: <20250717171100.2245998-3-ivecera@redhat.com> In-Reply-To: <20250717171100.2245998-1-ivecera@redhat.com> References: <20250717171100.2245998-1-ivecera@redhat.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 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Content-Type: text/plain; charset="utf-8" The clock ID value can be specified by the platform via 'clock-id' property. Use this property value to initialize clock ID and if it is not specified generate random one as fallback. Tested-by: Prathosh Satish Signed-off-by: Ivan Vecera --- drivers/dpll/zl3073x/core.c | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/drivers/dpll/zl3073x/core.c b/drivers/dpll/zl3073x/core.c index 7ebcfc5ec1f09..f5245225f1d3b 100644 --- a/drivers/dpll/zl3073x/core.c +++ b/drivers/dpll/zl3073x/core.c @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include #include #include @@ -932,6 +934,29 @@ zl3073x_dev_phase_meas_setup(struct zl3073x_dev *zldev= , int num_channels) return zl3073x_write_u8(zldev, ZL_REG_DPLL_PHASE_ERR_READ_MASK, mask); } =20 +/** + * zl3073x_dev_clock_id_init - initialize clock ID + * @zldev: pointer to zl3073x device + * + * Initializes clock ID using device property if it is provided or + * generates random one. + */ +static void +zl3073x_dev_clock_id_init(struct zl3073x_dev *zldev) +{ + u64 clock_id; + int rc; + + /* Try to read clock ID from device property */ + rc =3D device_property_read_u64(zldev->dev, "clock-id", &clock_id); + + /* Generate random id if the property does not exist or value is zero */ + if (rc || !clock_id) + clock_id =3D get_random_u64(); + + zldev->clock_id =3D clock_id; +} + /** * zl3073x_dev_probe - initialize zl3073x device * @zldev: pointer to zl3073x device @@ -985,11 +1010,8 @@ int zl3073x_dev_probe(struct zl3073x_dev *zldev, FIELD_GET(GENMASK(15, 8), cfg_ver), FIELD_GET(GENMASK(7, 0), cfg_ver)); =20 - /* Generate random clock ID as the device has not such property that - * could be used for this purpose. A user can later change this value - * using devlink. - */ - zldev->clock_id =3D get_random_u64(); + /* Initialize clock ID */ + zl3073x_dev_clock_id_init(zldev); =20 /* Initialize mutex for operations where multiple reads, writes * and/or polls are required to be done atomically. --=20 2.49.1