[coreboot-gerrit] New patch to review for filo: Add ARM support
Stefan Reinauer (stefan.reinauer@coreboot.org)
gerrit at coreboot.org
Fri Apr 15 01:06:12 CEST 2016
Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14370
-gerrit
commit 1994ed1b0cd81a3c22f92e0207fc060599594490
Author: Stefan Reinauer <stefan.reinauer at coreboot.org>
Date: Thu Apr 14 15:48:17 2016 -0700
Add ARM support
Change-Id: I9325f6df06cf85ecd77abef5c0a7b4d2742466f4
Signed-off-by: Stefan Reinauer <stefan.reinauer at coreboot.org>
---
Kconfig | 18 ++++++++++++++----
Makefile | 6 ++++--
arm/Makefile.inc | 20 ++++++++++++++++++++
arm/include/arch/elf.h | 5 +++++
4 files changed, 43 insertions(+), 6 deletions(-)
diff --git a/Kconfig b/Kconfig
index cc48bd3..24eb239 100644
--- a/Kconfig
+++ b/Kconfig
@@ -4,13 +4,21 @@
mainmenu "FILO Configuration"
-# When (if) we support multiple architectures, this will become an option.
+choice
+ prompt "Build for architecture"
+ default TARGET_I386
+
config TARGET_I386
- bool
- default y
+ bool "x86"
+
+config TARGET_ARM
+ bool "ARM"
+
+endchoice
config MULTIBOOT_IMAGE
bool "Include a MultiBoot header"
+ depends on TARGET_I386
default y
help
Including a MultiBoot header makes FILO chainloadable by MultiBoot
@@ -103,6 +111,7 @@ menu "Drivers"
config IDE_DISK
bool "IDE DISK support"
+ depends on TARGET_I386
default y
help
Driver for hard disk, CompactFlash, and CD-ROM on IDE bus
@@ -138,6 +147,7 @@ config PCMCIA_CF
config IDE_NEW_DISK
bool "New IDE driver"
+ depends on TARGET_I386
default n
depends on !IDE_DISK
help
@@ -234,7 +244,7 @@ config FSYS_ISO9660
config ELTORITO
bool "El Torito bootable CDROMs"
default y
- depends on FSYS_ISO9660
+ depends on FSYS_ISO9660 && TARGET_I386
help
Support for boot disk image in bootable CD-ROM (El Torito)
diff --git a/Makefile b/Makefile
index de1df17..f00ae56 100644
--- a/Makefile
+++ b/Makefile
@@ -81,6 +81,8 @@ $(if $(wildcard .xcompile),,$(shell bash util/xcompile/xcompile > .xcompile))
include .xcompile
ARCH-$(CONFIG_TARGET_I386) := x86_32
+ARCH-$(CONFIG_TARGET_ARM) := arm
+
CC := $(CC_$(ARCH-y))
AS := $(AS_$(ARCH-y))
LD := $(LD_$(ARCH-y))
@@ -104,6 +106,7 @@ LPGCC = $(LIBPAYLOAD_PREFIX)/bin/lpgcc
LPAS = $(LIBPAYLOAD_PREFIX)/bin/lpas
ARCHDIR-$(CONFIG_TARGET_I386) := x86
+ARCHDIR-$(CONFIG_TARGET_ARM) := arm
CPPFLAGS := -nostdinc -imacros $(obj)/config.h
CPPFLAGS += -I$(INCPAYLOAD) -I$(INCPAYLOAD)/$(ARCHDIR-y)
@@ -116,8 +119,7 @@ CFLAGS += $(call cc-option, -fno-stack-protector,)
LIBS := $(LIBPAYLOAD) $(LIBGCC)
-SUBDIRS-y += main/ fs/ drivers/
-SUBDIRS-$(CONFIG_TARGET_I386) += x86/
+SUBDIRS-y += main fs drivers $(ARCHDIR-y)
$(foreach subdir,$(SUBDIRS-y),$(eval include $(subdir)/Makefile.inc))
diff --git a/arm/Makefile.inc b/arm/Makefile.inc
new file mode 100644
index 0000000..48d8202
--- /dev/null
+++ b/arm/Makefile.inc
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 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; 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
+TARGETS-$(CONFIG_TARGET_ARM) +=
+
diff --git a/arm/include/arch/elf.h b/arm/include/arch/elf.h
new file mode 100644
index 0000000..2a5bbbf
--- /dev/null
+++ b/arm/include/arch/elf.h
@@ -0,0 +1,5 @@
+#define ARCH_ELF_CLASS ELFCLASS32
+#define ARCH_ELF_DATA ELFDATA2LSB
+#define ARCH_ELF_MACHINE_OK(x) ((x)==EM_ARM)
+typedef Elf32_Ehdr Elf_ehdr;
+typedef Elf32_Phdr Elf_phdr;
More information about the coreboot-gerrit
mailing list