Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3988091ybl; Mon, 26 Aug 2019 03:48:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqx774OkKrh35l7I3vs1Jhqdp+/nicZFjC0iz5HTto1O1QJaXD3SJMj9LBDCubJZkSphoLZi X-Received: by 2002:a17:902:9f8e:: with SMTP id g14mr18520708plq.67.1566816500064; Mon, 26 Aug 2019 03:48:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566816500; cv=none; d=google.com; s=arc-20160816; b=b/uPfmW1r5K010Dellr077oqgVFm0eG9WNon5NuQ9bPJTJVpNhyH8mrgBLhl+aQq9i Go3tKFHUURJD3nuNjxKhiYJaayUjeHBkdXld02UoDHvhEzrAGzKVG9bBxBmXHxhJhI0V 5e5A3HNhQFgDBv+YWSTolsgigunEYhEW2dnmByZDz7qTKjqfl94llMdxaN8xEuLkw7S5 dT0AAiCwLq/4p5DptaFjI4CmLZU+TLVWR06aYY5t/vNIlFRqRca9itcS7hWjqJszb6i4 GtaWmtmpPgWwN8G3ay2vftPp8mCKDlQkKNTqXxOPuDHZ3n4ejz3n52fBVuG9MBgos2Q7 X8SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=2VMmvoizXLJhz1+Z3KFd6IWAGIqHu70L0r9CBzVLfX8=; b=UBHPv0HlvWmk6QDTPCksJN5oa/Q1DSSKIi0JTCGaoRVYeQFiaoCfDksNr9tbg60bCH 1rIAk4IG+/G6Jt+GXOJVUY0l0/T5MxBU3nrnjh8C/Mia9nqsv6HxjUbjm2/wK4A8tzwI Jid5j3/MyOZbvg2gA5ka4/FolANDVHPhZeeRq/SaBLLWdsYOnoRboJjfavsdNTeTPIuw pU+iLy6oAOtMPbjKMtAfyiwwFS+ASkFmIHwnj2DiF6q4neQNPmlcBsKiWHSU27SWQqlK mKGFZt2CgCf0OGMLQCtAO3Ezre/ECaAxKTFxKkGRg+NP5t4sbyitA3YQ0n5jvTCV5tke cLrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yadro.com header.s=mta-01 header.b=ALFSZARy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yadro.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y9si4845085pfm.25.2019.08.26.03.48.04; Mon, 26 Aug 2019 03:48:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@yadro.com header.s=mta-01 header.b=ALFSZARy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yadro.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728335AbfHZKrH (ORCPT + 99 others); Mon, 26 Aug 2019 06:47:07 -0400 Received: from mta-02.yadro.com ([89.207.88.252]:52204 "EHLO mta-01.yadro.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726616AbfHZKrH (ORCPT ); Mon, 26 Aug 2019 06:47:07 -0400 Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id 8419741207; Mon, 26 Aug 2019 10:47:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :x-mailer:message-id:date:date:subject:subject:from:from :received:received:received; s=mta-01; t=1566816424; x= 1568630825; bh=E0To92lhfBhY9mEETsPSthtYRPyNoja4M5DFFsTt9Ls=; b=A LFSZARyfhqWZ0wv/zS+CIhcPTOLiRshZGcTrNxWggrezE6NMBDO2Zzx4biq3zkhF xzpoTdWFpQtDrj07Szv56ALheb7oiVfkNSpup4XmoSR6k3gNW3n3hHIBbhtoYPNP dcKVeYh1zEsGhbbh3gMH4B0+saEniXUZwgIGqaNBGc= X-Virus-Scanned: amavisd-new at yadro.com Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yfcsvvo-M9Rz; Mon, 26 Aug 2019 13:47:04 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id 3768B41206; Mon, 26 Aug 2019 13:47:02 +0300 (MSK) Received: from localhost.dev.yadro.com (172.17.15.69) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Mon, 26 Aug 2019 13:47:02 +0300 From: Ivan Mikhaylov To: Guenter Roeck , Wim Van Sebroeck CC: Joel Stanley , Andrew Jeffery , , , , , Alexander Amelkin , , Rob Herring , Mark Rutland , , Ivan Mikhaylov Subject: [PATCH v2 0/4] add dual-boot support Date: Mon, 26 Aug 2019 13:46:32 +0300 Message-ID: <20190826104636.19324-1-i.mikhaylov@yadro.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.17.15.69] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ASPEED SoCs support dual-boot feature for SPI Flash. When strapped appropriately, the SoC starts wdt2 (/dev/watchdog1) and if within a minute it is not disabled, it goes off and reboots the SoC from an alternate SPI Flash chip by changing CS0 controls to actually drive CS1 line. When booted from alternate chip, in order to access the main chip at CS0, the user must reset the appropriate bit in the watchdog hardware. There is no interface that would allow to do that from an embedded firmware startup script. This commit implements support for that feature: * Enable 'alt-boot' option for wdt2 * Enable secondary SPI flash chip * Make it possible to get access to the primary SPI flash chip at CS0 after booting from the alternate chip at CS1. A sysfs interface is added to provide an easy way for embedded firmware startup scripts to clear the chip select bit to gain access to the primary flash chip in order to allow for recovery of its contents. Ivan Mikhaylov (4): vesnin: add wdt2 section with alt-boot option vesnin: add secondary SPI flash chip watchdog/aspeed: add support for dual boot dt-bindings/watchdog: Add access_cs0 option for alt-boot .../bindings/watchdog/aspeed-wdt.txt | 7 +++ arch/arm/boot/dts/aspeed-bmc-opp-vesnin.dts | 12 ++++ drivers/watchdog/aspeed_wdt.c | 62 ++++++++++++++++++- 3 files changed, 80 insertions(+), 1 deletion(-) -- 2.20.1