Changeset a73ebf0 in mainline
- Timestamp:
- 2013-10-15T16:34:04Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4d2dba7
- Parents:
- 1f12fab
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/sparc32/include/ambapp.h
r1f12fab ra73ebf0 127 127 } __attribute__((packed)) ambapp_entry_t; 128 128 129 typedef struct { 130 unsigned int ram_read_ws: 1; 131 unsigned int ram_write_ws: 1; 132 unsigned int ram_width: 2; 133 unsigned int rmw: 1; 134 unsigned int rbrdy: 1; 135 unsigned int : 1; 136 unsigned int bank_size: 4; 137 unsigned int si: 1; 138 unsigned int se: 1; 139 unsigned int : 1; 140 unsigned int ms: 1; 141 unsigned int : 1; 142 unsigned int d64: 1; 143 unsigned int sdram_cmd: 2; 144 unsigned int sdram_colsz: 2; 145 unsigned int sdram_banksz: 3; 146 unsigned int tcas: 1; 147 unsigned int trfc: 3; 148 unsigned int trp: 1; 149 unsigned int sdrf: 1; 150 } __attribute__((packed)) mctrl_mcfg2_t; 151 129 152 amba_device_t amba_devices[AMBAPP_MAX_DEVICES]; 130 153 int amba_devices_found; 154 bool amba_fake; 131 155 uintptr_t amba_uart_base; 132 156 133 157 void ambapp_scan(void); 158 bool ambapp_fake(void); 134 159 void ambapp_qemu_fake_scan(void); 135 160 void ambapp_print_devices(void); -
boot/arch/sparc32/src/ambapp.c
r1f12fab ra73ebf0 54 54 void ambapp_scan() 55 55 { 56 amba_fake = false; 57 56 58 /* Scan for AHB masters & slaves */ 57 59 ambapp_scan_area(AMBAPP_AHBMASTER_AREA, 64); … … 64 66 65 67 /* If we found nothing, fake device entries */ 66 ambapp_qemu_fake_scan(); 68 if (amba_devices_found == 0) 69 ambapp_qemu_fake_scan(); 67 70 } 68 71 … … 80 83 amba_device_t *device = &amba_devices[amba_devices_found]; 81 84 device->vendor_id = (amba_vendor_id_t)entry->vendor_id; 82 85 device->device_id = (amba_device_id_t)entry->device_id; 83 86 device->version = entry->version; 84 87 device->irq = entry->irq; … … 121 124 amba_devices[2].bars[0].size = 0x100; 122 125 126 amba_fake = true; 123 127 amba_devices_found = 3; 128 } 129 130 bool ambapp_fake() 131 { 132 return amba_fake; 124 133 } 125 134 … … 130 139 for (int i = 0; i < amba_devices_found; i++) { 131 140 amba_device_t *dev = &amba_devices[i]; 132 printf("<%1x:%03x> at 0x%08x, irq %d\n", dev->vendor_id, dev->device_id, dev->bars[0].start, dev->irq); 141 printf("<%1x:%03x> at 0x%08x ", dev->vendor_id, dev->device_id, dev->bars[0].start); 142 if (dev->irq == -1) 143 printf("\n"); 144 else 145 printf("irq %d\n", dev->irq); 133 146 } 134 147 } -
boot/arch/sparc32/src/main.c
r1f12fab ra73ebf0 62 62 amba_device_t *uart = ambapp_lookup_first(GAISLER, GAISLER_APBUART); 63 63 amba_uart_base = uart->bars[0].start; 64 bootinfo.uart_base = amba_uart_base; 65 bootinfo.uart_irq = uart->irq; 64 66 67 /* Look up for IRQMP */ 68 amba_device_t *irqmp = ambapp_lookup_first(GAISLER, GAISLER_IRQMP); 69 bootinfo.intc_base = irqmp->bars[0].start; 70 71 /* Look up for timer */ 72 amba_device_t *timer = ambapp_lookup_first(GAISLER, GAISLER_GPTIMER); 73 bootinfo.timer_base = timer->bars[0].start; 74 bootinfo.timer_irq = timer->irq; 75 76 /* Lookp up for memory controller and obtain memory size */ 77 if (ambapp_fake()) { 78 bootinfo.memsize = 64 * 1024 * 1024; // 64MB 79 } else { 80 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); 82 bootinfo.memsize = (1 << (13 + mcfg2->bank_size)); 83 } 84 65 85 /* Standard output is now initialized */ 66 86 version_print(); … … 73 93 74 94 ambapp_print_devices(); 95 96 printf("Memory size: %dMB\n", bootinfo.memsize >> 20); 75 97 76 98 mmu_init(); -
kernel/arch/sparc32/include/arch/arch.h
r1f12fab ra73ebf0 63 63 size_t cnt; 64 64 utask_t tasks[TASKMAP_MAX_RECORDS]; 65 /* Fields below are LEON-specific */ 66 uintptr_t uart_base; 67 uintptr_t intc_base; 68 uintptr_t timer_base; 69 int uart_irq; 70 int timer_irq; 71 uint32_t memsize; 65 72 } bootinfo_t; 66 73
Note:
See TracChangeset
for help on using the changeset viewer.