Changeset 50 for trunk/tools/bootloader_tsar
- Timestamp:
- Jun 26, 2017, 3:15:11 PM (7 years ago)
- Location:
- trunk/tools/bootloader_tsar
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/bootloader_tsar/boot.c
r13 r50 26 26 * * 27 27 * It supports clusterised shared memory multi-processor architectures, * 28 * where each processor is identified by a composite index [cxy,lid],*28 * where each processor core is identified by a composite index [cxy,lid] * 29 29 * with one physical memory bank per cluster. * 30 30 * * 31 31 * The 'boot.elf' file (containing the boot-loader binary code) is stored * 32 * on disk and is loaded into memory by bscpu (whose index is [0,0]),*33 * executing the generic preloader.*32 * on disk and is loaded into memory by core[0,0] (cxy = 0 / lid = 0), * 33 * and is copied in each other cluter by the local CP0 (lid = 0]. * 34 34 * * 35 * 1) The boot-loader first phase is executed by bscpu only, while*35 * 1) The boot-loader first phase is executed by core[0,0], while * 36 36 * all other cores are waiting in the preloader. * 37 37 * It does the following tasks: * 38 * - load into the memory bank of cluster (0,0) the 'arch_info.bin'*38 * - load into the memory bank of cluster 0 the 'arch_info.bin' * 39 39 * file (containing the hardware architecture description) and the * 40 40 * 'kernel.elf' file, at temporary locations, * … … 47 47 * * 48 48 * 2) The boot-loader second phase is then executed in parallel by all * 49 * CP0s (other than bscpu). Each CP0 performs the following tasks:*49 * CP0s (other than core[0,0]). Each CP0 performs the following tasks: * 50 50 * - copies into the memory bank of the local cluster the 'boot.elf', * 51 51 * the 'arch_info.bin' (at the same addresses as the 'boot.elf' and * … … 59 59 * 3) The boot-loader third phase is executed in parallel by all cores. * 60 60 * After passing the global barrier the bscpu: * 61 * - activates the CPi of cluster(0 ,0),*61 * - activates the CPi of cluster(0), * 62 62 * - blocks on the local barrier waiting for all local CPi to report * 63 63 * completion on the local barrier, * … … 346 346 archinfo_irq_t * irq; 347 347 uint32_t irq_id; 348 348 uint32_t end; 349 uint32_t rsvd_pages; 349 350 boot_device_t * boot_dev; 350 351 … … 364 365 boot_info->io_cxy = header->io_cxy; 365 366 366 // Initialize kernel segments 367 // Initialize kernel segments from global variables 367 368 boot_info->kernel_code_start = seg_kcode_base; 368 369 boot_info->kernel_code_end = seg_kcode_base + seg_kcode_size; … … 505 506 if (device->type == DEV_TYPE_RAM_SCL) 506 507 { 507 // set total number of physical memory pages in cluster 508 boot_info->pages_nr = device->size >> CONFIG_PPM_PAGE_SHIFT; 509 510 // Get the last address allocated for the kernel segments 511 uint32_t end; 512 if( boot_info->kernel_code_end > boot_info->kernel_data_end ) 513 { 514 end = boot_info->kernel_code_end; 515 } 516 else 517 { 518 end = boot_info->kernel_data_end; 519 } 520 521 // Compute the number of pages allocated for the kernel. 522 if( (end & CONFIG_PPM_PAGE_MASK) == 0 ) 523 { 524 boot_info->pages_offset = end >> CONFIG_PPM_PAGE_SHIFT; 525 } 526 else 527 { 528 boot_info->pages_offset = (end >> CONFIG_PPM_PAGE_SHIFT) + 1; 529 } 530 531 #if DEBUG_BOOT_INFO 532 boot_printf(" - RAM : %x pages / first free page = %x\n", 533 boot_info->pages_nr , boot_info->pages_offset ); 508 // set number of physical memory pages 509 boot_info->pages_nr = device->size >> CONFIG_PPM_PAGE_SHIFT; 510 511 #if DEBUG_BOOT_INFO 512 boot_printf(" - RAM : %x pages\n", boot_info->pages_nr ); 534 513 #endif 535 514 } … … 602 581 } 603 582 } // end loop on local peripherals 583 584 // Get the top address of the kernel segments 585 end = (boot_info->kernel_code_end > boot_info->kernel_data_end ) ? 586 boot_info->kernel_code_end : boot_info->kernel_data_end; 587 588 // Get the number of pages reserved to kernel segments 589 rsvd_pages = ( (end & CONFIG_PPM_PAGE_MASK) == 0 ) ? 590 (end >> CONFIG_PPM_PAGE_SHIFT) : (end >> CONFIG_PPM_PAGE_SHIFT) + 1; 591 592 // set the kernel code "reserved zonz" 593 boot_info->rsvd_nr = 1; 594 boot_info->rsvd[0].first_page = 0; 595 boot_info->rsvd[0].npages = rsvd_pages; 596 597 #if DEBUG_BOOT_INFO 598 boot_printf("\n[BOOT INFO] %s : Kernel Reserved Zone / base = 0 / npages = %d at cycle %d\n", 599 __FUNCTION__ , rsvd_pages ,boot_get_proctime() ); 600 #endif 604 601 605 602 // set boot_info signature -
trunk/tools/bootloader_tsar/boot_config.h
r23 r50 7 7 8 8 // Debug options 9 #define DEBUG_BOOT_INFO 09 #define DEBUG_BOOT_INFO 1 10 10 #define DEBUG_BOOT_ELF 0 11 11 #define DEBUG_BOOT_IOC 0
Note: See TracChangeset
for help on using the changeset viewer.