Changeset 535 for trunk/kernel


Ignore:
Timestamp:
Sep 21, 2018, 10:20:57 PM (6 years ago)
Author:
nicolas.van.phan@…
Message:

Replace TXT0 by MTTY0 for LETI

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/kernel_init.c

    r534 r535  
    262262
    263263///////////////////////////////////////////////////////////////////////////////////////////
     264// This function is the same as txt0_device_init() but uses the internal multi_tty device
     265// attached to cluster (0,0) instead of the external tty_tsar.
     266// This function is used instead of txt0_device_init() only for TSAR LETI.
     267///////////////////////////////////////////////////////////////////////////////////////////
     268// @ info    : pointer on the local boot-info structure.
     269///////////////////////////////////////////////////////////////////////////////////////////
     270static void mtty0_device_init( boot_info_t * info)
     271{
     272    boot_device_t * dev_tbl;         // pointer on array of devices in boot_info
     273    uint32_t        dev_nr;          // actual number of devices in this cluster
     274    xptr_t          base;            // remote pointer on segment base
     275    uint32_t        func;            // device functional index
     276    uint32_t        impl;            // device implementation index
     277    uint32_t        i;               // device index in dev_tbl
     278    uint32_t        x;               // X cluster coordinate
     279    uint32_t        y;               // Y cluster coordinate
     280
     281    dev_nr = info->int_dev_nr;
     282    dev_tbl = info->int_dev;
     283
     284    // Loop on internal peripherals of cluster (0,0) to find MTY0
     285    for ( i = 0; i < dev_nr; i++ )
     286    {
     287        base = dev_tbl[i].base;
     288        func = FUNC_FROM_TYPE( dev_tbl[i].type );
     289        impl = IMPL_FROM_TYPE( dev_tbl[i].type );
     290
     291        if ( func == DEV_FUNC_TXT )
     292        {
     293            txt0_chdev.func     = func;
     294            txt0_chdev.impl     = impl;
     295            txt0_chdev.channel  = 0;
     296            txt0_chdev.base     = base;
     297            txt0_chdev.is_rx    = false;
     298
     299            // Initialize MTY0 chdev lock
     300            remote_spinlock_init( XPTR( local_cxy, &txt0_chdev.wait_lock ) );
     301
     302            // MTY specific initialization
     303            dev_txt_init( &txt0_chdev );
     304
     305            // register the MTY in all chdev_dir[x][y] structures
     306            for( x = 0 ; x < info->x_size ; x++ )
     307            {
     308                for( y = 0 ; y < info->y_max; y++ ) // [FIXME]
     309                {
     310                    cxy_t  cxy = (x<<info->y_width) + y;
     311                    hal_remote_swd( XPTR( cxy , &chdev_dir.txt_tx[0] ) ,
     312                                    XPTR( local_cxy , &txt0_chdev ) );
     313                }
     314            }
     315        }
     316    } // end loop on internal devices
     317} // end mty0_device_init()
     318
     319///////////////////////////////////////////////////////////////////////////////////////////
    264320// This function allocates memory and initializes the chdev descriptors for the internal
    265321// peripherals contained in the local cluster, other than the LAPIC, as specified by
     
    793849    thread->remote_locks = 0;
    794850
    795     // CP0 in I/O cluster initialises TXT0 chdev descriptor
    796     //if( (core_lid == 0) && (core_cxy == io_cxy) ) txt0_device_init( info );
    797851    // CP0 in cluster 0 initializes TXT0 chdev descriptor
    798     if( core_cxy == 0 && core_lid == 0 ) txt0_device_init( info );
     852    if( core_cxy == 0 && core_lid == 0 ) // [MODIF]
     853    {
     854        if( info->use_mty0 == 1 ) {
     855            mtty0_device_init( info );
     856        } else {
     857            txt0_device_init( info );
     858        }
     859    }
    799860    // [FIXME]
    800861
Note: See TracChangeset for help on using the changeset viewer.