Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp458558rwe; Fri, 14 Apr 2023 05:37:26 -0700 (PDT) X-Google-Smtp-Source: AKy350ZxnSbyZLhVoVBQUUmG4KXnR9CPVtXnQx3MUAU/6fZQafScf46MeL5BjhSXVxuVsRQf0P7+ X-Received: by 2002:a17:90b:4f84:b0:247:448:b9dc with SMTP id qe4-20020a17090b4f8400b002470448b9dcmr5738977pjb.14.1681475846438; Fri, 14 Apr 2023 05:37:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1681475846; cv=pass; d=google.com; s=arc-20160816; b=P/Uy2i0iVbo4N9lyxo9x8JO4ni7k5NI7gFG+CqYpK2PYRGuzezZltX5c52BZrgDynL f6q4CK7OoBZ2WB2pQQiBXjwc6Hakggh85LJfBFh+7fgKVvKyIjzoCZgRta7ElQLa5GIz /i0Ojb4JkZsQA7n6EQSJLiBTU6zB5vQbOLckpsDEXUn/wDYjmkqukbhBrExuDx2HfAMQ UHJZM0bMkc/Lf4qa/ou2/P2Uzko/mo0K2EtQscHyIfsGvdPPw0/SDnu/rfQH/51XTFU7 5DJB69K5tjiHxva2omhrNb1JzKE/WD44bA/Em0JMVlZNZ91WGR/xCBPR2hMkZvCDaXFB Wr2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=z2XOASLEKsa7wqjYtuo8NoqmkS3+OiypWGH4rl3hN5o=; b=u+YhmEc/kRQMbqVkiqqwtP+g97Rxv5K2iJiXInzTekgsbqZJ/gAGdk1ZbDvvZai7yl VyLH9349yk1q2YZzcs/WPbdwdabZFIqGUDly5IR4k7pj+SnLHwMnXVURrprc3zXLfwED jY9Yqrpqs2H992DNZ5dxWOZ6lgghpL3jYd3vdZK2oKYMRnwOboN6NsnYs8lBdDspiiUT Be0iRzmWt1eziykLS3KeaRzGxHG0JhVBxA70wLJMRviJfCGswbL40JToVmjEx5nIgr22 2Hx1VQfexYcJN/hHv3Qf8d/GEZAeS+JK1QQjQOVrufHmrxLBo4G560fXWsQpknrVoFCG 6rBg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arinc9.com header.s=zmail header.b=DjqWN6Yl; arc=pass (i=1 spf=pass spfdomain=arinc9.com dkim=pass dkdomain=arinc9.com dmarc=pass fromdomain=arinc9.com>); 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e2-20020a63f542000000b005184398f8e0si4644630pgk.57.2023.04.14.05.37.11; Fri, 14 Apr 2023 05:37:26 -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=@arinc9.com header.s=zmail header.b=DjqWN6Yl; arc=pass (i=1 spf=pass spfdomain=arinc9.com dkim=pass dkdomain=arinc9.com dmarc=pass fromdomain=arinc9.com>); 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230478AbjDNM2Z (ORCPT + 99 others); Fri, 14 Apr 2023 08:28:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230301AbjDNM2X (ORCPT ); Fri, 14 Apr 2023 08:28:23 -0400 Received: from sender3-op-o18.zoho.com (sender3-op-o18.zoho.com [136.143.184.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 443FD5260; Fri, 14 Apr 2023 05:28:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681475224; cv=none; d=zohomail.com; s=zohoarc; b=muEMiNc6X4kpwNuB2j+lTCvzYfl6q+EGl/it36G5HLiA3/9geCnrIwoZS+5IMBjFrMD6I9JS3J/QHnPeqgWqlsKMWC4PTc0XHqhXpI4GcfCtWDB6eFUWkU1omEqhge7ytalffWzH/IKHufx79x5QLPriEoPt1K7VFJooQ1SfnuE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681475224; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=z2XOASLEKsa7wqjYtuo8NoqmkS3+OiypWGH4rl3hN5o=; b=DAUZoXsgTbfo69eoDV4OtSGZn5XHU3YCDAInDfEWFcmX9w13n8n/2kyMXSBe46FopoaxOr6IvRxO1SZYot+8vsqpHjtkZPnlrmM0DnqrwxA+cQsELSrw6GWjuG7vJWpHkxry7BKHSANntEO9M1iIYdbzQ+d8I6YegrwoKUxFXA0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=arinc9.com; spf=pass smtp.mailfrom=arinc.unal@arinc9.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1681475224; s=zmail; d=arinc9.com; i=arinc.unal@arinc9.com; h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=z2XOASLEKsa7wqjYtuo8NoqmkS3+OiypWGH4rl3hN5o=; b=DjqWN6YlqTqNN4n1AGNJz1sT6czOolvvH75qmlhf+KpyMwkRDxemDPPSA5W3UUcW RJbXmLviSSPQr62y2I1GQA8farT0tSXq82a9RW6Ib6zTCt+TSqvGI2uF5LrM8tkP2Jc ntCwcyFDSZJvuWb3h4eh0+mxQDnS7BGuk0DkUqFM= Received: from [10.10.10.3] (149.91.1.15 [149.91.1.15]) by mx.zohomail.com with SMTPS id 1681475222132610.1878987362392; Fri, 14 Apr 2023 05:27:02 -0700 (PDT) Message-ID: <60d11eba-9532-48ea-b4ce-28a332f2b7df@arinc9.com> Date: Fri, 14 Apr 2023 15:26:52 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH net] net: dsa: mt7530: permit port 5 to work without port 6 on MT7621 SoC Content-Language: en-US To: Vladimir Oltean , netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Sean Wang , Landen Chao , DENG Qingfang , Andrew Lunn , Florian Fainelli , Matthias Brugger , AngeloGioacchino Del Regno , Russell King , =?UTF-8?Q?Ren=c3=a9_van_Dorst?= , Alexander Couzens , Ilya Lipnitskiy , Richard van Schagen , Frank Wunderlich , erkin.bozoglu@xeront.com, Greg Ungerer , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, arinc9.unal@gmail.com References: <20230307155411.868573-1-vladimir.oltean@nxp.com> From: =?UTF-8?B?QXLEsW7DpyDDnE5BTA==?= In-Reply-To: <20230307155411.868573-1-vladimir.oltean@nxp.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ZohoMailClient: External X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,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 On 7.03.2023 18:54, Vladimir Oltean wrote: > The MT7530 switch from the MT7621 SoC has 2 ports which can be set up as > internal: port 5 and 6. Arınç reports that the GMAC1 attached to port 5 > receives corrupted frames, unless port 6 (attached to GMAC0) has been > brought up by the driver. This is true regardless of whether port 5 is > used as a user port or as a CPU port (carrying DSA tags). > > Offline debugging (blind for me) which began in the linked thread showed > experimentally that the configuration done by the driver for port 6 > contains a step which is needed by port 5 as well - the write to > CORE_GSWPLL_GRP2 (note that I've no idea as to what it does, apart from > the comment "Set core clock into 500Mhz"). Prints put by Arınç show that > the reset value of CORE_GSWPLL_GRP2 is RG_GSWPLL_POSDIV_500M(1) | > RG_GSWPLL_FBKDIV_500M(40) (0x128), both on the MCM MT7530 from the > MT7621 SoC, as well as on the standalone MT7530 from MT7623NI Bananapi > BPI-R2. Apparently, port 5 on the standalone MT7530 can work under both > values of the register, while on the MT7621 SoC it cannot. I finally found out why. Looking at gsw_mt7623.c [0], setting the core clock into 500Mhz is done for 40MHz XTAL. With some dev_info code, I was able to confirm that the MCM MT7530 on my MT7621 board runs at 40MHz whilst the standalone MT7530 on my Bananapi BPI-R2 runs at 25MHz. [0] https://github.com/BPI-SINOVOIP/BPI-R2-bsp/blob/master/linux-mt/drivers/net/ethernet/mediatek/gsw_mt7623.c#L1039 Arınç