Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11386
-gerrit
commit d45b714e2ce8fe8fff9b67fdc1234cc416c21602
Author: Douglas Anderson <dianders(a)chromium.org>
Date: Thu Aug 6 09:28:03 2015 -0700
veyron: mickey sdram-lpddr3-samsung-2GB.inc now 40 Ohm
The value of 0x4 (60 Ohm) apperas to be causing lots of problems.
Since 0x1 (34.3 Ohm) was _almost_ right, let's try 0x2 (40 Ohm) and
hope it's the sweet spot.
BRANCH=None
BUG=chrome-os-partner:43626
TEST=My mickey now boots up
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
Original-Commit-Id: 06db96e00d39972edbaf8429cbe88bbc66804e15
Original-Change-Id: If8b7d51d058ae000c0af189a648c62fa38a872ac
Original-Signed-off-by: Douglas Anderson <dianders(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/291121
Original-Reviewed-by: Julius Werner <jwerner(a)chromium.org>
Original-(cherry picked from commit 0dabadca1ab3bb310f85646d020bdcf672014071)
Original-Reviewed-on: https://chromium-review.googlesource.com/291291
Change-Id: Id32790c894c09616e32503aa790fa294093eca8a
---
.../google/veyron_mickey/sdram_inf/sdram-lpddr3-samsung-2GB.inc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/mainboard/google/veyron_mickey/sdram_inf/sdram-lpddr3-samsung-2GB.inc b/src/mainboard/google/veyron_mickey/sdram_inf/sdram-lpddr3-samsung-2GB.inc
index cc39f62..666b12f 100644
--- a/src/mainboard/google/veyron_mickey/sdram_inf/sdram-lpddr3-samsung-2GB.inc
+++ b/src/mainboard/google/veyron_mickey/sdram_inf/sdram-lpddr3-samsung-2GB.inc
@@ -65,8 +65,8 @@
.mr[0] = 0x0,
.mr[1] = 0xC3,
.mr[2] = 0x6,
- /* 60Ohms instead of 34.3 due to bad PCB routing on Mickey. */
- .mr[3] = 0x4
+ /* 40 Ohms instead of 34.3 due to bad PCB routing on Mickey. */
+ .mr[3] = 0x2
},
.noc_timing = 0x20D266A4,
.noc_activate = 0x5B6,
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11385
-gerrit
commit 2407438231560f4c3d23b7059a7fa58e82133e05
Author: David Hendricks <dhendrix(a)chromium.org>
Date: Wed Aug 5 14:13:34 2015 -0700
veyron_rialto: Force 3G modem off
This basically does the same thing for firmware what CL:290631
did in the kernel. We want to keep the modem off until it needs
to be used to avoid enumeration/detection issues.
BUG=chrome-os-partner:43271
BRANCH=none
TEST=needs testing
Change-Id: I3b63a77c732dc4895b728b30f1dd71210a9c0e90
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
Original-Commit-Id: a90ccd7fbffe44abe05e96341cc77067442c85e4
Original-Change-Id: I3516de1ea9160f7186ad7f5fb3b5d29ac73143b5
Original-Signed-off-by: David Hendricks <dhendrix(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/290890
Original-Reviewed-by: Alexandru Stan <amstan(a)chromium.org>
---
src/mainboard/google/veyron_rialto/mainboard.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/mainboard/google/veyron_rialto/mainboard.c b/src/mainboard/google/veyron_rialto/mainboard.c
index 52a27bb..4dba666 100644
--- a/src/mainboard/google/veyron_rialto/mainboard.c
+++ b/src/mainboard/google/veyron_rialto/mainboard.c
@@ -72,6 +72,14 @@ static void configure_codec(void)
rkclk_configure_i2s(12288000);
}
+static void configure_3g(void)
+{
+ /* Force 3G modem off to avoid confusing the EHCI host and
+ * causing problems during enumeration/init */
+ gpio_output(GPIO(5, C, 1), 1); /* 3G_SHUTDOWN */
+ gpio_output(GPIO(4, D, 2), 0); /* 3G_ON_OFF */
+}
+
static void mainboard_init(device_t dev)
{
gpio_output(GPIO_RESET, 0);
@@ -79,6 +87,7 @@ static void mainboard_init(device_t dev)
configure_usb();
configure_emmc();
configure_codec();
+ configure_3g();
/* No video. */
elog_init();
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11383
-gerrit
commit aa2972dfe1fd5f6cbb5aef2bddce405563249a3a
Author: Furquan Shaikh <furquan(a)google.com>
Date: Wed Aug 5 17:03:34 2015 -0700
t210: Move page tables to end of TZDRAM
BL31 makes an assumption that TZDRAM always starts at its base. This
was not true in our case since coreboot page tables were located
towards the start of TZDRAM. Instead move page tables to the end, thus
satisfying the assumption that BL31 base is the base of TZDRAM as
well.
BUG=chrome-os-partner:42989
BRANCH=None
TEST=Compiles successfully and boots to kernel prompt
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
Original-Commit-Id: aabed336da6e9aea426650c5ca5977ccfc83a21b
Original-Change-Id: Ic4d155525dbb4baab95c971f77848e47d5d54dba
Original-Signed-off-by: Furquan Shaikh <furquan(a)google.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/291020
Original-Reviewed-by: Furquan Shaikh <furquan(a)chromium.org>
Original-Commit-Queue: Furquan Shaikh <furquan(a)chromium.org>
Original-Trybot-Ready: Furquan Shaikh <furquan(a)chromium.org>
Original-Tested-by: Furquan Shaikh <furquan(a)chromium.org>
Original-(cherry picked from commit a57127f1655ef311b82c41ce33ffc71db5f9db35)
Original-Reviewed-on: https://chromium-review.googlesource.com/290987
Change-Id: Ie7166fd0301b46eb32f44107f7f782c6d79a278c
---
src/soc/nvidia/tegra210/Makefile.inc | 9 +++-----
src/soc/nvidia/tegra210/mmu_operations.c | 35 +++++++++++++++++++++++++++++---
2 files changed, 35 insertions(+), 9 deletions(-)
diff --git a/src/soc/nvidia/tegra210/Makefile.inc b/src/soc/nvidia/tegra210/Makefile.inc
index 0593f06..fb38d38 100644
--- a/src/soc/nvidia/tegra210/Makefile.inc
+++ b/src/soc/nvidia/tegra210/Makefile.inc
@@ -161,14 +161,11 @@ endif
# BL31 component is placed towards the end of 32-bit address space. This assumes
# that TrustZone memory is placed at the end of 32-bit address space. Within the
-# TZ memory, we place TTB at the beginning and then remaining space can be used
-# up by BL31 and secure OS. Calculate TZDRAM_BASE i.e. base of BL31 component
-# by:
+# TZ memory, we place BL31 and BL32(if available) towards the beginning and TTB
+# towards the end. Calculate TZDRAM_BASE i.e. base of BL31 component by:
# 0x1000 = end of 32-bit address space in MiB
# 0x1000 - $(CONFIG_TRUSTZONE_CARVEOUT_SIZE_MB) = start of TZ memory in MiB
-# 0x1000 - $(CONFIG_TRUSTZONE_CARVEOUT_SIZE_MB) + $(CONFIG_TTB_SIZE_MB)
-# = skip TTB buffer and get base address of BL31
-BL31_MAKEARGS += TZDRAM_BASE=$$(((0x1000 - $(CONFIG_TRUSTZONE_CARVEOUT_SIZE_MB) + $(CONFIG_TTB_SIZE_MB)) << 20))
+BL31_MAKEARGS += TZDRAM_BASE=$$(((0x1000 - $(CONFIG_TRUSTZONE_CARVEOUT_SIZE_MB)) << 20))
BL31_MAKEARGS += PLAT=tegra TARGET_SOC=t210
# MTC fw
diff --git a/src/soc/nvidia/tegra210/mmu_operations.c b/src/soc/nvidia/tegra210/mmu_operations.c
index dd7437c..5578933 100644
--- a/src/soc/nvidia/tegra210/mmu_operations.c
+++ b/src/soc/nvidia/tegra210/mmu_operations.c
@@ -18,6 +18,7 @@
*/
#include <arch/mmu.h>
+#include <assert.h>
#include <memrange.h>
#include <soc/addressmap.h>
#include <soc/mmu_operations.h>
@@ -69,15 +70,43 @@ void tegra210_mmu_init(void)
{
uintptr_t tz_base_mib;
size_t tz_size_mib;
+ uintptr_t ttb_base_mib;
size_t ttb_size_mib;
struct memranges *map = &t210_mmap_ranges;
tegra210_memrange_init(map);
mainboard_add_memory_ranges(map);
- /* Place page tables at the base of the trust zone region. */
+ /*
+ * Place page tables at the end of the trust zone region.
+ * TZDRAM layout is as follows:
+ *
+ * +--------------------------+ <----+DRAM_END
+ * | |
+ * | |
+ * | |
+ * +--------------------------+ <----+0x100000000
+ * | |
+ * | coreboot page tables |
+ * +--------------------------+
+ * | |
+ * | BL32 |
+ * +--------------------------+
+ * | |
+ * | BL31 |
+ * +--------------------------+ <----+TZDRAM_BASE
+ * | |
+ * | |
+ * | |
+ * | |
+ * +--------------------------+ <----+DRAM_BASE
+ *
+ */
carveout_range(CARVEOUT_TZ, &tz_base_mib, &tz_size_mib);
- tz_base_mib *= MiB;
+
+ assert(tz_size_mib > CONFIG_TTB_SIZE_MB);
+ ttb_base_mib = (tz_base_mib + tz_size_mib - CONFIG_TTB_SIZE_MB) * MiB;
+
ttb_size_mib = CONFIG_TTB_SIZE_MB * MiB;
- mmu_init(map, (void *)tz_base_mib, ttb_size_mib);
+ mmu_init(map, (void *)ttb_base_mib, ttb_size_mib);
mmu_enable();
}
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11382
-gerrit
commit 629e14bd7ad72e09c76d65140c910a2bf4536386
Author: Furquan Shaikh <furquan(a)google.com>
Date: Wed Aug 5 17:05:26 2015 -0700
t210: Pass in required BL31 parameters
BUG=chrome-os-partner:42989
BRANCH=None
TEST=Compiles successfully and boots to kernel prompt.
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
Original-Commit-Id: ff42f0b4e7f81ea97e571ec03adac16b412e4a37
Original-Change-Id: If78857abfb9a348433b8707e58bea1f58416d243
Original-Signed-off-by: Furquan Shaikh <furquan(a)google.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/291021
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
Original-Commit-Queue: Furquan Shaikh <furquan(a)chromium.org>
Original-Trybot-Ready: Furquan Shaikh <furquan(a)chromium.org>
Original-Tested-by: Furquan Shaikh <furquan(a)chromium.org>
Original-(cherry picked from commit 68eeb4bb4b817184eb42f4ee3a840317ede07dae)
Original-Reviewed-on: https://chromium-review.googlesource.com/290988
Original-Reviewed-by: Furquan Shaikh <furquan(a)chromium.org>
Change-Id: Id555198bc8e5d77f8ceee710d1a432516bd1ae4c
---
src/soc/nvidia/tegra210/Makefile.inc | 1 +
src/soc/nvidia/tegra210/arm_tf.c | 47 ++++++++++++++++++++++++++++++++++++
2 files changed, 48 insertions(+)
diff --git a/src/soc/nvidia/tegra210/Makefile.inc b/src/soc/nvidia/tegra210/Makefile.inc
index 2d5bf58..0593f06 100644
--- a/src/soc/nvidia/tegra210/Makefile.inc
+++ b/src/soc/nvidia/tegra210/Makefile.inc
@@ -75,6 +75,7 @@ ramstage-$(CONFIG_MAINBOARD_DO_DSI_INIT) += mipi-phy.c
ramstage-$(CONFIG_MAINBOARD_DO_DSI_INIT) += ./jdi_25x18_display/panel-jdi-lpm102a188a.c
ramstage-$(CONFIG_MAINBOARD_DO_SOR_INIT) += dp.c
ramstage-$(CONFIG_MAINBOARD_DO_SOR_INIT) += sor.c
+ramstage-$(CONFIG_ARM64_USE_ARM_TRUSTED_FIRMWARE) += arm_tf.c
ramstage-y += sdram_lp0.c
ramstage-y += soc.c
diff --git a/src/soc/nvidia/tegra210/arm_tf.c b/src/soc/nvidia/tegra210/arm_tf.c
new file mode 100644
index 0000000..56aa4ac
--- /dev/null
+++ b/src/soc/nvidia/tegra210/arm_tf.c
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ *
+ * 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 <arch/cache.h>
+#include <arm_tf.h>
+#include <assert.h>
+#include <soc/addressmap.h>
+#include <stdlib.h>
+#include <string.h>
+#include <symbols.h>
+
+typedef struct bl31_plat_params {
+ uint32_t tzdram_size;
+} bl31_plat_params_t;
+
+static bl31_plat_params_t t210_plat_params;
+
+void *soc_get_bl31_plat_params(bl31_params_t *params)
+{
+ uintptr_t tz_base_mib;
+ size_t tz_size_mib;
+
+ carveout_range(CARVEOUT_TZ, &tz_base_mib, &tz_size_mib);
+
+ assert(tz_size_mib < 4096);
+ t210_plat_params.tzdram_size = tz_size_mib * MiB;
+
+ dcache_clean_by_mva(&t210_plat_params, sizeof(t210_plat_params));
+
+ return &t210_plat_params;
+}
Naman Govil (namangov(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10527
-gerrit
commit 01bf3d703250022854eda3897c694c232af4ad92
Author: Naman Govil <namangov(a)gmail.com>
Date: Wed Jul 15 02:51:36 2015 -0400
armv8 : coreboot for qemu aarch64 #Work in progress#
This patchset aims to add a new mainboard
(emulation) for arm64. By the
end of this work, we will have coreboot running
on a qemu-system-aarch64.
Change-Id: I5550dcaae9981908e0c3bf6961206a70bebac5d1
Signed-off-by: Naman Govil <namangov(a)gmail.com>
---
src/arch/arm64/armv8/bootblock_simple.c | 2 +-
src/arch/arm64/c_entry.c | 22 ++-
src/arch/arm64/cpu.c | 3 +-
src/arch/arm64/cpu.h | 204 +++++++++++++++++++++
src/arch/arm64/include/arch/cpu.h | 204 +++++++++++++++++++++
src/arch/arm64/include/armv8/arch/secmon.h | 4 +-
src/cpu/armltd/armv8/Kconfig | 11 ++
src/mainboard/emulation/qemu-armv8/Kconfig | 57 ++++++
src/mainboard/emulation/qemu-armv8/Kconfig.name | 2 +
src/mainboard/emulation/qemu-armv8/Makefile.inc | 40 ++++
src/mainboard/emulation/qemu-armv8/board_info.txt | 3 +
.../emulation/qemu-armv8/bootblock-common.h | 19 ++
src/mainboard/emulation/qemu-armv8/bootblock.c | 22 +++
src/mainboard/emulation/qemu-armv8/cbmem.c | 25 +++
src/mainboard/emulation/qemu-armv8/cpu_lib.S | 29 +++
src/mainboard/emulation/qemu-armv8/devicetree.cb | 20 ++
src/mainboard/emulation/qemu-armv8/mainboard.c | 27 +++
src/mainboard/emulation/qemu-armv8/media.c | 25 +++
src/mainboard/emulation/qemu-armv8/memlayout.ld | 48 +++++
src/mainboard/emulation/qemu-armv8/romstage.c | 24 +++
src/mainboard/emulation/qemu-armv8/timer.c | 27 +++
src/mainboard/emulation/qemu-armv8/uart.c | 24 +++
22 files changed, 829 insertions(+), 13 deletions(-)
diff --git a/src/arch/arm64/armv8/bootblock_simple.c b/src/arch/arm64/armv8/bootblock_simple.c
index c93a100..681bbf9 100644
--- a/src/arch/arm64/armv8/bootblock_simple.c
+++ b/src/arch/arm64/armv8/bootblock_simple.c
@@ -51,7 +51,7 @@ void main(void)
*/
if (boot_cpu()) {
- bootblock_cpu_init();
+ //bootblock_cpu_init();
bootblock_mainboard_init();
}
diff --git a/src/arch/arm64/c_entry.c b/src/arch/arm64/c_entry.c
index 5970405..3f672a3 100644
--- a/src/arch/arm64/c_entry.c
+++ b/src/arch/arm64/c_entry.c
@@ -63,22 +63,26 @@ static void arm64_init(void)
main();
}
-static void secondary_cpu_start(void)
-{
-#ifndef __PRE_RAM__
- mmu_enable();
- exception_hwinit();
+//static void secondary_cpu_start(void)
+//{
+//#ifndef __PRE_RAM__
+// mmu_enable();
+// exception_hwinit();
/* This will never return. */
- arch_secondary_cpu_init();
-#endif
-}
+// arch_secondary_cpu_init();
+//#endif
+//}
/*
* This variable holds entry point for CPUs starting up. The first
* element is the BSP path, and the second is the non-BSP path.
*/
-void (*c_entry[2])(void) = { &arm64_init, &arch_secondary_cpu_init };
+#ifdef __PRE_RAM__
+void (*c_entry[2])(void) = { &arm64_init, NULL};
+#else
+void (*c_entry[2])(void) = { &arm64_init, &arch_secondary_cpu_init};
+#endif
void *prepare_secondary_cpu_startup(void)
{
diff --git a/src/arch/arm64/cpu.c b/src/arch/arm64/cpu.c
index 3cf73ae..1026434 100644
--- a/src/arch/arm64/cpu.c
+++ b/src/arch/arm64/cpu.c
@@ -219,8 +219,9 @@ void arch_cpu_wait_for_action(void)
action_queue_complete(q, orig);
}
}
-
+#ifdef __PRE_RAM__
int boot_cpu(void)
{
return cpu_is_bsp();
}
+#endif
diff --git a/src/arch/arm64/cpu.h b/src/arch/arm64/cpu.h
new file mode 100644
index 0000000..ae16fa1
--- /dev/null
+++ b/src/arch/arm64/cpu.h
@@ -0,0 +1,204 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+#ifndef __ARCH_CPU_H__
+#define __ARCH_CPU_H__
+
+#define asmlinkage
+
+#if !defined(__PRE_RAM__)
+#include <arch/barrier.h>
+#include <arch/mpidr.h>
+#include <device/device.h>
+
+enum {
+ CPU_ID_END = 0x00000000,
+};
+
+struct cpu_device_id {
+ uint32_t midr;
+};
+
+struct cpu_driver {
+ /* This is excessive as init() is the only one called. */
+ struct device_operations *ops;
+ const struct cpu_device_id *id_table;
+};
+
+/* Action to run. */
+struct cpu_action {
+ void (*run)(void *arg);
+ void *arg;
+};
+
+/*
+ * Actions are queued to 'todo'. When picked up 'todo' is cleared. The
+ * 'completed' field is set to the original 'todo' value when the action
+ * is complete.
+ */
+struct cpu_action_queue {
+ struct cpu_action *todo;
+ struct cpu_action *completed;
+};
+
+struct cpu_info {
+ device_t cpu;
+ struct cpu_action_queue action_queue;
+ unsigned int online;
+ /* Current assumption is that id matches smp_processor_id(). */
+ unsigned int id;
+ uint64_t mpidr;
+};
+
+/* Obtain cpu_info for current executing CPU. */
+struct cpu_info *cpu_info(void);
+
+extern struct cpu_info *bsp_cpu_info;
+extern struct cpu_info cpu_infos[CONFIG_MAX_CPUS];
+
+static inline struct cpu_info *cpu_info_for_cpu(unsigned int id)
+{
+ return &cpu_infos[id];
+}
+
+/* Ran only by BSP at initial boot strapping. */
+static inline void cpu_set_bsp(void)
+{
+ bsp_cpu_info = cpu_info();
+}
+
+static inline int cpu_is_bsp(void)
+{
+ return cpu_info() == bsp_cpu_info;
+}
+
+static inline int cpu_online(struct cpu_info *ci)
+{
+ return load_acquire(&ci->online) != 0;
+}
+
+static inline void cpu_mark_online(struct cpu_info *ci)
+{
+ ci->mpidr = read_affinity_mpidr();
+ store_release(&ci->online, 1);
+}
+
+/* Provide number of CPUs online. */
+size_t cpus_online(void);
+
+/* Control routines for starting CPUs. */
+struct cpu_control_ops {
+ /* Return the maximum number of CPUs supported. */
+ size_t (*total_cpus)(void);
+ /*
+ * Start the requested CPU and have it start running entry().
+ * Returns 0 on success, < 0 on error.
+ */
+ int (*start_cpu)(unsigned int id, void (*entry)(void));
+};
+
+/*
+ * Initialize all DEVICE_PATH_CPUS under the DEVICE_PATH_CPU_CLUSTER cluster.
+ * type DEVICE_PATH_CPUS. Start up is controlled by cntrl_ops.
+ */
+void arch_initialize_cpus(device_t cluster, struct cpu_control_ops *cntrl_ops);
+
+/*
+ * Run cpu_action returning < 0 on error, 0 on success. There are synchronous
+ * and asynchronous methods. Both cases ensure the action has been picked up
+ * by the target cpu. The synchronous variants will wait for the action to
+ * be completed before returning.
+ *
+ * Though the current implementation allows queuing actions on the main cpu,
+ * the main cpu doesn't process its own queue.
+ */
+int arch_run_on_cpu(unsigned int cpu, struct cpu_action *action);
+int arch_run_on_all_cpus(struct cpu_action *action);
+int arch_run_on_all_cpus_but_self(struct cpu_action *action);
+int arch_run_on_cpu_async(unsigned int cpu, struct cpu_action *action);
+int arch_run_on_all_cpus_async(struct cpu_action *action);
+int arch_run_on_all_cpus_but_self_async(struct cpu_action *action);
+
+/* Wait for actions to be perfomed. */
+void arch_cpu_wait_for_action(void);
+
+#endif /* !__PRE_RAM__ */
+
+/*
+ * Returns logical cpu in range [0:MAX_CPUS). SoC should define this.
+ * Additionally, this is needed early in arm64 init so it should not
+ * rely on a stack. Standard clobber list is fair game: x0-x7 and x0
+ * returns the logical cpu number.
+ */
+unsigned int smp_processor_id(void);
+
+/*
+ * Stages and rmodules have 2 entry points: BSP and non-BSP. Provided
+ * a pointer the correct non-BSP entry point will be returned. The
+ * first instruction is for BSP and the 2nd is for non-BSP. Instructions
+ * are all 32-bit on arm64.
+ */
+static inline void *secondary_entry_point(void *e)
+{
+ uintptr_t nonbsp = (uintptr_t)e;
+
+ return (void *)(nonbsp + sizeof(uint32_t));
+}
+
+/*
+ * The arm64_cpu_startup() initializes a CPU's exception stack and regular
+ * stack as well initializing the C environment for the processor. It
+ * calls into the array of function pointers at symbol c_entry depending
+ * on BSP state. Note that arm64_cpu_startup contains secondary entry
+ * point which can be obtained by secondary_entry_point().
+ */
+void arm64_cpu_startup(void);
+
+/*
+ * The arm64_cpu_startup_resume() initializes a CPU's exception stack and
+ * regular stack as well initializing the C environment for the processor. It
+ * calls into the array of function pointers at symbol c_entry depending
+ * on BSP state. Note that arm64_cpu_startup contains secondary entry
+ * point which can be obtained by secondary_entry_point().
+ * Additionally, it also restores saved register data and enables MMU, caches
+ * and exceptions before jumping to C environment for both BSP and non-BSP CPUs.
+ */
+void arm64_cpu_startup_resume(void);
+
+/*
+ * The arm64_arch_timer_init() initializes the per CPU's cntfrq register of
+ * ARM arch timer.
+ */
+void arm64_arch_timer_init(void);
+
+/*
+ * The cortex_a57_cpu_power_down sequence as per A57/A53/A72 TRM.
+ * L2 flush by HW(0) or SW(1), if system/HW driven L2 flush is supported.
+ */
+#define NO_L2_FLUSH 0
+#define L2_FLUSH_HW 0
+#define L2_FLUSH_SW 1
+
+#if IS_ENABLED(CONFIG_ARCH_ARM64_CORTEX_A57_POWER_DOWN_SUPPORT)
+void cortex_a57_cpu_power_down(int l2_flush);
+#else
+static inline void cortex_a57_cpu_power_down(int l2_flush) {}
+#endif
+
+#endif /* __ARCH_CPU_H__ */
diff --git a/src/arch/arm64/include/arch/cpu.h b/src/arch/arm64/include/arch/cpu.h
new file mode 100644
index 0000000..ae16fa1
--- /dev/null
+++ b/src/arch/arm64/include/arch/cpu.h
@@ -0,0 +1,204 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+#ifndef __ARCH_CPU_H__
+#define __ARCH_CPU_H__
+
+#define asmlinkage
+
+#if !defined(__PRE_RAM__)
+#include <arch/barrier.h>
+#include <arch/mpidr.h>
+#include <device/device.h>
+
+enum {
+ CPU_ID_END = 0x00000000,
+};
+
+struct cpu_device_id {
+ uint32_t midr;
+};
+
+struct cpu_driver {
+ /* This is excessive as init() is the only one called. */
+ struct device_operations *ops;
+ const struct cpu_device_id *id_table;
+};
+
+/* Action to run. */
+struct cpu_action {
+ void (*run)(void *arg);
+ void *arg;
+};
+
+/*
+ * Actions are queued to 'todo'. When picked up 'todo' is cleared. The
+ * 'completed' field is set to the original 'todo' value when the action
+ * is complete.
+ */
+struct cpu_action_queue {
+ struct cpu_action *todo;
+ struct cpu_action *completed;
+};
+
+struct cpu_info {
+ device_t cpu;
+ struct cpu_action_queue action_queue;
+ unsigned int online;
+ /* Current assumption is that id matches smp_processor_id(). */
+ unsigned int id;
+ uint64_t mpidr;
+};
+
+/* Obtain cpu_info for current executing CPU. */
+struct cpu_info *cpu_info(void);
+
+extern struct cpu_info *bsp_cpu_info;
+extern struct cpu_info cpu_infos[CONFIG_MAX_CPUS];
+
+static inline struct cpu_info *cpu_info_for_cpu(unsigned int id)
+{
+ return &cpu_infos[id];
+}
+
+/* Ran only by BSP at initial boot strapping. */
+static inline void cpu_set_bsp(void)
+{
+ bsp_cpu_info = cpu_info();
+}
+
+static inline int cpu_is_bsp(void)
+{
+ return cpu_info() == bsp_cpu_info;
+}
+
+static inline int cpu_online(struct cpu_info *ci)
+{
+ return load_acquire(&ci->online) != 0;
+}
+
+static inline void cpu_mark_online(struct cpu_info *ci)
+{
+ ci->mpidr = read_affinity_mpidr();
+ store_release(&ci->online, 1);
+}
+
+/* Provide number of CPUs online. */
+size_t cpus_online(void);
+
+/* Control routines for starting CPUs. */
+struct cpu_control_ops {
+ /* Return the maximum number of CPUs supported. */
+ size_t (*total_cpus)(void);
+ /*
+ * Start the requested CPU and have it start running entry().
+ * Returns 0 on success, < 0 on error.
+ */
+ int (*start_cpu)(unsigned int id, void (*entry)(void));
+};
+
+/*
+ * Initialize all DEVICE_PATH_CPUS under the DEVICE_PATH_CPU_CLUSTER cluster.
+ * type DEVICE_PATH_CPUS. Start up is controlled by cntrl_ops.
+ */
+void arch_initialize_cpus(device_t cluster, struct cpu_control_ops *cntrl_ops);
+
+/*
+ * Run cpu_action returning < 0 on error, 0 on success. There are synchronous
+ * and asynchronous methods. Both cases ensure the action has been picked up
+ * by the target cpu. The synchronous variants will wait for the action to
+ * be completed before returning.
+ *
+ * Though the current implementation allows queuing actions on the main cpu,
+ * the main cpu doesn't process its own queue.
+ */
+int arch_run_on_cpu(unsigned int cpu, struct cpu_action *action);
+int arch_run_on_all_cpus(struct cpu_action *action);
+int arch_run_on_all_cpus_but_self(struct cpu_action *action);
+int arch_run_on_cpu_async(unsigned int cpu, struct cpu_action *action);
+int arch_run_on_all_cpus_async(struct cpu_action *action);
+int arch_run_on_all_cpus_but_self_async(struct cpu_action *action);
+
+/* Wait for actions to be perfomed. */
+void arch_cpu_wait_for_action(void);
+
+#endif /* !__PRE_RAM__ */
+
+/*
+ * Returns logical cpu in range [0:MAX_CPUS). SoC should define this.
+ * Additionally, this is needed early in arm64 init so it should not
+ * rely on a stack. Standard clobber list is fair game: x0-x7 and x0
+ * returns the logical cpu number.
+ */
+unsigned int smp_processor_id(void);
+
+/*
+ * Stages and rmodules have 2 entry points: BSP and non-BSP. Provided
+ * a pointer the correct non-BSP entry point will be returned. The
+ * first instruction is for BSP and the 2nd is for non-BSP. Instructions
+ * are all 32-bit on arm64.
+ */
+static inline void *secondary_entry_point(void *e)
+{
+ uintptr_t nonbsp = (uintptr_t)e;
+
+ return (void *)(nonbsp + sizeof(uint32_t));
+}
+
+/*
+ * The arm64_cpu_startup() initializes a CPU's exception stack and regular
+ * stack as well initializing the C environment for the processor. It
+ * calls into the array of function pointers at symbol c_entry depending
+ * on BSP state. Note that arm64_cpu_startup contains secondary entry
+ * point which can be obtained by secondary_entry_point().
+ */
+void arm64_cpu_startup(void);
+
+/*
+ * The arm64_cpu_startup_resume() initializes a CPU's exception stack and
+ * regular stack as well initializing the C environment for the processor. It
+ * calls into the array of function pointers at symbol c_entry depending
+ * on BSP state. Note that arm64_cpu_startup contains secondary entry
+ * point which can be obtained by secondary_entry_point().
+ * Additionally, it also restores saved register data and enables MMU, caches
+ * and exceptions before jumping to C environment for both BSP and non-BSP CPUs.
+ */
+void arm64_cpu_startup_resume(void);
+
+/*
+ * The arm64_arch_timer_init() initializes the per CPU's cntfrq register of
+ * ARM arch timer.
+ */
+void arm64_arch_timer_init(void);
+
+/*
+ * The cortex_a57_cpu_power_down sequence as per A57/A53/A72 TRM.
+ * L2 flush by HW(0) or SW(1), if system/HW driven L2 flush is supported.
+ */
+#define NO_L2_FLUSH 0
+#define L2_FLUSH_HW 0
+#define L2_FLUSH_SW 1
+
+#if IS_ENABLED(CONFIG_ARCH_ARM64_CORTEX_A57_POWER_DOWN_SUPPORT)
+void cortex_a57_cpu_power_down(int l2_flush);
+#else
+static inline void cortex_a57_cpu_power_down(int l2_flush) {}
+#endif
+
+#endif /* __ARCH_CPU_H__ */
diff --git a/src/arch/arm64/include/armv8/arch/secmon.h b/src/arch/arm64/include/armv8/arch/secmon.h
index f8351b5..6458893 100644
--- a/src/arch/arm64/include/armv8/arch/secmon.h
+++ b/src/arch/arm64/include/armv8/arch/secmon.h
@@ -24,8 +24,8 @@
struct secmon_params {
size_t online_cpus;
- struct cpu_action bsp;
- struct cpu_action secondary;
+ struct cpu_action *bsp;
+ struct cpu_action *secondary;
};
void secmon_run(void (*entry)(void *), void *arg);
diff --git a/src/cpu/armltd/armv8/Kconfig b/src/cpu/armltd/armv8/Kconfig
new file mode 100644
index 0000000..e73980c
--- /dev/null
+++ b/src/cpu/armltd/armv8/Kconfig
@@ -0,0 +1,11 @@
+config CPU_ARMLTD_ARMV8
+ bool
+ select ARCH_BOOTBLOCK_ARMV8_64
+ select ARCH_VERSTAGE_ARMV8_64
+ select ARCH_ROMSTAGE_ARMV8_64
+ select ARCH_RAMSTAGE_ARMV8_64
+ default n
+
+if CPU_ARMLTD_ARMV8
+
+endif
diff --git a/src/mainboard/emulation/qemu-armv8/Kconfig b/src/mainboard/emulation/qemu-armv8/Kconfig
new file mode 100644
index 0000000..f1ef32b
--- /dev/null
+++ b/src/mainboard/emulation/qemu-armv8/Kconfig
@@ -0,0 +1,57 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2015, Naman Govil <namangov(a)gmail.com>
+##
+## This software is licensed under the terms of the GNU General Public
+## License version 2, as published by the Free Software Foundation, and
+## may be copied, distributed, and modified under those terms.
+##
+## 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.
+
+# WRITE THE INSTRUCTIONS TO EXECUTE
+# To execute, do:
+# export QEMU_AUDIO_DRV=none
+# qemu-system-arm -M vexpress-a9 -m 1024M -nographic -kernel build/coreboot.rom
+
+if BOARD_EMULATION_QEMU_ARMV8
+
+config BOARD_SPECIFIC_OPTIONS # dummy
+ def_bool y
+ select ARCH_ARM64_CPU_CORTEX_A57
+ select ARCH_ARM64_CORTEX_A57_POWER_DOWN_SUPPORT
+ select DRIVERS_UART_PL011
+ select BOOTBLOCK_CONSOLE
+ select EARLY_CONSOLE
+ select CONSOLE_SERIAL
+ select ARCH_BOOTBLOCK_ARMV8_64
+ select ARCH_VERSTAGE_ARMV8_64
+ select ARCH_ROMSTAGE_ARMV8_64
+ select ARCH_RAMSTAGE_ARMV8_64
+ select BOARD_ROMSIZE_KB_4096
+
+
+config MAINBOARD_DIR
+ string
+ default emulation/qemu-armv8
+
+config MAINBOARD_PART_NUMBER
+ string
+ default "QEMU ARMv8"
+
+config MAX_CPUS
+ int
+ default 2
+
+config MAINBOARD_VENDOR
+ string
+ default "ARM Ltd."
+
+config DRAM_SIZE_MB
+ int
+ default 1024
+
+endif # BOARD_EMULATION_QEMU_ARMV8
diff --git a/src/mainboard/emulation/qemu-armv8/Kconfig.name b/src/mainboard/emulation/qemu-armv8/Kconfig.name
new file mode 100644
index 0000000..bb3a0e4
--- /dev/null
+++ b/src/mainboard/emulation/qemu-armv8/Kconfig.name
@@ -0,0 +1,2 @@
+config BOARD_EMULATION_QEMU_ARMV8
+ bool "QEMU armv8"
diff --git a/src/mainboard/emulation/qemu-armv8/Makefile.inc b/src/mainboard/emulation/qemu-armv8/Makefile.inc
new file mode 100644
index 0000000..7fa8880
--- /dev/null
+++ b/src/mainboard/emulation/qemu-armv8/Makefile.inc
@@ -0,0 +1,40 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2013 Google Inc.
+## Copyright (C) 2015, Naman Govil <namangov(a)gmail.com>
+##
+## This software is licensed under the terms of the GNU General Public
+## License version 2, as published by the Free Software Foundation, and
+## may be copied, distributed, and modified under those terms.
+##
+## 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.
+
+romstage-y += romstage.c
+
+romstage-y += cbmem.c
+ramstage-y += cbmem.c
+
+bootblock-y += media.c
+romstage-y += media.c
+ramstage-y += media.c
+
+bootblock-y += timer.c
+romstage-y += timer.c
+ramstage-y += timer.c
+
+bootblock-y += uart.c
+romstage-y += uart.c
+ramstage-y += uart.c
+
+bootblock-y += memlayout.ld
+romstage-y += memlayout.ld
+ramstage-y += memlayout.ld
+
+bootblock-y += cpu_lib.S
+romstage-y += cpu_lib.S
+ramstage-y += cpu_lib.S
+
diff --git a/src/mainboard/emulation/qemu-armv8/board_info.txt b/src/mainboard/emulation/qemu-armv8/board_info.txt
new file mode 100644
index 0000000..69c5eb6
--- /dev/null
+++ b/src/mainboard/emulation/qemu-armv8/board_info.txt
@@ -0,0 +1,3 @@
+Board name: QEMU armv8
+Category: emulation
+Board URL: http://fabrice.bellard.free.fr/qemu/
diff --git a/src/mainboard/emulation/qemu-armv8/bootblock-common.h b/src/mainboard/emulation/qemu-armv8/bootblock-common.h
new file mode 100644
index 0000000..09cff10
--- /dev/null
+++ b/src/mainboard/emulation/qemu-armv8/bootblock-common.h
@@ -0,0 +1,19 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 Naman Govil, <namangov(a)gmail.com>
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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 <stdlib.h>
+#include <console/console.h>
+
+void bootblock_cpu_init(void);
diff --git a/src/mainboard/emulation/qemu-armv8/bootblock.c b/src/mainboard/emulation/qemu-armv8/bootblock.c
new file mode 100644
index 0000000..d198a43
--- /dev/null
+++ b/src/mainboard/emulation/qemu-armv8/bootblock.c
@@ -0,0 +1,22 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 Naman Govil, <namangov(a)gmail.com>
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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 <stdlib.h>
+#include <console/console.h>
+#include "bootblock-common.h"
+
+void bootblock_cpu_init(void)
+{
+}
diff --git a/src/mainboard/emulation/qemu-armv8/cbmem.c b/src/mainboard/emulation/qemu-armv8/cbmem.c
new file mode 100644
index 0000000..d3a2d6f
--- /dev/null
+++ b/src/mainboard/emulation/qemu-armv8/cbmem.c
@@ -0,0 +1,25 @@
+/*
+ * 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 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.
+ */
+
+#include <stddef.h>
+#include <cbmem.h>
+#include <symbols.h>
+
+void *cbmem_top(void)
+{
+ return _dram + (CONFIG_DRAM_SIZE_MB << 20);
+}
diff --git a/src/mainboard/emulation/qemu-armv8/cpu_lib.S b/src/mainboard/emulation/qemu-armv8/cpu_lib.S
new file mode 100644
index 0000000..13eed4b
--- /dev/null
+++ b/src/mainboard/emulation/qemu-armv8/cpu_lib.S
@@ -0,0 +1,29 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2014 Google Inc.
+ * Copyright 2015, Naman Govil <namangov(a)gmail.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; 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.
+ */
+
+
+.text
+.global smp_processor_id
+smp_processor_id:
+ /* Core 0 and 1 are encoded in the Aff0 (7:0) field of MPIDR_EL1. */
+ /* Multiprocessor Afinity Register (MPIDR) contains CPU ID for a57 */
+ mrs x0, mpidr_el1
+ uxtb w0, w0
+ ret
diff --git a/src/mainboard/emulation/qemu-armv8/devicetree.cb b/src/mainboard/emulation/qemu-armv8/devicetree.cb
new file mode 100644
index 0000000..fa3c03a
--- /dev/null
+++ b/src/mainboard/emulation/qemu-armv8/devicetree.cb
@@ -0,0 +1,20 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2013 Google, Inc.
+##
+## This software is licensed under the terms of the GNU General Public
+## License version 2, as published by the Free Software Foundation, and
+## may be copied, distributed, and modified under those terms.
+##
+## 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.
+
+# TODO fill with Versatile Express board data in QEMU.
+chip cpu/armltd/armv8
+ chip drivers/generic/generic # I2C0 controller
+ device i2c 6 on end # Fake component for testing
+ end
+end
diff --git a/src/mainboard/emulation/qemu-armv8/mainboard.c b/src/mainboard/emulation/qemu-armv8/mainboard.c
new file mode 100644
index 0000000..b73ab9d
--- /dev/null
+++ b/src/mainboard/emulation/qemu-armv8/mainboard.c
@@ -0,0 +1,27 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2013 Google, Inc.
+ * Copyright (C) 2015 Naman Govil, <namangov(a)gmail.com>
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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 <device/device.h>
+
+static void mainboard_enable(device_t dev)
+{
+ printk(BIOS_INFO, "Enable qemu/armv8 device...\n");
+}
+
+struct chip_operations mainboard_ops = {
+ .enable_dev = mainboard_enable,
+};
diff --git a/src/mainboard/emulation/qemu-armv8/media.c b/src/mainboard/emulation/qemu-armv8/media.c
new file mode 100644
index 0000000..4d4edd8
--- /dev/null
+++ b/src/mainboard/emulation/qemu-armv8/media.c
@@ -0,0 +1,25 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2013 Google, Inc.
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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 <boot_device.h>
+
+/* Maps directly to qemu memory mapped space of 0x10000 up to rom size. */
+static const struct mem_region_device boot_dev =
+ MEM_REGION_DEV_INIT((void *)0x10000, CONFIG_ROM_SIZE);
+
+const struct region_device *boot_device_ro(void)
+{
+ return &boot_dev.rdev;
+}
diff --git a/src/mainboard/emulation/qemu-armv8/memlayout.ld b/src/mainboard/emulation/qemu-armv8/memlayout.ld
new file mode 100644
index 0000000..ee8132d
--- /dev/null
+++ b/src/mainboard/emulation/qemu-armv8/memlayout.ld
@@ -0,0 +1,48 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2014 Google Inc.
+ * Copyright (C )2015, Naman Govil <namangov(a)gmail.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; 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.
+ */
+
+#include <memlayout.h>
+
+#include <arch/header.ld>
+
+/*
+ * Memory map for qemu armv8:
+ *
+ * 0x0000_0000: jump instruction (required by qemu)
+ * 0x0001_0000: bootblock (entry of kernel / firmware)
+ * 0x0002_0000: romstage, assume up to 128KB in size.
+ * 0x0007_ff00: stack pointer
+ * 0x0010_0000: CBFS header
+ * 0x0011_0000: CBFS data
+ * 0x0100_0000: reserved for ramstage
+ * 0x1000_0000: I/O map address
+ */
+
+SECTIONS
+{
+ /* TODO: does this thing emulate SRAM? */
+
+ BOOTBLOCK(0x10000, 64K)
+ ROMSTAGE(0x20000, 128K)
+ STACK(0x000FC000, 16K)
+
+ DRAM_START(0x01000000)
+ RAMSTAGE(0x01000000, 16M)
+}
diff --git a/src/mainboard/emulation/qemu-armv8/romstage.c b/src/mainboard/emulation/qemu-armv8/romstage.c
new file mode 100644
index 0000000..158989f
--- /dev/null
+++ b/src/mainboard/emulation/qemu-armv8/romstage.c
@@ -0,0 +1,24 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2013 Google, Inc.
+ * Copyright (C) 2015, Naman Govil <namangov(a)gmail.com>
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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 <program_loading.h>
+
+void main(void)
+{
+ console_init();
+ run_ramstage();
+}
diff --git a/src/mainboard/emulation/qemu-armv8/timer.c b/src/mainboard/emulation/qemu-armv8/timer.c
new file mode 100644
index 0000000..b6d048b
--- /dev/null
+++ b/src/mainboard/emulation/qemu-armv8/timer.c
@@ -0,0 +1,27 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2013 Google, Inc.
+ * Copyright (C) 2015, Naman Govil <namangov(a)gmail.com>
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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.
+ */
+
+void udelay(unsigned int n);
+void udelay(unsigned int n)
+{
+ /* TODO provide delay here. */
+}
+
+int init_timer(void);
+int init_timer(void)
+{
+ return 0;
+}
diff --git a/src/mainboard/emulation/qemu-armv8/uart.c b/src/mainboard/emulation/qemu-armv8/uart.c
new file mode 100644
index 0000000..d751b15
--- /dev/null
+++ b/src/mainboard/emulation/qemu-armv8/uart.c
@@ -0,0 +1,24 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 Naman Govil, <namangov(a)gmail.com>
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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 <console/uart.h>
+
+#define UART0_IO_ADDRESS (0x90000000)
+
+uintptr_t uart_platform_base(int idx)
+{
+ return UART0_IO_ADDRESS;
+}
Naman Govil (namangov(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11371
-gerrit
commit 457f020ced283f648396fcf53c2f2ca6e5e7aaf2
Author: Naman Govil <namangov(a)gmail.com>
Date: Thu Aug 27 05:46:45 2015 +0530
Alignment Issue in arm64
The qemu-armv8 was unable to branch and link to appropriate location
(smp_processor_id) due to misalignment by 1 byte.
Change-Id: I38634cc075bfb1b72098b1dc4c9e488531f2c4e8
Signed-off-by: Naman Govil <namangov(a)gmail.com>
---
src/arch/arm64/id.S | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/arch/arm64/id.S b/src/arch/arm64/id.S
index a588f1e..b36e6f2 100644
--- a/src/arch/arm64/id.S
+++ b/src/arch/arm64/id.S
@@ -16,5 +16,6 @@ part:
.long CONFIG_ROM_SIZE /* Size of this romimage */
.globl __id_end
+ .align 2
__id_end:
.previous