Ignore:
Timestamp:
Jan 30, 2014, 5:32:13 PM (11 years ago)
Author:
cfuguet
Message:

Modifications in GIET_VM:

  • Supporting platforms with more than one IRQ per processor from the XICU.

When this is the case, the IRQ per processor can be signalled
by the XCU peripheric number of channels on the XML file.

The xml_parser will generate a constant on the hard_config.h
file, called IRQ_PER_PROCESSOR and this constant will be use
by the GIET_VM to create accordingly the irq masks on the
ICU

Location:
soft/giet_vm/giet_drivers
Files:
2 edited

Legend:

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

    r275 r281  
    5454////////////////////////////////////////////////////////////////////////////////
    5555//     _xcu_set_mask()
    56 // This function set the mask register for the XICU channel identified
    57 // by the cluster index and the processor index.
     56// This function set the mask register for the XICU channel identified by the
     57// cluster index and the processor index multiplied by the number of IRQ per
     58// processor.
    5859// All '1' bits are set / all '0' bits are not modified.
    5960// Returns 0 if success, > 0 if error.
    6061////////////////////////////////////////////////////////////////////////////////
    6162unsigned int _xcu_set_mask( unsigned int cluster_xy,
    62                             unsigned int proc_id,
     63                            unsigned int irq_index,
    6364                            unsigned int value,
    6465                            unsigned int irq_type )
     
    6768    unsigned int x = cluster_xy >> Y_WIDTH;
    6869    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
    69     if (x >= X_SIZE)             return 1;
    70     if (y >= Y_SIZE)             return 1;
    71     if (proc_id >= NB_PROCS_MAX) return 1;
     70    if (x >= X_SIZE)                                     return 1;
     71    if (y >= Y_SIZE)                                     return 1;
     72    if (irq_index >= (NB_PROCS_MAX * IRQ_PER_PROCESSOR)) return 1;
    7273
    7374#if USE_XICU
     
    8081    else if (irq_type == IRQ_TYPE_SWI) func = XICU_MSK_WTI_ENABLE;
    8182    else                               func = XICU_MSK_HWI_ENABLE;
    82     xcu_address[XICU_REG(func,proc_id)] = value;
     83    xcu_address[XICU_REG(func,irq_index)] = value;
    8384    return 0;
    8485#else
     
    9697// - active PTI (Timer Interrupt), or
    9798// - active SWI (Software Interrupt).
    98 // The ICU channel is identified by the cluster index and the processor index.
     99// The ICU channel is identified by the cluster index and the processor index
     100// multiplied by the number of IRQ per processor.
    99101// Returns 0 if success, > 0 if error.
    100102////////////////////////////////////////////////////////////////////////////////
    101103unsigned int _xcu_get_index( unsigned int cluster_xy,
    102                              unsigned int proc_id,
     104                             unsigned int irq_index,
    103105                             unsigned int * buffer)
    104106{
     
    106108    unsigned int x = cluster_xy >> Y_WIDTH;
    107109    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
    108     if (x >= X_SIZE)             return 1;
    109     if (y >= Y_SIZE)             return 1;
    110     if (proc_id >= NB_PROCS_MAX) return 1;
     110    if (x >= X_SIZE)                                     return 1;
     111    if (y >= Y_SIZE)                                     return 1;
     112    if (irq_index >= (NB_PROCS_MAX * IRQ_PER_PROCESSOR)) return 1;
    111113
    112114#if USE_XICU
     
    115117        (cluster_xy * (unsigned int)&vseg_cluster_increment));
    116118
    117     unsigned int prio = xcu_address[XICU_REG(XICU_PRIO, proc_id)];
     119    unsigned int prio = xcu_address[XICU_REG(XICU_PRIO,irq_index)];
    118120    unsigned int pti_ok = (prio & 0x00000001);
    119121    unsigned int hwi_ok = (prio & 0x00000002);
     
    140142// It writes the "wdata" value in the mailbox defined by the cluster index
    141143// and the processor index.
     144// Giet-VM supports at most NB_PROCS_MAX mailboxes:
     145// (0 <= wti_index <= NB_PROCS_MAX-1)
    142146// Returns 0 if success, > 0 if error.
    143147////////////////////////////////////////////////////////////////////////////////
    144148unsigned int _xcu_send_ipi( unsigned int cluster_xy,
    145                             unsigned int proc_id,
     149                            unsigned int wti_index,
    146150                            unsigned int wdata )
    147151{
     
    149153    unsigned int x = cluster_xy >> Y_WIDTH;
    150154    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
    151     if (x >= X_SIZE)             return 1;
    152     if (y >= Y_SIZE)             return 1;
    153     if (proc_id >= NB_PROCS_MAX) return 1;
     155    if (x >= X_SIZE)               return 1;
     156    if (y >= Y_SIZE)               return 1;
     157    if (wti_index >= NB_PROCS_MAX) return 1;
    154158
    155159#if USE_XICU
     
    158162        (cluster_xy * (unsigned int)&vseg_cluster_increment));
    159163
    160     xcu_address[XICU_REG(XICU_WTI_REG, proc_id)] = wdata;
     164    xcu_address[XICU_REG(XICU_WTI_REG,wti_index)] = wdata;
    161165    return 0;
    162166#else
  • soft/giet_vm/giet_drivers/xcu_driver.h

    r263 r281  
    4545
    4646extern unsigned int _xcu_get_index( unsigned int cluster_xy,
    47                                     unsigned int proc_id,
     47                                    unsigned int irq_index,
    4848                                    unsigned int * buffer );
    4949
    5050extern unsigned int _xcu_set_mask( unsigned int cluster_xy,
    51                                    unsigned int proc_id,
     51                                   unsigned int irq_index,
    5252                                   unsigned int mask,
    5353                                   unsigned int is_timer );
    5454
    5555extern unsigned int _xcu_send_ipi( unsigned int cluster_xy,
    56                                    unsigned int proc_id,
     56                                   unsigned int wti_index,
    5757                                   unsigned int wdata );
    5858
    5959extern unsigned int _xcu_timer_start( unsigned int cluster_xy,
    60                                       unsigned int proc_id,
     60                                      unsigned int pti_index,
    6161                                      unsigned int period );
    6262
    6363extern unsigned int _xcu_timer_stop( unsigned int cluster_xy,
    64                                      unsigned int proc_id );
     64                                     unsigned int pti_index );
    6565
    6666extern unsigned int _xcu_timer_reset_irq( unsigned int cluster_xy,
    67                                           unsigned int proc_id );
     67                                          unsigned int pti_index );
    6868
    6969extern unsigned int _xcu_timer_reset_cpt( unsigned int cluster_xy,
    70                                           unsigned int proc_id );
     70                                          unsigned int pti_index );
    7171
    7272///////////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.