You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(47) |
Sep
(524) |
Oct
(365) |
Nov
(277) |
Dec
(178) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(431) |
Feb
(340) |
Mar
(249) |
Apr
(678) |
May
(407) |
Jun
(449) |
Jul
(712) |
Aug
(391) |
Sep
(205) |
Oct
(692) |
Nov
(45) |
Dec
(61) |
| 2002 |
Jan
(237) |
Feb
(28) |
Mar
(138) |
Apr
(59) |
May
(75) |
Jun
(65) |
Jul
|
Aug
(26) |
Sep
(3) |
Oct
(294) |
Nov
(193) |
Dec
(121) |
| 2003 |
Jan
(160) |
Feb
(2) |
Mar
(277) |
Apr
(71) |
May
(252) |
Jun
(82) |
Jul
(211) |
Aug
(184) |
Sep
(105) |
Oct
(129) |
Nov
(46) |
Dec
(13) |
| 2004 |
Jan
(37) |
Feb
(113) |
Mar
(115) |
Apr
(115) |
May
(45) |
Jun
(141) |
Jul
(13) |
Aug
(82) |
Sep
(12) |
Oct
(69) |
Nov
|
Dec
(37) |
| 2005 |
Jan
(18) |
Feb
(5) |
Mar
(79) |
Apr
(9) |
May
(47) |
Jun
(60) |
Jul
(10) |
Aug
(89) |
Sep
(28) |
Oct
(65) |
Nov
(54) |
Dec
(23) |
| 2006 |
Jan
(198) |
Feb
(51) |
Mar
(23) |
Apr
|
May
|
Jun
(6) |
Jul
(103) |
Aug
(217) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Takashi Y. <yo...@us...> - 2006-08-02 15:02:25
|
Update of /cvsroot/linuxsh/linux In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4026 Modified Files: ChangeLog Log Message: SHMIN board support added Index: ChangeLog =================================================================== RCS file: /cvsroot/linuxsh/linux/ChangeLog,v retrieving revision 1.367 retrieving revision 1.368 diff -u -d -r1.367 -r1.368 --- ChangeLog 2 Aug 2006 14:40:08 -0000 1.367 +++ ChangeLog 2 Aug 2006 15:02:20 -0000 1.368 @@ -1,3 +1,18 @@ +2006-08-02 Takashi YOSHII <tak...@op...> + + SHMIN board support added + + * arch/sh/Kconfig: New config SH_SHMIN to support SHMIN board + * arch/sh/Makefile: machdir shmin added + * arch/sh/tools/mach-types: mach-type SHMIN added + * arch/sh/boards/shmin: New directory for SHMIN + * arch/sh/boards/shmin/Makefile: New file for SHMIN + * arch/sh/boards/shmin/setup.c: New file for SHMIN + * include/asm-sh/shmin/shmin.h: New file for SHMIN + * arch/sh/configs/shmin_defconfig: New file for SHMIN + * drivers/net/ne.c: ifdef SHMIN added + + 2006-07-26 Takashi YOSHII <tak...@op...> SH7706 CPU support added |
|
From: Takashi Y. <yo...@us...> - 2006-08-02 14:52:14
|
Update of /cvsroot/linuxsh/linux/include/asm-sh/shmin In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv301/include/asm-sh/shmin Log Message: Directory /cvsroot/linuxsh/linux/include/asm-sh/shmin added to the repository |
|
From: Takashi Y. <yo...@us...> - 2006-08-02 14:47:35
|
Update of /cvsroot/linuxsh/linux/arch/sh/boards/shmin In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30583/arch/sh/boards/shmin Log Message: Directory /cvsroot/linuxsh/linux/arch/sh/boards/shmin added to the repository |
|
From: Takashi Y. <yo...@us...> - 2006-08-02 14:40:17
|
Update of /cvsroot/linuxsh/linux/arch/sh/mm In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27255/arch/sh/mm Modified Files: Kconfig Log Message: SH7706 CPU support added Index: Kconfig =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/mm/Kconfig,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Kconfig 19 Jul 2006 14:33:16 -0000 1.11 +++ Kconfig 2 Aug 2006 14:40:09 -0000 1.12 @@ -47,6 +47,12 @@ select CPU_SH3 select CPU_HAS_PINT_IRQ +config CPU_SUBTYPE_SH7706 + bool "Support SH7706 processor" + select CPU_SH3 + help + Select SH7706 if you have a 133 Mhz SH-3 HD6417706 CPU. + config CPU_SUBTYPE_SH7707 bool "Support SH7707 processor" select CPU_SH3 |
|
From: Takashi Y. <yo...@us...> - 2006-08-02 14:40:15
|
Update of /cvsroot/linuxsh/linux/drivers/serial In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27255/drivers/serial Modified Files: sh-sci.c sh-sci.h Log Message: SH7706 CPU support added Index: sh-sci.c =================================================================== RCS file: /cvsroot/linuxsh/linux/drivers/serial/sh-sci.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- sh-sci.c 2 Aug 2006 06:18:15 -0000 1.47 +++ sh-sci.c 2 Aug 2006 14:40:09 -0000 1.48 @@ -293,7 +293,7 @@ sci_out(port, SCFCR, 0); } #elif defined(CONFIG_CPU_SH3) -/* For SH7705, SH7707, SH7709, SH7709A, SH7729 */ +/* For SH7705, SH7706, SH7707, SH7709, SH7709A, SH7729 */ static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag) { unsigned int fcr_val = 0; Index: sh-sci.h =================================================================== RCS file: /cvsroot/linuxsh/linux/drivers/serial/sh-sci.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- sh-sci.h 1 Aug 2006 04:16:11 -0000 1.23 +++ sh-sci.h 2 Aug 2006 14:40:09 -0000 1.24 @@ -28,7 +28,9 @@ # define SCSPTR 0xffffff7c /* 8 bit */ # define SCSCR_INIT(port) 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ # define SCI_ONLY -#elif defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) +#elif defined(CONFIG_CPU_SUBTYPE_SH7707) || \ + defined(CONFIG_CPU_SUBTYPE_SH7709) || \ + defined(CONFIG_CPU_SUBTYPE_SH7706) # define SCPCR 0xA4000116 /* 16 bit SCI and SCIF */ # define SCPDR 0xA4000136 /* 8 bit SCI and SCIF */ # define SCSCR_INIT(port) 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ @@ -411,7 +413,9 @@ return ctrl_inb(SCSPTR)&0x01 ? 1 : 0; /* SCI */ return 1; } -#elif defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) +#elif defined(CONFIG_CPU_SUBTYPE_SH7707) || \ + defined(CONFIG_CPU_SUBTYPE_SH7709) || \ + defined(CONFIG_CPU_SUBTYPE_SH7706) static inline int sci_rxd_in(struct uart_port *port) { if (port->mapbase == 0xfffffe80) |
|
From: Takashi Y. <yo...@us...> - 2006-08-02 14:40:15
|
Update of /cvsroot/linuxsh/linux/arch/sh/kernel/cpu/sh3 In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27255/arch/sh/kernel/cpu/sh3 Modified Files: Makefile ex.S probe.c Added Files: clock-sh7706.c Log Message: SH7706 CPU support added --- NEW FILE: clock-sh7706.c --- /* * arch/sh/kernel/cpu/sh3/clock-sh7706.c * * SH7706 support for the clock framework * * Copyright (C) 2006 Takashi YOSHII * * Based on arch/sh/kernel/cpu/sh3/clock-sh7709.c * Copyright (C) 2005 Andriy Skulysh * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #include <linux/init.h> #include <linux/kernel.h> #include <asm/clock.h> #include <asm/freq.h> #include <asm/io.h> static int stc_multipliers[] = { 1, 2, 4, 1, 3, 6, 1, 1 }; static int ifc_divisors[] = { 1, 2, 4, 1, 3, 1, 1, 1 }; static int pfc_divisors[] = { 1, 2, 4, 1, 3, 6, 1, 1 }; static void master_clk_init(struct clk *clk) { int frqcr = ctrl_inw(FRQCR); int idx = ((frqcr & 0x2000) >> 11) | (frqcr & 0x0003); clk->rate *= pfc_divisors[idx]; } static struct clk_ops sh7706_master_clk_ops = { .init = master_clk_init, }; static void module_clk_recalc(struct clk *clk) { int frqcr = ctrl_inw(FRQCR); int idx = ((frqcr & 0x2000) >> 11) | (frqcr & 0x0003); clk->rate = clk->parent->rate / pfc_divisors[idx]; } static struct clk_ops sh7706_module_clk_ops = { .recalc = module_clk_recalc, }; static void bus_clk_recalc(struct clk *clk) { int frqcr = ctrl_inw(FRQCR); int idx = ((frqcr & 0x8000) >> 13) | ((frqcr & 0x0030) >> 4); clk->rate = clk->parent->rate / stc_multipliers[idx]; } static struct clk_ops sh7706_bus_clk_ops = { .recalc = bus_clk_recalc, }; static void cpu_clk_recalc(struct clk *clk) { int frqcr = ctrl_inw(FRQCR); int idx = ((frqcr & 0x4000) >> 12) | ((frqcr & 0x000c) >> 2); clk->rate = clk->parent->rate / ifc_divisors[idx]; } static struct clk_ops sh7706_cpu_clk_ops = { .recalc = cpu_clk_recalc, }; static struct clk_ops *sh7706_clk_ops[] = { &sh7706_master_clk_ops, &sh7706_module_clk_ops, &sh7706_bus_clk_ops, &sh7706_cpu_clk_ops, }; void __init arch_init_clk_ops(struct clk_ops **ops, int idx) { if (idx < ARRAY_SIZE(sh7706_clk_ops)) *ops = sh7706_clk_ops[idx]; } Index: Makefile =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/kernel/cpu/sh3/Makefile,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile 1 Aug 2006 02:54:42 -0000 1.7 +++ Makefile 2 Aug 2006 14:40:09 -0000 1.8 @@ -6,6 +6,7 @@ # CPU subtype setup obj-$(CONFIG_CPU_SUBTYPE_SH7705) += setup-sh7705.o +obj-$(CONFIG_CPU_SUBTYPE_SH7706) += setup-sh7709.o obj-$(CONFIG_CPU_SUBTYPE_SH7707) += setup-sh7709.o obj-$(CONFIG_CPU_SUBTYPE_SH7708) += setup-sh7708.o obj-$(CONFIG_CPU_SUBTYPE_SH7709) += setup-sh7709.o @@ -15,6 +16,7 @@ clock-$(CONFIG_CPU_SH3) := clock-sh3.o clock-$(CONFIG_CPU_SUBTYPE_SH7300) := clock-sh7300.o clock-$(CONFIG_CPU_SUBTYPE_SH7705) := clock-sh7705.o +clock-$(CONFIG_CPU_SUBTYPE_SH7706) := clock-sh7706.o clock-$(CONFIG_CPU_SUBTYPE_SH7709) := clock-sh7709.o obj-y += $(clock-y) Index: ex.S =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/kernel/cpu/sh3/ex.S,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ex.S 20 Jun 2004 20:27:22 -0000 1.4 +++ ex.S 2 Aug 2006 14:40:09 -0000 1.5 @@ -86,6 +86,7 @@ .long do_IRQ .long do_IRQ /* 5E0 */ #if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \ + defined(CONFIG_CPU_SUBTYPE_SH7706) || \ defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7705) .long do_IRQ ! 32 IRQ irq0 /* 600 */ .long do_IRQ ! 33 irq1 Index: probe.c =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/kernel/cpu/sh3/probe.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- probe.c 30 Aug 2004 12:55:31 -0000 1.2 +++ probe.c 2 Aug 2006 14:40:09 -0000 1.3 @@ -72,6 +72,9 @@ cpu_data->dcache.sets = 256; cpu_data->type = CPU_SH7729; +#if defined(CONFIG_CPU_SUBTYPE_SH7706) + cpu_data->type = CPU_SH7706; +#endif #if defined(CONFIG_CPU_SUBTYPE_SH7705) cpu_data->type = CPU_SH7705; |
|
From: Takashi Y. <yo...@us...> - 2006-08-02 14:40:15
|
Update of /cvsroot/linuxsh/linux/include/asm-sh/cpu-sh3 In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27255/include/asm-sh/cpu-sh3 Modified Files: mmu_context.h Log Message: SH7706 CPU support added Index: mmu_context.h =================================================================== RCS file: /cvsroot/linuxsh/linux/include/asm-sh/cpu-sh3/mmu_context.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- mmu_context.h 7 Jan 2006 20:05:01 -0000 1.4 +++ mmu_context.h 2 Aug 2006 14:40:10 -0000 1.5 @@ -28,6 +28,7 @@ #define EXPEVT 0xffffffd4 #if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \ + defined(CONFIG_CPU_SUBTYPE_SH7706) || \ defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7705) #define INTEVT 0xa4000000 /* INTEVTE2(0xa4000000) */ #else |
|
From: Takashi Y. <yo...@us...> - 2006-08-02 14:40:14
|
Update of /cvsroot/linuxsh/linux/arch/sh/kernel In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27255/arch/sh/kernel Modified Files: setup.c Log Message: SH7706 CPU support added Index: setup.c =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/kernel/setup.c,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- setup.c 31 Jul 2006 08:30:48 -0000 1.54 +++ setup.c 2 Aug 2006 14:40:09 -0000 1.55 @@ -426,6 +426,7 @@ static const char *cpu_name[] = { [CPU_SH7604] = "SH7604", [CPU_SH7705] = "SH7705", + [CPU_SH7706] = "SH7706", [CPU_SH7708] = "SH7708", [CPU_SH7729] = "SH7729", [CPU_SH7300] = "SH7300", |
|
From: Takashi Y. <yo...@us...> - 2006-08-02 14:40:14
|
Update of /cvsroot/linuxsh/linux/include/asm-sh In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27255/include/asm-sh Modified Files: irq.h processor.h Log Message: SH7706 CPU support added Index: irq.h =================================================================== RCS file: /cvsroot/linuxsh/linux/include/asm-sh/irq.h,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- irq.h 11 Jul 2006 07:47:01 -0000 1.31 +++ irq.h 2 Aug 2006 14:40:10 -0000 1.32 @@ -193,7 +193,7 @@ #if defined (CONFIG_CPU_SUBTYPE_SH7707) || defined (CONFIG_CPU_SUBTYPE_SH7708) || \ defined (CONFIG_CPU_SUBTYPE_SH7709) || defined (CONFIG_CPU_SUBTYPE_SH7750) || \ - defined (CONFIG_CPU_SUBTYPE_SH7751) + defined (CONFIG_CPU_SUBTYPE_SH7751) || defined (CONFIG_CPU_SUBTYPE_SH7706) #define SCI_ERI_IRQ 23 #define SCI_RXI_IRQ 24 #define SCI_TXI_IRQ 25 @@ -208,6 +208,7 @@ #define SCIF0_IPR_POS 3 #define SCIF0_PRIORITY 3 #elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \ + defined(CONFIG_CPU_SUBTYPE_SH7706) || \ defined(CONFIG_CPU_SUBTYPE_SH7707) || \ defined(CONFIG_CPU_SUBTYPE_SH7709) #define SCIF_ERI_IRQ 56 @@ -262,6 +263,7 @@ #elif defined(CONFIG_CPU_SUBTYPE_SH7708) # define ONCHIP_NR_IRQS 32 #elif defined(CONFIG_CPU_SUBTYPE_SH7709) || \ + defined(CONFIG_CPU_SUBTYPE_SH7706) || \ defined(CONFIG_CPU_SUBTYPE_SH7705) # define ONCHIP_NR_IRQS 64 // Actually 61 # define PINT_NR_IRQS 16 @@ -477,6 +479,7 @@ #define INTC_ICR 0xfffffee0UL #elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \ + defined(CONFIG_CPU_SUBTYPE_SH7706) || \ defined(CONFIG_CPU_SUBTYPE_SH7707) || \ defined(CONFIG_CPU_SUBTYPE_SH7709) #define INTC_IRR0 0xa4000004UL Index: processor.h =================================================================== RCS file: /cvsroot/linuxsh/linux/include/asm-sh/processor.h,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- processor.h 7 Jul 2006 03:42:09 -0000 1.36 +++ processor.h 2 Aug 2006 14:40:10 -0000 1.37 @@ -37,7 +37,8 @@ CPU_SH7604, /* SH-3 types */ - CPU_SH7705, CPU_SH7707, CPU_SH7708, CPU_SH7708S, CPU_SH7708R, + CPU_SH7705, CPU_SH7706, CPU_SH7707, + CPU_SH7708, CPU_SH7708S, CPU_SH7708R, CPU_SH7709, CPU_SH7709A, CPU_SH7729, CPU_SH7300, /* SH-4 types */ |
|
From: Takashi Y. <yo...@us...> - 2006-08-02 14:40:13
|
Update of /cvsroot/linuxsh/linux/arch/sh/kernel/cpu/irq In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27255/arch/sh/kernel/cpu/irq Modified Files: ipr.c Log Message: SH7706 CPU support added Index: ipr.c =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/kernel/cpu/irq/ipr.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ipr.c 8 Jan 2006 12:21:42 -0000 1.2 +++ ipr.c 2 Aug 2006 14:40:09 -0000 1.3 @@ -90,6 +90,7 @@ disable_ipr_irq(irq); #if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \ + defined(CONFIG_CPU_SUBTYPE_SH7706) || \ defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7705) /* This is needed when we use edge triggered setting */ /* XXX: Is it really needed? */ @@ -163,6 +164,7 @@ #endif #if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \ + defined(CONFIG_CPU_SUBTYPE_SH7706) || \ defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7705) /* * Initialize the Interrupt Controller (INTC) |
|
From: Takashi Y. <yo...@us...> - 2006-08-02 14:40:12
|
Update of /cvsroot/linuxsh/linux In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27255 Modified Files: ChangeLog Log Message: SH7706 CPU support added Index: ChangeLog =================================================================== RCS file: /cvsroot/linuxsh/linux/ChangeLog,v retrieving revision 1.366 retrieving revision 1.367 diff -u -d -r1.366 -r1.367 --- ChangeLog 5 Jul 2006 07:19:04 -0000 1.366 +++ ChangeLog 2 Aug 2006 14:40:08 -0000 1.367 @@ -1,3 +1,21 @@ +2006-07-26 Takashi YOSHII <tak...@op...> + + SH7706 CPU support added + + * arch/sh/mm/Kconfig: New config CPU_SUBTYPE_SH7706 added + * include/asm-sh/irq.h: ifdef SH7706 added + * include/asm-sh/processor.h: cpu_type SH7706 added + * include/asm-sh/cpu-sh3/mmu_context.h: ifdef SH7706 added + * arch/sh/kernel/setup.c: cpu_name SH7706 added + * arch/sh/kernel/cpu/irq/ipr.c: ifdef SH7706 added + * arch/sh/kernel/cpu/sh3/Makefile: setup and clock for sh7706 added + * arch/sh/kernel/cpu/sh3/probe.c: cpu_data->type SH7706 added + * arch/sh/kernel/cpu/sh3/clock-sh7706.c: New file for SH7706 + * arch/sh/kernel/cpu/sh3/ex.S: ifdef SH7706 added + * drivers/serial/sh-sci.c: A comment for SH7706 added + * drivers/serial/sh-sci.h: ifdef SH7706 added + + 2006-06-05 Adrian McMenamin <ad...@mc...> Dreamcast AICA driver tidy |
|
From: Paul M. <le...@us...> - 2006-08-02 06:18:19
|
Update of /cvsroot/linuxsh/linux/drivers/serial In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv7896/drivers/serial Modified Files: sh-sci.c Log Message: Complete overhaul of sh-sci locking. Index: sh-sci.c =================================================================== RCS file: /cvsroot/linuxsh/linux/drivers/serial/sh-sci.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- sh-sci.c 1 Aug 2006 10:12:06 -0000 1.46 +++ sh-sci.c 2 Aug 2006 06:18:15 -0000 1.47 @@ -111,8 +111,8 @@ unsigned short status; int c; - local_irq_save(flags); - do { + spin_lock_irqsave(&port->lock, flags); + do { status = sci_in(port, SCxSR); if (status & SCxSR_ERRORS(port)) { handle_error(port); @@ -122,7 +122,7 @@ c = sci_in(port, SCxRDR); sci_in(port, SCxSR); /* Dummy read */ sci_out(port, SCxSR, SCxSR_RDxF_CLEAR(port)); - local_irq_restore(flags); + spin_unlock_irqrestore(&port->lock, flags); return c; } @@ -134,7 +134,7 @@ unsigned long flags; unsigned short status; - local_irq_save(flags); + spin_lock_irqsave(&port->lock, flags); do { status = sci_in(port, SCxSR); @@ -144,7 +144,7 @@ sci_in(port, SCxSR); /* Dummy read */ sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port)); - local_irq_restore(flags); + spin_unlock_irqrestore(&port->lock, flags); } #endif @@ -380,14 +380,12 @@ { struct circ_buf *xmit = &port->info->xmit; unsigned int stopped = uart_tx_stopped(port); - unsigned long flags; unsigned short status; unsigned short ctrl; int count; status = sci_in(port, SCxSR); if (!(status & SCxSR_TDxE(port))) { - local_irq_save(flags); ctrl = sci_in(port, SCSCR); if (uart_circ_empty(xmit)) { ctrl &= ~SCI_CTRL_FLAGS_TIE; @@ -395,7 +393,6 @@ ctrl |= SCI_CTRL_FLAGS_TIE; } sci_out(port, SCSCR, ctrl); - local_irq_restore(flags); return; } @@ -431,7 +428,6 @@ if (uart_circ_empty(xmit)) { sci_stop_tx(port); } else { - local_irq_save(flags); ctrl = sci_in(port, SCSCR); #if !defined(SCI_ONLY) @@ -443,7 +439,6 @@ ctrl |= SCI_CTRL_FLAGS_TIE; sci_out(port, SCSCR, ctrl); - local_irq_restore(flags); } } @@ -634,7 +629,7 @@ s->break_flag = 1; #endif /* Notify of BREAK */ - if(tty_insert_flip_char(tty, 0, TTY_BREAK)) + if (tty_insert_flip_char(tty, 0, TTY_BREAK)) copied++; pr_debug("sci: BREAK detected\n"); } @@ -643,7 +638,7 @@ /* XXX: Handle SCIF overrun error */ if (port->type == PORT_SCIF && (sci_in(port, SCLSR) & SCIF_ORER) != 0) { sci_out(port, SCLSR, 0); - if(tty_insert_flip_char(tty, 0, TTY_OVERRUN)) { + if (tty_insert_flip_char(tty, 0, TTY_OVERRUN)) { copied++; pr_debug("sci: overrun error\n"); } @@ -652,13 +647,12 @@ if (copied) tty_flip_buffer_push(tty); + return copied; } -static irqreturn_t sci_rx_interrupt(int irq, void *ptr, struct pt_regs *regs) +static irqreturn_t sci_rx_interrupt(int irq, void *port, struct pt_regs *regs) { - struct uart_port *port = ptr; - /* I think sci_receive_chars has to be called irrespective * of whether the I_IXOFF is set, otherwise, how is the interrupt * to be disabled? @@ -672,7 +666,9 @@ { struct uart_port *port = ptr; + spin_lock_irq(&port->lock); sci_transmit_chars(port); + spin_unlock_irq(&port->lock); return IRQ_HANDLED; } @@ -873,50 +869,42 @@ static void sci_start_tx(struct uart_port *port) { - struct sci_port *s = &sci_ports[port->line]; + unsigned short ctrl; - disable_irq(s->irqs[SCIx_TXI_IRQ]); - sci_transmit_chars(port); - enable_irq(s->irqs[SCIx_TXI_IRQ]); + /* Set TIE (Transmit Interrupt Enable) bit in SCSCR */ + ctrl = sci_in(port, SCSCR); + ctrl |= SCI_CTRL_FLAGS_TIE; + sci_out(port, SCSCR, ctrl); } static void sci_stop_tx(struct uart_port *port) { - unsigned long flags; unsigned short ctrl; /* Clear TIE (Transmit Interrupt Enable) bit in SCSCR */ - local_irq_save(flags); ctrl = sci_in(port, SCSCR); ctrl &= ~SCI_CTRL_FLAGS_TIE; sci_out(port, SCSCR, ctrl); - local_irq_restore(flags); } static void sci_start_rx(struct uart_port *port, unsigned int tty_start) { - unsigned long flags; unsigned short ctrl; /* Set RIE (Receive Interrupt Enable) bit in SCSCR */ - local_irq_save(flags); ctrl = sci_in(port, SCSCR); ctrl |= SCI_CTRL_FLAGS_RIE | SCI_CTRL_FLAGS_REIE; sci_out(port, SCSCR, ctrl); - local_irq_restore(flags); } static void sci_stop_rx(struct uart_port *port) { - unsigned long flags; unsigned short ctrl; /* Clear RIE (Receive Interrupt Enable) bit in SCSCR */ - local_irq_save(flags); ctrl = sci_in(port, SCSCR); ctrl &= ~(SCI_CTRL_FLAGS_RIE | SCI_CTRL_FLAGS_REIE); sci_out(port, SCSCR, ctrl); - local_irq_restore(flags); } static void sci_enable_ms(struct uart_port *port) @@ -965,6 +953,23 @@ baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); + switch (baud) { + case 0: + t = -1; + break; + default: + { +#if defined(CONFIG_SUPERH) && !defined(CONFIG_SUPERH64) + struct clk *clk = clk_get("module_clk"); + t = SCBRR_VALUE(baud, clk_get_rate(clk)); + clk_put(clk); +#else + t = SCBRR_VALUE(baud); +#endif + } + break; + } + spin_lock_irqsave(&port->lock, flags); do { @@ -992,25 +997,6 @@ sci_out(port, SCSMR, smr_val); - spin_unlock_irqrestore(&port->lock, flags); - - switch (baud) { - case 0: - t = -1; - break; - default: - { -#if defined(CONFIG_SUPERH) && !defined(CONFIG_SUPERH64) - struct clk *clk = clk_get("module_clk"); - t = SCBRR_VALUE(baud, clk_get_rate(clk)); - clk_put(clk); -#else - t = SCBRR_VALUE(baud); -#endif - } - break; - } - if (t > 0) { if(t >= 256) { sci_out(port, SCSMR, (sci_in(port, SCSMR) & ~3) | 1); @@ -1029,6 +1015,8 @@ if ((termios->c_cflag & CREAD) != 0) sci_start_rx(port,0); + + spin_unlock_irqrestore(&port->lock, flags); } static const char *sci_type(struct uart_port *port) |
|
From: Paul M. <le...@us...> - 2006-08-01 10:12:10
|
Update of /cvsroot/linuxsh/linux/include/asm-sh In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15566/include/asm-sh Modified Files: sci.h Log Message: Fixup sh-sci compile breakage, spotted by Manuel. Index: sci.h =================================================================== RCS file: /cvsroot/linuxsh/linux/include/asm-sh/sci.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- sci.h 1 Aug 2006 02:13:08 -0000 1.1 +++ sci.h 1 Aug 2006 10:12:06 -0000 1.2 @@ -22,11 +22,13 @@ * Platform device specific platform_data struct */ struct plat_sci_port { - void __iomem *membase; /* io cookie */ - unsigned long mapbase; /* resource base */ - unsigned int irqs[4]; /* ERI, RXI, TXI, BRI */ - unsigned int type; /* SCI / SCIF / IRDA */ - upf_t flags; /* UPF_* flags */ + void __iomem *membase; /* io cookie */ + unsigned long mapbase; /* resource base */ + unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */ + unsigned int type; /* SCI / SCIF / IRDA */ + upf_t flags; /* UPF_* flags */ }; +int early_sci_setup(struct uart_port *port); + #endif /* __ASM_SH_SCI_H */ |
|
From: Paul M. <le...@us...> - 2006-08-01 10:12:10
|
Update of /cvsroot/linuxsh/linux/drivers/serial In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15566/drivers/serial Modified Files: sh-sci.c Added Files: Kconfig Log Message: Fixup sh-sci compile breakage, spotted by Manuel. Index: sh-sci.c =================================================================== RCS file: /cvsroot/linuxsh/linux/drivers/serial/sh-sci.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- sh-sci.c 1 Aug 2006 02:13:08 -0000 1.45 +++ sh-sci.c 1 Aug 2006 10:12:06 -0000 1.46 @@ -1153,7 +1153,7 @@ } } -int __init early_serial_setup(struct uart_port *port) +int __init early_sci_setup(struct uart_port *port) { if (unlikely(port->line > SCI_NPORTS)) return -ENODEV; |
|
From: Paul M. <le...@us...> - 2006-08-01 04:16:14
|
Update of /cvsroot/linuxsh/linux/drivers/serial In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv7449/drivers/serial Modified Files: sh-sci.h Log Message: Kill the IRQ table from sh-sci, we no longer need it now that each subtype registers its own set of IRQs per port. Index: sh-sci.h =================================================================== RCS file: /cvsroot/linuxsh/linux/drivers/serial/sh-sci.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- sh-sci.h 1 Aug 2006 02:13:08 -0000 1.22 +++ sh-sci.h 1 Aug 2006 04:16:11 -0000 1.23 @@ -24,28 +24,6 @@ #endif #endif -/* ERI, RXI, TXI, BRI */ -#define SCI_IRQS { 23, 24, 25, 0 } -#define SH3_SCIF_IRQS { 56, 57, 59, 58 } -#define SH3_IRDA_IRQS { 52, 53, 55, 54 } -#define SH4_SCIF_IRQS { 40, 41, 43, 42 } -#define STB1_SCIF1_IRQS {23, 24, 26, 25 } -#define SH7760_SCIF0_IRQS { 52, 53, 55, 54 } -#define SH7760_SCIF1_IRQS { 72, 73, 75, 74 } -#define SH7760_SCIF2_IRQS { 76, 77, 79, 78 } -#define SH7300_SCIF0_IRQS {80, 80, 80, 80 } -#define SH73180_SCIF_IRQS {80, 81, 83, 82 } -#define H8300H_SCI_IRQS0 {52, 53, 54, 0 } -#define H8300H_SCI_IRQS1 {56, 57, 58, 0 } -#define H8300H_SCI_IRQS2 {60, 61, 62, 0 } -#define H8S_SCI_IRQS0 {88, 89, 90, 0 } -#define H8S_SCI_IRQS1 {92, 93, 94, 0 } -#define H8S_SCI_IRQS2 {96, 97, 98, 0 } -#define SH5_SCIF_IRQS {39, 40, 42, 0 } -#define SH7770_SCIF0_IRQS {61, 61, 61, 61 } -#define SH7770_SCIF1_IRQS {62, 62, 62, 62 } -#define SH7770_SCIF2_IRQS {63, 63, 63, 63 } - #if defined(CONFIG_CPU_SUBTYPE_SH7708) # define SCSPTR 0xffffff7c /* 8 bit */ # define SCSCR_INIT(port) 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ |
|
From: Paul M. <le...@us...> - 2006-08-01 02:54:46
|
Update of /cvsroot/linuxsh/linux/arch/sh/kernel/cpu/sh3 In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8195/arch/sh/kernel/cpu/sh3 Modified Files: Makefile Added Files: setup-sh7300.c setup-sh7705.c setup-sh7708.c setup-sh7709.c Log Message: Setup code for SH-3 CPU subtypes. --- NEW FILE: setup-sh7300.c --- /* * SH7300 Setup * * Copyright (C) 2006 Paul Mundt * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #include <linux/platform_device.h> #include <linux/init.h> #include <linux/serial.h> #include <asm/sci.h> static struct plat_sci_port sci_platform_data[] = { { .mapbase = 0xa4430000, .flags = UPF_BOOT_AUTOCONF, .type = PORT_SCI, .irqs = { 80, 80, 80, 80 }, }, { .flags = 0, } }; static struct platform_device sci_device = { .name = "sh-sci", .id = -1, .dev = { .platform_data = sci_platform_data, }, }; static struct platform_device *sh7300_devices[] __initdata = { &sci_device, }; static int __init sh7300_devices_setup(void) { return platform_add_devices(sh7300_devices, ARRAY_SIZE(sh7300_devices)); } __initcall(sh7300_devices_setup); --- NEW FILE: setup-sh7705.c --- /* * SH7705 Setup * * Copyright (C) 2006 Paul Mundt * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #include <linux/platform_device.h> #include <linux/init.h> #include <linux/serial.h> #include <asm/sci.h> static struct plat_sci_port sci_platform_data[] = { { .mapbase = 0xa4400000, .flags = UPF_BOOT_AUTOCONF, .type = PORT_SCIF, .irqs = { 52, 53, 55, 54 }, }, { .mapbase = 0xa4410000, .flags = UPF_BOOT_AUTOCONF, .type = PORT_SCIF, .irqs = { 56, 57, 59, 58 }, }, { .flags = 0, } }; static struct platform_device sci_device = { .name = "sh-sci", .id = -1, .dev = { .platform_data = sci_platform_data, }, }; static struct platform_device *sh7705_devices[] __initdata = { &sci_device, }; static int __init sh7705_devices_setup(void) { return platform_add_devices(sh7705_devices, ARRAY_SIZE(sh7705_devices)); } __initcall(sh7705_devices_setup); --- NEW FILE: setup-sh7708.c --- /* * SH7708 Setup * * Copyright (C) 2006 Paul Mundt * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #include <linux/platform_device.h> #include <linux/init.h> #include <linux/serial.h> #include <asm/sci.h> static struct plat_sci_port sci_platform_data[] = { { .mapbase = 0xfffffe80, .flags = UPF_BOOT_AUTOCONF, .type = PORT_SCI, .irqs = { 23, 24, 25, 0 }, }, { .flags = 0, } }; static struct platform_device sci_device = { .name = "sh-sci", .id = -1, .dev = { .platform_data = sci_platform_data, }, }; static struct platform_device *sh7708_devices[] __initdata = { &sci_device, }; static int __init sh7708_devices_setup(void) { return platform_add_devices(sh7708_devices, ARRAY_SIZE(sh7708_devices)); } __initcall(sh7708_devices_setup); --- NEW FILE: setup-sh7709.c --- /* * SH7707/SH7709 Setup * * Copyright (C) 2006 Paul Mundt * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #include <linux/platform_device.h> #include <linux/init.h> #include <linux/serial.h> #include <asm/sci.h> static struct plat_sci_port sci_platform_data[] = { { .mapbase = 0xfffffe80, .flags = UPF_BOOT_AUTOCONF, .type = PORT_SCI, .irqs = { 23, 24, 25, 0 }, }, { .mapbase = 0xa4000150, .flags = UPF_BOOT_AUTOCONF, .type = PORT_SCIF, .irqs = { 56, 57, 59, 58 }, }, { .mapbase = 0xa4000140, .flags = UPF_BOOT_AUTOCONF, .type = PORT_IRDA, .irqs = { 52, 53, 55, 54 }, }, { .flags = 0, } }; static struct platform_device sci_device = { .name = "sh-sci", .id = -1, .dev = { .platform_data = sci_platform_data, }, }; static struct platform_device *sh7709_devices[] __initdata = { &sci_device, }; static int __init sh7709_devices_setup(void) { return platform_add_devices(sh7709_devices, ARRAY_SIZE(sh7709_devices)); } __initcall(sh7709_devices_setup); Index: Makefile =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/kernel/cpu/sh3/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile 10 Jun 2005 15:51:47 -0000 1.6 +++ Makefile 1 Aug 2006 02:54:42 -0000 1.7 @@ -4,6 +4,14 @@ obj-y := ex.o probe.o +# CPU subtype setup +obj-$(CONFIG_CPU_SUBTYPE_SH7705) += setup-sh7705.o +obj-$(CONFIG_CPU_SUBTYPE_SH7707) += setup-sh7709.o +obj-$(CONFIG_CPU_SUBTYPE_SH7708) += setup-sh7708.o +obj-$(CONFIG_CPU_SUBTYPE_SH7709) += setup-sh7709.o +obj-$(CONFIG_CPU_SUBTYPE_SH7300) += setup-sh7300.o + +# Primary on-chip clocks (common) clock-$(CONFIG_CPU_SH3) := clock-sh3.o clock-$(CONFIG_CPU_SUBTYPE_SH7300) := clock-sh7300.o clock-$(CONFIG_CPU_SUBTYPE_SH7705) := clock-sh7705.o |
|
From: Paul M. <le...@us...> - 2006-08-01 02:44:16
|
Update of /cvsroot/linuxsh/linux/arch/sh/kernel/cpu/sh4 In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4325/arch/sh/kernel/cpu/sh4 Modified Files: Makefile Added Files: setup-sh4-202.c setup-sh73180.c setup-sh7770.c Log Message: SH7770/SH73180/SH4-202 setup code. --- NEW FILE: setup-sh4-202.c --- /* * SH4-202 Setup * * Copyright (C) 2006 Paul Mundt * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #include <linux/platform_device.h> #include <linux/init.h> #include <linux/serial.h> #include <asm/sci.h> static struct plat_sci_port sci_platform_data[] = { { .mapbase = 0xffe80000, .flags = UPF_BOOT_AUTOCONF, .type = PORT_SCIF, .irqs = { 40, 41, 43, 42 }, }, { .flags = 0, } }; static struct platform_device sci_device = { .name = "sh-sci", .id = -1, .dev = { .platform_data = sci_platform_data, }, }; static struct platform_device *sh4202_devices[] __initdata = { &sci_device, }; static int __init sh4202_devices_setup(void) { return platform_add_devices(sh4202_devices, ARRAY_SIZE(sh4202_devices)); } __initcall(sh4202_devices_setup); --- NEW FILE: setup-sh73180.c --- /* * SH73180 Setup * * Copyright (C) 2006 Paul Mundt * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #include <linux/platform_device.h> #include <linux/init.h> #include <linux/serial.h> #include <asm/sci.h> static struct plat_sci_port sci_platform_data[] = { { .mapbase = 0xffe80000, .flags = UPF_BOOT_AUTOCONF, .type = PORT_SCIF, .irqs = { 80, 81, 83, 82 }, }, { .flags = 0, } }; static struct platform_device sci_device = { .name = "sh-sci", .id = -1, .dev = { .platform_data = sci_platform_data, }, }; static struct platform_device *sh73180_devices[] __initdata = { &sci_device, }; static int __init sh73180_devices_setup(void) { return platform_add_devices(sh73180_devices, ARRAY_SIZE(sh73180_devices)); } __initcall(sh73180_devices_setup); --- NEW FILE: setup-sh7770.c --- /* * SH7770 Setup * * Copyright (C) 2006 Paul Mundt * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #include <linux/platform_device.h> #include <linux/init.h> #include <linux/serial.h> #include <asm/sci.h> static struct plat_sci_port sci_platform_data[] = { { .mapbase = 0xff923000, .flags = UPF_BOOT_AUTOCONF, .type = PORT_SCIF, .irqs = { 61, 61, 61, 61 }, }, { .mapbase = 0xff924000, .flags = UPF_BOOT_AUTOCONF, .type = PORT_SCIF, .irqs = { 62, 62, 62, 62 }, }, { .mapbase = 0xff925000, .flags = UPF_BOOT_AUTOCONF, .type = PORT_SCIF, .irqs = { 63, 63, 63, 63 }, }, { .flags = 0, } }; static struct platform_device sci_device = { .name = "sh-sci", .id = -1, .dev = { .platform_data = sci_platform_data, }, }; static struct platform_device *sh7770_devices[] __initdata = { &sci_device, }; static int __init sh7770_devices_setup(void) { return platform_add_devices(sh7770_devices, ARRAY_SIZE(sh7770_devices)); } __initcall(sh7770_devices_setup); Index: Makefile =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/kernel/cpu/sh4/Makefile,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Makefile 1 Aug 2006 02:34:00 -0000 1.14 +++ Makefile 1 Aug 2006 02:44:12 -0000 1.15 @@ -11,7 +11,10 @@ obj-$(CONFIG_CPU_SUBTYPE_SH7750) += setup-sh7750.o obj-$(CONFIG_CPU_SUBTYPE_SH7751) += setup-sh7750.o obj-$(CONFIG_CPU_SUBTYPE_SH7760) += setup-sh7760.o +obj-$(CONFIG_CPU_SUBTYPE_SH7770) += setup-sh7770.o obj-$(CONFIG_CPU_SUBTYPE_SH7780) += setup-sh7780.o +obj-$(CONFIG_CPU_SUBTYPE_SH73180) += setup-sh73180.o +obj-$(CONFIG_CPU_SUBTYPE_SH4_202) += setup-sh4-202.o # Primary on-chip clocks (common) clock-$(CONFIG_CPU_SH4) := clock-sh4.o |
|
From: Paul M. <le...@us...> - 2006-08-01 02:34:03
|
Update of /cvsroot/linuxsh/linux/arch/sh/kernel/cpu/sh4 In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv32608/arch/sh/kernel/cpu/sh4 Modified Files: Makefile Added Files: setup-sh7750.c setup-sh7760.c Log Message: Add setup code for SH7750/SH7751/SH7760. --- NEW FILE: setup-sh7750.c --- /* * SH7750/SH7751 Setup * * Copyright (C) 2006 Paul Mundt * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #include <linux/platform_device.h> #include <linux/init.h> #include <linux/serial.h> #include <asm/sci.h> static struct plat_sci_port sci_platform_data[] = { { .mapbase = 0xffe00000, .flags = UPF_BOOT_AUTOCONF, .type = PORT_SCI, .irqs = { 23, 24, 25, 0 }, }, { .mapbase = 0xffe80000, .flags = UPF_BOOT_AUTOCONF, .type = PORT_SCIF, .irqs = { 40, 41, 43, 42 }, }, { .flags = 0, } }; static struct platform_device sci_device = { .name = "sh-sci", .id = -1, .dev = { .platform_data = sci_platform_data, }, }; static struct platform_device *sh7750_devices[] __initdata = { &sci_device, }; static int __init sh7750_devices_setup(void) { return platform_add_devices(sh7750_devices, ARRAY_SIZE(sh7750_devices)); } __initcall(sh7750_devices_setup); --- NEW FILE: setup-sh7760.c --- /* * SH7760 Setup * * Copyright (C) 2006 Paul Mundt * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #include <linux/platform_device.h> #include <linux/init.h> #include <linux/serial.h> #include <asm/sci.h> static struct plat_sci_port sci_platform_data[] = { { .mapbase = 0xfe600000, .flags = UPF_BOOT_AUTOCONF, .type = PORT_SCIF, .irqs = { 52, 53, 55, 54 }, }, { .mapbase = 0xfe610000, .flags = UPF_BOOT_AUTOCONF, .type = PORT_SCIF, .irqs = { 72, 73, 75, 74 }, }, { .mapbase = 0xfe620000, .flags = UPF_BOOT_AUTOCONF, .type = PORT_SCIF, .irqs = { 76, 77, 79, 78 }, }, { .flags = 0, } }; static struct platform_device sci_device = { .name = "sh-sci", .id = -1, .dev = { .platform_data = sci_platform_data, }, }; static struct platform_device *sh7760_devices[] __initdata = { &sci_device, }; static int __init sh7760_devices_setup(void) { return platform_add_devices(sh7760_devices, ARRAY_SIZE(sh7760_devices)); } __initcall(sh7760_devices_setup); Index: Makefile =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/kernel/cpu/sh4/Makefile,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Makefile 11 Jul 2006 07:57:40 -0000 1.13 +++ Makefile 1 Aug 2006 02:34:00 -0000 1.14 @@ -8,6 +8,9 @@ obj-$(CONFIG_SH_STORE_QUEUES) += sq.o # CPU subtype setup +obj-$(CONFIG_CPU_SUBTYPE_SH7750) += setup-sh7750.o +obj-$(CONFIG_CPU_SUBTYPE_SH7751) += setup-sh7750.o +obj-$(CONFIG_CPU_SUBTYPE_SH7760) += setup-sh7760.o obj-$(CONFIG_CPU_SUBTYPE_SH7780) += setup-sh7780.o # Primary on-chip clocks (common) |
|
From: Paul M. <le...@us...> - 2006-08-01 02:13:12
|
Update of /cvsroot/linuxsh/linux/drivers/serial In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv24470/drivers/serial Modified Files: sh-sci.c sh-sci.h Log Message: Rewrite sh-sci for the driver model. All CPU subtypes are required to register a platform device with their port list defined (see the 7780 setup code as an example). Index: sh-sci.c =================================================================== RCS file: /cvsroot/linuxsh/linux/drivers/serial/sh-sci.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- sh-sci.c 31 Jul 2006 08:28:45 -0000 1.44 +++ sh-sci.c 1 Aug 2006 02:13:08 -0000 1.45 @@ -23,8 +23,6 @@ #include <linux/config.h> #include <linux/module.h> #include <linux/errno.h> -#include <linux/signal.h> -#include <linux/sched.h> #include <linux/timer.h> #include <linux/interrupt.h> #include <linux/tty.h> @@ -33,39 +31,56 @@ #include <linux/major.h> #include <linux/string.h> #include <linux/sysrq.h> -#include <linux/fcntl.h> -#include <linux/ptrace.h> #include <linux/ioport.h> #include <linux/mm.h> -#include <linux/slab.h> #include <linux/init.h> #include <linux/delay.h> #include <linux/console.h> -#include <linux/bitops.h> -#include <linux/generic_serial.h> +#include <linux/platform_device.h> #ifdef CONFIG_CPU_FREQ #include <linux/notifier.h> #include <linux/cpufreq.h> #endif -#include <asm/system.h> -#include <asm/io.h> -#include <asm/irq.h> -#include <asm/uaccess.h> - #if defined(CONFIG_SUPERH) && !defined(CONFIG_SUPERH64) #include <asm/clock.h> #include <asm/sh_bios.h> #include <asm/kgdb.h> #endif +#include <asm/sci.h> + #if defined(CONFIG_SERIAL_SH_SCI_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ #endif #include "sh-sci.h" +struct sci_port { + struct uart_port port; + + /* Port type */ + unsigned int type; + + /* Port IRQs: ERI, RXI, TXI, BRI (optional) */ + unsigned int irqs[SCIx_NR_IRQS]; + + /* Port pin configuration */ + void (*init_pins)(struct uart_port *port, + unsigned int cflag); + + /* Port enable callback */ + void (*enable)(struct uart_port *port); + + /* Port disable callback */ + void (*disable)(struct uart_port *port); + + /* Break timer */ + struct timer_list break_timer; + int break_flag; +}; + #ifdef CONFIG_SH_KGDB static struct sci_port *kgdb_sci_port; #endif @@ -77,12 +92,13 @@ /* Function prototypes */ static void sci_stop_tx(struct uart_port *port); -static struct sci_port sci_ports[]; -static struct uart_driver sci_uart_driver; +#define SCI_NPORTS CONFIG_SERIAL_SH_SCI_NR_UARTS -#define SCI_NPORTS sci_uart_driver.nr +static struct sci_port sci_ports[SCI_NPORTS]; +static struct uart_driver sci_uart_driver; -#if defined(CONFIG_SH_STANDARD_BIOS) || defined(CONFIG_SH_KGDB) +#if defined(CONFIG_SERIAL_SH_SCI_CONSOLE) && \ + defined(CONFIG_SH_STANDARD_BIOS) || defined(CONFIG_SH_KGDB) static inline void handle_error(struct uart_port *port) { /* Clear error flags */ @@ -230,8 +246,8 @@ } #endif -#if defined(SCI_ONLY) || defined(SCI_AND_SCIF) -#if defined(__H8300H__) || defined(__H8300S__) +#if defined(SCI_ONLY) || defined(SCI_AND_SCIF) && \ + defined(__H8300H__) || defined(__H8300S__) static void sci_init_pins_sci(struct uart_port* port, unsigned int cflag) { int ch = (port->mapbase - SMR0) >> 3; @@ -247,7 +263,26 @@ /* tx mark output*/ H8300_SCI_DR(ch) |= h8300_sci_pins[ch].tx; } +#else +#define sci_init_pins_sci NULL +#endif + +#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) +static void sci_init_pins_irda(struct uart_port *port, unsigned int cflag) +{ + unsigned int fcr_val = 0; + + if (cflag & CRTSCTS) + fcr_val |= SCFCR_MCE; + + sci_out(port, SCFCR, fcr_val); +} +#else +#define sci_init_pins_irda NULL #endif + +#ifdef SCI_ONLY +#define sci_init_pins_scif NULL #endif #if defined(SCIF_ONLY) || defined(SCI_AND_SCIF) @@ -285,18 +320,6 @@ sci_out(port, SCFCR, fcr_val); } - -#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) -static void sci_init_pins_irda(struct uart_port *port, unsigned int cflag) -{ - unsigned int fcr_val = 0; - - if (cflag & CRTSCTS) - fcr_val |= SCFCR_MCE; - - sci_out(port, SCFCR, fcr_val); -} -#endif #else /* For SH7750 */ static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag) @@ -713,16 +736,16 @@ scr_status = sci_in(port,SCSCR); /* Tx Interrupt */ - if ((ssr_status&0x0020) && (scr_status&0x0080)) + if ((ssr_status & 0x0020) && (scr_status & 0x0080)) sci_tx_interrupt(irq, ptr, regs); /* Rx Interrupt */ - if ((ssr_status&0x0002) && (scr_status&0x0040)) + if ((ssr_status & 0x0002) && (scr_status & 0x0040)) sci_rx_interrupt(irq, ptr, regs); /* Error Interrupt */ - if ((ssr_status&0x0080) && (scr_status&0x0400)) + if ((ssr_status & 0x0080) && (scr_status & 0x0400)) sci_er_interrupt(irq, ptr, regs); /* Break Interrupt */ - if ((ssr_status&0x0010) && (scr_status&0x0200)) + if ((ssr_status & 0x0010) && (scr_status & 0x0200)) sci_br_interrupt(irq, ptr, regs); return IRQ_HANDLED; @@ -733,7 +756,8 @@ * Here we define a transistion notifier so that we can update all of our * ports' baud rate when the peripheral clock changes. */ -static int sci_notifier(struct notifier_block *self, unsigned long phase, void *p) +static int sci_notifier(struct notifier_block *self, + unsigned long phase, void *p) { struct cpufreq_freqs *freqs = p; int i; @@ -760,8 +784,9 @@ clk_put(clk); } - printk("%s: got a postchange notification for cpu %d (old %d, new %d)\n", - __FUNCTION__, freqs->cpu, freqs->old, freqs->new); + printk(KERN_INFO "%s: got a postchange notification " + "for cpu %d (old %d, new %d)\n", + __FUNCTION__, freqs->cpu, freqs->old, freqs->new); } return NOTIFY_OK; @@ -785,8 +810,9 @@ printk(KERN_ERR "sci: Cannot allocate irq.(IRQ=0)\n"); return -ENODEV; } - if (request_irq(port->irqs[0], sci_mpxed_interrupt, SA_INTERRUPT, - "sci", port)) { + + if (request_irq(port->irqs[0], sci_mpxed_interrupt, + SA_INTERRUPT, "sci", port)) { printk(KERN_ERR "sci: Cannot allocate irq.\n"); return -ENODEV; } @@ -794,8 +820,8 @@ for (i = 0; i < ARRAY_SIZE(handlers); i++) { if (!port->irqs[i]) continue; - if (request_irq(port->irqs[i], handlers[i], SA_INTERRUPT, - desc[i], port)) { + if (request_irq(port->irqs[i], handlers[i], + SA_INTERRUPT, desc[i], port)) { printk(KERN_ERR "sci: Cannot allocate irq.\n"); return -ENODEV; } @@ -948,9 +974,8 @@ sci_out(port, SCSCR, 0x00); /* TE=0, RE=0, CKE1=0 */ #if !defined(SCI_ONLY) - if (port->type == PORT_SCIF) { + if (port->type == PORT_SCIF) sci_out(port, SCFCR, SCFCR_RFRST | SCFCR_TFRST); - } #endif smr_val = sci_in(port, SCSMR) & 3; @@ -1034,11 +1059,23 @@ port->type = s->type; + switch (port->type) { + case PORT_SCI: + s->init_pins = sci_init_pins_sci; + break; + case PORT_SCIF: + s->init_pins = sci_init_pins_scif; + break; + case PORT_IRDA: + s->init_pins = sci_init_pins_irda; + break; + } + #if defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103) if (port->mapbase == 0) port->mapbase = onchip_remap(SCIF_ADDR_SH5, 1024, "SCIF"); - port->membase = (void *)port->mapbase; + port->membase = (void __iomem *)port->mapbase; #endif } @@ -1074,418 +1111,61 @@ .verify_port = sci_verify_port, }; -static struct sci_port sci_ports[] = { -#if defined(CONFIG_CPU_SUBTYPE_SH7708) - { - .port = { - .membase = (void *)0xfffffe80, - .mapbase = 0xfffffe80, - .iotype = UPIO_MEM, - .irq = 25, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 0, - }, - .type = PORT_SCI, - .irqs = SCI_IRQS, - }, -#elif defined(CONFIG_CPU_SUBTYPE_SH7705) - { - .port = { - .membase = (void *)SCIF0, - .mapbase = SCIF0, - .iotype = UPIO_MEM, - .irq = 55, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 0, - }, - .type = PORT_SCIF, - .irqs = SH3_IRDA_IRQS, - .init_pins = sci_init_pins_scif, - }, - { - .port = { - .membase = (void *)SCIF2, - .mapbase = SCIF2, - .iotype = UPIO_MEM, - .irq = 59, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 1, - }, - .type = PORT_SCIF, - .irqs = SH3_SCIF_IRQS, - .init_pins = sci_init_pins_scif, - } -#elif defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) - { - .port = { - .membase = (void *)0xfffffe80, - .mapbase = 0xfffffe80, - .iotype = UPIO_MEM, - .irq = 25, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 0, - }, - .type = PORT_SCI, - .irqs = SCI_IRQS, - }, - { - .port = { - .membase = (void *)0xa4000150, - .mapbase = 0xa4000150, - .iotype = UPIO_MEM, - .irq = 59, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 1, - }, - .type = PORT_SCIF, - .irqs = SH3_SCIF_IRQS, - .init_pins = sci_init_pins_scif, - }, - { - .port = { - .membase = (void *)0xa4000140, - .mapbase = 0xa4000140, - .iotype = UPIO_MEM, - .irq = 55, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 2, - }, - .type = PORT_IRDA, - .irqs = SH3_IRDA_IRQS, - .init_pins = sci_init_pins_irda, - } -#elif defined(CONFIG_CPU_SUBTYPE_SH7300) - { - .port = { - .membase = (void *)0xA4430000, - .mapbase = 0xA4430000, - .iotype = UPIO_MEM, - .irq = 25, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 0, - }, - .type = PORT_SCIF, - .irqs = SH7300_SCIF0_IRQS, - .init_pins = sci_init_pins_scif, - }, -#elif defined(CONFIG_CPU_SUBTYPE_SH73180) - { - .port = { - .membase = (void *)0xffe00000, - .mapbase = 0xffe00000, - .iotype = UPIO_MEM, - .irq = 25, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 0, - }, - .type = PORT_SCIF, - .irqs = SH73180_SCIF_IRQS, - .init_pins = sci_init_pins_scif, - }, -#elif defined(CONFIG_CPU_SUBTYPE_SH4_202) - { - .port = { - .membase = (void *)0xffe80000, - .mapbase = 0xffe80000, - .iotype = UPIO_MEM, - .irq = 43, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 0, - }, - .type = PORT_SCIF, - .irqs = SH4_SCIF_IRQS, - .init_pins = sci_init_pins_scif, - }, -#elif defined(CONFIG_CPU_SUBTYPE_SH7750) || defined(CONFIG_CPU_SUBTYPE_SH7751) - { - .port = { - .membase = (void *)0xffe00000, - .mapbase = 0xffe00000, - .iotype = UPIO_MEM, - .irq = 25, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 0, - }, - .type = PORT_SCI, - .irqs = SCI_IRQS, - }, - { - .port = { - .membase = (void *)0xffe80000, - .mapbase = 0xffe80000, - .iotype = UPIO_MEM, - .irq = 43, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 1, - }, - .type = PORT_SCIF, - .irqs = SH4_SCIF_IRQS, - .init_pins = sci_init_pins_scif, - }, -#elif defined(CONFIG_CPU_SUBTYPE_SH7760) - { - .port = { - .membase = (void *)0xfe600000, - .mapbase = 0xfe600000, - .iotype = UPIO_MEM, - .irq = 55, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 0, - }, - .type = PORT_SCIF, - .irqs = SH7760_SCIF0_IRQS, - .init_pins = sci_init_pins_scif, - }, - { - .port = { - .membase = (void *)0xfe610000, - .mapbase = 0xfe610000, - .iotype = UPIO_MEM, - .irq = 75, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 1, - }, - .type = PORT_SCIF, - .irqs = SH7760_SCIF1_IRQS, - .init_pins = sci_init_pins_scif, - }, - { - .port = { - .membase = (void *)0xfe620000, - .mapbase = 0xfe620000, - .iotype = UPIO_MEM, - .irq = 79, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 2, - }, - .type = PORT_SCIF, - .irqs = SH7760_SCIF2_IRQS, - .init_pins = sci_init_pins_scif, - }, -#elif defined(CONFIG_CPU_SUBTYPE_ST40STB1) - { - .port = { - .membase = (void *)0xffe00000, - .mapbase = 0xffe00000, - .iotype = UPIO_MEM, - .irq = 26, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 0, - }, - .type = PORT_SCIF, - .irqs = STB1_SCIF1_IRQS, - .init_pins = sci_init_pins_scif, - }, - { - .port = { - .membase = (void *)0xffe80000, - .mapbase = 0xffe80000, - .iotype = UPIO_MEM, - .irq = 43, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 1, - }, - .type = PORT_SCIF, - .irqs = SH4_SCIF_IRQS, - .init_pins = sci_init_pins_scif, - }, -#elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103) - { - .port = { - .iotype = UPIO_MEM, - .irq = 42, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 0, - }, - .type = PORT_SCIF, - .irqs = SH5_SCIF_IRQS, - .init_pins = sci_init_pins_scif, - }, -#elif defined(CONFIG_H83007) || defined(CONFIG_H83068) - { - .port = { - .membase = (void *)0x00ffffb0, - .mapbase = 0x00ffffb0, - .iotype = UPIO_MEM, - .irq = 54, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 0, - }, - .type = PORT_SCI, - .irqs = H8300H_SCI_IRQS0, - .init_pins = sci_init_pins_sci, - }, - { - .port = { - .membase = (void *)0x00ffffb8, - .mapbase = 0x00ffffb8, - .iotype = UPIO_MEM, - .irq = 58, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 1, - }, - .type = PORT_SCI, - .irqs = H8300H_SCI_IRQS1, - .init_pins = sci_init_pins_sci, - }, - { - .port = { - .membase = (void *)0x00ffffc0, - .mapbase = 0x00ffffc0, - .iotype = UPIO_MEM, - .irq = 62, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 2, - }, - .type = PORT_SCI, - .irqs = H8300H_SCI_IRQS2, - .init_pins = sci_init_pins_sci, - }, -#elif defined(CONFIG_H8S2678) - { - .port = { - .membase = (void *)0x00ffff78, - .mapbase = 0x00ffff78, - .iotype = UPIO_MEM, - .irq = 90, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 0, - }, - .type = PORT_SCI, - .irqs = H8S_SCI_IRQS0, - .init_pins = sci_init_pins_sci, - .enable = h8300_sci_enable, - .disable = h8300_sci_disable, - }, - { - .port = { - .membase = (void *)0x00ffff80, - .mapbase = 0x00ffff80, - .iotype = UPIO_MEM, - .irq = 94, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 1, - }, - .type = PORT_SCI, - .irqs = H8S_SCI_IRQS1, - .init_pins = sci_init_pins_sci, - .enable = h8300_sci_enable, - .disable = h8300_sci_disable, - }, - { - .port = { - .membase = (void *)0x00ffff88, - .mapbase = 0x00ffff88, - .iotype = UPIO_MEM, - .irq = 98, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 2, - }, - .type = PORT_SCI, - .irqs = H8S_SCI_IRQS2, - .init_pins = sci_init_pins_sci, - .enable = h8300_sci_enable, - .disable = h8300_sci_disable, - }, -#elif defined(CONFIG_CPU_SUBTYPE_SH7770) - { - .port = { - .membase = (void *)0xff923000, - .mapbase = 0xff923000, - .iotype = UPIO_MEM, - .irq = 61, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 0, - }, - .type = PORT_SCIF, - .irqs = SH7770_SCIF0_IRQS, - .init_pins = sci_init_pins_scif, - }, - { - .port = { - .membase = (void *)0xff924000, - .mapbase = 0xff924000, - .iotype = UPIO_MEM, - .irq = 62, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 1, - }, - .type = PORT_SCIF, - .irqs = SH7770_SCIF1_IRQS, - .init_pins = sci_init_pins_scif, - }, - { - .port = { - .membase = (void *)0xff925000, - .mapbase = 0xff925000, - .iotype = UPIO_MEM, - .irq = 63, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 2, - }, - .type = PORT_SCIF, - .irqs = SH7770_SCIF2_IRQS, - .init_pins = sci_init_pins_scif, - }, -#elif defined(CONFIG_CPU_SUBTYPE_SH7780) - { - .port = { - .membase = (void *)0xffe00000, - .mapbase = 0xffe00000, - .iotype = UPIO_MEM, - .irq = 43, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 0, - }, - .type = PORT_SCIF, - .irqs = SH7780_SCIF0_IRQS, - .init_pins = sci_init_pins_scif, - }, - { - .port = { - .membase = (void *)0xffe10000, - .mapbase = 0xffe10000, - .iotype = UPIO_MEM, - .irq = 79, - .ops = &sci_uart_ops, - .flags = UPF_BOOT_AUTOCONF, - .line = 1, - }, - .type = PORT_SCIF, - .irqs = SH7780_SCIF1_IRQS, - .init_pins = sci_init_pins_scif, - }, +static void __init sci_init_ports(void) +{ + static int first = 1; + int i; + + if (!first) + return; + + first = 0; + + for (i = 0; i < SCI_NPORTS; i++) { + sci_ports[i].port.ops = &sci_uart_ops; + sci_ports[i].port.iotype = UPIO_MEM; + sci_ports[i].port.line = i; + sci_ports[i].port.fifosize = 1; + +#if defined(__H8300H__) || defined(__H8300S__) +#ifdef __H8300S__ + sci_ports[i].enable = h8300_sci_enable; + sci_ports[i].disable = h8300_sci_disable; +#endif + sci_ports[i].port.uartclk = CONFIG_CPU_CLOCK; +#elif defined(CONFIG_SUPERH64) + sci_ports[i].port.uartclk = current_cpu_info.module_clock * 16; #else -#error "CPU subtype not defined" + /* + * XXX: We should use a proper SCI/SCIF clock + */ + { + struct clk *clk = clk_get("module_clk"); + sci_ports[i].port.uartclk = clk_get_rate(clk) * 16; + clk_put(clk); + } #endif -}; + + sci_ports[i].break_timer.data = (unsigned long)&sci_ports[i]; + sci_ports[i].break_timer.function = sci_break_timer; + + init_timer(&sci_ports[i].break_timer); + } +} + +int __init early_serial_setup(struct uart_port *port) +{ + if (unlikely(port->line > SCI_NPORTS)) + return -ENODEV; + + sci_init_ports(); + + sci_ports[port->line].port.membase = port->membase; + sci_ports[port->line].port.mapbase = port->mapbase; + sci_ports[port->line].port.type = port->type; + + return 0; +} #ifdef CONFIG_SERIAL_SH_SCI_CONSOLE /* @@ -1507,36 +1187,38 @@ int flow = 'n'; int ret; + /* + * Check whether an invalid uart number has been specified, and + * if so, search for the first available port that does have + * console support. + */ + if (co->index >= SCI_NPORTS) + co->index = 0; + serial_console_port = &sci_ports[co->index]; port = &serial_console_port->port; + + /* + * Also need to check port->type, we don't actually have any + * UPIO_PORT ports, but uart_report_port() handily misreports + * it anyways if we don't have a port available by the time this is + * called. + */ + if (!port->type) + return -ENODEV; + if (!port->membase || !port->mapbase) + return -ENODEV; + + spin_lock_init(&port->lock); + port->type = serial_console_port->type; -#ifdef CONFIG_SUPERH64 - /* This is especially needed on sh64 to remap the SCIF */ - sci_config_port(port, 0); -#endif + if (port->flags & UPF_IOREMAP) + sci_config_port(port, 0); if (serial_console_port->enable) serial_console_port->enable(port); - /* - * We need to set the initial uartclk here, since otherwise it will - * only ever be setup at sci_init() time. - */ -#if defined(__H8300H__) || defined(__H8300S__) - port->uartclk = CONFIG_CPU_CLOCK; -#elif defined(CONFIG_SUPERH64) - port->uartclk = current_cpu_info.module_clock * 16; -#else - /* - * XXX: Use a proper clock for SCI/SCIF - */ - { - struct clk *clk = clk_get("module_clk"); - port->uartclk = clk_get_rate(clk) * 16; - clk_put(clk); - } -#endif if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); @@ -1554,17 +1236,17 @@ .device = uart_console_device, .write = serial_console_write, .setup = serial_console_setup, - .flags = CON_PRINTBUFFER, + .flags = CON_PRINTBUFFER, .index = -1, .data = &sci_uart_driver, }; static int __init sci_console_init(void) { + sci_init_ports(); register_console(&serial_console); return 0; } - console_initcall(sci_console_init); #endif /* CONFIG_SERIAL_SH_SCI_CONSOLE */ @@ -1599,6 +1281,8 @@ int parity = 'n'; int flow = 'n'; + spin_lock_init(&port->lock); + if (co->index != kgdb_portnum) co->index = kgdb_portnum; @@ -1627,10 +1311,10 @@ /* Register the KGDB console so we get messages (d'oh!) */ static int __init kgdb_console_init(void) { + sci_init_ports(); register_console(&kgdb_console); return 0; } - console_initcall(kgdb_console_init); #endif /* CONFIG_SH_KGDB_CONSOLE */ @@ -1648,64 +1332,131 @@ static struct uart_driver sci_uart_driver = { .owner = THIS_MODULE, .driver_name = "sci", -#ifdef CONFIG_DEVFS_FS - .devfs_name = "ttsc/", -#endif .dev_name = "ttySC", .major = SCI_MAJOR, .minor = SCI_MINOR_START, + .nr = SCI_NPORTS, .cons = SCI_CONSOLE, }; -static int __init sci_init(void) +/* + * Register a set of serial devices attached to a platform device. The + * list is terminated with a zero flags entry, which means we expect + * all entries to have at least UPF_BOOT_AUTOCONF set. Platforms that need + * remapping (such as sh64) should also set UPF_IOREMAP. + */ +static int __devinit sci_probe(struct platform_device *dev) { - int chan, ret; + struct plat_sci_port *p = dev->dev.platform_data; + int i; - printk("%s", banner); + for (i = 0; p && p->flags != 0 && i < SCI_NPORTS; p++, i++) { + struct sci_port *sciport = &sci_ports[i]; - sci_uart_driver.nr = ARRAY_SIZE(sci_ports); + sciport->port.mapbase = p->mapbase; - ret = uart_register_driver(&sci_uart_driver); - if (ret == 0) { - for (chan = 0; chan < SCI_NPORTS; chan++) { - struct sci_port *sciport = &sci_ports[chan]; + /* + * For the simple (and majority of) cases where we don't need + * to do any remapping, just cast the cookie directly. + */ + if (p->mapbase && !p->membase && !(p->flags & UPF_IOREMAP)) + p->membase = (void __iomem *)p->mapbase; -#if defined(__H8300H__) || defined(__H8300S__) - sciport->port.uartclk = CONFIG_CPU_CLOCK; -#elif defined(CONFIG_SUPERH64) - sciport->port.uartclk = current_cpu_info.module_clock * 16; -#else - /* XXX: We should use a proper SCI/SCIF clock */ - struct clk *clk = clk_get("module_clk"); - sciport->port.uartclk = clk_get_rate(clk) * 16; - clk_put(clk); -#endif - uart_add_one_port(&sci_uart_driver, &sciport->port); - sciport->break_timer.data = (unsigned long)sciport; - sciport->break_timer.function = sci_break_timer; - init_timer(&sciport->break_timer); - } + sciport->port.membase = p->membase; + + sciport->port.irq = p->irqs[SCIx_TXI_IRQ]; + sciport->port.flags = p->flags; + sciport->port.dev = &dev->dev; + + sciport->type = sciport->port.type = p->type; + + memcpy(&sciport->irqs, &p->irqs, sizeof(p->irqs)); + + uart_add_one_port(&sci_uart_driver, &sciport->port); } #ifdef CONFIG_CPU_FREQ cpufreq_register_notifier(&sci_nb, CPUFREQ_TRANSITION_NOTIFIER); - printk("sci: CPU frequency notifier registered\n"); + dev_info(&dev->dev, "sci: CPU frequency notifier registered\n"); #endif #ifdef CONFIG_SH_STANDARD_BIOS sh_bios_gdb_detach(); #endif - return ret; + return 0; } -static void __exit sci_exit(void) +static int __devexit sci_remove(struct platform_device *dev) { - int chan; + int i; - for (chan = 0; chan < SCI_NPORTS; chan++) - uart_remove_one_port(&sci_uart_driver, &sci_ports[chan].port); + for (i = 0; i < SCI_NPORTS; i++) + uart_remove_one_port(&sci_uart_driver, &sci_ports[i].port); + + return 0; +} + +static int sci_suspend(struct platform_device *dev, pm_message_t state) +{ + int i; + + for (i = 0; i < SCI_NPORTS; i++) { + struct sci_port *p = &sci_ports[i]; + + if (p->type != PORT_UNKNOWN && p->port.dev == &dev->dev) + uart_suspend_port(&sci_uart_driver, &p->port); + } + + return 0; +} + +static int sci_resume(struct platform_device *dev) +{ + int i; + + for (i = 0; i < SCI_NPORTS; i++) { + struct sci_port *p = &sci_ports[i]; + + if (p->type != PORT_UNKNOWN && p->port.dev == &dev->dev) + uart_resume_port(&sci_uart_driver, &p->port); + } + + return 0; +} + +static struct platform_driver sci_driver = { + .probe = sci_probe, + .remove = __devexit_p(sci_remove), + .suspend = sci_suspend, + .resume = sci_resume, + .driver = { + .name = "sh-sci", + .owner = THIS_MODULE, + }, +}; + +static int __init sci_init(void) +{ + int ret; + + printk(banner); + + sci_init_ports(); + + ret = uart_register_driver(&sci_uart_driver); + if (likely(ret == 0)) { + ret = platform_driver_register(&sci_driver); + if (unlikely(ret)) + uart_unregister_driver(&sci_uart_driver); + } + return ret; +} + +static void __exit sci_exit(void) +{ + platform_driver_unregister(&sci_driver); uart_unregister_driver(&sci_uart_driver); } Index: sh-sci.h =================================================================== RCS file: /cvsroot/linuxsh/linux/drivers/serial/sh-sci.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- sh-sci.h 8 Feb 2006 12:24:41 -0000 1.21 +++ sh-sci.h 1 Aug 2006 02:13:08 -0000 1.22 @@ -12,6 +12,7 @@ */ #include <linux/config.h> #include <linux/serial_core.h> +#include <asm/io.h> #if defined(__H8300H__) || defined(__H8300S__) #include <asm/gpio.h> @@ -23,11 +24,6 @@ #endif #endif -/* Offsets into the sci_port->irqs array */ -#define SCIx_ERI_IRQ 0 -#define SCIx_RXI_IRQ 1 -#define SCIx_TXI_IRQ 2 - /* ERI, RXI, TXI, BRI */ #define SCI_IRQS { 23, 24, 25, 0 } #define SH3_SCIF_IRQS { 56, 57, 59, 58 } @@ -49,8 +45,6 @@ #define SH7770_SCIF0_IRQS {61, 61, 61, 61 } #define SH7770_SCIF1_IRQS {62, 62, 62, 62 } #define SH7770_SCIF2_IRQS {63, 63, 63, 63 } -#define SH7780_SCIF0_IRQS {40, 41, 43, 42 } -#define SH7780_SCIF1_IRQS {76, 77, 79, 78 } #if defined(CONFIG_CPU_SUBTYPE_SH7708) # define SCSPTR 0xffffff7c /* 8 bit */ @@ -146,7 +140,7 @@ #elif defined(CONFIG_CPU_SUBTYPE_SH7780) # define SCSPTR0 0xffe00024 /* 16 bit SCIF */ # define SCSPTR1 0xffe10024 /* 16 bit SCIF */ -# define SCIF_OPER 0x0001 /* Overrun error bit */ +# define SCIF_ORER 0x0001 /* Overrun error bit */ # define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ # define SCIF_ONLY #else @@ -274,17 +268,6 @@ */ #define SCI_EVENT_WRITE_WAKEUP 0 -struct sci_port { - struct uart_port port; - int type; - unsigned char irqs[4]; /* ERI, RXI, TXI, BRI */ - void (*init_pins)(struct uart_port *port, unsigned int cflag); - void (*enable)(struct uart_port *port); - void (*disable)(struct uart_port *port); - int break_flag; - struct timer_list break_timer; -}; - #define SCI_IN(size, offset) \ unsigned int addr = port->mapbase + (offset); \ if ((size) == 8) { \ |
|
From: Paul M. <le...@us...> - 2006-08-01 02:13:12
|
Update of /cvsroot/linuxsh/linux/include/asm-sh In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv24470/include/asm-sh Added Files: sci.h Log Message: Rewrite sh-sci for the driver model. All CPU subtypes are required to register a platform device with their port list defined (see the 7780 setup code as an example). --- NEW FILE: sci.h --- #ifndef __ASM_SH_SCI_H #define __ASM_SH_SCI_H #include <linux/serial_core.h> /* * Generic header for SuperH SCI(F) * * Do not place SH-specific parts in here, sh64 and h8300 depend on this too. */ /* Offsets into the sci_port->irqs array */ enum { SCIx_ERI_IRQ, SCIx_RXI_IRQ, SCIx_TXI_IRQ, SCIx_BRI_IRQ, SCIx_NR_IRQS, }; /* * Platform device specific platform_data struct */ struct plat_sci_port { void __iomem *membase; /* io cookie */ unsigned long mapbase; /* resource base */ unsigned int irqs[4]; /* ERI, RXI, TXI, BRI */ unsigned int type; /* SCI / SCIF / IRDA */ upf_t flags; /* UPF_* flags */ }; #endif /* __ASM_SH_SCI_H */ |
|
From: Paul M. <le...@us...> - 2006-08-01 02:13:12
|
Update of /cvsroot/linuxsh/linux/arch/sh/kernel/cpu/sh4 In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv24470/arch/sh/kernel/cpu/sh4 Modified Files: setup-sh7780.c Log Message: Rewrite sh-sci for the driver model. All CPU subtypes are required to register a platform device with their port list defined (see the 7780 setup code as an example). Index: setup-sh7780.c =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/kernel/cpu/sh4/setup-sh7780.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- setup-sh7780.c 11 Jul 2006 07:57:40 -0000 1.1 +++ setup-sh7780.c 1 Aug 2006 02:13:08 -0000 1.2 @@ -9,6 +9,8 @@ */ #include <linux/platform_device.h> #include <linux/init.h> +#include <linux/serial.h> +#include <asm/sci.h> static struct resource rtc_resources[] = { [0] = { @@ -40,8 +42,33 @@ .resource = rtc_resources, }; +static struct plat_sci_port sci_platform_data[] = { + { + .mapbase = 0xffe00000, + .flags = UPF_BOOT_AUTOCONF, + .type = PORT_SCIF, + .irqs = { 40, 41, 43, 42 }, + }, { + .mapbase = 0xffe10000, + .flags = UPF_BOOT_AUTOCONF, + .type = PORT_SCIF, + .irqs = { 76, 77, 79, 78 }, + }, { + .flags = 0, + } +}; + +static struct platform_device sci_device = { + .name = "sh-sci", + .id = -1, + .dev = { + .platform_data = sci_platform_data, + }, +}; + static struct platform_device *sh7780_devices[] __initdata = { &rtc_device, + &sci_device, }; static int __init sh7780_devices_setup(void) |
|
From: Paul M. <le...@us...> - 2006-07-31 08:46:22
|
Update of /cvsroot/linuxsh/linux/arch/sh/kernel In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5187/arch/sh/kernel Modified Files: early_printk.c Log Message: __setup() semantics changed, return 1 from setup_early_printk(). Index: early_printk.c =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/kernel/early_printk.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- early_printk.c 31 Jul 2006 08:30:48 -0000 1.5 +++ early_printk.c 31 Jul 2006 08:46:19 -0000 1.6 @@ -177,7 +177,7 @@ if (likely(early_console)) register_console(early_console); - return 0; + return 1; } __setup("earlyprintk=", setup_early_printk); |
|
From: Paul M. <le...@us...> - 2006-07-31 08:43:22
|
Update of /cvsroot/linuxsh/linux/include/asm-sh In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv3961/include/asm-sh Added Files: setup.h Log Message: Missing header update for earlyprintk changes. --- NEW FILE: setup.h --- #ifdef __KERNEL__ #ifndef _SH_SETUP_H #define _SH_SETUP_H #define COMMAND_LINE_SIZE 256 int setup_early_printk(char *); #endif /* _SH_SETUP_H */ #endif /* __KERNEL__ */ |
|
From: Paul M. <le...@us...> - 2006-07-31 08:30:52
|
Update of /cvsroot/linuxsh/linux/arch/sh/kernel In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv31010/arch/sh/kernel Modified Files: early_printk.c setup.c Log Message: Allow multiple early printk consoles via earlyprintk=. With this change earlyprintk is no longer enabled by default, it must be specified on the kernel command line. Optionally with ,keep to prevent unreg by tty_io. Index: early_printk.c =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/kernel/early_printk.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- early_printk.c 13 Aug 2005 15:49:28 -0000 1.4 +++ early_printk.c 31 Jul 2006 08:30:48 -0000 1.5 @@ -3,7 +3,7 @@ * * Copyright (C) 1999, 2000 Niibe Yutaka * Copyright (C) 2002 M. R. Brown - * Copyright (C) 2004 Paul Mundt + * Copyright (C) 2004 - 2006 Paul Mundt * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -49,7 +49,7 @@ return 0; } -static struct console early_console = { +static struct console bios_console = { .name = "bios", .write = sh_console_write, .setup = sh_console_setup, @@ -72,7 +72,7 @@ static struct uart_port scif_port = { .mapbase = SCIF_REG, - .membase = (char *)SCIF_REG, + .membase = (char __iomem *)SCIF_REG, }; static void scif_sercon_putc(int c) @@ -91,7 +91,8 @@ scif_sercon_putc('\r'); } -static void scif_sercon_write(struct console *con, const char *s, unsigned count) +static void scif_sercon_write(struct console *con, const char *s, + unsigned count) { while (count-- > 0) scif_sercon_putc(*s++); @@ -104,7 +105,7 @@ return 0; } -static struct console early_console = { +static struct console scif_console = { .name = "sercon", .write = scif_sercon_write, .setup = scif_sercon_setup, @@ -112,7 +113,7 @@ .index = -1, }; -void scif_sercon_init(int baud) +static void scif_sercon_init(int baud) { ctrl_outw(0, SCIF_REG + 8); ctrl_outw(0, SCIF_REG); @@ -130,16 +131,61 @@ } #endif -void __init enable_early_printk(void) +/* + * Setup a default console, if more than one is compiled in, rely on the + * earlyprintk= parsing to give priority. + */ +static struct console *early_console = +#ifdef CONFIG_SH_STANDARD_BIOS + &bios_console +#elif defined(CONFIG_EARLY_SCIF_CONSOLE) + &scif_console +#else + NULL +#endif + ; + +static int __initdata keep_early; + +int __init setup_early_printk(char *opt) { -#if defined(CONFIG_EARLY_SCIF_CONSOLE) && defined(CONFIG_CPU_SH4) - scif_sercon_init(115200); + char *space; + char buf[256]; + + strlcpy(buf, opt, sizeof(buf)); + space = strchr(buf, ' '); + if (space) + *space = 0; + + if (strstr(buf, "keep")) + keep_early = 1; + +#ifdef CONFIG_SH_STANDARD_BIOS + if (!strncmp(buf, "bios", 4)) + early_console = &bios_console; #endif - register_console(&early_console); +#if defined(CONFIG_EARLY_SCIF_CONSOLE) + if (!strncmp(buf, "serial", 6)) { + early_console = &scif_console; + +#ifdef CONFIG_CPU_SH4 + scif_sercon_init(115200); +#endif + } +#endif + + if (likely(early_console)) + register_console(early_console); + + return 0; } +__setup("earlyprintk=", setup_early_printk); -void disable_early_printk(void) +void __init disable_early_printk(void) { - unregister_console(&early_console); + if (!keep_early) { + printk("disabling early console\n"); + unregister_console(early_console); + } else + printk("keeping early console\n"); } - Index: setup.c =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/kernel/setup.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- setup.c 7 Jul 2006 10:55:47 -0000 1.53 +++ setup.c 31 Jul 2006 08:30:48 -0000 1.54 @@ -145,6 +145,24 @@ memory_end = memory_start + mem_size; } } + +#ifdef CONFIG_EARLY_PRINTK + if (c == ' ' && !memcmp(from, "earlyprintk=", 12)) { + char *ep_end; + + if (to != command_line) + to--; + + from += 12; + ep_end = strchr(from, ' '); + + setup_early_printk(from); + printk("early console enabled\n"); + + from = ep_end; + } +#endif + if (c == ' ' && !memcmp(from, "sh_mv=", 6)) { char* mv_end; char* mv_comma; @@ -245,11 +263,7 @@ unsigned long bootmap_size; unsigned long start_pfn, max_pfn, max_low_pfn; -#ifdef CONFIG_EARLY_PRINTK - extern void enable_early_printk(void); - enable_early_printk(); -#endif #ifdef CONFIG_CMDLINE_BOOL strcpy(COMMAND_LINE, CONFIG_CMDLINE); #endif |
|
From: Paul M. <le...@us...> - 2006-07-31 08:28:48
|
Update of /cvsroot/linuxsh/linux/drivers/serial In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30621/drivers/serial Modified Files: sh-sci.c Log Message: Fix sleep under lock in sci_set_termios(). Index: sh-sci.c =================================================================== RCS file: /cvsroot/linuxsh/linux/drivers/serial/sh-sci.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- sh-sci.c 27 Mar 2006 21:06:14 -0000 1.43 +++ sh-sci.c 31 Jul 2006 08:28:45 -0000 1.44 @@ -967,6 +967,8 @@ sci_out(port, SCSMR, smr_val); + spin_unlock_irqrestore(&port->lock, flags); + switch (baud) { case 0: t = -1; @@ -1002,8 +1004,6 @@ if ((termios->c_cflag & CREAD) != 0) sci_start_rx(port,0); - - spin_unlock_irqrestore(&port->lock, flags); } static const char *sci_type(struct uart_port *port) |