From patchwork Wed Jul 11 06:46:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 942335 X-Patchwork-Delegate: monstr@monstr.eu 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=none (p=none dis=none) header.from=xilinx.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="HhmE2pRC"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41QV4G19Khz9s01 for ; Wed, 11 Jul 2018 16:47:26 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id D45F2C21E26; Wed, 11 Jul 2018 06:47:02 +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=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 8E0A0C21E26; Wed, 11 Jul 2018 06:46:53 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7792CC21E4F; Wed, 11 Jul 2018 06:46:47 +0000 (UTC) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by lists.denx.de (Postfix) with ESMTPS id 06436C21DF3 for ; Wed, 11 Jul 2018 06:46:43 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id z6-v6so15279550wma.0 for ; Tue, 10 Jul 2018 23:46:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=Qv2S2sfiXMpWGEFe+BGKJNiHt8snPElLnouTWI1ZiFQ=; b=HhmE2pRC0AzEIaFRanVxukV99Ih7sCVfhI4lwNxbW8B7z5rhA8n6u4dVBL/h0IOw9G 3gAQM0c2LNJyb7rlnPM7vtzaWs90D2efcGx1l4ij3MGc9Z3N6RMSNb8gpEm/GTRBz0Hz 8+s4H1m1xx2UOTxFmNm6EUjHNA7vC+dcKjpjEhg93fMJRNt60PfHNEmoqwhwayaK7TnZ vRp/dKYhi4FfyzApnoaqKFmnMa4mEgE2wUIvkSpJ8w7zIl8QnrzAuqUvs/tHehsNm2gl MXi8WdhXe5R9HobLAqrGRgvz8as7jI2xW6s8GVT7mniKQ95HxOhrXlh3d8gh1/8+UlRy AEtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=Qv2S2sfiXMpWGEFe+BGKJNiHt8snPElLnouTWI1ZiFQ=; b=OwgCcB+wMObyHrrnUONsGreF5Srh6avGo2Kf1DvtgzK9BsSTZ6tpZUdeD0UJwW+4M4 v5EdHjb3FePSmi113daqUUXXJvZE+A5ZRXk68K0sydV8yKh3wsw21UEsM08AWHCKwO84 WxzIj5NLvjjFg9nxEjvRSBMlndimZfGcjP8fCsv9cM7ToAHF8le1NFqSCIpjt/0+owfk zOG9KfGPfS+NDKQjeaJ/fy0q7CiVsXvff2vYXJQ5NGy5tqd/qKhSbNnLGoUFUfctZF9b rt4cmh4nW0HbHUTXhtE7gK1Fu2qpabKdi/l7tKiQiXGx+hcEvVGs/FUUsiHrDPY0dRJ9 US5Q== X-Gm-Message-State: APt69E2W8HHH7Cw/hX8ikkDj4oYEjyv4qrSr8vYQi5+9yvDFKtX06RI1 Qs8Bxx6rfB3lDuUx0sQHaeSYxkbs X-Google-Smtp-Source: AAOMgpeVAjvoH6AYRwfcT3yziFsDk9Jo00QmUJM7s0RPWZ9O4p8J1bbXgAv/Xl9THRg60QrjGo6f5Q== X-Received: by 2002:a1c:a813:: with SMTP id r19-v6mr8469230wme.100.1531291602505; Tue, 10 Jul 2018 23:46:42 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id t9-v6sm1058124wmh.41.2018.07.10.23.46.41 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 10 Jul 2018 23:46:41 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de Date: Wed, 11 Jul 2018 08:46:39 +0200 Message-Id: <9e422e39f59faadef36175d422353917fe8de2dd.1531291597.git.michal.simek@xilinx.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <255cc4b92dfab1a064c3fe73b7b7ceaa13762c76.1531291597.git.michal.simek@xilinx.com> References: <255cc4b92dfab1a064c3fe73b7b7ceaa13762c76.1531291597.git.michal.simek@xilinx.com> In-Reply-To: <255cc4b92dfab1a064c3fe73b7b7ceaa13762c76.1531291597.git.michal.simek@xilinx.com> References: <255cc4b92dfab1a064c3fe73b7b7ceaa13762c76.1531291597.git.michal.simek@xilinx.com> Subject: [U-Boot] [PATCH 2/2] arm: zynq: Try to enable the first watchdog via aliases 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The same change as was done for zynqmp with this description: Add support for enabling the first watchdog pointed via aliases. DT fragment: aliases { ... watchdog0= &watchdog0; watchdog1 = &watchdog_lpd; ... }; Till this patch the first watchdog found in DT was used and started which is not enabling all possible configuration based on user request. Signed-off-by: Michal Simek --- board/xilinx/zynq/board.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c index 1106f5c2a892..9c005e40e895 100644 --- a/board/xilinx/zynq/board.c +++ b/board/xilinx/zynq/board.c @@ -36,12 +36,16 @@ int board_early_init_f(void) int board_init(void) { #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_WDT) - if (uclass_get_device(UCLASS_WDT, 0, &watchdog_dev)) { - puts("Watchdog: Not found!\n"); - } else { - wdt_start(watchdog_dev, 0, 0); - puts("Watchdog: Started\n"); + if (uclass_get_device_by_seq(UCLASS_WDT, 0, &watchdog_dev)) { + debug("Watchdog: Not found by seq!\n"); + if (uclass_get_device(UCLASS_WDT, 0, &watchdog_dev)) { + puts("Watchdog: Not found!\n"); + return 0; + } } + + wdt_start(watchdog_dev, 0, 0); + puts("Watchdog: Started\n"); # endif return 0;