Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1606386pxb; Thu, 28 Oct 2021 06:53:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQ/IlpmQmWoUQekPV7pQub7wEYZ/NQ/WUjk+oWmREfmt6KvPBLuVtEn2a24WtzoKF8Uxio X-Received: by 2002:a17:90a:1950:: with SMTP id 16mr4562902pjh.126.1635429206038; Thu, 28 Oct 2021 06:53:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635429206; cv=none; d=google.com; s=arc-20160816; b=qp19M8qtyvmXm73jHvzf4ixuKU5egihz0suvO6YMb9p8l0sQO5eJ6ri170PsiNFt+T h01jn1XpwGXdjU5tcp6+Jg6TDG1kGobYb2A2uFmVe542Mlr26iH+XEK4qELZ8BNiQ3u0 W7yu/pXknfI7E059RX8GEptOMKxNwCFsP9nBwJGcJ4F1c1RuMXc8/X2fm+QMbULjvAiL SWhU9l5L0IHaiv9R81Kf9WgZ41vdzPhcf98+P0+G8eqDfSGLrbHdOcRW1I8yS/VK8kuq t0Mh9ccILrL0FMvthsCEU6JG1YEKYbaUGZVcnB5uGaTKVlQrFJ+az6RA9g+C6IsueH++ 8JNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=tGdcHHcKwE3aVgAdm0Lrkspl/A9xPEp4t2JzpwR3jww=; b=w0NVsFgZyFEQeuEGocEPYQfYyR+ynNtab98HXWsQfNgQ+aP9QxZzL4K7IHWlSStZq2 OeM9yOnB8N/ZiGPZUBknCMtwKNT1Hig3TzRzkbjNSS9kNnISLfc5bRogTnHKCWEeMVr2 AwazrY5edY6hTH8I/WIoByo5LRuhiTS/SMlFG4h+4U7bF3OJe934+9G6tRD+2U5/lC5e X01ndFB8bYe3vExBqn63LCPNfIsXMPV7IhlqYGLxqBLJ46X6eqX4/EMej5A1Wg2m/sBr +LIHmrVe3E7dMC5Ic33U8E+H3NcLg9Dw3DAIEltBlKGOiNTRBOEPeiAMDw35M//+e2ik PLdw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 38si4087091pgu.398.2021.10.28.06.53.13; Thu, 28 Oct 2021 06:53:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230157AbhJ1Ny2 (ORCPT + 99 others); Thu, 28 Oct 2021 09:54:28 -0400 Received: from mslow1.mail.gandi.net ([217.70.178.240]:58431 "EHLO mslow1.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231148AbhJ1NyW (ORCPT ); Thu, 28 Oct 2021 09:54:22 -0400 Received: from relay9-d.mail.gandi.net (unknown [217.70.183.199]) by mslow1.mail.gandi.net (Postfix) with ESMTP id 7AC1EC5142; Thu, 28 Oct 2021 13:51:27 +0000 (UTC) Received: (Authenticated sender: clement.leger@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id A81E6FF816; Thu, 28 Oct 2021 13:51:02 +0000 (UTC) From: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= To: "David S. Miller" , Jakub Kicinski , Rob Herring , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Andrew Lunn Cc: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] net: ocelot: add support to get mac from device-tree Date: Thu, 28 Oct 2021 15:49:30 +0200 Message-Id: <20211028134932.658167-2-clement.leger@bootlin.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211028134932.658167-1-clement.leger@bootlin.com> References: <20211028134932.658167-1-clement.leger@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support to get mac from device-tree using of_get_mac_address. Signed-off-by: Clément Léger --- drivers/net/ethernet/mscc/ocelot_vsc7514.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c index d51f799e4e86..c39118e5b3ee 100644 --- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c +++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c @@ -526,7 +526,10 @@ static int ocelot_chip_init(struct ocelot *ocelot, const struct ocelot_ops *ops) ocelot_pll5_init(ocelot); - eth_random_addr(ocelot->base_mac); + ret = of_get_mac_address(ocelot->dev->of_node, ocelot->base_mac); + if (ret) + eth_random_addr(ocelot->base_mac); + ocelot->base_mac[5] &= 0xf0; return 0; -- 2.33.0