summaryrefslogtreecommitdiff
path: root/HisiPkg/HiKeyPkg
diff options
context:
space:
mode:
Diffstat (limited to 'HisiPkg/HiKeyPkg')
-rw-r--r--HisiPkg/HiKeyPkg/Drivers/HiKeyDxe/HiKeyDxe.c1
-rw-r--r--HisiPkg/HiKeyPkg/Drivers/HiKeyDxe/HiKeyDxe.inf1
-rw-r--r--HisiPkg/HiKeyPkg/Drivers/HiKeyDxe/HiKeyDxeInternal.h5
-rw-r--r--HisiPkg/HiKeyPkg/Drivers/HiKeyDxe/InitPeripherals.c34
4 files changed, 41 insertions, 0 deletions
diff --git a/HisiPkg/HiKeyPkg/Drivers/HiKeyDxe/HiKeyDxe.c b/HisiPkg/HiKeyPkg/Drivers/HiKeyDxe/HiKeyDxe.c
index 400efc47d..157baf4a8 100644
--- a/HisiPkg/HiKeyPkg/Drivers/HiKeyDxe/HiKeyDxe.c
+++ b/HisiPkg/HiKeyPkg/Drivers/HiKeyDxe/HiKeyDxe.c
@@ -175,6 +175,7 @@ HiKeyEntryPoint (
HiKeyInitSerialNo ();
HiKeyInitBootDevice ();
+ HiKeyInitPeripherals ();
// Try to install the Flat Device Tree (FDT). This function actually installs the
// UEFI Driver Binding Protocol.
diff --git a/HisiPkg/HiKeyPkg/Drivers/HiKeyDxe/HiKeyDxe.inf b/HisiPkg/HiKeyPkg/Drivers/HiKeyDxe/HiKeyDxe.inf
index d614a1b00..895bac682 100644
--- a/HisiPkg/HiKeyPkg/Drivers/HiKeyDxe/HiKeyDxe.inf
+++ b/HisiPkg/HiKeyPkg/Drivers/HiKeyDxe/HiKeyDxe.inf
@@ -22,6 +22,7 @@
[Sources.common]
HiKeyDxe.c
+ InitPeripherals.c
InstallFdt.c
InstallBootMenu.c
diff --git a/HisiPkg/HiKeyPkg/Drivers/HiKeyDxe/HiKeyDxeInternal.h b/HisiPkg/HiKeyPkg/Drivers/HiKeyDxe/HiKeyDxeInternal.h
index 26344ccad..82ff92d59 100644
--- a/HisiPkg/HiKeyPkg/Drivers/HiKeyDxe/HiKeyDxeInternal.h
+++ b/HisiPkg/HiKeyPkg/Drivers/HiKeyDxe/HiKeyDxeInternal.h
@@ -34,4 +34,9 @@ HiKeyBootMenuInstall (
IN VOID
);
+EFI_STATUS
+HiKeyInitPeripherals (
+ IN VOID
+ );
+
#endif // __HIKEY_DXE_INTERNAL_H__
diff --git a/HisiPkg/HiKeyPkg/Drivers/HiKeyDxe/InitPeripherals.c b/HisiPkg/HiKeyPkg/Drivers/HiKeyDxe/InitPeripherals.c
new file mode 100644
index 000000000..c905dc6c6
--- /dev/null
+++ b/HisiPkg/HiKeyPkg/Drivers/HiKeyDxe/InitPeripherals.c
@@ -0,0 +1,34 @@
+/** @file
+*
+* Copyright (c) 2015, Linaro Ltd. All rights reserved.
+* Copyright (c) 2015, Hisilicon Ltd. All rights reserved.
+*
+* This program and the accompanying materials
+* are licensed and made available under the terms and conditions of the BSD License
+* which accompanies this distribution. The full text of the license may be found at
+* http://opensource.org/licenses/bsd-license.php
+*
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+*
+**/
+
+#include <Library/IoLib.h>
+
+#include "Hi6220RegsPeri.h"
+
+VOID
+EFIAPI
+HiKeyInitPeripherals (
+ IN VOID
+ )
+{
+ UINT32 Data;
+
+ /* make I2C2 out of reset */
+ MmioWrite32 (SC_PERIPH_RSTDIS3, PERIPH_RST3_I2C2);
+
+ do {
+ Data = MmioRead32 (SC_PERIPH_RSTSTAT3);
+ } while (Data & PERIPH_RST3_I2C2);
+}