Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp273420lqp; Thu, 21 Mar 2024 00:02:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUYRAZL68CxmqIt+9Cn24X4/LwZf7rgYVWXevgUVgbUFlr/HFKb9Ah2RwMfoQ6x2Vcz7tRyZ20V7kaeogN05SxHt70Ss8S7neaUCHzyEA== X-Google-Smtp-Source: AGHT+IFoIjj8km/UCbUBTaJxI6UKlZ6YgI/MAdU28k+HStp4vqcCchm6/mTBf4wJTQ8w4iItRkHr X-Received: by 2002:a05:620a:4728:b0:78a:34c5:e14d with SMTP id bs40-20020a05620a472800b0078a34c5e14dmr35394qkb.1.1711004535603; Thu, 21 Mar 2024 00:02:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711004535; cv=pass; d=google.com; s=arc-20160816; b=YHHurZrE6rWzcbDgKMnrcioCAVqSwJNzDPq2I9suEH7HHAK8SaVTC4scr9ZUaX1sBj d7UES/hjkffMH7IZSYYHSp62ZdhvjR5JPtPpd1kQtHNZ0dJK5QMgu0a3EufT2YE1s73K ide84mZx9iMTgwA2zJJQKYhaz2F+gdR087IwI0NbN2qHUqYQt7ynXsJ/7F8oVCRIoWMC D0d8XwbjwpBmoisI1XqJIBSwHkMYUxz+7Oi7XgCzHZxs9NdK8E23OIeqSctX1jVDxspd 38LhfiyRSxBBE7P9vtE8PMQmA7t3C1x/b4cHxqJp/39AMg6eWUAOHeLBc+2QJdDvc9iA 4IKg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=DJP47pseD2ZY7NaP7759rSonBuFE54K/AWpHpbwV2W8=; fh=xeFh299P/bkya+/xNZw6uqdHHHtn7E+GIPnUdva1CGA=; b=ydJfOlTDJwWn6AoiySjuP4qTz7DkW8Klf74E/35EKJFDKSaSV14F1oPHz+jUwhrwiG loppm0/JvUEa7ZILFsHPR8tLWkR/mifZfZBmpDeOm3HRWECtibBocu8IMksvIO3AGS5W mw3MBvxx0Yhrp2L1ovtVsFMQEEfTtaJKRJp6+c22tzmXwencjFqOc+vaipDYAXPfPQQY p+E/OiSMjp82j+vx7QUlvAdlsNPB4T0Q2xBw401CErAgNv8X59PgeB6MuQ9z3m1zhbqn wqKhEdoKAb7m2Hn3XaOZIglet020K+S5VMJlKFqKWMW880L+5Oqle7u6zV8R/ZXPIfKo Mauw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ynCQXy92; 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-109713-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109713-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 b11-20020a05620a088b00b00789e89df9acsi6794065qka.183.2024.03.21.00.02.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 00:02:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-109713-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=ynCQXy92; 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-109713-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109713-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 0BA001C20DAA for ; Thu, 21 Mar 2024 07:02:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 645524DA10; Thu, 21 Mar 2024 07:02:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="ynCQXy92" Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (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 C6A5556450; Thu, 21 Mar 2024 07:02:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.141 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711004526; cv=none; b=BiEVJVxNjcGtm7WdJT+HKzl2h3whZpz2zo64wdzepjqmzcKh88MamEoi2W+Q14X4QQ1w4ZRIaX2CuxNUJA9W2+/lg6i99u5p7LnyMOUHL8wx2YgNdNX3BpohBpDdGz7qRiAw2oYfrKJ2XQIT6hX1KwJDJ7UcR8TWo4dQIBf7TGM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711004526; c=relaxed/simple; bh=SwY21QFiwGpD1kcAiZUZyOjCoiCibVmG8EdjAluDzsM=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=MRhbdMEIrp7vYCZXFSJtY2rQqv1v0Jwwpcw81v0dfei5czuG0N4TqYQOs2SFyb7X2ws5mCg7ptS1t7GHJNEJ4NXs5Bci81IAxc/UH0XGkajWT8H2KOQfXCS9gY/MxVDv5PKy9QoEGVtTLQw8Ts/8vOl7BIYt4DD6qT2RtIlJQos= 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=ynCQXy92; arc=none smtp.client-ip=198.47.19.141 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 fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 42L71i5j014711; Thu, 21 Mar 2024 02:01:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1711004504; bh=DJP47pseD2ZY7NaP7759rSonBuFE54K/AWpHpbwV2W8=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=ynCQXy92jpkozeHVfpylGUaOryqC5wpun1PGjj78Nwq45Xs+k+6557eX5mXIk2v2Y FE4kkQCieLeMddWZM903qMSfVP3AXoM2q24eWz8CAgq34XBjHJvZn9cuNSjI3CZS5D 8Vt3q84dN6xT5sAi0Crz1+RR3zZumL/qOhDOL4w0= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 42L71ik3011527 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 21 Mar 2024 02:01:44 -0500 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 21 Mar 2024 02:01:44 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE110.ent.ti.com (157.170.170.21) 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, 21 Mar 2024 02:01:44 -0500 Received: from [172.24.227.220] (chintan-thinkstation-p360-tower.dhcp.ti.com [172.24.227.220]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 42L71dYr072133; Thu, 21 Mar 2024 02:01:40 -0500 Message-ID: Date: Thu, 21 Mar 2024 12:31:38 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 2/6] arm64: dts: ti: k3-j784s4: Add alias to MCU CPSW2G Content-Language: en-US To: Andrew Davis , Peter Rosin , Greg Kroah-Hartman , Conor Dooley , Krzysztof Kozlowski , Rob Herring , Tero Kristo , Vignesh Raghavendra , Nishanth Menon CC: , , , , , , References: <20240131101441.1362409-1-c-vankar@ti.com> <20240131101441.1362409-3-c-vankar@ti.com> <469a7f15-0539-48e9-993c-5b9c638917e0@ti.com> <0512d57f-af22-4bd8-8266-33d943d7eb4a@ti.com> From: Chintan Vankar In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 On 19/03/24 21:05, Andrew Davis wrote: > On 3/11/24 5:44 AM, Chintan Vankar wrote: >> >> >> On 31/01/24 21:06, Andrew Davis wrote: >>> On 1/31/24 4:14 AM, Chintan Vankar wrote: >>>> Add alias for the MCU CPSW2G port to enable Linux to fetch MAC Address >>>> for the port directly from U-Boot. >>> >>> Could you explain *how* this alias allows Linux to fetch a MAC >>> address from U-Boot? Sounds like we are doing something hacky here.. >>> >> Using "probe_daughtercards()" function U-Boot parses MAC addresses from >> EEPROM, then it internally calls "eth_env_set_enetaddr_by_index()" >> function which stores these MAC addresses into environment variables >> ethaddr, eth1addr, eth2addr and so on based on number of ports. >> >> U-Boot loads DTB during boot process, and it calls >> "fdt_fixup_ethernet()" function, which uses environment variables to >> update MAC addresses of ethernet ports as specified in the aliases >> section. >> > > So maybe a better question would by why does it need to use aliases > for this? > Since "probe_daughtercards()" in U-Boot is implemented in a way that it gets the MAC addresses fromm EEPROM and "fdt_fixup_ethernet()" function configures MAC addresses for the ethernet ports as specified in aliases section. >>> Why can't Linux fetch the MAC from efuses the same way U-Boot does, >> >> Linux can fetch the MAC address from efuses if "ti,syscon-efuse" >> property is enabled. >> > > Then let's do it this way always. > Yes, Linux reads MAC addresses from efuse this way only, but the functionality of Linux getting the MAC addresses from EEPROM is not implemented. >>> what happens if I don't use U-Boot to boot? >> >> If you don't use U-Boot to boot then the equivalent of >> "probe_daughtercards()" has to be implemented which is currently >> missing. >> > > Or we just let Linux fetch it instead of implementing that function > in all the possible bootloaders. This would also remove a DTB fixup. > Those fixups should be avoided if at all possible. > Yes, we can let Linux fetch MAC addresses, but right now the Ethernet driver in Linux can only fetch MAC addresses from "EFUSE" and not from "EEPROM", and since the functionality to fetch MAC addresses from "EEPROM" is implemented in U-Boot we are utilizing it. > Andrew > >>> >>> Andrew >>> >>>> --- >>>>   arch/arm64/boot/dts/ti/k3-j784s4-evm.dts | 1 + >>>>   1 file changed, 1 insertion(+) >>>> >>>> diff --git a/arch/arm64/boot/dts/ti/k3-j784s4-evm.dts >>>> b/arch/arm64/boot/dts/ti/k3-j784s4-evm.dts >>>> index f34b92acc56d..b74f7d3025de 100644 >>>> --- a/arch/arm64/boot/dts/ti/k3-j784s4-evm.dts >>>> +++ b/arch/arm64/boot/dts/ti/k3-j784s4-evm.dts >>>> @@ -27,6 +27,7 @@ aliases { >>>>           mmc1 = &main_sdhci1; >>>>           i2c0 = &wkup_i2c0; >>>>           i2c3 = &main_i2c0; >>>> +        ethernet0 = &mcu_cpsw_port1; >>>>       }; >>>>       memory@80000000 {