From patchwork Thu Jun 1 10:00:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 1788923 X-Patchwork-Delegate: rfried.dev@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=lWN13v3k; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=sswyaedp; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QX1qB0Zgrz20QB for ; Thu, 1 Jun 2023 20:00:54 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 627D9862E8; Thu, 1 Jun 2023 12:00:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1685613639; bh=beFtB3vt/mA8gn+1J3XS85rugVboUT9FhR8Yhw4DWm4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=lWN13v3kWjO4thCR70DVxtD6BVSXHYQ+d6dpq8X/GH7yRdhT1EqQcrff0xro9+by0 ATDv2vpWk5KZvn1IrPxMm/o5lEuMeZ90+dwdfm+xntWd1dY7jR198CccXvWH/IFjcX nTSrZoJL0W2nBOWAINHKRCqtFJZhdGpnY9GB+hmC/mWoE+KqD8NfwNz2QH4GecXVgX CaLxVDNXorLy1FKKFfCDs7AwcH7TUIGEuQ9g+yxEgpQQcglvnItg+dQjSMaFNIJCA7 zZ3d17ZGAp+uHkIhWWzX5LP13c/98nBf7JYBifI3h+ZO8Qrv4I3rH9iYm6xq/zA1ml XZgwCxoFUe0YQ== Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 1394F86152; Thu, 1 Jun 2023 12:00:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1685613629; bh=beFtB3vt/mA8gn+1J3XS85rugVboUT9FhR8Yhw4DWm4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sswyaedp0WLdnp22mVprsuiKpUkQ1dZeiLxAAAVrxCMmu/VQQHza1YeQgUaq/i8CL xhXJVmLuL8Zd11hTxO9yyvim02l8Uh/PDzssBxTY6mHRm9MXWKp6upmBpVMfXDJ8ls k2D9TCeIdNAHyCcs5U87vKAfhpSkHKMYSRUlKX2ollYmg3C9gF2P/L+TY3I7hcOJgW Uyn09B4M4ICC/49j2mTOEEla2Ivy60BRJlx3Z91KcxRKaQRju8GFkQAu2Ty6yu18xm P7UyC+EendkTG8NwQdJqR6raUiK+9MBFuGpoHYF2mzs8n+/1ZEsbVxvIazfgW1dCVx /96lW2muRPxKA== From: Lukasz Majewski To: u-boot@lists.denx.de, Tom Rini Cc: Anatolij Gustschin , Lukasz Majewski , Ramon Fried , Joe Hershberger , Marek Vasut , Michal Simek Subject: [PATCH v1 1/6] net: mv88e61xx: Add support for checking addressing mode Date: Thu, 1 Jun 2023 12:00:00 +0200 Message-Id: <20230601100005.2216345-2-lukma@denx.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230601100005.2216345-1-lukma@denx.de> References: <20230601100005.2216345-1-lukma@denx.de> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Some Marvell switch devices are dual chip ones, like mv88e6020, which use direct MDIO addressing to access its ports' registers. Such approach allows connecting two such devices in a single MDIO bus with simple addressing scheme. Signed-off-by: Lukasz Majewski Reviewed-by: Ramon Fried --- drivers/net/phy/mv88e61xx.c | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/drivers/net/phy/mv88e61xx.c b/drivers/net/phy/mv88e61xx.c index 85778106eddc..31f9b57456d6 100644 --- a/drivers/net/phy/mv88e61xx.c +++ b/drivers/net/phy/mv88e61xx.c @@ -194,6 +194,7 @@ struct mv88e61xx_phy_priv { u8 phy_ctrl1_en_det_shift; /* 'EDet' bit field offset */ u8 phy_ctrl1_en_det_width; /* Width of 'EDet' bit field */ u8 phy_ctrl1_en_det_ctrl; /* 'EDet' control value */ + u8 direct_access; /* Access switch device directly */ }; static inline int smi_cmd(int cmd, int addr, int reg) @@ -920,6 +921,40 @@ static int mv88e61xx_priv_reg_offs_pre_init(struct phy_device *phydev) return -ENODEV; } +static int mv88e61xx_check_addressing(struct phy_device *phydev) +{ + if (!CONFIG_IS_ENABLED(OF_CONTROL)) + return 0; + + /* + * Some devices - like mv88e6020 are dual chip - i.e. two + * such devices can be directly accessed via SMI bus. + * The addressing depends on R0_LED/ADDR4 pin value duing + * bootstrap. + * + * This means that there is no need for indirect access. + */ + struct mv88e61xx_phy_priv *priv = phydev->priv; + + /* + * As this function is called very early and hence the phydev + * is not yet initialized we use aliast and DTS to asses if + * device shall be directly accessed or not. + */ + ofnode sw0; + int ret; + + sw0 = ofnode_get_aliases_node("switch0"); + if (!ofnode_valid(sw0)) + return -ENODEV; + + ret = ofnode_device_is_compatible(sw0, "marvell,mv88e6020"); + if (ret) + priv->direct_access = 1; + + return 0; +} + static int mv88e61xx_probe(struct phy_device *phydev) { struct mii_dev *smi_wrapper; @@ -974,6 +1009,8 @@ static int mv88e61xx_probe(struct phy_device *phydev) phydev->priv = priv; + mv88e61xx_check_addressing(phydev); + res = mv88e61xx_priv_reg_offs_pre_init(phydev); if (res < 0) return res; @@ -1180,6 +1217,11 @@ int get_phy_id(struct mii_dev *bus, int smi_addr, int devad, u32 *phy_id) temp_phy.priv = &temp_priv; temp_mii.priv = &temp_phy; + mv88e61xx_check_addressing(&temp_phy); + /* For direct access the phy address equals to smi_addr */ + if (temp_priv.direct_access) + temp_phy.addr = smi_addr; + /* * get_phy_id() can be called by framework before mv88e61xx driver * probing, in this case the global register offsets are not From patchwork Thu Jun 1 10:00:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 1788925 X-Patchwork-Delegate: rfried.dev@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=Ef3ghuv3; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=avCvT6tC; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QX1qn0x43z20QB for ; Thu, 1 Jun 2023 20:01:25 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 715B6862E4; Thu, 1 Jun 2023 12:00:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1685613653; bh=FRq54RvLpdYYiJ/qtuPQj6hdFJAybDDEnZk+nr013kc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Ef3ghuv3WXRawY/aH3yMOkJRfv9RWlng0DcQaKpH5B4RCByYUP2aQEui223KNFmCz metoObCLMB5QXJwS4pWLax6fnZegIknHJRyWFC1qUrJPCj3XOXyx5d9qpo5LN/cM2+ scdSXYWFMiGibtgpohpOXU0rTA3ibaIGziEYlFSfOiguuYI/ArpBxDCZNiYzs/0KMv C8pf/AbaIAWIHxSc7RV3u3vdhqqIHW57ViNzoG2OJKu2OcREZtjUE7PZjJAyeW5f6e Xh9PZqF6TR+gd1rNzXb9brBP7nVa/63DwppiUF14T4m04MM41lmelhOCiRKqe8peEM d+eSFpe7CYafg== Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id C21158615F; Thu, 1 Jun 2023 12:00:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1685613630; bh=FRq54RvLpdYYiJ/qtuPQj6hdFJAybDDEnZk+nr013kc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=avCvT6tCGi0PfLjYrYqvXTGdbhkHn5t5IkGeudNC85lUrrdpN5GGJ972F/ewP1HxJ 1QkiE4hXu3mFc6uN6f4Mm1ka1kOqHouHZ5PJpYP+BR9EcnvFNP5HFYYhe81Z5aj5LF /JPUFzV0Y+zxzLBXGI/RslEPrL+F3+GxXa+Du3zMImGYPCPg7KRZDVfarTGfZ67eVe 2FhYFp0ErZIahpKXkwibNKlVfHDGdarE+m9rMujlaEWimpr1ikBgMkNDvPrUR8mrRV BQvJc7SKjPJ5PJ7Tzm2pkg/MlU26dFgWXdTsN2QdZClKrzK/wwhSmJXdfCNDRIzUb3 a52kJp6pAeuLw== From: Lukasz Majewski To: u-boot@lists.denx.de, Tom Rini Cc: Anatolij Gustschin , Lukasz Majewski , Ramon Fried , Joe Hershberger , Marek Vasut , Michal Simek Subject: [PATCH v1 2/6] net: mv88e61xx: Configure PHY ports to also pass packets between them Date: Thu, 1 Jun 2023 12:00:01 +0200 Message-Id: <20230601100005.2216345-3-lukma@denx.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230601100005.2216345-1-lukma@denx.de> References: <20230601100005.2216345-1-lukma@denx.de> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean After this change PHY ports are able to pass packets between them (and also to CPU port). The Kconfig variable - CONFIG_MV88E61XX_PHY_PORTS - is used to get the PHY ports of the switch and generate proper mask. Signed-off-by: Lukasz Majewski Reviewed-by: Ramon Fried --- drivers/net/phy/mv88e61xx.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/mv88e61xx.c b/drivers/net/phy/mv88e61xx.c index 31f9b57456d6..4aee83551beb 100644 --- a/drivers/net/phy/mv88e61xx.c +++ b/drivers/net/phy/mv88e61xx.c @@ -865,14 +865,19 @@ static int mv88e61xx_phy_setup(struct phy_device *phydev, u8 phy) static int mv88e61xx_phy_config_port(struct phy_device *phydev, u8 phy) { + struct mv88e61xx_phy_priv *priv = phydev->priv; + u16 port_mask; int val; val = mv88e61xx_port_enable(phydev, phy); if (val < 0) return val; - val = mv88e61xx_port_set_vlan(phydev, phy, - 1 << CONFIG_MV88E61XX_CPU_PORT); + port_mask = PORT_MASK(priv->port_count) & CONFIG_MV88E61XX_PHY_PORTS; + port_mask &= ~(1 << phy); + port_mask |= (1 << CONFIG_MV88E61XX_CPU_PORT); + + val = mv88e61xx_port_set_vlan(phydev, phy, port_mask); if (val < 0) return val; From patchwork Thu Jun 1 10:00:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 1788924 X-Patchwork-Delegate: rfried.dev@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=YjmIByMy; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=Qp8PkCqD; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QX1qV4xDdz20QB for ; Thu, 1 Jun 2023 20:01:10 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 95908862D0; Thu, 1 Jun 2023 12:00:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1685613643; bh=zKzw4DnyuWVp2O8QJCdLt44MKUCnxaa1c95GLb17D2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=YjmIByMyyHB81XbfVcZB52iQN6Kvxx+uNZV8eeeMdteJdHCx6l/rmdunLl1yHYl0E AxPH95DoPnWxcbrUTo/MyZfO3MKAXnPx/axD8urgHLk6St3dCe9QvA2TuiL4rgggrd Z9XbabHkv3wtL7i75qd7eoK8GM+JSpgF8h52t2I+CSmY4aaPsmsD84RjISpeE/ldwx GTe4sqGfZtwxdKtQrgVu4M+spOwhQsPgpN++B7fkiQg6I1SlY5X3rMAOE+ml0nn243 ntNoMRhsRPnFPhCisEUwmAwsDIxEnMHnH0AbxE2LSSGyGMLQcu7VK/peVmWVxBV2Ki VByfJEF2nph8g== Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 7FC47862C6; Thu, 1 Jun 2023 12:00:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1685613631; bh=zKzw4DnyuWVp2O8QJCdLt44MKUCnxaa1c95GLb17D2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qp8PkCqD2Dv5mR5PXP0VPE4VzZ4xalFL4QA8Tf5Ls9rkG/DGZ9/CpgUJPlIeTYYeX Xa77SrTpiNFegxOJOHyrGmK46H44HUqh+gKC+XrTjknuOkqU7sppTwy67ohmUrwFsl 1kX3srGPneIKrqUJ8Yy16GsHhwxgYCUhKJMONmVWJ81vMaWFxZJ1oy6w1cxwdtTlDU oFBZlokNXIa1+M3TEzfDqjgU0nXjGqgAdE8n0a83jhmNZvBVfbY+J1nB3UUnH8co9L 6maQO2fJ9v7qCwO2FwdqOkDs7jNs5sf5fCtuKwSpFkJNahWLVNdJUylr9SBjGWESrt D5wZTUuJ77B2g== From: Lukasz Majewski To: u-boot@lists.denx.de, Tom Rini Cc: Anatolij Gustschin , Lukasz Majewski , Ramon Fried , Joe Hershberger , Marek Vasut , Michal Simek Subject: [PATCH v1 3/6] net: mv88e61xx: Clear temporary structs before using them in get_phy_id() Date: Thu, 1 Jun 2023 12:00:02 +0200 Message-Id: <20230601100005.2216345-4-lukma@denx.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230601100005.2216345-1-lukma@denx.de> References: <20230601100005.2216345-1-lukma@denx.de> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Those automatically created structures can have random value. However, mv88e61xx driver assumes that those are zeroed. Signed-off-by: Lukasz Majewski Reviewed-by: Ramon Fried --- drivers/net/phy/mv88e61xx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/phy/mv88e61xx.c b/drivers/net/phy/mv88e61xx.c index 4aee83551beb..c19c3dfa8b6d 100644 --- a/drivers/net/phy/mv88e61xx.c +++ b/drivers/net/phy/mv88e61xx.c @@ -1213,6 +1213,10 @@ int get_phy_id(struct mii_dev *bus, int smi_addr, int devad, u32 *phy_id) struct mii_dev temp_mii; int val; + memset(&temp_phy, 0, sizeof(temp_phy)); + memset(&temp_priv, 0, sizeof(temp_priv)); + memset(&temp_mii, 0, sizeof(temp_mii)); + /* * Buid temporary data structures that the chip reading code needs to * read the ID From patchwork Thu Jun 1 10:00:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 1788928 X-Patchwork-Delegate: rfried.dev@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=snTw6hqc; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=opEdY5op; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QX1rb5Pq8z20QB for ; Thu, 1 Jun 2023 20:02:07 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 871CF862F7; Thu, 1 Jun 2023 12:01:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1685613664; bh=sVS2Wvy6sEZW0g0V/sgWZr2NvHeNmP3scCVfffFUmH4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=snTw6hqc5SoQFd1RgP2oR3xDhAsexgZp6aQfgTds7dQXUjfrIhFarU3X8wUQ9lnkC VVl6yVUtbMkwpzgMJgMqDzR6RP5+jwrxQF2m52u2bxttVs4CtUxv5xHnARFFmB3S+0 dQWawBRMEqAjnr8oUGhlcFUXmKSLj34Zcvj7aj83oy2qTn7tiHRFjM4e7kB6SsME6y aD4ESbx88IgVviILIKjpefiQgSoEwC4uzaQF1RYJW2tQQQaaaJmNZmrzVLT9Zkf82u 550ZXNjsrOZSpuOHNuSHWeBOxoesxGwlCZPBb1sPGoOeZ8tviwK6hKtgRjpQKWmSgY CMZlqCiOrNUQA== Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 4DF21862D7; Thu, 1 Jun 2023 12:00:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1685613631; bh=sVS2Wvy6sEZW0g0V/sgWZr2NvHeNmP3scCVfffFUmH4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=opEdY5ops8BuTVME9FJnUawU9uWynkkYPZPj9PyWcMRgltd9yhhzzZ20PgRDlQk4G Ztf+67968gnlizterrvYz+7Whv9Ufq+zRvmwwpGa/LydRB3qnUJHvlGS7I07wD4/FW kZ66CEPz1DQtROgo5ewWrb2IDqys77vD7CZHVu43WpBV/sevJgoMd9itDxMx5enJI4 rCla/AexmK9UdYsX+bX41GTaKqbeNaHk+jIHlAd9h4em7lgpQ3r/V2fsGiBPKJGFBj EEvo6JeTFLrXans+xg/WWLRo3REF4n8JY8yw+DcslEUrkCTqh6xhEC/J70nLqh5q72 TQo4FI2QatF4Q== From: Lukasz Majewski To: u-boot@lists.denx.de, Tom Rini Cc: Anatolij Gustschin , Lukasz Majewski , Ramon Fried , Joe Hershberger , Marek Vasut , Michal Simek Subject: [PATCH v1 4/6] net: mv88e61xx: Directly access the switch chip Date: Thu, 1 Jun 2023 12:00:03 +0200 Message-Id: <20230601100005.2216345-5-lukma@denx.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230601100005.2216345-1-lukma@denx.de> References: <20230601100005.2216345-1-lukma@denx.de> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean The mv88e6020 is accessed in a direct way (i.e. with direct read and write to mdio bus). The only necessary indirection is required when accessing its PHY registers. Signed-off-by: Lukasz Majewski Reviewed-by: Ramon Fried --- drivers/net/phy/mv88e61xx.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/phy/mv88e61xx.c b/drivers/net/phy/mv88e61xx.c index c19c3dfa8b6d..c9917953f3d7 100644 --- a/drivers/net/phy/mv88e61xx.c +++ b/drivers/net/phy/mv88e61xx.c @@ -261,8 +261,11 @@ static int mv88e61xx_reg_read(struct phy_device *phydev, int dev, int reg) int smi_addr = priv->smi_addr; int res; - /* In single-chip mode, the device can be addressed directly */ - if (smi_addr == 0) + /* + * In single-chip or dual-chip (like mv88e6020) mode, the device can + * be addressed directly. + */ + if (smi_addr == 0 || priv->direct_access) return mdio_bus->read(mdio_bus, dev, MDIO_DEVAD_NONE, reg); /* Wait for the bus to become free */ @@ -298,11 +301,13 @@ static int mv88e61xx_reg_write(struct phy_device *phydev, int dev, int reg, int smi_addr = priv->smi_addr; int res; - /* In single-chip mode, the device can be addressed directly */ - if (smi_addr == 0) { + /* + * In single-chip or dual-chip (like mv88e6020) mode, the device can + * be addressed directly. + */ + if (smi_addr == 0 || priv->direct_access) return mdio_bus->write(mdio_bus, dev, MDIO_DEVAD_NONE, reg, val); - } /* Wait for the bus to become free */ res = mv88e61xx_smi_wait(mdio_bus, smi_addr); From patchwork Thu Jun 1 10:00:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 1788927 X-Patchwork-Delegate: rfried.dev@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=lYtpxZMN; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=MmcScieR; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QX1rL02KYz20QB for ; Thu, 1 Jun 2023 20:01:53 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AA190862DA; Thu, 1 Jun 2023 12:01:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1685613661; bh=3j6m/8L5c25qaQ0/JW/kMgWj1u1J0dhwfXdcdMmiR9g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=lYtpxZMNnFmRsApEk/ohqvaIDkeX2Rr3PHzxBozrHK2jkq8a+5ktEWQ3/QvcdE4o0 9oZbOCKw2VRk2dx6CIhklA8PpQifHkbf8+4OOKphCN+0e0z3VQ8XBBP6Lhe+lSq+Kk 3HfUlogUX+6req2to/rztXUXtL8EWkMhOrFwcosX0x0iWU2kimRkq6lKv9XKXdcl3X ZrPI86P8wkA1oggMjPXGSV4O3NG2GuR0WWBpN08eQK6UFiyyec0ta6Qch0sAtvrtsz scCw9YGd2DPPFvQV0fMNwdhIwRV6JeM1/r0fsueXnQgSo4Y6hvn4swJHbS3i0McgPL VXFgdJ99oPWFA== Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 204D3862DA; Thu, 1 Jun 2023 12:00:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1685613632; bh=3j6m/8L5c25qaQ0/JW/kMgWj1u1J0dhwfXdcdMmiR9g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MmcScieRbvM+qtjbXIgJEvSWSb5qfbbriAYD3ldWI653xl/WddIF/irzgYT6ndU/E jOCy+MNf8fmKuGSsbR2Q0JEoynj5rXxxNaT5qt0NxuqjrY0aOAQEB5OyRHZkyV0HGX rmkyLfELLq3gKKbERpfZ8J0qZ0C3hSM7JDBUVuKiTiZrmf7mncIfc9C3ZtuiDjJVx7 9I9/gGi2Mir83fQicVnfG814FvVc3+D1FkEcc3Pbzq7PPTLU8NsFsuHciX11ontQKE 3Us0gdMnlLJfqN65kFkAI/RefHEACIF+7vQOmiiwJ6xo2bM513UmK7gnU475MW8P7w OcAiAHTk/wNOw== From: Lukasz Majewski To: u-boot@lists.denx.de, Tom Rini Cc: Anatolij Gustschin , Lukasz Majewski , Ramon Fried , Joe Hershberger , Marek Vasut , Michal Simek Subject: [PATCH v1 5/6] net: mv88e61xx: Set proper offset when R0_LED/ADDR4 is set on bootstrap Date: Thu, 1 Jun 2023 12:00:04 +0200 Message-Id: <20230601100005.2216345-6-lukma@denx.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230601100005.2216345-1-lukma@denx.de> References: <20230601100005.2216345-1-lukma@denx.de> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean The mv88e61xx driver need to be adjusted to handle situation when switch MDIO addresses are switched by offset (0x10 in this case). Signed-off-by: Lukasz Majewski Reviewed-by: Ramon Fried --- drivers/net/phy/mv88e61xx.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/drivers/net/phy/mv88e61xx.c b/drivers/net/phy/mv88e61xx.c index c9917953f3d7..69a87bead469 100644 --- a/drivers/net/phy/mv88e61xx.c +++ b/drivers/net/phy/mv88e61xx.c @@ -45,7 +45,6 @@ #define PORT_MASK(port_count) ((1 << (port_count)) - 1) /* Device addresses */ -#define DEVADDR_PHY(p) (p) #define DEVADDR_SERDES 0x0F /* SMI indirection registers for multichip addressing mode */ @@ -406,7 +405,7 @@ static int mv88e61xx_phy_write_indirect(struct mii_dev *smi_wrapper, int dev, /* Wrapper function to make calls to phy_read_indirect simpler */ static int mv88e61xx_phy_read(struct phy_device *phydev, int phy, int reg) { - return mv88e61xx_phy_read_indirect(phydev->bus, DEVADDR_PHY(phy), + return mv88e61xx_phy_read_indirect(phydev->bus, phydev->addr, MDIO_DEVAD_NONE, reg); } @@ -414,7 +413,7 @@ static int mv88e61xx_phy_read(struct phy_device *phydev, int phy, int reg) static int mv88e61xx_phy_write(struct phy_device *phydev, int phy, int reg, u16 val) { - return mv88e61xx_phy_write_indirect(phydev->bus, DEVADDR_PHY(phy), + return mv88e61xx_phy_write_indirect(phydev->bus, phydev->addr, MDIO_DEVAD_NONE, reg, val); } @@ -918,12 +917,21 @@ static int mv88e61xx_priv_reg_offs_pre_init(struct phy_device *phydev) /* * Now try via port registers with device address 0x08 * (88E6020 and compatible switches). + * + * When R0_LED/ADDR4 is set during bootstrap, one needs + * to add 0x10 offset to switch addresses. + * + * The phydev->addr is set according to device tree address + * of MDIO accessible device: + * + * When on board RO_LED/ADDR4 = 1 -> 0x10 + * 0 -> 0x0 */ - priv->port_reg_base = 0x08; + priv->port_reg_base = 0x08 + phydev->addr; priv->id = mv88e61xx_get_switch_id(phydev); if (priv->id != 0xfff0) { - priv->global1 = 0x0F; - priv->global2 = 0x07; + priv->global1 = 0x0F + phydev->addr; + priv->global2 = 0x07 + phydev->addr; return 0; } @@ -1082,7 +1090,10 @@ static int mv88e61xx_phy_config(struct phy_device *phydev) for (i = 0; i < priv->port_count; i++) { if ((1 << i) & CONFIG_MV88E61XX_PHY_PORTS) { - phydev->addr = i; + if (phydev->addr) + phydev->addr += i; + else + phydev->addr = i; res = mv88e61xx_phy_enable(phydev, i); if (res < 0) { From patchwork Thu Jun 1 10:00:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 1788926 X-Patchwork-Delegate: rfried.dev@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=r7+2UE5m; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=J5YhhS13; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QX1r53CPzz20QB for ; Thu, 1 Jun 2023 20:01:41 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1398C862DD; Thu, 1 Jun 2023 12:00:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1685613658; bh=CHM55tD60BH+54USUqCeLs3WUl+mg20Fb/yRAR+jG5c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=r7+2UE5mKB/DK5w6vSrTFqBB7xnPf3ojbf8VGJSqG5LFbDy7FU1fUNXJxVPf/X6p8 6O2zvPQYuDfebdnjSuNjCMbXtDusF2qMhbhaOPe/SsJtZwSDYWMKSA6huclK39YL2o 6CGRNAiaeleRDpud/W9QenSNlkwzDJj8sRjGzE/G+GBBxXpa73+xGXYnLTE+b10FUb ej4r740kPdX9jzx2TZTlcSBDNx2+Qf9LSNWDgFI7r/QbtznczjBXW31o8ZzRyIr487 MzJAMM94IRvepkGP+tggpW3SCCwtfeLMY1KyqXJ1IJYFuSfVi4E0mZxTXNQlayq/hH WjN648qE2lPmA== Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 132F6862DC; Thu, 1 Jun 2023 12:00:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1685613634; bh=CHM55tD60BH+54USUqCeLs3WUl+mg20Fb/yRAR+jG5c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J5YhhS13Z8VMF8RqEm1hzMuA1bb+UN+l4SG9tk5wtkU4kUvGAVOiEHFnWcY8Sgglc MNZsFS9tclko6lhcLrl6YjyFALUUzO7hlRoQYrOFR+42Nl7gIpezjI9H78RKb/Sexc JrN5ao8aplLyPceEZZmH9izslhD7VuPvSdgxlFU584g2WjfwnMNpCYK+OJ4RVJsXsL j88l/lszwXX30JdPs0mrXN3xnPA4FvM68hPcZnRnbSfmuX9yX4nDwtNN8U9vDEDfqZ HYSKMF7aBObuMyXaYtO1R7cJec4Tg37Lj+ba/OkX8deIGjiEQ5r1dbueJX1BKznLlN H1kKLXU4sl1BA== From: Lukasz Majewski To: u-boot@lists.denx.de, Tom Rini Cc: Anatolij Gustschin , Lukasz Majewski , Ramon Fried , Joe Hershberger , Marek Vasut , Michal Simek Subject: [PATCH v1 6/6] net: mv88e61xx: Reset switch PHYs when bootstrapped to !NO_CPU Date: Thu, 1 Jun 2023 12:00:05 +0200 Message-Id: <20230601100005.2216345-7-lukma@denx.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230601100005.2216345-1-lukma@denx.de> References: <20230601100005.2216345-1-lukma@denx.de> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Some devices, when configured in bootstrap to 'no cpu' mode require PHY manual reset to get them operational and responding to reading their ID registers. Without this step - the PHYLIB probing will fail. In more details - the bootstrap configuration from switch must be read. The value of CONFIG Data1 (0x71) of Scratch and Misc register is read to check if 'no_cpu' and 'addr4' bits were set. Signed-off-by: Lukasz Majewski Reviewed-by: Ramon Fried --- drivers/net/phy/mv88e61xx.c | 63 +++++++++++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/mv88e61xx.c b/drivers/net/phy/mv88e61xx.c index 69a87bead469..cf8f5e833e82 100644 --- a/drivers/net/phy/mv88e61xx.c +++ b/drivers/net/phy/mv88e61xx.c @@ -194,6 +194,17 @@ struct mv88e61xx_phy_priv { u8 phy_ctrl1_en_det_width; /* Width of 'EDet' bit field */ u8 phy_ctrl1_en_det_ctrl; /* 'EDet' control value */ u8 direct_access; /* Access switch device directly */ + /* + * Bootstrap configuration: + * + * If addr4 = 1 device is accessible from 0x10 address on MDIO bus. + */ + u8 addr4; + /* + * If no_cpu = 1 switch is automatically setup, otherwise PHY reset is + * required from CPU for normal operation. + */ + u8 no_cpu; }; static inline int smi_cmd(int cmd, int addr, int reg) @@ -1218,6 +1229,33 @@ U_BOOT_PHY_DRIVER(mv88e6071) = { .shutdown = &genphy_shutdown, }; +static int mv88e61xx_read_bootstrap(struct phy_device *phydev) +{ + struct mv88e61xx_phy_priv *priv = phydev->priv; + struct mii_dev *mdio_bus = priv->mdio_bus; + int val; + + /* mv88e6020 - ID = 0x0200 (REG 3 on non PHY port) */ + if (priv->id == PORT_SWITCH_ID_6020) { + /* Prepare to read scratch and misc register */ + mdio_bus->write(mdio_bus, priv->global2, 0, + 0x1a /*MV_SCRATCH_MISC*/, + (0x71 /*MV_CONFIG_DATA1*/ << 8)); + + val = mdio_bus->read(mdio_bus, priv->global2, 0, + 0x1a /*MV_SCRATCH_MISC*/); + + if (val & (1 << 0)) + priv->no_cpu = 1; + if (val & (1 << 4)) + priv->addr4 = 1; + debug("mv88e6020: no_cpu=%d addr4=%d\n", priv->no_cpu, + priv->addr4); + } + + return 0; +} + /* * Overload weak get_phy_id definition since we need non-standard functions * to read PHY registers @@ -1257,13 +1295,34 @@ int get_phy_id(struct mii_dev *bus, int smi_addr, int devad, u32 *phy_id) if (val < 0) return val; - val = mv88e61xx_phy_read_indirect(&temp_mii, 0, devad, MII_PHYSID1); + mv88e61xx_read_bootstrap(&temp_phy); + + /* + * When switch is configured to work with CPU (i.e. NO_CPU == 0), PHYs + * require reset (to at least single one) to have its registers + * accessible. + */ + if (!temp_priv.no_cpu && temp_priv.id == PORT_SWITCH_ID_6020) { + /* Reset PHY */ + val = mv88e61xx_phy_read_indirect(&temp_mii, temp_phy.addr, + devad, MII_BMCR); + if (val & BMCR_PDOWN) + val &= ~BMCR_PDOWN; + + mv88e61xx_phy_write_indirect(&temp_mii, temp_phy.addr, devad, + MII_BMCR, val); + } + + /* Read PHY_ID */ + val = mv88e61xx_phy_read_indirect(&temp_mii, temp_phy.addr, devad, + MII_PHYSID1); if (val < 0) return -EIO; *phy_id = val << 16; - val = mv88e61xx_phy_read_indirect(&temp_mii, 0, devad, MII_PHYSID2); + val = mv88e61xx_phy_read_indirect(&temp_mii, temp_phy.addr, devad, + MII_PHYSID2); if (val < 0) return -EIO;