[freeldr] Rework the ramdisk driver to let it be a full device, instead of a deprecat...
[reactos.git] / reactos / boot / freeldr / freeldr / arch / arm / macharm.c
index 6e2595f..c636a0a 100644 (file)
@@ -12,6 +12,8 @@
 
 /* GLOBALS ********************************************************************/
 
+UCHAR BootStack[0x4000];
+PUCHAR BootStackEnd = &BootStack[0x3FFF];
 PARM_BOARD_CONFIGURATION_BLOCK ArmBoardBlock;
 ULONG BootDrive, BootPartition;
 VOID ArmPrepareForReactOS(IN BOOLEAN Setup);
@@ -40,7 +42,8 @@ ArmInit(IN PARM_BOARD_CONFIGURATION_BLOCK BootContext)
     // This should probably go away once we support more boards
     //
     ASSERT((ArmBoardBlock->BoardType == MACH_TYPE_FEROCEON) ||
-           (ArmBoardBlock->BoardType == MACH_TYPE_VERSATILE_PB));
+           (ArmBoardBlock->BoardType == MACH_TYPE_VERSATILE_PB) ||
+           (ArmBoardBlock->BoardType == MACH_TYPE_OMAP3_BEAGLE));
 
     //
     // Save data required for memory initialization
@@ -68,7 +71,6 @@ BOOLEAN
 ArmDiskGetDriveGeometry(IN ULONG DriveNumber,
                         OUT PGEOMETRY Geometry)
 {
-    ASSERT(gRamDiskBase == NULL);
     return FALSE;
 }
 
@@ -78,15 +80,13 @@ ArmDiskReadLogicalSectors(IN ULONG DriveNumber,
                           IN ULONG SectorCount,
                           IN PVOID Buffer)
 {
-    ASSERT(gRamDiskBase == NULL);
     return FALSE;
 }
 
 ULONG
 ArmDiskGetCacheableBlockCount(IN ULONG DriveNumber)
 {
-    ASSERT(gRamDiskBase == NULL);
-    return FALSE;
+    return 0;
 }
 
 PCONFIGURATION_COMPONENT_DATA
@@ -99,14 +99,6 @@ ArmHwDetect(VOID)
     //
     FldrCreateSystemKey(&RootNode);
     
-    //
-    // Write null component information
-    //
-    FldrSetComponentInformation(RootNode,
-                                0x0,
-                                0x0,
-                                0xFFFFFFFF);
-    
     //
     // TODO:
     // There's no such thing as "PnP" on embedded hardware.
@@ -169,10 +161,25 @@ MachInit(IN PCCH CommandLine)
             MachVtbl.ConsGetCh = ArmVersaGetCh;
             break;
             
+        //
+        // Check for TI OMAP3 boards
+        // For now that means only Beagle, but ZOOM and others should be ok too
+        //
+        case MACH_TYPE_OMAP3_BEAGLE:
+            
+            //
+            // These boards use a UART16550
+            //
+            ArmOmap3SerialInit(115200);
+            MachVtbl.ConsPutChar = ArmOmap3PutChar;
+            MachVtbl.ConsKbHit = ArmOmap3KbHit;
+            MachVtbl.ConsGetCh = ArmOmap3GetCh;
+            break;
+            
         default:
             ASSERT(FALSE);
     }
-    
+        
     //
     // Setup generic ARM routines for all boards
     //
@@ -181,23 +188,17 @@ MachInit(IN PCCH CommandLine)
     MachVtbl.HwDetect = ArmHwDetect;
     
     //
-    // Setup disk I/O routines, switch to ramdisk ones for non-NAND boot
+    // Setup disk I/O routines
     //
     MachVtbl.DiskReadLogicalSectors = ArmDiskReadLogicalSectors;
     MachVtbl.DiskGetDriveGeometry = ArmDiskGetDriveGeometry;
     MachVtbl.DiskGetCacheableBlockCount = ArmDiskGetCacheableBlockCount;
-    RamDiskSwitchFromBios();
     
     //
     // Now set default disk handling routines -- we don't need to override
     //
-    MachVtbl.DiskGetBootVolume = DiskGetBootVolume;
-    MachVtbl.DiskGetSystemVolume = DiskGetSystemVolume;
     MachVtbl.DiskGetBootPath = DiskGetBootPath;
-    MachVtbl.DiskGetBootDevice = DiskGetBootDevice;
-    MachVtbl.DiskBootingFromFloppy = DiskBootingFromFloppy;
     MachVtbl.DiskNormalizeSystemPath = DiskNormalizeSystemPath;
-    MachVtbl.DiskGetPartitionEntry = DiskGetPartitionEntry;
     
     //
     // We can now print to the console