Changeset 759 for trunk


Ignore:
Timestamp:
Jul 24, 2014, 4:38:36 PM (10 years ago)
Author:
cfuguet
Message:

tsar_boot: preloader ldscript is automatically generated

  • Stack for processor 0 is allocated at the end of the cluster(0,0) ram segment:

SEG_RAM_BASE + SEG_RAM_SIZE - RESET_STACK_SIZE

  • code base is equal to the SEG_ROM_BASE constant defined in the hard_config.h file.
Location:
trunk/softs/tsar_boot
Files:
1 added
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/softs/tsar_boot/Makefile

    r758 r759  
    1 # let the user have a default configuration (ie for PLATFORM_DIR)
     1# let the user have a default configuration (ie for HARD_CONFIG_PATH)
    22-include ./build.mk
    33
     
    88
    99ifneq ($(MAKECMDGOALS),$(filter $(MAKECMDGOALS),clean distclean clean-doc doc))
    10   ifndef PLATFORM_DIR
    11     $(error please define PLATFORM_DIR 'make PLATFORM_DIR=foo')
     10  ifndef HARD_CONFIG_PATH
     11    $(error please define HARD_CONFIG_PATH 'make HARD_CONFIG_PATH=foo')
    1212  else
    13     $(info Make for $(PLATFORM_DIR))
     13    $(info Make for $(HARD_CONFIG_PATH))
    1414  endif
    1515endif
     
    2626AR         := mipsel-unknown-elf-ar
    2727RM         := rm -rf
     28SED        := sed
    2829ECHO       := @echo
    2930MKDIR      := mkdir
     
    3839# =============================================================================
    3940
    40 INCLUDE    += -I. -Iinclude -Idrivers -I$(PLATFORM_DIR)
     41INCLUDE    += -I. -Iinclude -Idrivers -I$(HARD_CONFIG_PATH)
    4142
    4243# =============================================================================
     
    108109        ./version.sh > $@
    109110
    110 $(TARGET): $(BUILD_DIR) $(OBJS) $(PLATFORM_DIR)/ldscript $(BUILD_DIR)/platform.ld $(BUILD_DIR)/$(DRV_LIB)
     111$(BUILD_DIR)/preloader.ld: preloader.ld.in
     112        $(ECHO) "[   CC    ]     $(notdir $<)"
     113        $(CC) -x c $(INCLUDE) -E $< | $(SED) -e '/#/d' -e '/^[\s\t]*$$/d' > $@
     114
     115$(TARGET): $(BUILD_DIR) $(OBJS) $(BUILD_DIR)/preloader.ld $(BUILD_DIR)/platform.ld $(BUILD_DIR)/$(DRV_LIB)
    111116        $(ECHO) "[   LD    ]     $@"
    112         $(LD) -o $@ -T $(PLATFORM_DIR)/ldscript $(OBJS) -L$(BUILD_DIR) -ldrivers
     117        $(LD) -o $@ -T $(BUILD_DIR)/preloader.ld $(OBJS) -L$(BUILD_DIR) -ldrivers
    113118        $(DU) -D $@ > $@.txt
    114119
     
    123128endif
    124129
    125 $(BUILD_DIR)/platform.dtb: $(PLATFORM_DIR)/$(DTS)
     130$(BUILD_DIR)/platform.dtb: $(HARD_CONFIG_PATH)/$(DTS)
    126131        $(ECHO) "[   DTC   ]     $(notdir $<)"
    127132        ${DTC} -O dtb -o $@ $< &> /dev/null
  • trunk/softs/tsar_boot/README

    r758 r759  
    1212driver/     Drivers source files and headers
    1313
    14 conf/       Platform specific files and ldscript
     14conf/       Platform specific files
    1515            For each platform, we must define a new directory.
    1616            Mandatory files:
     
    1818              - hard_config.h (can be generated using giet-vm genmap tool)
    1919
    20               - ldscript
     20                This file contains all physical segments addresses and sizes of the
     21                hardware platform. It also contains other configuration definitions
     22                as the disk controller type, mesh size, etc. Examples can be found
     23                in the conf/ directory.
    2124
    2225            Optional files:
     
    2730            Mandatory arguments:
    2831
    29               - PLATFORM_DIR=<platform_dir>
     32              - HARD_CONFIG_PATH=<platform_dir>
    3033
    31                 Defines the directory where to find the plateform specific
    32                 files
     34                Defines the directory where to find the hard_config.h file
    3335
    3436           Optional arguments:
     
    4850                Platform device tree (by default is platform.dts)
    4951
     52Important characteristics of this preloader:
     53
     54  - Processor 0 performs loading of Operating System Boot Loader which must
     55    be an ELF file located at the third block of the disk.
     56
     57  - Other processors wait to be waken up through an interruption generated
     58    from a XICU mailbox. Each processor other than 0 has its own mailbox
     59    in the local XICU.
     60
     61  - Stack allocation is only made for processor 0. The loaded Operating System
     62    boot loader or kernel must perform stack allocation for other processors.
     63
     64  - Stack for processor 0 is allocated at the end of RAM segment in the
     65    cluster (0,0).
     66
    5067Examples:
    5168
    52     make PLATFORM_DIR=<platform_dir> USE_DT=0
     69    make HARD_CONFIG_PATH=<platform_dir> USE_DT=0
    5370
    5471        Compile for <platform_dir> and do not compile device tree file
    5572
    56     make PLATFORM_DIR=<platform_dir> DTS=platform_fpga.dts SYSTEM_CLK=25000
     73    make HARD_CONFIG_PATH=<platform_dir> DTS=platform_fpga.dts SYSTEM_CLK=25000
    5774
    5875        Compile for <platform_dir> and compile the 'platform_dpga.dts'
    5976        device tree file. System clock frequency is 25 MHz
    6077
    61     make PLATFORM_DIR=<platform_conf> SYSTEM_CLK=25000
     78    make HARD_CONFIG_PATH=<platform_conf> SYSTEM_CLK=25000
    6279
    6380        Compile for <platform_dir> and compile the 'platform.dts'
Note: See TracChangeset for help on using the changeset viewer.