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 4CB2FA0524; Wed, 14 Apr 2021 02:41:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0D706161409; Wed, 14 Apr 2021 02:41:12 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 4398F161408 for ; Wed, 14 Apr 2021 02:41:10 +0200 (CEST) IronPort-SDR: YJNbqpSRxpGUdU+6kCoyN93EtHPSTI8Gx8MWlXmbvfdY6xDvtHrOM75ErCp4Ef/eGmnWqVqRH9 dNGMSm7Jca8Q== X-IronPort-AV: E=McAfee;i="6200,9189,9953"; a="194559262" X-IronPort-AV: E=Sophos;i="5.82,220,1613462400"; d="scan'208";a="194559262" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2021 17:41:09 -0700 IronPort-SDR: X+SfUm06pc7SoPSNETstex6HW2yhDlGiH9e5V8I3y2mv/ymsrRSSxChxHwYC0+3k+SrIWX7JVn iQHRJHRLVD3Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,220,1613462400"; d="scan'208";a="424485950" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by orsmga008.jf.intel.com with ESMTP; 13 Apr 2021 17:41:08 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Tue, 13 Apr 2021 17:41:08 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Tue, 13 Apr 2021 17:41:08 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.107) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Tue, 13 Apr 2021 17:41:08 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ifG3OA7fAo/bfV7Dv3AOYDPi/+ed/5V1F3v95lo828Fez7PLCSnkWX0aNME9u7Zc568vaGaM/GH8eKSowTSjolFaWYyjp9IKMLCDPL2ervhHV7Ch6+Dx4ZUpbUAsLh4dfw778aOUqyndBIgzgaWjv9ZkFRLaxuKQGxCB1bEg/HoXqF2tmMpW4TaMtVCEknpCYZ0J79y/yelEnJGeMBhJTOiuZc9Ra3wmf5M7A+0EYecS29o4jmgsQyF7K5n2aRd1nZev6N2e/CeHRH3OL+/GFJjtOF7brOPthQw4nWhHSLZc26qRw3wjI/2Zg/QcHoHl5P2kuzLflw27wSNOcCa9Jw== 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-SenderADCheck; bh=sIjpU64E3QlEjv3HwAXhjf7tSkLSKTJDe/gv3vYh+WE=; b=ezvbsrcmEOX0dMDAQOxIHU5TTIHtRwOK8BsQkDW5UhRlVxw8dPPMvJenKDMuzKP9coz/gUHD/em9lVNjHmoEGZ9VvclS+M6ay6Ah5vqLt/dPbu4UdK3+Dsak7FXVLbQYmk5SnzCVxqAbfSb3iV8kuxCOPUz2WTwI15dtcouxCMGWRk/tNxYCf7IDWUC3yhHYAmNg3bJAL13MyZNr3fk+aC7sCuh8+ORMElKg52oCo3EnblU/DqSUDG3iBspEKsNeiCBqa9GkOGUufcV1Z4kw90G1W4aqWfUgb4ac/QRtnXT8JbOy09gghcHCum98yRdjOVkGWCHOt+kB2TSwYbDJbw== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sIjpU64E3QlEjv3HwAXhjf7tSkLSKTJDe/gv3vYh+WE=; b=YwZdAaEQcz9vdhejG/qRP8iS4zb3vXGrsUOXjyTzsRp7mw3JO+srlknBIm1T3sDn58BGLid56w6f+wtZAz7DPTfKIxq32SKsEHz0uFTcdGBTbvmSJvpnCRSh6FidK605xaQQRGPA1cIe+/QSY4WZ2BBaapf36fCyelKFjxeMU3Y= Received: from BY5PR11MB4451.namprd11.prod.outlook.com (2603:10b6:a03:1cb::30) by SJ0PR11MB4831.namprd11.prod.outlook.com (2603:10b6:a03:2d2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.16; Wed, 14 Apr 2021 00:41:07 +0000 Received: from BY5PR11MB4451.namprd11.prod.outlook.com ([fe80::756a:2aef:40b1:11c8]) by BY5PR11MB4451.namprd11.prod.outlook.com ([fe80::756a:2aef:40b1:11c8%5]) with mapi id 15.20.4020.022; Wed, 14 Apr 2021 00:41:07 +0000 From: "Chautru, Nicolas" To: Hemant Agrawal , "dev@dpdk.org" , "gakhil@marvell.com" CC: "david.marchand@redhat.com" , Nipun Gupta Thread-Topic: [PATCH v3 4/8] baseband/la12xx: add queue and modem config support Thread-Index: AQHXMCSI3n8jyw6ueE2w52MY8Qh1f6qzIqFg Date: Wed, 14 Apr 2021 00:41:07 +0000 Message-ID: References: <20210410170252.4587-1-hemant.agrawal@nxp.com> <20210413051715.26430-1-hemant.agrawal@nxp.com> <20210413051715.26430-5-hemant.agrawal@nxp.com> In-Reply-To: <20210413051715.26430-5-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [45.28.143.88] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 48a28297-6f6d-4a5e-33bb-08d8feddfdfe x-ms-traffictypediagnostic: SJ0PR11MB4831: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:469; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3QDX2zrfcONlmG3kQPqmmxVHE/zk/8QSEhnb/gyvnSS9ZN8wrzDN1C0AU5HEXEsZQAIEKsY77lhzj30hZ/gzwBa50hbtuc7ciRGfxbZ1yFmp66EvXQycSDGEoajF9z6Ic1uyBQkENc30CkKYj0stAk0soYjKah+DkttovSznOYECjZDO/oYwYpnHTuedoI4U6nwzQQxK4KfWYBVBt4xZ+MOtAruw4ekMakR9iPG3PSEC7XXoDfXx6rmIq29Hdc7VRGed59i1X8QlhbgJAJ5VwQ9cIg4l2ICuFniqITkOSmdcDz29t7UJWIwgP45k3OouNylu4s3R+LzroWjC08iwdoWgcGR7LLsKljtN6W1vpNseCIt4KzYSJkaFpFp86SxrrxtTQqUzf6Z+S1kHj+N3x9gXou7EwBKdIRMsVGmRh440qrrEWnqz6gtUu1k1WQH/ddCEmMlxi14SG6gnAH3GJ16Dl/D6x2DLPdUjfH0/WWHk97b2ZGN6brOPxkTp+o7HeJL+5tVHIDeVTpV3QLXjPpYaZUJCTF+0zFFlfY79qG7odZFePAIqtldoutDC+EtVqwFuLQ/AlFCmBJV/VsPbZNB2wZuttXi3t6NYXcNkuKA= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR11MB4451.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(376002)(366004)(396003)(136003)(39860400002)(52536014)(7696005)(8936002)(86362001)(38100700002)(71200400001)(66556008)(8676002)(2906002)(4326008)(6506007)(26005)(66946007)(76116006)(55016002)(66446008)(66476007)(478600001)(5660300002)(316002)(54906003)(83380400001)(122000001)(64756008)(33656002)(30864003)(186003)(110136005)(9686003)(559001)(579004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?8Ha5pFRIuJfch7dDnoToekpUve1S1TOVkajlAEAa8T2tWMneKrZfEkLYDefQ?= =?us-ascii?Q?WpPmQ6F/MVDy5mI9KSVEjL1OsFya9QhaBHE1sJN48+vTHKAJYISqVDlMaxQc?= =?us-ascii?Q?s3w4NLYJV21ZpJPBOogYmojgX6zFfDpgsi9KG11b2tS5NpBZWdrVSGRKU/Sc?= =?us-ascii?Q?g41We4tNFRUtK4pPySr4nQa03LX2A6psN2G0PFfbvAuxUzloLQzX8qrwmzhU?= =?us-ascii?Q?o6Ig3sVPP44MFDBOX7C/ynkwz3YswFh+UVitUkg54qSiK2esgww3JUayfq5H?= =?us-ascii?Q?AqqFKbpH5laa7cUplLtr/YZkdEC7Awb0txxf/NXSCTXFfzkWCr++RksHCWIq?= =?us-ascii?Q?1Wju0YJORal4OF4KvQeqUj7UeX+tA5FA9FB89NWNjueKPQlxs2/sAC13Bh1H?= =?us-ascii?Q?04u6XIDPT+H/+OjufOLBIxq0Qw6B1odzOjrj/cKyXNPrE0ZIPM85FqWTzNuG?= =?us-ascii?Q?IRVO+/GX50lRNwFlii8kxp8Kw2hCkrh30dsUa0tbQHXVhRXHjy648ZvADcR8?= =?us-ascii?Q?YsslrLl/YbgUqmaGeKgMJXGldqlge9so49/9tSZ+gf2FUpCmOqWgBSEc4IQh?= =?us-ascii?Q?uEQDuFv6Kzjtr6ScksXVgbil8NafG8uNwnk7AmPM8lUuGp5z0ULRqevClWEW?= =?us-ascii?Q?BS0YgNPs507nSDwDzFFap+9nhqFnYrHx01Cs6ap02huvwWmD/JhyZrfb6cLL?= =?us-ascii?Q?6B8oy4tGHkQM0rrtcrPfz8qQfy9Fr3GTdNpYTWm/qcEtz4ACteSSHpnSeSgO?= =?us-ascii?Q?aGjErZAk6PiJlSwpaLHpuZCe8yyX67t8lvqFIAOcgA8Pu9A9EZfBjzxYiFB8?= =?us-ascii?Q?IUK5wBce02xiSaVY2FHvbZmDmKP8r31Aky5eY9CtZNRFaQ1DGUtGPazzNAam?= =?us-ascii?Q?YpTtXuKQAaH8A/VWHDslxNcXYb+EAMlxtgQhjAM2PIUOc4bANbfQxA9BglRO?= =?us-ascii?Q?UwMzFFrIwwfnbJEpN1vZ+KDBFPj0QaH91K0ipmFg89P4X9aviD1mzFKI13BK?= =?us-ascii?Q?dkvh/mw/yaIFAdawulL/wZ15LtzXlU5Lnr9zee1AB/kOcOpp+FcED/RL65tQ?= =?us-ascii?Q?yPKH3O+THBLulj2EggJdsSgxhRsrDjtEryiTexgFhSofTXbzIkPz/8HMZLWW?= =?us-ascii?Q?rXFmkn7F4kp14Dpi03Lg7b1v0jTaqysh96cy9KOfmdQ1tbH8IqvUY/U6qlvg?= =?us-ascii?Q?d6YLfU+D3nrnsoE8TuOuDcC89kq7G+P/8GqEabfI7fM/IXDUIz5IKf97Cogr?= =?us-ascii?Q?8wmetSoomrRRV81AOFQIaI4ZWhsWJDLjnDLPuTCmLUPbNgYAE7DVIOvYD4Pm?= =?us-ascii?Q?mxwfZaOgcVQx4ITLccNS5lxT?= x-ms-exchange-transport-forked: True 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: BY5PR11MB4451.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 48a28297-6f6d-4a5e-33bb-08d8feddfdfe X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2021 00:41:07.4308 (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: qjRRQGU06vUetURTG7Z6a4gnFGMZpmmReCsiKrBZlQPsVoI94PgxDdToT1ExuyMGyU2QAwi+QAL3djJYIUzFXJuZZZM+Syclg5NXvYIzyoo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4831 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3 4/8] baseband/la12xx: add queue and modem config support 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 Sender: "dev" > -----Original Message----- > From: Hemant Agrawal > Sent: Monday, April 12, 2021 10:17 PM >=20 > This patch add support for connecting with modem and creating the ipc > channel as queues with modem for the exchange of data. >=20 > Signed-off-by: Nipun Gupta > Signed-off-by: Hemant Agrawal > --- > drivers/baseband/la12xx/bbdev_la12xx.c | 564 ++++++++++++++++++++- > drivers/baseband/la12xx/bbdev_la12xx.h | 5 +- > drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 180 +++++++ > 3 files changed, 746 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c > b/drivers/baseband/la12xx/bbdev_la12xx.c > index 7e9be74bb4..0a68686205 100644 > --- a/drivers/baseband/la12xx/bbdev_la12xx.c > +++ b/drivers/baseband/la12xx/bbdev_la12xx.c > @@ -3,6 +3,11 @@ > */ >=20 > #include > +#include > +#include > +#include > +#include > +#include >=20 > #include > #include > @@ -31,11 +36,561 @@ struct bbdev_la12xx_params { > #define BBDEV_LA12XX_VDEV_MODEM_ID_ARG "modem" > #define LA12XX_MAX_MODEM 4 >=20 > +#define LA12XX_MAX_CORES 4 > +#define BBDEV_LA12XX_LDPC_ENC_CORE 0 > +#define BBDEV_LA12XX_LDPC_DEC_CORE 1 > + > static const char * const bbdev_la12xx_valid_params[] =3D { > BBDEV_LA12XX_MAX_NB_QUEUES_ARG, > BBDEV_LA12XX_VDEV_MODEM_ID_ARG, > }; >=20 > +static const struct rte_bbdev_op_cap bbdev_capabilities[] =3D { > + { > + .type =3D RTE_BBDEV_OP_LDPC_ENC, > + .cap.ldpc_enc =3D { > + .capability_flags =3D > + RTE_BBDEV_LDPC_CRC_24A_ATTACH > | > + > RTE_BBDEV_LDPC_CRC_24B_ATTACH, I believe you also support RTE_BBDEV_LDPC_RATE_MATCH based on future commit= s. Still in that very commit I dont believe support anything yet > + .num_buffers_src =3D > + > RTE_BBDEV_LDPC_MAX_CODE_BLOCKS, > + .num_buffers_dst =3D > + > RTE_BBDEV_LDPC_MAX_CODE_BLOCKS, > + } > + }, > + { > + .type =3D RTE_BBDEV_OP_LDPC_DEC, > + .cap.ldpc_dec =3D { > + .capability_flags =3D > + RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK | > + > RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK | > + > RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP, Similar comment, on that very commit I dont believe you support anything ye= t. Future commits and documentation suggests you support more than these. > + .num_buffers_src =3D > + > RTE_BBDEV_LDPC_MAX_CODE_BLOCKS, > + .num_buffers_hard_out =3D > + > RTE_BBDEV_LDPC_MAX_CODE_BLOCKS, > + } > + }, > + RTE_BBDEV_END_OF_CAPABILITIES_LIST() > +}; > + > +static struct rte_bbdev_queue_conf default_queue_conf =3D { > + .queue_size =3D MAX_CHANNEL_DEPTH, > +}; > + > +/* Get device info */ > +static void > +la12xx_info_get(struct rte_bbdev *dev, > + struct rte_bbdev_driver_info *dev_info) { > + PMD_INIT_FUNC_TRACE(); > + > + dev_info->driver_name =3D RTE_STR(DRIVER_NAME); > + dev_info->max_num_queues =3D LA12XX_MAX_QUEUES; > + dev_info->queue_size_lim =3D MAX_CHANNEL_DEPTH; > + dev_info->hardware_accelerated =3D true; > + dev_info->max_dl_queue_priority =3D 0; > + dev_info->max_ul_queue_priority =3D 0; > + dev_info->default_queue_conf =3D default_queue_conf; > + dev_info->capabilities =3D bbdev_capabilities; > + dev_info->cpu_flag_reqs =3D NULL; > + dev_info->min_alignment =3D 64; > + > + BBDEV_LA12XX_PMD_DEBUG("got device info from %u", dev->data- > >dev_id); > +} > + > +/* Release queue */ > +static int > +la12xx_queue_release(struct rte_bbdev *dev, uint16_t q_id) { > + RTE_SET_USED(dev); > + RTE_SET_USED(q_id); > + > + PMD_INIT_FUNC_TRACE(); > + > + /* TODO: Implement */ I believe this should be implemented in that commit. Not added later in the= serie from what I could see. > + > + return 0; > +} > + > +#define HUGEPG_OFFSET(A) \ > + ((uint64_t) ((unsigned long) (A) \ > + - ((uint64_t)ipc_priv->hugepg_start.host_vaddr))) > + > +static int ipc_queue_configure(uint32_t channel_id, > + ipc_t instance, struct bbdev_la12xx_q_priv *q_priv) { > + ipc_userspace_t *ipc_priv =3D (ipc_userspace_t *)instance; > + ipc_instance_t *ipc_instance =3D ipc_priv->instance; > + ipc_ch_t *ch; > + void *vaddr; > + uint32_t i =3D 0; > + uint32_t msg_size =3D sizeof(struct bbdev_ipc_enqueue_op); > + > + PMD_INIT_FUNC_TRACE(); > + > + BBDEV_LA12XX_PMD_DEBUG("%x %p", ipc_instance->initialized, > + ipc_priv->instance); > + ch =3D &(ipc_instance->ch_list[channel_id]); > + > + BBDEV_LA12XX_PMD_DEBUG("channel: %u, depth: %u, msg size: > %u", > + channel_id, q_priv->queue_size, msg_size); > + > + /* Start init of channel */ > + ch->md.ring_size =3D rte_cpu_to_be_32(q_priv->queue_size); > + ch->md.pi =3D 0; > + ch->md.ci =3D 0; > + ch->md.msg_size =3D msg_size; > + for (i =3D 0; i < q_priv->queue_size; i++) { > + vaddr =3D rte_malloc(NULL, msg_size, RTE_CACHE_LINE_SIZE); > + if (!vaddr) > + return IPC_HOST_BUF_ALLOC_FAIL; > + /* Only offset now */ > + ch->bd[i].modem_ptr =3D > + rte_cpu_to_be_32(HUGEPG_OFFSET(vaddr)); > + ch->bd[i].host_virt_l =3D lower_32_bits(vaddr); > + ch->bd[i].host_virt_h =3D upper_32_bits(vaddr); > + q_priv->msg_ch_vaddr[i] =3D vaddr; > + /* Not sure use of this len may be for CRC*/ What is that comment refering to? Is that a TODO?=20 > + ch->bd[i].len =3D 0; > + } > + ch->host_ipc_params =3D > + rte_cpu_to_be_32(HUGEPG_OFFSET(q_priv->host_params)); > + ch->bl_initialized =3D 1; > + > + BBDEV_LA12XX_PMD_DEBUG("Channel configured"); > + return IPC_SUCCESS; > +} > + > +static int > +la12xx_e200_queue_setup(struct rte_bbdev *dev, > + struct bbdev_la12xx_q_priv *q_priv) > +{ > + struct bbdev_la12xx_private *priv =3D dev->data->dev_private; > + ipc_userspace_t *ipc_priv =3D priv->ipc_priv; > + struct gul_hif *mhif; > + ipc_metadata_t *ipc_md; > + ipc_ch_t *ch; > + int instance_id =3D 0, i; > + int ret; > + > + PMD_INIT_FUNC_TRACE(); > + > + switch (q_priv->op_type) { > + case RTE_BBDEV_OP_LDPC_ENC: > + q_priv->la12xx_core_id =3D BBDEV_LA12XX_LDPC_ENC_CORE; > + break; > + case RTE_BBDEV_OP_LDPC_DEC: > + q_priv->la12xx_core_id =3D BBDEV_LA12XX_LDPC_DEC_CORE; > + break; > + default: > + BBDEV_LA12XX_PMD_ERR("Unsupported op type\n"); > + return -1; > + } > + > + mhif =3D (struct gul_hif *)ipc_priv->mhif_start.host_vaddr; > + /* offset is from start of PEB */ > + ipc_md =3D (ipc_metadata_t *)((size_t)ipc_priv->peb_start.host_vaddr > + > + mhif->ipc_regs.ipc_mdata_offset); > + ch =3D &ipc_md->instance_list[instance_id].ch_list[q_priv->q_id]; > + > + if (q_priv->q_id < priv->num_valid_queues) { > + ipc_br_md_t *md, *host_md; > + ipc_ch_t *host_rx_ch; > + > + host_rx_ch =3D > + &ipc_md->instance_list[instance_id].ch_list[q_priv- > >q_id > + + HOST_RX_QUEUEID_OFFSET]; > + md =3D &(ch->md); > + host_md =3D &(host_rx_ch->md); > + > + q_priv->feca_blk_id =3D rte_cpu_to_be_32(ch->feca_blk_id); > + q_priv->feca_blk_id_be32 =3D ch->feca_blk_id; > + q_priv->host_pi =3D rte_be_to_cpu_32(host_md->pi); > + q_priv->host_ci =3D rte_be_to_cpu_32(md->ci); > + q_priv->host_params =3D (host_ipc_params_t *) > + (rte_be_to_cpu_32(ch->host_ipc_params) + > + ((size_t)ipc_priv->hugepg_start.host_vaddr)); > + > + for (i =3D 0; i < q_priv->queue_size; i++) { > + uint32_t h, l; > + > + h =3D host_rx_ch->bd[i].host_virt_h; > + l =3D host_rx_ch->bd[i].host_virt_l; > + q_priv->msg_ch_vaddr[i] =3D (void *)join_32_bits(h, l); > + } > + > + BBDEV_LA12XX_PMD_WARN( > + "Queue [%d] already configured, not configuring > again", > + q_priv->q_id); > + return 0; > + } > + > + BBDEV_LA12XX_PMD_DEBUG("setting up queue %d", q_priv->q_id); > + > + q_priv->host_params =3D rte_zmalloc(NULL, > sizeof(host_ipc_params_t), > + RTE_CACHE_LINE_SIZE); > + ch->host_ipc_params =3D > + rte_cpu_to_be_32(HUGEPG_OFFSET(q_priv->host_params)); > + > + /* Call ipc_configure_channel */ > + ret =3D ipc_queue_configure((q_priv->q_id + > HOST_RX_QUEUEID_OFFSET), > + ipc_priv, q_priv); > + if (ret) { > + BBDEV_LA12XX_PMD_ERR("Unable to setup queue (%d) > (err=3D%d)", > + q_priv->q_id, ret); > + return ret; > + } > + > + /* Set queue properties for LA12xx device */ > + switch (q_priv->op_type) { > + case RTE_BBDEV_OP_LDPC_ENC: > + if (priv->num_ldpc_enc_queues >=3D > MAX_LDPC_ENC_FECA_QUEUES) { > + BBDEV_LA12XX_PMD_ERR( > + "num_ldpc_enc_queues reached max > value"); > + return -1; > + } > + ch->la12xx_core_id =3D > + > rte_cpu_to_be_32(BBDEV_LA12XX_LDPC_ENC_CORE); > + ch->feca_blk_id =3D rte_cpu_to_be_32(priv- > >num_ldpc_enc_queues++); > + break; > + case RTE_BBDEV_OP_LDPC_DEC: > + if (priv->num_ldpc_dec_queues >=3D > MAX_LDPC_DEC_FECA_QUEUES) { > + BBDEV_LA12XX_PMD_ERR( > + "num_ldpc_dec_queues reached max > value"); > + return -1; > + } > + ch->la12xx_core_id =3D > + > rte_cpu_to_be_32(BBDEV_LA12XX_LDPC_DEC_CORE); > + ch->feca_blk_id =3D rte_cpu_to_be_32(priv- > >num_ldpc_dec_queues++); > + break; > + default: > + BBDEV_LA12XX_PMD_ERR("Not supported op type\n"); > + return -1; > + } > + ch->op_type =3D rte_cpu_to_be_32(q_priv->op_type); > + ch->depth =3D rte_cpu_to_be_32(q_priv->queue_size); > + > + /* Store queue config here */ > + q_priv->feca_blk_id =3D rte_cpu_to_be_32(ch->feca_blk_id); > + q_priv->feca_blk_id_be32 =3D ch->feca_blk_id; > + > + return 0; > +} > + > +/* Setup a queue */ > +static int > +la12xx_queue_setup(struct rte_bbdev *dev, uint16_t q_id, > + const struct rte_bbdev_queue_conf *queue_conf) { > + struct bbdev_la12xx_private *priv =3D dev->data->dev_private; > + struct rte_bbdev_queue_data *q_data; > + struct bbdev_la12xx_q_priv *q_priv; > + int ret; > + > + PMD_INIT_FUNC_TRACE(); > + > + /* Move to setup_queues callback */ > + q_data =3D &dev->data->queues[q_id]; > + q_data->queue_private =3D rte_zmalloc(NULL, > + sizeof(struct bbdev_la12xx_q_priv), 0); > + if (!q_data->queue_private) { > + BBDEV_LA12XX_PMD_ERR("Memory allocation failed for > qpriv"); > + return -ENOMEM; > + } > + q_priv =3D q_data->queue_private; > + q_priv->q_id =3D q_id; > + q_priv->bbdev_priv =3D dev->data->dev_private; > + q_priv->queue_size =3D queue_conf->queue_size; > + q_priv->op_type =3D queue_conf->op_type; > + > + ret =3D la12xx_e200_queue_setup(dev, q_priv); > + if (ret) { > + BBDEV_LA12XX_PMD_ERR("e200_queue_setup failed for > qid: %d", > + q_id); > + return ret; > + } > + > + /* Store queue config here */ > + priv->num_valid_queues++; > + > + return 0; > +} > + > +static int > +la12xx_start(struct rte_bbdev *dev) > +{ > + struct bbdev_la12xx_private *priv =3D dev->data->dev_private; > + ipc_userspace_t *ipc_priv =3D priv->ipc_priv; > + int ready =3D 0; > + struct gul_hif *hif_start; > + > + PMD_INIT_FUNC_TRACE(); > + > + hif_start =3D (struct gul_hif *)ipc_priv->mhif_start.host_vaddr; > + > + /* Set Host Read bit */ > + SET_HIF_HOST_RDY(hif_start, HIF_HOST_READY_IPC_APP); > + > + /* Now wait for modem ready bit */ > + while (!ready) > + ready =3D CHK_HIF_MOD_RDY(hif_start, > HIF_MOD_READY_IPC_APP); > + > + return 0; > +} > + > +static const struct rte_bbdev_ops pmd_ops =3D { > + .info_get =3D la12xx_info_get, > + .queue_setup =3D la12xx_queue_setup, > + .queue_release =3D la12xx_queue_release, > + .start =3D la12xx_start > +}; > +static struct hugepage_info * > +get_hugepage_info(void) > +{ > + struct hugepage_info *hp_info; > + struct rte_memseg *mseg; > + > + PMD_INIT_FUNC_TRACE(); > + > + /* TODO - find a better way */ > + hp_info =3D rte_malloc(NULL, sizeof(struct hugepage_info), 0); > + if (!hp_info) { > + BBDEV_LA12XX_PMD_ERR("Unable to allocate on local > heap"); > + return NULL; > + } > + > + mseg =3D rte_mem_virt2memseg(hp_info, NULL); > + hp_info->vaddr =3D mseg->addr; > + hp_info->paddr =3D rte_mem_virt2phy(mseg->addr); > + hp_info->len =3D mseg->len; > + > + return hp_info; > +} I was not sure what this is trying to do. Is that assuming a single huge pa= ge being used and keep track of it for future DMA activity? Is that valid? > + > +static int open_ipc_dev(int modem_id) > +{ > + char dev_initials[16], dev_path[PATH_MAX]; > + struct dirent *entry; > + int dev_ipc =3D 0; > + DIR *dir; > + > + dir =3D opendir("/dev/"); > + if (!dir) { > + BBDEV_LA12XX_PMD_ERR("Unable to open /dev/"); > + return -1; > + } > + > + sprintf(dev_initials, "gulipcgul%d", modem_id); > + > + while ((entry =3D readdir(dir)) !=3D NULL) { > + if (!strncmp(dev_initials, entry->d_name, > + sizeof(dev_initials) - 1)) > + break; > + } > + > + if (!entry) { > + BBDEV_LA12XX_PMD_ERR("Error: No gulipcgul%d device", > modem_id); > + return -1; > + } > + > + sprintf(dev_path, "/dev/%s", entry->d_name); > + dev_ipc =3D open(dev_path, O_RDWR); > + if (dev_ipc < 0) { > + BBDEV_LA12XX_PMD_ERR("Error: Cannot open %s", > dev_path); > + return -errno; > + } > + > + return dev_ipc; > +} > + > +static int > +setup_la12xx_dev(struct rte_bbdev *dev) { > + struct bbdev_la12xx_private *priv =3D dev->data->dev_private; > + ipc_userspace_t *ipc_priv =3D priv->ipc_priv; > + struct hugepage_info *hp =3D NULL; > + ipc_channel_us_t *ipc_priv_ch =3D NULL; > + int dev_ipc =3D 0, dev_mem =3D 0, i; > + ipc_metadata_t *ipc_md; > + struct gul_hif *mhif; > + uint32_t phy_align =3D 0; > + int ret; > + > + PMD_INIT_FUNC_TRACE(); > + > + if (!ipc_priv) { > + /* TODO - get a better way */ > + /* Get the hugepage info against it */ > + hp =3D get_hugepage_info(); > + if (!hp) { > + BBDEV_LA12XX_PMD_ERR("Unable to get hugepage > info"); > + ret =3D -ENOMEM; > + goto err; > + } > + > + BBDEV_LA12XX_PMD_DEBUG("0x%" PRIx64 " %p %x", > + hp->paddr, hp->vaddr, (int)hp->len); > + > + ipc_priv =3D rte_zmalloc(0, sizeof(ipc_userspace_t), 0); > + if (ipc_priv =3D=3D NULL) { > + BBDEV_LA12XX_PMD_ERR( > + "Unable to allocate memory for ipc priv"); > + ret =3D -ENOMEM; > + goto err; > + } > + > + for (i =3D 0; i < IPC_MAX_CHANNEL_COUNT; i++) { > + ipc_priv_ch =3D rte_zmalloc(0, > + sizeof(ipc_channel_us_t), 0); > + if (ipc_priv_ch =3D=3D NULL) { > + BBDEV_LA12XX_PMD_ERR( > + "Unable to allocate memory for > channels"); > + ret =3D -ENOMEM; > + } > + ipc_priv->channels[i] =3D ipc_priv_ch; > + } > + > + dev_mem =3D open("/dev/mem", O_RDWR); > + if (dev_mem < 0) { > + BBDEV_LA12XX_PMD_ERR("Error: Cannot open > /dev/mem"); > + ret =3D -errno; > + goto err; > + } > + > + ipc_priv->instance_id =3D 0; > + ipc_priv->dev_mem =3D dev_mem; > + > + ipc_priv->sys_map.hugepg_start.host_phys =3D hp->paddr; > + ipc_priv->sys_map.hugepg_start.size =3D hp->len; > + > + ipc_priv->hugepg_start.host_phys =3D hp->paddr; > + ipc_priv->hugepg_start.host_vaddr =3D hp->vaddr; > + ipc_priv->hugepg_start.size =3D hp->len; > + > + rte_free(hp); > + } > + > + dev_ipc =3D open_ipc_dev(priv->modem_id); > + if (dev_ipc < 0) { > + BBDEV_LA12XX_PMD_ERR("Error: open_ipc_dev failed"); > + goto err; > + } > + ipc_priv->dev_ipc =3D dev_ipc; > + > + /* Send IOCTL to get system map */ > + /* Send IOCTL to put hugepg_start map */ > + ret =3D ioctl(ipc_priv->dev_ipc, IOCTL_GUL_IPC_GET_SYS_MAP, > + &ipc_priv->sys_map); > + if (ret) { > + BBDEV_LA12XX_PMD_ERR( > + "IOCTL_GUL_IPC_GET_SYS_MAP ioctl failed"); > + goto err; > + } > + > + phy_align =3D (ipc_priv->sys_map.mhif_start.host_phys % 0x1000); I would replace the 0x1000 magic number used for alignment > + ipc_priv->mhif_start.host_vaddr =3D > + mmap(0, ipc_priv->sys_map.mhif_start.size + phy_align, > + (PROT_READ | PROT_WRITE), MAP_SHARED, ipc_priv- > >dev_mem, > + (ipc_priv->sys_map.mhif_start.host_phys - phy_align)); > + if (ipc_priv->mhif_start.host_vaddr =3D=3D MAP_FAILED) { > + BBDEV_LA12XX_PMD_ERR("MAP failed:"); > + ret =3D -errno; > + goto err; > + } > + > + ipc_priv->mhif_start.host_vaddr =3D (void *)((size_t) > + (ipc_priv->mhif_start.host_vaddr) + phy_align); > + > + phy_align =3D (ipc_priv->sys_map.peb_start.host_phys % 0x1000); > + ipc_priv->peb_start.host_vaddr =3D > + mmap(0, ipc_priv->sys_map.peb_start.size + phy_align, > + (PROT_READ | PROT_WRITE), MAP_SHARED, ipc_priv- > >dev_mem, > + (ipc_priv->sys_map.peb_start.host_phys - phy_align)); > + if (ipc_priv->peb_start.host_vaddr =3D=3D MAP_FAILED) { > + BBDEV_LA12XX_PMD_ERR("MAP failed:"); > + ret =3D -errno; > + goto err; > + } > + > + ipc_priv->peb_start.host_vaddr =3D (void *)((size_t) > + (ipc_priv->peb_start.host_vaddr) + phy_align); > + > + phy_align =3D (ipc_priv->sys_map.modem_ccsrbar.host_phys % > 0x1000); > + ipc_priv->modem_ccsrbar.host_vaddr =3D > + mmap(0, ipc_priv->sys_map.modem_ccsrbar.size + > phy_align, > + (PROT_READ | PROT_WRITE), MAP_SHARED, ipc_priv- > >dev_mem, > + (ipc_priv->sys_map.modem_ccsrbar.host_phys - > phy_align)); > + if (ipc_priv->modem_ccsrbar.host_vaddr =3D=3D MAP_FAILED) { > + BBDEV_LA12XX_PMD_ERR("MAP failed:"); > + ret =3D -errno; > + goto err; > + } > + > + ipc_priv->modem_ccsrbar.host_vaddr =3D (void *)((size_t) > + (ipc_priv->modem_ccsrbar.host_vaddr) + phy_align); > + > + ipc_priv->hugepg_start.modem_phys =3D > + ipc_priv->sys_map.hugepg_start.modem_phys; > + > + ipc_priv->mhif_start.host_phys =3D > + ipc_priv->sys_map.mhif_start.host_phys; > + ipc_priv->mhif_start.size =3D ipc_priv->sys_map.mhif_start.size; > + ipc_priv->peb_start.host_phys =3D ipc_priv- > >sys_map.peb_start.host_phys; > + ipc_priv->peb_start.size =3D ipc_priv->sys_map.peb_start.size; > + > + BBDEV_LA12XX_PMD_INFO("peb 0x%" PRIx64 " %p %x", > + ipc_priv->peb_start.host_phys, > + ipc_priv->peb_start.host_vaddr, > + ipc_priv->peb_start.size); > + BBDEV_LA12XX_PMD_INFO("hugepg 0x%" PRIx64 " %p %x", > + ipc_priv->hugepg_start.host_phys, > + ipc_priv->hugepg_start.host_vaddr, > + ipc_priv->hugepg_start.size); > + BBDEV_LA12XX_PMD_INFO("mhif 0x%" PRIx64 " %p %x", > + ipc_priv->mhif_start.host_phys, > + ipc_priv->mhif_start.host_vaddr, > + ipc_priv->mhif_start.size); > + mhif =3D (struct gul_hif *)ipc_priv->mhif_start.host_vaddr; > + > + /* offset is from start of PEB */ > + ipc_md =3D (ipc_metadata_t *)((size_t)ipc_priv->peb_start.host_vaddr > + > + mhif->ipc_regs.ipc_mdata_offset); > + > + if (sizeof(ipc_metadata_t) !=3D mhif->ipc_regs.ipc_mdata_size) { > + BBDEV_LA12XX_PMD_ERR( > + "\n ipc_metadata_t=3D%d mhif- > >ipc_regs.ipc_mdata_size=3D%x", > + (int)sizeof(ipc_metadata_t), > + mhif->ipc_regs.ipc_mdata_size); > + BBDEV_LA12XX_PMD_ERR( > + "--> mhif->ipc_regs.ipc_mdata_offset=3D %x", > + mhif->ipc_regs.ipc_mdata_offset); > + BBDEV_LA12XX_PMD_ERR( > + "gul_hif size=3D%d", (int)sizeof(struct gul_hif)); > + return IPC_MD_SZ_MISS_MATCH; > + } > + > + ipc_priv->instance =3D (ipc_instance_t *) > + (&ipc_md->instance_list[ipc_priv->instance_id]); > + > + BBDEV_LA12XX_PMD_DEBUG("finish host init"); > + > + priv->ipc_priv =3D ipc_priv; > + > + return 0; > + > +err: > + rte_free(hp); > + rte_free(ipc_priv); > + rte_free(ipc_priv_ch); > + if (dev_mem) > + close(dev_mem); > + if (dev_ipc) > + close(dev_ipc); > + > + return ret; > +} > + > static inline int > parse_u16_arg(const char *key, const char *value, void *extra_args) { @= @ - > 123,6 +678,7 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev, > struct rte_bbdev *bbdev; > const char *name =3D rte_vdev_device_name(vdev); > struct bbdev_la12xx_private *priv; > + int ret; >=20 > PMD_INIT_FUNC_TRACE(); >=20 > @@ -152,7 +708,13 @@ la12xx_bbdev_create(struct rte_vdev_device > *vdev, >=20 > BBDEV_LA12XX_PMD_INFO("Setting Up %s: DevId=3D%d, > ModemId=3D%d", > name, bbdev->data->dev_id, priv- > >modem_id); > - bbdev->dev_ops =3D NULL; > + ret =3D setup_la12xx_dev(bbdev); > + if (ret) { > + BBDEV_LA12XX_PMD_ERR("IPC Setup failed for %s", name); > + rte_free(bbdev->data->dev_private); > + return ret; > + } > + bbdev->dev_ops =3D &pmd_ops; > bbdev->device =3D &vdev->device; > bbdev->data->socket_id =3D 0; > bbdev->intr_handle =3D NULL; > diff --git a/drivers/baseband/la12xx/bbdev_la12xx.h > b/drivers/baseband/la12xx/bbdev_la12xx.h > index 5228502331..c94f08e059 100644 > --- a/drivers/baseband/la12xx/bbdev_la12xx.h > +++ b/drivers/baseband/la12xx/bbdev_la12xx.h > @@ -14,7 +14,7 @@ > #define MAX_CHANNEL_DEPTH 16 > /* private data structure */ > struct bbdev_la12xx_private { > - void *ipc_priv; > + ipc_userspace_t *ipc_priv; > uint8_t num_valid_queues; > uint8_t max_nb_queues; > uint8_t num_ldpc_enc_queues; > @@ -52,5 +52,6 @@ struct bbdev_la12xx_q_priv { >=20 > #define lower_32_bits(x) ((uint32_t)((uint64_t)x)) #define upper_32_bit= s(x) > ((uint32_t)(((uint64_t)(x) >> 16) >> 16)) > - > +#define join_32_bits(upper, lower) \ > + ((size_t)(((uint64_t)(upper) << 32) | (uint32_t)(lower))) > #endif > diff --git a/drivers/baseband/la12xx/bbdev_la12xx_ipc.h > b/drivers/baseband/la12xx/bbdev_la12xx_ipc.h > index 9aa5562981..9d5789f726 100644 > --- a/drivers/baseband/la12xx/bbdev_la12xx_ipc.h > +++ b/drivers/baseband/la12xx/bbdev_la12xx_ipc.h > @@ -4,9 +4,175 @@ > #ifndef __BBDEV_LA12XX_IPC_H__ > #define __BBDEV_LA12XX_IPC_H__ >=20 > +#define LA12XX_MAX_QUEUES 20 > + > +/** No. of max channel per instance */ > +#define IPC_MAX_CHANNEL_COUNT (64) > + > /** No. of max channel per instance */ > #define IPC_MAX_DEPTH (16) >=20 > +/** No. of max IPC instance per modem */ > +#define IPC_MAX_INSTANCE_COUNT (1) > + > +#define HOST_RX_QUEUEID_OFFSET LA12XX_MAX_QUEUES > + > +#define MAX_MEM_POOL_COUNT 8 > + > +/** Error codes */ > +#define IPC_SUCCESS (0) /** IPC operation success */ > +#define IPC_INPUT_INVALID (-1) /** Invalid input to API */ > +#define IPC_CH_INVALID (-2) /** Channel no is invalid */ > +#define IPC_INSTANCE_INVALID (-3) /** Instance no is invalid */ > +#define IPC_MEM_INVALID (-4) /** Insufficient memory */ > +#define IPC_CH_FULL (-5) /** Channel is full */ > +#define IPC_CH_EMPTY (-6) /** Channel is empty */ > +#define IPC_BL_EMPTY (-7) /** Free buffer list is empty */ > +#define IPC_BL_FULL (-8) /** Free buffer list is full */ > +#define IPC_HOST_BUF_ALLOC_FAIL (-9) /** DPDK malloc fail */ > +#define IPC_MD_SZ_MISS_MATCH (-10) /** META DATA sz in mhif miss > matched*/ > +#define IPC_MALLOC_FAIL (-11) /** system malloc fail */ > +#define IPC_IOCTL_FAIL (-12) /** IOCTL call failed */ > +#define IPC_MMAP_FAIL (-14) /** MMAP fail */ > +#define IPC_OPEN_FAIL (-15) /** OPEN fail */ > +#define IPC_EVENTFD_FAIL (-16) /** eventfd initialization failed */ > +#define IPC_NOT_IMPLEMENTED (-17) /** IPC feature is not > implemented yet*/ > + > +#define SET_HIF_HOST_RDY(hif, RDY_MASK) (hif->host_ready |=3D > RDY_MASK) > +#define CHK_HIF_MOD_RDY(hif, RDY_MASK) (hif->mod_ready & > RDY_MASK) > + > +/* Host Ready bits */ > +#define HIF_HOST_READY_HOST_REGIONS (1 << 0) > +#define HIF_HOST_READY_IPC_LIB (1 << 12) > +#define HIF_HOST_READY_IPC_APP (1 << 13) > +#define HIF_HOST_READY_FECA (1 << 14) > + > +/* Modem Ready bits */ > +#define HIF_MOD_READY_IPC_LIB (1 << 5) > +#define HIF_MOD_READY_IPC_APP (1 << 6) > +#define HIF_MOD_READY_FECA (1 << 7) > + > +typedef void *ipc_t; > + > +struct ipc_msg { > + int chid; > + void *addr; > + uint32_t len; > + uint8_t flags; > +}; > + > +typedef struct { > + uint64_t host_phys; > + uint32_t modem_phys; > + void *host_vaddr; > + uint32_t size; > +} mem_range_t; > + > +#define GUL_IPC_MAGIC 'R' > + > +#define IOCTL_GUL_IPC_GET_SYS_MAP _IOW(GUL_IPC_MAGIC, 1, struct > ipc_msg > +*) #define IOCTL_GUL_IPC_CHANNEL_REGISTER _IOWR(GUL_IPC_MAGIC, 4, > +struct ipc_msg *) #define IOCTL_GUL_IPC_CHANNEL_DEREGISTER \ > + _IOWR(GUL_IPC_MAGIC, 5, struct ipc_msg *) #define > +IOCTL_GUL_IPC_CHANNEL_RAISE_INTERRUPT _IOW(GUL_IPC_MAGIC, 6, int > *) > + > +/** buffer ring common metadata */ > +typedef struct ipc_bd_ring_md { > + volatile uint32_t pi; /**< Producer index and flag (MSB) > + * which flip for each Ring wrapping > + */ > + volatile uint32_t ci; /**< Consumer index and flag (MSB) > + * which flip for each Ring wrapping > + */ > + uint32_t ring_size; /**< depth (Used to roll-over pi/ci) */ > + uint32_t msg_size; /**< Size of the each buffer */ > +} __rte_packed ipc_br_md_t; > + > +/** IPC buffer descriptor */ > +typedef struct ipc_buffer_desc { > + union { > + uint64_t host_virt; /**< msg's host virtual address */ > + struct { > + uint32_t host_virt_l; > + uint32_t host_virt_h; > + }; > + }; > + uint64_t host_phy; /**< msg's host physical address */ No intention to use rte_iova_t here?=20 > + uint32_t modem_ptr; /**< msg's modem physical address */ > + uint32_t len; /**< msg len */ > + uint64_t crc; /**< crc */ > +} __rte_packed ipc_bd_t; > + > +typedef struct ipc_channel { > + uint32_t ch_id; /**< Channel id */ > + uint32_t bl_initialized;/**< Set when buffer list is initialized */ > + ipc_br_md_t md; > + ipc_bd_t bd[IPC_MAX_DEPTH]; > + uint32_t op_type;/* BBDEV operation supported on this channel */ > + uint32_t depth; /* Channel depth */ > + uint32_t feca_blk_id;/* FECA Transport Block ID for processing */ > + uint32_t la12xx_core_id;/* LA12xx core ID to scheduled work for it*/ > + uint32_t host_ipc_params;/* Address for host IPC parameters */ } > +__rte_packed ipc_ch_t; > + > +typedef struct ipc_instance { > + uint32_t initialized; /**< Set in ipc_init */ > + ipc_ch_t ch_list[IPC_MAX_CHANNEL_COUNT]; > + /**< Channel descriptors in this instance */ } __rte_packed > +ipc_instance_t; > + > +typedef struct ipc_metadata { > + ipc_instance_t instance_list[IPC_MAX_INSTANCE_COUNT]; > +} __rte_packed ipc_metadata_t; > + > +typedef struct ipc_channel_us_priv { > + int32_t eventfd; > + uint32_t channel_id; > + /* In flight packets status for buffer list. */ > + uint8_t bufs_inflight[IPC_MAX_DEPTH]; > +} ipc_channel_us_t; > + > +typedef struct { > + uint64_t host_phys; > + uint32_t modem_phys; > + uint32_t size; > +} mem_strt_addr_t; > + > +typedef struct { > + mem_strt_addr_t modem_ccsrbar; > + mem_strt_addr_t peb_start; /* PEB meta data */ > + mem_strt_addr_t mhif_start; /* MHIF meta daat */ > + mem_strt_addr_t hugepg_start; /* Modem to access hugepage */ } > +sys_map_t; > + > +typedef struct ipc_priv_t { > + int instance_id; > + int dev_ipc; > + int dev_mem; > + struct rte_mempool *rtemempool[MAX_MEM_POOL_COUNT]; > + sys_map_t sys_map; > + mem_range_t modem_ccsrbar; > + mem_range_t peb_start; > + mem_range_t mhif_start; > + mem_range_t hugepg_start; > + ipc_channel_us_t *channels[IPC_MAX_CHANNEL_COUNT]; > + ipc_instance_t *instance; > +} ipc_userspace_t; > + > +/** Structure specifying enqueue operation (enqueue at LA1224) */ > +struct bbdev_ipc_enqueue_op { > + /** Status of operation that was performed */ > + int32_t status; > + /** CRC Status of SD operation that was performed */ > + int32_t crc_stat_addr; > + /** HARQ Output buffer memory length for Shared Decode. > + * Filled by LA12xx. > + */ What is this? Is HARQ supported or not? Is this memory accessible. > + uint32_t out_len; > + /** Reserved (for 8 byte alignment) */ > + uint32_t rsvd; > +}; > + > /* This shared memory would be on the host side which have copy of some > * of the parameters which are also part of Shared BD ring. Read access > * of these parameters from the host side would not be over PCI. > @@ -17,4 +183,18 @@ typedef struct host_ipc_params { > volatile uint32_t modem_ptr[IPC_MAX_DEPTH]; } __rte_packed > host_ipc_params_t; >=20 > +struct hif_ipc_regs { > + uint32_t ipc_mdata_offset; > + uint32_t ipc_mdata_size; > +} __rte_packed; > + > +struct gul_hif { > + uint32_t ver; > + uint32_t hif_ver; > + uint32_t status; > + volatile uint32_t host_ready; > + volatile uint32_t mod_ready; > + struct hif_ipc_regs ipc_regs; > +} __rte_packed; > + > #endif > -- > 2.17.1