From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FC0CC3A5A1 for ; Thu, 22 Aug 2019 13:55:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3210F22CE3 for ; Thu, 22 Aug 2019 13:55:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IROi/sU6"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IHwJHSCr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3210F22CE3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cn47LbYyoFwldeUqC1wZsz+WKMVWCg+Br977j+wIPoA=; b=IROi/sU6KBFptx aRwBeVF7he9sZQQLRPpDSLE6Z2YGI7IYuho2nx4eaKU6cr5fKDGeSK7tTj9Rq6Cc6XjjJn0YJQ4Dj z6Zs7O459sk/uNTxzEqcA/EKooa2hJ/9aCdxeOwAjmHUBj6HdQO//litIu/55Xv6evqWMuK8+6/aU eJFk/ivHrxBrjkolHcX/roAqmpRM3deZ+eVLW273MxgQVKeTZau5BjpMwnezzW7i96QauamYcQBHV 0PFNVJihwt+Spjh0REKV27e+TTJtfFshlY3x2gNNF60Ha7DH52IkgFFpBAYF3IlY/leX4Rg1W7lKR 1n23uaScf/5chFj0VUsQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i0nYt-0006WN-Lv; Thu, 22 Aug 2019 13:55:35 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i0nYq-0006Vg-Mm for linux-arm-kernel@lists.infradead.org; Thu, 22 Aug 2019 13:55:34 +0000 Received: by mail-pf1-x441.google.com with SMTP id g2so4038469pfq.0 for ; Thu, 22 Aug 2019 06:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=pVS9WjZ8RWCSBv6JVW5/oNJDRTIjY7tJwBPEyclsS3s=; b=IHwJHSCrZqwuxLg+z9PPuWxBtzeGhgAcD9jbCyNf7SVvnbEYEC7sAULbMT2EfPFyng 9Gu6yf9O1eH34wTMSQkb3aF/w9vUZKZHXAqzau1Zs48p0Q9w0ZJI90Qx/i2B92E2BH/m aPAxH9UWBwnGkUXLyHcpJqvRw8GzmYZGDYi07ux6OMSttTDL7fSOevIObEPBOiGEM6Cq G7suHv7mIKdp15Tk4i8uRrjOH5Oh3qtPH6lxCTvPOo1Ti9O4Nlhzcj1x+Luj6OEiPDFV 2suCvr6o6JxtVothsXeejOPG1tN3DA4OWAOosJkqclGKmUrtEx/0h4IHi/gdwB5Sz17U ECmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=pVS9WjZ8RWCSBv6JVW5/oNJDRTIjY7tJwBPEyclsS3s=; b=mpWnSmA6bSjbeFuKY4tHgzAvCmRIwGqgDw6ZY50AoG846sGHQl4xISFyBjMoDeVBjQ +GKrACdkJkEiaqDUKpna1l7DxdnAMzuMMV/kEE0UcomswGmGjXUgckResTxI094EaYYS epin4krDnVa68Uv1hIPYfJ9IdBT8Huj7LJZ4vcZFC/Go0KJTxkXVCzTL91sHNXqtE9R2 rHtr0uAAoLeGU6kBDLAz6uD3WoFYq8jCgbKrojxnMWdFHMr7ARh5e7LtRfSXfwc9v14d HnpnJemf/Gge5gaOqm7Sn5944702zEbyn3dLSdb98loIF80QKn/xX40jscX7iqj9u0g/ /Now== X-Gm-Message-State: APjAAAX/1HQDBgd3Vl3Uc+hIyjIo5A2EwoT6h+xWX5BCMibNwcC+yXEd CzE3KnvfRdAoQqvGIakO8Wg= X-Google-Smtp-Source: APXvYqzUGuZQ6dNDWJuoxeDgwfknlEuPoT5poRPywocRNFuXhtyT1qaDxcSK+l4Xj7UZ6pJX7sV9IQ== X-Received: by 2002:a17:90a:bd0b:: with SMTP id y11mr5304283pjr.141.1566482130453; Thu, 22 Aug 2019 06:55:30 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id e13sm33247202pfl.130.2019.08.22.06.55.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Aug 2019 06:55:29 -0700 (PDT) Date: Thu, 22 Aug 2019 06:55:28 -0700 From: Guenter Roeck To: Ivan Mikhaylov Subject: Re: [PATCH 3/3] watchdog/aspeed: add support for dual boot Message-ID: <20190822135528.GB8144@roeck-us.net> References: <1f2cd155057e5ab0cdb20a9a11614bbb09bb49ad.camel@yadro.com> <20190821163220.GA11547@roeck-us.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190822_065532_748047_EDE499C6 X-CRM114-Status: GOOD ( 23.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-watchdog@vger.kernel.org, linux-aspeed@lists.ozlabs.org, Andrew Jeffery , Alexander Amelkin , linux-kernel@vger.kernel.org, Joel Stanley , Wim Van Sebroeck , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Aug 22, 2019 at 12:15:20PM +0300, Ivan Mikhaylov wrote: > On Wed, 2019-08-21 at 09:32 -0700, Guenter Roeck wrote: > > > > > + writel(WDT_CLEAR_TIMEOUT_AND_BOOT_CODE_SELECTION, > > > + wdt->base + WDT_CLEAR_TIMEOUT_STATUS); > > > + wdt->wdd.bootstatus |= WDIOF_EXTERN1; > > > > The variable reflects the _boot status_. It should not change after booting. > > Okay, then perhaps may we set 'status' handler for watchdog device and check > 'status' file? Right now 'bootstatus' and 'status' are same because there is no > handler for 'status'. > You would still have to redefine one of the status bits to mean something driver specific. You would also still have two different flags to read and control cs0 - to read the status, you would read an ioctl (or the status sysfs attribute), to write it you would write into access_cs0. I guess I must be missing something. What is the problem with using access_cs0 for both ? Guenter > > > + > > > + return size; > > > +} > > > +static DEVICE_ATTR_WO(access_cs0); > > > + > > > +static struct attribute *bswitch_attrs[] = { > > > + &dev_attr_access_cs0.attr, > > > + NULL > > > +}; > > > +ATTRIBUTE_GROUPS(bswitch); > > > + > > > static const struct watchdog_ops aspeed_wdt_ops = { > > > .start = aspeed_wdt_start, > > > .stop = aspeed_wdt_stop, > > > @@ -223,6 +248,9 @@ static int aspeed_wdt_probe(struct platform_device > > > *pdev) > > > > > > wdt->ctrl = WDT_CTRL_1MHZ_CLK; > > > > > > + if (of_property_read_bool(np, "aspeed,alt-boot")) > > > + wdt->wdd.groups = bswitch_groups; > > > + > > Why does this have to be separate to the existing evaluation of > > aspeed,alt-boot, and why does the existing code not work ? > > > > Also, is it guaranteed that this does not interfer with existing > > support for alt-boot ? > > It doesn't, it just provides for ast2400 switch to cs0 at side 1(cs1). Problem > is that only one flash chip(side 1/cs1) is accessible on alternate boot, there > is citation from the documentation in commit body. So if by some reason side 0 > is corrupted, need to switch into alternate boot to cs1, do the load from it, > drop that bit to make side 0 accessible and do the flash of first side. On > ast2500/2600 this problem is solved already, in alternate boot there both flash > chips are present. It's additional requirement for alternate boot on ast2400, to > make the possibility to access at all side 0 flash chip after we boot to the > alternate side. > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel