xref: /netbsd-src/sys/arch/evbarm/stand/board/gemini_mem.c (revision ba1eaeccf6f8cc61295c424239079858352194e8)
1*ba1eaeccScliff /*	$NetBSD: gemini_mem.c,v 1.2 2008/11/11 06:32:15 cliff Exp $	*/
21913f7baScliff 
31913f7baScliff /* adapted from:
41913f7baScliff  *	NetBSD: integrator_mem.c,v 1.4 2006/01/16 19:34:53 he Exp
51913f7baScliff  */
61913f7baScliff 
71913f7baScliff /*
81913f7baScliff  * Copyright (c) 2002 Wasabi Systems, Inc.
91913f7baScliff  * All rights reserved.
101913f7baScliff  *
111913f7baScliff  * Written by Jason R. Thorpe for Wasabi Systems, Inc.
121913f7baScliff  *
131913f7baScliff  * Redistribution and use in source and binary forms, with or without
141913f7baScliff  * modification, are permitted provided that the following conditions
151913f7baScliff  * are met:
161913f7baScliff  * 1. Redistributions of source code must retain the above copyright
171913f7baScliff  *    notice, this list of conditions and the following disclaimer.
181913f7baScliff  * 2. Redistributions in binary form must reproduce the above copyright
191913f7baScliff  *    notice, this list of conditions and the following disclaimer in the
201913f7baScliff  *    documentation and/or other materials provided with the distribution.
211913f7baScliff  * 3. All advertising materials mentioning features or use of this software
221913f7baScliff  *    must display the following acknowledgement:
231913f7baScliff  *	This product includes software developed for the NetBSD Project by
241913f7baScliff  *	Wasabi Systems, Inc.
251913f7baScliff  * 4. The name of Wasabi Systems, Inc. may not be used to endorse
261913f7baScliff  *    or promote products derived from this software without specific prior
271913f7baScliff  *    written permission.
281913f7baScliff  *
291913f7baScliff  * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
301913f7baScliff  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
311913f7baScliff  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
321913f7baScliff  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
331913f7baScliff  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
341913f7baScliff  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
351913f7baScliff  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
361913f7baScliff  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
371913f7baScliff  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
381913f7baScliff  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
391913f7baScliff  * POSSIBILITY OF SUCH DAMAGE.
401913f7baScliff  */
411913f7baScliff 
421913f7baScliff /*
431913f7baScliff  * This file provides the mem_init() function for ARM Integrator
441913f7baScliff  * core modules.
451913f7baScliff  */
461913f7baScliff 
471913f7baScliff #include <sys/types.h>
481913f7baScliff #include <lib/libsa/stand.h>
491913f7baScliff 
501913f7baScliff #include "board.h"
511913f7baScliff 
52*ba1eaeccScliff /*
53*ba1eaeccScliff  * constrain MEMSIZE to avoid stepping out of smallest-case
54*ba1eaeccScliff  * Gemini CPU Remap Control remapped-private memory size
55*ba1eaeccScliff  * "bad" things can happen if the gzboot heap is in
56*ba1eaeccScliff  * non-core-private memory.
57*ba1eaeccScliff  */
58*ba1eaeccScliff #define MEMSIZE	(32 * 1024 * 1024)	/* 32MB */
591913f7baScliff 
601913f7baScliff void
mem_init(void)611913f7baScliff mem_init(void)
621913f7baScliff {
631913f7baScliff 	uint32_t heap, size;
641913f7baScliff 
65*ba1eaeccScliff 	size = MEMSIZE;
661913f7baScliff 
671913f7baScliff 	/* Start is always 0. */
681913f7baScliff 	heap = size - BOARD_HEAP_SIZE;
691913f7baScliff 
701913f7baScliff 	printf(">> RAM 0x%x - 0x%x, heap at 0x%x\n", 0, size - 1, heap);
711913f7baScliff 	setheap((void *)heap, (void *)(size - 1));
721913f7baScliff }
73