ARM Packages: Fixed line endings
This large code change only modifies the line endings to be CRLF to be compliant with the EDK2 coding convention document. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14088 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -60,4 +60,4 @@ DebugAgentTimerEndOfInterrupt (
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
@@ -1,45 +1,45 @@
|
||||
/** @file
|
||||
DMA abstraction library APIs. Based on UEFI PCI IO protocol DMA abstractions.
|
||||
At some point these functions will probably end up in a non PCI protocol
|
||||
for embedded systems.
|
||||
|
||||
/** @file
|
||||
DMA abstraction library APIs. Based on UEFI PCI IO protocol DMA abstractions.
|
||||
At some point these functions will probably end up in a non PCI protocol
|
||||
for embedded systems.
|
||||
|
||||
DMA Bus Master Read Operation:
|
||||
Call DmaMap() for MapOperationBusMasterRead.
|
||||
Program the DMA Bus Master with the DeviceAddress returned by DmaMap().
|
||||
Start the DMA Bus Master.
|
||||
Wait for DMA Bus Master to complete the read operation.
|
||||
Call DmaUnmap().
|
||||
|
||||
DMA Bus Master Write Operation:
|
||||
Call DmaMap() for MapOperationBusMasterRead.
|
||||
Program the DMA Bus Master with the DeviceAddress returned by DmaMap().
|
||||
Start the DMA Bus Master.
|
||||
Wait for DMA Bus Master to complete the read operation.
|
||||
Call DmaUnmap().
|
||||
|
||||
DMA Bus Master Write Operation:
|
||||
Call DmaMap() for MapOperationBusMasterWrite.
|
||||
Program the DMA Bus Master with the DeviceAddress returned by DmaMap().
|
||||
Start the DMA Bus Master.
|
||||
Wait for DMA Bus Master to complete the write operation.
|
||||
Call DmaUnmap().
|
||||
|
||||
DMA Bus Master Common Buffer Operation:
|
||||
Call DmaAllocateBuffer() to allocate a common buffer.
|
||||
Call DmaMap() for MapOperationBusMasterCommonBuffer.
|
||||
Program the DMA Bus Master with the DeviceAddress returned by DmaMap().
|
||||
The common buffer can now be accessed equally by the processor and the DMA bus master.
|
||||
Call DmaUnmap().
|
||||
Call DmaFreeBuffer().
|
||||
|
||||
Copyright (c) 2008 - 2010, Apple Inc. 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 __DMA_LIB_H__
|
||||
#define __DMA_LIB_H__
|
||||
|
||||
Call DmaUnmap().
|
||||
|
||||
DMA Bus Master Common Buffer Operation:
|
||||
Call DmaAllocateBuffer() to allocate a common buffer.
|
||||
Call DmaMap() for MapOperationBusMasterCommonBuffer.
|
||||
Program the DMA Bus Master with the DeviceAddress returned by DmaMap().
|
||||
The common buffer can now be accessed equally by the processor and the DMA bus master.
|
||||
Call DmaUnmap().
|
||||
Call DmaFreeBuffer().
|
||||
|
||||
Copyright (c) 2008 - 2010, Apple Inc. 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 __DMA_LIB_H__
|
||||
#define __DMA_LIB_H__
|
||||
|
||||
typedef enum {
|
||||
///
|
||||
/// A read operation from system memory by a bus master.
|
||||
@@ -56,10 +56,10 @@ typedef enum {
|
||||
MapOperationBusMasterCommonBuffer,
|
||||
MapOperationMaximum
|
||||
} DMA_MAP_OPERATION;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Provides the DMA controller-specific addresses needed to access system memory.
|
||||
|
||||
@@ -79,20 +79,20 @@ typedef enum {
|
||||
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
|
||||
@retval EFI_DEVICE_ERROR The system hardware could not map the requested address.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DmaMap (
|
||||
IN DMA_MAP_OPERATION Operation,
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DmaMap (
|
||||
IN DMA_MAP_OPERATION Operation,
|
||||
IN VOID *HostAddress,
|
||||
IN OUT UINTN *NumberOfBytes,
|
||||
OUT PHYSICAL_ADDRESS *DeviceAddress,
|
||||
OUT VOID **Mapping
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Completes the DmaMapBusMasterRead, DmaMapBusMasterWrite, or DmaMapBusMasterCommonBuffer
|
||||
operation and releases any corresponding resources.
|
||||
@@ -102,14 +102,14 @@ DmaMap (
|
||||
@retval EFI_SUCCESS The range was unmapped.
|
||||
@retval EFI_DEVICE_ERROR The data was not committed to the target system memory.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DmaUnmap (
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DmaUnmap (
|
||||
IN VOID *Mapping
|
||||
);
|
||||
|
||||
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Allocates pages that are suitable for an DmaMap() of type MapOperationBusMasterCommonBuffer.
|
||||
mapping.
|
||||
@@ -126,16 +126,16 @@ DmaUnmap (
|
||||
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
|
||||
@retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DmaAllocateBuffer (
|
||||
IN EFI_MEMORY_TYPE MemoryType,
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DmaAllocateBuffer (
|
||||
IN EFI_MEMORY_TYPE MemoryType,
|
||||
IN UINTN Pages,
|
||||
OUT VOID **HostAddress
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Frees memory that was allocated with DmaAllocateBuffer().
|
||||
|
||||
@@ -147,13 +147,13 @@ DmaAllocateBuffer (
|
||||
was not allocated with DmaAllocateBuffer().
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DmaFreeBuffer (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DmaFreeBuffer (
|
||||
IN UINTN Pages,
|
||||
IN VOID *HostAddress
|
||||
);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -1,122 +1,122 @@
|
||||
/** @file
|
||||
Include file for basic command line parser for EBL (Embedded Boot Loader)
|
||||
|
||||
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Portions copyright (c) 2008 - 2009, Apple Inc. 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 __EBL_ADD_EXTERNAL_COMMAND_LIB_H__
|
||||
#define __EBL_ADD_EXTERNAL_COMMAND_LIB_H__
|
||||
|
||||
#include <PiDxe.h>
|
||||
#include <Protocol/EblAddCommand.h>
|
||||
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
EblAddExternalCommands (
|
||||
IN const EBL_COMMAND_TABLE *EntryArray,
|
||||
IN UINTN ArrayCount
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
Return a keypress or optionally timeout if a timeout value was passed in.
|
||||
|
||||
An optional callback function is called every second when waiting for a
|
||||
|
||||
timeout.
|
||||
|
||||
|
||||
|
||||
@param Key EFI Key information returned
|
||||
|
||||
@param TimeoutInSec Number of seconds to wait to timeout
|
||||
|
||||
@param CallBack Callback called every second during the timeout wait
|
||||
|
||||
|
||||
|
||||
@return EFI_SUCCESS Key was returned
|
||||
|
||||
@return EFI_TIMEOUT If the TimoutInSec expired
|
||||
|
||||
|
||||
|
||||
**/
|
||||
|
||||
EFI_STATUS
|
||||
|
||||
EFIAPI
|
||||
|
||||
EblGetCharKey (
|
||||
|
||||
IN OUT EFI_INPUT_KEY *Key,
|
||||
|
||||
IN UINTN TimeoutInSec,
|
||||
|
||||
IN EBL_GET_CHAR_CALL_BACK CallBack OPTIONAL
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
This routine is used prevent command output data from scrolling off the end
|
||||
|
||||
of the screen. The global gPageBreak is used to turn on or off this feature.
|
||||
|
||||
If the CurrentRow is near the end of the screen pause and print out a prompt
|
||||
|
||||
If the use hits Q to quit return TRUE else for any other key return FALSE.
|
||||
|
||||
PrefixNewline is used to figure out if a newline is needed before the prompt
|
||||
|
||||
string. This depends on the last print done before calling this function.
|
||||
|
||||
CurrentRow is updated by one on a call or set back to zero if a prompt is
|
||||
|
||||
needed.
|
||||
|
||||
|
||||
|
||||
@param CurrentRow Used to figure out if its the end of the page and updated
|
||||
|
||||
@param PrefixNewline Did previous print issue a newline
|
||||
|
||||
|
||||
|
||||
@return TRUE if Q was hit to quit, FALSE in all other cases.
|
||||
|
||||
|
||||
|
||||
**/
|
||||
|
||||
BOOLEAN
|
||||
|
||||
EFIAPI
|
||||
|
||||
EblAnyKeyToContinueQtoQuit (
|
||||
|
||||
IN UINTN *CurrentRow,
|
||||
|
||||
IN BOOLEAN PrefixNewline
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/** @file
|
||||
Include file for basic command line parser for EBL (Embedded Boot Loader)
|
||||
|
||||
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Portions copyright (c) 2008 - 2009, Apple Inc. 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 __EBL_ADD_EXTERNAL_COMMAND_LIB_H__
|
||||
#define __EBL_ADD_EXTERNAL_COMMAND_LIB_H__
|
||||
|
||||
#include <PiDxe.h>
|
||||
#include <Protocol/EblAddCommand.h>
|
||||
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
EblAddExternalCommands (
|
||||
IN const EBL_COMMAND_TABLE *EntryArray,
|
||||
IN UINTN ArrayCount
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
Return a keypress or optionally timeout if a timeout value was passed in.
|
||||
|
||||
An optional callback function is called every second when waiting for a
|
||||
|
||||
timeout.
|
||||
|
||||
|
||||
|
||||
@param Key EFI Key information returned
|
||||
|
||||
@param TimeoutInSec Number of seconds to wait to timeout
|
||||
|
||||
@param CallBack Callback called every second during the timeout wait
|
||||
|
||||
|
||||
|
||||
@return EFI_SUCCESS Key was returned
|
||||
|
||||
@return EFI_TIMEOUT If the TimoutInSec expired
|
||||
|
||||
|
||||
|
||||
**/
|
||||
|
||||
EFI_STATUS
|
||||
|
||||
EFIAPI
|
||||
|
||||
EblGetCharKey (
|
||||
|
||||
IN OUT EFI_INPUT_KEY *Key,
|
||||
|
||||
IN UINTN TimeoutInSec,
|
||||
|
||||
IN EBL_GET_CHAR_CALL_BACK CallBack OPTIONAL
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
This routine is used prevent command output data from scrolling off the end
|
||||
|
||||
of the screen. The global gPageBreak is used to turn on or off this feature.
|
||||
|
||||
If the CurrentRow is near the end of the screen pause and print out a prompt
|
||||
|
||||
If the use hits Q to quit return TRUE else for any other key return FALSE.
|
||||
|
||||
PrefixNewline is used to figure out if a newline is needed before the prompt
|
||||
|
||||
string. This depends on the last print done before calling this function.
|
||||
|
||||
CurrentRow is updated by one on a call or set back to zero if a prompt is
|
||||
|
||||
needed.
|
||||
|
||||
|
||||
|
||||
@param CurrentRow Used to figure out if its the end of the page and updated
|
||||
|
||||
@param PrefixNewline Did previous print issue a newline
|
||||
|
||||
|
||||
|
||||
@return TRUE if Q was hit to quit, FALSE in all other cases.
|
||||
|
||||
|
||||
|
||||
**/
|
||||
|
||||
BOOLEAN
|
||||
|
||||
EFIAPI
|
||||
|
||||
EblAnyKeyToContinueQtoQuit (
|
||||
|
||||
IN UINTN *CurrentRow,
|
||||
|
||||
IN BOOLEAN PrefixNewline
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -1,48 +1,48 @@
|
||||
/** @file
|
||||
Include file for basic command line parser for EBL (Embedded Boot Loader)
|
||||
|
||||
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Portions copyright (c) 2008 - 2009, Apple Inc. 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 __EBL_LIB_H__
|
||||
#define __EBL_LIB_H__
|
||||
|
||||
#include <PiDxe.h>
|
||||
#include <Protocol/EblAddCommand.h>
|
||||
|
||||
|
||||
VOID
|
||||
EblAddCommand (
|
||||
IN const EBL_COMMAND_TABLE *Entry
|
||||
);
|
||||
|
||||
VOID
|
||||
EblAddCommands (
|
||||
IN const EBL_COMMAND_TABLE *EntryArray,
|
||||
IN UINTN ArrayCount
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// LIbrary constructor called directly from Ebl Code.
|
||||
// This module calls EblAddCommand () or EblAddCommands () to register new commands
|
||||
//
|
||||
VOID
|
||||
EblInitializeExternalCmd (
|
||||
VOID
|
||||
);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/** @file
|
||||
Include file for basic command line parser for EBL (Embedded Boot Loader)
|
||||
|
||||
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Portions copyright (c) 2008 - 2009, Apple Inc. 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 __EBL_LIB_H__
|
||||
#define __EBL_LIB_H__
|
||||
|
||||
#include <PiDxe.h>
|
||||
#include <Protocol/EblAddCommand.h>
|
||||
|
||||
|
||||
VOID
|
||||
EblAddCommand (
|
||||
IN const EBL_COMMAND_TABLE *Entry
|
||||
);
|
||||
|
||||
VOID
|
||||
EblAddCommands (
|
||||
IN const EBL_COMMAND_TABLE *EntryArray,
|
||||
IN UINTN ArrayCount
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// LIbrary constructor called directly from Ebl Code.
|
||||
// This module calls EblAddCommand () or EblAddCommands () to register new commands
|
||||
//
|
||||
VOID
|
||||
EblInitializeExternalCmd (
|
||||
VOID
|
||||
);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -1,68 +1,68 @@
|
||||
/** @file
|
||||
Abstractions for Ebl network accesses.
|
||||
|
||||
Copyright (c) 2008 - 2009, Apple Inc. 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 __EBL_NETWORK_LIB_H__
|
||||
#define __EBL_NETWORK_LIB_H__
|
||||
|
||||
#include <Protocol/PxeBaseCode.h>
|
||||
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
EblGetCurrentIpAddress (
|
||||
IN OUT EFI_IP_ADDRESS *Ip
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
EblGetCurrentMacAddress (
|
||||
IN OUT EFI_MAC_ADDRESS *Mac
|
||||
);
|
||||
|
||||
CHAR8 *
|
||||
EFIAPI
|
||||
EblLoadFileBootTypeString (
|
||||
IN EFI_HANDLE Handle
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
EblPerformDHCP (
|
||||
IN BOOLEAN SortOffers
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
EblSetStationIp (
|
||||
IN EFI_IP_ADDRESS *NewStationIp, OPTIONAL
|
||||
IN EFI_IP_ADDRESS *NewSubnetMask OPTIONAL
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
EblMtftp (
|
||||
IN EFI_PXE_BASE_CODE_TFTP_OPCODE Operation,
|
||||
IN OUT VOID *BufferPtr OPTIONAL,
|
||||
IN BOOLEAN Overwrite,
|
||||
IN OUT UINT64 *BufferSize,
|
||||
IN UINTN *BlockSize OPTIONAL,
|
||||
IN EFI_IP_ADDRESS *ServerIp,
|
||||
IN UINT8 *Filename OPTIONAL,
|
||||
IN EFI_PXE_BASE_CODE_MTFTP_INFO *Info OPTIONAL,
|
||||
IN BOOLEAN DontUseBuffer
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
/** @file
|
||||
Abstractions for Ebl network accesses.
|
||||
|
||||
Copyright (c) 2008 - 2009, Apple Inc. 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 __EBL_NETWORK_LIB_H__
|
||||
#define __EBL_NETWORK_LIB_H__
|
||||
|
||||
#include <Protocol/PxeBaseCode.h>
|
||||
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
EblGetCurrentIpAddress (
|
||||
IN OUT EFI_IP_ADDRESS *Ip
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
EblGetCurrentMacAddress (
|
||||
IN OUT EFI_MAC_ADDRESS *Mac
|
||||
);
|
||||
|
||||
CHAR8 *
|
||||
EFIAPI
|
||||
EblLoadFileBootTypeString (
|
||||
IN EFI_HANDLE Handle
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
EblPerformDHCP (
|
||||
IN BOOLEAN SortOffers
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
EblSetStationIp (
|
||||
IN EFI_IP_ADDRESS *NewStationIp, OPTIONAL
|
||||
IN EFI_IP_ADDRESS *NewSubnetMask OPTIONAL
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
EblMtftp (
|
||||
IN EFI_PXE_BASE_CODE_TFTP_OPCODE Operation,
|
||||
IN OUT VOID *BufferPtr OPTIONAL,
|
||||
IN BOOLEAN Overwrite,
|
||||
IN OUT UINT64 *BufferSize,
|
||||
IN UINTN *BlockSize OPTIONAL,
|
||||
IN EFI_IP_ADDRESS *ServerIp,
|
||||
IN UINT8 *Filename OPTIONAL,
|
||||
IN EFI_PXE_BASE_CODE_MTFTP_INFO *Info OPTIONAL,
|
||||
IN BOOLEAN DontUseBuffer
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -1,107 +1,107 @@
|
||||
/** @file
|
||||
Basic serial IO abstaction for GDB
|
||||
|
||||
Copyright (c) 2008 - 2009, Apple Inc. 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 __GDB_SERIAL_LIB_H__
|
||||
#define __GDB_SERIAL_LIB_H__
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Sets the baud rate, receive FIFO depth, transmit/receice time out, parity,
|
||||
data buts, and stop bits on a serial device. This call is optional as the serial
|
||||
port will be set up with defaults base on PCD values.
|
||||
|
||||
@param BaudRate The requested baud rate. A BaudRate value of 0 will use the the
|
||||
device's default interface speed.
|
||||
@param Parity The type of parity to use on this serial device. A Parity value of
|
||||
DefaultParity will use the device's default parity value.
|
||||
@param DataBits The number of data bits to use on the serial device. A DataBits
|
||||
vaule of 0 will use the device's default data bit setting.
|
||||
@param StopBits The number of stop bits to use on this serial device. A StopBits
|
||||
value of DefaultStopBits will use the device's default number of
|
||||
stop bits.
|
||||
|
||||
@retval EFI_SUCCESS The device was configured.
|
||||
@retval EFI_DEVICE_ERROR The serial device could not be coonfigured.
|
||||
|
||||
**/
|
||||
RETURN_STATUS
|
||||
EFIAPI
|
||||
GdbSerialInit (
|
||||
IN UINT64 BaudRate,
|
||||
IN UINT8 Parity,
|
||||
IN UINT8 DataBits,
|
||||
IN UINT8 StopBits
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Check to see if a character is available from GDB. Do not read the character as that is
|
||||
done via GdbGetChar().
|
||||
|
||||
@return TRUE - Character availible
|
||||
@return FALSE - Character not availible
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
GdbIsCharAvailable (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Get a character from GDB. This function must be able to run in interrupt context.
|
||||
|
||||
@return A character from GDB
|
||||
|
||||
**/
|
||||
CHAR8
|
||||
EFIAPI
|
||||
GdbGetChar (
|
||||
VOID
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Send a character to GDB. This function must be able to run in interrupt context.
|
||||
|
||||
|
||||
@param Char Send a character to GDB
|
||||
|
||||
**/
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
GdbPutChar (
|
||||
IN CHAR8 Char
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Send an ASCII string to GDB. This function must be able to run in interrupt context.
|
||||
|
||||
|
||||
@param String Send a string to GDB
|
||||
|
||||
**/
|
||||
|
||||
VOID
|
||||
GdbPutString (
|
||||
IN CHAR8 *String
|
||||
);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/** @file
|
||||
Basic serial IO abstaction for GDB
|
||||
|
||||
Copyright (c) 2008 - 2009, Apple Inc. 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 __GDB_SERIAL_LIB_H__
|
||||
#define __GDB_SERIAL_LIB_H__
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Sets the baud rate, receive FIFO depth, transmit/receice time out, parity,
|
||||
data buts, and stop bits on a serial device. This call is optional as the serial
|
||||
port will be set up with defaults base on PCD values.
|
||||
|
||||
@param BaudRate The requested baud rate. A BaudRate value of 0 will use the the
|
||||
device's default interface speed.
|
||||
@param Parity The type of parity to use on this serial device. A Parity value of
|
||||
DefaultParity will use the device's default parity value.
|
||||
@param DataBits The number of data bits to use on the serial device. A DataBits
|
||||
vaule of 0 will use the device's default data bit setting.
|
||||
@param StopBits The number of stop bits to use on this serial device. A StopBits
|
||||
value of DefaultStopBits will use the device's default number of
|
||||
stop bits.
|
||||
|
||||
@retval EFI_SUCCESS The device was configured.
|
||||
@retval EFI_DEVICE_ERROR The serial device could not be coonfigured.
|
||||
|
||||
**/
|
||||
RETURN_STATUS
|
||||
EFIAPI
|
||||
GdbSerialInit (
|
||||
IN UINT64 BaudRate,
|
||||
IN UINT8 Parity,
|
||||
IN UINT8 DataBits,
|
||||
IN UINT8 StopBits
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Check to see if a character is available from GDB. Do not read the character as that is
|
||||
done via GdbGetChar().
|
||||
|
||||
@return TRUE - Character availible
|
||||
@return FALSE - Character not availible
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
GdbIsCharAvailable (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Get a character from GDB. This function must be able to run in interrupt context.
|
||||
|
||||
@return A character from GDB
|
||||
|
||||
**/
|
||||
CHAR8
|
||||
EFIAPI
|
||||
GdbGetChar (
|
||||
VOID
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Send a character to GDB. This function must be able to run in interrupt context.
|
||||
|
||||
|
||||
@param Char Send a character to GDB
|
||||
|
||||
**/
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
GdbPutChar (
|
||||
IN CHAR8 Char
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Send an ASCII string to GDB. This function must be able to run in interrupt context.
|
||||
|
||||
|
||||
@param String Send a string to GDB
|
||||
|
||||
**/
|
||||
|
||||
VOID
|
||||
GdbPutString (
|
||||
IN CHAR8 *String
|
||||
);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,66 +1,66 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2012, ARM 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.
|
||||
|
||||
**/
|
||||
|
||||
#ifndef __SERIAL_PORT_EXT_LIB_H__
|
||||
#define __SERIAL_PORT_EXT_LIB_H__
|
||||
|
||||
#include <Uefi/UefiBaseType.h>
|
||||
#include <Protocol/SerialIo.h>
|
||||
|
||||
/**
|
||||
Set the serial device control bits.
|
||||
|
||||
@return Always return EFI_UNSUPPORTED.
|
||||
|
||||
**/
|
||||
RETURN_STATUS
|
||||
EFIAPI
|
||||
SerialPortSetControl (
|
||||
IN UINT32 Control
|
||||
);
|
||||
|
||||
/**
|
||||
Get the serial device control bits.
|
||||
|
||||
@param Control Control signals read from the serial device.
|
||||
|
||||
@retval EFI_SUCCESS The control bits were read from the serial device.
|
||||
@retval EFI_DEVICE_ERROR The serial device is not functioning correctly.
|
||||
|
||||
**/
|
||||
RETURN_STATUS
|
||||
EFIAPI
|
||||
SerialPortGetControl (
|
||||
OUT UINT32 *Control
|
||||
);
|
||||
|
||||
/**
|
||||
Set the serial device attributes.
|
||||
|
||||
@return Always return EFI_UNSUPPORTED.
|
||||
|
||||
**/
|
||||
RETURN_STATUS
|
||||
EFIAPI
|
||||
SerialPortSetAttributes (
|
||||
IN UINT64 BaudRate,
|
||||
IN UINT32 ReceiveFifoDepth,
|
||||
IN UINT32 Timeout,
|
||||
IN EFI_PARITY_TYPE Parity,
|
||||
IN UINT8 DataBits,
|
||||
IN EFI_STOP_BITS_TYPE StopBits
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2012, ARM 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.
|
||||
|
||||
**/
|
||||
|
||||
#ifndef __SERIAL_PORT_EXT_LIB_H__
|
||||
#define __SERIAL_PORT_EXT_LIB_H__
|
||||
|
||||
#include <Uefi/UefiBaseType.h>
|
||||
#include <Protocol/SerialIo.h>
|
||||
|
||||
/**
|
||||
Set the serial device control bits.
|
||||
|
||||
@return Always return EFI_UNSUPPORTED.
|
||||
|
||||
**/
|
||||
RETURN_STATUS
|
||||
EFIAPI
|
||||
SerialPortSetControl (
|
||||
IN UINT32 Control
|
||||
);
|
||||
|
||||
/**
|
||||
Get the serial device control bits.
|
||||
|
||||
@param Control Control signals read from the serial device.
|
||||
|
||||
@retval EFI_SUCCESS The control bits were read from the serial device.
|
||||
@retval EFI_DEVICE_ERROR The serial device is not functioning correctly.
|
||||
|
||||
**/
|
||||
RETURN_STATUS
|
||||
EFIAPI
|
||||
SerialPortGetControl (
|
||||
OUT UINT32 *Control
|
||||
);
|
||||
|
||||
/**
|
||||
Set the serial device attributes.
|
||||
|
||||
@return Always return EFI_UNSUPPORTED.
|
||||
|
||||
**/
|
||||
RETURN_STATUS
|
||||
EFIAPI
|
||||
SerialPortSetAttributes (
|
||||
IN UINT64 BaudRate,
|
||||
IN UINT32 ReceiveFifoDepth,
|
||||
IN UINT32 Timeout,
|
||||
IN EFI_PARITY_TYPE Parity,
|
||||
IN UINT8 DataBits,
|
||||
IN EFI_STOP_BITS_TYPE StopBits
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -73,11 +73,11 @@ VOID
|
||||
);
|
||||
|
||||
|
||||
typedef
|
||||
VOID
|
||||
(EFIAPI *EBL_GET_CHAR_CALL_BACK) (
|
||||
IN UINTN ElapsedTime
|
||||
);
|
||||
typedef
|
||||
VOID
|
||||
(EFIAPI *EBL_GET_CHAR_CALL_BACK) (
|
||||
IN UINTN ElapsedTime
|
||||
);
|
||||
|
||||
/**
|
||||
Return a keypress or optionally timeout if a timeout value was passed in.
|
||||
|
@@ -1,94 +1,94 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2008 - 2009, Apple Inc. 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 __EMBEDDED_EXTERNAL_DEVICE_H__
|
||||
#define __EMBEDDED_EXTERNAL_DEVICE_H__
|
||||
|
||||
//
|
||||
// Protocol GUID
|
||||
//
|
||||
#define EMBEDDED_EXTERNAL_DEVICE_PROTOCOL_GUID { 0x735F8C64, 0xD696, 0x44D0, { 0xBD, 0xF2, 0x44, 0x7F, 0xD0, 0x5A, 0x54, 0x06 }}
|
||||
|
||||
//
|
||||
// Protocol interface structure
|
||||
//
|
||||
typedef struct _EMBEDDED_EXTERNAL_DEVICE EMBEDDED_EXTERNAL_DEVICE;
|
||||
|
||||
//
|
||||
// Function Prototypes
|
||||
//
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EMBEDDED_EXTERNAL_DEVICE_READ) (
|
||||
IN EMBEDDED_EXTERNAL_DEVICE *This,
|
||||
IN UINTN Register,
|
||||
IN UINTN Length,
|
||||
OUT VOID *Buffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Read a set of contiguous external device registers.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - pointer to protocol
|
||||
Offset - starting register number
|
||||
Length - number of bytes to read
|
||||
Buffer - destination buffer
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - registers read successfully
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EMBEDDED_EXTERNAL_DEVICE_WRITE) (
|
||||
IN EMBEDDED_EXTERNAL_DEVICE *This,
|
||||
IN UINTN Register,
|
||||
IN UINTN Length,
|
||||
IN VOID *Buffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Write to a set of contiguous external device registers.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - pointer to protocol
|
||||
Offset - starting register number
|
||||
Length - number of bytes to write
|
||||
Buffer - source buffer
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - registers written successfully
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
struct _EMBEDDED_EXTERNAL_DEVICE {
|
||||
EMBEDDED_EXTERNAL_DEVICE_READ Read;
|
||||
EMBEDDED_EXTERNAL_DEVICE_WRITE Write;
|
||||
};
|
||||
|
||||
extern EFI_GUID gEmbeddedExternalDeviceProtocolGuid;
|
||||
|
||||
#endif // __EMBEDDED_EXTERNAL_DEVICE_H__
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2008 - 2009, Apple Inc. 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 __EMBEDDED_EXTERNAL_DEVICE_H__
|
||||
#define __EMBEDDED_EXTERNAL_DEVICE_H__
|
||||
|
||||
//
|
||||
// Protocol GUID
|
||||
//
|
||||
#define EMBEDDED_EXTERNAL_DEVICE_PROTOCOL_GUID { 0x735F8C64, 0xD696, 0x44D0, { 0xBD, 0xF2, 0x44, 0x7F, 0xD0, 0x5A, 0x54, 0x06 }}
|
||||
|
||||
//
|
||||
// Protocol interface structure
|
||||
//
|
||||
typedef struct _EMBEDDED_EXTERNAL_DEVICE EMBEDDED_EXTERNAL_DEVICE;
|
||||
|
||||
//
|
||||
// Function Prototypes
|
||||
//
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EMBEDDED_EXTERNAL_DEVICE_READ) (
|
||||
IN EMBEDDED_EXTERNAL_DEVICE *This,
|
||||
IN UINTN Register,
|
||||
IN UINTN Length,
|
||||
OUT VOID *Buffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Read a set of contiguous external device registers.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - pointer to protocol
|
||||
Offset - starting register number
|
||||
Length - number of bytes to read
|
||||
Buffer - destination buffer
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - registers read successfully
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EMBEDDED_EXTERNAL_DEVICE_WRITE) (
|
||||
IN EMBEDDED_EXTERNAL_DEVICE *This,
|
||||
IN UINTN Register,
|
||||
IN UINTN Length,
|
||||
IN VOID *Buffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Write to a set of contiguous external device registers.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - pointer to protocol
|
||||
Offset - starting register number
|
||||
Length - number of bytes to write
|
||||
Buffer - source buffer
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - registers written successfully
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
struct _EMBEDDED_EXTERNAL_DEVICE {
|
||||
EMBEDDED_EXTERNAL_DEVICE_READ Read;
|
||||
EMBEDDED_EXTERNAL_DEVICE_WRITE Write;
|
||||
};
|
||||
|
||||
extern EFI_GUID gEmbeddedExternalDeviceProtocolGuid;
|
||||
|
||||
#endif // __EMBEDDED_EXTERNAL_DEVICE_H__
|
||||
|
@@ -1,167 +1,167 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2008 - 2009, Apple Inc. 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 __EMBEDDED_GPIO_H__
|
||||
#define __EMBEDDED_GPIO_H__
|
||||
|
||||
//
|
||||
// Protocol interface structure
|
||||
//
|
||||
typedef struct _EMBEDDED_GPIO EMBEDDED_GPIO;
|
||||
|
||||
//
|
||||
// Data Types
|
||||
//
|
||||
typedef UINTN EMBEDDED_GPIO_PIN;
|
||||
|
||||
#define GPIO(Port, Pin) ((EMBEDDED_GPIO_PIN)(((Port) << (16)) | (Pin)))
|
||||
#define GPIO_PIN(x) ((EMBEDDED_GPIO_PIN)(x) & (0xFFFF))
|
||||
#define GPIO_PORT(x) ((EMBEDDED_GPIO_PIN)(x) >> (16))
|
||||
|
||||
typedef enum {
|
||||
GPIO_MODE_INPUT = 0x00,
|
||||
GPIO_MODE_OUTPUT_0 = 0x0E,
|
||||
GPIO_MODE_OUTPUT_1 = 0x0F,
|
||||
GPIO_MODE_SPECIAL_FUNCTION_2 = 0x02,
|
||||
GPIO_MODE_SPECIAL_FUNCTION_3 = 0x03,
|
||||
GPIO_MODE_SPECIAL_FUNCTION_4 = 0x04,
|
||||
GPIO_MODE_SPECIAL_FUNCTION_5 = 0x05,
|
||||
GPIO_MODE_SPECIAL_FUNCTION_6 = 0x06,
|
||||
GPIO_MODE_SPECIAL_FUNCTION_7 = 0x07
|
||||
} EMBEDDED_GPIO_MODE;
|
||||
|
||||
typedef enum {
|
||||
GPIO_PULL_NONE,
|
||||
GPIO_PULL_UP,
|
||||
GPIO_PULL_DOWN
|
||||
} EMBEDDED_GPIO_PULL;
|
||||
|
||||
//
|
||||
// Function Prototypes
|
||||
//
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EMBEDDED_GPIO_GET) (
|
||||
IN EMBEDDED_GPIO *This,
|
||||
IN EMBEDDED_GPIO_PIN Gpio,
|
||||
OUT UINTN *Value
|
||||
);
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Gets the state of a GPIO pin
|
||||
|
||||
Arguments:
|
||||
|
||||
This - pointer to protocol
|
||||
Gpio - which pin to read
|
||||
Value - state of the pin
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - GPIO state returned in Value
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EMBEDDED_GPIO_SET) (
|
||||
IN EMBEDDED_GPIO *This,
|
||||
IN EMBEDDED_GPIO_PIN Gpio,
|
||||
IN EMBEDDED_GPIO_MODE Mode
|
||||
);
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Sets the state of a GPIO pin
|
||||
|
||||
Arguments:
|
||||
|
||||
This - pointer to protocol
|
||||
Gpio - which pin to modify
|
||||
Mode - mode to set
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - GPIO set as requested
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EMBEDDED_GPIO_GET_MODE) (
|
||||
IN EMBEDDED_GPIO *This,
|
||||
IN EMBEDDED_GPIO_PIN Gpio,
|
||||
OUT EMBEDDED_GPIO_MODE *Mode
|
||||
);
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Gets the mode (function) of a GPIO pin
|
||||
|
||||
Arguments:
|
||||
|
||||
This - pointer to protocol
|
||||
Gpio - which pin
|
||||
Mode - pointer to output mode value
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - mode value retrieved
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EMBEDDED_GPIO_SET_PULL) (
|
||||
IN EMBEDDED_GPIO *This,
|
||||
IN EMBEDDED_GPIO_PIN Gpio,
|
||||
IN EMBEDDED_GPIO_PULL Direction
|
||||
);
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Sets the pull-up / pull-down resistor of a GPIO pin
|
||||
|
||||
Arguments:
|
||||
|
||||
This - pointer to protocol
|
||||
Gpio - which pin
|
||||
Direction - pull-up, pull-down, or none
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - pin was set
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
|
||||
struct _EMBEDDED_GPIO {
|
||||
EMBEDDED_GPIO_GET Get;
|
||||
EMBEDDED_GPIO_SET Set;
|
||||
EMBEDDED_GPIO_GET_MODE GetMode;
|
||||
EMBEDDED_GPIO_SET_PULL SetPull;
|
||||
};
|
||||
|
||||
extern EFI_GUID gEmbeddedGpioProtocolGuid;
|
||||
|
||||
#endif
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2008 - 2009, Apple Inc. 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 __EMBEDDED_GPIO_H__
|
||||
#define __EMBEDDED_GPIO_H__
|
||||
|
||||
//
|
||||
// Protocol interface structure
|
||||
//
|
||||
typedef struct _EMBEDDED_GPIO EMBEDDED_GPIO;
|
||||
|
||||
//
|
||||
// Data Types
|
||||
//
|
||||
typedef UINTN EMBEDDED_GPIO_PIN;
|
||||
|
||||
#define GPIO(Port, Pin) ((EMBEDDED_GPIO_PIN)(((Port) << (16)) | (Pin)))
|
||||
#define GPIO_PIN(x) ((EMBEDDED_GPIO_PIN)(x) & (0xFFFF))
|
||||
#define GPIO_PORT(x) ((EMBEDDED_GPIO_PIN)(x) >> (16))
|
||||
|
||||
typedef enum {
|
||||
GPIO_MODE_INPUT = 0x00,
|
||||
GPIO_MODE_OUTPUT_0 = 0x0E,
|
||||
GPIO_MODE_OUTPUT_1 = 0x0F,
|
||||
GPIO_MODE_SPECIAL_FUNCTION_2 = 0x02,
|
||||
GPIO_MODE_SPECIAL_FUNCTION_3 = 0x03,
|
||||
GPIO_MODE_SPECIAL_FUNCTION_4 = 0x04,
|
||||
GPIO_MODE_SPECIAL_FUNCTION_5 = 0x05,
|
||||
GPIO_MODE_SPECIAL_FUNCTION_6 = 0x06,
|
||||
GPIO_MODE_SPECIAL_FUNCTION_7 = 0x07
|
||||
} EMBEDDED_GPIO_MODE;
|
||||
|
||||
typedef enum {
|
||||
GPIO_PULL_NONE,
|
||||
GPIO_PULL_UP,
|
||||
GPIO_PULL_DOWN
|
||||
} EMBEDDED_GPIO_PULL;
|
||||
|
||||
//
|
||||
// Function Prototypes
|
||||
//
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EMBEDDED_GPIO_GET) (
|
||||
IN EMBEDDED_GPIO *This,
|
||||
IN EMBEDDED_GPIO_PIN Gpio,
|
||||
OUT UINTN *Value
|
||||
);
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Gets the state of a GPIO pin
|
||||
|
||||
Arguments:
|
||||
|
||||
This - pointer to protocol
|
||||
Gpio - which pin to read
|
||||
Value - state of the pin
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - GPIO state returned in Value
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EMBEDDED_GPIO_SET) (
|
||||
IN EMBEDDED_GPIO *This,
|
||||
IN EMBEDDED_GPIO_PIN Gpio,
|
||||
IN EMBEDDED_GPIO_MODE Mode
|
||||
);
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Sets the state of a GPIO pin
|
||||
|
||||
Arguments:
|
||||
|
||||
This - pointer to protocol
|
||||
Gpio - which pin to modify
|
||||
Mode - mode to set
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - GPIO set as requested
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EMBEDDED_GPIO_GET_MODE) (
|
||||
IN EMBEDDED_GPIO *This,
|
||||
IN EMBEDDED_GPIO_PIN Gpio,
|
||||
OUT EMBEDDED_GPIO_MODE *Mode
|
||||
);
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Gets the mode (function) of a GPIO pin
|
||||
|
||||
Arguments:
|
||||
|
||||
This - pointer to protocol
|
||||
Gpio - which pin
|
||||
Mode - pointer to output mode value
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - mode value retrieved
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EMBEDDED_GPIO_SET_PULL) (
|
||||
IN EMBEDDED_GPIO *This,
|
||||
IN EMBEDDED_GPIO_PIN Gpio,
|
||||
IN EMBEDDED_GPIO_PULL Direction
|
||||
);
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Sets the pull-up / pull-down resistor of a GPIO pin
|
||||
|
||||
Arguments:
|
||||
|
||||
This - pointer to protocol
|
||||
Gpio - which pin
|
||||
Direction - pull-up, pull-down, or none
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - pin was set
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
|
||||
struct _EMBEDDED_GPIO {
|
||||
EMBEDDED_GPIO_GET Get;
|
||||
EMBEDDED_GPIO_SET Set;
|
||||
EMBEDDED_GPIO_GET_MODE GetMode;
|
||||
EMBEDDED_GPIO_SET_PULL SetPull;
|
||||
};
|
||||
|
||||
extern EFI_GUID gEmbeddedGpioProtocolGuid;
|
||||
|
||||
#endif
|
||||
|
@@ -1,74 +1,74 @@
|
||||
/** @file
|
||||
*
|
||||
* Copyright (c) 2011-2012, ARM Limited. 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.
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef _FDT_H
|
||||
#define _FDT_H
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
struct fdt_header {
|
||||
uint32_t magic; /* magic word FDT_MAGIC */
|
||||
uint32_t totalsize; /* total size of DT block */
|
||||
uint32_t off_dt_struct; /* offset to structure */
|
||||
uint32_t off_dt_strings; /* offset to strings */
|
||||
uint32_t off_mem_rsvmap; /* offset to memory reserve map */
|
||||
uint32_t version; /* format version */
|
||||
uint32_t last_comp_version; /* last compatible version */
|
||||
|
||||
/* version 2 fields below */
|
||||
uint32_t boot_cpuid_phys; /* Which physical CPU id we're
|
||||
booting on */
|
||||
/* version 3 fields below */
|
||||
uint32_t size_dt_strings; /* size of the strings block */
|
||||
|
||||
/* version 17 fields below */
|
||||
uint32_t size_dt_struct; /* size of the structure block */
|
||||
};
|
||||
|
||||
struct fdt_reserve_entry {
|
||||
uint64_t address;
|
||||
uint64_t size;
|
||||
};
|
||||
|
||||
struct fdt_node_header {
|
||||
uint32_t tag;
|
||||
char name[0];
|
||||
};
|
||||
|
||||
struct fdt_property {
|
||||
uint32_t tag;
|
||||
uint32_t len;
|
||||
uint32_t nameoff;
|
||||
char data[0];
|
||||
};
|
||||
|
||||
#endif /* !__ASSEMBLY */
|
||||
|
||||
#define FDT_MAGIC 0xd00dfeed /* 4: version, 4: total size */
|
||||
#define FDT_TAGSIZE sizeof(uint32_t)
|
||||
|
||||
#define FDT_BEGIN_NODE 0x1 /* Start node: full name */
|
||||
#define FDT_END_NODE 0x2 /* End node */
|
||||
#define FDT_PROP 0x3 /* Property: name off,
|
||||
size, content */
|
||||
#define FDT_NOP 0x4 /* nop */
|
||||
#define FDT_END 0x9
|
||||
|
||||
#define FDT_V1_SIZE (7*sizeof(uint32_t))
|
||||
#define FDT_V2_SIZE (FDT_V1_SIZE + sizeof(uint32_t))
|
||||
#define FDT_V3_SIZE (FDT_V2_SIZE + sizeof(uint32_t))
|
||||
#define FDT_V16_SIZE FDT_V3_SIZE
|
||||
#define FDT_V17_SIZE (FDT_V16_SIZE + sizeof(uint32_t))
|
||||
|
||||
#endif /* _FDT_H */
|
||||
/** @file
|
||||
*
|
||||
* Copyright (c) 2011-2012, ARM Limited. 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.
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef _FDT_H
|
||||
#define _FDT_H
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
struct fdt_header {
|
||||
uint32_t magic; /* magic word FDT_MAGIC */
|
||||
uint32_t totalsize; /* total size of DT block */
|
||||
uint32_t off_dt_struct; /* offset to structure */
|
||||
uint32_t off_dt_strings; /* offset to strings */
|
||||
uint32_t off_mem_rsvmap; /* offset to memory reserve map */
|
||||
uint32_t version; /* format version */
|
||||
uint32_t last_comp_version; /* last compatible version */
|
||||
|
||||
/* version 2 fields below */
|
||||
uint32_t boot_cpuid_phys; /* Which physical CPU id we're
|
||||
booting on */
|
||||
/* version 3 fields below */
|
||||
uint32_t size_dt_strings; /* size of the strings block */
|
||||
|
||||
/* version 17 fields below */
|
||||
uint32_t size_dt_struct; /* size of the structure block */
|
||||
};
|
||||
|
||||
struct fdt_reserve_entry {
|
||||
uint64_t address;
|
||||
uint64_t size;
|
||||
};
|
||||
|
||||
struct fdt_node_header {
|
||||
uint32_t tag;
|
||||
char name[0];
|
||||
};
|
||||
|
||||
struct fdt_property {
|
||||
uint32_t tag;
|
||||
uint32_t len;
|
||||
uint32_t nameoff;
|
||||
char data[0];
|
||||
};
|
||||
|
||||
#endif /* !__ASSEMBLY */
|
||||
|
||||
#define FDT_MAGIC 0xd00dfeed /* 4: version, 4: total size */
|
||||
#define FDT_TAGSIZE sizeof(uint32_t)
|
||||
|
||||
#define FDT_BEGIN_NODE 0x1 /* Start node: full name */
|
||||
#define FDT_END_NODE 0x2 /* End node */
|
||||
#define FDT_PROP 0x3 /* Property: name off,
|
||||
size, content */
|
||||
#define FDT_NOP 0x4 /* nop */
|
||||
#define FDT_END 0x9
|
||||
|
||||
#define FDT_V1_SIZE (7*sizeof(uint32_t))
|
||||
#define FDT_V2_SIZE (FDT_V1_SIZE + sizeof(uint32_t))
|
||||
#define FDT_V3_SIZE (FDT_V2_SIZE + sizeof(uint32_t))
|
||||
#define FDT_V16_SIZE FDT_V3_SIZE
|
||||
#define FDT_V17_SIZE (FDT_V16_SIZE + sizeof(uint32_t))
|
||||
|
||||
#endif /* _FDT_H */
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,77 +1,77 @@
|
||||
/** @file
|
||||
*
|
||||
* Copyright (c) 2011-2012, ARM Limited. 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.
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef _LIBFDT_ENV_H
|
||||
#define _LIBFDT_ENV_H
|
||||
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
|
||||
typedef UINT8 uint8_t;
|
||||
typedef UINT16 uint16_t;
|
||||
typedef UINT32 uint32_t;
|
||||
typedef UINT64 uint64_t;
|
||||
typedef UINTN uintptr_t;
|
||||
typedef UINTN size_t;
|
||||
|
||||
static inline uint16_t fdt16_to_cpu(uint16_t x)
|
||||
{
|
||||
return SwapBytes16 (x);
|
||||
}
|
||||
#define cpu_to_fdt16(x) fdt16_to_cpu(x)
|
||||
|
||||
static inline uint32_t fdt32_to_cpu(uint32_t x)
|
||||
{
|
||||
return SwapBytes32 (x);
|
||||
}
|
||||
#define cpu_to_fdt32(x) fdt32_to_cpu(x)
|
||||
|
||||
static inline uint64_t fdt64_to_cpu(uint64_t x)
|
||||
{
|
||||
return SwapBytes64 (x);
|
||||
}
|
||||
#define cpu_to_fdt64(x) fdt64_to_cpu(x)
|
||||
|
||||
static inline void* memcpy(void* dest, const void* src, size_t len) {
|
||||
return CopyMem (dest, src, len);
|
||||
}
|
||||
|
||||
static inline void *memmove(void *dest, const void *src, size_t n) {
|
||||
return CopyMem (dest, src, n);
|
||||
}
|
||||
|
||||
static inline void *memset(void *s, int c, size_t n) {
|
||||
return SetMem (s, n, c);
|
||||
}
|
||||
|
||||
static inline int memcmp(const void* dest, const void* src, int len) {
|
||||
return CompareMem (dest, src, len);
|
||||
}
|
||||
|
||||
static inline void *memchr(const void *s, int c, size_t n) {
|
||||
return ScanMem8 (s, n, c);
|
||||
}
|
||||
|
||||
static inline size_t strlen (const char* str) {
|
||||
return AsciiStrLen (str);
|
||||
}
|
||||
|
||||
static inline char *strchr(const char *s, int c) {
|
||||
char pattern[2];
|
||||
pattern[0] = c;
|
||||
pattern[1] = 0;
|
||||
return AsciiStrStr (s, pattern);
|
||||
}
|
||||
|
||||
#endif /* _LIBFDT_ENV_H */
|
||||
/** @file
|
||||
*
|
||||
* Copyright (c) 2011-2012, ARM Limited. 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.
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef _LIBFDT_ENV_H
|
||||
#define _LIBFDT_ENV_H
|
||||
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
|
||||
typedef UINT8 uint8_t;
|
||||
typedef UINT16 uint16_t;
|
||||
typedef UINT32 uint32_t;
|
||||
typedef UINT64 uint64_t;
|
||||
typedef UINTN uintptr_t;
|
||||
typedef UINTN size_t;
|
||||
|
||||
static inline uint16_t fdt16_to_cpu(uint16_t x)
|
||||
{
|
||||
return SwapBytes16 (x);
|
||||
}
|
||||
#define cpu_to_fdt16(x) fdt16_to_cpu(x)
|
||||
|
||||
static inline uint32_t fdt32_to_cpu(uint32_t x)
|
||||
{
|
||||
return SwapBytes32 (x);
|
||||
}
|
||||
#define cpu_to_fdt32(x) fdt32_to_cpu(x)
|
||||
|
||||
static inline uint64_t fdt64_to_cpu(uint64_t x)
|
||||
{
|
||||
return SwapBytes64 (x);
|
||||
}
|
||||
#define cpu_to_fdt64(x) fdt64_to_cpu(x)
|
||||
|
||||
static inline void* memcpy(void* dest, const void* src, size_t len) {
|
||||
return CopyMem (dest, src, len);
|
||||
}
|
||||
|
||||
static inline void *memmove(void *dest, const void *src, size_t n) {
|
||||
return CopyMem (dest, src, n);
|
||||
}
|
||||
|
||||
static inline void *memset(void *s, int c, size_t n) {
|
||||
return SetMem (s, n, c);
|
||||
}
|
||||
|
||||
static inline int memcmp(const void* dest, const void* src, int len) {
|
||||
return CompareMem (dest, src, len);
|
||||
}
|
||||
|
||||
static inline void *memchr(const void *s, int c, size_t n) {
|
||||
return ScanMem8 (s, n, c);
|
||||
}
|
||||
|
||||
static inline size_t strlen (const char* str) {
|
||||
return AsciiStrLen (str);
|
||||
}
|
||||
|
||||
static inline char *strchr(const char *s, int c) {
|
||||
char pattern[2];
|
||||
pattern[0] = c;
|
||||
pattern[1] = 0;
|
||||
return AsciiStrStr (s, pattern);
|
||||
}
|
||||
|
||||
#endif /* _LIBFDT_ENV_H */
|
||||
|
Reference in New Issue
Block a user