Received: by 2002:a05:7412:1492:b0:e2:908c:2ebd with SMTP id s18csp381642rdh; Mon, 21 Aug 2023 20:29:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQj5tXnWrceyVtgycCaoKm5DoqGSyCw+cEhzigopxLBxOig5tcAOb2oV889ida0ZzD3z0P X-Received: by 2002:a05:6512:477:b0:4fe:2c6:1d76 with SMTP id x23-20020a056512047700b004fe02c61d76mr5324371lfd.21.1692674982424; Mon, 21 Aug 2023 20:29:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692674982; cv=none; d=google.com; s=arc-20160816; b=XN5eEMazegGJWB7JEblTVFRtpdNaRl60G9DM9qE7ENX1kDE7VRGtvjZ9qCqp/pHt9c hZAiaY75rgAMT+d9NdYv7RlczBCvSYbUXKPK42p9Cb3PfaAu1g5pTujTCOXTtfXWTJ6x iU/TNUkEh4Ol8prpiVOdQ94tEh2O0J5l85xEKMDJb3uK2/9Dva8izxPprhUEDzBsVL/T mkJoN24NItxQfGcrvJWKnO8InEmUEBeR5llgQdPsM7KF5pPrs1cOtId9lHRDHfbsuF7v Hj0Puexmf64sbMEVpFPAghjlKBRjpc9GVTHh5sganZaAavxIdC/lQuebSRs5n8GM+Cnk 1BRw== 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:to:from:date; bh=qlnjPm6dPkb+57n/9UfCDDBuOfZ7cdVqIfZwO0EBp2A=; fh=X1vQ7pCsbQpxViGgjgqIn/1e1UlakaNBc5eoPlgDJr0=; b=ejNZbIsvYp9K+XwVnW4hKlyfR5uLrKpsNzez/wSEIlr0aNVulVRAnBBS0QB6RDUTf/ LVok9XOdJ2marzax+axg050o4exgsQdyipcatn7ehgy9PrqN+Xu3Esjqq7uXrPtJeBKl /KI6rSlsb48l7nDU/iGtGInQOf5nz6nol6S4v3BgknvEXWd3phzT1xxAqE/JGClwKbE9 /LJsuxJo7Mss+OUrUZPbRfl5iOTSvN7QS5cVpD9VM7rlEu60ZfE7DrsoUfeuh3hBjQfY WtE+hBksEhYNZwnju+gy4I80O+77nanAbIvtM04dY5R/qoAAjDUeCaSIV1ZPBnaVhdV3 do7g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bw24-20020a170906c1d800b0099c49a11e78si6306483ejb.975.2023.08.21.20.29.14; Mon, 21 Aug 2023 20:29:42 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231696AbjHUX3o (ORCPT + 99 others); Mon, 21 Aug 2023 19:29:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231669AbjHUX3n (ORCPT ); Mon, 21 Aug 2023 19:29:43 -0400 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D39B186; Mon, 21 Aug 2023 16:29:40 -0700 (PDT) Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1qYEKw-0004U0-2Z; Mon, 21 Aug 2023 23:29:31 +0000 Date: Tue, 22 Aug 2023 00:29:17 +0100 From: Daniel Golle To: Felix Fietkau , John Crispin , Sean Wang , Mark Lee , Lorenzo Bianconi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Daniel Golle , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 1/4] net: ethernet: mtk_eth_soc: fix register definitions for MT7988 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 More register macros need to be adjusted for the 3rd GMAC on MT7988. Account for added bit in SYSCFG0_SGMII_MASK. Fixes: 445eb6448ed3 ("net: ethernet: mtk_eth_soc: add basic support for MT7988 SoC") Signed-off-by: Daniel Golle Reviewed-by: Simon Horman --- drivers/net/ethernet/mediatek/mtk_eth_soc.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h index 4a2470fbad2cf..8d2d35b322351 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -133,10 +133,12 @@ #define MTK_GDMA_XGDM_SEL BIT(31) /* Unicast Filter MAC Address Register - Low */ -#define MTK_GDMA_MAC_ADRL(x) (0x508 + (x * 0x1000)) +#define MTK_GDMA_MAC_ADRL(x) ({ typeof(x) _x = (x); (_x == MTK_GMAC3_ID) ? \ + 0x548 : 0x508 + (_x * 0x1000); }) /* Unicast Filter MAC Address Register - High */ -#define MTK_GDMA_MAC_ADRH(x) (0x50C + (x * 0x1000)) +#define MTK_GDMA_MAC_ADRH(x) ({ typeof(x) _x = (x); (_x == MTK_GMAC3_ID) ? \ + 0x54C : 0x50C + (_x * 0x1000); }) /* FE global misc reg*/ #define MTK_FE_GLO_MISC 0x124 @@ -503,7 +505,7 @@ #define ETHSYS_SYSCFG0 0x14 #define SYSCFG0_GE_MASK 0x3 #define SYSCFG0_GE_MODE(x, y) (x << (12 + (y * 2))) -#define SYSCFG0_SGMII_MASK GENMASK(9, 8) +#define SYSCFG0_SGMII_MASK GENMASK(9, 7) #define SYSCFG0_SGMII_GMAC1 ((2 << 8) & SYSCFG0_SGMII_MASK) #define SYSCFG0_SGMII_GMAC2 ((3 << 8) & SYSCFG0_SGMII_MASK) #define SYSCFG0_SGMII_GMAC1_V2 BIT(9) -- 2.41.0