From patchwork Thu Apr 4 10:51:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kim Kukjin X-Patchwork-Id: 2391901 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id C09E23FD8C for ; Thu, 4 Apr 2013 10:54:22 +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 1UNhoC-0007Rt-Of for patchwork-linux-arm@patchwork.kernel.org; Thu, 04 Apr 2013 10:54:20 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UNhmG-0001nZ-La; Thu, 04 Apr 2013 10:52:20 +0000 Received: from mail-pb0-f42.google.com ([209.85.160.42]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UNhm3-0001lf-Ma for linux-arm-kernel@lists.infradead.org; Thu, 04 Apr 2013 10:52:09 +0000 Received: by mail-pb0-f42.google.com with SMTP id up7so1368772pbc.15 for ; Thu, 04 Apr 2013 03:52:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer; bh=o+W8y0//UOLUYl+7hOVrVIm6rVJypeeFOc7BicErlSQ=; b=zQDb8JtaNdth/arkZhDMYIyRmZHV9XyjjtQJwXXy9RlOq/BPAqUGd0DPvbseStufqd XwEUviU8Lp+E6SLhsNCLbkOdqkEgD02TC44U/7jZ/fqcN1eJxUoJ5aKQN8RV6EaOBkoC Y2rfy9udhycJTopvXOq+7tXaNCVwVjcbqbatvaFdHfzT0CWux5esI5EEplBOYqBDdHII gIPngQVc++NqUMWjOsgwY6RbsuHSki8gDbwQGQ7/YR7bGAyr05no6nwPSHqSyGQBRWOz 6/OvuL8ujowTmdT7GUESGH+5IV5q3zrH2Du57QL6EglFXeCRbMdAlXpHXJ7jxQrShh9o Oo1w== X-Received: by 10.68.129.226 with SMTP id nz2mr79662pbb.51.1365072723610; Thu, 04 Apr 2013 03:52:03 -0700 (PDT) Received: from localhost.localdomain ([121.136.168.198]) by mx.google.com with ESMTPS id fc8sm10971334pad.21.2013.04.04.03.52.01 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 04 Apr 2013 03:52:02 -0700 (PDT) From: Kukjin Kim To: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] ARM: EXYNOS: Add a platform bus notifier to set dma masks for Exynos5440 Date: Thu, 4 Apr 2013 19:51:43 +0900 Message-Id: <1365072704-4568-1-git-send-email-kgene.kim@samsung.com> X-Mailer: git-send-email 1.7.4.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130404_065207_879442_49AF41E6 X-CRM114-Status: GOOD ( 14.47 ) X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.8 RCVD_IN_SORBS_WEB RBL: SORBS: sender is an abusable web server [121.136.168.198 listed in dnsbl.sorbs.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.42 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (kgene.kim[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Kukjin Kim , Thomas Abraham 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 From: Thomas Abraham Use a platform bus notifier callback function to set the correct dma_mask and coherent_dma_mask for every device registered on Exynos5440 based machine. Signed-off-by: Thomas Abraham Signed-off-by: Kukjin Kim --- arch/arm/mach-exynos/mach-exynos5-dt.c | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c index 753b94f..e47c2a5 100644 --- a/arch/arm/mach-exynos/mach-exynos5-dt.c +++ b/arch/arm/mach-exynos/mach-exynos5-dt.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -23,11 +24,30 @@ #include "common.h" +static u64 dma_mask64 = DMA_BIT_MASK(64); + static void __init exynos5_dt_map_io(void) { exynos_init_io(NULL, 0); } +static int exynos5440_platform_notifier(struct notifier_block *nb, + unsigned long event, void *__dev) +{ + struct device *dev = __dev; + + if (event != BUS_NOTIFY_ADD_DEVICE) + return NOTIFY_DONE; + + dev->dma_mask = &dma_mask64; + dev->coherent_dma_mask = DMA_BIT_MASK(64); + return NOTIFY_OK; +} + +static struct notifier_block exynos5440_platform_nb = { + .notifier_call = exynos5440_platform_notifier, +}; + static void __init exynos5_dt_machine_init(void) { struct device_node *i2c_np; @@ -52,6 +72,9 @@ static void __init exynos5_dt_machine_init(void) } } + if (of_machine_is_compatible("samsung,exynos5440")) + bus_register_notifier(&platform_bus_type, &exynos5440_platform_nb); + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); }