Ignore:
Timestamp:
Oct 30, 2013, 11:03:43 AM (10 years ago)
Author:
alain
Message:

Introducing CP2 registers mnemonics in mips32_registers.h
Supporting 40 bits physical addresses, multi-clusters TSAR
architectures: XICUs are accessed using the physical address
extension mechanism.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/softs/tsar_boot/src/reset.S

    r554 r567  
    8383
    8484    la      k0,     NB_CLUSTERS
    85     li      t3,     0x80000000
    86     divu    t3,     k0
    87     mflo    t4
    88     sll     t4,     1               /* t4 <= cluster_increment = 4G / NB_CLUSTERS */
    89 
    90     mult    t4,     t2
    91     mflo    t5                      /* t5 <= cluster_id * cluster_increment       */
    92  
     85    sll     k1,     t2,     8       /* k1 <= 256*cluster_id                       */
     86    div     k1,     k0              /* LO <= cluster_id * 256 / NB_CLUSTERS       */
     87    mflo    k1                      /* k1 <= physical address extension (8 MSB)   */
     88
    9389    /* Initialization of the count register in the coprocessor 0 */
    9490
    9591    mtc0    zero,   CP0_COUNT
    96 
    97     /* In each cluster, the ICU base address depends on the cluster_id */
    98 
    99     la      t3,     ICU_BASE
    100     addu    t3,     t3,     t5      /* t3 <= ICU_BASE +                       */
    101                                     /*       (cluster_id * cluster_increment) */
    10292
    10393    /**
    10494     * Compute the output index for the Write Triggered Interruption mask.
    10595     * Each processor enable the WTI for its irq output
    106      * Each processor may have IRQ_PER_PROC private irq outputs from
    107      * the XICU
    108      */
    109 
     96     * Each processor may have IRQ_PER_PROC private irq outputs from the XICU
     97     * In each cluster, the ICU base address depends on the cluster_id
     98     */
     99
     100    la      t3,     ICU_BASE
    110101    move    t4,     t1              /* t4 <= local_id                   */
    111102    li      t5,     IRQ_PER_PROC    /* t5 <= IRQ_PER_PROC               */
     
    118109    or      t5,     t3,     t4      /* t5 <= &XICU[MSK_WTI][OUT_INDEX]  */
    119110   
    120     /* Compute and set WTI mask */
     111    /* Compute and set WTI mask using the physical address extension    */
    121112
    122113    li      t4,     1
    123114    sllv    t4,     t4,     t1      /* Set XICU[MSK_WTI][INDEX][local_id] */
    124     sw      t4,     0(t5)           /* XICU[MSK_WTI][INDEX] <= t4         */
     115
     116    mtc2    k1,     CP2_PADDR_EXT   /* set PADDR extension                */
     117    sw      t4,     0(t3)           /* XICU[MSK_WTI][INDEX] <= t4         */
     118    mtc2    zero,   CP2_PADDR_EXT   /* reset PADDR extension              */
    125119
    126120    /**
     
    130124     * t2: cluster id
    131125     * t3: xicu base address
     126     * k1: Paddr extension depending on cluster_id
    132127     *
    133128     * Only processor 0 in cluster 0 executes the boot loader
     
    193188     * t2: cluster id
    194189     * t3: xicu base address
     190     * k1: Paddr extension depending on cluster_id
    195191     */
    196192
     
    200196    wait
    201197
    202     lw      k0,     0(t5)           /* k0 <= XICU[WTI_REG][local_id]  */
     198    /* read the address to jump with a physical read */
     199
     200    mtc2    k1,     CP2_PADDR_EXT   /* set PADDR extension                */
     201    lw      k0,     0(t5)           /* k0 <= XICU[WTI_REG][local_id]      */
     202    mtc2    zero,   CP2_PADDR_EXT   /* reset PADDR extension              */
     203
    203204    jr      k0
    204205    nop
Note: See TracChangeset for help on using the changeset viewer.