diff options
author | Richard Zhu <richard.zhu@freescale.com> | 2014-10-20 16:10:20 +0800 |
---|---|---|
committer | Richard Zhu <Richard.Zhu@freescale.com> | 2014-11-04 10:32:49 +0800 |
commit | 4ae7bb4ffe231caceb3256e2cb85de6ee48fc394 (patch) | |
tree | 09e9506252ca89902ee1067636bfcd2be1abc690 /include | |
parent | e939f15863418f928fa4c69530ef33f20cf9cc10 (diff) |
MLK-9707-4 arm: mcc: mcc2.0 updates platform related changes
the linux and soc(imx6sx) related modifications
in mcc2.0 updates.
- wrap linux os header into mcc_linux.h
- move the platform related macro definitions from
mcc_config.h to mcc_config_linux.h
- DO not use MCC_OS_USED macro in the mcc common codes
except the header file include.
- unify the phys and virt exchange callbacks.
Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mcc_config_linux.h | 56 | ||||
-rw-r--r-- | include/linux/mcc_imx6sx.h | 2 | ||||
-rw-r--r-- | include/linux/mcc_linux.h | 22 |
3 files changed, 72 insertions, 8 deletions
diff --git a/include/linux/mcc_config_linux.h b/include/linux/mcc_config_linux.h new file mode 100644 index 000000000000..49339904fd3d --- /dev/null +++ b/include/linux/mcc_config_linux.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2014 Freescale Semiconductor, Inc. + * Freescale IMX Linux-specific MCC implementation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __MCC_LINUX_CONFIG_ +#define __MCC_CLINUX_CONFIG_ + +/* base address of shared memory */ +#define MCC_BASE_ADDRESS (0xBFF00000) + +/* size (in bytes) and number of receive buffers */ +#define MCC_ATTR_NUM_RECEIVE_BUFFERS (10) +#define MCC_ATTR_BUFFER_SIZE_IN_BYTES (1024) + +/* maximum number of receive endpoints (application specific setting), + * do not assign it to a value greater than 255 ! */ +#define MCC_ATTR_MAX_RECEIVE_ENDPOINTS (5) + +/* size of the signal queue */ +#define MCC_MAX_OUTSTANDING_SIGNALS (10) + +/* number of cores */ +#define MCC_NUM_CORES (2) + +/* core number */ +#define MCC_CORE_NUMBER (_psp_core_num()) + +/* node number */ +#define MCC_NODE_NUMBER (_psp_node_num()) + +/* semaphore number */ +#define MCC_SHMEM_SEMAPHORE_NUMBER (1) +#define MCC_PRINTF_SEMAPHORE_NUMBER (2) +#define MCC_I2C_SEMAPHORE_NUMBER (3) +#define MCC_RESERVED1_SEMAPHORE_NUMBER (4) +#define MCC_RESERVED2_SEMAPHORE_NUMBER (5) +#define MCC_POWER_SHMEM_NUMBER (6) + +/* data non-copy mechanisms enabled */ +#define MCC_SEND_RECV_NOCOPY_API_ENABLED (1) + +#endif /* __MCC_LINUX_CONFIG_*/ + diff --git a/include/linux/mcc_imx6sx.h b/include/linux/mcc_imx6sx.h index 427cae50cd34..931d670d7484 100644 --- a/include/linux/mcc_imx6sx.h +++ b/include/linux/mcc_imx6sx.h @@ -1,7 +1,6 @@ /* * Copyright (C) 2014 Freescale Semiconductor, Inc. * Freescale IMX Linux-specific MCC implementation. - * Prototypes for iMX6sx-specific MCC library functions. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -49,6 +48,7 @@ extern struct regmap *imx_mu_reg; /* Return core num. A9 0, M4 1 */ unsigned int _psp_core_num(void); +unsigned int _psp_node_num(void); unsigned int mcc_get_cpu_to_cpu_vector(unsigned int); void mcc_clear_cpu_to_cpu_interrupt(unsigned int); diff --git a/include/linux/mcc_linux.h b/include/linux/mcc_linux.h index f8591de63e74..a2806c7ffcec 100644 --- a/include/linux/mcc_linux.h +++ b/include/linux/mcc_linux.h @@ -1,7 +1,6 @@ /* * Copyright (C) 2014 Freescale Semiconductor, Inc. * Freescale IMX Linux-specific MCC implementation. - * Prototypes for Linunx-specific MCC library functions * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -19,6 +18,9 @@ #ifndef __MCC_LINUX__ #define __MCC_LINUX__ +#include <linux/sched.h> +#include <linux/string.h> + /* Define the kinds of cache macros */ #define MCC_DCACHE_ENABLE(n) #define MCC_DCACHE_DISABLE() @@ -29,12 +31,12 @@ #define MCC_DCACHE_INVALIDATE_LINE(p) #define MCC_DCACHE_INVALIDATE_MLINES(p, m) -#define _mem_size unsigned int +#define MCC_LINUX_NODE_NUMBER (0) -void * virt_to_mqx(void *); -void * mqx_to_virt(void *); -#define VIRT_TO_MQX(x) virt_to_mqx(x) -#define MQX_TO_VIRT(x) mqx_to_virt(x) +void * mcc_virt_to_phys(void *); +void * mcc_phys_to_virt(void *); +#define MCC_MEM_VIRT_TO_PHYS(x) mcc_virt_to_phys(x) +#define MCC_MEM_PHYS_TO_VIRT(x) mcc_phys_to_virt(x) /* Semaphore-related functions */ int mcc_init_semaphore(unsigned int); @@ -48,6 +50,12 @@ int mcc_generate_cpu_to_cpu_interrupt(void); /* Memory management-related functions */ void mcc_memcpy(void *, void *, unsigned int); -void _mem_zero(void *, unsigned int); +int mcc_init_os_sync(void); +int mcc_deinit_os_sync(void); +void mcc_clear_os_sync_for_ep(MCC_ENDPOINT *); +int mcc_wait_for_buffer_freed(MCC_RECEIVE_BUFFER **, unsigned int); +int mcc_wait_for_buffer_queued(MCC_ENDPOINT *, unsigned int); + +MCC_BOOKEEPING_STRUCT *mcc_get_bookeeping_data(void); #endif /* __MCC_LINUX__ */ |