5 changes: 3 additions & 2 deletions Documentation/mainboard/emulation/qemu-aarch64.md
Expand Up @@ -7,7 +7,7 @@ as a payload for QEMU/AArch64.
```bash
qemu-system-aarch64 -bios ./build/coreboot.rom \
-M virt,secure=on,virtualization=on -cpu cortex-a53 \
-nographic -m 8912M
-nographic -m 8192M
```

- The default CPU in QEMU for AArch64 is a cortex-a15 which is 32-bit
Expand All @@ -17,6 +17,7 @@ have the right to access EL3/EL2 registers. You need to enable EL3/EL2
via `-machine secure=on,virtualization=on`.
- You need to specify the size of memory more than 544 MiB because 512
MiB is reserved for the kernel.
- The maximum size of memory is 255GiB (-m 261120).

## Building coreboot with an arbitrary FIT payload
There are 3 steps to make coreboot.rom for QEMU/AArch64. If you select
Expand All @@ -30,7 +31,7 @@ You can get the DTB from QEMU with the following command.
```
$ qemu-system-aarch64 \
-M virt,dumpdtb=virt.dtb,secure=on,virtualization=on \
-cpu cortex-a53 -nographic -m 2048M
-cpu cortex-a53 -nographic -m 8192M
```

### 2. Build a FIT image with a DTB
Expand Down
1 change: 1 addition & 0 deletions Documentation/mainboard/index.md
Expand Up @@ -111,6 +111,7 @@ The boards in this section are not real mainboards, but emulators.
## Supermicro

- [X10SLM+-F](supermicro/x10slm-f.md)
- [X11SSH-TF](supermicro/x11ssh-tf.md)

## UP

Expand Down
74 changes: 74 additions & 0 deletions Documentation/mainboard/supermicro/x11ssh-tf.md
@@ -0,0 +1,74 @@
# Supermicro X11SSH-TF

This section details how to run coreboot on the [Supermicro X11SSH-TF].

## Required proprietary blobs

* [Intel FSP2.0]
* Intel ME

## Flashing coreboot

The board can be flashed externally using *some* programmers.
The CH341 was found working, while Dediprog won't detect the chip.

For more details have a look at the [flashing tutorial].

The flash IC can be found between the two PCIe slots near the southbridge:
![](x11ssh_flash.jpg)

## BMC (IPMI)

This board has an ASPEED [AST2400], which has BMC functionality. The
BMC firmware resides in a 32 MiB SOIC-16 chip in the corner of the
mainboard near the [AST2400]. This chip is an [MX25L25635F].

## Known issues

- Intel SGX causes secondary APs to crash (disabled for now).
- Tianocore doesn't work with Aspeed NGI, as it's text mode only.
- After S5 resume coreboot detects more DIMMs than installed, causing FSP-M
to fail.

## Tested and working

- USB ports
- M.2 2280 NVMe slot
- 2x 10GB Ethernet
- SATA
- RS232
- VGA on Aspeed
- Super I/O initialisation
- ECC DRAM detection
- PCIe slots
- TPM on TPM expansion header
- BMC (IPMI)

## Technology

```eval_rst
+------------------+--------------------------------------------------+
| CPU | Intel Kaby Lake |
+------------------+--------------------------------------------------+
| PCH | Intel C236 |
+------------------+--------------------------------------------------+
| Super I/O | ASPEED AST2400 |
+------------------+--------------------------------------------------+
| Coprocessor | Intel SPS (server version of the ME) |
+------------------+--------------------------------------------------+
| Coprocessor | ASPEED AST2400 |
+------------------+--------------------------------------------------+
```

## Extra links

- [Board manual]

[AST2400]: https://www.aspeedtech.com/products.php?fPath=20&rId=376
[Board manual]: https://www.supermicro.com/manuals/motherboard/C236/MNL-1783.pdf
[flashrom]: https://flashrom.org/Flashrom
[MX25L25635F]: https://media.digikey.com/pdf/Data%20Sheets/Macronix/MX25L25635F.pdf
[N25Q128A]: https://www.micron.com/~/media/Documents/Products/Data%20Sheet/NOR%20Flash/Serial%20NOR/N25Q/n25q_128mb_3v_65nm.pdf
[flashing tutorial]: ../../flash_tutorial/ext_power.md
[Intel FSP2.0]: ../../soc/intel/fsp/index.md
[Supermicro X11SSH-TF]: https://www.supermicro.com/en/products/motherboard/X11SSH-TF
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions Documentation/security/intel/txt.md
Expand Up @@ -90,11 +90,11 @@ correct state. If it's not the SINIT ACM will reset the platform.

## For developers
### Configuring Intel TXT in Kconfig
Enable ``TEE_INTEL_TXT`` and set the following:
Enable ``INTEL_TXT`` and set the following:

``TEE_INTEL_TXT_BIOSACM_FILE`` to the path of the BIOS ACM provided by Intel
``INTEL_TXT_BIOSACM_FILE`` to the path of the BIOS ACM provided by Intel

``TEE_INTEL_TXT_SINITACM_FILE`` to the path of the SINIT ACM provided by Intel
``INTEL_TXT_SINITACM_FILE`` to the path of the SINIT ACM provided by Intel
### Print TXT status as early as possible
Add platform code to print the TXT status as early as possible, as the register
is cleared on cold reset.
Expand Down
2 changes: 2 additions & 0 deletions Documentation/soc/intel/fsp/index.md
Expand Up @@ -45,6 +45,8 @@ those are fixed. If possible a workaround is described here as well.

* [FSP Specification 2.0](https://www.intel.com/content/dam/www/public/us/en/documents/technical-specifications/fsp-architecture-spec-v2.pdf)

* [FSP Specification 2.1](https://cdrdv2.intel.com/v1/dl/getContent/611786)

## Additional Features in FSP 2.1 specification

- [PPI](ppi/ppi.md)
Expand Down
56 changes: 56 additions & 0 deletions Documentation/superio/common/ssdt.md
@@ -0,0 +1,56 @@
# SuperIO SSTD generator

This page describes the common SSDT ACPI generator for SuperIO chips that can
be found in coreboot.

## Functional description

In order to automatically generate ACPI functions you need to add
a new `chip superio/common` and `device pnp xx.0 on` to your devicetree.

The xx denotes the hexadecimal address of the SuperIO.

Place the regular LDN pnp devices behind those two entries.

The code will automatically guess the function based on the decoded
I/O range and ISA IRQ number.

## Example devicetree.cb

This example is based on AST2400.

```code
# Add a "container" for proper ACPI code generation
chip superio/common
device pnp 2e.0 on # just for the base device, not for the LDNs
chip superio/aspeed/ast2400
device pnp 2e.0 off end
device pnp 2e.2 on # SUART1
io 0x60 = 0x3f8
irq 0x70 = 4
end
device pnp 2e.3 on # SUART2
io 0x60 = 0x2f8
irq 0x70 = 3
end
device pnp 2e.4 on # SWC
io 0x60 = 0xa00
io 0x62 = 0xa10
io 0x64 = 0xa20
io 0x66 = 0xa30
irq 0x70 = 0
end
end
end
end
```

## TODO

1) Add ACPI HIDs to every SuperIO driver
2) Don't guess ACPI HID of LDNs if it's known
3) Add "enter config" and "exit config" bytes
4) Generate support methods that allow
* Setting resource settings at runtime
* Getting resource settings at runtime
* Disabling LDNs at runtime
3 changes: 3 additions & 0 deletions Documentation/superio/index.md
Expand Up @@ -5,3 +5,6 @@ This section contains documentation about coreboot on specific SuperIOs.
## Nuvoton

- [NPCD378](nuvoton/npcd378.md)

## Common
- [SSDT generator for generic SuperIOs](common/ssdt.md)
12 changes: 6 additions & 6 deletions Makefile
Expand Up @@ -129,6 +129,12 @@ NOMKDIR:=1
endif
endif

.xcompile: util/xcompile/xcompile
rm -f $@
$< $(XGCCPATH) > $@.tmp
\mv -f $@.tmp $@ 2> /dev/null
rm -f $@.tmp

-include $(TOPLEVEL)/site-local/Makefile.inc

ifeq ($(NOCOMPILE),1)
Expand All @@ -148,12 +154,6 @@ include $(DOTCONFIG)
# to silence stupid warnings about a file that would be generated anyway.
$(if $(wildcard .xcompile)$(NOCOMPILE),,$(eval $(shell util/xcompile/xcompile $(XGCCPATH) > .xcompile || rm -f .xcompile)))

.xcompile: util/xcompile/xcompile
rm -f $@
$< $(XGCCPATH) > $@.tmp
\mv -f $@.tmp $@ 2> /dev/null
rm -f $@.tmp

-include .xcompile

ifneq ($(XCOMPILE_COMPLETE),1)
Expand Down
6 changes: 3 additions & 3 deletions Makefile.inc
Expand Up @@ -402,7 +402,7 @@ endif
CFLAGS_common += -pipe -g -nostdinc -std=gnu11
CFLAGS_common += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs -Wimplicit-fallthrough
CFLAGS_common += -Wstrict-aliasing -Wshadow -Wdate-time -Wtype-limits
CFLAGS_common += -Wstrict-aliasing -Wshadow -Wdate-time -Wtype-limits -Wvla
CFLAGS_common += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer
CFLAGS_common += -ffunction-sections -fdata-sections -fno-pie
ifeq ($(CONFIG_COMPILER_GCC),y)
Expand Down Expand Up @@ -497,7 +497,7 @@ build_h_exports := BUILD_TIMELESS KERNELVERSION COREBOOT_EXTRA_VERSION
# Report new `build.ht` as dependency if `build.h` differs.
build_h_check := \
export $(foreach exp,$(build_h_exports),$(exp)="$($(exp))"); \
util/genbuild_h/genbuild_h.sh >$(build_h)t 2>/dev/null; \
util/genbuild_h/genbuild_h.sh .xcompile >$(build_h)t 2>/dev/null; \
cmp -s $(build_h)t $(build_h) >/dev/null 2>&1 || echo $(build_h)t

$(build_h): $$(shell $$(build_h_check))
Expand Down Expand Up @@ -646,7 +646,7 @@ install-git-commit-clangfmt:
include util/crossgcc/Makefile.inc

.PHONY: tools
tools: $(objutil)/kconfig/conf $(CBFSTOOL) $(objutil)/cbfstool/cbfs-compression-tool $(FMAPTOOL) $(RMODTOOL) $(IFWITOOL) $(objutil)/nvramtool/nvramtool $(ROMCC_BIN) $(objutil)/sconfig/sconfig $(IFDTOOL) $(CBOOTIMAGE) $(AMDFWTOOL) $(AMDCOMPRESS) $(FUTILITY) $(BINCFG) $(IFITTOOL)
tools: $(objutil)/kconfig/conf $(objutil)/kconfig/toada $(CBFSTOOL) $(objutil)/cbfstool/cbfs-compression-tool $(FMAPTOOL) $(RMODTOOL) $(IFWITOOL) $(objutil)/nvramtool/nvramtool $(ROMCC_BIN) $(objutil)/sconfig/sconfig $(IFDTOOL) $(CBOOTIMAGE) $(AMDFWTOOL) $(AMDCOMPRESS) $(FUTILITY) $(BINCFG) $(IFITTOOL)

###########################################################################
# Common recipes for all stages
Expand Down
1 change: 0 additions & 1 deletion configs/config.intel_galileo_gen2.debug
Expand Up @@ -3,7 +3,6 @@ CONFIG_VENDOR_INTEL=y
CONFIG_BOARD_INTEL_GALILEO=y
# CONFIG_FSP_DEBUG_ALL is not set
CONFIG_DISPLAY_MTRRS=y
CONFIG_DISPLAY_SMM_MEMORY_MAP=y
CONFIG_DISPLAY_ESRAM_LAYOUT=y
CONFIG_BOOTBLOCK_NORMAL=y
CONFIG_ON_DEVICE_ROM_LOAD=y
Expand Down
2 changes: 1 addition & 1 deletion configs/config.pcengines_apu1
@@ -1,4 +1,4 @@
CONFIG_LOCALVERSION="v4.10.0.0"
CONFIG_LOCALVERSION="v4.10.0.1"
CONFIG_VENDOR_PCENGINES=y
CONFIG_PAYLOAD_CONFIGFILE="$(top)/src/mainboard/$(MAINBOARDDIR)/seabios_config"
CONFIG_NO_GFX_INIT=y
Expand Down
2 changes: 1 addition & 1 deletion configs/config.pcengines_apu2
@@ -1,4 +1,4 @@
CONFIG_LOCALVERSION="v4.10.0.0"
CONFIG_LOCALVERSION="v4.10.0.1"
CONFIG_VENDOR_PCENGINES=y
CONFIG_PAYLOAD_CONFIGFILE="$(top)/src/mainboard/$(MAINBOARDDIR)/seabios_config"
CONFIG_BOARD_PCENGINES_APU2=y
Expand Down
4 changes: 2 additions & 2 deletions configs/config.pcengines_apu2_vboot
@@ -1,13 +1,13 @@
CONFIG_LOCALVERSION="v4.9.0.7"
CONFIG_LOCALVERSION="v4.10.0.1"
CONFIG_VENDOR_PCENGINES=y
CONFIG_CBFS_SIZE=0x20C000
CONFIG_PAYLOAD_CONFIGFILE="$(top)/src/mainboard/$(MAINBOARDDIR)/seabios_config"
CONFIG_VBOOT=y
CONFIG_BOARD_PCENGINES_APU2=y
CONFIG_VBOOT_SLOTS_RW_AB=y
CONFIG_PXE_ROM_ID="8086,157b"
CONFIG_NO_GFX_INIT=y
CONFIG_VBOOT_MEASURED_BOOT=y
CONFIG_VBOOT_SLOTS_RW_AB=y
CONFIG_USER_TPM2=y
CONFIG_DEFAULT_CONSOLE_LOGLEVEL_1=y
CONFIG_SEABIOS_REVISION=y
Expand Down
2 changes: 1 addition & 1 deletion configs/config.pcengines_apu3
@@ -1,4 +1,4 @@
CONFIG_LOCALVERSION="v4.10.0.0"
CONFIG_LOCALVERSION="v4.10.0.1"
CONFIG_VENDOR_PCENGINES=y
CONFIG_PAYLOAD_CONFIGFILE="$(top)/src/mainboard/$(MAINBOARDDIR)/seabios_config"
CONFIG_BOARD_PCENGINES_APU3=y
Expand Down
2 changes: 1 addition & 1 deletion configs/config.pcengines_apu4
@@ -1,4 +1,4 @@
CONFIG_LOCALVERSION="v4.10.0.0"
CONFIG_LOCALVERSION="v4.10.0.1"
CONFIG_VENDOR_PCENGINES=y
CONFIG_PAYLOAD_CONFIGFILE="$(top)/src/mainboard/$(MAINBOARDDIR)/seabios_config"
CONFIG_BOARD_PCENGINES_APU4=y
Expand Down
2 changes: 1 addition & 1 deletion configs/config.pcengines_apu5
@@ -1,4 +1,4 @@
CONFIG_LOCALVERSION="v4.10.0.0"
CONFIG_LOCALVERSION="v4.10.0.1"
CONFIG_VENDOR_PCENGINES=y
CONFIG_PAYLOAD_CONFIGFILE="$(top)/src/mainboard/$(MAINBOARDDIR)/seabios_config"
CONFIG_BOARD_PCENGINES_APU5=y
Expand Down
6 changes: 3 additions & 3 deletions payloads/Kconfig
Expand Up @@ -30,7 +30,7 @@ config PAYLOAD_ELF

config PAYLOAD_FIT
bool "A FIT payload"
depends on ARCH_ARM64
depends on ARCH_ARM64 || ARCH_RISCV
select PAYLOAD_FIT_SUPPORT
help
Select this option if you have a payload image (a FIT file) which
Expand Down Expand Up @@ -99,8 +99,8 @@ config PAYLOAD_IS_FLAT_BINARY
config PAYLOAD_FIT_SUPPORT
bool "FIT support"
default n
default y if PAYLOAD_LINUX && (ARCH_ARM || ARCH_ARM64)
depends on ARCH_ARM64
default y if PAYLOAD_LINUX && (ARCH_ARM || ARCH_ARM64 || ARCH_RISCV)
depends on ARCH_ARM64 || ARCH_RISCV
select FLATTENED_DEVICE_TREE
help
Select this option if your payload is of type FIT.
Expand Down
2 changes: 1 addition & 1 deletion payloads/coreinfo/Makefile
Expand Up @@ -83,7 +83,7 @@ OBJCOPY := $(OBJCOPY_$(ARCH-y))
LPCC := CC="$(CC)" $(LIBPAYLOAD_OBJ)/bin/lpgcc
LPAS := AS="$(AS)" $(LIBPAYLOAD_OBJ)/bin/lpas

CFLAGS += -Wall -Wextra -Wmissing-prototypes -Werror
CFLAGS += -Wall -Wextra -Wmissing-prototypes -Wvla -Werror
CFLAGS += -Os -fno-builtin $(CFLAGS_$(ARCH-y)) $(INCLUDES)

ifneq ($(strip $(HAVE_DOTCONFIG)),)
Expand Down
15 changes: 11 additions & 4 deletions payloads/external/LinuxBoot/Kconfig
Expand Up @@ -39,6 +39,13 @@ config LINUXBOOT_ARM64
help
AARCH64 kernel and initramfs

config LINUXBOOT_RISCV
bool "RISC-V"
depends on ARCH_RISCV
select PAYLOAD_FIT_SUPPORT
help
RISC-V kernel and initramfs

endchoice

comment "Linux kernel"
Expand Down Expand Up @@ -126,22 +133,22 @@ config LINUXBOOT_KERNEL_CONFIGFILE
choice
prompt "Kernel binary format"
default LINUXBOOT_KERNEL_BZIMAGE if LINUXBOOT_X86 || LINUXBOOT_X86_64
default LINUXBOOT_KERNEL_UIMAGE if LINUXBOOT_ARM64
default LINUXBOOT_KERNEL_UIMAGE if LINUXBOOT_ARM64 || LINUXBOOT_RISCV

config LINUXBOOT_KERNEL_BZIMAGE
bool "bzImage"
depends on LINUXBOOT_X86 || LINUXBOOT_X86_64

config LINUXBOOT_KERNEL_UIMAGE
bool "uImage"
depends on LINUXBOOT_ARM64
depends on LINUXBOOT_ARM64 || LINUXBOOT_RISCV

endchoice


config LINUXBOOT_DTB_FILE
string "Compiled devicetree file"
depends on LINUXBOOT_ARM64
depends on LINUXBOOT_ARM64 || LINUXBOOT_RISCV
default ""

endif #LINUXBOOT_COMPILE_KERNEL
Expand All @@ -154,7 +161,7 @@ config LINUX_COMMAND_LINE

config PAYLOAD_FILE
default "payloads/external/LinuxBoot/linuxboot/bzImage" if LINUXBOOT_COMPILE_KERNEL && ( LINUXBOOT_X86 || LINUXBOOT_X86_64 )
default "payloads/external/LinuxBoot/linuxboot/uImage" if LINUXBOOT_COMPILE_KERNEL && LINUXBOOT_ARM64
default "payloads/external/LinuxBoot/linuxboot/uImage" if LINUXBOOT_COMPILE_KERNEL && (LINUXBOOT_ARM64 || LINUXBOOT_RISCV)
default LINUXBOOT_KERNEL_PATH if !LINUXBOOT_COMPILE_KERNEL

comment "Linux initramfs"
Expand Down
2 changes: 1 addition & 1 deletion payloads/external/LinuxBoot/Kconfig.name
Expand Up @@ -14,7 +14,7 @@

config PAYLOAD_LINUXBOOT
bool "LinuxBoot"
depends on ARCH_X86 || ARCH_ARM64
depends on ARCH_X86 || ARCH_ARM64 || ARCH_RISCV
help
Select this option if you want to build a coreboot image
with a LinuxBoot payload. If you don't know what this is
Expand Down
4 changes: 2 additions & 2 deletions payloads/external/LinuxBoot/targets/linux.mk
Expand Up @@ -33,7 +33,7 @@ OBJCOPY:=$(LINUXBOOT_CROSS_COMPILE)objcopy
ifeq ($(CONFIG_LINUXBOOT_KERNEL_CUSTOM),y)
kernel_version:=$(CONFIG_LINUXBOOT_KERNEL_CUSTOM_VERSION)
else
kernel_version:=$(shell curl -s -k https://www.kernel.org/feeds/kdist.xml | \
kernel_version:=$(shell curl -sS -k https://www.kernel.org/feeds/kdist.xml | \
sed -n -e 's@.*<guid isPermaLink="false">\(.*\)</guid>.*@\1@p' | \
awk -F ',' '/$(TAG-y)/{ print $$3 }' | \
head -n 1)
Expand Down Expand Up @@ -67,7 +67,7 @@ ifneq ($(shell [[ -d "$(kernel_dir)" && -f "$(kernel_dir)/$(decompress_flag)" ]]
if [[ ! -f $(tarball_dir)/$(kernel_tarball).xz && ! -f $(tarball_dir)/$(kernel_tarball).xz ]]; then \
echo " WWW $(kernel_tarball).xz"; \
cd $(tarball_dir); \
curl -OLs "$(kernel_mirror_path)/$(kernel_tarball).xz"; \
curl -OLSs "$(kernel_mirror_path)/$(kernel_tarball).xz"; \
cd $(pwd); \
fi
endif
Expand Down
6 changes: 3 additions & 3 deletions payloads/external/Makefile.inc
Expand Up @@ -172,14 +172,14 @@ payloads/external/tianocore/tianocore/Build/UEFIPAYLOAD.fd tianocore: $(DOTCONFI
$(MAKE) -C payloads/external/tianocore all \
HOSTCC="$(HOSTCC)" \
CC="$(HOSTCC)" \
CONFIG_TIANOCORE_MASTER=$(CONFIG_TIANOCORE_MASTER) \
CONFIG_TIANOCORE_STABLE=$(CONFIG_TIANOCORE_STABLE) \
CONFIG_TIANOCORE_REVISION=$(CONFIG_TIANOCORE_REVISION) \
CONFIG_TIANOCORE_REVISION_ID=$(CONFIG_TIANOCORE_REVISION_ID) \
CONFIG_TIANOCORE_DEBUG=$(CONFIG_TIANOCORE_DEBUG) \
CONFIG_TIANOCORE_TARGET_IA32=$(CONFIG_TIANOCORE_TARGET_IA32) \
CONFIG_TIANOCORE_USE_8254_TIMER=$(CONFIG_TIANOCORE_USE_8254_TIMER) \
CONFIG_TIANOCORE_BOOTSPLASH_FILE=$(CONFIG_TIANOCORE_BOOTSPLASH_FILE) \
CONFIG_TIANOCORE_UEFIPAYLOAD=$(CONFIG_TIANOCORE_UEFIPAYLOAD) \
CONFIG_TIANOCORE_COREBOOTPAYLOAD=$(CONFIG_TIANOCORE_COREBOOTPAYLOAD) \
CONFIG_MMCONF_BASE_ADDRESS=$(CONFIG_MMCONF_BASE_ADDRESS) \
GCC_CC_x86_32=$(GCC_CC_x86_32) \
GCC_CC_x86_64=$(GCC_CC_x86_64) \
GCC_CC_arm=$(GCC_CC_arm) \
Expand Down
2 changes: 1 addition & 1 deletion payloads/external/linux/Kconfig.name
@@ -1,6 +1,6 @@
config PAYLOAD_LINUX
bool "A Linux payload"
depends on ARCH_X86 || ARCH_ARM
depends on ARCH_X86 || ARCH_ARM || ARCH_RISCV
help
Select this option if you have a Linux bzImage which coreboot
should run as soon as the basic hardware initialization
Expand Down
34 changes: 15 additions & 19 deletions payloads/external/tianocore/Kconfig
Expand Up @@ -7,38 +7,33 @@ config PAYLOAD_FILE
The result of a corebootPkg build

choice
prompt "Tianocore version"
default TIANOCORE_STABLE
prompt "Tianocore payload"
default TIANOCORE_COREBOOTPAYLOAD
help
Select which version of Tianocore to build (default is to build stable)
stable: MrChromebox's customized version of Tianocore which works on most
Select which type of payload Tianocore will build (default is CorebootPayload)
CorebootPayload: MrChromebox's customized version of Tianocore which works on most
(all?) x86_64 devices
revision: use specific commit or branch to build Tianocore (specified by user)
UEFIPayload: Use upstream Tianocore payload from https://github.com/tianocore/edk2

config TIANOCORE_STABLE
bool "stable"
config TIANOCORE_COREBOOTPAYLOAD
bool "CorebootPayload"
help
Select this option to build using MrChromebox's custom Tianocore tree
i.e. a version of Tianocore that builds without any errors and just works.

config TIANOCORE_REVISION
bool "git revision"
config TIANOCORE_UEFIPAYLOAD
bool "UEFIPayload"
help
Select this option if you have a specific commit or branch
that you want to use from either MrChromebox's tree or upstream
EDK2 from which to build Tianocore.

You will be able to specify the name of a branch or a commit id
later.
Select this option if you want to use upstream EDK2 to build Tianocore.

endchoice

config TIANOCORE_REVISION_ID
string "Insert a commit's SHA-1 or a branch name"
depends on TIANOCORE_REVISION
default "upstream/master"
default "origin/coreboot-4.7.x-uefi"
help
The commit's SHA-1 or branch name of the revision to use.
The commit's SHA-1 or branch name of the revision to use. Choose "upstream/master"
for master branch of Tianocore release on github.

choice
prompt "Target architecture"
Expand Down Expand Up @@ -89,7 +84,7 @@ config TIANOCORE_USE_8254_TIMER

config TIANOCORE_BOOTSPLASH_IMAGE
bool "Use a custom bootsplash image"
depends on TIANOCORE_STABLE
depends on TIANOCORE_COREBOOTPAYLOAD
help
Select this option if you have a bootsplash image that you would
like to be used. If this option is not selected, the default
Expand All @@ -98,6 +93,7 @@ config TIANOCORE_BOOTSPLASH_IMAGE
config TIANOCORE_BOOTSPLASH_FILE
string "Tianocore Bootsplash path and filename"
depends on TIANOCORE_BOOTSPLASH_IMAGE
depends on TIANOCORE_COREBOOTPAYLOAD
default "bootsplash.bmp"
help
The path and filename of the file to use as graphical bootsplash
Expand Down
2 changes: 1 addition & 1 deletion payloads/external/tianocore/Kconfig.name
@@ -1,5 +1,5 @@
config PAYLOAD_TIANOCORE
bool "Tianocore coreboot payload package"
bool "Tianocore payload"
depends on ARCH_X86
help
Select this option if you want to build a coreboot image
Expand Down
27 changes: 17 additions & 10 deletions payloads/external/tianocore/Makefile
Expand Up @@ -23,8 +23,15 @@ project_git_branch=coreboot-4.7.x-uefi
upstream_git_repo=https://github.com/tianocore/edk2

# STABLE revision is 3mdeb's coreboot uefi (coreboot-4.7.x-uefi) branch
TAG-$(CONFIG_TIANOCORE_STABLE)=origin/$(project_git_branch)
TAG-$(CONFIG_TIANOCORE_REVISION)=$(CONFIG_TIANOCORE_REVISION_ID)
ifeq ($(CONFIG_TIANOCORE_UEFIPAYLOAD),y)
bootloader=UefiPayloadPkg
build_flavor=-D BOOTLOADER=COREBOOT -D PCIE_BASE=$(CONFIG_MMCONF_BASE_ADDRESS)
TAG=$(CONFIG_TIANOCORE_REVISION_ID)
else
bootloader=CorebootPayloadPkg
# STABLE revision is MrChromebox's coreboot framebuffer (coreboot_fb) branch
TAG=$(CONFIG_TIANOCORE_REVISION_ID)
endif

export EDK_TOOLS_PATH=$(project_dir)/BaseTools

Expand All @@ -39,9 +46,9 @@ TIMER=-DUSE_HPET_TIMER
endif

ifeq ($(CONFIG_TIANOCORE_TARGET_IA32), y)
BUILD_STR=-a IA32 -t COREBOOT -p CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc -b $(BUILD_TYPE) $(TIMER)
BUILD_STR=-a IA32 -t COREBOOT -p $(bootloader)/$(bootloader)Ia32.dsc -b $(BUILD_TYPE) $(TIMER) $(build_flavor)
else
BUILD_STR=-a IA32 -a X64 -t COREBOOT -p CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc -b $(BUILD_TYPE) $(TIMER)
BUILD_STR=-a IA32 -a X64 -t COREBOOT -p $(bootloader)/$(bootloader)Ia32X64.dsc -b $(BUILD_TYPE) $(TIMER) $(build_flavor)
endif

all: clean build
Expand All @@ -56,13 +63,13 @@ update: $(project_dir)
cd $(project_dir); \
echo " Fetching new commits from the $(project_name) repo"; \
git fetch --multiple origin upstream 2>/dev/null; \
if ! git rev-parse --verify -q $(TAG-y) >/dev/null; then \
echo " $(TAG-y) is not a valid git reference"; \
if ! git rev-parse --verify -q $(TAG) >/dev/null; then \
echo " $(TAG) is not a valid git reference"; \
exit 1; \
fi; \
if git describe --all --dirty | grep -qv dirty; then \
echo " Checking out $(project_name) revision $(TAG-y)"; \
git checkout --detach $(TAG-y); \
echo " Checking out $(project_name) revision $(TAG)"; \
git checkout --detach $(TAG); \
else \
echo " Working directory not clean; will not overwrite"; \
fi
Expand All @@ -80,7 +87,7 @@ checktools:

build: update checktools
unset CC; $(MAKE) -C $(project_dir)/BaseTools
echo " build $(project_name) $(TAG-y)"
echo " build $(project_name) $(TAG)"
if [ -n $(CONFIG_TIANOCORE_BOOTSPLASH_FILE) ]; then \
echo " Copying custom bootsplash image"; \
case "$(CONFIG_TIANOCORE_BOOTSPLASH_FILE)" in \
Expand All @@ -99,7 +106,7 @@ build: update checktools
cat ../tools_def.txt >> $(project_dir)/Conf/tools_def.txt; \
fi; \
build $(BUILD_STR); \
mv $(project_dir)/Build/CorebootPayloadPkg*/*/FV/UEFIPAYLOAD.fd $(project_dir)/Build/UEFIPAYLOAD.fd; \
mv $(project_dir)/Build/$(bootloader)*/*/FV/UEFIPAYLOAD.fd $(project_dir)/Build/UEFIPAYLOAD.fd; \
git checkout CorebootPayloadPkg/Logo/Logo.bmp > /dev/null 2>&1 || true

clean:
Expand Down
2 changes: 1 addition & 1 deletion payloads/libpayload/Makefile.inc
Expand Up @@ -62,7 +62,7 @@ INCLUDES := -Iinclude -Iinclude/$(ARCHDIR-y) -I$(obj) -include include/kconfig.h
CFLAGS += $(EXTRA_CFLAGS) $(INCLUDES) -Os -pipe -nostdinc -ggdb3
CFLAGS += -nostdlib -fno-builtin -ffreestanding -fomit-frame-pointer
CFLAGS += -ffunction-sections -fdata-sections
CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wvla
CFLAGS += -Wwrite-strings -Wredundant-decls -Wno-trigraphs -Wimplicit-fallthrough
CFLAGS += -Wstrict-aliasing -Wshadow -Werror

Expand Down
16 changes: 15 additions & 1 deletion payloads/libpayload/drivers/usb/usb.c
Expand Up @@ -265,6 +265,8 @@ usb_decode_mps0(usb_speed speed, u8 bMaxPacketSize0)
}
return bMaxPacketSize0;
case SUPER_SPEED:
/* Intentional fallthrough */
case SUPER_SPEED_PLUS:
if (bMaxPacketSize0 != 9) {
usb_debug("Invalid MPS0: 0x%02x\n", bMaxPacketSize0);
bMaxPacketSize0 = 9;
Expand All @@ -284,6 +286,8 @@ int speed_to_default_mps(usb_speed speed)
case HIGH_SPEED:
return 64;
case SUPER_SPEED:
/* Intentional fallthrough */
case SUPER_SPEED_PLUS:
default:
return 512;
}
Expand Down Expand Up @@ -319,6 +323,8 @@ usb_decode_interval(usb_speed speed, const endpoint_type type, const unsigned ch
return LOG2(bInterval);
}
case SUPER_SPEED:
/* Intentional fallthrough */
case SUPER_SPEED_PLUS:
switch (type) {
case ISOCHRONOUS: case INTERRUPT:
return bInterval - 1;
Expand Down Expand Up @@ -657,7 +663,7 @@ usb_detach_device(hci_t *controller, int devno)
int
usb_attach_device(hci_t *controller, int hubaddress, int port, usb_speed speed)
{
static const char* speeds[] = { "full", "low", "high", "super" };
static const char *speeds[] = { "full", "low", "high", "super", "ultra" };
usb_debug ("%sspeed device\n", (speed < sizeof(speeds) / sizeof(char*))
? speeds[speed] : "invalid value - no");
int newdev = set_address (controller, speed, port, hubaddress);
Expand Down Expand Up @@ -692,6 +698,14 @@ usb_generic_init (usbdev_t *dev)
}
}

/*
* returns the speed is above SUPER_SPEED or not
*/
_Bool is_usb_speed_ss(usb_speed speed)
{
return (speed == SUPER_SPEED || speed == SUPER_SPEED_PLUS);
}

/*
* returns the address of the closest USB2.0 hub, which is responsible for
* split transactions, along with the number of the used downstream port
Expand Down
8 changes: 4 additions & 4 deletions payloads/libpayload/drivers/usb/usbhub.c
Expand Up @@ -96,8 +96,8 @@ usb_hub_port_speed(usbdev_t *const dev, const int port)
int ret = get_status (dev, port, DR_PORT, sizeof(buf), buf);
if (ret >= 0 && (buf[0] & PORT_ENABLE)) {
/* SuperSpeed hubs can only have SuperSpeed devices. */
if (dev->speed == SUPER_SPEED)
return SUPER_SPEED;
if (is_usb_speed_ss(dev->speed))
return dev->speed;

/*[bit] 10 9 (USB 2.0 port status word)
* 0 0 full speed
Expand Down Expand Up @@ -176,7 +176,7 @@ usb_hub_port_initialize(usbdev_t *const dev, const int port)
void
usb_hub_init(usbdev_t *const dev)
{
int type = dev->speed == SUPER_SPEED ? 0x2a : 0x29; /* similar enough */
int type = is_usb_speed_ss(dev->speed) ? 0x2a : 0x29; /* similar enough */
hub_descriptor_t desc; /* won't fit the whole thing, we don't care */
if (get_descriptor(dev, gen_bmRequestType(device_to_host, class_type,
dev_recp), type, 0, &desc, sizeof(desc)) != sizeof(desc)) {
Expand All @@ -185,7 +185,7 @@ usb_hub_init(usbdev_t *const dev)
return;
}

if (dev->speed == SUPER_SPEED)
if (is_usb_speed_ss(dev->speed))
usb_hub_set_hub_depth(dev);
if (generic_hub_init(dev, desc.bNbrPorts, &usb_hub_ops) < 0)
return;
Expand Down
45 changes: 32 additions & 13 deletions payloads/libpayload/drivers/usb/usbmsc.c
Expand Up @@ -157,6 +157,9 @@ reset_transport (usbdev_t *dev)
dr.wIndex = 0;
dr.wLength = 0;

if (MSC_INST (dev)->quirks & USB_MSC_QUIRK_NO_RESET)
return MSC_COMMAND_FAIL;

/* if any of these fails, detach device, as we are lost */
if (dev->controller->control (dev, OUT, sizeof (dr), &dr, 0, 0) < 0 ||
clear_stall (MSC_INST (dev)->bulk_in) ||
Expand Down Expand Up @@ -185,7 +188,8 @@ initialize_luns (usbdev_t *dev)
dr.wValue = 0;
dr.wIndex = 0;
dr.wLength = 1;
if (dev->controller->control (dev, IN, sizeof (dr), &dr,
if (MSC_INST (dev)->quirks & USB_MSC_QUIRK_NO_LUNS ||
dev->controller->control (dev, IN, sizeof (dr), &dr,
sizeof (msc->num_luns), &msc->num_luns) < 0)
msc->num_luns = 0; /* assume only 1 lun if req fails */
msc->num_luns++; /* Get Max LUN returns number of last LUN */
Expand Down Expand Up @@ -218,14 +222,23 @@ wrap_cbw (cbw_t *cbw, int datalen, cbw_direction dir, const u8 *cmd,
static int
get_csw (endpoint_t *ep, csw_t *csw)
{
if (ep->dev->controller->bulk (ep, sizeof (csw_t), (u8 *) csw, 1) < 0) {
hci_t *ctrlr = ep->dev->controller;
int ret = ctrlr->bulk (ep, sizeof (csw_t), (u8 *) csw, 1);

/* Some broken sticks send a zero-length packet at the end of their data
transfer which would show up here. Skip it to get the actual CSW. */
if (ret == 0)
ret = ctrlr->bulk (ep, sizeof (csw_t), (u8 *) csw, 1);

if (ret < 0) {
clear_stall (ep);
if (ep->dev->controller->bulk
(ep, sizeof (csw_t), (u8 *) csw, 1) < 0) {
if (ctrlr->bulk (ep, sizeof (csw_t), (u8 *) csw, 1) < 0) {
return reset_transport (ep->dev);
}
}
if (csw->dCSWTag != tag) {
if (ret != sizeof(csw_t) || csw->dCSWTag != tag ||
csw->dCSWSignature != csw_signature) {
usb_debug ("MSC: received malformed CSW\n");
return reset_transport (ep->dev);
}
return MSC_COMMAND_OK;
Expand Down Expand Up @@ -591,14 +604,6 @@ usb_msc_test_unit_ready (usbdev_t *dev)
void
usb_msc_init (usbdev_t *dev)
{
int i;

/* init .data before setting .destroy */
dev->data = NULL;

dev->destroy = usb_msc_destroy;
dev->poll = usb_msc_poll;

configuration_descriptor_t *cd =
(configuration_descriptor_t *) dev->configuration;
interface_descriptor_t *interface =
Expand All @@ -625,13 +630,27 @@ usb_msc_init (usbdev_t *dev)
return;
}

usb_msc_force_init (dev, 0);
}

void usb_msc_force_init (usbdev_t *dev, u32 quirks)
{
int i;

/* init .data before setting .destroy */
dev->data = NULL;

dev->destroy = usb_msc_destroy;
dev->poll = usb_msc_poll;

dev->data = malloc (sizeof (usbmsc_inst_t));
if (!dev->data)
fatal("Not enough memory for USB MSC device.\n");

MSC_INST (dev)->bulk_in = 0;
MSC_INST (dev)->bulk_out = 0;
MSC_INST (dev)->usbdisk_created = 0;
MSC_INST (dev)->quirks = quirks;

for (i = 1; i <= dev->num_endp; i++) {
if (dev->endpoints[i].endpoint == 0)
Expand Down
2 changes: 1 addition & 1 deletion payloads/libpayload/drivers/usb/xhci_devconf.c
Expand Up @@ -267,7 +267,7 @@ xhci_set_address (hci_t *controller, usb_speed speed, int hubport, int hubaddr)
static int
xhci_finish_hub_config(usbdev_t *const dev, inputctx_t *const ic)
{
int type = dev->speed == SUPER_SPEED ? 0x2a : 0x29; /* similar enough */
int type = is_usb_speed_ss(dev->speed) ? 0x2a : 0x29; /* similar enough */
hub_descriptor_t desc;

if (get_descriptor(dev, gen_bmRequestType(device_to_host, class_type,
Expand Down
19 changes: 19 additions & 0 deletions payloads/libpayload/include/libpayload.h
Expand Up @@ -445,6 +445,25 @@ static inline int __ffs(u32 x) { return log2(x & (u32)(-(s32)x)); }
/** @} */


/**
* @defgroup mmio MMIO helper functions
* @{
*/
#if !CONFIG(LP_ARCH_MIPS)
void buffer_from_fifo32(void *buffer, size_t size, void *fifo,
int fifo_stride, int fifo_width);
void buffer_to_fifo32_prefix(void *buffer, u32 prefix, int prefsz, size_t size,
void *fifo, int fifo_stride, int fifo_width);
static inline void buffer_to_fifo32(void *buffer, size_t size, void *fifo,
int fifo_stride, int fifo_width)
{
buffer_to_fifo32_prefix(buffer, size, 0, 0, fifo,
fifo_stride, fifo_width);
}
#endif
/** @} */


/**
* @defgroup hash Hashing functions
* @{
Expand Down
2 changes: 2 additions & 0 deletions payloads/libpayload/include/usb/usb.h
Expand Up @@ -210,6 +210,7 @@ typedef enum {
LOW_SPEED = 1,
HIGH_SPEED = 2,
SUPER_SPEED = 3,
SUPER_SPEED_PLUS = 4,
} usb_speed;

struct usbdev {
Expand Down Expand Up @@ -293,6 +294,7 @@ int get_descriptor (usbdev_t *dev, int rtype, int descType, int descIdx,
int set_configuration (usbdev_t *dev);
int clear_feature (usbdev_t *dev, int endp, int feature, int rtype);
int clear_stall (endpoint_t *ep);
_Bool is_usb_speed_ss(usb_speed speed);

void usb_nop_init (usbdev_t *dev);
void usb_hub_init (usbdev_t *dev);
Expand Down
17 changes: 16 additions & 1 deletion payloads/libpayload/include/usb/usbmsc.h
Expand Up @@ -34,13 +34,24 @@ typedef struct {
unsigned int numblocks;
endpoint_t *bulk_in;
endpoint_t *bulk_out;
u8 usbdisk_created;
u8 quirks : 7;
u8 usbdisk_created : 1;
s8 ready;
u8 lun;
u8 num_luns;
void *data; /* For use by consumers of libpayload. */
} usbmsc_inst_t;

/* Possible values for quirks field. */
enum {
/* Don't check for LUNs (force assumption that there's only one LUN). */
USB_MSC_QUIRK_NO_LUNS = 1 << 0,
/* Never do a BULK_ONLY reset, just continue. This means that the device
cannot recover from phase errors and won't detach automatically for
unrecoverable errors. Do not use unless you have to. */
USB_MSC_QUIRK_NO_RESET = 1 << 1,
};

/* Possible values for ready field. */
enum {
USB_MSC_DETACHED = -1, /* Disk detached or out to lunch. */
Expand All @@ -56,4 +67,8 @@ typedef enum { cbw_direction_data_in = 0x80, cbw_direction_data_out = 0
int readwrite_blocks_512 (usbdev_t *dev, int start, int n, cbw_direction dir, u8 *buf);
int readwrite_blocks (usbdev_t *dev, int start, int n, cbw_direction dir, u8 *buf);

/* Force a device to enumerate as MSC, without checking class/protocol types.
It must still have a bulk endpoint pair and respond to MSC commands. */
void usb_msc_force_init (usbdev_t *dev, u32 quirks);

#endif
52 changes: 52 additions & 0 deletions payloads/libpayload/libc/lib.c
Expand Up @@ -27,6 +27,7 @@
* SUCH DAMAGE.
*/

#include <assert.h>
#include <libpayload.h>

/*
Expand Down Expand Up @@ -125,3 +126,54 @@ char *getenv(const char *name)
{
return NULL;
}

#if !CONFIG(LP_ARCH_MIPS)
/*
* Reads a transfer buffer from 32-bit FIFO registers. fifo_stride is the
* distance in bytes between registers (e.g. pass 4 for a normal array of 32-bit
* registers or 0 to read everything from the same register). fifo_width is
* the amount of bytes read per register (can be 1 through 4).
*/
void buffer_from_fifo32(void *buffer, size_t size, void *fifo,
int fifo_stride, int fifo_width)
{
u8 *p = buffer;
int i, j;

assert(fifo_width > 0 && fifo_width <= sizeof(u32) &&
fifo_stride % sizeof(u32) == 0);

for (i = 0; i < size; i += fifo_width, fifo += fifo_stride) {
u32 val = read32(fifo);
for (j = 0; j < MIN(size - i, fifo_width); j++)
*p++ = (u8)(val >> (j * 8));
}
}

/*
* Version of buffer_to_fifo32() that can prepend a prefix of up to fifo_width
* size to the transfer. This is often useful for protocols where a command word
* precedes the actual payload data. The prefix must be packed in the low-order
* bytes of the 'prefix' u32 parameter and any high-order bytes exceeding prefsz
* must be 0. Note that 'size' counts total bytes written, including 'prefsz'.
*/
void buffer_to_fifo32_prefix(void *buffer, u32 prefix, int prefsz, size_t size,
void *fifo, int fifo_stride, int fifo_width)
{
u8 *p = buffer;
int i, j = prefsz;

assert(fifo_width > 0 && fifo_width <= sizeof(u32) &&
fifo_stride % sizeof(u32) == 0 && prefsz <= fifo_width);

uint32_t val = prefix;
for (i = 0; i < size; i += fifo_width, fifo += fifo_stride) {
for (; j < MIN(size - i, fifo_width); j++)
val |= *p++ << (j * 8);
write32(fifo, val);
val = 0;
j = 0;
}

}
#endif
2 changes: 1 addition & 1 deletion payloads/linuxcheck/Makefile
Expand Up @@ -3,7 +3,7 @@ XCOMPILE=$(LIBPAYLOAD_DIR)/libpayload.xcompile
# build libpayload and put .config file in $(CURDIR) instead of ../libpayload
# to avoid pollute the libpayload source directory and possible conflicts
LPOPTS=obj="$(CURDIR)/build" DESTDIR="$(CURDIR)" DOTCONFIG="$(CURDIR)/.config"
CFLAGS += -Wall -Werror -Os -ffreestanding -nostdinc -nostdlib
CFLAGS += -Wall -Wvla -Werror -Os -ffreestanding -nostdinc -nostdlib
ifeq ($(CONFIG_ARCH_X86),y)
TARGETARCH = i386
endif
Expand Down
2 changes: 1 addition & 1 deletion payloads/nvramcui/Makefile
Expand Up @@ -3,7 +3,7 @@ XCOMPILE=$(LIBPAYLOAD_DIR)/libpayload.xcompile
# build libpayload and put .config file in $(CURDIR) instead of ../libpayload
# to avoid pollute the libpayload source directory and possible conflicts
LPOPTS=obj="$(CURDIR)/build" DESTDIR="$(CURDIR)" DOTCONFIG="$(CURDIR)/.config"
CFLAGS += -Wall -Werror -Os -ffreestanding -nostdinc -nostdlib
CFLAGS += -Wall -Wvla -Werror -Os -ffreestanding -nostdinc -nostdlib

all: nvramcui.elf

Expand Down
7 changes: 1 addition & 6 deletions src/Kconfig
Expand Up @@ -484,12 +484,7 @@ source "src/console/Kconfig"
config HAVE_ACPI_RESUME
bool
default n

config ACPI_HUGE_LOWMEM_BACKUP
bool
default n
help
On S3 resume path, backup low memory from RAMBASE..RAMTOP in CBMEM.
depends on RELOCATABLE_RAMSTAGE

config RESUME_PATH_SAME_AS_BOOT
bool
Expand Down
8 changes: 3 additions & 5 deletions src/arch/arm/Kconfig
@@ -1,24 +1,22 @@
config ARCH_ARM
bool
default n

config ARCH_BOOTBLOCK_ARM
bool
default n
select ARCH_ARM
select C_ENVIRONMENT_BOOTBLOCK

config ARCH_VERSTAGE_ARM
bool
default n
select ARCH_ARM

config ARCH_ROMSTAGE_ARM
bool
default n
select ARCH_ARM

config ARCH_RAMSTAGE_ARM
bool
default n
select ARCH_ARM

source src/arch/arm/armv4/Kconfig
source src/arch/arm/armv7/Kconfig
Expand Down
5 changes: 0 additions & 5 deletions src/arch/arm/Makefile.inc
Expand Up @@ -2,11 +2,6 @@
##
## This file is part of the coreboot project.
##
## Copyright (C) 2012-2013 The ChromiumOS Authors
## Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me@gmail.com>
## Copyright (C) 2009-2010 coresystems GmbH
## Copyright (C) 2009 Ronald G. Minnich
##
## 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; version 2 of the License.
Expand Down
8 changes: 4 additions & 4 deletions src/arch/arm/armv4/Kconfig
@@ -1,15 +1,15 @@
config ARCH_BOOTBLOCK_ARMV4
def_bool n
bool
select ARCH_BOOTBLOCK_ARM

config ARCH_VERSTAGE_ARMV4
def_bool n
bool
select ARCH_VERSTAGE_ARM

config ARCH_ROMSTAGE_ARMV4
def_bool n
bool
select ARCH_ROMSTAGE_ARM

config ARCH_RAMSTAGE_ARMV4
def_bool n
bool
select ARCH_RAMSTAGE_ARM
2 changes: 0 additions & 2 deletions src/arch/arm/armv4/Makefile.inc
Expand Up @@ -2,8 +2,6 @@
##
## This file is part of the coreboot project.
##
## Copyright (C) 2013 The ChromiumOS Authors
##
## 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; version 2 of the License.
Expand Down
19 changes: 6 additions & 13 deletions src/arch/arm/armv4/bootblock.S
@@ -1,17 +1,5 @@
/*
* Early initialization code for ARM architecture.
*
* This file is based off of the OMAP3530/ARM Cortex start.S file from Das
* U-Boot, which itself got the file from armboot.
*
* Copyright (c) 2004 Texas Instruments <r-woodruff2@ti.com>
* Copyright (c) 2001 Marius Gröger <mag@sysgo.de>
* Copyright (c) 2002 Alex Züpke <azu@sysgo.de>
* Copyright (c) 2002 Gary Jennejohn <garyj@denx.de>
* Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com>
* Copyright (c) 2003 Kshitij <kshitij@ti.com>
* Copyright (c) 2006-2008 Syed Mohammed Khasim <x0khasim@ti.com>
* Copyright (c) 2013 The Chromium OS Authors
* This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
Expand All @@ -22,6 +10,11 @@
* 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.
*
* Early initialization code for ARM architecture.
*
* This file is based off of the OMAP3530/ARM Cortex start.S file from Das
* U-Boot, which itself got the file from armboot.
*/

#include <arch/asm.h>
Expand Down
22 changes: 12 additions & 10 deletions src/arch/arm/armv7/Kconfig
@@ -1,37 +1,39 @@
config ARCH_BOOTBLOCK_ARMV7
def_bool n
bool
select ARCH_BOOTBLOCK_ARM

config ARCH_VERSTAGE_ARMV7
def_bool n
bool
select ARCH_VERSTAGE_ARM

config ARCH_ROMSTAGE_ARMV7
def_bool n
bool
select ARCH_ROMSTAGE_ARM

config ARCH_RAMSTAGE_ARMV7
def_bool n
bool
select ARCH_RAMSTAGE_ARM

config ARCH_BOOTBLOCK_ARMV7_M
def_bool n
bool
select ARCH_BOOTBLOCK_ARM

config ARCH_VERSTAGE_ARMV7_M
def_bool n
bool
select ARCH_VERSTAGE_ARM

config ARCH_BOOTBLOCK_ARMV7_R
def_bool n
bool
select ARCH_BOOTBLOCK_ARM

config ARCH_VERSTAGE_ARMV7_R
def_bool n
bool
select ARCH_VERSTAGE_ARM

config ARCH_ROMSTAGE_ARMV7_R
def_bool n
bool
select ARCH_ROMSTAGE_ARM

config ARCH_RAMSTAGE_ARMV7_R
def_bool n
bool
select ARCH_RAMSTAGE_ARM
2 changes: 0 additions & 2 deletions src/arch/arm/armv7/Makefile.inc
Expand Up @@ -2,8 +2,6 @@
##
## This file is part of the coreboot project.
##
## Copyright (C) 2013 The ChromiumOS Authors
##
## 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; version 2 of the License.
Expand Down
19 changes: 6 additions & 13 deletions src/arch/arm/armv7/bootblock.S
@@ -1,17 +1,5 @@
/*
* Early initialization code for ARMv7 architecture.
*
* This file is based off of the OMAP3530/ARM Cortex start.S file from Das
* U-Boot, which itself got the file from armboot.
*
* Copyright (c) 2004 Texas Instruments <r-woodruff2@ti.com>
* Copyright (c) 2001 Marius Gröger <mag@sysgo.de>
* Copyright (c) 2002 Alex Züpke <azu@sysgo.de>
* Copyright (c) 2002 Gary Jennejohn <garyj@denx.de>
* Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com>
* Copyright (c) 2003 Kshitij <kshitij@ti.com>
* Copyright (c) 2006-2008 Syed Mohammed Khasim <x0khasim@ti.com>
* Copyright (c) 2013 The Chromium OS Authors
* This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
Expand All @@ -22,6 +10,11 @@
* 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.
*
* Early initialization code for ARMv7 architecture.
*
* This file is based off of the OMAP3530/ARM Cortex start.S file from Das
* U-Boot, which itself got the file from armboot.
*/

#include <arch/asm.h>
Expand Down
8 changes: 5 additions & 3 deletions src/arch/arm/armv7/cpu.S
@@ -1,7 +1,5 @@
/*
* Optimized assembly for low-level CPU operations on ARMv7 processors.
*
* Cache flushing code based off sys/arch/arm/arm/cpufunc_asm_armv7.S in NetBSD
* This file is part of the coreboot project.
*
* Copyright (c) 2010 Per Odlund <per.odlund@armagedon.se>
* Copyright (c) 2014 Google Inc.
Expand All @@ -28,6 +26,10 @@
* 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.
*
* Optimized assembly for low-level CPU operations on ARMv7 processors.
*
* Cache flushing code based off sys/arch/arm/arm/cpufunc_asm_armv7.S in NetBSD
*/

#include <arch/asm.h>
Expand Down
2 changes: 1 addition & 1 deletion src/arch/arm/armv7/exception.c
@@ -1,5 +1,5 @@
/*
* This file is part of the libpayload project.
* This file is part of the coreboot project.
*
* Copyright 2013 Google Inc.
*
Expand Down
2 changes: 1 addition & 1 deletion src/arch/arm/armv7/exception_asm.S
@@ -1,5 +1,5 @@
/*
* This file is part of the libpayload project.
* This file is part of the coreboot project.
*
* Copyright 2013 Google Inc.
*
Expand Down
2 changes: 1 addition & 1 deletion src/arch/arm/armv7/exception_mr.c
@@ -1,5 +1,5 @@
/*
* This file is part of the libpayload project.
* This file is part of the coreboot project.
*
* Copyright 2013 Google Inc.
*
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm/armv7/thread.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2013 Google, Inc.
*
* 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; version 2 of the License.
Expand Down
8 changes: 3 additions & 5 deletions src/arch/arm/asmlib.h
@@ -1,9 +1,5 @@
/*
* arch/arm/asmlib.h
*
* Adapted from Linux arch/arm/include/assembler.h
*
* Copyright (C) 1996-2000 Russell King
* This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
Expand All @@ -17,6 +13,8 @@
* This file contains arm architecture specific defines
* for the different processors.
*
* Adapted from Linux arch/arm/include/assembler.h
*
* Do not include any C declarations in this file - it is included by
* assembler source.
*/
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm/boot.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2013 Google Inc.
*
* 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; version 2 of the License.
Expand Down
3 changes: 1 addition & 2 deletions src/arch/arm/div0.c
@@ -1,6 +1,5 @@
/*
* (C) Copyright 2002
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
* This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
Expand Down
6 changes: 3 additions & 3 deletions src/arch/arm/eabi_compat.c
@@ -1,7 +1,5 @@
/*
* Utility functions needed for (some) EABI conformant tool chains.
*
* (C) Copyright 2009 Wolfgang Denk <wd@denx.de>
* This file is part of the coreboot project.
*
* This program is Free Software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
Expand All @@ -12,6 +10,8 @@
* 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.
*
* Utility functions needed for (some) EABI conformant tool chains.
*/

#include <stdint.h>
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm/include/arch/asm.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2013 Google Inc.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm/include/arch/cbconfig.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2016 Google Inc.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm/include/arch/clock.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2014 Google Inc.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm/include/arch/early_variables.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm/include/arch/header.ld
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2014 Google Inc.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm/include/arch/memlayout.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2014 Google Inc.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm/include/arch/pci_ops.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2013 Google Inc.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm/include/arch/stages.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2013 The ChromiumOS Authors
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm/include/armv4/arch/cpu.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2012 Google Inc.
*
* 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; version 2 of the License.
Expand Down
18 changes: 3 additions & 15 deletions src/arch/arm/include/armv4/arch/mmio.h
@@ -1,9 +1,5 @@
/*
* Originally imported from linux/include/asm-arm/io.h. This file has changed
* substantially since then.
*
* Copyright 2013 Google Inc.
* Copyright (C) 1996-2000 Russell King
* This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
Expand All @@ -14,16 +10,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Modifications:
* 08-Apr-2013 G Replaced several macros with inlines for type safety.
* 16-Sep-1996 RMK Inlined the inx/outx functions & optimised for both
* constant addresses and variable addresses.
* 04-Dec-1997 RMK Moved a lot of this stuff to the new architecture
* specific IO header files.
* 27-Mar-1999 PJB Second parameter of memcpy_toio is const..
* 04-Apr-1999 PJB Added check_signature.
* 12-Dec-1999 RMK More cleanups
* 18-Jun-2000 RMK Removed virt_to_* and friends definitions
* Originally imported from linux/include/asm-arm/io.h. This file has changed
* substantially since then.
*/

#ifndef __ARCH_MMIO_H__
Expand Down
4 changes: 1 addition & 3 deletions src/arch/arm/include/armv7.h
@@ -1,7 +1,5 @@
/*
* (C) Copyright 2010
* Texas Instruments, <www.ti.com>
* Aneesh V <aneesh@ti.com>
* This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
Expand Down
8 changes: 1 addition & 7 deletions src/arch/arm/include/armv7/arch/cpu.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2012 Google Inc.
*
* 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; version 2 of the License.
Expand All @@ -17,12 +15,10 @@
#define __ARCH_CPU_H__

#include <stdint.h>
#include <device/device.h>

#define asmlinkage

#if !defined(__PRE_RAM__)
#include <device/device.h>

struct cpu_driver {
struct device_operations *ops;
const struct cpu_device_id *id_table;
Expand All @@ -34,8 +30,6 @@ struct cpuinfo_arm {
uint8_t arm_model;
};

#endif

/* Primitives for CPU and MP cores. */

/* read Main Id register (MIDR) */
Expand Down
2 changes: 1 addition & 1 deletion src/arch/arm/include/armv7/arch/exception.h
@@ -1,5 +1,5 @@
/*
* This file is part of the libpayload project.
* This file is part of the coreboot project.
*
* Copyright 2013 Google Inc.
*
Expand Down
18 changes: 3 additions & 15 deletions src/arch/arm/include/armv7/arch/mmio.h
@@ -1,9 +1,5 @@
/*
* Originally imported from linux/include/asm-arm/io.h. This file has changed
* substantially since then.
*
* Copyright 2013 Google Inc.
* Copyright (C) 1996-2000 Russell King
* This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
Expand All @@ -14,16 +10,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Modifications:
* 08-Apr-2013 G Replaced several macros with inlines for type safety.
* 16-Sep-1996 RMK Inlined the inx/outx functions & optimised for both
* constant addresses and variable addresses.
* 04-Dec-1997 RMK Moved a lot of this stuff to the new architecture
* specific IO header files.
* 27-Mar-1999 PJB Second parameter of memcpy_toio is const..
* 04-Apr-1999 PJB Added check_signature.
* 12-Dec-1999 RMK More cleanups
* 18-Jun-2000 RMK Removed virt_to_* and friends definitions
* Originally imported from linux/include/asm-arm/io.h. This file has changed
* substantially since then.
*/

#ifndef __ARCH_MMIO_H__
Expand Down
2 changes: 1 addition & 1 deletion src/arch/arm/include/clocks.h
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The Chromium OS Authors.
* This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm/libgcc/Makefile.inc
Expand Up @@ -2,8 +2,6 @@
##
## This file is part of the coreboot project.
##
## Copyright (C) 2013 The ChromiumOS Authors
##
## 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; version 2 of the License.
Expand Down
4 changes: 2 additions & 2 deletions src/arch/arm/libgcc/ashldi3.S
@@ -1,5 +1,5 @@
/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
Free Software Foundation, Inc.
/*
This file is part of the coreboot project.

This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Expand Down
13 changes: 5 additions & 8 deletions src/arch/arm/libgcc/lib1funcs.S
@@ -1,12 +1,5 @@
/*
* linux/arch/arm/lib/lib1funcs.S: Optimized ARM division routines
*
* Author: Nicolas Pitre <nico@fluxnic.net>
* - contributed to gcc-3.4 on Sep 30, 2003
* - adapted for the Linux kernel on Oct 2, 2003
*/

/* Copyright 1995, 1996, 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
This file is part of the coreboot project.

This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Expand All @@ -28,6 +21,10 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
*/

/*
* linux/arch/arm/lib/lib1funcs.S: Optimized ARM division routines
*/


#if defined __GNUC__

Expand Down
4 changes: 2 additions & 2 deletions src/arch/arm/libgcc/lshrdi3.S
@@ -1,5 +1,5 @@
/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
Free Software Foundation, Inc.
/*
This file is part of the coreboot project.

This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Expand Down
14 changes: 6 additions & 8 deletions src/arch/arm/libgcc/muldi3.S
@@ -1,18 +1,16 @@
/*
* linux/arch/arm/lib/muldi3.S
* This file is part of the coreboot project.
*
* Author: Nicolas Pitre
* Created: Oct 19, 2005
* Copyright: Monta Vista Software, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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.
*
* Based on linux/arch/arm/lib/muldi3.S
*/

#if defined __GNUC__
Expand Down
14 changes: 6 additions & 8 deletions src/arch/arm/libgcc/ucmpdi2.S
@@ -1,18 +1,16 @@
/*
* linux/arch/arm/lib/ucmpdi2.S
* This file is part of the coreboot project.
*
* Author: Nicolas Pitre
* Created: Oct 19, 2005
* Copyright: Monta Vista Software, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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.
*
* Based on linux/arch/arm/lib/ucmpdi2.S
*/

#if defined __GNUC__
Expand Down
2 changes: 2 additions & 0 deletions src/arch/arm/libgcc/uldivmod.S
@@ -1,4 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2010, Google Inc.
* All rights reserved.
*
Expand Down
14 changes: 6 additions & 8 deletions src/arch/arm/memcpy.S
@@ -1,18 +1,16 @@
/*
* linux/arch/arm/lib/memcpy.S
* This file is part of the coreboot project.
*
* Author: Nicolas Pitre
* Created: Sep 28, 2005
* Copyright: MontaVista Software, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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.
*
* Based on linux/arch/arm/lib/memcpy.S
*/

#include <arch/asm.h>
Expand Down
14 changes: 6 additions & 8 deletions src/arch/arm/memmove.S
@@ -1,18 +1,16 @@
/*
* linux/arch/arm/lib/memmove.S
* This file is part of the coreboot project.
*
* Author: Nicolas Pitre
* Created: Sep 28, 2005
* Copyright: (C) MontaVista Software Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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.
*
* Based on linux/arch/arm/lib/memmove.S
*/

#include <arch/asm.h>
Expand Down
8 changes: 4 additions & 4 deletions src/arch/arm/memset.S
@@ -1,7 +1,5 @@
/*
* linux/arch/arm/lib/memset.S
*
* Copyright (C) 1995-2000 Russell King
* This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
Expand All @@ -12,7 +10,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* ASM optimised string functions
* Based on linux/arch/arm/lib/memset.S
*
* ASM optimised string functions
*/

#include <arch/asm.h>
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm/stages.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2012 Google Inc.
*
* 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; version 2 of the License.
Expand Down
4 changes: 0 additions & 4 deletions src/arch/arm/tables.c
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2003 Eric Biederman
* Copyright (C) 2005 Steve Magnani
* Copyright (C) 2008-2009 coresystems GmbH
*
* 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; version 2 of the License.
Expand Down
12 changes: 7 additions & 5 deletions src/arch/arm64/Kconfig
@@ -1,27 +1,27 @@
config ARCH_ARM64
bool
default n

config ARCH_BOOTBLOCK_ARM64
bool
default n
select ARCH_ARM64
select C_ENVIRONMENT_BOOTBLOCK

config ARCH_VERSTAGE_ARM64
bool
default n
select ARCH_ARM64

config ARCH_ROMSTAGE_ARM64
bool
default n
select ARCH_ARM64

config ARCH_RAMSTAGE_ARM64
bool
default n
select ARCH_ARM64

source src/arch/arm64/armv8/Kconfig

if ARCH_ARM64

config ARM64_USE_ARCH_TIMER
bool
default n
Expand Down Expand Up @@ -58,3 +58,5 @@ config ARM64_A53_ERRATUM_843419
incorrect address calculations in rare cases. This option enables a
linker workaround to avoid those cases if your toolchain supports it.
Should be selected automatically by SoCs that are affected.

endif # if ARCH_ARM64
10 changes: 3 additions & 7 deletions src/arch/arm64/Makefile.inc
Expand Up @@ -2,12 +2,6 @@
##
## This file is part of the coreboot project.
##
## Copyright (C) 2014 Google Inc.
## Copyright (C) 2012-2013 The ChromiumOS Authors
## Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me@gmail.com>
## Copyright (C) 2009-2010 coresystems GmbH
## Copyright (C) 2009 Ronald G. Minnich
##
## 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; version 2 of the License.
Expand Down Expand Up @@ -107,6 +101,7 @@ romstage-$(CONFIG_ARM64_USE_ARCH_TIMER) += arch_timer.c
romstage-y += memset.S
romstage-y += memcpy.S
romstage-y += memmove.S
romstage-y += ramdetect.c
romstage-y += romstage.c
romstage-y += transition.c transition_asm.S

Expand All @@ -131,11 +126,12 @@ ramstage-y += div0.c
ramstage-y += eabi_compat.c
ramstage-y += boot.c
ramstage-y += tables.c
ramstage-y += ramdetect.c
ramstage-$(CONFIG_ARM64_USE_ARCH_TIMER) += arch_timer.c
ramstage-y += memset.S
ramstage-y += memcpy.S
ramstage-y += memmove.S
ramstage-$(CONFIG_ARM64_USE_ARM_TRUSTED_FIRMWARE) += arm_tf.c
ramstage-$(CONFIG_ARM64_USE_ARM_TRUSTED_FIRMWARE) += bl31.c
ramstage-y += transition.c transition_asm.S
ramstage-$(CONFIG_PAYLOAD_FIT_SUPPORT) += fit_payload.c

Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm64/arch_timer.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
Expand Down
8 changes: 4 additions & 4 deletions src/arch/arm64/armv8/Kconfig
@@ -1,17 +1,17 @@
config ARCH_BOOTBLOCK_ARMV8_64
def_bool n
bool
select ARCH_BOOTBLOCK_ARM64

config ARCH_VERSTAGE_ARMV8_64
def_bool n
bool
select ARCH_VERSTAGE_ARM64

config ARCH_ROMSTAGE_ARMV8_64
def_bool n
bool
select ARCH_ROMSTAGE_ARM64

config ARCH_RAMSTAGE_ARMV8_64
def_bool n
bool
select ARCH_RAMSTAGE_ARM64

config ARCH_ARMV8_EXTENSION
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm64/armv8/Makefile.inc
Expand Up @@ -2,8 +2,6 @@
##
## This file is part of the coreboot project.
##
## Copyright (C) 2014 The ChromiumOS Authors
##
## 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; version 2 of the License.
Expand Down
6 changes: 3 additions & 3 deletions src/arch/arm64/armv8/bootblock.S
@@ -1,7 +1,5 @@
/*
* Early initialization code for aarch64 (a.k.a. armv8)
*
* Copyright 2015 Google Inc.
* This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
Expand All @@ -12,6 +10,8 @@
* 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.
*
* Early initialization code for aarch64 (a.k.a. armv8)
*/

#include <arch/asm.h>
Expand Down
7 changes: 3 additions & 4 deletions src/arch/arm64/armv8/cpu.S
@@ -1,8 +1,5 @@
/*
* Optimized assembly for low-level CPU operations on ARM64 processors.
*
* Copyright (c) 2010 Per Odlund <per.odlund@armagedon.se>
* Copyright (c) 2014 Google Inc.
* This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
Expand All @@ -12,6 +9,8 @@
* 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.
*
* Optimized assembly for low-level CPU operations on ARM64 processors.
*/

#include <arch/asm.h>
Expand Down
2 changes: 1 addition & 1 deletion src/arch/arm64/armv8/exception.c
@@ -1,5 +1,5 @@
/*
* This file is part of the libpayload project.
* This file is part of the coreboot project.
*
* Copyright 2013 Google Inc.
*
Expand Down
6 changes: 2 additions & 4 deletions src/arch/arm64/arm_tf.c → src/arch/arm64/bl31.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2015 Google Inc.
*
* 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; version 2 of the License.
Expand All @@ -17,7 +15,7 @@
#include <arch/lib_helpers.h>
#include <arch/mmu.h>
#include <arch/transition.h>
#include <arm_tf.h>
#include <bl31.h>
#include <bootmem.h>
#include <cbfs.h>
#include <console/console.h>
Expand All @@ -42,7 +40,7 @@ void __weak *soc_get_bl31_plat_params(bl31_params_t *params)
return NULL;
}

void arm_tf_run_bl31(u64 payload_entry, u64 payload_arg0, u64 payload_spsr)
void run_bl31(u64 payload_entry, u64 payload_arg0, u64 payload_spsr)
{
struct prog bl31 = PROG_INIT(PROG_BL31, CONFIG_CBFS_PREFIX"/bl31");
void (*bl31_entry)(bl31_params_t *params, void *plat_params) = NULL;
Expand Down
6 changes: 2 additions & 4 deletions src/arch/arm64/boot.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2013 Google Inc.
*
* 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; version 2 of the License.
Expand All @@ -17,7 +15,7 @@
#include <arch/lib_helpers.h>
#include <arch/stages.h>
#include <arch/transition.h>
#include <arm_tf.h>
#include <bl31.h>
#include <program_loading.h>

static void run_payload(struct prog *prog)
Expand All @@ -30,7 +28,7 @@ static void run_payload(struct prog *prog)
u64 payload_spsr = get_eret_el(EL2, SPSR_USE_L);

if (CONFIG(ARM64_USE_ARM_TRUSTED_FIRMWARE))
arm_tf_run_bl31((u64)doit, (u64)arg, payload_spsr);
run_bl31((u64)doit, (u64)arg, payload_spsr);
else
transition_to_el2(doit, arg, payload_spsr);
}
Expand Down
3 changes: 1 addition & 2 deletions src/arch/arm64/div0.c
@@ -1,6 +1,5 @@
/*
* (C) Copyright 2002
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
* This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
Expand Down
6 changes: 3 additions & 3 deletions src/arch/arm64/eabi_compat.c
@@ -1,7 +1,5 @@
/*
* Utility functions needed for (some) EABI conformant tool chains.
*
* (C) Copyright 2009 Wolfgang Denk <wd@denx.de>
* This file is part of the coreboot project.
*
* This program is Free Software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
Expand All @@ -12,6 +10,8 @@
* 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.
*
* Utility functions needed for (some) EABI conformant tool chains.
*/

int raise (int signum) __attribute__((used));
Expand Down
3 changes: 1 addition & 2 deletions src/arch/arm64/fit_payload.c
@@ -1,6 +1,5 @@
/*
* Copyright 2013 Google Inc.
* Copyright 2018 Facebook, Inc.
* This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
Expand Down
9 changes: 0 additions & 9 deletions src/arch/arm64/include/arch/acpi.h
@@ -1,15 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2004 SUSE LINUX AG
* Copyright (C) 2004 Nick Barker
* Copyright (C) 2008-2009 coresystems GmbH
* Copyright (C) 2015 Timothy Pearson <tpearson@raptorengineeringinc.com>,
* Raptor Engineering
* Copyright (C) 2016 Siemens AG
* (Written by Stefan Reinauer <stepan@coresystems.de>)
* Copyright 2018-present Facebook, Inc.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm64/include/arch/asm.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2013 Google Inc.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm64/include/arch/cbconfig.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2016 Google Inc.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm64/include/arch/early_variables.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm64/include/arch/header.ld
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2014 Google Inc.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm64/include/arch/memlayout.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2014 Google Inc.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm64/include/arch/mpidr.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2014 Google Inc.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm64/include/arch/pci_ops.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2013 Google Inc.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm64/include/arch/stages.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2013 The ChromiumOS Authors
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm64/include/arch/transition.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2014 Google Inc.
*
* 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; version 2 of the License.
Expand Down
2 changes: 2 additions & 0 deletions src/arch/arm64/include/arm_tf_temp.h
@@ -1,4 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
6 changes: 3 additions & 3 deletions src/arch/arm64/include/armv8/arch/barrier.h
@@ -1,7 +1,5 @@
/*
* Based on arch/arm/include/asm/barrier.h
*
* Copyright (C) 2012 ARM Ltd.
* This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
Expand All @@ -11,6 +9,8 @@
* 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.
*
* Based on arch/arm/include/asm/barrier.h
*/
#ifndef __ASM_ARM_BARRIER_H
#define __ASM_ARM_BARRIER_H
Expand Down
5 changes: 0 additions & 5 deletions src/arch/arm64/include/armv8/arch/cpu.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2014 Google Inc.
*
* 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; version 2 of the License.
Expand All @@ -20,9 +18,6 @@

static inline unsigned int smp_processor_id(void) { return 0; }


#if !defined(__PRE_RAM__)
struct cpu_driver { };
#endif

#endif /* __ARCH_CPU_H__ */
2 changes: 1 addition & 1 deletion src/arch/arm64/include/armv8/arch/exception.h
@@ -1,5 +1,5 @@
/*
* This file is part of the libpayload project.
* This file is part of the coreboot project.
*
* Copyright 2013 Google Inc.
*
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm64/include/armv8/arch/lib_helpers.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Google Inc
*
* 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; version 2 of
Expand Down
18 changes: 3 additions & 15 deletions src/arch/arm64/include/armv8/arch/mmio.h
@@ -1,9 +1,5 @@
/*
* Originally imported from linux/include/asm-arm/io.h. This file has changed
* substantially since then.
*
* Copyright 2014 Google Inc.
* Copyright (C) 1996-2000 Russell King
* This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
Expand All @@ -14,16 +10,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Modifications:
* 08-Apr-2013 G Replaced several macros with inlines for type safety.
* 16-Sep-1996 RMK Inlined the inx/outx functions & optimised for both
* constant addresses and variable addresses.
* 04-Dec-1997 RMK Moved a lot of this stuff to the new architecture
* specific IO header files.
* 27-Mar-1999 PJB Second parameter of memcpy_toio is const..
* 04-Apr-1999 PJB Added check_signature.
* 12-Dec-1999 RMK More cleanups
* 18-Jun-2000 RMK Removed virt_to_* and friends definitions
* Originally imported from linux/include/asm-arm/io.h. This file has changed
* substantially since then.
*/

#ifndef __ARCH_MMIO_H__
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm64/include/armv8/arch/mmu.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2014 Google Inc.
*
* 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; version 2 of the License.
Expand Down
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2015 Google Inc.
*
* 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; version 2 of the License.
Expand All @@ -13,18 +11,18 @@
* GNU General Public License for more details.
*/

#ifndef __ARM_TF_H__
#define __ARM_TF_H__
#ifndef __BL31_H__
#define __BL31_H__

#include <types.h>

/* TODO: Pull in directly from ARM TF once its headers have been reorganized. */
#include <arm_tf_temp.h>

/* Load and enter BL31, set it up to exit to payload according to arguments. */
void arm_tf_run_bl31(u64 payload_entry, u64 payload_arg0, u64 payload_spsr);
void run_bl31(u64 payload_entry, u64 payload_arg0, u64 payload_spsr);

/* Return platform-specific bl31_plat_params. May update bl31_params. */
void *soc_get_bl31_plat_params(bl31_params_t *bl31_params);

#endif /* __ARM_TF_H__ */
#endif /* __BL31_H__ */
2 changes: 1 addition & 1 deletion src/arch/arm64/include/clocks.h
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The Chromium OS Authors.
* This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm64/include/cpu/cortex_a57.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2015 Google Inc.
*
* 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; version 2 of the License.
Expand Down
2 changes: 1 addition & 1 deletion src/arch/arm64/memcpy.S
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2013 ARM Ltd.
* This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
Expand Down
2 changes: 1 addition & 1 deletion src/arch/arm64/memmove.S
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2013 ARM Ltd.
* This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
Expand Down
2 changes: 1 addition & 1 deletion src/arch/arm64/memset.S
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2013 ARM Ltd.
* This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
Expand Down
41 changes: 41 additions & 0 deletions src/arch/arm64/ramdetect.c
@@ -0,0 +1,41 @@
/*
* This file is part of the coreboot project.
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/

#include <types.h>
#include <device/mmio.h>
#include <ramdetect.h>
#include <arch/exception.h>
#include <arch/transition.h>

static enum {
ABORT_CHECKER_NOT_TRIGGERED,
ABORT_CHECKER_TRIGGERED,
} abort_state = ABORT_CHECKER_NOT_TRIGGERED;

static int abort_checker(struct exc_state *state, uint64_t vector_id)
{
if (raw_read_esr_el3() >> 26 != 0x25)
return EXC_RET_IGNORED; /* Not a data abort. */

abort_state = ABORT_CHECKER_TRIGGERED;
state->elx.elr += sizeof(uint32_t); /* Jump over faulting instruction. */
raw_write_elr_el3(state->elx.elr);
return EXC_RET_HANDLED;
}

static struct exception_handler sync_el0 = {.handler = &abort_checker};

int probe_mb(const uintptr_t dram_start, const uintptr_t size)
{
uintptr_t addr = dram_start + (size * MiB) - sizeof(uint32_t);
void *ptr = (void *)addr;

abort_state = ABORT_CHECKER_NOT_TRIGGERED;
exception_handler_register(EXC_VID_CUR_SP_EL0_SYNC, &sync_el0);
read32(ptr);
exception_handler_unregister(EXC_VID_CUR_SP_EL0_SYNC, &sync_el0);
return abort_state == ABORT_CHECKER_NOT_TRIGGERED;
}
2 changes: 0 additions & 2 deletions src/arch/arm64/romstage.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2018 Google Inc.
*
* 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; version 2 of
Expand Down
4 changes: 0 additions & 4 deletions src/arch/arm64/tables.c
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2003 Eric Biederman
* Copyright (C) 2005 Steve Magnani
* Copyright (C) 2008-2009 coresystems GmbH
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm64/transition.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2014 Google Inc.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm64/transition_asm.S
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2014 Google Inc.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/mips/Kconfig
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
# Copyright (C) 2014 Imagination Technologies
#
# 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; version 2 of
Expand Down
2 changes: 0 additions & 2 deletions src/arch/mips/Makefile.inc
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
# Copyright (C) 2014 Imagination Technologies
#
# 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; version 2 of
Expand Down
6 changes: 2 additions & 4 deletions src/arch/mips/ashldi3.c
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Google, Inc.
*
* Based on linux arch/mips/lib/ashldi3.c
*
* 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; version 2 of the License.
Expand All @@ -13,6 +9,8 @@
* 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.
*
* Based on linux arch/mips/lib/ashldi3.c
*/

#ifndef __ORDER_LITTLE_ENDIAN__
Expand Down
2 changes: 0 additions & 2 deletions src/arch/mips/boot.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Imagination Technologies
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/mips/bootblock.S
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Imagination Technologies
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/mips/bootblock_simple.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Imagination Technologies
*
* 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; version 2 of
Expand Down
2 changes: 0 additions & 2 deletions src/arch/mips/cache.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Imagination Technologies
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/mips/include/arch/bootblock_common.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Imagination Technologies
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/mips/include/arch/byteorder.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Imagination Technologies
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/mips/include/arch/cache.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Imagination Technologies
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/mips/include/arch/cbconfig.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2016 Google Inc.
*
* 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; version 2 of the License.
Expand Down
9 changes: 2 additions & 7 deletions src/arch/mips/include/arch/cpu.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Imagination Technologies
*
* 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; version 2 of the License.
Expand All @@ -16,12 +14,10 @@
#ifndef __MIPS_ARCH_CPU_H
#define __MIPS_ARCH_CPU_H

#define asmlinkage

#ifndef __PRE_RAM__

#include <device/device.h>

#define asmlinkage

struct cpu_driver {
struct device_operations *ops;
const struct cpu_device_id *id_table;
Expand All @@ -34,7 +30,6 @@ struct cpu_info {
unsigned long index;
};

#endif /* !__PRE_RAM__ */

/***************************************************************************
* The following section was copied from arch/mips/include/asm/mipsregs.h in
Expand Down
2 changes: 0 additions & 2 deletions src/arch/mips/include/arch/early_variables.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Imagination Technologies
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/mips/include/arch/exception.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Imagination Technologies
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/mips/include/arch/header.ld
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2014 Google Inc.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/mips/include/arch/hlt.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Imagination Technologies
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/mips/include/arch/memlayout.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2014 Google Inc.
*
* 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; version 2 of the License.
Expand Down
6 changes: 0 additions & 6 deletions src/arch/mips/include/arch/mmio.h
@@ -1,12 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Imagination Technologies
*
* Based on arch/armv7/include/arch/io.h:
* Copyright 2013 Google Inc.
* Copyright (C) 1996-2000 Russell King
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/mips/include/arch/mmu.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2015 Google, Inc.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/mips/include/arch/pci_ops.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2013 Google Inc.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/mips/include/arch/stages.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Imagination Technologies
*
* 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; version 2 of the License.
Expand Down
4 changes: 0 additions & 4 deletions src/arch/mips/include/arch/types.h
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Imagination Technologies
*
* Based on src/arch/armv7/include/arch/types.h
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/mips/mmu.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2015 Google, Inc.
*
* 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; version 2 of
Expand Down
2 changes: 0 additions & 2 deletions src/arch/mips/stages.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Imagination Technologies
*
* 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; version 2 of the License.
Expand Down
5 changes: 0 additions & 5 deletions src/arch/mips/tables.c
@@ -1,11 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Based on src/arch/armv7/tables.c:
* Copyright (C) 2003 Eric Biederman
* Copyright (C) 2005 Steve Magnani
* Copyright (C) 2008-2009 coresystems GmbH
*
* 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; version 2 of the License.
Expand Down
4 changes: 0 additions & 4 deletions src/arch/ppc64/Makefile.inc
Expand Up @@ -2,9 +2,6 @@
##
## This file is part of the coreboot project.
##
## Copyright (C) 2016 Raptor Engineering, LLC
## Copyright (C) 2014 The ChromiumOS Authors
##
## 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; version 2 of the License.
Expand Down Expand Up @@ -80,7 +77,6 @@ ifeq ($(CONFIG_ARCH_RAMSTAGE_PPC64),y)

ramstage-y += rom_media.c
ramstage-y += stages.c
ramstage-y += misc.c
ramstage-y += boot.c
ramstage-y += tables.c
ramstage-y += \
Expand Down
2 changes: 0 additions & 2 deletions src/arch/ppc64/boot.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2013 Google Inc.
*
* 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; version 2 of the License.
Expand Down
7 changes: 3 additions & 4 deletions src/arch/ppc64/bootblock.S
@@ -1,8 +1,5 @@
/*
* Early initialization code for POWER8.
*
* Copyright 2016 Raptor Engineering, LLC
* Copyright 2013 Google Inc.
* This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
Expand All @@ -13,6 +10,8 @@
* 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.
*
* Early initialization code for POWER8.
*/

.section ".text._start", "ax", %progbits
Expand Down
2 changes: 0 additions & 2 deletions src/arch/ppc64/include/arch/cbconfig.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2016 Google Inc.
*
* 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; version 2 of the License.
Expand Down
10 changes: 3 additions & 7 deletions src/arch/ppc64/include/arch/cpu.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2012 Google Inc.
*
* 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; version 2 of the License.
Expand All @@ -16,11 +14,10 @@
#ifndef __ARCH_CPU_H__
#define __ARCH_CPU_H__

#define asmlinkage

#if !defined(__PRE_RAM__)
#include <device/device.h>

#define asmlinkage

struct cpu_driver {
struct device_operations *ops;
const struct cpu_device_id *id_table;
Expand All @@ -42,7 +39,6 @@ struct cpuinfo_ppc64 {
uint8_t ppc64_model;
};

#endif

struct cpu_info *cpu_info(void);

#endif /* __ARCH_CPU_H__ */
2 changes: 0 additions & 2 deletions src/arch/ppc64/include/arch/early_variables.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/ppc64/include/arch/header.ld
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2014 Google Inc.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/ppc64/include/arch/memlayout.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2014 Google Inc.
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/ppc64/include/arch/stages.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2013 The ChromiumOS Authors
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/ppc64/prologue.inc
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2002 Eric Biederman
*
* 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; version 2 of the License.
Expand Down
2 changes: 0 additions & 2 deletions src/arch/ppc64/rom_media.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2015 Google Inc.
*
* 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; version 2 of
Expand Down
2 changes: 0 additions & 2 deletions src/arch/ppc64/stages.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2014 Google Inc.
*
* 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; version 2 of the License.
Expand Down
4 changes: 0 additions & 4 deletions src/arch/ppc64/tables.c
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2003 Eric Biederman
* Copyright (C) 2005 Steve Magnani
* Copyright (C) 2008-2009 coresystems GmbH
*
* 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; version 2 of the License.
Expand Down
1 change: 1 addition & 0 deletions src/arch/riscv/Makefile.inc
Expand Up @@ -147,6 +147,7 @@ ramstage-y += boot.c
ramstage-y += tables.c
ramstage-y += payload.c
ramstage-$(ARCH_RISCV_PMP) += pmp.c
ramstage-y += fit_payload.c
ramstage-y += \
$(top)/src/lib/memchr.c \
$(top)/src/lib/memcmp.c \
Expand Down
141 changes: 141 additions & 0 deletions src/arch/riscv/fit_payload.c
@@ -0,0 +1,141 @@
/*
* Copyright 2013 Google Inc.
* Copyright 2018 Facebook, Inc.
* Copyright 2019 9elements Agency GmbH <patrick.rudolph@9elements.com>
*
* 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 (at your option) 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.
*/

#include <console/console.h>
#include <bootmem.h>
#include <stdlib.h>
#include <program_loading.h>
#include <string.h>
#include <commonlib/compression.h>
#include <commonlib/cbfs_serialized.h>
#include <lib.h>
#include <fit.h>
#include <endian.h>

/* Implements a Berkley Boot Loader (BBL) compatible payload loading */

#define MAX_KERNEL_SIZE (64*MiB)

#if CONFIG(ARCH_RISCV_RV32)
#define SECTION_ALIGN (4 * MiB)
#endif
#if CONFIG(ARCH_RISCV_RV64)
#define SECTION_ALIGN (2 * MiB)
#endif

static size_t get_kernel_size(const struct fit_image_node *node)
{
/*
* Since we don't have a way to determine the uncompressed size of the
* kernel, we have to keep as much memory as possible free for use by
* the kernel immediately after the end of the kernel image. The amount
* of space required will vary depending on selected features, and is
* effectively unbound.
*/

printk(BIOS_INFO,
"FIT: Leaving additional %u MiB of free space after kernel.\n",
MAX_KERNEL_SIZE >> 20);

return node->size + MAX_KERNEL_SIZE;
}

/**
* Place the region in free memory range.
*
* The caller has to set region->offset to the minimum allowed address.
*/
static bool fit_place_mem(const struct range_entry *r, void *arg)
{
struct region *region = arg;
resource_t start;

if (range_entry_tag(r) != BM_MEM_RAM)
return true;

/* Section must be aligned at page boundary */
start = ALIGN_UP(MAX(region->offset, range_entry_base(r)), SECTION_ALIGN);

if (start + region->size < range_entry_end(r)) {
region->offset = (size_t)start;
return false;
}

return true;
}

bool fit_payload_arch(struct prog *payload, struct fit_config_node *config,
struct region *kernel,
struct region *fdt,
struct region *initrd)
{
void *arg = NULL;

if (!config->fdt || !fdt) {
printk(BIOS_CRIT, "CRIT: Providing a valid FDT is mandatory to "
"boot a RISC-V kernel!\n");
return false;
/* TODO: Fall back to the ROM FDT? */
}

/* Update kernel size from image header, if possible */
kernel->size = get_kernel_size(config->kernel);
printk(BIOS_DEBUG, "FIT: Using kernel size of 0x%zx bytes\n",
kernel->size);

/*
* The code assumes that bootmem_walk provides a sorted list of memory
* regions, starting from the lowest address.
* The order of the calls here doesn't matter, as the placement is
* enforced in the called functions.
* For details check code on top.
*/
kernel->offset = 0;
if (!bootmem_walk(fit_place_mem, kernel))
return false;

/* Mark as reserved for future allocations. */
bootmem_add_range(kernel->offset, kernel->size, BM_MEM_PAYLOAD);

/* Place FDT and INITRD after kernel. */

/* Place INITRD */
if (config->ramdisk) {
initrd->offset = kernel->offset + kernel->size;

if (!bootmem_walk(fit_place_mem, initrd))
return false;
/* Mark as reserved for future allocations. */
bootmem_add_range(initrd->offset, initrd->size, BM_MEM_PAYLOAD);
}

/* Place FDT */
fdt->offset = kernel->offset + kernel->size;

if (!bootmem_walk(fit_place_mem, fdt))
return false;
/* Mark as reserved for future allocations. */
bootmem_add_range(fdt->offset, fdt->size, BM_MEM_PAYLOAD);

/* Kernel expects FDT as argument */
arg = (void *)fdt->offset;

prog_set_entry(payload, (void *)kernel->offset, arg);

bootmem_dump_ranges();

return true;
}
6 changes: 1 addition & 5 deletions src/arch/riscv/include/arch/cpu.h
Expand Up @@ -17,12 +17,10 @@
#define __ARCH_CPU_H__

#include <arch/encoding.h>
#include <device/device.h>

#define asmlinkage

#if !defined(__PRE_RAM__)
#include <device/device.h>

struct cpu_driver {
struct device_operations *ops;
const struct cpu_device_id *id_table;
Expand All @@ -44,8 +42,6 @@ struct cpuinfo_riscv {
uint8_t riscv_model;
};

#endif

static inline int supports_extension(char ext)
{
return read_csr(misa) & (1 << (ext - 'A'));
Expand Down
2 changes: 1 addition & 1 deletion src/arch/riscv/include/arch/memlayout.h
Expand Up @@ -20,7 +20,7 @@

#define STACK(addr, size) REGION(stack, addr, size, 4096)

#if defined(__PRE_RAM__)
#if ENV_ROMSTAGE_OR_BEFORE
#define CAR_STACK(addr, size) \
REGION(car_stack, addr, size, 4K) \
ALIAS_REGION(car_stack, stack)
Expand Down
12 changes: 10 additions & 2 deletions src/arch/x86/Kconfig
Expand Up @@ -81,6 +81,13 @@ config AP_IN_SIPI_WAIT
default n
depends on ARCH_X86 && SMP

config RESET_VECTOR_IN_RAM
bool
depends on ARCH_X86
help
Select this option if the x86 soc implements custom code to handle the
reset vector in RAM instead of the traditional 0xfffffff0 location.

# Aligns 16bit entry code in bootblock so that hyper-threading CPUs
# can boot AP CPUs to enable their shared caches.
config SIPI_VECTOR_IN_ROM
Expand Down Expand Up @@ -222,8 +229,9 @@ config VERSTAGE_ADDR
# Use the post CAR infrastructure for tearing down cache-as-ram
# from a program loaded in RAM and subsequently loading ramstage.
config POSTCAR_STAGE
def_bool n
select NO_CAR_GLOBAL_MIGRATION
def_bool y
depends on ARCH_X86
depends on !CAR_GLOBAL_MIGRATION

config VERSTAGE_DEBUG_SPINLOOP
bool
Expand Down
18 changes: 18 additions & 0 deletions src/arch/x86/acpi_device.c
Expand Up @@ -81,6 +81,24 @@ const char *acpi_device_name(const struct device *dev)
return NULL;
}

/* Locate and return the ACPI _HID (Hardware ID) for this device */
const char *acpi_device_hid(const struct device *dev)
{
if (!dev)
return NULL;

/* Check for device specific handler */
if (dev->ops->acpi_hid)
return dev->ops->acpi_hid(dev);

/*
* Don't walk up the tree to find any parent that can identify this device, as
* PNP devices are hard to identify.
*/

return NULL;
}

/* Recursive function to find the root device and print a path from there */
static ssize_t acpi_device_path_fill(const struct device *dev, char *buf,
size_t buf_len, size_t cur)
Expand Down