2005-07-14 09:57:16 -06:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2008-05-27 09:27:28 -06:00
|
|
|
#ifndef __ASM_RTLX_H_
|
2006-04-05 02:45:45 -06:00
|
|
|
#define __ASM_RTLX_H_
|
2005-07-14 09:57:16 -06:00
|
|
|
|
2007-01-07 10:14:29 -07:00
|
|
|
#include <irq.h>
|
|
|
|
|
2005-07-14 09:57:16 -06:00
|
|
|
#define LX_NODE_BASE 10
|
|
|
|
|
|
|
|
#define MIPS_CPU_RTLX_IRQ 0
|
|
|
|
|
2006-04-05 02:45:45 -06:00
|
|
|
#define RTLX_VERSION 2
|
2005-07-14 09:57:16 -06:00
|
|
|
#define RTLX_xID 0x12345600
|
|
|
|
#define RTLX_ID (RTLX_xID | RTLX_VERSION)
|
|
|
|
#define RTLX_CHANNELS 8
|
|
|
|
|
2006-04-05 02:45:45 -06:00
|
|
|
#define RTLX_CHANNEL_STDIO 0
|
|
|
|
#define RTLX_CHANNEL_DBG 1
|
|
|
|
#define RTLX_CHANNEL_SYSIO 2
|
2005-10-30 17:30:39 -07:00
|
|
|
|
2006-04-05 02:45:45 -06:00
|
|
|
extern int rtlx_open(int index, int can_sleep);
|
|
|
|
extern int rtlx_release(int index);
|
2007-03-16 06:16:27 -06:00
|
|
|
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);
|
2006-04-05 02:45:45 -06:00
|
|
|
extern unsigned int rtlx_read_poll(int index, int can_sleep);
|
|
|
|
extern unsigned int rtlx_write_poll(int index);
|
|
|
|
|
|
|
|
enum rtlx_state {
|
2008-04-16 07:32:22 -06:00
|
|
|
RTLX_STATE_UNUSED = 0,
|
2006-04-05 02:45:45 -06:00
|
|
|
RTLX_STATE_INITIALISED,
|
|
|
|
RTLX_STATE_REMOTE_READY,
|
|
|
|
RTLX_STATE_OPENED
|
|
|
|
};
|
|
|
|
|
2008-04-16 07:32:22 -06:00
|
|
|
#define RTLX_BUFFER_SIZE 2048
|
2005-10-30 17:30:39 -07:00
|
|
|
|
2005-07-14 09:57:16 -06:00
|
|
|
/* each channel supports read and write.
|
|
|
|
linux (vpe0) reads lx_buffer and writes rt_buffer
|
|
|
|
SP (vpe1) reads rt_buffer and writes lx_buffer
|
|
|
|
*/
|
2005-10-30 17:30:39 -07:00
|
|
|
struct rtlx_channel {
|
2006-04-05 02:45:45 -06:00
|
|
|
enum rtlx_state rt_state;
|
|
|
|
enum rtlx_state lx_state;
|
2005-07-14 09:57:16 -06:00
|
|
|
|
|
|
|
int buffer_size;
|
|
|
|
|
|
|
|
/* read and write indexes per buffer */
|
|
|
|
int rt_write, rt_read;
|
|
|
|
char *rt_buffer;
|
|
|
|
|
|
|
|
int lx_write, lx_read;
|
|
|
|
char *lx_buffer;
|
2005-10-30 17:30:39 -07:00
|
|
|
};
|
2005-07-14 09:57:16 -06:00
|
|
|
|
2005-10-30 17:30:39 -07:00
|
|
|
struct rtlx_info {
|
2005-07-14 09:57:16 -06:00
|
|
|
unsigned long id;
|
2006-04-05 02:45:45 -06:00
|
|
|
enum rtlx_state state;
|
2005-07-14 09:57:16 -06:00
|
|
|
|
|
|
|
struct rtlx_channel channel[RTLX_CHANNELS];
|
2005-10-30 17:30:39 -07:00
|
|
|
};
|
2005-07-14 09:57:16 -06:00
|
|
|
|
2006-04-05 02:45:45 -06:00
|
|
|
#endif /* __ASM_RTLX_H_ */
|