From: Yanfeng Liu <yfliu2008@qq.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-arm@nongnu.org
Cc: qemu-devel@nongnu.org, peter.maydell@linaro.org,
alistair.francis@wdc.com
Subject: Re: [PATCH] arm/cpu: revises cortex-r5
Date: Thu, 30 Jan 2025 19:48:13 +0800 [thread overview]
Message-ID: <tencent_6A70CD1509675ED7CF926CD93DEDC152CA05@qq.com> (raw)
In-Reply-To: <67dbc202-7b6d-4bf4-8d18-2ba78f39a287@linaro.org>
On Mon, 2025-01-27 at 09:03 +0100, Philippe Mathieu-Daudé wrote:
> Hi,
>
> On 26/1/25 12:43, Yanfeng Liu wrote:
> > From: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
> >
> > This enables generic timer feature for Cortex-R5 so that to support guests
> > like NuttX RTOS.
>
> QEMU aims to model CPU faithful to hardware, than the R5
> doesn't has generic timer.
>
Okay, I see.
>
> Maybe you want to use the Cortex-R52 instead? I see NuttX supports it:
> https://nuttx.apache.org/docs/latest/platforms/arm/fvp-v8r-aarch32/boards/fvp-armv8r-aarch32/index.html
>
Thanks for mentioning this, both commit logs and docs say the r52 support is for
FVP simulator, not for QEMU. Also the MPU memory model support is still missing.
Is it proper to use Cortex-R52 on `virt` board? I am currently using CR5 on
`virt` board to share some code base of armv7-a support.
> If it works for you, could you add a test for NuttX on Cortex-R52?
> See for example tests/functional/test_avr_mega2560.py
>
>
I don't know how a FVP guest can help on QEMU testing. But from the sample test
you shared, it seems that a NuttX image URL is needed to create a test case.
That won't be an issue as NuttX images are small and we can have different
images for plain flat memory model, MPU isolated memory model and MMU mapped
memory model if needed.
If using cortex-r52 on `virt` board is allowed, I may add a NuttX port and share
a binary image URL for a QEMU test case later.
> Thanks!
>
> Regards,
>
> Phil.
>
> > Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
> > ---
> > target/arm/tcg/cpu32.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/target/arm/tcg/cpu32.c b/target/arm/tcg/cpu32.c
> > index 2ad2182525..5d68d515b4 100644
> > --- a/target/arm/tcg/cpu32.c
> > +++ b/target/arm/tcg/cpu32.c
> > @@ -590,9 +590,10 @@ static void cortex_r5_initfn(Object *obj)
> > set_feature(&cpu->env, ARM_FEATURE_V7MP);
> > set_feature(&cpu->env, ARM_FEATURE_PMSA);
> > set_feature(&cpu->env, ARM_FEATURE_PMU);
> > + set_feature(&cpu->env, ARM_FEATURE_GENERIC_TIMER);
> > cpu->midr = 0x411fc153; /* r1p3 */
> > cpu->isar.id_pfr0 = 0x0131;
> > - cpu->isar.id_pfr1 = 0x001;
> > + cpu->isar.id_pfr1 = 0x10001;
> > cpu->isar.id_dfr0 = 0x010400;
> > cpu->id_afr0 = 0x0;
> > cpu->isar.id_mmfr0 = 0x0210030;
prev parent reply other threads:[~2025-01-30 11:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-26 11:43 [PATCH] arm/cpu: revises cortex-r5 Yanfeng Liu
2025-01-27 8:03 ` Philippe Mathieu-Daudé
2025-01-30 11:48 ` Yanfeng Liu [this message]
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=tencent_6A70CD1509675ED7CF926CD93DEDC152CA05@qq.com \
--to=yfliu2008@qq.com \
--cc=alistair.francis@wdc.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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 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).