summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/arm/s3c2xx0/sscom.c56
-rw-r--r--sys/arch/arm/s3c2xx0/sscom_s3c2410.c23
2 files changed, 40 insertions, 39 deletions
diff --git a/sys/arch/arm/s3c2xx0/sscom.c b/sys/arch/arm/s3c2xx0/sscom.c
index 53b02cdf19b..97283348844 100644
--- a/sys/arch/arm/s3c2xx0/sscom.c
+++ b/sys/arch/arm/s3c2xx0/sscom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sscom.c,v 1.5 2008/12/15 22:30:17 drahn Exp $ */
+/* $OpenBSD: sscom.c,v 1.6 2008/12/24 07:46:15 drahn Exp $ */
/* $NetBSD: sscom.c,v 1.29 2008/06/11 22:37:21 cegger Exp $ */
/*
@@ -190,10 +190,8 @@ static int sscom_to_tiocm(struct sscom_softc *);
static void sscom_iflush(struct sscom_softc *);
static int sscomhwiflow(struct tty *tp, int block);
-#if 0
-static int sscom_init(bus_space_tag_t, const struct sscom_uart_info *,
+int sscom_init(bus_space_tag_t, const struct sscom_uart_info *,
int, int, tcflag_t, bus_space_handle_t *);
-#endif
extern struct cfdriver sscom_cd;
@@ -380,6 +378,7 @@ sscomstatus(struct sscom_softc *sc, const char *str)
#define sscom_debug 0
#endif
+#if 0
static void
sscom_enable_debugport(struct sscom_softc *sc)
{
@@ -397,6 +396,7 @@ sscom_enable_debugport(struct sscom_softc *sc)
SSCOM_UNLOCK(sc);
splx(s);
}
+#endif
static void
sscom_set_modem_control(struct sscom_softc *sc)
@@ -426,13 +426,6 @@ sscom_attach_subr(struct sscom_softc *sc)
bus_space_handle_t ioh = sc->sc_ioh;
struct tty *tp;
- timeout_set(&sc->sc_diag_timeout, sscomdiag, sc);
-#if (defined(MULTIPROCESSOR) || defined(LOCKDEBUG)) && defined(SSCOM_MPLOCK)
- simple_lock_init(&sc->sc_lock);
-#endif
-
- sc->sc_ucon = UCON_RXINT_ENABLE|UCON_TXINT_ENABLE;
-
/*
* set default for modem control hook
*/
@@ -441,6 +434,14 @@ sscom_attach_subr(struct sscom_softc *sc)
if (sc->read_modem_status == NULL)
sc->read_modem_status = sscom_read_modem_status;
+ timeout_set(&sc->sc_diag_timeout, sscomdiag, sc);
+#if (defined(MULTIPROCESSOR) || defined(LOCKDEBUG)) && defined(SSCOM_MPLOCK)
+ simple_lock_init(&sc->sc_lock);
+#endif
+
+ sc->sc_ucon = UCON_RXINT_ENABLE|UCON_TXINT_ENABLE;
+
+
/* Disable interrupts before configuring the device. */
sscom_disable_txrxint(sc);
@@ -517,10 +518,19 @@ sscom_attach_subr(struct sscom_softc *sc)
cn_tab->cn_dev = makedev(maj, sc->sc_dev.dv_unit);
- printf("%s: console (major=%d)\n", sc->sc_dev.dv_xname, maj);
+ printf(": console", sc->sc_dev.dv_xname, maj);
}
+
+#if NRND > 0 && defined(RND_COM)
+ rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname,
+ RND_TYPE_TTY, 0);
+#endif
+
+ /* if there are no enable/disable functions, assume the device
+ is always enabled */
+
#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
sc->sc_si = softintr_establish(IPL_TTY, sscomsoft, sc);
if (sc->sc_si == NULL)
@@ -530,21 +540,14 @@ sscom_attach_subr(struct sscom_softc *sc)
timeout_set(&sc->sc_comsoft_tmo, comsoft, sc);
#endif
+ SET(sc->sc_hwflags, SSCOM_HW_DEV_OK);
-#if NRND > 0 && defined(RND_COM)
- rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname,
- RND_TYPE_TTY, 0);
-#endif
-
- /* if there are no enable/disable functions, assume the device
- is always enabled */
-
+#if 0
if (ISSET(sc->sc_hwflags, SSCOM_HW_CONSOLE))
sscom_enable_debugport(sc);
else
sscom_disable_txrxint(sc);
-
- SET(sc->sc_hwflags, SSCOM_HW_DEV_OK);
+#endif
}
int
@@ -1300,13 +1303,6 @@ sscom_loadchannelregs(struct sscom_softc *sc)
bus_space_write_2(iot, ioh, SSCOM_UCON, 0);
-#if 0
- if (ISSET(sc->sc_hwflags, COM_HW_FLOW)) {
- bus_space_write_1(iot, ioh, com_lcr, LCR_EERS);
- bus_space_write_1(iot, ioh, com_efr, sc->sc_efr);
- }
-#endif
-
bus_space_write_2(iot, ioh, SSCOM_UBRDIV, sc->sc_ubrdiv);
bus_space_write_1(iot, ioh, SSCOM_ULCON, sc->sc_ulcon);
sc->set_modem_control(sc);
@@ -1999,7 +1995,7 @@ sscomtxintr(void *arg)
/*
* Initialize UART for use as console or KGDB line.
*/
-static int
+int
sscom_init(bus_space_tag_t iot, const struct sscom_uart_info *config,
int rate, int frequency, tcflag_t cflag, bus_space_handle_t *iohp)
{
diff --git a/sys/arch/arm/s3c2xx0/sscom_s3c2410.c b/sys/arch/arm/s3c2xx0/sscom_s3c2410.c
index 0b84d383ef1..44ad1463443 100644
--- a/sys/arch/arm/s3c2xx0/sscom_s3c2410.c
+++ b/sys/arch/arm/s3c2xx0/sscom_s3c2410.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sscom_s3c2410.c,v 1.2 2008/12/08 20:50:20 drahn Exp $ */
+/* $OpenBSD: sscom_s3c2410.c,v 1.3 2008/12/24 07:46:15 drahn Exp $ */
/* $NetBSD: sscom_s3c2410.c,v 1.2 2005/12/11 12:16:51 christos Exp $ */
/*
@@ -79,7 +79,7 @@ CFATTACH_DECL(sscom, sizeof(struct sscom_softc), sscom_match,
#endif
struct cfdriver sscom_cd = {
- NULL, "com", DV_TTY
+ NULL, "sscom", DV_TTY
};
struct cfattach sscom_ca = {
sizeof(struct sscom_softc), sscom_match, sscom_attach
@@ -129,7 +129,7 @@ sscom_attach(struct device *parent, struct device *self, void *aux)
int unit = sa->sa_index;
bus_addr_t iobase = s3c2410_uart_config[unit].iobase;
- printf( ": UART%d addr=%lx", sa->sa_index, iobase );
+ printf( ": addr=%lx", iobase );
sc->sc_iot = s3c2xx0_softc->sc_iot;
sc->sc_unit = unit;
@@ -144,19 +144,24 @@ sscom_attach(struct device *parent, struct device *self, void *aux)
}
+ sscom_disable_txrxint(sc);
+
+ printf(" irqs(%d:%d:%d)",
+ s3c2410_uart_config[unit].tx_int,
+ s3c2410_uart_config[unit].rx_int,
+ s3c2410_uart_config[unit].err_int);
+
+ sscom_attach_subr(sc);
+
+
s3c24x0_intr_establish(s3c2410_uart_config[unit].tx_int,
IPL_SERIAL, IST_LEVEL, sscomtxintr, sc);
s3c24x0_intr_establish(s3c2410_uart_config[unit].rx_int,
IPL_SERIAL, IST_LEVEL, sscomrxintr, sc);
s3c24x0_intr_establish(s3c2410_uart_config[unit].err_int,
IPL_SERIAL, IST_LEVEL, sscomrxintr, sc);
- sscom_disable_txrxint(sc);
- printf(" txirq %d rxirq %d mirq %d\n",
- s3c2410_uart_config[unit].tx_int,
- s3c2410_uart_config[unit].rx_int,
- s3c2410_uart_config[unit].err_int);
- sscom_attach_subr(sc);
+ printf("\n");
}