brcm2708: update against latest rpi-3.10.y branch
[openwrt.git] / target / linux / brcm2708 / patches-3.10 / 0039-bcm2708-Add-vc_cma-driver-to-enable-use-of-CMA.patch
1 From bf571a571b090c16cd49458126e996243d8a2626 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/174] 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 --- a/arch/arm/mach-bcm2708/bcm2708.c
11 +++ b/arch/arm/mach-bcm2708/bcm2708.c
12 @@ -60,6 +60,11 @@
13  #include "armctrl.h"
14  #include "clock.h"
15  
16 +#ifdef CONFIG_BCM_VC_CMA
17 +#include <linux/broadcom/vc_cma.h>
18 +#endif
19 +
20 +
21  /* Effectively we have an IOMMU (ARM<->VideoCore map) that is set up to
22   * give us IO access only to 64Mbytes of physical memory (26 bits).  We could
23   * represent this window by setting our dmamasks to 26 bits but, in fact
24 @@ -693,6 +698,9 @@ void __init bcm2708_init(void)
25  {
26         int i;
27  
28 +#if defined(CONFIG_BCM_VC_CMA)
29 +       vc_cma_early_init();
30 +#endif
31         printk("bcm2708.uart_clock = %d\n", uart_clock);
32         pm_power_off = bcm2708_power_off;
33  
34 @@ -889,6 +897,13 @@ void __init bcm2708_init_early(void)
35         init_dma_coherent_pool_size(SZ_4M);
36  }
37  
38 +static void __init board_reserve(void)
39 +{
40 +#if defined(CONFIG_BCM_VC_CMA)
41 +       vc_cma_reserve();
42 +#endif
43 +}
44 +
45  MACHINE_START(BCM2708, "BCM2708")
46      /* Maintainer: Broadcom Europe Ltd. */
47         .map_io = bcm2708_map_io,
48 @@ -897,6 +912,7 @@ MACHINE_START(BCM2708, "BCM2708")
49         .init_machine = bcm2708_init,
50         .init_early = bcm2708_init_early,
51         .restart = bcm2708_restart,
52 +       .reserve = board_reserve,
53  MACHINE_END
54  
55  module_param(boardrev, uint, 0644);