summaryrefslogtreecommitdiff
path: root/EmbeddedPkg
diff options
context:
space:
mode:
authorOlivier Martin <olivier.martin@arm.com>2014-03-05 04:14:02 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2014-03-05 04:14:02 +0000
commitddd1436622131ced99193700dcd7dca5dc0aa315 (patch)
tree4fabe0af0e2d42e2c0b103e0a1d478e1cd6df285 /EmbeddedPkg
parentd8fd88626bc97303a423733fd0baa208e28728ec (diff)
downloadedk2-ddd1436622131ced99193700dcd7dca5dc0aa315.tar.gz
EmbeddedPkg/AndroidFastbootPlatform.h: Introduced Fastboot Platform Protocol
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15311 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EmbeddedPkg')
-rw-r--r--EmbeddedPkg/EmbeddedPkg.dec1
-rw-r--r--EmbeddedPkg/Include/Protocol/AndroidFastbootPlatform.h145
2 files changed, 146 insertions, 0 deletions
diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec
index a09b6d24d..7524db5e0 100644
--- a/EmbeddedPkg/EmbeddedPkg.dec
+++ b/EmbeddedPkg/EmbeddedPkg.dec
@@ -59,6 +59,7 @@
gPeCoffLoaderProtocolGuid = { 0xB323179B, 0x97FB, 0x477E, { 0xB0, 0xFE, 0xD8, 0x85, 0x91, 0xFA, 0x11, 0xAB } }
gEfiMmcHostProtocolGuid = { 0x3e591c00, 0x9e4a, 0x11df, {0x92, 0x44, 0x00, 0x02, 0xA5, 0xD5, 0xC5, 0x1B }}
gAndroidFastbootTransportProtocolGuid = { 0x74bd9fe0, 0x8902, 0x11e3, {0xb9, 0xd3, 0xf7, 0x22, 0x38, 0xfc, 0x9a, 0x31}}
+ gAndroidFastbootPlatformProtocolGuid = { 0x524685a0, 0x89a0, 0x11e3, {0x9d, 0x4d, 0xbf, 0xa9, 0xf6, 0xa4, 0x03, 0x08}}
[PcdsFeatureFlag.common]
gEmbeddedTokenSpaceGuid.PcdEmbeddedMacBoot|FALSE|BOOLEAN|0x00000001
diff --git a/EmbeddedPkg/Include/Protocol/AndroidFastbootPlatform.h b/EmbeddedPkg/Include/Protocol/AndroidFastbootPlatform.h
new file mode 100644
index 000000000..a9b4aac48
--- /dev/null
+++ b/EmbeddedPkg/Include/Protocol/AndroidFastbootPlatform.h
@@ -0,0 +1,145 @@
+/** @file
+
+ Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>
+
+ 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.
+
+**/
+
+#ifndef __ANDROID_FASTBOOT_PLATFORM_H__
+#define __ANDROID_FASTBOOT_PLATFORM_H__
+
+extern EFI_GUID gAndroidFastbootPlatformProtocolGuid;
+
+/*
+ Protocol for platform-specific operations initiated by Android Fastboot.
+
+ Based on Fastboot Protocol version 0.4. See
+ system/core/fastboot/fastboot_protocol.txt in the AOSP source tree for more
+ info.
+
+ Doesn't support image verification.
+*/
+
+/*
+ Do any initialisation that needs to be done in order to be able to respond to
+ commands.
+
+ @retval EFI_SUCCESS Initialised successfully.
+ @retval !EFI_SUCCESS Error in initialisation.
+*/
+typedef
+EFI_STATUS
+(*FASTBOOT_PLATFORM_INIT) (
+ VOID
+ );
+
+/*
+ To be called when Fastboot is finished and we aren't rebooting or booting an
+ image. Undo initialisation, free resrouces.
+*/
+typedef
+VOID
+(*FASTBOOT_PLATFORM_UN_INIT) (
+ VOID
+ );
+
+/*
+ Flash the partition named (according to a platform-specific scheme)
+ PartitionName, with the image pointed to by Buffer, whose size is BufferSize.
+
+ @param[in] PartitionName Null-terminated name of partition to write.
+ @param[in] BufferSize Size of Buffer in byets.
+ @param[in] Buffer Data to write to partition.
+
+ @retval EFI_NOT_FOUND No such partition.
+ @retval EFI_DEVICE_ERROR Flashing failed.
+*/
+typedef
+EFI_STATUS
+(*FASTBOOT_PLATFORM_FLASH) (
+ IN CHAR8 *PartitionName,
+ IN UINTN BufferSize,
+ IN VOID *Buffer
+ );
+
+/*
+ Erase the partition named PartitionName.
+
+ @param[in] PartitionName Null-terminated name of partition to erase.
+
+ @retval EFI_NOT_FOUND No such partition.
+ @retval EFI_DEVICE_ERROR Erasing failed.
+*/
+typedef
+EFI_STATUS
+(*FASTBOOT_PLATFORM_ERASE) (
+ IN CHAR8 *PartitionName
+ );
+
+/*
+ If the variable referred to by Name exists, copy it (as a null-terminated
+ string) into Value. If it doesn't exist, put the Empty string in Value.
+
+ Variable names and values may not be larger than 60 bytes, excluding the
+ terminal null character. This is a limitation of the Fastboot protocol.
+
+ The Fastboot application will handle platform-nonspecific variables
+ (Currently "version" is the only one of these.)
+
+ @param[in] Name Null-terminated name of Fastboot variable to retrieve.
+ @param[out] Value Caller-allocated buffer for null-terminated value of
+ variable.
+
+ @retval EFI_SUCCESS The variable was retrieved, or it doesn't exist.
+ @retval EFI_DEVICE_ERROR There was an error looking up the variable. This
+ does _not_ include the variable not existing.
+*/
+typedef
+EFI_STATUS
+(*FASTBOOT_PLATFORM_GETVAR) (
+ IN CHAR8 *Name,
+ OUT CHAR8 *Value
+ );
+
+/*
+ React to an OEM-specific command.
+
+ Future versions of this function might want to allow the platform to do some
+ extra communication with the host. A way to do this would be to add a function
+ to the FASTBOOT_TRANSPORT_PROTOCOL that allows the implementation of
+ DoOemCommand to replace the ReceiveEvent with its own, and to restore the old
+ one when it's finished.
+
+ However at the moment although the specification allows it, the AOSP fastboot
+ host application doesn't handle receiving any data from the client, and it
+ doesn't support a data phase for OEM commands.
+
+ @param[in] Command Null-terminated command string.
+
+ @retval EFI_SUCCESS The command executed successfully.
+ @retval EFI_NOT_FOUND The command wasn't recognised.
+ @retval EFI_DEVICE_ERROR There was an error executing the command.
+*/
+typedef
+EFI_STATUS
+(*FASTBOOT_PLATFORM_OEM_COMMAND) (
+ IN CHAR8 *Command
+ );
+
+typedef struct _FASTBOOT_PLATFORM_PROTOCOL {
+ FASTBOOT_PLATFORM_INIT Init;
+ FASTBOOT_PLATFORM_UN_INIT UnInit;
+ FASTBOOT_PLATFORM_FLASH FlashPartition;
+ FASTBOOT_PLATFORM_ERASE ErasePartition;
+ FASTBOOT_PLATFORM_GETVAR GetVar;
+ FASTBOOT_PLATFORM_OEM_COMMAND DoOemCommand;
+} FASTBOOT_PLATFORM_PROTOCOL;
+
+#endif