@@ -26,8 +26,8 @@
#include "target/rx/cpu.h"
#include "hw/intc/rx_icu.h"
-#include "hw/timer/renesas_tmr.h"
-#include "hw/timer/renesas_cmt.h"
+#include "hw/timer/renesas_tmr8.h"
+#include "hw/timer/renesas_timer.h"
#include "hw/char/renesas_sci.h"
#include "hw/rx/rx62n-cpg.h"
#include "qemu/units.h"
@@ -56,9 +56,9 @@ struct RX62NState {
RXCPU cpu;
RXICUState icu;
- RTMRState tmr[RX62N_NR_TMR];
- RCMTState cmt[RX62N_NR_CMT];
- RSCIState sci[RX62N_NR_SCI];
+ RenesasTMR8State tmr[RX62N_NR_TMR];
+ RenesasCMTState cmt[RX62N_NR_CMT];
+ RenesasSCIState sci[RX62N_NR_SCI];
RX62NCPGState cpg;
MemoryRegion *sysmem;
@@ -164,7 +164,7 @@ static void register_tmr(RX62NState *s, int unit)
char ckname[16];
object_initialize_child(OBJECT(s), "tmr[*]",
- &s->tmr[unit], TYPE_RENESAS_TMR);
+ &s->tmr[unit], TYPE_RENESAS_TMR8);
tmr = SYS_BUS_DEVICE(&s->tmr[unit]);
irqbase = RX62N_TMR_IRQ + TMR_NR_IRQ * unit;
@@ -174,10 +174,10 @@ static void register_tmr(RX62NState *s, int unit)
sysbus_mmio_map(tmr, 0, RX62N_TMR_BASE + unit * 0x10);
qdev_prop_set_uint32(DEVICE(tmr), "unit", unit);
- sysbus_realize(tmr, &error_abort);
snprintf(ckname, sizeof(ckname), "pck_tmr8-%d", unit);
qdev_connect_clock_in(DEVICE(tmr), "pck",
qdev_get_clock_out(DEVICE(&s->cpg), ckname));
+ sysbus_realize(tmr, &error_abort);
}
static void register_cmt(RX62NState *s, int unit)
@@ -190,6 +190,9 @@ static void register_cmt(RX62NState *s, int unit)
&s->cmt[unit], TYPE_RENESAS_CMT);
cmt = SYS_BUS_DEVICE(&s->cmt[unit]);
qdev_prop_set_uint32(DEVICE(cmt), "unit", unit);
+ snprintf(ckname, sizeof(ckname), "pck_cmt-%d", unit);
+ qdev_connect_clock_in(DEVICE(cmt), "pck",
+ qdev_get_clock_out(DEVICE(&s->cpg), ckname));
irqbase = RX62N_CMT_IRQ + CMT_NR_IRQ * unit;
for (i = 0; i < CMT_NR_IRQ; i++) {
@@ -197,20 +200,23 @@ static void register_cmt(RX62NState *s, int unit)
}
sysbus_mmio_map(cmt, 0, RX62N_CMT_BASE + unit * 0x10);
sysbus_realize(cmt, &error_abort);
- snprintf(ckname, sizeof(ckname), "pck_cmt-%d", unit);
- qdev_connect_clock_in(DEVICE(cmt), "pck",
- qdev_get_clock_out(DEVICE(&s->cpg), ckname));
}
static void register_sci(RX62NState *s, int unit)
{
SysBusDevice *sci;
int i, irqbase;
+ char ckname[16];
object_initialize_child(OBJECT(s), "sci[*]",
- &s->sci[unit], TYPE_RENESAS_SCI);
+ &s->sci[unit], TYPE_RENESAS_SCIA);
sci = SYS_BUS_DEVICE(&s->sci[unit]);
qdev_prop_set_chr(DEVICE(sci), "chardev", serial_hd(unit));
+ qdev_prop_set_uint32(DEVICE(sci), "unit", unit);
+ qdev_prop_set_uint32(DEVICE(sci), "register-size", SCI_REGSIZE_8);
+ snprintf(ckname, sizeof(ckname), "pck_sci-%d", unit);
+ qdev_connect_clock_in(DEVICE(sci), "pck",
+ qdev_get_clock_out(DEVICE(&s->cpg), ckname));
sysbus_realize(sci, &error_abort);
irqbase = RX62N_SCI_IRQ + SCI_NR_IRQ * unit;
@@ -1,8 +1,8 @@
config RX62N_MCU
bool
select RX_ICU
- select RENESAS_TMR
- select RENESAS_CMT
+ select RENESAS_TMR8
+ select RENESAS_TIMER
select RENESAS_SCI
config RX_GDBSIM
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> --- include/hw/rx/rx62n.h | 10 +++++----- hw/rx/rx62n.c | 18 ++++++++++++------ hw/rx/Kconfig | 4 ++-- 3 files changed, 19 insertions(+), 13 deletions(-)