1 /** @file
2 *
3 * Copyright (c) 2015, Hisilicon Limited. All rights reserved.
4 * Copyright (c) 2015, Linaro Limited. All rights reserved.
5 *
6 * This program and the accompanying materials
7 * are licensed and made available under the terms and conditions of the BSD License
8 * which accompanies this distribution. The full text of the license may be found at
9 * http://opensource.org/licenses/bsd-license.php
10 *
11 * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 *
14 **/
15
16 #include <Uefi.h>
17 #include <Library/DebugLib.h>
18 #include <Library/UefiBootServicesTableLib.h>
19
20 #include <Library/PlatformSysCtrlLib.h>
21 #include <Library/SerdesLib.h>
22
23 VOID
24 EFIAPI
ExitBootServicesEventSmmu(IN EFI_EVENT Event,IN VOID * Context)25 ExitBootServicesEventSmmu (
26 IN EFI_EVENT Event,
27 IN VOID *Context
28 )
29 {
30 SmmuConfigForOS ();
31 DEBUG((EFI_D_INFO,"SMMU ExitBootServicesEvent\n"));
32 }
33
34
35 EFI_STATUS
36 EFIAPI
IoInitDxeEntry(IN EFI_HANDLE ImageHandle,IN EFI_SYSTEM_TABLE * SystemTable)37 IoInitDxeEntry (
38 IN EFI_HANDLE ImageHandle,
39 IN EFI_SYSTEM_TABLE *SystemTable)
40 {
41 EFI_STATUS Status;
42 EFI_EVENT Event = NULL;
43
44 (VOID) EfiSerdesInitWrap ();
45
46 SmmuConfigForBios ();
47
48 Status = gBS->CreateEvent (
49 EVT_SIGNAL_EXIT_BOOT_SERVICES,
50 TPL_CALLBACK,
51 ExitBootServicesEventSmmu,
52 NULL,
53 &Event
54 );
55
56 if (EFI_ERROR(Status))
57 {
58 DEBUG ((EFI_D_ERROR, "[%a:%d] - CreateEvent failed: %r\n", __FUNCTION__,
59 __LINE__, Status));
60 }
61
62 return Status;
63 }
64
65