Print this page
bcm2835: use the real uart instead of the mini-uart
The real uart is more capable. We'll want to use it for the real console
eventually anyway, so let's bite the bullet now when no one will really
notice. (For comparison, the Linux kernel uses the real uart and totally
lacks a driver for the miniuart.)
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/armv6/bcm2835/os/boot_console.c
+++ new/usr/src/uts/armv6/bcm2835/os/boot_console.c
1 1 /*
2 2 * This file and its contents are supplied under the terms of the
3 3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 4 * You may only use this file in accordance with the terms of version
5 5 * 1.0 of the CDDL.
6 6 *
7 7 * A full copy of the text of the CDDL should have accompanied this
8 8 * source. A copy of the CDDL is also available via the Internet at
9 9 * http://www.illumos.org/license/CDDL.
↓ open down ↓ |
9 lines elided |
↑ open up ↑ |
10 10 */
11 11
12 12 /*
13 13 * Copyright (c) 2013 Joyent, Inc. All rights reserved.
14 14 */
15 15
16 16 /*
17 17 * bcm2835 boot console implementation
18 18 */
19 19
20 -#include "miniuart.h"
20 +#include "bcm2835_uart.h"
21 21
22 22 /*
23 23 * There are a few different potential boot consoles that we could have on the
24 24 * bcm2835. There is both a mini uart and a full functioning uart. Generally,
25 - * people will use the mini uart, but we want to support both. As such we have a
25 + * people will use one of them, but we want to support both. As such we have a
26 26 * single global ops vector that we set once during bcons_init and never again.
27 27 */
28 28 #define BMC2835_CONSNAME_MAX 24
29 29 typedef struct bcm2835_consops {
30 30 char bco_name[BMC2835_CONSNAME_MAX];
31 31 void (*bco_putc)(uint8_t);
32 32 uint8_t (*bco_getc)(void);
33 33 int (*bco_isc)(void);
34 34 } bcm2835_consops_t;
35 35
36 36 static bcm2835_consops_t consops;
37 37
38 38 /*
39 - * For now, we only support the mini uart.
39 + * For now, we only support the real uart.
40 40 */
41 41 void
42 42 bcons_init(char *bstr)
43 43 {
44 - bcm2835_miniuart_init();
45 - consops.bco_putc = bcm2835_miniuart_putc;
46 - consops.bco_getc = bcm2835_miniuart_getc;
47 - consops.bco_isc = bcm2835_miniuart_isc;
44 + bcm2835_uart_init();
45 + consops.bco_putc = bcm2835_uart_putc;
46 + consops.bco_getc = bcm2835_uart_getc;
47 + consops.bco_isc = bcm2835_uart_isc;
48 48 }
49 49
50 50 void
51 51 bcons_putchar(int c)
52 52 {
53 53 consops.bco_putc(c);
54 54 }
55 55
56 56 void
57 57 bcons_puts(const char *str)
58 58 {
59 59 const char *c = str;
60 60 while (*c != '\0')
61 61 consops.bco_putc(*c++);
62 62 }
63 63
64 64 int
65 65 bcons_getchar(void)
66 66 {
67 67 return (consops.bco_getc());
68 68 }
69 69
70 70 int
71 71 bcons_ischar(void)
72 72 {
73 73 return (consops.bco_isc());
74 74 }
↓ open down ↓ |
17 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX