From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE4A4C433DF for ; Tue, 13 Oct 2020 06:37:16 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 68C4F208D5 for ; Tue, 13 Oct 2020 06:37:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QW4QYE7h" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 68C4F208D5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DJ0dY4VrF5sLe9NIWo2mgHTTOnJ2tGHD0mnFqYmMtks=; b=QW4QYE7hP9xpdErQ2HSLxXdKL +hV5dz4GVgHZFuFfqmIvg8EB0D8L3x1FfxyltxOgH9RG6xk7XUflo9fZGH3XPwoD1Af/PHkFJbxMC OKKB2LMg3NB+3/BOLn4kIta5JEfNsgdZiKqZF/cEkIYcVGFIZGVsxFXudTcdMr75jkq9eMzb8zM2L bv9ofknMoi57ckFS0zisnSlzEiw+nRy8BUvrb5WheFeX3/Vduw53Zo2Ero8hongXMiiI8n4U7vTcU Zh+ANz+af22hDl30CXgvAgCA/hvo5m+n6ze86ene0ITHmqObDpOR7GrVg05EWrEjyrB6+8B9Vtn8f nfVsfgziw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSDuj-00078S-Rd; Tue, 13 Oct 2020 06:36:01 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSDug-00077b-FB for linux-arm-kernel@lists.infradead.org; Tue, 13 Oct 2020 06:35:59 +0000 X-Originating-IP: 81.255.150.195 Received: from windsurf.home (unknown [81.255.150.195]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 51ED6C0004; Tue, 13 Oct 2020 06:35:55 +0000 (UTC) Date: Tue, 13 Oct 2020 08:35:54 +0200 From: Thomas Petazzoni To: Ezra Buehler Subject: Re: Linux mvneta driver unable to read MAC address from HW Message-ID: <20201013083554.0ab5c099@windsurf.home> In-Reply-To: <4E00AED7-28FD-4583-B319-FFF5C96CCE73@easyb.ch> References: <4E00AED7-28FD-4583-B319-FFF5C96CCE73@easyb.ch> Organization: Bootlin X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201013_023558_615466_3117147A X-CRM114-Status: GOOD ( 19.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, Stefan Roese , linux-arm-kernel@lists.infradead.org, u-boot@lists.denx.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello Ezra, On Sat, 10 Oct 2020 18:41:24 +0200 Ezra Buehler wrote: > I am running Debian buster (Linux 4.19.146) on a Synology DS214+ NAS > (Marvell ARMADA XP). Unfortunately, I end up with random MAC addresses > for the two Ethernet interfaces after boot. (Also with Debian sid, Linux > 5.4.0.) > > Since commit 8cc3e439ab92 ("net: mvneta: read MAC address from hardware > when available") the mvneta Linux driver reads the MVNETA_MAC_ADDR_* > registers when no MAC address is provided by the DT. In my case, only > zeros are read, causing the driver to fall back to a random address. I > was able to verify that the registers are correctly written by the > bootloader by reading out the registers in the U-Boot prompt. > > As a workaround, I now specify the MAC addresses in the DT. However, I > would prefer not to do that. Also, it would be nice to get to the bottom > of this. > > Could it be, that for some reason, the clock of the MAC is removed > either by U-Boot or Linux during boot? I suspect you have the mvneta driver as a module ? If this is the case, then indeed, the MAC address is lost because Linux turns of all unused clocks at the end of the boot. When the driver is built-in, there is a driver adding a reference to the clock before all unused clocks are disabled. When the driver is compiled as a module, this does not happen. So indeed, the correct solution here is to have U-Boot pass the MAC address in the Device Tree. Best regards, Thomas Petazzoni -- Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel