Changeset 50 for trunk/tools
- Timestamp:
- Jun 26, 2017, 3:15:11 PM (7 years ago)
- Location:
- trunk/tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/arch_info/boot_info.h
r13 r50 2 2 * boot_info.h - informations passed by the bootloader to the kernel in each cluster. 3 3 * 4 * Author Alain Greiner (june 2016 )4 * Author Alain Greiner (june 2016,2017) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 82 82 83 83 /********************************************************************************************* 84 * This structure defines a reserved zone in the physical address space of a given cluster. 85 * A reserved zone is described as a set of contiguous small pages (4 Kbytes) covering the 86 * reserved zone, that must be considered already allocated. 87 ********************************************************************************************/ 88 89 typedef struct boot_rsvd_s 90 { 91 ppn_t first_page; /*! first physical page index in cluster */ 92 uint32_t npages; /*! number of small pages */ 93 } 94 boot_rsvd_t; 95 96 /********************************************************************************************* 84 97 * This structure defines the interface between the boot-loader and the kernel. 85 98 * In each cluster, the boot core build a local boot_info_t structure containing … … 110 123 uint32_t cores_nr; /*! number of local cores in */ 111 124 boot_core_t core[CONFIG_MAX_LOCAL_CORES]; /*! array of core descriptors */ 125 uint32_t rsvd_nr; /*! number of reserved zones */ 126 boot_rsvd_t rsvd[CONFIG_PPM_MAX_RSVD]; /*! array of reserved zones */ 112 127 boot_device_t dev_icu; /*! embedded ICU peripheral */ 113 128 boot_device_t dev_mmc; /*! embedded MMC peripheral */ 114 129 boot_device_t dev_dma; /*! embedded DMA peripheral */ 115 130 116 uint32_t pages_ nr; /*! number of 4 Kbytes pages*/117 uint32_t pages_ offset; /*! number of pages allocated for kernel*/131 uint32_t pages_offset; /*! first free page index (after kernel) */ 132 uint32_t pages_nr; /*! total number of physical pages in RAM */ 118 133 119 134 // kernel segments 120 135 121 intptr_t kernel_code_start; /*! kernel code base address*/122 intptr_t kernel_code_end; /*! kernel code last address (excluded)*/123 intptr_t kernel_data_start; /*! kernel data base address*/124 intptr_t kernel_data_end; /*! kernel data last address (excluded)*/136 intptr_t kernel_code_start; /*! kernel code base paddr */ 137 intptr_t kernel_code_end; /*! kernel code last paddr (excluded) */ 138 intptr_t kernel_data_start; /*! kernel data base paddr */ 139 intptr_t kernel_data_end; /*! kernel data last paddr (excluded) */ 125 140 } 126 141 boot_info_t; -
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.