From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, patches@linaro.org,
Michael Davidsaver <mdavidsaver@gmail.com>,
Liviu Ionescu <ilg@livius.net>
Subject: Re: [PATCH 2/9] armv7m: Implement reading and writing of PRIGROUP
Date: Tue, 14 Feb 2017 17:08:59 +0000 [thread overview]
Message-ID: <878tp8vgwk.fsf@linaro.org> (raw)
In-Reply-To: <1486065742-28639-3-git-send-email-peter.maydell@linaro.org>
Peter Maydell <peter.maydell@linaro.org> writes:
> Add a state field for the v7M PRIGROUP register and implent
> reading and writing it. The current NVIC doesn't honour
> the values written, but the new version will.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> hw/intc/armv7m_nvic.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c
> index 09975f3..ce22001 100644
> --- a/hw/intc/armv7m_nvic.c
> +++ b/hw/intc/armv7m_nvic.c
> @@ -24,6 +24,9 @@
> typedef struct NVICState {
> GICState gic;
> ARMCPU *cpu;
> +
> + uint32_t prigroup;
It might be worth mentioning the field resets to 0b000 here.
Nevertheless:
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> +
> struct {
> uint32_t control;
> uint32_t reload;
> @@ -223,7 +226,7 @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset)
> case 0xd08: /* Vector Table Offset. */
> return cpu->env.v7m.vecbase;
> case 0xd0c: /* Application Interrupt/Reset Control. */
> - return 0xfa050000;
> + return 0xfa050000 | (s->prigroup << 8);
> case 0xd10: /* System Control. */
> /* TODO: Implement SLEEPONEXIT. */
> return 0;
> @@ -362,9 +365,7 @@ static void nvic_writel(NVICState *s, uint32_t offset, uint32_t value)
> if (value & 1) {
> qemu_log_mask(LOG_UNIMP, "AIRCR system reset unimplemented\n");
> }
> - if (value & 0x700) {
> - qemu_log_mask(LOG_UNIMP, "PRIGROUP unimplemented\n");
> - }
> + s->prigroup = extract32(value, 8, 3);
> }
> break;
> case 0xd10: /* System Control. */
> @@ -483,13 +484,14 @@ static const MemoryRegionOps nvic_sysreg_ops = {
>
> static const VMStateDescription vmstate_nvic = {
> .name = "armv7m_nvic",
> - .version_id = 1,
> - .minimum_version_id = 1,
> + .version_id = 2,
> + .minimum_version_id = 2,
> .fields = (VMStateField[]) {
> VMSTATE_UINT32(systick.control, NVICState),
> VMSTATE_UINT32(systick.reload, NVICState),
> VMSTATE_INT64(systick.tick, NVICState),
> VMSTATE_TIMER_PTR(systick.timer, NVICState),
> + VMSTATE_UINT32(prigroup, NVICState),
> VMSTATE_END_OF_LIST()
> }
> };
--
Alex Bennée
WARNING: multiple messages have this Message-ID (diff)
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, patches@linaro.org,
Michael Davidsaver <mdavidsaver@gmail.com>,
Liviu Ionescu <ilg@livius.net>
Subject: Re: [Qemu-devel] [PATCH 2/9] armv7m: Implement reading and writing of PRIGROUP
Date: Tue, 14 Feb 2017 17:08:59 +0000 [thread overview]
Message-ID: <878tp8vgwk.fsf@linaro.org> (raw)
In-Reply-To: <1486065742-28639-3-git-send-email-peter.maydell@linaro.org>
Peter Maydell <peter.maydell@linaro.org> writes:
> Add a state field for the v7M PRIGROUP register and implent
> reading and writing it. The current NVIC doesn't honour
> the values written, but the new version will.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> hw/intc/armv7m_nvic.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c
> index 09975f3..ce22001 100644
> --- a/hw/intc/armv7m_nvic.c
> +++ b/hw/intc/armv7m_nvic.c
> @@ -24,6 +24,9 @@
> typedef struct NVICState {
> GICState gic;
> ARMCPU *cpu;
> +
> + uint32_t prigroup;
It might be worth mentioning the field resets to 0b000 here.
Nevertheless:
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> +
> struct {
> uint32_t control;
> uint32_t reload;
> @@ -223,7 +226,7 @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset)
> case 0xd08: /* Vector Table Offset. */
> return cpu->env.v7m.vecbase;
> case 0xd0c: /* Application Interrupt/Reset Control. */
> - return 0xfa050000;
> + return 0xfa050000 | (s->prigroup << 8);
> case 0xd10: /* System Control. */
> /* TODO: Implement SLEEPONEXIT. */
> return 0;
> @@ -362,9 +365,7 @@ static void nvic_writel(NVICState *s, uint32_t offset, uint32_t value)
> if (value & 1) {
> qemu_log_mask(LOG_UNIMP, "AIRCR system reset unimplemented\n");
> }
> - if (value & 0x700) {
> - qemu_log_mask(LOG_UNIMP, "PRIGROUP unimplemented\n");
> - }
> + s->prigroup = extract32(value, 8, 3);
> }
> break;
> case 0xd10: /* System Control. */
> @@ -483,13 +484,14 @@ static const MemoryRegionOps nvic_sysreg_ops = {
>
> static const VMStateDescription vmstate_nvic = {
> .name = "armv7m_nvic",
> - .version_id = 1,
> - .minimum_version_id = 1,
> + .version_id = 2,
> + .minimum_version_id = 2,
> .fields = (VMStateField[]) {
> VMSTATE_UINT32(systick.control, NVICState),
> VMSTATE_UINT32(systick.reload, NVICState),
> VMSTATE_INT64(systick.tick, NVICState),
> VMSTATE_TIMER_PTR(systick.timer, NVICState),
> + VMSTATE_UINT32(prigroup, NVICState),
> VMSTATE_END_OF_LIST()
> }
> };
--
Alex Bennée
next prev parent reply other threads:[~2017-02-14 17:08 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-02 20:02 [PATCH 0/9] Rewrite NVIC to not depend on the GIC Peter Maydell
2017-02-02 20:02 ` [Qemu-devel] " Peter Maydell
2017-02-02 20:02 ` [PATCH 1/9] armv7m: Rename nvic_state to NVICState Peter Maydell
2017-02-02 20:02 ` [Qemu-devel] " Peter Maydell
2017-02-10 14:23 ` Philippe Mathieu-Daudé
2017-02-14 17:00 ` Alex Bennée
2017-02-14 17:00 ` [Qemu-devel] " Alex Bennée
2017-02-02 20:02 ` [PATCH 2/9] armv7m: Implement reading and writing of PRIGROUP Peter Maydell
2017-02-02 20:02 ` [Qemu-devel] " Peter Maydell
2017-02-10 14:27 ` Philippe Mathieu-Daudé
2017-02-14 17:08 ` Alex Bennée [this message]
2017-02-14 17:08 ` Alex Bennée
2017-02-02 20:02 ` [PATCH 3/9] armv7m: Rewrite NVIC to not use any GIC code Peter Maydell
2017-02-02 20:02 ` [Qemu-devel] " Peter Maydell
2017-02-15 12:46 ` Alex Bennée
2017-02-15 12:46 ` [Qemu-devel] " Alex Bennée
2017-02-15 13:34 ` Peter Maydell
2017-02-15 13:34 ` [Qemu-devel] " Peter Maydell
2017-02-15 14:14 ` Alex Bennée
2017-02-15 14:14 ` [Qemu-devel] " Alex Bennée
2017-02-15 14:27 ` Peter Maydell
2017-02-15 14:27 ` [Qemu-devel] " Peter Maydell
2017-02-15 14:51 ` Alex Bennée
2017-02-15 14:51 ` [Qemu-devel] " Alex Bennée
2017-02-16 14:11 ` Peter Maydell
2017-02-16 14:11 ` [Qemu-devel] " Peter Maydell
2017-02-18 17:45 ` Michael Davidsaver
2017-02-18 17:45 ` [Qemu-devel] " Michael Davidsaver
2017-02-18 18:38 ` Peter Maydell
2017-02-18 18:38 ` [Qemu-devel] " Peter Maydell
2017-02-19 18:10 ` Michael Davidsaver
2017-02-19 18:10 ` [Qemu-devel] " Michael Davidsaver
2017-02-16 16:12 ` Peter Maydell
2017-02-16 16:12 ` [Qemu-devel] " Peter Maydell
2017-02-02 20:02 ` [PATCH 4/9] armv7m: Fix condition check for taking exceptions Peter Maydell
2017-02-02 20:02 ` [Qemu-devel] " Peter Maydell
2017-02-15 12:48 ` Alex Bennée
2017-02-15 12:48 ` [Qemu-devel] " Alex Bennée
2017-02-02 20:02 ` [PATCH 5/9] arm: gic: Remove references to NVIC Peter Maydell
2017-02-02 20:02 ` [Qemu-devel] " Peter Maydell
2017-02-15 12:49 ` Alex Bennée
2017-02-15 12:49 ` [Qemu-devel] " Alex Bennée
2017-04-17 3:11 ` Philippe Mathieu-Daudé
2017-02-02 20:02 ` [PATCH 6/9] armv7m: Escalate exceptions to HardFault if necessary Peter Maydell
2017-02-02 20:02 ` [Qemu-devel] " Peter Maydell
2017-02-15 14:15 ` Alex Bennée
2017-02-15 14:15 ` [Qemu-devel] " Alex Bennée
2017-02-02 20:02 ` [PATCH 7/9] armv7m: Remove unused armv7m_nvic_acknowledge_irq() return value Peter Maydell
2017-02-02 20:02 ` [Qemu-devel] " Peter Maydell
2017-02-15 14:16 ` Alex Bennée
2017-02-15 14:16 ` [Qemu-devel] " Alex Bennée
2017-02-02 20:02 ` [PATCH 8/9] armv7m: Simpler and faster exception start Peter Maydell
2017-02-02 20:02 ` [Qemu-devel] " Peter Maydell
2017-02-15 14:18 ` Alex Bennée
2017-02-15 14:18 ` [Qemu-devel] " Alex Bennée
2017-02-02 20:02 ` [PATCH 9/9] armv7m: VECTCLRACTIVE and VECTRESET are UNPREDICTABLE Peter Maydell
2017-02-02 20:02 ` [Qemu-devel] " Peter Maydell
2017-02-10 14:31 ` Philippe Mathieu-Daudé
2017-02-15 14:19 ` Alex Bennée
2017-02-15 14:19 ` [Qemu-devel] " Alex Bennée
2017-02-10 14:05 ` [Qemu-arm] [PATCH 0/9] Rewrite NVIC to not depend on the GIC Peter Maydell
2017-02-10 14:05 ` [Qemu-devel] " Peter Maydell
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=878tp8vgwk.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=ilg@livius.net \
--cc=mdavidsaver@gmail.com \
--cc=patches@linaro.org \
--cc=peter.maydell@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 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.