You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge tag 'samsung-drivers-exynos-mfc-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into next/drivers
Topic branch for Exynos MFC changes for v4.8: Pull s5p-mfc changes from media tree so the arm/mach-exynos code could be removed. The bindings are converted to generic reserved memory bindings. * tag 'samsung-drivers-exynos-mfc-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: dts: exynos: Enable MFC device on Exynos4412 Odroid boards ARM: dts: exynos: Convert MFC device to generic reserved memory bindings ARM: EXYNOS: Remove code for MFC custom reserved memory handling media: s5p-mfc: add iommu support media: s5p-mfc: replace custom reserved memory handling code with generic one media: s5p-mfc: use generic reserved memory bindings of: reserved_mem: add support for using more than one region for given device media: set proper max seg size for devices on Exynos SoCs media: vb2-dma-contig: add helper for setting dma max seg size s5p-mfc: Fix race between s5p_mfc_probe() and s5p_mfc_open() s5p-mfc: Add release callback for memory region devs s5p-mfc: Set device name for reserved memory region devs Signed-off-by: Olof Johansson <olof@lixom.net>
This commit is contained in:
@@ -21,15 +21,18 @@ Required properties:
|
||||
- clock-names : from common clock binding: must contain "mfc",
|
||||
corresponding to entry in the clocks property.
|
||||
|
||||
- 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.
|
||||
|
||||
Optional properties:
|
||||
- power-domains : power-domain property defined with a phandle
|
||||
to respective power domain.
|
||||
- memory-region : from reserved memory binding: phandles to two reserved
|
||||
memory regions, first is for "left" mfc memory bus interfaces,
|
||||
second if for the "right" mfc memory bus, used when no SYSMMU
|
||||
support is available
|
||||
|
||||
Obsolete properties:
|
||||
- samsung,mfc-r, samsung,mfc-l : support removed, please use memory-region
|
||||
property instead
|
||||
|
||||
|
||||
Example:
|
||||
SoC specific DT entry:
|
||||
@@ -43,9 +46,29 @@ mfc: codec@13400000 {
|
||||
clock-names = "mfc";
|
||||
};
|
||||
|
||||
Reserved memory specific DT entry for given board (see reserved memory binding
|
||||
for more information):
|
||||
|
||||
reserved-memory {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
|
||||
mfc_left: region@51000000 {
|
||||
compatible = "shared-dma-pool";
|
||||
no-map;
|
||||
reg = <0x51000000 0x800000>;
|
||||
};
|
||||
|
||||
mfc_right: region@43000000 {
|
||||
compatible = "shared-dma-pool";
|
||||
no-map;
|
||||
reg = <0x43000000 0x800000>;
|
||||
};
|
||||
};
|
||||
|
||||
Board specific DT entry:
|
||||
|
||||
codec@13400000 {
|
||||
samsung,mfc-r = <0x43000000 0x800000>;
|
||||
samsung,mfc-l = <0x51000000 0x800000>;
|
||||
memory-region = <&mfc_left>, <&mfc_right>;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Samsung's Exynos SoC MFC (Video Codec) reserved memory common definition.
|
||||
*
|
||||
* Copyright (c) 2016 Samsung Electronics Co., Ltd
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
/ {
|
||||
reserved-memory {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
|
||||
mfc_left: region@51000000 {
|
||||
compatible = "shared-dma-pool";
|
||||
no-map;
|
||||
reg = <0x51000000 0x800000>;
|
||||
};
|
||||
|
||||
mfc_right: region@43000000 {
|
||||
compatible = "shared-dma-pool";
|
||||
no-map;
|
||||
reg = <0x43000000 0x800000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "exynos4210.dtsi"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include "exynos-mfc-reserved-memory.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Insignal Origen evaluation board based on Exynos4210";
|
||||
@@ -288,8 +289,7 @@
|
||||
};
|
||||
|
||||
&mfc {
|
||||
samsung,mfc-r = <0x43000000 0x800000>;
|
||||
samsung,mfc-l = <0x51000000 0x800000>;
|
||||
memory-region = <&mfc_left>, <&mfc_right>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
/dts-v1/;
|
||||
#include "exynos4210.dtsi"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include "exynos-mfc-reserved-memory.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Samsung smdkv310 evaluation board based on Exynos4210";
|
||||
@@ -133,8 +134,7 @@
|
||||
};
|
||||
|
||||
&mfc {
|
||||
samsung,mfc-r = <0x43000000 0x800000>;
|
||||
samsung,mfc-l = <0x51000000 0x800000>;
|
||||
memory-region = <&mfc_left>, <&mfc_right>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "exynos4412.dtsi"
|
||||
#include "exynos4412-ppmu-common.dtsi"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include "exynos-mfc-reserved-memory.dtsi"
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
@@ -499,6 +500,11 @@
|
||||
clock-names = "iis", "i2s_opclk0", "i2s_opclk1";
|
||||
};
|
||||
|
||||
&mfc {
|
||||
memory-region = <&mfc_left>, <&mfc_right>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mixer {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "exynos4412.dtsi"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include "exynos-mfc-reserved-memory.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Insignal Origen evaluation board based on Exynos4412";
|
||||
@@ -466,8 +467,7 @@
|
||||
};
|
||||
|
||||
&mfc {
|
||||
samsung,mfc-r = <0x43000000 0x800000>;
|
||||
samsung,mfc-l = <0x51000000 0x800000>;
|
||||
memory-region = <&mfc_left>, <&mfc_right>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
/dts-v1/;
|
||||
#include "exynos4412.dtsi"
|
||||
#include "exynos-mfc-reserved-memory.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Samsung SMDK evaluation board based on Exynos4412";
|
||||
@@ -112,8 +113,7 @@
|
||||
};
|
||||
|
||||
&mfc {
|
||||
samsung,mfc-r = <0x43000000 0x800000>;
|
||||
samsung,mfc-l = <0x51000000 0x800000>;
|
||||
memory-region = <&mfc_left>, <&mfc_right>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include "exynos5250.dtsi"
|
||||
#include "exynos-mfc-reserved-memory.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Insignal Arndale evaluation board based on EXYNOS5250";
|
||||
@@ -516,8 +517,7 @@
|
||||
};
|
||||
|
||||
&mfc {
|
||||
samsung,mfc-r = <0x43000000 0x800000>;
|
||||
samsung,mfc-l = <0x51000000 0x800000>;
|
||||
memory-region = <&mfc_left>, <&mfc_right>;
|
||||
};
|
||||
|
||||
&mmc_0 {
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
#include "exynos5250.dtsi"
|
||||
#include "exynos-mfc-reserved-memory.dtsi"
|
||||
|
||||
/ {
|
||||
model = "SAMSUNG SMDK5250 board based on EXYNOS5250";
|
||||
@@ -344,8 +345,7 @@
|
||||
};
|
||||
|
||||
&mfc {
|
||||
samsung,mfc-r = <0x43000000 0x800000>;
|
||||
samsung,mfc-l = <0x51000000 0x800000>;
|
||||
memory-region = <&mfc_left>, <&mfc_right>;
|
||||
};
|
||||
|
||||
&mmc_0 {
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include "exynos5250.dtsi"
|
||||
#include "exynos-mfc-reserved-memory.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Google Spring";
|
||||
@@ -425,8 +426,7 @@
|
||||
};
|
||||
|
||||
&mfc {
|
||||
samsung,mfc-r = <0x43000000 0x800000>;
|
||||
samsung,mfc-l = <0x51000000 0x800000>;
|
||||
memory-region = <&mfc_left>, <&mfc_right>;
|
||||
};
|
||||
|
||||
&mmc_0 {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/clock/samsung,s2mps11.h>
|
||||
#include "exynos-mfc-reserved-memory.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Insignal Arndale Octa evaluation board based on EXYNOS5420";
|
||||
@@ -347,8 +348,7 @@
|
||||
};
|
||||
|
||||
&mfc {
|
||||
samsung,mfc-r = <0x43000000 0x800000>;
|
||||
samsung,mfc-l = <0x51000000 0x800000>;
|
||||
memory-region = <&mfc_left>, <&mfc_right>;
|
||||
};
|
||||
|
||||
&mmc_0 {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <dt-bindings/regulator/maxim,max77802.h>
|
||||
#include "exynos5420.dtsi"
|
||||
#include "exynos5420-cpus.dtsi"
|
||||
#include "exynos-mfc-reserved-memory.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Google Peach Pit Rev 6+";
|
||||
@@ -695,8 +696,7 @@
|
||||
};
|
||||
|
||||
&mfc {
|
||||
samsung,mfc-r = <0x43000000 0x800000>;
|
||||
samsung,mfc-l = <0x51000000 0x800000>;
|
||||
memory-region = <&mfc_left>, <&mfc_right>;
|
||||
};
|
||||
|
||||
&mmc_0 {
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "exynos5420.dtsi"
|
||||
#include "exynos5420-cpus.dtsi"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include "exynos-mfc-reserved-memory.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Samsung SMDK5420 board based on EXYNOS5420";
|
||||
@@ -355,8 +356,7 @@
|
||||
};
|
||||
|
||||
&mfc {
|
||||
samsung,mfc-r = <0x43000000 0x800000>;
|
||||
samsung,mfc-l = <0x51000000 0x800000>;
|
||||
memory-region = <&mfc_left>, <&mfc_right>;
|
||||
};
|
||||
|
||||
&mmc_0 {
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "exynos5800.dtsi"
|
||||
#include "exynos5422-cpus.dtsi"
|
||||
#include "exynos5422-cpu-thermal.dtsi"
|
||||
#include "exynos-mfc-reserved-memory.dtsi"
|
||||
|
||||
/ {
|
||||
memory {
|
||||
@@ -406,8 +407,7 @@
|
||||
};
|
||||
|
||||
&mfc {
|
||||
samsung,mfc-r = <0x43000000 0x800000>;
|
||||
samsung,mfc-l = <0x51000000 0x800000>;
|
||||
memory-region = <&mfc_left>, <&mfc_right>;
|
||||
};
|
||||
|
||||
&mmc_0 {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <dt-bindings/regulator/maxim,max77802.h>
|
||||
#include "exynos5800.dtsi"
|
||||
#include "exynos5420-cpus.dtsi"
|
||||
#include "exynos-mfc-reserved-memory.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Google Peach Pi Rev 10+";
|
||||
@@ -670,8 +671,7 @@
|
||||
};
|
||||
|
||||
&mfc {
|
||||
samsung,mfc-r = <0x43000000 0x800000>;
|
||||
samsung,mfc-l = <0x51000000 0x800000>;
|
||||
memory-region = <&mfc_left>, <&mfc_right>;
|
||||
};
|
||||
|
||||
&mmc_0 {
|
||||
|
||||
@@ -22,5 +22,3 @@ AFLAGS_sleep.o :=-Wa,-march=armv7-a$(plus_sec)
|
||||
|
||||
obj-$(CONFIG_EXYNOS5420_MCPM) += mcpm-exynos.o
|
||||
CFLAGS_mcpm-exynos.o += -march=armv7-a
|
||||
|
||||
obj-$(CONFIG_S5P_DEV_MFC) += s5p-dev-mfc.o
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <mach/map.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "mfc.h"
|
||||
|
||||
static struct map_desc exynos4_iodesc[] __initdata = {
|
||||
{
|
||||
@@ -237,23 +236,6 @@ static char const *const exynos_dt_compat[] __initconst = {
|
||||
NULL
|
||||
};
|
||||
|
||||
static void __init exynos_reserve(void)
|
||||
{
|
||||
#ifdef CONFIG_S5P_DEV_MFC
|
||||
int i;
|
||||
char *mfc_mem[] = {
|
||||
"samsung,mfc-v5",
|
||||
"samsung,mfc-v6",
|
||||
"samsung,mfc-v7",
|
||||
"samsung,mfc-v8",
|
||||
};
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(mfc_mem); i++)
|
||||
if (of_scan_flat_dt(s5p_fdt_alloc_mfc_mem, mfc_mem[i]))
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void __init exynos_dt_fixup(void)
|
||||
{
|
||||
/*
|
||||
@@ -275,6 +257,5 @@ DT_MACHINE_START(EXYNOS_DT, "SAMSUNG EXYNOS (Flattened Device Tree)")
|
||||
.init_machine = exynos_dt_machine_init,
|
||||
.init_late = exynos_init_late,
|
||||
.dt_compat = exynos_dt_compat,
|
||||
.reserve = exynos_reserve,
|
||||
.dt_fixup = exynos_dt_fixup,
|
||||
MACHINE_END
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 Samsung Electronics Co.Ltd
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef __MACH_EXYNOS_MFC_H
|
||||
#define __MACH_EXYNOS_MFC_H __FILE__
|
||||
|
||||
int __init s5p_fdt_alloc_mfc_mem(unsigned long node, const char *uname,
|
||||
int depth, void *data);
|
||||
|
||||
#endif /* __MACH_EXYNOS_MFC_H */
|
||||
@@ -1,93 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2011 Samsung Electronics Co.Ltd
|
||||
*
|
||||
* Base S5P MFC resource and device definitions
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/memblock.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/of_fdt.h>
|
||||
#include <linux/of.h>
|
||||
|
||||
static struct platform_device s5p_device_mfc_l;
|
||||
static struct platform_device s5p_device_mfc_r;
|
||||
|
||||
struct s5p_mfc_dt_meminfo {
|
||||
unsigned long loff;
|
||||
unsigned long lsize;
|
||||
unsigned long roff;
|
||||
unsigned long rsize;
|
||||
char *compatible;
|
||||
};
|
||||
|
||||
struct s5p_mfc_reserved_mem {
|
||||
phys_addr_t base;
|
||||
unsigned long size;
|
||||
struct device *dev;
|
||||
};
|
||||
|
||||
static struct s5p_mfc_reserved_mem s5p_mfc_mem[2] __initdata;
|
||||
|
||||
|
||||
static void __init s5p_mfc_reserve_mem(phys_addr_t rbase, unsigned int rsize,
|
||||
phys_addr_t lbase, unsigned int lsize)
|
||||
{
|
||||
int i;
|
||||
|
||||
s5p_mfc_mem[0].dev = &s5p_device_mfc_r.dev;
|
||||
s5p_mfc_mem[0].base = rbase;
|
||||
s5p_mfc_mem[0].size = rsize;
|
||||
|
||||
s5p_mfc_mem[1].dev = &s5p_device_mfc_l.dev;
|
||||
s5p_mfc_mem[1].base = lbase;
|
||||
s5p_mfc_mem[1].size = lsize;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(s5p_mfc_mem); i++) {
|
||||
struct s5p_mfc_reserved_mem *area = &s5p_mfc_mem[i];
|
||||
if (memblock_remove(area->base, area->size)) {
|
||||
printk(KERN_ERR "Failed to reserve memory for MFC device (%ld bytes at 0x%08lx)\n",
|
||||
area->size, (unsigned long) area->base);
|
||||
area->base = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int __init s5p_fdt_alloc_mfc_mem(unsigned long node, const char *uname,
|
||||
int depth, void *data)
|
||||
{
|
||||
const __be32 *prop;
|
||||
int len;
|
||||
struct s5p_mfc_dt_meminfo mfc_mem;
|
||||
|
||||
if (!data)
|
||||
return 0;
|
||||
|
||||
if (!of_flat_dt_is_compatible(node, data))
|
||||
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]);
|
||||
|
||||
s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize,
|
||||
mfc_mem.loff, mfc_mem.lsize);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -1124,6 +1124,7 @@ static int gsc_probe(struct platform_device *pdev)
|
||||
goto err_m2m;
|
||||
|
||||
/* Initialize continious memory allocator */
|
||||
vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32));
|
||||
gsc->alloc_ctx = vb2_dma_contig_init_ctx(dev);
|
||||
if (IS_ERR(gsc->alloc_ctx)) {
|
||||
ret = PTR_ERR(gsc->alloc_ctx);
|
||||
@@ -1153,6 +1154,7 @@ static int gsc_remove(struct platform_device *pdev)
|
||||
v4l2_device_unregister(&gsc->v4l2_dev);
|
||||
|
||||
vb2_dma_contig_cleanup_ctx(gsc->alloc_ctx);
|
||||
vb2_dma_contig_clear_max_seg_size(&pdev->dev);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
gsc_clk_put(gsc);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user