From patchwork Wed Jul 11 06:46:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 942334 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="1E3rAkoh"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41QV3Y6pYYz9s01 for ; Wed, 11 Jul 2018 16:46:49 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 98CF9C21D72; Wed, 11 Jul 2018 06:46:46 +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 E2FC0C21D72; Wed, 11 Jul 2018 06:46:42 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id EE02AC21D72; Wed, 11 Jul 2018 06:46:41 +0000 (UTC) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by lists.denx.de (Postfix) with ESMTPS id 7258FC21C29 for ; Wed, 11 Jul 2018 06:46:41 +0000 (UTC) Received: by mail-wm0-f65.google.com with SMTP id s12-v6so1263904wmc.1 for ; Tue, 10 Jul 2018 23:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:subject:date:message-id; bh=Lne0/WJPitzx/3F/feTuOSw/T5XE6efUE39+WEk+zRg=; b=1E3rAkohUpMq9cW9zJI6bPVMeLhFB6D3uk99fnYTn0Ruy38ZvHDzCNdTddXsRytGs9 B0JR1Y4TNLMlvVNWcNNYFutxAxhtWPVbGuowzqTwq+inwx6gR02zIvnpreHVqxVoxN1R OSI67AQm10x8nR8iH3GrDa3ooa3YWfMj4voysGWFpdwDr5Qoj3aPhvTwBLoYnkAgBmgU 5j1e0rgpk8z48shk/L8QfFX09Qxwj0rnESLrY/adW/UjC22GxM+yVxpbiU1/AZvNSpbr A785rKW45IFX7fRaPiCSKZ2EH+znHsiiiTWW1To86hc0jDUsayt2402CRtiW1t3IdA5l 9Wtg== 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:subject:date:message-id; bh=Lne0/WJPitzx/3F/feTuOSw/T5XE6efUE39+WEk+zRg=; b=OeCihQ4VKWMVClPHb/F433SBSV31PeHE53RqtoiZxGbTYGvOouKHG2Kkt2H7kkn3hL e+YJAc7jBO9fEqfRIpBRk0ttJbtJumMMu8ohOsY2z1BDTfqhSSxDp9c9b7N/CZXBbHG/ gsFFSKRr0yZetYjbVtoNPFYMGAqyRByUSXtPoUmEB4Q4cM2YMpLYu4luiQU8DJHJ5oXX XTDEusXrrJDynYCu7hWAviRxWTNetBLq1vEtcr6/uuWpoj76ejyMZVvx7RsRFrM1agtS t3NFmnBZ7sMxN2PMc2cAv+cRKq4f+yvDDrL3kdrPvSCVGMnef57BBcyc/R84EZvT9TaL 3utw== X-Gm-Message-State: APt69E35SVL6T5Gc/ZXbjvVItzGsvKEBD8/ptCiJV0w/jXU5nukILI/B CUo5g2tCrrzB1cM7j1ipPBT3A5ov X-Google-Smtp-Source: AAOMgpdNL5QbkuUfY1S+++BfQIn8JruYABshn/Bf0nLU7fM6rT1joBW4CIhkX25IRaAbWy89nJebRA== X-Received: by 2002:a1c:80b:: with SMTP id 11-v6mr18055494wmi.125.1531291600989; Tue, 10 Jul 2018 23:46:40 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id k13-v6sm14832964wrr.14.2018.07.10.23.46.40 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 10 Jul 2018 23:46:40 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de Date: Wed, 11 Jul 2018 08:46:38 +0200 Message-Id: <255cc4b92dfab1a064c3fe73b7b7ceaa13762c76.1531291597.git.michal.simek@xilinx.com> X-Mailer: git-send-email 1.9.1 Subject: [U-Boot] [PATCH 1/2] arm64: zynqmp: 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" Add support for enabling the first watchdog pointed via aliases. DT fragment: aliases { ... watchdog0 = &watchdog0; watchdog1 = &watchdog_lpd; ... }; dm tree fragment for above configuration with patch applied: ZynqMP> dm tree Class index Probed Driver Name ----------------------------------------- ... watchdog 0 [ ] cdns_wdt | |-- watchdog@ff150000 watchdog 1 [ + ] cdns_wdt | `-- watchdog@fd4d0000 ... dm uclass fragment: ZynqMP> dm uclass ... uclass 75: watchdog 0 watchdog@ff150000 @ 7df02f40, seq -1, (req 1) 1 * watchdog@fd4d0000 @ 7df02ff0, seq 0, (req 0) ... It is visible that index 1 is IP with seq 0 which means that FPD watchdog (@fd4d0000) is in DT below LPD watchdog (@ff150000). 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/zynqmp/zynqmp.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 3d6d00167622..cf9a923bf2af 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -312,12 +312,16 @@ int board_init(void) #endif #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; 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;