diff mbox series

[2/3] hw/rx: rx62n switch renesas_timer.

Message ID 20210623123416.60038-3-ysato@users.sourceforge.jp
State New
Headers show
Series Integrate renesas MCU/SoC timer module | expand

Commit Message

Yoshinori Sato June 23, 2021, 12:34 p.m. UTC
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
 include/hw/rx/rx62n.h | 4 ++--
 hw/rx/Kconfig         | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Philippe Mathieu-Daudé June 24, 2021, 9:01 a.m. UTC | #1
Hi Yoshinori,

On 6/23/21 2:34 PM, Yoshinori Sato wrote:
> Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
> ---
>  include/hw/rx/rx62n.h | 4 ++--
>  hw/rx/Kconfig         | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/include/hw/rx/rx62n.h b/include/hw/rx/rx62n.h
> index 3ed80dba0d..c35bf3998c 100644
> --- a/include/hw/rx/rx62n.h
> +++ b/include/hw/rx/rx62n.h
> @@ -27,7 +27,7 @@
>  #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_timer.h"
>  #include "hw/char/renesas_sci.h"
>  #include "qemu/units.h"
>  #include "qom/object.h"
> @@ -56,7 +56,7 @@ struct RX62NState {
>      RXCPU cpu;
>      RXICUState icu;
>      RTMRState tmr[RX62N_NR_TMR];
> -    RCMTState cmt[RX62N_NR_CMT];
> +    RenesasCMTState cmt[RX62N_NR_CMT];
>      RSCIState sci[RX62N_NR_SCI];
>  
>      MemoryRegion *sysmem;
> diff --git a/hw/rx/Kconfig b/hw/rx/Kconfig
> index 2b297c5a6a..f9cb892633 100644
> --- a/hw/rx/Kconfig
> +++ b/hw/rx/Kconfig
> @@ -2,7 +2,7 @@ config RX62N_MCU
>      bool
>      select RX_ICU
>      select RENESAS_TMR
> -    select RENESAS_CMT
> +    select RENESAS_TIMER
>      select RENESAS_SCI
>  
>  config RX_GDBSIM
> 

I am confused, your patch seems incomplete... missing:

-- >8 --
diff --git a/include/hw/rx/rx62n.h b/include/hw/rx/rx62n.h
index c35bf3998c7..a34b845e1e7 100644
--- a/include/hw/rx/rx62n.h
+++ b/include/hw/rx/rx62n.h
@@ -26,7 +26,6 @@

 #include "target/rx/cpu.h"
 #include "hw/intc/rx_icu.h"
-#include "hw/timer/renesas_tmr.h"
 #include "hw/timer/renesas_timer.h"
 #include "hw/char/renesas_sci.h"
 #include "qemu/units.h"
@@ -55,7 +54,7 @@ struct RX62NState {

     RXCPU cpu;
     RXICUState icu;
-    RTMRState tmr[RX62N_NR_TMR];
+    RenesasTMUState tmr[RX62N_NR_TMR];
     RenesasCMTState cmt[RX62N_NR_CMT];
     RSCIState sci[RX62N_NR_SCI];

diff --git a/include/hw/timer/renesas_timer.h
b/include/hw/timer/renesas_timer.h
index dc0711ba832..ccf2e64b702 100644
--- a/include/hw/timer/renesas_timer.h
+++ b/include/hw/timer/renesas_timer.h
@@ -30,6 +30,7 @@ enum {

 enum {
     CMT_NR_IRQ = 1 * TIMER_CH_CMT,
+    TMU_NR_IRQ = 1 * TIMER_CH_TMU,
 };

 enum {

diff --git a/hw/rx/rx62n.c b/hw/rx/rx62n.c
index fa5add9f9db..626d027a2db 100644
--- a/hw/rx/rx62n.c
+++ b/hw/rx/rx62n.c
@@ -163,13 +163,13 @@ static void register_tmr(RX62NState *s, int unit)
     int i, irqbase;

     object_initialize_child(OBJECT(s), "tmr[*]",
-                            &s->tmr[unit], TYPE_RENESAS_TMR);
+                            &s->tmr[unit], TYPE_RENESAS_TMU);
     tmr = SYS_BUS_DEVICE(&s->tmr[unit]);
     qdev_prop_set_uint64(DEVICE(tmr), "input-freq", s->pclk_freq_hz);
     sysbus_realize(tmr, &error_abort);

-    irqbase = RX62N_TMR_IRQ + TMR_NR_IRQ * unit;
-    for (i = 0; i < TMR_NR_IRQ; i++) {
+    irqbase = RX62N_TMR_IRQ + TMU_NR_IRQ * unit;
+    for (i = 0; i < TMU_NR_IRQ; i++) {
         sysbus_connect_irq(tmr, i, s->irq[irqbase + i]);
     }
     sysbus_mmio_map(tmr, 0, RX62N_TMR_BASE + unit * 0x10);
---

Have I misunderstood the point of your series?

Regards,

Phil.
diff mbox series

Patch

diff --git a/include/hw/rx/rx62n.h b/include/hw/rx/rx62n.h
index 3ed80dba0d..c35bf3998c 100644
--- a/include/hw/rx/rx62n.h
+++ b/include/hw/rx/rx62n.h
@@ -27,7 +27,7 @@ 
 #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_timer.h"
 #include "hw/char/renesas_sci.h"
 #include "qemu/units.h"
 #include "qom/object.h"
@@ -56,7 +56,7 @@  struct RX62NState {
     RXCPU cpu;
     RXICUState icu;
     RTMRState tmr[RX62N_NR_TMR];
-    RCMTState cmt[RX62N_NR_CMT];
+    RenesasCMTState cmt[RX62N_NR_CMT];
     RSCIState sci[RX62N_NR_SCI];
 
     MemoryRegion *sysmem;
diff --git a/hw/rx/Kconfig b/hw/rx/Kconfig
index 2b297c5a6a..f9cb892633 100644
--- a/hw/rx/Kconfig
+++ b/hw/rx/Kconfig
@@ -2,7 +2,7 @@  config RX62N_MCU
     bool
     select RX_ICU
     select RENESAS_TMR
-    select RENESAS_CMT
+    select RENESAS_TIMER
     select RENESAS_SCI
 
 config RX_GDBSIM