From nobody Thu Oct 9 06:05:20 2025 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (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 77E85275B08; Thu, 19 Jun 2025 17:05:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750352707; cv=none; b=AYFHlCkye0I3bcBoJhENmg1RD/RIQY8fLrFQDu/uHVAXHc4qSslO+Vi9VRJC/gBAionXfObtBFopUfahig+MO1Qi43hh2WWQ1UIf76OrAX4FBrMmW9TEFVrI4bKW27WFJ60956c8WqvXXy+COXaxGlFosR6/ijjcj8bhWVwxrUA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750352707; c=relaxed/simple; bh=ZjMY4Fa96m+s23sE8OnwzE3fdgUKcaNsPpnljTmbXxQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bjxTdT13/PQ6jxJDJKfP92/WgDDgzEkARe9Mwgx+cxiaCZJYguoz4iXLO2prPf1FU11N914qHrrTuKVsFei3EN4CuQDKZnD6fZPsT0TPe86Nj848mexTRXMg3AD4v5PZ+c5tWKT2VFquJ/XCWwj511VhZE+TghZYfi6ucVrwyAo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=qo0+a+CC; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="qo0+a+CC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1750352705; x=1781888705; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZjMY4Fa96m+s23sE8OnwzE3fdgUKcaNsPpnljTmbXxQ=; b=qo0+a+CChQFUfB0ZG6oFjgk0wFAt5Pd8ZLazVDvmFvvGCj3IFOPCrV3G y26XKvQKtSbrJpD3HIjxF6V74qD5OgCvBSQ7pYlvpWHgB4ov59UUkiYPg LKoGs/Wejbf3c6cKS2zwUXqKQqzQ495jj/t1zjfqpaRyxkzzJJ5HeV0CX f9Hb/ngofo33gGCSV95K6atw0vWjjl1c+O8AHcBl9swfUVana7r8V+o/t 5qGMLcS5/2egpC/KqI8oCOzNn7h3z5ubPrYypd3aA5fXvIWFGFYhxV3If mufc8u6WrPr8075vSCardb7tbJwFQTqYpchhyWdnQp1NHfaOMCZFxSbOG Q==; X-CSE-ConnectionGUID: sSReNXTdTRmYjwcJmlGBZA== X-CSE-MsgGUID: BhLU5CLySg2t/vGmvgLpEg== X-IronPort-AV: E=Sophos;i="6.16,249,1744095600"; d="scan'208";a="42526388" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 19 Jun 2025 10:05:04 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44; Thu, 19 Jun 2025 10:04:02 -0700 Received: from ryan-Precision-3630-Tower.microchip.com (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.44 via Frontend Transport; Thu, 19 Jun 2025 10:04:02 -0700 From: To: , , , , , , , , , CC: , , , Ryan Wanner Subject: [PATCH 1/3] dt-bindings: net: cdns,macb: Add external REFCLK property Date: Thu, 19 Jun 2025 10:04:13 -0700 Message-ID: <7f9c7308e404a6bcebdc8cc65ccf188dde435924.1750346271.git.Ryan.Wanner@microchip.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" From: Ryan Wanner REFCLK can be provided by an external source so this should be exposed by a DT property. The REFCLK is used for RMII and in some SoCs that use this driver the RGMII 125MHz clk can also be provided by an external source. Signed-off-by: Ryan Wanner Acked-by: Conor Dooley --- Documentation/devicetree/bindings/net/cdns,macb.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/net/cdns,macb.yaml b/Documen= tation/devicetree/bindings/net/cdns,macb.yaml index 8d69846b2e09..e69f60c37793 100644 --- a/Documentation/devicetree/bindings/net/cdns,macb.yaml +++ b/Documentation/devicetree/bindings/net/cdns,macb.yaml @@ -114,6 +114,13 @@ properties: power-domains: maxItems: 1 =20 + cdns,refclk-ext: + type: boolean + description: + This selects if the REFCLK for RMII is provided by an external sourc= e. + For RGMII mode this selects if the 125MHz REF clock is provided by a= n external + source. + cdns,rx-watermark: $ref: /schemas/types.yaml#/definitions/uint32 description: --=20 2.43.0 From nobody Thu Oct 9 06:05:20 2025 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (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 9876C28BAB0; Thu, 19 Jun 2025 17:04:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750352681; cv=none; b=fXlw05pGBzClVVs1HAkLRgC4+Qh5ceDSVuEq/hPN6wo7ctB/6A7/dCPQYKA8HsKEqAWH7/ls6Pgjk3wSWcy5qCsjl7OIJWO5R68pyNsudzDEQf5E02lnFoZuepJOAbbf1fbS5tARrpJ0/wE5s8k3weULONowjTGwyaI89KVxWZc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750352681; c=relaxed/simple; bh=LBxk1XbCpvlQaaVQ7qLlGRQ+MP2uxh41c3edxa57o58=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=n0iJ8VwKoNq18qJ3yvlITrNIVRA9ov232kV4qUKN8HSvOnq96ayhcPWWKpjI4TVbSk5vL1laaKKrhRD3853G7nHPcQ5OAW3SOkJ+wFknfsWHxi7Ekmkb809KztCwYGeuB+WzXjwALS8FKnQe3NBpgABatCkNDj9dtMNh9bkNBlo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=VxPrA0Ts; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="VxPrA0Ts" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1750352680; x=1781888680; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LBxk1XbCpvlQaaVQ7qLlGRQ+MP2uxh41c3edxa57o58=; b=VxPrA0Ts7ZThfQ54tRtFCjj/nyWUvOvoRE5Axf0G8PJhQJtaBzfRG4Pb XLVHU9AOUs+DuKsom4aORyLzl+V2mL7dcqLNfhFHGYj9OKOHGdXhesGOd hB2VJiXSdkIyRsdIRZOSUk9hikLeaBLDLcgHfxBWfezZOJqVfeTdikdhk g38zL96LqFAPhPCeyYTQRG0K/IkDKJ7bppMRORmEKHD9d9dwHQCcigcUW 4Zf8HeWYL5Aji6oJYrAG8B60K2cWQlYAf6FC86Q5docrTWN2yPTXFuf9U 10Mdegpm4Ytb873Unrl2S19xl4bJovSPxQVwEL+cuhOW5lu43SCegLPBT g==; X-CSE-ConnectionGUID: pR/nkXtYSem+L1lGhth8FQ== X-CSE-MsgGUID: x4p3wmC6Rbi9YyjdA3x1iQ== X-IronPort-AV: E=Sophos;i="6.16,249,1744095600"; d="scan'208";a="274392752" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 19 Jun 2025 10:04:38 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44; Thu, 19 Jun 2025 10:04:02 -0700 Received: from ryan-Precision-3630-Tower.microchip.com (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.44 via Frontend Transport; Thu, 19 Jun 2025 10:04:02 -0700 From: To: , , , , , , , , , CC: , , , Ryan Wanner Subject: [PATCH 2/3] net: cadence: macb: Expose REFCLK as a device tree property Date: Thu, 19 Jun 2025 10:04:14 -0700 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" From: Ryan Wanner The RMII and RGMII can both support internal or external provided REFCLKs 50MHz and 125MHz respectively. Since this is dependent on the board that the SoC is on this needs to be set via the device tree. This property flag is checked in the MACB DT node so the REFCLK cap is configured the correct way for the RMII or RGMII is configured on the board. Signed-off-by: Ryan Wanner --- drivers/net/ethernet/cadence/macb_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/etherne= t/cadence/macb_main.c index d1f1ae5ea161..146e532543a1 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4109,6 +4109,8 @@ static const struct net_device_ops macb_netdev_ops = =3D { static void macb_configure_caps(struct macb *bp, const struct macb_config *dt_conf) { + struct device_node *np =3D bp->pdev->dev.of_node; + bool refclk_ext =3D of_property_present(np, "cdns,refclk-ext"); u32 dcfg; =20 if (dt_conf) @@ -4141,6 +4143,9 @@ static void macb_configure_caps(struct macb *bp, } } =20 + if (refclk_ext) + bp->caps |=3D MACB_CAPS_USRIO_HAS_CLKEN; + dev_dbg(&bp->pdev->dev, "Cadence caps 0x%08x\n", bp->caps); } =20 --=20 2.43.0 From nobody Thu Oct 9 06:05:20 2025 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (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 19A9423CB; Thu, 19 Jun 2025 17:04:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750352655; cv=none; b=VifzNk7d5Ixi+W/lQXqek4j4YDLTb4BmB2vmHmw7ru2oenW1eN/0fgooMkGwQ5kuOw90QUxspa1UHvCB3Tgx2DjX0e9rrmDwTpI254/d1oHxcZGewhV/aLNQKQtsq+qpha/pKTf/vSETwlODb3E2VTf91zT+/TdE1jHrvh4bpKQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750352655; c=relaxed/simple; bh=rkue6qCTiyMbLrRxDHpkHGwB6s3jUn/L79o500WV5/g=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Jdt7vvFx2vgbfs7lpxJQQ9wD0yjRoH1myMQ3HHJDc+/jnbrXVL088K/+x5C6yQ6dpACZ8Cp2r2y7TbmS4doAU5TrVALRpHpohK8uH9swsE3byzVo06UtJjFm3Fmec7mKQCxYabBo/uy6KZE5FIC5UCe46+umBVbh2D9xrlK3GFk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=Q9mwf/mA; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="Q9mwf/mA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1750352654; x=1781888654; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rkue6qCTiyMbLrRxDHpkHGwB6s3jUn/L79o500WV5/g=; b=Q9mwf/mA43eLiJlmm18GguPl9owTTyyQTWa8MYIQogeExEbtZsI/nQdx pUYNHWN3yQmuLGwRnFyR/7VmWqLsZWdyPaqHvAivyxLXgbMDdQzr75emp M97ADUD5ESzP8UoOH1LUOH4q7+mEvKRgXW1qAnOXVuyPLNvC+HGIWynYI OzSXcZp6l2IhW+cbjJUfN1xZDhQ3I+8lkP1p/KHV/JVmnAkc4uZZWYTkp M8+A3+70EPl8SKr46meKdQ3dKfAH7PhRLAS9ffpV9T/HT2TW/8bEj1chD S46cHzjGyjDYdtl03T4APrduGJ9VCENsE5/brXWnoCc1E4iZj7yXoQno7 w==; X-CSE-ConnectionGUID: gIxPXZ7kQ0e0IzwdxhfIcw== X-CSE-MsgGUID: /TXATMiURlqyR2BrkjcObg== X-IronPort-AV: E=Sophos;i="6.16,249,1744095600"; d="scan'208";a="48040283" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 19 Jun 2025 10:04:12 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44; Thu, 19 Jun 2025 10:04:02 -0700 Received: from ryan-Precision-3630-Tower.microchip.com (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.44 via Frontend Transport; Thu, 19 Jun 2025 10:04:02 -0700 From: To: , , , , , , , , , CC: , , , Ryan Wanner Subject: [PATCH 3/3] net: cadence: macb: Enable RMII for SAMA7 gem Date: Thu, 19 Jun 2025 10:04:15 -0700 Message-ID: <0d56e0bd0cb32d1d9ff2c5674f66986251db5e40.1750346271.git.Ryan.Wanner@microchip.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" From: Ryan Wanner This macro enables the RMII mode bit in the USRIO register when RMII mode is requested. Signed-off-by: Ryan Wanner --- drivers/net/ethernet/cadence/macb_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/etherne= t/cadence/macb_main.c index 146e532543a1..f4f922915ade 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -5101,6 +5101,7 @@ static const struct macb_config mpfs_config =3D { =20 static const struct macb_config sama7g5_gem_config =3D { .caps =3D MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_CLK_HW_CHG | + MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_MIIONRGMII | MACB_CAPS_GEM_HAS_PTP, .dma_burst_length =3D 16, .clk_init =3D macb_clk_init, --=20 2.43.0