Changes in kernel/arch/mips32/src/mips32.c [2277e03:36df4109] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/src/mips32.c
r2277e03 r36df4109 34 34 35 35 #include <arch.h> 36 #include <arch/arch.h> 36 37 #include <typedefs.h> 37 38 #include <errno.h> … … 41 42 #include <memstr.h> 42 43 #include <userspace.h> 43 #include <console/console.h>44 44 #include <syscall/syscall.h> 45 45 #include <sysinfo/sysinfo.h> 46 46 #include <arch/debug.h> 47 47 #include <arch/debugger.h> 48 #include <arch/drivers/msim.h> 49 #include <genarch/fb/fb.h> 50 #include <genarch/drivers/dsrln/dsrlnin.h> 51 #include <genarch/drivers/dsrln/dsrlnout.h> 52 #include <genarch/srln/srln.h> 48 #include <arch/machine_func.h> 53 49 54 50 /* Size of the code jumping to the exception handler code … … 61 57 #define CACHE_EXC ((char *) 0x80000100) 62 58 59 static void mips32_pre_mm_init(void); 60 static void mips32_post_mm_init(void); 61 static void mips32_post_smp_init(void); 62 63 arch_ops_t mips32_ops = { 64 .pre_mm_init = mips32_pre_mm_init, 65 .post_mm_init = mips32_post_mm_init, 66 .post_smp_init = mips32_post_smp_init, 67 }; 68 69 arch_ops_t *arch_ops = &mips32_ops; 63 70 64 71 /* Why the linker moves the variable 64K away in assembler … … 71 78 size_t cpu_count = 0; 72 79 80 #if defined(MACHINE_lmalta) || defined(MACHINE_bmalta) 81 size_t sdram_size = 0; 82 #endif 83 73 84 /** Performs mips32-specific initialization before main_bsp() is called. */ 74 void arch_pre_main(void *entry __attribute__((unused)), bootinfo_t *bootinfo)85 void mips32_pre_main(void *entry __attribute__((unused)), bootinfo_t *bootinfo) 75 86 { 76 87 init.cnt = min3(bootinfo->cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); … … 88 99 cpu_count++; 89 100 } 90 } 91 92 void arch_pre_mm_init(void) 101 102 #if defined(MACHINE_lmalta) || defined(MACHINE_bmalta) 103 sdram_size = bootinfo->sdram_size; 104 #endif 105 106 /* Initialize machine_ops pointer. */ 107 machine_ops_init(); 108 } 109 110 void mips32_pre_mm_init(void) 93 111 { 94 112 /* It is not assumed by default */ … … 121 139 } 122 140 123 void arch_post_mm_init(void)141 void mips32_post_mm_init(void) 124 142 { 125 143 interrupt_init(); 126 127 #ifdef CONFIG_FB 128 /* GXemul framebuffer */ 129 fb_properties_t gxemul_prop = { 130 .addr = 0x12000000, 131 .offset = 0, 132 .x = 640, 133 .y = 480, 134 .scan = 1920, 135 .visual = VISUAL_RGB_8_8_8, 136 }; 137 138 outdev_t *fbdev = fb_init(&gxemul_prop); 139 if (fbdev) 140 stdout_wire(fbdev); 141 #endif 142 143 #ifdef CONFIG_MIPS_PRN 144 outdev_t *dsrlndev = dsrlnout_init((ioport8_t *) MSIM_KBD_ADDRESS); 145 if (dsrlndev) 146 stdout_wire(dsrlndev); 147 #endif 148 } 149 150 void arch_post_cpu_init(void) 151 { 152 } 153 154 void arch_pre_smp_init(void) 155 { 156 } 157 158 void arch_post_smp_init(void) 159 { 160 static const char *platform; 161 144 145 machine_init(); 146 machine_output_init(); 147 } 148 149 void mips32_post_smp_init(void) 150 { 162 151 /* Set platform name. */ 163 #ifdef MACHINE_msim 164 platform = "msim"; 165 #endif 166 #ifdef MACHINE_bgxemul 167 platform = "gxemul"; 168 #endif 169 #ifdef MACHINE_lgxemul 170 platform = "gxemul"; 171 #endif 172 sysinfo_set_item_data("platform", NULL, (void *) platform, 173 str_size(platform)); 174 175 #ifdef CONFIG_MIPS_KBD 176 /* 177 * Initialize the msim/GXemul keyboard port. Then initialize the serial line 178 * module and connect it to the msim/GXemul keyboard. Enable keyboard interrupts. 179 */ 180 dsrlnin_instance_t *dsrlnin_instance 181 = dsrlnin_init((dsrlnin_t *) MSIM_KBD_ADDRESS, MSIM_KBD_IRQ); 182 if (dsrlnin_instance) { 183 srln_instance_t *srln_instance = srln_init(); 184 if (srln_instance) { 185 indev_t *sink = stdin_wire(); 186 indev_t *srln = srln_wire(srln_instance, sink); 187 dsrlnin_wire(dsrlnin_instance, srln); 188 cp0_unmask_int(MSIM_KBD_IRQ); 189 } 190 } 191 192 /* 193 * This is the necessary evil until the userspace driver is entirely 194 * self-sufficient. 195 */ 196 sysinfo_set_item_val("kbd", NULL, true); 197 sysinfo_set_item_val("kbd.inr", NULL, MSIM_KBD_IRQ); 198 sysinfo_set_item_val("kbd.address.physical", NULL, 199 PA2KA(MSIM_KBD_ADDRESS)); 200 #endif 152 sysinfo_set_item_data("platform", NULL, 153 (void *) machine_get_platform_name(), 154 str_size(machine_get_platform_name())); 155 156 machine_input_init(); 201 157 } 202 158 … … 235 191 } 236 192 237 /** Set thread-local-storage pointer238 *239 * We have it currently in K1, it is240 * possible to have it separately in the future.241 */242 sysarg_t sys_tls_set(uintptr_t addr)243 {244 return EOK;245 }246 247 193 void arch_reboot(void) 248 194 {
Note:
See TracChangeset
for help on using the changeset viewer.