From nobody Sun Nov 16 05:40:19 2025 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=1598532129; cv=none; d=zohomail.com; s=zohoarc; b=hiq/9j8ntdXJ+xQhd3kcuF+/v6wtALsS0W1MPmi8/+S2y1WRdUmY+HWBKK6coEjX1N8G7IcYHY0e9UQqNnLPGLEc6DYREEvPVbKqu+BepoBstFjvZr4/+SNqe5LsuGLbaMWoE54mLCw4lXTqkvnUKU0WB+xBr4vHIVk4+qpKCxo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598532129; 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=SZVcaaGgIPF0KoMQNnGwlSeWvNphOTnJAwKxb4Ua9Ng=; b=X4yYi8U0FxMCqp8yMFPT5YdC1tbka8/yxT7lT0SJSGvUS7FV/Q2VI22q4zm1CtBRAEWIkWZyRWuAwWGcQcFMZ2ygdv896sv4793qnUaCurMIrjeO8agfUo8LBS093BnZUMupt6T40XcSCkdzZnmtxko+IJJS33Q7CnVnoXp0zAU= 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 1598532129063706.7308424523835; Thu, 27 Aug 2020 05:42:09 -0700 (PDT) Received: from localhost ([::1]:50276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBHEF-0005qg-M1 for importer@patchew.org; Thu, 27 Aug 2020 08:42:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBHBV-00086e-4C for qemu-devel@nongnu.org; Thu, 27 Aug 2020 08:39:17 -0400 Received: from mail02.asahi-net.or.jp ([202.224.55.14]:56311) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBHBO-0005wY-Np for qemu-devel@nongnu.org; Thu, 27 Aug 2020 08:39:16 -0400 Received: from sakura.ysato.name (ik1-413-38519.vs.sakura.ne.jp [153.127.30.23]) (Authenticated sender: PQ4Y-STU) by mail02.asahi-net.or.jp (Postfix) with ESMTPA id BFCF72683A; Thu, 27 Aug 2020 21:39:09 +0900 (JST) Received: from yo-satoh-debian.localdomain (ZM005235.ppp.dion.ne.jp [222.8.5.235]) by sakura.ysato.name (Postfix) with ESMTPSA id 783C81C0792; Thu, 27 Aug 2020 21:39:09 +0900 (JST) From: Yoshinori Sato To: qemu-devel@nongnu.org Subject: [PATCH 19/20] hw/rx: Add CQ-FRK-RX62N target Date: Thu, 27 Aug 2020 21:38:58 +0900 Message-Id: <20200827123859.81793-20-ysato@users.sourceforge.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200827123859.81793-1-ysato@users.sourceforge.jp> References: <20200827123859.81793-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.14; envelope-from=ysato@users.sourceforge.jp; helo=mail02.asahi-net.or.jp X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/27 08:39:06 X-ACL-Warn: Detected OS = ??? 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" It most popular RX target board in Japan. Signed-off-by: Yoshinori Sato --- default-configs/rx-softmmu.mak | 1 + hw/rx/cq-frk-rx62n.c | 94 ++++++++++++++++++++++++++++++++++ hw/rx/Kconfig | 3 ++ hw/rx/meson.build | 1 + 4 files changed, 99 insertions(+) create mode 100644 hw/rx/cq-frk-rx62n.c diff --git a/default-configs/rx-softmmu.mak b/default-configs/rx-softmmu.mak index ea8731d67b..dbbaee8809 100644 --- a/default-configs/rx-softmmu.mak +++ b/default-configs/rx-softmmu.mak @@ -2,3 +2,4 @@ =20 CONFIG_RX_GDBSIM=3Dy CONFIG_TKDN_RX62N=3Dy +CONFIG_FRK_RX62N=3Dy diff --git a/hw/rx/cq-frk-rx62n.c b/hw/rx/cq-frk-rx62n.c new file mode 100644 index 0000000000..a1cd9cb2ad --- /dev/null +++ b/hw/rx/cq-frk-rx62n.c @@ -0,0 +1,94 @@ +/* + * CQ publishing CQ-FRK-RX62N + * + * Copyright (c) 2020 Yoshinori Sato + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2 or later, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License f= or + * more details. + * + * You should have received a copy of the GNU General Public License along= with + * this program. If not, see . + */ + +#include "qemu/osdep.h" +#include "qemu/cutils.h" +#include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" +#include "hw/hw.h" +#include "hw/sysbus.h" +#include "hw/loader.h" +#include "hw/rx/loader.h" +#include "hw/qdev-properties.h" +#include "hw/rx/rx62n.h" +#include "sysemu/sysemu.h" +#include "sysemu/qtest.h" +#include "sysemu/device_tree.h" +#include "hw/boards.h" + +typedef struct { + /*< private >*/ + MachineState parent_obj; + /*< public >*/ + RX62NState mcu; +} FRK_RX62NMachineState; + +#define TYPE_FRK_RX62N_MACHINE MACHINE_TYPE_NAME("cq-frk-rx62n") + +#define FRK_RX62N_MACHINE(obj) \ + OBJECT_CHECK(FRK_RX62NMachineState, (obj), TYPE_FRK_RX62N_MACHINE) + +static void frk_rx62n_init(MachineState *machine) +{ + FRK_RX62NMachineState *s =3D FRK_RX62N_MACHINE(machine); + RX62NClass *rx62nc; + MemoryRegion *sysmem =3D get_system_memory(); + + /* Initialize MCU */ + object_initialize_child(OBJECT(machine), "mcu", + &s->mcu, TYPE_R5F562N7_MCU); + rx62nc =3D RX62N_MCU_GET_CLASS(&s->mcu); + object_property_set_link(OBJECT(&s->mcu), "main-bus", OBJECT(sysmem), + &error_abort); + object_property_set_uint(OBJECT(&s->mcu), "xtal-frequency-hz", + 12 * 1000 * 1000, &error_abort); + if (bios_name) { + if (!load_bios(bios_name, rx62nc->rom_flash_size, &error_abort)) { + exit(0); + } + } else if (!qtest_enabled()) { + error_report("No bios specified"); + exit(1); + } + qdev_realize(DEVICE(&s->mcu), NULL, &error_abort); +} + +static void frk_rx62n_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc =3D MACHINE_CLASS(oc); + + mc->desc =3D "CQ publishing CQ-FRK-RX62N"; + mc->init =3D frk_rx62n_init; + mc->is_default =3D 0; + mc->default_cpu_type =3D TYPE_RX62N_CPU; +} + +static const TypeInfo frk_rx62n_type =3D { + .name =3D MACHINE_TYPE_NAME("cq-frk-rx62n"), + .parent =3D TYPE_MACHINE, + .instance_size =3D sizeof(FRK_RX62NMachineState), + .class_init =3D frk_rx62n_class_init, +}; + +static void frk_rx62n_machine_init(void) +{ + type_register_static(&frk_rx62n_type); +} + +type_init(frk_rx62n_machine_init) diff --git a/hw/rx/Kconfig b/hw/rx/Kconfig index 0ef20d0c3c..ab2c472510 100644 --- a/hw/rx/Kconfig +++ b/hw/rx/Kconfig @@ -17,3 +17,6 @@ config TKDN_RX62N select RX62N_MCU select FITLOADER =20 +config FRK_RX62N + bool + select RX62N_MCU diff --git a/hw/rx/meson.build b/hw/rx/meson.build index 0a741e091c..0f26f1fcb2 100644 --- a/hw/rx/meson.build +++ b/hw/rx/meson.build @@ -2,6 +2,7 @@ rx_ss =3D ss.source_set() rx_ss.add(files('loader.c')) rx_ss.add(when: 'CONFIG_RX_GDBSIM', if_true: files('rx-gdbsim.c')) rx_ss.add(when: 'CONFIG_TKDN_RX62N', if_true: files('tkdn-rx62n.c')) +rx_ss.add(when: 'CONFIG_FRK_RX62N', if_true: files('cq-frk-rx62n.c')) rx_ss.add(when: 'CONFIG_RX62N_MCU', if_true: files('rx62n.c', 'rx62n-cpg.c= ')) =20 hw_arch +=3D {'rx': rx_ss} --=20 2.20.1