Commit b5f464fb authored by Hari Kanigeri's avatar Hari Kanigeri

SYSLINK:proc-start and stop functionality

This patch implements the SysM3 and AppM3 start
and stop functionality. This exact functionality
is not verified as SysM3, AppM3 reset control is
not supported by Virtio.
Signed-off-by: default avatarHari Kanigeri <h-kanigeri2@ti.com>
parent ebe56d94
......@@ -35,6 +35,16 @@
#define DUCATI_DMM_START_ADDR 0xa0000000
#define DUCATI_DMM_POOL_SIZE 0x6000000
#define SYS_M3 2
#define APP_M3 3
#define CORE_PRM_BASE IO_ADDRESS(0x4a306700)
#define RM_MPU_M3_RSTCTRL_OFFSET 0x210
#define RM_MPU_M3_RSTST_OFFSET 0x214
#define RM_MPU_M3_RST1 0x1
#define RM_MPU_M3_RST2 0x2
#define RM_MPU_M3_RST3 0x4
/*OMAP4430 Module state object */
struct proc4430_module_object {
u32 config_size;
......@@ -127,6 +137,8 @@ int proc4430_setup(struct proc4430_config *cfg)
proc4430_get_config(&tmp_cfg);
cfg = &tmp_cfg;
}
/* Put SYS-M3 and APP M3 in reset */
__raw_writel(0x03, CORE_PRM_BASE + RM_MPU_M3_RSTCTRL_OFFSET);
if (proc4430_state.is_setup == false) {
dmm_create();
dmm_create_tables(DUCATI_DMM_START_ADDR, DUCATI_DMM_POOL_SIZE);
......@@ -442,10 +454,28 @@ int proc4430_detach(void *handle)
*
*/
int proc4430_start(void *handle, u32 entry_pt,
struct processor_start_params *params)
struct processor_start_params *start_params)
{
int retval = 0;
return retval;
int i;
switch (start_params->params->proc_id) {
case SYS_M3:
__raw_writel(0x02, CORE_PRM_BASE + RM_MPU_M3_RSTCTRL_OFFSET);
break;
case APP_M3:
i = __raw_readl(CORE_PRM_BASE + RM_MPU_M3_RSTCTRL_OFFSET);
if (i & RM_MPU_M3_RST1) {
printk(KERN_ALERT"ERROR: proc4430Start: SYS M3 is in"
"reset cannot start APP M3\n");
return -EFAULT;
}
__raw_writel(0x0, CORE_PRM_BASE + RM_MPU_M3_RSTCTRL_OFFSET);
break;
default:
printk("proc4430_start: ERROR input\n");
break;
}
return 0;
}
......@@ -462,12 +492,12 @@ int proc4430_start(void *handle, u32 entry_pt,
int
proc4430_stop(void *handle)
{
int retval = 0;
BUG_ON(handle == NULL);
/* TODO*/
return retval;
/* Stoppping both SYS M3 and APP M3 */
/* FIX ME: this needs to be changed to handle reset
* of only APPM3 case too
*/
__raw_writel(0x3, CORE_PRM_BASE + RM_MPU_M3_RSTCTRL_OFFSET);
return 0;
}
......
......@@ -84,7 +84,7 @@ struct proc_mgr_module_object proc_mgr_obj_state = {
.gate_handle = NULL,
.def_inst_params.proc_handle = NULL,
.def_attach_params.boot_mode = PROC_MGR_BOOTMODE_BOOT,
.def_start_params.reserved = 0
.def_start_params.proc_id = 0
};
......
......@@ -131,8 +131,7 @@ struct proc_mgr_attach_params {
* processor.
*/
struct proc_mgr_start_params {
u32 reserved;
/* Reserved for future params. */
u32 proc_id;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment