Changeset 133 for trunk/hal


Ignore:
Timestamp:
Jul 3, 2017, 3:30:03 PM (7 years ago)
Author:
max@…
Message:

style

File:
1 edited

Legend:

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

    r75 r133  
    88 * This file is part of ALMOS-MKH.
    99 *
    10  * ALMOS-MKH.is free software; you can redistribute it and/or modify it
     10 * ALMOS-MKH is free software; you can redistribute it and/or modify it
    1111 * under the terms of the GNU General Public License as published by
    1212 * the Free Software Foundation; version 2.0 of the License.
    1313 *
    14  * ALMOS-MKH.is distributed in the hope that it will be useful, but
     14 * ALMOS-MKH is distributed in the hope that it will be useful, but
    1515 * WITHOUT ANY WARRANTY; without even the implied warranty of
    1616 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     
    2727#include <chdev.h>
    2828
    29 
    30 
    3129////////////////////////////////////
    3230void soclib_xcu_init( chdev_t * icu,
     
    3432{
    3533    // get local ICU segment base address
    36         uint32_t * base = (uint32_t *)GET_PTR( icu->base );
     34    uint32_t * base = (uint32_t *)GET_PTR( icu->base );
    3735
    3836    // disable all IRQs
     
    4947{
    5048    // get XCU segment base address
    51         uint32_t * base = (uint32_t *)GET_PTR( icu->base );
     49    uint32_t * base = (uint32_t *)GET_PTR( icu->base );
    5250
    5351    // 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;
     52    if     ( type == WTI_TYPE ) base[XCU_MSK_WTI_DISABLE << 5 | lid] = mask;
     53    else if( type == HWI_TYPE ) base[XCU_MSK_HWI_DISABLE << 5 | lid] = mask;
     54    else                        base[XCU_MSK_PTI_DISABLE << 5 | lid] = mask;
    5755}
    5856
     
    6462{
    6563    // get XCU segment base address
    66         uint32_t * base = (uint32_t *)GET_PTR( icu->base );
     64    uint32_t * base = (uint32_t *)GET_PTR( icu->base );
    6765
    6866    // 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;
     67    if     ( type == WTI_TYPE ) base[XCU_MSK_WTI_ENABLE << 5 | lid] = mask;
     68    else if( type == HWI_TYPE ) base[XCU_MSK_HWI_ENABLE << 5 | lid] = mask;
     69    else                        base[XCU_MSK_PTI_ENABLE << 5 | lid] = mask;
    7270}
    7371
     
    8078{
    8179    // get XCU segment base address
    82         uint32_t * base = (uint32_t *)GET_PTR( icu->base );
    83  
     80    uint32_t * base = (uint32_t *)GET_PTR( icu->base );
     81
    8482    // 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]; 
     83    *hwi_mask = base[XCU_MSK_HWI << 5 | lid];
     84    *wti_mask = base[XCU_MSK_WTI << 5 | lid];
     85    *pti_mask = base[XCU_MSK_PTI << 5 | lid];
    8886}
    8987
     
    9492{
    9593    // get local ICU segment base address
    96         uint32_t * base = (uint32_t *)GET_PTR( icu->base );
     94    uint32_t * base = (uint32_t *)GET_PTR( icu->base );
    9795
    9896    // write into register
     
    105103{
    106104    // get local ICU segment base address
    107         uint32_t * base = (uint32_t *)GET_PTR( icu->base );
     105    uint32_t * base = (uint32_t *)GET_PTR( icu->base );
    108106
    109107    // read from register
    110         return base[XCU_PTI_ACK << 5 | index];
     108    return base[XCU_PTI_ACK << 5 | index];
    111109}
    112110
     
    118116                            uint32_t * pti_status )
    119117{
    120     // get local ICU segment base address 
     118    // get local ICU segment base address
    121119    uint32_t * base = (uint32_t *)GET_PTR( icu->base );
    122120
    123121    // read PRIO register
    124         uint32_t prio = base[XCU_PRIO << 5 | lid];
     122    uint32_t prio = base[XCU_PRIO << 5 | lid];
    125123
    126124    *wti_status = (prio & 0x4) ? (((prio >> 24) & 0x1F) + 1) : 0;
     
    140138    xptr_t  xp_base = (xptr_t)hal_remote_lwd( XPTR( cxy_icu , &ptr_icu->base ) );
    141139
    142     // get remote ICU segment local pointer 
    143         uint32_t  * base = (uint32_t *)GET_PTR( xp_base );
     140    // get remote ICU segment local pointer
     141    uint32_t  * base = (uint32_t *)GET_PTR( xp_base );
    144142
    145143    // send IPI to remote core
    146         hal_remote_sw( XPTR( cxy_icu , &base[XCU_WTI_REG << 5 | lid] ) , 0 );
     144    hal_remote_sw( XPTR( cxy_icu , &base[XCU_WTI_REG << 5 | lid] ) , 0 );
    147145}
    148146
Note: See TracChangeset for help on using the changeset viewer.