e8375d033fd194cbad965637a74402e879b57972
[reactos.git] / reactos / boot / freeldr / freeldr / arch / arm / stubs.c
1 /*
2 * PROJECT: ReactOS Boot Loader
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: boot/freeldr/arch/arm/stubs.c
5 * PURPOSE: Non-completed ARM hardware-specific routines
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9 /* INCLUDES *******************************************************************/
10
11 #include <freeldr.h>
12
13 /* GLOBALS ********************************************************************/
14
15 ULONG PageDirectoryStart, PageDirectoryEnd;
16
17 /* FUNCTIONS ******************************************************************/
18
19 VOID
20 FrLdrStartup(IN ULONG Magic)
21 {
22 //
23 // Start the OS
24 //
25 }
26
27 BOOLEAN
28 ArmDiskGetDriveGeometry(IN ULONG DriveNumber,
29 OUT PGEOMETRY Geometry)
30 {
31 ASSERT(gRamDiskBase == NULL);
32 return FALSE;
33 }
34
35 BOOLEAN
36 ArmDiskReadLogicalSectors(IN ULONG DriveNumber,
37 IN ULONGLONG SectorNumber,
38 IN ULONG SectorCount,
39 IN PVOID Buffer)
40 {
41 ASSERT(gRamDiskBase == NULL);
42 return FALSE;
43 }
44
45 ULONG
46 ArmDiskGetCacheableBlockCount(IN ULONG DriveNumber)
47 {
48 ASSERT(gRamDiskBase == NULL);
49 return FALSE;
50 }
51
52 VOID
53 ArmPrepareForReactOS(IN BOOLEAN Setup)
54 {
55 while (TRUE);
56 }
57
58 PCONFIGURATION_COMPONENT_DATA
59 ArmHwDetect(VOID)
60 {
61 PCONFIGURATION_COMPONENT_DATA RootNode;
62
63 //
64 // Create the root node
65 //
66 FldrCreateSystemKey(&RootNode);
67
68 //
69 // Write null component information
70 //
71 FldrSetComponentInformation(RootNode,
72 0x0,
73 0x0,
74 0xFFFFFFFF);
75
76 //
77 // TODO:
78 // There's no such thing as "PnP" on embedded hardware.
79 // The boot loader will send us a device tree, similar to ACPI
80 // or OpenFirmware device trees, and we will convert it to ARC.
81 //
82
83 //
84 // Return the root node
85 //
86 return RootNode;
87 }
88
89 ULONG
90 ArmMemGetMemoryMap(OUT PBIOS_MEMORY_MAP BiosMemoryMap,
91 IN ULONG MaxMemoryMapSize)
92 {
93 //
94 // Return whatever the board returned to us (CS0 Base + Size and FLASH0)
95 //
96 RtlCopyMemory(BiosMemoryMap,
97 ArmBoardBlock->MemoryMap,
98 ArmBoardBlock->MemoryMapEntryCount * sizeof(BIOS_MEMORY_MAP));
99 return ArmBoardBlock->MemoryMapEntryCount;
100 }
101
102 VOID
103 MachInit(IN PCCH CommandLine)
104 {
105 //
106 // Setup board-specific ARM routines
107 //
108 switch (ArmBoardBlock->BoardType)
109 {
110 //
111 // Check for Feroceon-base boards
112 //
113 case ARM_FEROCEON:
114
115 //
116 // These boards use a UART16550. Set us up for 115200 bps
117 //
118 ArmFeroSerialInit(115200);
119 MachVtbl.ConsPutChar = ArmFeroPutChar;
120 MachVtbl.ConsKbHit = ArmFeroKbHit;
121 MachVtbl.ConsGetCh = ArmFeroGetCh;
122 break;
123
124 default:
125 ASSERT(FALSE);
126 }
127
128 //
129 // Setup generic ARM routines for all boards
130 //
131 MachVtbl.PrepareForReactOS = ArmPrepareForReactOS;
132 MachVtbl.GetMemoryMap = ArmMemGetMemoryMap;
133 MachVtbl.HwDetect = ArmHwDetect;
134
135 //
136 // Setup disk I/O routines, switch to ramdisk ones for non-NAND boot
137 //
138 MachVtbl.DiskReadLogicalSectors = ArmDiskReadLogicalSectors;
139 MachVtbl.DiskGetDriveGeometry = ArmDiskGetDriveGeometry;
140 MachVtbl.DiskGetCacheableBlockCount = ArmDiskGetCacheableBlockCount;
141 RamDiskSwitchFromBios();
142
143 //
144 // Now set default disk handling routines -- we don't need to override
145 //
146 MachVtbl.DiskGetBootVolume = DiskGetBootVolume;
147 MachVtbl.DiskGetSystemVolume = DiskGetSystemVolume;
148 MachVtbl.DiskGetBootPath = DiskGetBootPath;
149 MachVtbl.DiskGetBootDevice = DiskGetBootDevice;
150 MachVtbl.DiskBootingFromFloppy = DiskBootingFromFloppy;
151 MachVtbl.DiskNormalizeSystemPath = DiskNormalizeSystemPath;
152 MachVtbl.DiskGetPartitionEntry = DiskGetPartitionEntry;
153
154 //
155 // We can now print to the console
156 //
157 TuiPrintf("%s for ARM\n", GetFreeLoaderVersionString());
158 TuiPrintf("Bootargs: %s\n", CommandLine);
159 }