Changeset 200 for soft/giet_vm/boot
- Timestamp:
- Aug 12, 2012, 1:35:34 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/boot/boot_init.c
r199 r200 1059 1059 boot_puts(" ******\n"); 1060 1060 #endif 1061 // We must set the PTPR depending on the vspace, because the addresses1062 // of mwmmr channels, barriers and locks are defined in virtual space.1063 boot_set_mmu_ptpr( (unsigned int)boot_ptabs_paddr[vspace_id] >> 13 );1064 1061 1065 1062 unsigned int ptab_found = 0; … … 1074 1071 case VOBJ_TYPE_MWMR: // storage capacity is (vobj.length/4 - 5) words 1075 1072 { 1076 mwmr_channel_t* mwmr = (mwmr_channel_t*)(vobj[vobj_id]. vaddr);1073 mwmr_channel_t* mwmr = (mwmr_channel_t*)(vobj[vobj_id].paddr); 1077 1074 mwmr->ptw = 0; 1078 1075 mwmr->ptr = 0; … … 1116 1113 case VOBJ_TYPE_BARRIER: // init is the number of participants 1117 1114 { 1118 giet_barrier_t* barrier = (giet_barrier_t*)(vobj[vobj_id]. vaddr);1115 giet_barrier_t* barrier = (giet_barrier_t*)(vobj[vobj_id].paddr); 1119 1116 barrier->count = 0; 1120 1117 barrier->init = vobj[vobj_id].init; … … 1130 1127 case VOBJ_TYPE_LOCK: // init is "not taken" 1131 1128 { 1132 unsigned int* lock = (unsigned int*)(vobj[vobj_id]. vaddr);1129 unsigned int* lock = (unsigned int*)(vobj[vobj_id].paddr); 1133 1130 *lock = 0; 1134 1131 #if BOOT_DEBUG_VOBJS … … 1181 1178 } // end loop on vspaces 1182 1179 } // end boot_vobjs_init() 1180 1181 void 1182 mwmr_hw_init( void *coproc, enum mwmrPortDirection way, 1183 unsigned int no, const mwmr_channel_t *pmwmr) 1184 { 1185 volatile unsigned int *cbase = (unsigned int*) coproc; 1186 1187 1188 cbase[MWMR_CONFIG_FIFO_WAY] = way ; 1189 cbase[MWMR_CONFIG_FIFO_NO] = no ; 1190 cbase[MWMR_CONFIG_STATUS_ADDR] = (unsigned int)pmwmr ; 1191 cbase[MWMR_CONFIG_WIDTH] = pmwmr->width ; 1192 cbase[MWMR_CONFIG_DEPTH] = pmwmr->depth; 1193 cbase[MWMR_CONFIG_BUFFER_ADDR] = (unsigned int)&pmwmr->data; 1194 cbase[MWMR_CONFIG_RUNNING] = 1 ; 1195 } 1196 1183 1197 1184 1198 //////////////////////////////////////////////////////////////////////////////// … … 1194 1208 mapping_periph_t* periph = boot_get_periph_base( header ); 1195 1209 mapping_pseg_t* pseg = boot_get_pseg_base( header ); 1210 mapping_vobj_t* vobj = boot_get_vobj_base( header ); 1211 mapping_vspace_t* vspace = boot_get_vspace_base( header ); 1212 mapping_coproc_t* coproc = boot_get_coproc_base( header ); 1213 mapping_cp_port_t* cp_port = boot_get_cp_port_base( header ); 1196 1214 1197 1215 unsigned int cluster_id; 1198 1216 unsigned int periph_id; 1199 1217 unsigned int coproc_id; 1218 unsigned int cp_port_id; 1200 1219 unsigned int channel_id; 1201 1220 … … 1292 1311 coproc_id++ ) 1293 1312 { 1294 // TODO 1313 unsigned no_fifo_to = 0; //FIXME: should it be the map.xml who define the order? 1314 unsigned no_fifo_from = 0; 1315 unsigned int cpseg = pseg[coproc[coproc_id].psegid].base; 1316 1317 #if BOOT_DEBUG_PERI 1318 boot_puts("[BOOT] mwmr coproc initialisation of "); 1319 boot_putw((unsigned int) coproc[coproc_id].name); 1320 boot_puts(", nb ports"); 1321 boot_putw((unsigned int)coproc[coproc_id].ports); 1322 boot_puts("\n"); 1323 #endif 1324 1325 for ( cp_port_id = coproc[coproc_id].port_offset ; 1326 cp_port_id < coproc[coproc_id].port_offset + coproc[coproc_id].ports ; 1327 cp_port_id++ ) 1328 { 1329 //FIXME: should the same for all ports: put it in the coproc 1330 unsigned int vspace_id = cp_port[cp_port_id].vspaceid; 1331 unsigned int vobj_id = cp_port[cp_port_id].vobjlocid + vspace[vspace_id].vobj_offset; 1332 1333 mwmr_channel_t *pmwmr = (mwmr_channel_t*)(vobj[vobj_id].paddr); 1334 1335 if( cp_port[cp_port_id].direction == PORT_TO_COPROC) 1336 { 1337 1338 #if BOOT_DEBUG_PERI 1339 boot_puts(" port direction: PORT_TO_COPROC"); 1340 #endif 1341 mwmr_hw_init((void*)cpseg, PORT_TO_COPROC, no_fifo_to, pmwmr ); 1342 no_fifo_to++; 1343 } 1344 else 1345 { 1346 #if BOOT_DEBUG_PERI 1347 boot_puts(" port direction: PORT_FROM_COPROC"); 1348 #endif 1349 mwmr_hw_init((void*)cpseg, PORT_FROM_COPROC, no_fifo_from, pmwmr ); 1350 no_fifo_from++; 1351 } 1352 #if BOOT_DEBUG_PERI 1353 boot_puts(", with mwmr: "); 1354 boot_puts(vobj[vobj_id].name); 1355 boot_puts(" of vspace: "); 1356 boot_puts(vspace[vspace_id].name); 1357 #endif 1358 } 1295 1359 } // end for coprocs 1296 1360 … … 1680 1744 boot_puts("\n"); 1681 1745 1746 // page table building 1747 boot_pt_init(); 1748 1749 boot_puts("\n[BOOT] Page Tables initialisation completed at cycle "); 1750 boot_putw( boot_proctime() ); 1751 boot_puts("\n"); 1752 1753 // vobjs initialisation 1754 boot_vobjs_init(); 1755 1756 boot_puts("\n[BOOT] Vobjs initialisation completed at cycle : "); 1757 boot_putw( boot_proctime() ); 1758 boot_puts("\n"); 1759 1682 1760 // peripherals initialisation 1683 1761 boot_peripherals_init(); … … 1687 1765 boot_puts("\n"); 1688 1766 1689 // page table building1690 boot_pt_init();1691 1692 boot_puts("\n[BOOT] Page Tables initialisation completed at cycle ");1693 boot_putw( boot_proctime() );1694 boot_puts("\n");1695 1696 1767 // mmu activation 1697 1768 boot_set_mmu_ptpr( (unsigned int)boot_ptabs_paddr[0] >> 13 ); … … 1699 1770 1700 1771 boot_puts("\n[BOOT] MMU activation completed at cycle "); 1701 boot_putw( boot_proctime() );1702 boot_puts("\n");1703 1704 // vobjs initialisation1705 boot_vobjs_init();1706 1707 boot_puts("\n[BOOT] Vobjs initialisation completed at cycle : ");1708 1772 boot_putw( boot_proctime() ); 1709 1773 boot_puts("\n");
Note: See TracChangeset
for help on using the changeset viewer.