From patchwork Wed May 3 14:16:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13230202 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B6406C77B75 for ; Wed, 3 May 2023 14:17:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=p8yutMsi1dYM4XGbXK5Z3FOCrIMIj6ESCWGg5hxOhwQ=; b=tzlJUcr4VuM8C4 MHIpCFXhaJPHA9FWKM2JSRmL300egR6A+cXx60FistbX2HBPZskDzpTC5Tus8VT2CuCqtBOIMDV2p Dh9mEUzAklY6g245iCspV5OWp7FQNWrUD3cMrSLluKQQc/S7d3lbdQSTn83ER0FxQYHVIbJMr43rB LZQoXzf17WLQJIphsUHg4UIhhcp9yCKZRZbRKp2vyzkFlyJsPHZoHq2hFT+Zm7K/TzHfBnQF93Tb+ FM695vRDMYA96NtF3xfa1qbbS94sHjXSOw+r0bKYIp+V/KvPagKUo6tP2uhT0DRqAVmSIykrTncIg 6C4IdLLarugIgQcIvnKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1puDHd-004nzH-0Z; Wed, 03 May 2023 14:16:41 +0000 Received: from mx1.tq-group.com ([93.104.207.81]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1puDHZ-004nxt-0L for linux-arm-kernel@lists.infradead.org; Wed, 03 May 2023 14:16:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1683123397; x=1714659397; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=5KpAM7ysjDnKkIcSK/F0J25T6tAF5FB7NOCWNkGG9DI=; b=DFAmFPQpvAn2CgDLhuv0mNNxDflPO2uBt92sumhEqomqX2/bopYylkZQ MBr/xRwhT9PkZuCRjmeNrRoDOufR/fag6F9Y2jur5IWjM5M+Y0ha3yjGo 3XQ7BMlQBmwYInbjdoCAXl4EnSi/YmmpijPtnRgVMq+1z7fUPT/dwuIDf UX5wJhUme/v9EcDtxShBgyTcovd2GJ3QfBgiSglz6Kll5G3AZX+p4vY9t yLg7xpwTfJToe8PshaGoyCLMyeQ+cjZnXPgZAsQy/k0+t9i1XCXZiYAQz ye/c2LoVW3M4DCrpabRyD5NaXhg/GNPp2L4+r5FrpZ3/tI23nVmIgUNKL A==; X-IronPort-AV: E=Sophos;i="5.99,247,1677538800"; d="scan'208";a="30697843" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 03 May 2023 16:16:33 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Wed, 03 May 2023 16:16:33 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Wed, 03 May 2023 16:16:33 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1683123393; x=1714659393; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=5KpAM7ysjDnKkIcSK/F0J25T6tAF5FB7NOCWNkGG9DI=; b=nT8oAjPKRvfLMisHJQ3o1F5T50JaS/HSpw/1jdzWaVhtzyWA3fxtuKwJ iwtSsA1MD2CFkCT7EYQ7/tsrX4BfWB5BNrhlAkegovG4d6p8KcHRM7COh Lb+mfLNWqiT25GqGAbIHqWNLcJ90fOaS5N0gHLQiGGO0mmHt2bJ9OoNIG +l7WkQcbQfRGu6CjHM9z+CjarX44AUn+scWHGeDTyUabqEvc/ulQQTtei SVZCBR1E05M9zKciCYRNUR6qGy16sP6u+3tns0+BzHMXj8RXiLWmRiF/P klT4xUFcXnGBoFETYeoktJXcST2jDwkWHentz6TlZ7C2ynPiC8I5py7c1 Q==; X-IronPort-AV: E=Sophos;i="5.99,247,1677538800"; d="scan'208";a="30697842" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 03 May 2023 16:16:33 +0200 Received: from steina-w.tq-net.de (unknown [10.123.53.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 512B7280056; Wed, 3 May 2023 16:16:33 +0200 (CEST) From: Alexander Stein To: Srinivas Kandagatla , Shawn Guo , Sascha Hauer , Fabio Estevam Cc: Alexander Stein , Pengutronix Kernel Team , NXP Linux Team , linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/1] nvmem: imx-ocotp: Fix MAC address reversal for i.MX6/7 derivates Date: Wed, 3 May 2023 16:16:27 +0200 Message-Id: <20230503141627.2546884-1-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230503_071637_523367_6F4BC94A X-CRM114-Status: GOOD ( 14.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Not just i.MX8M, but all i.MX6/7 (and subtypes) need to reverse the MAC address read from fuses. Exceptions are i.MX6SLL and i.MX7ULP which do not support ethernet at all. Fixes: d0221a780cbc ("nvmem: imx-ocotp: add support for post processing") Signed-off-by: Alexander Stein --- Looking at [1] reading MAC address from fuses in u-boot is the same for all i.MX. Only difference is one or two MAC addresses. I hit the problem on TQMa6Q (i.MX6Q) and could test this patch. For the others I checked which have ethernet on NXP page. [1] https://elixir.bootlin.com/u-boot/v2023.07-rc1/source/arch/arm/mach-imx/mac.c drivers/nvmem/imx-ocotp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c index ac0edb6398f1..93628cd756ec 100644 --- a/drivers/nvmem/imx-ocotp.c +++ b/drivers/nvmem/imx-ocotp.c @@ -490,6 +490,7 @@ static const struct ocotp_params imx6q_params = { .bank_address_words = 0, .set_timing = imx_ocotp_set_imx6_timing, .ctrl = IMX_OCOTP_BM_CTRL_DEFAULT, + .reverse_mac_address = true, }; static const struct ocotp_params imx6sl_params = { @@ -497,6 +498,7 @@ static const struct ocotp_params imx6sl_params = { .bank_address_words = 0, .set_timing = imx_ocotp_set_imx6_timing, .ctrl = IMX_OCOTP_BM_CTRL_DEFAULT, + .reverse_mac_address = true, }; static const struct ocotp_params imx6sll_params = { @@ -511,6 +513,7 @@ static const struct ocotp_params imx6sx_params = { .bank_address_words = 0, .set_timing = imx_ocotp_set_imx6_timing, .ctrl = IMX_OCOTP_BM_CTRL_DEFAULT, + .reverse_mac_address = true, }; static const struct ocotp_params imx6ul_params = { @@ -518,6 +521,7 @@ static const struct ocotp_params imx6ul_params = { .bank_address_words = 0, .set_timing = imx_ocotp_set_imx6_timing, .ctrl = IMX_OCOTP_BM_CTRL_DEFAULT, + .reverse_mac_address = true, }; static const struct ocotp_params imx6ull_params = { @@ -525,6 +529,7 @@ static const struct ocotp_params imx6ull_params = { .bank_address_words = 0, .set_timing = imx_ocotp_set_imx6_timing, .ctrl = IMX_OCOTP_BM_CTRL_DEFAULT, + .reverse_mac_address = true, }; static const struct ocotp_params imx7d_params = { @@ -532,6 +537,7 @@ static const struct ocotp_params imx7d_params = { .bank_address_words = 4, .set_timing = imx_ocotp_set_imx7_timing, .ctrl = IMX_OCOTP_BM_CTRL_DEFAULT, + .reverse_mac_address = true, }; static const struct ocotp_params imx7ulp_params = {