From patchwork Mon Feb 25 12:09:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Shilimkar X-Patchwork-Id: 2180991 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E8FE93FD4E for ; Mon, 25 Feb 2013 12:07:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752049Ab3BYMH4 (ORCPT ); Mon, 25 Feb 2013 07:07:56 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:47344 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751661Ab3BYMHz (ORCPT ); Mon, 25 Feb 2013 07:07:55 -0500 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r1PC7psg009517; Mon, 25 Feb 2013 06:07:52 -0600 Received: from DBDE70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id r1PC7n2i012767; Mon, 25 Feb 2013 17:37:49 +0530 (IST) Received: from dbdp33.itg.ti.com (172.24.170.252) by dbde70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 14.1.323.3; Mon, 25 Feb 2013 17:37:49 +0530 Received: from ula0393909.apr.dhcp.ti.com (smtpvbd.itg.ti.com [172.24.170.250]) by dbdp33.itg.ti.com (8.13.8/8.13.8) with ESMTP id r1PC7l2J029291; Mon, 25 Feb 2013 17:37:47 +0530 From: Santosh Shilimkar To: CC: , , Santosh Shilimkar Subject: [PATCH] ARM: OMAP4: Fix the init code to have OMAP4460 errata available in DT build Date: Mon, 25 Feb 2013 17:39:16 +0530 Message-ID: <1361794156-9789-1-git-send-email-santosh.shilimkar@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org OMAP4460 ROM code bug needs the GIC distributor and local timer bases to be available for the bug work around. In current code, dt case these bases are not initialized leading to failure of the errata work-around. Fix it by extracting the bases from dt blob and populating them. Reported-by: Sourav Poddar Tested-by: Sourav Poddar Signed-off-by: Santosh Shilimkar --- Posting this one seperatly but will add along with rest of my fixes so that it doesn't get lost on the list. arch/arm/mach-omap2/omap4-common.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c index 6897ae2..d07740e 100644 --- a/arch/arm/mach-omap2/omap4-common.c +++ b/arch/arm/mach-omap2/omap4-common.c @@ -261,8 +261,40 @@ static struct of_device_id irq_match[] __initdata = { { } }; +static struct of_device_id twd_match[] __initdata = { + { .compatible = "arm,cortex-a9-twd-timer", }, + { } +}; + void __init omap_gic_of_init(void) { + struct device_node *np; + const void *reg_prop; + unsigned long start = 0, size = 0; + + /* Extract GIC distributor and TWD bases for OMAP4460 ROM Errata WA */ + if (!cpu_is_omap446x()) + goto skip_errata_init; + + np = of_find_matching_node(NULL, irq_match); + if (np) { + reg_prop = of_get_property(np, "reg", NULL); + start = of_read_number(reg_prop, 1); + size = of_read_number(reg_prop + 4, 1); + } + gic_dist_base_addr = ioremap(start, size); + WARN_ON(!gic_dist_base_addr); + + np = of_find_matching_node(NULL, twd_match); + if (np) { + reg_prop = of_get_property(np, "reg", NULL); + start = of_read_number(reg_prop, 1); + size = of_read_number(reg_prop + 4, 1); + } + twd_base = ioremap(start, size); + WARN_ON(!twd_base); + +skip_errata_init: omap_wakeupgen_init(); of_irq_init(irq_match); }