From: Dhaval Shah Date: Tue, 27 Mar 2018 06:51:13 +0000 (-0700) Subject: soc: xilinx: vcu: Provided API to get number of cores X-Git-Tag: xlnx_rebase_v4.14_2018.1~5 X-Git-Url: https://rtime.felk.cvut.cz/gitweb/zynq/linux.git/commitdiff_plain/e070ada07acaced31edd7359d239ca9b620658ec soc: xilinx: vcu: Provided API to get number of cores Number of cores related information is provided through the xvcu_get_num_cores API. Signed-off-by: Dhaval Shah Reviewed-by: Varunkumar Allagadapa Signed-off-by: Michal Simek --- diff --git a/drivers/soc/xilinx/xlnx_vcu.c b/drivers/soc/xilinx/xlnx_vcu.c index 3173c822e09a..98467ac33c1a 100644 --- a/drivers/soc/xilinx/xlnx_vcu.c +++ b/drivers/soc/xilinx/xlnx_vcu.c @@ -43,6 +43,7 @@ #define VCU_BUFFER_B_FRAME 0x5c #define VCU_WPP_EN 0x60 #define VCU_PLL_CLK_DEC 0x64 +#define VCU_NUM_CORE 0x6c #define VCU_GASKET_INIT 0x74 #define VCU_GASKET_VALUE 0x03 @@ -317,6 +318,19 @@ u32 xvcu_get_clock_frequency(struct xvcu_device *xvcu) } EXPORT_SYMBOL_GPL(xvcu_get_clock_frequency); +/** + * xvcu_get_num_cores - read the number of core register + * @xvcu: Pointer to the xvcu_device structure + * + * Return: Returns 32bit value + * + */ +u32 xvcu_get_num_cores(struct xvcu_device *xvcu) +{ + return xvcu_read(xvcu->logicore_reg_ba, VCU_NUM_CORE); +} +EXPORT_SYMBOL_GPL(xvcu_get_num_cores); + /** * xvcu_set_vcu_pll_info - Set the VCU PLL info * @xvcu: Pointer to the xvcu_device structure diff --git a/include/soc/xilinx/xlnx_vcu.h b/include/soc/xilinx/xlnx_vcu.h index c81c757eae68..9a226c634569 100644 --- a/include/soc/xilinx/xlnx_vcu.h +++ b/include/soc/xilinx/xlnx_vcu.h @@ -15,5 +15,6 @@ struct xvcu_device; u32 xvcu_get_color_depth(struct xvcu_device *xvcu); u32 xvcu_get_memory_depth(struct xvcu_device *xvcu); u32 xvcu_get_clock_frequency(struct xvcu_device *xvcu); +u32 xvcu_get_num_cores(struct xvcu_device *xvcu); #endif /* _XILINX_VCU_H_ */