bc092b9
From 24e37a885269bdec9b27babf1da0bba3692d55c0 Mon Sep 17 00:00:00 2001
bc092b9
From: Vladimir Serbinenko <phcoder@gmail.com>
bc092b9
Date: Mon, 8 May 2017 20:53:28 +0200
6f1e3d5
Subject: [PATCH 019/198] arm-coreboot: Start new port.
bc092b9
bc092b9
---
bc092b9
 configure.ac                           |   2 +
bc092b9
 gentpl.py                              |   8 ++-
bc092b9
 grub-core/Makefile.am                  |  10 +++
bc092b9
 grub-core/Makefile.core.def            |  18 ++++-
bc092b9
 grub-core/kern/arm/coreboot/cbtable.c  |  40 +++++++++++
bc092b9
 grub-core/kern/arm/coreboot/coreboot.S |  44 ++++++++++++
bc092b9
 grub-core/kern/arm/coreboot/init.c     | 127 +++++++++++++++++++++++++++++++++
bc092b9
 grub-core/kern/arm/coreboot/timer.c    |  65 +++++++++++++++++
bc092b9
 grub-core/kern/arm/startup.S           |   4 ++
bc092b9
 grub-core/kern/coreboot/cbtable.c      |   2 +
bc092b9
 grub-core/lib/dummy/reboot.c           |  32 +++++++++
bc092b9
 grub-core/loader/arm/linux.c           |   3 +
bc092b9
 include/grub/arm/coreboot/console.h    |  29 ++++++++
bc092b9
 include/grub/arm/coreboot/kernel.h     |  44 ++++++++++++
bc092b9
 include/grub/offsets.h                 |   6 ++
bc092b9
 util/grub-mkimagexx.c                  |  19 +++--
bc092b9
 util/mkimage.c                         |  41 ++++++++++-
bc092b9
 17 files changed, 482 insertions(+), 12 deletions(-)
bc092b9
 create mode 100644 grub-core/kern/arm/coreboot/cbtable.c
bc092b9
 create mode 100644 grub-core/kern/arm/coreboot/coreboot.S
bc092b9
 create mode 100644 grub-core/kern/arm/coreboot/init.c
bc092b9
 create mode 100644 grub-core/kern/arm/coreboot/timer.c
bc092b9
 create mode 100644 grub-core/lib/dummy/reboot.c
bc092b9
 create mode 100644 include/grub/arm/coreboot/console.h
bc092b9
 create mode 100644 include/grub/arm/coreboot/kernel.h
bc092b9
bc092b9
diff --git a/configure.ac b/configure.ac
bc092b9
index ee2c86537..571f7a0b5 100644
bc092b9
--- a/configure.ac
bc092b9
+++ b/configure.ac
bc092b9
@@ -167,6 +167,7 @@ case "$target_cpu"-"$platform" in
bc092b9
   mipsel-fuloong) platform=loongson ;;
bc092b9
   mipsel-loongson) ;;
bc092b9
   arm-uboot) ;;
bc092b9
+  arm-coreboot) ;;
bc092b9
   arm-efi) ;;
bc092b9
   arm64-efi) ;;
bc092b9
   *-emu) ;;
bc092b9
@@ -1918,6 +1919,7 @@ AM_CONDITIONAL([COND_mipsel], [test x$target_cpu = xmipsel])
bc092b9
 AM_CONDITIONAL([COND_mipseb], [test x$target_cpu = xmips])
bc092b9
 AM_CONDITIONAL([COND_arm], [test x$target_cpu = xarm ])
bc092b9
 AM_CONDITIONAL([COND_arm_uboot], [test x$target_cpu = xarm -a x$platform = xuboot])
bc092b9
+AM_CONDITIONAL([COND_arm_coreboot], [test x$target_cpu = xarm -a x$platform = xcoreboot])
bc092b9
 AM_CONDITIONAL([COND_arm_efi], [test x$target_cpu = xarm -a x$platform = xefi])
bc092b9
 AM_CONDITIONAL([COND_arm64], [test x$target_cpu = xarm64 ])
bc092b9
 AM_CONDITIONAL([COND_arm64_efi], [test x$target_cpu = xarm64 -a x$platform = xefi])
bc092b9
diff --git a/gentpl.py b/gentpl.py
bc092b9
index f08bcc404..ed268178b 100644
bc092b9
--- a/gentpl.py
bc092b9
+++ b/gentpl.py
bc092b9
@@ -31,7 +31,8 @@ GRUB_PLATFORMS = [ "emu", "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot",
bc092b9
                    "i386_xen", "x86_64_xen",
bc092b9
                    "mips_loongson", "sparc64_ieee1275",
bc092b9
                    "powerpc_ieee1275", "mips_arc", "ia64_efi",
bc092b9
-                   "mips_qemu_mips", "arm_uboot", "arm_efi", "arm64_efi" ]
bc092b9
+                   "mips_qemu_mips", "arm_uboot", "arm_efi", "arm64_efi",
bc092b9
+                   "arm_coreboot"]
bc092b9
 
bc092b9
 GROUPS = {}
bc092b9
 
bc092b9
@@ -44,7 +45,7 @@ GROUPS["x86"]      = GROUPS["i386"] + GROUPS["x86_64"]
bc092b9
 GROUPS["mips"]     = [ "mips_loongson", "mips_qemu_mips", "mips_arc" ]
bc092b9
 GROUPS["sparc64"]  = [ "sparc64_ieee1275" ]
bc092b9
 GROUPS["powerpc"]  = [ "powerpc_ieee1275" ]
bc092b9
-GROUPS["arm"]      = [ "arm_uboot", "arm_efi" ]
bc092b9
+GROUPS["arm"]      = [ "arm_uboot", "arm_efi", "arm_coreboot" ]
bc092b9
 GROUPS["arm64"]    = [ "arm64_efi" ]
bc092b9
 
bc092b9
 # Groups based on firmware
bc092b9
@@ -52,6 +53,7 @@ GROUPS["efi"]  = [ "i386_efi", "x86_64_efi", "ia64_efi", "arm_efi", "arm64_efi"
bc092b9
 GROUPS["ieee1275"]   = [ "i386_ieee1275", "sparc64_ieee1275", "powerpc_ieee1275" ]
bc092b9
 GROUPS["uboot"] = [ "arm_uboot" ]
bc092b9
 GROUPS["xen"]  = [ "i386_xen", "x86_64_xen" ]
bc092b9
+GROUPS["coreboot"]  = [ "i386_coreboot", "arm_coreboot" ]
bc092b9
 
bc092b9
 # emu is a special case so many core functionality isn't needed on this platform
bc092b9
 GROUPS["noemu"]   = GRUB_PLATFORMS[:]; GROUPS["noemu"].remove("emu")
bc092b9
@@ -64,7 +66,7 @@ GROUPS["pci"]      = GROUPS["x86"] + ["mips_loongson"]
bc092b9
 GROUPS["usb"]      = GROUPS["pci"]
bc092b9
 
bc092b9
 # If gfxterm is main output console integrate it into kernel
bc092b9
-GROUPS["videoinkernel"] = ["mips_loongson", "i386_coreboot" ]
bc092b9
+GROUPS["videoinkernel"] = ["mips_loongson", "i386_coreboot", "arm_coreboot" ]
bc092b9
 GROUPS["videomodules"]   = GRUB_PLATFORMS[:];
bc092b9
 for i in GROUPS["videoinkernel"]: GROUPS["videomodules"].remove(i)
bc092b9
 
bc092b9
diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am
bc092b9
index 781d0ffbf..bec058554 100644
bc092b9
--- a/grub-core/Makefile.am
bc092b9
+++ b/grub-core/Makefile.am
bc092b9
@@ -239,6 +239,16 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h
bc092b9
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/system.h
bc092b9
 endif
bc092b9
 
bc092b9
+if COND_arm_coreboot
bc092b9
+KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/system.h
bc092b9
+KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video.h
bc092b9
+KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video_fb.h
bc092b9
+KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/gfxterm.h
bc092b9
+KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/font.h
bc092b9
+KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bufio.h
bc092b9
+KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/coreboot/kernel.h
bc092b9
+endif
bc092b9
+
bc092b9
 if COND_arm_efi
bc092b9
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/efi/loader.h
bc092b9
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h
bc092b9
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
bc092b9
index 6540dc951..411dca46b 100644
bc092b9
--- a/grub-core/Makefile.core.def
bc092b9
+++ b/grub-core/Makefile.core.def
bc092b9
@@ -92,6 +92,8 @@ kernel = {
bc092b9
   emu_cppflags = '$(CPPFLAGS_GNULIB)';
bc092b9
   arm_uboot_ldflags       = '-Wl,-r,-d';
bc092b9
   arm_uboot_stripflags    = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version';
bc092b9
+  arm_coreboot_ldflags       = '-Wl,-r,-d';
bc092b9
+  arm_coreboot_stripflags    = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version';
bc092b9
 
bc092b9
   i386_pc_startup = kern/i386/pc/startup.S;
bc092b9
   i386_efi_startup = kern/i386/efi/startup.S;
bc092b9
@@ -106,6 +108,7 @@ kernel = {
bc092b9
   sparc64_ieee1275_startup = kern/sparc64/ieee1275/crt0.S;
bc092b9
   powerpc_ieee1275_startup = kern/powerpc/ieee1275/startup.S;
bc092b9
   arm_uboot_startup = kern/arm/startup.S;
bc092b9
+  arm_coreboot_startup = kern/arm/startup.S;
bc092b9
   arm_efi_startup = kern/arm/efi/startup.S;
bc092b9
   arm64_efi_startup = kern/arm64/efi/startup.S;
bc092b9
 
bc092b9
@@ -152,6 +155,10 @@ kernel = {
bc092b9
   arm_uboot = kern/arm/uboot/init.c;
bc092b9
   arm_uboot = kern/arm/uboot/uboot.S;
bc092b9
 
bc092b9
+  arm_coreboot = kern/arm/coreboot/init.c;
bc092b9
+  arm_coreboot = kern/arm/coreboot/timer.c;
bc092b9
+  arm_coreboot = kern/arm/coreboot/coreboot.S;
bc092b9
+
bc092b9
   terminfoinkernel = term/terminfo.c;
bc092b9
   terminfoinkernel = term/tparm.c;
bc092b9
   terminfoinkernel = commands/extcmd.c;
bc092b9
@@ -166,7 +173,7 @@ kernel = {
bc092b9
   i386_multiboot = kern/i386/coreboot/init.c;
bc092b9
   i386_qemu = kern/i386/qemu/init.c;
bc092b9
   i386_coreboot_multiboot_qemu = term/i386/pc/vga_text.c;
bc092b9
-  i386_coreboot = video/coreboot/cbfb.c;
bc092b9
+  coreboot = video/coreboot/cbfb.c;
bc092b9
 
bc092b9
   efi = disk/efi/efidisk.c;
bc092b9
   efi = kern/efi/efi.c;
bc092b9
@@ -227,9 +234,10 @@ kernel = {
bc092b9
   i386_qemu = kern/vga_init.c;
bc092b9
   i386_qemu = kern/i386/qemu/mmap.c;
bc092b9
 
bc092b9
-  i386_coreboot = kern/coreboot/mmap.c;
bc092b9
+  coreboot = kern/coreboot/mmap.c;
bc092b9
   i386_coreboot = kern/i386/coreboot/cbtable.c;
bc092b9
-  i386_coreboot = kern/coreboot/cbtable.c;
bc092b9
+  coreboot = kern/coreboot/cbtable.c;
bc092b9
+  arm_coreboot = kern/arm/coreboot/cbtable.c;
bc092b9
 
bc092b9
   i386_multiboot = kern/i386/multiboot_mmap.c;
bc092b9
 
bc092b9
@@ -758,6 +766,7 @@ module = {
bc092b9
   enable = arm_efi;
bc092b9
   enable = arm64_efi;
bc092b9
   enable = arm_uboot;
bc092b9
+  enable = arm_coreboot;
bc092b9
 };
bc092b9
 
bc092b9
 module = {
bc092b9
@@ -842,6 +851,7 @@ module = {
bc092b9
   ieee1275 = lib/ieee1275/halt.c;
bc092b9
   emu = lib/emu/halt.c;
bc092b9
   uboot = lib/dummy/halt.c;
bc092b9
+  arm_coreboot = lib/dummy/halt.c;
bc092b9
 };
bc092b9
 
bc092b9
 module = {
bc092b9
@@ -859,6 +869,7 @@ module = {
bc092b9
   mips_qemu_mips = lib/mips/qemu_mips/reboot.c;
bc092b9
   xen = lib/xen/reboot.c;
bc092b9
   uboot = lib/uboot/reboot.c;
bc092b9
+  arm_coreboot = lib/dummy/reboot.c;
bc092b9
   common = commands/reboot.c;
bc092b9
 };
bc092b9
 
bc092b9
@@ -1553,6 +1564,7 @@ module = {
bc092b9
   cmos = lib/cmos_datetime.c;
bc092b9
   efi = lib/efi/datetime.c;
bc092b9
   uboot = lib/dummy/datetime.c;
bc092b9
+  arm_coreboot = lib/dummy/datetime.c;
bc092b9
   sparc64_ieee1275 = lib/ieee1275/datetime.c;
bc092b9
   powerpc_ieee1275 = lib/ieee1275/datetime.c;
bc092b9
   sparc64_ieee1275 = lib/ieee1275/cmos.c;
bc092b9
diff --git a/grub-core/kern/arm/coreboot/cbtable.c b/grub-core/kern/arm/coreboot/cbtable.c
bc092b9
new file mode 100644
bc092b9
index 000000000..8a655bb5c
bc092b9
--- /dev/null
bc092b9
+++ b/grub-core/kern/arm/coreboot/cbtable.c
bc092b9
@@ -0,0 +1,40 @@
bc092b9
+/*
bc092b9
+ *  GRUB  --  GRand Unified Bootloader
bc092b9
+ *  Copyright (C) 2007,2008,2013  Free Software Foundation, Inc.
bc092b9
+ *
bc092b9
+ *  GRUB is free software: you can redistribute it and/or modify
bc092b9
+ *  it under the terms of the GNU General Public License as published by
bc092b9
+ *  the Free Software Foundation, either version 3 of the License, or
bc092b9
+ *  (at your option) any later version.
bc092b9
+ *
bc092b9
+ *  GRUB is distributed in the hope that it will be useful,
bc092b9
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
bc092b9
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
bc092b9
+ *  GNU General Public License for more details.
bc092b9
+ *
bc092b9
+ *  You should have received a copy of the GNU General Public License
bc092b9
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
bc092b9
+ */
bc092b9
+
bc092b9
+#include <grub/coreboot/lbio.h>
bc092b9
+#include <grub/types.h>
bc092b9
+#include <grub/err.h>
bc092b9
+#include <grub/misc.h>
bc092b9
+#include <grub/dl.h>
bc092b9
+#include <grub/arm/startup.h>
bc092b9
+
bc092b9
+GRUB_MOD_LICENSE ("GPLv3+");
bc092b9
+
bc092b9
+#pragma GCC diagnostic ignored "-Wcast-align"
bc092b9
+
bc092b9
+grub_linuxbios_table_header_t
bc092b9
+grub_linuxbios_get_tables (void)
bc092b9
+{
bc092b9
+  grub_linuxbios_table_header_t table_header
bc092b9
+    = (grub_linuxbios_table_header_t) grub_arm_saved_registers.r[0];
bc092b9
+
bc092b9
+  if (!grub_linuxbios_check_signature (table_header))
bc092b9
+    return 0;
bc092b9
+
bc092b9
+  return table_header;
bc092b9
+}
bc092b9
diff --git a/grub-core/kern/arm/coreboot/coreboot.S b/grub-core/kern/arm/coreboot/coreboot.S
bc092b9
new file mode 100644
bc092b9
index 000000000..a1104526c
bc092b9
--- /dev/null
bc092b9
+++ b/grub-core/kern/arm/coreboot/coreboot.S
bc092b9
@@ -0,0 +1,44 @@
bc092b9
+/*
bc092b9
+ *  GRUB  --  GRand Unified Bootloader
bc092b9
+ *  Copyright (C) 2016  Free Software Foundation, Inc.
bc092b9
+ *
bc092b9
+ *  GRUB is free software: you can redistribute it and/or modify
bc092b9
+ *  it under the terms of the GNU General Public License as published by
bc092b9
+ *  the Free Software Foundation, either version 3 of the License, or
bc092b9
+ *  (at your option) any later version.
bc092b9
+ *
bc092b9
+ *  GRUB is distributed in the hope that it will be useful,
bc092b9
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
bc092b9
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
bc092b9
+ *  GNU General Public License for more details.
bc092b9
+ *
bc092b9
+ *  You should have received a copy of the GNU General Public License
bc092b9
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
bc092b9
+ */
bc092b9
+
bc092b9
+#include <grub/symbol.h>
bc092b9
+
bc092b9
+	.file	"coreboot.S"
bc092b9
+	.text
bc092b9
+	.syntax	unified
bc092b9
+#if !defined (__thumb2__)
bc092b9
+	.arch	armv7a
bc092b9
+	.arm
bc092b9
+#else
bc092b9
+	.arch	armv7
bc092b9
+	.thumb
bc092b9
+#endif
bc092b9
+
bc092b9
+FUNCTION(grub_arm_pfr1)
bc092b9
+	mrc p15, 0, r0, c0, c1, 1
bc092b9
+	bx	lr
bc092b9
+
bc092b9
+FUNCTION(grub_armv7_get_timer_value)
bc092b9
+	isb
bc092b9
+	mrrc p15, 1, r0, r1, c14
bc092b9
+	bx	lr
bc092b9
+
bc092b9
+FUNCTION(grub_armv7_get_timer_frequency)
bc092b9
+	mrc p15, 0, r0, c14, c0, 0
bc092b9
+	bx	lr
bc092b9
+
bc092b9
diff --git a/grub-core/kern/arm/coreboot/init.c b/grub-core/kern/arm/coreboot/init.c
bc092b9
new file mode 100644
bc092b9
index 000000000..51ecaceb0
bc092b9
--- /dev/null
bc092b9
+++ b/grub-core/kern/arm/coreboot/init.c
bc092b9
@@ -0,0 +1,127 @@
bc092b9
+/*
bc092b9
+ *  GRUB  --  GRand Unified Bootloader
bc092b9
+ *  Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2013  Free Software Foundation, Inc.
bc092b9
+ *
bc092b9
+ *  GRUB is free software: you can redistribute it and/or modify
bc092b9
+ *  it under the terms of the GNU General Public License as published by
bc092b9
+ *  the Free Software Foundation, either version 3 of the License, or
bc092b9
+ *  (at your option) any later version.
bc092b9
+ *
bc092b9
+ *  GRUB is distributed in the hope that it will be useful,
bc092b9
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
bc092b9
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
bc092b9
+ *  GNU General Public License for more details.
bc092b9
+ *
bc092b9
+ *  You should have received a copy of the GNU General Public License
bc092b9
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
bc092b9
+ */
bc092b9
+
bc092b9
+#include <grub/kernel.h>
bc092b9
+#include <grub/mm.h>
bc092b9
+#include <grub/memory.h>
bc092b9
+#include <grub/machine/console.h>
bc092b9
+#include <grub/machine/kernel.h>
bc092b9
+#include <grub/offsets.h>
bc092b9
+#include <grub/types.h>
bc092b9
+#include <grub/err.h>
bc092b9
+#include <grub/dl.h>
bc092b9
+#include <grub/misc.h>
bc092b9
+#include <grub/loader.h>
bc092b9
+#include <grub/env.h>
bc092b9
+#include <grub/cache.h>
bc092b9
+#include <grub/time.h>
bc092b9
+#include <grub/symbol.h>
bc092b9
+#include <grub/video.h>
bc092b9
+#include <grub/coreboot/lbio.h>
bc092b9
+
bc092b9
+extern grub_uint8_t _start[];
bc092b9
+extern grub_uint8_t _end[];
bc092b9
+extern grub_uint8_t _edata[];
bc092b9
+grub_addr_t start_of_ram = ~(grub_addr_t)0;
bc092b9
+
bc092b9
+void  __attribute__ ((noreturn))
bc092b9
+grub_exit (void)
bc092b9
+{
bc092b9
+  /* We can't use grub_fatal() in this function.  This would create an infinite
bc092b9
+     loop, since grub_fatal() calls grub_abort() which in turn calls grub_exit().  */
bc092b9
+  while (1)
bc092b9
+    grub_cpu_idle ();
bc092b9
+}
bc092b9
+
bc092b9
+static grub_uint64_t modend;
bc092b9
+static int have_memory = 0;
bc092b9
+
bc092b9
+/* Helper for grub_machine_init.  */
bc092b9
+static int
bc092b9
+heap_init (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type,
bc092b9
+	   void *data __attribute__ ((unused)))
bc092b9
+{
bc092b9
+  grub_uint64_t begin = addr, end = addr + size;
bc092b9
+
bc092b9
+#if GRUB_CPU_SIZEOF_VOID_P == 4
bc092b9
+  /* Restrict ourselves to 32-bit memory space.  */
bc092b9
+  if (begin > GRUB_ULONG_MAX)
bc092b9
+    return 0;
bc092b9
+  if (end > GRUB_ULONG_MAX)
bc092b9
+    end = GRUB_ULONG_MAX;
bc092b9
+#endif
bc092b9
+
bc092b9
+  if (start_of_ram > begin)
bc092b9
+    start_of_ram = begin;
bc092b9
+
bc092b9
+  if (type != GRUB_MEMORY_AVAILABLE)
bc092b9
+    return 0;
bc092b9
+
bc092b9
+  if (modend && begin < modend)
bc092b9
+    {
bc092b9
+      if (begin < (grub_addr_t)_start)
bc092b9
+	{
bc092b9
+	  grub_mm_init_region ((void *) (grub_addr_t) begin, (grub_size_t) ((grub_addr_t)_start - begin));
bc092b9
+	  have_memory = 1;
bc092b9
+	}
bc092b9
+      begin = modend;
bc092b9
+    }
bc092b9
+
bc092b9
+  /* Avoid DMA problems.  */
bc092b9
+  if (end >= 0xfe000000)
bc092b9
+    end = 0xfe000000;
bc092b9
+
bc092b9
+  if (end <= begin)
bc092b9
+    return 0;
bc092b9
+
bc092b9
+  grub_mm_init_region ((void *) (grub_addr_t) begin, (grub_size_t) (end - begin));
bc092b9
+
bc092b9
+  have_memory = 1;
bc092b9
+
bc092b9
+  return 0;
bc092b9
+}
bc092b9
+
bc092b9
+void
bc092b9
+grub_machine_init (void)
bc092b9
+{
bc092b9
+  modend = grub_modules_get_end ();
bc092b9
+
bc092b9
+  grub_video_coreboot_fb_early_init ();
bc092b9
+
bc092b9
+  grub_machine_mmap_iterate (heap_init, NULL);
bc092b9
+  if (!have_memory)
bc092b9
+    grub_fatal ("No memory found");
bc092b9
+
bc092b9
+  grub_video_coreboot_fb_late_init ();
bc092b9
+
bc092b9
+  grub_font_init ();
bc092b9
+  grub_gfxterm_init ();
bc092b9
+
bc092b9
+  grub_machine_timer_init ();
bc092b9
+}
bc092b9
+
bc092b9
+void
bc092b9
+grub_machine_get_bootlocation (char **device __attribute__ ((unused)),
bc092b9
+			       char **path __attribute__ ((unused)))
bc092b9
+{
bc092b9
+}
bc092b9
+
bc092b9
+void
bc092b9
+grub_machine_fini (int flags __attribute__ ((unused)))
bc092b9
+{
bc092b9
+}
bc092b9
diff --git a/grub-core/kern/arm/coreboot/timer.c b/grub-core/kern/arm/coreboot/timer.c
bc092b9
new file mode 100644
bc092b9
index 000000000..ebefb99d5
bc092b9
--- /dev/null
bc092b9
+++ b/grub-core/kern/arm/coreboot/timer.c
bc092b9
@@ -0,0 +1,65 @@
bc092b9
+/*
bc092b9
+ *  GRUB  --  GRand Unified Bootloader
bc092b9
+ *  Copyright (C) 2016  Free Software Foundation, Inc.
bc092b9
+ *
bc092b9
+ *  GRUB is free software: you can redistribute it and/or modify
bc092b9
+ *  it under the terms of the GNU General Public License as published by
bc092b9
+ *  the Free Software Foundation, either version 3 of the License, or
bc092b9
+ *  (at your option) any later version.
bc092b9
+ *
bc092b9
+ *  GRUB is distributed in the hope that it will be useful,
bc092b9
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
bc092b9
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
bc092b9
+ *  GNU General Public License for more details.
bc092b9
+ *
bc092b9
+ *  You should have received a copy of the GNU General Public License
bc092b9
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
bc092b9
+ */
bc092b9
+
bc092b9
+#include <grub/mm.h>
bc092b9
+#include <grub/machine/kernel.h>
bc092b9
+#include <grub/types.h>
bc092b9
+#include <grub/err.h>
bc092b9
+#include <grub/time.h>
bc092b9
+#include <grub/misc.h>
bc092b9
+
bc092b9
+grub_uint64_t
bc092b9
+grub_armv7_get_timer_value(void);
bc092b9
+
bc092b9
+grub_uint32_t
bc092b9
+grub_armv7_get_timer_frequency(void);
bc092b9
+
bc092b9
+grub_uint32_t
bc092b9
+grub_arm_pfr1(void);
bc092b9
+
bc092b9
+static int have_timer = 0;
bc092b9
+static grub_uint32_t timer_frequency_in_khz;
bc092b9
+
bc092b9
+static grub_uint64_t
bc092b9
+generic_get_time_ms (void)
bc092b9
+{
bc092b9
+  return grub_divmod64 (grub_armv7_get_timer_value(), timer_frequency_in_khz, 0);
bc092b9
+}
bc092b9
+
bc092b9
+static int
bc092b9
+try_generic_timer (void)
bc092b9
+{
bc092b9
+  if (((grub_arm_pfr1 () >> 16) & 0xf) != 1)
bc092b9
+    return 0;
bc092b9
+  grub_printf ("freq = %x\n", grub_armv7_get_timer_frequency());
bc092b9
+  timer_frequency_in_khz = 0x016e3600 / 1000; //grub_armv7_get_timer_frequency() / 1000;
bc092b9
+  if (timer_frequency_in_khz == 0)
bc092b9
+    return 0;
bc092b9
+  grub_install_get_time_ms (generic_get_time_ms);
bc092b9
+  have_timer = 1;
bc092b9
+  return 1;
bc092b9
+}
bc092b9
+
bc092b9
+void
bc092b9
+grub_machine_timer_init (void)
bc092b9
+{
bc092b9
+  if (!have_timer)
bc092b9
+    try_generic_timer ();
bc092b9
+  if (!have_timer)
bc092b9
+    grub_fatal ("No timer found");
bc092b9
+}
bc092b9
diff --git a/grub-core/kern/arm/startup.S b/grub-core/kern/arm/startup.S
bc092b9
index 640837cba..3946fe8e1 100644
bc092b9
--- a/grub-core/kern/arm/startup.S
bc092b9
+++ b/grub-core/kern/arm/startup.S
bc092b9
@@ -24,6 +24,7 @@
bc092b9
  * GRUB is called from U-Boot as a Linux Kernel type image, which
bc092b9
  * means among other things that it always enters in ARM state.
bc092b9
  *
bc092b9
+ * coreboot starts in ARM mode as well.
bc092b9
  *
bc092b9
  * Overview of GRUB image layout:
bc092b9
  *
bc092b9
@@ -127,6 +128,8 @@ reloc_done:
bc092b9
 
bc092b9
 	str     r1, EXT_C(grub_modbase)
bc092b9
 
bc092b9
+	/* Coreboot already places modules at right place.  */
bc092b9
+#ifndef GRUB_MACHINE_COREBOOT
bc092b9
 	add	r1, r1, r2
bc092b9
 	add	r0, r0, r2
bc092b9
 	sub     r1, r1, #4
bc092b9
@@ -136,6 +139,7 @@ reloc_done:
bc092b9
 	str	r3, [r1], #-4			@ *dst-- = r3 
bc092b9
 	subs	r2, #4				@ remaining -= 4
bc092b9
 	bne	1b				@ while remaining != 0
bc092b9
+#endif
bc092b9
 
bc092b9
 	@ Since we _are_ the C run-time, we need to manually zero the BSS
bc092b9
 	@ region before continuing
bc092b9
diff --git a/grub-core/kern/coreboot/cbtable.c b/grub-core/kern/coreboot/cbtable.c
bc092b9
index 996d3f407..aec63dbd1 100644
bc092b9
--- a/grub-core/kern/coreboot/cbtable.c
bc092b9
+++ b/grub-core/kern/coreboot/cbtable.c
bc092b9
@@ -23,6 +23,8 @@
bc092b9
 #include <grub/misc.h>
bc092b9
 #include <grub/dl.h>
bc092b9
 
bc092b9
+#pragma GCC diagnostic ignored "-Wcast-align"
bc092b9
+
bc092b9
 /* Helper for grub_linuxbios_table_iterate.  */
bc092b9
 int
bc092b9
 grub_linuxbios_check_signature (grub_linuxbios_table_header_t tbl_header)
bc092b9
diff --git a/grub-core/lib/dummy/reboot.c b/grub-core/lib/dummy/reboot.c
bc092b9
new file mode 100644
bc092b9
index 000000000..b8cbed8f8
bc092b9
--- /dev/null
bc092b9
+++ b/grub-core/lib/dummy/reboot.c
bc092b9
@@ -0,0 +1,32 @@
bc092b9
+/*
bc092b9
+ *  GRUB  --  GRand Unified Bootloader
bc092b9
+ *  Copyright (C) 2013  Free Software Foundation, Inc.
bc092b9
+ *
bc092b9
+ *  GRUB is free software: you can redistribute it and/or modify
bc092b9
+ *  it under the terms of the GNU General Public License as published by
bc092b9
+ *  the Free Software Foundation, either version 3 of the License, or
bc092b9
+ *  (at your option) any later version.
bc092b9
+ *
bc092b9
+ *  GRUB is distributed in the hope that it will be useful,
bc092b9
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
bc092b9
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
bc092b9
+ *  GNU General Public License for more details.
bc092b9
+ *
bc092b9
+ *  You should have received a copy of the GNU General Public License
bc092b9
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
bc092b9
+ */
bc092b9
+
bc092b9
+#include <grub/misc.h>
bc092b9
+#include <grub/mm.h>
bc092b9
+#include <grub/kernel.h>
bc092b9
+#include <grub/loader.h>
bc092b9
+
bc092b9
+void
bc092b9
+grub_reboot (void)
bc092b9
+{
bc092b9
+  grub_machine_fini (GRUB_LOADER_FLAG_NORETURN);
bc092b9
+
bc092b9
+  /* Just stop here */
bc092b9
+
bc092b9
+  while (1);
bc092b9
+}
bc092b9
diff --git a/grub-core/loader/arm/linux.c b/grub-core/loader/arm/linux.c
bc092b9
index 5b39f02bb..01374ee78 100644
bc092b9
--- a/grub-core/loader/arm/linux.c
bc092b9
+++ b/grub-core/loader/arm/linux.c
bc092b9
@@ -31,6 +31,8 @@
bc092b9
 
bc092b9
 GRUB_MOD_LICENSE ("GPLv3+");
bc092b9
 
bc092b9
+#ifndef GRUB_MACHINE_COREBOOT
bc092b9
+
bc092b9
 static grub_dl_t my_mod;
bc092b9
 
bc092b9
 static grub_addr_t initrd_start;
bc092b9
@@ -527,3 +529,4 @@ GRUB_MOD_FINI (linux)
bc092b9
   grub_unregister_command (cmd_initrd);
bc092b9
   grub_unregister_command (cmd_devicetree);
bc092b9
 }
bc092b9
+#endif
bc092b9
diff --git a/include/grub/arm/coreboot/console.h b/include/grub/arm/coreboot/console.h
bc092b9
new file mode 100644
bc092b9
index 000000000..13a14b783
bc092b9
--- /dev/null
bc092b9
+++ b/include/grub/arm/coreboot/console.h
bc092b9
@@ -0,0 +1,29 @@
bc092b9
+/*
bc092b9
+ *  GRUB  --  GRand Unified Bootloader
bc092b9
+ *  Copyright (C) 2009  Free Software Foundation, Inc.
bc092b9
+ *
bc092b9
+ *  GRUB is free software: you can redistribute it and/or modify
bc092b9
+ *  it under the terms of the GNU General Public License as published by
bc092b9
+ *  the Free Software Foundation, either version 3 of the License, or
bc092b9
+ *  (at your option) any later version.
bc092b9
+ *
bc092b9
+ *  GRUB is distributed in the hope that it will be useful,
bc092b9
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
bc092b9
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
bc092b9
+ *  GNU General Public License for more details.
bc092b9
+ *
bc092b9
+ *  You should have received a copy of the GNU General Public License
bc092b9
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
bc092b9
+ */
bc092b9
+
bc092b9
+#ifndef GRUB_MACHINE_CONSOLE_HEADER
bc092b9
+#define GRUB_MACHINE_CONSOLE_HEADER	1
bc092b9
+
bc092b9
+void grub_video_coreboot_fb_init (void);
bc092b9
+void grub_video_coreboot_fb_early_init (void);
bc092b9
+void grub_video_coreboot_fb_late_init (void);
bc092b9
+void grub_video_coreboot_fb_fini (void);
bc092b9
+
bc092b9
+extern struct grub_linuxbios_table_framebuffer *grub_video_coreboot_fbtable;
bc092b9
+
bc092b9
+#endif /* ! GRUB_MACHINE_CONSOLE_HEADER */
bc092b9
diff --git a/include/grub/arm/coreboot/kernel.h b/include/grub/arm/coreboot/kernel.h
bc092b9
new file mode 100644
bc092b9
index 000000000..09cd7fe32
bc092b9
--- /dev/null
bc092b9
+++ b/include/grub/arm/coreboot/kernel.h
bc092b9
@@ -0,0 +1,44 @@
bc092b9
+/*
bc092b9
+ *  GRUB  --  GRand Unified Bootloader
bc092b9
+ *  Copyright (C) 2013 Free Software Foundation, Inc.
bc092b9
+ *
bc092b9
+ *  GRUB is free software: you can redistribute it and/or modify
bc092b9
+ *  it under the terms of the GNU General Public License as published by
bc092b9
+ *  the Free Software Foundation, either version 3 of the License, or
bc092b9
+ *  (at your option) any later version.
bc092b9
+ *
bc092b9
+ *  GRUB is distributed in the hope that it will be useful,
bc092b9
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
bc092b9
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
bc092b9
+ *  GNU General Public License for more details.
bc092b9
+ *
bc092b9
+ *  You should have received a copy of the GNU General Public License
bc092b9
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
bc092b9
+ */
bc092b9
+
bc092b9
+#ifndef GRUB_KERNEL_MACHINE_HEADER
bc092b9
+#define GRUB_KERNEL_MACHINE_HEADER	1
bc092b9
+
bc092b9
+#ifndef ASM_FILE
bc092b9
+
bc092b9
+#include <grub/symbol.h>
bc092b9
+#include <grub/types.h>
bc092b9
+
bc092b9
+struct grub_fdt_board
bc092b9
+{
bc092b9
+  const char *vendor, *part;
bc092b9
+  const grub_uint8_t *dtb;
bc092b9
+  grub_size_t dtb_size;
bc092b9
+};
bc092b9
+
bc092b9
+extern struct grub_fdt_board grub_fdt_boards[];
bc092b9
+void grub_machine_timer_init (void);
bc092b9
+void grub_pl050_init (void);
bc092b9
+void
bc092b9
+grub_cros_init (void);
bc092b9
+extern grub_addr_t EXPORT_VAR (start_of_ram);
bc092b9
+#endif /* ! ASM_FILE */
bc092b9
+
bc092b9
+#define GRUB_KERNEL_MACHINE_STACK_SIZE GRUB_KERNEL_ARM_STACK_SIZE
bc092b9
+
bc092b9
+#endif /* ! GRUB_KERNEL_MACHINE_HEADER */
bc092b9
diff --git a/include/grub/offsets.h b/include/grub/offsets.h
bc092b9
index c88c86d4d..bf0689fc9 100644
bc092b9
--- a/include/grub/offsets.h
bc092b9
+++ b/include/grub/offsets.h
bc092b9
@@ -122,6 +122,12 @@
bc092b9
 #define GRUB_KERNEL_ARM_UBOOT_MOD_ALIGN 	0x8
bc092b9
 #define GRUB_KERNEL_ARM_UBOOT_TOTAL_MODULE_SIZE	0x4
bc092b9
 
bc092b9
+#define GRUB_KERNEL_ARM_COREBOOT_MOD_ALIGN 	0x8
bc092b9
+#define GRUB_KERNEL_ARM_COREBOOT_TOTAL_MODULE_SIZE	0x4
bc092b9
+
bc092b9
+#define GRUB_KERNEL_ARM_STACK_SIZE 0x40000
bc092b9
+#define GRUB_KERNEL_ARM_COREBOOT_MOD_GAP (GRUB_KERNEL_ARM_STACK_SIZE + 1024)
bc092b9
+
bc092b9
 /* Minimal gap between _end and the start of the modules.  It's a hack
bc092b9
    for PowerMac to prevent "CLAIM failed" error.  The real fix is to
bc092b9
    rewrite grub-mkimage to generate valid ELF files.  */
bc092b9
diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
bc092b9
index 3fab93e20..a2bb05439 100644
bc092b9
--- a/util/grub-mkimagexx.c
bc092b9
+++ b/util/grub-mkimagexx.c
bc092b9
@@ -87,7 +87,8 @@ struct fixup_block_list
bc092b9
 static int
bc092b9
 is_relocatable (const struct grub_install_image_target_desc *image_target)
bc092b9
 {
bc092b9
-  return image_target->id == IMAGE_EFI || image_target->id == IMAGE_UBOOT;
bc092b9
+  return image_target->id == IMAGE_EFI || image_target->id == IMAGE_UBOOT
bc092b9
+    || (image_target->id == IMAGE_COREBOOT && image_target->elf_target == EM_ARM);
bc092b9
 }
bc092b9
 
bc092b9
 #ifdef MKIMAGE_ELF32
bc092b9
@@ -274,7 +275,10 @@ SUFFIX (grub_mkimage_generate_elf) (const struct grub_install_image_target_desc
bc092b9
     {
bc092b9
       grub_uint32_t target_addr_mods;
bc092b9
       phdr->p_filesz = grub_host_to_target32 (layout->kernel_size);
bc092b9
-      phdr->p_memsz = grub_host_to_target32 (layout->kernel_size + layout->bss_size);
bc092b9
+      if (image_target->id == IMAGE_COREBOOT && image_target->elf_target == EM_ARM)
bc092b9
+	phdr->p_memsz = grub_host_to_target32 (layout->kernel_size);
bc092b9
+      else
bc092b9
+	phdr->p_memsz = grub_host_to_target32 (layout->kernel_size + layout->bss_size);
bc092b9
 
bc092b9
       phdr++;
bc092b9
       phdr->p_type = grub_host_to_target32 (PT_GNU_STACK);
bc092b9
@@ -290,8 +294,12 @@ SUFFIX (grub_mkimage_generate_elf) (const struct grub_install_image_target_desc
bc092b9
       phdr->p_filesz = phdr->p_memsz
bc092b9
 	= grub_host_to_target32 (*core_size - layout->kernel_size);
bc092b9
 
bc092b9
-      if (image_target->id == IMAGE_COREBOOT)
bc092b9
+      if (image_target->id == IMAGE_COREBOOT && image_target->elf_target == EM_386)
bc092b9
 	target_addr_mods = GRUB_KERNEL_I386_COREBOOT_MODULES_ADDR;
bc092b9
+      else if (image_target->id == IMAGE_COREBOOT && image_target->elf_target == EM_ARM)
bc092b9
+	target_addr_mods = ALIGN_UP (target_addr + layout->end
bc092b9
+				     + image_target->mod_gap,
bc092b9
+				     image_target->mod_align);
bc092b9
       else
bc092b9
 	target_addr_mods = ALIGN_UP (target_addr + layout->kernel_size + layout->bss_size
bc092b9
 				     + image_target->mod_gap,
bc092b9
@@ -1876,7 +1884,7 @@ SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path,
bc092b9
      Platforms other than EFI and U-boot shouldn't have .bss in
bc092b9
      their binaries as we build with -Wl,-Ttext.
bc092b9
   */
bc092b9
-  if (image_target->id != IMAGE_UBOOT)
bc092b9
+  if (image_target->id == IMAGE_EFI || !is_relocatable (image_target))
bc092b9
     layout->kernel_size = layout->end;
bc092b9
 
bc092b9
   return section_addresses;
bc092b9
@@ -1979,6 +1987,7 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path,
bc092b9
   if (image_target->id == IMAGE_SPARC64_AOUT
bc092b9
       || image_target->id == IMAGE_SPARC64_RAW
bc092b9
       || image_target->id == IMAGE_UBOOT
bc092b9
+      || image_target->id == IMAGE_COREBOOT
bc092b9
       || image_target->id == IMAGE_SPARC64_CDCORE)
bc092b9
     layout->kernel_size = ALIGN_UP (layout->kernel_size, image_target->mod_align);
bc092b9
 
bc092b9
@@ -2084,7 +2093,7 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path,
bc092b9
 	   Platforms other than EFI and U-boot shouldn't have .bss in
bc092b9
 	   their binaries as we build with -Wl,-Ttext.
bc092b9
 	*/
bc092b9
-	|| (SUFFIX (is_bss_section) (s, image_target) && (image_target->id != IMAGE_UBOOT))
bc092b9
+	|| (SUFFIX (is_bss_section) (s, image_target) && (image_target->id == IMAGE_EFI || !is_relocatable (image_target)))
bc092b9
 	|| SUFFIX (is_text_section) (s, image_target))
bc092b9
       {
bc092b9
 	if (grub_target_to_host32 (s->sh_type) == SHT_NOBITS)
bc092b9
diff --git a/util/mkimage.c b/util/mkimage.c
bc092b9
index 528166c87..6aa77ed73 100644
bc092b9
--- a/util/mkimage.c
bc092b9
+++ b/util/mkimage.c
bc092b9
@@ -533,6 +533,45 @@ static const struct grub_install_image_target_desc image_targets[] =
bc092b9
       .mod_align = GRUB_KERNEL_ARM_UBOOT_MOD_ALIGN,
bc092b9
       .link_align = 4
bc092b9
     },
bc092b9
+    /* For coreboot versions that don't support self-relocating images. */
bc092b9
+    {
bc092b9
+      .dirname = "arm-coreboot-vexpress",
bc092b9
+      .names = { "arm-coreboot-vexpress", NULL },
bc092b9
+      .voidp_sizeof = 4,
bc092b9
+      .bigendian = 0,
bc092b9
+      .id = IMAGE_COREBOOT,
bc092b9
+      .flags = PLATFORM_FLAGS_NONE,
bc092b9
+      .total_module_size = GRUB_KERNEL_ARM_COREBOOT_TOTAL_MODULE_SIZE,
bc092b9
+      .decompressor_compressed_size = TARGET_NO_FIELD,
bc092b9
+      .decompressor_uncompressed_size = TARGET_NO_FIELD,
bc092b9
+      .decompressor_uncompressed_addr = TARGET_NO_FIELD,
bc092b9
+      .section_align = GRUB_KERNEL_ARM_COREBOOT_MOD_ALIGN,
bc092b9
+      .vaddr_offset = 0,
bc092b9
+      .elf_target = EM_ARM,
bc092b9
+      .mod_gap = GRUB_KERNEL_ARM_COREBOOT_MOD_GAP,
bc092b9
+      .mod_align = GRUB_KERNEL_ARM_COREBOOT_MOD_ALIGN,
bc092b9
+      .link_align = 4,
bc092b9
+      .link_addr = 0x62000000,
bc092b9
+    },
bc092b9
+    {
bc092b9
+      .dirname = "arm-coreboot-veyron",
bc092b9
+      .names = { "arm-coreboot-veyron", NULL },
bc092b9
+      .voidp_sizeof = 4,
bc092b9
+      .bigendian = 0,
bc092b9
+      .id = IMAGE_COREBOOT,
bc092b9
+      .flags = PLATFORM_FLAGS_NONE,
bc092b9
+      .total_module_size = GRUB_KERNEL_ARM_COREBOOT_TOTAL_MODULE_SIZE,
bc092b9
+      .decompressor_compressed_size = TARGET_NO_FIELD,
bc092b9
+      .decompressor_uncompressed_size = TARGET_NO_FIELD,
bc092b9
+      .decompressor_uncompressed_addr = TARGET_NO_FIELD,
bc092b9
+      .section_align = GRUB_KERNEL_ARM_COREBOOT_MOD_ALIGN,
bc092b9
+      .vaddr_offset = 0,
bc092b9
+      .elf_target = EM_ARM,
bc092b9
+      .mod_gap = GRUB_KERNEL_ARM_COREBOOT_MOD_GAP,
bc092b9
+      .mod_align = GRUB_KERNEL_ARM_COREBOOT_MOD_ALIGN,
bc092b9
+      .link_align = 4,
bc092b9
+      .link_addr = 0x43000000,
bc092b9
+    },
bc092b9
     {
bc092b9
       .dirname = "arm-efi",
bc092b9
       .names = { "arm-efi", NULL },
bc092b9
@@ -1033,7 +1072,7 @@ grub_install_generate_image (const char *dir, const char *prefix,
bc092b9
 	/* fallthrough */
bc092b9
     case IMAGE_COREBOOT:
bc092b9
     case IMAGE_QEMU:
bc092b9
-	if (layout.kernel_size + layout.bss_size + GRUB_KERNEL_I386_PC_LINK_ADDR > 0x68000)
bc092b9
+	if (image_target->elf_target != EM_ARM && layout.kernel_size + layout.bss_size + GRUB_KERNEL_I386_PC_LINK_ADDR > 0x68000)
bc092b9
 	  grub_util_error (_("kernel image is too big (0x%x > 0x%x)"),
bc092b9
 			   (unsigned) layout.kernel_size + (unsigned) layout.bss_size
bc092b9
 			   + GRUB_KERNEL_I386_PC_LINK_ADDR,
bc092b9
-- 
da63b36
2.14.3
bc092b9