Changeset 1042 for trunk/softs/tsar_boot


Ignore:
Timestamp:
May 19, 2016, 3:15:16 PM (8 years ago)
Author:
meunier
Message:
  • Passing BLOCK_SIZE as a Makefile parameter in tsar bootloader
  • Adding a 32-bit version for the bootloader
Location:
trunk/softs/tsar_boot
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/softs/tsar_boot/Makefile

    r1024 r1042  
    66HARD_CONFIG_PATH ?= ../../../giet_vm
    77MAKECMDGOALS     ?= none
    8 BS_PROC    ?= 0
     8BS_PROC          ?= 0
     9USE_32BIT        ?= 0
     10BLOCK_SIZE       ?= 512
    911
    1012MAKECMDGOALS ?= none
     
    2325    DEFS   := "-DRESET_SYSTEM_CLK=$(SYSTEM_CLK)"
    2426endif
    25 DEFS       := -DBS_PROC=$(BS_PROC)
     27DEFS       := -DBS_PROC=$(BS_PROC) -DBLOCK_SIZE=$(BLOCK_SIZE) -DUSE_32BIT=$(USE_32BIT)
    2628
    2729LD         := mipsel-unknown-elf-ld
  • trunk/softs/tsar_boot/drivers/reset_tty.c

    r992 r1042  
    3838{
    3939    iowrite32( &tty_address[TTY_WRITE], (unsigned int)c );
    40     if (c == '\n') reset_putc( '\r' );
    4140}
    4241
  • trunk/softs/tsar_boot/include/defs.h

    r949 r1042  
    3030 */
    3131
    32 #define BLOCK_SIZE            512   /* bytes */
     32/* BLOCK_SIZE is now defined in the makefile */
    3333#define CACHE_LINE_SIZE       64    /* bytes */
    3434
  • trunk/softs/tsar_boot/src/reset.S

    r949 r1042  
    9292    srl     t2,     t0,     P_WIDTH          /* t2 <= cluster_xy            */
    9393
    94     /* All processors initialise the count register in CP0 */
     94    /* All processors initialize the count register in CP0 */
    9595
    9696    mtc0    zero,   CP0_COUNT
    9797
    98     /*
     98#if USE_32BIT
     99    /*** VERSION 1 : 32 bits ***/
     100
     101    /*
     102     * If the addresses are 32-bit wide, we need to compute the address
     103     * if the XICU for each cluster
    99104     * All processors enable the WTI for XICU
    100105     * Each processor may have IRQ_PER_PROC irq outputs from the XICU
    101106     * In each cluster, the XICU base address depends on the cluster_xy
    102107     */
    103 
     108    la      t3,     SEG_XCU_BASE      /* t3 <= ICU base address             */
     109    li      t4,     1                 /* t4 <= 1                            */
     110    sll     t4,     t4,     X_WIDTH   /* t4 <= 1 << X_WIDTH                 */
     111    li      t5,     1                 /* t5 <= 1                            */
     112    sll     t5,     t5,     Y_WIDTH   /* t5 <= 1 << Y_WIDTH                 */
     113    multu   t4,     t5                /* X_WIDTH * Y_WIDTH                  */
     114    mflo    t4                        /* t4 <= X_WIDTH * Y_WIDTH            */
     115    lui     t5,     0x8000            /* t5 <= 0x80000000                   */
     116    divu    t5,     t4                /* (Address increment per cluster) / 2*/
     117    mflo    t4                        /* t4 <= Increment / 2                */
     118    sll     t4,     t4,     1         /* t4 <= Address increment per clus.  */
     119    mult    t4,     t2                /* Cluster increment * Cluster num.   */
     120    mflo    t4                        /* Cluster base address               */
     121    addu    t3,     t3,     t4        /* t3 <= XICU base address in clus.   */
     122
     123    move    t4,     t1                /* t4 <= local_id                     */
     124    li      t5,     IRQ_PER_PROCESSOR /* t5 <= IRQ_PER_PROCESSOR            */
     125    multu   t4,     t5
     126    mflo    t6                       /* t6 <= IRQ_PER_PROC * local_id       */
     127    sll     t4,     t6,     2        /* t4 <= OUT_INDEX = t6 * 4            */
     128
     129    li      t5,     (0xC << 7)       /* t5 <= FUNC      = XICU_MSK_WTI      */
     130    or      t4,     t4,     t5       /* t4 <= FUNC | INDEX | 00             */
     131    or      t5,     t3,     t4       /* t5 <= &XICU[MSK_WTI][OUT_INDEX]     */
     132
     133    /* All processors set WTI mask */
     134
     135    li      t4,     1
     136    sllv    t4,     t4,     t1       /* Set XICU[MSK_WTI][INDEX][local_id]  */
     137    sw      t4,     0(t5)            /* XICU[MSK_WTI][INDEX] <= t4          */
     138#else
     139    /*** VERSION 2 : 40 bits ***/
     140
     141    /*
     142     * All processors enable the WTI for XICU
     143     * Each processor may have IRQ_PER_PROC irq outputs from the XICU
     144     * In each cluster, the XICU base address depends on the cluster_xy
     145     */
    104146    la      t3,     SEG_XCU_BASE      /* t3 <= ICU base address             */
    105147    move    t4,     t1                /* t4 <= local_id                     */
     
    121163    sw      t4,     0(t5)            /* XICU[MSK_WTI][INDEX] <= t4          */
    122164    mtc2    zero,   CP2_PADDR_EXT    /* reset PADDR extension               */
    123 
    124     /*
    125      * Only processor 0 in cluster 0 loads and executes the boot-loader
     165#endif
     166
     167    /*
     168     * Only the bootstrap processor loads and executes the boot-loader
    126169     * We have:
    127170     * t0: global pid
    128171     * t1: local pid
    129172     * t2: cluster_xy
    130      * t3: xicu physical base address in cluster 0
    131      */
    132 
    133     bne     zero,   t0,     _reset_wait
    134     nop
    135 
    136     /* Processor 0 initializes stack pointer */
     173     * t3: xicu physical base address in bootstrap cluster
     174     */
     175
     176    li      t4,     BS_PROC
     177    bne     t4,     t0,     _reset_wait
     178    nop
     179
     180    /* Bootstrap Processor initializes stack pointer */
    137181
    138182    la      k0,     _stack
     
    140184    addu    sp,     k0,     k1       /* P0 stack from base to (base + size) */
    141185
    142     /* Processor 0 displays version for this reset code */
     186    /* Bootstrap Processor displays version for this reset code */
    143187
    144188    la      a0,     versionstr
     
    146190    nop
    147191
    148     /* Processor 0 initializes the block device */
     192    /* Bootstrap Processor initializes the block device */
    149193
    150194    jal     reset_ioc_init
     
    152196
    153197    /*
    154      * Processor 0 jumps to the reset_elf_loader routine passing as argument
     198     * Bootstrap Processor jumps to the reset_elf_loader routine passing as argument
    155199     * the block number in which is loaded the .elf file
    156200     */
     
    161205
    162206    /*
    163      * Processor O jumps to the entry address defined in the .elf file, and
     207     * Bootstrap Processor jumps to the entry address defined in the .elf file, and
    164208     * returned by reset_elf_loader function.
    165209     * First argument is pointer to the preloader function vectors other
Note: See TracChangeset for help on using the changeset viewer.