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 A44BE41FC8; Wed, 30 Aug 2023 04:17:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5E4A7402E4; Wed, 30 Aug 2023 04:15:54 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2094.outbound.protection.outlook.com [40.107.93.94]) by mails.dpdk.org (Postfix) with ESMTP id C2680402D8 for ; Wed, 30 Aug 2023 04:15:51 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZWEOhMu2lHZ0H0w9IumyiFotB06oNEQZfyTd0KjtUdW0fdKtlJuDGzsKOUaqK6CUZsK8nzFMAZr+aAbtI4PDE6jJO+IJGoP4d01yhTEkQcfm6NGLdiKg0vvpbSBF1QXJdxehjkJaqg2MoCREpk9Q3Em/y57VEetJR/QFBCfRx9SkXX/Qxe0s1AfLxcwWKi5OnJNaC9UVPd/zjbpTZAKVQ2T5oPtTTXR+8cuZhqC7evolM+dRXNrRw5x9Vdkx/qQzqwsH9cuYbelCzqm+20lOOYyajiDU4LaaipRvpWHQlqIC2EBJf8sgb7+2ZWkoOZXn+LMuM/k4mJH+I2edi0ULJg== 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=LyEdMXGwxkWV7ILVn/HSh66TNDwofZdcxCtH9MmpUCHFC/K7GTLfT/l+aX4v/+pnpYlGZnfNDzyh9urAg08Sk3pn5GYVbDSCGz7h8pRwkWSyeZyTMWeOGrmsswtqLHE8eunteExEXZWD6IPA+YeyIBppB8hduWGd4NRNkdpM0D8u1tBIyNBQZfrGyqPpFKGEgiU0ywR8SZ1mZwQ0Pu9adkrER6zEwmbNvoJ7iWX9AtVZfVTGFqaAwiq+QTVu+JYXtwCCHQ7PZR73hu7Y24ii7hra62wP5kEXz/5nKQNiO1UZltwpKsgv2O0ahiDl5vICgvkIA7BA72QvIwmXac6Ztg== 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=t/gqoc57vJQ/sFcFLnVCLPzXFpo1uphqXGFFIhFPZLGE6jjS+xknfBK/LLTOpfZL7HlG01XfojU75dlYMDPcWgVRGt2Yx8UIY3cWR2MIpD4qVIHD80kQCSUZMqIte8yGdDOV1z72OkJyQG5O78VeikjJorqO/AGdnz0liPSHM8c= 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 DM6PR13MB3786.namprd13.prod.outlook.com (2603:10b6:5:229::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.18; Wed, 30 Aug 2023 02:15:48 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::c0f3:c2cc:b5bb:4192]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::c0f3:c2cc:b5bb:4192%4]) with mapi id 15.20.6699.034; Wed, 30 Aug 2023 02:15:48 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v2 13/27] net/nfp: refact the nffw module Date: Wed, 30 Aug 2023 10:14:43 +0800 Message-Id: <20230830021457.2064750-14-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230830021457.2064750-1-chaoyong.he@corigine.com> References: <20230824110956.1943559-1-chaoyong.he@corigine.com> <20230830021457.2064750-1-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: PH0PR07CA0113.namprd07.prod.outlook.com (2603:10b6:510:4::28) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|DM6PR13MB3786:EE_ X-MS-Office365-Filtering-Correlation-Id: 6034c235-fa8f-4384-d05b-08dba8ff06b0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lWGXYYAjwt/xEafQUk6fWz/54myHfwnNGtAgQY5mrnxyyYIj1CGSAb7AcaxGEWE1WShx/ILBl0Y2zq9oKTq8FS+ApEsWdfuypcsREHYLkSIuo1+qBldKU5mMVfrKDFhbVLaqwJCz4poPnHtVGZWK6B+e8qbpVT5nm1Ke+XbxSQELjbxfwhiuk4DSSso617jEBN44KOSnY8xsp3B9ZxlGpakMhob7TYAvzjBOYDS/BJ4c1g5aXhpXJmcGKXzFG7t+rpSz0A/8jDGlRsmR3n8E0BXq2xQVl2iuoDg672Vz/8b4EbAeVzwkH8jmgGtswCVl2XOprBPinc7fnBGzEPp3fSLm2ejkIXfN2BWu1zkvQ8giTw8BUK6AQ8wTxx1abTv7BhZs9yMldFfA4I9yR0IPPBwmkVUE745FMx2HdXXsanav5LwjXa1zKFja9IrtBbvpngn2upIgWkQZsGTnfGiDmEXdJ3g3wL3khTRx/vdT4FUVCKL2jGuBoo19mxGzacRb7dPs7R7oJeYTRCJQ0AmLcN7O0T4SYqW0OSrT34moQ6iWQKEeMVP8bYszeiK30n+bgjn9Ht3NDEkpptY8dnLgdU3/vBdl9lvvz3SFbAV0Bl4BELpnwEo8HF2x9bUcaG73zZRFFBqnCqa2dwFob5h++mYl3s53jRnl/tYPIKBCdWg= 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)(136003)(366004)(376002)(346002)(396003)(39830400003)(451199024)(186009)(1800799009)(6512007)(6916009)(316002)(38100700002)(41300700001)(38350700002)(2906002)(4326008)(66574015)(83380400001)(2616005)(86362001)(44832011)(26005)(36756003)(1076003)(8676002)(5660300002)(107886003)(8936002)(6666004)(6506007)(6486002)(66556008)(66946007)(66476007)(52116002)(478600001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dXA5cjVIaHNmalBaMjNneWZDTldUN2NTaDc4VnQyY2Q3UlFxKzd4b1RxMTZ0?= =?utf-8?B?UVdaK2g4QzBsMG04VHFwUUxIbkJRLzdMVDRDTGhrVTFEWGFJb0tja1ZlNWdh?= =?utf-8?B?TVlwZ0lpN2ZXS1luK1FUQmdGTHAySDZaejU3cnNHRllnR2s3ZGJuT1k2TXFG?= =?utf-8?B?WEhEQXc3Y1VqQnJMRnIyU2Z2NzNhRG8vNmtTQ0tBSHdGZlAwYjhNZ2x6aTFi?= =?utf-8?B?M0hsMDY4anNkSVZmTE5RcEVreEVCSFVMS3MxdWdnblg1bEd3ZEdSWDhjK3dN?= =?utf-8?B?WGMvLzV6T1pTSVRGYUxkWFN2R3hvVU5BY3BFMlljRzB5KzNKNFcrY3B5ZzRw?= =?utf-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dETW0yNk9GZWFTVnQ3YmZIaEM4cjhWdGQ4N2N1bHg0a2N1REY3?= =?utf-8?B?Q1E9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6034c235-fa8f-4384-d05b-08dba8ff06b0 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2023 02:15:48.8859 (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: d5/YkAzAHfqpmDaPx15EMch1DYAweElXurPs6vjIouz0gLmkxlymdw7iQ46K3IFOS+4nJPcM1xdNAGoW4JvSIpo4Y7XXxC4rnF+/ZWIuqw4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR13MB3786 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