Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apu2 uefi #1

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions CorebootModulePkg/CbSupportDxe/CbSupportDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,14 @@ CbDxeEntryPoint (
//
// Report MMIO/IO Resources
//
Status = CbReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo, 0xFEE00000, SIZE_1MB, 0, SystemTable); // LAPIC
ASSERT_EFI_ERROR (Status);
//Status = CbReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo, 0xFEE00000, SIZE_1MB, 0, SystemTable); // LAPIC
//ASSERT_EFI_ERROR (Status);

Status = CbReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo, 0xFEC00000, SIZE_4KB, 0, SystemTable); // IOAPIC
ASSERT_EFI_ERROR (Status);
//Status = CbReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo, 0xFEC00000, SIZE_4KB, 0, SystemTable); // IOAPIC
//ASSERT_EFI_ERROR (Status);

Status = CbReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo, 0xFED00000, SIZE_1KB, 0, SystemTable); // HPET
ASSERT_EFI_ERROR (Status);
//Status = CbReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo, 0xFED00000, SIZE_1KB, 0, SystemTable); // HPET
//ASSERT_EFI_ERROR (Status);

//
// Find the system table information guid hob
Expand Down
4 changes: 2 additions & 2 deletions CorebootModulePkg/CbSupportPei/CbSupportPei.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ CbPeiReportRemainedFvs (
}

/**
Based on memory base, size and type, build resource descripter HOB.
Based on memory base, size and type, build resource descriptor HOB.

@param Base Memory base address.
@param Size Memory size.
Expand Down Expand Up @@ -381,7 +381,7 @@ CbPeiEntryPoint (
SmbiosTableSize = 0;
Status = CbParseAcpiTable (&pAcpiTable, &AcpiTableSize);
if (EFI_ERROR (Status)) {
// ACPI table is oblidgible
// ACPI table is obligable
DEBUG ((EFI_D_ERROR, "Failed to find the required acpi table\n"));
ASSERT (FALSE);
}
Expand Down
6 changes: 3 additions & 3 deletions CorebootModulePkg/Include/Library/CbParseLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ typedef RETURN_STATUS \
@param Tag The tag id to be found

@retval NULL The Tag is not found.
@retval Others The poiter to the record found.
@retval Others The pointer to the record found.

**/
VOID *
Expand Down Expand Up @@ -114,7 +114,7 @@ CbParseSmbiosTable (
@param pPmCtrlReg Pointer to the address of power management control register
@param pPmTimerReg Pointer to the address of power management timer register
@param pResetReg Pointer to the address of system reset register
@param pResetValue Pointer to the value to be writen to the system reset register
@param pResetValue Pointer to the value to be written to the system reset register
@param pPmEvtReg Pointer to the address of power management event register
@param pPmGpeEnReg Pointer to the address of power management GPE enable register

Expand All @@ -139,7 +139,7 @@ CbParseFadtInfo (
@param pRegBase Pointer to the base address of serial port registers
@param pRegAccessType Pointer to the access type of serial port registers
@param pRegWidth Pointer to the register width in bytes
@param pBaudrate Pointer to the serial port baudrate
@param pBaudrate Pointer to the serial port baud rate
@param pInputHertz Pointer to the input clock frequency
@param pUartPciAddr Pointer to the UART PCI bus, dev and func address

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
#include <Library/BaseLib.h>

//
// PCI Defintions.
// PCI Definitions.
//
#define PCI_BRIDGE_32_BIT_IO_SPACE 0x01

//
// 16550 UART register offsets and bitfields
// 16550 UART register offsets and bit fields
//
#define R_UART_RXBUF 0
#define R_UART_TXBUF 0
Expand Down Expand Up @@ -154,7 +154,7 @@ SerialPortLibUpdatePciRegister16 (
@param Value The value to program into the PCI Configuration Register.
@param Mask Bitmask of the bits to check and update in the PCI configuration register.

@return The Secondary bus number that is actually programed into the PCI to PCI Bridge device.
@return The Secondary bus number that is actually programmed into the PCI to PCI Bridge device.

**/
UINT32
Expand Down Expand Up @@ -451,7 +451,7 @@ SerialPortWritable (
// 0 0 No cable connected. Transmit
// 0 1 No cable connected. Transmit
// 1 0 Cable connected, but not clear to send. Wait
// 1 1 Cable connected, and clar to send. Transmit
// 1 1 Cable connected, and clear to send. Transmit
//
return (BOOLEAN) ((SerialPortReadRegister (SerialRegisterBase, R_UART_MSR) & (B_UART_MSR_DSR | B_UART_MSR_CTS)) != (B_UART_MSR_DSR));
}
Expand Down Expand Up @@ -722,7 +722,7 @@ SerialPortRead (
/**
Polls a serial device to see if there is any data waiting to be read.

Polls aserial device to see if there is any data waiting to be read.
Polls a serial device to see if there is any data waiting to be read.
If there is data waiting to be read from the serial device, then TRUE is returned.
If there is no data waiting to be read from the serial device, then FALSE is returned.

Expand Down Expand Up @@ -903,7 +903,7 @@ SerialPortGetControl (
}

/**
Sets the baud rate, receive FIFO depth, transmit/receice time out, parity,
Sets the baud rate, receive FIFO depth, transmit/receive time out, parity,
data bits, and stop bits on a serial device.

@param BaudRate The requested baud rate. A BaudRate value of 0 will use the
Expand Down
8 changes: 4 additions & 4 deletions CorebootModulePkg/Library/CbParseLib/CbParseLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

@param val The pointer to packed data.

@return the UNIT64 value after convertion.
@return the UNIT64 value after conversion.

**/
UINT64
Expand Down Expand Up @@ -90,7 +90,7 @@ CbCheckSum16 (
@param Tag The tag id to be found

@retval NULL The Tag is not found.
@retval Others The poiter to the record found.
@retval Others The pointer to the record found.

**/
VOID *
Expand Down Expand Up @@ -383,7 +383,7 @@ CbParseSmbiosTable (
@param pPmCtrlReg Pointer to the address of power management control register
@param pPmTimerReg Pointer to the address of power management timer register
@param pResetReg Pointer to the address of system reset register
@param pResetValue Pointer to the value to be writen to the system reset register
@param pResetValue Pointer to the value to be written to the system reset register
@param pPmEvtReg Pointer to the address of power management event register
@param pPmGpeEnReg Pointer to the address of power management GPE enable register

Expand Down Expand Up @@ -531,7 +531,7 @@ CbParseFadtInfo (
@param pRegBase Pointer to the base address of serial port registers
@param pRegAccessType Pointer to the access type of serial port registers
@param pRegWidth Pointer to the register width in bytes
@param pBaudrate Pointer to the serial port baudrate
@param pBaudrate Pointer to the serial port baud rate
@param pInputHertz Pointer to the input clock frequency
@param pUartPciAddr Pointer to the UART PCI bus, dev and func address

Expand Down
2 changes: 1 addition & 1 deletion CorebootModulePkg/SataControllerDxe/SataController.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ typedef struct _EFI_SATA_CONTROLLER_PRIVATE_DATA {
UINT8 DeviceCount;

//
// The highest disqulified mode for each attached device,
// The highest disqualified mode for each attached device,
// From ATA/ATAPI spec, if a mode is not supported,
// the modes higher than it is also not supported
//
Expand Down
18 changes: 9 additions & 9 deletions CorebootModulePkg/SecCore/Ia32/Stack.S
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# Abstract:
#
# Switch the stack from temporary memory to permenent memory.
# Switch the stack from temporary memory to permanent memory.
#
#------------------------------------------------------------------------------

Expand All @@ -36,38 +36,38 @@ ASM_PFX(SecSwitchStack):

#
# !!CAUTION!! this function address's is pushed into stack after
# migration of whole temporary memory, so need save it to permenent
# migration of whole temporary memory, so need save it to permanent
# memory at first!
#
movl 20(%esp), %ebx # Save the first parameter
movl 24(%esp), %ecx # Save the second parameter

#
# Save this function's return address into permenent memory at first.
# Then, Fixup the esp point to permenent memory
# Save this function's return address into permanent memory at first.
# Then, Fixup the esp point to permanent memory
#
movl %esp, %eax
subl %ebx, %eax
addl %ecx, %eax
movl 0(%esp), %edx # copy pushed register's value to permenent memory
movl 0(%esp), %edx # copy pushed register's value to permanent memory
movl %edx, 0(%eax)
movl 4(%esp), %edx
movl %edx, 4(%eax)
movl 8(%esp), %edx
movl %edx, 8(%eax)
movl 12(%esp), %edx
movl %edx, 12(%eax)
movl 16(%esp), %edx # Update this function's return address into permenent memory
movl 16(%esp), %edx # Update this function's return address into permanent memory
movl %edx, 16(%eax)
movl %eax, %esp # From now, esp is pointed to permenent memory
movl %eax, %esp # From now, esp is pointed to permanent memory

#
# Fixup the ebp point to permenent memory
# Fixup the ebp point to permanent memory
#
movl %ebp, %eax
subl %ebx, %eax
addl %ecx, %eax
movl %eax, %ebp # From now, ebp is pointed to permenent memory
movl %eax, %ebp # From now, ebp is pointed to permanent memory

popl %edx
popl %ecx
Expand Down
18 changes: 9 additions & 9 deletions CorebootModulePkg/SecCore/Ia32/Stack.asm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;
; Abstract:
;
; Switch the stack from temporary memory to permenent memory.
; Switch the stack from temporary memory to permanent memory.
;
;------------------------------------------------------------------------------

Expand All @@ -38,39 +38,39 @@ SecSwitchStack PROC

;
; !!CAUTION!! this function address's is pushed into stack after
; migration of whole temporary memory, so need save it to permenent
; migration of whole temporary memory, so need save it to permanent
; memory at first!
;

mov ebx, [esp + 20] ; Save the first parameter
mov ecx, [esp + 24] ; Save the second parameter

;
; Save this function's return address into permenent memory at first.
; Then, Fixup the esp point to permenent memory
; Save this function's return address into permanent memory at first.
; Then, Fixup the esp point to permanent memory
;
mov eax, esp
sub eax, ebx
add eax, ecx
mov edx, dword ptr [esp] ; copy pushed register's value to permenent memory
mov edx, dword ptr [esp] ; copy pushed register's value to permanent memory
mov dword ptr [eax], edx
mov edx, dword ptr [esp + 4]
mov dword ptr [eax + 4], edx
mov edx, dword ptr [esp + 8]
mov dword ptr [eax + 8], edx
mov edx, dword ptr [esp + 12]
mov dword ptr [eax + 12], edx
mov edx, dword ptr [esp + 16] ; Update this function's return address into permenent memory
mov edx, dword ptr [esp + 16] ; Update this function's return address into permanent memory
mov dword ptr [eax + 16], edx
mov esp, eax ; From now, esp is pointed to permenent memory
mov esp, eax ; From now, esp is pointed to permanent memory

;
; Fixup the ebp point to permenent memory
; Fixup the ebp point to permanent memory
;
mov eax, ebp
sub eax, ebx
add eax, ecx
mov ebp, eax ; From now, ebp is pointed to permenent memory
mov ebp, eax ; From now, ebp is pointed to permanent memory

pop edx
pop ecx
Expand Down
2 changes: 1 addition & 1 deletion CorebootModulePkg/SecCore/Ia32/Stack.nasm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ ASM_PFX(SecSwitchStack):
mov esp, eax ; From now, esp is pointed to permanent memory

;
; Fixup the ebp point to permenent memory
; Fixup the ebp point to permanent memory
;
mov eax, ebp
sub eax, ebx
Expand Down
6 changes: 3 additions & 3 deletions CorebootModulePkg/SecCore/SecMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ SecStartupPhase2(


@param SizeOfRam Size of the temporary memory available for use.
@param TempRamBase Base address of tempory ram
@param TempRamBase Base address of temporary ram
@param BootFirmwareVolume Base address of the Boot Firmware Volume.
**/
VOID
Expand Down Expand Up @@ -276,8 +276,8 @@ SecTemporaryRamSupport (

//
// SecSwitchStack function must be invoked after the memory migration
// immediatly, also we need fixup the stack change caused by new call into
// permenent memory.
// immediately, also we need fixup the stack change caused by new call into
// permanent memory.
//
SecSwitchStack (
(UINT32) (UINTN) OldStack,
Expand Down
2 changes: 1 addition & 1 deletion CorebootModulePkg/SecCore/SecMain.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ SecTemporaryRamSupport (
the control is transferred to this function.

@param SizeOfRam Size of the temporary memory available for use.
@param TempRamBase Base address of tempory ram
@param TempRamBase Base address of temporary ram
@param BootFirmwareVolume Base address of the Boot Firmware Volume.
**/
VOID
Expand Down
Loading