Changeset 552 for soft


Ignore:
Timestamp:
Apr 5, 2015, 12:28:37 AM (9 years ago)
Author:
alain
Message:

Move the peripherals initialisation to kernel_init.c.

File:
1 edited

Legend:

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

    r538 r552  
    11771177    {
    11781178        // register WAKUP ISR in WTI interrupt vector
    1179         _schedulers[x][y][lpid]->wti_vector[4*lpid] = ISR_WAKUP;
     1179        _schedulers[x][y][lpid]->wti_vector[lpid] = ISR_WAKUP;
    11801180
    11811181        // update XCU WTI mask for P[x,y,lpid] (4 entries per proc)
     
    17251725} // end boot_elf_load()
    17261726
    1727 ////////////////////////////////////////////////////////////////////////////////
    1728 // This function intializes the external peripherals in cluster_io.
    1729 ////////////////////////////////////////////////////////////////////////////////
    1730 void boot_peripherals_init()
    1731 {
    1732     mapping_header_t * header   = (mapping_header_t *)SEG_BOOT_MAPPING_BASE;
    1733     mapping_cluster_t * cluster = _get_cluster_base(header);
    1734     mapping_periph_t * periph   = _get_periph_base(header);
    1735 
    1736     unsigned int periph_id;
    1737     unsigned int channel_id;
    1738 
    1739 #if BOOT_DEBUG_PERI
    1740 _printf("\n[BOOT] External peripherals initialisation in cluster[%d,%d]\n",
    1741         X_IO , Y_IO );
    1742 #endif
    1743 
    1744     // get pointer on cluster_io
    1745     mapping_cluster_t * cluster_io = &cluster[X_IO * Y_SIZE + Y_IO];
    1746 
    1747     // loop on peripherals
    1748     for (periph_id = cluster_io->periph_offset;
    1749          periph_id < cluster_io->periph_offset + cluster_io->periphs;
    1750          periph_id++)
    1751     {
    1752         unsigned int type       = periph[periph_id].type;
    1753         unsigned int subtype    = periph[periph_id].subtype;
    1754         unsigned int channels   = periph[periph_id].channels;
    1755 
    1756         switch (type)
    1757         {
    1758             case PERIPH_TYPE_IOC:    // vci_block_device component
    1759             {
    1760                 if      ( subtype == IOC_SUBTYPE_BDV ) _bdv_init();
    1761                 else if ( subtype == IOC_SUBTYPE_HBA ) _hba_init();
    1762                 else if ( subtype == IOC_SUBTYPE_SPI ) _sdc_init();
    1763                 break;
    1764             }
    1765             case PERIPH_TYPE_TTY:    // vci_multi_tty component
    1766             {
    1767                 for (channel_id = 0; channel_id < channels; channel_id++)
    1768                 {
    1769                     _tty_init( channel_id );
    1770                 }
    1771                 break;
    1772             }
    1773             case PERIPH_TYPE_NIC:    // vci_multi_nic component
    1774             {
    1775                 _nic_global_init( 1,      // broadcast accepted
    1776                                   1,      // bypass activated
    1777                                   0,      // tdm non activated
    1778                                   0 );    // tdm period
    1779                 break;
    1780             }
    1781             case PERIPH_TYPE_IOB:    // vci_io_bridge component
    1782             {
    1783                 if (GIET_USE_IOMMU)
    1784                 {
    1785                     // TODO
    1786                     // get the iommu page table physical address
    1787                     // set IOMMU page table address
    1788                     // pseg_base[IOB_IOMMU_PTPR] = ptab_pbase;   
    1789                     // activate IOMMU
    1790                     // pseg_base[IOB_IOMMU_ACTIVE] = 1;       
    1791                 }
    1792                 break;
    1793             }
    1794         }  // end switch periph type
    1795     } // end loop on peripherals
    1796 } // end boot_peripherals_init()
    17971727
    17981728/////////////////////////////////////////////////////////////////////////////////
     
    18651795    if ( gpid == 0 )   
    18661796    {
    1867         unsigned int cid;  // index for loops
     1797        unsigned int cid;  // index for loop on clusters
    18681798
    18691799        // initialises the TTY0 spin lock
     
    18721802        _printf("\n[BOOT] P[0,0,0] starts at cycle %d\n", _get_proctime() );
    18731803
     1804        // initialises the IOC peripheral
     1805        if      ( USE_IOC_BDV != 0 ) _bdv_init();
     1806        else if ( USE_IOC_HBA != 0 ) _hba_init();
     1807        else if ( USE_IOC_SDC != 0 ) _sdc_init();
     1808        else if ( USE_IOC_RDK == 0 )
     1809        {
     1810            _printf("\n[BOOT ERROR] boot_init() : no IOC peripheral\n");
     1811            _exit();
     1812        }
     1813
    18741814        // initialises the FAT
    1875         _fat_init( 0 );   // no IRQ
     1815        _fat_init( 0 );          // no IRQ
    18761816
    18771817        _printf("\n[BOOT] FAT initialised at cycle %d\n", _get_proctime() );
     
    19651905        }
    19661906
    1967        
    1968         // Each processor P[x,y,0] contributes to load .elf files.
     1907        // All processor P[x,y,0] contributes to load .elf files into clusters.
    19691908        boot_elf_load();
    19701909
     
    19731912        //////////////////////////////////////////////
    19741913       
    1975         // Processor P[0,0,0] initialises external peripherals
    1976         if ( gpid == 0 )
    1977         {
    1978             // initialize external peripherals
    1979             boot_peripherals_init();
    1980        
    1981             _printf("\n[BOOT] Peripherals initialised at cycle %d\n",
    1982                     _get_proctime() );
    1983         }
    1984 
    1985         //////////////////////////////////////////////
    1986         _simple_barrier_wait( &_barrier_all_clusters );
    1987         //////////////////////////////////////////////
    1988 
    1989         // each processor P[x][y][0] wake up other processors in same cluster
     1914        // Each processor P[x][y][0] wake up other processors in same cluster
    19901915        mapping_header_t*  header     = (mapping_header_t *)SEG_BOOT_MAPPING_BASE;
    19911916        mapping_cluster_t* cluster    = _get_cluster_base(header);
     
    20051930        }
    20061931    }
    2007     // Other processors than P[x][y][0] activate MMU (using local PTAB)
     1932    // All other processors activate MMU (using local PTAB)
    20081933    if ( lpid != 0 )
    20091934    {
     
    20221947
    20231948#if BOOT_DEBUG_ELF
    2024 _printf("\n@@@ P[%d,%d,%d] exit boot / jumping to %x at cycle %d\n",
     1949_printf("\n[DEBUG BOOT_ELF] P[%d,%d,%d] exit boot & jump to %x at cycle %d\n",
    20251950        cx, cy, lpid, kernel_entry , _get_proctime() );
    20261951#endif
Note: See TracChangeset for help on using the changeset viewer.