Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5864204ioo; Wed, 1 Jun 2022 14:24:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMr1EbZxp1iwRsGBneTe9ZPwRMukdX69VqgnLL3rsP6/+QbTwAUzyOinoYuWOxEtnCaqMo X-Received: by 2002:a05:6a00:15c5:b0:518:98a7:dc0e with SMTP id o5-20020a056a0015c500b0051898a7dc0emr1510637pfu.30.1654118649219; Wed, 01 Jun 2022 14:24:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654118649; cv=none; d=google.com; s=arc-20160816; b=I6Q8cQKUTgZDlir7byHYrYYyZeCtJPmYauCwWvvLgfwQiV1k5MO9q9zrFGyIOb+7/U o/eAE88D+aUXK6z7btGEgYEd1+2b/tnq4ALqm1XqoFN4v4s5DcPIUERMIPxCfT8KpTnt Z3St+KoPlS7hWWcd2wqA4KpSnCjlgfl4zM0unXAcqlZY7j231MHxctz7Q4bq6kJC/Ul9 DIzikYaBN8ZuNNom1k0hEWKpC0ssO5A3+db1AQo88iJLDoXeijZp+q2+PyXcuScGFfFU 8pjMusMoVaa+/ffboW/X1w13jneOkmYB0KQOPBj/ly8jxZVYexhf2ifC8ZsVbbRX1402 c+oQ== ARC-Message-Signature: i=1; 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=o58GPHpSfMrNtcPoXLXC45PlGOEAXm5Hicr+kbxgAAM=; b=vMkOiNeAI79XXljNvJQ19GI7VYR0B8VXTy/amModDp96XZF/IJgDuZu2SOe/PXu6ZM 5A39+hAV6IfjUQNVHsIaga/nVACmv8QyX2VoSHIZXv89sXTTvKN/hweXyOPuzM8/ytOW zFQWyvHDXaWum6fkvm3Zn0WMSp72CBRycJQQHAhkFU+wnry32gTLD0NjpogbzGpkAEG6 uHdWKhF5G4ErcKKJHTEEHi/5JddkZIeU3wpKuQO157Q+Smb7qaZqDTM34rdtQ/aCbCbN +Tfk1ZgiXeZnTgqK3LtNM7+P9qK7R7k3U3+g0/LUpWBZEu/Y8M1WBggKop8DeU+PuD8K K6oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Ge5DDgxy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id jh20-20020a170903329400b00163e4495597si3374681plb.581.2022.06.01.14.24.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 14:24:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Ge5DDgxy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D4C0D3004C4; Wed, 1 Jun 2022 13:14:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349781AbiFAGGR (ORCPT + 99 others); Wed, 1 Jun 2022 02:06:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243583AbiFAGGQ (ORCPT ); Wed, 1 Jun 2022 02:06:16 -0400 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F1BD6FA35; Tue, 31 May 2022 23:06:15 -0700 (PDT) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 25165rQB028781; Wed, 1 Jun 2022 01:05:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1654063553; bh=o58GPHpSfMrNtcPoXLXC45PlGOEAXm5Hicr+kbxgAAM=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=Ge5DDgxyRVQVPW/13G2xotnhrnAFpALyt0RhGLZpTCnORTzUxL6jvtf26farqri00 PWWU4UQNGw/1Md9vGHFcMMu/my5whJn228sYkb5xfPG9XIgy4WvhIgUsyn8piZGlaY QNYvJ99ZZfxysJTZ1qJoql+ujN2fNZwBKZU6jguY= Received: from DFLE101.ent.ti.com (dfle101.ent.ti.com [10.64.6.22]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 25165rnp010401 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 1 Jun 2022 01:05:53 -0500 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 1 Jun 2022 01:05:53 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Wed, 1 Jun 2022 01:05:53 -0500 Received: from [172.24.222.108] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 25165hef032372; Wed, 1 Jun 2022 01:05:45 -0500 Message-ID: <670b070f-ed0c-a1e0-1a3c-875ee36ca134@ti.com> Date: Wed, 1 Jun 2022 11:35:43 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH 2/3] net: ethernet: ti: am65-cpsw: Add support for QSGMII mode Content-Language: en-US To: "Russell King (Oracle)" CC: , , , , , , , , , , , , , , References: <20220531113058.23708-1-s-vadapalli@ti.com> <20220531113058.23708-3-s-vadapalli@ti.com> From: Siddharth Vadapalli In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Hello Russell, On 31/05/22 17:20, Russell King (Oracle) wrote: > On Tue, May 31, 2022 at 05:00:57PM +0530, Siddharth Vadapalli wrote: >> static void am65_cpsw_nuss_mac_config(struct phylink_config *config, unsigned int mode, >> const struct phylink_link_state *state) >> { >> - /* Currently not used */ >> + struct am65_cpsw_slave_data *slave = container_of(config, struct am65_cpsw_slave_data, >> + phylink_config); >> + struct am65_cpsw_port *port = container_of(slave, struct am65_cpsw_port, slave); >> + >> + if (state->interface == PHY_INTERFACE_MODE_QSGMII) >> + writel(AM65_CPSW_SGMII_CONTROL_MR_AN_ENABLE, >> + port->sgmii_base + AM65_CPSW_SGMII_CONTROL_REG); > > What about writing this register when the interface mode isn't QSGMII? In TI's J7200 device, there are two CPSW MACs namely CPSW2G and CPSW5G. While CPSW5G supports QSGMII mode, CPSW2G does not. The same am65-cpsw-nuss driver is used to control both CPSW2G and CPSW5G. Thus, the am65_cpsw_nuss_mac_config() function is called for both CPSW2G and CPSW5G MACs. The SGMII CONTROL Register is only present for CPSW5G. Thus, the write should only be performed for QSGMII mode which is supported only by CPSW5G. Functionally, always writing to the register even if the mode is not QSGMII does not cause any problems, as long as it is CPSW5G MAC that is being used. Thinking about it again, I will add a compatible to differentiate CPSW2G ports from CPSW5G ports in order to make it cleaner, so that the register can always be written to if the CPSW5G ports are used, irrespective of the interface mode. Thanks, Siddharth.