Implement a proper ARM startup routine. We disable the FIQ and IRQ lines, then disabl...
[reactos.git] / reactos / boot / freeldr / freeldr / arch / arm / macharm.c
1 /*
2 * PROJECT: ReactOS Boot Loader
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: boot/freeldr/arch/arm/marcharm.c
5 * PURPOSE: Implements ARM-specific machine initialization
6 * PROGRAMMERS: alex@winsiderss.com
7 */
8
9 /* INCLUDES *******************************************************************/
10
11 #include <freeldr.h>
12
13 /* GLOBALS ********************************************************************/
14
15 //
16 // The only things we support
17 //
18 typedef enum _ARM_BOARD_TYPE
19 {
20 //
21 // Marvell Feroceon-based SoC:
22 // Buffalo Linkstation, KuroBox Pro, D-Link DS323 and others
23 //
24 ARM_FEROCEON = 1,
25 } ARM_BOARD_TYPE;
26
27 //
28 // Compatible boot-loaders should return us this information
29 //
30 #define ARM_BOARD_CONFIGURATION_MAJOR_VERSION 1
31 #define ARM_BOARD_CONFIGURATION_MINOR_VERSION 1
32 typedef struct _ARM_BOARD_CONFIGURATION_BLOCK
33 {
34 ULONG MajorVersion;
35 ULONG MinorVersion;
36 ARM_BOARD_TYPE BoardType;
37 ULONG TimerRegisterBase;
38 ULONG UartRegisterBase;
39 PBIOS_MEMORY_MAP MemoryMap;
40 CHAR CommandLine[256];
41 } ARM_BOARD_CONFIGURATION_BLOCK, *PARM_BOARD_CONFIGURATION_BLOCK;
42
43 /* FUNCTIONS ******************************************************************/
44
45 PARM_BOARD_CONFIGURATION_BLOCK ArmBoardBlock;
46
47 VOID
48 ArmInit(IN PARM_BOARD_CONFIGURATION_BLOCK BootContext)
49 {
50 //
51 // Remember the pointer
52 //
53 ArmBoardBlock = BootContext;
54
55 //
56 // Let's make sure we understand the boot-loader
57 //
58 ASSERT(ArmBoardBlock->MajorVersion == ARM_BOARD_CONFIGURATION_MAJOR_VERSION);
59 ASSERT(ArmBoardBlock->MinorVersion == ARM_BOARD_CONFIGURATION_MINOR_VERSION);
60
61 //
62 // This should probably go away once we support more boards
63 //
64 ASSERT(ArmBoardBlock->BoardType == ARM_FEROCEON);
65
66 //
67 // Call FreeLDR's portable entrypoint with our command-line
68 //
69 BootMain(ArmBoardBlock->CommandLine);
70 }
71