11.2Scliff/*	$NetBSD: gemini_mem.c,v 1.2 2008/11/11 06:32:15 cliff Exp $	*/
21.1Scliff
31.1Scliff/* adapted from:
41.1Scliff *	NetBSD: integrator_mem.c,v 1.4 2006/01/16 19:34:53 he Exp
51.1Scliff */
61.1Scliff
71.1Scliff/*
81.1Scliff * Copyright (c) 2002 Wasabi Systems, Inc.
91.1Scliff * All rights reserved.
101.1Scliff *
111.1Scliff * Written by Jason R. Thorpe for Wasabi Systems, Inc.
121.1Scliff *
131.1Scliff * Redistribution and use in source and binary forms, with or without
141.1Scliff * modification, are permitted provided that the following conditions
151.1Scliff * are met:
161.1Scliff * 1. Redistributions of source code must retain the above copyright
171.1Scliff *    notice, this list of conditions and the following disclaimer.
181.1Scliff * 2. Redistributions in binary form must reproduce the above copyright
191.1Scliff *    notice, this list of conditions and the following disclaimer in the
201.1Scliff *    documentation and/or other materials provided with the distribution.
211.1Scliff * 3. All advertising materials mentioning features or use of this software
221.1Scliff *    must display the following acknowledgement:
231.1Scliff *	This product includes software developed for the NetBSD Project by
241.1Scliff *	Wasabi Systems, Inc.
251.1Scliff * 4. The name of Wasabi Systems, Inc. may not be used to endorse
261.1Scliff *    or promote products derived from this software without specific prior
271.1Scliff *    written permission.
281.1Scliff *
291.1Scliff * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
301.1Scliff * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
311.1Scliff * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
321.1Scliff * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
331.1Scliff * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
341.1Scliff * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
351.1Scliff * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
361.1Scliff * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
371.1Scliff * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
381.1Scliff * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
391.1Scliff * POSSIBILITY OF SUCH DAMAGE.
401.1Scliff */
411.1Scliff
421.1Scliff/*
431.1Scliff * This file provides the mem_init() function for ARM Integrator
441.1Scliff * core modules.
451.1Scliff */
461.1Scliff
471.1Scliff#include <sys/types.h>
481.1Scliff#include <lib/libsa/stand.h>
491.1Scliff
501.1Scliff#include "board.h"
511.1Scliff
521.2Scliff/*
531.2Scliff * constrain MEMSIZE to avoid stepping out of smallest-case
541.2Scliff * Gemini CPU Remap Control remapped-private memory size
551.2Scliff * "bad" things can happen if the gzboot heap is in
561.2Scliff * non-core-private memory.
571.2Scliff */
581.2Scliff#define MEMSIZE	(32 * 1024 * 1024)	/* 32MB */
591.1Scliff
601.1Scliffvoid
611.1Scliffmem_init(void)
621.1Scliff{
631.1Scliff	uint32_t heap, size;
641.1Scliff
651.2Scliff	size = MEMSIZE;
661.1Scliff
671.1Scliff	/* Start is always 0. */
681.1Scliff	heap = size - BOARD_HEAP_SIZE;
691.1Scliff
701.1Scliff	printf(">> RAM 0x%x - 0x%x, heap at 0x%x\n", 0, size - 1, heap);
711.1Scliff	setheap((void *)heap, (void *)(size - 1));
721.1Scliff}
73