All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: u-boot@lists.denx.de
Subject: [PATCH v2 3/5] arm: qemu: implement enable_caches()
Date: Thu, 11 Jun 2020 10:17:05 +0200	[thread overview]
Message-ID: <20200611081707.195994-4-ardb@kernel.org> (raw)
In-Reply-To: <20200611081707.195994-1-ardb@kernel.org>

Add an override for enable_caches to enable the I and D caches, along
with the cached 1:1 mapping of all of DRAM. This is needed for running
U-Boot under virtualization with QEMU/kvm.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 board/emulation/qemu-arm/qemu-arm.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/board/emulation/qemu-arm/qemu-arm.c b/board/emulation/qemu-arm/qemu-arm.c
index 69e8ef46f1f5..1b0d543b93c1 100644
--- a/board/emulation/qemu-arm/qemu-arm.c
+++ b/board/emulation/qemu-arm/qemu-arm.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <fdtdec.h>
 #include <init.h>
@@ -94,6 +95,12 @@ void *board_fdt_blob_setup(void)
 	return (void *)CONFIG_SYS_SDRAM_BASE;
 }
 
+void enable_caches(void)
+{
+	 icache_enable();
+	 dcache_enable();
+}
+
 #if defined(CONFIG_EFI_RNG_PROTOCOL)
 #include <efi_loader.h>
 #include <efi_rng.h>
-- 
2.26.2

  parent reply	other threads:[~2020-06-11  8:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11  8:17 [PATCH v2 0/5] Fixes for running U-boot under QEMU/KVM Ard Biesheuvel
2020-06-11  8:17 ` [PATCH v2 1/5] arm: enable allocate-on-read for LPAE's DCACHE_WRITEBACK/_WRITETHROUGH Ard Biesheuvel
2020-06-11  8:17 ` [PATCH v2 2/5] arm: qemu: enable LPAE on 32-bit Ard Biesheuvel
2020-06-11  8:17 ` Ard Biesheuvel [this message]
2020-06-11  8:17 ` [PATCH v2 4/5] arm: qemu: disable the EFI workaround for older GRUB Ard Biesheuvel
2020-06-11  8:17 ` [PATCH v2 5/5] arm: qemu: override flash accessors to use virtualizable instructions Ard Biesheuvel
2020-06-13 21:45   ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200611081707.195994-4-ardb@kernel.org \
    --to=ardb@kernel.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.