Ignore:
Timestamp:
Jun 27, 2017, 2:07:55 PM (5 years ago)
Author:
max@…
Message:

empty out the x86 drivers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/drivers/soclib_xcu.c

    r75 r76  
    2727#include <chdev.h>
    2828
    29 
    30 
    31 ////////////////////////////////////
    3229void soclib_xcu_init( chdev_t * icu,
    3330                      lid_t     lid )
    3431{
    35     // get local ICU segment base address
    36         uint32_t * base = (uint32_t *)GET_PTR( icu->base );
    3732
    38     // disable all IRQs
    39     base[XCU_MSK_HWI_DISABLE << 5 | lid] = 0xFFFFFFFF;
    40     base[XCU_MSK_WTI_DISABLE << 5 | lid] = 0xFFFFFFFF;
    41     base[XCU_MSK_PTI_DISABLE << 5 | lid] = 0xFFFFFFFF;
    4233}
    4334
    44 ////////////////////////////////////////////
    4535void soclib_xcu_disable_irq( chdev_t  * icu,
    4636                             uint32_t   mask,
     
    4838                             lid_t      lid )
    4939{
    50     // get XCU segment base address
    51         uint32_t * base = (uint32_t *)GET_PTR( icu->base );
    5240
    53     // write into register
    54         if     ( type == WTI_TYPE ) base[XCU_MSK_WTI_DISABLE << 5 | lid] = mask;
    55         else if( type == HWI_TYPE ) base[XCU_MSK_HWI_DISABLE << 5 | lid] = mask;
    56         else                        base[XCU_MSK_PTI_DISABLE << 5 | lid] = mask;
    5741}
    5842
    59 ///////////////////////////////////////////
    6043void soclib_xcu_enable_irq( chdev_t  * icu,
    6144                            uint32_t   mask,
     
    6346                            lid_t      lid )
    6447{
    65     // get XCU segment base address
    66         uint32_t * base = (uint32_t *)GET_PTR( icu->base );
    6748
    68     // write into register
    69         if     ( type == WTI_TYPE ) base[XCU_MSK_WTI_ENABLE << 5 | lid] = mask;
    70         else if( type == HWI_TYPE ) base[XCU_MSK_HWI_ENABLE << 5 | lid] = mask;
    71         else                        base[XCU_MSK_PTI_ENABLE << 5 | lid] = mask;
    7249}
    7350
    74 ///////////////////////////////////////////
    7551void soclib_xcu_get_masks( chdev_t   * icu,
    7652                           lid_t       lid,
     
    7955                           uint32_t  * pti_mask )
    8056{
    81     // get XCU segment base address
    82         uint32_t * base = (uint32_t *)GET_PTR( icu->base );
    83  
    84     // get values from registers
    85     *hwi_mask = base[XCU_MSK_HWI << 5 | lid];
    86     *wti_mask = base[XCU_MSK_WTI << 5 | lid];
    87     *pti_mask = base[XCU_MSK_PTI << 5 | lid];
     57
    8858}
    8959
    90 //////////////////////////////////////////
    9160void soclib_xcu_set_period( chdev_t * icu,
    9261                            uint32_t  index,
    9362                            uint32_t  period )
    9463{
    95     // get local ICU segment base address
    96         uint32_t * base = (uint32_t *)GET_PTR( icu->base );
    9764
    98     // write into register
    99     base[XCU_PTI_PER << 5 | index] = period;
    10065}
    10166
    102 /////////////////////////////////////////////
    10367uint32_t soclib_xcu_ack_timer( chdev_t * icu,
    10468                               uint32_t  index )
    10569{
    106     // get local ICU segment base address
    107         uint32_t * base = (uint32_t *)GET_PTR( icu->base );
    10870
    109     // read from register
    110         return base[XCU_PTI_ACK << 5 | index];
    11171}
    11272
    113 ///////////////////////////////////////////
    11473void soclib_xcu_get_status( chdev_t  * icu,
    11574                            lid_t      lid,
     
    11877                            uint32_t * pti_status )
    11978{
    120     // get local ICU segment base address
    121     uint32_t * base = (uint32_t *)GET_PTR( icu->base );
    12279
    123     // read PRIO register
    124         uint32_t prio = base[XCU_PRIO << 5 | lid];
    125 
    126     *wti_status = (prio & 0x4) ? (((prio >> 24) & 0x1F) + 1) : 0;
    127     *hwi_status = (prio & 0x2) ? (((prio >> 16) & 0x1F) + 1) : 0;
    128     *pti_status = (prio & 0x1) ? (((prio >>  8) & 0x1F) + 1) : 0;
    12980}
    13081
    131 /////////////////////////////////////////
    13282void soclib_xcu_send_ipi( xptr_t  icu_xp,
    13383                          lid_t   lid )
    13484{
    135     // get target ICU device cluster and local pointer
    136     cxy_t       cxy_icu = GET_CXY( icu_xp );
    137     chdev_t  * ptr_icu = (chdev_t *)GET_PTR( icu_xp );
    13885
    139     // get extended pointer on target ICU segment base
    140     xptr_t  xp_base = (xptr_t)hal_remote_lwd( XPTR( cxy_icu , &ptr_icu->base ) );
    141 
    142     // get remote ICU segment local pointer
    143         uint32_t  * base = (uint32_t *)GET_PTR( xp_base );
    144 
    145     // send IPI to remote core
    146         hal_remote_sw( XPTR( cxy_icu , &base[XCU_WTI_REG << 5 | lid] ) , 0 );
    14786}
    14887
    149 //////////////////////////////////////////////
    15088uint32_t * soclib_xcu_wti_ptr( chdev_t  * icu,
    15189                               uint32_t   index )
    15290{
    153     uint32_t * base = (uint32_t *)GET_PTR( icu->base );
    15491
    155     return &base[XCU_WTI_REG << 5 | index];
    15692}
Note: See TracChangeset for help on using the changeset viewer.