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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 346F8C636CC for ; Tue, 7 Feb 2023 12:56:01 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D8B0485C48; Tue, 7 Feb 2023 13:55:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=emagii.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=emagii.com header.i=@emagii.com header.b="468qfJac"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 26CD485D5F; Tue, 7 Feb 2023 09:25:40 +0100 (CET) Received: from emagii.se (www.emagii.com [185.133.207.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5CEE585CBD for ; Tue, 7 Feb 2023 09:25:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=emagii.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ulf@emagii.com Received: from valinor.ownit.se (84-55-68-216.customers.ownit.se [84.55.68.216]) by emagii.se (Postfix) with ESMTPSA id 09A9E12018E; Tue, 7 Feb 2023 09:25:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emagii.com; s=default; t=1675758336; bh=1E75ZnNCniMFnGHZizQMrjvyBXUmWC1aupQcdqH8RlU=; h=From:To:Subject; b=468qfJacxn6S1YMuyfi1MYt/XfTqEkvs9ylJTFMW2mKO3QtZPAGb2zr7qrzVGpA6m X4Ne/2az8WmfeRmGh5LqMvbK5kXTMyH+bKMD4BlbkR8V1KdHwZsedX+f6Al8umjMp3 vs71720skzMmWklHw7Vpdp+WZG5t2uDW1y01PjlM= Authentication-Results: emagii.beebytevps.io; spf=pass (sender IP is 84.55.68.216) smtp.mailfrom=ulf@emagii.com smtp.helo=valinor.ownit.se Received-SPF: pass (emagii.beebytevps.io: connection is authenticated) From: Ulf Samuelsson To: u-boot@lists.denx.de Cc: Ulf Samuelsson , Joe Hershberger , Ramon Fried Subject: [PATCH] cpsw_mdio.c: Use correct reg in cpsw_mdio_get_alive Date: Tue, 7 Feb 2023 09:25:27 +0100 Message-Id: <20230207082527.2319-1-ulf@emagii.com> X-Mailer: git-send-email 2.17.1 X-PPP-Message-ID: <167575833630.3471097.5669169467626474419@localhost.localdomain> X-PPP-Vhost: emagii.com X-Mailman-Approved-At: Tue, 07 Feb 2023 13:55:37 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean cpsw_mdio_get_alive reads the wrong register. See page 2316 in SPRUH73Q AM335x TRM Signed-off-by: Ulf Samuelsson Cc: Joe Hershberger Cc: Ramon Fried --- drivers/net/ti/cpsw_mdio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ti/cpsw_mdio.c b/drivers/net/ti/cpsw_mdio.c index a5ba73b739..ac791faa81 100644 --- a/drivers/net/ti/cpsw_mdio.c +++ b/drivers/net/ti/cpsw_mdio.c @@ -51,7 +51,7 @@ struct cpsw_mdio_regs { #define USERACCESS_PHY_REG_SHIFT (21) #define USERACCESS_PHY_ADDR_SHIFT (16) #define USERACCESS_DATA GENMASK(15, 0) - } user[0]; + } user[2]; }; #define CPSW_MDIO_DIV_DEF 0xff @@ -366,8 +366,8 @@ u32 cpsw_mdio_get_alive(struct mii_dev *bus) struct cpsw_mdio *mdio = bus->priv; u32 val; - val = readl(&mdio->regs->control); - return val & GENMASK(15, 0); + val = readl(&mdio->regs->alive); + return val & GENMASK(7, 0); } struct mii_dev *cpsw_mdio_init(const char *name, phys_addr_t mdio_base, -- 2.17.1