2005-04-16 22:20:36 +00:00
|
|
|
#include <linux/serial_core.h>
|
2009-11-25 07:23:35 +00:00
|
|
|
#include <linux/io.h>
|
2008-12-25 09:17:34 +00:00
|
|
|
#include <linux/gpio.h>
|
2007-08-19 23:59:33 +00:00
|
|
|
|
2007-07-26 01:14:16 +00:00
|
|
|
#if defined(CONFIG_CPU_SUBTYPE_SH7706) || \
|
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7707) || \
|
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7708) || \
|
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7709)
|
2005-04-16 22:20:36 +00:00
|
|
|
# define SCPCR 0xA4000116 /* 16 bit SCI and SCIF */
|
|
|
|
# define SCPDR 0xA4000136 /* 8 bit SCI and SCIF */
|
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SH7705)
|
|
|
|
# define SCPCR 0xA4000116
|
|
|
|
# define SCPDR 0xA4000136
|
2007-12-26 02:45:06 +00:00
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SH7720) || \
|
2010-02-05 11:15:33 +00:00
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7721) || \
|
2010-11-17 10:59:31 +00:00
|
|
|
defined(CONFIG_ARCH_SH73A0) || \
|
2010-03-16 11:21:07 +00:00
|
|
|
defined(CONFIG_ARCH_SH7367) || \
|
|
|
|
defined(CONFIG_ARCH_SH7377) || \
|
|
|
|
defined(CONFIG_ARCH_SH7372)
|
2009-01-09 07:32:08 +00:00
|
|
|
# define PORT_PTCR 0xA405011EUL
|
|
|
|
# define PORT_PVCR 0xA4050122UL
|
2005-04-16 22:20:36 +00:00
|
|
|
#elif defined(CONFIG_SH_RTS7751R2D)
|
2008-10-29 07:16:02 +00:00
|
|
|
# define SCSPTR1 0xFFE0001C /* 8 bit SCIF */
|
2005-04-16 22:20:36 +00:00
|
|
|
# define SCSPTR2 0xFFE80020 /* 16 bit SCIF */
|
2007-05-15 07:25:47 +00:00
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SH7750) || \
|
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7750R) || \
|
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7750S) || \
|
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7091) || \
|
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7751) || \
|
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7751R)
|
2005-04-16 22:20:36 +00:00
|
|
|
# define SCSPTR1 0xffe0001c /* 8 bit SCI */
|
|
|
|
# define SCSPTR2 0xFFE80020 /* 16 bit SCIF */
|
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SH7760)
|
2006-02-01 11:06:06 +00:00
|
|
|
# define SCSPTR0 0xfe600024 /* 16 bit SCIF */
|
|
|
|
# define SCSPTR1 0xfe610024 /* 16 bit SCIF */
|
|
|
|
# define SCSPTR2 0xfe620024 /* 16 bit SCIF */
|
2007-06-20 09:27:10 +00:00
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
|
2006-09-27 07:32:13 +00:00
|
|
|
# define SCSPTR0 0xA4400000 /* 16 bit SCIF */
|
2007-03-27 09:13:51 +00:00
|
|
|
# define PACR 0xa4050100
|
|
|
|
# define PBCR 0xa4050102
|
2006-09-27 07:32:13 +00:00
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SH7343)
|
|
|
|
# define SCSPTR0 0xffe00010 /* 16 bit SCIF */
|
2006-12-11 11:28:03 +00:00
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SH7722)
|
2008-04-23 12:25:29 +00:00
|
|
|
# define PWDR 0xA4050166
|
|
|
|
# define PSCR 0xA405011E
|
2008-02-08 08:31:24 +00:00
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SH7366)
|
|
|
|
# define SCPDR0 0xA405013E /* 16 bit SCIF0 PSDR */
|
|
|
|
# define SCSPTR0 SCPDR0
|
2008-04-09 08:56:18 +00:00
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SH7723)
|
|
|
|
# define SCSPTR0 0xa4050160
|
2005-04-16 22:20:36 +00:00
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SH4_202)
|
|
|
|
# define SCSPTR2 0xffe80020 /* 16 bit SCIF */
|
2009-08-21 07:30:28 +00:00
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SH7757)
|
|
|
|
# define SCSPTR0 0xfe4b0020
|
2008-01-07 05:40:07 +00:00
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SH7763)
|
|
|
|
# define SCSPTR0 0xffe00024 /* 16 bit SCIF */
|
2006-02-01 11:06:06 +00:00
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SH7770)
|
|
|
|
# define SCSPTR0 0xff923020 /* 16 bit SCIF */
|
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SH7780)
|
|
|
|
# define SCSPTR0 0xffe00024 /* 16 bit SCIF */
|
2009-03-03 06:40:25 +00:00
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SH7785) || \
|
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7786)
|
2007-03-12 05:38:59 +00:00
|
|
|
# define SCSPTR0 0xffea0024 /* 16 bit SCIF */
|
2008-11-28 13:48:20 +00:00
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SH7201) || \
|
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7203) || \
|
2007-11-26 10:54:02 +00:00
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7206) || \
|
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7263)
|
2006-11-05 06:40:13 +00:00
|
|
|
# define SCSPTR0 0xfffe8020 /* 16 bit SCIF */
|
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SH7619)
|
|
|
|
# define SCSPTR0 0xf8400020 /* 16 bit SCIF */
|
2007-06-20 09:27:10 +00:00
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SHX3)
|
|
|
|
# define SCSPTR0 0xffc30020 /* 16 bit SCIF */
|
2005-04-16 22:20:36 +00:00
|
|
|
#else
|
|
|
|
# error CPU subtype not defined
|
|
|
|
#endif
|
|
|
|
|
2007-08-19 23:59:33 +00:00
|
|
|
#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
|
2007-12-26 02:45:06 +00:00
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7720) || \
|
2010-02-05 11:15:33 +00:00
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7721) || \
|
2010-11-17 10:59:31 +00:00
|
|
|
defined(CONFIG_ARCH_SH73A0) || \
|
2010-03-16 11:21:07 +00:00
|
|
|
defined(CONFIG_ARCH_SH7367) || \
|
|
|
|
defined(CONFIG_ARCH_SH7377) || \
|
|
|
|
defined(CONFIG_ARCH_SH7372)
|
2008-06-06 08:04:08 +00:00
|
|
|
# define SCIF_RFDC_MASK 0x007f
|
|
|
|
# define SCIF_TXROOM_MAX 64
|
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SH7763)
|
|
|
|
# define SCIF_RFDC_MASK 0x007f
|
|
|
|
# define SCIF_TXROOM_MAX 64
|
|
|
|
/* SH7763 SCIF2 support */
|
|
|
|
# define SCIF2_RFDC_MASK 0x001f
|
|
|
|
# define SCIF2_TXROOM_MAX 16
|
2005-04-16 22:20:36 +00:00
|
|
|
#else
|
2008-06-06 08:04:08 +00:00
|
|
|
# define SCIF_RFDC_MASK 0x001f
|
|
|
|
# define SCIF_TXROOM_MAX 16
|
2005-04-16 22:20:36 +00:00
|
|
|
#endif
|
|
|
|
|
2008-10-02 10:47:12 +00:00
|
|
|
#define SCxSR_TEND(port) (((port)->type == PORT_SCI) ? SCI_TEND : SCIF_TEND)
|
|
|
|
#define SCxSR_RDxF(port) (((port)->type == PORT_SCI) ? SCI_RDRF : SCIF_RDF)
|
|
|
|
#define SCxSR_TDxE(port) (((port)->type == PORT_SCI) ? SCI_TDRE : SCIF_TDFE)
|
|
|
|
#define SCxSR_FER(port) (((port)->type == PORT_SCI) ? SCI_FER : SCIF_FER)
|
|
|
|
#define SCxSR_PER(port) (((port)->type == PORT_SCI) ? SCI_PER : SCIF_PER)
|
|
|
|
#define SCxSR_BRK(port) (((port)->type == PORT_SCI) ? 0x00 : SCIF_BRK)
|
2011-06-08 09:19:37 +00:00
|
|
|
|
|
|
|
#define SCxSR_ERRORS(port) (to_sci_port(port)->cfg->error_mask)
|
2008-10-02 10:47:12 +00:00
|
|
|
|
2007-08-19 23:59:33 +00:00
|
|
|
#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
|
2007-12-26 02:45:06 +00:00
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7720) || \
|
2010-02-05 11:15:33 +00:00
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7721) || \
|
2010-11-17 10:59:31 +00:00
|
|
|
defined(CONFIG_ARCH_SH73A0) || \
|
2010-03-16 11:21:07 +00:00
|
|
|
defined(CONFIG_ARCH_SH7367) || \
|
|
|
|
defined(CONFIG_ARCH_SH7377) || \
|
|
|
|
defined(CONFIG_ARCH_SH7372)
|
2008-10-02 10:47:12 +00:00
|
|
|
# define SCxSR_RDxF_CLEAR(port) (sci_in(port, SCxSR) & 0xfffc)
|
|
|
|
# define SCxSR_ERROR_CLEAR(port) (sci_in(port, SCxSR) & 0xfd73)
|
|
|
|
# define SCxSR_TDxE_CLEAR(port) (sci_in(port, SCxSR) & 0xffdf)
|
|
|
|
# define SCxSR_BREAK_CLEAR(port) (sci_in(port, SCxSR) & 0xffe3)
|
2005-04-16 22:20:36 +00:00
|
|
|
#else
|
|
|
|
# define SCxSR_RDxF_CLEAR(port) (((port)->type == PORT_SCI) ? 0xbc : 0x00fc)
|
|
|
|
# define SCxSR_ERROR_CLEAR(port) (((port)->type == PORT_SCI) ? 0xc4 : 0x0073)
|
|
|
|
# define SCxSR_TDxE_CLEAR(port) (((port)->type == PORT_SCI) ? 0x78 : 0x00df)
|
|
|
|
# define SCxSR_BREAK_CLEAR(port) (((port)->type == PORT_SCI) ? 0xc4 : 0x00e3)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* SCFCR */
|
|
|
|
#define SCFCR_RFRST 0x0002
|
|
|
|
#define SCFCR_TFRST 0x0004
|
|
|
|
#define SCFCR_MCE 0x0008
|
|
|
|
|
|
|
|
#define SCI_MAJOR 204
|
|
|
|
#define SCI_MINOR_START 8
|
|
|
|
|
2011-06-08 08:06:25 +00:00
|
|
|
#define SCI_IN(size, offset) \
|
|
|
|
ioread##size(port->membase + (offset))
|
|
|
|
|
|
|
|
#define SCI_OUT(size, offset, value) \
|
|
|
|
iowrite##size(value, port->membase + (offset))
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
#define CPU_SCIx_FNS(name, sci_offset, sci_size, scif_offset, scif_size)\
|
|
|
|
static inline unsigned int sci_##name##_in(struct uart_port *port) \
|
|
|
|
{ \
|
2010-05-23 16:39:09 +00:00
|
|
|
if (port->type == PORT_SCIF || port->type == PORT_SCIFB) { \
|
2011-06-08 08:06:25 +00:00
|
|
|
return SCI_IN(scif_size, scif_offset); \
|
2008-11-11 03:19:05 +00:00
|
|
|
} else { /* PORT_SCI or PORT_SCIFA */ \
|
2011-06-08 08:06:25 +00:00
|
|
|
return SCI_IN(sci_size, sci_offset); \
|
2005-04-16 22:20:36 +00:00
|
|
|
} \
|
|
|
|
} \
|
|
|
|
static inline void sci_##name##_out(struct uart_port *port, unsigned int value) \
|
|
|
|
{ \
|
2010-05-23 16:39:09 +00:00
|
|
|
if (port->type == PORT_SCIF || port->type == PORT_SCIFB) { \
|
2011-06-08 08:06:25 +00:00
|
|
|
SCI_OUT(scif_size, scif_offset, value); \
|
2008-11-11 03:19:05 +00:00
|
|
|
} else { /* PORT_SCI or PORT_SCIFA */ \
|
|
|
|
SCI_OUT(sci_size, sci_offset, value); \
|
2005-04-16 22:20:36 +00:00
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
2009-04-28 04:40:15 +00:00
|
|
|
#define CPU_SCIF_FNS(name, scif_offset, scif_size) \
|
2005-04-16 22:20:36 +00:00
|
|
|
static inline unsigned int sci_##name##_in(struct uart_port *port) \
|
|
|
|
{ \
|
2011-06-08 08:06:25 +00:00
|
|
|
return SCI_IN(scif_size, scif_offset); \
|
2005-04-16 22:20:36 +00:00
|
|
|
} \
|
|
|
|
static inline void sci_##name##_out(struct uart_port *port, unsigned int value) \
|
|
|
|
{ \
|
|
|
|
SCI_OUT(scif_size, scif_offset, value); \
|
|
|
|
}
|
|
|
|
|
2010-03-16 11:21:07 +00:00
|
|
|
#if defined(CONFIG_CPU_SH3) || \
|
2010-11-17 10:59:31 +00:00
|
|
|
defined(CONFIG_ARCH_SH73A0) || \
|
2010-03-16 11:21:07 +00:00
|
|
|
defined(CONFIG_ARCH_SH7367) || \
|
|
|
|
defined(CONFIG_ARCH_SH7377) || \
|
|
|
|
defined(CONFIG_ARCH_SH7372)
|
2007-03-27 09:13:51 +00:00
|
|
|
#if defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
|
|
|
|
#define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \
|
2011-06-01 05:47:42 +00:00
|
|
|
sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
|
2007-03-27 09:13:51 +00:00
|
|
|
CPU_SCIx_FNS(name, sh4_sci_offset, sh4_sci_size, sh4_scif_offset, sh4_scif_size)
|
|
|
|
#define SCIF_FNS(name, sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
|
|
|
|
CPU_SCIF_FNS(name, sh4_scif_offset, sh4_scif_size)
|
2007-08-19 23:59:33 +00:00
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \
|
2007-12-26 02:45:06 +00:00
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7720) || \
|
2010-02-05 11:15:33 +00:00
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7721) || \
|
2011-04-28 03:10:35 +00:00
|
|
|
defined(CONFIG_ARCH_SH7367)
|
2010-05-23 16:39:09 +00:00
|
|
|
#define SCIF_FNS(name, scif_offset, scif_size) \
|
|
|
|
CPU_SCIF_FNS(name, scif_offset, scif_size)
|
2011-04-28 03:10:35 +00:00
|
|
|
#elif defined(CONFIG_ARCH_SH7377) || \
|
|
|
|
defined(CONFIG_ARCH_SH7372) || \
|
|
|
|
defined(CONFIG_ARCH_SH73A0)
|
2010-05-23 16:39:09 +00:00
|
|
|
#define SCIx_FNS(name, sh4_scifa_offset, sh4_scifa_size, sh4_scifb_offset, sh4_scifb_size) \
|
|
|
|
CPU_SCIx_FNS(name, sh4_scifa_offset, sh4_scifa_size, sh4_scifb_offset, sh4_scifb_size)
|
2005-04-16 22:20:36 +00:00
|
|
|
#define SCIF_FNS(name, scif_offset, scif_size) \
|
|
|
|
CPU_SCIF_FNS(name, scif_offset, scif_size)
|
|
|
|
#else
|
|
|
|
#define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \
|
2011-06-01 05:47:42 +00:00
|
|
|
sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
|
2005-04-16 22:20:36 +00:00
|
|
|
CPU_SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh3_scif_offset, sh3_scif_size)
|
|
|
|
#define SCIF_FNS(name, sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
|
|
|
|
CPU_SCIF_FNS(name, sh3_scif_offset, sh3_scif_size)
|
|
|
|
#endif
|
2009-04-15 02:42:47 +00:00
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SH7723) ||\
|
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7724)
|
2008-04-09 08:56:18 +00:00
|
|
|
#define SCIx_FNS(name, sh4_scifa_offset, sh4_scifa_size, sh4_scif_offset, sh4_scif_size) \
|
|
|
|
CPU_SCIx_FNS(name, sh4_scifa_offset, sh4_scifa_size, sh4_scif_offset, sh4_scif_size)
|
|
|
|
#define SCIF_FNS(name, sh4_scif_offset, sh4_scif_size) \
|
|
|
|
CPU_SCIF_FNS(name, sh4_scif_offset, sh4_scif_size)
|
2005-04-16 22:20:36 +00:00
|
|
|
#else
|
|
|
|
#define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \
|
2011-06-01 05:47:42 +00:00
|
|
|
sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
|
2005-04-16 22:20:36 +00:00
|
|
|
CPU_SCIx_FNS(name, sh4_sci_offset, sh4_sci_size, sh4_scif_offset, sh4_scif_size)
|
|
|
|
#define SCIF_FNS(name, sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
|
|
|
|
CPU_SCIF_FNS(name, sh4_scif_offset, sh4_scif_size)
|
|
|
|
#endif
|
|
|
|
|
2007-08-19 23:59:33 +00:00
|
|
|
#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
|
2007-12-26 02:45:06 +00:00
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7720) || \
|
2010-02-05 11:15:33 +00:00
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7721) || \
|
2011-04-28 03:10:35 +00:00
|
|
|
defined(CONFIG_ARCH_SH7367)
|
2007-03-27 09:13:51 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
SCIF_FNS(SCSMR, 0x00, 16)
|
|
|
|
SCIF_FNS(SCBRR, 0x04, 8)
|
|
|
|
SCIF_FNS(SCSCR, 0x08, 16)
|
|
|
|
SCIF_FNS(SCxSR, 0x14, 16)
|
|
|
|
SCIF_FNS(SCFCR, 0x18, 16)
|
|
|
|
SCIF_FNS(SCFDR, 0x1c, 16)
|
|
|
|
SCIF_FNS(SCxTDR, 0x20, 8)
|
|
|
|
SCIF_FNS(SCxRDR, 0x24, 8)
|
2010-02-05 11:15:33 +00:00
|
|
|
SCIF_FNS(SCLSR, 0x00, 0)
|
2011-04-28 03:10:35 +00:00
|
|
|
#elif defined(CONFIG_ARCH_SH7377) || \
|
|
|
|
defined(CONFIG_ARCH_SH7372) || \
|
|
|
|
defined(CONFIG_ARCH_SH73A0)
|
2010-05-23 16:39:09 +00:00
|
|
|
SCIF_FNS(SCSMR, 0x00, 16)
|
|
|
|
SCIF_FNS(SCBRR, 0x04, 8)
|
|
|
|
SCIF_FNS(SCSCR, 0x08, 16)
|
|
|
|
SCIF_FNS(SCTDSR, 0x0c, 16)
|
|
|
|
SCIF_FNS(SCFER, 0x10, 16)
|
|
|
|
SCIF_FNS(SCxSR, 0x14, 16)
|
|
|
|
SCIF_FNS(SCFCR, 0x18, 16)
|
|
|
|
SCIF_FNS(SCFDR, 0x1c, 16)
|
|
|
|
SCIF_FNS(SCTFDR, 0x38, 16)
|
|
|
|
SCIF_FNS(SCRFDR, 0x3c, 16)
|
|
|
|
SCIx_FNS(SCxTDR, 0x20, 8, 0x40, 8)
|
|
|
|
SCIx_FNS(SCxRDR, 0x24, 8, 0x60, 8)
|
|
|
|
SCIF_FNS(SCLSR, 0x00, 0)
|
2009-04-15 02:42:47 +00:00
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SH7723) ||\
|
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7724)
|
2008-04-09 08:56:18 +00:00
|
|
|
SCIx_FNS(SCSMR, 0x00, 16, 0x00, 16)
|
|
|
|
SCIx_FNS(SCBRR, 0x04, 8, 0x04, 8)
|
|
|
|
SCIx_FNS(SCSCR, 0x08, 16, 0x08, 16)
|
|
|
|
SCIx_FNS(SCxTDR, 0x20, 8, 0x0c, 8)
|
|
|
|
SCIx_FNS(SCxSR, 0x14, 16, 0x10, 16)
|
|
|
|
SCIx_FNS(SCxRDR, 0x24, 8, 0x14, 8)
|
2009-01-20 03:18:22 +00:00
|
|
|
SCIx_FNS(SCSPTR, 0, 0, 0, 0)
|
2008-04-09 08:56:18 +00:00
|
|
|
SCIF_FNS(SCFCR, 0x18, 16)
|
|
|
|
SCIF_FNS(SCFDR, 0x1c, 16)
|
|
|
|
SCIF_FNS(SCLSR, 0x24, 16)
|
2005-04-16 22:20:36 +00:00
|
|
|
#else
|
2011-06-01 05:47:42 +00:00
|
|
|
/* reg SCI/SH3 SCI/SH4 SCIF/SH3 SCIF/SH4 */
|
|
|
|
/* name off sz off sz off sz off sz */
|
|
|
|
SCIx_FNS(SCSMR, 0x00, 8, 0x00, 8, 0x00, 8, 0x00, 16)
|
|
|
|
SCIx_FNS(SCBRR, 0x02, 8, 0x04, 8, 0x02, 8, 0x04, 8)
|
|
|
|
SCIx_FNS(SCSCR, 0x04, 8, 0x08, 8, 0x04, 8, 0x08, 16)
|
|
|
|
SCIx_FNS(SCxTDR, 0x06, 8, 0x0c, 8, 0x06, 8, 0x0C, 8)
|
|
|
|
SCIx_FNS(SCxSR, 0x08, 8, 0x10, 8, 0x08, 16, 0x10, 16)
|
|
|
|
SCIx_FNS(SCxRDR, 0x0a, 8, 0x14, 8, 0x0A, 8, 0x14, 8)
|
2005-04-16 22:20:36 +00:00
|
|
|
SCIF_FNS(SCFCR, 0x0c, 8, 0x18, 16)
|
2007-03-12 05:38:59 +00:00
|
|
|
#if defined(CONFIG_CPU_SUBTYPE_SH7760) || \
|
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7780) || \
|
2009-03-03 06:40:25 +00:00
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7785) || \
|
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7786)
|
2008-07-29 15:56:39 +00:00
|
|
|
SCIF_FNS(SCFDR, 0x0e, 16, 0x1C, 16)
|
2006-02-01 11:06:06 +00:00
|
|
|
SCIF_FNS(SCTFDR, 0x0e, 16, 0x1C, 16)
|
|
|
|
SCIF_FNS(SCRFDR, 0x0e, 16, 0x20, 16)
|
|
|
|
SCIF_FNS(SCSPTR, 0, 0, 0x24, 16)
|
|
|
|
SCIF_FNS(SCLSR, 0, 0, 0x28, 16)
|
2008-07-29 15:56:39 +00:00
|
|
|
#elif defined(CONFIG_CPU_SUBTYPE_SH7763)
|
2008-06-06 08:04:08 +00:00
|
|
|
SCIF_FNS(SCFDR, 0, 0, 0x1C, 16)
|
2008-07-29 15:56:39 +00:00
|
|
|
SCIF_FNS(SCTFDR, 0x0e, 16, 0x1C, 16)
|
|
|
|
SCIF_FNS(SCRFDR, 0x0e, 16, 0x20, 16)
|
|
|
|
SCIF_FNS(SCSPTR, 0, 0, 0x24, 16)
|
|
|
|
SCIF_FNS(SCLSR, 0, 0, 0x28, 16)
|
2006-02-01 11:06:06 +00:00
|
|
|
#else
|
2005-04-16 22:20:36 +00:00
|
|
|
SCIF_FNS(SCFDR, 0x0e, 16, 0x1C, 16)
|
2008-04-23 12:31:14 +00:00
|
|
|
#if defined(CONFIG_CPU_SUBTYPE_SH7722)
|
|
|
|
SCIF_FNS(SCSPTR, 0, 0, 0, 0)
|
|
|
|
#else
|
2005-04-16 22:20:36 +00:00
|
|
|
SCIF_FNS(SCSPTR, 0, 0, 0x20, 16)
|
2008-04-23 12:31:14 +00:00
|
|
|
#endif
|
2005-04-16 22:20:36 +00:00
|
|
|
SCIF_FNS(SCLSR, 0, 0, 0x24, 16)
|
|
|
|
#endif
|
2006-02-01 11:06:06 +00:00
|
|
|
#endif
|
2005-04-16 22:20:36 +00:00
|
|
|
#define sci_in(port, reg) sci_##reg##_in(port)
|
|
|
|
#define sci_out(port, reg, value) sci_##reg##_out(port, value)
|