public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yoshinori Sato <ysato@users.sourceforge.jp>
To: Linus Torvalds <torvalds@osdl.org>, linuxsh-dev@lists.sourceforge.net
Cc: linux kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: sh-sci compile error fix patch
Date: Tue, 06 Apr 2004 20:00:27 +0900	[thread overview]
Message-ID: <m265cdl6b8.wl%ysato@users.sourceforge.jp> (raw)

- add Kconfig depends H8300
- H8/300 support compile error fixed.

-- 
Yoshinori Sato
<ysato@users.sourceforge.jp>

diff -Nru -X .exclude-diff linux-2.6.5/drivers/serial/Kconfig linux-2.6.5-h8300/drivers/serial/Kconfig
--- linux-2.6.5/drivers/serial/Kconfig	2004-04-06 17:11:11.000000000 +0900
+++ linux-2.6.5-h8300/drivers/serial/Kconfig	2004-04-06 01:52:16.000000000 +0900
@@ -479,7 +479,7 @@
 
 config SERIAL_SH_SCI
 	tristate "SH SCI(F) serial port support"
-	depends on SUPERH
+	depends on SUPERH || H8300
 	select SERIAL_CORE
 
 config SERIAL_SH_SCI_CONSOLE
diff -Nru -X .exclude-diff linux-2.6.5/drivers/serial/sh-sci.c linux-2.6.5-h8300/drivers/serial/sh-sci.c
--- linux-2.6.5/drivers/serial/sh-sci.c	2004-04-06 17:11:11.000000000 +0900
+++ linux-2.6.5-h8300/drivers/serial/sh-sci.c	2004-04-06 01:52:16.000000000 +0900
@@ -313,9 +313,9 @@
 
 #if defined(SCI_ONLY) || defined(SCI_AND_SCIF)
 #if defined(__H8300H__) || defined(__H8300S__)
-static void sci_init_pins_sci(struct sci_port* port, unsigned int cflag)
+static void sci_init_pins_sci(struct uart_port* port, unsigned int cflag)
 {
-	int ch = (port->base - SMR0) >> 3;
+	int ch = (port->mapbase - SMR0) >> 3;
 
 	/* set DDR regs */
 	H8300_GPIO_DDR(h8300_sci_pins[ch].port,h8300_sci_pins[ch].rx,H8300_GPIO_INPUT);
@@ -418,11 +418,15 @@
 		return;
 	}
 
+#if !defined(SCI_ONLY)
 	if (port->type == PORT_SCIF) {
 		txroom = 16 - (sci_in(port, SCFDR)>>8);
 	} else {
 		txroom = (sci_in(port, SCxSR) & SCI_TDRE)?1:0;
 	}
+#else
+	txroom = (sci_in(port, SCxSR) & SCI_TDRE)?1:0;
+#endif
 
 	count = txroom;
 
@@ -454,10 +458,12 @@
 		local_irq_save(flags);
 		ctrl = sci_in(port, SCSCR);
 
+#if !defined(SCI_ONLY)
 		if (port->type == PORT_SCIF) {
 			sci_in(port, SCxSR); /* Dummy read */
 			sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port));
 		}
+#endif
 
 		ctrl |= SCI_CTRL_FLAGS_TIE;
 		sci_out(port, SCSCR, ctrl);
@@ -480,11 +486,15 @@
 		return;
 
 	while (1) {
+#if !defined(SCI_ONLY)
 		if (port->type == PORT_SCIF) {
 			count = sci_in(port, SCFDR)&0x001f;
 		} else {
 			count = (sci_in(port, SCxSR)&SCxSR_RDxF(port))?1:0;
 		}
+#else
+		count = (sci_in(port, SCxSR)&SCxSR_RDxF(port))?1:0;
+#endif
 
 		/* Don't copy more bytes than there is room for in the buffer */
 		if (tty->flip.count + count > TTY_FLIPBUF_SIZE)
@@ -936,9 +946,11 @@
 
 	sci_out(port, SCSCR, 0x00);	/* TE=0, RE=0, CKE1=0 */
 
+#if !defined(SCI_ONLY)
 	if (port->type == PORT_SCIF) {
 		sci_out(port, SCFCR, SCFCR_RFRST | SCFCR_TFRST);
 	}
+#endif
 
 	smr_val = sci_in(port, SCSMR) & 3;
 	if ((termios->c_cflag & CSIZE) == CS7)
@@ -1328,8 +1340,11 @@
 	 * 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 = current_cpu_data.module_clock * 16;
-
+#else
+	port->uartclk = CONFIG_CPU_CLOCK;
+#endif
 	if (options)
 		uart_parse_options(options, &baud, &parity, &bits, &flow);
 
@@ -1468,7 +1483,11 @@
 		for (chan = 0; chan < SCI_NPORTS; chan++) {
 			struct sci_port *sciport = &sci_ports[chan];
 
+#if !defined(__H8300H__) && !defined(__H8300S__)
 			sciport->port.uartclk = (current_cpu_data.module_clock * 16);
+#else
+			sciport->port.uartclk = CONFIG_CPU_CLOCK;
+#endif
 			uart_add_one_port(&sci_uart_driver, &sciport->port);
 			sciport->break_timer.data = (unsigned long)sciport;
 			sciport->break_timer.function = sci_break_timer;
diff -Nru -X .exclude-diff linux-2.6.5/drivers/serial/sh-sci.h linux-2.6.5-h8300/drivers/serial/sh-sci.h
--- linux-2.6.5/drivers/serial/sh-sci.h	2004-04-06 17:11:11.000000000 +0900
+++ linux-2.6.5-h8300/drivers/serial/sh-sci.h	2004-04-06 01:52:16.000000000 +0900
@@ -240,11 +240,11 @@
   }
 
 #define CPU_SCI_FNS(name, sci_offset, sci_size)				\
-  static inline unsigned int sci_##name##_in(struct sci_port* port)	\
+  static inline unsigned int sci_##name##_in(struct uart_port* port)	\
   {									\
     SCI_IN(sci_size, sci_offset);		 			\
   }									\
-  static inline void sci_##name##_out(struct sci_port* port, unsigned int value) \
+  static inline void sci_##name##_out(struct uart_port* port, unsigned int value) \
   {									\
     SCI_OUT(sci_size, sci_offset, value);				\
   }
@@ -379,9 +379,9 @@
 
 }
 #elif defined(__H8300H__) || defined(__H8300S__)
-static inline int sci_rxd_in(struct sci_port *port)
+static inline int sci_rxd_in(struct uart_port *port)
 {
-	int ch = (port->base - SMR0) >> 3;
+	int ch = (port->mapbase - SMR0) >> 3;
 	return (H8300_SCI_DR(ch) & h8300_sci_pins[ch].rx) ? 1 : 0;
 }
 #endif

                 reply	other threads:[~2004-04-06 11:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m265cdl6b8.wl%ysato@users.sourceforge.jp \
    --to=ysato@users.sourceforge.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxsh-dev@lists.sourceforge.net \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox