| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| Redistribution and use in source and binary forms, with or without | ||
| modification, are permitted provided that the following conditions are | ||
| met: | ||
|
|
||
| 1. Redistributions of source code must retain the above copyright | ||
| notice, this list of conditions and the following disclaimer. | ||
|
|
||
| 2. Redistributions in binary form must reproduce the above copyright | ||
| notice, this list of conditions and the following disclaimer in the | ||
| documentation and/or other materials provided with the distribution. | ||
|
|
||
| Subject to the terms and conditions of this license, each copyright | ||
| holder and contributor hereby grants to those receiving rights under | ||
| this license a perpetual, worldwide, non-exclusive, no-charge, | ||
| royalty-free, irrevocable (except for failure to satisfy the conditions | ||
| of this license) patent license to make, have made, use, offer to sell, | ||
| sell, import, and otherwise transfer this software, where such license | ||
| applies only to those patent claims, already acquired or hereafter | ||
| acquired, licensable by such copyright holder or contributor that are | ||
| necessarily infringed by: | ||
|
|
||
| (a) their Contribution(s) (the licensed copyrights of copyright holders | ||
| and non-copyrightable additions of contributors, in source or binary | ||
| form) alone; | ||
| or | ||
| (b) combination of their Contribution(s) with the work of authorship to | ||
| which such Contribution(s) was added by such copyright holder or | ||
| contributor, if, at the time the Contribution is added, such addition | ||
| causes such combination to be necessarily infringed. The patent | ||
| license shall not apply to any other combinations which include the | ||
| Contribution. | ||
|
|
||
| Except as expressly stated above, no rights or licenses from any | ||
| copyright holder or contributor is granted under this license, whether | ||
| expressly, by implication, estoppel or otherwise. | ||
|
|
||
| DISCLAIMER | ||
|
|
||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS | ||
| IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | ||
| TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A | ||
| PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED | ||
| TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
| PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
| LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
| NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
| SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| Copyright (c) <year> <owner>. | ||
|
|
||
| Redistribution and use in source and binary forms, with or without | ||
| modification, are permitted provided that the following conditions are | ||
| met: | ||
|
|
||
| 1. Redistributions of source code must retain the above copyright | ||
| notice, this list of conditions and the following disclaimer. | ||
| 2. Redistributions in binary form must reproduce the above copyright | ||
| notice, this list of conditions and the following disclaimer in the | ||
| documentation and/or other materials provided with the distribution. | ||
|
|
||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS | ||
| IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | ||
| TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A | ||
| PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED | ||
| TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
| PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
| LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
| NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
| SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| Copyright [various years] The Regents of the University of California. | ||
| All rights reserved. | ||
|
|
||
| Redistribution and use in source and binary forms, with or without | ||
| modification, are permitted provided that the following conditions are | ||
| met: | ||
|
|
||
| 1. Redistributions of source code must retain the above copyright | ||
| notice, this list of conditions and the following disclaimer. | ||
| 2. Redistributions in binary form must reproduce the above copyright | ||
| notice, this list of conditions and the following disclaimer in the | ||
| documentation and/or other materials provided with the distribution. | ||
| 3. All advertising materials mentioning features or use of this software | ||
| must display the following acknowledgement: This product includes | ||
| software developed by the University of California, Berkeley and its | ||
| contributors. | ||
| 4. Neither the name of the University nor the names of its contributors | ||
| may be used to endorse or promote products derived from this software | ||
| without specific prior written permission. | ||
|
|
||
| THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ''AS IS'' AND | ||
| ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE | ||
| LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
| CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
| SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
| INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
| CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
| THE POSSIBILITY OF SUCH DAMAGE. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| The person or persons who have associated work with this document (the | ||
| "Dedicator" or "Certifier") hereby either (a) certifies that, to the | ||
| best of his knowledge, the work of authorship identified is in the | ||
| public domain of the country from which the work is published, or (b) | ||
| hereby dedicates whatever copyright the dedicators holds in the work of | ||
| authorship identified below (the "Work") to the public domain. A | ||
| certifier, moreover, dedicates any copyright interest he may have in the | ||
| associated work, and for these purposes, is described as a "dedicator" | ||
| below. | ||
|
|
||
| A certifier has taken reasonable steps to verify the copyright status of | ||
| this work. Certifier recognizes that his good faith efforts may not | ||
| shield him from liability if in fact the work certified is not in the | ||
| public domain. | ||
|
|
||
| Dedicator makes this dedication for the benefit of the public at large | ||
| and to the detriment of the Dedicator's heirs and successors. Dedicator | ||
| intends this dedication to be an overt act of relinquishment in | ||
| perpetuity of all present and future rights under copyright law, whether | ||
| vested or contingent, in the Work. Dedicator understands that such | ||
| relinquishment of all rights includes the relinquishment of all rights | ||
| to enforce (by lawsuit or otherwise) those copyrights in the Work. | ||
|
|
||
| Dedicator recognizes that, once placed in the public domain, the Work | ||
| may be freely reproduced, distributed, transmitted, used, modified, | ||
| built upon, or otherwise exploited by anyone for any purpose, commercial | ||
| or non-commercial, and in any way, including by methods that have not | ||
| yet been invented or conceived. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| Permission to use, copy, modify, distribute, and sell this software and | ||
| its documentation for any purpose is hereby granted without fee, | ||
| provided that the above copyright notice appears in all copies, and that | ||
| both that the copyright notice and this permission notice appear in | ||
| supporting documentation, and that the name of <copyright holder> <or | ||
| related entities> not be used in advertising or publicity pertaining to | ||
| distribution of the software without specific, written prior permission | ||
| . <copyright holder> makes no representations about the suitability of | ||
| this software for any purpose. It is provided "as is" without express or | ||
| implied warranty. | ||
|
|
||
| <copyright holder> DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS | ||
| SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND | ||
| FITNESS . IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY | ||
| SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER | ||
| RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF | ||
| CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN | ||
| CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| <copyright notice> | ||
|
|
||
| Permission to use, copy, modify and distribute this software and its | ||
| documentation for any purpose and without fee is hereby granted, | ||
| provided that the above copyright notice appear in all copies, and that | ||
| both that the copyright notice and this permission notice appear in | ||
| supporting documentation , and that the name of <copyright holder> <or | ||
| related entities> not be used in advertising or publicity pertaining to | ||
| distribution of the software without specific, written prior permission. | ||
| <copyright holder> makes no representations about the suitability of | ||
| this software for any purpose. It is provided "as is" without express or | ||
| implied warranty. | ||
|
|
||
| <copyright holder> DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS | ||
| SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND | ||
| FITNESS . IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY | ||
| SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER | ||
| RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF | ||
| CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN | ||
| CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| GCC RUNTIME LIBRARY EXCEPTION | ||
|
|
||
| Version 3.1, 31 March 2009 | ||
|
|
||
| General information: http://www.gnu.org/licenses/gcc-exception.html | ||
|
|
||
| Copyright (C) 2009 Free Software Foundation, Inc. <http://fsf.org/> | ||
|
|
||
| Everyone is permitted to copy and distribute verbatim copies of this | ||
| license document, but changing it is not allowed. | ||
|
|
||
| This GCC Runtime Library Exception ("Exception") is an additional | ||
| permission under section 7 of the GNU General Public License, version 3 | ||
| ("GPLv3"). It applies to a given file (the "Runtime Library") that bears | ||
| a notice placed by the copyright holder of the file stating that the | ||
| file is governed by GPLv3 along with this Exception. | ||
|
|
||
| When you use GCC to compile a program, GCC may combine portions of | ||
| certain GCC header files and runtime libraries with the compiled | ||
| program. The purpose of this Exception is to allow compilation of | ||
| non-GPL (including proprietary) programs to use, in this way, the header | ||
| files and runtime libraries covered by this Exception. | ||
|
|
||
| 0. Definitions. | ||
|
|
||
| A file is an "Independent Module" if it either requires the Runtime | ||
| Library for execution after a Compilation Process, or makes use of an | ||
| interface provided by the Runtime Library, but is not otherwise based | ||
| on the Runtime Library. | ||
|
|
||
| "GCC" means a version of the GNU Compiler Collection, with or without | ||
| modifications, governed by version 3 (or a specified later version) of | ||
| the GNU General Public License (GPL) with the option of using any | ||
| subsequent versions published by the FSF. | ||
|
|
||
| "GPL-compatible Software" is software whose conditions of propagation, | ||
| modification and use would permit combination with GCC in accord with | ||
| the license of GCC. | ||
|
|
||
| "Target Code" refers to output from any compiler for a real or virtual | ||
| target processor architecture, in executable form or suitable for | ||
| input to an assembler, loader, linker and/or execution phase. | ||
| Notwithstanding that, Target Code does not include data in any format | ||
| that is used as a compiler intermediate representation, or used for | ||
| producing a compiler intermediate representation. | ||
|
|
||
| The "Compilation Process" transforms code entirely represented in | ||
| non-intermediate languages designed for human-written code, and/or in | ||
| Java Virtual Machine byte code, into Target Code. Thus, for example, | ||
| use of source code generators and preprocessors need not be considered | ||
| part of the Compilation Process, since the Compilation Process can be | ||
| understood as starting with the output of the generators or | ||
| preprocessors. | ||
|
|
||
| A Compilation Process is "Eligible" if it is done using GCC, alone or | ||
| with other GPL-compatible software, or if it is done without using any | ||
| work based on GCC. For example, using non-GPL-compatible Software to | ||
| optimize any GCC intermediate representations would not qualify as an | ||
| Eligible Compilation Process. | ||
|
|
||
| 1. Grant of Additional Permission. | ||
|
|
||
| You have permission to propagate a work of Target Code formed by | ||
| combining the Runtime Library with Independent Modules, even if such | ||
| propagation would otherwise violate the terms of GPLv3, provided that | ||
| all Target Code was generated by Eligible Compilation Processes. You | ||
| may then convey such a combination under terms of your choice, | ||
| consistent with the licensing of the Independent Modules. | ||
|
|
||
| 2. No Weakening of GCC Copyleft. | ||
|
|
||
| The availability of this Exception does not imply any general | ||
| presumption that third-party software is unaffected by the copyleft | ||
| requirements of the license of GCC. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| NOTE! This copyright does *not* cover user programs that use kernel | ||
| services by normal system calls - this is merely considered normal use | ||
| of the kernel, and does *not* fall under the heading of "derived work". | ||
| Also note that the GPL below is copyrighted by the Free Software | ||
| Foundation, but the instance of code that it refers to (the Linux | ||
| kernel) is copyrighted by me and others who actually wrote it. | ||
|
|
||
| Also note that the only valid version of the GPL as far as the kernel is | ||
| concerned is _this_ particular version of the license (ie v2, not v2.2 | ||
| or v3.x or whatever), unless explicitly otherwise stated. | ||
|
|
||
| Linus Torvalds |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,19 @@ | ||
| CONFIG_VENDOR_MSI=y | ||
| CONFIG_CBFS_SIZE=0x1000000 | ||
| CONFIG_CONSOLE_CBMEM_BUFFER_SIZE=0x20000 | ||
| CONFIG_EDK2_BOOT_TIMEOUT=3 | ||
| CONFIG_BOARD_MSI_Z690_A_PRO_WIFI_DDR4=y | ||
| CONFIG_POWER_STATE_OFF_AFTER_FAILURE=y | ||
| CONFIG_PCIEXP_HOTPLUG=y | ||
| CONFIG_PCIEXP_HOTPLUG_PREFETCH_MEM_BELOW_4G=y | ||
| CONFIG_DEFAULT_CONSOLE_LOGLEVEL_0=y | ||
| CONFIG_POST_DEVICE_PCI_PCIE=y | ||
| CONFIG_POST_IO_PORT=0x80 | ||
| CONFIG_PAYLOAD_EDK2=y | ||
| CONFIG_EDK2_REPOSITORY="https://github.com/Dasharo/edk2.git" | ||
| CONFIG_EDK2_TAG_OR_REV="origin/dasharo" | ||
| CONFIG_EDK2_CBMEM_LOGGING=y | ||
| CONFIG_EDK2_FOLLOW_BGRT_SPEC=y | ||
| CONFIG_EDK2_SD_MMC_TIMEOUT=1000 | ||
| CONFIG_TPM2=y | ||
| CONFIG_TPM_MEASURED_BOOT=y |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| CONFIG_VENDOR_SYSTEM76=y | ||
| CONFIG_BOARD_SYSTEM76_GAZE15=y | ||
| CONFIG_PAYLOAD_EDK2=y | ||
| CONFIG_RUN_FSP_GOP=y | ||
| CONFIG_SMMSTORE=y |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| CONFIG_VENDOR_SYSTEM76=y | ||
| CONFIG_BOARD_SYSTEM76_LEMP9=y | ||
| CONFIG_PAYLOAD_EDK2=y | ||
| CONFIG_RUN_FSP_GOP=y | ||
| CONFIG_SMMSTORE=y |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| CONFIG_VENDOR_SYSTEM76=y | ||
| CONFIG_BOARD_SYSTEM76_ORYP5=y | ||
| CONFIG_PAYLOAD_EDK2=y | ||
| CONFIG_POST_IO=n | ||
| CONFIG_RUN_FSP_GOP=y | ||
| CONFIG_SMMSTORE=y |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| config PAYLOAD_EDK2 | ||
| bool "edk2 payload" | ||
| depends on ARCH_X86 || ARCH_ARM64 | ||
| help | ||
| Select this option if you want to build a coreboot image | ||
| with a edk2 payload. If you don't know what this is | ||
| about, just leave it enabled. | ||
|
|
||
| See https://coreboot.org/Payloads for more information. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,189 @@ | ||
| ## SPDX-License-Identifier: GPL-2.0-only | ||
|
|
||
| # force the shell to bash - the edksetup.sh script doesn't work with dash | ||
| export SHELL := env bash | ||
|
|
||
| project_name = edk2 | ||
| project_dir = $(CURDIR)/$(word 3,$(subst /, ,$(CONFIG_EDK2_REPOSITORY))) | ||
|
|
||
| BUILD_STR = -a IA32 -a X64 -t COREBOOT | ||
| BUILD_STR += -p UefiPayloadPkg/UefiPayloadPkg.dsc | ||
| BUILD_STR += -D BOOTLOADER=COREBOOT -q | ||
|
|
||
| # | ||
| # EDK II has the following build options relevant to coreboot: | ||
| # | ||
| # | ||
| # OPTION = DEFAULT_VALUE | ||
| # | ||
| # ABOVE_4G_MEMORY = TRUE | ||
| ifneq ($(CONFIG_EDK2_ABOVE_4G_MEMORY),y) | ||
| BUILD_STR += -D ABOVE_4G_MEMORY=FALSE | ||
| endif | ||
| # BOOTSPLASH_IMAGE = FALSE | ||
| ifneq ($(CONFIG_EDK2_BOOTSPLASH_FILE),) | ||
| BUILD_STR += -D BOOTSPLASH_IMAGE=TRUE | ||
| endif | ||
| # BOOT_MANAGER_ESCAPE = FALSE | ||
| ifeq ($(CONFIG_EDK2_BOOT_MANAGER_ESCAPE),y) | ||
| BUILD_STR += -D BOOT_MANAGER_ESCAPE=TRUE | ||
| endif | ||
| # BUILD_TARGETS = DEBUG | ||
| ifeq ($(CONFIG_EDK2_RELEASE),y) | ||
| BUILD_STR += -b RELEASE | ||
| endif | ||
| # DISABLE_SERIAL_TERMINAL = FALSE | ||
| ifneq ($(CONFIG_EDK2_SERIAL_SUPPORT),y) | ||
| BUILD_STR += -D DISABLE_SERIAL_TERMINAL=TRUE | ||
| endif | ||
| # FOLLOW_BGRT_SPEC = FALSE | ||
| ifeq ($(CONFIG_EDK2_FOLLOW_BGRT_SPEC),y) | ||
| BUILD_STR += -D FOLLOW_BGRT_SPEC=TRUE | ||
| endif | ||
| # PCIE_BASE_ADDRESS = 0 | ||
| ifneq ($(CONFIG_ECAM_MMCONF_LENGTH),) | ||
| BUILD_STR += --pcd gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress=$(CONFIG_ECAM_MMCONF_BASE_ADDRESS) | ||
| endif | ||
| # PCIE_BASE_LENGTH = 0 | ||
| ifneq ($(CONFIG_ECAM_MMCONF_LENGTH),) | ||
| BUILD_STR += --pcd gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize=$(CONFIG_ECAM_MMCONF_LENGTH) | ||
| endif | ||
| # PRIORITIZE_INTERNAL = FALSE | ||
| ifeq ($(CONFIG_EDK2_PRIORITIZE_INTERNAL),y) | ||
| BUILD_STR += -D PRIORITIZE_INTERNAL=TRUE | ||
| endif | ||
| # PS2_KEYBOARD_ENABLE = FALSE | ||
| ifeq ($(CONFIG_EDK2_PS2_SUPPORT),y) | ||
| BUILD_STR += -D PS2_KEYBOARD_ENABLE=TRUE | ||
| endif | ||
| # PLATFORM_BOOT_TIMEOUT = 3 | ||
| ifneq ($(CONFIG_EDK2_BOOT_TIMEOUT),) | ||
| BUILD_STR += -D PLATFORM_BOOT_TIMEOUT=$(CONFIG_EDK2_BOOT_TIMEOUT) | ||
| endif | ||
| # SIO_BUS_ENABLE = FALSE | ||
| ifeq ($(CONFIG_EDK2_PS2_SUPPORT),y) | ||
| BUILD_STR += -D SIO_BUS_ENABLE=TRUE | ||
| endif | ||
| # SHELL_TYPE = BUILD_SHELL | ||
| ifneq ($(CONFIG_EDK2_HAVE_EFI_SHELL),y) | ||
| BUILD_STR += -D SHELL_TYPE=NONE | ||
| endif | ||
| # USE_CBMEM_FOR_CONSOLE = FALSE | ||
| ifeq ($(CONFIG_EDK2_CBMEM_LOGGING),y) | ||
| BUILD_STR += -D USE_CBMEM_FOR_CONSOLE=TRUE | ||
| endif | ||
| # SD_MMC_TIMEOUT = 1000000 | ||
| ifneq ($(CONFIG_EDK2_SD_MMC_TIMEOUT),) | ||
| BUILD_STR += -D SD_MMC_TIMEOUT=$(shell echo $$(( $(CONFIG_EDK2_SD_MMC_TIMEOUT) * 1000)) ) | ||
| endif | ||
|
|
||
| # | ||
| # EDKII has the below PCDs that are relevant to coreboot: | ||
| # | ||
| # Allows EDKII to use the full framebuffer | ||
| ifeq ($(CONFIG_EDK2_FULL_SCREEN_SETUP),y) | ||
| BUILD_STR += --pcd gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow=0 | ||
| BUILD_STR += --pcd gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn=0 | ||
| BUILD_STR += --pcd gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow=0 | ||
| BUILD_STR += --pcd gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutColumn=0 | ||
| endif | ||
|
|
||
| bootloader = $(word 8,$(subst /, ,$(BUILD_STR))) | ||
|
|
||
| ifneq ($(CONFIG_EDK2_CUSTOM_BUILD_PARAMS),) | ||
| BUILD_STR += $(CONFIG_EDK2_CUSTOM_BUILD_PARAMS) | ||
| endif | ||
|
|
||
| all: clean build | ||
|
|
||
| $(project_dir): | ||
| echo " Cloning $(project_name) from $(CONFIG_EDK2_REPOSITORY)" | ||
| git clone $(CONFIG_EDK2_REPOSITORY) $(project_dir); \ | ||
| cd $(project_dir); | ||
|
|
||
| update: $(project_dir) | ||
| if [ ! -d "$(project_dir)" ]; then \ | ||
| git clone $(CONFIG_EDK2_REPOSITORY) $(project_dir); \ | ||
| fi | ||
| cd $(project_dir); \ | ||
| git checkout MdeModulePkg/Logo/Logo.bmp > /dev/null 2>&1 || true; \ | ||
| echo " Fetching new commits from $(CONFIG_EDK2_REPOSITORY)"; \ | ||
| git fetch origin 2>/dev/null; \ | ||
| if ! git rev-parse --verify -q $(CONFIG_EDK2_TAG_OR_REV) >/dev/null; then \ | ||
| echo " $(CONFIG_EDK2_TAG_OR_REV) is not a valid git reference"; \ | ||
| exit 1; \ | ||
| fi; \ | ||
| if git status --ignore-submodules=dirty | grep -q clean; then \ | ||
| echo " Checking out $(project_name) revision $(CONFIG_EDK2_TAG_OR_REV)"; \ | ||
| git checkout --detach $(CONFIG_EDK2_TAG_OR_REV) -f; \ | ||
| else \ | ||
| echo " Working directory not clean; will not overwrite"; \ | ||
| fi; \ | ||
| git submodule update --init --checkout | ||
|
|
||
| logo: $(project_dir) | ||
| case "$(CONFIG_EDK2_BOOTSPLASH_FILE)" in \ | ||
| "") ;; \ | ||
| /*) convert -background None $(CONFIG_EDK2_BOOTSPLASH_FILE) \ | ||
| BMP3:$(project_dir)/MdeModulePkg/Logo/Logo.bmp;; \ | ||
| *) convert -background None $(top)/$(CONFIG_EDK2_BOOTSPLASH_FILE) \ | ||
| BMP3:$(project_dir)/MdeModulePkg/Logo/Logo.bmp;; \ | ||
| esac \ | ||
|
|
||
| checktools: | ||
| echo -n "EDK2: Checking uuid-dev:" | ||
| echo "#include <uuid/uuid.h>" > libtest.c | ||
| echo "int main(int argc, char **argv) { (void) argc; (void) argv; return 0; }" >> libtest.c | ||
| $(HOSTCC) $(HOSTCCFLAGS) libtest.c -o libtest >/dev/null 2>&1 && echo " Found!" || \ | ||
| ( echo " Not found!"; \ | ||
| echo "ERROR: please_install uuid-dev (libuuid-devel)"; exit 1 ) | ||
| rm -rf libtest.c libtest | ||
| echo -n "EDK2: Checking nasm:" | ||
| type nasm > /dev/null 2>&1 && echo " Found!" || \ | ||
| ( echo " Not found!"; echo "ERROR: Please install nasm."; exit 1 ) | ||
| echo -n "EDK2: Checking imagemagick:" | ||
| -convert -size 1x1 xc: test.png &> /dev/null; | ||
| if [ -f test.png ]; then \ | ||
| rm test.png && echo " Found!"; \ | ||
| else \ | ||
| echo " Not found!"; \ | ||
| echo "ERROR: Please install imagemagick"; \ | ||
| exit 1; \ | ||
| fi | ||
|
|
||
| print: | ||
| echo " ##### $(project_name) Build Summary #####" | ||
| echo " Repository: $(CONFIG_EDK2_REPOSITORY)" | ||
| echo " Branch: $(CONFIG_EDK2_TAG_OR_REV)" | ||
| echo " $(BUILD_STR)" | \ | ||
| sed -e 's/--/-/g' -e 's/-/\n /g' | sort | sed \ | ||
| -e 's/a /Architecture: /g' \ | ||
| -e 's/b /Release: /g' \ | ||
| -e 's/D /Option: /g' \ | ||
| -e 's/pcd /Pcd: /g' \ | ||
| -e 's/p /Payload: /g' \ | ||
| -e 's/q /Build: Quiet/' \ | ||
| -e 's/s /Build: Silent/' \ | ||
| -e 's/t /Toolchain: /' | ||
|
|
||
| build: update print logo checktools | ||
| unset CC; $(MAKE) -C $(project_dir)/BaseTools 2>&1 | ||
| cd $(project_dir); \ | ||
| export EDK_TOOLS_PATH=$(project_dir)/BaseTools; \ | ||
| export WORKSPACE=$(project_dir); \ | ||
| . ./edksetup.sh BaseTools; \ | ||
| grep -q "COREBOOT" $(project_dir)/Conf/tools_def.txt; \ | ||
| if [ $$? -ne 0 ]; then \ | ||
| cat ../tools_def.txt >> $(project_dir)/Conf/tools_def.txt; \ | ||
| fi; \ | ||
| build $(BUILD_STR); \ | ||
| mkdir -p $(project_dir)/../output; \ | ||
| mv $(project_dir)/Build/$(bootloader)*/*/FV/UEFIPAYLOAD.fd $(project_dir)/../output/UEFIPAYLOAD.fd; \ | ||
|
|
||
| clean: | ||
| test -d $(project_dir) && (cd $(project_dir); rm -rf Build; rm -f Conf/tools_def.txt) || exit 0 | ||
|
|
||
| distclean: | ||
| rm -rf */ | ||
|
|
||
| .PHONY: all update checktools config build clean distclean logo |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0-only */ | ||
|
|
||
| #include <libpayload.h> | ||
| #include <pci.h> | ||
|
|
||
| /* | ||
| * iATU Unroll-specific register definitions | ||
| */ | ||
| #define PCIE_ATU_UNR_REGION_CTRL1 0x00 | ||
| #define PCIE_ATU_UNR_REGION_CTRL2 0x04 | ||
| #define PCIE_ATU_UNR_LOWER_BASE 0x08 | ||
| #define PCIE_ATU_UNR_UPPER_BASE 0x0C | ||
| #define PCIE_ATU_UNR_LIMIT 0x10 | ||
| #define PCIE_ATU_UNR_LOWER_TARGET 0x14 | ||
| #define PCIE_ATU_UNR_UPPER_TARGET 0x18 | ||
| #define PCIE_ATU_REGION_INDEX0 0x0 | ||
| #define PCIE_ATU_TYPE_CFG0 0x4 | ||
| #define PCIE_ATU_TYPE_CFG1 0x5 | ||
| #define PCIE_ATU_ENABLE BIT(31) | ||
| #define ATU_CTRL2 PCIE_ATU_UNR_REGION_CTRL2 | ||
| #define ATU_ENABLE PCIE_ATU_ENABLE | ||
|
|
||
| #define PCIE_ATU_BUS(x) (((x) & 0xff) << 24) | ||
| #define PCIE_ATU_DEV(x) (((x) & 0x1f) << 19) | ||
| #define PCIE_ATU_FUNC(x) (((x) & 0x7) << 16) | ||
| #define LINK_WAIT_IATU_US 1000 | ||
| #define LINK_WAIT_MAX_IATU_RETRIES 5 | ||
|
|
||
| /* Register address builder */ | ||
| #define PCIE_GET_ATU_OUTB_UNR_REG_OFFSET(region) ((region) << 9) | ||
|
|
||
| #define lower_32_bits(n) ((u32)(n)) | ||
| #define upper_32_bits(n) ((u32)(((n) >> 16) >> 16)) | ||
|
|
||
| /* | ||
| * ATU & endpoint config space base address offsets relative to | ||
| * PCIe controller base address. | ||
| */ | ||
| #define QCOM_ATU_BASE_OFFSET 0x1000 | ||
| #define QCOM_EP_CFG_OFFSET 0x100000 | ||
| #define QCOM_EP_CFG_SIZE 0x1000 /* 4K */ | ||
|
|
||
| static void dw_pcie_writel_iatu(void *atu_base, unsigned short index, | ||
| uint32_t reg, uint32_t val) | ||
| { | ||
| uint32_t offset = PCIE_GET_ATU_OUTB_UNR_REG_OFFSET(index); | ||
|
|
||
| write32(atu_base + offset + reg, val); | ||
| } | ||
|
|
||
| static uint32_t dw_pcie_readl_iatu(void *atu_base, unsigned short index, | ||
| uint32_t reg) | ||
| { | ||
| uint32_t offset = PCIE_GET_ATU_OUTB_UNR_REG_OFFSET(index); | ||
|
|
||
| return read32(atu_base + offset + reg); | ||
| } | ||
|
|
||
| static void dw_pcie_prog_outbound_atu(void *atu_base, unsigned short index, | ||
| unsigned int type, uint64_t cfg_addr, | ||
| uint64_t pcie_addr, uint32_t cfg_size) | ||
| { | ||
| dw_pcie_writel_iatu(atu_base, index, PCIE_ATU_UNR_LOWER_BASE, | ||
| lower_32_bits(cfg_addr)); | ||
| dw_pcie_writel_iatu(atu_base, index, PCIE_ATU_UNR_UPPER_BASE, | ||
| upper_32_bits(cfg_addr)); | ||
| dw_pcie_writel_iatu(atu_base, index, PCIE_ATU_UNR_LIMIT, | ||
| lower_32_bits(cfg_addr + cfg_size - 1)); | ||
| dw_pcie_writel_iatu(atu_base, index, PCIE_ATU_UNR_LOWER_TARGET, | ||
| lower_32_bits(pcie_addr)); | ||
| dw_pcie_writel_iatu(atu_base, index, PCIE_ATU_UNR_UPPER_TARGET, | ||
| upper_32_bits(pcie_addr)); | ||
| dw_pcie_writel_iatu(atu_base, index, PCIE_ATU_UNR_REGION_CTRL1, type); | ||
| dw_pcie_writel_iatu(atu_base, index, PCIE_ATU_UNR_REGION_CTRL2, | ||
| PCIE_ATU_ENABLE); | ||
| /* | ||
| * Make sure ATU enable takes effect before any subsequent config | ||
| * and I/O accesses. | ||
| */ | ||
| if (retry(LINK_WAIT_MAX_IATU_RETRIES, | ||
| (dw_pcie_readl_iatu(atu_base, index, ATU_CTRL2) & ATU_ENABLE), | ||
| udelay(LINK_WAIT_IATU_US))) | ||
| return; | ||
|
|
||
| printf("outbound iATU is couldn't be enabled after 5ms\n"); | ||
| } | ||
|
|
||
| /* Get PCIe MMIO configuration space base address */ | ||
| uintptr_t pci_map_bus(pcidev_t dev) | ||
| { | ||
| unsigned int atu_type, busdev; | ||
| uint32_t config_size; | ||
| void *cntrlr_base, *config_base, *atu_base; | ||
| unsigned int current_bus = PCI_BUS(dev); | ||
| unsigned int devfn = (PCI_SLOT(dev) << 3) | PCI_FUNC(dev); | ||
| static pcidev_t current_dev; | ||
|
|
||
| /* | ||
| * Extract PCIe controller base from coreboot and derive the ATU and | ||
| * endpoint config base addresses from it. | ||
| */ | ||
| cntrlr_base = (void *)lib_sysinfo.pcie_ctrl_base; | ||
| config_base = (void *)cntrlr_base + QCOM_EP_CFG_OFFSET; | ||
| config_size = (uint32_t)QCOM_EP_CFG_SIZE; | ||
| atu_base = (void *)cntrlr_base + QCOM_ATU_BASE_OFFSET; | ||
|
|
||
| /* | ||
| * Cache the dev. For same dev, ATU mapping is not needed for each | ||
| * request. | ||
| */ | ||
| if (current_dev == dev) | ||
| goto out; | ||
|
|
||
| current_dev = dev; | ||
|
|
||
| busdev = PCIE_ATU_BUS(current_bus) | | ||
| PCIE_ATU_DEV(PCI_SLOT(dev)) | | ||
| PCIE_ATU_FUNC(PCI_FUNC(dev)); | ||
|
|
||
| atu_type = current_bus == 1 ? PCIE_ATU_TYPE_CFG0 : PCIE_ATU_TYPE_CFG1; | ||
|
|
||
| dw_pcie_prog_outbound_atu(atu_base, PCIE_ATU_REGION_INDEX0, atu_type, | ||
| (uint64_t)config_base, busdev, config_size); | ||
| out: | ||
| return (uintptr_t)config_base + (QCOM_EP_CFG_SIZE * devfn); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,6 @@ | |
| #include <usb/usb.h> | ||
|
|
||
| hci_t *dwc2_init(void *bar); | ||
| void dwc2_rh_init(usbdev_t *dev); | ||
|
|
||
| #endif | ||