Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2900533rwd; Mon, 22 May 2023 06:07:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7WoZeyQem6VlwYaQ2Q9CiBlig+wmtYErJBK/dL2lZYrLuElem/EOqkSKBGARwx95Txu385 X-Received: by 2002:a05:6a00:1581:b0:64e:c85:4457 with SMTP id u1-20020a056a00158100b0064e0c854457mr1896581pfk.8.1684760819763; Mon, 22 May 2023 06:06:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684760819; cv=none; d=google.com; s=arc-20160816; b=AFMXRVD+MIty1OXtr2fyGKuRTEHi+jH3wH711myke/q9z4LCv+1QPSlK3z1TUaEMWt RZ5/YKG4/6eWJ4Q4rKSPXd2Vq6j9LtF256YW766tdewqwG75glla12OBWEPzrlzuEP76 sd10QL8s5zuW9uvjS4K8lKKCiGHX6bIVBwWUd/YQPggK3L8JR6wHN6+dbnHZ2VwC8XvG SelXFPAVooTcbfuSBBXNDkw+YbAmTZkHPrFmSJHccRHH9PNGWTnrm7IzEpImluFj5x/F U12SV2bv3K5pux4JA60CcfctvTwHceTD25V8E+ZisWIbp1UtGatSubd2WO7msofLLlYS AMaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QgXnsrFF/eM2ahjoriewoNCLFM3CfsM4mow2EOGXBSw=; b=VU8rLswfruXsZ+iIDIzy5oRtHbYc/8jyTs9184JK1/u2y23gczmRd0jV0A6e0hSXpS P7YWugsIJW0svSXZQIXpofatxkkiXb2/CfG1Emy3QC+sRSmBNtyejoxsHSW8uLM3Doea +L0C33BgnXQqSIZY/bCUrosmr9cwvB9NmLk1dYc+eb5coi7TEcZeQUZFPFaI9NHvUJjo nZ5JC7c38TwI98ykExqN0TcGSA1jJAFM6R1uhjtIUVJ1/1xHBJ6SZ0Qid4j7H2/Bumnh CB4vYQfKn+cO5lVr0EB8p6cVeHiNnndIGZJQMU7sB9zFv5s1KlxrGO9TuEVkKz5ASNHw D1gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="4wSwfd/t"; 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=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p188-20020a6229c5000000b0063f2827e1dasi73800pfp.184.2023.05.22.06.06.43; Mon, 22 May 2023 06:06:59 -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=@lunn.ch header.s=20171124 header.b="4wSwfd/t"; 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=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234032AbjEVM46 (ORCPT + 99 others); Mon, 22 May 2023 08:56:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233994AbjEVM4z (ORCPT ); Mon, 22 May 2023 08:56:55 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90817C5; Mon, 22 May 2023 05:56:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=QgXnsrFF/eM2ahjoriewoNCLFM3CfsM4mow2EOGXBSw=; b=4wSwfd/ts3aW08Yk3aF3qarO5l 2YotqNK6pAGChYhnuNzd6uHSFpt+E2mRThWPkYXfRoE3vk0csDN3p1m/rnNpN4r5gLw5xENu4sxD5 0t6GQRkC4G2WC1lfdsNYsG7pAgSJNo3K9mKi1/0J4tzXHkm739Yeaa1jMc4+ZteiMAiE=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1q155f-00DXqz-6H; Mon, 22 May 2023 14:56:43 +0200 Date: Mon, 22 May 2023 14:56:43 +0200 From: Andrew Lunn To: Parthiban Veerasooran Cc: hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ramon.nordin.rodriguez@ferroamp.se, horatiu.vultur@microchip.com, Woojung.Huh@microchip.com, Nicolas.Ferre@microchip.com, Thorsten.Kummermehr@microchip.com Subject: Re: [PATCH net-next v2 6/6] net: phy: microchip_t1s: add support for Microchip LAN865x Rev.B0 PHYs Message-ID: <349e1c57-24c6-46fa-b0ab-c6225ae1ece4@lunn.ch> References: <20230522113331.36872-1-Parthiban.Veerasooran@microchip.com> <20230522113331.36872-7-Parthiban.Veerasooran@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230522113331.36872-7-Parthiban.Veerasooran@microchip.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,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 > +static int lan865x_setup_cfgparam(struct phy_device *phydev) > +{ > + u16 cfg_results[5]; > + u16 cfg_params[ARRAY_SIZE(lan865x_revb0_fixup_cfg_regs)]; > + s8 offsets[2]; > + int ret; Reverse Christmas tree please. > + > + ret = lan865x_generate_cfg_offsets(phydev, offsets); > + if (ret) > + return ret; > + > + ret = lan865x_read_cfg_params(phydev, cfg_params); Is this doing a read from fuses? Is anything documented about this? What the values mean? Would a board designer ever need to use different values? Or is this just a case of 'trust us', you don't need to understand this magic. > + if (ret) > + return ret; > + > + cfg_results[0] = (cfg_params[0] & 0x000F) | > + FIELD_PREP(GENMASK(15, 10), 9 + offsets[0]) | > + FIELD_PREP(GENMASK(15, 4), 14 + offsets[0]); > + cfg_results[1] = (cfg_params[1] & 0x03FF) | > + FIELD_PREP(GENMASK(15, 10), 40 + offsets[1]); > + cfg_results[2] = (cfg_params[2] & 0xC0C0) | > + FIELD_PREP(GENMASK(15, 8), 5 + offsets[0]) | > + (9 + offsets[0]); > + cfg_results[3] = (cfg_params[3] & 0xC0C0) | > + FIELD_PREP(GENMASK(15, 8), 9 + offsets[0]) | > + (14 + offsets[0]); > + cfg_results[4] = (cfg_params[4] & 0xC0C0) | > + FIELD_PREP(GENMASK(15, 8), 17 + offsets[0]) | > + (22 + offsets[0]); > + > + return lan865x_write_cfg_params(phydev, cfg_results); > +} Andrew