Changeset 801 for trunk


Ignore:
Timestamp:
Sep 12, 2014, 3:10:03 PM (10 years ago)
Author:
cfuguet
Message:

tsar_boot: Using P_WIDTH constant to get lpid from CP0 EBASE

Location:
trunk/softs/tsar_boot
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/softs/tsar_boot/Makefile

    r794 r801  
    115115$(BUILD_DIR)/preloader.ld: preloader.ld.in
    116116        $(ECHO) "[   CC    ]     $(notdir $<)"
    117         $(CC) -DUSE_DT=$(USE_DT) -x c $(INCLUDE) -E $< | $(SED) -e '/#/d' -e '/^[\s\t]*$$/d' > $@
     117        $(CC) -x c -P -E -DUSE_DT=$(USE_DT) $(INCLUDE) $< -o $@
    118118
    119119$(TARGET): $(BUILD_DIR) $(OBJS) $(BUILD_DIR)/preloader.ld $(BUILD_DIR)/$(DRV_LIB)
  • trunk/softs/tsar_boot/conf/platform_de2_115_fpga/hard_config.h

    r798 r801  
    88#define X_WIDTH                4
    99#define Y_WIDTH                4
     10#define P_WIDTH                1
    1011#define X_IO                   0
    1112#define Y_IO                   0
  • trunk/softs/tsar_boot/conf/platform_tsar_generic_iob/hard_config.h

    r798 r801  
    1010#define X_WIDTH                4
    1111#define Y_WIDTH                4
     12#define P_WIDTH                2
    1213#define X_IO                   0
    1314#define Y_IO                   0
  • trunk/softs/tsar_boot/include/defs.h

    r758 r801  
    3232 */
    3333
    34 #ifndef NB_PROCS_MAX
    35 #   error "NB_PROCS_MAX constant must be defined in hard_config.h"
     34#ifndef P_WIDTH
     35#   error "P_WIDTH constant must be defined in the hard_config.h file"
    3636#endif
    3737
  • trunk/softs/tsar_boot/src/reset.S

    r758 r801  
    7979    mtc0    k0,     CP0_STATUS
    8080
    81     /* All processors compute pid, lpid, cluster_xy */
     81    /*
     82     * All processors compute gpid, lpid, cluster_xy
     83     * gpid = ebase[9:0] = X_WIDTH : Y_WIDTH : P_WIDTH
     84     *                        x         y       lpid
     85     * X, Y and LPID fields are left-aligned
     86     */
    8287
    8388    mfc0    k0,     CP0_EBASE
    84     andi    t0,     k0,     0x3FF    /* t0 <= pid (at most 1024 procs)      */
    85 
    86     move    t3,     t0
    87 
    88     la      k0,     NB_PROCS_MAX     /* k0 <= # of processors per cluster   */
    89     divu    t3,     k0
    90     mfhi    t1                       /* t1 <= lpid       = pid % NB_PROCS   */
    91     mflo    t2                       /* t2 <= cluster_xy = pid / NB_PROCS   */
     89    andi    t0,     k0,     0x3FF            /* t0 <= gpid (<= 1024 procs)  */
     90    andi    t1,     t0,     ((1<<P_WIDTH)-1) /* t1 <= lpid                  */
     91    srl     t2,     t0,     P_WIDTH          /* t2 <= cluster_xy            */
    9292
    9393    /* All processors initialise the count register in CP0 */
Note: See TracChangeset for help on using the changeset viewer.