Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 342301
b: refs/heads/master
c: 326f3ab
h: refs/heads/master
i:
  342299: dff69ae
v: v3
  • Loading branch information
Kukjin Kim committed Nov 19, 2012
1 parent 0299469 commit 3695b01
Show file tree
Hide file tree
Showing 17 changed files with 162 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 64a574344dadbee5d01819d9d73b594d3cbe448e
refs/heads/master: 326f3abf19360014dfae968aa3ab891d25599618
23 changes: 23 additions & 0 deletions trunk/Documentation/devicetree/bindings/media/s5p-mfc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
* Samsung Multi Format Codec (MFC)

Multi Format Codec (MFC) is the IP present in Samsung SoCs which
supports high resolution decoding and encoding functionalities.
The MFC device driver is a v4l2 driver which can encode/decode
video raw/elementary streams and has support for all popular
video codecs.

Required properties:
- compatible : value should be either one among the following
(a) "samsung,mfc-v5" for MFC v5 present in Exynos4 SoCs
(b) "samsung,mfc-v6" for MFC v6 present in Exynos5 SoCs

- reg : Physical base address of the IP registers and length of memory
mapped region.

- interrupts : MFC interrupt number to the CPU.

- samsung,mfc-r : Base address of the first memory bank used by MFC
for DMA contiguous memory allocation and its size.

- samsung,mfc-l : Base address of the second memory bank used by MFC
for DMA contiguous memory allocation and its size.
16 changes: 16 additions & 0 deletions trunk/arch/arm/boot/dts/exynos4210-origen.dts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,22 @@
status = "okay";
};

serial@13800000 {
status = "okay";
};

serial@13810000 {
status = "okay";
};

serial@13820000 {
status = "okay";
};

serial@13830000 {
status = "okay";
};

gpio_keys {
compatible = "gpio-keys";
#address-cells = <1>;
Expand Down
16 changes: 16 additions & 0 deletions trunk/arch/arm/boot/dts/exynos4210-smdkv310.dts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,22 @@
status = "okay";
};

serial@13800000 {
status = "okay";
};

serial@13810000 {
status = "okay";
};

serial@13820000 {
status = "okay";
};

serial@13830000 {
status = "okay";
};

keypad@100A0000 {
samsung,keypad-num-rows = <2>;
samsung,keypad-num-columns = <8>;
Expand Down
7 changes: 7 additions & 0 deletions trunk/arch/arm/boot/dts/exynos4210.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,11 @@
compatible = "samsung,pinctrl-exynos4210";
reg = <0x03860000 0x1000>;
};

tmu@100C0000 {
compatible = "samsung,exynos4210-tmu";
interrupt-parent = <&combiner>;
reg = <0x100C0000 0x100>;
interrupts = <2 4>;
};
};
5 changes: 5 additions & 0 deletions trunk/arch/arm/boot/dts/exynos5250-smdk5250.dts
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,9 @@
spi_2: spi@12d40000 {
status = "disabled";
};

codec@11000000 {
samsung,mfc-r = <0x43000000 0x800000>;
samsung,mfc-l = <0x51000000 0x800000>;
};
};
12 changes: 12 additions & 0 deletions trunk/arch/arm/boot/dts/exynos5250.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,24 @@
interrupts = <0 42 0>;
};

codec@11000000 {
compatible = "samsung,mfc-v6";
reg = <0x11000000 0x10000>;
interrupts = <0 96 0>;
};

rtc {
compatible = "samsung,s3c6410-rtc";
reg = <0x101E0000 0x100>;
interrupts = <0 43 0>, <0 44 0>;
};

tmu@10060000 {
compatible = "samsung,exynos5250-tmu";
reg = <0x10060000 0x100>;
interrupts = <0 65 0>;
};

serial@12C00000 {
compatible = "samsung,exynos4210-uart";
reg = <0x12C00000 0x100>;
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-exynos/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ config SOC_EXYNOS5250
depends on ARCH_EXYNOS5
select S5P_PM if PM
select S5P_SLEEP if PM
select S5P_DEV_MFC
select SAMSUNG_DMADEV
help
Enable EXYNOS5250 SoC support
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/arm/mach-exynos/clock-exynos4.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,10 @@ static struct clk exynos4_init_clocks_off[] = {
.name = "adc",
.enable = exynos4_clk_ip_peril_ctrl,
.ctrlbit = (1 << 15),
}, {
.name = "tmu_apbif",
.enable = exynos4_clk_ip_perir_ctrl,
.ctrlbit = (1 << 17),
}, {
.name = "keypad",
.enable = exynos4_clk_ip_perir_ctrl,
Expand Down
7 changes: 6 additions & 1 deletion trunk/arch/arm/mach-exynos/clock-exynos5.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,11 @@ static struct clk exynos5_init_clocks_off[] = {
.parent = &exynos5_clk_aclk_66.clk,
.enable = exynos5_clk_ip_peric_ctrl,
.ctrlbit = (1 << 24),
}, {
.name = "tmu_apbif",
.parent = &exynos5_clk_aclk_66.clk,
.enable = exynos5_clk_ip_peris_ctrl,
.ctrlbit = (1 << 21),
}, {
.name = "rtc",
.parent = &exynos5_clk_aclk_66.clk,
Expand Down Expand Up @@ -664,7 +669,7 @@ static struct clk exynos5_init_clocks_off[] = {
.ctrlbit = (1 << 25),
}, {
.name = "mfc",
.devname = "s5p-mfc",
.devname = "s5p-mfc-v6",
.enable = exynos5_clk_ip_mfc_ctrl,
.ctrlbit = (1 << 0),
}, {
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/arm/mach-exynos/include/mach/irqs.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@
#define EXYNOS4_IRQ_TSI IRQ_SPI(115)
#define EXYNOS4_IRQ_SATA IRQ_SPI(116)

#define EXYNOS4_IRQ_TMU_TRIG0 COMBINER_IRQ(2, 4)
#define EXYNOS4_IRQ_TMU_TRIG1 COMBINER_IRQ(3, 4)

#define EXYNOS4_IRQ_SYSMMU_MDMA0_0 COMBINER_IRQ(4, 0)
#define EXYNOS4_IRQ_SYSMMU_SSS_0 COMBINER_IRQ(4, 1)
#define EXYNOS4_IRQ_SYSMMU_FIMC0_0 COMBINER_IRQ(4, 2)
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-exynos/include/mach/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
#define EXYNOS4_PA_TWD 0x10500600
#define EXYNOS4_PA_L2CC 0x10502000

#define EXYNOS4_PA_TMU 0x100C0000

#define EXYNOS4_PA_MDMA0 0x10810000
#define EXYNOS4_PA_MDMA1 0x12850000
#define EXYNOS4_PA_PDMA0 0x12680000
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-exynos/mach-exynos4-dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ static const struct of_dev_auxdata exynos4_auxdata_lookup[] __initconst = {
"exynos4210-spi.2", NULL),
OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_PDMA0, "dma-pl330.0", NULL),
OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_PDMA1, "dma-pl330.1", NULL),
OF_DEV_AUXDATA("samsung,exynos4210-tmu", EXYNOS4_PA_TMU,
"exynos-tmu", NULL),
{},
};

Expand Down
18 changes: 18 additions & 0 deletions trunk/arch/arm/mach-exynos/mach-exynos5-dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@

#include <linux/of_platform.h>
#include <linux/serial_core.h>
#include <linux/memblock.h>
#include <linux/of_fdt.h>

#include <asm/mach/arch.h>
#include <asm/hardware/gic.h>
#include <mach/map.h>

#include <plat/cpu.h>
#include <plat/regs-serial.h>
#include <plat/mfc.h>

#include "common.h"

Expand Down Expand Up @@ -72,6 +75,9 @@ static const struct of_dev_auxdata exynos5250_auxdata_lookup[] __initconst = {
"exynos-gsc.2", NULL),
OF_DEV_AUXDATA("samsung,exynos5-gsc", EXYNOS5_PA_GSC3,
"exynos-gsc.3", NULL),
OF_DEV_AUXDATA("samsung,mfc-v6", 0x11000000, "s5p-mfc-v6", NULL),
OF_DEV_AUXDATA("samsung,exynos5250-tmu", 0x10060000,
"exynos-tmu", NULL),
{},
};

Expand All @@ -92,6 +98,17 @@ static char const *exynos5250_dt_compat[] __initdata = {
NULL
};

static void __init exynos5_reserve(void)
{
struct s5p_mfc_dt_meminfo mfc_mem;

/* Reserve memory for MFC only if it's available */
mfc_mem.compatible = "samsung,mfc-v6";
if (of_scan_flat_dt(s5p_fdt_find_mfc_mem, &mfc_mem))
s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize, mfc_mem.loff,
mfc_mem.lsize);
}

DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)")
/* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
.init_irq = exynos5_init_irq,
Expand All @@ -103,4 +120,5 @@ DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)")
.timer = &exynos4_timer,
.dt_compat = exynos5250_dt_compat,
.restart = exynos5_restart,
.reserve = exynos5_reserve,
MACHINE_END
1 change: 1 addition & 0 deletions trunk/arch/arm/plat-samsung/devs.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,7 @@ struct platform_device s5p_device_mfc_r = {
.coherent_dma_mask = DMA_BIT_MASK(32),
},
};

#endif /* CONFIG_S5P_DEV_MFC */

/* MIPI CSIS */
Expand Down
11 changes: 11 additions & 0 deletions trunk/arch/arm/plat-samsung/include/plat/mfc.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
#ifndef __PLAT_SAMSUNG_MFC_H
#define __PLAT_SAMSUNG_MFC_H __FILE__

struct s5p_mfc_dt_meminfo {
unsigned long loff;
unsigned long lsize;
unsigned long roff;
unsigned long rsize;
char *compatible;
};

/**
* s5p_mfc_reserve_mem - function to early reserve memory for MFC driver
* @rbase: base address for MFC 'right' memory interface
Expand All @@ -24,4 +32,7 @@
void __init s5p_mfc_reserve_mem(phys_addr_t rbase, unsigned int rsize,
phys_addr_t lbase, unsigned int lsize);

int __init s5p_fdt_find_mfc_mem(unsigned long node, const char *uname,
int depth, void *data);

#endif /* __PLAT_SAMSUNG_MFC_H */
34 changes: 34 additions & 0 deletions trunk/arch/arm/plat-samsung/s5p-dev-mfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <linux/dma-mapping.h>
#include <linux/memblock.h>
#include <linux/ioport.h>
#include <linux/of_fdt.h>
#include <linux/of.h>

#include <mach/map.h>
#include <plat/devs.h>
Expand Down Expand Up @@ -69,3 +71,35 @@ static int __init s5p_mfc_memory_init(void)
return 0;
}
device_initcall(s5p_mfc_memory_init);

#ifdef CONFIG_OF
int __init s5p_fdt_find_mfc_mem(unsigned long node, const char *uname,
int depth, void *data)
{
__be32 *prop;
unsigned long len;
struct s5p_mfc_dt_meminfo *mfc_mem = data;

if (!data)
return 0;

if (!of_flat_dt_is_compatible(node, mfc_mem->compatible))
return 0;

prop = of_get_flat_dt_prop(node, "samsung,mfc-l", &len);
if (!prop || (len != 2 * sizeof(unsigned long)))
return 0;

mfc_mem->loff = be32_to_cpu(prop[0]);
mfc_mem->lsize = be32_to_cpu(prop[1]);

prop = of_get_flat_dt_prop(node, "samsung,mfc-r", &len);
if (!prop || (len != 2 * sizeof(unsigned long)))
return 0;

mfc_mem->roff = be32_to_cpu(prop[0]);
mfc_mem->rsize = be32_to_cpu(prop[1]);

return 1;
}
#endif

0 comments on commit 3695b01

Please sign in to comment.