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 E2417425C9; Mon, 18 Sep 2023 04:48:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 32060410EE; Mon, 18 Sep 2023 04:47:40 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2104.outbound.protection.outlook.com [40.107.244.104]) by mails.dpdk.org (Postfix) with ESMTP id 440A0406B6 for ; Mon, 18 Sep 2023 04:47:34 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jNudfTBTVYCwKzIramuCOZgd+wFfK5VYCLa6gEEkyctPe3tITg2TdfoaJNYt3hL49ZcyIyKa+y/AJrke6/oRVYwPCPjp3+PWZ/gzIZtR641sJYMLiQ+nZ85M+Srsq3my+jxjUZ7z5ZkPM6j7mI21HXb9+5YQ2JTIgdZktYBg4he9/ahRR1NwO8MaYxa6N486KMXfFE1jNnUJbOIKpyE635vKnslfDAOcoTmYxsuFPl50iBhLpAwSNEB8IoyolcJonmt8f8CV2JIC9dtlJcOvMB2oSQP2LJuJGsCj1CRXF3L3q5X5y0yip+2gyAieSxBmcs5iY7O0x/FMhsJw6pbX4A== 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=iFBLGRqxQPGyfRCx7SSgwF7jhSgNxLPpetz+N024eXs=; b=AIZDs1XPhvu3emqeuroV8aAQlybkJ36F37pOxRPxItoFAQR86zy73uDhJpmMfLPBz+ihJMradL2uNQYjW2IIIH7408CchpL5dELjpzqYMzU+3u1z796ypDa90tR/fpQ/x93zG9iHFP9zbbkouKESbhG7CugF+QL9hHa45s1pKXm5+O8QxVKYxrZtqBxIrH+4maN6TSE88hHlB2rAO4uTB9pFCFX7D56iR+fywdvZcS9l2/IcK2m80DAjQN4N0hq6SMAiJGsCXt9oobs7s4EOMRKhiPKQ/1CX7QVvi1Tfku50D5ju21MKFc5XWOqme+aWe3kfT+1eNYDMTup2D9dXTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iFBLGRqxQPGyfRCx7SSgwF7jhSgNxLPpetz+N024eXs=; b=Ip60F4S3czNklOwmqvTkd2dGaJvafHvtEWUqXAli+dj9vdlLQFZIfDUiEd7QEgbdtCGn8JfPlehr9S7siQfMxJESfse/01FkblLL463WXcF8NrLWxCtQV1deWkBEmsZfcYP1dMnuF6ITJnQcZ96Ic7m0DtTxQY+JAXWlCh1Stp8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by PH7PR13MB6435.namprd13.prod.outlook.com (2603:10b6:510:2ea::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.26; Mon, 18 Sep 2023 02:47:32 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::7a1c:2887:348a:84bd]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::7a1c:2887:348a:84bd%6]) with mapi id 15.20.6792.026; Mon, 18 Sep 2023 02:47:32 +0000 From: Chaoyong He To: dev@dpdk.org Cc: Chaoyong He , =?UTF-8?q?Niklas=20S=C3=B6derlund?= Subject: [PATCH v4 12/26] net/nfp: refact the nffw module Date: Mon, 18 Sep 2023 10:45:58 +0800 Message-Id: <20230918024612.1600536-13-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230918024612.1600536-1-chaoyong.he@corigine.com> References: <20230915091551.1459606-1-chaoyong.he@corigine.com> <20230918024612.1600536-1-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SE2P216CA0016.KORP216.PROD.OUTLOOK.COM (2603:1096:101:114::20) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH7PR13MB6435:EE_ X-MS-Office365-Filtering-Correlation-Id: fddd9042-9411-4f6f-57d0-08dbb7f19b6d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EV0/pEmlm7s9eOeI2vug/kx2KzQaPkrm+BCBGoXzAeYET09uAHJJQW5ekNGWTDhKg6F5/5N1OMd8OuQoQwpza0op9KfzQDLMZ5yzyOixSCDYQ9rtcMZECBwRaxJIxjnc0+Ib2cTkEwutRR3B1QzAUpiOIGSPEBBybjgDo9ptzxe1a4t2JtlXdDD8uKI52uqxG7MSsmYt1TMyeCdU9IzgjRJGKoHfCdTsBECLsYPLMbDwLbx/d8Zeoyh2nu65QIoykBniGr5psnnhu/PlvfHJiC6ZQYty0y0X/CF7pb6oa9mxeoyHmTEpEJEx/ConA93d2lF98MlEP8xWsD1kjTf+M/8LHvOpuZL/ZMs+Sp6rl3YPjXTKE5y8REbfwnrHdvBXIbhz8NapeNnWbtJfh+jGPerb7foJ0BpvBiUNknkdkDBzBTQfi3VuuQWJ+l8vHwvdGo535j2AVZBMlt6KCUZ5N7wRuUYgdV59kEf0F1IjYjbvpoUOJMIOHngbNocdwjH/RlxxXX/7todG1KECGkKRO45/zcaF48yu9bVZe5F30VU7lzW6L8sA/mOCBoq0iCAWnu0Z0CXOo5mJptqIvEefxAjqXAm4DLMWFsIkV6LFbrs6NFB6/tZvY2CB+rl4XKU2PY+V47ojsX/LN3PwPswoXS/CdHJb1CbCbSTL1X6mxeo= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(39830400003)(136003)(346002)(366004)(376002)(396003)(1800799009)(451199024)(186009)(54906003)(66476007)(66946007)(66574015)(41300700001)(6916009)(316002)(8676002)(4326008)(8936002)(52116002)(6506007)(6486002)(6512007)(478600001)(6666004)(83380400001)(26005)(1076003)(2616005)(107886003)(86362001)(2906002)(44832011)(38100700002)(38350700002)(5660300002)(36756003)(66556008); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZGZvM3B6SERGSHZjWWNud0ZnWHlFcENSV2pTNDJteGNrK0VRU3VIRG5qOW5W?= =?utf-8?B?OTlMQUx2Rk9EUk1ER3l1RmtGZ3FhdEx6MEZISXJsVUZYK0RTdGlMRkNzRzc5?= =?utf-8?B?OUdvYndaM1FXM3pRb2dsRTlGWncxbmxOQXgzWG5RUzllSGZGK2FpYWgrakRn?= =?utf-8?B?d3REay8xMFJGbVhHTW8vREk0WTh4MVAyY1NmTXdzWVdESkg3UG1NZ3ZCeXN1?= =?utf-8?B?U1dZbk15b1FnaW90ZXhjRXhsdXJBektMTytRbmxuUk1ZTDR3aXBTZWM5cHNZ?= =?utf-8?B?cmYzRy9OSmJvVjZ6VmJnZ1pWeGswZUhrbHYvd1ZMckZTMlgvWDQyTnd6VDg2?= =?utf-8?B?WXRUY1VSd1YwMkRCQzBMZm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=?utf-8?B?TkE9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: fddd9042-9411-4f6f-57d0-08dbb7f19b6d X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2023 02:47:32.7497 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4zuOzHGfHQ0r0mi2WaYt7zj6h4Z8pA5xVbvsx3oa3pO7k8wzKs0kmRyB4VRtYzv6UOFUeM2PuZATT2UBhxAOeQwnRFreH7gtGMpFMW1dmqo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB6435 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 Move the definition of data structure and macro into the implement file. Also sync the logic from kernel driver and remove the unneeded header file include statements. Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- drivers/net/nfp/nfpcore/nfp_mip.h | 4 +- drivers/net/nfp/nfpcore/nfp_nffw.c | 105 +++++++++++++++++++---------- drivers/net/nfp/nfpcore/nfp_nffw.h | 66 +----------------- 3 files changed, 72 insertions(+), 103 deletions(-) diff --git a/drivers/net/nfp/nfpcore/nfp_mip.h b/drivers/net/nfp/nfpcore/nfp_mip.h index 7fa09ee575..dbd9af31ed 100644 --- a/drivers/net/nfp/nfpcore/nfp_mip.h +++ b/drivers/net/nfp/nfpcore/nfp_mip.h @@ -6,7 +6,7 @@ #ifndef __NFP_MIP_H__ #define __NFP_MIP_H__ -#include "nfp_nffw.h" +#include "nfp_cpp.h" struct nfp_mip; @@ -16,7 +16,5 @@ void nfp_mip_close(struct nfp_mip *mip); const char *nfp_mip_name(const struct nfp_mip *mip); void nfp_mip_symtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size); void nfp_mip_strtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size); -int nfp_nffw_info_mip_first(struct nfp_nffw_info *state, uint32_t *cpp_id, - uint64_t *offset); #endif /* __NFP_MIP_H__ */ diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.c b/drivers/net/nfp/nfpcore/nfp_nffw.c index df6292e909..2f07fcd6c1 100644 --- a/drivers/net/nfp/nfpcore/nfp_nffw.c +++ b/drivers/net/nfp/nfpcore/nfp_nffw.c @@ -3,12 +3,76 @@ * All rights reserved. */ -#include "../nfp_logs.h" -#include "nfp_cpp.h" #include "nfp_nffw.h" + +#include "../nfp_logs.h" #include "nfp_mip.h" -#include "nfp6000/nfp6000.h" #include "nfp_resource.h" +#include "nfp6000/nfp6000.h" + +/* + * Init-CSR owner IDs for firmware map to firmware IDs which start at 4. + * Lower IDs are reserved for target and loader IDs. + */ +#define NFFW_FWID_EXT 3 /* For active MEs that we didn't load. */ +#define NFFW_FWID_BASE 4 + +#define NFFW_FWID_ALL 255 + +/* + * NFFW_INFO_VERSION history: + * 0: This was never actually used (before versioning), but it refers to + * the previous struct which had FWINFO_CNT = MEINFO_CNT = 120 that later + * changed to 200. + * 1: First versioned struct, with + * FWINFO_CNT = 120 + * MEINFO_CNT = 120 + * 2: FWINFO_CNT = 200 + * MEINFO_CNT = 200 + */ +#define NFFW_INFO_VERSION_CURRENT 2 + +/* Enough for all current chip families */ +#define NFFW_MEINFO_CNT_V1 120 +#define NFFW_FWINFO_CNT_V1 120 +#define NFFW_MEINFO_CNT_V2 200 +#define NFFW_FWINFO_CNT_V2 200 + +/* nfp.nffw meinfo */ +struct nffw_meinfo { + uint32_t ctxmask_fwid_meid; +}; + +struct nffw_fwinfo { + uint32_t loaded_mu_da_mip_off_hi; + uint32_t mip_cppid; /**< 0 means no MIP */ + uint32_t mip_offset_lo; +}; + +struct nfp_nffw_info_v1 { + struct nffw_meinfo meinfo[NFFW_MEINFO_CNT_V1]; + struct nffw_fwinfo fwinfo[NFFW_FWINFO_CNT_V1]; +}; + +struct nfp_nffw_info_v2 { + struct nffw_meinfo meinfo[NFFW_MEINFO_CNT_V2]; + struct nffw_fwinfo fwinfo[NFFW_FWINFO_CNT_V2]; +}; + +struct nfp_nffw_info_data { + uint32_t flags[2]; + union { + struct nfp_nffw_info_v1 v1; + struct nfp_nffw_info_v2 v2; + } info; +}; + +struct nfp_nffw_info { + struct nfp_cpp *cpp; + struct nfp_resource *res; + + struct nfp_nffw_info_data fwinf; +}; /* * flg_info_version = flags[0]<27:16> @@ -61,32 +125,6 @@ nffw_fwinfo_mip_offset_get(const struct nffw_fwinfo *fi) return (mip_off_hi & 0xFF) << 32 | fi->mip_offset_lo; } -#define NFP_IMB_TGTADDRESSMODECFG_MODE_of(_x) (((_x) >> 13) & 0x7) -#define NFP_IMB_TGTADDRESSMODECFG_ADDRMODE RTE_BIT32(12) -#define NFP_IMB_TGTADDRESSMODECFG_ADDRMODE_32_BIT 0 -#define NFP_IMB_TGTADDRESSMODECFG_ADDRMODE_40_BIT RTE_BIT32(12) - -static int -nfp_mip_mu_locality_lsb(struct nfp_cpp *cpp) -{ - int err; - uint32_t mode; - uint32_t addr40; - uint32_t xpbaddr; - uint32_t imbcppat; - - /* Hardcoded XPB IMB Base, island 0 */ - xpbaddr = 0x000a0000 + NFP_CPP_TARGET_MU * 4; - err = nfp_xpb_readl(cpp, xpbaddr, &imbcppat); - if (err < 0) - return err; - - mode = NFP_IMB_TGTADDRESSMODECFG_MODE_of(imbcppat); - addr40 = !!(imbcppat & NFP_IMB_TGTADDRESSMODECFG_ADDRMODE); - - return nfp_cppat_mu_locality_lsb(mode, addr40); -} - static uint32_t nffw_res_fwinfos(struct nfp_nffw_info_data *fwinf, struct nffw_fwinfo **arr) @@ -239,14 +277,7 @@ nfp_nffw_info_mip_first(struct nfp_nffw_info *state, *offset = nffw_fwinfo_mip_offset_get(fwinfo); if (nffw_fwinfo_mip_mu_da_get(fwinfo) != 0) { - int locality_off; - - if (NFP_CPP_ID_TARGET_of(*cpp_id) != NFP_CPP_TARGET_MU) - return 0; - - locality_off = nfp_mip_mu_locality_lsb(state->cpp); - if (locality_off < 0) - return locality_off; + int locality_off = nfp_cpp_mu_locality_lsb(state->cpp); *offset &= ~(NFP_MU_ADDR_ACCESS_TYPE_MASK << locality_off); *offset |= NFP_MU_ADDR_ACCESS_TYPE_DIRECT << locality_off; diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.h b/drivers/net/nfp/nfpcore/nfp_nffw.h index 52e25c090a..fd46009d37 100644 --- a/drivers/net/nfp/nfpcore/nfp_nffw.h +++ b/drivers/net/nfp/nfpcore/nfp_nffw.h @@ -8,71 +8,11 @@ #include "nfp_cpp.h" -/* - * Init-CSR owner IDs for firmware map to firmware IDs which start at 4. - * Lower IDs are reserved for target and loader IDs. - */ -#define NFFW_FWID_EXT 3 /* For active MEs that we didn't load. */ -#define NFFW_FWID_BASE 4 - -#define NFFW_FWID_ALL 255 - -/* - * NFFW_INFO_VERSION history: - * 0: This was never actually used (before versioning), but it refers to - * the previous struct which had FWINFO_CNT = MEINFO_CNT = 120 that later - * changed to 200. - * 1: First versioned struct, with - * FWINFO_CNT = 120 - * MEINFO_CNT = 120 - * 2: FWINFO_CNT = 200 - * MEINFO_CNT = 200 - */ -#define NFFW_INFO_VERSION_CURRENT 2 - -/* Enough for all current chip families */ -#define NFFW_MEINFO_CNT_V1 120 -#define NFFW_FWINFO_CNT_V1 120 -#define NFFW_MEINFO_CNT_V2 200 -#define NFFW_FWINFO_CNT_V2 200 - -/* nfp.nffw meinfo */ -struct nffw_meinfo { - uint32_t ctxmask_fwid_meid; -}; - -struct nffw_fwinfo { - uint32_t loaded_mu_da_mip_off_hi; - uint32_t mip_cppid; /* 0 means no MIP */ - uint32_t mip_offset_lo; -}; - -struct nfp_nffw_info_v1 { - struct nffw_meinfo meinfo[NFFW_MEINFO_CNT_V1]; - struct nffw_fwinfo fwinfo[NFFW_FWINFO_CNT_V1]; -}; - -struct nfp_nffw_info_v2 { - struct nffw_meinfo meinfo[NFFW_MEINFO_CNT_V2]; - struct nffw_fwinfo fwinfo[NFFW_FWINFO_CNT_V2]; -}; - -struct nfp_nffw_info_data { - uint32_t flags[2]; - union { - struct nfp_nffw_info_v1 v1; - struct nfp_nffw_info_v2 v2; - } info; -}; - -struct nfp_nffw_info { - struct nfp_cpp *cpp; - struct nfp_resource *res; - - struct nfp_nffw_info_data fwinf; -}; +struct nfp_nffw_info; struct nfp_nffw_info *nfp_nffw_info_open(struct nfp_cpp *cpp); void nfp_nffw_info_close(struct nfp_nffw_info *state); +int nfp_nffw_info_mip_first(struct nfp_nffw_info *state, uint32_t *cpp_id, + uint64_t *offset); #endif /* __NFP_NFFW_H__ */ -- 2.39.1