Commit d647aa60 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 ddb598f9
...@@ -33,7 +33,17 @@ ...@@ -33,7 +33,17 @@
#include <syslink/ducatienabler.h> #include <syslink/ducatienabler.h>
#define DUCATI_DMM_START_ADDR 0xa0000000 #define DUCATI_DMM_START_ADDR 0xa0000000
#define DUCATI_DMM_POOL_SIZE 0x6000000 #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 */ /*OMAP4430 Module state object */
struct proc4430_module_object { struct proc4430_module_object {
...@@ -127,6 +137,8 @@ int proc4430_setup(struct proc4430_config *cfg) ...@@ -127,6 +137,8 @@ int proc4430_setup(struct proc4430_config *cfg)
proc4430_get_config(&tmp_cfg); proc4430_get_config(&tmp_cfg);
cfg = &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) { if (proc4430_state.is_setup == false) {
dmm_create(); dmm_create();
dmm_create_tables(DUCATI_DMM_START_ADDR, DUCATI_DMM_POOL_SIZE); dmm_create_tables(DUCATI_DMM_START_ADDR, DUCATI_DMM_POOL_SIZE);
...@@ -442,10 +454,28 @@ int proc4430_detach(void *handle) ...@@ -442,10 +454,28 @@ int proc4430_detach(void *handle)
* *
*/ */
int proc4430_start(void *handle, u32 entry_pt, int proc4430_start(void *handle, u32 entry_pt,
struct processor_start_params *params) struct processor_start_params *start_params)
{ {
int retval = 0; int i;
return retval;
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, ...@@ -462,12 +492,12 @@ int proc4430_start(void *handle, u32 entry_pt,
int int
proc4430_stop(void *handle) proc4430_stop(void *handle)
{ {
int retval = 0; /* Stoppping both SYS M3 and APP M3 */
/* FIX ME: this needs to be changed to handle reset
BUG_ON(handle == NULL); * of only APPM3 case too
*/
/* TODO*/ __raw_writel(0x3, CORE_PRM_BASE + RM_MPU_M3_RSTCTRL_OFFSET);
return retval; return 0;
} }
......
...@@ -84,7 +84,7 @@ struct proc_mgr_module_object proc_mgr_obj_state = { ...@@ -84,7 +84,7 @@ struct proc_mgr_module_object proc_mgr_obj_state = {
.gate_handle = NULL, .gate_handle = NULL,
.def_inst_params.proc_handle = NULL, .def_inst_params.proc_handle = NULL,
.def_attach_params.boot_mode = PROC_MGR_BOOTMODE_BOOT, .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 { ...@@ -131,8 +131,7 @@ struct proc_mgr_attach_params {
* processor. * processor.
*/ */
struct proc_mgr_start_params { struct proc_mgr_start_params {
u32 reserved; u32 proc_id;
/* Reserved for future params. */
}; };
......
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