ReactOS 0.4.15-dev-6656-gbbb33a6
macharm.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Boot Loader
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: boot/freeldr/freeldr/arch/arm/macharm.c
5 * PURPOSE: Provides abstraction between the ARM Boot Loader and FreeLDR
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9/* INCLUDES *******************************************************************/
10
11#include <freeldr.h>
13
14/* GLOBALS ********************************************************************/
15
20
21#ifndef UEFIBOOT
23#endif
24
33
35
37{
38 -1, // INVALID
39 -1, // INVALID
40 1 << 12, // 4KB
41 1 << 13, // 8KB
42 1 << 14, // 16KB
43 1 << 15, // 32KB
44 1 << 16, // 64KB
45 1 << 17 // 128KB
46};
47
49{
50 -1, // INVALID
51 -1, // INVALID
52 4 // 4-way associative
53};
54
56{
57 -1, // INVALID
58 -1, // INVALID
59 8 // 8 words per line (32 bytes)
60};
61
62/* FUNCTIONS ******************************************************************/
63
64VOID
66{
67 /* Nothing for now */
68}
69
70VOID
72{
73 /* Remember the pointer */
74 ArmBoardBlock = BootContext;
75
76 /* Let's make sure we understand the LLB */
79
80 /* This should probably go away once we support more boards */
85
86 /* Call FreeLDR's portable entrypoint with our command-line */
88}
89
90VOID
92{
93 return;
94}
95
98{
99 ARM_CACHE_REGISTER CacheReg;
100
101 /* Create the root node */
102 if (ArmHwDetectRan++) return RootNode;
104
105 /*
106 * TODO:
107 * There's no such thing as "PnP" on embedded hardware.
108 * The boot loader will send us a device tree, similar to ACPI
109 * or OpenFirmware device trees, and we will convert it to ARC.
110 */
111
112 /* Get cache information */
113 CacheReg = KeArmCacheRegisterGet();
124
125 /* Initialize the RAMDISK Device */
127
128 /* Fill out the ARC disk block */
129 AddReactOSArcDiskInfo("ramdisk(0)", 0xBADAB00F, 0xDEADBABE, TRUE);
131
132 /* Return the root node */
133 return RootNode;
134}
135
138{
139 /* Emulate old behavior */
140 if (ArmHwDetect() == NULL)
141 return FALSE;
142
143 /* On ARM platforms, the loader is always in RAM */
144 strcpy(FrLdrBootPath, "ramdisk(0)");
145 return TRUE;
146}
147
149
152{
153 ULONG i;
155
156 /* Return whatever the board returned to us (CS0 Base + Size and FLASH0) */
157 for (i = 0; i < ArmBoardBlock->MemoryMapEntryCount; i++)
158 {
163 else
165 }
166
167 *MemoryMapSize = ArmBoardBlock->MemoryMapEntryCount;
168
169 // FIXME
170 return NULL;
171}
172
173VOID
175{
176 /* UNIMPLEMENTED */
177}
178
179#ifndef UEFIBOOT
180VOID
181MachInit(IN PCCH CommandLine)
182{
183 /* Copy Machine Routines from Firmware Table */
192
193 /* Setup board-specific ARM routines */
194 switch (ArmBoardBlock->BoardType)
195 {
196 /* Check for Feroceon-base boards */
198 TuiPrintf("Not implemented\n");
199 while (TRUE);
200 break;
201
202 /* Check for TI OMAP3 ZOOM-II MDK */
204
205 /* Setup the disk and file system buffers */
206 gDiskReadBuffer = 0x81094000;
207 gFileSysBuffer = 0x81094000;
208 break;
209
210 /* Check for ARM Versatile PB boards */
212
213 /* Setup the disk and file system buffers */
214 gDiskReadBuffer = 0x00090000;
215 gFileSysBuffer = 0x00090000;
216 break;
217
218 /* Check for TI OMAP3 Beagleboard */
220 TuiPrintf("Not implemented\n");
221 while (TRUE);
222 break;
223
224 default:
225 ASSERT(FALSE);
226 }
227
228 /* Setup generic ARM routines for all boards */
234}
235#endif
unsigned char BOOLEAN
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
MACHVTBL MachVtbl
Definition: arcemul.c:21
VOID AddReactOSArcDiskInfo(IN PSTR ArcName, IN ULONG Signature, IN ULONG Checksum, IN BOOLEAN ValidPartitionTable)
Definition: archwsup.c:77
VOID FldrCreateSystemKey(_Out_ PCONFIGURATION_COMPONENT_DATA *SystemNode, _In_ PCSTR IdentifierString)
Definition: archwsup.c:135
FORCEINLINE ARM_CACHE_REGISTER KeArmCacheRegisterGet(VOID)
Definition: intrin_i.h:109
ARC_STATUS RamDiskInitialize(IN BOOLEAN InitRamDisk, IN PCSTR LoadOptions OPTIONAL, IN PCSTR DefaultPath OPTIONAL)
Definition: ramdisk.c:206
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define PAGE_SIZE
Definition: env_spec_w32.h:49
VOID __cdecl BootMain(IN PCCH CmdLine)
Definition: freeldr.c:43
CCHAR FrLdrBootPath[MAX_PATH]
Definition: freeldr.c:39
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
PARM_BOARD_CONFIGURATION_BLOCK ArmBoardBlock
Definition: macharm.c:16
PFREELDR_MEMORY_DESCRIPTOR ArmMemGetMemoryMap(OUT ULONG *MemoryMapSize)
Definition: macharm.c:151
VOID FrLdrCheckCpuCompatibility(VOID)
Definition: macharm.c:65
ULONG FirstLevelIcacheFillSize
Definition: macharm.c:28
ULONG LenBits[]
Definition: macharm.c:55
ULONG gFileSysBuffer
Definition: macharm.c:17
VOID MachInit(IN PCCH CommandLine)
Definition: macharm.c:181
BOOLEAN ArmInitializeBootDevices(VOID)
Definition: macharm.c:137
ULONG SecondLevelDcacheSize
Definition: macharm.c:29
VOID ArmHwIdle(VOID)
Definition: macharm.c:174
ULONG FirstLevelDcacheFillSize
Definition: macharm.c:26
BOOLEAN ArmHwDetectRan
Definition: macharm.c:18
BOOLEAN AcpiPresent
Definition: macharm.c:22
ULONG SizeBits[]
Definition: macharm.c:36
ULONG gDiskReadBuffer
Definition: macharm.c:17
VOID ArmInit(IN PARM_BOARD_CONFIGURATION_BLOCK BootContext)
Definition: macharm.c:71
VOID ArmPrepareForReactOS(VOID)
Definition: macharm.c:91
FREELDR_MEMORY_DESCRIPTOR ArmMemoryMap[32]
Definition: macharm.c:148
ULONG FirstLevelIcacheSize
Definition: macharm.c:27
ULONG SecondLevelIcacheSize
Definition: macharm.c:31
ULONG SecondLevelIcacheFillSize
Definition: macharm.c:32
PCONFIGURATION_COMPONENT_DATA ArmHwDetect(VOID)
Definition: macharm.c:97
ULONG reactos_disk_count
Definition: archwsup.c:68
ULONG AssocBits[]
Definition: macharm.c:48
ULONG FirstLevelDcacheSize
Definition: macharm.c:25
ULONG SecondLevelDcacheFillSize
Definition: macharm.c:30
PCONFIGURATION_COMPONENT_DATA RootNode
Definition: macharm.c:19
#define MACH_TYPE_OMAP_ZOOM2
Definition: machtype.h:30
#define MACH_TYPE_FEROCEON
Definition: machtype.h:13
#define MACH_TYPE_OMAP3_BEAGLE
Definition: machtype.h:25
#define MACH_TYPE_VERSATILE_PB
Definition: machtype.h:19
#define ASSERT(a)
Definition: mode.c:44
CONST CHAR * PCCH
Definition: ntbasedef.h:392
@ BiosMemoryUsable
Definition: osloader.h:22
#define ARM_BOARD_CONFIGURATION_MINOR_VERSION
Definition: osloader.h:43
#define ARM_BOARD_CONFIGURATION_MAJOR_VERSION
Definition: osloader.h:42
@ MemoryFirmwarePermanent
Definition: arc.h:214
@ MemoryFree
Definition: arc.h:210
LONGLONG BaseAddress
Definition: osloader.h:33
LONGLONG Length
Definition: osloader.h:34
PBIOS_MEMORY_MAP MemoryMap
Definition: osloader.h:53
TYPE_OF_MEMORY MemoryType
Definition: mm.h:43
PFN_NUMBER PageCount
Definition: mm.h:45
PFN_NUMBER BasePage
Definition: mm.h:44
int(* ConsGetCh)(VOID)
Definition: machine.h:43
VOID(* PrepareForReactOS)(VOID)
Definition: machine.h:59
BOOLEAN(* InitializeBootDevices)(VOID)
Definition: machine.h:76
BOOLEAN(* ConsKbHit)(VOID)
Definition: machine.h:42
TIMEINFO *(* GetTime)(VOID)
Definition: machine.h:72
PCONFIGURATION_COMPONENT_DATA(* HwDetect)(VOID)
Definition: machine.h:77
PFREELDR_MEMORY_DESCRIPTOR(* GetMemoryMap)(PULONG MaxMemoryMapSize)
Definition: machine.h:63
VOID(* VideoPutChar)(int Ch, UCHAR Attr, unsigned X, unsigned Y)
Definition: machine.h:52
VOID(* VideoGetDisplaySize)(PULONG Width, PULONG Height, PULONG Depth)
Definition: machine.h:47
VOID(* VideoClearScreen)(UCHAR Attr)
Definition: machine.h:45
VOID(* HwIdle)(VOID)
Definition: machine.h:78
VIDEODISPLAYMODE(* VideoSetDisplayMode)(char *DisplayMode, BOOLEAN Init)
Definition: machine.h:46
VOID(* ConsPutChar)(int Ch)
Definition: machine.h:41
INT TuiPrintf(_In_ PCSTR Format,...)
Definition: tui.c:31
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40