From patchwork Mon Dec 30 10:26:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 3418771 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 263359F295 for ; Mon, 30 Dec 2013 10:30:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 21B28200E9 for ; Mon, 30 Dec 2013 10:30:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3C5EC200DC for ; Mon, 30 Dec 2013 10:30:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754511Ab3L3KaX (ORCPT ); Mon, 30 Dec 2013 05:30:23 -0500 Received: from mail-pb0-f42.google.com ([209.85.160.42]:59831 "EHLO mail-pb0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754490Ab3L3KaX (ORCPT ); Mon, 30 Dec 2013 05:30:23 -0500 Received: by mail-pb0-f42.google.com with SMTP id uo5so11531064pbc.1 for ; Mon, 30 Dec 2013 02:30:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6+dgHUetIeWdtC2QMpkp54L6wEmV+ccfvjUbE71Aatw=; b=lqT9Fq5in76C+4rnp+q3CF1rXZpyvYnyyPnAhJMATZEVYsv9ogHOkDQC8HsEu/7myZ O+SbHxJ/WRSL2mtOYDVjQk3Vr3k42spH4ecJ+rIUUNQMQZBVoVlq01oUT6X0DfrXaKXf tT7T+7Mo1s3cmJoGaxY/pQCkrWHMDgbB+jfZtaLzXdBBmS/2YcNtKtWzQmzGVF33cLUY LysHcsOBYGgWbvWQ5SGFq14gcrBryAdI242RkwYVzvRdeOpGWONqJgMbRlCtQwCkgl8g Y/j7noEK++9lG0YPGLPq1BexenptrSg0XUoqJGKMAg5mP9bgXuw69w89oql+yY02lzgo SwJg== X-Gm-Message-State: ALoCoQksg6KOndxO28UOrzRgQEPRRnjIVdiW738sygN6xucWLAcDqKVylRihh7hrL0RM8XfrCsKy X-Received: by 10.68.204.4 with SMTP id ku4mr67983416pbc.66.1388399422234; Mon, 30 Dec 2013 02:30:22 -0800 (PST) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id wp8sm80528752pbc.26.2013.12.30.02.30.19 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Dec 2013 02:30:21 -0800 (PST) From: Tushar Behera To: linux-samsung-soc@vger.kernel.org Cc: jtp.park@samsung.com, k.debski@samsung.com, kyungmin.park@samsung.com, kgene.kim@samsung.com Subject: [PATCH] ARM: SAMSUNG: Reorganize calls to reserve memory for MFC Date: Mon, 30 Dec 2013 15:56:45 +0530 Message-Id: <1388399205-3111-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=-7.0 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 Reorganize code so that "plat/mfc.h" is no more referred from mach-exynos folder. Signed-off-by: Tushar Behera --- Rebased on top of next-20131224. arch/arm/mach-exynos/mach-exynos4-dt.c | 10 ++-------- arch/arm/mach-exynos/mach-exynos5-dt.c | 10 ++-------- arch/arm/plat-samsung/include/plat/mfc.h | 3 --- arch/arm/plat-samsung/s5p-dev-mfc.c | 17 ++++++++++------- 4 files changed, 14 insertions(+), 26 deletions(-) diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c index 4603e6b..66b4a6e 100644 --- a/arch/arm/mach-exynos/mach-exynos4-dt.c +++ b/arch/arm/mach-exynos/mach-exynos4-dt.c @@ -15,9 +15,9 @@ #include #include -#include #include "common.h" +#include "mfc.h" static void __init exynos4_dt_machine_init(void) { @@ -36,13 +36,7 @@ static char const *exynos4_dt_compat[] __initdata = { static void __init exynos4_reserve(void) { #ifdef CONFIG_S5P_DEV_MFC - struct s5p_mfc_dt_meminfo mfc_mem; - - /* Reserve memory for MFC only if it's available */ - mfc_mem.compatible = "samsung,mfc-v5"; - if (of_scan_flat_dt(s5p_fdt_find_mfc_mem, &mfc_mem)) - s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize, mfc_mem.loff, - mfc_mem.lsize); + of_scan_flat_dt(s5p_fdt_alloc_mfc_mem, "samsung,mfc-v5"); #endif } DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)") diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c index 9bb6eac..36b36f4 100644 --- a/arch/arm/mach-exynos/mach-exynos5-dt.c +++ b/arch/arm/mach-exynos/mach-exynos5-dt.c @@ -14,9 +14,9 @@ #include #include -#include #include "common.h" +#include "mfc.h" #include "regs-pmu.h" static void __init exynos5_dt_machine_init(void) @@ -59,13 +59,7 @@ static char const *exynos5_dt_compat[] __initdata = { static void __init exynos5_reserve(void) { #ifdef CONFIG_S5P_DEV_MFC - struct s5p_mfc_dt_meminfo mfc_mem; - - /* Reserve memory for MFC only if it's available */ - mfc_mem.compatible = "samsung,mfc-v6"; - if (of_scan_flat_dt(s5p_fdt_find_mfc_mem, &mfc_mem)) - s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize, mfc_mem.loff, - mfc_mem.lsize); + of_scan_flat_dt(s5p_fdt_alloc_mfc_mem, "samsung,mfc-v6"); #endif } diff --git a/arch/arm/plat-samsung/include/plat/mfc.h b/arch/arm/plat-samsung/include/plat/mfc.h index e6d7c42..033654e 100644 --- a/arch/arm/plat-samsung/include/plat/mfc.h +++ b/arch/arm/plat-samsung/include/plat/mfc.h @@ -32,7 +32,4 @@ struct s5p_mfc_dt_meminfo { void __init s5p_mfc_reserve_mem(phys_addr_t rbase, unsigned int rsize, phys_addr_t lbase, unsigned int lsize); -int __init s5p_fdt_find_mfc_mem(unsigned long node, const char *uname, - int depth, void *data); - #endif /* __PLAT_SAMSUNG_MFC_H */ diff --git a/arch/arm/plat-samsung/s5p-dev-mfc.c b/arch/arm/plat-samsung/s5p-dev-mfc.c index ad51f85..98087b6 100644 --- a/arch/arm/plat-samsung/s5p-dev-mfc.c +++ b/arch/arm/plat-samsung/s5p-dev-mfc.c @@ -122,32 +122,35 @@ device_initcall(s5p_mfc_memory_init); #endif #ifdef CONFIG_OF -int __init s5p_fdt_find_mfc_mem(unsigned long node, const char *uname, +int __init s5p_fdt_alloc_mfc_mem(unsigned long node, const char *uname, int depth, void *data) { __be32 *prop; unsigned long len; - struct s5p_mfc_dt_meminfo *mfc_mem = data; + struct s5p_mfc_dt_meminfo mfc_mem; if (!data) return 0; - if (!of_flat_dt_is_compatible(node, mfc_mem->compatible)) + if (!of_flat_dt_is_compatible(node, data)) return 0; prop = of_get_flat_dt_prop(node, "samsung,mfc-l", &len); if (!prop || (len != 2 * sizeof(unsigned long))) return 0; - mfc_mem->loff = be32_to_cpu(prop[0]); - mfc_mem->lsize = be32_to_cpu(prop[1]); + mfc_mem.loff = be32_to_cpu(prop[0]); + mfc_mem.lsize = be32_to_cpu(prop[1]); prop = of_get_flat_dt_prop(node, "samsung,mfc-r", &len); if (!prop || (len != 2 * sizeof(unsigned long))) return 0; - mfc_mem->roff = be32_to_cpu(prop[0]); - mfc_mem->rsize = be32_to_cpu(prop[1]); + mfc_mem.roff = be32_to_cpu(prop[0]); + mfc_mem.rsize = be32_to_cpu(prop[1]); + + s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize, + mfc_mem.loff, mfc_mem.lsize); return 1; }