lib/sw_apps/libmetal_echo_demo/src/system/freertos/zynqmp_r5/zynqmp_amp_demo/sys_init.c
int sys_init()
{
	struct metal_init_params metal_param = METAL_INIT_DEFAULTS;
	int ret;

	enable_caches();
	init_uart();
	if (init_irq()) {
		LPERROR("Failed to initialize interrupt\n");
	}

	/* Initialize libmetal environment */
	metal_init(&metal_param);
	/* Initialize metal Xilinx IRQ controller */
	ret = metal_xlnx_irq_init();
	if (ret) {
		LPERROR("%s: Xilinx metal IRQ controller init failed.\n",
			__func__);
		return ret;
	}
	/* Register libmetal devices */
	ret = platform_register_metal_device();
	if (ret) {
		LPERROR("%s: failed to register devices: %d\n", __func__, ret);
		return ret;
	}

	/* Open libmetal devices which have been registered */
	ret = open_metal_devices();
	if (ret) {
		LPERROR("%s: failed to open devices: %d\n", __func__, ret);
		return ret;
	}
	return 0;
}
/**
 * @brief sys_init() - Register libmetal devices.
 *        This function register the libmetal generic bus, and then
 *        register the IPI, shared memory descriptor and shared memory
 *        devices to the libmetal generic bus.
 *
 * @return 0 - succeeded, non-zero for failures.
 */
@brief sys_init() - Register libmetal devices.
This function register the libmetal generic bus, and then
register the IPI, shared memory descriptor and shared memory
devices to the libmetal generic bus.

@return 0 - succeeded, non-zero for failures.
@brief sys_init () - Register libmetal devices . This function register the libmetal generic bus and then register the IPI shared memory descriptor and shared memory devices to the libmetal generic bus . @return 0 - succeeded non - zero for failures .
int sys_init()
{
	struct metal_init_params metal_param = METAL_INIT_DEFAULTS;
	int ret;
	enable_caches();
	init_uart();
	if (init_irq()) {
		LPERROR("Failed to initialize interrupt\n");
	}
	metal_init(&metal_param);
	ret = metal_xlnx_irq_init();
	if (ret) {
		LPERROR("%s: Xilinx metal IRQ controller init failed.\n",
			__func__);
		return ret;
	}
	ret = platform_register_metal_device();
	if (ret) {
		LPERROR("%s: failed to register devices: %d\n", __func__, ret);
		return ret;
	}
	ret = open_metal_devices();
	if (ret) {
		LPERROR("%s: failed to open devices: %d\n", __func__, ret);
		return ret;
	}
	return 0;
}
int sys_init ( ) { struct metal_init_params metal_param = METAL_INIT_DEFAULTS ; int ret ; enable_caches ( ) ; init_uart ( ) ; if ( init_irq ( ) ) { LPERROR ( " \n " ) ; } metal_init ( & metal_param ) ; ret = metal_xlnx_irq_init ( ) ; if ( ret ) { LPERROR ( " \n " , __func__ ) ; return ret ; } ret = platform_register_metal_device ( ) ; if ( ret ) { LPERROR ( " \n " , __func__ , ret ) ; return ret ; } ret = open_metal_devices ( ) ; if ( ret ) { LPERROR ( " \n " , __func__ , ret ) ; return ret ; } return 0 ; }
@brief sys_init() - Register libmetal devices.
@brief sys_init () - Register libmetal devices .
/* Initialize libmetal environment */ /* Initialize metal Xilinx IRQ controller */ /* Register libmetal devices */ /* Open libmetal devices which have been registered */