public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Marcin Wojtas <mw@semihalf.com>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	"Tian, Feng" <feng.tian@intel.com>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>,
	"Gao, Liming" <liming.gao@intel.com>,
	"Leif Lindholm" <leif.lindholm@linaro.org>,
	"Nadav Haklai" <nadavh@marvell.com>,
	"Jan Dąbroś" <jsd@semihalf.com>
Subject: Re: [PATCH] ArmPkg/GenericWatchdogDxe: Split 64bit register write to 2x32bit
Date: Thu, 2 Aug 2018 16:59:09 +0200	[thread overview]
Message-ID: <CAKv+Gu9nYcqRdfO1qgXm4bpUYcdWQ0x916-DstXu9n7SB6AL=Q@mail.gmail.com> (raw)
In-Reply-To: <1533221396-11620-1-git-send-email-mw@semihalf.com>

On 2 August 2018 at 16:49, Marcin Wojtas <mw@semihalf.com> wrote:
> EDK2 code uses a single 64bit write to update SBSA watchdog
> compare registers, however an access to mmio registers should
> be 32bit for some SoCs. Current usage of MmioWrite64 resulted
> in an unpredicted behavior. Fix this by modifying
> WatchdogWriteCompareRegister routine to use two consecutive
> 32bit writes to Watchdog Compare Register Low and High.
>

You describe it as if this is generally the case, but this is just a
silicon bug, right?

> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marcin Wojtas <mw@semihalf.com>
> ---
>  ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c
> index 3180f01..b25d210 100644
> --- a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c
> +++ b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c
> @@ -56,7 +56,11 @@ WatchdogWriteCompareRegister (
>    UINT64  Value
>    )
>  {
> -  MmioWrite64 (GENERIC_WDOG_COMPARE_VALUE_REG, Value);
> +  MmioWrite32 (GENERIC_WDOG_COMPARE_VALUE_REG, Value & MAX_UINT32);
> +  MmioWrite32 (
> +    GENERIC_WDOG_COMPARE_VALUE_REG + sizeof (UINT32),
> +    (Value >> 32) & MAX_UINT32
> +    );
>  }
>
>  VOID
> --
> 2.7.4
>


  reply	other threads:[~2018-08-02 14:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-02 14:49 [PATCH] ArmPkg/GenericWatchdogDxe: Split 64bit register write to 2x32bit Marcin Wojtas
2018-08-02 14:59 ` Ard Biesheuvel [this message]
2018-08-02 15:12   ` Marcin Wojtas
2018-08-02 18:32     ` Ard Biesheuvel
2018-08-02 20:14       ` Leif Lindholm

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-list 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='CAKv+Gu9nYcqRdfO1qgXm4bpUYcdWQ0x916-DstXu9n7SB6AL=Q@mail.gmail.com' \
    --to=devel@edk2.groups.io \
    /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