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 X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C43F2C433DB for ; Mon, 4 Jan 2021 12:16:46 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8597921E92 for ; Mon, 4 Jan 2021 12:16:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8597921E92 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0sgyj4CdOCjw5Wllj0Z2AB/SrwFJ2ogJHcr4ggk0OEc=; b=1yL3nAB4ldzPg083tk0lfEHG4 8ryCKiWHepuBjiBVznK72OiaivUdN5+ddAvxnKG0jlnkL9Q4GBn9PgkLdUIwiV/eHVSJKC7FyU3ze POIb3G5D7FH43ng5iz6jRdQ+llEpFwkv0dl4Kv7fQuErh+PlzjBkr3W+KEnUWIvsm6N/948decbAU hLrn0c8YFOTBuHMeu+66MWDcltCejVA/xvJvA9dTZAvSRrR0HLWOkF3bOQUZkVd7kEphX5F5307DR 6lEKEv7iMe1kaXvAPVQFgsq0YJWy5pa3rEPAqPezgWJ/PBrQ6ZY+a7qMAxYCQL42oS4x51PFd/ZVz ez2ZIIzjQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwOlU-0003CO-9e; Mon, 04 Jan 2021 12:15:12 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwOlR-00035V-9D for linux-arm-kernel@lists.infradead.org; Mon, 04 Jan 2021 12:15:10 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id DF9FF21E92; Mon, 4 Jan 2021 12:15:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609762507; bh=ujE4ia0BZCEIoKHFwGJssPvikHau8MsYGuk81g80iRg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OKkJGLadCQfFuWPr1tbn+w9hTwc0ISMeA8o/yHcdamNGWlgsk6Roi2lt2dr1ZKx3P OyHsC3Unamy6+JqA29im/B2IIcVJTNVEiMgCyHq2JO6ISG6fkLUIO/CEBXTYQxgJiz jnSyvqoySZ3DIMb7PnV3tyUhMwTjn/lYv2722nnwM0W8iscXii6sNDFIFVdXYfTvab LQz93Weo7hSPbaEgFi96lHHVQMwY3Iu/pu8hzYIAKXHIS4fhiXQd164LD8FeYMddN8 T4z++6/TQCUWL6HRd1EpjziiBSpDenY1uoyauUZfwIZ/Hx2RWMJt/WBSsf1M5DrMjK U3mhGqccbyDNQ== Date: Mon, 4 Jan 2021 14:15:02 +0200 From: Leon Romanovsky To: Steen Hegelund Subject: Re: [PATCH v11 3/4] phy: Add Sparx5 ethernet serdes PHY driver Message-ID: <20210104121502.GK31158@unreal> References: <20210104082218.1389450-1-steen.hegelund@microchip.com> <20210104082218.1389450-4-steen.hegelund@microchip.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210104082218.1389450-4-steen.hegelund@microchip.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210104_071509_478361_73124374 X-CRM114-Status: GOOD ( 17.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bjarni Jonasson , Alexandre Belloni , Andrew Lunn , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Kishon Vijay Abraham I , Vinod Koul , linux-arm-kernel@lists.infradead.org, Microchip UNG Driver List , Lars Povlsen Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jan 04, 2021 at 09:22:17AM +0100, Steen Hegelund wrote: > Add the Microchip Sparx5 ethernet serdes PHY driver for the 6G, 10G and 25G > interfaces available in the Sparx5 SoC. > > Signed-off-by: Bjarni Jonasson > Signed-off-by: Steen Hegelund > Reviewed-by: Andrew Lunn > --- > drivers/phy/Kconfig | 1 + > drivers/phy/Makefile | 1 + > drivers/phy/microchip/Kconfig | 12 + > drivers/phy/microchip/Makefile | 6 + > drivers/phy/microchip/sparx5_serdes.c | 2443 ++++++++++++++++++ > drivers/phy/microchip/sparx5_serdes.h | 129 + > drivers/phy/microchip/sparx5_serdes_regs.h | 2695 ++++++++++++++++++++ > 7 files changed, 5287 insertions(+) > create mode 100644 drivers/phy/microchip/Kconfig > create mode 100644 drivers/phy/microchip/Makefile > create mode 100644 drivers/phy/microchip/sparx5_serdes.c > create mode 100644 drivers/phy/microchip/sparx5_serdes.h > create mode 100644 drivers/phy/microchip/sparx5_serdes_regs.h > > diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig > index 00dabe5fab8a..df35c752f3aa 100644 > --- a/drivers/phy/Kconfig > +++ b/drivers/phy/Kconfig > @@ -70,6 +70,7 @@ source "drivers/phy/ingenic/Kconfig" > source "drivers/phy/lantiq/Kconfig" > source "drivers/phy/marvell/Kconfig" > source "drivers/phy/mediatek/Kconfig" > +source "drivers/phy/microchip/Kconfig" > source "drivers/phy/motorola/Kconfig" > source "drivers/phy/mscc/Kconfig" > source "drivers/phy/qualcomm/Kconfig" > diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile > index 32261e164abd..adac1b1a39d1 100644 > --- a/drivers/phy/Makefile > +++ b/drivers/phy/Makefile > @@ -20,6 +20,7 @@ obj-y += allwinner/ \ > lantiq/ \ > marvell/ \ > mediatek/ \ > + microchip/ \ > motorola/ \ > mscc/ \ > qualcomm/ \ > diff --git a/drivers/phy/microchip/Kconfig b/drivers/phy/microchip/Kconfig > new file mode 100644 > index 000000000000..0b1a818e01b8 <...> > +struct sparx5_sd10g28_args { > + bool skip_cmu_cfg; /* Enable/disable CMU cfg */ > + bool no_pwrcycle; /* Omit initial power-cycle */ > + bool txinvert; /* Enable inversion of output data */ > + bool rxinvert; /* Enable inversion of input data */ > + bool txmargin; /* Set output level to half/full */ > + u16 txswing; /* Set output level */ > + bool mute; /* Mute Output Buffer */ > + bool is_6g; > + bool reg_rst; > +}; All those bools in structs can be squeezed into one u8, just use bitfields, e.g. "u8 a:1;". Also I strongly advise do not do vertical alignment, it will cause to too many churn later when this code will be updated. > + <...> > +static inline void __iomem *sdx5_addr(void __iomem *base[], > + int id, int tinst, int tcnt, > + int gbase, int ginst, > + int gcnt, int gwidth, > + int raddr, int rinst, > + int rcnt, int rwidth) > +{ > +#if defined(CONFIG_DEBUG_KERNEL) > + WARN_ON((tinst) >= tcnt); > + WARN_ON((ginst) >= gcnt); > + WARN_ON((rinst) >= rcnt); > +#endif Please don't put "#if defined(CONFIG_DEBUG_KERNEL)", print WARN_ON(). Thanks _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel