diff options
| -rw-r--r-- | Documentation/devicetree/bindings/media/s5p-mfc.txt | 23 | ||||
| -rw-r--r-- | arch/arm/boot/dts/exynos5250-smdk5250.dts | 5 | ||||
| -rw-r--r-- | arch/arm/boot/dts/exynos5250.dtsi | 6 | ||||
| -rw-r--r-- | arch/arm/mach-exynos/Kconfig | 1 | ||||
| -rw-r--r-- | arch/arm/mach-exynos/clock-exynos5.c | 2 | ||||
| -rw-r--r-- | arch/arm/mach-exynos/mach-exynos5-dt.c | 16 | ||||
| -rw-r--r-- | arch/arm/plat-samsung/devs.c | 1 | ||||
| -rw-r--r-- | arch/arm/plat-samsung/include/plat/mfc.h | 11 | ||||
| -rw-r--r-- | arch/arm/plat-samsung/s5p-dev-mfc.c | 34 |
9 files changed, 98 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/media/s5p-mfc.txt b/Documentation/devicetree/bindings/media/s5p-mfc.txt new file mode 100644 index 000000000000..67ec3d4ccc7f --- /dev/null +++ b/Documentation/devicetree/bindings/media/s5p-mfc.txt | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | * Samsung Multi Format Codec (MFC) | ||
| 2 | |||
| 3 | Multi Format Codec (MFC) is the IP present in Samsung SoCs which | ||
| 4 | supports high resolution decoding and encoding functionalities. | ||
| 5 | The MFC device driver is a v4l2 driver which can encode/decode | ||
| 6 | video raw/elementary streams and has support for all popular | ||
| 7 | video codecs. | ||
| 8 | |||
| 9 | Required properties: | ||
| 10 | - compatible : value should be either one among the following | ||
| 11 | (a) "samsung,mfc-v5" for MFC v5 present in Exynos4 SoCs | ||
| 12 | (b) "samsung,mfc-v6" for MFC v6 present in Exynos5 SoCs | ||
| 13 | |||
| 14 | - reg : Physical base address of the IP registers and length of memory | ||
| 15 | mapped region. | ||
| 16 | |||
| 17 | - interrupts : MFC interrupt number to the CPU. | ||
| 18 | |||
| 19 | - samsung,mfc-r : Base address of the first memory bank used by MFC | ||
| 20 | for DMA contiguous memory allocation and its size. | ||
| 21 | |||
| 22 | - samsung,mfc-l : Base address of the second memory bank used by MFC | ||
| 23 | for DMA contiguous memory allocation and its size. | ||
diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts b/arch/arm/boot/dts/exynos5250-smdk5250.dts index a352df403b7a..21d4ccdb0a5a 100644 --- a/arch/arm/boot/dts/exynos5250-smdk5250.dts +++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts | |||
| @@ -166,4 +166,9 @@ | |||
| 166 | spi_2: spi@12d40000 { | 166 | spi_2: spi@12d40000 { |
| 167 | status = "disabled"; | 167 | status = "disabled"; |
| 168 | }; | 168 | }; |
| 169 | |||
| 170 | codec@11000000 { | ||
| 171 | samsung,mfc-r = <0x43000000 0x800000>; | ||
| 172 | samsung,mfc-l = <0x51000000 0x800000>; | ||
| 173 | }; | ||
| 169 | }; | 174 | }; |
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi index dddfd6e444dc..49546bc43ec0 100644 --- a/arch/arm/boot/dts/exynos5250.dtsi +++ b/arch/arm/boot/dts/exynos5250.dtsi | |||
| @@ -62,6 +62,12 @@ | |||
| 62 | interrupts = <0 42 0>; | 62 | interrupts = <0 42 0>; |
| 63 | }; | 63 | }; |
| 64 | 64 | ||
| 65 | codec@11000000 { | ||
| 66 | compatible = "samsung,mfc-v6"; | ||
| 67 | reg = <0x11000000 0x10000>; | ||
| 68 | interrupts = <0 96 0>; | ||
| 69 | }; | ||
| 70 | |||
| 65 | rtc { | 71 | rtc { |
| 66 | compatible = "samsung,s3c6410-rtc"; | 72 | compatible = "samsung,s3c6410-rtc"; |
| 67 | reg = <0x101E0000 0x100>; | 73 | reg = <0x101E0000 0x100>; |
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index da55107033dd..bb3b09aa9183 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig | |||
| @@ -63,6 +63,7 @@ config SOC_EXYNOS5250 | |||
| 63 | depends on ARCH_EXYNOS5 | 63 | depends on ARCH_EXYNOS5 |
| 64 | select S5P_PM if PM | 64 | select S5P_PM if PM |
| 65 | select S5P_SLEEP if PM | 65 | select S5P_SLEEP if PM |
| 66 | select S5P_DEV_MFC | ||
| 66 | select SAMSUNG_DMADEV | 67 | select SAMSUNG_DMADEV |
| 67 | help | 68 | help |
| 68 | Enable EXYNOS5250 SoC support | 69 | Enable EXYNOS5250 SoC support |
diff --git a/arch/arm/mach-exynos/clock-exynos5.c b/arch/arm/mach-exynos/clock-exynos5.c index c44ca1ee1b8d..8c4e3253cdb0 100644 --- a/arch/arm/mach-exynos/clock-exynos5.c +++ b/arch/arm/mach-exynos/clock-exynos5.c | |||
| @@ -664,7 +664,7 @@ static struct clk exynos5_init_clocks_off[] = { | |||
| 664 | .ctrlbit = (1 << 25), | 664 | .ctrlbit = (1 << 25), |
| 665 | }, { | 665 | }, { |
| 666 | .name = "mfc", | 666 | .name = "mfc", |
| 667 | .devname = "s5p-mfc", | 667 | .devname = "s5p-mfc-v6", |
| 668 | .enable = exynos5_clk_ip_mfc_ctrl, | 668 | .enable = exynos5_clk_ip_mfc_ctrl, |
| 669 | .ctrlbit = (1 << 0), | 669 | .ctrlbit = (1 << 0), |
| 670 | }, { | 670 | }, { |
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c index db1cd8eacf28..b7f1154088bd 100644 --- a/arch/arm/mach-exynos/mach-exynos5-dt.c +++ b/arch/arm/mach-exynos/mach-exynos5-dt.c | |||
| @@ -11,6 +11,8 @@ | |||
| 11 | 11 | ||
| 12 | #include <linux/of_platform.h> | 12 | #include <linux/of_platform.h> |
| 13 | #include <linux/serial_core.h> | 13 | #include <linux/serial_core.h> |
| 14 | #include <linux/memblock.h> | ||
| 15 | #include <linux/of_fdt.h> | ||
| 14 | 16 | ||
| 15 | #include <asm/mach/arch.h> | 17 | #include <asm/mach/arch.h> |
| 16 | #include <asm/hardware/gic.h> | 18 | #include <asm/hardware/gic.h> |
| @@ -18,6 +20,7 @@ | |||
| 18 | 20 | ||
| 19 | #include <plat/cpu.h> | 21 | #include <plat/cpu.h> |
| 20 | #include <plat/regs-serial.h> | 22 | #include <plat/regs-serial.h> |
| 23 | #include <plat/mfc.h> | ||
| 21 | 24 | ||
| 22 | #include "common.h" | 25 | #include "common.h" |
| 23 | 26 | ||
| @@ -72,6 +75,7 @@ static const struct of_dev_auxdata exynos5250_auxdata_lookup[] __initconst = { | |||
| 72 | "exynos-gsc.2", NULL), | 75 | "exynos-gsc.2", NULL), |
| 73 | OF_DEV_AUXDATA("samsung,exynos5-gsc", EXYNOS5_PA_GSC3, | 76 | OF_DEV_AUXDATA("samsung,exynos5-gsc", EXYNOS5_PA_GSC3, |
| 74 | "exynos-gsc.3", NULL), | 77 | "exynos-gsc.3", NULL), |
| 78 | OF_DEV_AUXDATA("samsung,mfc-v6", 0x11000000, "s5p-mfc-v6", NULL), | ||
| 75 | {}, | 79 | {}, |
| 76 | }; | 80 | }; |
| 77 | 81 | ||
| @@ -92,6 +96,17 @@ static char const *exynos5250_dt_compat[] __initdata = { | |||
| 92 | NULL | 96 | NULL |
| 93 | }; | 97 | }; |
| 94 | 98 | ||
| 99 | static void __init exynos5_reserve(void) | ||
| 100 | { | ||
| 101 | struct s5p_mfc_dt_meminfo mfc_mem; | ||
| 102 | |||
| 103 | /* Reserve memory for MFC only if it's available */ | ||
| 104 | mfc_mem.compatible = "samsung,mfc-v6"; | ||
| 105 | if (of_scan_flat_dt(s5p_fdt_find_mfc_mem, &mfc_mem)) | ||
| 106 | s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize, mfc_mem.loff, | ||
| 107 | mfc_mem.lsize); | ||
| 108 | } | ||
| 109 | |||
| 95 | DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)") | 110 | DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)") |
| 96 | /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ | 111 | /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ |
| 97 | .init_irq = exynos5_init_irq, | 112 | .init_irq = exynos5_init_irq, |
| @@ -103,4 +118,5 @@ DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)") | |||
| 103 | .timer = &exynos4_timer, | 118 | .timer = &exynos4_timer, |
| 104 | .dt_compat = exynos5250_dt_compat, | 119 | .dt_compat = exynos5250_dt_compat, |
| 105 | .restart = exynos5_restart, | 120 | .restart = exynos5_restart, |
| 121 | .reserve = exynos5_reserve, | ||
| 106 | MACHINE_END | 122 | MACHINE_END |
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c index 03f654d55eff..52dfa8f914c7 100644 --- a/arch/arm/plat-samsung/devs.c +++ b/arch/arm/plat-samsung/devs.c | |||
| @@ -933,6 +933,7 @@ struct platform_device s5p_device_mfc_r = { | |||
| 933 | .coherent_dma_mask = DMA_BIT_MASK(32), | 933 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 934 | }, | 934 | }, |
| 935 | }; | 935 | }; |
| 936 | |||
| 936 | #endif /* CONFIG_S5P_DEV_MFC */ | 937 | #endif /* CONFIG_S5P_DEV_MFC */ |
| 937 | 938 | ||
| 938 | /* MIPI CSIS */ | 939 | /* MIPI CSIS */ |
diff --git a/arch/arm/plat-samsung/include/plat/mfc.h b/arch/arm/plat-samsung/include/plat/mfc.h index ac13227272f0..e6d7c42d68b6 100644 --- a/arch/arm/plat-samsung/include/plat/mfc.h +++ b/arch/arm/plat-samsung/include/plat/mfc.h | |||
| @@ -10,6 +10,14 @@ | |||
| 10 | #ifndef __PLAT_SAMSUNG_MFC_H | 10 | #ifndef __PLAT_SAMSUNG_MFC_H |
| 11 | #define __PLAT_SAMSUNG_MFC_H __FILE__ | 11 | #define __PLAT_SAMSUNG_MFC_H __FILE__ |
| 12 | 12 | ||
| 13 | struct s5p_mfc_dt_meminfo { | ||
| 14 | unsigned long loff; | ||
| 15 | unsigned long lsize; | ||
| 16 | unsigned long roff; | ||
| 17 | unsigned long rsize; | ||
| 18 | char *compatible; | ||
| 19 | }; | ||
| 20 | |||
| 13 | /** | 21 | /** |
| 14 | * s5p_mfc_reserve_mem - function to early reserve memory for MFC driver | 22 | * s5p_mfc_reserve_mem - function to early reserve memory for MFC driver |
| 15 | * @rbase: base address for MFC 'right' memory interface | 23 | * @rbase: base address for MFC 'right' memory interface |
| @@ -24,4 +32,7 @@ | |||
| 24 | void __init s5p_mfc_reserve_mem(phys_addr_t rbase, unsigned int rsize, | 32 | void __init s5p_mfc_reserve_mem(phys_addr_t rbase, unsigned int rsize, |
| 25 | phys_addr_t lbase, unsigned int lsize); | 33 | phys_addr_t lbase, unsigned int lsize); |
| 26 | 34 | ||
| 35 | int __init s5p_fdt_find_mfc_mem(unsigned long node, const char *uname, | ||
| 36 | int depth, void *data); | ||
| 37 | |||
| 27 | #endif /* __PLAT_SAMSUNG_MFC_H */ | 38 | #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 ad6089465e2a..5ec104b5408b 100644 --- a/arch/arm/plat-samsung/s5p-dev-mfc.c +++ b/arch/arm/plat-samsung/s5p-dev-mfc.c | |||
| @@ -14,6 +14,8 @@ | |||
| 14 | #include <linux/dma-mapping.h> | 14 | #include <linux/dma-mapping.h> |
| 15 | #include <linux/memblock.h> | 15 | #include <linux/memblock.h> |
| 16 | #include <linux/ioport.h> | 16 | #include <linux/ioport.h> |
| 17 | #include <linux/of_fdt.h> | ||
| 18 | #include <linux/of.h> | ||
| 17 | 19 | ||
| 18 | #include <mach/map.h> | 20 | #include <mach/map.h> |
| 19 | #include <plat/devs.h> | 21 | #include <plat/devs.h> |
| @@ -69,3 +71,35 @@ static int __init s5p_mfc_memory_init(void) | |||
| 69 | return 0; | 71 | return 0; |
| 70 | } | 72 | } |
| 71 | device_initcall(s5p_mfc_memory_init); | 73 | device_initcall(s5p_mfc_memory_init); |
| 74 | |||
| 75 | #ifdef CONFIG_OF | ||
| 76 | int __init s5p_fdt_find_mfc_mem(unsigned long node, const char *uname, | ||
| 77 | int depth, void *data) | ||
| 78 | { | ||
| 79 | __be32 *prop; | ||
| 80 | unsigned long len; | ||
| 81 | struct s5p_mfc_dt_meminfo *mfc_mem = data; | ||
| 82 | |||
| 83 | if (!data) | ||
| 84 | return 0; | ||
| 85 | |||
| 86 | if (!of_flat_dt_is_compatible(node, mfc_mem->compatible)) | ||
| 87 | return 0; | ||
| 88 | |||
| 89 | prop = of_get_flat_dt_prop(node, "samsung,mfc-l", &len); | ||
| 90 | if (!prop || (len != 2 * sizeof(unsigned long))) | ||
| 91 | return 0; | ||
| 92 | |||
| 93 | mfc_mem->loff = be32_to_cpu(prop[0]); | ||
| 94 | mfc_mem->lsize = be32_to_cpu(prop[1]); | ||
| 95 | |||
| 96 | prop = of_get_flat_dt_prop(node, "samsung,mfc-r", &len); | ||
| 97 | if (!prop || (len != 2 * sizeof(unsigned long))) | ||
| 98 | return 0; | ||
| 99 | |||
| 100 | mfc_mem->roff = be32_to_cpu(prop[0]); | ||
| 101 | mfc_mem->rsize = be32_to_cpu(prop[1]); | ||
| 102 | |||
| 103 | return 1; | ||
| 104 | } | ||
| 105 | #endif | ||
