From 2c973ef0cc3f981bfb137c3e42e08de5e8f1cc18 Mon Sep 17 00:00:00 2001 From: Deng-Cheng Zhu Date: Wed, 1 Jan 2014 16:26:46 +0100 Subject: MIPS: APRP: Split RTLX support into separate files. Split the RTLX functionality in preparation for adding support for CMP platforms. Common functions remain in the original file and a new file contains code specific to platforms that do not have a CMP. Signed-off-by: Deng-Cheng Zhu Signed-off-by: Steven J. Hill Reviewed-by: Qais Yousef Patchwork: http://patchwork.linux-mips.org/patch/6093/ Reviewed-by: John Crispin --- arch/mips/include/asm/rtlx.h | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) (limited to 'arch/mips/include/asm/rtlx.h') diff --git a/arch/mips/include/asm/rtlx.h b/arch/mips/include/asm/rtlx.h index 90985b61dbd9..676602649358 100644 --- a/arch/mips/include/asm/rtlx.h +++ b/arch/mips/include/asm/rtlx.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights reserved. - * + * Copyright (C) 2013 Imagination Technologies Ltd. */ #ifndef __ASM_RTLX_H_ @@ -8,6 +8,8 @@ #include +#define RTLX_MODULE_NAME "rtlx" + #define LX_NODE_BASE 10 #define MIPS_CPU_RTLX_IRQ 0 @@ -15,18 +17,31 @@ #define RTLX_VERSION 2 #define RTLX_xID 0x12345600 #define RTLX_ID (RTLX_xID | RTLX_VERSION) +#define RTLX_BUFFER_SIZE 2048 #define RTLX_CHANNELS 8 #define RTLX_CHANNEL_STDIO 0 #define RTLX_CHANNEL_DBG 1 #define RTLX_CHANNEL_SYSIO 2 -extern int rtlx_open(int index, int can_sleep); -extern int rtlx_release(int index); -extern ssize_t rtlx_read(int index, void __user *buff, size_t count); -extern ssize_t rtlx_write(int index, const void __user *buffer, size_t count); -extern unsigned int rtlx_read_poll(int index, int can_sleep); -extern unsigned int rtlx_write_poll(int index); +void rtlx_starting(int vpe); +void rtlx_stopping(int vpe); + +int rtlx_open(int index, int can_sleep); +int rtlx_release(int index); +ssize_t rtlx_read(int index, void __user *buff, size_t count); +ssize_t rtlx_write(int index, const void __user *buffer, size_t count); +unsigned int rtlx_read_poll(int index, int can_sleep); +unsigned int rtlx_write_poll(int index); + +int __init rtlx_module_init(void); +void __exit rtlx_module_exit(void); + +void _interrupt_sp(void); + +extern struct vpe_notifications rtlx_notify; +extern const struct file_operations rtlx_fops; +extern void (*aprp_hook)(void); enum rtlx_state { RTLX_STATE_UNUSED = 0, @@ -35,10 +50,15 @@ enum rtlx_state { RTLX_STATE_OPENED }; -#define RTLX_BUFFER_SIZE 2048 +extern struct chan_waitqueues { + wait_queue_head_t rt_queue; + wait_queue_head_t lx_queue; + atomic_t in_open; + struct mutex mutex; +} channel_wqs[RTLX_CHANNELS]; /* each channel supports read and write. - linux (vpe0) reads lx_buffer and writes rt_buffer + linux (vpe0) reads lx_buffer and writes rt_buffer SP (vpe1) reads rt_buffer and writes lx_buffer */ struct rtlx_channel { @@ -55,11 +75,10 @@ struct rtlx_channel { char *lx_buffer; }; -struct rtlx_info { +extern struct rtlx_info { unsigned long id; enum rtlx_state state; struct rtlx_channel channel[RTLX_CHANNELS]; -}; - +} *rtlx; #endif /* __ASM_RTLX_H_ */ -- cgit v1.2.3 From da615cf603e209fdf2e5917d84e070b34dd8daa1 Mon Sep 17 00:00:00 2001 From: Deng-Cheng Zhu Date: Wed, 1 Jan 2014 16:29:03 +0100 Subject: MIPS: APRP: Add RTLX API support for CMP platforms. This patch adds RTLX API support for platforms having a CMP. Signed-off-by: Deng-Cheng Zhu Signed-off-by: Steven J. Hill Reviewed-by: Qais Yousef Patchwork: http://patchwork.linux-mips.org/patch/6095/ Reviewed-by: John Crispin --- arch/mips/include/asm/rtlx.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/mips/include/asm/rtlx.h') diff --git a/arch/mips/include/asm/rtlx.h b/arch/mips/include/asm/rtlx.h index 676602649358..fa86dfdfd3de 100644 --- a/arch/mips/include/asm/rtlx.h +++ b/arch/mips/include/asm/rtlx.h @@ -78,6 +78,7 @@ struct rtlx_channel { extern struct rtlx_info { unsigned long id; enum rtlx_state state; + int ap_int_pending; /* Status of 0 or 1 for CONFIG_MIPS_CMP only */ struct rtlx_channel channel[RTLX_CHANNELS]; } *rtlx; -- cgit v1.2.3 From 5792bf6438658cb129c3022aa2cf7e9b19b5de3a Mon Sep 17 00:00:00 2001 From: "Steven J. Hill" Date: Wed, 1 Jan 2014 16:35:32 +0100 Subject: MIPS: APRP: Code formatting clean-ups. Clean-up code according to the 'checkpatch.pl' script. Signed-off-by: Steven J. Hill Reviewed-by: Qais Yousef Patchwork: http://patchwork.linux-mips.org/patch/6097/ Reviewed-by: John Crispin --- arch/mips/include/asm/rtlx.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'arch/mips/include/asm/rtlx.h') diff --git a/arch/mips/include/asm/rtlx.h b/arch/mips/include/asm/rtlx.h index fa86dfdfd3de..c1020654876e 100644 --- a/arch/mips/include/asm/rtlx.h +++ b/arch/mips/include/asm/rtlx.h @@ -1,8 +1,11 @@ /* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * * Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights reserved. * Copyright (C) 2013 Imagination Technologies Ltd. */ - #ifndef __ASM_RTLX_H_ #define __ASM_RTLX_H_ -- cgit v1.2.3