LlbHwGetSerialUart(VOID)
{
return 0;
-}
+}
+
+//
+// Versatile Memory Map
+//
+// 0x00000000 - 0x000000FF ARM Vectors [ 1 KB]
+// 0x00000100 - 0x000001FF ATAG Structures [ 1 KB]
+// 0x00000200 - 0x0000FFFF ARM STACK [ 62 KB]
+// 0x00010000 - 0x0001FFFF ARM LLB [ 64 KB]
+// 0x00020000 - 0x0009FFFF ARM OS LOADER [512 KB]
+// 0x000A0000 - 0x007FFFFF OS LOADER FREE/UNUSED [7.3 MB]
+// 0x00800000 - 0x017FFFFF KERNEL, HAL, INITIAL DRIVER LOAD ADDR [ 16 MB]
+// 0x01800000 - 0x037FFFFF RAM DISK [ 32 MB]
+// 0x03800000 - 0x07FFFFFF FREE RAM [ 72 MB]
+// 0x08000000 - 0x0FFFFFFF FREE RAM IF 256MB DEVICE [128 MB]
+// 0x10000000 - 0x1FFFFFFF MMIO DEVICES [256 MB]
+BIOS_MEMORY_MAP LlbHwVersaMemoryMap[] =
+{
+ {0x00000000, 0x00000100, BiosMemoryReserved, 0},
+ {0x00000100, 0x00000100, BiosMemoryBootStrap, 0},
+ {0x00000200, 0x0000FE00, BiosMemoryBootStrap, 0},
+ {0x00010000, 0x00010000, BiosMemoryBootStrap, 0},
+ {0x00020000, 0x00080000, BiosMemoryBootLoader, 0},
+ {0x00080000, 0x01000000, BiosMemoryUsable, 0},
+ {0x01800000, 0x02000000, BiosMemoryReserved, 0},
+ {0x10000000, 0x10000000, BiosMemoryReserved, 0},
+ {0, 0, 0, 0}
+};
VOID
NTAPI
LlbHwBuildMemoryMap(IN PBIOS_MEMORY_MAP MemoryMap)
{
- /* Mark MMIO space as reserved */
- LlbAllocateMemoryEntry(BiosMemoryReserved, 0x10000000, 128 * 1024 * 1024);
+ PBIOS_MEMORY_MAP MapEntry;
+ ULONG Base, Size, FsBase, FsSize;
+
+ /* Parse hardware memory map */
+ MapEntry = LlbHwVersaMemoryMap;
+ while (MapEntry->Length)
+ {
+ /* Add this entry */
+ LlbAllocateMemoryEntry(MapEntry->Type, MapEntry->BaseAddress, MapEntry->Length);
+
+ /* Move to the next one */
+ MapEntry++;
+ }
+
+ /* Query memory and RAMDISK information */
+ LlbEnvGetMemoryInformation(&Base, &Size);
+ LlbEnvGetRamDiskInformation(&FsBase, &FsSize);
+
+ /* Add-in the size of the ramdisk */
+ Base = FsBase + FsSize;
+
+ /* Subtract size of ramdisk and anything else before it */
+ Size -= Base;
+
+ /* Allocate an entry for it */
+ LlbAllocateMemoryEntry(BiosMemoryUsable, Base, Size);
}
ULONG
PCHAR Offset;
CHAR CommandLine[64];
- /* On versatile, the NAND image is loaded as the RAMDISK */
- LlbEnvGetRamDiskInformation(&Base, &Size);
+ /* On versatile we load the RAMDISK with initrd */
+ LlbEnvGetRamDiskInformation(&RootFs, &Size);
- /* The LLB is first, which we already have, so skip it */
- Base += 0x10000; // 64 KB (see nandflash)
-
- /* The OS loader is next, followed by the root file system */
- RootFs = Base + 0x80000; // 512 KB (see nandflash)
+ /* The OS Loader is at 0x20000, always */
+ Base = 0x20000;
/* Read image offset */
Offset = LlbEnvRead("rdoffset");
NTAPI
LlbBuildMemoryMap(VOID)
{
- ULONG Base, Size;
-
/* Zero out the memory map */
memset(MemoryMap, 0, sizeof(MemoryMap));
-
- /* Query memory information */
- LlbEnvGetMemoryInformation(&Base, &Size);
-
- /* Don't use memory that the RAMDISK is using */
- /* HACK HACK */
- Base += 32 * 1024 * 1024;
- Size -= 32 * 1024 * 1024;
-
- /* Allocate an entry for it */
- LlbAllocateMemoryEntry(BiosMemoryUsable, Base, Size);
/* Call the hardware-specific function for hardware-defined regions */
LlbHwBuildMemoryMap(MemoryMap);
{ { MemoryFirmwarePermanent, 0xA0, 0x60 }, 6, }, // ROM / Video
{ { MemorySpecialMemory, 0xFFF, 1 }, 7, }, // unusable memory
#elif __arm__ // This needs to be done per-platform specific way
- { { MemoryLoadedProgram, 0x80000, 32 }, 0, }, // X-Loader + OmapLdr
- { { MemoryLoadedProgram, 0x81000, 128 }, 1, }, // FreeLDR
- { { MemoryFirmwareTemporary, 0x80500, 4096 }, 2, }, // Video Buffer
+
#endif
};
MEMORY_DESCRIPTOR*