| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: com.c,v 1.318 2013/12/15 11:06:57 skrll Exp $ */ | | 1 | /* $NetBSD: com.c,v 1.319 2013/12/15 15:55:39 mbalmer Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Charles M. Hannum. | | 8 | * by Charles M. Hannum. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -56,27 +56,27 @@ | | | @@ -56,27 +56,27 @@ |
56 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 56 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
57 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 57 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
58 | * SUCH DAMAGE. | | 58 | * SUCH DAMAGE. |
59 | * | | 59 | * |
60 | * @(#)com.c 7.5 (Berkeley) 5/16/91 | | 60 | * @(#)com.c 7.5 (Berkeley) 5/16/91 |
61 | */ | | 61 | */ |
62 | | | 62 | |
63 | /* | | 63 | /* |
64 | * COM driver, uses National Semiconductor NS16450/NS16550AF UART | | 64 | * COM driver, uses National Semiconductor NS16450/NS16550AF UART |
65 | * Supports automatic hardware flow control on StarTech ST16C650A UART | | 65 | * Supports automatic hardware flow control on StarTech ST16C650A UART |
66 | */ | | 66 | */ |
67 | | | 67 | |
68 | #include <sys/cdefs.h> | | 68 | #include <sys/cdefs.h> |
69 | __KERNEL_RCSID(0, "$NetBSD: com.c,v 1.318 2013/12/15 11:06:57 skrll Exp $"); | | 69 | __KERNEL_RCSID(0, "$NetBSD: com.c,v 1.319 2013/12/15 15:55:39 mbalmer Exp $"); |
70 | | | 70 | |
71 | #include "opt_com.h" | | 71 | #include "opt_com.h" |
72 | #include "opt_ddb.h" | | 72 | #include "opt_ddb.h" |
73 | #include "opt_kgdb.h" | | 73 | #include "opt_kgdb.h" |
74 | #include "opt_lockdebug.h" | | 74 | #include "opt_lockdebug.h" |
75 | #include "opt_multiprocessor.h" | | 75 | #include "opt_multiprocessor.h" |
76 | #include "opt_ntp.h" | | 76 | #include "opt_ntp.h" |
77 | | | 77 | |
78 | #include "rnd.h" | | 78 | #include "rnd.h" |
79 | | | 79 | |
80 | /* The COM16650 option was renamed to COM_16650. */ | | 80 | /* The COM16650 option was renamed to COM_16650. */ |
81 | #ifdef COM16650 | | 81 | #ifdef COM16650 |
82 | #error Obsolete COM16650 option; use COM_16650 instead. | | 82 | #error Obsolete COM16650 option; use COM_16650 instead. |
| @@ -375,27 +375,29 @@ com_enable_debugport(struct com_softc *s | | | @@ -375,27 +375,29 @@ com_enable_debugport(struct com_softc *s |
375 | sc->sc_ier = IER_ERXRDY; | | 375 | sc->sc_ier = IER_ERXRDY; |
376 | if (sc->sc_type == COM_TYPE_PXA2x0) | | 376 | if (sc->sc_type == COM_TYPE_PXA2x0) |
377 | sc->sc_ier |= IER_EUART | IER_ERXTOUT; | | 377 | sc->sc_ier |= IER_EUART | IER_ERXTOUT; |
378 | CSR_WRITE_1(&sc->sc_regs, COM_REG_IER, sc->sc_ier); | | 378 | CSR_WRITE_1(&sc->sc_regs, COM_REG_IER, sc->sc_ier); |
379 | SET(sc->sc_mcr, MCR_DTR | MCR_RTS); | | 379 | SET(sc->sc_mcr, MCR_DTR | MCR_RTS); |
380 | CSR_WRITE_1(&sc->sc_regs, COM_REG_MCR, sc->sc_mcr); | | 380 | CSR_WRITE_1(&sc->sc_regs, COM_REG_MCR, sc->sc_mcr); |
381 | } | | 381 | } |
382 | | | 382 | |
383 | void | | 383 | void |
384 | com_attach_subr(struct com_softc *sc) | | 384 | com_attach_subr(struct com_softc *sc) |
385 | { | | 385 | { |
386 | struct com_regs *regsp = &sc->sc_regs; | | 386 | struct com_regs *regsp = &sc->sc_regs; |
387 | struct tty *tp; | | 387 | struct tty *tp; |
| | | 388 | #ifdef COM_16650 |
388 | u_int8_t lcr; | | 389 | u_int8_t lcr; |
| | | 390 | #endif |
389 | const char *fifo_msg = NULL; | | 391 | const char *fifo_msg = NULL; |
390 | prop_dictionary_t dict; | | 392 | prop_dictionary_t dict; |
391 | bool is_console = true; | | 393 | bool is_console = true; |
392 | | | 394 | |
393 | aprint_naive("\n"); | | 395 | aprint_naive("\n"); |
394 | | | 396 | |
395 | dict = device_properties(sc->sc_dev); | | 397 | dict = device_properties(sc->sc_dev); |
396 | prop_dictionary_get_bool(dict, "is_console", &is_console); | | 398 | prop_dictionary_get_bool(dict, "is_console", &is_console); |
397 | | | 399 | |
398 | callout_init(&sc->sc_diag_callout, 0); | | 400 | callout_init(&sc->sc_diag_callout, 0); |
399 | mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_HIGH); | | 401 | mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_HIGH); |
400 | | | 402 | |
401 | /* Disable interrupts before configuring the device. */ | | 403 | /* Disable interrupts before configuring the device. */ |