From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::429; helo=mail-pf1-x429.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) (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 93FBE2119BBC4 for ; Thu, 20 Dec 2018 07:01:02 -0800 (PST) Received: by mail-pf1-x429.google.com with SMTP id b85so1058623pfc.3 for ; Thu, 20 Dec 2018 07:01:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ark9ARSyofvs/n/K+Jkev1P4ZCArAZ8P4ShjTHnUwVE=; b=MRzfsT8NjQPm0mNSDT1oB24GV469UExUJOWbdXX+9zvMUHHsHw5F/c/SyGIpIpJG05 C/M749CKsBhAJtiUxalWdEFupFXanwqkdhsRbD/gwoo0phLjaK6+lA8OOE4biYz4FS1i VsEtQn8N2tf5Udlio6y/wblgZ+j3sH/8sEIKE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ark9ARSyofvs/n/K+Jkev1P4ZCArAZ8P4ShjTHnUwVE=; b=ueY+InG/Cubxf6WptqpGx9bOJnfLHLe1rSyzwOAAHeOO4Sv2I/81w73pVI5bpfcMdx RH3FWI+FOaR9smU3hzKLVZ1sbJJ9mSAqsWqNw6FQfr1rWxbeY6k4BMEvX14oEJ380Ohn JeOeXp5WeLeY4f+AEgcdwjVbXT6PwDf/Z3nCI7v/nH7Ih+rezOur2TOfMw4kFIhCbiyp v18gbghaw9VXbBiYJQbTqEULpH1FPb8msHrYinjnUN8PQIRjvAfmwrRiSwRrkpSSO9g+ HFF1Ahd1jn+uu1WR7XNgpYdPRPyYYnm06Y01d3U0H2kD4NPkMev18IZsMh1n8+WsGDY+ nkMA== X-Gm-Message-State: AA+aEWbuo7Iu9rMbwfStdwooQWUcS9z7gox1dhQaK6AUex5u87fWzPL/ pF/BvQGNzd3LqkMsyo3pgma3tQ== X-Google-Smtp-Source: AFSGD/WAqsMNrjGwH5Dp8cujRvPK90AbKSfJlsNQgjLJEa7GMB+MkS5CZ7auyPhU5KLK//vaGmQp5w== X-Received: by 2002:a63:ba4d:: with SMTP id l13mr10365244pgu.194.1545318061785; Thu, 20 Dec 2018 07:01:01 -0800 (PST) Received: from [10.182.0.126] ([64.64.108.144]) by smtp.gmail.com with ESMTPSA id y89sm31312793pfa.136.2018.12.20.07.00.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Dec 2018 07:01:01 -0800 (PST) To: Leif Lindholm , Sami Mujawar , Thomas Panakamattam Abraham Cc: Meenakshi Aggarwal , Udit Kumar , Ard Biesheuvel , "edk2-devel (edk2-devel@lists.01.org)" , Heyi Guo , Matteo Carlini , Nariman Poushin References: From: Ming Huang Message-ID: <0e2c9959-21c0-3af3-0ee8-b1ff4a11b99e@linaro.org> Date: Thu, 20 Dec 2018 23:00:49 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: Subject: Re: SP805 driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Dec 2018 15:01:02 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit On 12/17/2018 8:55 PM, Leif Lindholm wrote: > Hi Sami, Thomas, (and others on cc) > > NXP are upstreaming a set containing an implementation of  > EFI_WATCHDOG_TIMER_ARCH_PROTOCOL using a hardware watchdog as backing. > This idea comes from the SP805 driver ArmPlatformPkg/Drivers/SP805WatchdogDxe, which does the same. > > The problem is that this is a horrible idea. The point of the EFI_WATCHDOG_TIMER_ARCH_PROTOCOL is that it lets you schedule software events when the watchdog timer expires. However, the SP805 driver does not let you do this: > > EFI_STATUS > EFIAPI > SP805RegisterHandler ( >   IN CONST 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; > } > > From section 12.14 of the PI 1.6 spec: > "If no handler has been registered, or the registered handler returns, then the system will be reset by calling the Runtime Service ResetSystem()." > Blatantly, any driver that does the above (and initializes hardware that will reset the system without software control) will violate this. > > Meanwhile, the only two ARM platforms that include this driver are TC2 and FVP. > > Now, NXP are not at fault for following examples given to them in the reference ARM driver section - but can we please keep further people from making the same mistake? > So my question to {Sami|Thomas} is - can we nuke this driver, and if so, can you provide the patches to remove it from edk2 and the resulting ones needed for edk2-platforms? > > I have no issues with reintroducing a fixed SP805 driver in the future that does not claim to conform to the above protocol. > > Finally - both the D03 and D05 platform .dsc files, as well as the Hisilicon ArmPlatformLib, contain references to it. (Ming/Heyi - please provide a patch.) OK. Thanks. > > / >     Leif