1 /* $NetBSD: arm_boot.cpp,v 1.9 2008/04/28 20:23:20 martin Exp $ */
4 * Copyright (c) 2001 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
37 #include <arm/arm_arch.h>
38 #include <arm/arm_sa1100.h>
39 #include <arm/arm_pxa2x0.h>
40 #include <arm/arm_boot.h>
41 #include <arm/arm_console.h>
54 ARMConsole::Destroy();
60 struct HpcMenuInterface::HpcMenuPreferences
&pref
= HPC_PREFERENCE
;
63 platid
.dw
.dw0
= pref
.platid_hi
;
64 platid
.dw
.dw1
= pref
.platid_lo
;
66 if (platid_match(&platid
, &platid_mask_CPU_ARM_STRONGARM_SA1100
))
67 args
.architecture
= ARCHITECTURE_ARM_SA1100
;
68 else if (platid_match(&platid
, &platid_mask_CPU_ARM_STRONGARM_SA1110
))
69 args
.architecture
= ARCHITECTURE_ARM_SA1100
;
70 else if (platid_match(&platid
, &platid_mask_CPU_ARM_XSCALE_PXA250
))
71 args
.architecture
= ARCHITECTURE_ARM_PXA250
;
72 else if (platid_match(&platid
, &platid_mask_CPU_ARM_XSCALE_PXA270
))
73 args
.architecture
= ARCHITECTURE_ARM_PXA270
;
77 args
.memory
= MEMORY_MANAGER_LOCKPAGES
;
79 return super::setup();
85 BOOL(*lock_pages
)(LPVOID
, DWORD
, PDWORD
, int);
86 BOOL(*unlock_pages
)(LPVOID
, DWORD
);
88 // Architecture dependent ops.
89 switch (args
.architecture
) {
91 DPRINTF((TEXT("Unsupported architecture.\n")));
93 case ARCHITECTURE_ARM_SA1100
:
94 _arch
= new SA1100Architecture(_cons
, _mem
);
96 case ARCHITECTURE_ARM_PXA250
:
97 case ARCHITECTURE_ARM_PXA270
:
98 _arch
= new PXA2X0Architecture(_cons
, _mem
);
101 _arch
->setDebug() = args
.architectureDebug
;
103 lock_pages
= _arch
->_load_LockPages();
104 unlock_pages
= _arch
->_load_UnlockPages();
105 if (lock_pages
== 0 || unlock_pages
== 0) {
107 DPRINTF((TEXT("couldn't find LockPages/UnlockPages.\n")));
115 case MEMORY_MANAGER_VIRTUALCOPY
:
117 case MEMORY_MANAGER_SOFTMMU
:
119 case MEMORY_MANAGER_HARDMMU
:
120 DPRINTF((TEXT("unsupported memory address detection method.\n")));
122 case MEMORY_MANAGER_LOCKPAGES
:
123 _mem
= new MemoryManager_LockPages(lock_pages
, unlock_pages
,
127 _mem
->setDebug() = args
.memorymanagerDebug
;
130 if (args
.console
== CONSOLE_SERIAL
) {
131 _cons
= ARMConsole::Instance(_mem
, args
.architecture
);
132 if (_cons
== NULL
|| !_cons
->init()) {
133 _cons
= Console::Instance();
134 DPRINTF((TEXT("use LCD console instead.\n")));
137 _cons
= Console::Instance();
140 // File Manager, Loader
141 return super::create();