diff options
author | Richard Zhu <Richard.Zhu@freescale.com> | 2015-01-08 15:08:42 +0800 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2015-01-15 21:19:02 -0600 |
commit | 58d805939bf2eabcd115928a7d843a415bfd36c0 (patch) | |
tree | a8c2eb3c99fab054bdcc9e9f61cce7e2a380c89b /include | |
parent | f6f8d217b8c4a28b5f04d96f8e2208edfc3aec9f (diff) |
MLK-10078-01 arm: mcc: platform related header changes
The platform related header changes when enable mcc2.0
on imx_3.14 kernel, and tested on imx6sx sdb board.
- keep imx6sx soc related apis in mcc_imx6sx.c/h
- keep linux os related apis in mcc_linux.c/h
- add some new mcc callback in mu driver, since the
gie3 of mu is used as cpu2cpu interrupter in the mcc
implementation on imx6sx.
Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/imx_sema4.h | 14 | ||||
-rw-r--r-- | include/linux/mcc_imx6sx.h | 33 | ||||
-rw-r--r-- | include/linux/mcc_linux.h | 59 |
3 files changed, 100 insertions, 6 deletions
diff --git a/include/linux/imx_sema4.h b/include/linux/imx_sema4.h index 83f319f805e9..9787980cbc84 100644 --- a/include/linux/imx_sema4.h +++ b/include/linux/imx_sema4.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014 Freescale Semiconductor, Inc. + * Copyright (C) 2014-2015 Freescale Semiconductor, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -37,24 +37,26 @@ static const unsigned int idx_sema4[16] = { }; struct imx_sema4_mutex { - u32 valid; - u32 gate_num; + unsigned int valid; + unsigned int gate_num; unsigned char gate_val; wait_queue_head_t wait_q; }; struct imx_sema4_mutex_device { struct device *dev; - u16 cpntf_val; - u16 cpine_val; + unsigned short cpntf_val; + unsigned short cpine_val; void __iomem *ioaddr; /* Mapped address */ spinlock_t lock; /* Mutex */ int irq; - u16 alloced; + unsigned short alloced; struct imx_sema4_mutex *mutex_ptr[16]; }; +extern struct imx_sema4_mutex *mcc_shm_ptr; + struct imx_sema4_mutex * imx_sema4_mutex_create(u32 dev_num, u32 mutex_num); int imx_sema4_mutex_destroy(struct imx_sema4_mutex *mutex_ptr); diff --git a/include/linux/mcc_imx6sx.h b/include/linux/mcc_imx6sx.h new file mode 100644 index 000000000000..82c926994fac --- /dev/null +++ b/include/linux/mcc_imx6sx.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2014-2015 Freescale Semiconductor, Inc. All Rights Reserved. + * + * SPDX-License-Identifier: GPL-2.0+ and/or BSD-3-Clause + * The GPL-2.0+ license for this file can be found in the COPYING.GPL file + * included with this distribution or at + * http://www.gnu.org/licenses/gpl-2.0.html + * The BSD-3-Clause License for this file can be found in the COPYING.BSD file + * included with this distribution or at + * http://opensource.org/licenses/BSD-3-Clause + */ + +/* + * Define the phiscal memory address on A9 and shared M4, + * This definition should be aligned on both A9 and M4 + */ +#define MCC_VECTOR_NUMBER_INVALID (0) + +enum { + INT_CPU_TO_CPU_MU_A2M = 122, + INT_CPU_TO_CPU_MU_M2A = 90, +}; + +/* 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); +/* Defined in MU driver */ +void mcc_clear_cpu_to_cpu_interrupt(void); +int mcc_triger_cpu_to_cpu_interrupt(void); +int imx_mcc_bsp_int_disable(void); +int imx_mcc_bsp_int_enable(void); diff --git a/include/linux/mcc_linux.h b/include/linux/mcc_linux.h new file mode 100644 index 000000000000..7dab31738189 --- /dev/null +++ b/include/linux/mcc_linux.h @@ -0,0 +1,59 @@ +/* + * This file contains prototypes for Linux-specific MCC library functions + * + * Copyright (C) 2014-2015 Freescale Semiconductor, Inc. All Rights Reserved. + * + * + * SPDX-License-Identifier: GPL-2.0+ and/or BSD-3-Clause + * The GPL-2.0+ license for this file can be found in the COPYING.GPL file + * included with this distribution or at + * http://www.gnu.org/licenses/gpl-2.0.html + * The BSD-3-Clause License for this file can be found in the COPYING.BSD file + * included with this distribution or at + * http://opensource.org/licenses/BSD-3-Clause + */ + +#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() +#define MCC_DCACHE_FLUSH() +#define MCC_DCACHE_FLUSH_LINE(p) +#define MCC_DCACHE_FLUSH_MLINES(p, m) +#define MCC_DCACHE_INVALIDATE() +#define MCC_DCACHE_INVALIDATE_LINE(p) +#define MCC_DCACHE_INVALIDATE_MLINES(p, m) + +#define MCC_LINUX_NODE_NUMBER (0) + +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); +int mcc_deinit_semaphore(unsigned int); +int mcc_get_semaphore(void); +int mcc_release_semaphore(void); + +/* CPU-to-CPU interrupt-related functions */ +int mcc_register_cpu_to_cpu_isr(void); +int mcc_generate_cpu_to_cpu_interrupt(void); + +/* Memory management-related functions */ +void mcc_memcpy(void *, 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__ */ |