qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Maksim Kozlov <m.kozlov@samsung.com>
Cc: peter.maydell@linaro.org, kyungmin.park@samsung.com,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 4/4] ARM: exynos4210_pmu: Add software reset support
Date: Thu, 12 Jul 2012 20:44:42 +0400	[thread overview]
Message-ID: <4FFEFEFA.40904@samsung.com> (raw)
In-Reply-To: <1341589767-9895-5-git-send-email-m.kozlov@samsung.com>

I didn't delete comment in this file. This comment become irrelevant 
after apply this patch. I'll send new patch set.

06.07.2012 19:49, Maksim Kozlov пишет:
> Signed-off-by: Maksim Kozlov<m.kozlov@samsung.com>
> ---
>   hw/exynos4210_pmu.c |   34 +++++++++++++++++++++++++++++++++-
>   1 files changed, 33 insertions(+), 1 deletions(-)
>
> diff --git a/hw/exynos4210_pmu.c b/hw/exynos4210_pmu.c
> index 7f09c79..2ae3b60 100644
> --- a/hw/exynos4210_pmu.c
> +++ b/hw/exynos4210_pmu.c
> @@ -25,6 +25,7 @@
>    */
>
>   #include "sysbus.h"
> +#include "sysemu.h"
>
>   #ifndef DEBUG_PMU
>   #define DEBUG_PMU           0
> @@ -230,6 +231,8 @@
>
>   #define EXYNOS4210_PMU_REGS_MEM_SIZE 0x3d0c
>
> +#define SWRESET_SYSTEM_MASK     0x00000001
> +
>   typedef struct Exynos4210PmuReg {
>       const char  *name; /* for debug only */
>       uint32_t     offset;
> @@ -458,7 +461,17 @@ static void exynos4210_pmu_write(void *opaque, target_phys_addr_t offset,
>       PRINT_DEBUG_EXTEND("%s [0x%04x]<- 0x%04x\n",
>                exynos4210_pmu_regs[index].name, (uint32_t)offset, (uint32_t)val);
>
> -    s->reg[index] = val;
> +    switch (offset) {
> +    case SWRESET:
> +        if (val&  SWRESET_SYSTEM_MASK) {
> +            s->reg[index] = val;
> +            qemu_system_reset_request();
> +        }
> +        break;
> +    default:
> +        s->reg[index] = val;
> +        break;
> +    }
>   }
>
>   static const MemoryRegionOps exynos4210_pmu_ops = {
> @@ -477,9 +490,28 @@ static void exynos4210_pmu_reset(DeviceState *dev)
>       Exynos4210PmuState *s =
>               container_of(dev, Exynos4210PmuState, busdev.qdev);
>       unsigned i;
> +    uint32_t index = exynos4210_pmu_get_register_index(s, SWRESET);
> +    uint32_t swreset = s->reg[index];
>
>       /* Set default values for registers */
>       for (i = 0; i<  PMU_NUM_OF_REGISTERS; i++) {
> +        if (swreset) {
> +            switch (exynos4210_pmu_regs[i].offset) {
> +            case INFORM0:
> +            case INFORM1:
> +            case INFORM2:
> +            case INFORM3:
> +            case INFORM4:
> +            case INFORM5:
> +            case INFORM6:
> +            case INFORM7:
> +            case PS_HOLD_CONTROL:
> +                /* keep these registers during SW reset */
> +                continue;
> +            default:
> +                break;
> +            }
> +        }
>           s->reg[i] = exynos4210_pmu_regs[i].reset_value;
>       }
>   }

      reply	other threads:[~2012-07-12 16:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-06 15:49 [Qemu-devel] [PATCH 0/4] ARM: exynos4210 PMU modifications Maksim Kozlov
2012-07-06 15:49 ` [Qemu-devel] [PATCH 1/4] ARM: exynos4210_pmu: just formatting changes Maksim Kozlov
2012-07-20 14:05   ` Peter Maydell
2012-07-06 15:49 ` [Qemu-devel] [PATCH 2/4] ARM: exynos4210_pmu: changes in PRINT_DEBUG macro set Maksim Kozlov
2012-07-20 14:29   ` Peter Maydell
2012-07-06 15:49 ` [Qemu-devel] [PATCH 3/4] ARM: exynos4210_pmu: Introduced exynos4210_pmu_get_register_index Maksim Kozlov
2012-07-20 13:53   ` Peter Maydell
2012-07-06 15:49 ` [Qemu-devel] [PATCH 4/4] ARM: exynos4210_pmu: Add software reset support Maksim Kozlov
2012-07-12 16:44   ` Maksim Kozlov [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=4FFEFEFA.40904@samsung.com \
    --to=m.kozlov@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=peter.maydell@linaro.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).