diff mbox series

[RFC,2/4] !fixup hw/rx: rx62n switch renesas_timer.

Message ID 20210624092336.1078504-3-f4bug@amsat.org (mailing list archive)
State New, archived
Headers show
Series Integrate renesas MCU/SoC timer module [part 2 from review] | expand

Commit Message

Philippe Mathieu-Daudé June 24, 2021, 9:23 a.m. UTC
Fixup while reviewing.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/rx/rx62n.h | 3 +--
 hw/rx/rx62n.c         | 6 +++---
 hw/rx/Kconfig         | 1 -
 3 files changed, 4 insertions(+), 6 deletions(-)

Comments

Yoshinori Sato June 25, 2021, 2:02 p.m. UTC | #1
On Thu, 24 Jun 2021 18:23:34 +0900,
Philippe Mathieu-Daudé wrote:
> 
> Fixup while reviewing.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  include/hw/rx/rx62n.h | 3 +--
>  hw/rx/rx62n.c         | 6 +++---
>  hw/rx/Kconfig         | 1 -
>  3 files changed, 4 insertions(+), 6 deletions(-)
> 
> 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/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);
> diff --git a/hw/rx/Kconfig b/hw/rx/Kconfig
> index f9cb892633a..845ef416e38 100644
> --- a/hw/rx/Kconfig
> +++ b/hw/rx/Kconfig
> @@ -1,7 +1,6 @@
>  config RX62N_MCU
>      bool
>      select RX_ICU
> -    select RENESAS_TMR
>      select RENESAS_TIMER
>      select RENESAS_SCI
>  
> -- 
> 2.31.1
> 
> 

The TMU and TMR are different, so the fix is not intended.
TMR is implemented in renesas_tmr.c and has not been integrated yet.
The features are also different and cannot be integrated immediately.
diff mbox series

Patch

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/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);
diff --git a/hw/rx/Kconfig b/hw/rx/Kconfig
index f9cb892633a..845ef416e38 100644
--- a/hw/rx/Kconfig
+++ b/hw/rx/Kconfig
@@ -1,7 +1,6 @@ 
 config RX62N_MCU
     bool
     select RX_ICU
-    select RENESAS_TMR
     select RENESAS_TIMER
     select RENESAS_SCI