Changeset 939dfd7 in mainline


Ignore:
Timestamp:
2005-12-09T18:29:34Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
705b4149
Parents:
ef0e259
Message:

Added MIPS ARC memory initializaiton.

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • arch/mips32/include/drivers/arc.h

    ref0e259 r939dfd7  
    3434#define ARC_BASE_ADDR 0x1000;
    3535#define ARC_MAGIC 0x53435241
     36/* Frame size used by ARC */
     37#define ARC_FRAME 4096
    3638
    3739typedef enum {
     
    208210}__attribute__ ((packed)) arc_sbp;
    209211
    210 extern int init_arc(void);
     212extern int arc_init(void);
    211213extern void arc_print_memory_map(void);
    212214extern int arc_enabled(void);
     
    214216extern void arc_print_devices(void);
    215217extern int arc_getchar(void);
     218void arc_frame_init(void);
     219
    216220#endif
  • arch/mips32/include/mm/memory_init.h

    ref0e259 r939dfd7  
    3232#include <config.h>
    3333
     34/* When this function is called, we do not have ARC initiated
     35 * - provide some reasonable minimum and update it later
     36 */
    3437#define get_memory_size()       CONFIG_MEMORY_SIZE
    35 //#define get_memory_size()     150*1024*1024
    3638
    3739#endif
  • arch/mips32/src/drivers/arc.c

    ref0e259 r939dfd7  
    3232#include <arch.h>
    3333#include <arch/byteorder.h>
     34#include <arch/mm/frame.h>
     35#include <mm/frame.h>
    3436
    3537/* This is a good joke, SGI HAS different types than NT bioses... */
     
    102104 * @return 0 - ARC OK, -1 - ARC does not exist
    103105 */
    104 int init_arc(void)
     106int arc_init(void)
    105107{
    106108        if (sbp->signature != ARC_MAGIC) {
     
    166168        while (desc) {
    167169                printf("%s: %d (size: %dKB)\n",basetypes[desc->type],
    168                        desc->basepage * 4096,
    169                        desc->basecount*4);
     170                       desc->basepage * ARC_FRAME,
     171                       desc->basecount*ARC_FRAME/1024);
    170172                desc = arc_entry->getmemorydescriptor(desc);
    171173        }
     
    203205        return ch;
    204206}
     207
     208/* Initialize frame zones from ARC firmware.
     209 * In the future we may use even the FirmwareTemporary regions,
     210 * currently we use the FreeMemory (what about the LoadedProgram?)
     211 */
     212void arc_frame_init(void)
     213{
     214        arc_memdescriptor_t *desc;
     215        int total = 0;
     216
     217        desc = arc_entry->getmemorydescriptor(NULL);
     218        while (desc) {
     219                if (desc->type == FreeMemory ||
     220                    desc->type == FreeContiguous) {
     221                        total += desc->basecount*ARC_FRAME;
     222                        zone_create_in_region(desc->basepage*ARC_FRAME,
     223                                              desc->basecount*ARC_FRAME);
     224                }
     225                desc = arc_entry->getmemorydescriptor(desc);
     226        }
     227
     228        config.memory_size = total;
     229}
     230
  • arch/mips32/src/mips32.c

    ref0e259 r939dfd7  
    5656        interrupts_disable();
    5757
    58         init_arc();
     58        arc_init();
    5959
    6060        /* Copy the exception vectors to the right places */
  • arch/mips32/src/mm/frame.c

    ref0e259 r939dfd7  
    3434#include <panic.h>
    3535#include <print.h>
     36#include <arch/drivers/arc.h>
    3637
     38/** Create memory zones
     39 *
     40 * If ARC is known, read information from ARC, otherwise
     41 * assume some defaults.
     42 * - blacklist first FRAME because there is an exception vector
     43 */
    3744void frame_arch_init(void)
    3845{
    39         zone_create_in_region(KA2PA(KERNEL_LOAD_ADDRESS), config.memory_size & ~(FRAME_SIZE-1));
     46        /* Blacklist first 4KB, exception vector */
     47        frame_region_not_free(0, FRAME_SIZE);
     48
     49        if (arc_enabled())
     50                arc_frame_init();
     51        else
     52                zone_create_in_region(KA2PA(KERNEL_LOAD_ADDRESS),
     53                                      config.memory_size & ~(FRAME_SIZE-1));
    4054}
  • tools/config.py

    ref0e259 r939dfd7  
    290290                return False
    291291            if oper== '!=' and condval == defaults[condname]:
    292                 print 2
    293292                return False
    294293    if ctype=='cnf':
Note: See TracChangeset for help on using the changeset viewer.