From patchwork Wed Mar 17 14:14:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 1454694 X-Patchwork-Delegate: rfried.dev@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: 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=EFSet2zr; 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 RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F0scD1SpWz9sVm for ; Thu, 18 Mar 2021 01:14:51 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B146482815; Wed, 17 Mar 2021 15:14:34 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (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=1615990474; bh=MVY2jgbja2zxWyEA3NF1J5a7we2aGRH1CuE4MPj3vP8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=EFSet2zr+Hrvfxpqxnfo8RV3RkTGOLAqVeZ2jyho6fslH4MU9b7XlhuXoWCvLkcAE 20FhDgABvbVFjfuYhATeWrlBT1sUp7PHipP20a6BkTLlu96YVRFokJoRlWQ8WsKzAg eiMPRL9cqYG/MUqJ3gYsldz5xa5LrDksQ4jmxyuTf/DF9jnkTcRXNcHe7cozblGlh5 1B9JHB0b/28Wb3Y9iZrAragtqS31BPapy9dT/ogN/pL1ZB+IbXl9I61CgNnTvC1uQE p7uBsnzJpKV5JQauuzUln+p5TS9Az4iNczwv03n7t9MajdS/AVHwMyilTeacQUd/GV k4ACJNSHdrrMA== Received: by phobos.denx.de (Postfix, from userid 109) id 6E16F82884; Wed, 17 Mar 2021 15:14:28 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D377982858 for ; Wed, 17 Mar 2021 15:14:24 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=lukma@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4F0sbh49tPz1rxw2; Wed, 17 Mar 2021 15:14:24 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4F0sbh401mz1r1MT; Wed, 17 Mar 2021 15:14:24 +0100 (CET) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 6DR56DkoRfiu; Wed, 17 Mar 2021 15:14:23 +0100 (CET) X-Auth-Info: 0d4o7tK2F6tZOUivM8kKy9S9UgjjiVRo6NGedRKEbWU= Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Wed, 17 Mar 2021 15:14:23 +0100 (CET) From: Lukasz Majewski To: u-boot@lists.denx.de Cc: Lukasz Majewski , Joe Hershberger , Ramon Fried , Simon Glass Subject: [PATCH v1 2/6] net: mv88e61xx: Configure PHY ports to also pass packets between them Date: Wed, 17 Mar 2021 15:14:06 +0100 Message-Id: <20210317141410.32152-3-lukma@denx.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210317141410.32152-1-lukma@denx.de> References: <20210317141410.32152-1-lukma@denx.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.4 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 69a1dd8f1859..14074c0b82fb 100644 --- a/drivers/net/phy/mv88e61xx.c +++ b/drivers/net/phy/mv88e61xx.c @@ -873,14 +873,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;