Changeset c6a7b3a in mainline for boot


Ignore:
Timestamp:
2013-03-28T20:39:16Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2d1fdcad
Parents:
cc3c27ad (diff), 5d9fce4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

mainline changes

Location:
boot
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/mips32/Makefile.inc

    rcc3c27ad rc6a7b3a  
    2929BFD_ARCH = mips
    3030BITS = 32
    31 EXTRA_CFLAGS = -msoft-float -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mips3 -mabi=32
     31EXTRA_CFLAGS = -msoft-float -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mabi=32
    3232
    33 RD_SRVS_NON_ESSENTIAL += \
    34         $(USPACE_PATH)/srv/bd/gxe_bd/gxe_bd
    35 
    36 ifeq ($(MACHINE),lgxemul)
    37         BFD_NAME = elf32-tradlittlemips
    38         BFD_OUTPUT = ecoff-littlemips
    39         ENDIANESS = LE
    40 endif
    41 ifeq ($(MACHINE),bgxemul)
    42         BFD_NAME = elf32-tradbigmips
    43         BFD_OUTPUT = ecoff-bigmips
    44         ENDIANESS = BE
    45 endif
    4633ifeq ($(MACHINE),msim)
    4734        BFD_NAME = elf32-tradlittlemips
    4835        BFD_OUTPUT = binary
    4936        ENDIANESS = LE
     37        EXTRA_CFLAGS += -march=r4000
    5038endif
     39ifeq ($(MACHINE),lmalta)
     40        BFD_NAME = elf32-tradlittlemips
     41        BFD_OUTPUT = elf32-tradlittlemips
     42        ENDIANESS = LE
     43        EXTRA_CFLAGS += -march=4kc
     44endif
     45ifeq ($(MACHINE),bmalta)
     46        BFD_NAME = elf32-tradbigmips
     47        BFD_OUTPUT = elf32-tradbigmips
     48        ENDIANESS = BE
     49        EXTRA_CFLAGS += -march=4kc
     50endif
     51
    5152
    5253SOURCES = \
  • boot/arch/mips32/_link.ld.in

    rcc3c27ad rc6a7b3a  
    22
    33SECTIONS {
     4#if defined(MACHINE_msim)
    45        . = 0xbfc00000;
     6#elif defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
     7        . = 0x80103000;
     8#endif
    59        .text : {
    610                *(BOOTSTRAP);
  • boot/arch/mips32/include/arch.h

    rcc3c27ad rc6a7b3a  
    3333#define PAGE_SIZE   (1 << PAGE_WIDTH)
    3434
     35#if defined(MACHINE_msim)
    3536#define CPUMAP_OFFSET    0x00001000
    3637#define STACK_OFFSET     0x00002000
     
    4142#define MSIM_VIDEORAM_ADDRESS  0xb0000000
    4243#define MSIM_DORDER_ADDRESS    0xb0000100
     44#endif
     45
     46#if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
     47#define CPUMAP_OFFSET    0x00100000
     48#define STACK_OFFSET     0x00101000
     49#define BOOTINFO_OFFSET  0x00102000
     50#define BOOT_OFFSET      0x00200000
     51#define LOADER_OFFSET    0x00103000
     52
     53#define YAMON_SUBR_BASE         PA2KA(0x1fc00500)
     54#define YAMON_SUBR_PRINT_COUNT  (YAMON_SUBR_BASE + 0x4)
     55#endif
    4356
    4457#ifndef __ASM__
    4558        #define PA2KA(addr)    (((uintptr_t) (addr)) + 0x80000000)
     59        #define PA2KSEG(addr)  (((uintptr_t) (addr)) + 0xa0000000)
     60        #define KA2PA(addr)    (((uintptr_t) (addr)) - 0x80000000)
    4661        #define KSEG2PA(addr)  (((uintptr_t) (addr)) - 0xa0000000)
    4762#else
  • boot/arch/mips32/include/types.h

    rcc3c27ad rc6a7b3a  
    4747
    4848typedef struct {
     49#if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
     50        uint32_t sdram_size;
     51#endif
    4952        uint32_t cpumap;
    5053        size_t cnt;
  • boot/arch/mips32/src/asm.S

    rcc3c27ad rc6a7b3a  
    5151        and $a0, $a1, $a0
    5252        mtc0 $a0, $status
     53
     54#if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
     55        /*
     56         * Remember the size of the SDRAM in bootinfo.
     57         */
     58        la $a0, PA2KA(BOOTINFO_OFFSET)
     59        sw $a3, 0($a0)
     60#endif
    5361       
    5462        /*
  • boot/arch/mips32/src/main.c

    rcc3c27ad rc6a7b3a  
    6565        for (i = 0; i < COMPONENTS; i++)
    6666                printf(" %p|%p: %s image (%zu/%zu bytes)\n", components[i].start,
    67                     (void *) KSEG2PA(components[i].start), components[i].name,
    68                     components[i].inflated, components[i].size);
     67                    (uintptr_t) components[i].start >= PA2KSEG(0) ?
     68                    (void *) KSEG2PA(components[i].start) :
     69                    (void *) KA2PA(components[i].start),
     70                    components[i].name, components[i].inflated,
     71                    components[i].size);
    6972       
    7073        void *dest[COMPONENTS];
     
    9396       
    9497        for (i = cnt; i > 0; i--) {
     98#ifdef MACHINE_msim
    9599                void *tail = dest[i - 1] + components[i].inflated;
    96100                if (tail >= ((void *) PA2KA(LOADER_OFFSET))) {
     
    99103                        halt();
    100104                }
     105#endif
    101106               
    102107                printf("%s ", components[i - 1].name);
  • boot/arch/mips32/src/putchar.c

    rcc3c27ad rc6a7b3a  
    3232#include <str.h>
    3333
     34#ifdef PUTCHAR_ADDRESS
     35#undef PUTCHAR_ADDRESS
     36#endif
     37
     38#if defined(MACHINE_msim)
     39#define _putchar(ch)    msim_putchar((ch))
     40static void msim_putchar(const wchar_t ch)
     41{
     42        *((char *) MSIM_VIDEORAM_ADDRESS) = ch;
     43}
     44#endif
     45
     46#if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
     47#define _putchar(ch)    yamon_putchar((ch))
     48typedef void (**yamon_print_count_ptr_t)(uint32_t, const char *, uint32_t);
     49yamon_print_count_ptr_t yamon_print_count =
     50    (yamon_print_count_ptr_t) YAMON_SUBR_PRINT_COUNT;
     51
     52static void yamon_putchar(const wchar_t wch)
     53{
     54        const char ch = (char) wch;
     55
     56        (*yamon_print_count)(0, &ch, 1);
     57}
     58#endif
     59
    3460void putchar(const wchar_t ch)
    3561{
    3662        if (ascii_check(ch))
    37                 *((char *) MSIM_VIDEORAM_ADDRESS) = ch;
     63                _putchar(ch);
    3864        else
    39                 *((char *) MSIM_VIDEORAM_ADDRESS) = U_SPECIAL;
     65                _putchar(U_SPECIAL);
    4066}
     67
  • boot/generic/include/memstr.h

    rcc3c27ad rc6a7b3a  
    3636
    3737extern void *memcpy(void *, const void *, size_t);
     38extern void *memset(void *, int, size_t);
    3839extern void *memmove(void *, const void *, size_t);
    3940
  • boot/generic/src/memstr.c

    rcc3c27ad rc6a7b3a  
    3030#include <typedefs.h>
    3131
    32 /** Copy block of memory.
     32/** Move memory block without overlapping.
    3333 *
    34  * Copy cnt bytes from src address to dst address.The source and destination
    35  * memory areas cannot overlap.
     34 * Copy cnt bytes from src address to dst address. The source
     35 * and destination memory areas cannot overlap.
    3636 *
    37  * @param src           Source address to copy from.
    38  * @param dst           Destination address to copy to.
    39  * @param cnt           Number of bytes to copy.
     37 * @param dst Destination address to copy to.
     38 * @param src Source address to copy from.
     39 * @param cnt Number of bytes to copy.
    4040 *
    41  * @return              Destination address.
     41 * @return Destination address.
     42 *
    4243 */
    4344void *memcpy(void *dst, const void *src, size_t cnt)
    4445{
    45         size_t i;
     46        uint8_t *dp = (uint8_t *) dst;
     47        const uint8_t *sp = (uint8_t *) src;
     48       
     49        while (cnt-- != 0)
     50                *dp++ = *sp++;
     51       
     52        return dst;
     53}
    4654
    47         for (i = 0; i < cnt; i++)
    48                 ((uint8_t *) dst)[i] = ((uint8_t *) src)[i];
    49 
     55/** Fill block of memory.
     56 *
     57 * Fill cnt bytes at dst address with the value val.
     58 *
     59 * @param dst Destination address to fill.
     60 * @param val Value to fill.
     61 * @param cnt Number of bytes to fill.
     62 *
     63 * @return Destination address.
     64 *
     65 */
     66void *memset(void *dst, int val, size_t cnt)
     67{
     68        uint8_t *dp = (uint8_t *) dst;
     69       
     70        while (cnt-- != 0)
     71                *dp++ = val;
     72       
    5073        return dst;
    5174}
Note: See TracChangeset for help on using the changeset viewer.