X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fcommon%2Fcnxk%2Froc_model.h;h=cee06779bc19114615c2bb68612808589511a792;hb=f137566333308b91503bb18e079f598e9f02bb37;hp=a54f435b4660981d82b635766c889477a671c74a;hpb=fa4ac9512e90fea6af8b5954f6d9067d35f02f74;p=dpdk.git diff --git a/drivers/common/cnxk/roc_model.h b/drivers/common/cnxk/roc_model.h index a54f435b46..cee06779bc 100644 --- a/drivers/common/cnxk/roc_model.h +++ b/drivers/common/cnxk/roc_model.h @@ -23,10 +23,15 @@ struct roc_model { #define ROC_MODEL_CN106xx_A0 BIT_ULL(20) #define ROC_MODEL_CNF105xx_A0 BIT_ULL(21) #define ROC_MODEL_CNF105xxN_A0 BIT_ULL(22) +/* Following flags describe platform code is running on */ +#define ROC_ENV_HW BIT_ULL(61) +#define ROC_ENV_EMUL BIT_ULL(62) +#define ROC_ENV_ASIM BIT_ULL(63) uint64_t flag; #define ROC_MODEL_STR_LEN_MAX 128 char name[ROC_MODEL_STR_LEN_MAX]; + char env[ROC_MODEL_STR_LEN_MAX]; } __plt_cache_aligned; #define ROC_MODEL_CN96xx_Ax (ROC_MODEL_CN96xx_A0 | ROC_MODEL_CN96xx_B0) @@ -35,12 +40,17 @@ struct roc_model { ROC_MODEL_CNF95xx_B0 | ROC_MODEL_CNF95xxMM_A0 | \ ROC_MODEL_CNF95xxO_A0 | ROC_MODEL_CNF95xxN_A0 | ROC_MODEL_CN98xx_A0 | \ ROC_MODEL_CNF95xxN_A1) +#define ROC_MODEL_CNF9K \ + (ROC_MODEL_CNF95xx_A0 | ROC_MODEL_CNF95xx_B0 | \ + ROC_MODEL_CNF95xxMM_A0 | ROC_MODEL_CNF95xxO_A0 | \ + ROC_MODEL_CNF95xxN_A0 | ROC_MODEL_CNF95xxN_A1) #define ROC_MODEL_CN106xx (ROC_MODEL_CN106xx_A0) #define ROC_MODEL_CNF105xx (ROC_MODEL_CNF105xx_A0) #define ROC_MODEL_CNF105xxN (ROC_MODEL_CNF105xxN_A0) #define ROC_MODEL_CN10K \ (ROC_MODEL_CN106xx | ROC_MODEL_CNF105xx | ROC_MODEL_CNF105xxN) +#define ROC_MODEL_CNF10K (ROC_MODEL_CNF105xx | ROC_MODEL_CNF105xxN) /* Runtime variants */ static inline uint64_t @@ -158,6 +168,30 @@ roc_model_is_cnf10kb_a0(void) return roc_model->flag & ROC_MODEL_CNF105xxN_A0; } +static inline bool +roc_env_is_hw(void) +{ + return roc_model->flag & ROC_ENV_HW; +} + +static inline bool +roc_env_is_emulator(void) +{ + return roc_model->flag & ROC_ENV_EMUL; +} + +static inline bool +roc_env_is_asim(void) +{ + return roc_model->flag & ROC_ENV_ASIM; +} + +static inline const char * +roc_env_get(void) +{ + return roc_model->env; +} + int roc_model_init(struct roc_model *model); #endif