Commit b93b315d444faa1505b6a5e001c30f3024849e46

Authored by Kukjin Kim
1 parent 7f798c1c0d

ARM: SAMSUNG: make local s5p-dev-mfc in mach-exynos

This patch moves s5p-dev-mfc from plat-samsung into mach-exynos
because it is used for only exynos no other platforms.

Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Kukjin Kim <kgene@kernel.org>

Showing 6 changed files with 101 additions and 100 deletions Side-by-side Diff

arch/arm/mach-exynos/Kconfig
... ... @@ -30,6 +30,11 @@
30 30  
31 31 if ARCH_EXYNOS
32 32  
  33 +config S5P_DEV_MFC
  34 + bool
  35 + help
  36 + Compile in setup memory (init) code for MFC
  37 +
33 38 config ARCH_EXYNOS3
34 39 bool "SAMSUNG EXYNOS3"
35 40 select ARM_CPU_SUSPEND if PM
arch/arm/mach-exynos/Makefile
... ... @@ -23,4 +23,6 @@
23 23  
24 24 obj-$(CONFIG_EXYNOS5420_MCPM) += mcpm-exynos.o
25 25 CFLAGS_mcpm-exynos.o += -march=armv7-a
  26 +
  27 +obj-$(CONFIG_S5P_DEV_MFC) += s5p-dev-mfc.o
arch/arm/mach-exynos/s5p-dev-mfc.c
  1 +/*
  2 + * Copyright (C) 2010-2011 Samsung Electronics Co.Ltd
  3 + *
  4 + * Base S5P MFC resource and device definitions
  5 + *
  6 + * This program is free software; you can redistribute it and/or modify
  7 + * it under the terms of the GNU General Public License version 2 as
  8 + * published by the Free Software Foundation.
  9 + */
  10 +
  11 +#include <linux/kernel.h>
  12 +#include <linux/interrupt.h>
  13 +#include <linux/platform_device.h>
  14 +#include <linux/dma-mapping.h>
  15 +#include <linux/memblock.h>
  16 +#include <linux/ioport.h>
  17 +#include <linux/of_fdt.h>
  18 +#include <linux/of.h>
  19 +
  20 +static struct platform_device s5p_device_mfc_l;
  21 +static struct platform_device s5p_device_mfc_r;
  22 +
  23 +struct s5p_mfc_dt_meminfo {
  24 + unsigned long loff;
  25 + unsigned long lsize;
  26 + unsigned long roff;
  27 + unsigned long rsize;
  28 + char *compatible;
  29 +};
  30 +
  31 +struct s5p_mfc_reserved_mem {
  32 + phys_addr_t base;
  33 + unsigned long size;
  34 + struct device *dev;
  35 +};
  36 +
  37 +static struct s5p_mfc_reserved_mem s5p_mfc_mem[2] __initdata;
  38 +
  39 +
  40 +static void __init s5p_mfc_reserve_mem(phys_addr_t rbase, unsigned int rsize,
  41 + phys_addr_t lbase, unsigned int lsize)
  42 +{
  43 + int i;
  44 +
  45 + s5p_mfc_mem[0].dev = &s5p_device_mfc_r.dev;
  46 + s5p_mfc_mem[0].base = rbase;
  47 + s5p_mfc_mem[0].size = rsize;
  48 +
  49 + s5p_mfc_mem[1].dev = &s5p_device_mfc_l.dev;
  50 + s5p_mfc_mem[1].base = lbase;
  51 + s5p_mfc_mem[1].size = lsize;
  52 +
  53 + for (i = 0; i < ARRAY_SIZE(s5p_mfc_mem); i++) {
  54 + struct s5p_mfc_reserved_mem *area = &s5p_mfc_mem[i];
  55 + if (memblock_remove(area->base, area->size)) {
  56 + printk(KERN_ERR "Failed to reserve memory for MFC device (%ld bytes at 0x%08lx)\n",
  57 + area->size, (unsigned long) area->base);
  58 + area->base = 0;
  59 + }
  60 + }
  61 +}
  62 +
  63 +int __init s5p_fdt_alloc_mfc_mem(unsigned long node, const char *uname,
  64 + int depth, void *data)
  65 +{
  66 + const __be32 *prop;
  67 + int len;
  68 + struct s5p_mfc_dt_meminfo mfc_mem;
  69 +
  70 + if (!data)
  71 + return 0;
  72 +
  73 + if (!of_flat_dt_is_compatible(node, data))
  74 + return 0;
  75 +
  76 + prop = of_get_flat_dt_prop(node, "samsung,mfc-l", &len);
  77 + if (!prop || (len != 2 * sizeof(unsigned long)))
  78 + return 0;
  79 +
  80 + mfc_mem.loff = be32_to_cpu(prop[0]);
  81 + mfc_mem.lsize = be32_to_cpu(prop[1]);
  82 +
  83 + prop = of_get_flat_dt_prop(node, "samsung,mfc-r", &len);
  84 + if (!prop || (len != 2 * sizeof(unsigned long)))
  85 + return 0;
  86 +
  87 + mfc_mem.roff = be32_to_cpu(prop[0]);
  88 + mfc_mem.rsize = be32_to_cpu(prop[1]);
  89 +
  90 + s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize,
  91 + mfc_mem.loff, mfc_mem.lsize);
  92 +
  93 + return 1;
  94 +}
arch/arm/plat-samsung/Kconfig
... ... @@ -233,11 +233,6 @@
233 233 pinctrl-samsung driver.
234 234 endif
235 235  
236   -config S5P_DEV_MFC
237   - bool
238   - help
239   - Compile in setup memory (init) code for MFC
240   -
241 236 comment "Power management"
242 237  
243 238 config SAMSUNG_PM_DEBUG
arch/arm/plat-samsung/Makefile
... ... @@ -20,7 +20,6 @@
20 20  
21 21 obj-$(CONFIG_SAMSUNG_ATAGS) += devs.o
22 22 obj-$(CONFIG_SAMSUNG_ATAGS) += dev-uart.o
23   -obj-$(CONFIG_S5P_DEV_MFC) += s5p-dev-mfc.o
24 23  
25 24 # PM support
26 25  
arch/arm/plat-samsung/s5p-dev-mfc.c
1   -/*
2   - * Copyright (C) 2010-2011 Samsung Electronics Co.Ltd
3   - *
4   - * Base S5P MFC resource and device definitions
5   - *
6   - * This program is free software; you can redistribute it and/or modify
7   - * it under the terms of the GNU General Public License version 2 as
8   - * published by the Free Software Foundation.
9   - */
10   -
11   -#include <linux/kernel.h>
12   -#include <linux/interrupt.h>
13   -#include <linux/platform_device.h>
14   -#include <linux/dma-mapping.h>
15   -#include <linux/memblock.h>
16   -#include <linux/ioport.h>
17   -#include <linux/of_fdt.h>
18   -#include <linux/of.h>
19   -
20   -static struct platform_device s5p_device_mfc_l;
21   -static struct platform_device s5p_device_mfc_r;
22   -
23   -struct s5p_mfc_dt_meminfo {
24   - unsigned long loff;
25   - unsigned long lsize;
26   - unsigned long roff;
27   - unsigned long rsize;
28   - char *compatible;
29   -};
30   -
31   -struct s5p_mfc_reserved_mem {
32   - phys_addr_t base;
33   - unsigned long size;
34   - struct device *dev;
35   -};
36   -
37   -static struct s5p_mfc_reserved_mem s5p_mfc_mem[2] __initdata;
38   -
39   -
40   -static void __init s5p_mfc_reserve_mem(phys_addr_t rbase, unsigned int rsize,
41   - phys_addr_t lbase, unsigned int lsize)
42   -{
43   - int i;
44   -
45   - s5p_mfc_mem[0].dev = &s5p_device_mfc_r.dev;
46   - s5p_mfc_mem[0].base = rbase;
47   - s5p_mfc_mem[0].size = rsize;
48   -
49   - s5p_mfc_mem[1].dev = &s5p_device_mfc_l.dev;
50   - s5p_mfc_mem[1].base = lbase;
51   - s5p_mfc_mem[1].size = lsize;
52   -
53   - for (i = 0; i < ARRAY_SIZE(s5p_mfc_mem); i++) {
54   - struct s5p_mfc_reserved_mem *area = &s5p_mfc_mem[i];
55   - if (memblock_remove(area->base, area->size)) {
56   - printk(KERN_ERR "Failed to reserve memory for MFC device (%ld bytes at 0x%08lx)\n",
57   - area->size, (unsigned long) area->base);
58   - area->base = 0;
59   - }
60   - }
61   -}
62   -
63   -int __init s5p_fdt_alloc_mfc_mem(unsigned long node, const char *uname,
64   - int depth, void *data)
65   -{
66   - const __be32 *prop;
67   - int len;
68   - struct s5p_mfc_dt_meminfo mfc_mem;
69   -
70   - if (!data)
71   - return 0;
72   -
73   - if (!of_flat_dt_is_compatible(node, data))
74   - return 0;
75   -
76   - prop = of_get_flat_dt_prop(node, "samsung,mfc-l", &len);
77   - if (!prop || (len != 2 * sizeof(unsigned long)))
78   - return 0;
79   -
80   - mfc_mem.loff = be32_to_cpu(prop[0]);
81   - mfc_mem.lsize = be32_to_cpu(prop[1]);
82   -
83   - prop = of_get_flat_dt_prop(node, "samsung,mfc-r", &len);
84   - if (!prop || (len != 2 * sizeof(unsigned long)))
85   - return 0;
86   -
87   - mfc_mem.roff = be32_to_cpu(prop[0]);
88   - mfc_mem.rsize = be32_to_cpu(prop[1]);
89   -
90   - s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize,
91   - mfc_mem.loff, mfc_mem.lsize);
92   -
93   - return 1;
94   -}