]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
soc: xilinx: vcu: Provided API to get number of cores
authorDhaval Shah <dhaval.shah@xilinx.com>
Tue, 27 Mar 2018 06:51:13 +0000 (23:51 -0700)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 27 Mar 2018 08:25:45 +0000 (10:25 +0200)
Number of cores related information is provided
through the xvcu_get_num_cores API.

Signed-off-by: Dhaval Shah <dshah@xilinx.com>
Reviewed-by: Varunkumar Allagadapa <varunkumar.allagadapa@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/soc/xilinx/xlnx_vcu.c
include/soc/xilinx/xlnx_vcu.h

index 3173c822e09ab60670d16b217a734c5e630d2e65..98467ac33c1aad2bffd700403095c455a3b46c1c 100644 (file)
@@ -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
index c81c757eae6869b7511532998698925db932a910..9a226c6345695afa226738b9a2e9381e0ca0efb3 100644 (file)
@@ -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_ */