Changeset f6f22cdb in mainline for boot/arch/sparc32/src/main.c
- Timestamp:
- 2013-12-27T18:45:56Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 32e8cd1
- Parents:
- e47ed05
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/sparc32/src/main.c
re47ed05 rf6f22cdb 52 52 53 53 #define TOP2ADDR(top) (((void *) PA2KA(BOOT_OFFSET)) + (top)) 54 54 55 static bootinfo_t bootinfo; 55 56 … … 58 59 /* Initialize AMBA P&P device list */ 59 60 ambapp_scan(); 60 61 /* Look upfor UART */61 62 /* Look for UART */ 62 63 amba_device_t *uart = ambapp_lookup_first(GAISLER, GAISLER_APBUART); 63 64 amba_uart_base = uart->bars[0].start; 64 65 bootinfo.uart_base = amba_uart_base; 65 66 bootinfo.uart_irq = uart->irq; 66 67 /* Look upfor IRQMP */67 68 /* Look for IRQMP */ 68 69 amba_device_t *irqmp = ambapp_lookup_first(GAISLER, GAISLER_IRQMP); 69 70 bootinfo.intc_base = irqmp->bars[0].start; 70 71 /* Look upfor timer */71 72 /* Look for timer */ 72 73 amba_device_t *timer = ambapp_lookup_first(GAISLER, GAISLER_GPTIMER); 73 74 bootinfo.timer_base = timer->bars[0].start; 74 75 bootinfo.timer_irq = timer->irq; 75 76 76 /* Lookp up for memory controller and obtain memory size */ 77 if (ambapp_fake()) { 78 bootinfo.memsize = 64 * 1024 * 1024; // 64MB 79 } else { 77 /* Look for memory controller and obtain memory size */ 78 if (!ambapp_fake()) { 80 79 amba_device_t *mctrl = ambapp_lookup_first(ESA, ESA_MCTRL); 81 volatile mctrl_mcfg2_t *mcfg2 = (volatile mctrl_mcfg2_t *)(mctrl->bars[0].start + 0x4); 80 volatile mctrl_mcfg2_t *mcfg2 = (volatile mctrl_mcfg2_t *) 81 (mctrl->bars[0].start + 0x4); 82 82 bootinfo.memsize = (1 << (13 + mcfg2->bank_size)); 83 } 83 } else 84 bootinfo.memsize = 64 * 1024 * 1024; 84 85 85 86 /* Standard output is now initialized */ 86 87 version_print(); 87 88 88 89 for (size_t i = 0; i < COMPONENTS; i++) { 89 90 printf(" %p|%p: %s image (%u/%u bytes)\n", components[i].start, … … 91 92 components[i].size); 92 93 } 93 94 94 95 ambapp_print_devices(); 95 96 printf("Memory size: % dMB\n", bootinfo.memsize >> 20);97 96 97 printf("Memory size: %u MB\n", bootinfo.memsize >> 20); 98 98 99 mmu_init(); 99 100 100 101 void *dest[COMPONENTS]; 101 102 size_t top = 0; … … 116 117 117 118 dest[i] = TOP2ADDR(top); 118 119 119 120 top += components[i].inflated; 120 121 cnt++; … … 128 129 printf("\n%s: Image too large to fit (%p >= %p), halting.\n", 129 130 components[i].name, tail, dest[i - 1]); 130 for (;;);131 halt(); 131 132 } 132 133 … … 137 138 if (err != EOK) { 138 139 printf("\n%s: Inflating error %d\n", components[i - 1].name, err); 139 for (;;);140 halt(); 140 141 } 141 142 } 142 143 143 144 printf("Booting the kernel ... \n"); 144 145 jump_to_kernel((void *) PA2KA(BOOT_OFFSET), &bootinfo);
Note:
See TracChangeset
for help on using the changeset viewer.