src/runtime_src/core/pcie/driver/linux/xocl/userpf/xocl_kds.c
/* The xocl_kds_update function sould be called after xclbin is
 * downloaded. Do not use this function in other place.
 */
The xocl_kds_update function sould be called after xclbin is
downloaded. Do not use this function in other place.
The xocl_kds_update function sould be called after xclbin is downloaded . Do not use this function in other place .
int xocl_kds_update(struct xocl_dev *xdev, struct drm_xocl_kds cfg)
{
	int ret = 0;
	struct ert_cu_bulletin brd;
	ret = xocl_ert_user_bulletin(xdev, &brd);
	if (ret == -ENODEV || !brd.cap.cu_intr) {
		ret = 0;
		userpf_info(xdev, "Not support CU to host interrupt");
		XDEV(xdev)->kds.cu_intr_cap = 0;
	} else {
		userpf_info(xdev, "Shell supports CU to host interrupt");
		XDEV(xdev)->kds.cu_intr_cap = 1;
	}
	xocl_kds_fa_clear(xdev);
	ret = xocl_detect_fa_cmdmem(xdev);
	if (ret) {
		userpf_info(xdev, "Detect FA cmdmem failed, ret %d", ret);
		goto out;
	}
	XDEV(xdev)->kds.cu_intr = 0;
	ret = kds_cfg_update(&XDEV(xdev)->kds);
	if (ret) {
		userpf_info(xdev, "KDS configure update failed, ret %d", ret);
		goto out;
	}
	ret = xocl_config_ert(xdev, cfg);
out:
	return ret;
}
int xocl_kds_update ( struct xocl_dev * xdev , struct drm_xocl_kds cfg ) { int ret = 0 ; struct ert_cu_bulletin brd ; ret = xocl_ert_user_bulletin ( xdev , & brd ) ; if ( ret == - ENODEV || ! brd . cap . cu_intr ) { ret = 0 ; userpf_info ( xdev , " " ) ; XDEV ( xdev ) -> kds . cu_intr_cap = 0 ; } else { userpf_info ( xdev , " " ) ; XDEV ( xdev ) -> kds . cu_intr_cap = 1 ; } xocl_kds_fa_clear ( xdev ) ; ret = xocl_detect_fa_cmdmem ( xdev ) ; if ( ret ) { userpf_info ( xdev , " " , ret ) ; goto out ; } XDEV ( xdev ) -> kds . cu_intr = 0 ; ret = kds_cfg_update ( & XDEV ( xdev ) -> kds ) ; if ( ret ) { userpf_info ( xdev , " " , ret ) ; goto out ; } ret = xocl_config_ert ( xdev , cfg ) ; out : return ret ; }
The xocl_kds_update function sould be called after xclbin is
 downloaded.
The xocl_kds_update function sould be called after xclbin is downloaded .
/* Detect if ERT subsystem is able to support CU to host interrupt
	 * This support is added since ERT ver3.0
	 *
	 * So, please make sure this is called after subdev init.
	 */ /* By default, use ERT */ /* Construct and send configure command */