From patchwork Mon Jan 6 14:36:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 3438701 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EC49B9F1C4 for ; Mon, 6 Jan 2014 14:54:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D70AE2015F for ; Mon, 6 Jan 2014 14:54:12 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9AFCF200E7 for ; Mon, 6 Jan 2014 14:54:11 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W0BKd-0006VR-5I; Mon, 06 Jan 2014 14:39:08 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W0BK4-0003lw-AA; Mon, 06 Jan 2014 14:38:32 +0000 Received: from mail-ee0-f54.google.com ([74.125.83.54]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W0BJi-0003go-CC for linux-arm-kernel@lists.infradead.org; Mon, 06 Jan 2014 14:38:11 +0000 Received: by mail-ee0-f54.google.com with SMTP id e51so6821811eek.27 for ; Mon, 06 Jan 2014 06:37:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references:content-type; bh=ZC+PERUiqNWEWbgvbEjWMOwAvOrmTXcA+hZ5O//YT/w=; b=mQ9SGe468W8WzZu2HKjJvUBAx3h4qt4X0AydqaTaNr2sAx9WiDEQ5iy8DlFnB3/4Yj /4Jd7xxsE4SlnYrN7hCSbTfFvXSvOWZ2cSX8kkZAR37832O5bNfs+W+uZBGAaxeJ6Dzh ydTZryDBO+rIMjNNk0jGvoq8Igk97aEXE8vRAZtp9hQx890HyKEHZMcDgrm6jwHg8+HK WzkrEgH6STax/DdGN/8Dh3+6BSg6tanId3ELID64vfDL7YcdJoHd4urfQScOWIlRLvIt 3IFoLg9t9eDY6XmvAaOphKn+VVhaFGh5RMQGslgmazFFNYq5ZXJsYBGEkEuZZT0KUc9r fm6Q== X-Gm-Message-State: ALoCoQm7D4LV+6UBj7RVbMt1+rgq0sk0kVHJRm/lhIrcs5IDww0c/4YzJyLugsdROkhJPfBRz8JL X-Received: by 10.14.172.130 with SMTP id t2mr16197480eel.68.1389019068267; Mon, 06 Jan 2014 06:37:48 -0800 (PST) Received: from localhost (nat-63.starnet.cz. [178.255.168.63]) by mx.google.com with ESMTPSA id e3sm171475876eeg.11.2014.01.06.06.37.45 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 06 Jan 2014 06:37:46 -0800 (PST) From: Michal Simek To: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Soren Brinkmann , Steffen Trumtrar Subject: [PATCH 7/7] ARM: zynq: Introduce zynq_slcr_unlock() Date: Mon, 6 Jan 2014 15:36:43 +0100 Message-Id: X-Mailer: git-send-email 1.8.2.3 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140106_093810_580614_C575C699 X-CRM114-Status: GOOD ( 16.91 ) X-Spam-Score: -1.9 (-) Cc: Josh Cartwright , monstr@monstr.eu, Russell King , Peter Crosthwaite , linux-kernel@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Call special function for unlocking SLCR. Signed-off-by: Michal Simek --- arch/arm/mach-zynq/slcr.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) -- 1.8.2.3 diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c index f0f6a69..c1f1499 100644 --- a/arch/arm/mach-zynq/slcr.c +++ b/arch/arm/mach-zynq/slcr.c @@ -71,6 +71,18 @@ static int zynq_slcr_read(u32 *val, u32 offset) } /** + * zynq_slcr_unlock - Unlock SLCR registers + * + * return: a negative value on error, 0 on success + */ +static inline int zynq_slcr_unlock(void) +{ + zynq_slcr_write(SLCR_UNLOCK_MAGIC, SLCR_UNLOCK_OFFSET); + + return 0; +} + +/** * zynq_slcr_system_reset - Reset the entire system. */ void zynq_slcr_system_reset(void) @@ -82,7 +94,7 @@ void zynq_slcr_system_reset(void) * Note that this seems to require raw i/o * functions or there's a lockup? */ - writel(SLCR_UNLOCK_MAGIC, zynq_slcr_base + SLCR_UNLOCK_OFFSET); + zynq_slcr_unlock(); /* * Clear 0x0F000000 bits of reboot status register to workaround @@ -164,7 +176,7 @@ int __init zynq_early_slcr_init(void) np->data = (__force void *)zynq_slcr_base; /* unlock the SLCR so that registers can be changed */ - writel(SLCR_UNLOCK_MAGIC, zynq_slcr_base + SLCR_UNLOCK_OFFSET); + zynq_slcr_unlock(); pr_info("%s mapped to %p\n", np->name, zynq_slcr_base);