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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 86A0FC25B0C for ; Mon, 8 Aug 2022 02:28:21 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D8B3F83FA0; Mon, 8 Aug 2022 04:28:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=mediatek.com header.i=@mediatek.com header.b="h3/8hFiJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9B8ED83FB5; Mon, 8 Aug 2022 04:28:18 +0200 (CEST) Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4487983F88 for ; Mon, 8 Aug 2022 04:28:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=weijie.gao@mediatek.com X-UUID: 39698b81d4e54c27a5471a47da61c61b-20220808 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=JVzzz8sgCrgJP0WzqZKy3JWRZEqvfb1phApGHmPVpOw=; b=h3/8hFiJeLrbxll3huA0BhMilbqqudCwdfUfo8p4N8mwOw60Hvi8CmDq8YF4frzlimgCZ1DCiY2dsyzekQYKQkNxUzSBZUyx1BLPHVLQdbDDjheBo8EWjnX68hzI+AHxZoLurd3eWeTBEq/cqRGobrnldTQPK0aXmo9bzQV//1A=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.8, REQID:9115940e-1dc0-4b54-aecd-283fbf940db3, OB:0, LO B:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,RULE:Release_Ham,ACTI ON:release,TS:0 X-CID-META: VersionHash:0f94e32, CLOUDID:74332aae-9535-44a6-aa9b-7f62b79b6ff6, C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil ,QS:nil,BEC:nil,COL:0 X-UUID: 39698b81d4e54c27a5471a47da61c61b-20220808 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1896846815; Mon, 08 Aug 2022 10:28:07 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Mon, 8 Aug 2022 10:28:06 +0800 Received: from mcddlt001.gcn.mediatek.inc (10.19.240.15) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Mon, 8 Aug 2022 10:28:05 +0800 Message-ID: <95d81ee79193a997ddcf2fcd529aa072ba2218b2.camel@mediatek.com> Subject: Re: [PATCH 06/31] net: mediatek: use a struct to cover variations of all SoCs From: Weijie Gao To: Simon Glass CC: U-Boot Mailing List , GSS_MTK_Uboot_upstream , Joe Hershberger , Ramon Fried Date: Mon, 8 Aug 2022 10:28:05 +0800 In-Reply-To: References: <1daf284821f5a3bc522646034792805b50a3b971.1659581119.git.weijie.gao@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On Thu, 2022-08-04 at 07:56 -0600, Simon Glass wrote: > Hi Weijie, > > On Wed, 3 Aug 2022 at 21:36, Weijie Gao > wrote: > > > > Using a single soc id to control different initialization and TX/RX > > flow > > for all SoCs is not extensible if more hardware variations are > > added in > > the future. > > > > This patch introduces a struct to replace the original mtk_soc to > > allow > > the driver be able handle newer hardwares. > > > > Signed-off-by: Weijie Gao > > --- > > drivers/net/mtk_eth.c | 50 +++++++++++++++++++++++++++++-------- > > ------ > > drivers/net/mtk_eth.h | 25 +++++++++++++++++++++- > > 2 files changed, 58 insertions(+), 17 deletions(-) > > Reviewed-by: Simon Glass > > > > > diff --git a/drivers/net/mtk_eth.c b/drivers/net/mtk_eth.c > > index 4fe7ee0d36..92d2ea4f2a 100644 > > --- a/drivers/net/mtk_eth.c > > +++ b/drivers/net/mtk_eth.c > > @@ -142,11 +142,9 @@ enum mtk_switch { > > SW_MT7531 > > }; > > > > -enum mtk_soc { > > - SOC_MT7623, > > - SOC_MT7629, > > - SOC_MT7622, > > - SOC_MT7621 > > +struct mtk_soc_data { > > + u32 caps; > > + u32 ana_rgc3; > > please comment these > [..] OK. > > Regards, > Simon