diff options
author | Suman Anna <s-anna@ti.com> | 2010-03-25 18:18:32 -0600 |
---|---|---|
committer | Hari Kanigeri <h-kanigeri2@ti.com> | 2010-07-09 17:57:47 -0500 |
commit | defea75cb3cd52a163e5d82608f69e8ad34210bc (patch) | |
tree | 523b337f5021da9f24129c2a4b706ee9a35a0f69 /arch/arm | |
parent | 8b5056875f5dafec7d7e67a2dbbb41b054ba3ff7 (diff) |
SYSLINK: ipc - added ipc module from SysLink 2.0
Added IPC module for SysLink 2.0. This replaces the sysmgr module.
Major changes:
- Setup and destroy of individual IPC modules has been moved to platform.c
- ipc module is dedicated to IPC-wide settings rather than module-specific
settings.
- sysmgr ioctl interfaces have been renamed as sysipc and use the new ipc
functions.
Signed-off-by: Simon Que <sque@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/plat-omap/include/syslink/ipc.h | 166 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/syslink/sysipc_ioctl.h (renamed from arch/arm/plat-omap/include/syslink/sysmgr_ioctl.h) | 100 |
2 files changed, 225 insertions, 41 deletions
diff --git a/arch/arm/plat-omap/include/syslink/ipc.h b/arch/arm/plat-omap/include/syslink/ipc.h new file mode 100644 index 000000000000..318602c89716 --- /dev/null +++ b/arch/arm/plat-omap/include/syslink/ipc.h @@ -0,0 +1,166 @@ +/* + * sysmgr.h + * + * Defines for System manager. + * + * Copyright(C) 2009 Texas Instruments, Inc. + * + * This package is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. + */ + +#ifndef _IPC_H_ +#define _IPC_H_ + + +/* Module headers */ +#include <multiproc.h> +#include <gatepeterson.h> +#include <sharedregion.h> +#include <notify.h> +#include <notify_ducatidriver.h> +#include <heap.h> +#include <heapbufmp.h> +#include <heapmemmp.h> + + + +/* Unique module ID. */ +#define IPC_MODULEID (0xF086) + + +/* ============================================================================= + * Module Success and Failure codes + * ============================================================================= + */ +/* The resource is still in use */ +#define IPC_S_BUSY 2 + +/* The module has been already setup */ +#define IPC_S_ALREADYSETUP 1 + +/* Operation is successful. */ +#define IPC_S_SUCCESS 0 + +/* Generic failure. */ +#define IPC_E_FAIL -1 + +/* Argument passed to function is invalid. */ +#define IPC_E_INVALIDARG -2 + +/* Operation resulted in memory failure. */ +#define IPC_E_MEMORY -3 + +/* The specified entity already exists. */ +#define IPC_E_ALREADYEXISTS -4 + +/* Unable to find the specified entity. */ +#define IPC_E_NOTFOUND -5 + +/* Operation timed out. */ +#define IPC_E_TIMEOUT -6 + +/* Module is not initialized. */ +#define IPC_E_INVALIDSTATE -7 + +/* A failure occurred in an OS-specific call */ +#define IPC_E_OSFAILURE -8 + +/* Specified resource is not available */ +#define IPC_E_RESOURCE -9 + +/* Operation was interrupted. Please restart the operation */ +#define IPC_E_RESTART -10 + + +/* ============================================================================= + * Macros + * ============================================================================= + */ +/* IPC_CONTROLCMD_LOADCALLBACK */ +#define IPC_CONTROLCMD_LOADCALLBACK (0xBABE0000) + +/* IPC_CONTROLCMD_STARTCALLBACK */ +#define IPC_CONTROLCMD_STARTCALLBACK (0xBABE0001) + +/* IPC_CONTROLCMD_STOPCALLBACK */ +#define IPC_CONTROLCMD_STOPCALLBACK (0xBABE0002) + + +/* ============================================================================= + * Enums & Structures + * ============================================================================= + */ +/* the different options for processor synchronization */ +enum ipc_proc_sync { + IPC_PROCSYNC_NONE, /* don't do any processor sync */ + IPC_PROCSYNC_PAIR, /* sync pair of processors in ipc_attach */ + IPC_PROCSYNC_ALL /* sync all processors, done in ipc_start */ +}; + +/* ipc configuration structure. */ +struct ipc_config { + enum ipc_proc_sync proc_sync; + /* the different options for processor synchronization */ +}; + +/* ipc configuration structure. */ +struct ipc_params { + bool setup_messageq; + bool setup_notify; + bool slave; + enum ipc_proc_sync proc_sync; +}; + + +/* ============================================================================= + * APIs + * ============================================================================= + */ +/* Attach to remote processor */ +int ipc_attach(u16 remote_proc_id); + +/* Detach from the remote processor */ +int ipc_detach(u16 remote_proc_id); + +/* Reads the config entry from the config area. */ +int ipc_read_config(u16 remote_proc_id, u32 tag, void *cfg, u32 size); + +/* Reserves memory, creates default gatemp and heapmemmp */ +int ipc_start(void); + +/* Writes the config entry to the config area. */ +int ipc_write_config(u16 remote_proc_id, u32 tag, void *cfg, u32 size); + +/* Returns default configuration values for ipc. */ +void ipc_get_config(struct ipc_config *cfg_params); + +/* Sets up ipc for this processor. */ +int ipc_setup(const struct ipc_config *cfg_params); + +/* Destroys ipc for this processor. */ +int ipc_destroy(void); + +/* Creates a ipc. */ +int ipc_create(u16 proc_id, struct ipc_params *params); + +/* Function to control a Ipc instance for a slave */ +int ipc_control(u16 proc_id, u32 cmd_id, void *arg); + +/* Function to read configuration information from ipc module */ +int ipc_read_config(u16 remote_proc_id, u32 tag, void *cfg, u32 size); + +/* Function to write configuration information to ipc module */ +int ipc_write_config(u16 remote_proc_id, u32 tag, void *cfg, u32 size); + +/* Clears memory, deletes default gatemp and heapmemmp */ +int ipc_stop(void); + + +#endif /* ifndef _IPC_H_ */ diff --git a/arch/arm/plat-omap/include/syslink/sysmgr_ioctl.h b/arch/arm/plat-omap/include/syslink/sysipc_ioctl.h index 03db7b9511a2..d5896c21c96d 100644 --- a/arch/arm/plat-omap/include/syslink/sysmgr_ioctl.h +++ b/arch/arm/plat-omap/include/syslink/sysipc_ioctl.h @@ -1,5 +1,5 @@ /* - * sysmgr_ioctl.h + * sysipc_ioctl.h * * Definitions of sysmgr driver types and structures.. * @@ -15,15 +15,15 @@ * PURPOSE. */ -#ifndef _SYSMGR_IOCTL_H_ -#define _SYSMGR_IOCTL_H_ +#ifndef _SYSIPC_IOCTL_H_ +#define _SYSIPC_IOCTL_H_ /* Standard headers */ #include <linux/types.h> /* Syslink headers */ #include <ipc_ioctl.h> -#include <sysmgr.h> +#include <ipc.h> /* ============================================================================= @@ -35,41 +35,41 @@ * ---------------------------------------------------------------------------- */ /* IOC Magic Number for sysmgr */ -#define SYSMGR_IOC_MAGIC IPC_IOC_MAGIC - -/* IOCTL command numbers for sysmgr */ -enum sysmgr_drv_cmd { - SYSMGR_SETUP = SYSMGR_BASE_CMD, - SYSMGR_DESTROY, - SYSMGR_LOADCALLBACK, - SYSMGR_STARTCALLBACK, - SYSMGR_STOPCALLBACK -}; - -/* Command for sysmgr_setup */ -#define CMD_SYSMGR_SETUP \ - _IOWR(SYSMGR_IOC_MAGIC, SYSMGR_SETUP, \ - struct sysmgr_cmd_args) - -/* Command for sysmgr_destroy */ -#define CMD_SYSMGR_DESTROY \ - _IOWR(SYSMGR_IOC_MAGIC, SYSMGR_DESTROY, \ - struct sysmgr_cmd_args) +#define SYSIPC_IOC_MAGIC IPC_IOC_MAGIC + +/* IOCTL command numbers for ipc/sysipc */ +enum sysipc_drv_cmd { + IPC_SETUP = IPC_BASE_CMD, + IPC_DESTROY, + IPC_CONTROL, + IPC_READCONFIG, + IPC_WRITECONFIG + }; + +/* Command for ipc_setup */ +#define CMD_IPC_SETUP \ + _IOWR(SYSIPC_IOC_MAGIC, IPC_SETUP, \ + struct sysipc_cmd_args) + +/* Command for ipc_destroy */ +#define CMD_IPC_DESTROY \ + _IOWR(SYSIPC_IOC_MAGIC, IPC_DESTROY, \ + struct sysipc_cmd_args) /* Command for load callback */ -#define CMD_SYSMGR_LOADCALLBACK \ - _IOWR(SYSMGR_IOC_MAGIC, SYSMGR_LOADCALLBACK, \ - struct sysmgr_cmd_args) +#define CMD_IPC_CONTROL \ + _IOWR(SYSIPC_IOC_MAGIC, IPC_CONTROL, \ + struct sysipc_cmd_args) -/* Command for load callback */ -#define CMD_SYSMGR_STARTCALLBACK \ - _IOWR(SYSMGR_IOC_MAGIC, SYSMGR_STARTCALLBACK, \ - struct sysmgr_cmd_args) +/* Command for ipc_read_config */ +#define CMD_IPC_READCONFIG \ + _IOWR(SYSIPC_IOC_MAGIC, IPC_READCONFIG, \ + struct sysipc_cmd_args) -/* Command for stop callback */ -#define CMD_SYSMGR_STOPCALLBACK \ - _IOWR(SYSMGR_IOC_MAGIC, SYSMGR_STOPCALLBACK, \ - struct sysmgr_cmd_args) +/* Command for ipc_write_config */ +#define CMD_IPC_WRITECONFIG \ + _IOWR(SYSIPC_IOC_MAGIC, IPC_WRITECONFIG, \ + struct sysipc_cmd_args) /* ---------------------------------------------------------------------------- @@ -77,13 +77,31 @@ enum sysmgr_drv_cmd { * ---------------------------------------------------------------------------- */ /* Command arguments for sysmgr */ -struct sysmgr_cmd_args { +struct sysipc_cmd_args { union { struct { - struct sysmgr_config *config; - } setup; + u16 proc_id; + s32 cmd_id; + void *arg; + } control; - int proc_id; + struct { + u16 remote_proc_id; + u32 tag; + void *cfg; + u32 size; + } read_config; + + struct { + u16 remote_proc_id; + u32 tag; + void *cfg; + u32 size; + } write_config; + + struct { + struct ipc_config *config; + } setup; } args; s32 api_status; @@ -94,7 +112,7 @@ struct sysmgr_cmd_args { * ---------------------------------------------------------------------------- */ /* ioctl interface function for sysmgr */ -int sysmgr_ioctl(struct inode *inode, struct file *filp, +int sysipc_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long args); -#endif /* _SYSMGR_IOCTL_H_ */ +#endif /* _SYSIPC_IOCTL_H_ */ |