gemini_mem.c revision 1.2
1/*	$NetBSD: gemini_mem.c,v 1.2 2008/11/11 06:32:15 cliff Exp $	*/
2
3/* adapted from:
4 *	NetBSD: integrator_mem.c,v 1.4 2006/01/16 19:34:53 he Exp
5 */
6
7/*
8 * Copyright (c) 2002 Wasabi Systems, Inc.
9 * All rights reserved.
10 *
11 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 *    notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 *    notice, this list of conditions and the following disclaimer in the
20 *    documentation and/or other materials provided with the distribution.
21 * 3. All advertising materials mentioning features or use of this software
22 *    must display the following acknowledgement:
23 *	This product includes software developed for the NetBSD Project by
24 *	Wasabi Systems, Inc.
25 * 4. The name of Wasabi Systems, Inc. may not be used to endorse
26 *    or promote products derived from this software without specific prior
27 *    written permission.
28 *
29 * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
30 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
31 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
32 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
33 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
34 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
36 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
37 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39 * POSSIBILITY OF SUCH DAMAGE.
40 */
41
42/*
43 * This file provides the mem_init() function for ARM Integrator
44 * core modules.
45 */
46
47#include <sys/types.h>
48#include <lib/libsa/stand.h>
49
50#include "board.h"
51
52/*
53 * constrain MEMSIZE to avoid stepping out of smallest-case
54 * Gemini CPU Remap Control remapped-private memory size
55 * "bad" things can happen if the gzboot heap is in
56 * non-core-private memory.
57 */
58#define MEMSIZE	(32 * 1024 * 1024)	/* 32MB */
59
60void
61mem_init(void)
62{
63	uint32_t heap, size;
64
65	size = MEMSIZE;
66
67	/* Start is always 0. */
68	heap = size - BOARD_HEAP_SIZE;
69
70	printf(">> RAM 0x%x - 0x%x, heap at 0x%x\n", 0, size - 1, heap);
71	setheap((void *)heap, (void *)(size - 1));
72}
73