Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2852317rwd; Mon, 22 May 2023 05:26:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4OyvJYFjccH3pE5imu8GdPoPGZXaj3B0/SPQngBVlbY4ljuJK5iy+56YZpaob///qlGEbr X-Received: by 2002:a05:6a20:144e:b0:10b:97c8:2e12 with SMTP id a14-20020a056a20144e00b0010b97c82e12mr3443021pzi.60.1684758389227; Mon, 22 May 2023 05:26:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684758389; cv=none; d=google.com; s=arc-20160816; b=qZfgp0GxSFxcpJ+7NwrGLziWa6IgkEWmt67OL2ai2TUQkxWLKfZ5bLzoNFxYXeiJr/ PdZwOxiO2JkEGBP6U2CeEQW5Q6jN74M0tABXy0TRQ0cYMUQpKaPQfpa8sn7zuC60dLcV N0UV2iTRA7e72OZY53SSCNXcRPJW/yBrhtt81cFEa8ik611M5JXq0PPqdYGHcylh/x1q fUtPcLT/YXzVopbM7Qhr+VCnhHIXvhla5gTw3in5hXN5+43EfBRW6Xl0iIBxcOgEf6a3 SNqJYW1N6jDASK5KNqhHowhhS/WjjGDDFg6CQ90yIE9z0YuIRtF5KPoDejN3SnQmaAKL mW5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=50+e+zsfVv5J1BqpAiWf9C7KcKligVVxQwX0YPFvKBI=; b=r39VpVVXdmfQ4p1m07NoLD6ToYS7JMvdV+J6rbTByrtOOs1FddOW9WeQFlYQb4MPVM 1mt44i9eiRxBCmj+pbUlBn610O3CyFNtEoioA26VN8tHmxG6HCDIu61Xez8A7f/QCeNU hkX1iZFOKtlSgouNAxLTfyBrBqd8nGalaDOqUChf2dScVseh+HkCb4VF2rygy81ZAh/n ItoDm+t/Bys1jPsHP6ZSpXiq9x28W3ERcogKH2Kfq4ipEN/h/heZDxPUlQQ363HqP1WK XsZS96mF+PNCQjWwZnWhsmaMEoEvnKCW9BJJgaDtKc39h63aL0qfmo4aIDuTntRF4tWN Jsvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=sjnpuNcM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q134-20020a632a8c000000b0052c89d50011si2626956pgq.676.2023.05.22.05.26.16; Mon, 22 May 2023 05:26:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=sjnpuNcM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233960AbjEVMTa (ORCPT + 99 others); Mon, 22 May 2023 08:19:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233893AbjEVMST (ORCPT ); Mon, 22 May 2023 08:18:19 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D22951FCC; Mon, 22 May 2023 05:16:51 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-96fd3a658eeso186902566b.1; Mon, 22 May 2023 05:16:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684757806; x=1687349806; 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=50+e+zsfVv5J1BqpAiWf9C7KcKligVVxQwX0YPFvKBI=; b=sjnpuNcMC4vPuNPM5W8qAKHq8laEr0IiAs8Yv8iF7D6XCl2l39DG4sCvemNN4DXMs3 ygsXI11bEbL4/sQHwESDh5EijbGBg0RFP7Bgk80DGY4cAwRo2iK+FiCX/ApZ+Pp5xjIH PoXGQ/fNfKgDR0sfgxwy/1E++kxv7CmxHSTppQ/sSAD/si0gUa4LHUf/78iNajzyzreo aRCWFhGX1GF6TLN/e+8vq6PeNM81ysMzgguyezsQRJ1g6kPblL8ZxH8mzUeRSvOUlbWP et0xQ/W7NAx3eCpXY2a52dWtedYRdKGxpOrP4dt1+TzYuTNxIoDpLv5/aKY8yyldcukJ ZHsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684757806; x=1687349806; 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=50+e+zsfVv5J1BqpAiWf9C7KcKligVVxQwX0YPFvKBI=; b=RSwFH6BSD0flXgrcsVlVJ7eL7t1s/xe0M8Yaw7NqzKnOR+NENHL+8izlqPrnIj2XJp FsXWRepKoVsAt7NEY3BdCm0Mlr9TL/gS/g8C/7xPccTaGI1uOfZUzxbM9UFrNSGQZ3hD XTlhlj87XIwjd0DJhPM6q30jJTGDUBtqxlRBCDaQffEXcq1XBJLh6QmqitzYf4bHRLod 9l6Qh2FRH9naoSx5UefTwxlM0wcfkedfUa0sN2f3MYzC1mjZPMs+X8MlJDOEYpQacmuK LliEn/s59wXOXtMGYIsY9YKrxfo8o9a0x7/JpmgNbrQJVd+wEsipsars0YGy7warPMwL /bdA== X-Gm-Message-State: AC+VfDyu+8cQvc3bHeBk+HyTp0v32Nq7KVrWQ7HRJEcITfHTcjQXzxKm HXBm2cYQrXeAHBIJDO7BzVM= X-Received: by 2002:a17:907:60ce:b0:96a:f21f:ab64 with SMTP id hv14-20020a17090760ce00b0096af21fab64mr8346390ejc.49.1684757806185; Mon, 22 May 2023 05:16:46 -0700 (PDT) Received: from arinc9-PC.. ([149.91.1.15]) by smtp.gmail.com with ESMTPSA id y26-20020a17090614da00b009659fed3612sm2999950ejc.24.2023.05.22.05.16.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 05:16:45 -0700 (PDT) From: arinc9.unal@gmail.com X-Google-Original-From: arinc.unal@arinc9.com To: Sean Wang , Landen Chao , DENG Qingfang , Daniel Golle , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King Cc: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= , Richard van Schagen , Richard van Schagen , Frank Wunderlich , Bartel Eerdekens , erkin.bozoglu@xeront.com, mithat.guner@xeront.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next 20/30] net: dsa: mt7530: properly reset MT7531 switch Date: Mon, 22 May 2023 15:15:22 +0300 Message-Id: <20230522121532.86610-21-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230522121532.86610-1-arinc.unal@arinc9.com> References: <20230522121532.86610-1-arinc.unal@arinc9.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arınç ÜNAL According to the document MT7531 Reference Manual for Development Board v1.0, the SW_PHY_RST bit on the SYS_CTRL register doesn't exist for MT7531. This is likely why forcing link-down on the MACs is necessary for MT7531. Therefore, do not set SW_PHY_RST on mt7531_setup(). Tested-by: Arınç ÜNAL Signed-off-by: Arınç ÜNAL --- drivers/net/dsa/mt7530.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index 0c261ef87bee..aafb7415e2ce 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -2416,14 +2416,12 @@ mt7531_setup(struct dsa_switch *ds) val = mt7530_read(priv, MT7531_TOP_SIG_SR); priv->p5_sgmii = !!(val & PAD_DUAL_SGMII_EN); - /* all MACs must be forced link-down before sw reset */ + /* Force link-down on all MACs before internal reset */ for (i = 0; i < MT7530_NUM_PORTS; i++) mt7530_write(priv, MT7530_PMCR_P(i), MT7531_FORCE_LNK); /* Reset the switch through internal reset */ - mt7530_write(priv, MT7530_SYS_CTRL, - SYS_CTRL_PHY_RST | SYS_CTRL_SW_RST | - SYS_CTRL_REG_RST); + mt7530_write(priv, MT7530_SYS_CTRL, SYS_CTRL_SW_RST | SYS_CTRL_REG_RST); if (!priv->p5_sgmii) { mt7531_pll_setup(priv); -- 2.39.2