| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: rpi_machdep.c,v 1.27 2013/01/10 14:15:20 jmcneill Exp $ */ | | 1 | /* $NetBSD: rpi_machdep.c,v 1.28 2013/01/11 12:47:38 jmcneill Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2012 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2012 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 Nick Hudson | | 8 | * by Nick Hudson |
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. |
| @@ -20,36 +20,37 @@ | | | @@ -20,36 +20,37 @@ |
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
29 | * POSSIBILITY OF SUCH DAMAGE. | | 29 | * POSSIBILITY OF SUCH DAMAGE. |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | #include <sys/cdefs.h> | | 32 | #include <sys/cdefs.h> |
33 | __KERNEL_RCSID(0, "$NetBSD: rpi_machdep.c,v 1.27 2013/01/10 14:15:20 jmcneill Exp $"); | | 33 | __KERNEL_RCSID(0, "$NetBSD: rpi_machdep.c,v 1.28 2013/01/11 12:47:38 jmcneill Exp $"); |
34 | | | 34 | |
35 | #include "opt_evbarm_boardtype.h" | | 35 | #include "opt_evbarm_boardtype.h" |
36 | | | 36 | |
37 | #include "sdhc.h" | | 37 | #include "sdhc.h" |
38 | #include "dotg.h" | | 38 | #include "dotg.h" |
39 | #include "bcmspi.h" | | 39 | #include "bcmspi.h" |
40 | #include "bsciic.h" | | 40 | #include "bsciic.h" |
41 | #include "plcom.h" | | 41 | #include "plcom.h" |
42 | #include "genfb.h" | | 42 | #include "genfb.h" |
| | | 43 | #include "ukbd.h" |
43 | | | 44 | |
44 | #include <sys/param.h> | | 45 | #include <sys/param.h> |
45 | #include <sys/device.h> | | 46 | #include <sys/device.h> |
46 | #include <sys/termios.h> | | 47 | #include <sys/termios.h> |
47 | #include <sys/bus.h> | | 48 | #include <sys/bus.h> |
48 | | | 49 | |
49 | #include <net/if_ether.h> | | 50 | #include <net/if_ether.h> |
50 | #include <prop/proplib.h> | | 51 | #include <prop/proplib.h> |
51 | | | 52 | |
52 | #include <dev/cons.h> | | 53 | #include <dev/cons.h> |
53 | | | 54 | |
54 | #include <uvm/uvm_extern.h> | | 55 | #include <uvm/uvm_extern.h> |
55 | | | 56 | |
| @@ -71,26 +72,30 @@ __KERNEL_RCSID(0, "$NetBSD: rpi_machdep. | | | @@ -71,26 +72,30 @@ __KERNEL_RCSID(0, "$NetBSD: rpi_machdep. |
71 | | | 72 | |
72 | #include <evbarm/rpi/rpi.h> | | 73 | #include <evbarm/rpi/rpi.h> |
73 | | | 74 | |
74 | #if NPLCOM > 0 | | 75 | #if NPLCOM > 0 |
75 | #include <evbarm/dev/plcomreg.h> | | 76 | #include <evbarm/dev/plcomreg.h> |
76 | #include <evbarm/dev/plcomvar.h> | | 77 | #include <evbarm/dev/plcomvar.h> |
77 | #endif | | 78 | #endif |
78 | | | 79 | |
79 | #if NGENFB > 0 | | 80 | #if NGENFB > 0 |
80 | #include <dev/videomode/videomode.h> | | 81 | #include <dev/videomode/videomode.h> |
81 | #include <dev/videomode/edidvar.h> | | 82 | #include <dev/videomode/edidvar.h> |
82 | #endif | | 83 | #endif |
83 | | | 84 | |
| | | 85 | #if NUKBD > 0 |
| | | 86 | #include <dev/usb/ukbdvar.h> |
| | | 87 | #endif |
| | | 88 | |
84 | #include "ksyms.h" | | 89 | #include "ksyms.h" |
85 | | | 90 | |
86 | extern int KERNEL_BASE_phys[]; | | 91 | extern int KERNEL_BASE_phys[]; |
87 | extern int KERNEL_BASE_virt[]; | | 92 | extern int KERNEL_BASE_virt[]; |
88 | | | 93 | |
89 | BootConfig bootconfig; /* Boot config storage */ | | 94 | BootConfig bootconfig; /* Boot config storage */ |
90 | static char bootargs[MAX_BOOT_STRING]; | | 95 | static char bootargs[MAX_BOOT_STRING]; |
91 | char *boot_args = NULL; | | 96 | char *boot_args = NULL; |
92 | | | 97 | |
93 | static void rpi_bootparams(void); | | 98 | static void rpi_bootparams(void); |
94 | static void rpi_device_register(device_t, void *); | | 99 | static void rpi_device_register(device_t, void *); |
95 | | | 100 | |
96 | /* | | 101 | /* |
| @@ -752,19 +757,23 @@ rpi_device_register(device_t dev, void * | | | @@ -752,19 +757,23 @@ rpi_device_register(device_t dev, void * |
752 | "WARNING: Unable to set mac-address property\n"); | | 757 | "WARNING: Unable to set mac-address property\n"); |
753 | } | | 758 | } |
754 | prop_object_release(pd); | | 759 | prop_object_release(pd); |
755 | } | | 760 | } |
756 | | | 761 | |
757 | #if NGENFB > 0 | | 762 | #if NGENFB > 0 |
758 | if (device_is_a(dev, "genfb")) { | | 763 | if (device_is_a(dev, "genfb")) { |
759 | char *ptr; | | 764 | char *ptr; |
760 | if (rpi_fb_init(dict) == false) | | 765 | if (rpi_fb_init(dict) == false) |
761 | return; | | 766 | return; |
762 | if (get_bootconf_option(boot_args, "console", | | 767 | if (get_bootconf_option(boot_args, "console", |
763 | BOOTOPT_TYPE_STRING, &ptr) && strncmp(ptr, "fb", 2) == 0) { | | 768 | BOOTOPT_TYPE_STRING, &ptr) && strncmp(ptr, "fb", 2) == 0) { |
764 | prop_dictionary_set_bool(dict, "is_console", true); | | 769 | prop_dictionary_set_bool(dict, "is_console", true); |
| | | 770 | #if NUKBD > 0 |
| | | 771 | /* allow ukbd to be the console keyboard */ |
| | | 772 | ukbd_cnattach(); |
| | | 773 | #endif |
765 | } else { | | 774 | } else { |
766 | prop_dictionary_set_bool(dict, "is_console", false); | | 775 | prop_dictionary_set_bool(dict, "is_console", false); |
767 | } | | 776 | } |
768 | } | | 777 | } |
769 | #endif | | 778 | #endif |
770 | } | | 779 | } |