From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EECBDC433F5 for ; Tue, 8 Feb 2022 16:12:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382762AbiBHQMZ (ORCPT ); Tue, 8 Feb 2022 11:12:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343745AbiBHQMZ (ORCPT ); Tue, 8 Feb 2022 11:12:25 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02E4EC061576 for ; Tue, 8 Feb 2022 08:12:25 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 94C92616A3 for ; Tue, 8 Feb 2022 16:12:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6DFCC004E1; Tue, 8 Feb 2022 16:12:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644336744; bh=6GXXH4TfsdmfERkKnDoEch0jzcTIOQshlqOEju75yBY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FtXIpitFlgGbuzu8r2Tr4aLpCrB+AgEfgWdQpELpZgvTXKmmvEGIMEfQEI8p9KfK4 5YHq4nkNzUbvqXocLMTOolSrnYY0XwlQRaiOFlLdR+6yXkwexbMox0ALzNcJJqgf/8 rBuXaMuCUThGBFwOAaYZDiiYxeoOInVvuOXrOJCnWux9gbtHxHy4OPBtuSjWH91Dof 4rUDtvBL066Gh8FsTVqWrI8XtMo7qmqVnXzStEll0dKxxFaWcpiK/2xgJqJ7OlOUXS 4jt32Atd0CHay+o3BQ9xeFWbQqwysZZlOUqXUMX2a/mR6R4BkVSEbg+/nLEfGVVMtM J/00STjBEu6RQ== Date: Tue, 8 Feb 2022 17:12:19 +0100 From: Marek =?UTF-8?B?QmVow7pu?= To: Holger Brunck Cc: netdev@vger.kernel.org, Andrew Lunn , Jakub Kicinski Subject: Re: [v4] dsa: mv88e6xxx: make serdes SGMII/Fiber tx amplitude configurable Message-ID: <20220208171219.022165d1@thinkpad> In-Reply-To: <20220208094455.28870-1-holger.brunck@hitachienergy.com> References: <20220208094455.28870-1-holger.brunck@hitachienergy.com> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, 8 Feb 2022 10:44:55 +0100 Holger Brunck wrote: > +static struct mv88e6352_serdes_p2p_to_val mv88e6352_serdes_p2p_to_val[] = { > + /* Mapping of configurable mikrovolt values to the register value */ > + { 14000, 0}, > + { 112000, 1}, > + { 210000, 2}, > + { 308000, 3}, > + { 406000, 4}, > + { 504000, 5}, > + { 602000, 6}, > + { 700000, 7}, > +}; ... > + reg = (reg & MV88E6352_SERDES_OUT_AMP_MASK) | val; This is weird: normally in mask we have those bits set that are to be changed. So amplitude mask should be bits that specify the amplitue, and this should be reg &= ~MV88E6352_SERDES_OUT_AMP_MASK; reg |= val & MV88E6352_SERDES_OUT_AMP_MASK; and mask should be defined inversely. ... > +#define MV88E6352_SERDES_OUT_AMP_MASK 0xfffc And this is also weird. 0xfffc is all bits set except last 2, but in the mapping above the maximum value is 7, so you use 3 bits for amplitude... Marek