From patchwork Thu Apr 24 15:42:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Shilimkar X-Patchwork-Id: 28989 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 19564203AC for ; Thu, 24 Apr 2014 15:43:14 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id oz11sf9988315veb.9 for ; Thu, 24 Apr 2014 08:43:13 -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=lmh+KIOfoGxe2xT6oo5i6eNivPngli7lBN0VkRsUZPk=; b=gLZgEiBBo0kxZQob/Ep7hhFHOhb9pglZigiIAqk8C/510D3PuTdolU0asLw6xkL8aV Luzx0M5oUyWMqQooUhwY8OIo4CIVflwcDa42rmIcBC6QlEKLQKzAVg2zHPWOoSq0HUKh nD/fzE1+XomCdCk+/yFqZZTjqYiLGk4CNYj0lUcSXuFV4n704/NVPV3GKUp8fRJgl3TS Hpi2eRc4XAxIhxp3+bosycp2EJnb8/JFQnRKTOld5cAr/IehFWm6ujlncwHUQyT3I3F1 cNgg5rl4V4VjYrYs9pJeFjJXQpxm8Y6jLEIHDYGEujBJg6WQZrVh5/MBfj4+e3MjSXpU 7SFA== X-Gm-Message-State: ALoCoQn+Gc/kx9NtKam240yvZj4SR6GuO5s72BoY6FGLWdYqXTkuzUnLlswpTlH0SomQZX1cCpJp X-Received: by 10.58.161.175 with SMTP id xt15mr1570161veb.19.1398354193861; Thu, 24 Apr 2014 08:43:13 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.40.74 with SMTP id w68ls1116719qgw.53.gmail; Thu, 24 Apr 2014 08:43:13 -0700 (PDT) X-Received: by 10.221.34.7 with SMTP id sq7mr1674252vcb.5.1398354193729; Thu, 24 Apr 2014 08:43:13 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id y5si971436vcq.192.2014.04.24.08.43.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Apr 2014 08:43:13 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id lg15so3181821vcb.16 for ; Thu, 24 Apr 2014 08:43:13 -0700 (PDT) X-Received: by 10.52.108.164 with SMTP id hl4mr1397365vdb.25.1398354193581; Thu, 24 Apr 2014 08:43:13 -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.220.221.72 with SMTP id ib8csp26228vcb; Thu, 24 Apr 2014 08:43:13 -0700 (PDT) X-Received: by 10.68.113.5 with SMTP id iu5mr4467287pbb.60.1398354192015; Thu, 24 Apr 2014 08:43:12 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id nf8si1008373pbc.353.2014.04.24.08.43.11; Thu, 24 Apr 2014 08:43:11 -0700 (PDT) Received-SPF: none (google.com: devicetree-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 S1758198AbaDXPnE (ORCPT + 9 others); Thu, 24 Apr 2014 11:43:04 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:48012 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757821AbaDXPm5 (ORCPT ); Thu, 24 Apr 2014 11:42:57 -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 s3OFgQnb023746; Thu, 24 Apr 2014 10:42:26 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s3OFgQEo020103; Thu, 24 Apr 2014 10:42:26 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.174.1; Thu, 24 Apr 2014 10:42:26 -0500 Received: from ula0393909.am.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s3OFgOrF006840; Thu, 24 Apr 2014 10:42:26 -0500 From: Santosh Shilimkar To: CC: , , , , , , Santosh Shilimkar Subject: [PATCH 2/4] ARM: keystone: Update the dma offset for non-dt platform devices Date: Thu, 24 Apr 2014 11:42:20 -0400 Message-ID: <1398354142-2767-3-git-send-email-santosh.shilimkar@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1398354142-2767-1-git-send-email-santosh.shilimkar@ti.com> References: <1398354142-2767-1-git-send-email-santosh.shilimkar@ti.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: santosh.shilimkar@ti.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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: , Signed-off-by: Grygorii Strashko Signed-off-by: Santosh Shilimkar --- arch/arm/mach-keystone/keystone.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c index 155eb06..59b8383 100644 --- a/arch/arm/mach-keystone/keystone.c +++ b/arch/arm/mach-keystone/keystone.c @@ -31,6 +31,27 @@ #define PLL_RESET BIT(16) static void __iomem *keystone_rstctrl; +static struct notifier_block platform_nb; +static unsigned long keystone_dma_pfn_offset __read_mostly; + +static int keystone_platform_notifier(struct notifier_block *nb, + unsigned long event, void *data) +{ + struct device *dev = data; + + if (event != BUS_NOTIFY_ADD_DEVICE) + return NOTIFY_DONE; + + if (!dev) + return NOTIFY_BAD; + + if (!dev->of_node) { + dev->dma_pfn_offset = keystone_dma_pfn_offset; + dev_err(dev, "set dma_pfn_offset%08lx\n", + dev->dma_pfn_offset); + } + return NOTIFY_OK; +} static void __init keystone_init(void) { @@ -45,6 +66,8 @@ static void __init keystone_init(void) pr_warn("ti,keystone-reset iomap error\n"); keystone_pm_runtime_init(); + if (platform_nb.notifier_call) + bus_register_notifier(&platform_bus_type, &platform_nb); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); } @@ -88,6 +111,9 @@ static void __init keystone_init_meminfo(void) /* Populate the arch idmap hook */ arch_virt_to_idmap = keystone_virt_to_idmap; + platform_nb.notifier_call = keystone_platform_notifier; + keystone_dma_pfn_offset = PFN_DOWN(KEYSTONE_HIGH_PHYS_START - + KEYSTONE_LOW_PHYS_START); pr_info("Switching to high address space at 0x%llx\n", (u64)offset); }