All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiaxun Yang <jiaxun.yang@flygoat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	qemu-devel@nongnu.org, "Huacai Chen" <chenhuacai@kernel.org>
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Cleber Rosa" <crosa@redhat.com>
Subject: Re: [PATCH] tests/acceptance: Test PMON with Loongson-3A1000 CPU
Date: Thu, 17 Dec 2020 11:36:17 +0800	[thread overview]
Message-ID: <a5d00c59-b028-99b1-7500-32cb8e0e43d1@flygoat.com> (raw)
In-Reply-To: <20201216181759.933527-1-f4bug@amsat.org>



在 2020/12/17 上午2:17, Philippe Mathieu-Daudé 写道:
> Test the PMON firmware. As the firmware is not redistributable,
> it has to be downloaded manually first. Then it can be used by
> providing its path via the PMON_PATH environment variable:

We have a PMON port for loongson3-virt machine[1] and it's redistributable.

You can also fetch prebuilt binary from GitHub action artifacts, I can 
also make
a release on GitHub to make it easier.

Thanks.

[1] https://github.com/loongson-community/pmon

- Jiaxun
>
>    $ AVOCADO_ALLOW_UNTRUSTED_CODE=1 \
>      PMON_PATH=/images/pmon \
>      avocado --show=app,console \
>        run -t machine:loongson3-virt tests/acceptance
>    JOB ID     : 363e66a2d20b1c0e3f515653f9137483b83b2984
>    JOB LOG    : /home/phil/avocado/job-results/job-2020-12-16T19.02-363e66a/job.log
>     (1/2) tests/acceptance/machine_mips_fuloong3.py:MipsFuloong3.test_pmon_BLD_serial_console:
>    console: PMON2000 MIPS Initializing. Standby...
>    console: 00000000
>    console: Shut down other cores
>    console: 0xbfe00190  : 0000000000000000
>    console: CPU CLK SEL : 00000000
>    console: MEM CLK SEL : 00000000
>    console: Change the driver
>    console: Soft CLK SEL adjust begin
>    console: HT         :00000000
>    console: DDR_DIV:00000002
>    console: BBGEN start  :
>    console: BBGEN config value  :00000000
>    console: MC RESET
>    console: Fix L1xbar illegal access at NODE 0
>    console: Fix L2xbar in NODE 0
>    console: 32 bit PCI space translate to 64 bit HT space
>    console: Waiting HyperTransport bus to be up.
>    PASS (0.10 s)
>     (2/2) tests/acceptance/machine_mips_fuloong3.py:MipsFuloong3.test_pmon_A1101_serial_console:
>    console: PMON2000 MIPS Initializing. Standby...
>    console: 0xbfe00190  : 0000000000000000
>    console: CPU CLK SEL : 00000000
>    console: CPU clk frequency = SYSCLK x 0x0000001e /  1
>    console: MEM CLK SEL : 00000000
>    console: DDR clk frequency = MEMCLK x 0x0000001e /  3
>    console: Fix L1xbar illegal access
>    console: Fix L2xbar illegal access
>    console: Init tlb...
>    console: godson2 caches found
>    PASS (0.12 s)
>    RESULTS    : PASS 2 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
>    JOB TIME   : 0.58 s
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> Based-on: <20201215125716.477023-1-chenhuacai@kernel.org>
> ---
>   MAINTAINERS                                 |  1 +
>   tests/acceptance/machine_mips_loongson3v.py | 66 +++++++++++++++++++++
>   2 files changed, 67 insertions(+)
>   create mode 100644 tests/acceptance/machine_mips_loongson3v.py
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index f75fa2a7142..9a02d44f997 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1166,6 +1166,7 @@ M: Huacai Chen <chenhuacai@kernel.org>
>   R: Jiaxun Yang <jiaxun.yang@flygoat.com>
>   S: Maintained
>   F: hw/intc/loongson_liointc.c
> +F: tests/acceptance/machine_mips_loongson3v.py
>   
>   Boston
>   M: Paul Burton <paulburton@kernel.org>
> diff --git a/tests/acceptance/machine_mips_loongson3v.py b/tests/acceptance/machine_mips_loongson3v.py
> new file mode 100644
> index 00000000000..8e698bbc99b
> --- /dev/null
> +++ b/tests/acceptance/machine_mips_loongson3v.py
> @@ -0,0 +1,66 @@
> +# Functional tests for the Generic Loongson-3 Platform.
> +#
> +# Copyright (c) 2020 Philippe Mathieu-Daudé <f4bug@amsat.org>
> +#
> +# This work is licensed under the terms of the GNU GPL, version 2 or later.
> +# See the COPYING file in the top-level directory.
> +#
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +
> +import os
> +import time
> +
> +from avocado import skipUnless
> +from avocado_qemu import Test
> +from avocado_qemu import wait_for_console_pattern
> +
> +class MipsFuloong3(Test):
> +
> +    timeout = 60
> +
> +    @skipUnless(os.getenv('PMON_PATH'), 'PMON_PATH not available')
> +    @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
> +    def test_pmon_BLD_serial_console(self):
> +        """
> +        :avocado: tags=arch:mips64el
> +        :avocado: tags=endian:little
> +        :avocado: tags=machine:loongson3-virt
> +        :avocado: tags=cpu:Loongson-3A1000
> +        :avocado: tags=device:liointc
> +        :avocado: tags=device:goldfish_rtc
> +        """
> +        pmon_name = 'pmon_BLD-3A3000-780EMATX-1w-V1.10.bin'
> +        pmon_hash = '38916ee03ed09a86997b40c687c83e92'
> +        pmon_path = self.fetch_asset('file://' + os.path.join(
> +                                        os.getenv('PMON_PATH'), pmon_name),
> +                                     asset_hash=pmon_hash, algorithm='md5')
> +
> +        self.vm.set_console()
> +        self.vm.add_args('-bios', pmon_path)
> +        self.vm.launch()
> +        wait_for_console_pattern(self, 'PMON2000 MIPS Initializing. Standby...')
> +        wait_for_console_pattern(self, 'Shut down other cores')
> +        wait_for_console_pattern(self, 'Waiting HyperTransport bus to be up.')
> +
> +    @skipUnless(os.getenv('PMON_PATH'), 'PMON_PATH not available')
> +    @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
> +    def test_pmon_A1101_serial_console(self):
> +        """
> +        :avocado: tags=arch:mips64el
> +        :avocado: tags=endian:little
> +        :avocado: tags=machine:loongson3-virt
> +        :avocado: tags=cpu:Loongson-3A1000
> +        :avocado: tags=device:liointc
> +        :avocado: tags=device:goldfish_rtc
> +        """
> +        pmon_name = 'pmon-A1101-2.0.8.bin'
> +        pmon_hash = 'cc40276213cfa20922720f183b92ab61'
> +        pmon_path = self.fetch_asset('file://' + os.path.join(
> +                                        os.getenv('PMON_PATH'), pmon_name),
> +                                     asset_hash=pmon_hash, algorithm='md5')
> +
> +        self.vm.set_console()
> +        self.vm.add_args('-bios', pmon_path)
> +        self.vm.launch()
> +        wait_for_console_pattern(self, 'PMON2000 MIPS Initializing. Standby...')
> +        wait_for_console_pattern(self, 'godson2 caches found')


  parent reply	other threads:[~2020-12-17  3:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16 18:17 [PATCH] tests/acceptance: Test PMON with Loongson-3A1000 CPU Philippe Mathieu-Daudé
2020-12-17  0:08 ` Jiaxun Yang
2020-12-17  3:36 ` Jiaxun Yang [this message]
2020-12-18 15:21   ` Philippe Mathieu-Daudé
2020-12-18 15:27 ` Wainer dos Santos Moschetta
2020-12-18 20:51 ` Willian Rampazzo
2020-12-21 12:51   ` Huacai Chen
2020-12-21 15:34     ` Philippe Mathieu-Daudé
2020-12-22  0:40       ` Jiaxun Yang
2021-01-12  2:07 Jiaxun Yang
2021-01-12 12:10 ` Philippe Mathieu-Daudé
2021-01-18 16:54   ` Alex Bennée
2021-01-19  5:57     ` Philippe Mathieu-Daudé
2021-01-19  6:59       ` Jiaxun Yang
2021-01-19  7:19         ` Philippe Mathieu-Daudé
2021-01-12 14:05 ` Wainer dos Santos Moschetta
2021-01-13 23:26   ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a5d00c59-b028-99b1-7500-32cb8e0e43d1@flygoat.com \
    --to=jiaxun.yang@flygoat.com \
    --cc=chenhuacai@kernel.org \
    --cc=crosa@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wainersm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.