xref: /reactos/boot/armllb/hw/omap3-zoom2/hwinit.c (revision 3e1f4074)
1 /*
2  * PROJECT:         ReactOS Boot Loader
3  * LICENSE:         BSD - See COPYING.ARM in the top level directory
4  * FILE:            boot/armllb/hw/omap3-zoom2/hwinit.c
5  * PURPOSE:         LLB UART Initialization Routines for OMAP3 ZOOM2
6  * PROGRAMMERS:     ReactOS Portable Systems Group
7  */
8 
9 #include "precomp.h"
10 
11 //
12 // OMAP3 Memory Map
13 //
14 // 0x00000000 - 0x3FFFFFFF GPMC                                     [  1 GB]
15 // 0x40000000 - 0x47FFFFFF On-Chip Memory (ROM/SRAM Address Space)  [128 MB]
16 // 0x48000000 - 0x4FFFFFFF L4 Interconnects (All system peripherals)[128 MB]
17 // 0x50000000 - 0x53FFFFFF SGX Graphics Accelerator Slave Port      [ 64 MB]
18 // 0x54000000 - 0x57FFFFFF L4 Emulation                             [128 MB]
19 // 0x58000000 - 0x58FFFFFF Reserved                                 [ 64 MB]
20 // 0x5C000000 - 0x5FFFFFFF IVA2.2 Subsystem                         [ 64 MB]
21 // 0x60000000 - 0x67FFFFFF Reserved                                 [128 MB]
22 // 0x68000000 - 0x6FFFFFFF L3 Interconnect (Control Registers)      [128 MB]
23 // 0x70000000 - 0x7FFFFFFF SDRC/SMS Virtual Address Space 0         [256 MB]
24 // 0x80000000 - 0x9FFFFFFF SDRC/SMS CS0 SDRAM                       [512 MB]
25     // 0x80000000 - 0x80FFFFFF KERNEL, HAL, BOOT DRIVERS            [ 16 MB]
26 // THIS IS THE x86-STYLE "LOW 1MB" THAT IS IDENTITY MAPPED
27     // 0x81000000 - 0x8100FFFF ARM LLB                              [ 64 KB]
28     // 0x81010000 - 0x81013FFF ARM BOOT STACK                       [ 16 KB]
29     // 0x81014000 - 0x81073FFF ARM FRAMEBUFFER                      [384 KB]
30     // 0x81070000 - 0x81093FFF ARM OS LOADER                        [128 KB]
31     // 0x81094000 - 0x810FFFFF RESERVED FOR BOOT LOADER EXPANSION   [432 KB]
32 // END OF THE x86-STYLE "LOW 1MB" THAT IS IDENTITY MAPPED
33     // 0x81100000 - 0x8FFFFFFF FREE RAM                             [ 15 MB]
34     // 0x82000000 - 0x83FFFFFF ARM RAMDISK                          [ 32 MB]
35     // 0x84000000 - 0x8FFFFFFF FREE RAM                             [192 MB]
36     // 0x90000000 - 0x9FFFFFFF FREE RAM IF > 256MB INSTALLED        [256 MB]
37 // 0xA0000000 - 0xBFFFFFFF SDRC/SMS CS1 SDRAM                       [512 MB]
38     // 0xA0000000 - 0xAFFFFFFF FREE RAM IF > 512MB INSTALLED        [256 MB]
39     // 0xB0000000 - 0xBFFFFFFF FREE RAM IF > 768MB INSTALLED        [256 MB]
40 // 0xC0000000 - 0xDFFFFFFF Reserved                                 [512 MB]
41 // 0xE0000000 - 0xFFFFFFFF SDRC/SMS Virtual Address Space 1         [512 MB]
42 BIOS_MEMORY_MAP LlbHwOmap3MemoryMap[] =
43 {
44     {0x00000000, 0x80000000, BiosMemoryReserved,   0}, /* Device Registers */
45     {0x80000000, 0x01000000, BiosMemoryUsable,     0}, /* 16 MB RAM for Kernel map */
46     {0x81000000, 0x00010000, BiosMemoryBootLoader, 0}, /* Arm LLB */
47     {0x81010000, 0x00004000, BiosMemoryBootStrap,  0}, // LLB Stack
48     {0x81014000, 0x00060000, BiosMemoryBootLoader, 0}, /* Kernel Framebuffer */
49     {0x81070000, 0x00020000, BiosMemoryBootStrap,  0}, /* ARM OS Loader */
50     {0x81094000, 0x0006C000, BiosMemoryBootStrap,  0}, /* ARM OS Loader Expansion */
51     {0x81100000, 0x00F00000, BiosMemoryUsable,     0}, /* 15 MB Free RAM */
52     {0x82000000, 0x02000000, BiosMemoryBootStrap,  0}, /* 32MB RAMDISK */
53     {0x84000000, 0x0C000000, BiosMemoryUsable,     0}, /* 192 MB Free RAM */
54     {0x90000000, 0x70000000, BiosMemoryReserved,   0},
55     {0, 0, 0, 0}
56 };
57 
58 VOID
59 NTAPI
60 LlbHwBuildMemoryMap(IN PBIOS_MEMORY_MAP MemoryMap)
61 {
62     PBIOS_MEMORY_MAP MapEntry;
63     ULONG Base, Size, FsBase, FsSize;
64 
65     /* Parse hardware memory map */
66     MapEntry = LlbHwOmap3MemoryMap;
67     while (MapEntry->Length)
68     {
69         /* Add this entry */
70         LlbAllocateMemoryEntry(MapEntry->Type, MapEntry->BaseAddress, MapEntry->Length);
71 
72         /* Move to the next one */
73         MapEntry++;
74     }
75 
76     /* Query memory and RAMDISK information */
77     LlbEnvGetMemoryInformation(&Base, &Size);
78     LlbEnvGetRamDiskInformation(&FsBase, &FsSize);
79     if (!FsSize) return;
80 #ifdef _BEAGLE_
81     /* Add-in the size of the ramdisk */
82     Base = FsBase + FsSize;
83 
84     /* Subtract size of ramdisk and anything else before it */
85     Size -= Base;
86 
87     /* Allocate an entry for it */
88     LlbAllocateMemoryEntry(BiosMemoryUsable, Base, Size);
89 #endif
90 }
91 
92 VOID
93 NTAPI
94 LlbHwInitialize(VOID)
95 {
96     /* Setup the UART (NS16550) */
97     LlbHwOmap3UartInitialize();
98 
99     /* Setup the NEC WVGA LCD Panel and the Display Controller */
100     LlbHwOmap3LcdInitialize();
101 
102     /* Setup the keyboard */
103     LlbHwOmap3SynKpdInitialize();
104 }
105 
106 /* EOF */
107