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

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.