ReactOS 0.4.16-dev-340-g0540c21
hwinfo.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Boot Loader
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: boot/armllb/hw/versatile/hwinfo.c
5 * PURPOSE: LLB Hardware Info Routines
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9#include "precomp.h"
10
11#define PL031_RTC_DR (LlbHwVersaRtcBase + 0x00)
12static const ULONG LlbHwVersaRtcBase = 0x101E8000;
13
17{
19}
20
24{
25 return 24000000;
26}
27
31{
32 return 0x101E2000;
33}
34
38{
39 return 0;
40}
41
42//
43// Versatile Memory Map
44//
45// 0x00000000 - 0x000000FF ARM Vectors [ 1 KB]
46// 0x00000100 - 0x000001FF ATAG Structures [ 1 KB]
47// 0x00000200 - 0x0000FFFF ARM STACK [ 62 KB]
48// 0x00010000 - 0x0001FFFF ARM LLB [ 64 KB]
49// 0x00020000 - 0x0009FFFF ARM OS LOADER [512 KB]
50// 0x000A0000 - 0x0013FFFF ARM FRAMEBUFFER [640 KB]
51// 0x00140000 - 0x007FFFFF OS LOADER FREE/UNUSED [ 6 MB]
52// 0x00800000 - 0x017FFFFF KERNEL, HAL, INITIAL DRIVER LOAD ADDR [ 16 MB]
53// 0x01800000 - 0x037FFFFF RAM DISK [ 32 MB]
54// 0x03800000 - 0x07FFFFFF FREE RAM [ 72 MB]
55// 0x08000000 - 0x0FFFFFFF FREE RAM IF 256MB DEVICE [128 MB]
56// 0x10000000 - 0x1FFFFFFF MMIO DEVICES [256 MB]
58{
59 {0x00000000, 0x00000100, BiosMemoryReserved, 0},
60 {0x00000100, 0x00000100, BiosMemoryBootStrap, 0},
61 {0x00000200, 0x0000FE00, BiosMemoryBootStrap, 0},
62 {0x00010000, 0x00010000, BiosMemoryBootStrap, 0},
63 {0x00020000, 0x00080000, BiosMemoryBootLoader, 0},
64 {0x000A0000, 0x000A0000, BiosMemoryBootLoader, 0},
65 {0x00140000, 0x016C0000, BiosMemoryUsable, 0},
66 {0x01800000, 0x02000000, BiosMemoryReserved, 0},
67 {0x10000000, 0x10000000, BiosMemoryReserved, 0},
68 {0, 0, 0, 0}
69};
70
71VOID
74{
75 PBIOS_MEMORY_MAP MapEntry;
76 ULONG Base, Size, FsBase, FsSize;
77
78 /* Parse hardware memory map */
79 MapEntry = LlbHwVersaMemoryMap;
80 while (MapEntry->Length)
81 {
82 /* Add this entry */
83 LlbAllocateMemoryEntry(MapEntry->Type, MapEntry->BaseAddress, MapEntry->Length);
84
85 /* Move to the next one */
86 MapEntry++;
87 }
88
89 /* Query memory and RAMDISK information */
91 LlbEnvGetRamDiskInformation(&FsBase, &FsSize);
92
93 /* Add-in the size of the ramdisk */
94 Base = FsBase + FsSize;
95
96 /* Subtract size of ramdisk and anything else before it */
97 Size -= Base;
98
99 /* Allocate an entry for it */
101}
102
103ULONG
105{
106 /* Read RTC value */
108}
109/* EOF */
#define READ_REGISTER_ULONG(r)
Definition: arm.h:26
BIOS_MEMORY_MAP MemoryMap[32]
Definition: loader.c:11
VOID NTAPI LlbEnvGetMemoryInformation(IN PULONG Base, IN PULONG Size)
Definition: envir.c:97
BOOLEAN NTAPI LlbEnvGetRamDiskInformation(IN PULONG Base, IN PULONG Size)
Definition: envir.c:107
#define MACH_TYPE_VERSATILE_PB
Definition: machtype.h:19
_In_opt_ ULONG Base
Definition: rtlfuncs.h:2451
ULONG NTAPI LlbHwGetSerialUart(VOID)
Definition: hwinfo.c:34
ULONG NTAPI LlbHwGetBoardType(VOID)
Definition: hwinfo.c:13
ULONG LlbHwRtcRead(VOID)
Definition: hwinfo.c:132
VOID NTAPI LlbHwBuildMemoryMap(IN PBIOS_MEMORY_MAP MemoryMap)
Definition: hwinfo.c:101
ULONG NTAPI LlbHwGetPClk(VOID)
Definition: hwinfo.c:20
ULONG NTAPI LlbHwGetTmr0Base(VOID)
Definition: hwinfo.c:27
VOID NTAPI LlbAllocateMemoryEntry(IN BIOS_MEMORY_TYPE Type, IN ULONG BaseAddress, IN ULONG Length)
Definition: loader.c:17
@ BiosMemoryUsable
Definition: osloader.h:22
@ BiosMemoryBootStrap
Definition: osloader.h:24
@ BiosMemoryBootLoader
Definition: osloader.h:23
@ BiosMemoryReserved
Definition: osloader.h:25
LONGLONG BaseAddress
Definition: osloader.h:33
LONGLONG Length
Definition: osloader.h:34
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
static const ULONG LlbHwVersaRtcBase
Definition: hwinfo.c:12
#define PL031_RTC_DR
Definition: hwinfo.c:11
BIOS_MEMORY_MAP LlbHwVersaMemoryMap[]
Definition: hwinfo.c:57
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533