Rev 4114 | Rev 4148 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4114 | Rev 4122 | ||
---|---|---|---|
Line 66... | Line 66... | ||
66 | #include <print.h> |
66 | #include <print.h> |
67 | #include <sysinfo/sysinfo.h> |
67 | #include <sysinfo/sysinfo.h> |
68 | #include <string.h> |
68 | #include <string.h> |
69 | 69 | ||
70 | /* NS16550 as a COM 1 */ |
70 | /* NS16550 as a COM 1 */ |
71 | #define NS16550_IRQ (4 + LEGACY_INTERRUPT_BASE) |
71 | #define NS16550_IRQ (4 + LEGACY_INTERRUPT_BASE) |
72 | 72 | ||
73 | bootinfo_t *bootinfo; |
73 | bootinfo_t *bootinfo; |
74 | 74 | ||
75 | static uint64_t iosapic_base = 0xfec00000; |
75 | static uint64_t iosapic_base = 0xfec00000; |
76 | 76 | ||
Line 155... | Line 155... | ||
155 | if (in) |
155 | if (in) |
156 | srln_init(in); |
156 | srln_init(in); |
157 | skiout_init(); |
157 | skiout_init(); |
158 | #endif |
158 | #endif |
159 | 159 | ||
160 | #ifdef I460GX |
- | |
161 | #ifdef CONFIG_EGA |
160 | #ifdef CONFIG_EGA |
162 | ega_init(EGA_BASE, EGA_VIDEORAM); |
161 | ega_init(EGA_BASE, EGA_VIDEORAM); |
163 | #endif |
162 | #endif |
164 | 163 | ||
165 | devno_t devno = device_assign_devno(); |
- | |
166 | inr_t inr; |
- | |
167 | - | ||
168 | #ifdef CONFIG_NS16550 |
164 | #ifdef CONFIG_NS16550 |
- | 165 | devno_t devno_ns16550 = device_assign_devno(); |
|
169 | inr = NS16550_IRQ; |
166 | indev_t *kbrdin_ns16550 |
170 | - | ||
171 | indev_t *kbrdin = ns16550_init((ns16550_t *) NS16550_BASE, devno, inr, NULL, NULL); |
167 | = ns16550_init((ns16550_t *) NS16550_BASE, devno_ns16550, NS16550_IRQ, NULL, NULL); |
172 | if (kbrdin) |
168 | if (kbrdin_ns16550) |
173 | srln_init(kbrdin); |
169 | srln_init(kbrdin_ns16550); |
174 | 170 | ||
- | 171 | sysinfo_set_item_val("kbd", NULL, true); |
|
- | 172 | sysinfo_set_item_val("kbd.devno", NULL, devno_ns16550); |
|
- | 173 | sysinfo_set_item_val("kbd.inr", NULL, NS16550_IRQ); |
|
175 | sysinfo_set_item_val("kbd.type", NULL, KBD_NS16550); |
174 | sysinfo_set_item_val("kbd.type", NULL, KBD_NS16550); |
176 | sysinfo_set_item_val("kbd.address.physical", NULL, |
175 | sysinfo_set_item_val("kbd.address.physical", NULL, |
177 | (uintptr_t) NS16550_BASE); |
176 | (uintptr_t) NS16550_BASE); |
178 | sysinfo_set_item_val("kbd.address.kernel", NULL, |
177 | sysinfo_set_item_val("kbd.address.kernel", NULL, |
179 | (uintptr_t) NS16550_BASE); |
178 | (uintptr_t) NS16550_BASE); |
180 | #else |
179 | #endif |
181 | inr = IRQ_KBD; |
- | |
182 | /* |
180 | |
183 | * Initialize the i8042 controller. Then initialize the keyboard |
181 | #ifdef CONFIG_I8042 |
184 | * module and connect it to i8042. Enable keyboard interrupts. |
182 | devno_t devno_i8042 = device_assign_devno(); |
185 | */ |
- | |
186 | indev_t *kbrdin = i8042_init((i8042_t *) I8042_BASE, devno, irq); |
183 | indev_t *kbrdin_i8042 = i8042_init((i8042_t *) I8042_BASE, devno_i8042, IRQ_KBD); |
187 | if (kbrdin) { |
184 | if (kbrdin_i8042) |
188 | kbrd_init(kbrdin); |
185 | kbrd_init(kbrdin_i8042); |
189 | trap_virtual_enable_irqs(1 << inr); |
- | |
190 | } |
- | |
191 | 186 | ||
- | 187 | sysinfo_set_item_val("kbd", NULL, true); |
|
- | 188 | sysinfo_set_item_val("kbd.devno", NULL, devno_i8042); |
|
- | 189 | sysinfo_set_item_val("kbd.inr", NULL, IRQ_KBD); |
|
192 | sysinfo_set_item_val("kbd.type", NULL, KBD_LEGACY); |
190 | sysinfo_set_item_val("kbd.type", NULL, KBD_LEGACY); |
193 | sysinfo_set_item_val("kbd.address.physical", NULL, |
191 | sysinfo_set_item_val("kbd.address.physical", NULL, |
194 | (uintptr_t) I8042_BASE); |
192 | (uintptr_t) I8042_BASE); |
195 | sysinfo_set_item_val("kbd.address.kernel", NULL, |
193 | sysinfo_set_item_val("kbd.address.kernel", NULL, |
196 | (uintptr_t) I8042_BASE); |
194 | (uintptr_t) I8042_BASE); |
197 | #endif |
195 | #endif |
198 | sysinfo_set_item_val("kbd", NULL, true); |
- | |
199 | sysinfo_set_item_val("kbd.devno", NULL, devno); |
- | |
200 | sysinfo_set_item_val("kbd.inr", NULL, inr); |
- | |
201 | #endif |
- | |
202 | 196 | ||
203 | sysinfo_set_item_val("ia64_iospace", NULL, true); |
197 | sysinfo_set_item_val("ia64_iospace", NULL, true); |
204 | sysinfo_set_item_val("ia64_iospace.address", NULL, true); |
198 | sysinfo_set_item_val("ia64_iospace.address", NULL, true); |
205 | sysinfo_set_item_val("ia64_iospace.address.virtual", NULL, IO_OFFSET); |
199 | sysinfo_set_item_val("ia64_iospace.address.virtual", NULL, IO_OFFSET); |
206 | } |
200 | } |