From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 56DDFA00C5; Mon, 15 Aug 2022 08:28:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 11FDB40143; Mon, 15 Aug 2022 08:28:58 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id ECA74400EF for ; Mon, 15 Aug 2022 08:28:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660544936; x=1692080936; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=zcRmckpT1iuC2izM9FQ7eDrN7+1Sb57gF/jfRoVAnsU=; b=Y5YOp/ZZZwnfiMaRJ97Kh+pKMSp6E7M03t9XXJgAGt5kI0MYgKBFV9Qr /rVTOdhETQwzG9MvTPhK2Tczfx3Cu/FkGjAwWJPQG6Q5bpgCg7JOoR6hX /hCt2EvrmaJDH35StqHmFuEfFQDXz7/ruRXouL+yFxt+tOqKT0SfWCMX4 OZsRlYnGfLWrZUBtTfrsWx0K0LrVsMyRo2RAPYGJKl82QlTWeyGCke/yI LDnRoUeb40fN1WOmGIoOf3s88ZnHQ1kO2pln/WbalaIBRxuY7vDjq6qkd 6h/0W+d9QC8j1EfV1wunkYUHBvUN51zhZFDifg4vQLkuwCaAXn18oKnAc g==; X-IronPort-AV: E=McAfee;i="6400,9594,10439"; a="317882248" X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="317882248" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2022 23:28:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="674741062" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga004.fm.intel.com with ESMTP; 14 Aug 2022 23:28:54 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sun, 14 Aug 2022 23:28:54 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28 via Frontend Transport; Sun, 14 Aug 2022 23:28:54 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.169) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.28; Sun, 14 Aug 2022 23:28:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TsqPh0Gcvbxpmp5aV73uAIYvyDX30ARpdM7+MVRWNXYsiHJ46xxmmsfluN34d/vswhOdjISosQwWtDiIjwaFQwfoRyT66NPMD/cJwLUiAkM719hPU59PPpP7QpY92+PtA2udbQxfOu5aSs3diBrm2ecbca/qEBx3R9044ymGEqeoUon6jUPMso43tNYChYXNgQ3EVe/dUunFNWmdSrppM90ZOOfDag9Atb9yaoZGpi2slE2xu6UVP0NFcty8R8cRUMmz7f1lD5jWbfXmbBt3xXso6lZcI5/4c86itLqDRrK6rGABmklpmjR2Wu6iQpwRag14wQMFFs5JwWYztyRmMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ord7YrCHl5eFjQZOWlIoYjREFrB1dfax6q3y4vOzGnQ=; b=DIz+77yO40BGyDjC9sSMJBwsVMYUfVKo8cl26ZnZZih3ReKAkj9FVrHnqBW/M9DbvNRM6GlICV9IUG6e5jgzIgkpugJlm/IzD+g9CtDIEAuRfEVvSIB93nWfSLNbawB3xSF299ECOIp2phPCmC685pe0Qnkoca6caBLRnWfqjs1UTC6dHvSDeMyjBYm6rYuJIMs/rdanWMRYluhNnx/hfJoZQengqCmcFKF4VOngzB5Ps9h7MfAPxerkRbplRUmVJDUHQrPOvHa8OHXg1EFLCj2H5n97WcShD11qrXCWzgmklaMre8ImKfb2psQ1qsrVw738bMMuvt48SrLTuEiIQg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MWHPR11MB1886.namprd11.prod.outlook.com (2603:10b6:300:110::9) by BY5PR11MB4321.namprd11.prod.outlook.com (2603:10b6:a03:1bf::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.10; Mon, 15 Aug 2022 06:28:51 +0000 Received: from MWHPR11MB1886.namprd11.prod.outlook.com ([fe80::c96d:8042:77d9:722a]) by MWHPR11MB1886.namprd11.prod.outlook.com ([fe80::c96d:8042:77d9:722a%12]) with mapi id 15.20.5504.028; Mon, 15 Aug 2022 06:28:51 +0000 From: "Yang, Qiming" To: "Zhang, Qi Z" CC: "dev@dpdk.org" , "Michalik, Michal" Subject: RE: [PATCH v2 01/70] net/ice/base: add netlist helper functions Thread-Topic: [PATCH v2 01/70] net/ice/base: add netlist helper functions Thread-Index: AQHYsDS0l/BqK8TGTEuviyEXlMXUFq2vf+sg Date: Mon, 15 Aug 2022 06:28:51 +0000 Message-ID: References: <20220815071306.2910599-1-qi.z.zhang@intel.com> <20220815073206.2917968-1-qi.z.zhang@intel.com> <20220815073206.2917968-2-qi.z.zhang@intel.com> In-Reply-To: <20220815073206.2917968-2-qi.z.zhang@intel.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.500.17 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 35d9b1e5-4362-498b-9a95-08da7e876b91 x-ms-traffictypediagnostic: BY5PR11MB4321:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: yfiBpVXzv2UO01GwFKSxiDkgVQ9cAJswOXnev8uYKTYflp6QcQtjl0IKcrT/bgJ8VCdRIx+hDpFiJ6tbrsOYwIFGg3xxOc8Y8iaqFHDIjUyh7bz+fda9KLtOfNMqGEHzgqx1w3LX1Ghkz58KmjCnyOA8SJ367KJ6XhYMo/NKuBkbEWVMck6tfG4nuVBadQRRPmFJ8psDJWtGmzfK0USijN2MkH3Sniyalwhi6FQofcHgFxTY0usOh1PbkIOheVuNo9NGBo5DWfm/1HvNfalGa8ch1hRB4RFHRnOolp74zxgwgJ90SwVCxhiAvW7Q4gFjcreNS1k7REZ3ElzQAjcHMZdV2HYF4R/ZiKlW96y73eudoRJjQJxzMoyrz7oK69qcQc5jhOrCufXv5/POce16pqZm/SDLaOnQfVH9cXQNX7H8CwxCQLDQoK0c1i4FyxKaS0KjcRKZwp8Wly07OYDrcS8F2uYAj8FERsPcQSWTCsAnJ+sSVgtE6xHft74I+Q90sP3rmKK2enxXabcSoJCamhcQ704uBceAzlb2oUUpYP/PxVtxQVkgt/QKdBRZMSepNeGFuS7fPdwL7HLpdqMaXF7BOsFk/5ZmiFnCB0nZKBLKQ98FtdHCBk5vd6RYvJNwiclsDwcQKULSp/if83tNpXprcl+zSpeF2TxyPTuWFAv/Au9iYzBMnhWvY9TNhoKtc33hozuiSlgTXEglbt1Vn42XviDE/q+voDYthURY72DRhq9pfbI3ZujQYZ9iRor5YFAoURRMW4GyLtUYJAntHUKp2NYPUZAz3zSs72lgz2AsyJ82kDDEZA7agFA1MI1d x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1886.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(346002)(136003)(396003)(366004)(39860400002)(376002)(186003)(9686003)(6506007)(26005)(53546011)(6636002)(54906003)(55016003)(7696005)(71200400001)(478600001)(316002)(41300700001)(82960400001)(38070700005)(122000001)(86362001)(38100700002)(6862004)(83380400001)(107886003)(30864003)(52536014)(8936002)(4326008)(66556008)(66446008)(2906002)(5660300002)(76116006)(8676002)(66476007)(64756008)(33656002)(66946007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?DpbHcv7BTBoCnQ4siXnmDyZrupPNN/+OGHGI9noB4PYbGSGnIn2vzPUDki55?= =?us-ascii?Q?dF3Q1IGDiAGhHORFdDO2UDlGuXyQo/OpA6M4oRXDml5ciSf0/M+H1KY9kxv6?= =?us-ascii?Q?o9iWqKBZgzTXyCU1Lru7IEbMXSEpwRBIuHxwzSEsuHK/fPpo+Zmw4lLwLeYP?= =?us-ascii?Q?ZYB9SV9W+y7S8MTIFL8UQw/1ME4Cv1xnPa1jrnLkVPXT37joLASuLBtrs5FG?= =?us-ascii?Q?KXNs1lWbPTniCwaTO+u+eZIhhJkfr7STYW9y5sy7TEPqrduxyJIBCygV3caN?= =?us-ascii?Q?3SzYcna73s4TpvoZzGo9Yx1QLAogvR7974djaoqtg4rpigzC6TdLxdX481iV?= =?us-ascii?Q?/erEQFJpRN+1g/IgzC3euVXyIUBQINY9YVA+q/nudzvC2RGaFGX+k/0r6esy?= =?us-ascii?Q?QRQcUqhl2OuOtId6XM3KaygWSS80y1w1l0TDnevImsScbx/FnM+JxwSX3tM0?= =?us-ascii?Q?XmGZZW4qjJ6mY0uOwZVdrDm0dBEIfRScVFiDP9XgAf40eg+pO63zQ2ZGZs+x?= =?us-ascii?Q?nEvrEOFl45bT9MzXWhQPII73lGCQH8P5Z/RSn/vkcFevI5fMSaa0VAAQaruD?= =?us-ascii?Q?ZJVyJ/HFzLEHvdDxQ/MxhQaU0FNEELF4JKOC44RF0IvBraH2H8tWwwMF+KwK?= =?us-ascii?Q?Sg5lKXS22GWxDrSPa9Rpv4nxCAmoE0OKdreIxEIA3bP8CpNj4s45AW7qvvfa?= =?us-ascii?Q?zPupP0ZW9SRmZgq4e6WRFRykaQP9sp78KmVTdk0Leu/132XsCipPvRB7bCU0?= =?us-ascii?Q?04eRTXWwLD50KVK+lwJJUti7piLC1LdVHopAWMNUk3ZAMUHbUhU1MDsrZqYx?= =?us-ascii?Q?Ryxk/v+6y5ODk4nVa/NpNY90JIjTw+4uu3dA24Ksphe+Qqyh/lxLZwJTy2vS?= =?us-ascii?Q?XpAPTHfVlRzOcIfAgW0g7mC5Xd/mUn7p+YInqPcuedtwQy9aSFTH/Bj17xQz?= =?us-ascii?Q?/rRdkPTGI4t6eX7oIlYU9HmkzCx5j2UsrlM2SQOsTNcecAC9ObnJdbHz7GUM?= =?us-ascii?Q?2Bl2eyD/Eb8HrehN6z+vsl9bv9fsvWFBnr2y6s9zrLuYoaanioLctUdZtYWI?= =?us-ascii?Q?2LPj1Lkbmgv+QvVxJ42Vn8UxpR0XoGHZhAKJLvSWGna3A+kgDCHUQMxk/QR/?= =?us-ascii?Q?LwrgDF257uJ//zjd6EceieV90TXhlnFHzrjyowaz5CxC0AbnXlHW2TKLRa0M?= =?us-ascii?Q?T/eMgEe6LF3QqxkVjBLKss/W5GCn42hUa8p+XFNLQtEhO5Q8vR9U1/Z9ipem?= =?us-ascii?Q?7CX2nF1yf5JoXyB7vik0SpfGpjtvB1+lR55FkmLWqRFRIaLouWVTNyurDUrf?= =?us-ascii?Q?tIEVme+Z2oqt2tqw4ujBWzS1FXWMUPLOhYFmxWkw1baa9EMXjOccNv/h/UwA?= =?us-ascii?Q?zJUURkzNlFaeCkFb1jXz2rRrhhTyMBFEfRt4MykredyXIOpqq62MOayjkk+M?= =?us-ascii?Q?0U24esL7VgIgFskGbWvDVD4e2gA3yisCUBuTIse5/bio5Ik2BddgIpnIlK8e?= =?us-ascii?Q?VhSTjJ8vaZjGOT+tyqR8JfhrrcoK96SBBVNS3dIlnMxeVWDr5bpyfePVnBEY?= =?us-ascii?Q?xmesjqLWo87vlkOe+m+jrTzuwCh5/KhBwnwb18Ig?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1886.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 35d9b1e5-4362-498b-9a95-08da7e876b91 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Aug 2022 06:28:51.6110 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 1Be3U+iEvcTku1Gp3xupYHI4LKvd5Czru/RVJmudYHQU8PgXA9JafhPD2mK3vKyZyxn/VGfVfpauQqke0tgD1w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4321 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi, > -----Original Message----- > From: Zhang, Qi Z > Sent: Monday, August 15, 2022 3:31 PM > To: Yang, Qiming > Cc: dev@dpdk.org; Zhang, Qi Z ; Michalik, Michal > > Subject: [PATCH v2 01/70] net/ice/base: add netlist helper functions >=20 > Add new functions to check in netlist if HW has: > - Recovered Clock device, > - Clock Generation Unit, > - Clock Multiplexer, > - GPS generic device. >=20 > Signed-off-by: Michal Michalik > Signed-off-by: Qi Zhang > --- > drivers/net/ice/base/ice_adminq_cmd.h | 54 +++++++++++ > drivers/net/ice/base/ice_common.c | 130 +++++++++++++++++++++----- > drivers/net/ice/base/ice_common.h | 10 ++ > drivers/net/ice/base/ice_ptp_hw.c | 37 +++++--- > drivers/net/ice/base/ice_ptp_hw.h | 1 + > 5 files changed, 195 insertions(+), 37 deletions(-) >=20 > diff --git a/drivers/net/ice/base/ice_adminq_cmd.h > b/drivers/net/ice/base/ice_adminq_cmd.h > index 253b971dfd..a3add411b8 100644 > --- a/drivers/net/ice/base/ice_adminq_cmd.h > +++ b/drivers/net/ice/base/ice_adminq_cmd.h > @@ -1635,6 +1635,7 @@ struct ice_aqc_link_topo_params { > #define ICE_AQC_LINK_TOPO_NODE_TYPE_CAGE 6 > #define ICE_AQC_LINK_TOPO_NODE_TYPE_MEZZ 7 > #define ICE_AQC_LINK_TOPO_NODE_TYPE_ID_EEPROM 8 > +#define ICE_AQC_LINK_TOPO_NODE_TYPE_GPS 11 > #define ICE_AQC_LINK_TOPO_NODE_CTX_S 4 > #define ICE_AQC_LINK_TOPO_NODE_CTX_M \ > (0xF << ICE_AQC_LINK_TOPO_NODE_CTX_S) > @@ -1672,9 +1673,61 @@ struct ice_aqc_get_link_topo { > struct ice_aqc_link_topo_addr addr; > u8 node_part_num; > #define ICE_ACQ_GET_LINK_TOPO_NODE_NR_PCA9575 0x21 > +#define ICE_ACQ_GET_LINK_TOPO_NODE_NR_GEN_GPS 0x48 > u8 rsvd[9]; > }; >=20 > +/* Get Link Topology Pin (direct, 0x06E1) */ struct > +ice_aqc_get_link_topo_pin { > + struct ice_aqc_link_topo_addr addr; > + u8 input_io_params; > +#define ICE_AQC_LINK_TOPO_INPUT_IO_FUNC_S 0 > +#define ICE_AQC_LINK_TOPO_INPUT_IO_FUNC_M \ > + (0x1F << > ICE_AQC_LINK_TOPO_INPUT_IO_FUNC_S) > +#define ICE_AQC_LINK_TOPO_IO_FUNC_GPIO 0 > +#define ICE_AQC_LINK_TOPO_IO_FUNC_RESET_N 1 > +#define ICE_AQC_LINK_TOPO_IO_FUNC_INT_N 2 > +#define ICE_AQC_LINK_TOPO_IO_FUNC_PRESENT_N 3 > +#define ICE_AQC_LINK_TOPO_IO_FUNC_TX_DIS 4 > +#define ICE_AQC_LINK_TOPO_IO_FUNC_MODSEL_N 5 > +#define ICE_AQC_LINK_TOPO_IO_FUNC_LPMODE 6 > +#define ICE_AQC_LINK_TOPO_IO_FUNC_TX_FAULT 7 > +#define ICE_AQC_LINK_TOPO_IO_FUNC_RX_LOSS 8 > +#define ICE_AQC_LINK_TOPO_IO_FUNC_RS0 9 > +#define ICE_AQC_LINK_TOPO_IO_FUNC_RS1 10 > +#define ICE_AQC_LINK_TOPO_IO_FUNC_EEPROM_WP 11 > +/* 12 repeats intentionally due to two different uses depending on > context */ > +#define ICE_AQC_LINK_TOPO_IO_FUNC_LED 12 > +#define ICE_AQC_LINK_TOPO_IO_FUNC_RED_LED 12 > +#define ICE_AQC_LINK_TOPO_IO_FUNC_GREEN_LED 13 > +#define ICE_AQC_LINK_TOPO_IO_FUNC_BLUE_LED 14 > +#define ICE_AQC_LINK_TOPO_INPUT_IO_TYPE_S 5 > +#define ICE_AQC_LINK_TOPO_INPUT_IO_TYPE_M \ > + (0x7 << ICE_AQC_LINK_TOPO_INPUT_IO_TYPE_S) > +#define ICE_AQC_LINK_TOPO_INPUT_IO_TYPE_GPIO 3 > +/* Use ICE_AQC_LINK_TOPO_NODE_TYPE_* for the type values */ > + u8 output_io_params; > +#define ICE_AQC_LINK_TOPO_OUTPUT_IO_FUNC_S 0 > +#define ICE_AQC_LINK_TOPO_OUTPUT_IO_FUNC_M \ > + (0x1F << \ > ICE_AQC_LINK_TOPO_INPUT_IO_FUNC_NUM_S) > +/* Use ICE_AQC_LINK_TOPO_IO_FUNC_* for the non-numerical options */ > +#define ICE_AQC_LINK_TOPO_OUTPUT_IO_TYPE_S 5 > +#define ICE_AQC_LINK_TOPO_OUTPUT_IO_TYPE_M \ > + (0x7 << ICE_AQC_LINK_TOPO_INPUT_IO_TYPE_S) > +/* Use ICE_AQC_LINK_TOPO_NODE_TYPE_* for the type values */ > + u8 output_io_flags; > +#define ICE_AQC_LINK_TOPO_OUTPUT_SPEED_S 0 > +#define ICE_AQC_LINK_TOPO_OUTPUT_SPEED_M \ > + (0x7 << ICE_AQC_LINK_TOPO_OUTPUT_SPEED_S) > +#define ICE_AQC_LINK_TOPO_OUTPUT_INT_S 3 > +#define ICE_AQC_LINK_TOPO_OUTPUT_INT_M \ > + (0x3 << ICE_AQC_LINK_TOPO_OUTPUT_INT_S) > +#define ICE_AQC_LINK_TOPO_OUTPUT_POLARITY BIT(5) > +#define ICE_AQC_LINK_TOPO_OUTPUT_VALUE BIT(6) > +#define ICE_AQC_LINK_TOPO_OUTPUT_DRIVEN BIT(7) > + u8 rsvd[7]; > +}; > + > /* Read/Write I2C (direct, 0x06E2/0x06E3) */ struct ice_aqc_i2c { > struct ice_aqc_link_topo_addr topo_addr; @@ -2936,6 +2989,7 @@ > struct ice_aq_desc { > struct ice_aqc_get_link_status get_link_status; > struct ice_aqc_event_lan_overflow lan_overflow; > struct ice_aqc_get_link_topo get_link_topo; > + struct ice_aqc_get_link_topo_pin get_link_topo_pin; > struct ice_aqc_set_health_status_config > set_health_status_config; > struct ice_aqc_get_supported_health_status_codes > diff --git a/drivers/net/ice/base/ice_common.c > b/drivers/net/ice/base/ice_common.c > index db87bacd97..edc24030ec 100644 > --- a/drivers/net/ice/base/ice_common.c > +++ b/drivers/net/ice/base/ice_common.c > @@ -396,37 +396,103 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, > bool qual_mods, u8 report_mode, } >=20 > /** > - * ice_aq_get_link_topo_handle - get link topology node return status > - * @pi: port information structure > - * @node_type: requested node type > - * @cd: pointer to command details structure or NULL > - * > - * Get link topology node return status for specified node type (0x06E0) > - * > - * Node type cage can be used to determine if cage is present. If AQC > - * returns error (ENOENT), then no cage present. If no cage present, the= n > - * connection type is backplane or BASE-T. > + * ice_aq_get_netlist_node_pin > + * @hw: pointer to the hw struct > + * @cmd: get_link_topo_pin AQ structure > + * @node_handle: output node handle parameter if node found > */ > -static enum ice_status > -ice_aq_get_link_topo_handle(struct ice_port_info *pi, u8 node_type, > - struct ice_sq_cd *cd) > +enum ice_status > +ice_aq_get_netlist_node_pin(struct ice_hw *hw, > + struct ice_aqc_get_link_topo_pin *cmd, > + u16 *node_handle) > { > - struct ice_aqc_get_link_topo *cmd; > struct ice_aq_desc desc; >=20 > - cmd =3D &desc.params.get_link_topo; > + ice_fill_dflt_direct_cmd_desc(&desc, > ice_aqc_opc_get_link_topo_pin); > + desc.params.get_link_topo_pin =3D *cmd; > + > + if (ice_aq_send_cmd(hw, &desc, NULL, 0, NULL)) > + return ICE_ERR_NOT_SUPPORTED; > + > + if (node_handle) > + *node_handle =3D > + > LE16_TO_CPU(desc.params.get_link_topo_pin.addr.handle); > + > + return ICE_SUCCESS; > +} > + > +/** > + * ice_aq_get_netlist_node > + * @hw: pointer to the hw struct > + * @cmd: get_link_topo AQ structure > + * @node_part_number: output node part number if node found > + * @node_handle: output node handle parameter if node found */ enum > +ice_status ice_aq_get_netlist_node(struct ice_hw *hw, struct > +ice_aqc_get_link_topo *cmd, > + u8 *node_part_number, u16 *node_handle) { > + struct ice_aq_desc desc; >=20 > ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_link_topo); > + desc.params.get_link_topo =3D *cmd; >=20 > - cmd->addr.topo_params.node_type_ctx =3D > - (ICE_AQC_LINK_TOPO_NODE_CTX_PORT << > - ICE_AQC_LINK_TOPO_NODE_CTX_S); > + if (ice_aq_send_cmd(hw, &desc, NULL, 0, NULL)) > + return ICE_ERR_NOT_SUPPORTED; >=20 > - /* set node type */ > - cmd->addr.topo_params.node_type_ctx |=3D > - (ICE_AQC_LINK_TOPO_NODE_TYPE_M & node_type); > + if (node_handle) > + *node_handle =3D > + > LE16_TO_CPU(desc.params.get_link_topo.addr.handle); > + if (node_part_number) > + *node_part_number =3D > desc.params.get_link_topo.node_part_num; >=20 > - return ice_aq_send_cmd(pi->hw, &desc, NULL, 0, cd); > + return ICE_SUCCESS; > +} > + > +#define MAX_NETLIST_SIZE 10 > +/** > + * ice_find_netlist_node > + * @hw: pointer to the hw struct > + * @node_type_ctx: type of netlist node to look for > + * @node_part_number: node part number to look for > + * @node_handle: output parameter if node found - optional > + * > + * Find and return the node handle for a given node type and part > +number in the > + * netlist. When found ICE_SUCCESS is returned, > ICE_ERR_DOES_NOT_EXIST > + * otherwise. If node_handle provided, it would be set to found node > handle. > + */ > +enum ice_status > +ice_find_netlist_node(struct ice_hw *hw, u8 node_type_ctx, u8 > node_part_number, > + u16 *node_handle) > +{ > + struct ice_aqc_get_link_topo cmd; > + u8 rec_node_part_number; > + u16 rec_node_handle; > + u8 idx; > + > + for (idx =3D 0; idx < MAX_NETLIST_SIZE; idx++) { > + enum ice_status status; > + > + memset(&cmd, 0, sizeof(cmd)); > + > + cmd.addr.topo_params.node_type_ctx =3D > + (node_type_ctx << > ICE_AQC_LINK_TOPO_NODE_TYPE_S); > + cmd.addr.topo_params.index =3D idx; > + > + status =3D ice_aq_get_netlist_node(hw, &cmd, > + &rec_node_part_number, > + &rec_node_handle); > + if (status) > + return status; > + > + if (rec_node_part_number =3D=3D node_part_number) { > + if (node_handle) > + *node_handle =3D rec_node_handle; > + return ICE_SUCCESS; > + } > + } > + > + return ICE_ERR_DOES_NOT_EXIST; > } >=20 > /** > @@ -438,13 +504,27 @@ ice_aq_get_link_topo_handle(struct ice_port_info > *pi, u8 node_type, > */ > static bool ice_is_media_cage_present(struct ice_port_info *pi) { > + struct ice_aqc_get_link_topo *cmd; > + struct ice_aq_desc desc; > + > + cmd =3D &desc.params.get_link_topo; > + > + ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_link_topo); > + > + cmd->addr.topo_params.node_type_ctx =3D > + (ICE_AQC_LINK_TOPO_NODE_CTX_PORT << > + ICE_AQC_LINK_TOPO_NODE_CTX_S); > + > + /* set node type */ > + cmd->addr.topo_params.node_type_ctx |=3D > + (ICE_AQC_LINK_TOPO_NODE_TYPE_M & > + ICE_AQC_LINK_TOPO_NODE_TYPE_CAGE); > + > /* Node type cage can be used to determine if cage is present. If > AQC > * returns error (ENOENT), then no cage present. If no cage present > then > * connection type is backplane or BASE-T. > */ > - return !ice_aq_get_link_topo_handle(pi, > - > ICE_AQC_LINK_TOPO_NODE_TYPE_CAGE, > - NULL); > + return ice_aq_get_netlist_node(pi->hw, cmd, NULL, NULL); > } >=20 > /** > diff --git a/drivers/net/ice/base/ice_common.h > b/drivers/net/ice/base/ice_common.h > index a3cbf4fb05..1044a3088e 100644 > --- a/drivers/net/ice/base/ice_common.h > +++ b/drivers/net/ice/base/ice_common.h > @@ -145,6 +145,16 @@ enum ice_status > ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 > report_mode, > struct ice_aqc_get_phy_caps_data *caps, > struct ice_sq_cd *cd); > +enum ice_status > +ice_aq_get_netlist_node_pin(struct ice_hw *hw, > + struct ice_aqc_get_link_topo_pin *cmd, > + u16 *node_handle); > +enum ice_status > +ice_aq_get_netlist_node(struct ice_hw *hw, struct ice_aqc_get_link_topo > *cmd, > + u8 *node_part_number, u16 *node_handle); enum > ice_status > +ice_find_netlist_node(struct ice_hw *hw, u8 node_type_ctx, u8 > node_part_number, > + u16 *node_handle); > void > ice_update_phy_type(u64 *phy_type_low, u64 *phy_type_high, > u16 link_speeds_bitmap); > diff --git a/drivers/net/ice/base/ice_ptp_hw.c > b/drivers/net/ice/base/ice_ptp_hw.c > index 7e797c9511..5b366c95c5 100644 > --- a/drivers/net/ice/base/ice_ptp_hw.c > +++ b/drivers/net/ice/base/ice_ptp_hw.c > @@ -3095,10 +3095,10 @@ ice_ptp_port_cmd_e810(struct ice_hw *hw, > enum ice_ptp_tmr_cmd cmd, static enum ice_status > ice_get_pca9575_handle(struct ice_hw *hw, __le16 *pca9575_handle) { > - struct ice_aqc_get_link_topo *cmd; > - struct ice_aq_desc desc; > + struct ice_aqc_get_link_topo cmd; > + u8 node_part_number, idx; > enum ice_status status; > - u8 idx; > + u16 node_handle; >=20 > if (!hw || !pca9575_handle) > return ICE_ERR_PARAM; > @@ -3109,12 +3109,10 @@ ice_get_pca9575_handle(struct ice_hw *hw, > __le16 *pca9575_handle) > return ICE_SUCCESS; > } >=20 > - /* If handle was not detected read it from the netlist */ > - cmd =3D &desc.params.get_link_topo; > - ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_link_topo); > + memset(&cmd, 0, sizeof(cmd)); >=20 > /* Set node type to GPIO controller */ > - cmd->addr.topo_params.node_type_ctx =3D > + cmd.addr.topo_params.node_type_ctx =3D > (ICE_AQC_LINK_TOPO_NODE_TYPE_M & > ICE_AQC_LINK_TOPO_NODE_TYPE_GPIO_CTRL); >=20 > @@ -3129,24 +3127,39 @@ ice_get_pca9575_handle(struct ice_hw *hw, > __le16 *pca9575_handle) > else > return ICE_ERR_NOT_SUPPORTED; >=20 > - cmd->addr.topo_params.index =3D idx; > + cmd.addr.topo_params.index =3D idx; >=20 > - status =3D ice_aq_send_cmd(hw, &desc, NULL, 0, NULL); > + status =3D ice_aq_get_netlist_node(hw, &cmd, &node_part_number, > + &node_handle); > if (status) > return ICE_ERR_NOT_SUPPORTED; >=20 > /* Verify if we found the right IO expander type */ > - if (desc.params.get_link_topo.node_part_num !=3D > - ICE_ACQ_GET_LINK_TOPO_NODE_NR_PCA9575) > + if (node_part_number !=3D > ICE_ACQ_GET_LINK_TOPO_NODE_NR_PCA9575) > return ICE_ERR_NOT_SUPPORTED; >=20 > /* If present save the handle and return it */ > - hw->io_expander_handle =3D desc.params.get_link_topo.addr.handle; > + hw->io_expander_handle =3D node_handle; > *pca9575_handle =3D hw->io_expander_handle; >=20 > return ICE_SUCCESS; > } >=20 > +/** > + * ice_is_gps_present_e810t > + * @hw: pointer to the hw struct > + * > + * Check if the GPS generic device is present in the netlist */ bool > +ice_is_gps_present_e810t(struct ice_hw *hw) { > + if (ice_find_netlist_node(hw, ICE_AQC_LINK_TOPO_NODE_TYPE_GPS, > + > ICE_ACQ_GET_LINK_TOPO_NODE_NR_GEN_GPS, NULL)) > + return false; > + > + return true; > +} > + > /** > * ice_read_e810t_pca9575_reg > * @hw: pointer to the hw struct > diff --git a/drivers/net/ice/base/ice_ptp_hw.h > b/drivers/net/ice/base/ice_ptp_hw.h > index ee3366e83c..4f349593aa 100644 > --- a/drivers/net/ice/base/ice_ptp_hw.h > +++ b/drivers/net/ice/base/ice_ptp_hw.h > @@ -221,6 +221,7 @@ enum ice_status ice_phy_cfg_rx_offset_e822(struct > ice_hw *hw, u8 port); enum ice_status ice_phy_exit_bypass_e822(struct > ice_hw *hw, u8 port); >=20 > /* E810 family functions */ > +bool ice_is_gps_present_e810t(struct ice_hw *hw); > enum ice_status ice_ptp_init_phy_e810(struct ice_hw *hw); enum > ice_status ice_read_e810t_pca9575_reg(struct ice_hw *hw, u8 offset, u8 > *data); > -- > 2.31.1 Patch 01~12 Acked-by: Qiming Yang