Adding support for BeagleBoard.

ArmPkg - Supoprt for ARM specific things that can change as the architecture changes. Plus semihosting JTAG drivers.
EmbeddedPkg - Generic support for an embeddded platform. Including a light weight command line shell.
BeagleBoardPkg - Platform specifics for BeagleBoard. SD Card works, but USB has issues. Looks like a bug in the open source USB stack (Our internal stack works fine).


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9518 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
AJFISH
2009-12-06 01:57:05 +00:00
parent f7753a96ba
commit 2ef2b01e07
294 changed files with 47954 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
/** @file
Protocol is used to help implement DebugSupport.RegisterPeriodicCallback() functionality.
This enables the DXE timer driver to support the periodic callback function so the
DebugSupport driver does not need to contain platform specific information about how a timer
works.
Copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
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 __DEBUG_SUPPORT_PERIODIC_CALLBACK_H__
#define __DEBUG_SUPPORT_PERIODIC_CALLBACK_H__
#include <Protocol/DebugSupport.h>
typedef struct _EFI_DEBUG_SUPPORT_PERIODIC_CALLBACK_PROTOCOL EFI_DEBUG_SUPPORT_PERIODIC_CALLBACK_PROTOCOL;
// {9546E07C-2CBB-4c88-986C-CD341086F044}
#define EFI_DEBUG_SUPPORT_PERIODIC_CALLBACK_PROTOCOL_GUID \
{ 0x9546e07c, 0x2cbb, 0x4c88, { 0x98, 0x6c, 0xcd, 0x34, 0x10, 0x86, 0xf0, 0x44 } }
//
// DebugSupport protocol definition
//
struct _EFI_DEBUG_SUPPORT_PERIODIC_CALLBACK_PROTOCOL {
EFI_PERIODIC_CALLBACK PeriodicCallback;
};
extern EFI_GUID gEfiDebugSupportPeriodicCallbackProtocolGuid;
#endif

View File

@@ -0,0 +1,156 @@
/** @file
Copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
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.
**/
/** @file
Abstraction for hardware based interrupt routine
Copyright (c) 2009 Apple Inc.
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 __EBL_ADD_COMMAND_H__
#define __EBL_ADD_COMMAND_H__
//
// Protocol GUID
//
// AEDA2428-9A22-4637-9B21-545E28FBB829
#define EBL_ADD_COMMAND_PROTOCOL_GUID \
{ 0xaeda2428, 0x9a22, 0x4637, { 0x9b, 0x21, 0x54, 0x5e, 0x28, 0xfb, 0xb8, 0x29 } }
typedef struct _EBL_ADD_COMMAND_PROTOCOL EBL_ADD_COMMAND_PROTOCOL;
typedef
EFI_STATUS
(EFIAPI *EBL_COMMMAND) (
IN UINTN Argc,
IN CHAR8 **Argv
);
typedef struct {
CHAR8 *Name;
CHAR8 *HelpSummary;
CHAR8 *Help;
EBL_COMMMAND Command;
} EBL_COMMAND_TABLE;
/**
Add a single command table entry.
@param EntryArray Pointer EBL_COMMAND_TABLE of the command that is being added
**/
typedef
VOID
(EFIAPI *EBL_ADD_COMMAND) (
IN const EBL_COMMAND_TABLE *Entry
);
/**
Add a multiple command table entry.
@param EntryArray Pointer EBL_COMMAND_TABLE of the commands that are being added
@param ArrayCount Nuber of commands in the EntryArray.
**/
typedef
VOID
(EFIAPI *EBL_ADD_COMMANDS) (
IN const EBL_COMMAND_TABLE *EntryArray,
IN UINTN ArrayCount
);
typedef
VOID
(EFIAPI *EBL_GET_CHAR_CALL_BACK) (
IN UINTN ElapsedTime
);
/**
Return a keypress or optionally timeout if a timeout value was passed in.
An optional callback funciton is called evey 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
**/
typedef
EFI_STATUS
(EFIAPI *EBL_GET_CHAR_KEY) (
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.
**/
typedef
BOOLEAN
(EFIAPI *EBL_ANY_KEY_CONTINUE_Q_QUIT) (
IN UINTN *CurrentRow,
IN BOOLEAN PrefixNewline
);
struct _EBL_ADD_COMMAND_PROTOCOL {
EBL_ADD_COMMAND AddCommand;
EBL_ADD_COMMANDS AddCommands;
// Commands to reuse EBL infrastructure
EBL_GET_CHAR_KEY EblGetCharKey;
EBL_ANY_KEY_CONTINUE_Q_QUIT EblAnyKeyToContinueQtoQuit;
};
extern EFI_GUID gEfiEblAddCommandProtocolGuid;
#endif

View File

@@ -0,0 +1,58 @@
/** @file
Deal with devices that just exist in memory space.
To follow the EFI driver model you need a root handle to start with. An
EFI driver will have a driver binding protocol (Supported, Start, Stop)
that is used to layer on top of a handle via a gBS->ConnectController.
The first handle has to just be in the system to make that work. For
PCI it is a PCI Root Bridge IO protocol that provides the root.
On an embedded system with MMIO device we need a handle to just
show up. That handle will have this protocol and a device path
protocol on it.
For an ethernet device the device path must contain a MAC address device path
node.
Copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
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 __EMBEDDED_DEVICE_PROTOCOL_H__
#define __EMBEDDED_DEVICE_PROTOCOL_H__
//
// Protocol GUID
//
// BF4B9D10-13EC-43dd-8880-E90B718F27DE
#define EMBEDDED_DEVICE_PROTOCOL_GUID \
{ 0xbf4b9d10, 0x13ec, 0x43dd, { 0x88, 0x80, 0xe9, 0xb, 0x71, 0x8f, 0x27, 0xde } }
typedef struct {
UINT16 VendorId;
UINT16 DeviceId;
UINT16 RevisionId;
UINT16 SubsystemId;
UINT16 SubsystemVendorId;
UINT8 ClassCode[3];
UINT8 HeaderSize;
UINTN BaseAddress;
} EMBEDDED_DEVICE_PROTOCOL;
extern EFI_GUID gEmbeddedDeviceGuid;
#endif

View File

@@ -0,0 +1,94 @@
/** @file
Copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
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 __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__

View File

@@ -0,0 +1,167 @@
/** @file
Copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
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 __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

View File

@@ -0,0 +1,151 @@
/** @file
Abstraction for hardware based interrupt routine
On non IA-32 systems it is common to have a single hardware interrupt vector
and a 2nd layer of software that routes the interrupt handlers based on the
interrupt source. This protocol enables this routing. The driver implementing
this protocol is responsible for clearing the pending interrupt in the
interrupt routing hardware. The HARDWARE_INTERRUPT_HANDLER is responsible
for clearing interrupt sources from individual devices.
Copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
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 __HARDWARE_INTERRUPT_H__
#define __HARDWARE_INTERRUPT_H__
#include <Protocol/DebugSupport.h>
//
// Protocol GUID
//
// EAB39028-3D05-4316-AD0C-D64808DA3FF1
#define EFI_HARDWARE_INTERRUPT_PROTOCOL_GGUID \
{ 0x2890B3EA, 0x053D, 0x1643, { 0xAD, 0x0C, 0xD6, 0x48, 0x08, 0xDA, 0x3F, 0xF1 } }
typedef struct _EFI_HARDWARE_INTERRUPT_PROTOCOL EFI_HARDWARE_INTERRUPT_PROTOCOL;
typedef UINTN HARDWARE_INTERRUPT_SOURCE;
/**
C Interrupt Handler calledin the interrupt context when Source interrupt is active.
@param Source Source of the interrupt. Hardware routing off a specific platform defines
what source means.
@param SystemContext Pointer to system register context. Mostly used by debuggers and will
update the system context after the return from the interrupt if
modified. Don't change these values unless you know what you are doing
**/
typedef
VOID
(EFIAPI *HARDWARE_INTERRUPT_HANDLER) (
IN HARDWARE_INTERRUPT_SOURCE Source,
IN EFI_SYSTEM_CONTEXT SystemContext
);
/**
Register Handler for the specified interrupt source.
@param This Instance pointer for this protocol
@param Source Hardware source of the interrupt
@param Handler Callback for interrupt. NULL to unregister
@retval EFI_SUCCESS Source was updated to support Handler.
@retval EFI_DEVICE_ERROR Hardware could not be programmed.
**/
typedef
EFI_STATUS
(EFIAPI *HARDWARE_INTERRUPT_REGISTER) (
IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,
IN HARDWARE_INTERRUPT_SOURCE Source,
IN HARDWARE_INTERRUPT_HANDLER Handler
);
/**
Enable interrupt source Source.
@param This Instance pointer for this protocol
@param Source Hardware source of the interrupt
@retval EFI_SUCCESS Source interrupt enabled.
@retval EFI_DEVICE_ERROR Hardware could not be programmed.
**/
typedef
EFI_STATUS
(EFIAPI *HARDWARE_INTERRUPT_ENABLE) (
IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,
IN HARDWARE_INTERRUPT_SOURCE Source
);
/**
Disable interrupt source Source.
@param This Instance pointer for this protocol
@param Source Hardware source of the interrupt
@retval EFI_SUCCESS Source interrupt disabled.
@retval EFI_DEVICE_ERROR Hardware could not be programmed.
**/
typedef
EFI_STATUS
(EFIAPI *HARDWARE_INTERRUPT_DISABLE) (
IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,
IN HARDWARE_INTERRUPT_SOURCE Source
);
/**
Return current state of interrupt source Source.
@param This Instance pointer for this protocol
@param Source Hardware source of the interrupt
@param InterruptState TRUE: source enabled, FALSE: source disabled.
@retval EFI_SUCCESS InterruptState is valid
@retval EFI_DEVICE_ERROR InterruptState is not valid
**/
typedef
EFI_STATUS
(EFIAPI *HARDWARE_INTERRUPT_INTERRUPT_STATE) (
IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,
IN HARDWARE_INTERRUPT_SOURCE Source,
IN BOOLEAN *InterruptState
);
struct _EFI_HARDWARE_INTERRUPT_PROTOCOL {
HARDWARE_INTERRUPT_REGISTER RegisterInterruptSource;
HARDWARE_INTERRUPT_ENABLE EnableInterruptSource;
HARDWARE_INTERRUPT_DISABLE DisableInterruptSource;
HARDWARE_INTERRUPT_INTERRUPT_STATE GetInterruptSourceState;
};
extern EFI_GUID gHardwareInterruptProtocolGuid;
#endif