xref: /netbsd-src/sys/arch/evbarm/mini2440/mini2440_start.S (revision 549aa5640fd486189db2ca05c6579e863feab712)
177b78cdcSnisimura/*-
277b78cdcSnisimura * Copyright (c) 2012 The NetBSD Foundation, Inc.
377b78cdcSnisimura * All rights reserved.
477b78cdcSnisimura *
577b78cdcSnisimura * This code is derived from software contributed to The NetBSD Foundation
677b78cdcSnisimura * by Paul Fleischer <paul@xpg.dk>
777b78cdcSnisimura *
877b78cdcSnisimura * Redistribution and use in source and binary forms, with or without
977b78cdcSnisimura * modification, are permitted provided that the following conditions
1077b78cdcSnisimura * are met:
1177b78cdcSnisimura * 1. Redistributions of source code must retain the above copyright
1277b78cdcSnisimura *    notice, this list of conditions and the following disclaimer.
1377b78cdcSnisimura * 2. Redistributions in binary form must reproduce the above copyright
1477b78cdcSnisimura *    notice, this list of conditions and the following disclaimer in the
1577b78cdcSnisimura *    documentation and/or other materials provided with the distribution.
1677b78cdcSnisimura *
1777b78cdcSnisimura * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
1877b78cdcSnisimura * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
1977b78cdcSnisimura * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2077b78cdcSnisimura * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2177b78cdcSnisimura * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2277b78cdcSnisimura * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2377b78cdcSnisimura * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2477b78cdcSnisimura * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2577b78cdcSnisimura * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2677b78cdcSnisimura * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2777b78cdcSnisimura * POSSIBILITY OF SUCH DAMAGE.
2877b78cdcSnisimura */
2977b78cdcSnisimura
3077b78cdcSnisimura/* This file is based on arch/evbarm/smdk2xx0/smdk2410_start.S */
3177b78cdcSnisimura/*
3277b78cdcSnisimura * Copyright (c) 2002, 2003 Fujitsu Component Limited
3377b78cdcSnisimura * Copyright (c) 2002, 2003 Genetec Corporation
3477b78cdcSnisimura * All rights reserved.
3577b78cdcSnisimura *
3677b78cdcSnisimura * Redistribution and use in source and binary forms, with or without
3777b78cdcSnisimura * modification, are permitted provided that the following conditions
3877b78cdcSnisimura * are met:
3977b78cdcSnisimura * 1. Redistributions of source code must retain the above copyright
4077b78cdcSnisimura *    notice, this list of conditions and the following disclaimer.
4177b78cdcSnisimura * 2. Redistributions in binary form must reproduce the above copyright
4277b78cdcSnisimura *    notice, this list of conditions and the following disclaimer in the
4377b78cdcSnisimura *    documentation and/or other materials provided with the distribution.
4477b78cdcSnisimura * 3. Neither the name of The Fujitsu Component Limited nor the name of
4577b78cdcSnisimura *    Genetec corporation may not be used to endorse or promote products
4677b78cdcSnisimura *    derived from this software without specific prior written permission.
4777b78cdcSnisimura *
4877b78cdcSnisimura * THIS SOFTWARE IS PROVIDED BY FUJITSU COMPONENT LIMITED AND GENETEC
4977b78cdcSnisimura * CORPORATION ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
5077b78cdcSnisimura * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5177b78cdcSnisimura * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
5277b78cdcSnisimura * DISCLAIMED.  IN NO EVENT SHALL FUJITSU COMPONENT LIMITED OR GENETEC
5377b78cdcSnisimura * CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
5477b78cdcSnisimura * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
5577b78cdcSnisimura * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
5677b78cdcSnisimura * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
5777b78cdcSnisimura * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
5877b78cdcSnisimura * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
5977b78cdcSnisimura * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
6077b78cdcSnisimura * SUCH DAMAGE.
6177b78cdcSnisimura */
6277b78cdcSnisimura
6377b78cdcSnisimura#include <machine/asm.h>
6477b78cdcSnisimura#include <arm/armreg.h>
6577b78cdcSnisimura#include <arm/arm32/pte.h>
6677b78cdcSnisimura#include <arm/arm32/pmap.h>		/* for PMAP_DOMAIN_KERNEL */
6777b78cdcSnisimura
6877b78cdcSnisimura#include <arm/s3c2xx0/s3c2440reg.h>	/* for S3C2440_SDRAM_START */
6977b78cdcSnisimura
7077b78cdcSnisimura/*
7177b78cdcSnisimura * Kernel start routine for Friendly ARM Mini2440.
7277b78cdcSnisimura * This code is excuted at the very first after the kernel is loaded
7377b78cdcSnisimura * by boot program.
7477b78cdcSnisimura */
7577b78cdcSnisimura	.text
7677b78cdcSnisimura
7777b78cdcSnisimura	.global	_C_LABEL(mini2440_start)
7877b78cdcSnisimura_C_LABEL(mini2440_start):
79*549aa564Sandvar	/* r0 (argument 0) remains unchanged until initarm() is called */
8077b78cdcSnisimura
8177b78cdcSnisimura	/* Jump to kernel code in TRUE VA */
8277b78cdcSnisimura	adr	r1, Lstart
8377b78cdcSnisimura	ldr	pc, [r1]
8477b78cdcSnisimura
8577b78cdcSnisimura
8677b78cdcSnisimuraLstart:
8777b78cdcSnisimura	.word	start
88