From patchwork Mon Jul 28 21:16:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 34429 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 52A25202E4 for ; Mon, 28 Jul 2014 21:21:57 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id 29sf28584962yhl.2 for ; Mon, 28 Jul 2014 14:21:57 -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=lH/F56cEj8Bmj1Vm/Qk0ijOiW6m3Vl4NQbGWMWXfReA=; b=N88teOoI/Njebledep3Ma3aAe1t3ojmvN3wzlh3Li7JGl+SNjaVRLPgWtbUH7HDAI+ sDWfpI/gTa46MnAOQBrOyJn3q5qBiR1FFxX795stMVNpqqi0Bk7TaFJ5FM4gcRBF6ZC5 JtfQ2mU0GD8Oqvo6BuFB/GhHuLftKvjoV8fgJSg0441qthM/W6VuTvFUPkEKaeOqCWGi E6Ze1XNqn8aejWDH0+9sq8Sy9MD8UYmy7USUXl9L1zCauSVl6LfDFglhrkz7vB6EUpjf LYnNRcqjlgXjfGPbBDYssRT9bqPOhlW3bcjJemEHh1kFuDLtXGufF7VDq8eGDStJG14w wb6Q== X-Gm-Message-State: ALoCoQlXA2VA+v9ahlHTOZSsDt83Ud+Emsr+A17JXRoAiuDYn/hkZ343wBJwz7i1fhKlBfT1WUCK X-Received: by 10.224.29.1 with SMTP id o1mr17271480qac.0.1406582517151; Mon, 28 Jul 2014 14:21:57 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.87.226 with SMTP id r89ls2190413qgd.44.gmail; Mon, 28 Jul 2014 14:21:57 -0700 (PDT) X-Received: by 10.52.89.211 with SMTP id bq19mr3941002vdb.93.1406582516967; Mon, 28 Jul 2014 14:21:56 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id r16si13347232vex.37.2014.07.28.14.21.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Jul 2014 14:21:56 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id ij19so11931441vcb.25 for ; Mon, 28 Jul 2014 14:21:56 -0700 (PDT) X-Received: by 10.52.129.200 with SMTP id ny8mr23805vdb.27.1406582516889; Mon, 28 Jul 2014 14:21:56 -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.37.5 with SMTP id tc5csp197227vcb; Mon, 28 Jul 2014 14:21:55 -0700 (PDT) X-Received: by 10.70.35.143 with SMTP id h15mr41174545pdj.5.1406582509853; Mon, 28 Jul 2014 14:21:49 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hp4si19107618pac.0.2014.07.28.14.21.48 for ; Mon, 28 Jul 2014 14:21:49 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-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 S1752819AbaG1VVd (ORCPT + 25 others); Mon, 28 Jul 2014 17:21:33 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:55580 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751968AbaG1VRt (ORCPT ); Mon, 28 Jul 2014 17:17:49 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s6SLHLMn004211; Mon, 28 Jul 2014 16:17:21 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s6SLHLpe015045; Mon, 28 Jul 2014 16:17:21 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Mon, 28 Jul 2014 16:17:20 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s6SLHKkr012912; Mon, 28 Jul 2014 16:17:20 -0500 From: Felipe Balbi To: Tony Lindgren CC: Linux OMAP Mailing List , Linux ARM Kernel Mailing List , , , , , , , Linux Kernel Mailing List , Felipe Balbi Subject: [PATCH 35/35] irq: intc: enable IP protection Date: Mon, 28 Jul 2014 16:16:23 -0500 Message-ID: <1406582183-696-36-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.0.1.563.g66f467c In-Reply-To: <1406582183-696-1-git-send-email-balbi@ti.com> References: <1406582183-696-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@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.180 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: , When PROTECTION bit in enabled in PROTECTION register, INTC's registers are only accessible from privileged mode. Signed-off-by: Felipe Balbi --- drivers/irqchip/irq-omap-intc.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-omap-intc.c b/drivers/irqchip/irq-omap-intc.c index 371ff5e..28c8b6d 100644 --- a/drivers/irqchip/irq-omap-intc.c +++ b/drivers/irqchip/irq-omap-intc.c @@ -52,6 +52,8 @@ #define INTCPS_NR_ILR_REGS 128 #define INTCPS_NR_MIR_REGS 3 +#define INTC_PROTECTION_ENABLE (1 << 0) + /* * OMAP2 has a number of different interrupt controllers, each interrupt * controller is identified as its own "bank". Register definitions are @@ -291,12 +293,28 @@ static int __init omap_init_irq_legacy(u32 base) return 0; } +static void __init omap_irq_enable_protection(void) +{ + u32 reg; + + reg = intc_readl(INTC_PROTECTION); + reg |= INTC_PROTECTION_ENABLE; + intc_writel(INTC_PROTECTION, reg); +} + static int __init omap_init_irq(u32 base, struct device_node *node) { + int ret; + if (node) - return omap_init_irq_of(node); + ret = omap_init_irq_of(node); else - return omap_init_irq_legacy(base); + ret = omap_init_irq_legacy(base); + + if (ret == 0) + omap_irq_enable_protection(); + + return ret; } static asmlinkage void __exception_irq_entry