Changeset bcad855 in mainline


Ignore:
Timestamp:
2012-12-06T23:03:08Z (11 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3f69f63d
Parents:
295732b
Message:

Use the SDRAM size as passed from YAMON.

  • Do not probe memory beyond the end of SDRAM.
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/mips32/include/types.h

    r295732b rbcad855  
    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

    r295732b rbcad855  
    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        /*
  • kernel/arch/mips32/include/arch.h

    r295732b rbcad855  
    4444extern size_t cpu_count;
    4545
     46#if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
     47extern size_t sdram_size;
     48#endif
     49
    4650typedef struct {
    4751        void *addr;
     
    5155
    5256typedef struct {
     57#if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
     58        uint32_t sdram_size;
     59#endif
    5360        uint32_t cpumap;
    5461        size_t cnt;
  • kernel/arch/mips32/src/mips32.c

    r295732b rbcad855  
    7171size_t cpu_count = 0;
    7272
     73#if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
     74size_t sdram_size = 0;
     75#endif
     76
    7377/** Performs mips32-specific initialization before main_bsp() is called. */
    7478void arch_pre_main(void *entry __attribute__((unused)), bootinfo_t *bootinfo)
     
    8892                        cpu_count++;
    8993        }
     94
     95#if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
     96        sdram_size = bootinfo->sdram_size;
     97#endif
    9098}
    9199
  • kernel/arch/mips32/src/mm/frame.c

    r295732b rbcad855  
    4141#include <config.h>
    4242#include <arch/drivers/msim.h>
     43#include <arch/arch.h>
    4344#include <print.h>
    4445
     
    8283        /* MSIM device (dkeyboard) */
    8384        if (frame == (KA2PA(MSIM_KBD_ADDRESS) >> ZERO_PAGE_WIDTH))
     85                return false;
     86#endif
     87
     88#if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
     89        if (frame >= (sdram_size >> ZERO_PAGE_WIDTH))
    8490                return false;
    8591#endif
Note: See TracChangeset for help on using the changeset viewer.