1 /* $NetBSD: hpcboot.h,v 1.11 2008/04/28 20:23:20 martin Exp $ */
4 * Copyright (c) 2001, 2002, 2004 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.
36 #include <res/resource.h>
38 #include <machine/bootinfo.h>
39 #include <machine/platid.h>
40 #include <machine/platid_mask.h>
41 #include <machine/platid_generated.h>
43 enum { KERNEL_PAGE_SIZE
= 0x1000 };
45 enum ArchitectureOps
{
47 ARCHITECTURE_ARM_SA1100
= PLATID_CPU_ARM_STRONGARM_SA1100
,
48 ARCHITECTURE_ARM_PXA250
= PLATID_CPU_ARM_XSCALE_PXA250
,
49 ARCHITECTURE_ARM_PXA270
= PLATID_CPU_ARM_XSCALE_PXA270
,
52 ARCHITECTURE_SH3_7707
= PLATID_CPU_SH_3_7707
,
53 ARCHITECTURE_SH3_7709
= PLATID_CPU_SH_3_7709
,
54 ARCHITECTURE_SH3_7709A
= PLATID_CPU_SH_3_7709A
,
55 ARCHITECTURE_SH4_7750
= PLATID_CPU_SH_4_7750
,
58 ARCHITECTURE_MIPS_TX3900
= PLATID_CPU_MIPS_TX_3900
,
59 ARCHITECTURE_MIPS_TX3920
= PLATID_CPU_MIPS_TX_3920
,
60 ARCHITECTURE_MIPS_VR41
= PLATID_CPU_MIPS_VR_41XX
69 enum MemoryManagerOps
{
70 MEMORY_MANAGER_VIRTUALCOPY
,
71 MEMORY_MANAGER_LOCKPAGES
,
72 MEMORY_MANAGER_SOFTMMU
,
73 MEMORY_MANAGER_HARDMMU
89 struct BootSetupArgs
{
90 enum ArchitectureOps architecture
;
91 BOOL architectureDebug
;
92 enum ConsoleOps console
;
94 enum MemoryManagerOps memory
;
95 BOOL memorymanagerDebug
;
98 TCHAR fileRoot
[MAX_PATH
];
99 TCHAR fileName
[MAX_PATH
];
101 TCHAR mfsName
[MAX_PATH
];
102 enum LoaderOps loader
;
107 uint32_t next
; /* next tagged page kernel virtual address; */
108 uint32_t src
; /* kernel virtual or physical address */
109 uint32_t dst
; /* kernel virtual or physical address */
110 uint32_t sz
; /* copy size or zero-clear size; */
114 kaddr_t kernel_entry
;
121 #define VOLATILE_REF(x) (*(volatile uint32_t *)(x))
122 #define VOLATILE_REF16(x) (*(volatile uint16_t *)(x))
123 #define VOLATILE_REF8(x) (*(volatile uint8_t *)(x))
124 #define _reg_read_1(a) (*(volatile uint8_t *)(a))
125 #define _reg_read_2(a) (*(volatile uint16_t *)(a))
126 #define _reg_read_4(a) (*(volatile uint32_t *)(a))
127 #define _reg_write_1(a, v) (*(volatile uint8_t *)(a) = (v))
128 #define _reg_write_2(a, v) (*(volatile uint16_t *)(a) = (v))
129 #define _reg_write_4(a, v) (*(volatile uint32_t *)(a) = (v))
132 #define ptokv(x) (x) /* UNCACHED FLAT */
134 #define ptokv(x) ((x) | 0x80000000) /* CACHED P1 */
136 #define ptokv(x) ((x) | 0x80000000) /* CACHED kseg0 */
138 #error "physical address to kernel virtual macro not defined."
143 BOOL
VirtualCopy(LPVOID
, LPVOID
, DWORD
, DWORD
);
145 BOOL
LockPages(LPVOID
, DWORD
, PDWORD
, int);
146 BOOL
UnlockPages(LPVOID
, DWORD
);
148 #define CACHE_D_WBINV 1
149 #define CACHE_I_INV 2
151 #define GETVFRAMEPHYSICAL 6144
152 #define GETVFRAMELEN 6145
155 void _bitdisp(uint32_t, int, int, int, int);
156 void _dbg_bit_print(uint32_t, uint32_t, const char *);
157 #define bitdisp(a) _bitdisp((a), 0, 0, 0, 1)
160 /* Runtime Windows CE version */
161 #if _WIN32_WCE <= 200
162 extern OSVERSIONINFO WinCEVersion
;
164 extern OSVERSIONINFOW WinCEVersion
;
167 #endif /* _HPCBOOT_H_ */