Changeset 253 for soft/giet_vm/boot
- Timestamp:
- Aug 14, 2013, 11:19:29 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/boot/boot_init.c
r249 r253 806 806 { 807 807 mapping_header_t * header = (mapping_header_t *) & seg_mapping_base; 808 mapping_cluster_t * cluster = boot_get_cluster_base(header);809 mapping_periph_t * periph = boot_get_periph_base(header);810 808 811 809 // checking mapping availability … … 835 833 boot_exit(); 836 834 } 837 // checking hardware 838 unsigned int periph_id; 839 unsigned int cluster_id; 840 unsigned int tty_found = 0; 841 unsigned int nic_found = 0; 842 for (cluster_id = 0; cluster_id < NB_CLUSTERS; cluster_id++) 843 { 844 // NB_PROCS_MAX 845 if (cluster[cluster_id].procs > NB_PROCS_MAX) 846 { 847 boot_puts("\n[BOOT ERROR] too many processors in cluster "); 848 boot_putd(cluster_id); 849 boot_puts(" : procs = "); 850 boot_putd(cluster[cluster_id].procs); 851 boot_puts("\n"); 852 boot_exit(); 853 } 854 855 for (periph_id = cluster[cluster_id].periph_offset; 856 periph_id < cluster[cluster_id].periph_offset + cluster[cluster_id].periphs; 857 periph_id++) 858 { 859 // NB_TTY_CHANNELS 860 if (periph[periph_id].type == PERIPH_TYPE_TTY) 861 { 862 if (tty_found) 863 { 864 boot_puts("\n[BOOT ERROR] TTY component should not be replicated\n"); 865 boot_exit(); 866 } 867 if (periph[periph_id].channels > NB_TTY_CHANNELS) 868 { 869 boot_puts("\n[BOOT ERROR] Wrong NB_TTY_CHANNELS in cluster "); 870 boot_putd(cluster_id); 871 boot_puts(" : ttys = "); 872 boot_putd(periph[periph_id].channels); 873 boot_puts("\n"); 874 boot_exit(); 875 } 876 tty_found = 1; 877 } 878 // NB_NIC_CHANNELS 879 if (periph[periph_id].type == PERIPH_TYPE_NIC) 880 { 881 if (nic_found) 882 { 883 boot_puts("\n[BOOT ERROR] NIC component should not be replicated\n"); 884 boot_exit(); 885 } 886 if (periph[periph_id].channels != NB_NIC_CHANNELS) 887 { 888 boot_puts("\n[BOOT ERROR] Wrong NB_NIC_CHANNELS in cluster "); 889 boot_putd(cluster_id); 890 boot_puts(" : nics = "); 891 boot_putd(periph[periph_id].channels); 892 boot_puts("\n"); 893 boot_exit(); 894 } 895 nic_found = 1; 896 } 897 // NB_TIMERS 898 if (periph[periph_id].type == PERIPH_TYPE_TIM) 899 { 900 if (periph[periph_id].channels > NB_TIM_CHANNELS) 901 { 902 boot_puts("\n[BOOT ERROR] Too much user timers in cluster "); 903 boot_putd(cluster_id); 904 boot_puts(" : timers = "); 905 boot_putd(periph[periph_id].channels); 906 boot_puts("\n"); 907 boot_exit(); 908 } 909 } 910 // NB_DMAS 911 if (periph[periph_id].type == PERIPH_TYPE_DMA) 912 { 913 if (periph[periph_id].channels > NB_DMA_CHANNELS) 914 { 915 boot_puts("\n[BOOT ERROR] Too much DMA channels in cluster "); 916 boot_putd(cluster_id); 917 boot_puts(" : channels = "); 918 boot_putd(periph[periph_id].channels); 919 boot_puts(" - NB_DMA_CHANNELS : "); 920 boot_putd(NB_DMA_CHANNELS); 921 boot_puts("\n"); 922 boot_exit(); 923 } 924 } 925 } // end for periphs 926 } // end for clusters 835 836 #if BOOT_DEBUG_MAPPING 837 boot_puts("\nclusters = "); 838 boot_putd( header->clusters ); 839 boot_puts("\nprocs = "); 840 boot_putd( header->procs ); 841 boot_puts("\nperiphs = "); 842 boot_putd( header->periphs ); 843 boot_puts("\nvspaces = "); 844 boot_putd( header->vspaces ); 845 boot_puts("\ntasks = "); 846 boot_putd( header->tasks ); 847 boot_puts("\n"); 848 849 unsigned int cluster_id; 850 mapping_cluster_t * cluster = boot_get_cluster_base(header); 851 for (cluster_id = 0; cluster_id < NB_CLUSTERS; cluster_id++) 852 { 853 boot_puts("\n cluster = "); 854 boot_putd( cluster_id ); 855 boot_puts("\n procs = "); 856 boot_putd( cluster[cluster_id].procs ); 857 boot_puts("\n psegs = "); 858 boot_putd( cluster[cluster_id].psegs ); 859 boot_puts("\n periphs = "); 860 boot_putd( cluster[cluster_id].periphs ); 861 boot_puts("\n"); 862 } 863 #endif 864 865 boot_puts("\n[BOOT] Mapping check completed at cycle "); 866 boot_putd(boot_proctime()); 867 boot_puts(" for "); 868 boot_puts( header->name ); 869 boot_puts("\n"); 870 927 871 } // end boot_check_mapping() 928 872 … … 971 915 } 972 916 } 917 918 boot_puts("\n[BOOT] Pseg allocators initialisation completed at cycle "); 919 boot_putd(boot_proctime()); 920 boot_puts("\n"); 921 973 922 } // end boot_psegs_init() 974 923 … … 1037 986 #endif 1038 987 } 988 989 boot_puts("\n[BOOT] Page Tables initialisation completed at cycle "); 990 boot_putd(boot_proctime()); 991 boot_puts("\n"); 992 1039 993 } // end boot_pt_init() 1040 994 … … 1216 1170 } 1217 1171 } // end loop on vspaces 1172 1173 boot_puts("\n[BOOT] Vobjs initialisation completed at cycle : "); 1174 boot_putd(boot_proctime()); 1175 boot_puts("\n"); 1176 1218 1177 } // end boot_vobjs_init() 1219 1178 … … 1423 1382 } // end for coprocs 1424 1383 } // end for clusters 1384 1385 boot_puts("\n[BOOT] Peripherals initialisation completed at cycle "); 1386 boot_putd(boot_proctime()); 1387 boot_puts("\n"); 1388 1425 1389 } // end boot_peripherals_init() 1426 1390 … … 1858 1822 } // end loop on tasks 1859 1823 } // end loop on vspaces 1824 1825 boot_puts("\n[BOOT] Schedulers initialisation completed at cycle "); 1826 boot_putd(boot_proctime()); 1827 boot_puts("\n"); 1828 1860 1829 } // end boot_schedulers_init() 1861 1830 … … 1879 1848 boot_check_mapping(); 1880 1849 1881 boot_puts("\n[BOOT] Mapping check completed at cycle ");1882 boot_putd(boot_proctime());1883 boot_puts("\n");1884 1885 1850 // pseg allocators initialisation 1886 1851 boot_psegs_init(); 1887 1852 1888 boot_puts("\n[BOOT] Pseg allocators initialisation completed at cycle ");1889 boot_putd(boot_proctime());1890 boot_puts("\n");1891 1892 1853 // page table building 1893 1854 boot_pt_init(); 1894 1855 1895 boot_puts("\n[BOOT] Page Tables initialisation completed at cycle "); 1896 boot_putd(boot_proctime()); 1897 boot_puts("\n"); 1898 1899 // mmu activation ( with page table [Ã] ) 1856 // mmu activation ( with page table [0] ) 1900 1857 boot_set_mmu_ptpr((unsigned int) (boot_ptabs_paddr[0] >> 13)); 1901 1858 boot_set_mmu_mode(0xF); … … 1905 1862 boot_puts("\n"); 1906 1863 1907 1908 1864 // vobjs initialisation 1909 1865 boot_vobjs_init(); 1910 1866 1911 boot_puts("\n[BOOT] Vobjs initialisation completed at cycle : ");1912 boot_putd(boot_proctime());1913 boot_puts("\n");1914 1915 1867 // peripherals initialisation 1916 1868 boot_peripherals_init(); 1917 1869 1918 boot_puts("\n[BOOT] Peripherals initialisation completed at cycle ");1919 boot_putd(boot_proctime());1920 boot_puts("\n");1921 1922 1870 // schedulers initialisation 1923 1871 boot_schedulers_init(); 1924 1925 boot_puts("\n[BOOT] Schedulers initialisation completed at cycle ");1926 boot_putd(boot_proctime());1927 boot_puts("\n");1928 1872 1929 1873 // start all processors
Note: See TracChangeset
for help on using the changeset viewer.