Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3256265rdh; Mon, 27 Nov 2023 09:35:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IFxGGGbyJRDj8z4BxFmaiD7MU8BxO2C3YXO4YQKKKqM3lJldKIwiwPGKy6sHkeg63AD1aT3 X-Received: by 2002:a17:90b:350d:b0:285:b6b1:a2d6 with SMTP id ls13-20020a17090b350d00b00285b6b1a2d6mr7358691pjb.33.1701106523358; Mon, 27 Nov 2023 09:35:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701106523; cv=none; d=google.com; s=arc-20160816; b=pCIL9kZ+ASaBY3LcYHLGGzNAAvKmBUzIQUtEQVBdDSobFrRHRdkhGfc3FWR40c7czx ZoHgVGVqUUn3Wh1AIzG+E+oZET9e35fbU9wM0iowHvs1S0pk2ht6o1od3Xkyh2GRrfNf x58cfaCyN4frfwK4Np031nPv0rEm8HyOWRxczEdNT5AJqjzW6n4CGREi8NiKpTzFRUre 3+OfZCQW3+0+0fT+1tqV6imfuOwzhYLsGpcbJwItcDPBjedOzlTeMSWFFmQr1kEavGfM v+IUUbE7n5awqoVbpwXV7SE8gPPjZHDUXwU6y3H7DGhHzzM7InRMPxA+d2jS0aVPk4zk 4MHA== 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=dCgnYA2BHI8R6kOuu4v1Rr1eB4wzNkIiBg2MOXwz+BY=; fh=JhnJ7uicRLpMFWf2FxvREo3TO1w+ltkJZy/ybS059oE=; b=i7dpdOlBj40voCznV2UNBL1l3EuNcJGJew7iGpGQHluKf52Ih3ntXRszvWsrYhOYY6 djQhXe6creRHO76DWBPxmNeEc7XZvZ2y13q+giOwIUEhJ7osfAKGxxxbK/6JfYOV/p8K 2Wfy9EwqlD/C8HbOCDNQ7qRJng0QWUJM8LQW++NiA0uMlqpCUzRGWRGAfTrUPRSDxQsB ylA/6oN136rMK6h5qzZeNub9866eYALgFkVuvGiLpbP1thUi18ICeihp9NWUWy5fcLxG fi9sdtC/6wcHsDVFD6nXYlNOORpUk4dEYUwUg4COLzJet9L+3x99rnretfHod2Yq37jO 9ovA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=JRzzzBUR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id pd9-20020a17090b1dc900b002859ad34f7bsi7472085pjb.92.2023.11.27.09.35.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 09:35:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=JRzzzBUR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id CF6128078284; Mon, 27 Nov 2023 05:37:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233067AbjK0Nho (ORCPT + 99 others); Mon, 27 Nov 2023 08:37:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232913AbjK0Nhm (ORCPT ); Mon, 27 Nov 2023 08:37:42 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56F90B8; Mon, 27 Nov 2023 05:37:49 -0800 (PST) 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=dCgnYA2BHI8R6kOuu4v1Rr1eB4wzNkIiBg2MOXwz+BY=; b=JRzzzBURcil9rlFybupVTuue/j mpbF6lr8Dcw5ofoEFFGxD5Qh9rXJY8GaHgh5vRr2xC8FrVhiZfvcKPIi+W76VSd0plT6ieKlZwQnK QF7ihjEeC42ugiVrnAQ2E5G3JcsJrx9A7KCqcmU58xyTbzoI6JgCab42kz8g1eaZAKTU=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1r7bnx-001LUS-N5; Mon, 27 Nov 2023 14:37:41 +0100 Date: Mon, 27 Nov 2023 14:37:41 +0100 From: Andrew Lunn To: =?iso-8859-1?Q?Ram=F3n_N=2ERodriguez?= Cc: Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] net: microchip_t1s: add support for LAN867x Rev.C1 Message-ID: References: <20231127104045.96722-1-ramon.nordin.rodriguez@ferroamp.se> <20231127104045.96722-3-ramon.nordin.rodriguez@ferroamp.se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231127104045.96722-3-ramon.nordin.rodriguez@ferroamp.se> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 27 Nov 2023 05:38:00 -0800 (PST) > #define PHY_ID_LAN867X_REVB1 0x0007C162 > +#define PHY_ID_LAN867X_REVC1 0x0007C164 So there is a gap in the revisions. Maybe a B2 exists? > +static int lan867x_revc1_read_fixup_value(struct phy_device *phydev, u16 addr) > +{ > + int regval; > + /* The AN pretty much just states 'trust us' regarding these magic vals */ > + const u16 magic_or = 0xE0; > + const u16 magic_reg_mask = 0x1F; > + const u16 magic_check_mask = 0x10; Reverse christmass tree please. Longest first, shorted last. > + regval = lan865x_revb0_indirect_read(phydev, addr); > + if (regval < 0) > + return regval; > + > + regval &= magic_reg_mask; > + > + return (regval & magic_check_mask) ? regval | magic_or : regval; > +} > + > +static int lan867x_revc1_config_init(struct phy_device *phydev) > +{ > + int err; > + int regval; > + u16 override0; > + u16 override1; > + const u16 override_addr0 = 0x4; > + const u16 override_addr1 = 0x8; > + const u8 index_to_override0 = 2; > + const u8 index_to_override1 = 3; Same here. > + > + err = lan867x_wait_for_reset_complete(phydev); > + if (err) > + return err; > + > + /* The application note specifies a super convenient process > + * where 2 of the fixup regs needs a write with a value that is > + * a modified result of another reg read. > + * Enjoy the magic show. > + */ I really do hope that by revision D1 they get the firmware sorted out so none of this undocumented magic is needed. Andrew