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
9 /* INCLUDES *******************************************************************/
13 /* GLOBALS ********************************************************************/
15 ULONG PageDirectoryStart
, PageDirectoryEnd
;
17 /* FUNCTIONS ******************************************************************/
20 ArmDiskGetDriveGeometry(IN ULONG DriveNumber
,
21 OUT PGEOMETRY Geometry
)
23 ASSERT(gRamDiskBase
== NULL
);
28 ArmDiskReadLogicalSectors(IN ULONG DriveNumber
,
29 IN ULONGLONG SectorNumber
,
33 ASSERT(gRamDiskBase
== NULL
);
38 ArmDiskGetCacheableBlockCount(IN ULONG DriveNumber
)
40 ASSERT(gRamDiskBase
== NULL
);
45 ArmPrepareForReactOS(IN BOOLEAN Setup
)
50 PCONFIGURATION_COMPONENT_DATA
53 PCONFIGURATION_COMPONENT_DATA RootNode
;
56 // Create the root node
58 FldrCreateSystemKey(&RootNode
);
61 // Write null component information
63 FldrSetComponentInformation(RootNode
,
70 // There's no such thing as "PnP" on embedded hardware.
71 // The boot loader will send us a device tree, similar to ACPI
72 // or OpenFirmware device trees, and we will convert it to ARC.
76 // Return the root node
82 ArmMemGetMemoryMap(OUT PBIOS_MEMORY_MAP BiosMemoryMap
,
83 IN ULONG MaxMemoryMapSize
)
86 // Return whatever the board returned to us (CS0 Base + Size and FLASH0)
88 RtlCopyMemory(BiosMemoryMap
,
89 ArmBoardBlock
->MemoryMap
,
90 ArmBoardBlock
->MemoryMapEntryCount
* sizeof(BIOS_MEMORY_MAP
));
91 return ArmBoardBlock
->MemoryMapEntryCount
;
95 MachInit(IN PCCH CommandLine
)
98 // Setup board-specific ARM routines
100 switch (ArmBoardBlock
->BoardType
)
103 // Check for Feroceon-base boards
105 case MACH_TYPE_FEROCEON
:
108 // These boards use a UART16550. Set us up for 115200 bps
110 ArmFeroSerialInit(115200);
111 MachVtbl
.ConsPutChar
= ArmFeroPutChar
;
112 MachVtbl
.ConsKbHit
= ArmFeroKbHit
;
113 MachVtbl
.ConsGetCh
= ArmFeroGetCh
;
117 // Check for ARM Versatile PB boards
119 case MACH_TYPE_VERSATILE_PB
:
122 // These boards use a PrimeCell UART (PL011)
124 ArmVersaSerialInit(115200);
125 MachVtbl
.ConsPutChar
= ArmVersaPutChar
;
126 MachVtbl
.ConsKbHit
= ArmVersaKbHit
;
127 MachVtbl
.ConsGetCh
= ArmVersaGetCh
;
135 // Setup generic ARM routines for all boards
137 MachVtbl
.PrepareForReactOS
= ArmPrepareForReactOS
;
138 MachVtbl
.GetMemoryMap
= ArmMemGetMemoryMap
;
139 MachVtbl
.HwDetect
= ArmHwDetect
;
142 // Setup disk I/O routines, switch to ramdisk ones for non-NAND boot
144 MachVtbl
.DiskReadLogicalSectors
= ArmDiskReadLogicalSectors
;
145 MachVtbl
.DiskGetDriveGeometry
= ArmDiskGetDriveGeometry
;
146 MachVtbl
.DiskGetCacheableBlockCount
= ArmDiskGetCacheableBlockCount
;
147 RamDiskSwitchFromBios();
150 // Now set default disk handling routines -- we don't need to override
152 MachVtbl
.DiskGetBootVolume
= DiskGetBootVolume
;
153 MachVtbl
.DiskGetSystemVolume
= DiskGetSystemVolume
;
154 MachVtbl
.DiskGetBootPath
= DiskGetBootPath
;
155 MachVtbl
.DiskGetBootDevice
= DiskGetBootDevice
;
156 MachVtbl
.DiskBootingFromFloppy
= DiskBootingFromFloppy
;
157 MachVtbl
.DiskNormalizeSystemPath
= DiskNormalizeSystemPath
;
158 MachVtbl
.DiskGetPartitionEntry
= DiskGetPartitionEntry
;
161 // We can now print to the console
163 TuiPrintf("%s for ARM\n", GetFreeLoaderVersionString());
164 TuiPrintf("Bootargs: %s\n", CommandLine
);
168 FrLdrStartup(IN ULONG Magic
)