- Timestamp:
- Apr 5, 2015, 12:28:37 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_boot/boot.c
r538 r552 1177 1177 { 1178 1178 // 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; 1180 1180 1181 1181 // update XCU WTI mask for P[x,y,lpid] (4 entries per proc) … … 1725 1725 } // end boot_elf_load() 1726 1726 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_PERI1740 _printf("\n[BOOT] External peripherals initialisation in cluster[%d,%d]\n",1741 X_IO , Y_IO );1742 #endif1743 1744 // get pointer on cluster_io1745 mapping_cluster_t * cluster_io = &cluster[X_IO * Y_SIZE + Y_IO];1746 1747 // loop on peripherals1748 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 component1759 {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 component1766 {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 component1774 {1775 _nic_global_init( 1, // broadcast accepted1776 1, // bypass activated1777 0, // tdm non activated1778 0 ); // tdm period1779 break;1780 }1781 case PERIPH_TYPE_IOB: // vci_io_bridge component1782 {1783 if (GIET_USE_IOMMU)1784 {1785 // TODO1786 // get the iommu page table physical address1787 // set IOMMU page table address1788 // pseg_base[IOB_IOMMU_PTPR] = ptab_pbase;1789 // activate IOMMU1790 // pseg_base[IOB_IOMMU_ACTIVE] = 1;1791 }1792 break;1793 }1794 } // end switch periph type1795 } // end loop on peripherals1796 } // end boot_peripherals_init()1797 1727 1798 1728 ///////////////////////////////////////////////////////////////////////////////// … … 1865 1795 if ( gpid == 0 ) 1866 1796 { 1867 unsigned int cid; // index for loop s1797 unsigned int cid; // index for loop on clusters 1868 1798 1869 1799 // initialises the TTY0 spin lock … … 1872 1802 _printf("\n[BOOT] P[0,0,0] starts at cycle %d\n", _get_proctime() ); 1873 1803 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 1874 1814 // initialises the FAT 1875 _fat_init( 0 ); // no IRQ1815 _fat_init( 0 ); // no IRQ 1876 1816 1877 1817 _printf("\n[BOOT] FAT initialised at cycle %d\n", _get_proctime() ); … … 1965 1905 } 1966 1906 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. 1969 1908 boot_elf_load(); 1970 1909 … … 1973 1912 ////////////////////////////////////////////// 1974 1913 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 1990 1915 mapping_header_t* header = (mapping_header_t *)SEG_BOOT_MAPPING_BASE; 1991 1916 mapping_cluster_t* cluster = _get_cluster_base(header); … … 2005 1930 } 2006 1931 } 2007 // Other processors than P[x][y][0]activate MMU (using local PTAB)1932 // All other processors activate MMU (using local PTAB) 2008 1933 if ( lpid != 0 ) 2009 1934 { … … 2022 1947 2023 1948 #if BOOT_DEBUG_ELF 2024 _printf("\n @@@ P[%d,%d,%d] exit boot / jumpingto %x at cycle %d\n",1949 _printf("\n[DEBUG BOOT_ELF] P[%d,%d,%d] exit boot & jump to %x at cycle %d\n", 2025 1950 cx, cy, lpid, kernel_entry , _get_proctime() ); 2026 1951 #endif
Note: See TracChangeset
for help on using the changeset viewer.