From patchwork Fri Aug 9 10:05:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 2841849 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D072BBF546 for ; Fri, 9 Aug 2013 10:22:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E4391202BC for ; Fri, 9 Aug 2013 10:22:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AFC4A202B9 for ; Fri, 9 Aug 2013 10:22:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966223Ab3HIKWF (ORCPT ); Fri, 9 Aug 2013 06:22:05 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:64690 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965879Ab3HIKWD (ORCPT ); Fri, 9 Aug 2013 06:22:03 -0400 Received: by mail-pd0-f173.google.com with SMTP id p10so380998pdj.4 for ; Fri, 09 Aug 2013 03:22:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=mrSk+fnJw7xNDfYpe8iKq44zkXFD8QTu/sEzGvPaOdE=; b=MtW8t7FW2PqbRfDXZgYMZa9yTURRE8YB2Zq/UTQ3IiSujlLZ/bsyBnKIBVKBX5SExo gYZa5zxW/MszH+Eh/ck+uJw92ZOQ96F+KkrEvRTVvMLOb3zO34NKNYOAb9VimHD8Hz+o 6YiDdOWgCH1iZRF23T/pLvksb9gV6Gd+VgkMqqlBmbn5Kj27GrttjJbpjIJVBOKZ1s12 kE+ea4WYau4BDbzE+WdwtpKD0IZbnTfDTOEBHiVXJqyGyAoRJceCu+16wInHGLFe1G2n p4vZSs2YMW4kRQnPGDkYjHNwo4TG9ojjnscVNPacXFFyBPc7hk1lEDuGlF0z32P4ZMng 7Efw== X-Gm-Message-State: ALoCoQnvk9zfQvgYpf50R8bWotzQQeiM7TkU+yOT72EMspyh9G+KheEKRli55jfViu/i21zBvLDG X-Received: by 10.66.186.12 with SMTP id fg12mr10699378pac.178.1376043723148; Fri, 09 Aug 2013 03:22:03 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id sp4sm19305368pbc.45.2013.08.09.03.22.00 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 03:22:02 -0700 (PDT) From: Tushar Behera To: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: linux@arm.linux.org.uk, kgene.kim@samsung.com, patches@linaro.org Subject: [PATCH] ARM: EXYNOS: Set 64-bit DMA mask for EXYNOS5250 Date: Fri, 9 Aug 2013 15:35:14 +0530 Message-Id: <1376042714-26513-1-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When LPAE is enabled, we need to set 64bit DMA mask bits. Signed-off-by: Tushar Behera --- Based on v3.11-rc4. arch/arm/mach-exynos/mach-exynos5-dt.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c index f874b77..2217631 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,6 +24,26 @@ #include "common.h" +static u64 dma_mask64 = DMA_BIT_MASK(64); + +static int exynos5250_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 exynos5250_platform_nb = { + .notifier_call = exynos5250_platform_notifier, +}; + static void __init exynos5_dt_machine_init(void) { struct device_node *i2c_np; @@ -47,6 +68,11 @@ static void __init exynos5_dt_machine_init(void) } } + if (config_enabled(CONFIG_ARM_LPAE) && + of_machine_is_compatible("samsung,exynos5250")) + bus_register_notifier(&platform_bus_type, + &exynos5250_platform_nb); + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); }