qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [Patch] ARM: Add an L2 cache controller to KZM
@ 2013-08-05  1:21 Peter Chubb
  2013-08-05  9:18 ` Peter Maydell
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Chubb @ 2013-08-05  1:21 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel


Reads to unassigned memory now return non-zero (since patch
9b8c69243585).  This breaks guests runnong on i.MX31 that use the
cache controller --- they poll forever waiting for the L2CC cache
invalidate regsiter to be zero.

This patch adds in an L2 cache controller.  It's not quite right ---
it reuses the PL2x0 implementation that  is already in QEMU.  The
differences however are minor --- a different ID, a different initial
value for the aux control register (because Freescale have used
some of the reserved bits), and the pl2x0 implements registers that
are not present in the Freescale cache controller.

Signed-off-by: Peter Chubb <peter.chubb@nicta.com.au>

diff --git a/hw/arm/kzm.c b/hw/arm/kzm.c
index bd6c05c..018fc81 100644
--- a/hw/arm/kzm.c
+++ b/hw/arm/kzm.c
@@ -33,6 +33,7 @@
      * 0x1fffc000-0x1fffffff RAM                  EMULATED
      * 0x20000000-0x2fffffff Reserved             IGNORED
      * 0x30000000-0x7fffffff I.MX31 Internal Register Space
+     *   0x30000000-0x30000fff L2 Cache Controller PARTIALLY EMULATED
      *   0x43f00000 IO_AREA0
      *   0x43f90000 UART1                         EMULATED
      *   0x43f94000 UART2                         EMULATED
@@ -134,6 +135,15 @@ static void kzm_init(QEMUMachineInitArgs *args)
                        DEVICE_NATIVE_ENDIAN);
     }
 
+    /*
+     * The i.MX L2CC  is almost the same as the PL210
+     * except for a different ID (the implementor bits are different)
+     * and the `reserved' bits in the auxilliary control register
+     * are implemented.  The l2x0 qemu implementation is for a superset
+     * of the PL210.
+     */
+    sysbus_create_varargs("l2x0", 0x30000000, NULL);
+
     kzm_binfo.ram_size = ram_size;
     kzm_binfo.kernel_filename = kernel_filename;
     kzm_binfo.kernel_cmdline = kernel_cmdline;


--
Dr Peter Chubb				        peter.chubb AT nicta.com.au
http://www.ssrg.nicta.com.au          Software Systems Research Group/NICTA

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-08-07  2:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-05  1:21 [Qemu-devel] [Patch] ARM: Add an L2 cache controller to KZM Peter Chubb
2013-08-05  9:18 ` Peter Maydell
2013-08-05  9:24   ` Andreas Färber
2013-08-06  0:00     ` peter
2013-08-06  8:27       ` Andreas Färber
2013-08-07  2:21         ` Peter Chubb
2013-08-06  0:53     ` Peter Chubb
2013-08-05 23:31   ` Peter Chubb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).