From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4864:20::144; helo=mail-lf1-x144.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) (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 342B3210D7F52 for ; Thu, 2 Aug 2018 07:50:12 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id a4-v6so1759445lff.5 for ; Thu, 02 Aug 2018 07:50:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=KQqj1EoYy1f4J4XYE4488qEKyhNV/p01oWfyIDHIg7g=; b=xC9pAp+7brVrZBHDKpiyJqKE6Uo3a5vD/DDR156KCcwKZoHLBzOItJ7RJQQn4VGgs1 dmENkcdWkGZAX6N5We+4vhVaJsjkRgYkD0t9VciZmITsFOObguiUTw5AlfiMwbMCdnwX zuF+0PpNW2ElpN8OjOhw1UkAbvGhCX+6mZx+mj5A57G1YPXisjKC0CCdGQD4meK9CeN6 LZ7aDanB6WqzHdPU1IK8Fi/lGgWETiHovDmgy0OjQ0ls3Gg0tkm02coaril02BAuw9an CCeShMbEW8D31MQGiSkFGOSli5FCAwGaRAw2UKVPUHSiBfCYDC8/kAe+SOLaDJV1sMjf MvXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KQqj1EoYy1f4J4XYE4488qEKyhNV/p01oWfyIDHIg7g=; b=GOq59dshLCsdZnVGD/0Bf2PgImbMl18Zcv2AcGkYcy5e2VooTBbVs/W55Iy1a3xs15 OjL8sQZUpU355Nd7FEU2rN8eU/Rv3BaLzQHXPbX0VVVx3JD78UrFnF9P4gfRTkCbXZJm vAsz3px4qImFJ9URDOqd0RtIchsb/PVydt56qvxqVVpyvsnqDVWgOGBIse4AmkJy2jBL thXaqJtautvMd9fmHtM/pLwNPEDg3cZgOyPkHTR8P+loUMgxUsQEOQeEX8vQXNtwo3PR wt5U09yRrgy5Tp10sbwrzGPNk4gei2KnV2a7uIIGqmXY3x/RuHZs5rIEVS/IGw5FFvvc 73qA== X-Gm-Message-State: AOUpUlHiecnET+Lt6bRZzg1EOg9ZUm5iGomDTHKpVOB+kpMOsH/Yjujf mOFYU87JmvrvSALh//VEBhMy1tXw/lwSwA== X-Google-Smtp-Source: AAOMgpcAcniajgaf0/ar9wKCR5aqYMXAprCMnOeI2cdoJg6tcXN5ZQIJJqBFVL/4DJe0MuEzKlg+pQ== X-Received: by 2002:a19:4c57:: with SMTP id z84-v6mr2016743lfa.67.1533221409597; Thu, 02 Aug 2018 07:50:09 -0700 (PDT) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id t8-v6sm328765lfd.2.2018.08.02.07.50.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Aug 2018 07:50:08 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Cc: feng.tian@intel.com, michael.d.kinney@intel.com, liming.gao@intel.com, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, nadavh@marvell.com, mw@semihalf.com, jsd@semihalf.com Date: Thu, 2 Aug 2018 16:49:56 +0200 Message-Id: <1533221396-11620-1-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 Subject: [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:50:12 -0000 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. 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