On Fri, Feb 10, 2017 at 03:59:05PM +0000, Ard Biesheuvel wrote:
On 10 February 2017 at 15:57, Leif Lindholm leif.lindholm@linaro.org wrote:
On Thu, Feb 09, 2017 at 10:11:50PM +0800, Haojian Zhuang wrote:
Add the platform boot manager to boot Android Fastboot.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang haojian.zhuang@linaro.org
OpenPlatformPkg.dec | 1 + .../Library/PlatformBootManagerLib/PlatformBm.c | 485 +++++++++++++++ .../Library/PlatformBootManagerLib/PlatformBm.h | 59 ++ .../PlatformBootManagerLib.inf | 88 +++ .../Library/PlatformBootManagerLib/QuietBoot.c | 680 +++++++++++++++++++++ 5 files changed, 1313 insertions(+) create mode 100644 Platforms/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c create mode 100644 Platforms/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.h create mode 100644 Platforms/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf create mode 100644 Platforms/Hisilicon/Library/PlatformBootManagerLib/QuietBoot.c
diff --git a/OpenPlatformPkg.dec b/OpenPlatformPkg.dec index 2db143d..e82b4d4 100644 --- a/OpenPlatformPkg.dec +++ b/OpenPlatformPkg.dec @@ -39,5 +39,6 @@ [PcdsFixedAtBuild] ## Indicates the size in MB for RAM disk. gOpenPlatformTokenSpaceGuid.PcdRamDiskMaxSize|0|UINT32|0x00000001
- gOpenPlatformTokenSpaceGuid.PcdAndroidFastbootFile|{ 0x2a, 0x50, 0x88, 0x95, 0x70, 0x53, 0xe3, 0x11, 0x86, 0x31, 0xd7, 0xc5, 0x95, 0x13, 0x64, 0xc8 }|VOID*|0x00000002
[PcdsFeatureFlag] diff --git a/Platforms/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c b/Platforms/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c new file mode 100644 index 0000000..03b764d --- /dev/null +++ b/Platforms/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c @@ -0,0 +1,485 @@ +/** @file
- Implementation for PlatformBootManagerLib library class interfaces.
From ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
Like the fastboot duplication, this also looks like a lot of opportunity for unifying into a common version.
It looks to me like the only differences from the original are:
- Deleting code specific to PCI systems.
- Deleting the Connect() function (unused with PCI bits gone).
- Updating EFI_D_ to DEBUG_ in order to keep PatchCheck.py happy.
- A call to PlatformRegisterFvBootOption().
Ard: would you be happy for us to start introducing a few compile-time settings that would let this platform just reuse the ArmPkg Platform boot manager?
I.e., CONFIG_PCI and CONFIG_ANDROID_FASTBOOT.
That would also be an excellent starting point for commonalizing config fragments.
Do you mean #ifdefs in the code? Shouldn't we use PCDs instead?
Can we use PCDs to comment out unused functions?
/ Leif