Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp4544lqp; Thu, 4 Apr 2024 05:46:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXDSPzeD4eITk75RBsr79TuyZyO0Kiwl9fgWOVMFYtlZMgZFECdVL+s79U3gXCzUbVWOL/KKlws/i/YRB7ZUSNsBupUU6eY06LckxYRuQ== X-Google-Smtp-Source: AGHT+IHOHXr4dfCUSXp/mfmNze94P996NidTWLFvPEHUaqZTkIOBPz32Y5lmG5BdGm4S2tKsLhro X-Received: by 2002:a1f:7c0b:0:b0:4c0:1bb6:322 with SMTP id x11-20020a1f7c0b000000b004c01bb60322mr1685121vkc.15.1712234797006; Thu, 04 Apr 2024 05:46:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712234796; cv=pass; d=google.com; s=arc-20160816; b=lY3biOgrKhLhs9sUXAzOLkoLiJStWd931TpLITpW9AVc7Ux9SSmcYMKJeHrjhOQJY0 Unj8XP4Vh8rY6ThYzrv/D6kMyk6kIQTLMEWxk4Br5FpsIlO4v3NwPviyyJlbS514Ax+Q tHKa70VwIjit2Q0s//4a5WK2afEIhdPc1qVODCnWN9QH/dlFLEjL+dqWw3+11lnagZ3N sGl44XSTb0eDCglbyBZEVDDzZXmJEP3oeWPprbAzIvR7jjuIV722DycqquH5VDuVwyZC 1LP9MvirBoaF48o5O0lOueW9Op8mP8oRiutnAouIAmBdqYJmWIJrL1EU2zlEY6UpUzGS eTtg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=qJg1mXxEBeSMHwRCIuB9hLceXhAMTVZyXHOqCCpB/kQ=; fh=cMiJFUl8uvPfY8iHwLUdbvkLZopZrxRQQwz3r4aOoUY=; b=W0+Hpnvb7tndztBi3QK9jV5Bl65EqaX1Bw1T8bci5D6BTQZepG9X7px4q4fRTBNqpe WhMKH7cB2WJEn5H4+a0Hdvl4vHdvGPYYQsxZo+5QdEWooVHvB2JQDtmmxzCZhaQDVi+/ WGof+ehQ+FGWfiKO+481dOEx61+k9F6P6R7ozo2YiJAmr67YsiYxgxIQNlMTy62zU098 WwjIlcA6PLsI4IOTyphqhXESDirJPvNJeYtGMH/Br0rMtUVXk4f/4q88JvYAkkCQemdz KsZAMtMtSlGc1H3kCtmyGHYRxQoFjum3v3jSYcm/cSx2Xd+7RQ4jotg5fKm5EhLOJXkF +rbQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=INwBympi; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-131458-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131458-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id w126-20020a1fdf84000000b004daa963c729si41685vkg.111.2024.04.04.05.46.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 05:46:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131458-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=INwBympi; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-131458-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131458-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 85A091C21A36 for ; Thu, 4 Apr 2024 12:46:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EE66C80C09; Thu, 4 Apr 2024 12:46:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="INwBympi" Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (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 66E3E7492; Thu, 4 Apr 2024 12:46:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.249 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712234790; cv=none; b=Nu5MMDqMsH0WQcOj3I3+OhsytcquqgwtHH8pHUolX3WmSqa0Tk0EbPe5Zy5i5+xQUAey1gkRTcpXBFHxJ8wgWwMFj3fCQqR/kxerUkplb+gWPcgC4lowrWNb+PCWyCQ9j5kyR//Pq7R47unptad1B3p2EFYjSlfCyGOou6nLDgU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712234790; c=relaxed/simple; bh=vSfmQlOnTjFhj0V1lM1jgKnxEb4/A8CPTuffchOy/y4=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Re0/+TT5DkdRPqQio5Wnpz8wMokz7VhXSSdqLHASKtAMuytTynXercI+0GA/DT42f9Z9qEwZxl6yQ1TIyJU0rNJP3UAlCeCSZfvwuFaY3UMWGdw1XeLtVZnw2kHdlIl7w198GMkl/tqLKZlaGvqUUmrD3yt/6XocOWehb7QPf0s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=INwBympi; arc=none smtp.client-ip=198.47.23.249 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 434CkJtG031225; Thu, 4 Apr 2024 07:46:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1712234779; bh=qJg1mXxEBeSMHwRCIuB9hLceXhAMTVZyXHOqCCpB/kQ=; h=From:To:CC:Subject:Date; b=INwBympiz9+H+p/rPLx76IjQMfYsO/3ee8Tdgq2rZ6cihVSpKNxClCFjo6vQzHf0Z ZirSByzB+OKq7vqWy4DehAgkZj04M4v5iPTNbighs48m53yaeQRf0oXjA17XWe7xH3 15brUwoJlVCBZf85ecWPkejaFTWte8UCQGk2lcTQ= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 434CkJwv119773 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 4 Apr 2024 07:46:19 -0500 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 4 Apr 2024 07:46:19 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 4 Apr 2024 07:46:18 -0500 Received: from uda0492258.dhcp.ti.com (uda0492258.dhcp.ti.com [172.24.227.9]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 434CkFK0077955; Thu, 4 Apr 2024 07:46:16 -0500 From: Siddharth Vadapalli To: , , , , , CC: , , , , Subject: [PATCH v3] arm64: dts: ti: k3-am62p: use eFuse MAC Address for CPSW3G Port 1 Date: Thu, 4 Apr 2024 18:16:14 +0530 Message-ID: <20240404124614.891416-1-s-vadapalli@ti.com> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Add the "ethernet-mac-syscon" node within "wkup_conf" node corresponding to the CTRLMMR_MAC_IDx registers within the CTRL_MMR space. Assign the compatible "ti,am62p-cpsw-mac-efuse" to enable "syscon_regmap" operations on these registers. The MAC Address programmed in the eFuse is accessible through the CTRLMMR_MAC_IDx registers. The "ti,syscon-efuse" device-tree property points to the CTRLMMR_MAC_IDx registers, allowing the CPSW driver to fetch the MAC Address and assign it to the network interface associated with CPSW3G MAC Port 1. Signed-off-by: Siddharth Vadapalli --- This patch is based on linux-next tagged next-20240404. Patch depends on: https://patchwork.kernel.org/project/linux-arm-kernel/patch/20240402105708.4114146-1-s-vadapalli@ti.com/ for the newly added "ti,am62p-cpsw-mac-efuse" compatible. v2: https://patchwork.kernel.org/project/linux-arm-kernel/patch/20240404081845.622707-1-s-vadapalli@ti.com/ Changes since v2: - Renamed "cpsw-mac-efuse" node as "ethernet-mac-syscon" based on Krzysztof's suggestion. - Renamed "cpsw_mac_efuse" label as "cpsw_mac_syscon" to match node naming convention. - Updated node-name in commit message to "ethernet-mac-syscon". v1: https://patchwork.kernel.org/project/linux-arm-kernel/patch/20240402094200.4036076-1-s-vadapalli@ti.com/ Changes since v1: - Since "wkup_conf" is modelled as a "simple-bus" rather than being modelled as a System Controller node with the "syscon" compatible, directly passing the reference to the "wkup_conf" node using the "ti,syscon-efuse" device-tree property will not work. Therefore, I posted the patch at: https://patchwork.kernel.org/project/linux-arm-kernel/patch/20240402105708.4114146-1-s-vadapalli@ti.com/ in order to add a new compatible to be used for modelling the CTRLMMR_MAC_IDx registers as System Controller nodes, thereby allowing the existing "ti,syscon-efuse" property to be used. Now, "ti,syscon-efuse" points to the "cpsw_mac_efuse" node within "wkup_conf" node, with "cpsw_mac_efuse" being a "syscon" node. Logs verifying that the CPSW driver assigns the MAC Address from the eFuse based on the CTRLMMR_MAC_IDx registers at 0x43000200 and 0x43000204 to the interface eth0 corresponding to CPSW3G MAC Port 1: https://gist.github.com/Siddharth-Vadapalli-at-TI/63473d68e7a34860566c1339ce3da9f0 arch/arm64/boot/dts/ti/k3-am62p-main.dtsi | 1 + arch/arm64/boot/dts/ti/k3-am62p-wakeup.dtsi | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/arch/arm64/boot/dts/ti/k3-am62p-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62p-main.dtsi index 7337a9e13535..21020b7d3034 100644 --- a/arch/arm64/boot/dts/ti/k3-am62p-main.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am62p-main.dtsi @@ -696,6 +696,7 @@ cpsw_port1: port@1 { label = "port1"; phys = <&phy_gmii_sel 1>; mac-address = [00 00 00 00 00 00]; + ti,syscon-efuse = <&cpsw_mac_syscon 0x0>; }; cpsw_port2: port@2 { diff --git a/arch/arm64/boot/dts/ti/k3-am62p-wakeup.dtsi b/arch/arm64/boot/dts/ti/k3-am62p-wakeup.dtsi index a84756c336d0..7469b3d3a8c9 100644 --- a/arch/arm64/boot/dts/ti/k3-am62p-wakeup.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am62p-wakeup.dtsi @@ -18,6 +18,11 @@ chipid: chipid@14 { reg = <0x14 0x4>; bootph-all; }; + + cpsw_mac_syscon: ethernet-mac-syscon@200 { + compatible = "ti,am62p-cpsw-mac-efuse", "syscon"; + reg = <0x200 0x8>; + }; }; wkup_uart0: serial@2b300000 { -- 2.40.1