Changeset f2ea5d8 in mainline for boot/arch/sparc64/loader/ofwarch.c


Ignore:
Timestamp:
2006-11-17T20:21:25Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f18cc64
Parents:
282f2c9c
Message:

sparc64 code to support physical memory that starts on non-zero addresses.
Still needs to be tested on systems with such setup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/sparc64/loader/ofwarch.c

    r282f2c9c rf2ea5d8  
    11/*
    22 * Copyright (C) 2005 Martin Decky
     3 * Copyright (C) 2006 Jakub Jermar
    34 * All rights reserved.
    45 *
     
    3839#include <register.h>
    3940#include "main.h"
     41#include "asm.h"
    4042
    4143void write(const char *str, const int len)
     
    8688                                         * Start secondary processor.
    8789                                         */
    88                                         (void) ofw_call("SUNW,start-cpu", 3, 1, NULL, node, KERNEL_VIRTUAL_ADDRESS, 0);
     90                                        (void) ofw_call("SUNW,start-cpu", 3, 1, NULL, node,
     91                                                 KERNEL_VIRTUAL_ADDRESS,
     92                                                 bootinfo.physmem_start | AP_PROCESSOR);
    8993                                }
    9094                        }
     
    9498        return cpus;
    9599}
     100
     101/** Get physical memory starting address.
     102 *
     103 * @param start Pointer to variable where the physical memory starting
     104 *              address will be stored.
     105 *
     106 * @return Non-zero on succes, zero on failure.
     107 */
     108int ofw_get_physmem_start(uintptr_t *start)
     109{
     110        uint32_t memreg[4];
     111
     112        if (ofw_get_property(ofw_memory, "reg", &memreg, sizeof(memreg)) <= 0)
     113                return 0;
     114
     115        *start = (((uint64_t) memreg[0]) << 32) | memreg[1];
     116        return 1;
     117}
     118
Note: See TracChangeset for help on using the changeset viewer.