Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
469 changed files
with
28,161 additions
and
4,016 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# -*- makefile -*- : Force emacs to use Makefile mode | ||
|
||
# The EFI linker script | ||
# | ||
LDSCRIPT = scripts/efi.lds | ||
|
||
# Retain relocation information for elf2efi | ||
# | ||
LDFLAGS += -q -S | ||
|
||
# Media types. | ||
# | ||
NON_AUTO_MEDIA += efi | ||
NON_AUTO_MEDIA += efidrv | ||
NON_AUTO_MEDIA += drv.efi | ||
NON_AUTO_MEDIA += efirom | ||
|
||
# Include SNP driver in the all-drivers build | ||
# | ||
DRIVERS_net += snp | ||
|
||
# Rules for building EFI files | ||
# | ||
$(BIN)/%.efi : $(BIN)/%.efi.tmp $(ELF2EFI) | ||
$(QM)$(ECHO) " [FINISH] $@" | ||
$(Q)$(ELF2EFI) --subsystem=10 $< $@ | ||
|
||
$(BIN)/%.efidrv : $(BIN)/%.efidrv.tmp $(ELF2EFI) | ||
$(QM)$(ECHO) " [FINISH] $@" | ||
$(Q)$(ELF2EFI) --subsystem=11 $< $@ | ||
|
||
$(BIN)/%.drv.efi : $(BIN)/%.efidrv | ||
$(QM)$(ECHO) " [FINISH] $@" | ||
$(Q)$(CP) $< $@ | ||
|
||
$(BIN)/%.efirom : $(BIN)/%.efidrv $(EFIROM) | ||
$(QM)$(ECHO) " [FINISH] $@" | ||
$(Q)$(EFIROM) -v $(TGT_PCI_VENDOR) -d $(TGT_PCI_DEVICE) $< $@ | ||
|
||
$(BIN)/efidrv.cab : $(BIN)/alldrv.efis # $(ALL_drv.efi) is not yet defined | ||
$(QM)$(ECHO) " [CAB] $@" | ||
$(Q)$(LCAB) -n -q $(ALL_drv.efi) $@ | ||
|
||
$(BIN)/%.usb : $(BIN)/%.efi | ||
$(QM)$(ECHO) " [GENEFIDSK] $@" | ||
$(Q)bash util/genefidsk -o $@ -b $(EFI_BOOT_FILE) $< |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Assembler section type character | ||
# | ||
ASM_TCHAR := % | ||
ASM_TCHAR_OPS := %% | ||
|
||
# Include common ARM headers | ||
# | ||
INCDIRS += arch/arm/include | ||
|
||
# ARM-specific directories containing source files | ||
# | ||
SRCDIRS += arch/arm/interface/efi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# -*- makefile -*- : Force emacs to use Makefile mode | ||
|
||
# Include generic EFI Makefile | ||
# | ||
MAKEDEPS += Makefile.efi | ||
include Makefile.efi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/* | ||
* Copyright (C) 2016 Michael Brown <mbrown@fensystems.co.uk>. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License as | ||
* published by the Free Software Foundation; either version 2 of the | ||
* License, or any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
* 02110-1301, USA. | ||
* | ||
* You can also choose to distribute this program under the terms of | ||
* the Unmodified Binary Distribution Licence (as given in the file | ||
* COPYING.UBDL), provided that you have satisfied its requirements. | ||
*/ | ||
|
||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); | ||
|
||
#include <ipxe/io.h> | ||
#include <ipxe/arm_io.h> | ||
|
||
/** @file | ||
* | ||
* iPXE I/O API for ARM | ||
* | ||
*/ | ||
|
||
/** An ARM I/O qword */ | ||
union arm32_io_qword { | ||
uint64_t qword; | ||
uint32_t dword[2]; | ||
}; | ||
|
||
/** | ||
* Read 64-bit qword from memory-mapped device | ||
* | ||
* @v io_addr I/O address | ||
* @ret data Value read | ||
* | ||
* This is not atomic for ARM32. | ||
*/ | ||
static uint64_t arm32_readq ( volatile uint64_t *io_addr ) { | ||
volatile union arm32_io_qword *ptr = | ||
container_of ( io_addr, union arm32_io_qword, qword ); | ||
union arm32_io_qword tmp; | ||
|
||
tmp.dword[0] = readl ( &ptr->dword[0] ); | ||
tmp.dword[1] = readl ( &ptr->dword[1] ); | ||
return tmp.qword; | ||
} | ||
|
||
/** | ||
* Write 64-bit qword to memory-mapped device | ||
* | ||
* @v data Value to write | ||
* @v io_addr I/O address | ||
* | ||
* This is not atomic for ARM32. | ||
*/ | ||
static void arm32_writeq ( uint64_t data, volatile uint64_t *io_addr ) { | ||
volatile union arm32_io_qword *ptr = | ||
container_of ( io_addr, union arm32_io_qword, qword ); | ||
union arm32_io_qword tmp; | ||
|
||
tmp.qword = data; | ||
writel ( tmp.dword[0], &ptr->dword[0] ); | ||
writel ( tmp.dword[1], &ptr->dword[1] ); | ||
} | ||
|
||
PROVIDE_IOAPI_INLINE ( arm, phys_to_bus ); | ||
PROVIDE_IOAPI_INLINE ( arm, bus_to_phys ); | ||
PROVIDE_IOAPI_INLINE ( arm, readb ); | ||
PROVIDE_IOAPI_INLINE ( arm, readw ); | ||
PROVIDE_IOAPI_INLINE ( arm, readl ); | ||
PROVIDE_IOAPI_INLINE ( arm, writeb ); | ||
PROVIDE_IOAPI_INLINE ( arm, writew ); | ||
PROVIDE_IOAPI_INLINE ( arm, writel ); | ||
PROVIDE_IOAPI_INLINE ( arm, iodelay ); | ||
PROVIDE_IOAPI_INLINE ( arm, mb ); | ||
#ifdef __aarch64__ | ||
PROVIDE_IOAPI_INLINE ( arm, readq ); | ||
PROVIDE_IOAPI_INLINE ( arm, writeq ); | ||
#else | ||
PROVIDE_IOAPI ( arm, readq, arm32_readq ); | ||
PROVIDE_IOAPI ( arm, writeq, arm32_writeq ); | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef _BITS_ENDIAN_H | ||
#define _BITS_ENDIAN_H | ||
|
||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); | ||
|
||
/* ARM may be either little-endian or big-endian */ | ||
#ifdef __ARM_BIG_ENDIAN | ||
#define __BYTE_ORDER __BIG_ENDIAN | ||
#else | ||
#define __BYTE_ORDER __LITTLE_ENDIAN | ||
#endif | ||
|
||
#endif /* _BITS_ENDIAN_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#ifndef _BITS_ERRFILE_H | ||
#define _BITS_ERRFILE_H | ||
|
||
/** @file | ||
* | ||
* ARM-specific error file identifiers | ||
* | ||
*/ | ||
|
||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); | ||
|
||
/** | ||
* @addtogroup errfile Error file identifiers | ||
* @{ | ||
*/ | ||
|
||
/** @} */ | ||
|
||
#endif /* _BITS_ERRFILE_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#ifndef _BITS_HYPERV_H | ||
#define _BITS_HYPERV_H | ||
|
||
/** @file | ||
* | ||
* Hyper-V interface | ||
* | ||
*/ | ||
|
||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); | ||
|
||
#endif /* _BITS_HYPERV_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef _BITS_IO_H | ||
#define _BITS_IO_H | ||
|
||
/** @file | ||
* | ||
* ARM-specific I/O API implementations | ||
* | ||
*/ | ||
|
||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); | ||
|
||
#include <ipxe/arm_io.h> | ||
|
||
#endif /* _BITS_IO_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#ifndef _BITS_IOMAP_H | ||
#define _BITS_IOMAP_H | ||
|
||
/** @file | ||
* | ||
* ARM-specific I/O mapping API implementations | ||
* | ||
*/ | ||
|
||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); | ||
|
||
#endif /* _BITS_IOMAP_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef _BITS_NAP_H | ||
#define _BITS_NAP_H | ||
|
||
/** @file | ||
* | ||
* ARM-specific CPU sleeping API implementations | ||
* | ||
*/ | ||
|
||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); | ||
|
||
#include <ipxe/efi/efiarm_nap.h> | ||
|
||
#endif /* _BITS_MAP_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef _BITS_PCI_IO_H | ||
#define _BITS_PCI_IO_H | ||
|
||
/** @file | ||
* | ||
* ARM PCI I/O API implementations | ||
* | ||
*/ | ||
|
||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); | ||
|
||
#include <ipxe/io.h> | ||
|
||
#endif /* _BITS_PCI_IO_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.