[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v3 13/24] hw/arm: add RT595-EVK board
|
From: |
Octavian Purdila |
|
Subject: |
[RFC PATCH v3 13/24] hw/arm: add RT595-EVK board |
|
Date: |
Mon, 26 Aug 2024 23:45:17 -0700 |
Add basic support for the RT595-EVK board, enough to be able to run
the NXP's microXpresso SDK hello world example.
Signed-off-by: Octavian Purdila <tavip@google.com>
---
hw/arm/rt595-evk.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++
hw/arm/Kconfig | 5 ++++
hw/arm/meson.build | 1 +
3 files changed, 70 insertions(+)
create mode 100644 hw/arm/rt595-evk.c
diff --git a/hw/arm/rt595-evk.c b/hw/arm/rt595-evk.c
new file mode 100644
index 0000000000..e5daecc8b8
--- /dev/null
+++ b/hw/arm/rt595-evk.c
@@ -0,0 +1,64 @@
+/*
+ * i.MX RT595 EVK
+ *
+ * Copyright (c) 2024 Google LLC
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+#include "elf.h"
+#include "exec/address-spaces.h"
+#include "hw/loader.h"
+#include "hw/sysbus.h"
+#include "hw/boards.h"
+#include "qemu/log.h"
+#include "hw/arm/armv7m.h"
+#include "hw/arm/boot.h"
+#include "qapi/error.h"
+#include "hw/arm/rt500.h"
+#include "hw/qdev-clock.h"
+#include "sysemu/reset.h"
+
+static void rt595_evk_reset(MachineState *ms, ShutdownCause reason)
+{
+ /*
+ * CPU reset is not done by default, we need to do it manually when the
+ * machine is reset.
+ */
+ cpu_reset(first_cpu);
+
+ qemu_devices_reset(reason);
+}
+
+static void rt595_evk_init(MachineState *ms)
+{
+ RT500State *s;
+ Clock *sysclk;
+
+ sysclk = clock_new(OBJECT(ms), "SYSCLK");
+ clock_set_hz(sysclk, 200000000);
+
+ s = RT500(object_new(TYPE_RT500));
+ qdev_connect_clock_in(DEVICE(s), "sysclk", sysclk);
+ object_property_add_child(OBJECT(ms), "soc", OBJECT(s));
+ sysbus_realize_and_unref(SYS_BUS_DEVICE(s), &error_fatal);
+
+ if (ms->kernel_filename) {
+ armv7m_load_kernel(ARM_CPU(first_cpu), ms->kernel_filename, 0, 0);
+ }
+}
+
+static void rt595_evk_machine_init(MachineClass *mc)
+{
+ mc->desc = "RT595 EVK Machine (ARM Cortex-M33)";
+ mc->init = rt595_evk_init;
+ mc->reset = rt595_evk_reset;
+
+ mc->ignore_memory_transaction_failures = true;
+}
+
+DEFINE_MACHINE("rt595-evk", rt595_evk_machine_init);
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index d1443e8f89..6720a41f65 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -719,3 +719,8 @@ config RT500
select RT500_CLKCTL
select FLEXSPI
select RT500_RSTCTL
+
+config RT595_EVK
+ bool
+ default y
+ select RT500
diff --git a/hw/arm/meson.build b/hw/arm/meson.build
index 7d827d512c..9792c93142 100644
--- a/hw/arm/meson.build
+++ b/hw/arm/meson.build
@@ -60,6 +60,7 @@ arm_ss.add(when: 'CONFIG_FSL_IMX6UL', if_true:
files('fsl-imx6ul.c', 'mcimx6ul-e
arm_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_soc.c'))
arm_ss.add(when: 'CONFIG_XEN', if_true: files('xen_arm.c'))
arm_ss.add(when: 'CONFIG_RT500', if_true: files('rt500.c'))
+arm_ss.add(when: 'CONFIG_RT595_EVK', if_true: files('rt595-evk.c'))
system_ss.add(when: 'CONFIG_ARM_SMMUV3', if_true: files('smmu-common.c'))
system_ss.add(when: 'CONFIG_CHEETAH', if_true: files('palm.c'))
--
2.46.0.295.g3b9ea8a38a-goog
- [RFC PATCH v3 08/24] hw/ssi: add support for flexcomm spi, (continued)
- [RFC PATCH v3 08/24] hw/ssi: add support for flexcomm spi, Octavian Purdila, 2024/08/27
- [RFC PATCH v3 20/24] hw/ssi: allow NULL realize callbacks for peripherals, Octavian Purdila, 2024/08/27
- [RFC PATCH v3 24/24] test/unit: add unit tests for RT500's clock controller, Octavian Purdila, 2024/08/27
- [RFC PATCH v3 10/24] hw/ssi: add support for flexspi, Octavian Purdila, 2024/08/27
- [RFC PATCH v3 09/24] hw/misc: add support for RT500's clock controller, Octavian Purdila, 2024/08/27
- [RFC PATCH v3 16/24] tests/qtest: add flexcomm tests, Octavian Purdila, 2024/08/27
- [RFC PATCH v3 12/24] hw/arm: add basic support for the RT500 SoC, Octavian Purdila, 2024/08/27
- [RFC PATCH v3 11/24] hw/misc: add support for RT500's reset controller, Octavian Purdila, 2024/08/27
- [RFC PATCH v3 14/24] tests/qtest: add register access macros and functions, Octavian Purdila, 2024/08/27
- [RFC PATCH v3 15/24] system/qtest: add APIS to check for memory access failures, Octavian Purdila, 2024/08/27
- [RFC PATCH v3 13/24] hw/arm: add RT595-EVK board,
Octavian Purdila <=
- [RFC PATCH v3 23/24] systems/qtest: add device clock APIs, Octavian Purdila, 2024/08/27
- [RFC PATCH v3 19/24] tests/qtest: add tests for flexcomm i2c, Octavian Purdila, 2024/08/27
- [RFC PATCH v3 18/24] hw/misc: add i2c-tester, Octavian Purdila, 2024/08/27
- [RFC PATCH v3 21/24] hw/misc: add spi-tester, Octavian Purdila, 2024/08/27
- [RFC PATCH v3 22/24] tests/qtest: add tests for flexcomm spi, Octavian Purdila, 2024/08/27