]> git.proxmox.com Git - mirror_edk2.git/blob - QuarkPlatformPkg/Platform/Dxe/PlatformInit/PlatformInitDxe.c
ArmPkg/CompilerIntrinsicsLib: Add uread, uwrite GCC assembly sources
[mirror_edk2.git] / QuarkPlatformPkg / Platform / Dxe / PlatformInit / PlatformInitDxe.c
1 /** @file
2 Platform init DXE driver for this platform.
3
4 Copyright (c) 2013 Intel Corporation.
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 //
11 // Statements that include other files
12 //
13 #include "PlatformInitDxe.h"
14 #include <Library/PciLib.h>
15 #include <IndustryStandard/Pci.h>
16
17 VOID
18 GetQncName (
19 VOID
20 )
21 {
22 DEBUG ((EFI_D_INFO, "QNC Name: "));
23 switch (PciRead16 (PCI_LIB_ADDRESS (MC_BUS, MC_DEV, MC_FUN, PCI_DEVICE_ID_OFFSET))) {
24 case QUARK_MC_DEVICE_ID:
25 DEBUG ((EFI_D_INFO, "Quark"));
26 break;
27 case QUARK2_MC_DEVICE_ID:
28 DEBUG ((EFI_D_INFO, "Quark2"));
29 break;
30 default:
31 DEBUG ((EFI_D_INFO, "Unknown"));
32 }
33
34 //
35 // Revision
36 //
37 switch (PciRead8 (PCI_LIB_ADDRESS (MC_BUS, MC_DEV, MC_FUN, PCI_REVISION_ID_OFFSET))) {
38 case QNC_MC_REV_ID_A0:
39 DEBUG ((EFI_D_INFO, " - A0 stepping\n"));
40 break;
41 default:
42 DEBUG ((EFI_D_INFO, " - xx\n"));
43 }
44
45 return;
46 }
47
48 EFI_STATUS
49 EFIAPI
50 PlatformInit (
51 IN EFI_HANDLE ImageHandle,
52 IN EFI_SYSTEM_TABLE *SystemTable
53 )
54 /*++
55
56 Routine Description:
57 Entry point for the driver.
58
59 Arguments:
60
61 ImageHandle - Image Handle.
62 SystemTable - EFI System Table.
63
64 Returns:
65
66 EFI_SUCCESS - Function has completed successfully.
67
68 --*/
69 {
70 EFI_STATUS Status;
71
72 GetQncName();
73
74 //
75 // Create events for configuration callbacks.
76 //
77 CreateConfigEvents ();
78
79 //
80 // Init Platform LEDs.
81 //
82 Status = PlatformLedInit ((EFI_PLATFORM_TYPE)PcdGet16 (PcdPlatformType));
83 ASSERT_EFI_ERROR (Status);
84
85 return EFI_SUCCESS;
86 }
87