From patchwork Thu Apr 24 17:01:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 29003 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D64E52036A for ; Thu, 24 Apr 2014 17:02:24 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id l4sf1505493lbv.2 for ; Thu, 24 Apr 2014 10:02:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=XX4eplxCnPQPPU6WzzfIwcLZV+A1ZziKP0HQwSevaLk=; b=QtF/VXRqhD6Il07aujhagdJHQ/xY9aHxklFYmNUSWnvdUVIw2lwUQ2NFB8v3U9zscE aERlmpjJAAUoSVDB/IGDyepuz/MAXdCBLS7WeKQJd3gFEi3O8Vysxvxwvn3MF0h6TCPW mFrTpsLnhCRTSziigvMt+/Aflo1u/qHqgppUb763ltudwG6/1oXEvtdZyFqQGxCUBQmq uTOXnH7Ae4E/sdHIvEKtglgSp3+sDa7EnMkTaBRSK3Wd9jOjBmBGHloAOnS3KfQ4Oeol g6R93QwK2va0xqQW+goEh3GtQq7BCLVfDdwxMuWz+4y7AyFTMZ9C1TbwWcweRcDIGHrV GhFA== X-Gm-Message-State: ALoCoQnzfb0cTmOU7spvsg5GdukYUgw2WH13E4G5zriDz0QXRBgOCR9e/e6ltgcDOXa6Ac5mnvra X-Received: by 10.112.50.50 with SMTP id z18mr440650lbn.7.1398358943087; Thu, 24 Apr 2014 10:02:23 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.97.134 with SMTP id m6ls1247974qge.88.gmail; Thu, 24 Apr 2014 10:02:22 -0700 (PDT) X-Received: by 10.220.69.72 with SMTP id y8mr1938932vci.21.1398358942556; Thu, 24 Apr 2014 10:02:22 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id tn6si1063050vcb.183.2014.04.24.10.02.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Apr 2014 10:02:22 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id jz11so3224189veb.39 for ; Thu, 24 Apr 2014 10:02:22 -0700 (PDT) X-Received: by 10.58.201.5 with SMTP id jw5mr1961133vec.6.1398358942460; Thu, 24 Apr 2014 10:02:22 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp31737vcb; Thu, 24 Apr 2014 10:02:22 -0700 (PDT) X-Received: by 10.224.129.66 with SMTP id n2mr4441198qas.55.1398358941636; Thu, 24 Apr 2014 10:02:21 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id w93si2533712qge.26.2014.04.24.10.02.20 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 24 Apr 2014 10:02:21 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1WdN26-0004Hb-0z; Thu, 24 Apr 2014 17:01:58 +0000 Received: from mail-ee0-f49.google.com ([74.125.83.49]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1WdN1i-0004GA-6A for lng-odp@lists.linaro.org; Thu, 24 Apr 2014 17:01:34 +0000 Received: by mail-ee0-f49.google.com with SMTP id c41so2056025eek.22 for ; Thu, 24 Apr 2014 10:01:50 -0700 (PDT) X-Received: by 10.15.36.6 with SMTP id h6mr3683536eev.54.1398358910474; Thu, 24 Apr 2014 10:01:50 -0700 (PDT) Received: from uglx0153363.synapse.com ([195.238.92.128]) by mx.google.com with ESMTPSA id w46sm17371207eeo.35.2014.04.24.10.01.49 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Apr 2014 10:01:49 -0700 (PDT) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Thu, 24 Apr 2014 20:01:34 +0300 Message-Id: <1398358899-9851-4-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1398358899-9851-1-git-send-email-taras.kondratiuk@linaro.org> References: <1398358899-9851-1-git-send-email-taras.kondratiuk@linaro.org> Cc: linaro-networking@linaro.org Subject: [lng-odp] [PATCH v4 3/8] Keystone2: Initialize hardware X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: taras.kondratiuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Initialize hardware and helper libraries environment on ODP init. Assume OpenEM helper libraries and their headers can be found in standard locations. Signed-off-by: Taras Kondratiuk --- platform/linux-keystone2/Makefile | 19 ++- .../include/configs/odp_config_platform.h | 57 ++++++++ .../include/configs/odp_config_platform_c6638.h | 95 ++++++++++++ platform/linux-keystone2/source/odp_init.c | 151 ++++++++++++++++++++ 4 files changed, 320 insertions(+), 2 deletions(-) create mode 100644 platform/linux-keystone2/include/configs/odp_config_platform.h create mode 100644 platform/linux-keystone2/include/configs/odp_config_platform_c6638.h create mode 100644 platform/linux-keystone2/source/odp_init.c diff --git a/platform/linux-keystone2/Makefile b/platform/linux-keystone2/Makefile index 398f8dd..939d2db 100644 --- a/platform/linux-keystone2/Makefile +++ b/platform/linux-keystone2/Makefile @@ -13,6 +13,16 @@ DOC_DIR = ./doc LINUX_GENERIC_DIR = ../linux-generic +MY_PLATFORM = DEVICE_K2K + +PLAT_CFLAGS = -D$(MY_PLATFORM) +PLAT_CFLAGS += -D_GNU_SOURCE -DEM_32_BIT -DTI_EM_CENTRAL_SCHED +PLAT_CFLAGS += -DTI_EM_TRACE_LEVEL=3 -DEM_CHECK_LEVEL=1 +PLAT_CFLAGS += -DTI_EM_LINUX -DTI_EM_GCC -DTI_EM_ARM_A15 -DTI_EM_C6638 +PLAT_CFLAGS += -D_LITTLE_ENDIAN -DTI_EM_USE_MSM -DTI_EM_XGE_LOOPBACK +PLAT_CFLAGS += -DTI_ODP + +EXTRA_CFLAGS += $(PLAT_CFLAGS) EXTRA_CFLAGS += -I./include EXTRA_CFLAGS += -I./include/api EXTRA_CFLAGS += -I$(LINUX_GENERIC_DIR)/include @@ -70,8 +80,13 @@ $(OBJ_DIR)/%.o: %.c # # Lib rule # -$(STATIC_LIB): $(OBJS) - $(AR) -cr $@ $(OBJS) +$(OBJ_DIR)/libodp.o: $(OBJS) + $(ECHO) " LD $@" + $(LD) -r -o $@ $(OBJS) $(LDFLAGS) -lopenem_rh -lopenem_osal + +$(STATIC_LIB): $(OBJ_DIR)/libodp.o + $(ECHO) " AR $@" + $(AR) -cr $@ $(OBJ_DIR)/libodp.o clean: $(RMDIR) $(OBJ_DIR) diff --git a/platform/linux-keystone2/include/configs/odp_config_platform.h b/platform/linux-keystone2/include/configs/odp_config_platform.h new file mode 100644 index 0000000..bcad278 --- /dev/null +++ b/platform/linux-keystone2/include/configs/odp_config_platform.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2012, Texas Instruments Incorporated - http://www.ti.com/ + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Texas Instruments Incorporated nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#ifndef ODP_CONFIG_PLATFORM_H_ +#define ODP_CONFIG_PLATFORM_H_ + +/* #include */ +#if defined(TI_EM_C6678) +#include +#elif defined(TI_EM_C6614) +#include +#elif defined(TI_EM_C6638) +#include +#else +#error "platform not defined or unsupported!" +#endif + +#define TI_ODP_PUBLIC_DESC_SIZE (64u) +#define TI_ODP_PUBLIC_DESC_NUM (4096u) +#define TI_ODP_REGION_NUM (2) /* local regions are not used on Linux */ + +#define MY_EM_DEVICE_ID (0) +#define MY_EM_PROCESS_ID (0) + +/* + * Queue, pool and event definitions + */ +#define MY_EM_PROC_QUEUE_NUM (32) +#define MY_EM_PROC_QUEUE_TYPE (EM_QUEUE_TYPE_PARALLEL) +#define MY_EM_PROC_EVENT_TYPE (TI_EM_EVENT_TYPE_PRELOAD_OFF) + +#endif /* ODP_CONFIG_PLATFORM_H_ */ diff --git a/platform/linux-keystone2/include/configs/odp_config_platform_c6638.h b/platform/linux-keystone2/include/configs/odp_config_platform_c6638.h new file mode 100644 index 0000000..1b05ebf --- /dev/null +++ b/platform/linux-keystone2/include/configs/odp_config_platform_c6638.h @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2012, Texas Instruments Incorporated - http://www.ti.com/ + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Texas Instruments Incorporated nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +/* + * This is the typical configuration for TCI6638 (KeyStone 2, Linux ARM A15) + * + * Descriptors and PDSP communications memory must reside in contiguous and coherent DDR + * (using CMA). + * + * On KeyStone2 QMSS regions do not need to be ordered. + */ +#ifndef ODP_CONFIG_PLATFORM_C6638_H_ +#define ODP_CONFIG_PLATFORM_C6638_H_ + +/* Cores are here "EM cores" that are not necessarily tied to real "CPU cores" */ +#define MY_EM_CORE_NUM (4) /* number of cores used by OpenEM */ +#define MY_EM_INIT_CORE_IDX (0) /* core on which the init will be started */ + +/* Index of the QMSS PDSP that will be used by OpenEM, Linux use QMSS PDSP0 for accumulator */ +#define MY_EM_SCHED_PDSP_IDX (2) + +/* Define if we are polling or waiting on event interrupts when dispatching events */ +#define MY_EM_DISPATCH_MODE (TI_EM_RH_POLL_MODE) + +/* + * Coherent contiguous memory used for PDSP <-> CPU communication + * We use one page per slot and CORE_NUM + 2 slots + */ +#ifdef TI_EM_USE_MSM +#define MY_EM_PDSP_COMM_MEM_BASE (0x0c000000) /* MSM */ +#else +#define MY_EM_PDSP_COMM_MEM_BASE (0x0) /* use DDR from CMA (contiguous & coherent)*/ +#endif +#define MY_EM_PDSP_COMM_MEM_VBASE (0x0) /* dynamic mapping */ +#define MY_EM_PDSP_COMM_MEM_SIZE (0x00010000) /* allowing 16 slots */ +#define MY_EM_PDSP_COMM_MEM_OFFSET (0x0) /* no offset */ + +/* + * Base physical address for event descriptors. + * In the future in will be managed by Linux or platform resource manager. + */ +#ifdef TI_EM_USE_MSM +#define TI_ODP_PUBLIC_DESC_BASE (0x0c100000) /* MSM */ +#define TI_ODP_PUBLIC_DESC_VBASE (0x0) /* dynamic mapping */ +#define TI_ODP_PUBLIC_DESC_OFFSET (0x0) /* no offset, QMSS/PDSP mapping equal to CPU mapping */ +#else /* TI_EM_USE_MSM */ +#define TI_ODP_PUBLIC_DESC_BASE (0x0) /* use DDR from CMA (contiguous & coherent)*/ +#define TI_ODP_PUBLIC_DESC_VBASE (0x0) /* dynamic mapping */ +#define TI_ODP_PUBLIC_DESC_OFFSET (0x0) /* no offset, QMSS/PDSP mapping equal to CPU mapping */ +#endif /* TI_EM_USE_MSM */ + +#define TI_ODP_PUBLIC_REGION_IDX (1) /* Linux uses 12 & 13 on ARM, set in DTS */ +#define TI_ODP_PRIVATE_REGION_IDX (2) +#define TI_ODP_PUBLIC_START_DESC_IDX (0) /* start index for desc (Linux starts at 0x4000, set in DTS) */ +#define TI_ODP_PRIVATE_START_DESC_IDX (-1) /* Automatically computed */ + +#define TI_ODP_PRIVATE_DESC_BASE (TI_EM_PDSPSH_DRAM) /* use PDSP data RAM */ +#define TI_ODP_PRIVATE_DESC_OFFSET (TI_EM_PDSP_DRAM_OFFSET) /* offset between CPU and QMSS/PDSP mapping */ +#define TI_ODP_PRIVATE_DESC_VBASE (0x0) /* dynamic mapping */ + +/* + * For the time being, free queues that can be used from user application are + * harcoded here. In the future it will be provided by platform resource manager. + */ +#define TI_ODP_PUBLIC_QUEUE_BASE_IDX (QMSS_GENERAL_PURPOSE_USER_QUEUE_BASE) +#define TI_ODP_FREE_QUEUE_BASE_IDX (TI_ODP_PUBLIC_QUEUE_BASE_IDX + ODP_CONFIG_QUEUES) +#define MY_EM_PRIVATE_FREE_QUEUE_IDX (TI_ODP_FREE_QUEUE_BASE_IDX + ODP_CONFIG_BUFFER_POOLS) +#define MY_EM_SCHED_QUEUE_IDX (MY_EM_PRIVATE_FREE_QUEUE_IDX + 2) + +#endif /* ODP_CONFIG_PLATFORM_C6638_H_ */ diff --git a/platform/linux-keystone2/source/odp_init.c b/platform/linux-keystone2/source/odp_init.c new file mode 100644 index 0000000..b466e67 --- /dev/null +++ b/platform/linux-keystone2/source/odp_init.c @@ -0,0 +1,151 @@ +/* Copyright (c) 2013, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Make region_configs[] global, because hw_config is saved in + * ti_em_rh_init_global() and it references region_configs[]. + */ +static ti_em_osal_hw_region_config_t region_configs[TI_ODP_REGION_NUM]; + +static int ti_init_hw_config(void) +{ + ti_em_rh_hw_config_t hw_config; + ti_em_osal_hw_region_config_t *reg_config; + memset(&hw_config, 0, sizeof(ti_em_rh_hw_config_t)); + + /* Set ODP initialization parameters */ + hw_config.private_free_queue_idx = MY_EM_PRIVATE_FREE_QUEUE_IDX; + hw_config.hw_queue_base_idx = MY_EM_SCHED_QUEUE_IDX; + hw_config.dma_idx = -1; /* not used */ + hw_config.dma_queue_base_idx = 0; /* not used */ + hw_config.device_id = MY_EM_DEVICE_ID; + hw_config.process_id = MY_EM_PROCESS_ID; + hw_config.chain_config_ptr = NULL; + hw_config.dispatch_mode = MY_EM_DISPATCH_MODE; + + /* The location of the PDSP communication memory (physical address) */ + hw_config.pdsp_comm_mem_config.paddr = MY_EM_PDSP_COMM_MEM_BASE; + hw_config.pdsp_comm_mem_config.vaddr = MY_EM_PDSP_COMM_MEM_VBASE; + hw_config.pdsp_comm_mem_config.size = MY_EM_PDSP_COMM_MEM_SIZE; + hw_config.pdsp_comm_mem_config.offset = MY_EM_PDSP_COMM_MEM_OFFSET; + + TI_EM_OSAL_TRACE(2, "physical address of the PDSP communication memory is 0x%x\n", + hw_config.pdsp_comm_mem_config.paddr); + + /* Define descriptor regions */ + reg_config = ®ion_configs[TI_EM_RH_PUBLIC]; + reg_config->region_idx = TI_ODP_PUBLIC_REGION_IDX; + reg_config->desc_size = TI_ODP_PUBLIC_DESC_SIZE; + reg_config->desc_num = TI_ODP_PUBLIC_DESC_NUM; + reg_config->desc_base = TI_ODP_PUBLIC_DESC_BASE; + reg_config->desc_vbase = TI_ODP_PUBLIC_DESC_VBASE; + reg_config->desc_offset = TI_ODP_PUBLIC_DESC_OFFSET; + reg_config->desc_flag = TI_EM_RH_UNMANAGED_DESCRIPTOR; + reg_config->start_idx = TI_ODP_PUBLIC_START_DESC_IDX; + + reg_config = ®ion_configs[TI_EM_RH_PRIVATE]; + reg_config->region_idx = TI_ODP_PRIVATE_REGION_IDX; + reg_config->desc_size = TI_EM_PRIVATE_EVENT_DSC_SIZE; + reg_config->desc_num = TI_EM_RH_PRIVATE_EVENT_NUM; + reg_config->desc_base = TI_ODP_PRIVATE_DESC_BASE; + reg_config->desc_vbase = TI_ODP_PRIVATE_DESC_VBASE; + reg_config->desc_offset = TI_ODP_PRIVATE_DESC_OFFSET; + reg_config->desc_flag = TI_EM_RH_UNMANAGED_DESCRIPTOR; + reg_config->start_idx = TI_ODP_PRIVATE_START_DESC_IDX; + + hw_config.region_num = TI_ODP_REGION_NUM; + hw_config.region_configs = ®ion_configs[0]; + + /* Define PDSP configuration */ + hw_config.pdsp_num = 0; + /* do not use router (no chaining) */ + hw_config.pdsp_router.pdsp_id = -1; + + TI_EM_OSAL_TRACE(1, "calling EM global initialization\n"); + + /* call OpenEM global initialization */ + if (ti_em_rh_init_global(0, + NULL, + MY_EM_CORE_NUM, + &hw_config) != EM_OK) { + TI_EM_OSAL_ERROR("EM global initialization failed!\n"); + return -1; + } + + return 0; +} + + +int odp_init_global(void) +{ + odp_thread_init_global(); + + odp_system_info_init(); + + ti_em_osal_core_init_global(); + ti_init_hw_config(); + + if (odp_shm_init_global()) { + ODP_ERR("ODP shm init failed.\n"); + return -1; + } + + if (odp_buffer_pool_init_global()) { + ODP_ERR("ODP buffer pool init failed.\n"); + return -1; + } + + if (odp_queue_init_global()) { + ODP_ERR("ODP queue init failed.\n"); + return -1; + } + + if (odp_schedule_init_global()) { + ODP_ERR("ODP schedule init failed.\n"); + return -1; + } + + if (odp_pktio_init_global()) { + ODP_ERR("ODP packet io init failed.\n"); + return -1; + } + + if (odp_timer_init_global()) { + ODP_ERR("ODP timer init failed.\n"); + return -1; + } + + return 0; +} + + +int odp_init_local(int thr_id) +{ + odp_thread_init_local(thr_id); + + ti_em_rh_init_local(); + + if (odp_pktio_init_local()) { + ODP_ERR("ODP packet io local init failed.\n"); + return -1; + } + + if (odp_schedule_init_local()) { + ODP_ERR("ODP schedule local init failed.\n"); + return -1; + } + + return 0; +}