Hisilicon/PlatformBm: add gpiokey board

Use GPIO keyboard as ConsoleIn.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
diff --git a/Platforms/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c b/Platforms/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
index 9bf355e..f7b118f 100644
--- a/Platforms/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
+++ b/Platforms/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
@@ -50,6 +50,11 @@
           { 0x8C, 0xAF, 0x49, 0x67, 0xEB, 0x62, 0x72, 0x41 } \

           }

 

+#define GPIO_KBD_DXE_FILE_GUID { \

+          0xd1927a35, 0x11fa, 0x44d0, \

+          { 0x9d, 0x91, 0xda, 0xce, 0x09, 0x22, 0x5d, 0x8d } \

+          }

+

 STATIC PLATFORM_SERIAL_CONSOLE mSerialConsole = {

   //

   // VENDOR_DEVICE_PATH SerialDxe

@@ -126,6 +131,30 @@
   }

 };

 

+#pragma pack (1)

+typedef struct {

+  VENDOR_DEVICE_PATH       Keyboard;

+  EFI_DEVICE_PATH_PROTOCOL End;

+} PLATFORM_GPIO_KEYBOARD;

+#pragma pack ()

+

+STATIC PLATFORM_GPIO_KEYBOARD mGpioKeyboard = {

+  //

+  // VENDOR_DEVICE_PATH Keyboard

+  //

+  {

+    { HARDWARE_DEVICE_PATH, HW_VENDOR_DP, DP_NODE_LEN (VENDOR_DEVICE_PATH) },

+    GPIO_KBD_DXE_FILE_GUID

+  },

+

+  //

+  // EFI_DEVICE_PATH_PROTOCOL End

+  //

+  {

+    END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE,

+    DP_NODE_LEN (EFI_DEVICE_PATH_PROTOCOL)

+  }

+};

 

 /**

   Check if the handle satisfies a particular condition.

@@ -503,6 +532,12 @@
     (EFI_DEVICE_PATH_PROTOCOL *)&mUsbKeyboard, NULL);

 

   //

+  // Add the hardcoded short-form GPIO keyboard device path to ConIn.

+  //

+  EfiBootManagerUpdateConsoleVariable (ConIn,

+    (EFI_DEVICE_PATH_PROTOCOL *)&mGpioKeyboard, NULL);

+

+  //

   // Add the hardcoded serial console device path to ConIn, ConOut, ErrOut.

   //

   ASSERT (FixedPcdGet8 (PcdDefaultTerminalType) == 4);