Changeset 554


Ignore:
Timestamp:
Oct 22, 2013, 8:15:05 PM (10 years ago)
Author:
bouyer
Message:

Make sure the boot loader won't try to write to the ROM.
Store read-write data in BSS along with the stack at seg_stack_base.

Location:
trunk/softs/tsar_boot
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/softs/tsar_boot/README.txt

    r425 r554  
    5454             We define two segments:
    5555                seg_stack_base: Base address of the stack used by processor 0
    56                 during the boot process.
     56                during the boot process. read-write data and bss will also
     57                be there.
    5758
    58                 seg_boot_base: Base address of the code and data defined for
    59                 this loader
     59                seg_boot_base: Base address of the code and read-only data
     60                defined for this loader
    6061           
    6162Makefile    Makefile for compile the boot loader.
  • trunk/softs/tsar_boot/conf/platform_fpga_de2-115/ldscript

    r368 r554  
    1919        *(.boot)
    2020        *(.reset)
     21        *(.rodata)
     22        *(.rodata.*)
     23        . = ALIGN(0x4);
     24        dtb_addr = .;
     25        INCLUDE "build/platform.ld";
    2126    }
    2227
     28    . = seg_stack_base;
    2329    .data ALIGN(0x4) : {
    24         *(.reset_data)
    25         . = ALIGN(0x4);
    26         dtb_addr = .;
    27         INCLUDE "build/platform.ld";
     30        *(.data)
     31        *(.bss)
    2832    }
    2933}
  • trunk/softs/tsar_boot/conf/platform_tsarv4_mono_mmu_ioc/ldscript

    r413 r554  
    1919        *(.boot)
    2020        *(.reset)
     21        *(.rodata)
     22        *(.rodata.*)
     23        . = ALIGN(0x4);
     24        dtb_addr = .;
     25        INCLUDE "build/platform.ld";
    2126    }
    2227
     28    . = seg_stack_base;
    2329    .data ALIGN(0x4) : {
    24         *(.reset_data)
    25         . = ALIGN(0x4);
    26         dtb_addr = .;
    27         INCLUDE "build/platform.ld";
     30        *(.data)
     31        *(.bss)
    2832    }
    2933}
  • trunk/softs/tsar_boot/conf/platform_vgsb_xicu_mmu/ldscript

    r425 r554  
    1919        *(.boot)
    2020        *(.reset)
     21        *(.rodata)
     22        *(.rodata.*)
     23        . = ALIGN(0x4);
     24        dtb_addr = .;
     25        INCLUDE "build/platform.ld";
    2126    }
    2227
     28    . = seg_stack_base;
    2329    .data ALIGN(0x4) : {
    24         *(.reset_data)
    25         . = ALIGN(0x4);
    26         dtb_addr = .;
    27         INCLUDE "build/platform.ld";
     30        *(.data)
     31        *(.bss)
    2832    }
    2933}
  • trunk/softs/tsar_boot/src/boot_elf_loader.c

    r425 r554  
    1717
    1818#if (BOOT_DEBUG == 1)
    19 static char* init_state_str[] = {
     19static char const * const init_state_str[] = {
    2020    "ELF_HEADER_STATE",
    2121    "ELF_PROGRAM_HEADER_STATE",
  • trunk/softs/tsar_boot/src/boot_ioc.c

    r425 r554  
    44
    55static struct sdcard_dev  _sdcard_device;
    6 static struct spi_dev   * _spi_device   = ( struct spi_dev * )IOC_BASE;
     6static struct spi_dev   *const _spi_device   = ( struct spi_dev * )IOC_BASE;
    77
    88#endif // end ifndef SOCLIB_IOC
  • trunk/softs/tsar_boot/src/reset.S

    r502 r554  
    139139    /* Initializes stack pointer */
    140140
    141     la      k1,     seg_stack_base
    142     li      k0,     BOOT_STACK_SIZE
    143     addu    sp,     k1,     k0      /* sp <= seg_stack_base + BOOT_STACK_SIZE */
     141    la      sp,     stk
    144142
    145143    la      a0,     versionstr
     
    220218    .set reorder
    221219
     220    .section .data
     221    .space BOOT_STACK_SIZE
     222stk:
     223    .space 1
     224
    222225/*
    223226 * vim: tabstop=4 : shiftwidth=4 : expandtab
Note: See TracChangeset for help on using the changeset viewer.