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 CD26C430EF; Thu, 24 Aug 2023 13:12:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8CDAB432AB; Thu, 24 Aug 2023 13:11:13 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2133.outbound.protection.outlook.com [40.107.93.133]) by mails.dpdk.org (Postfix) with ESMTP id 364444326D for ; Thu, 24 Aug 2023 13:11:11 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jBOSbCxKGfMirU6oa/ZRDb8yhrng/7PAlZGYVnZQGthZ66cYy8Keoqwm49HXpTVWBe+z0go/nLjuqyegJlHDGmT3qNI/JMyvv6w0VEsnL1SquJMMhxgS+7zmSnif0xiL8D9wb2avbPQcNttOst8NJzBzbgeFg21kV/VjQmr2VNMIY4xcWjj1yTgaMkEvRj+c+e7RZhiNlBPT7Xon0Tnv7ZZNeNMsNjHTLOaMaWVT2V+7ewRRy4ogtda8yeqasovmTc1JkQA2lGYPVieGODSpGboX9kg+nyXAaGj0zYDjyITbyaLtoS6soH/bXsTGUXPgOlbyeapm+l5FE5Lsyp0eVQ== 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=wYci63y3qVXDFD7YNNplZ+coGeGQ2oodavJXdk/t9jw=; b=fYdnRSDUZ+Qx7yPyQkGk43pIFy7cBaVlRbZHPbHKcSVDdxBVqKzEQ4mOmlThiwS8sVwfFdQT/datB0pqh04Nhj5YyDj3SnAS/6cnHVaWqkIFFYbjf65vIn9GGBejQyLJQPo7Y9pRe5RoZbW02/3efnmBAf9eqCeAYbDYpwXBPabPsWLZlGbXaYnqFNZXrP1cCnGUNn+hWWGTlESC1RW5DGT0uOu9bdfYOfL/2OokBqCu+I45KtRYnrBWY9g3q60ccDFuismMDnFGg2rQC9eyn/fN1iTKlYCP5/c2WyV9HBToK6N8cTaHacImtZ1hbxx3Td2IW96+ymMMwSENnzRmSg== 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=wYci63y3qVXDFD7YNNplZ+coGeGQ2oodavJXdk/t9jw=; b=WUtRiMZB5pOKWo+8kl4d0/u6fQHaGWxugE9fgrMYc1AiM2dsgd5n4uSh1gomKO6/5ayMTOFchhyGNeI4FZUCVfhtxTqLIPt+/xrKMvxBEAaeVkSPEvtdI++NxPjV6lcpE4W9Zs/Hm69M74U6i1fcWYBgBglH8opRTjQaj9L+xyo= 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 PH7PR13MB6116.namprd13.prod.outlook.com (2603:10b6:510:2b7::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20; Thu, 24 Aug 2023 11:11:09 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::51fe:5846:af8b:bace]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::51fe:5846:af8b:bace%3]) with mapi id 15.20.6699.020; Thu, 24 Aug 2023 11:11:09 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH 13/27] net/nfp: refact the nffw module Date: Thu, 24 Aug 2023 19:09:42 +0800 Message-Id: <20230824110956.1943559-14-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230824110956.1943559-1-chaoyong.he@corigine.com> References: <20230824110956.1943559-1-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SJ0PR05CA0005.namprd05.prod.outlook.com (2603:10b6:a03:33b::10) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH7PR13MB6116:EE_ X-MS-Office365-Filtering-Correlation-Id: 7a97ed60-cd4e-474a-9b60-08dba492d194 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0OFJqsNyTLOjQufFBC9hdS5uiUA1fRwrwuhUQgTH7KeUbLVypc94qfPR/bSTrgPd4rRsXo8fJ1bocw4Frl+CBCeNX46VbKxBgqo6yrZp+Nw8L+Gae9VCUlTubpXqXPWFwATaM4RwB2sffXCcSgH2OmxjrPdYn5+DjGuh1U1fyQd1vCw97SQT8euAaGYwwpoOsaqHIKvQXs1u9ILB4kMZikTpBG5RQHJr77BV4qrVGcz0j8+UEyflP9LK1g5SE11jJLCcauJF9KmU4v6MSeAwm1zNWoIOnZXZE7kydgIk83a9cNea4ODLN10AFsnK5cQcYupfBZ0vzoAersHMmXZlUyLp+eLZ0lZ0ZCQzsCf9jDLuo4Y3Sd0v60Tb5FiXmjKwBQTkm6YhA/HeJqnSlGi9f8QkpYfoglb6BEXdwWM4b/khJ4bbt5eQ/tFaUfAlEmSB9YNDkqhcGKeFv8xEgUKIrhZ4EJDw51+QQ2YEjKeY7xzcEkv2cVVr19pIDSeS9+4WU30k5hb9HmQdHRrpgqSjPZ5z/zLNHTG3xyNj16NI73LPJ7B5+MfXkAmCUylinGwnleUm/z10hn/Cq2LkNqzaFdPM9z6vJT1wjpIrxRKRifdwVroCpK7sP//avjIV+dFMOUJLCl/B+giiibsp3r61FudI8lGW7zISEpeUnCJ8U1SzArVLk6QFd7QWxG9GHIDy 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)(366004)(39830400003)(346002)(396003)(136003)(376002)(1800799009)(186009)(451199024)(6506007)(26005)(1076003)(2616005)(107886003)(52116002)(12101799020)(6512007)(66574015)(6486002)(83380400001)(38100700002)(8676002)(8936002)(36756003)(316002)(4326008)(41300700001)(2906002)(86362001)(5660300002)(44832011)(38350700002)(6666004)(6916009)(478600001)(66476007)(66946007)(66556008); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aG4zYlVyTnExWTdibzFOcDlkV1E3TWJiZHRBT1NXSmlEN3d1ZHF0aGxqV3pC?= =?utf-8?B?TnBmL0ZTamJ4NEZhTFYzV0hNM3lBMTVuSng1KzREZnRoUmxYb201Tkcya3B6?= =?utf-8?B?VklUdVZSWDFHajdWc1BWTVl0SFpGdWdnakVENlJQTEwwT2F5elhzUTE2ZTZj?= =?utf-8?B?OFVCb3MvUUYvMlZXTEtBWlVxT2dsVXJneW55K1h0enVrNXpTRWc2UkwrT0k0?= =?utf-8?B?WWxEcHppZU5nOC9uQ1JTTTE5bHFtTXpjb2xSckF4ZzhzRVA2MUtjc1VrY2FW?= =?utf-8?B?alVmNGxFMVFmdW9zMGxVY0VlMUlKQjlGRnVLY1ltYXJybDVUWjIxR2ppczJz?= =?utf-8?B?MW9SMzk4djhBSm93MHY2SX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QkE9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a97ed60-cd4e-474a-9b60-08dba492d194 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2023 11:11:09.4852 (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: 7j72SnYT5x9/BP28XVHSpNs0I9czn9uuHkZ0luEXlFodqDUv7E8Qw7JhbzKXFfbz5pKrTYYpceom/KJGNOk8f4P4aEtYTdfvjxMt+2iW1I0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB6116 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 b27a9fbaa7..895c71afdd 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) { @@ -236,14 +274,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