Changeset 32e8cd1 in mainline for kernel/arch/sparc32/src/machine/leon3/leon3.c
- Timestamp:
- 2013-12-28T17:16:44Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c1023bcb
- Parents:
- f6f22cdb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc32/src/machine/leon3/leon3.c
rf6f22cdb r32e8cd1 38 38 #include <arch/asm.h> 39 39 #include <arch/machine_func.h> 40 41 40 #include <arch/machine/leon3/leon3.h> 42 43 41 #include <genarch/drivers/grlib/uart.h> 44 42 #include <genarch/drivers/grlib/irqmp.h> 45 43 #include <genarch/srln/srln.h> 46 47 44 #include <func.h> 48 45 #include <config.h> … … 70 67 static const char *leon3_get_platform_name(void); 71 68 72 struct leon3_machine_t 73 { 69 struct leon3_machine_t { 74 70 bootinfo_t *bootinfo; 75 71 outdev_t *scons_dev; 76 72 grlib_irqmp_t irqmp; 77 //grlib_timer_t timer;78 73 }; 79 74 80 75 struct sparc_machine_ops leon3_machine_ops = { 81 leon3_init,82 leon3_cpu_halt,83 leon3_get_memory_extents,84 leon3_timer_start,85 leon3_irq_exception,86 leon3_output_init,87 leon3_input_init,88 leon3_get_irq_count,89 leon3_get_platform_name76 .machine_init = leon3_init, 77 .machine_cpu_halt = leon3_cpu_halt, 78 .machine_get_memory_extents = leon3_get_memory_extents, 79 .machine_timer_irq_start = leon3_timer_start, 80 .machine_irq_exception = leon3_irq_exception, 81 .machine_output_init = leon3_output_init, 82 .machine_input_init = leon3_input_init, 83 .machine_get_irq_count = leon3_get_irq_count, 84 .machine_get_platform_name = leon3_get_platform_name 90 85 }; 91 86 … … 95 90 { 96 91 machine.bootinfo = bootinfo; 97 98 92 grlib_irqmp_init(&machine.irqmp, bootinfo); 99 93 } … … 101 95 static void leon3_cpu_halt(void) 102 96 { 103 for (;;); 97 // FIXME TODO 98 while (1); 104 99 } 105 100 … … 107 102 { 108 103 *start = LEON3_SDRAM_START; 109 *size = 64 * 1024 * 1024;//machine.bootinfo->memsize; 104 *size = 64 * 1024 * 1024; 105 // FIXME: *size = machine.bootinfo->memsize; 110 106 } 111 107 112 108 static void leon3_timer_start(void) 113 109 { 114 //machine.timer = grlib_timer_init(machine.bootinfo->timer_base, machine.bootinfo->timer_irq); 110 // FIXME: 111 // machine.timer = 112 // grlib_timer_init(machine.bootinfo->timer_base, 113 // machine.bootinfo->timer_irq); 115 114 } 116 115 117 static void leon3_irq_exception(unsigned int exc _no, istate_t *istate)116 static void leon3_irq_exception(unsigned int exc, istate_t *istate) 118 117 { 119 118 int irqnum = grlib_irqmp_inum_get(&machine.irqmp); 120 119 121 120 grlib_irqmp_clear(&machine.irqmp, irqnum); 122 121 123 122 irq_t *irq = irq_dispatch_and_lock(irqnum); 124 123 if (irq) { … … 131 130 static void leon3_output_init(void) 132 131 { 133 printf("leon3_output_init\n"); 134 printf("machine.bootinfo=%p, machine.bootinfo->uart_base=0x%08x\n", machine.bootinfo, machine.bootinfo->uart_base); 135 136 machine.scons_dev = grlib_uart_init(machine.bootinfo->uart_base, machine.bootinfo->uart_irq); 137 132 machine.scons_dev = 133 grlib_uart_init(machine.bootinfo->uart_base, 134 machine.bootinfo->uart_irq); 135 138 136 if (machine.scons_dev) 139 137 stdout_wire(machine.scons_dev); … … 148 146 /* Create input device. */ 149 147 scons_inst = (void *)machine.scons_dev->data; 150 148 151 149 srln_instance_t *srln_instance = srln_init(); 152 150 if (srln_instance) { … … 154 152 indev_t *srln = srln_wire(srln_instance, sink); 155 153 grlib_uart_input_wire(scons_inst, srln); 156 154 157 155 /* Enable interrupts from UART */ 158 grlib_irqmp_unmask(&machine.irqmp, machine.bootinfo->uart_irq); 156 grlib_irqmp_unmask(&machine.irqmp, 157 machine.bootinfo->uart_irq); 159 158 } 160 159 } … … 171 170 return "LEON3"; 172 171 } 173 174
Note:
See TracChangeset
for help on using the changeset viewer.