Rev 4377 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4377 | Rev 4692 | ||
---|---|---|---|
Line 34... | Line 34... | ||
34 | 34 | ||
35 | #include <config.h> |
35 | #include <config.h> |
36 | #include <arch.h> |
36 | #include <arch.h> |
37 | #include <arch/boot/boot.h> |
37 | #include <arch/boot/boot.h> |
38 | #include <genarch/drivers/via-cuda/cuda.h> |
38 | #include <genarch/drivers/via-cuda/cuda.h> |
- | 39 | #include <genarch/kbrd/kbrd.h> |
|
39 | #include <arch/interrupt.h> |
40 | #include <arch/interrupt.h> |
40 | #include <genarch/fb/fb.h> |
41 | #include <genarch/fb/fb.h> |
41 | #include <genarch/fb/visuals.h> |
42 | #include <genarch/fb/visuals.h> |
42 | #include <userspace.h> |
43 | #include <userspace.h> |
43 | #include <proc/uarg.h> |
44 | #include <proc/uarg.h> |
Line 89... | Line 90... | ||
89 | switch (bootinfo.screen.bpp) { |
90 | switch (bootinfo.screen.bpp) { |
90 | case 8: |
91 | case 8: |
91 | visual = VISUAL_INDIRECT_8; |
92 | visual = VISUAL_INDIRECT_8; |
92 | break; |
93 | break; |
93 | case 16: |
94 | case 16: |
94 | visual = VISUAL_RGB_5_5_5; |
95 | visual = VISUAL_RGB_5_5_5_BE; |
95 | break; |
96 | break; |
96 | case 24: |
97 | case 24: |
97 | visual = VISUAL_RGB_8_8_8; |
98 | visual = VISUAL_BGR_8_8_8; |
98 | break; |
99 | break; |
99 | case 32: |
100 | case 32: |
100 | visual = VISUAL_RGB_0_8_8_8; |
101 | visual = VISUAL_RGB_0_8_8_8; |
101 | break; |
102 | break; |
102 | default: |
103 | default: |
Line 115... | Line 116... | ||
115 | #endif |
116 | #endif |
116 | 117 | ||
117 | /* Initialize IRQ routing */ |
118 | /* Initialize IRQ routing */ |
118 | irq_init(IRQ_COUNT, IRQ_COUNT); |
119 | irq_init(IRQ_COUNT, IRQ_COUNT); |
119 | 120 | ||
120 | if (bootinfo.macio.addr) { |
- | |
121 | /* Initialize PIC */ |
- | |
122 | cir_t cir; |
- | |
123 | void *cir_arg; |
- | |
124 | pic_init(bootinfo.macio.addr, PAGE_SIZE, &cir, &cir_arg); |
- | |
125 | - | ||
126 | #ifdef CONFIG_VIA_CUDA |
- | |
127 | uintptr_t pa = bootinfo.macio.addr + 0x16000; |
- | |
128 | uintptr_t aligned_addr = ALIGN_DOWN(pa, PAGE_SIZE); |
- | |
129 | size_t offset = pa - aligned_addr; |
- | |
130 | size_t size = 2 * PAGE_SIZE; |
- | |
131 | - | ||
132 | cuda_t *cuda = (cuda_t *) |
- | |
133 | (hw_map(aligned_addr, offset + size) + offset); |
- | |
134 | - | ||
135 | /* Initialize I/O controller */ |
- | |
136 | cuda_instance_t *cuda_instance = |
- | |
137 | cuda_init(cuda, IRQ_CUDA, cir, cir_arg); |
- | |
138 | if (cuda_instance) { |
- | |
139 | indev_t *sink = stdin_wire(); |
- | |
140 | cuda_wire(cuda_instance, sink); |
- | |
141 | } |
- | |
142 | #endif |
- | |
143 | } |
- | |
144 | - | ||
145 | /* Merge all zones to 1 big zone */ |
121 | /* Merge all zones to 1 big zone */ |
146 | zone_merge_all(); |
122 | zone_merge_all(); |
147 | } |
123 | } |
148 | } |
124 | } |
149 | 125 | ||
Line 155... | Line 131... | ||
155 | { |
131 | { |
156 | } |
132 | } |
157 | 133 | ||
158 | void arch_post_smp_init(void) |
134 | void arch_post_smp_init(void) |
159 | { |
135 | { |
- | 136 | if (bootinfo.macio.addr) { |
|
- | 137 | /* Initialize PIC */ |
|
- | 138 | cir_t cir; |
|
- | 139 | void *cir_arg; |
|
- | 140 | pic_init(bootinfo.macio.addr, PAGE_SIZE, &cir, &cir_arg); |
|
- | 141 | ||
- | 142 | #ifdef CONFIG_MAC_KBD |
|
- | 143 | uintptr_t pa = bootinfo.macio.addr + 0x16000; |
|
- | 144 | uintptr_t aligned_addr = ALIGN_DOWN(pa, PAGE_SIZE); |
|
- | 145 | size_t offset = pa - aligned_addr; |
|
- | 146 | size_t size = 2 * PAGE_SIZE; |
|
- | 147 | ||
- | 148 | cuda_t *cuda = (cuda_t *) |
|
- | 149 | (hw_map(aligned_addr, offset + size) + offset); |
|
- | 150 | ||
- | 151 | /* Initialize I/O controller */ |
|
- | 152 | cuda_instance_t *cuda_instance = |
|
- | 153 | cuda_init(cuda, IRQ_CUDA, cir, cir_arg); |
|
- | 154 | if (cuda_instance) { |
|
- | 155 | kbrd_instance_t *kbrd_instance = kbrd_init(); |
|
- | 156 | if (kbrd_instance) { |
|
- | 157 | indev_t *sink = stdin_wire(); |
|
- | 158 | indev_t *kbrd = kbrd_wire(kbrd_instance, sink); |
|
- | 159 | cuda_wire(cuda_instance, kbrd); |
|
- | 160 | pic_enable_interrupt(IRQ_CUDA); |
|
- | 161 | } |
|
- | 162 | } |
|
- | 163 | #endif |
|
- | 164 | } |
|
160 | } |
165 | } |
161 | 166 | ||
162 | void calibrate_delay_loop(void) |
167 | void calibrate_delay_loop(void) |
163 | { |
168 | { |
164 | } |
169 | } |