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: 2391881 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 48B833FD8C for ; Thu, 4 Apr 2013 10:52:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755822Ab3DDKwE (ORCPT ); Thu, 4 Apr 2013 06:52:04 -0400 Received: from mail-pb0-f49.google.com ([209.85.160.49]:33153 "EHLO mail-pb0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755454Ab3DDKwE (ORCPT ); Thu, 4 Apr 2013 06:52:04 -0400 Received: by mail-pb0-f49.google.com with SMTP id um15so1352486pbc.8 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 Cc: Thomas Abraham , Kukjin Kim 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 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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); }