Changeset 68d8736 in mainline for kernel/arch/mips32/src/mach/malta/malta.c
- Timestamp:
- 2019-03-31T13:30:01Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f5dd4a1
- Parents:
- bbb99f82
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/src/mach/malta/malta.c
rbbb99f82 r68d8736 38 38 #include <console/chardev.h> 39 39 #include <arch/mm/page.h> 40 #include <genarch/drivers/i8259/i8259.h> 41 #include <genarch/drivers/ns16550/ns16550.h> 42 #include <genarch/srln/srln.h> 43 #include <arch/interrupt.h> 40 44 41 45 static void malta_init(void); … … 57 61 }; 58 62 63 #ifdef CONFIG_NS16550 64 static ns16550_instance_t *tty_instance; 65 #endif 66 #ifdef CONFIG_NS16550_OUT 67 static outdev_t *tty_out; 68 #endif 69 70 #ifdef CONFIG_NS16550 71 static void tty_clear_interrupt(void *arg, inr_t inr) 72 { 73 (void) pio_read_8((ioport8_t *) GT64120_PCI0_INTACK); 74 pic_eoi(); 75 } 76 #endif 77 59 78 void malta_init(void) 60 79 { 80 i8259_init((i8259_t *) PIC0_BASE, (i8259_t *) PIC1_BASE, 2, 0, 8); 81 82 #if (defined(CONFIG_NS16550) || defined(CONFIG_NS16550_OUT)) 83 #ifdef CONFIG_NS16550_OUT 84 outdev_t **tty_out_ptr = &tty_out; 85 #else 86 outdev_t **tty_out_ptr = NULL; 87 #endif 88 tty_instance = ns16550_init((ioport8_t *) TTY_BASE, 0, TTY_CPU_INT, 89 tty_clear_interrupt, NULL, tty_out_ptr); 90 #endif 61 91 } 62 92 … … 73 103 } 74 104 75 #define YAMON_SUBR_BASE PA2KA(0x1fc00500)76 #define YAMON_SUBR_PRINT_COUNT (YAMON_SUBR_BASE + 0x4)77 78 typedef void (**yamon_print_count_ptr_t)(uint32_t, const char *, uint32_t);79 80 yamon_print_count_ptr_t yamon_print_count =81 (yamon_print_count_ptr_t) YAMON_SUBR_PRINT_COUNT;82 83 static void yamon_putwchar(outdev_t *dev, const wchar_t wch)84 {85 86 const char ch = (char) wch;87 88 (*yamon_print_count)(0, &ch, 1);89 }90 91 static outdev_t yamon_outdev;92 static outdev_operations_t yamon_outdev_ops = {93 .write = yamon_putwchar,94 .redraw = NULL,95 .scroll_up = NULL,96 .scroll_down = NULL97 };98 99 105 void malta_output_init(void) 100 106 { 101 outdev_initialize("yamon", &yamon_outdev, &yamon_outdev_ops); 102 stdout_wire(&yamon_outdev); 107 #ifdef CONFIG_NS16550_OUT 108 if (tty_out) 109 stdout_wire(tty_out); 110 #endif 103 111 } 104 112 105 113 void malta_input_init(void) 106 114 { 107 (void) stdin_wire(); 115 #ifdef CONFIG_NS16550 116 if (tty_instance) { 117 srln_instance_t *srln_instance = srln_init(); 118 if (srln_instance) { 119 indev_t *sink = stdin_wire(); 120 indev_t *srln = srln_wire(srln_instance, sink); 121 ns16550_wire(tty_instance, srln); 122 pic_enable_irqs(1 << TTY_ISA_IRQ); 123 cp0_unmask_int(TTY_CPU_INT); 124 } 125 } 126 #endif 108 127 } 109 128
Note:
See TracChangeset
for help on using the changeset viewer.