2 * Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights reserved.
3 * Copyright (C) 2013 Imagination Technologies Ltd.
11 #define RTLX_MODULE_NAME "rtlx"
13 #define LX_NODE_BASE 10
15 #define MIPS_CPU_RTLX_IRQ 0
17 #define RTLX_VERSION 2
18 #define RTLX_xID 0x12345600
19 #define RTLX_ID (RTLX_xID | RTLX_VERSION)
20 #define RTLX_BUFFER_SIZE 2048
21 #define RTLX_CHANNELS 8
23 #define RTLX_CHANNEL_STDIO 0
24 #define RTLX_CHANNEL_DBG 1
25 #define RTLX_CHANNEL_SYSIO 2
27 void rtlx_starting(int vpe
);
28 void rtlx_stopping(int vpe
);
30 int rtlx_open(int index
, int can_sleep
);
31 int rtlx_release(int index
);
32 ssize_t
rtlx_read(int index
, void __user
*buff
, size_t count
);
33 ssize_t
rtlx_write(int index
, const void __user
*buffer
, size_t count
);
34 unsigned int rtlx_read_poll(int index
, int can_sleep
);
35 unsigned int rtlx_write_poll(int index
);
37 int __init
rtlx_module_init(void);
38 void __exit
rtlx_module_exit(void);
40 void _interrupt_sp(void);
42 extern struct vpe_notifications rtlx_notify
;
43 extern const struct file_operations rtlx_fops
;
44 extern void (*aprp_hook
)(void);
47 RTLX_STATE_UNUSED
= 0,
48 RTLX_STATE_INITIALISED
,
49 RTLX_STATE_REMOTE_READY
,
53 extern struct chan_waitqueues
{
54 wait_queue_head_t rt_queue
;
55 wait_queue_head_t lx_queue
;
58 } channel_wqs
[RTLX_CHANNELS
];
60 /* each channel supports read and write.
61 linux (vpe0) reads lx_buffer and writes rt_buffer
62 SP (vpe1) reads rt_buffer and writes lx_buffer
65 enum rtlx_state rt_state
;
66 enum rtlx_state lx_state
;
70 /* read and write indexes per buffer */
71 int rt_write
, rt_read
;
74 int lx_write
, lx_read
;
78 extern struct rtlx_info
{
80 enum rtlx_state state
;
81 int ap_int_pending
; /* Status of 0 or 1 for CONFIG_MIPS_CMP only */
83 struct rtlx_channel channel
[RTLX_CHANNELS
];
85 #endif /* __ASM_RTLX_H_ */