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 228F8C77B7E for ; Thu, 1 Jun 2023 10:01:23 +0000 (UTC) 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 Content-Transfer-Encoding: 8bit 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; -- 2.30.2