Changeset 218 for soft/giet_vm/boot/boot_init.c
- Timestamp:
- Sep 19, 2012, 10:52:43 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/boot/boot_init.c
r215 r218 912 912 boot_exit(); 913 913 } 914 if ( periph[periph_id].channels !=NB_TTYS )914 if ( periph[periph_id].channels > NB_TTYS ) 915 915 { 916 916 boot_puts("\n[BOOT ERROR] Wrong NB_TTYS in cluster "); … … 1296 1296 unsigned int* pseg_base = (unsigned int*)pseg[pseg_id].base; 1297 1297 1298 //////// vci_block_device component 1299 if ( type == PERIPH_TYPE_IOC ) 1298 #if BOOT_DEBUG_PERI 1299 boot_puts("- peripheral type : "); 1300 boot_putd( type ); 1301 boot_puts(" / address = "); 1302 boot_putx( (unsigned int)pseg_base ); 1303 boot_puts(" / channels = "); 1304 boot_putd( channels ); 1305 boot_puts("\n"); 1306 #endif 1307 1308 switch ( type ) 1300 1309 { 1301 1302 // activate interrupts 1303 pseg_base[BLOCK_DEVICE_IRQ_ENABLE] = 1; 1304 1310 case PERIPH_TYPE_IOC: // vci_block_device component 1311 pseg_base[BLOCK_DEVICE_IRQ_ENABLE] = 1; 1305 1312 #if BOOT_DEBUG_PERI 1306 boot_puts("- IOC initialised : "); 1307 boot_putd( channels ); 1308 boot_puts(" channels\n"); 1309 #endif 1310 } 1311 1312 //////// vci_multi_dma component 1313 else if ( type == PERIPH_TYPE_DMA ) 1314 { 1315 for ( channel_id = 0 ; channel_id < channels ; channel_id++ ) 1316 { 1317 // activate interrupts 1318 pseg_base[DMA_IRQ_DISABLE + channel_id*DMA_SPAN] = 0; 1319 } 1320 1313 boot_puts("- IOC initialised\n"); 1314 #endif 1315 break; 1316 case PERIPH_TYPE_DMA: // vci_multi_dma component 1317 for ( channel_id = 0 ; channel_id < channels ; channel_id++ ) 1318 { 1319 pseg_base[DMA_IRQ_DISABLE + channel_id*DMA_SPAN] = 0; 1320 } 1321 1321 #if BOOT_DEBUG_PERI 1322 boot_puts("- DMA initialised : "); 1323 boot_putd( channels ); 1324 boot_puts(" channels\n"); 1325 #endif 1326 } 1327 1328 //////// vci_multi_nic component 1329 else if ( type == PERIPH_TYPE_NIC ) 1330 { 1331 for ( channel_id = 0 ; channel_id < channels ; channel_id++ ) 1332 { 1333 // TODO 1334 } 1335 1322 boot_puts("- DMA initialised\n"); 1323 #endif 1324 break; 1325 case PERIPH_TYPE_NIC: // vci_multi_nic component 1326 for ( channel_id = 0 ; channel_id < channels ; channel_id++ ) 1327 { 1328 // TODO 1329 } 1336 1330 #if BOOT_DEBUG_PERI 1337 boot_puts("- NIC initialised : "); 1338 boot_putd( channels ); 1339 boot_puts(" channels\n"); 1340 #endif 1341 } 1342 1343 //////// vci_io_bridge component 1344 else if ( (type == PERIPH_TYPE_IOB) && IOMMU_ACTIVE ) 1345 { 1346 // get the iommu page table physical address 1347 // TODO 1348 1349 // define IPI address mapping the IOC interrupt 1350 // TODO 1351 1352 // set IOMMU page table address 1353 // pseg_base[IOB_IOMMU_PTPR] = ptab_pbase; 1354 1355 // activate IOMMU 1356 // pseg_base[IOB_IOMMU_ACTIVE] = 1; 1357 1331 boot_puts("- NIC initialised\n"); 1332 #endif 1333 break; 1334 case PERIPH_TYPE_TTY: // vci_multi_tty component 1358 1335 #if BOOT_DEBUG_PERI 1359 boot_puts("- IOB initialised : "); 1360 boot_putd( channels ); 1361 boot_puts(" channels\n"); 1362 #endif 1363 } 1364 1336 boot_puts("- TTY initialised\n"); 1337 #endif 1338 break; 1339 case PERIPH_TYPE_IOB: // vci_io_bridge component 1340 if ( IOMMU_ACTIVE ) 1341 { 1342 // TODO 1343 // get the iommu page table physical address 1344 // define IPI address mapping the IOC interrupt 1345 // set IOMMU page table address 1346 // pseg_base[IOB_IOMMU_PTPR] = ptab_pbase; 1347 // activate IOMMU 1348 // pseg_base[IOB_IOMMU_ACTIVE] = 1; 1349 } 1350 #if BOOT_DEBUG_PERI 1351 boot_puts("- IOB initialised\n"); 1352 #endif 1353 break; 1354 } // end switch periph type 1365 1355 } // end for periphs 1356 1357 #if BOOT_DEBUG_PERI 1358 boot_puts("\n[BOOT DEBUG] ****** coprocessors initialisation in cluster "); 1359 boot_putd( cluster_id ); 1360 boot_puts(" ******\n"); 1361 #endif 1366 1362 1367 1363 for ( coproc_id = cluster[cluster_id].coproc_offset ; … … 1374 1370 1375 1371 #if BOOT_DEBUG_PERI 1376 boot_puts(" [BOOT] mwmr coproc initialisation of");1377 boot_puts( (unsigned int) coproc[coproc_id].name);1378 boot_puts(" , nb ports");1372 boot_puts("- coprocessor name : "); 1373 boot_puts( coproc[coproc_id].name ); 1374 boot_puts(" / nb ports = "); 1379 1375 boot_putd((unsigned int)coproc[coproc_id].ports); 1380 1376 boot_puts("\n"); … … 1443 1439 unsigned int alloc_tty_channel; // TTY channel allocator 1444 1440 unsigned int alloc_nic_channel; // NIC channel allocator 1445 unsigned int alloc_ fbdma_channel[NB_CLUSTERS]; // FBDMA channel allocators1441 unsigned int alloc_dma_channel[NB_CLUSTERS]; // DMA channel allocators 1446 1442 unsigned int alloc_timer_channel[NB_CLUSTERS]; // user TIMER allocators 1447 1443 … … 1464 1460 for ( cluster_id = 0 ; cluster_id < header->clusters ; cluster_id++ ) 1465 1461 { 1466 alloc_ fbdma_channel[cluster_id]= 0;1462 alloc_dma_channel[cluster_id] = 0; 1467 1463 alloc_timer_channel[cluster_id] = 0; 1468 1464 } … … 1678 1674 } 1679 1675 1680 // ctx_ fbdma : DMA global index provided by a cluster allocator1681 unsigned int ctx_ fbdma = 0xFFFFFFFF;1682 if ( task[task_id].use_fbdma )1676 // ctx_dma : DMA global index provided by a cluster allocator 1677 unsigned int ctx_dma = 0xFFFFFFFF; 1678 if ( task[task_id].use_fbdma || task[task_id].use_nic ) 1683 1679 { 1684 1680 unsigned int cluster_id = task[task_id].clusterid; 1685 if ( alloc_ fbdma_channel[cluster_id] >= NB_DMAS_MAX )1686 { 1687 boot_puts("\n[BOOT ERROR] local FBDMA index too large for task ");1681 if ( alloc_dma_channel[cluster_id] >= NB_DMAS_MAX ) 1682 { 1683 boot_puts("\n[BOOT ERROR] local DMA index too large for task "); 1688 1684 boot_puts( task[task_id].name ); 1689 1685 boot_puts(" in vspace "); … … 1692 1688 boot_exit(); 1693 1689 } 1694 ctx_ fbdma = cluster_id*NB_DMAS_MAX + alloc_fbdma_channel[cluster_id];1695 alloc_ fbdma_channel[cluster_id]++;1690 ctx_dma = cluster_id*NB_DMAS_MAX + alloc_dma_channel[cluster_id]; 1691 alloc_dma_channel[cluster_id]++; 1696 1692 } 1697 1693 … … 1730 1726 1731 1727 // initializes the task context in scheduler[gpid] 1732 boot_scheduler_set_context( gpid, ltid, CTX_SR_ID , ctx_sr 1733 boot_scheduler_set_context( gpid, ltid, CTX_SP_ID , ctx_sp 1734 boot_scheduler_set_context( gpid, ltid, CTX_RA_ID , ctx_ra 1735 boot_scheduler_set_context( gpid, ltid, CTX_EPC_ID , ctx_epc 1736 boot_scheduler_set_context( gpid, ltid, CTX_PTPR_ID , ctx_ptpr 1737 boot_scheduler_set_context( gpid, ltid, CTX_TTY_ID , ctx_tty 1738 boot_scheduler_set_context( gpid, ltid, CTX_ FBDMA_ID , ctx_fbdma);1739 boot_scheduler_set_context( gpid, ltid, CTX_NIC_ID , ctx_nic 1740 boot_scheduler_set_context( gpid, ltid, CTX_TIMER_ID , ctx_timer 1741 boot_scheduler_set_context( gpid, ltid, CTX_PTAB_ID , ctx_ptab 1742 boot_scheduler_set_context( gpid, ltid, CTX_LTID_ID , ltid 1743 boot_scheduler_set_context( gpid, ltid, CTX_VSID_ID , vspace_id 1744 boot_scheduler_set_context( gpid, ltid, CTX_RUN_ID , 1 1728 boot_scheduler_set_context( gpid, ltid, CTX_SR_ID , ctx_sr ); 1729 boot_scheduler_set_context( gpid, ltid, CTX_SP_ID , ctx_sp ); 1730 boot_scheduler_set_context( gpid, ltid, CTX_RA_ID , ctx_ra ); 1731 boot_scheduler_set_context( gpid, ltid, CTX_EPC_ID , ctx_epc ); 1732 boot_scheduler_set_context( gpid, ltid, CTX_PTPR_ID , ctx_ptpr ); 1733 boot_scheduler_set_context( gpid, ltid, CTX_TTY_ID , ctx_tty ); 1734 boot_scheduler_set_context( gpid, ltid, CTX_DMA_ID , ctx_dma ); 1735 boot_scheduler_set_context( gpid, ltid, CTX_NIC_ID , ctx_nic ); 1736 boot_scheduler_set_context( gpid, ltid, CTX_TIMER_ID , ctx_timer ); 1737 boot_scheduler_set_context( gpid, ltid, CTX_PTAB_ID , ctx_ptab ); 1738 boot_scheduler_set_context( gpid, ltid, CTX_LTID_ID , ltid ); 1739 boot_scheduler_set_context( gpid, ltid, CTX_VSID_ID , vspace_id ); 1740 boot_scheduler_set_context( gpid, ltid, CTX_RUN_ID , 1 ); 1745 1741 1746 1742 #if BOOT_DEBUG_SCHED … … 1785 1781 boot_puts("\n"); 1786 1782 1787 boot_puts(" - ctx[ FBDMA]= ");1788 boot_putd( ctx_ fbdma );1783 boot_puts(" - ctx[DMA] = "); 1784 boot_putd( ctx_dma ); 1789 1785 boot_puts("\n"); 1790 1786
Note: See TracChangeset
for help on using the changeset viewer.