From patchwork Wed Apr 17 17:41:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 1087077 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cQPotjhD"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44kqLf62QVz9s5c for ; Thu, 18 Apr 2019 03:42:18 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 4E69FC21E26; Wed, 17 Apr 2019 17:41:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 8F5FFC21EC3; Wed, 17 Apr 2019 17:41:14 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 37540C21EBF; Wed, 17 Apr 2019 17:41:07 +0000 (UTC) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by lists.denx.de (Postfix) with ESMTPS id 55400C21EE7 for ; Wed, 17 Apr 2019 17:41:04 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id h18so4628052wml.1 for ; Wed, 17 Apr 2019 10:41:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aNZT0oQ+uLLsSV4K3Cj1gpGxYAIUo69aYuIirLtzKFw=; b=cQPotjhDw/t/dxeHagNhsK8ucz0t9HkGhpjqWZcdBhESO27DDc0slBIMMRd55IVsy3 pTVssXRgWjzh2bRPLoAepSfs24BogEOY9ON6DNZPKMk+zoX2QWFmdTzxJu+y7Xqy/jck GISKTynLvSuuFVMSsLIA7beyheHYMSZprzHQLfyAyBvAB/nfVgVaRrdAtQa1aEesyjm2 x+lqt7iEUyvXxZ9dw2XZJIfZ7j1x8mYvdW14qkWBlBBXrR4MKOULr8b5RcpC6aOAgC65 7sTGErNkIj/992vRXQY+10Le4/mklmNAK9vb+3qhaYWg4ihrt4nOfaRT2SuAsp6j4tQf fNgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aNZT0oQ+uLLsSV4K3Cj1gpGxYAIUo69aYuIirLtzKFw=; b=TpWmyzEJDmPvHw1jvFXLXp/SvamMUnyQEAWw6BwunGKyc3NnvewrRviVulerECtXj4 9OKohgmmPo4CzekYMTfAGZYQTy0DDOd8v3p146WM5TN51ntBKKzziktmCBJlgOTlmWg4 J6v2RkGSj3J+kuJLpF6e/9nVYqY3StjUEDBVO9kPx5XspcQ5P8FPK1bkAuhop1RDdfOY vCINOM+7HjKYRUVLW3OTDGWTxrcBrSwZMDD9XgygWxUsblRfO9LSSd1RikHgY/8WzZZK 20nUECbLivJerK0MHvG0pv66dVAxGLCwNsFn+USywxo4BFC/NmS89l35U0Ox6AhQZEgp RW4Q== X-Gm-Message-State: APjAAAXUxSHg9UJxOMS6dZQRv2XNyiVR1wpvwaPpbMLX9hIb1CY0zABs 77FogvWRHEojIOovxSeoq/4= X-Google-Smtp-Source: APXvYqz8vS0AL9zDADjbMW7i8QJnD4/a2J8eebTBAsCHND00QOkOapTi+SGTBBg7uYHtJvhG/wUv4A== X-Received: by 2002:a1c:c786:: with SMTP id x128mr652365wmf.152.1555522863846; Wed, 17 Apr 2019 10:41:03 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0::df7e:4a05]) by smtp.gmail.com with ESMTPSA id y18sm4271789wro.80.2019.04.17.10.41.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Apr 2019 10:41:02 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Jagan Teki , Maxime Ripard Date: Wed, 17 Apr 2019 19:41:05 +0200 Message-Id: <20190417174105.27440-4-peron.clem@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190417174105.27440-1-peron.clem@gmail.com> References: <20190417174105.27440-1-peron.clem@gmail.com> MIME-Version: 1.0 Cc: U-Boot-Denx , linux-sunxi Subject: [U-Boot] [PATCH v3 3/3] arm: sunxi: h6: fix reset using r_wdog X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" WDOG is broken for some H6 rev. The board is not reseted correctly. Use the R_WDOG instead. Signed-off-by: Clément Péron --- arch/arm/include/asm/arch-sunxi/cpu_sun50i_h6.h | 1 + arch/arm/mach-sunxi/board.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/arch-sunxi/cpu_sun50i_h6.h b/arch/arm/include/asm/arch-sunxi/cpu_sun50i_h6.h index 41a9b0fc47..6392cb07b4 100644 --- a/arch/arm/include/asm/arch-sunxi/cpu_sun50i_h6.h +++ b/arch/arm/include/asm/arch-sunxi/cpu_sun50i_h6.h @@ -60,6 +60,7 @@ #define SUNXI_RTC_BASE 0x07000000 #define SUNXI_R_CPUCFG_BASE 0x07000400 #define SUNXI_PRCM_BASE 0x07010000 +#define SUNXI_R_WDOG_BASE 0x07020400 #define SUNXI_R_PIO_BASE 0x07022000 #define SUNXI_R_UART_BASE 0x07080000 #define SUNXI_R_TWI_BASE 0x07081400 diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c index c6dd7b8e54..921e4c5175 100644 --- a/arch/arm/mach-sunxi/board.c +++ b/arch/arm/mach-sunxi/board.c @@ -289,9 +289,14 @@ void reset_cpu(ulong addr) writel(WDT_MODE_RESET_EN | WDT_MODE_EN, &wdog->mode); } #elif defined(CONFIG_SUNXI_GEN_SUN6I) || defined(CONFIG_MACH_SUN50I_H6) +#if defined(CONFIG_MACH_SUN50I_H6) + /* WDOG is broken for some H6 rev. use the R_WDOG instead */ static const struct sunxi_wdog *wdog = - ((struct sunxi_timer_reg *)SUNXI_TIMER_BASE)->wdog; - + (struct sunxi_wdog *)SUNXI_R_WDOG_BASE; +#else + static const struct sunxi_wdog *wdog = + ((struct sunxi_timer_reg *)SUNXI_TIMER_BASE)->wdog; +#endif /* Set the watchdog for its shortest interval (.5s) and wait */ writel(WDT_CFG_RESET, &wdog->cfg); writel(WDT_MODE_EN, &wdog->mode);