Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14370
-gerrit
commit 8828bc32481fcbab84fd061184c03c4764e9f2a1
Author: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Date: Thu Apr 14 15:48:17 2016 -0700
Add ARM support
Change-Id: I9325f6df06cf85ecd77abef5c0a7b4d2742466f4
Signed-off-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
---
Kconfig | 19 +++++++++++++++----
Makefile | 6 ++++--
arm/Makefile.inc | 20 ++++++++++++++++++++
arm/elf.c | 29 +++++++++++++++++++++++++++++
arm/include/arch/elf.h | 5 +++++
arm/sys_info.c | 35 +++++++++++++++++++++++++++++++++++
main/grub/builtins.c | 12 ++++++++++++
main/grub/grub.c | 6 ++++++
8 files changed, 126 insertions(+), 6 deletions(-)
diff --git a/Kconfig b/Kconfig
index cc48bd3..21a718d 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
@@ -165,6 +175,7 @@ config FLASH_DISK
config SUPPORT_PCI
bool "PCI support"
default y
+ depends on TARGET_I386
config PCI_BRUTE_SCAN
bool "Scan all PCI busses"
@@ -234,7 +245,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 39e477b..1a9430d 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..8009ec2
--- /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) += arm/sys_info.o arm/elf.o
+
diff --git a/arm/elf.c b/arm/elf.c
new file mode 100644
index 0000000..5db5227
--- /dev/null
+++ b/arm/elf.c
@@ -0,0 +1,29 @@
+/*
+ * This file is part of FILO.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdint.h>
+
+void relocate(void)
+{
+ // Not supported
+}
+
+u32 start_elf(u32 entry_point, u32 param)
+{
+ // Not supported
+ return 0;
+}
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;
diff --git a/arm/sys_info.c b/arm/sys_info.c
new file mode 100644
index 0000000..45dd44f
--- /dev/null
+++ b/arm/sys_info.c
@@ -0,0 +1,35 @@
+/*
+ * This file is part of FILO.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <libpayload.h>
+#include <config.h>
+#include <sys_info.h>
+#define DEBUG_THIS CONFIG_DEBUG_SYS_INFO
+#include <debug.h>
+
+void collect_sys_info(struct sys_info *info)
+{
+ // Nothing yet
+}
+
+const char *get_cb_version()
+{
+ const char *cb_version = lib_sysinfo.cb_version ?
+ lib_sysinfo.cb_version : "<unknown version>";
+
+ return cb_version;
+}
diff --git a/main/grub/builtins.c b/main/grub/builtins.c
index 58d6855..f53fe79 100644
--- a/main/grub/builtins.c
+++ b/main/grub/builtins.c
@@ -1030,6 +1030,7 @@ static struct builtin builtin_lock = {
};
#ifdef CONFIG_DEVELOPER_TOOLS
+#ifdef CONFIG_SUPPORT_PCI
static int lspci_indent = 0;
static void lspci_scan_bus(int bus)
{
@@ -1139,6 +1140,7 @@ static struct builtin builtin_lspci = {
"Show PCI devices or dump PCI config space"
};
#endif
+#endif
#ifdef CONFIG_USE_MD5_PASSWORDS
/* md5crypt */
@@ -1194,6 +1196,7 @@ static struct builtin builtin_md5crypt = {
#endif /* CONFIG_USE_MD5_PASSWORDS */
#if CONFIG_DEVELOPER_TOOLS
+#if CONFIG_TARGET_I386
/* nvram */
static int nvram_func(char *arg, int flags)
{
@@ -1256,6 +1259,7 @@ static struct builtin builtin_nvram = {
"image on the next boot."
};
#endif
+#endif
/* password */
static int password_func(char *arg, int flags)
@@ -1561,6 +1565,7 @@ static struct builtin builtin_serial = {
};
#ifdef CONFIG_DEVELOPER_TOOLS
+#ifdef CONFIG_SUPPORT_PCI
static int setpci_func(char *arg, int flags)
{
char *walk = arg;
@@ -1716,6 +1721,7 @@ static struct builtin builtin_setpci = {
"Show/change PCI config space values"
};
#endif
+#endif
/* terminal */
static int terminal_func(char *arg, int flags)
@@ -1945,14 +1951,18 @@ struct builtin *builtin_table[] = {
&builtin_keymap,
&builtin_lock,
#ifdef CONFIG_DEVELOPER_TOOLS
+#ifdef CONFIG_SUPPORT_PCI
&builtin_lspci,
#endif
+#endif
#ifdef CONFIG_USE_MD5_PASSWORDS
&builtin_md5crypt,
#endif
#ifdef CONFIG_DEVELOPER_TOOLS
+#ifdef CONFIG_TARGET_I386
&builtin_nvram,
#endif
+#endif
&builtin_password,
&builtin_pause,
&builtin_poweroff,
@@ -1963,8 +1973,10 @@ struct builtin *builtin_table[] = {
&builtin_root,
&builtin_serial,
#ifdef CONFIG_DEVELOPER_TOOLS
+#ifdef CONFIG_SUPPORT_PCI
&builtin_setpci,
#endif
+#endif
&builtin_terminal,
&builtin_timeout,
&builtin_title,
diff --git a/main/grub/grub.c b/main/grub/grub.c
index 2c8595b..67efdb6 100644
--- a/main/grub/grub.c
+++ b/main/grub/grub.c
@@ -47,6 +47,12 @@ static char configs[16384];
int flashrom_lockdown = 1;
#endif
+/* get_option() is currently only implemented on x86 */
+int __attribute__((weak)) get_option(void *dest, const char *name)
+{
+ return 1;
+}
+
int using_grub_interface = 0;
#define ENTER '\r'
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14355
-gerrit
commit 7f23a5adda199812a4f35c51a054bb019a85afd0
Author: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Date: Wed Apr 13 16:23:48 2016 -0700
Point to the correct libpayload path
libpayload is not standalone, so assume it lives under coreboot
to make out of the box builds easier.
Change-Id: Ib6240e7459a7e56f911c01e1ebe9f535cc0e50ad
Signed-off-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 2b7edb6..39e477b 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,7 @@ export obj := $(src)/build
export objk := $(src)/build/util/kconfig
ifndef LIBCONFIG_PATH
- LIBCONFIG_PATH := $(src)/../libpayload
+LIBCONFIG_PATH := $(src)/../coreboot/payloads/libpayload
endif
export LIBCONFIG_PATH
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14370
-gerrit
commit 421451f7cd8af3c374daa8d870eb1e8c88240235
Author: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Date: Thu Apr 14 15:48:17 2016 -0700
Add ARM support
Change-Id: I9325f6df06cf85ecd77abef5c0a7b4d2742466f4
Signed-off-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
---
Kconfig | 19 +++++++++++++++----
Makefile | 6 ++++--
arm/Makefile.inc | 20 ++++++++++++++++++++
arm/elf.c | 29 +++++++++++++++++++++++++++++
arm/include/arch/elf.h | 5 +++++
arm/sys_info.c | 35 +++++++++++++++++++++++++++++++++++
main/grub/builtins.c | 12 ++++++++++++
main/grub/grub.c | 6 ++++++
8 files changed, 126 insertions(+), 6 deletions(-)
diff --git a/Kconfig b/Kconfig
index cc48bd3..21a718d 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
@@ -165,6 +175,7 @@ config FLASH_DISK
config SUPPORT_PCI
bool "PCI support"
default y
+ depends on TARGET_I386
config PCI_BRUTE_SCAN
bool "Scan all PCI busses"
@@ -234,7 +245,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 39e477b..1a9430d 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..8009ec2
--- /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) += arm/sys_info.o arm/elf.o
+
diff --git a/arm/elf.c b/arm/elf.c
new file mode 100644
index 0000000..5db5227
--- /dev/null
+++ b/arm/elf.c
@@ -0,0 +1,29 @@
+/*
+ * This file is part of FILO.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdint.h>
+
+void relocate(void)
+{
+ // Not supported
+}
+
+u32 start_elf(u32 entry_point, u32 param)
+{
+ // Not supported
+ return 0;
+}
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;
diff --git a/arm/sys_info.c b/arm/sys_info.c
new file mode 100644
index 0000000..45dd44f
--- /dev/null
+++ b/arm/sys_info.c
@@ -0,0 +1,35 @@
+/*
+ * This file is part of FILO.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <libpayload.h>
+#include <config.h>
+#include <sys_info.h>
+#define DEBUG_THIS CONFIG_DEBUG_SYS_INFO
+#include <debug.h>
+
+void collect_sys_info(struct sys_info *info)
+{
+ // Nothing yet
+}
+
+const char *get_cb_version()
+{
+ const char *cb_version = lib_sysinfo.cb_version ?
+ lib_sysinfo.cb_version : "<unknown version>";
+
+ return cb_version;
+}
diff --git a/main/grub/builtins.c b/main/grub/builtins.c
index 58d6855..f53fe79 100644
--- a/main/grub/builtins.c
+++ b/main/grub/builtins.c
@@ -1030,6 +1030,7 @@ static struct builtin builtin_lock = {
};
#ifdef CONFIG_DEVELOPER_TOOLS
+#ifdef CONFIG_SUPPORT_PCI
static int lspci_indent = 0;
static void lspci_scan_bus(int bus)
{
@@ -1139,6 +1140,7 @@ static struct builtin builtin_lspci = {
"Show PCI devices or dump PCI config space"
};
#endif
+#endif
#ifdef CONFIG_USE_MD5_PASSWORDS
/* md5crypt */
@@ -1194,6 +1196,7 @@ static struct builtin builtin_md5crypt = {
#endif /* CONFIG_USE_MD5_PASSWORDS */
#if CONFIG_DEVELOPER_TOOLS
+#if CONFIG_TARGET_I386
/* nvram */
static int nvram_func(char *arg, int flags)
{
@@ -1256,6 +1259,7 @@ static struct builtin builtin_nvram = {
"image on the next boot."
};
#endif
+#endif
/* password */
static int password_func(char *arg, int flags)
@@ -1561,6 +1565,7 @@ static struct builtin builtin_serial = {
};
#ifdef CONFIG_DEVELOPER_TOOLS
+#ifdef CONFIG_SUPPORT_PCI
static int setpci_func(char *arg, int flags)
{
char *walk = arg;
@@ -1716,6 +1721,7 @@ static struct builtin builtin_setpci = {
"Show/change PCI config space values"
};
#endif
+#endif
/* terminal */
static int terminal_func(char *arg, int flags)
@@ -1945,14 +1951,18 @@ struct builtin *builtin_table[] = {
&builtin_keymap,
&builtin_lock,
#ifdef CONFIG_DEVELOPER_TOOLS
+#ifdef CONFIG_SUPPORT_PCI
&builtin_lspci,
#endif
+#endif
#ifdef CONFIG_USE_MD5_PASSWORDS
&builtin_md5crypt,
#endif
#ifdef CONFIG_DEVELOPER_TOOLS
+#ifdef CONFIG_TARGET_I386
&builtin_nvram,
#endif
+#endif
&builtin_password,
&builtin_pause,
&builtin_poweroff,
@@ -1963,8 +1973,10 @@ struct builtin *builtin_table[] = {
&builtin_root,
&builtin_serial,
#ifdef CONFIG_DEVELOPER_TOOLS
+#ifdef CONFIG_SUPPORT_PCI
&builtin_setpci,
#endif
+#endif
&builtin_terminal,
&builtin_timeout,
&builtin_title,
diff --git a/main/grub/grub.c b/main/grub/grub.c
index 2c8595b..5e2364d 100644
--- a/main/grub/grub.c
+++ b/main/grub/grub.c
@@ -47,6 +47,12 @@ static char configs[16384];
int flashrom_lockdown = 1;
#endif
+/* get_option() is currently only implemented on x86 */
+int __attribute__((weak)) get_option(void *dest, const char *name)
+{
+ return 1;
+}
+
int using_grub_interface = 0;
#define ENTER '\r'