Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
762 changes: 762 additions & 0 deletions mmax.config

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions payloads/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ config COREINFO_SECONDARY_PAYLOAD
coreinfo can be loaded as a secondary payload under SeaBIOS, GRUB,
or any other payload that can load additional payloads.

config BAREFLANK_SECONDARY_PAYLOAD
bool "Load Bareflank as a secondary payload"
default n
depends on ARCH_X86
help
Bareflank can be loaded before primary payload.

config MEMTEST_SECONDARY_PAYLOAD
bool "Load Memtest86+ as a secondary payload"
default n
Expand Down Expand Up @@ -151,4 +158,20 @@ config TINT_SECONDARY_PAYLOAD
source "payloads/external/*/Kconfig.secondary"

endmenu # "Secondary Payloads"

menu "Reserve RAM for payload"

config CUSTOM_RAM_RES_ADDR
hex "Base address for reserved memory"
default 0
help
If a payload needs some preallocated memory this field specifies
starting address of reserved memory region.

config CUSTOM_RAM_RES_SIZE
hex "Size of reserved memory"
default 0
help
Size (in bytes) of reserved memory region.
endmenu
endmenu
9 changes: 9 additions & 0 deletions payloads/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
## GNU General Public License for more details.
##

cbfs-files-$(CONFIG_BAREFLANK_SECONDARY_PAYLOAD) += $(CONFIG_CBFS_PREFIX)/payload
$(CONFIG_CBFS_PREFIX)/payload-file := payloads/bareflank/build/bareflank.elf
$(CONFIG_CBFS_PREFIX)/payload-type := payload
$(CONFIG_CBFS_PREFIX)/payload-compression := $(CBFS_SECONDARY_PAYLOAD_COMPRESS_FLAG)

cbfs-files-$(CONFIG_COREINFO_SECONDARY_PAYLOAD) += img/coreinfo
img/coreinfo-file := payloads/coreinfo/build/coreinfo.elf
img/coreinfo-type := payload
Expand All @@ -24,6 +29,7 @@ img/nvramcui-type := payload
img/nvramcui-compression := $(CBFS_SECONDARY_PAYLOAD_COMPRESS_FLAG)

PAYLOADS_LIST=\
payloads/bareflank \
payloads/coreinfo \
payloads/nvramcui \
payloads/libpayload \
Expand All @@ -38,6 +44,9 @@ payloads/external/GRUB2 \
payloads/external/LinuxBoot \
payloads/external/Yabits \

payloads/bareflank/build/bareflank.elf bareflank:
$(MAKE) -C payloads/bareflank defaultbuild CONFIG_CBFS_PREFIX=$(CONFIG_CBFS_PREFIX)

payloads/coreinfo/build/coreinfo.elf coreinfo:
$(MAKE) -C payloads/coreinfo defaultbuild

Expand Down
17 changes: 17 additions & 0 deletions payloads/bareflank/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
##
## 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.
##
## 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.
##

#
# For a description of the syntax of this configuration file,
# see http://lxr.linux.no/source/Documentation/kbuild/kconfig-language.txt.
#

mainmenu "Bareflank Configuration"
144 changes: 144 additions & 0 deletions payloads/bareflank/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
##
## This file is part of the coreinfo project.
##
## Copyright (C) 2008 Advanced Micro Devices, Inc.
## Copyright (C) 2008 Uwe Hermann <[email protected]>
##
## 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.
##
## 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.
##

src := $(CURDIR)
srctree := $(src)
srck := $(src)/../../util/kconfig
coreinfo_obj := $(src)/build
objk := $(src)/build/util/kconfig

ifeq ($(filter %clean,$(MAKECMDGOALS)),)
export KERNELVERSION := 0.1.0
export KCONFIG_AUTOHEADER := $(coreinfo_obj)/config.h
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krystian-hebel this coreinfo_obj stuff looks weird. Does it have any relation to coreinfo payload?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miczyg1 I've copied this MAkefile from coreinfo, there may be more leftovers, I guess I should clear it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do, This looks confusing

export KCONFIG_AUTOCONFIG := $(coreinfo_obj)/auto.conf
export KCONFIG_DEPENDENCIES := $(coreinfo_obj)/auto.conf.cmd
export KCONFIG_SPLITCONFIG := $(coreinfo_obj)/config
export KCONFIG_TRISTATE := $(coreinfo_obj)/tristate.conf
export KCONFIG_CONFIG := $(CURDIR)/.config
export KCONFIG_NEGATIVES := 1
export Kconfig := Kconfig

export V := $(V)

CONFIG_SHELL := sh
KBUILD_DEFCONFIG := configs/defconfig
UNAME_RELEASE := $(shell uname -r)
HAVE_DOTCONFIG := $(wildcard .config)
MAKEFLAGS += -rR --no-print-directory

# Make is silent per default, but 'make V=1' will show all compiler calls.
ifneq ($(V),1)
.SILENT:
endif

HOSTCC ?= gcc
HOSTCXX ?= g++
HOSTCFLAGS := -I$(srck) -I$(objk)
HOSTCXXFLAGS := -I$(srck) -I$(objk)

LIBPAYLOAD_PATH := $(realpath ../libpayload)
LIBPAYLOAD_OBJ := $(coreinfo_obj)/libpayload
HAVE_LIBPAYLOAD := $(wildcard $(LIBPAYLOAD_OBJ)/lib/libpayload.a)
LIBPAYLOAD_CONFIG ?= configs/defconfig-tinycurses-64
OBJCOPY ?= objcopy

INCLUDES = -I$(coreinfo_obj) -include $(LIBPAYLOAD_OBJ)/include/kconfig.h -I$(src)/../../src/commonlib/include -I$(src)/include -I$(src)
OBJECTS = common.o entry.o platform.o
OBJS = $(patsubst %,$(coreinfo_obj)/%,$(OBJECTS))
TARGET = $(coreinfo_obj)/bareflank.elf

all: real-all

# in addition to the dependency below, create the file if it doesn't exist
# to silence warnings about a file that would be generated anyway.
$(if $(wildcard .xcompile),,$(eval $(shell ../../util/xcompile/xcompile $(XGCCPATH) > .xcompile || rm -f .xcompile)))
.xcompile: ../../util/xcompile/xcompile
$< $(XGCCPATH) > [email protected]
\mv -f [email protected] $@ 2> /dev/null || rm -f [email protected] $@

CONFIG_COMPILER_GCC := y
ARCH-y := x86_64

include .xcompile

CC := $(CC_$(ARCH-y))
AS := $(AS_$(ARCH-y))
OBJCOPY := $(OBJCOPY_$(ARCH-y))

LPCC := CC="$(CC)" $(LIBPAYLOAD_OBJ)/bin/lpgcc
LPAS := AS="$(AS)" $(LIBPAYLOAD_OBJ)/bin/lpas

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

ifneq ($(strip $(HAVE_DOTCONFIG)),)
include $(src)/.config
real-all: $(TARGET)

$(TARGET): $(src)/.config $(coreinfo_obj)/config.h $(OBJS) libpayload
printf " LPCC $(subst $(CURDIR)/,,$(@)) (LINK)\n"
$(LPCC) -o $@ $(OBJS)
$(OBJCOPY) --only-keep-debug $@ $(TARGET).debug
$(OBJCOPY) --strip-debug $@
$(OBJCOPY) --add-gnu-debuglink=$(TARGET).debug $@

$(coreinfo_obj)/%.S.o: $(src)/%.S libpayload
printf " LPAS $(subst $(CURDIR)/,,$(@))\n"
$(LPAS) -o $@ $<

$(coreinfo_obj)/%.o: $(src)/%.c libpayload
printf " LPCC $(subst $(CURDIR)/,,$(@))\n"
$(LPCC) $(CFLAGS) -c -o $@ $< -DCONFIG_CBFS_PREFIX=\"$(CONFIG_CBFS_PREFIX)\"

else
real-all: config
endif

defaultbuild:
$(MAKE) olddefconfig
$(MAKE) all

ifneq ($(strip $(HAVE_LIBPAYLOAD)),)
libpayload:
printf "Found Libpayload $(LIBPAYLOAD_OBJ).\n"
else
LPOPTS=obj="$(CURDIR)/lpbuild" DOTCONFIG="$(CURDIR)/lp.config"
libpayload:
printf "Building libpayload @ $(LIBPAYLOAD_PATH).\n"
$(MAKE) -C $(LIBPAYLOAD_PATH) $(LPOPTS) distclean coreinfo_obj=$(coreinfo_obj)/libptmp
$(MAKE) -C $(LIBPAYLOAD_PATH) $(LPOPTS) defconfig KBUILD_DEFCONFIG=$(LIBPAYLOAD_CONFIG)
$(MAKE) -C $(LIBPAYLOAD_PATH) $(LPOPTS) install DESTDIR=$(coreinfo_obj)
endif

$(coreinfo_obj)/config.h:
$(MAKE) oldconfig

$(shell mkdir -p $(coreinfo_obj) $(objk)/lxdialog $(KCONFIG_SPLITCONFIG))

include $(srck)/Makefile

.PHONY: $(PHONY) prepare

else

clean:
rm -rf build/*.elf build/*.o .xcompile

distclean: clean
rm -rf build lpbuild
rm -f .config* lp.config*

.PHONY: clean distclean
endif
Loading