Rev 3646 | Rev 3714 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3646 | Rev 3655 | ||
|---|---|---|---|
| Line 61... | Line 61... | ||
| 61 | { |
61 | { |
| 62 | size_t offset; |
62 | size_t offset; |
| 63 | uintptr_t aligned_addr; |
63 | uintptr_t aligned_addr; |
| 64 | ofw_tree_property_t *prop; |
64 | ofw_tree_property_t *prop; |
| 65 | const char *name; |
65 | const char *name; |
| - | 66 | cir_t cir; |
|
| - | 67 | void *cir_arg; |
|
| 66 | 68 | ||
| 67 | name = ofw_tree_node_name(node); |
69 | name = ofw_tree_node_name(node); |
| 68 | 70 | ||
| 69 | /* |
71 | /* |
| 70 | * Determine keyboard serial controller type. |
72 | * Determine keyboard serial controller type. |
| Line 107... | Line 109... | ||
| 107 | ((ofw_fhc_reg_t *) prop->value), &pa)) { |
109 | ((ofw_fhc_reg_t *) prop->value), &pa)) { |
| 108 | printf("Failed to determine keyboard address.\n"); |
110 | printf("Failed to determine keyboard address.\n"); |
| 109 | return; |
111 | return; |
| 110 | } |
112 | } |
| 111 | if (!ofw_fhc_map_interrupt(node->parent, |
113 | if (!ofw_fhc_map_interrupt(node->parent, |
| 112 | ((ofw_fhc_reg_t *) prop->value), interrupts, &inr)) { |
114 | ((ofw_fhc_reg_t *) prop->value), interrupts, &inr, &cir, |
| - | 115 | &cir_arg)) { |
|
| 113 | printf("Failed to determine keyboard interrupt.\n"); |
116 | printf("Failed to determine keyboard interrupt.\n"); |
| 114 | return; |
117 | return; |
| 115 | } |
118 | } |
| 116 | break; |
119 | break; |
| 117 | 120 | ||
| Line 121... | Line 124... | ||
| 121 | ((ofw_ebus_reg_t *) prop->value), &pa)) { |
124 | ((ofw_ebus_reg_t *) prop->value), &pa)) { |
| 122 | printf("Failed to determine keyboard address.\n"); |
125 | printf("Failed to determine keyboard address.\n"); |
| 123 | return; |
126 | return; |
| 124 | } |
127 | } |
| 125 | if (!ofw_ebus_map_interrupt(node->parent, |
128 | if (!ofw_ebus_map_interrupt(node->parent, |
| 126 | ((ofw_ebus_reg_t *) prop->value), interrupts, &inr)) { |
129 | ((ofw_ebus_reg_t *) prop->value), interrupts, &inr, &cir, |
| - | 130 | &cir_arg)) { |
|
| 127 | printf("Failed to determine keyboard interrupt.\n"); |
131 | printf("Failed to determine keyboard interrupt.\n"); |
| 128 | return; |
132 | return; |
| 129 | }; |
133 | }; |
| 130 | break; |
134 | break; |
| 131 | 135 | ||
| Line 144... | Line 148... | ||
| 144 | uintptr_t vaddr = hw_map(aligned_addr, offset + size) + offset; |
148 | uintptr_t vaddr = hw_map(aligned_addr, offset + size) + offset; |
| 145 | 149 | ||
| 146 | switch (kbd_type) { |
150 | switch (kbd_type) { |
| 147 | #ifdef CONFIG_Z8530 |
151 | #ifdef CONFIG_Z8530 |
| 148 | case KBD_Z8530: |
152 | case KBD_Z8530: |
| 149 | z8530_init(devno, inr, vaddr); |
153 | z8530_init(devno, vaddr, inr, cir, cir_arg); |
| 150 | break; |
154 | break; |
| 151 | #endif |
155 | #endif |
| 152 | #ifdef CONFIG_NS16550 |
156 | #ifdef CONFIG_NS16550 |
| 153 | case KBD_NS16550: |
157 | case KBD_NS16550: |
| 154 | ns16550_init(devno, inr, (ioport_t)vaddr); |
158 | ns16550_init(devno, (ioport_t)vaddr, inr, cir, cir_arg); |
| 155 | break; |
159 | break; |
| 156 | #endif |
160 | #endif |
| 157 | default: |
161 | default: |
| 158 | printf("Kernel is not compiled with the necessary keyboard " |
162 | printf("Kernel is not compiled with the necessary keyboard " |
| 159 | "driver this machine requires.\n"); |
163 | "driver this machine requires.\n"); |