Ignore:
Timestamp:
Nov 3, 2014, 10:53:00 AM (10 years ago)
Author:
alain
Message:

Introducing dynamic allocation of peripheral channel(TTY, NIC, TIM, CMA)
Removint the ICU driver : ICU component not supported anymore.
Removing the FBF driver.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_drivers/xcu_driver.c

    r395 r437  
    44// Author   : alain greiner
    55// Copyright (c) UPMC-LIP6
    6 ///////////////////////////////////////////////////////////////////////////////////
    7 // This peripheral is replicated in all clusters containing processors.
    8 //
    9 // SEG_XCU_BASE and PERI_CLUSTER_INCREMENT must be defined in hard_config.h file.
    106///////////////////////////////////////////////////////////////////////////////////
    117
     
    8581}
    8682
    87 ////////////////////////////////////////////////////////////////////////////////
    88 // This function set the mask register for the IRQ type defined by "irq_type",
    89 // and for the channel identified by the "cluster_xy" and "channel" arguments.
    90 // All '1' bits are set / all '0' bits are not modified.
    91 ////////////////////////////////////////////////////////////////////////////////
     83////////////////////////////////////////////
    9284void _xcu_set_mask( unsigned int cluster_xy,
    9385                    unsigned int channel, 
     
    109101    else
    110102    {
    111         _printf("[GIET ERROR] _xcu_set_mask() receives illegal IRQ type\n");
     103        _puts("[GIET ERROR] _xcu_set_mask() receives illegal IRQ type\n");
    112104        _exit();
    113105    }
     
    116108
    117109#else
    118     _printf("[GIET ERROR] _xcu_set_mask() should not be used if USE_XCU not set\n");
    119     _exit();
    120 #endif
    121 }
    122 
    123 ////////////////////////////////////////////////////////////////////////////////
    124 // This function returns the index and the type of the highest priority
    125 // - active PTI (Timer Interrupt), then
    126 // - active HWI (Hardware Interrupt), then
    127 // - active WTI (Software Interrupt)
    128 // As the hardware can define more than one IRQ per processor, but the GIET
    129 // use only one, channel = lpid * IRQ_PER_PROCESSOR.
    130 ////////////////////////////////////////////////////////////////////////////////
     110    _puts("[GIET ERROR] _xcu_set_mask() should not be used if USE_XCU not set\n");
     111    _exit();
     112#endif
     113}
     114
     115/////////////////////////////////////////////
    131116void _xcu_get_index( unsigned int cluster_xy,
    132117                     unsigned int channel,   
     
    170155 
    171156#else
    172     _printf("[GIET ERROR] _xcu_get_index should not be used if USE_XCU is not set\n");
    173     _exit();
    174 #endif
    175 }
    176 
    177 ////////////////////////////////////////////////////////////////////////////////
    178 // This function writes the "wdata" value in the mailbox defined
    179 // by the "cluster_xy" and "wti_index" arguments.
    180 ////////////////////////////////////////////////////////////////////////////////
     157    _puts("[GIET ERROR] _xcu_get_index should not be used if USE_XCU is not set\n");
     158    _exit();
     159#endif
     160}
     161
     162////////////////////////////////////////////
    181163void _xcu_send_wti( unsigned int cluster_xy,
    182164                    unsigned int wti_index,
     
    194176
    195177#else
    196     _printf("[GIET ERROR] _xcu_send_wti() should not be used if USE_XCU is not set\n");
     178    _puts("[GIET ERROR] _xcu_send_wti() should not be used if USE_XCU is not set\n");
    197179    _exit();
    198180#endif
    199181}
    200182
    201 ////////////////////////////////////////////////////////////////////////////////
    202 // This function returns the value contained in a WTI mailbox defined by
    203 // the cluster_xy and "wti_index" arguments. This value is written in
    204 // the "value" argument, and the corresponding WTI is acknowledged.
    205 // returns 0 if success, > 0 if error.
    206 ////////////////////////////////////////////////////////////////////////////////
     183///////////////////////////////////////////////////
    207184void _xcu_get_wti_value( unsigned int   cluster_xy,
    208185                         unsigned int   wti_index,
     
    220197
    221198#else
    222     _printf("[GIET ERROR] in _xcu_get_wti_value() USE_XCU is not set\n");
    223     _exit();
    224 #endif
    225 }
    226 
    227 ////////////////////////////////////////////////////////////////////////////////
    228 // This function returns the address of a WTI mailbox defined by
    229 // the "wti_index" argument, in the unsigned int "address" argument.
    230 // It is used by the GIET to configurate the IOPIC component.
    231 // There is no access to a specific XCU component in a specific cluster.
    232 // returns 0 if success, > 0 if error.
    233 ////////////////////////////////////////////////////////////////////////////////
     199    _puts("[GIET ERROR] in _xcu_get_wti_value() USE_XCU is not set\n");
     200    _exit();
     201#endif
     202}
     203
     204////////////////////////////////////////////////////
    234205void _xcu_get_wti_address( unsigned int   wti_index,
    235206                           unsigned int * address )
     
    241212
    242213#else
    243     _printf("[GIET ERROR] in _xcu_get_wti_address() USE_XCU is not set\n");
    244     _exit();
    245 #endif
    246 }
    247 
    248 ////////////////////////////////////////////////////////////////////////////////
    249 // This function activates a timer contained in XCU by writing in the
    250 // proper register the period value.
    251 ////////////////////////////////////////////////////////////////////////////////
     214    _puts("[GIET ERROR] in _xcu_get_wti_address() USE_XCU is not set\n");
     215    _exit();
     216#endif
     217}
     218
     219///////////////////////////////////////////////
    252220void _xcu_timer_start( unsigned int cluster_xy,
    253221                       unsigned int pti_index,
     
    264232
    265233#else
    266     _printf("[GIET ERROR] in _xcu_timer_start() USE_XCU is not set\n");
    267     _exit();
    268 #endif
    269 }
    270 
    271 //////////////////////////////////////////////////////////////////////////////
    272 // This function desactivates a timer in XCU component
    273 // by writing in the proper register.
    274 //////////////////////////////////////////////////////////////////////////////
     234    _puts("[GIET ERROR] in _xcu_timer_start() USE_XCU is not set\n");
     235    _exit();
     236#endif
     237}
     238
     239//////////////////////////////////////////////
    275240void _xcu_timer_stop( unsigned int cluster_xy,
    276241                      unsigned int pti_index)
     
    286251
    287252#else
    288     _printf("[GIET ERROR] in _xcu_timer_stop() USE_XCU is not set\n");
    289     _exit();
    290 #endif
    291 }
    292 
    293 //////////////////////////////////////////////////////////////////////////////
    294 // This function acknowlegge a timer interrupt in XCU
    295 // component by reading in the proper XCU register.
    296 // It can be used by both the isr_switch() for a "system" timer,
    297 // or by the _isr_timer() for an "user" timer.
    298 //////////////////////////////////////////////////////////////////////////////
     253    _puts("[GIET ERROR] in _xcu_timer_stop() USE_XCU is not set\n");
     254    _exit();
     255#endif
     256}
     257
     258///////////////////////////////////////////////////////////
    299259unsigned int _xcu_timer_reset_irq( unsigned int cluster_xy,
    300260                                   unsigned int pti_index )
     
    311271
    312272#else
    313     _printf("[GIET ERROR] in _xcu_timer_reset_irq() USE_XCU is not set\n");
     273    _puts("[GIET ERROR] in _xcu_timer_reset_irq() USE_XCU is not set\n");
    314274    _exit();
    315275    return 0;
     
    317277}
    318278
    319 //////////////////////////////////////////////////////////////////////////////
    320 // This function resets a timer counter. To do so, we re-write the period
    321 // in the proper register, what causes the count to restart.
    322 // The period value is read from the same (TIMER_PERIOD) register,
    323 // this is why in appearance we do nothing useful (read a value
    324 // from a register and write this value in the same register).
    325 // This function is called during a context switch (user or preemptive)
    326 /////////////////////////////////////////////////////////////////////////////
     279///////////////////////////////////////////////////
    327280void _xcu_timer_reset_cpt( unsigned int cluster_xy,
    328281                           unsigned int pti_index )
     
    343296
    344297#else
    345     _printf("[GIET ERROR] in _xcu_timer_reset_cpt() USE_XCU is not set\n");
     298    _puts("[GIET ERROR] in _xcu_timer_reset_cpt() USE_XCU is not set\n");
    346299    _exit();
    347300#endif
Note: See TracChangeset for help on using the changeset viewer.