From patchwork Wed Sep 9 21:04:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1361063 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=a4n24Rjl; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BmvfT6531z9sTd for ; Thu, 10 Sep 2020 07:04:49 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BF59F822C3; Wed, 9 Sep 2020 23:04:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="a4n24Rjl"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 871F982281; Wed, 9 Sep 2020 23:04:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 09ACF82189 for ; Wed, 9 Sep 2020 23:04:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qk1-x744.google.com with SMTP id p4so3922283qkf.0 for ; Wed, 09 Sep 2020 14:04:28 -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=gugqOKvL77/UgqQL7jvmQTKiUep2DsuKw9LSkJAmgKU=; b=a4n24RjlqZAALUGXO2we/WlrvwsotKCq/w5ORYS5BWA1yShqmSRZsgFnMUYGfYzIC4 28IJRE3y3loB5Qhsd5QvdMItMbjw2n4CGu6SkBMA4TTVhKbIDDs4NEkPA3Otm1xYhzQz YlbLXFTnIgEcGWLq4OOwquQD3nNurpAUQv/C4mmmwq81aOnYDVp1Zat2ESGZDmz7tYcG KfK/vL0WWjJFW1trQ8sWC6b0u3c639XLFF0cGvkb0lQ912RbjJMdX6KKwau3iu2s4OSi 4vCbpMTU5WcoltKTuMpsZqSzxQtzZHWFECwwbTf8G1slN2+Ew53idPM4G2fVCLyRFO/i QknQ== 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=gugqOKvL77/UgqQL7jvmQTKiUep2DsuKw9LSkJAmgKU=; b=EDOGYsJlFtVRLlkTudYnhr2Sjprq3JpFvDLGrT7oToLEAGW1A2VuPkjWS/2I9Gjzp4 h2L8OfftxgJmMfrj/jbtvA3u9WmDR0T2c/I4EX9unEDa6XdPk842YpP0jXp4t5Lbtqqz XL8UQiLeDMfOwz6xV5I4FjP1fvf0ge77cBBxlFexZn9AsWCjtb38wxfVGrefvr5D6pab zAVBDfofWseS8jN3tGDIPA/cQX2OwVQUGhEtEM5tY1iUZlrC6YccV5lpdzuj3WbbRmFa z5wPYxo1qh0yIySa/ee4rQXY7oi0681oeoP1B7uXcsvi7KwdgWopEjrC+piwWBE0qrF8 3fxQ== X-Gm-Message-State: AOAM5300vBIxOZTaAHUxyM+NpyIpIlCjDNI5dwBcu26eO6/9mkTwDmbP zGJjC4n/k2CCpFo4/dsTGvNhG+M+SbDHEE9g X-Google-Smtp-Source: ABdhPJyn4bF++vCWjN5CtBeB1Q64uOYGippijq5gV5YHJ7dFHooxnUcdSrEXgWiQtJsvOdhVNxRFuQ== X-Received: by 2002:a37:62c4:: with SMTP id w187mr5101035qkb.102.1599685467812; Wed, 09 Sep 2020 14:04:27 -0700 (PDT) Received: from godwin.fios-router.home (pool-108-51-35-162.washdc.fios.verizon.net. [108.51.35.162]) by smtp.gmail.com with ESMTPSA id c40sm4664096qtb.72.2020.09.09.14.04.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 14:04:27 -0700 (PDT) From: Sean Anderson To: u-boot@lists.denx.de Cc: Bin Meng , Marek Vasut , Jagan Teki , Simon Glass , Heinrich Schuchardt , Sean Anderson Subject: [PATCH v4 1/7] wdt: dw: Switch to using fls for log2 Date: Wed, 9 Sep 2020 17:04:14 -0400 Message-Id: <20200909210420.243190-2-seanga2@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200909210420.243190-1-seanga2@gmail.com> References: <20200909210420.243190-1-seanga2@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean log_2_n_round_up is only found in arm. fls performs the same job and is generic. Signed-off-by: Sean Anderson Reviewed-by: Simon Glass --- (no changes since v2) Changes in v2: - Fix fls being off-by-one when compared to log_2_n_round_up drivers/watchdog/designware_wdt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/watchdog/designware_wdt.c b/drivers/watchdog/designware_wdt.c index 12f09a7a39..f25c8d9ab3 100644 --- a/drivers/watchdog/designware_wdt.c +++ b/drivers/watchdog/designware_wdt.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #define DW_WDT_CR 0x00 @@ -35,7 +34,7 @@ static int designware_wdt_settimeout(void __iomem *base, unsigned int clk_khz, signed int i; /* calculate the timeout range value */ - i = log_2_n_round_up(timeout * clk_khz) - 16; + i = fls(timeout * clk_khz - 1) - 16; i = clamp(i, 0, 15); writel(i | (i << 4), base + DW_WDT_TORR); From patchwork Wed Sep 9 21:04:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1361064 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=S8Mp1XHc; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bmvfb1xfBz9sTH for ; Thu, 10 Sep 2020 07:04:55 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C5583822E8; Wed, 9 Sep 2020 23:04:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="S8Mp1XHc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1DE04822C3; Wed, 9 Sep 2020 23:04:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EA8B2821ED for ; Wed, 9 Sep 2020 23:04:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qk1-x742.google.com with SMTP id g72so3876399qke.8 for ; Wed, 09 Sep 2020 14:04:29 -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=cenf7uGWY+dDk2Jni9wC9YeD0xZiaCaFFu81rkZhx1g=; b=S8Mp1XHcieR2Yrz5uhyuYn3yS62W1R1omgltj08m+vXRyBnGzmYTOZwBSr+TJUnftN Mywq+MHf3Ou+8rdtablpukHRXWy/Z7X5675hbJ9QtsG+qQ5KBwAWes7PN1vD6icC0Lg+ 56PM7/VEv4Vr1uWHDG3W0LlUslFQuFPZCkglVkgb9DPnS80XnmBBaj1gYlhFlIqdRyp5 dfxvKz13hDvwK64KMXqHgJOJwHf3huobMMQ46U0q0PpaVJn9Pf2IlbGKk4xrwJTAaZRb Fnwl0n/UDb04GTPJc8Ng9axk1+GNzpiM7AMgB4jutGBwqjgFZpnyzhyyVSxNfjyUYAYp pLOQ== 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=cenf7uGWY+dDk2Jni9wC9YeD0xZiaCaFFu81rkZhx1g=; b=Wibc7JOdhVUxkqPxDUTWrlwymcBKXYxJR3iIGFP/oSU/ffaLepp4Hcvj9cPkWGBiel GhQLnvQSaBZfLG6uSWG3Q9HfUlzanjhlD8xhmDpFLtcUFO6bl8eUyryoNhhfgwgJjrYT tmexNH0ZfbXfhXXpvlvQ7k+Nr0f5VbEg2nJ7nbVvTy6AnXlxRpRnPFsVwVynQd/Dt5N8 mS8WgTMcccLpk5bwaQRwHzcEdo8lsHblzozggy2PKcJV0V++Aj4VQIRmYmk4K8sObgq3 6NxKlrIRYZ3FpV1BQfsrk1hie3UhDGUFOkZDFILlyuoeRRaBQEhnjpyYnEJQV4n+J+9q yiGA== X-Gm-Message-State: AOAM532wrcwpSO56y43NSkYS2SWwGh5sx7bvWu2s+2CzouO73TBY233U W2B2e3r3GeoIfOSX5JHkVekqUyWwQHc5H/IN X-Google-Smtp-Source: ABdhPJx/zypjZZIRiQM5M7TdqyqdcBVjB9xZTEOapGsozpIOo0ChVGYl3lyQcrbmON1h/Yw99jRCxQ== X-Received: by 2002:a05:620a:40d0:: with SMTP id g16mr4920699qko.282.1599685468767; Wed, 09 Sep 2020 14:04:28 -0700 (PDT) Received: from godwin.fios-router.home (pool-108-51-35-162.washdc.fios.verizon.net. [108.51.35.162]) by smtp.gmail.com with ESMTPSA id c40sm4664096qtb.72.2020.09.09.14.04.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 14:04:28 -0700 (PDT) From: Sean Anderson To: u-boot@lists.denx.de Cc: Bin Meng , Marek Vasut , Jagan Teki , Simon Glass , Heinrich Schuchardt , Sean Anderson Subject: [PATCH v4 2/7] wdt: dw: Switch to if(CONFIG()) instead of using #if Date: Wed, 9 Sep 2020 17:04:15 -0400 Message-Id: <20200909210420.243190-3-seanga2@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200909210420.243190-1-seanga2@gmail.com> References: <20200909210420.243190-1-seanga2@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean This is preferred over #if because the compiler can check syntax even if the feature is disabled. This cannot be used for CONFIG_CLK because CONFIG_DW_WDT_CLOCK_KHZ is not defined on all platforms. Signed-off-by: Sean Anderson Reviewed-by: Heinrich Schuchardt --- (no changes since v1) drivers/watchdog/designware_wdt.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/watchdog/designware_wdt.c b/drivers/watchdog/designware_wdt.c index f25c8d9ab3..49cf861d46 100644 --- a/drivers/watchdog/designware_wdt.c +++ b/drivers/watchdog/designware_wdt.c @@ -136,17 +136,17 @@ static int designware_wdt_probe(struct udevice *dev) priv->clk_khz = CONFIG_DW_WDT_CLOCK_KHZ; #endif -#if CONFIG_IS_ENABLED(DM_RESET) - struct reset_ctl_bulk resets; + if (CONFIG_IS_ENABLED(DM_RESET)) { + struct reset_ctl_bulk resets; - ret = reset_get_bulk(dev, &resets); - if (ret) - return ret; + ret = reset_get_bulk(dev, &resets); + if (ret) + return ret; - ret = reset_deassert_bulk(&resets); - if (ret) - return ret; -#endif + ret = reset_deassert_bulk(&resets); + if (ret) + return ret; + } /* reset to disable the watchdog */ return designware_wdt_stop(dev); From patchwork Wed Sep 9 21:04:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1361065 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=uul26Jci; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bmvfr53BFz9sTH for ; Thu, 10 Sep 2020 07:05:06 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DFAD9822F5; Wed, 9 Sep 2020 23:04:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uul26Jci"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AB96B822C7; Wed, 9 Sep 2020 23:04:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 129A981B79 for ; Wed, 9 Sep 2020 23:04:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qk1-x743.google.com with SMTP id q63so3118629qkf.3 for ; Wed, 09 Sep 2020 14:04:31 -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=p5671etH4GHnPYP+3/WpVmT7Y9OzWOeUzc5sYYJxzIQ=; b=uul26Jci/2SurrotstSabwjUoZd8X95+w2vraNi/SQzYyUIKYpUWCKCZ30eXzXwFmK 6o9QZb/W6mAchhTmpF2cg1B+NLdmuAh6fbKYUdYkx/Yl0sBDvixb0fD6OXVkFnUbSPVk 2ktnyZsv3YIlPMSKYFhi+Y9OaVmtzMyFXKQbt2jaJquqboGvhRMsECljr6l9tP8+0B2L n0sBrt8E+AtJ608VjiFKJMWq3Isxw2lYhTYAZ3TNJ4fUpqgQ7bo+MH+dFpjlWnxmsXu4 i73qetiCxWOPRrs+Se+EgTIc7Gr3vWtvSpnIAox72XIq1AnaFLVE0XIdSxx0u5J75zOg b2oA== 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=p5671etH4GHnPYP+3/WpVmT7Y9OzWOeUzc5sYYJxzIQ=; b=TTrzkzAxO3jCU2+KnFtvSi/HBPr9ytmnl6v9Z8GoaI6zoYWZ62nSy4Y5oJhhdoxCrU FpMMaCtmfE0nhK0OpFg6oGilPMbb418EHn6/gMrMD4G96GCXrwbeFnKH6HU+sSEbgF76 +Wxd5iWPg2EG4YF79NkNINTYtvFsPVOgc/AidkZtapoYPqm5mOdGtB4PiRhYpKzsRxOz y2jSg4Bnv8+odME6b0Al6Q6GC8hv5F5wVFc8JeUNxZuQfxvIY85dsPDDwdhyQf7dxNHv +oXSP2CsKbWosx9dqNXsAC4i/wPKksMPv3G92jdZFbrg/xgsYYNPCV0ctcxqQ99kc6qL WLAA== X-Gm-Message-State: AOAM5300eQS7vBHM6GkXzu+97LuD3D6HCnpDFHFPzPIanQSTSCLwdkTu KivY6o7+tRLPeBFirGq0EPGW4RvvlEx/6O55 X-Google-Smtp-Source: ABdhPJz/Mlb7wPpbjtOnr11VRwGB5jz5tAG/OOWVG1kNnbqpuvYvQiOPb9FtdxFcrBZsNspto/toYA== X-Received: by 2002:a37:a83:: with SMTP id 125mr4819734qkk.360.1599685469799; Wed, 09 Sep 2020 14:04:29 -0700 (PDT) Received: from godwin.fios-router.home (pool-108-51-35-162.washdc.fios.verizon.net. [108.51.35.162]) by smtp.gmail.com with ESMTPSA id c40sm4664096qtb.72.2020.09.09.14.04.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 14:04:29 -0700 (PDT) From: Sean Anderson To: u-boot@lists.denx.de Cc: Bin Meng , Marek Vasut , Jagan Teki , Simon Glass , Heinrich Schuchardt , Sean Anderson Subject: [PATCH v4 3/7] wdt: dw: Fix clock rate being off by 1000 Date: Wed, 9 Sep 2020 17:04:16 -0400 Message-Id: <20200909210420.243190-4-seanga2@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200909210420.243190-1-seanga2@gmail.com> References: <20200909210420.243190-1-seanga2@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean The clock subsystem returns clock rates in Hz. We need to divide by 1000 so the rate is in kHz. Fixes: cf89ef8d10f240554541c20b2e1bdcdd58d1d7e6 Signed-off-by: Sean Anderson Reviewed-by: Simon Glass --- (no changes since v1) drivers/watchdog/designware_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/watchdog/designware_wdt.c b/drivers/watchdog/designware_wdt.c index 49cf861d46..41866fa01b 100644 --- a/drivers/watchdog/designware_wdt.c +++ b/drivers/watchdog/designware_wdt.c @@ -129,7 +129,7 @@ static int designware_wdt_probe(struct udevice *dev) if (ret) return ret; - priv->clk_khz = clk_get_rate(&clk); + priv->clk_khz = clk_get_rate(&clk) / 1000; if (!priv->clk_khz) return -EINVAL; #else From patchwork Wed Sep 9 21:04:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1361066 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Fk/SvyWE; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bmvg06fvkz9sTM for ; Thu, 10 Sep 2020 07:05:16 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 19F62822D7; Wed, 9 Sep 2020 23:04:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Fk/SvyWE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B2909822D7; Wed, 9 Sep 2020 23:04:34 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 16F2382189 for ; Wed, 9 Sep 2020 23:04:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qk1-x741.google.com with SMTP id v123so3870778qkd.9 for ; Wed, 09 Sep 2020 14:04:32 -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=JrreX9iKyIbdO+4gya0cpRD1pcSsa4XSaa270bO8Ico=; b=Fk/SvyWE4pBlsfikg9BFqKWOKcypKOW9hGmXOi/dtx3LZbEypunE8nO0/6rOiXEcZE xMypc3mf/IJuJenJe18UBT0nsGuHKhvsYlPaCVCckprnFf4Ag/Kqks8bSKvOlVfZCJoi UPXUHZUcVLbTjy/4EOuxMqOUzMJ/UEoTgra9+kF0tm0XwwQBJ85neNEMSRgQtF0DTZ9g LyFs+WFYUqa/WVlwBNwoacqh0NL9rq26TlrTC6kh20Xb+o3xCvaikv+s3KcenFF+X0ho OF0uq5l+QqCEXmAvjt7Jy+268X7iyWOpY3khBc+kJtKP1YHJKCJoCATPfV+rmktuWBLP tacw== 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=JrreX9iKyIbdO+4gya0cpRD1pcSsa4XSaa270bO8Ico=; b=g8LCQA9HcU3LSn12K/FzoksqtZL3WaWjY8AG0ltzpQ3XywsnOB2tKVWdmBOeAITE7o 7pnZo3wfWXPbyhbetKaR5tI77Dhmj7ISqBkDS0gTxdEBf2Z1QufBisWivd1nvmsY7vAY uAjd4Lq1xtrbShwqYfOLypArDhMeXOmA0T54Nq0jyuc8gkCVbcBOadwW+/eOXKURf2TA pAc0Cx3qTBgy0FnYJm1OTw8CEmdgzKpxwSLCD94tH5S7vaxfMSHlC308Hb7zs5VFdLXs eG3G+m1Dq2xkD/8aUSFUKh3fWDuqD1NZMFP5r4BL85Wv/vtnuVkbhoTkH0Z/Jc7wY8D7 jwzg== X-Gm-Message-State: AOAM530WDUfl45VtwZBtjNtSaLcEcvs3SDkYgmJvon1DcbSzvdP46ZPe UzsxEF1wFhd0L5+QdbVJtcw9U7E9C5RgsniB X-Google-Smtp-Source: ABdhPJxpa75OmJS6idQ/cGOsOOztphu0XZReB3cIBw1WJQ8PBBumhLh7lm46J/UbGRsyOypnpJ4/Sw== X-Received: by 2002:a37:745:: with SMTP id 66mr4909394qkh.344.1599685470803; Wed, 09 Sep 2020 14:04:30 -0700 (PDT) Received: from godwin.fios-router.home (pool-108-51-35-162.washdc.fios.verizon.net. [108.51.35.162]) by smtp.gmail.com with ESMTPSA id c40sm4664096qtb.72.2020.09.09.14.04.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 14:04:30 -0700 (PDT) From: Sean Anderson To: u-boot@lists.denx.de Cc: Bin Meng , Marek Vasut , Jagan Teki , Simon Glass , Heinrich Schuchardt , Sean Anderson Subject: [PATCH v4 4/7] wdt: dw: Enable the clock before using it Date: Wed, 9 Sep 2020 17:04:17 -0400 Message-Id: <20200909210420.243190-5-seanga2@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200909210420.243190-1-seanga2@gmail.com> References: <20200909210420.243190-1-seanga2@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean The watchdog won't work if the clock isn't enabled. Fixes: cf89ef8d10f240554541c20b2e1bdcdd58d1d7e6 Signed-off-by: Sean Anderson Reviewed-by: Simon Glass --- (no changes since v1) drivers/watchdog/designware_wdt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/watchdog/designware_wdt.c b/drivers/watchdog/designware_wdt.c index 41866fa01b..e6f5437056 100644 --- a/drivers/watchdog/designware_wdt.c +++ b/drivers/watchdog/designware_wdt.c @@ -129,6 +129,10 @@ static int designware_wdt_probe(struct udevice *dev) if (ret) return ret; + ret = clk_enable(&clk); + if (ret) + return ret; + priv->clk_khz = clk_get_rate(&clk) / 1000; if (!priv->clk_khz) return -EINVAL; From patchwork Wed Sep 9 21:04:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1361067 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=iGPcVxpK; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BmvgC6Tx4z9sTH for ; Thu, 10 Sep 2020 07:05:27 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4EDCA822FC; Wed, 9 Sep 2020 23:04:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="iGPcVxpK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BCDFA822D9; Wed, 9 Sep 2020 23:04:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 259BA821ED for ; Wed, 9 Sep 2020 23:04:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qk1-x744.google.com with SMTP id w12so3898324qki.6 for ; Wed, 09 Sep 2020 14:04:33 -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=Hd5C5Y5uvWgspjff7BBnIY4jKUpSfJEjP/r+GIFiO3Q=; b=iGPcVxpKOuwhtX3b+t0j56BjdICs8XkOQtUIUDhAwI4TohRelr7IQU7rdeNfMNMJly o9kl8JjgBoaD8HOkr7FgQ+kCpVnwhkNk8wvC6+v8AsdZg8WQy8rfH0RB/EJcPH89lUor xjwJhA0b1BMHh86oJkq1un+wJPLDt0PpFrLiEp/Y/IGSfC8jEn+vJ5cY7P7urnq3LIcg v+M7APkIhfro1N4WLM/YZYoeCA0tiw+U5r4fZr7Zo58UpHtXvmp8iVGgwXN9ba7QqRzJ w70bHh4dluuxdqk71nZlP7xeh2wq4/bza2G6gGABCuaHMy6kB11TfKb6jIx6PgISRfxz sfBw== 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=Hd5C5Y5uvWgspjff7BBnIY4jKUpSfJEjP/r+GIFiO3Q=; b=m1Yd17L4D4WD8V/i6lILssMdcCLJgNzd61Mi8sPL52QyFY1no8W1HUpAmTtRUDjlNB qCC6xQwAWC+k0qrtiNBVoDr1kylpiOLfIchd3HaQq+q31709lhRstnsnk5sHVMQYKEr/ ekINFvpxJwGOkr0qHgzPDhKTpN05BlS/QNZXWyXgP9Ga3lZd8bHXJeHXweJ/Sz9id0Ke y9nCF1b0HuqY9UEx0Oy/C/Sd4GUC6KXTs05JP8DuJUiLw3oITSwxGkys+fqc5e7b7LSm z05dUEU1u0ZM41GoGhQXTTpQZqlpUsN71FBxk+A19K2DIJFJ+VAOtBYCEwe0b2MO61ZE +Yrw== X-Gm-Message-State: AOAM531iQAMa2cVyLwYm/PW+I6C9ydBYkYSejA4KkOLu2XgOp9b4dRjp B2U13bihv13iqCfv8G45rpfiUK9zLZg3x7yr X-Google-Smtp-Source: ABdhPJzl5FtBvKCGgi6uitviLNk9XAJREjXQRqGjsoS+XPV6E4zF11RKcDchKGoobXHKQVJHllYjVg== X-Received: by 2002:a37:b347:: with SMTP id c68mr5076154qkf.430.1599685471834; Wed, 09 Sep 2020 14:04:31 -0700 (PDT) Received: from godwin.fios-router.home (pool-108-51-35-162.washdc.fios.verizon.net. [108.51.35.162]) by smtp.gmail.com with ESMTPSA id c40sm4664096qtb.72.2020.09.09.14.04.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 14:04:31 -0700 (PDT) From: Sean Anderson To: u-boot@lists.denx.de Cc: Bin Meng , Marek Vasut , Jagan Teki , Simon Glass , Heinrich Schuchardt , Sean Anderson Subject: [PATCH v4 5/7] wdt: dw: Free the clock on error Date: Wed, 9 Sep 2020 17:04:18 -0400 Message-Id: <20200909210420.243190-6-seanga2@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200909210420.243190-1-seanga2@gmail.com> References: <20200909210420.243190-1-seanga2@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean The clock subsystem requires that clk_free be called on clocks obtained via clk_get_*. Signed-off-by: Sean Anderson Reviewed-by: Simon Glass --- Changes in v4: - Fix build error without CONFIG_CLK drivers/watchdog/designware_wdt.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/watchdog/designware_wdt.c b/drivers/watchdog/designware_wdt.c index e6f5437056..b952737fb4 100644 --- a/drivers/watchdog/designware_wdt.c +++ b/drivers/watchdog/designware_wdt.c @@ -131,11 +131,13 @@ static int designware_wdt_probe(struct udevice *dev) ret = clk_enable(&clk); if (ret) - return ret; + goto err; priv->clk_khz = clk_get_rate(&clk) / 1000; - if (!priv->clk_khz) - return -EINVAL; + if (!priv->clk_khz) { + ret = -EINVAL; + goto err; + } #else priv->clk_khz = CONFIG_DW_WDT_CLOCK_KHZ; #endif @@ -145,15 +147,21 @@ static int designware_wdt_probe(struct udevice *dev) ret = reset_get_bulk(dev, &resets); if (ret) - return ret; + goto err; ret = reset_deassert_bulk(&resets); if (ret) - return ret; + goto err; } /* reset to disable the watchdog */ return designware_wdt_stop(dev); + +err: +#if CONFIG_IS_ENABLED(CLK) + clk_free(&clk); +#endif + return ret; } static const struct wdt_ops designware_wdt_ops = { From patchwork Wed Sep 9 21:04:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1361068 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=UqQUotCH; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BmvgR4NB7z9sTH for ; Thu, 10 Sep 2020 07:05:39 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6DBD28230E; Wed, 9 Sep 2020 23:04:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UqQUotCH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9C529822E3; Wed, 9 Sep 2020 23:04:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2BDF6822CD for ; Wed, 9 Sep 2020 23:04:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qt1-x843.google.com with SMTP id n18so3173844qtw.0 for ; Wed, 09 Sep 2020 14:04:34 -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=+e2YG4BgM1TmDrtMmKcU29+SO7DV34/AAAWvtVR7yRA=; b=UqQUotCHjEnTbc7SjPs9iAAmhRET4Q8O8mLHi0O2RfBx94zyP0aLwGiN111Oo2i011 yeBFsM7PzXU+jC7OemqgtUAYPbQnAJLlRCkz8p2y7m6OrXBDIGEOv0uNODE6zgEcDH28 vO4BAKHNjoZWaeXCU4omjlgmjNW/Ax7ZukxY5Iyoc/nU3koQPSspVSB+gPkcfxI5LL4k AC6rEtAV/ASiodVMiRaPev8BDEmTJZRvVDYnJZL3rHRe3PasmfRWma2fp8IKiFAmOLBK MEGTNOUvJcsBHzgqLnSVMg8F8JzgMeXLpQxhEv9KjqDrggjI8DPV1lKAXm7r5QKdX5w2 vdng== 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=+e2YG4BgM1TmDrtMmKcU29+SO7DV34/AAAWvtVR7yRA=; b=FdO3no7WFz3we2hmMaXEAJDVYZJZyGYgjeFVkDCIXNvHEizALNSimfIn/u7tXiMaqJ kWpKspCl06dQuXq0nhUpEOHRlU8BYPY4RELsyQkN4c1ZDjtFMui2ogkHmoLjmTuOz3ZZ SbpAlH34f30p4L1vxK226BGB3PVNnzRLCUtJOwOlH3eGl5Ajuwtbn3Jfu9ElXRPVLJ57 loKIqT34icrHQZ9APknVXA1djqg4+AWgjRfef0kywaz1entbj7QvQ9Z2ourNc0iN96/w kRThUlyWgOG3LvM0ed1vz1U/p+uS6t9QbJUTSLpMS5HjPZAeTgxHLAmKWImwGekjxRcu GHcw== X-Gm-Message-State: AOAM530FdZKnhkPn1p3vkCElRFxdkFcCydYz1VxrFAnQKh6IpSl/dZyz 98FE3S4Mc4sSogUdV83nTpPFUVWqqL0qL2on X-Google-Smtp-Source: ABdhPJzuuzzKkAn0s6cIamDSF9khVJ2SRuF2t8jXGxNVcm8csE/to7aQvJbAHhHO6fQbSXSaQA95qw== X-Received: by 2002:ac8:4e09:: with SMTP id c9mr3564488qtw.347.1599685473002; Wed, 09 Sep 2020 14:04:33 -0700 (PDT) Received: from godwin.fios-router.home (pool-108-51-35-162.washdc.fios.verizon.net. [108.51.35.162]) by smtp.gmail.com with ESMTPSA id c40sm4664096qtb.72.2020.09.09.14.04.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 14:04:32 -0700 (PDT) From: Sean Anderson To: u-boot@lists.denx.de Cc: Bin Meng , Marek Vasut , Jagan Teki , Simon Glass , Heinrich Schuchardt , Sean Anderson , Rick Chen Subject: [PATCH v4 6/7] riscv: Add watchdog bindings for the k210 Date: Wed, 9 Sep 2020 17:04:19 -0400 Message-Id: <20200909210420.243190-7-seanga2@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200909210420.243190-1-seanga2@gmail.com> References: <20200909210420.243190-1-seanga2@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean This adds the necessary bindings. Most of them are already there. Signed-off-by: Sean Anderson Acked-by: Rick Chen --- (no changes since v2) Changes in v2: - Move watchdog enable to k210.dtsi as it does not depend on anything board-specific. arch/riscv/dts/k210.dtsi | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/riscv/dts/k210.dtsi b/arch/riscv/dts/k210.dtsi index 84cff51c36..81ac417dde 100644 --- a/arch/riscv/dts/k210.dtsi +++ b/arch/riscv/dts/k210.dtsi @@ -426,7 +426,6 @@ interrupts = <21>; clocks = <&sysclk K210_CLK_WDT0>; resets = <&sysrst K210_RST_WDT0>; - status = "disabled"; }; wdt1: watchdog@50410000 { From patchwork Wed Sep 9 21:04:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1361069 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Fw3s75mA; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bmvgd17cxz9sTW for ; Thu, 10 Sep 2020 07:05:48 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 72BF182317; Wed, 9 Sep 2020 23:04:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Fw3s75mA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B9062822F2; Wed, 9 Sep 2020 23:04:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4853C82189 for ; Wed, 9 Sep 2020 23:04:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qt1-x842.google.com with SMTP id y11so3130200qtn.9 for ; Wed, 09 Sep 2020 14:04:35 -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=d1qr84Ndl6iu4dGV8Qc8iNeWXsqP1qIRibUEJ5aUcv4=; b=Fw3s75mA2v/nSSDav/XbWpkHu0z9gWftBMjBgOAct5t8oeTQY0SbvfjFd7x6m4CqdP 5W+UcJUwAHmlTY/Lu5CeNDmFSNmhydA5F09RTw6uSbGFNN2mBiaKbaJjtWRlfQuXTM9+ K8bmyli9lz0OaPRWP/nJSoA/URV6O+DJLYt96ssqSW8KYjCtjeXmUr5QxIP5BwAfvnxE 2t8yRtsSdy3jMZiEaDUBydaamUaDDEMf5kCYj5iCzls1kiXB+AmRRtflS4HwDkYB0JMy CbFgc0pigVA5rqaupY/cw/haNrW0M1UJkaF2zoojQN8bfOm8br29AjziciehtSxQEpS4 ytUw== 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=d1qr84Ndl6iu4dGV8Qc8iNeWXsqP1qIRibUEJ5aUcv4=; b=a1OpfhwhdtyQSEjMkZBA74rwkosDGSCJA2GO8kC4esilKbGfMLfYmiWd7jx83QBiv6 or7+rVhM8DrJV0eWHtd8zXIqpsmoxfhvKx4ETxUarhOJN9TIw7kbujUvtKBDBoJHgkdK 96FwqC18wySfQr15cv13IBdkQ3tsflUFe2WqbebpvLrVdnRt33bKXlKnnO0swHgo19I2 cMcEP69+EeBkSrks6H6b2a+kRu+ywz1lUbsIyh7jLIbNuYfvcLquka4823sfIzFWZYli AxGqAPBt2vwYr20aPG4z4T6LbFOXXlcm2DfXgEtlhmdOyifaXIpzVYfIO7RVovnETsRb oe0A== X-Gm-Message-State: AOAM530PLBmrmJ80h03uyVG88oMZCtcAr75fNs6rjmQ3AFt9ddtIUoll IlrKqlSfQFoM0vsKJorBo6apb+Ke0dACFIyy X-Google-Smtp-Source: ABdhPJxj7lBuml3wDhLmudvES7Vl3xynM5vf4PfZ+f6dHCduZfd8BqN3qVSCfizFR7RN96AWwTwubA== X-Received: by 2002:ac8:5d04:: with SMTP id f4mr5209065qtx.290.1599685474061; Wed, 09 Sep 2020 14:04:34 -0700 (PDT) Received: from godwin.fios-router.home (pool-108-51-35-162.washdc.fios.verizon.net. [108.51.35.162]) by smtp.gmail.com with ESMTPSA id c40sm4664096qtb.72.2020.09.09.14.04.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 14:04:33 -0700 (PDT) From: Sean Anderson To: u-boot@lists.denx.de Cc: Bin Meng , Marek Vasut , Jagan Teki , Simon Glass , Heinrich Schuchardt , Sean Anderson Subject: [PATCH v4 7/7] riscv: Enable watchdog for the k210 Date: Wed, 9 Sep 2020 17:04:20 -0400 Message-Id: <20200909210420.243190-8-seanga2@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200909210420.243190-1-seanga2@gmail.com> References: <20200909210420.243190-1-seanga2@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean This enables the necessary config options. Signed-off-by: Sean Anderson Reviewed-by: Simon Glass --- (no changes since v3) Changes in v3: - Note dependency on "time: Fix get_ticks being non-monotonic" - Add a few signed-off-bys which were sent for version 1 board/sipeed/maix/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/board/sipeed/maix/Kconfig b/board/sipeed/maix/Kconfig index 0cdcd32adc..b9dac5a64e 100644 --- a/board/sipeed/maix/Kconfig +++ b/board/sipeed/maix/Kconfig @@ -44,4 +44,6 @@ config BOARD_SPECIFIC_OPTIONS imply RESET_SYSCON imply SYSRESET imply SYSRESET_SYSCON + imply WDT + imply DESIGNWARE_WATCHDOG endif