From nobody Sat Sep 21 02:52:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1622093192; cv=none; d=zohomail.com; s=zohoarc; b=jCUrgvxIbcABmlGPToT+QoWLfgMmrO9g2pxDiYbcKfJuJal3gi15epzErrPX6irDkFccPZq51tGohVkCj9ckxVANstRjvA7JvgEPqKiq8VMuj9CKL+ifE9nlT6BhJxPxx4pl7THrdWDxcWEMPCAAzBT2Ykf+uDBPAP35unr4ZDU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622093192; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=j1Mir4Hr9Hv5wTgwOHetkWDylgxn7ZV3ES6pY5AXAYo=; b=bomObJQ1ejk5dcyfYH5WFlQ30k1tAg99Pcw1/+lY6DQaPIDP5h00UpWMaNNk/ucheUQI4nwbxok9z5SBApjM2/ssA4c1wgpi8DzzaacEbEZQaBQXjh1hjXo1e24/Vc6aiXDqmNMdmn4UQauluY4jDhFc/EK5YDuB9/UbNKUxaDs= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622093192862665.7854356611207; Wed, 26 May 2021 22:26:32 -0700 (PDT) Received: from localhost ([::1]:47640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lm8XP-0008Px-QK for importer@patchew.org; Thu, 27 May 2021 01:26:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lm8Si-0008P3-83 for qemu-devel@nongnu.org; Thu, 27 May 2021 01:21:40 -0400 Received: from mail03.asahi-net.or.jp ([202.224.55.15]:32938) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lm8Sc-00066C-97 for qemu-devel@nongnu.org; Thu, 27 May 2021 01:21:39 -0400 Received: from sakura.ysato.name (ik1-413-38519.vs.sakura.ne.jp [153.127.30.23]) (Authenticated sender: PQ4Y-STU) by mail03.asahi-net.or.jp (Postfix) with ESMTPA id 41FEC385BB; Thu, 27 May 2021 14:21:32 +0900 (JST) Received: from yo-satoh-debian.localdomain (y245018.dynamic.ppp.asahi-net.or.jp [118.243.245.18]) by sakura.ysato.name (Postfix) with ESMTPSA id D82651C0077; Thu, 27 May 2021 14:21:31 +0900 (JST) From: Yoshinori Sato To: qemu-devel@nongnu.org Subject: [PATCH 08/11] hw/rx: rx62n use new hw modules. Date: Thu, 27 May 2021 14:21:19 +0900 Message-Id: <20210527052122.97103-9-ysato@users.sourceforge.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210527052122.97103-1-ysato@users.sourceforge.jp> References: <20210527052122.97103-1-ysato@users.sourceforge.jp> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: softfail client-ip=202.224.55.15; envelope-from=ysato@users.sourceforge.jp; helo=mail03.asahi-net.or.jp X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yoshinori Sato Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Signed-off-by: Yoshinori Sato --- include/hw/rx/rx62n.h | 10 +++++----- hw/rx/rx62n.c | 18 ++++++++++++------ hw/rx/Kconfig | 4 ++-- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/include/hw/rx/rx62n.h b/include/hw/rx/rx62n.h index 44f5fcc74d..942ed0639f 100644 --- a/include/hw/rx/rx62n.h +++ b/include/hw/rx/rx62n.h @@ -26,8 +26,8 @@ =20 #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 { =20 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; =20 MemoryRegion *sysmem; diff --git a/hw/rx/rx62n.c b/hw/rx/rx62n.c index cfd41930bf..58eff0b4a3 100644 --- a/hw/rx/rx62n.c +++ b/hw/rx/rx62n.c @@ -164,7 +164,7 @@ static void register_tmr(RX62NState *s, int unit) char ckname[16]; =20 object_initialize_child(OBJECT(s), "tmr[*]", - &s->tmr[unit], TYPE_RENESAS_TMR); + &s->tmr[unit], TYPE_RENESAS_TMR8); tmr =3D SYS_BUS_DEVICE(&s->tmr[unit]); =20 irqbase =3D 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); =20 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); } =20 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 =3D 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)); =20 irqbase =3D RX62N_CMT_IRQ + CMT_NR_IRQ * unit; for (i =3D 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)); } =20 static void register_sci(RX62NState *s, int unit) { SysBusDevice *sci; int i, irqbase; + char ckname[16]; =20 object_initialize_child(OBJECT(s), "sci[*]", - &s->sci[unit], TYPE_RENESAS_SCI); + &s->sci[unit], TYPE_RENESAS_SCIA); sci =3D 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); =20 irqbase =3D RX62N_SCI_IRQ + SCI_NR_IRQ * unit; diff --git a/hw/rx/Kconfig b/hw/rx/Kconfig index 2b297c5a6a..9cd1082623 100644 --- a/hw/rx/Kconfig +++ b/hw/rx/Kconfig @@ -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 =20 config RX_GDBSIM --=20 2.20.1