Changeset 536


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

TTY MUX 1 : Init tty chdevs in internal_devices_init()

File:
1 edited

Legend:

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

    r535 r536  
    400400
    401401                assert( (chdev_ptr != NULL) , "cannot allocate memory for DMA chdev" );
    402            
     402
    403403                // make DMA specific initialisation
    404404                dev_dma_init( chdev_ptr );     
     
    413413__FUNCTION__ , channel , local_cxy , chdev_ptr );
    414414#endif
     415            }
     416        }
     417
     418        else if ( func == DEV_FUNC_TXT && info->use_mty0 == 1 )
     419        {
     420            assert(impl == IMPL_TXT_MTY,
     421                "Internal TTYs should have MTY implementation\n");
     422
     423            for ( channel = 0; channel < channels; channel++ )
     424            {
     425                int rx;
     426                for ( rx = 0; rx <= 1; rx++ )
     427                {
     428                    // skip MTY0_TX since it has already been initialized
     429                    if ( channel == 0 && rx == 0 ) continue;
     430
     431                    // create chdev in local cluster
     432                    chdev_ptr = chdev_create( func,
     433                                              impl,
     434                                              channel,
     435                                              rx,
     436                                              base );
     437
     438                    assert( (chdev_ptr != NULL) ,
     439                        "cannot allocate memory for MTY chdev" );
     440
     441                    // make MTY specific initialization
     442                    dev_txt_init( chdev_ptr );
     443
     444                    // set the MTY fields in all clusters
     445                    xptr_t *chdev_entry;
     446                    if ( rx == 1 ) {
     447                        chdev_entry = &chdev_dir.txt_rx[channel];
     448                    } else {
     449                        chdev_entry = &chdev_dir.txt_tx[channel];
     450                    }
     451                    for ( x = 0; x < info->x_max; x++ )
     452                    {
     453                        for ( y = 0; y < info->y_max; y++ )
     454                        {
     455                            cxy_t cxy = (x<<info->y_width) + y;
     456                            hal_remote_swd( XPTR( cxy, chdev_entry ),
     457                                            XPTR( local_cxy, chdev_ptr ) );
     458                        }
     459                    }
     460                }
    415461            }
    416462        }
     
    492538            {
    493539                // skip TXT_TX[0] chdev that has already been created & registered
    494                 if( (func == DEV_FUNC_TXT) && (channel == 0) && (rx == 0) ) continue;
     540                if( info->use_mty0 == 0 && (func == DEV_FUNC_TXT) && (channel == 0) && (rx == 0) )
     541                {
     542                    continue;
     543                }
     544
     545                // skip TXT chdevs because they are initialized in internal_devices_init()
     546                if ( info->use_mty0 == 1 && func == DEV_FUNC_TXT )
     547                {
     548                    continue;
     549                }
    495550
    496551                // compute target cluster for chdev[func,channel,direction]
Note: See TracChangeset for help on using the changeset viewer.