Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2253892imm; Mon, 28 May 2018 04:51:22 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrSoWdhstc0eiw8z153eNpLLI+InAJvU7vkT1fgA3n2esdH8CJz37vs/PsfojS4s1DJ3EoR X-Received: by 2002:a65:4d8e:: with SMTP id p14-v6mr10005228pgq.296.1527508282871; Mon, 28 May 2018 04:51:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527508282; cv=none; d=google.com; s=arc-20160816; b=fUqRQEZqc9kRQ+Ehb62YHk8NUzadlMb/47Pw3M4dZm6ycwFbGwIUt+Y6t4wWlqa3zq j/MmTPkmgBMu7/ixHHBJwilzaT6z0pAODFioDJ3DbKV8vE038vB/zUdAd7CjL63NvZc3 hbgd9GyZNVsLxxyy3Aa5BsgInIWOGvpeIAJheGkur7OPxy2zYb0b/ZeOsJurvmR+dPn+ 2uwWd3xwaLMzopcTlVLOSka9mM2T52re35b+xuF75CAZnRYZnJAd9WkRTA7Ru92XYqe8 6x/Ptet/0hpqmgBatzmtXplPRztyPBAXKdcEUYXDJAk4sXgtPDkJM/wU6kS21UP/4Sw0 0wTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=i0BHAHCp2KrN4Bs0SRHGZhEQRdsQ1Ue2en3QnWZ515Q=; b=jovY13yAu2gtURcNy4Gwyf/Ht2Y/mJ7LT5BSNavwZPsbNGGXtAJs5p3tLDwEHD4efC 5GKYun6guWUWI6SISuoJ1n2LTCS+yVltoQr4lEj0vrqDJ2722mULsKd3AVfOTAzVKL3N oT8x07VWRriFxocXAZNbsa4c1d7QC85GubJU2i+bbkEsvqSP/T3f3NGYNS6hEsT/kRx4 LEh94bfmvYSfKg/y4Pus/FdJZXLwiMoVHzuu4boaKOhYALekF8/fPufSD0wb6PT824km h+v5QIM0biwWjw3p0UB1/erFoxKFTkhTix8zr9Uzq3PGClK/rcIh1i8RlYzxlqR8tRYo k4Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yY2+BsNX; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u9-v6si23488186pgv.313.2018.05.28.04.51.07; Mon, 28 May 2018 04:51:22 -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=@kernel.org header.s=default header.b=yY2+BsNX; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424942AbeE1Lt3 (ORCPT + 99 others); Mon, 28 May 2018 07:49:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:58222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423869AbeE1LKH (ORCPT ); Mon, 28 May 2018 07:10:07 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 31B4020845; Mon, 28 May 2018 11:10:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527505806; bh=9A2N5DxDJYtlTGUC1b9S9GDKy8HHl0QOE4UK4UFjj44=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yY2+BsNXbNbk0L2S/iZaA5VEQEA7NBjtCdtPmNBz2NnzkINnRQCKaSQJFZiaI3OXK EIKa2zm8D+5sdDt5X9BO0mUpK6CxZWhSb3LSSceNSC/+goIkwqJ8y8Kyz87kmaQNyo i0Kjh2NY9F/w1dJnT8z9ehY52KM9qTvMnLYIc8gY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Milton Miller , Eddie James , Joel Stanley , Guenter Roeck , Wim Van Sebroeck , Sasha Levin Subject: [PATCH 4.16 135/272] watchdog: aspeed: Allow configuring for alternate boot Date: Mon, 28 May 2018 12:02:48 +0200 Message-Id: <20180528100252.405881036@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100240.256525891@linuxfoundation.org> References: <20180528100240.256525891@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Milton Miller [ Upstream commit 6ffa3402211acc30e47e691e14d62f3fd065a54e ] Allow the device tree to specify a watchdog to fallover to the alternate boot source. The aspeeed watchdog can set a latch directing flash chip select 0 to chip select 1, allowing boot from an alternate media if the watchdog is not reset in time. On the ast2400 bank 1 also goes to flash bank 1, while on the ast2500 the chip selects are swapped. Also clear the secondary boot bit during the machine restart operation. Otherwise, the system will switch to the alternate boot after every reboot, which is not desired. Signed-off-by: Milton Miller Signed-off-by: Eddie James Reviewed-by: Joel Stanley Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/watchdog/aspeed_wdt.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/watchdog/aspeed_wdt.c +++ b/drivers/watchdog/aspeed_wdt.c @@ -46,6 +46,7 @@ MODULE_DEVICE_TABLE(of, aspeed_wdt_of_ta #define WDT_RELOAD_VALUE 0x04 #define WDT_RESTART 0x08 #define WDT_CTRL 0x0C +#define WDT_CTRL_BOOT_SECONDARY BIT(7) #define WDT_CTRL_RESET_MODE_SOC (0x00 << 5) #define WDT_CTRL_RESET_MODE_FULL_CHIP (0x01 << 5) #define WDT_CTRL_RESET_MODE_ARM_CPU (0x10 << 5) @@ -158,6 +159,7 @@ static int aspeed_wdt_restart(struct wat { struct aspeed_wdt *wdt = to_aspeed_wdt(wdd); + wdt->ctrl &= ~WDT_CTRL_BOOT_SECONDARY; aspeed_wdt_enable(wdt, 128 * WDT_RATE_1MHZ / 1000); mdelay(1000); @@ -242,6 +244,8 @@ static int aspeed_wdt_probe(struct platf } if (of_property_read_bool(np, "aspeed,external-signal")) wdt->ctrl |= WDT_CTRL_WDT_EXT; + if (of_property_read_bool(np, "aspeed,alt-boot")) + wdt->ctrl |= WDT_CTRL_BOOT_SECONDARY; if (readl(wdt->base + WDT_CTRL) & WDT_CTRL_ENABLE) { /*