Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp329387lqo; Wed, 8 May 2024 00:31:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX7fyZN0AaVYwDnLFJOKRKqUWgf6PVW+8148mU36HHALGSwIB0h0rWGNFFYQSoJokgT03z7/etjZ9xFS4AOk4L9Nkc8hn5OdeTNt6aahw== X-Google-Smtp-Source: AGHT+IFWwHJnAhfDYv6r2DJB6bqnDHCTTiAYTSGh7qnZkiQJ59fmz5GfKe415yP8BLNTL1EZE9k1 X-Received: by 2002:a17:906:eb0d:b0:a59:bfc8:aa2a with SMTP id a640c23a62f3a-a59fb941e8emr91232566b.25.1715153469338; Wed, 08 May 2024 00:31:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715153469; cv=pass; d=google.com; s=arc-20160816; b=1JXbn68VqN0Ueh2f/31ApMyJgQGDqJ9iWm4u7t9hjTBDxbH7um1NKQq2xWt5Bq2vzv rEGcNuiyXgN9wVa/4OSQQzNXJ/RlEB9hdXQfIUfGtipGvMe5O16dvSxXIz029k4mzU5/ ZDdvpjyFXxxv5PrzEdnMHELVawlilpCDj7VkOc5osWEs3lqVXRk841JCbgmHeTRs3Iw9 2Ycu1F94gF1bhnYxmM4Ke68aQ4PcS6ysbefjXmhpqWn9JEfrMdTGWzrqd6UvKn4d09dN cwWyFivV5d+GMcFWjy4PoIhEDDlZOjtts5MVvNbrERJDdD5dNFPnz0H/U1s9IyaMQaiI 9m3A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=5VYVvd11hV7rJunixQLWGyRIvzoAkWZceNjuLWyDIro=; fh=kpGNf2t2d0Ky8yI9gQ38KoUf0oX0G+aejxy2cZHrh+E=; b=UZNfnKWsnalS9Wk6hac8XPZVOLAWzCQzPqxeQ7MN4rZFs1GshTt0d85ER64VoZkSSB s5V7ofvfTe2HVazLCaWz0ow9Av7wvxGcu+ypLOV0gO6E39dVTH88pVRshHLyIDbgYDka PxqrdwHcBASFY6tpHVwyBj9L+3wv+DRiWSxu7TdIUn0PjMpknvRU4rF9mntX+34U07UZ J+msoQPe4eAxY4Lr07Vmvy3ZdmkA0yf31RV2cybjPYYHAAIcc4CLSWywWY43aL9ygfan QuAVuHkaX6N/nMXfp/fWLoweegbXqC5a8mf5/1BPhSgw5JKB+OutLuFql/H8zFi3PQj9 DemA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@innosonix.de header.s=google header.b=CncpDfTr; arc=pass (i=1 spf=pass spfdomain=innosonix.de dkim=pass dkdomain=innosonix.de dmarc=pass fromdomain=innosonix.de); spf=pass (google.com: domain of linux-kernel+bounces-172812-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172812-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=innosonix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id nb30-20020a1709071c9e00b00a59caa14d3bsi3539950ejc.906.2024.05.08.00.31.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 00:31:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172812-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@innosonix.de header.s=google header.b=CncpDfTr; arc=pass (i=1 spf=pass spfdomain=innosonix.de dkim=pass dkdomain=innosonix.de dmarc=pass fromdomain=innosonix.de); spf=pass (google.com: domain of linux-kernel+bounces-172812-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172812-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=innosonix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E4D861F244F9 for ; Wed, 8 May 2024 07:31:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 934153D39B; Wed, 8 May 2024 07:30:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=innosonix.de header.i=@innosonix.de header.b="CncpDfTr" Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DCD6A29417 for ; Wed, 8 May 2024 07:30:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715153428; cv=none; b=ujgl3EGiLyUQAAsjl/FYupwL3zNW/hja6rqYMJO94Aj4cWhSyju5Qq+B+CMhRA5GB/YyMy4j9HAbYmZBkBSOiH4/4vncgBkRU06dk5NUT7AxV6ag5v/0k69YftS3E8EQH4jc+ttIeJM0vWTsjMkUE0NSXJYUBbr5nLgkuJyHjM0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715153428; c=relaxed/simple; bh=HkLTXlvLqPcM1G9r5TuQ/k6k+kIB8Kh6veaRJgAeLuE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=NVpNMljSz1lZ00jDPb+/kXxdsakKTt09JyjnJOlFHMkMrvYo0sh4JhK4zfWC8oGZLSRI9YcWIP2usdsK5ym1Ur4deNn/goQGlq3I1xbAXem79WaSySotIdoilukRyAOGDe4y0FB7o+MmvAuzIbhOFiUNL+MMaKKCnsGmKHJC0mk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=innosonix.de; spf=pass smtp.mailfrom=innosonix.de; dkim=pass (2048-bit key) header.d=innosonix.de header.i=@innosonix.de header.b=CncpDfTr; arc=none smtp.client-ip=209.85.218.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=innosonix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=innosonix.de Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a59a86fb052so131394666b.0 for ; Wed, 08 May 2024 00:30:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=innosonix.de; s=google; t=1715153425; x=1715758225; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5VYVvd11hV7rJunixQLWGyRIvzoAkWZceNjuLWyDIro=; b=CncpDfTrHUfZw6dPg0Q43fIfcyNbLPSpT0yl+p/WWlFiSrNf/ue+abrPSlPlJUrzNg bQc7RkPFAkE9tOGs2mi8fRYcCFsVZ/tLKRtMQGu/dk4h9gjbeEY6jDyQcq5C5bHiDay6 CU4AAqg0fy9XUy6T1gvhkG0zaVapZU5ITd2nTLiiyngmPxRnfCX8KzCtBZ0L6BqAa8DB 2qShFxanfwqwn72fVGyFlmO79FLkXGqUhrCls3/59cK1D9tzU3RFcV+cMBJYYLFC0bqQ AHoak4ESm1XkK5e/4bY7Jott7Dpx+zRxMJApnioSE/uB2WJeyt691VE4wgz4KfLnn+Z2 QCBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715153425; x=1715758225; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5VYVvd11hV7rJunixQLWGyRIvzoAkWZceNjuLWyDIro=; b=Q4wikL/gbLhLx5jNdfwdG4sT1YxVhyAz69a5UFDB3+ytAIeWEx9wPU4bLaKAxu0JBF GFZZG25qap35DrvkgArCb1JuBeh7J37s7FJU5GlFG7tBuCa3jbHY0MHTMJl/tbeICJH+ JIVcfTyUeej3kefwcvZlvhhNVLzZY/+/XCzz8LPjEb3Nz7Xn82O/LuqHxo2xLe4ThG+n oxiRBmvTA2b3/ZkS11AeG5NrJcDCqdBnje+4Phdi6jm5TChhQ4Us3NbsBYEcbl7ZtcNN BBYm2qyCmYQEQNFq+anZ6Uaq3UG2WKRLQN3PSkhmmesxoxKxY6xjrdIn0xCYVF/PuIfw 5/lw== X-Forwarded-Encrypted: i=1; AJvYcCWKQ8kD20KdqJnM5qb4njAt66hG1LmRpYp0gekJEm2oSopTU7yvf0/zDJfGMBXMvd9odDaJ4fdblgIs86uflu2pEEBh93ipFx9pmZY+ X-Gm-Message-State: AOJu0YxpKMJwwW7mUJ+l5ksNyoNyHO94iJGA2QcjMbJNLIEvqtDDLfEL DlxeqkVsKmwe1vIN7o5pdU+5s682BByo5aqoTePw1TPgrueX0DWM/TF4qx8q3Q60Zp40JYVt88e sNtodup8REp0ZVsRoAkRRd/Pzr02Z3CTp0u49GtPpc+eoY2KXaP3QQiA= X-Received: by 2002:a17:906:df14:b0:a59:bce9:8454 with SMTP id a640c23a62f3a-a59fb94f6d3mr109682366b.1.1715153425329; Wed, 08 May 2024 00:30:25 -0700 (PDT) Received: from localhost.localdomain ([24.134.20.169]) by smtp.gmail.com with ESMTPSA id d12-20020a17090648cc00b00a59a874136fsm5212358ejt.214.2024.05.08.00.30.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 00:30:24 -0700 (PDT) From: =?UTF-8?q?Steffen=20B=C3=A4tz?= To: Cc: =?UTF-8?q?Steffen=20B=C3=A4tz?= , Andrew Lunn , Fabio Estevam , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Russell King , "Russell King (Oracle)" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 net 2/2] net: dsa: mv88e6xxx: read cmode on mv88e6320/21 serdes only ports Date: Wed, 8 May 2024 09:29:44 +0200 Message-Id: <20240508072944.54880-3-steffen@innosonix.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240508072944.54880-1-steffen@innosonix.de> References: <20240508072944.54880-1-steffen@innosonix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On the mv88e6320 and 6321 switch family, port 0/1 are serdes only ports. Modified the mv88e6352_get_port4_serdes_cmode function to pass a port number since the register set of the 6352 is equal on the 6320/21. Signed-off-by: Steffen B=C3=A4tz Reviewed-by: Andrew Lunn Reviewed-by: Fabio Estevam Changes since v1: - Collected Reviewed-by tags from Andrew and Fabio --- drivers/net/dsa/mv88e6xxx/chip.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/c= hip.c index bd58190853c7..6780e8c36b1f 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -637,12 +637,12 @@ static void mv88e6351_phylink_get_caps(struct mv88e6x= xx_chip *chip, int port, MAC_1000FD; } =20 -static int mv88e6352_get_port4_serdes_cmode(struct mv88e6xxx_chip *chip) +static int mv88e63xx_get_port_serdes_cmode(struct mv88e6xxx_chip *chip, in= t port) { u16 reg, val; int err; =20 - err =3D mv88e6xxx_port_read(chip, 4, MV88E6XXX_PORT_STS, ®); + err =3D mv88e6xxx_port_read(chip, port, MV88E6XXX_PORT_STS, ®); if (err) return err; =20 @@ -651,16 +651,16 @@ static int mv88e6352_get_port4_serdes_cmode(struct mv= 88e6xxx_chip *chip) return 0xf; =20 val =3D reg & ~MV88E6XXX_PORT_STS_PHY_DETECT; - err =3D mv88e6xxx_port_write(chip, 4, MV88E6XXX_PORT_STS, val); + err =3D mv88e6xxx_port_write(chip, port, MV88E6XXX_PORT_STS, val); if (err) return err; =20 - err =3D mv88e6xxx_port_read(chip, 4, MV88E6XXX_PORT_STS, &val); + err =3D mv88e6xxx_port_read(chip, port, MV88E6XXX_PORT_STS, &val); if (err) return err; =20 /* Restore PHY_DETECT value */ - err =3D mv88e6xxx_port_write(chip, 4, MV88E6XXX_PORT_STS, reg); + err =3D mv88e6xxx_port_write(chip, port, MV88E6XXX_PORT_STS, reg); if (err) return err; =20 @@ -688,7 +688,7 @@ static void mv88e6352_phylink_get_caps(struct mv88e6xxx= _chip *chip, int port, if (err <=3D 0) return; =20 - cmode =3D mv88e6352_get_port4_serdes_cmode(chip); + cmode =3D mv88e63xx_get_port_serdes_cmode(chip, port); if (cmode < 0) dev_err(chip->dev, "p%d: failed to read serdes cmode\n", port); @@ -701,12 +701,23 @@ static void mv88e632x_phylink_get_caps(struct mv88e6x= xx_chip *chip, int port, struct phylink_config *config) { unsigned long *supported =3D config->supported_interfaces; + int cmode; =20 /* Translate the default cmode */ mv88e6xxx_translate_cmode(chip->ports[port].cmode, supported); =20 config->mac_capabilities =3D MAC_SYM_PAUSE | MAC_10 | MAC_100 | MAC_1000FD; + + /* Port 0/1 are serdes only ports */ + if (port =3D=3D 0 || port =3D=3D 1) { + cmode =3D mv88e63xx_get_port_serdes_cmode(chip, port); + if (cmode < 0) + dev_err(chip->dev, "p%d: failed to read serdes cmode\n", + port); + else + mv88e6xxx_translate_cmode(cmode, supported); + } } =20 static void mv88e6341_phylink_get_caps(struct mv88e6xxx_chip *chip, int po= rt, --=20 2.34.1 --=20 *innosonix GmbH* Hauptstr. 35 96482 Ahorn central: +49 9561 7459980 www.innosonix.de innosonix GmbH Gesch=C3=A4ftsf=C3=BChrer:=20 Markus B=C3=A4tz, Steffen B=C3=A4tz USt.-IdNr / VAT-Nr.: DE266020313 EORI-Nr.:=20 DE240121536680271 HRB 5192 Coburg WEEE-Reg.-Nr. DE88021242 --=20