Changeset 279 for trunk/tools


Ignore:
Timestamp:
Jul 27, 2017, 12:23:29 AM (7 years ago)
Author:
alain
Message:

1) Introduce independant command fields for the various devices in the thread descriptor.
2) Introduce a new dev_pic_enable_ipi() function in the generic PIC device
3) Fix two bugs identified by Maxime in the scheduler initialisation, and in the sched_select().
4) fix several bugs in the TSAR hal_kentry.S.
5) Introduce a third kgiet segment (besides kdata and kcode) in the TSAR bootloader.

Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/arch_info/genarch.py

    r6 r279  
    2525#  --fbf_size=int    : frame buffer width & heigth
    2626#  --ioc_type=string : can be IOC_BDV , IOC_HBA , IOC_SDC , IOC_SPI
    27 #  --io_cxy=int      : IO cluster identifier
    28 #  --boot_cxy=int    : boot cluster identifier
    29 #  --cache_line=int  : number of bytes in a cache line
    3027#
    3128# The following parameters can be used to generate the optional "hard_config.h" file,
     
    8279                   help = 'define type of IOC: BDV / HBA / SDC / RDK / SPI' )
    8380
    84 parser.add_option( '--io_cxy', type = 'int', dest = 'io_cxy',
    85                    default = 0,
    86                    help = 'define IO cluster identifier' )
    87 
    88 parser.add_option( '--boot_cxy', type = 'int', dest = 'boot_cxy',
    89                    default = 0,
    90                    help = 'define boot cluster identifier' )
    91 
    92 parser.add_option( '--cache_line', type = 'int', dest = 'cache_line',
    93                    default = 64,
    94                    help = 'define number of bytes in a cache line' )
    95 
    9681parser.add_option( '--hard', type = 'string', dest = 'hard_path',
    9782                   help = 'define pathname to directory for the hard_config.h file ' )
     
    120105nb_nics        = options.nb_nics     # number of NIC channels           
    121106ioc_type       = options.ioc_type    # ioc controller type
    122 io_cxy         = options.io_cxy      # IO cluster identifier
    123 boot_cxy       = options.boot_cxy    # boot cluster identifier
    124 cache_line     = options.cache_line  # number of bytes in a cache line
    125107
    126108hard_path      = options.hard_path   # path for hard_config.h file
     
    152134                        nb_nics,
    153135                        fbf_size,
    154                         ioc_type,
    155                         io_cxy,
    156                         boot_cxy,
    157                         cache_line )
     136                        ioc_type )
    158137
    159138print '[genarch] archinfo build for %s' % archinfo.name
  • trunk/tools/bootloader_tsar/boot.c

    r204 r279  
    109109uint32_t                        seg_kdata_base;  // kdata segment base address
    110110uint32_t                        seg_kdata_size;  // kdata segment size (bytes)
     111uint32_t                        seg_kgiet_base;  // kcode segment base address
     112uint32_t                        seg_kgiet_size;  // kcode segment size (bytes)
     113
    111114uint32_t                        kernel_entry;    // kernel entry point
    112115
     
    172175/**************************************************************************************
    173176 * This function loads the 'kernel.elf' file into the boot cluster memory buffer,
    174  * analyzes it, and places the the two seg_kcode & seg_kdata segments at their final
    175  * physical adresses (just after the preloader zone).       
     177 * analyzes it, and places the three kcode, kgiet, kdata segments at their final
     178 * physical adresses (defined the .elf file).       
    176179 * It set the global variables defining the kernel layout.
    177180 *************************************************************************************/
     
    189192    bool_t       kcode_found;     // kcode segment found.
    190193    bool_t       kdata_found;     // kdata segment found.
     194    bool_t       kgiet_found;     // kgiet segment found.
    191195    uint32_t     seg_id;          // iterator for segments loop.
    192196
     
    229233    kcode_found = false;
    230234    kdata_found = false;
     235    kgiet_found = false;
    231236    for (seg_id = 0; seg_id < segments_nb; seg_id++)
    232237    {
     
    259264            }
    260265
    261             // Note: we suppose that the 'kernel.elf' file contains only 2
    262             // loadable segments ktext & kdata and that the main
    263             // difference between these two is the WRITE permission: ktext
    264             // contains read-only instructions and read_only data,
    265             // while kdata contains writable data.
    266 
    267             if ((program_header[seg_id].p_flags & PF_W) == 0)  // kcode segment
     266            // Note: we suppose that the 'kernel.elf' file contains exactly
     267            // three loadable segments ktext, kgiet, & kdata:
     268            // - the kcode segment is read-only and base < 0x80000000
     269            // - the kgiet segment is read-only and base >= 0x8000000
     270
     271            if( ((program_header[seg_id].p_flags & PF_W) == 0) &&
     272                 (program_header[seg_id].p_paddr < 0x80000000) )     // kcode segment
    268273            {
    269274                if( kcode_found )
    270275                {
    271276                    boot_printf("\n[BOOT_ERROR] in %s for file %s :\n"
    272                                 "   two loadable kcode segments found\n",
     277                                "   two kcode segments found\n",
    273278                                __FUNCTION__ , KERNEL_PATHNAME );
    274279                    boot_exit();
     
    279284                seg_kcode_size = seg_memsz;
    280285            }
    281             else                                               // kdata segment
     286            else if( program_header[seg_id].p_paddr >= 0x80000000 ) // kgiet segment
     287            {
     288                if( kgiet_found )
     289                {
     290                    boot_printf("\n[BOOT_ERROR] in %s for file %s :\n"
     291                                "   two kgiet segments found\n",
     292                                __FUNCTION__ , KERNEL_PATHNAME );
     293                    boot_exit();
     294                }
     295
     296                kgiet_found     = true;
     297                seg_kgiet_base = seg_paddr;
     298                seg_kgiet_size = seg_memsz;
     299            }
     300            else                                                    // kdata segment
    282301            {
    283302                if( kdata_found )
     
    299318    if( kcode_found == false )
    300319    {
    301         boot_printf("\n[BOOT_ERROR] in %s for file %s :\n"
    302                     "   kcode segment not found\n",
     320        boot_printf("\n[BOOT_ERROR] in %s for file %s : seg_kcode not found\n",
    303321                    __FUNCTION__ , KERNEL_PATHNAME );
    304322        boot_exit();
    305323    }
    306     if( kdata_found == false )
    307     {
    308         boot_printf("\n[BOOT_ERROR] in %s for file %s :\n"
    309                     "   kdata segment not found\n",
     324    if( kgiet_found == false )
     325    {
     326        boot_printf("\n[BOOT_ERROR] in %s for file %s : seg_kgiet not found\n",
    310327                    __FUNCTION__ , KERNEL_PATHNAME );
    311328        boot_exit();
    312329    }
     330    if( kdata_found == false )
     331    {
     332        boot_printf("\n[BOOT_ERROR] in %s for file %s : seg_kdata not found\n",
     333                    __FUNCTION__ , KERNEL_PATHNAME );
     334        boot_exit();
     335    }
    313336
    314337    // set entry point
     
    316339
    317340#if DEBUG_BOOT_ELF
    318 boot_printf("\n[BOOT INFO] %s successfully completed for file %s at cycle %d\n",
     341boot_printf("\n[BOOT INFO] %s completed for file %s at cycle %d\n",
    319342            __FUNCTION__ , KERNEL_PATHNAME , boot_get_proctime() );
    320343#endif
     
    584607          boot_info->kernel_code_end : boot_info->kernel_data_end;
    585608
    586     // Set number of pages occupied by the kernel code
     609    // compute number of physical pages occupied by the kernel code
    587610    boot_info->pages_offset = ( (end & CONFIG_PPM_PAGE_MASK) == 0 ) ?
    588611                 (end >> CONFIG_PPM_PAGE_SHIFT) : (end >> CONFIG_PPM_PAGE_SHIFT) + 1;
    589612
    590     // No "reserved zones" for the TSAR architecture
    591     boot_info->rsvd_nr = 0;
     613    // set one reserved zone for giet code
     614    uint32_t first_page = seg_kgiet_base >> CONFIG_PPM_PAGE_SHIFT;
     615    uint32_t last_page  = (seg_kgiet_base + seg_kgiet_size - 1) >> CONFIG_PPM_PAGE_SHIFT;
     616
     617    boot_info->rsvd_nr = 1;
     618    boot_info->rsvd[0].first_page = first_page;
     619    boot_info->rsvd[0].npages     = last_page - first_page + 1;
    592620
    593621    // set boot_info signature
Note: See TracChangeset for help on using the changeset viewer.