From patchwork Fri Nov 19 15:58:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHDheKAmiBOYXphcmV3aWN6?= X-Patchwork-Id: 340041 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAJFxbLu027895 for ; Fri, 19 Nov 2010 15:59:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755456Ab0KSP6e (ORCPT ); Fri, 19 Nov 2010 10:58:34 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:25566 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755424Ab0KSP6c (ORCPT ); Fri, 19 Nov 2010 10:58:32 -0500 Received: from spt2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by mailout2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0LC500L3U31GRG@mailout2.w1.samsung.com>; Fri, 19 Nov 2010 15:58:29 +0000 (GMT) Received: from linux.samsung.com ([106.116.38.10]) by spt2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LC500BOS31EOC@spt2.w1.samsung.com>; Fri, 19 Nov 2010 15:58:27 +0000 (GMT) Received: from pikus.digital.local (unknown [106.116.48.169]) by linux.samsung.com (Postfix) with ESMTP id 55F5F2700F5; Fri, 19 Nov 2010 16:58:23 +0100 (CET) Date: Fri, 19 Nov 2010 16:58:11 +0100 From: Michal Nazarewicz Subject: [RFCv6 13/13] ARM: cma: Added CMA to Aquila, Goni and c210 universal boards In-reply-to: To: mina86@mina86.com Cc: Andrew Morton , Ankita Garg , Bryan Huntsman , Daniel Walker , FUJITA Tomonori , Hans Verkuil , Johan Mossberg , Jonathan Corbet , KAMEZAWA Hiroyuki , Konrad Rzeszutek Wilk , Marcus LORENTZON , Marek Szyprowski , Mark Brown , Mel Gorman , Pawel Osciak , Russell King , Vaidyanathan Srinivasan , Zach Pfeffer , dipankar@in.ibm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-mm@kvack.org Message-id: MIME-version: 1.0 X-Mailer: git-send-email 1.7.2.3 Content-type: TEXT/PLAIN Content-transfer-encoding: 7BIT References: Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 19 Nov 2010 15:59:37 +0000 (UTC) diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c index 28677ca..f1feb73 100644 --- a/arch/arm/mach-s5pv210/mach-aquila.c +++ b/arch/arm/mach-s5pv210/mach-aquila.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -650,6 +651,30 @@ static void __init aquila_sound_init(void) __raw_writel(__raw_readl(S5P_OTHERS) | (0x3 << 8), S5P_OTHERS); } +#ifdef CONFIG_CMA + +static void __init aquila_reserve(void) +{ + static struct cma_region regions[] = { + CMA_REGION("fw", 1 << 20, 128 << 10, 0x32000000), + CMA_REGION("b1", 32 << 20, 0, 0x33000000), + CMA_REGION("b2", 16 << 20, 0, 0x44000000), + { } + }; + + static const char map[] __initconst = + "s5p-mfc5/f=fw;s5p-mfc5/a=b1;s5p-mfc5/b=b2;*=b1,b2"; + + cma_set_defaults(regions, map); + cma_early_regions_reserve(NULL); +} + +#else + +#define aquila_reserve NULL + +#endif + static void __init aquila_map_io(void) { s5p_init_io(NULL, 0, S5P_VA_CHIPID); @@ -690,4 +715,5 @@ MACHINE_START(AQUILA, "Aquila") .map_io = aquila_map_io, .init_machine = aquila_machine_init, .timer = &s3c24xx_timer, + .reserve = aquila_reserve, MACHINE_END diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c index b1dcf96..0bda14f 100644 --- a/arch/arm/mach-s5pv210/mach-goni.c +++ b/arch/arm/mach-s5pv210/mach-goni.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -809,6 +810,30 @@ static void __init goni_sound_init(void) __raw_writel(__raw_readl(S5P_OTHERS) | (0x3 << 8), S5P_OTHERS); } +#ifdef CONFIG_CMA + +static void __init goni_reserve(void) +{ + static struct cma_region regions[] = { + CMA_REGION("fw", 1 << 20, 128 << 10, 0x32000000), + CMA_REGION("b1", 32 << 20, 0, 0x33000000), + CMA_REGION("b2", 16 << 20, 0, 0x44000000), + { } + }; + + static const char map[] __initconst = + "s5p-mfc5/f=fw;s5p-mfc5/a=b1;s5p-mfc5/b=b2;*=b1,b2"; + + cma_set_defaults(regions, map); + cma_early_regions_reserve(NULL); +} + +#else + +#define goni_reserve NULL + +#endif + static void __init goni_map_io(void) { s5p_init_io(NULL, 0, S5P_VA_CHIPID); @@ -865,4 +890,5 @@ MACHINE_START(GONI, "GONI") .map_io = goni_map_io, .init_machine = goni_machine_init, .timer = &s3c24xx_timer, + .reserve = goni_reserve, MACHINE_END diff --git a/arch/arm/mach-s5pv310/mach-universal_c210.c b/arch/arm/mach-s5pv310/mach-universal_c210.c index 16d8fc0..90a2296 100644 --- a/arch/arm/mach-s5pv310/mach-universal_c210.c +++ b/arch/arm/mach-s5pv310/mach-universal_c210.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -138,6 +139,21 @@ static void __init universal_map_io(void) s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs)); } +static void __init universal_reserve(void) +{ + static struct cma_region regions[] = { + CMA_REGION("r" , 64 << 20, 0, 0), + CMA_REGION("fw", 1 << 20, 128 << 10), + { } + }; + + static const char map[] __initconst = + "s3c-mfc5/f=fw;*=r"; + + cma_set_defaults(regions, map); + cma_early_regions_reserve(NULL); +} + static void __init universal_machine_init(void) { i2c_register_board_info(0, i2c0_devs, ARRAY_SIZE(i2c0_devs)); @@ -152,6 +168,7 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") .boot_params = S5P_PA_SDRAM + 0x100, .init_irq = s5pv310_init_irq, .map_io = universal_map_io, + .reserve = universal_reserve, .init_machine = universal_machine_init, .timer = &s5pv310_timer, MACHINE_END