Re: [edk2] [PATCH] ArmPkg/PlatformBootManagerLib: implement new generic version

2016-05-12 Thread Leif Lindholm
On 11 May 2016 at 13:57, Ard Biesheuvel  wrote:
> On 11 May 2016 at 14:54, Laszlo Ersek  wrote:
>> On 05/11/16 14:47, Ard Biesheuvel wrote:
>>> This implements the platform glue for the new generic BDS implementation.
>>> It is based on the ArmVirtQemu version, with the QEMU references removed.
>>>
>>> Contributed-under: TianoCore Contribution Agreement 1.0
>>> Signed-off-by: Ard Biesheuvel 
>>> ---
>>>  ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c   | 562 
>>> 
>>>  ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h   |  59 ++
>>>  ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf |  86 +++
>>>  ArmPkg/Library/PlatformBootManagerLib/QuietBoot.c| 680 
>>> 
>>>  4 files changed, 1387 insertions(+)
>>
>>> +  //~ Status = gRT->GetVariable (L"Timeout",
>>> +  //~ ,
>>> +  //~ NULL,
>>> +  //~ sizeof (Timeout),
>>> +  //~ );
>>> +  //~ if (!EFI_ERROR (Status)) {
>>> +//~ PcdSet16 (PcdPlatformBootTimeOut, Timeout);
>>> +  //~ }
>>
>> Forgotten or intentional?
>>
>
> Forgotten.
>
> I discovered that this
>
> [PcdsDynamicExHii.common.DEFAULT]
>   
> gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|5
>
> does the trick nicely.
>
> Thanks for spotting that.

Provided you clean that up on commit:
Reviewed-by: Leif Lindholm 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ArmPkg/PlatformBootManagerLib: implement new generic version

2016-05-11 Thread Ard Biesheuvel
On 11 May 2016 at 14:54, Laszlo Ersek  wrote:
> On 05/11/16 14:47, Ard Biesheuvel wrote:
>> This implements the platform glue for the new generic BDS implementation.
>> It is based on the ArmVirtQemu version, with the QEMU references removed.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Ard Biesheuvel 
>> ---
>>  ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c   | 562 
>> 
>>  ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h   |  59 ++
>>  ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf |  86 +++
>>  ArmPkg/Library/PlatformBootManagerLib/QuietBoot.c| 680 
>> 
>>  4 files changed, 1387 insertions(+)
>
>> +  //~ Status = gRT->GetVariable (L"Timeout",
>> +  //~ ,
>> +  //~ NULL,
>> +  //~ sizeof (Timeout),
>> +  //~ );
>> +  //~ if (!EFI_ERROR (Status)) {
>> +//~ PcdSet16 (PcdPlatformBootTimeOut, Timeout);
>> +  //~ }
>
> Forgotten or intentional?
>

Forgotten.

I discovered that this

[PcdsDynamicExHii.common.DEFAULT]
  
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|5

does the trick nicely.

Thanks for spotting that.

Ard.
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ArmPkg/PlatformBootManagerLib: implement new generic version

2016-05-11 Thread Laszlo Ersek
On 05/11/16 14:47, Ard Biesheuvel wrote:
> This implements the platform glue for the new generic BDS implementation.
> It is based on the ArmVirtQemu version, with the QEMU references removed.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel 
> ---
>  ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c   | 562 
> 
>  ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h   |  59 ++
>  ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf |  86 +++
>  ArmPkg/Library/PlatformBootManagerLib/QuietBoot.c| 680 
> 
>  4 files changed, 1387 insertions(+)

> +  //~ Status = gRT->GetVariable (L"Timeout",
> +  //~ ,
> +  //~ NULL,
> +  //~ sizeof (Timeout),
> +  //~ );
> +  //~ if (!EFI_ERROR (Status)) {
> +//~ PcdSet16 (PcdPlatformBootTimeOut, Timeout);
> +  //~ }

Forgotten or intentional?

Thanks
Laszlo

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH] ArmPkg/PlatformBootManagerLib: implement new generic version

2016-05-11 Thread Ard Biesheuvel
This implements the platform glue for the new generic BDS implementation.
It is based on the ArmVirtQemu version, with the QEMU references removed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel 
---
 ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c   | 562 

 ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h   |  59 ++
 ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf |  86 +++
 ArmPkg/Library/PlatformBootManagerLib/QuietBoot.c| 680 

 4 files changed, 1387 insertions(+)

diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c 
b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
new file mode 100644
index ..175220122b5e
--- /dev/null
+++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
@@ -0,0 +1,562 @@
+/** @file
+  Implementation for PlatformBootManagerLib library class interfaces.
+
+  Copyright (C) 2015-2016, Red Hat, Inc.
+  Copyright (c) 2014, ARM Ltd. All rights reserved.
+  Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
+  Copyright (c) 2016, Linaro 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "PlatformBm.h"
+
+#define DP_NODE_LEN(Type) { (UINT8)sizeof (Type), (UINT8)(sizeof (Type) >> 8) }
+
+
+#pragma pack (1)
+typedef struct {
+  VENDOR_DEVICE_PATH SerialDxe;
+  UART_DEVICE_PATH   Uart;
+  VENDOR_DEFINED_DEVICE_PATH TermType;
+  EFI_DEVICE_PATH_PROTOCOL   End;
+} PLATFORM_SERIAL_CONSOLE;
+#pragma pack ()
+
+#define SERIAL_DXE_FILE_GUID { \
+  0xD3987D4B, 0x971A, 0x435F, \
+  { 0x8C, 0xAF, 0x49, 0x67, 0xEB, 0x62, 0x72, 0x41 } \
+  }
+
+STATIC PLATFORM_SERIAL_CONSOLE mSerialConsole = {
+  //
+  // VENDOR_DEVICE_PATH SerialDxe
+  //
+  {
+{ HARDWARE_DEVICE_PATH, HW_VENDOR_DP, DP_NODE_LEN (VENDOR_DEVICE_PATH) },
+SERIAL_DXE_FILE_GUID
+  },
+
+  //
+  // UART_DEVICE_PATH Uart
+  //
+  {
+{ MESSAGING_DEVICE_PATH, MSG_UART_DP, DP_NODE_LEN (UART_DEVICE_PATH) },
+0,  // Reserved
+FixedPcdGet64 (PcdUartDefaultBaudRate), // BaudRate
+FixedPcdGet8 (PcdUartDefaultDataBits),  // DataBits
+FixedPcdGet8 (PcdUartDefaultParity),// Parity
+FixedPcdGet8 (PcdUartDefaultStopBits)   // StopBits
+  },
+
+  //
+  // VENDOR_DEFINED_DEVICE_PATH TermType
+  //
+  {
+{
+  MESSAGING_DEVICE_PATH, MSG_VENDOR_DP,
+  DP_NODE_LEN (VENDOR_DEFINED_DEVICE_PATH)
+}
+//
+// Guid to be filled in dynamically
+//
+  },
+
+  //
+  // EFI_DEVICE_PATH_PROTOCOL End
+  //
+  {
+END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE,
+DP_NODE_LEN (EFI_DEVICE_PATH_PROTOCOL)
+  }
+};
+
+
+#pragma pack (1)
+typedef struct {
+  USB_CLASS_DEVICE_PATHKeyboard;
+  EFI_DEVICE_PATH_PROTOCOL End;
+} PLATFORM_USB_KEYBOARD;
+#pragma pack ()
+
+STATIC PLATFORM_USB_KEYBOARD mUsbKeyboard = {
+  //
+  // USB_CLASS_DEVICE_PATH Keyboard
+  //
+  {
+{
+  MESSAGING_DEVICE_PATH, MSG_USB_CLASS_DP,
+  DP_NODE_LEN (USB_CLASS_DEVICE_PATH)
+},
+0x, // VendorId: any
+0x, // ProductId: any
+3,  // DeviceClass: HID
+1,  // DeviceSubClass: boot
+1   // DeviceProtocol: keyboard
+  },
+
+  //
+  // 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.
+
+  @param[in] Handle  The handle to check.
+  @param[in] ReportText  A caller-allocated string passed in for reporting
+ purposes. It must never be NULL.
+
+  @retval TRUE   The condition is satisfied.
+  @retval FALSE  Otherwise. This includes the case when the condition could not
+ be fully evaluated due to an error.
+**/
+typedef
+BOOLEAN
+(EFIAPI *FILTER_FUNCTION) (
+  IN EFI_HANDLE   Handle,
+  IN CONST CHAR16 *ReportText
+  );
+
+
+/**
+  Process a handle.
+
+  @param[in] Handle  The handle to process.
+  @param[in] ReportText  A caller-allocated string passed in for reporting
+ purposes. It must never be NULL.
+**/
+typedef
+VOID
+(EFIAPI *CALLBACK_FUNCTION)  (
+  IN EFI_HANDLE   Handle,
+  IN CONST CHAR16 *ReportText
+  );
+
+/**
+  Locate all handles that carry the specified protocol, filter them with a
+  callback function, and