diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-28 16:52:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-28 16:52:50 -0500 |
commit | e189f3495c4e30fc84fc9241096edf3932e23439 (patch) | |
tree | 5916c89ace81537a02ae01869386ba6caafdab9c /drivers/serial | |
parent | f4798748dee00c807a63f5518f08b3df161e0f6d (diff) | |
parent | 6582d7b7376aa587d74b08c74457dc28abc1a9fa (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (197 commits)
sh: add spi header and r2d platform data V3
sh: update r7780rp interrupt code
sh: remove consistent alloc stuff from the machine vector
sh: use declared coherent memory for dreamcast pci ethernet adapter
sh: declared coherent memory support V2
sh: Add support for SDK7780 board.
sh: constify function pointer tables
sh: Kill off -traditional for linker script.
cdrom: Add support for Sega Dreamcast GD-ROM.
sh: Kill off hs7751rvoip reference from arch/sh/Kconfig.
sh: Drop r7780rp_defconfig, use r7780mp_defconfig as kbuild default.
sh: Kill off dead HS771RVoIP board support.
sh: r7785rp: Fix up DECLARE_INTC_DESC() arg mismatch.
sh: r7785rp: Hook up the rest of the HL7785 FPGA IRQ vectors.
sh: r2d - enable sm501 usb host function
sh: remove voyagergx
sh: r2d - add lcd planel timings to sm501 platform data
sh: Add OHCI and UDC platform devices for SH7720.
sh: intc - remove default interrupt priority tables
sh: Correct pte size mismatch for X2 TLB.
...
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/sh-sci.c | 6 | ||||
-rw-r--r-- | drivers/serial/sh-sci.h | 48 |
2 files changed, 42 insertions, 12 deletions
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index 73440e26834b..ddf639144538 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
@@ -302,7 +302,7 @@ static void sci_init_pins_scif(struct uart_port* port, unsigned int cflag) | |||
302 | } | 302 | } |
303 | sci_out(port, SCFCR, fcr_val); | 303 | sci_out(port, SCFCR, fcr_val); |
304 | } | 304 | } |
305 | #elif defined(CONFIG_CPU_SUBTYPE_SH7720) | 305 | #elif defined(CONFIG_CPU_SUBTYPE_SH7720) || defined(CONFIG_CPU_SUBTYPE_SH7721) |
306 | static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag) | 306 | static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag) |
307 | { | 307 | { |
308 | unsigned int fcr_val = 0; | 308 | unsigned int fcr_val = 0; |
@@ -395,7 +395,8 @@ static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag) | |||
395 | } else { | 395 | } else { |
396 | #ifdef CONFIG_CPU_SUBTYPE_SH7343 | 396 | #ifdef CONFIG_CPU_SUBTYPE_SH7343 |
397 | /* Nothing */ | 397 | /* Nothing */ |
398 | #elif defined(CONFIG_CPU_SUBTYPE_SH7780) || \ | 398 | #elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \ |
399 | defined(CONFIG_CPU_SUBTYPE_SH7780) || \ | ||
399 | defined(CONFIG_CPU_SUBTYPE_SH7785) || \ | 400 | defined(CONFIG_CPU_SUBTYPE_SH7785) || \ |
400 | defined(CONFIG_CPU_SUBTYPE_SHX3) | 401 | defined(CONFIG_CPU_SUBTYPE_SHX3) |
401 | ctrl_outw(0x0080, SCSPTR0); /* Set RTS = 1 */ | 402 | ctrl_outw(0x0080, SCSPTR0); /* Set RTS = 1 */ |
@@ -408,6 +409,7 @@ static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag) | |||
408 | #endif | 409 | #endif |
409 | 410 | ||
410 | #if defined(CONFIG_CPU_SUBTYPE_SH7760) || \ | 411 | #if defined(CONFIG_CPU_SUBTYPE_SH7760) || \ |
412 | defined(CONFIG_CPU_SUBTYPE_SH7763) || \ | ||
411 | defined(CONFIG_CPU_SUBTYPE_SH7780) || \ | 413 | defined(CONFIG_CPU_SUBTYPE_SH7780) || \ |
412 | defined(CONFIG_CPU_SUBTYPE_SH7785) | 414 | defined(CONFIG_CPU_SUBTYPE_SH7785) |
413 | static inline int scif_txroom(struct uart_port *port) | 415 | static inline int scif_txroom(struct uart_port *port) |
diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h index d24621ce799a..f5764ebcfe07 100644 --- a/drivers/serial/sh-sci.h +++ b/drivers/serial/sh-sci.h | |||
@@ -46,7 +46,8 @@ | |||
46 | */ | 46 | */ |
47 | # define SCSCR_INIT(port) (port->mapbase == SCIF2) ? 0xF3 : 0xF0 | 47 | # define SCSCR_INIT(port) (port->mapbase == SCIF2) ? 0xF3 : 0xF0 |
48 | # define SCIF_ONLY | 48 | # define SCIF_ONLY |
49 | #elif defined(CONFIG_CPU_SUBTYPE_SH7720) | 49 | #elif defined(CONFIG_CPU_SUBTYPE_SH7720) || \ |
50 | defined(CONFIG_CPU_SUBTYPE_SH7721) | ||
50 | # define SCSCR_INIT(port) 0x0030 /* TIE=0,RIE=0,TE=1,RE=1 */ | 51 | # define SCSCR_INIT(port) 0x0030 /* TIE=0,RIE=0,TE=1,RE=1 */ |
51 | # define SCIF_ONLY | 52 | # define SCIF_ONLY |
52 | #define SCIF_ORER 0x0200 /* overrun error bit */ | 53 | #define SCIF_ORER 0x0200 /* overrun error bit */ |
@@ -119,6 +120,12 @@ | |||
119 | # define SCSCR_INIT(port) 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ | 120 | # define SCSCR_INIT(port) 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ |
120 | # define SCI_ONLY | 121 | # define SCI_ONLY |
121 | # define H8300_SCI_DR(ch) *(volatile char *)(P1DR + h8300_sci_pins[ch].port) | 122 | # define H8300_SCI_DR(ch) *(volatile char *)(P1DR + h8300_sci_pins[ch].port) |
123 | #elif defined(CONFIG_CPU_SUBTYPE_SH7763) | ||
124 | # define SCSPTR0 0xffe00024 /* 16 bit SCIF */ | ||
125 | # define SCSPTR1 0xffe08024 /* 16 bit SCIF */ | ||
126 | # define SCIF_ORER 0x0001 /* overrun error bit */ | ||
127 | # define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ | ||
128 | # define SCIF_ONLY | ||
122 | #elif defined(CONFIG_CPU_SUBTYPE_SH7770) | 129 | #elif defined(CONFIG_CPU_SUBTYPE_SH7770) |
123 | # define SCSPTR0 0xff923020 /* 16 bit SCIF */ | 130 | # define SCSPTR0 0xff923020 /* 16 bit SCIF */ |
124 | # define SCSPTR1 0xff924020 /* 16 bit SCIF */ | 131 | # define SCSPTR1 0xff924020 /* 16 bit SCIF */ |
@@ -142,7 +149,9 @@ | |||
142 | # define SCIF_OPER 0x0001 /* Overrun error bit */ | 149 | # define SCIF_OPER 0x0001 /* Overrun error bit */ |
143 | # define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ | 150 | # define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ |
144 | # define SCIF_ONLY | 151 | # define SCIF_ONLY |
145 | #elif defined(CONFIG_CPU_SUBTYPE_SH7206) | 152 | #elif defined(CONFIG_CPU_SUBTYPE_SH7203) || \ |
153 | defined(CONFIG_CPU_SUBTYPE_SH7206) || \ | ||
154 | defined(CONFIG_CPU_SUBTYPE_SH7263) | ||
146 | # define SCSPTR0 0xfffe8020 /* 16 bit SCIF */ | 155 | # define SCSPTR0 0xfffe8020 /* 16 bit SCIF */ |
147 | # define SCSPTR1 0xfffe8820 /* 16 bit SCIF */ | 156 | # define SCSPTR1 0xfffe8820 /* 16 bit SCIF */ |
148 | # define SCSPTR2 0xfffe9020 /* 16 bit SCIF */ | 157 | # define SCSPTR2 0xfffe9020 /* 16 bit SCIF */ |
@@ -214,7 +223,8 @@ | |||
214 | #define SCIF_DR 0x0001 /* 7705 SCIF, 7707 SCIF, 7709 SCIF, 7750 SCIF */ | 223 | #define SCIF_DR 0x0001 /* 7705 SCIF, 7707 SCIF, 7709 SCIF, 7750 SCIF */ |
215 | 224 | ||
216 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) || \ | 225 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) || \ |
217 | defined(CONFIG_CPU_SUBTYPE_SH7720) | 226 | defined(CONFIG_CPU_SUBTYPE_SH7720) || \ |
227 | defined(CONFIG_CPU_SUBTYPE_SH7721) | ||
218 | #define SCIF_ORER 0x0200 | 228 | #define SCIF_ORER 0x0200 |
219 | #define SCIF_ERRORS ( SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK | SCIF_ORER) | 229 | #define SCIF_ERRORS ( SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK | SCIF_ORER) |
220 | #define SCIF_RFDC_MASK 0x007f | 230 | #define SCIF_RFDC_MASK 0x007f |
@@ -252,7 +262,8 @@ | |||
252 | # define SCxSR_PER(port) SCIF_PER | 262 | # define SCxSR_PER(port) SCIF_PER |
253 | # define SCxSR_BRK(port) SCIF_BRK | 263 | # define SCxSR_BRK(port) SCIF_BRK |
254 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) || \ | 264 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) || \ |
255 | defined(CONFIG_CPU_SUBTYPE_SH7720) | 265 | defined(CONFIG_CPU_SUBTYPE_SH7720) || \ |
266 | defined(CONFIG_CPU_SUBTYPE_SH7721) | ||
256 | # define SCxSR_RDxF_CLEAR(port) (sci_in(port,SCxSR)&0xfffc) | 267 | # define SCxSR_RDxF_CLEAR(port) (sci_in(port,SCxSR)&0xfffc) |
257 | # define SCxSR_ERROR_CLEAR(port) (sci_in(port,SCxSR)&0xfd73) | 268 | # define SCxSR_ERROR_CLEAR(port) (sci_in(port,SCxSR)&0xfd73) |
258 | # define SCxSR_TDxE_CLEAR(port) (sci_in(port,SCxSR)&0xffdf) | 269 | # define SCxSR_TDxE_CLEAR(port) (sci_in(port,SCxSR)&0xffdf) |
@@ -361,7 +372,8 @@ | |||
361 | #define SCIF_FNS(name, sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \ | 372 | #define SCIF_FNS(name, sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \ |
362 | CPU_SCIF_FNS(name, sh4_scif_offset, sh4_scif_size) | 373 | CPU_SCIF_FNS(name, sh4_scif_offset, sh4_scif_size) |
363 | #elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \ | 374 | #elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \ |
364 | defined(CONFIG_CPU_SUBTYPE_SH7720) | 375 | defined(CONFIG_CPU_SUBTYPE_SH7720) || \ |
376 | defined(CONFIG_CPU_SUBTYPE_SH7721) | ||
365 | #define SCIF_FNS(name, scif_offset, scif_size) \ | 377 | #define SCIF_FNS(name, scif_offset, scif_size) \ |
366 | CPU_SCIF_FNS(name, scif_offset, scif_size) | 378 | CPU_SCIF_FNS(name, scif_offset, scif_size) |
367 | #else | 379 | #else |
@@ -388,7 +400,8 @@ | |||
388 | #endif | 400 | #endif |
389 | 401 | ||
390 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) || \ | 402 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) || \ |
391 | defined(CONFIG_CPU_SUBTYPE_SH7720) | 403 | defined(CONFIG_CPU_SUBTYPE_SH7720) || \ |
404 | defined(CONFIG_CPU_SUBTYPE_SH7721) | ||
392 | 405 | ||
393 | SCIF_FNS(SCSMR, 0x00, 16) | 406 | SCIF_FNS(SCSMR, 0x00, 16) |
394 | SCIF_FNS(SCBRR, 0x04, 8) | 407 | SCIF_FNS(SCBRR, 0x04, 8) |
@@ -412,6 +425,7 @@ SCIx_FNS(SCxSR, 0x08, 8, 0x10, 8, 0x08, 16, 0x10, 16, 0x04, 8) | |||
412 | SCIx_FNS(SCxRDR, 0x0a, 8, 0x14, 8, 0x0A, 8, 0x14, 8, 0x05, 8) | 425 | SCIx_FNS(SCxRDR, 0x0a, 8, 0x14, 8, 0x0A, 8, 0x14, 8, 0x05, 8) |
413 | SCIF_FNS(SCFCR, 0x0c, 8, 0x18, 16) | 426 | SCIF_FNS(SCFCR, 0x0c, 8, 0x18, 16) |
414 | #if defined(CONFIG_CPU_SUBTYPE_SH7760) || \ | 427 | #if defined(CONFIG_CPU_SUBTYPE_SH7760) || \ |
428 | defined(CONFIG_CPU_SUBTYPE_SH7763) || \ | ||
415 | defined(CONFIG_CPU_SUBTYPE_SH7780) || \ | 429 | defined(CONFIG_CPU_SUBTYPE_SH7780) || \ |
416 | defined(CONFIG_CPU_SUBTYPE_SH7785) | 430 | defined(CONFIG_CPU_SUBTYPE_SH7785) |
417 | SCIF_FNS(SCFDR, 0x0e, 16, 0x1C, 16) | 431 | SCIF_FNS(SCFDR, 0x0e, 16, 0x1C, 16) |
@@ -510,7 +524,8 @@ static inline void set_sh771x_scif_pfc(struct uart_port *port) | |||
510 | return; | 524 | return; |
511 | } | 525 | } |
512 | } | 526 | } |
513 | #elif defined(CONFIG_CPU_SUBTYPE_SH7720) | 527 | #elif defined(CONFIG_CPU_SUBTYPE_SH7720) || \ |
528 | defined(CONFIG_CPU_SUBTYPE_SH7721) | ||
514 | static inline int sci_rxd_in(struct uart_port *port) | 529 | static inline int sci_rxd_in(struct uart_port *port) |
515 | { | 530 | { |
516 | if (port->mapbase == 0xa4430000) | 531 | if (port->mapbase == 0xa4430000) |
@@ -580,6 +595,15 @@ static inline int sci_rxd_in(struct uart_port *port) | |||
580 | int ch = (port->mapbase - SMR0) >> 3; | 595 | int ch = (port->mapbase - SMR0) >> 3; |
581 | return (H8300_SCI_DR(ch) & h8300_sci_pins[ch].rx) ? 1 : 0; | 596 | return (H8300_SCI_DR(ch) & h8300_sci_pins[ch].rx) ? 1 : 0; |
582 | } | 597 | } |
598 | #elif defined(CONFIG_CPU_SUBTYPE_SH7763) | ||
599 | static inline int sci_rxd_in(struct uart_port *port) | ||
600 | { | ||
601 | if (port->mapbase == 0xffe00000) | ||
602 | return ctrl_inw(SCSPTR0) & 0x0001 ? 1 : 0; /* SCIF */ | ||
603 | if (port->mapbase == 0xffe08000) | ||
604 | return ctrl_inw(SCSPTR1) & 0x0001 ? 1 : 0; /* SCIF */ | ||
605 | return 1; | ||
606 | } | ||
583 | #elif defined(CONFIG_CPU_SUBTYPE_SH7770) | 607 | #elif defined(CONFIG_CPU_SUBTYPE_SH7770) |
584 | static inline int sci_rxd_in(struct uart_port *port) | 608 | static inline int sci_rxd_in(struct uart_port *port) |
585 | { | 609 | { |
@@ -617,7 +641,9 @@ static inline int sci_rxd_in(struct uart_port *port) | |||
617 | return ctrl_inw(SCSPTR5) & 0x0001 ? 1 : 0; /* SCIF */ | 641 | return ctrl_inw(SCSPTR5) & 0x0001 ? 1 : 0; /* SCIF */ |
618 | return 1; | 642 | return 1; |
619 | } | 643 | } |
620 | #elif defined(CONFIG_CPU_SUBTYPE_SH7206) | 644 | #elif defined(CONFIG_CPU_SUBTYPE_SH7203) || \ |
645 | defined(CONFIG_CPU_SUBTYPE_SH7206) || \ | ||
646 | defined(CONFIG_CPU_SUBTYPE_SH7263) | ||
621 | static inline int sci_rxd_in(struct uart_port *port) | 647 | static inline int sci_rxd_in(struct uart_port *port) |
622 | { | 648 | { |
623 | if (port->mapbase == 0xfffe8000) | 649 | if (port->mapbase == 0xfffe8000) |
@@ -688,11 +714,13 @@ static inline int sci_rxd_in(struct uart_port *port) | |||
688 | * -- Mitch Davis - 15 Jul 2000 | 714 | * -- Mitch Davis - 15 Jul 2000 |
689 | */ | 715 | */ |
690 | 716 | ||
691 | #if defined(CONFIG_CPU_SUBTYPE_SH7780) || \ | 717 | #if defined(CONFIG_CPU_SUBTYPE_SH7763) || \ |
718 | defined(CONFIG_CPU_SUBTYPE_SH7780) || \ | ||
692 | defined(CONFIG_CPU_SUBTYPE_SH7785) | 719 | defined(CONFIG_CPU_SUBTYPE_SH7785) |
693 | #define SCBRR_VALUE(bps, clk) ((clk+16*bps)/(16*bps)-1) | 720 | #define SCBRR_VALUE(bps, clk) ((clk+16*bps)/(16*bps)-1) |
694 | #elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \ | 721 | #elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \ |
695 | defined(CONFIG_CPU_SUBTYPE_SH7720) | 722 | defined(CONFIG_CPU_SUBTYPE_SH7720) || \ |
723 | defined(CONFIG_CPU_SUBTYPE_SH7721) | ||
696 | #define SCBRR_VALUE(bps, clk) (((clk*2)+16*bps)/(32*bps)-1) | 724 | #define SCBRR_VALUE(bps, clk) (((clk*2)+16*bps)/(32*bps)-1) |
697 | #elif defined(__H8300H__) || defined(__H8300S__) | 725 | #elif defined(__H8300H__) || defined(__H8300S__) |
698 | #define SCBRR_VALUE(bps) (((CONFIG_CPU_CLOCK*1000/32)/bps)-1) | 726 | #define SCBRR_VALUE(bps) (((CONFIG_CPU_CLOCK*1000/32)/bps)-1) |