brcm2708: update 3.10 patches with raspberrypi/rpi-3.10.y of 27 Apr. 2014
[openwrt/staging/dedeckeh.git] / target / linux / brcm2708 / patches-3.10 / 0039-bcm2708-Add-vc_cma-driver-to-enable-use-of-CMA.patch
1 From 4998fad71d9539a6f6e28c7ad54142950c85cbe5 Mon Sep 17 00:00:00 2001
2 From: popcornmix <popcornmix@gmail.com>
3 Date: Thu, 28 Mar 2013 00:10:32 +0000
4 Subject: [PATCH 039/196] bcm2708: Add vc_cma driver to enable use of CMA
5
6 ---
7 arch/arm/mach-bcm2708/bcm2708.c | 16 ++++++++++++++++
8 1 file changed, 16 insertions(+)
9
10 diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c
11 index 5a7437b..13b91de 100644
12 --- a/arch/arm/mach-bcm2708/bcm2708.c
13 +++ b/arch/arm/mach-bcm2708/bcm2708.c
14 @@ -60,6 +60,11 @@
15 #include "armctrl.h"
16 #include "clock.h"
17
18 +#ifdef CONFIG_BCM_VC_CMA
19 +#include <linux/broadcom/vc_cma.h>
20 +#endif
21 +
22 +
23 /* Effectively we have an IOMMU (ARM<->VideoCore map) that is set up to
24 * give us IO access only to 64Mbytes of physical memory (26 bits). We could
25 * represent this window by setting our dmamasks to 26 bits but, in fact
26 @@ -693,6 +698,9 @@ void __init bcm2708_init(void)
27 {
28 int i;
29
30 +#if defined(CONFIG_BCM_VC_CMA)
31 + vc_cma_early_init();
32 +#endif
33 printk("bcm2708.uart_clock = %d\n", uart_clock);
34 pm_power_off = bcm2708_power_off;
35
36 @@ -889,6 +897,13 @@ void __init bcm2708_init_early(void)
37 init_dma_coherent_pool_size(SZ_4M);
38 }
39
40 +static void __init board_reserve(void)
41 +{
42 +#if defined(CONFIG_BCM_VC_CMA)
43 + vc_cma_reserve();
44 +#endif
45 +}
46 +
47 MACHINE_START(BCM2708, "BCM2708")
48 /* Maintainer: Broadcom Europe Ltd. */
49 .map_io = bcm2708_map_io,
50 @@ -897,6 +912,7 @@ MACHINE_START(BCM2708, "BCM2708")
51 .init_machine = bcm2708_init,
52 .init_early = bcm2708_init_early,
53 .restart = bcm2708_restart,
54 + .reserve = board_reserve,
55 MACHINE_END
56
57 module_param(boardrev, uint, 0644);
58 --
59 1.9.1
60