1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2021 Marvell.
9 #define PLT_INIT_CB_MAX 8
11 static int plt_init_cb_num;
12 static roc_plt_init_cb_t plt_init_cbs[PLT_INIT_CB_MAX];
15 roc_plt_init_cb_register(roc_plt_init_cb_t cb)
17 if (plt_init_cb_num >= PLT_INIT_CB_MAX)
20 plt_init_cbs[plt_init_cb_num++] = cb;
27 const struct rte_memzone *mz;
30 mz = rte_memzone_lookup(PLT_MODEL_MZ_NAME);
31 if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
33 mz = rte_memzone_reserve(PLT_MODEL_MZ_NAME,
34 sizeof(struct roc_model),
37 plt_err("Failed to reserve mem for roc_model");
40 roc_model_init(mz->addr);
44 plt_err("Failed to lookup mem for roc_model");
50 for (i = 0; i < plt_init_cb_num; i++) {
51 rc = (*plt_init_cbs[i])();
59 RTE_LOG_REGISTER(cnxk_logtype_base, pmd.cnxk.base, NOTICE);