get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/88577/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 88577,
    "url": "http://patches.dpdk.org/api/patches/88577/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210305133918.8005-51-ndabilpuram@marvell.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20210305133918.8005-51-ndabilpuram@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210305133918.8005-51-ndabilpuram@marvell.com",
    "date": "2021-03-05T13:39:16",
    "name": "[50/52] common/cnxk: add base tim device support",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e1fc622227f8df0921782ab29cc1ab66c073b72f",
    "submitter": {
        "id": 1202,
        "url": "http://patches.dpdk.org/api/people/1202/?format=api",
        "name": "Nithin Dabilpuram",
        "email": "ndabilpuram@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "http://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210305133918.8005-51-ndabilpuram@marvell.com/mbox/",
    "series": [
        {
            "id": 15508,
            "url": "http://patches.dpdk.org/api/series/15508/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=15508",
            "date": "2021-03-05T13:38:26",
            "name": "Add Marvell CNXK common driver",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/15508/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/88577/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/88577/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id EFB20A0547;\n\tFri,  5 Mar 2021 14:48:26 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 41DD522A404;\n\tFri,  5 Mar 2021 14:42:03 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 692A922A485\n for <dev@dpdk.org>; Fri,  5 Mar 2021 14:42:01 +0100 (CET)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id\n 125DdlEm008297 for <dev@dpdk.org>; Fri, 5 Mar 2021 05:42:00 -0800",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com with ESMTP id 370p7p0dhm-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Fri, 05 Mar 2021 05:42:00 -0800",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Fri, 5 Mar 2021 05:41:58 -0800",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Fri, 5 Mar 2021 05:41:58 -0800",
            "from hyd1588t430.marvell.com (unknown [10.29.52.204])\n by maili.marvell.com (Postfix) with ESMTP id 27C6B3F703F;\n Fri,  5 Mar 2021 05:41:55 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-type; s=pfpt0220; bh=pIiy6lX1Zclhe4bk8aQgv7dCAmwdo/2JOa41u0cj/XQ=;\n b=iF/603k/89KDHIA2el/N4ASjW6ss+LpmchTrYNZue5TFOF/oqQgFWhRsW0Pw5dzmZ0uR\n Wva4UKcdnL90LCnlYXsBvroy79wAQ5MoaETQ/fM2zrdxK5pvieeThEHTky8Pu0YAcmVu\n owwxDgeyWbyNUCEb4HXznz/MkJOpDVRM7bQnMI2XGQE6/QOQBMh8WOd2EuTDfZQs/SbK\n kDxZQr6mbvmthYCTZZQHy5gs04nWegyNP4a3lHeWjh3EhHIkwU3JRfwfmACzR66SARyN\n dHE6WwRceex8K8Mp8k03w15ZA536ay75HswikTTR+MpSQr3sfLDpqpLspDrO3+jffAkK aA==",
        "From": "Nithin Dabilpuram <ndabilpuram@marvell.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<jerinj@marvell.com>, <skori@marvell.com>, <skoteshwar@marvell.com>,\n <pbhagavatula@marvell.com>, <kirankumark@marvell.com>,\n <psatheesh@marvell.com>, <asekhar@marvell.com>",
        "Date": "Fri, 5 Mar 2021 19:09:16 +0530",
        "Message-ID": "<20210305133918.8005-51-ndabilpuram@marvell.com>",
        "X-Mailer": "git-send-email 2.8.4",
        "In-Reply-To": "<20210305133918.8005-1-ndabilpuram@marvell.com>",
        "References": "<20210305133918.8005-1-ndabilpuram@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.369, 18.0.761\n definitions=2021-03-05_08:2021-03-03,\n 2021-03-05 signatures=0",
        "Subject": "[dpdk-dev] [PATCH 50/52] common/cnxk: add base tim device support",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Pavan Nikhilesh <pbhagavatula@marvell.com>\n\nAdd TIM device init, fini which are used to attach TIM LF\nresources to the RVU PF/VF and TIM LF alloc and free.\n\nSigned-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>\n---\n drivers/common/cnxk/meson.build    |   1 +\n drivers/common/cnxk/roc_api.h      |   3 +\n drivers/common/cnxk/roc_platform.c |   1 +\n drivers/common/cnxk/roc_platform.h |   2 +\n drivers/common/cnxk/roc_priv.h     |   3 +\n drivers/common/cnxk/roc_tim.c      | 263 +++++++++++++++++++++++++++++++++++++\n drivers/common/cnxk/roc_tim.h      |  43 ++++++\n drivers/common/cnxk/roc_tim_priv.h |  21 +++\n drivers/common/cnxk/version.map    |   9 ++\n 9 files changed, 346 insertions(+)\n create mode 100644 drivers/common/cnxk/roc_tim.c\n create mode 100644 drivers/common/cnxk/roc_tim.h\n create mode 100644 drivers/common/cnxk/roc_tim_priv.h",
    "diff": "diff --git a/drivers/common/cnxk/meson.build b/drivers/common/cnxk/meson.build\nindex 4c910be..14fbade 100644\n--- a/drivers/common/cnxk/meson.build\n+++ b/drivers/common/cnxk/meson.build\n@@ -43,5 +43,6 @@ sources = files('roc_dev.c',\n \t\t'roc_sso.c',\n \t\t'roc_sso_debug.c',\n \t\t'roc_sso_irq.c',\n+\t\t'roc_tim.c',\n \t\t'roc_utils.c')\n includes += include_directories('../../bus/pci')\ndiff --git a/drivers/common/cnxk/roc_api.h b/drivers/common/cnxk/roc_api.h\nindex acdc97e..154c392 100644\n--- a/drivers/common/cnxk/roc_api.h\n+++ b/drivers/common/cnxk/roc_api.h\n@@ -91,6 +91,9 @@\n /* SSO */\n #include \"roc_sso.h\"\n \n+/* TIM */\n+#include \"roc_tim.h\"\n+\n /* Utils */\n #include \"roc_utils.h\"\n \ndiff --git a/drivers/common/cnxk/roc_platform.c b/drivers/common/cnxk/roc_platform.c\nindex 927bdca..dc0f193 100644\n--- a/drivers/common/cnxk/roc_platform.c\n+++ b/drivers/common/cnxk/roc_platform.c\n@@ -34,4 +34,5 @@ RTE_LOG_REGISTER(cnxk_logtype_npa, pmd.mempool.cnxk, NOTICE);\n RTE_LOG_REGISTER(cnxk_logtype_nix, pmd.net.cnxk, NOTICE);\n RTE_LOG_REGISTER(cnxk_logtype_npc, pmd.net.cnxk.flow, NOTICE);\n RTE_LOG_REGISTER(cnxk_logtype_sso, pmd.event.cnxk, NOTICE);\n+RTE_LOG_REGISTER(cnxk_logtype_tim, pmd.event.cnxk.timer, NOTICE);\n RTE_LOG_REGISTER(cnxk_logtype_tm, pmd.net.cnxk.tm, NOTICE);\ndiff --git a/drivers/common/cnxk/roc_platform.h b/drivers/common/cnxk/roc_platform.h\nindex 16db7f0..a1162e6 100644\n--- a/drivers/common/cnxk/roc_platform.h\n+++ b/drivers/common/cnxk/roc_platform.h\n@@ -130,6 +130,7 @@ extern int cnxk_logtype_npa;\n extern int cnxk_logtype_nix;\n extern int cnxk_logtype_npc;\n extern int cnxk_logtype_sso;\n+extern int cnxk_logtype_tim;\n extern int cnxk_logtype_tm;\n \n #define plt_err(fmt, args...)                                                  \\\n@@ -152,6 +153,7 @@ extern int cnxk_logtype_tm;\n #define plt_nix_dbg(fmt, ...)\tplt_dbg(nix, fmt, ##__VA_ARGS__)\n #define plt_npc_dbg(fmt, ...)\tplt_dbg(npc, fmt, ##__VA_ARGS__)\n #define plt_sso_dbg(fmt, ...)\tplt_dbg(sso, fmt, ##__VA_ARGS__)\n+#define plt_tim_dbg(fmt, ...)\tplt_dbg(tim, fmt, ##__VA_ARGS__)\n #define plt_tm_dbg(fmt, ...)\tplt_dbg(tm, fmt, ##__VA_ARGS__)\n \n #ifdef __cplusplus\ndiff --git a/drivers/common/cnxk/roc_priv.h b/drivers/common/cnxk/roc_priv.h\nindex 01e8f6b..ad696da 100644\n--- a/drivers/common/cnxk/roc_priv.h\n+++ b/drivers/common/cnxk/roc_priv.h\n@@ -29,4 +29,7 @@\n /* SSO */\n #include \"roc_sso_priv.h\"\n \n+/* TIM */\n+#include \"roc_tim_priv.h\"\n+\n #endif /* _ROC_PRIV_H_ */\ndiff --git a/drivers/common/cnxk/roc_tim.c b/drivers/common/cnxk/roc_tim.c\nnew file mode 100644\nindex 0000000..bd803db\n--- /dev/null\n+++ b/drivers/common/cnxk/roc_tim.c\n@@ -0,0 +1,263 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell.\n+ */\n+\n+#include \"roc_api.h\"\n+#include \"roc_priv.h\"\n+\n+static void\n+tim_err_desc(int rc)\n+{\n+\tswitch (rc) {\n+\tcase TIM_AF_NO_RINGS_LEFT:\n+\t\tplt_err(\"Unable to allocate new TIM ring.\");\n+\t\tbreak;\n+\tcase TIM_AF_INVALID_NPA_PF_FUNC:\n+\t\tplt_err(\"Invalid NPA pf func.\");\n+\t\tbreak;\n+\tcase TIM_AF_INVALID_SSO_PF_FUNC:\n+\t\tplt_err(\"Invalid SSO pf func.\");\n+\t\tbreak;\n+\tcase TIM_AF_RING_STILL_RUNNING:\n+\t\tplt_err(\"Ring busy.\");\n+\t\tbreak;\n+\tcase TIM_AF_LF_INVALID:\n+\t\tplt_err(\"Invalid Ring id.\");\n+\t\tbreak;\n+\tcase TIM_AF_CSIZE_NOT_ALIGNED:\n+\t\tplt_err(\"Chunk size specified needs to be multiple of 16.\");\n+\t\tbreak;\n+\tcase TIM_AF_CSIZE_TOO_SMALL:\n+\t\tplt_err(\"Chunk size too small.\");\n+\t\tbreak;\n+\tcase TIM_AF_CSIZE_TOO_BIG:\n+\t\tplt_err(\"Chunk size too big.\");\n+\t\tbreak;\n+\tcase TIM_AF_INTERVAL_TOO_SMALL:\n+\t\tplt_err(\"Bucket traversal interval too small.\");\n+\t\tbreak;\n+\tcase TIM_AF_INVALID_BIG_ENDIAN_VALUE:\n+\t\tplt_err(\"Invalid Big endian value.\");\n+\t\tbreak;\n+\tcase TIM_AF_INVALID_CLOCK_SOURCE:\n+\t\tplt_err(\"Invalid Clock source specified.\");\n+\t\tbreak;\n+\tcase TIM_AF_GPIO_CLK_SRC_NOT_ENABLED:\n+\t\tplt_err(\"GPIO clock source not enabled.\");\n+\t\tbreak;\n+\tcase TIM_AF_INVALID_BSIZE:\n+\t\tplt_err(\"Invalid bucket size.\");\n+\t\tbreak;\n+\tcase TIM_AF_INVALID_ENABLE_PERIODIC:\n+\t\tplt_err(\"Invalid bucket size.\");\n+\t\tbreak;\n+\tcase TIM_AF_INVALID_ENABLE_DONTFREE:\n+\t\tplt_err(\"Invalid Don't free value.\");\n+\t\tbreak;\n+\tcase TIM_AF_ENA_DONTFRE_NSET_PERIODIC:\n+\t\tplt_err(\"Don't free bit not set when periodic is enabled.\");\n+\t\tbreak;\n+\tcase TIM_AF_RING_ALREADY_DISABLED:\n+\t\tplt_err(\"Ring already stopped\");\n+\t\tbreak;\n+\tdefault:\n+\t\tplt_err(\"Unknown Error.\");\n+\t}\n+}\n+\n+int\n+roc_tim_lf_enable(struct roc_tim *roc_tim, uint8_t ring_id, uint64_t *start_tsc,\n+\t\t  uint32_t *cur_bkt)\n+{\n+\tstruct dev *dev = &roc_sso_to_sso_priv(roc_tim->roc_sso)->dev;\n+\tstruct tim_enable_rsp *rsp;\n+\tstruct tim_ring_req *req;\n+\tint rc = -ENOSPC;\n+\n+\treq = mbox_alloc_msg_tim_enable_ring(dev->mbox);\n+\tif (req == NULL)\n+\t\treturn rc;\n+\treq->ring = ring_id;\n+\n+\trc = mbox_process_msg(dev->mbox, (void **)&rsp);\n+\tif (rc < 0) {\n+\t\ttim_err_desc(rc);\n+\t\treturn rc;\n+\t}\n+\n+\tif (cur_bkt)\n+\t\t*cur_bkt = rsp->currentbucket;\n+\tif (start_tsc)\n+\t\t*start_tsc = rsp->timestarted;\n+\n+\treturn 0;\n+}\n+\n+int\n+roc_tim_lf_disable(struct roc_tim *roc_tim, uint8_t ring_id)\n+{\n+\tstruct dev *dev = &roc_sso_to_sso_priv(roc_tim->roc_sso)->dev;\n+\tstruct tim_ring_req *req;\n+\tint rc = -ENOSPC;\n+\n+\treq = mbox_alloc_msg_tim_disable_ring(dev->mbox);\n+\tif (req == NULL)\n+\t\treturn rc;\n+\treq->ring = ring_id;\n+\n+\trc = mbox_process(dev->mbox);\n+\tif (rc < 0) {\n+\t\ttim_err_desc(rc);\n+\t\treturn rc;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+uintptr_t\n+roc_tim_lf_base_get(struct roc_tim *roc_tim, uint8_t ring_id)\n+{\n+\tstruct dev *dev = &roc_sso_to_sso_priv(roc_tim->roc_sso)->dev;\n+\n+\treturn dev->bar2 + (RVU_BLOCK_ADDR_TIM << 20 | ring_id << 12);\n+}\n+\n+int\n+roc_tim_lf_config(struct roc_tim *roc_tim, uint8_t ring_id,\n+\t\t  enum roc_tim_clk_src clk_src, uint8_t ena_periodic,\n+\t\t  uint8_t ena_dfb, uint32_t bucket_sz, uint32_t chunk_sz,\n+\t\t  uint32_t interval)\n+{\n+\tstruct dev *dev = &roc_sso_to_sso_priv(roc_tim->roc_sso)->dev;\n+\tstruct tim_config_req *req;\n+\tint rc = -ENOSPC;\n+\n+\treq = mbox_alloc_msg_tim_config_ring(dev->mbox);\n+\tif (req == NULL)\n+\t\treturn rc;\n+\treq->ring = ring_id;\n+\treq->bigendian = false;\n+\treq->bucketsize = bucket_sz;\n+\treq->chunksize = chunk_sz;\n+\treq->clocksource = clk_src;\n+\treq->enableperiodic = ena_periodic;\n+\treq->enabledontfreebuffer = ena_dfb;\n+\treq->interval = interval;\n+\treq->gpioedge = TIM_GPIO_LTOH_TRANS;\n+\n+\trc = mbox_process(dev->mbox);\n+\tif (rc < 0) {\n+\t\ttim_err_desc(rc);\n+\t\treturn rc;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+int\n+roc_tim_lf_alloc(struct roc_tim *roc_tim, uint8_t ring_id, uint64_t *clk)\n+{\n+\tstruct sso *sso = roc_sso_to_sso_priv(roc_tim->roc_sso);\n+\tstruct tim_lf_alloc_req *req;\n+\tstruct tim_lf_alloc_rsp *rsp;\n+\tstruct dev *dev = &sso->dev;\n+\tint rc = -ENOSPC;\n+\n+\treq = mbox_alloc_msg_tim_lf_alloc(dev->mbox);\n+\tif (req == NULL)\n+\t\treturn rc;\n+\treq->npa_pf_func = idev_npa_pffunc_get();\n+\treq->sso_pf_func = idev_sso_pffunc_get();\n+\treq->ring = ring_id;\n+\n+\trc = mbox_process_msg(dev->mbox, (void **)&rsp);\n+\tif (rc < 0) {\n+\t\ttim_err_desc(rc);\n+\t\treturn rc;\n+\t}\n+\n+\tif (clk)\n+\t\t*clk = rsp->tenns_clk;\n+\n+\treturn rc;\n+}\n+\n+int\n+roc_tim_lf_free(struct roc_tim *roc_tim, uint8_t ring_id)\n+{\n+\tstruct sso *sso = roc_sso_to_sso_priv(roc_tim->roc_sso);\n+\tstruct dev *dev = &sso->dev;\n+\tstruct tim_ring_req *req;\n+\tint rc = -ENOSPC;\n+\n+\treq = mbox_alloc_msg_tim_lf_free(dev->mbox);\n+\tif (req == NULL)\n+\t\treturn rc;\n+\treq->ring = ring_id;\n+\n+\trc = mbox_process(dev->mbox);\n+\tif (rc < 0) {\n+\t\ttim_err_desc(rc);\n+\t\treturn rc;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+int\n+roc_tim_init(struct roc_tim *roc_tim)\n+{\n+\tstruct rsrc_attach_req *attach_req;\n+\tstruct free_rsrcs_rsp *free_rsrc;\n+\tstruct dev *dev;\n+\tuint16_t nb_lfs;\n+\tint rc;\n+\n+\tif (roc_tim == NULL || roc_tim->roc_sso == NULL)\n+\t\treturn TIM_ERR_PARAM;\n+\n+\tPLT_STATIC_ASSERT(sizeof(struct tim) <= TIM_MEM_SZ);\n+\tdev = &roc_sso_to_sso_priv(roc_tim->roc_sso)->dev;\n+\tnb_lfs = roc_tim->nb_lfs;\n+\tmbox_alloc_msg_free_rsrc_cnt(dev->mbox);\n+\trc = mbox_process_msg(dev->mbox, (void *)&free_rsrc);\n+\tif (rc < 0) {\n+\t\tplt_err(\"Unable to get free rsrc count.\");\n+\t\treturn 0;\n+\t}\n+\n+\tif (nb_lfs && (free_rsrc->tim < nb_lfs)) {\n+\t\tplt_tim_dbg(\"Requested LFs : %d Available LFs : %d\", nb_lfs,\n+\t\t\t    free_rsrc->tim);\n+\t\treturn 0;\n+\t}\n+\n+\tattach_req = mbox_alloc_msg_attach_resources(dev->mbox);\n+\tif (attach_req == NULL)\n+\t\treturn -ENOSPC;\n+\tattach_req->modify = true;\n+\tattach_req->timlfs = nb_lfs ? nb_lfs : free_rsrc->tim;\n+\tnb_lfs = attach_req->timlfs;\n+\n+\trc = mbox_process(dev->mbox);\n+\tif (rc < 0) {\n+\t\tplt_err(\"Unable to attach TIM LFs.\");\n+\t\treturn 0;\n+\t}\n+\n+\treturn nb_lfs;\n+}\n+\n+void\n+roc_tim_fini(struct roc_tim *roc_tim)\n+{\n+\tstruct dev *dev = &roc_sso_to_sso_priv(roc_tim->roc_sso)->dev;\n+\tstruct rsrc_detach_req *detach_req;\n+\n+\tdetach_req = mbox_alloc_msg_detach_resources(dev->mbox);\n+\tPLT_ASSERT(detach_req);\n+\tdetach_req->partial = true;\n+\tdetach_req->timlfs = true;\n+\n+\tmbox_process(dev->mbox);\n+}\ndiff --git a/drivers/common/cnxk/roc_tim.h b/drivers/common/cnxk/roc_tim.h\nnew file mode 100644\nindex 0000000..f3bc016\n--- /dev/null\n+++ b/drivers/common/cnxk/roc_tim.h\n@@ -0,0 +1,43 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell.\n+ */\n+\n+#ifndef _ROC_TIM_H_\n+#define _ROC_TIM_H_\n+\n+enum roc_tim_clk_src {\n+\tROC_TIM_CLK_SRC_10NS = 0,\n+\tROC_TIM_CLK_SRC_GPIO,\n+\tROC_TIM_CLK_SRC_GTI,\n+\tROC_TIM_CLK_SRC_PTP,\n+\tROC_TIM_CLK_SRC_INVALID,\n+};\n+\n+struct roc_tim {\n+\tstruct roc_sso *roc_sso;\n+\t/* Public data. */\n+\tuint16_t nb_lfs;\n+\t/* Private data. */\n+#define TIM_MEM_SZ (1 * 1024)\n+\tuint8_t reserved[TIM_MEM_SZ] __plt_cache_aligned;\n+} __plt_cache_aligned;\n+\n+int __roc_api roc_tim_init(struct roc_tim *roc_tim);\n+void __roc_api roc_tim_fini(struct roc_tim *roc_tim);\n+\n+/* TIM config */\n+int __roc_api roc_tim_lf_enable(struct roc_tim *roc_tim, uint8_t ring_id,\n+\t\t\t\tuint64_t *start_tsc, uint32_t *cur_bkt);\n+int __roc_api roc_tim_lf_disable(struct roc_tim *roc_tim, uint8_t ring_id);\n+int __roc_api roc_tim_lf_config(struct roc_tim *roc_tim, uint8_t ring_id,\n+\t\t\t\tenum roc_tim_clk_src clk_src,\n+\t\t\t\tuint8_t ena_periodic, uint8_t ena_dfb,\n+\t\t\t\tuint32_t bucket_sz, uint32_t chunk_sz,\n+\t\t\t\tuint32_t interval);\n+int __roc_api roc_tim_lf_alloc(struct roc_tim *roc_tim, uint8_t ring_id,\n+\t\t\t       uint64_t *clk);\n+int __roc_api roc_tim_lf_free(struct roc_tim *roc_tim, uint8_t ring_id);\n+uintptr_t __roc_api roc_tim_lf_base_get(struct roc_tim *roc_tim,\n+\t\t\t\t\tuint8_t ring_id);\n+\n+#endif\ndiff --git a/drivers/common/cnxk/roc_tim_priv.h b/drivers/common/cnxk/roc_tim_priv.h\nnew file mode 100644\nindex 0000000..9eaff22\n--- /dev/null\n+++ b/drivers/common/cnxk/roc_tim_priv.h\n@@ -0,0 +1,21 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell.\n+ */\n+\n+#ifndef _ROC_TIM_PRIV_H_\n+#define _ROC_TIM_PRIV_H_\n+\n+struct tim {\n+};\n+\n+enum tim_err_status {\n+\tTIM_ERR_PARAM = -5120,\n+};\n+\n+static inline struct tim *\n+roc_tim_to_tim_priv(struct roc_tim *roc_tim)\n+{\n+\treturn (struct tim *)&roc_tim->reserved[0];\n+}\n+\n+#endif /* _ROC_TIM_PRIV_H_ */\ndiff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map\nindex 4778480..5291faf 100644\n--- a/drivers/common/cnxk/version.map\n+++ b/drivers/common/cnxk/version.map\n@@ -7,6 +7,7 @@ INTERNAL {\n \tcnxk_logtype_npa;\n \tcnxk_logtype_npc;\n \tcnxk_logtype_sso;\n+\tcnxk_logtype_tim;\n \tcnxk_logtype_tm;\n \tplt_init;\n \troc_clk_freq_get;\n@@ -187,6 +188,14 @@ INTERNAL {\n \troc_sso_ns_to_gw;\n \troc_sso_rsrc_fini;\n \troc_sso_rsrc_init;\n+\troc_tim_fini;\n+\troc_tim_init;\n+\troc_tim_lf_alloc;\n+\troc_tim_lf_base_get;\n+\troc_tim_lf_config;\n+\troc_tim_lf_disable;\n+\troc_tim_lf_enable;\n+\troc_tim_lf_free;\n \n \tlocal: *;\n };\n",
    "prefixes": [
        "50/52"
    ]
}