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.h

    r320 r437  
    77// The xcu_driver.c and xcu_driver.h files are part ot the GIET-VM nano-kernel.
    88// This driver supports the SoCLib vci_xicu, that is a vectorised interrupt
    9 // controler supporting IPI (Inter Processor Interrupts) and integrated timers.
     9// controler supporting three types of interrupts:
     10//
     11// - HWI : HardWare Interrupts (from hardware peripherals)
     12// - PTI : Programmable Timer Interrupts (contained in the XCU component)
     13// - WTI : Write Trigered Interrupts (from software, or from a PIC controller)
    1014//
    1115// It can exist several interrupt controller unit in the architecture
    12 // (one per cluster), and each one can contain several channels.
     16// (one per cluster), and each one can contain several channels:
    1317// The number of XICU channels is equal to NB_PROCS_MAX, because there is
    1418// one private XICU channel per processor in a cluster.
    15 ////////////////////////////////////////////////////////////////////////////////
     19//
    1620// The virtual base address of the segment associated to the component is:
    1721//
    18 //      seg_xcu_base + cluster_xy * vseg_cluster_increment
     22//      vbase = SEG_XCU_BASE + cluster_xy * PERI_CLUSTER_INCREMENT
    1923//
    20 // The seg_xcu_base and vseg_cluster_increment values must be defined
    21 // in giet_vsegs.ld file.
     24// The SEG_XCU_BSE  and PERI_CLUSTER_INCREMENT values must be defined
     25// in the hard_config.h file.
    2226////////////////////////////////////////////////////////////////////////////////
    2327
     
    5660#define XCU_REG(func, index) (((func)<<5)|(index))
    5761 
    58 ///////////////////////////////////////////////////////////////////////////////////
    59 // XICU access functions
    60 ///////////////////////////////////////////////////////////////////////////////////
     62////////////////////////////////////////////////////////////////////////////////
     63//                           access functions
     64////////////////////////////////////////////////////////////////////////////////
    6165
     66////////////////////////////////////////////////////////////////////////////////
     67// This function set the mask register for the IRQ type defined by "irq_type",
     68// and for the channel identified by the "cluster_xy" and "channel" arguments.
     69// All '1' bits are set / all '0' bits are not modified.
     70////////////////////////////////////////////////////////////////////////////////
    6271extern void _xcu_set_mask( unsigned int cluster_xy,
    6372                           unsigned int channel, 
     
    6574                           unsigned int irq_type );
    6675
     76////////////////////////////////////////////////////////////////////////////////
     77// This function returns the index and the type of the highest priority
     78// - active PTI (Timer Interrupt), then
     79// - active HWI (Hardware Interrupt), then
     80// - active WTI (Software Interrupt)
     81////////////////////////////////////////////////////////////////////////////////
    6782extern void _xcu_get_index( unsigned int   cluster_xy,
    6883                            unsigned int   channel,   
     
    7085                            unsigned int * irq_type );
    7186
     87////////////////////////////////////////////////////////////////////////////////
     88// This function writes the "wdata" value in the mailbox defined
     89// by the "cluster_xy" and "wti_index" arguments.
     90////////////////////////////////////////////////////////////////////////////////
    7291extern void _xcu_send_wti( unsigned int cluster_xy,
    7392                           unsigned int wti_index,
    7493                           unsigned int wdata );
    7594
     95////////////////////////////////////////////////////////////////////////////////
     96// This function returns the value contained in a WTI mailbox defined by
     97// the cluster_xy and "wti_index" arguments. This value is written in
     98// the "value" argument, and the corresponding WTI is acknowledged.
     99////////////////////////////////////////////////////////////////////////////////
    76100extern void _xcu_get_wti_value( unsigned int   cluster_xy,
    77101                                unsigned int   wti_index,
    78102                                unsigned int * value );
    79103
     104////////////////////////////////////////////////////////////////////////////////
     105// This function returns the address of a WTI mailbox defined by
     106// the "wti_index" argument, in the unsigned int "address" argument.
     107// It is used by the GIET to configurate the IOPIC component.
     108// There is no access to a specific XCU component in a specific cluster.
     109////////////////////////////////////////////////////////////////////////////////
    80110extern void _xcu_get_wti_address( unsigned int   wti_index,
    81111                                  unsigned int * address );
    82112
     113////////////////////////////////////////////////////////////////////////////////
     114// This function activates a timer contained in XCU by writing in the
     115// proper register the period value.
     116////////////////////////////////////////////////////////////////////////////////
    83117extern void _xcu_timer_start( unsigned int cluster_xy,
    84118                              unsigned int pti_index,
    85119                              unsigned int period );
    86120
     121//////////////////////////////////////////////////////////////////////////////
     122// This function desactivates a timer in XCU component
     123// by writing in the proper register.
     124//////////////////////////////////////////////////////////////////////////////
    87125extern void _xcu_timer_stop( unsigned int cluster_xy,
    88126                             unsigned int pti_index );
    89127
     128//////////////////////////////////////////////////////////////////////////////
     129// This function acknowlegge a timer interrupt in XCU
     130// component by reading in the proper XCU register.
     131// It can be used by both the isr_switch() for a "system" timer,
     132// or by the _isr_timer() for an "user" timer.
     133//////////////////////////////////////////////////////////////////////////////
    90134extern unsigned int _xcu_timer_reset_irq( unsigned int cluster_xy,
    91135                                          unsigned int pti_index );
    92136
     137//////////////////////////////////////////////////////////////////////////////
     138// This function resets a timer counter. To do so, we re-write the period
     139// in the proper register, what causes the count to restart.
     140// The period value is read from the same (TIMER_PERIOD) register,
     141// this is why in appearance we do nothing useful (read a value
     142// from a register and write this value in the same register).
     143// This function is called during a context switch (user or preemptive)
     144/////////////////////////////////////////////////////////////////////////////
    93145extern void _xcu_timer_reset_cpt( unsigned int cluster_xy,
    94146                                  unsigned int pti_index );
    95 
    96 ///////////////////////////////////////////////////////////////////////////////////
    97147
    98148#endif
Note: See TracChangeset for help on using the changeset viewer.