Rev 4055 | Rev 4296 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4055 | Rev 4156 | ||
---|---|---|---|
Line 35... | Line 35... | ||
35 | #include <arch/console.h> |
35 | #include <arch/console.h> |
36 | #include <arch/types.h> |
36 | #include <arch/types.h> |
37 | 37 | ||
38 | #include <arch/drivers/scr.h> |
38 | #include <arch/drivers/scr.h> |
39 | #include <arch/drivers/kbd.h> |
39 | #include <arch/drivers/kbd.h> |
40 | - | ||
41 | #include <arch/drivers/sgcn.h> |
40 | #include <arch/drivers/sgcn.h> |
42 | - | ||
- | 41 | #include <genarch/srln/srln.h> |
|
43 | #include <console/chardev.h> |
42 | #include <console/chardev.h> |
44 | #include <console/console.h> |
43 | #include <console/console.h> |
45 | #include <arch/asm.h> |
44 | #include <arch/asm.h> |
46 | #include <arch/register.h> |
45 | #include <arch/register.h> |
47 | #include <proc/thread.h> |
46 | #include <proc/thread.h> |
Line 61... | Line 60... | ||
61 | * @param aliases the "/aliases" OBP node |
60 | * @param aliases the "/aliases" OBP node |
62 | */ |
61 | */ |
63 | static void standard_console_init(ofw_tree_node_t *aliases) |
62 | static void standard_console_init(ofw_tree_node_t *aliases) |
64 | { |
63 | { |
65 | #ifdef CONFIG_FB |
64 | #ifdef CONFIG_FB |
66 | ofw_tree_property_t *prop; |
- | |
67 | ofw_tree_node_t *screen; |
- | |
68 | ofw_tree_node_t *keyboard; |
- | |
69 | - | ||
70 | prop = ofw_tree_getprop(aliases, "screen"); |
65 | ofw_tree_property_t *prop_scr = ofw_tree_getprop(aliases, "screen"); |
71 | if (!prop) |
66 | if (!prop_scr) |
72 | panic("Cannot find property 'screen'."); |
67 | panic("Cannot find property 'screen'."); |
73 | if (!prop->value) |
68 | if (!prop_scr->value) |
74 | panic("Cannot find screen alias."); |
69 | panic("Cannot find screen alias."); |
75 | screen = ofw_tree_lookup(prop->value); |
70 | ofw_tree_node_t *screen = ofw_tree_lookup(prop_scr->value); |
76 | if (!screen) |
71 | if (!screen) |
77 | panic("Cannot find %s.", prop->value); |
72 | panic("Cannot find %s.", prop_scr->value); |
78 | 73 | ||
79 | scr_init(screen); |
74 | scr_init(screen); |
- | 75 | #endif |
|
80 | 76 | ||
- | 77 | #ifdef CONFIG_SUN_KBD |
|
81 | prop = ofw_tree_getprop(aliases, "keyboard"); |
78 | ofw_tree_property_t *prop_kbd = ofw_tree_getprop(aliases, "keyboard"); |
82 | if (!prop) |
79 | if (!prop_kbd) |
83 | panic("Cannot find property 'keyboard'."); |
80 | panic("Cannot find property 'keyboard'."); |
84 | if (!prop->value) |
81 | if (!prop_kbd->value) |
85 | panic("Cannot find keyboard alias."); |
82 | panic("Cannot find keyboard alias."); |
86 | keyboard = ofw_tree_lookup(prop->value); |
83 | ofw_tree_node_t *keyboard = ofw_tree_lookup(prop_kbd->value); |
87 | if (!keyboard) |
84 | if (!keyboard) |
88 | panic("Cannot find %s.", prop->value); |
85 | panic("Cannot find %s.", prop_kbd->value); |
89 | 86 | ||
90 | kbd_init(keyboard); |
87 | kbd_init(keyboard); |
91 | #else |
- | |
92 | panic("Standard console requires FB, " |
- | |
93 | "but the kernel is not compiled with FB support."); |
- | |
94 | #endif |
88 | #endif |
95 | } |
89 | } |
96 | 90 | ||
97 | /** Initilize I/O on the Serengeti machine. */ |
91 | /** Initilize I/O on the Serengeti machine. */ |
98 | static void serengeti_init(void) |
92 | static void serengeti_init(void) |
99 | { |
93 | { |
- | 94 | #ifdef CONFIG_SGCN_KBD |
|
- | 95 | indev_t *kbrdin; |
|
- | 96 | kbrdin = sgcnin_init(); |
|
- | 97 | if (kbrdin) |
|
- | 98 | srlnin_init(kbrdin); |
|
- | 99 | #endif |
|
- | 100 | #ifdef CONFIG_SGCN_PRN |
|
100 | sgcn_init(); |
101 | sgcnout_init(); |
- | 102 | #endif |
|
101 | } |
103 | } |
102 | 104 | ||
103 | /** |
105 | /** |
104 | * Initialize input/output. Auto-detects the type of machine |
106 | * Initialize input/output. Auto-detects the type of machine |
105 | * and calls the appropriate I/O init routine. |
107 | * and calls the appropriate I/O init routine. |
Line 122... | Line 124... | ||
122 | serengeti_init(); |
124 | serengeti_init(); |
123 | } |
125 | } |
124 | } |
126 | } |
125 | 127 | ||
126 | 128 | ||
127 | /** Kernel thread for polling keyboard. |
- | |
128 | * |
- | |
129 | * @param arg Ignored. |
- | |
130 | */ |
- | |
131 | void kkbdpoll(void *arg) |
- | |
132 | { |
- | |
133 | thread_detach(THREAD); |
- | |
134 | - | ||
135 | if (kbd_type != KBD_SGCN) |
- | |
136 | return; |
- | |
137 | - | ||
138 | while (1) { |
- | |
139 | #ifdef CONFIG_SGCN |
- | |
140 | if (kbd_type == KBD_SGCN) |
- | |
141 | sgcn_poll(); |
- | |
142 | #endif |
- | |
143 | thread_usleep(KEYBOARD_POLL_PAUSE); |
- | |
144 | } |
- | |
145 | } |
- | |
146 | - | ||
147 | /** Acquire console back for kernel |
129 | /** Acquire console back for kernel |
148 | * |
130 | * |
149 | */ |
131 | */ |
150 | void arch_grab_console(void) |
132 | void arch_grab_console(void) |
151 | { |
133 | { |