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 524AFC74A5B for ; Wed, 29 Mar 2023 19:05:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230057AbjC2TFQ (ORCPT ); Wed, 29 Mar 2023 15:05:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229586AbjC2TFO (ORCPT ); Wed, 29 Mar 2023 15:05:14 -0400 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B04F1198C; Wed, 29 Mar 2023 12:05:13 -0700 (PDT) Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1phb6a-0005fL-2y; Wed, 29 Mar 2023 21:05:09 +0200 Date: Wed, 29 Mar 2023 20:05:06 +0100 From: Daniel Golle To: Andrew Lunn Cc: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Sean Wang , Landen Chao , DENG Qingfang , Philipp Zabel , Sam Shih , Lorenzo Bianconi , John Crispin , Felix Fietkau Subject: Re: [RFC PATCH net-next v3 14/15] net: dsa: mt7530: introduce driver for MT7988 built-in switch Message-ID: References: <371f0586e257d098993847e71d0c916a03c04191.1680105013.git.daniel@makrotopia.org> <8fe9c1b6-a533-4ad9-8a23-4f16547476ed@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8fe9c1b6-a533-4ad9-8a23-4f16547476ed@lunn.ch> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 29, 2023 at 06:57:54PM +0200, Andrew Lunn wrote: > > @@ -18,6 +18,7 @@ enum mt753x_id { > > ID_MT7530 = 0, > > ID_MT7621 = 1, > > ID_MT7531 = 2, > > + ID_MT7988 = 3, > > }; > > > > #define NUM_TRGMII_CTRL 5 > > @@ -54,11 +55,11 @@ enum mt753x_id { > > #define MT7531_MIRROR_PORT_SET(x) (((x) & MIRROR_MASK) << 16) > > #define MT7531_CPU_PMAP_MASK GENMASK(7, 0) > > > > -#define MT753X_MIRROR_REG(id) (((id) == ID_MT7531) ? \ > > +#define MT753X_MIRROR_REG(id) ((((id) == ID_MT7531) || ((id) == ID_MT7988)) ? \ > > MT7531_CFC : MT7530_MFC) > > -#define MT753X_MIRROR_EN(id) (((id) == ID_MT7531) ? \ > > +#define MT753X_MIRROR_EN(id) ((((id) == ID_MT7531) || ((id) == ID_MT7988)) ? \ > > MT7531_MIRROR_EN : MIRROR_EN) > > -#define MT753X_MIRROR_MASK(id) (((id) == ID_MT7531) ? \ > > +#define MT753X_MIRROR_MASK(id) ((((id) == ID_MT7531) || ((id) == ID_MT7988)) ? \ > > MT7531_MIRROR_MASK : MIRROR_MASK) > > Are there more devices coming soon? I'm just wondering if these should > change into static inline functions with a switch statement? The > current code is not going to scale too much more. Afaik no devices with different built-in switches are in the pipe at this time, so this should be fine for a while. 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 56C8DC74A5B for ; Wed, 29 Mar 2023 19:06:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=qRq4vFexPxQsukt4pdk/MY8arBaean1Sl3UfhVjhZjM=; b=eJsuwJ5jCompdP 7iCV/3yacY/GtLEoSENA9n/x20vhqEvRgCTYxoqlnsGcjMHrEpS1bxSEzXcMv4MjFNM8HBLmbSeOq o/21BIw2m5XYTrCp/wT6MXwooX+GDrkISZZdrklSbOgM4wQuOC9TtY3yxlu501dbrmL/G/H6smgv9 6v6mu/8aSv9dmMTq8n58SDZCjz2BOmB87JK4U54tKZ7po4o7fPfG7DafjAOUwf7ym0KdD8O+ul6lj kHRwSART+rp9dr4H/Rd63Bf73Yri7AlpYaJKZYajzCMjcvNUNOtsUwU/BDl8tGecovR9j7K+ovKJy 0sB7QXlGGe799/Mz7qmQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1phb6i-001ZUn-2P; Wed, 29 Mar 2023 19:05:16 +0000 Received: from fudo.makrotopia.org ([2a07:2ec0:3002::71]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1phb6f-001ZTv-2M; Wed, 29 Mar 2023 19:05:14 +0000 Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1phb6a-0005fL-2y; Wed, 29 Mar 2023 21:05:09 +0200 Date: Wed, 29 Mar 2023 20:05:06 +0100 From: Daniel Golle To: Andrew Lunn Cc: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Sean Wang , Landen Chao , DENG Qingfang , Philipp Zabel , Sam Shih , Lorenzo Bianconi , John Crispin , Felix Fietkau Subject: Re: [RFC PATCH net-next v3 14/15] net: dsa: mt7530: introduce driver for MT7988 built-in switch Message-ID: References: <371f0586e257d098993847e71d0c916a03c04191.1680105013.git.daniel@makrotopia.org> <8fe9c1b6-a533-4ad9-8a23-4f16547476ed@lunn.ch> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <8fe9c1b6-a533-4ad9-8a23-4f16547476ed@lunn.ch> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230329_120513_778943_C9CAE6FD X-CRM114-Status: GOOD ( 12.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Wed, Mar 29, 2023 at 06:57:54PM +0200, Andrew Lunn wrote: > > @@ -18,6 +18,7 @@ enum mt753x_id { > > ID_MT7530 = 0, > > ID_MT7621 = 1, > > ID_MT7531 = 2, > > + ID_MT7988 = 3, > > }; > > > > #define NUM_TRGMII_CTRL 5 > > @@ -54,11 +55,11 @@ enum mt753x_id { > > #define MT7531_MIRROR_PORT_SET(x) (((x) & MIRROR_MASK) << 16) > > #define MT7531_CPU_PMAP_MASK GENMASK(7, 0) > > > > -#define MT753X_MIRROR_REG(id) (((id) == ID_MT7531) ? \ > > +#define MT753X_MIRROR_REG(id) ((((id) == ID_MT7531) || ((id) == ID_MT7988)) ? \ > > MT7531_CFC : MT7530_MFC) > > -#define MT753X_MIRROR_EN(id) (((id) == ID_MT7531) ? \ > > +#define MT753X_MIRROR_EN(id) ((((id) == ID_MT7531) || ((id) == ID_MT7988)) ? \ > > MT7531_MIRROR_EN : MIRROR_EN) > > -#define MT753X_MIRROR_MASK(id) (((id) == ID_MT7531) ? \ > > +#define MT753X_MIRROR_MASK(id) ((((id) == ID_MT7531) || ((id) == ID_MT7988)) ? \ > > MT7531_MIRROR_MASK : MIRROR_MASK) > > Are there more devices coming soon? I'm just wondering if these should > change into static inline functions with a switch statement? The > current code is not going to scale too much more. Afaik no devices with different built-in switches are in the pipe at this time, so this should be fine for a while. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel