Ignore:
Timestamp:
Aug 12, 2012, 1:35:34 PM (12 years ago)
Author:
karaoui
Message:

+ removing some bugs from:

  • xml_parser.c: check that strcmp == 0 for coproc direction
  • mwmr_channel.c: mwmr->ptr to ptr.
  • utils.h double definition of memcpy fonction.

+ mapping_info.h : naming the enums
+ boot_init.c: changing the order of initialisation in order

to initialise the coproc with the mwmr channel values( depth, width...).
Note that the vobjs are now physically initialised.

+ mwmr_channel.h: changing the order argument definition to suit vci_mwmr_channel Soclib componnent.
+ hwr_mapping.h: adding the register description of the vci_mwmr_controller .

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/boot/boot_init.c

    r199 r200  
    10591059boot_puts(" ******\n");
    10601060#endif
    1061         // We must set the PTPR depending on the vspace, because the addresses
    1062         // of mwmmr channels, barriers and locks are defined in virtual space.
    1063         boot_set_mmu_ptpr( (unsigned int)boot_ptabs_paddr[vspace_id] >> 13 );
    10641061
    10651062        unsigned int ptab_found = 0;
     
    10741071                case VOBJ_TYPE_MWMR:    // storage capacity is (vobj.length/4 - 5) words
    10751072                        {
    1076                     mwmr_channel_t* mwmr = (mwmr_channel_t*)(vobj[vobj_id].vaddr);
     1073                    mwmr_channel_t* mwmr = (mwmr_channel_t*)(vobj[vobj_id].paddr);
    10771074                    mwmr->ptw   = 0;
    10781075                    mwmr->ptr   = 0;
     
    11161113                case VOBJ_TYPE_BARRIER: // init is the number of participants
    11171114                {
    1118                     giet_barrier_t* barrier = (giet_barrier_t*)(vobj[vobj_id].vaddr);
     1115                    giet_barrier_t* barrier = (giet_barrier_t*)(vobj[vobj_id].paddr);
    11191116                    barrier->count = 0;
    11201117                    barrier->init  = vobj[vobj_id].init;
     
    11301127                case VOBJ_TYPE_LOCK:    // init is "not taken"
    11311128                {
    1132                     unsigned int* lock = (unsigned int*)(vobj[vobj_id].vaddr);
     1129                    unsigned int* lock = (unsigned int*)(vobj[vobj_id].paddr);
    11331130                    *lock = 0;
    11341131#if BOOT_DEBUG_VOBJS
     
    11811178    } // end loop on vspaces
    11821179} // end boot_vobjs_init()
     1180
     1181void
     1182mwmr_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
    11831197
    11841198////////////////////////////////////////////////////////////////////////////////
     
    11941208    mapping_periph_t*   periph  = boot_get_periph_base( header );
    11951209    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 );
    11961214
    11971215    unsigned int        cluster_id;
    11981216    unsigned int        periph_id; 
    11991217    unsigned int        coproc_id; 
     1218    unsigned int        cp_port_id; 
    12001219    unsigned int        channel_id;
    12011220
     
    12921311              coproc_id++ )
    12931312        {
    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
     1318boot_puts("[BOOT] mwmr coproc initialisation of ");
     1319boot_putw((unsigned int) coproc[coproc_id].name);
     1320boot_puts(", nb ports");
     1321boot_putw((unsigned int)coproc[coproc_id].ports);
     1322boot_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
     1339boot_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
     1347boot_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
     1353boot_puts(", with mwmr: ");
     1354boot_puts(vobj[vobj_id].name);
     1355boot_puts(" of vspace: ");
     1356boot_puts(vspace[vspace_id].name);
     1357#endif
     1358            }
    12951359        } // end for coprocs
    12961360
     
    16801744    boot_puts("\n");
    16811745
     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
    16821760    // peripherals initialisation
    16831761    boot_peripherals_init();
     
    16871765    boot_puts("\n");
    16881766
    1689     // page table building
    1690     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 
    16961767    // mmu activation
    16971768    boot_set_mmu_ptpr( (unsigned int)boot_ptabs_paddr[0] >> 13 );
     
    16991770
    17001771    boot_puts("\n[BOOT] MMU activation completed at cycle ");
    1701     boot_putw( boot_proctime() );
    1702     boot_puts("\n");
    1703 
    1704     // vobjs initialisation
    1705     boot_vobjs_init();
    1706 
    1707     boot_puts("\n[BOOT] Vobjs initialisation completed at cycle : ");
    17081772    boot_putw( boot_proctime() );
    17091773    boot_puts("\n");
Note: See TracChangeset for help on using the changeset viewer.