2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights reserved.
7 * Copyright (C) 2013 Imagination Technologies Ltd.
14 #define RTLX_MODULE_NAME "rtlx"
16 #define LX_NODE_BASE 10
18 #define MIPS_CPU_RTLX_IRQ 0
20 #define RTLX_VERSION 2
21 #define RTLX_xID 0x12345600
22 #define RTLX_ID (RTLX_xID | RTLX_VERSION)
23 #define RTLX_BUFFER_SIZE 2048
24 #define RTLX_CHANNELS 8
26 #define RTLX_CHANNEL_STDIO 0
27 #define RTLX_CHANNEL_DBG 1
28 #define RTLX_CHANNEL_SYSIO 2
30 void rtlx_starting(int vpe);
31 void rtlx_stopping(int vpe);
33 int rtlx_open(int index, int can_sleep);
34 int rtlx_release(int index);
35 ssize_t rtlx_read(int index, void __user *buff, size_t count);
36 ssize_t rtlx_write(int index, const void __user *buffer, size_t count);
37 unsigned int rtlx_read_poll(int index, int can_sleep);
38 unsigned int rtlx_write_poll(int index);
40 int __init rtlx_module_init(void);
41 void __exit rtlx_module_exit(void);
43 void _interrupt_sp(void);
45 extern struct vpe_notifications rtlx_notify;
46 extern const struct file_operations rtlx_fops;
47 extern void (*aprp_hook)(void);
50 RTLX_STATE_UNUSED = 0,
51 RTLX_STATE_INITIALISED,
52 RTLX_STATE_REMOTE_READY,
56 extern struct chan_waitqueues {
57 wait_queue_head_t rt_queue;
58 wait_queue_head_t lx_queue;
61 } channel_wqs[RTLX_CHANNELS];
63 /* each channel supports read and write.
64 linux (vpe0) reads lx_buffer and writes rt_buffer
65 SP (vpe1) reads rt_buffer and writes lx_buffer
68 enum rtlx_state rt_state;
69 enum rtlx_state lx_state;
73 /* read and write indexes per buffer */
74 int rt_write, rt_read;
77 int lx_write, lx_read;
81 extern struct rtlx_info {
83 enum rtlx_state state;
84 int ap_int_pending; /* Status of 0 or 1 for CONFIG_MIPS_CMP only */
86 struct rtlx_channel channel[RTLX_CHANNELS];
88 #endif /* __ASM_RTLX_H_ */