From patchwork Mon Sep 1 18:09:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 36414 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3959F20C87 for ; Mon, 1 Sep 2014 18:10:32 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id c9sf19440921qcz.4 for ; Mon, 01 Sep 2014 11:10:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=wxo6tqAk1rD45IB/Tq8FTwqwkHgPff5gUHVuOQvV0ss=; b=kmpA/AGVWmbsDLsK8nBHA6Gs/7c4bwp1xPXHrQe7bTk7+vEE2SSeeZHCItlMECYxFc JOjC6THp9Fj1YIBaiTET1FWapvLQZJYkzvQWiUZlqlmrE9fkeZK3K5ChsU38Z46DQDcR hDicbOU3ex3pipmXK7FVTHOLREiSqP7iW6uYscCLWlEBUqpFcBP4b7w0M5t5xwuzSl76 u26+MF2SwlWo1amp0VcNf/9KSY0M6rqMm0WybI4mykvR84JxFOFlmGVdqGs1thiJK8yv 3sffSoOSSvqqBzBy7mIDJ46Jy1LKVrpPoF+d77hTBBcyHG1YoTJUHRIMAEeokv5xO97D gWow== X-Gm-Message-State: ALoCoQl45A4eaYGmBSt2gA02ADDj8ABQZVfHqDdDJg9vuLvD4RtlyJXRAKBf3HQHb4hWle/e4vpf X-Received: by 10.236.117.141 with SMTP id j13mr14517579yhh.3.1409595032093; Mon, 01 Sep 2014 11:10:32 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.105.247 with SMTP id c110ls2063232qgf.5.gmail; Mon, 01 Sep 2014 11:10:32 -0700 (PDT) X-Received: by 10.220.44.136 with SMTP id a8mr1656645vcf.42.1409595031990; Mon, 01 Sep 2014 11:10:31 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id yx12si1089717vdb.70.2014.09.01.11.10.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Sep 2014 11:10:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id im17so5932783vcb.13 for ; Mon, 01 Sep 2014 11:10:31 -0700 (PDT) X-Received: by 10.221.61.5 with SMTP id wu5mr26388629vcb.13.1409595031930; Mon, 01 Sep 2014 11:10:31 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp421379vcb; Mon, 1 Sep 2014 11:10:31 -0700 (PDT) X-Received: by 10.66.251.195 with SMTP id zm3mr11413773pac.78.1409595030909; Mon, 01 Sep 2014 11:10:30 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ef7si2466605pac.71.2014.09.01.11.10.30 for ; Mon, 01 Sep 2014 11:10:30 -0700 (PDT) Received-SPF: none (google.com: linux-omap-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754728AbaIASK1 (ORCPT + 5 others); Mon, 1 Sep 2014 14:10:27 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:44853 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754717AbaIASKZ (ORCPT ); Mon, 1 Sep 2014 14:10:25 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s81I9v6X007339; Mon, 1 Sep 2014 13:09:57 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s81I9vBl009948; Mon, 1 Sep 2014 13:09:57 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Mon, 1 Sep 2014 13:09:57 -0500 Received: from sokoban.home (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s81I9JlJ012145; Mon, 1 Sep 2014 13:09:56 -0500 From: Tero Kristo To: , , CC: Subject: [PATCH 20/26] ARM: AM33xx: PRM: move global warm reset implementation to driver Date: Mon, 1 Sep 2014 21:09:09 +0300 Message-ID: <1409594955-1476-21-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1409594955-1476-1-git-send-email-t-kristo@ti.com> References: <1409594955-1476-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: t-kristo@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Moved the implementation from am33xx-restart.c to the prm33xx.c file to isolate the PRM register accesses to be private for PRM driver. Signed-off-by: Tero Kristo --- arch/arm/mach-omap2/am33xx-restart.c | 9 +-------- arch/arm/mach-omap2/prm33xx.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-omap2/am33xx-restart.c b/arch/arm/mach-omap2/am33xx-restart.c index c88d8df7..7286389 100644 --- a/arch/arm/mach-omap2/am33xx-restart.c +++ b/arch/arm/mach-omap2/am33xx-restart.c @@ -24,12 +24,5 @@ void am33xx_restart(enum reboot_mode mode, const char *cmd) { /* TODO: Handle mode and cmd if necessary */ - am33xx_prm_rmw_reg_bits(AM33XX_RST_GLOBAL_WARM_SW_MASK, - AM33XX_RST_GLOBAL_WARM_SW_MASK, - AM33XX_PRM_DEVICE_MOD, - AM33XX_PRM_RSTCTRL_OFFSET); - - /* OCP barrier */ - (void)am33xx_prm_read_reg(AM33XX_PRM_DEVICE_MOD, - AM33XX_PRM_RSTCTRL_OFFSET); + am33xx_prm_global_warm_sw_reset(); } diff --git a/arch/arm/mach-omap2/prm33xx.c b/arch/arm/mach-omap2/prm33xx.c index 3cbfb78..03960bc 100644 --- a/arch/arm/mach-omap2/prm33xx.c +++ b/arch/arm/mach-omap2/prm33xx.c @@ -23,6 +23,10 @@ #include "prm33xx.h" #include "prm-regbits-33xx.h" +#define AM33XX_PRM_RSTCTRL_OFFSET 0x0000 + +#define AM33XX_RST_GLOBAL_WARM_SW_MASK (1 << 0) + /* Read a register in a PRM instance */ u32 am33xx_prm_read_reg(s16 inst, u16 idx) { @@ -332,6 +336,23 @@ static int am33xx_check_vcvp(void) return 0; } +/** + * am33xx_prm_global_warm_sw_reset - reboot the device via warm reset + * + * Immediately reboots the device through warm reset. + */ +void am33xx_prm_global_warm_sw_reset(void) +{ + am33xx_prm_rmw_reg_bits(AM33XX_RST_GLOBAL_WARM_SW_MASK, + AM33XX_RST_GLOBAL_WARM_SW_MASK, + AM33XX_PRM_DEVICE_MOD, + AM33XX_PRM_RSTCTRL_OFFSET); + + /* OCP barrier */ + (void)am33xx_prm_read_reg(AM33XX_PRM_DEVICE_MOD, + AM33XX_PRM_RSTCTRL_OFFSET); +} + struct pwrdm_ops am33xx_pwrdm_operations = { .pwrdm_set_next_pwrst = am33xx_pwrdm_set_next_pwrst, .pwrdm_read_next_pwrst = am33xx_pwrdm_read_next_pwrst,