From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::243; helo=mail-wr0-x243.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) (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 C9F8E22152380 for ; Mon, 4 Dec 2017 06:31:12 -0800 (PST) Received: by mail-wr0-x243.google.com with SMTP id h1so17500921wre.12 for ; Mon, 04 Dec 2017 06:35:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QPM7nAa3gk8AnGnp8BOlQ7/RnGvsT8CAKfX/K14U11k=; b=V12CcfRWhxJ1mhXVSVVeIQWUqNIvCR1DOTdWGQOyjcgUpSTrkVrUnO9dxKEpn0LOOy P8HXfv/HLJfSIW9tqz1w5A4tIdXzu+xPT7CwEAYkDmiO/Va5tpJlfKqGrjCqeluqOVG7 WAhlCK6ohH77VWLPGS0C8m5+WEl7fwtcOnoHs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=QPM7nAa3gk8AnGnp8BOlQ7/RnGvsT8CAKfX/K14U11k=; b=n66MGQym62JatLH2MfqICpIrRw+kd4ys3/HrEAj7BOiyApG91JofKlKz3+o1QOAPVb qu4ksiYyDn3zczaHlQW8t3R9q39V/hRfqKG0ArabNfyPyRiFJcDPF3+OMag88/SlTqOl TfPwR/07ejxQm7umgORhhg/izB7mUfLjdWcg0YftTjbNrAd3OFSpePCHcXXtLLLdCfUp VyjEzmoufLb4AbElxc2/IgFyEjrs8X3kduIgoLlsQv8o1IA2jqjSBuKnDyAlyB2ZjqtJ 8YBD5ZCB7AZ67FtqALDa4+I4ySNUSFodCAQY9N5qi8XTFoB1Lel41H7BHZJTt2+KsNOR 7KKg== X-Gm-Message-State: AJaThX5vrMae0tu+NEH9Z8PFDreb4B3Ga4GmLl6ZBA5SSrT246YtqZnM mfPhQ263iZt/sdr7HExbANhpQA== X-Google-Smtp-Source: AGs4zMaEoYdmco/PXxgh+DOMbzF2PBJGXPimwEy55p7p1fych4aXETX0Qxxt7u1mdrtPGX9URLHLwQ== X-Received: by 10.223.175.223 with SMTP id y31mr13252476wrd.106.1512398140943; Mon, 04 Dec 2017 06:35:40 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id v47sm13827183wrc.13.2017.12.04.06.35.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Dec 2017 06:35:39 -0800 (PST) Date: Mon, 4 Dec 2017 14:35:37 +0000 From: Leif Lindholm To: michael.d.kinney@intel.com, liming.gao@intel.com Cc: Meenakshi Aggarwal , ard.biesheuvel@linaro.org, edk2-devel@lists.01.org, udit.kumar@nxp.com, v.sethi@nxp.com Message-ID: <20171204143537.abxvjztldex2bjde@bivouac.eciton.net> References: <1511779917-9255-1-git-send-email-meenakshi.aggarwal@nxp.com> <1511779917-9255-3-git-send-email-meenakshi.aggarwal@nxp.com> MIME-Version: 1.0 In-Reply-To: <1511779917-9255-3-git-send-email-meenakshi.aggarwal@nxp.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PATCH edk2-platforms] [PATCH v3 2/9] Platform/NXP : Add support for Watchdog driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Dec 2017 14:31:13 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Mike, Liming, as MdePkg mainteiners - one question below: On Mon, Nov 27, 2017 at 04:21:50PM +0530, Meenakshi Aggarwal wrote: > diff --git a/Platform/NXP/Drivers/WatchDog/WatchDog.c b/Platform/NXP/Drivers/WatchDog/WatchDog.c > new file mode 100644 > index 0000000..a9c70ef > --- /dev/null > +++ b/Platform/NXP/Drivers/WatchDog/WatchDog.c > @@ -0,0 +1,421 @@ ... > +/** > + This function registers the handler NotifyFunction so it is called every time > + the watchdog timer expires. It also passes the amount of time since the last > + handler call to the NotifyFunction. > + If NotifyFunction is not NULL and a handler is not already registered, > + then the new handler is registered and EFI_SUCCESS is returned. > + If NotifyFunction is NULL, and a handler is already registered, > + then that handler is unregistered. > + If an attempt is made to register a handler when a handler is already registered, > + then EFI_ALREADY_STARTED is returned. > + If an attempt is made to unregister a handler when a handler is not registered, > + then EFI_INVALID_PARAMETER is returned. > + > + @param This The EFI_TIMER_ARCH_PROTOCOL instance. > + @param NotifyFunction The function to call when a timer interrupt fires. This > + function executes at TPL_HIGH_LEVEL. The DXE Core will > + register a handler for the timer interrupt, so it can know > + how much time has passed. This information is used to > + signal timer based events. NULL will unregister the handler. > + > + @retval EFI_SUCCESS The watchdog timer handler was registered. > + @retval EFI_ALREADY_STARTED NotifyFunction is not NULL, and a handler is already > + registered. > + @retval EFI_INVALID_PARAMETER NotifyFunction is NULL, and a handler was not > + previously registered. > + > +**/ > +STATIC > +EFI_STATUS > +EFIAPI > +WdogRegisterHandler ( > + IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This, > + IN EFI_WATCHDOG_TIMER_NOTIFY NotifyFunction > + ) > +{ > + // ERROR: This function is not supported. > + // The hardware watchdog will reset the board > + return EFI_INVALID_PARAMETER; Michael, Liming - what's your take on this? Is EFI_WATCHDOG_TIMER_ARCH_PROTOCOL suitable for use with a pure-hw watchdog such as this? If so, what would be a suitable return code here? EFI_INVALID_PARAMETER does not look ideal. / Leif