lib/sw_services/xilplmi/src/xplmi.c
int XPlmi_RunTimeConfigInit(void)
{
	int Status = XST_FAILURE;
	u32 DevSecureState = XPlmi_In32(PMC_GLOBAL_GLOBAL_GEN_STORAGE2);

	Status = XPlmi_MemSet((u64)XPLMI_RTCFG_BASEADDR, 0U,
		(XPLMI_RTCFG_DBG_LOG_BUF_OFFSET >> XPLMI_WORD_LEN_SHIFT));
	if (Status != XST_SUCCESS) {
		goto END;
	}

	Status = XPlmi_MemSet((u64)(XPLMI_RTCFG_BASEADDR + XPLMI_RTCFG_LOG_UART_OFFSET),
		0U,	((XPLMI_RTCFG_SIZE - XPLMI_RTCFG_LOG_UART_OFFSET)
				>> XPLMI_WORD_LEN_SHIFT));
	if (Status != XST_SUCCESS) {
		goto END;
	}

	XPlmi_Out32(XPLMI_RTCFG_RTCA_ADDR, XPLMI_RTCFG_IDENTIFICATION);
	XPlmi_Out32(XPLMI_RTCFG_VERSION_ADDR, XPLMI_RTCFG_VER);
	XPlmi_Out32(XPLMI_RTCFG_SIZE_ADDR, XPLMI_RTCFG_SIZE);
	XPlmi_Out32(XPLMI_RTCFG_IMGINFOTBL_ADDRLOW_ADDR,
				XPLMI_IMAGE_INFO_TBL_BUFFER_ADDR);
	XPlmi_Out32(XPLMI_RTCFG_IMGINFOTBL_ADDRHIGH_ADDR,
				XPLMI_RTCFG_IMGINFOTBL_ADDR_HIGH);
	XPlmi_Out32(XPLMI_RTCFG_IMGINFOTBL_LEN_ADDR,
				XPLMI_RTCFG_IMGINFOTBL_LEN);
	XPlmi_Out32(XPLMI_RTCFG_SECURESTATE_AHWROT_ADDR,
				XPLMI_RTCFG_SECURESTATE_AHWROT);
	XPlmi_Out32(XPLMI_RTCFG_SECURESTATE_SHWROT_ADDR,
				XPLMI_RTCFG_SECURESTATE_SHWROT);
	XPlmi_Out32(XPLMI_RTCFG_PDI_ID_ADDR, XPLMI_RTCFG_PDI_ID);
	XPlmi_Out32(XPLMI_RTCFG_SECURE_STATE_ADDR, DevSecureState);

	/* Set PLM prints log level */
	DebugLog->LogLevel = ((u8)XPlmiDbgCurrentTypes << XPLMI_LOG_LEVEL_SHIFT) |
		(u8)XPlmiDbgCurrentTypes;

END:
	return Status;
}
/*****************************************************************************/
/**
 * @brief	This function initializes the Runtime Configuration Area with
 * default values.
 *
 * @return	XST_SUCCESS on success and error code on failure
 *
 *****************************************************************************/
@brief       This function initializes the Runtime Configuration Area with
default values.

@return      XST_SUCCESS on success and error code on failure
@brief This function initializes the Runtime Configuration Area with default values . @return XST_SUCCESS on success and error code on failure
int XPlmi_RunTimeConfigInit(void)
{
	int Status = XST_FAILURE;
	u32 DevSecureState = XPlmi_In32(PMC_GLOBAL_GLOBAL_GEN_STORAGE2);
	Status = XPlmi_MemSet((u64)XPLMI_RTCFG_BASEADDR, 0U,
		(XPLMI_RTCFG_DBG_LOG_BUF_OFFSET >> XPLMI_WORD_LEN_SHIFT));
	if (Status != XST_SUCCESS) {
		goto END;
	}
	Status = XPlmi_MemSet((u64)(XPLMI_RTCFG_BASEADDR + XPLMI_RTCFG_LOG_UART_OFFSET),
		0U,	((XPLMI_RTCFG_SIZE - XPLMI_RTCFG_LOG_UART_OFFSET)
				>> XPLMI_WORD_LEN_SHIFT));
	if (Status != XST_SUCCESS) {
		goto END;
	}
	XPlmi_Out32(XPLMI_RTCFG_RTCA_ADDR, XPLMI_RTCFG_IDENTIFICATION);
	XPlmi_Out32(XPLMI_RTCFG_VERSION_ADDR, XPLMI_RTCFG_VER);
	XPlmi_Out32(XPLMI_RTCFG_SIZE_ADDR, XPLMI_RTCFG_SIZE);
	XPlmi_Out32(XPLMI_RTCFG_IMGINFOTBL_ADDRLOW_ADDR,
				XPLMI_IMAGE_INFO_TBL_BUFFER_ADDR);
	XPlmi_Out32(XPLMI_RTCFG_IMGINFOTBL_ADDRHIGH_ADDR,
				XPLMI_RTCFG_IMGINFOTBL_ADDR_HIGH);
	XPlmi_Out32(XPLMI_RTCFG_IMGINFOTBL_LEN_ADDR,
				XPLMI_RTCFG_IMGINFOTBL_LEN);
	XPlmi_Out32(XPLMI_RTCFG_SECURESTATE_AHWROT_ADDR,
				XPLMI_RTCFG_SECURESTATE_AHWROT);
	XPlmi_Out32(XPLMI_RTCFG_SECURESTATE_SHWROT_ADDR,
				XPLMI_RTCFG_SECURESTATE_SHWROT);
	XPlmi_Out32(XPLMI_RTCFG_PDI_ID_ADDR, XPLMI_RTCFG_PDI_ID);
	XPlmi_Out32(XPLMI_RTCFG_SECURE_STATE_ADDR, DevSecureState);
	DebugLog->LogLevel = ((u8)XPlmiDbgCurrentTypes << XPLMI_LOG_LEVEL_SHIFT) |
		(u8)XPlmiDbgCurrentTypes;
END:
	return Status;
}
int XPlmi_RunTimeConfigInit ( void ) { int Status = XST_FAILURE ; u32 DevSecureState = XPlmi_In32 ( PMC_GLOBAL_GLOBAL_GEN_STORAGE2 ) ; Status = XPlmi_MemSet ( ( u64 ) XPLMI_RTCFG_BASEADDR , 0U , ( XPLMI_RTCFG_DBG_LOG_BUF_OFFSET >> XPLMI_WORD_LEN_SHIFT ) ) ; if ( Status != XST_SUCCESS ) { goto END ; } Status = XPlmi_MemSet ( ( u64 ) ( XPLMI_RTCFG_BASEADDR + XPLMI_RTCFG_LOG_UART_OFFSET ) , 0U , ( ( XPLMI_RTCFG_SIZE - XPLMI_RTCFG_LOG_UART_OFFSET ) >> XPLMI_WORD_LEN_SHIFT ) ) ; if ( Status != XST_SUCCESS ) { goto END ; } XPlmi_Out32 ( XPLMI_RTCFG_RTCA_ADDR , XPLMI_RTCFG_IDENTIFICATION ) ; XPlmi_Out32 ( XPLMI_RTCFG_VERSION_ADDR , XPLMI_RTCFG_VER ) ; XPlmi_Out32 ( XPLMI_RTCFG_SIZE_ADDR , XPLMI_RTCFG_SIZE ) ; XPlmi_Out32 ( XPLMI_RTCFG_IMGINFOTBL_ADDRLOW_ADDR , XPLMI_IMAGE_INFO_TBL_BUFFER_ADDR ) ; XPlmi_Out32 ( XPLMI_RTCFG_IMGINFOTBL_ADDRHIGH_ADDR , XPLMI_RTCFG_IMGINFOTBL_ADDR_HIGH ) ; XPlmi_Out32 ( XPLMI_RTCFG_IMGINFOTBL_LEN_ADDR , XPLMI_RTCFG_IMGINFOTBL_LEN ) ; XPlmi_Out32 ( XPLMI_RTCFG_SECURESTATE_AHWROT_ADDR , XPLMI_RTCFG_SECURESTATE_AHWROT ) ; XPlmi_Out32 ( XPLMI_RTCFG_SECURESTATE_SHWROT_ADDR , XPLMI_RTCFG_SECURESTATE_SHWROT ) ; XPlmi_Out32 ( XPLMI_RTCFG_PDI_ID_ADDR , XPLMI_RTCFG_PDI_ID ) ; XPlmi_Out32 ( XPLMI_RTCFG_SECURE_STATE_ADDR , DevSecureState ) ; DebugLog -> LogLevel = ( ( u8 ) XPlmiDbgCurrentTypes << XPLMI_LOG_LEVEL_SHIFT ) | ( u8 ) XPlmiDbgCurrentTypes ; END : return Status ; }
@brief       This function initializes the Runtime Configuration Area with
 default values.
@brief This function initializes the Runtime Configuration Area with default values .
/* Set PLM prints log level */