From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c0b::242; helo=mail-it0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CB760210D7F39 for ; Thu, 2 Aug 2018 07:59:17 -0700 (PDT) Received: by mail-it0-x242.google.com with SMTP id v71-v6so3657493itb.3 for ; Thu, 02 Aug 2018 07:59:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=sOu7LbVVIM0kyGBaN7Ac/NYE0zymnauctfdE+HNk2Do=; b=GguCF68RrR1k/Qb5pumBXPvGJTAnmJXk+Y1qgSoQ892nuXyC9Xb65bw/QkGvcVCbQa Zfz7LM7a+lkM6fRXQG8jZqWGqskI/1e5RLNqz2dx7T7gvyNMx5U7EfFStrFqr+qPRhbE 4/rvFbVNxJzAg2jlA37dzP4VsouNW4iNJ+x7o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=sOu7LbVVIM0kyGBaN7Ac/NYE0zymnauctfdE+HNk2Do=; b=G461ktgQhufjvNqLNM2aF6QLNq/lsPlXP5BIz+o0XWBkUEkBfsf5eKIyD5yyXhuSZs 6JHiICGEe4CI+Lb+go/LN0CA1fnTSFrnTdv6Nr3E+smUjG7luQtBVnn5lnud/aNDsuCq VJQgch8q9GOrmkE8SGy2o/6Mu/uuHrq0w3Eecy7+JZjmCKmp/8b0b6uq/lkbBVJcaKXJ i371npR4A2/IkGxk9FX+RTnAhv9BJWhGv+w7BfKI014ntGds+f6eD5rydu9ANLD4iAT2 o7nLa0XDHH+fLPpP9Vzs15WnGf/Tlj5g5lVfQEfzipYtFYoNyc33P+oy55n++Uzajo76 kR3Q== X-Gm-Message-State: AOUpUlEw5aJms/fEx+wOy1jkMg4Nl1PhuC1JnFglXJT5Bmv9F+eivVpt 6zquY5wMIhjalgjQqaC4FNmNyYkgU/h4F72FuMRQvQ== X-Google-Smtp-Source: AAOMgpcfE0l1PmPh95hA6J3PKohdQczzQNJFKlcH6kr5WlZYI3Og9tMvpMXqDIiEpOH10Ipd7BGa+1w7rdNocouKQbQ= X-Received: by 2002:a02:35a:: with SMTP id y87-v6mr2823835jad.2.1533221956620; Thu, 02 Aug 2018 07:59:16 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:ac05:0:0:0:0:0 with HTTP; Thu, 2 Aug 2018 07:59:09 -0700 (PDT) In-Reply-To: <1533221396-11620-1-git-send-email-mw@semihalf.com> References: <1533221396-11620-1-git-send-email-mw@semihalf.com> From: Ard Biesheuvel Date: Thu, 2 Aug 2018 16:59:09 +0200 Message-ID: To: Marcin Wojtas Cc: "edk2-devel@lists.01.org" , "Tian, Feng" , "Kinney, Michael D" , "Gao, Liming" , Leif Lindholm , Nadav Haklai , =?UTF-8?B?SmFuIETEhWJyb8Wb?= Subject: Re: [PATCH] ArmPkg/GenericWatchdogDxe: Split 64bit register write to 2x32bit X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Aug 2018 14:59:18 -0000 Content-Type: text/plain; charset="UTF-8" On 2 August 2018 at 16:49, Marcin Wojtas 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 > --- > 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 >