qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] MAX78000: documentation and test
@ 2025-07-11 11:06 Jackson Donaldson
  2025-07-11 11:06 ` [PATCH v2 1/2] docs/system: arm: Add max78000 board description Jackson Donaldson
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jackson Donaldson @ 2025-07-11 11:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

v2:
Docs now build. Sorry about that

v1:
Adds .rST documentation and a functional test for the MAX78000FTHR machine
as requested by Peter Maydell.

Jackson Donaldson (2):
  docs/system: arm: Add max78000 board description
  tests/functional: Add a test for the MAX78000 arm machine

 docs/system/arm/max78000.rst              | 35 +++++++++++++++++
 docs/system/target-arm.rst                |  1 +
 tests/functional/meson.build              |  1 +
 tests/functional/test_arm_max78000fthr.py | 48 +++++++++++++++++++++++
 4 files changed, 85 insertions(+)
 create mode 100644 docs/system/arm/max78000.rst
 create mode 100755 tests/functional/test_arm_max78000fthr.py

-- 
2.34.1



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/2] docs/system: arm: Add max78000 board description
  2025-07-11 11:06 [PATCH v2 0/2] MAX78000: documentation and test Jackson Donaldson
@ 2025-07-11 11:06 ` Jackson Donaldson
  2025-07-11 12:29   ` Peter Maydell
  2025-07-11 11:06 ` [PATCH v2 2/2] tests/functional: Add a test for the MAX78000 arm machine Jackson Donaldson
  2025-07-11 12:09 ` [PATCH v2 0/2] MAX78000: documentation and test Peter Maydell
  2 siblings, 1 reply; 6+ messages in thread
From: Jackson Donaldson @ 2025-07-11 11:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

This adds the target guide for the max78000FTHR

Signed-off-by: Jackson Donaldson <jcksn@duck.com>
---
 docs/system/arm/max78000.rst | 35 +++++++++++++++++++++++++++++++++++
 docs/system/target-arm.rst   |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 docs/system/arm/max78000.rst

diff --git a/docs/system/arm/max78000.rst b/docs/system/arm/max78000.rst
new file mode 100644
index 0000000000..8ebd1f7de8
--- /dev/null
+++ b/docs/system/arm/max78000.rst
@@ -0,0 +1,35 @@
+Analog Devices max78000 board (``max78000fthr``)
+===============================================================================================================
+
+The max78000 is a Cortex-M4 based SOC with a RISC-V coprocessor. The RISC-V coprocessor is not supported.
+
+Supported devices
+----------------------------------
+
+ * Instruction Cache Controller
+ * UART
+ * Global Control Register
+ * True Random Number Generator
+ * AES
+
+Notable unsupported devices
+----------------------------------
+
+ * I2C
+ * CNN
+ * CRC
+ * SPI
+
+Boot options
+----------------------------------
+
+The max78000 can be started using the ``-kernel`` option to load a
+firmware at address 0 as the ROM. As the ROM normally jumps to software loaded
+from the internal flash at address 0x10000000, loading your program there is
+generally advisable. If you don't have a copy of the ROM, the interrupt
+vector table from user firmware will do.
+Example:
+
+.. code-block:: bash
+
+  $ qemu-system-arm -machine max78000fthr -kernel max78000.bin -device loader,file=max78000.bin,addr=0x10000000
\ No newline at end of file
diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst
index b96a05a920..8a62a6f688 100644
--- a/docs/system/target-arm.rst
+++ b/docs/system/target-arm.rst
@@ -88,6 +88,7 @@ Board-specific documentation
    arm/emcraft-sf2
    arm/exynos
    arm/fby35
+   arm/max78000
    arm/musicpal
    arm/kzm
    arm/nrf
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/2] tests/functional: Add a test for the MAX78000 arm machine
  2025-07-11 11:06 [PATCH v2 0/2] MAX78000: documentation and test Jackson Donaldson
  2025-07-11 11:06 ` [PATCH v2 1/2] docs/system: arm: Add max78000 board description Jackson Donaldson
@ 2025-07-11 11:06 ` Jackson Donaldson
  2025-07-11 12:09 ` [PATCH v2 0/2] MAX78000: documentation and test Peter Maydell
  2 siblings, 0 replies; 6+ messages in thread
From: Jackson Donaldson @ 2025-07-11 11:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Thomas Huth

Runs a binary from the max78000test repo used in
developing the qemu implementation of the max78000
to verify that the machine and implemented devices
generally still work.

Signed-off-by: Jackson Donaldson <jcksn@duck.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
---
 tests/functional/meson.build              |  1 +
 tests/functional/test_arm_max78000fthr.py | 48 +++++++++++++++++++++++
 2 files changed, 49 insertions(+)
 create mode 100755 tests/functional/test_arm_max78000fthr.py

diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index e9f19d54a2..f837c6ddb1 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -131,6 +131,7 @@ tests_arm_system_thorough = [
   'arm_cubieboard',
   'arm_emcraft_sf2',
   'arm_integratorcp',
+  'arm_max78000fthr',
   'arm_microbit',
   'arm_orangepi',
   'arm_quanta_gsj',
diff --git a/tests/functional/test_arm_max78000fthr.py b/tests/functional/test_arm_max78000fthr.py
new file mode 100755
index 0000000000..a82980b0f7
--- /dev/null
+++ b/tests/functional/test_arm_max78000fthr.py
@@ -0,0 +1,48 @@
+#!/usr/bin/env python3
+#
+# Functional test that checks the max78000fthr machine.
+# Tests ICC, GCR, TRNG, AES, and UART
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import QemuSystemTest, Asset, exec_command_and_wait_for_pattern
+from qemu_test import wait_for_console_pattern
+
+
+class Max78000Machine(QemuSystemTest):
+
+    ASSET_FW = Asset(
+        'https://github.com/JacksonDonaldson/max78000Test/raw/main/build/max78000.bin',
+        '86940b4bf60931bc6a8aa5db4b9f7f3cf8f64dbbd7ac534647980e536cf3adf7')
+
+    def test_fthr(self):
+        self.set_machine('max78000fthr')
+        fw_path = self.ASSET_FW.fetch()
+        self.vm.set_console()
+        self.vm.add_args('-kernel', fw_path)
+        self.vm.add_args('-device', "loader,file=" + fw_path + ",addr=0x10000000")
+        self.vm.launch()
+
+        wait_for_console_pattern(self, 'started')
+
+        # i -> prints instruction cache values
+        exec_command_and_wait_for_pattern(self, 'i', 'CTRL: 00010001')
+
+        # r -> gcr resets the machine
+        exec_command_and_wait_for_pattern(self, 'r', 'started')
+
+        # z -> sets some memory, then has gcr zero it
+        exec_command_and_wait_for_pattern(self, 'z', 'initial value: 12345678')
+        wait_for_console_pattern(self, "after memz: 00000000")
+
+        # t -> runs trng
+        exec_command_and_wait_for_pattern(self, 't', 'random data:')
+
+        # a -> runs aes
+        exec_command_and_wait_for_pattern(self, 'a',
+                'encrypted to : a47ca9dd e0df4c86 a070af6e 91710dec')
+        wait_for_console_pattern(self,
+                'encrypted to : cab7a28e bf456751 9049fcea 8960494b')
+
+if __name__ == '__main__':
+    QemuSystemTest.main()
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 0/2] MAX78000: documentation and test
  2025-07-11 11:06 [PATCH v2 0/2] MAX78000: documentation and test Jackson Donaldson
  2025-07-11 11:06 ` [PATCH v2 1/2] docs/system: arm: Add max78000 board description Jackson Donaldson
  2025-07-11 11:06 ` [PATCH v2 2/2] tests/functional: Add a test for the MAX78000 arm machine Jackson Donaldson
@ 2025-07-11 12:09 ` Peter Maydell
  2 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2025-07-11 12:09 UTC (permalink / raw)
  To: Jackson Donaldson; +Cc: qemu-devel

On Fri, 11 Jul 2025 at 12:06, Jackson Donaldson <jackson88044@gmail.com> wrote:
>
> v2:
> Docs now build. Sorry about that
>
> v1:
> Adds .rST documentation and a functional test for the MAX78000FTHR machine
> as requested by Peter Maydell.
>
> Jackson Donaldson (2):
>   docs/system: arm: Add max78000 board description
>   tests/functional: Add a test for the MAX78000 arm machine



Applied to target-arm.next, thanks.

-- PMM


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] docs/system: arm: Add max78000 board description
  2025-07-11 11:06 ` [PATCH v2 1/2] docs/system: arm: Add max78000 board description Jackson Donaldson
@ 2025-07-11 12:29   ` Peter Maydell
  2025-07-11 12:33     ` Jackson Donaldson
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Maydell @ 2025-07-11 12:29 UTC (permalink / raw)
  To: Jackson Donaldson; +Cc: qemu-devel

On Fri, 11 Jul 2025 at 12:06, Jackson Donaldson <jackson88044@gmail.com> wrote:
>
> This adds the target guide for the max78000FTHR
>
> Signed-off-by: Jackson Donaldson <jcksn@duck.com>
> ---

Checkpatch wants an SPDX line for this new file -- can
you confirm that I can mark it as GPL-2.0-or-later like
the C files, please?

thanks
-- PMM


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] docs/system: arm: Add max78000 board description
  2025-07-11 12:29   ` Peter Maydell
@ 2025-07-11 12:33     ` Jackson Donaldson
  0 siblings, 0 replies; 6+ messages in thread
From: Jackson Donaldson @ 2025-07-11 12:33 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 468 bytes --]

Confirmed.
-Jackson

On Fri, Jul 11, 2025, 8:29 AM Peter Maydell <peter.maydell@linaro.org>
wrote:

> On Fri, 11 Jul 2025 at 12:06, Jackson Donaldson <jackson88044@gmail.com>
> wrote:
> >
> > This adds the target guide for the max78000FTHR
> >
> > Signed-off-by: Jackson Donaldson <jcksn@duck.com>
> > ---
>
> Checkpatch wants an SPDX line for this new file -- can
> you confirm that I can mark it as GPL-2.0-or-later like
> the C files, please?
>
> thanks
> -- PMM
>

[-- Attachment #2: Type: text/html, Size: 1013 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-07-11 12:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-11 11:06 [PATCH v2 0/2] MAX78000: documentation and test Jackson Donaldson
2025-07-11 11:06 ` [PATCH v2 1/2] docs/system: arm: Add max78000 board description Jackson Donaldson
2025-07-11 12:29   ` Peter Maydell
2025-07-11 12:33     ` Jackson Donaldson
2025-07-11 11:06 ` [PATCH v2 2/2] tests/functional: Add a test for the MAX78000 arm machine Jackson Donaldson
2025-07-11 12:09 ` [PATCH v2 0/2] MAX78000: documentation and test Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).