]> git.proxmox.com Git - mirror_edk2.git/blame - QuarkPlatformPkg/Platform/Dxe/PlatformInit/PlatformInitDxe.c
QuarkPlatformPkg: Add new package for Galileo boards
[mirror_edk2.git] / QuarkPlatformPkg / Platform / Dxe / PlatformInit / PlatformInitDxe.c
CommitLineData
b303605e
MK
1/** @file\r
2Platform init DXE driver for this platform.\r
3\r
4Copyright (c) 2013 Intel Corporation.\r
5\r
6This program and the accompanying materials\r
7are licensed and made available under the terms and conditions of the BSD License\r
8which accompanies this distribution. The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16//\r
17// Statements that include other files\r
18//\r
19#include "PlatformInitDxe.h"\r
20#include <Library/PciLib.h>\r
21#include <IndustryStandard/Pci.h>\r
22\r
23VOID\r
24GetQncName (\r
25 VOID\r
26 )\r
27{\r
28 DEBUG ((EFI_D_INFO, "QNC Name: "));\r
29 switch (PciRead16 (PCI_LIB_ADDRESS (MC_BUS, MC_DEV, MC_FUN, PCI_DEVICE_ID_OFFSET))) {\r
30 case QUARK_MC_DEVICE_ID:\r
31 DEBUG ((EFI_D_INFO, "Quark"));\r
32 break;\r
33 case QUARK2_MC_DEVICE_ID:\r
34 DEBUG ((EFI_D_INFO, "Quark2"));\r
35 break;\r
36 default:\r
37 DEBUG ((EFI_D_INFO, "Unknown"));\r
38 }\r
39\r
40 //\r
41 // Revision\r
42 //\r
43 switch (PciRead8 (PCI_LIB_ADDRESS (MC_BUS, MC_DEV, MC_FUN, PCI_REVISION_ID_OFFSET))) {\r
44 case QNC_MC_REV_ID_A0:\r
45 DEBUG ((EFI_D_INFO, " - A0 stepping\n"));\r
46 break;\r
47 default:\r
48 DEBUG ((EFI_D_INFO, " - xx\n"));\r
49 }\r
50\r
51 return;\r
52}\r
53\r
54EFI_STATUS\r
55EFIAPI\r
56PlatformInit (\r
57 IN EFI_HANDLE ImageHandle,\r
58 IN EFI_SYSTEM_TABLE *SystemTable\r
59 )\r
60/*++\r
61\r
62Routine Description:\r
63 Entry point for the driver.\r
64\r
65Arguments:\r
66\r
67 ImageHandle - Image Handle.\r
68 SystemTable - EFI System Table.\r
69\r
70Returns:\r
71\r
72 EFI_SUCCESS - Function has completed successfully.\r
73\r
74--*/\r
75{\r
76 EFI_STATUS Status;\r
77\r
78 GetQncName();\r
79\r
80 //\r
81 // Create events for configuration callbacks.\r
82 //\r
83 CreateConfigEvents ();\r
84\r
85 //\r
86 // Init Platform LEDs.\r
87 //\r
88 Status = PlatformLedInit ((EFI_PLATFORM_TYPE)PcdGet16 (PcdPlatformType));\r
89 ASSERT_EFI_ERROR (Status);\r
90\r
91 return EFI_SUCCESS;\r
92}\r
93\r