aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/sh.h3
-rw-r--r--hw/sh7750.c6
-rw-r--r--hw/sh_intc.c7
-rw-r--r--hw/sh_serial.c3
-rw-r--r--hw/sh_timer.c3
5 files changed, 18 insertions, 4 deletions
diff --git a/hw/sh.h b/hw/sh.h
index 116441a7dd..5e3c22bbb9 100644
--- a/hw/sh.h
+++ b/hw/sh.h
@@ -4,6 +4,9 @@
#include "sh_intc.h"
+#define A7ADDR(x) ((x) & 0x1fffffff)
+#define P4ADDR(x) ((x) | 0xe0000000)
+
/* sh7750.c */
struct SH7750State;
diff --git a/hw/sh7750.c b/hw/sh7750.c
index afdb9f5bcb..af86f0e990 100644
--- a/hw/sh7750.c
+++ b/hw/sh7750.c
@@ -683,10 +683,16 @@ SH7750State *sh7750_init(CPUSH4State * cpu)
sh7750_mem_write, s);
cpu_register_physical_memory_offset(0x1f000000, 0x1000,
sh7750_io_memory, 0x1f000000);
+ cpu_register_physical_memory_offset(0xff000000, 0x1000,
+ sh7750_io_memory, 0x1f000000);
cpu_register_physical_memory_offset(0x1f800000, 0x1000,
sh7750_io_memory, 0x1f800000);
+ cpu_register_physical_memory_offset(0xff800000, 0x1000,
+ sh7750_io_memory, 0x1f800000);
cpu_register_physical_memory_offset(0x1fc00000, 0x1000,
sh7750_io_memory, 0x1fc00000);
+ cpu_register_physical_memory_offset(0xffc00000, 0x1000,
+ sh7750_io_memory, 0x1fc00000);
sh7750_mm_cache_and_tlb = cpu_register_io_memory(0,
sh7750_mmct_read,
diff --git a/hw/sh_intc.c b/hw/sh_intc.c
index b62633d312..7d738d16ca 100644
--- a/hw/sh_intc.c
+++ b/hw/sh_intc.c
@@ -307,9 +307,12 @@ struct intc_source *sh_intc_source(struct intc_desc *desc, intc_enum id)
static void sh_intc_register(struct intc_desc *desc,
unsigned long address)
{
- if (address)
- cpu_register_physical_memory_offset(INTC_A7(address), 4,
+ if (address) {
+ cpu_register_physical_memory_offset(P4ADDR(address), 4,
desc->iomemtype, INTC_A7(address));
+ cpu_register_physical_memory_offset(A7ADDR(address), 4,
+ desc->iomemtype, INTC_A7(address));
+ }
}
static void sh_intc_register_source(struct intc_desc *desc,
diff --git a/hw/sh_serial.c b/hw/sh_serial.c
index 8397739de9..843031e8a5 100644
--- a/hw/sh_serial.c
+++ b/hw/sh_serial.c
@@ -399,7 +399,8 @@ void sh_serial_init (target_phys_addr_t base, int feat,
s_io_memory = cpu_register_io_memory(0, sh_serial_readfn,
sh_serial_writefn, s);
- cpu_register_physical_memory(base, 0x28, s_io_memory);
+ cpu_register_physical_memory(P4ADDR(base), 0x28, s_io_memory);
+ cpu_register_physical_memory(A7ADDR(base), 0x28, s_io_memory);
s->chr = chr;
diff --git a/hw/sh_timer.c b/hw/sh_timer.c
index 4557a8354c..c5c45f50d2 100644
--- a/hw/sh_timer.c
+++ b/hw/sh_timer.c
@@ -320,6 +320,7 @@ void tmu012_init(target_phys_addr_t base, int feat, uint32_t freq,
ch2_irq0); /* ch2_irq1 not supported */
iomemtype = cpu_register_io_memory(0, tmu012_readfn,
tmu012_writefn, s);
- cpu_register_physical_memory(base, 0x00001000, iomemtype);
+ cpu_register_physical_memory(P4ADDR(base), 0x00001000, iomemtype);
+ cpu_register_physical_memory(A7ADDR(base), 0x00001000, iomemtype);
/* ??? Save/restore. */
}