From patchwork Mon Aug 26 18:21:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1153382 X-Patchwork-Delegate: ykai007@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=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="ft4AtN5x"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46HL2j3vnCz9sDQ for ; Tue, 27 Aug 2019 04:22:37 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 1555EC222E0; Mon, 26 Aug 2019 18:21: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 11A4EC222B7; Mon, 26 Aug 2019 18:21:38 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C2D6FC222C0; Mon, 26 Aug 2019 18:21:31 +0000 (UTC) Received: from mail-ot1-f68.google.com (mail-ot1-f68.google.com [209.85.210.68]) by lists.denx.de (Postfix) with ESMTPS id AB77EC22031 for ; Mon, 26 Aug 2019 18:21:28 +0000 (UTC) Received: by mail-ot1-f68.google.com with SMTP id z17so16067005otk.13 for ; Mon, 26 Aug 2019 11:21:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8hP6rdkEvhhT0hEj14Sjz70+JpS0tBwbVOMye6DfvhQ=; b=ft4AtN5xDxHjy6eOId++YM1EB7GJSKqvdjtHWYgnGKEhArM++k5myYew8y1mJTP2sZ DqeH3Mbk/VyRVtif3wtmop05/hb0Y6nFX1l16/JIjyoJp3nhU06eKbgUex2tEG/UHetQ 8SmeAzs6en3FSb2Uf+750xu0Q3WDHXL83SsAQ= 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=8hP6rdkEvhhT0hEj14Sjz70+JpS0tBwbVOMye6DfvhQ=; b=CKiC3L8QynpD7sevdeRDmRptcfkL4wfdgtHOLCIDKfEy3w6Emrqp7GtYWa29T8ZkoY rpWltOsN/kP4ci1MTno0am/9bGofFJ93f6wxZ4e3ubhseFlQ1GoDgkjwIYQWtd2anPZ2 5gLw8E/EbpcvaAKotUPaFRqGM/k/skNaR5KCCtRDAODKYBhKiwSLz1/zzOZapaNrSOyy TQYic5xzPqgiPrfidTcOmgJyy0GCRDox/eKW6bulPpMxOEVy+16ByOBepzEzEDMuSz/w Ky0TU7OesWA4UGlpLw7C++ONlCnCAXWizL/q/NH6DFlBAz781m2MfY9QEH6Eq7dUDqp9 o8Iw== X-Gm-Message-State: APjAAAV4u7IlYKeL/Bboj4qytIZx266CCMpFQuJZWEEzs9qfhOHxkW6p M4acWaTcmGw4l3SanqZiHpjqlg== X-Google-Smtp-Source: APXvYqzm1+FntLl6FQEiVro/U1i5yZzn0uwDxMAdubld1WOR8uL9ojfUk/HhkGLEOMN5HdATGt3WCg== X-Received: by 2002:a9d:6852:: with SMTP id c18mr16870633oto.218.1566843687442; Mon, 26 Aug 2019 11:21:27 -0700 (PDT) Received: from jagan-XPS-13-9350.attlocal.net ([2600:1700:7430:38e0:d5b0:4823:33c8:5e46]) by smtp.gmail.com with ESMTPSA id c11sm4401461otr.54.2019.08.26.11.21.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 11:21:27 -0700 (PDT) From: Jagan Teki To: Kever Yang , Simon Glass , Philipp Tomsich Date: Mon, 26 Aug 2019 23:51:01 +0530 Message-Id: <20190826182111.30999-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190826182111.30999-1-jagan@amarulasolutions.com> References: <20190826182111.30999-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Cc: linux-rockchip@lists.infradead.org, Chin Liang See , u-boot@lists.denx.de, Andy Shevchenko , linux-amarula@amarulasolutions.com, Akash Gajjar Subject: [U-Boot] [PATCH v2 06/16] wdt: designware: Simplify enable function 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" Simplify dw watchdog enable function by using proper macro and drop unwanted macros. Cc: Chin Liang See Cc: Andy Shevchenko Signed-off-by: Jagan Teki --- drivers/watchdog/designware_wdt.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/designware_wdt.c b/drivers/watchdog/designware_wdt.c index bd858f0608..2979fda44e 100644 --- a/drivers/watchdog/designware_wdt.c +++ b/drivers/watchdog/designware_wdt.c @@ -14,7 +14,6 @@ #define DW_WDT_CR_EN_OFFSET 0x00 #define DW_WDT_CR_RMOD_OFFSET 0x01 -#define DW_WDT_CR_RMOD_VAL 0x00 #define DW_WDT_CRR_RESTART_VAL 0x76 /* @@ -38,9 +37,11 @@ static int designware_wdt_settimeout(unsigned int timeout) static void designware_wdt_enable(void) { - writel(((DW_WDT_CR_RMOD_VAL << DW_WDT_CR_RMOD_OFFSET) | - (0x1 << DW_WDT_CR_EN_OFFSET)), - (CONFIG_DW_WDT_BASE + DW_WDT_CR)); + u32 val = readl(CONFIG_DW_WDT_BASE + DW_WDT_CR); + + /* Enable watchdog */ + val |= DW_WDT_CR_RMOD_OFFSET; + writel(val, CONFIG_DW_WDT_BASE + DW_WDT_CR); } static unsigned int designware_wdt_is_enabled(void)