예제 #1
0
cfw_client_t * system_setup(T_QUEUE *q, handle_msg_cb_t cb, void *cb_data)
{
	cfw_client_t * client;

	/* Initialize OS abstraction */
	os_init();

	/* Setup BSP and get main queue */
	*q = bsp_setup();

	/* start Quark watchdog */
	wdt_start(WDT_MAX_TIMEOUT_MS);

	/* Component framework and services setup */
	client = cfw_app_setup(*q, cb, cb_data);
	pr_info(LOG_MODULE_MAIN, "cfw init done");

	/* Cproxy is another (deprecated) way to communicate with the component
	 * framework, used by some test commands and some services. Initialize
	 * it here. */
	cproxy_init(*q);

	/* Initialize ARC shared structure and start it. */
	shared_data->ports = port_get_port_table();
	shared_data->services = services;
	shared_data->service_mgr_port_id = cfw_get_service_mgr_port_id();
	start_arc(0);

	return client;
}
예제 #2
0
cfw_handle_t system_setup(T_QUEUE *q, handle_msg_cb_t cb, void *cb_data)
{
	cfw_handle_t handle;

	/* Initialize OS abstraction */
	os_init();

	/* Setup IPC and main queue */
	*q = ipc_setup();

	/* General hardware setup function, pass the ipc message handler if you
	 * want to use this feature. */
	soc_setup(ipc_handle_message);

	/* start Quark watchdog */
	wdt_start(WDT_MAX_TIMEOUT_MS);

	/* USB setup */
	usb_app_setup();

	/* Start log infrastructure */
	log_start(log_backend_uart);

	/* Enable test command engine async support through the main queue */
	tcmd_async_init(*q);
	/* Test commands will use the same port as the log system */
	set_tcmd_uart_port(CONFIG_UART_CONSOLE_INDEX);

	/* Component framework and services setup */
	handle = cfw_setup(*q, cb, NULL);
	pr_info(LOG_MODULE_MAIN, "cfw init done");

	/* Initialize ARC shared structure and start it. */
	shared_data->ports = port_get_port_table();
	shared_data->services = services;
	shared_data->service_mgr_port_id = cfw_get_service_mgr_port_id();
	start_arc(0);

	return handle;
}
예제 #3
0
STATIC_PREFIX int run_cmd(char * cmd)
{
    int argc;
    char * argv[4]={NULL,NULL,NULL,NULL};
    char * str;
    for(argc=0,str=cmd;argc<4;argc++)
    {
        while(*str==0x20)
            str++;
        if(*str==0)
            break;
        if(*str=='"')
        {
            argv[argc]=++str;
            while(*str!='"'&&*str!=0)
                str++;
            if(*str==0)
                break;
            *str++=0;
            continue;
        }
        argv[argc]=str;
        while(*str!=0x20&&*str!=0)
            str++;
        if(*str==0)
        {
            argc++;
            break;
        }
        *str++=0;
    }
    if(argc==0)
        return 1;
    switch(argv[0][0])
    {
    case 'w':
        debug_write_reg(argc,argv);
        break;
    case 'r':
        debug_read_reg(argc,argv);
        break;
#if (defined AML_DEBUGROM)||(CONFIG_ENABLE_SPL_MORE_CMD)
    case 'P':
        memory_pll_init(argc,argv);
        break;
    case 'S':
        show_setting_addr(argc,argv);
        break;
    case 'M':
        debugrom_ddr_init(argc,argv);
        break;
    case 'm':
        clk_msr(argc,argv);
        break;
    case 'B':
        debugrom_set_start(argc,argv);
        break;
#endif 
#if (defined AML_DEBUGROM)
    case 's':
        debugrom_save_to_spi(argc,argv);
        break;
    case 'c':
        caculate_sum(argc,argv);
        break;
#endif  
    case 'a':
        start_arc(argc,argv);
        break;  
    case 't':
    		restart_arm();
    		break;
    case 'q':
        return 0;
    }
    return 1;
}