aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--[-rwxr-xr-x]Makefile0
-rw-r--r--arch/arm/configs/m0_00_defconfig2
-rwxr-xr-xarch/arm/mach-exynos/board-grande.c2
-rw-r--r--arch/arm/mach-exynos/charger-slp.c271
-rw-r--r--arch/arm/mach-exynos/cpuidle-exynos4.c2
-rw-r--r--arch/arm/mach-exynos/mach-midas.c2
-rw-r--r--arch/arm/mach-exynos/mach-p4notepq.c2
-rw-r--r--arch/arm/mach-exynos/mach-px.c6
-rw-r--r--arch/arm/mach-exynos/mach-smdk4x12.c2
-rw-r--r--arch/arm/mach-exynos/mach-u1.c6
-rw-r--r--drivers/gpu/drm/Makefile1
-rw-r--r--drivers/media/video/samsung/fimc/fimc_dev.c54
-rw-r--r--drivers/media/video/samsung/fimc/fimc_dev_u1.c54
-rw-r--r--drivers/media/video/samsung/jpeg/jpeg_dev.c7
-rw-r--r--drivers/media/video/samsung/mali/arch-orion-m400/config.h2
-rw-r--r--drivers/media/video/samsung/tvout/s5p_tvout_v4l2.c59
-rw-r--r--drivers/video/Makefile1
-rw-r--r--drivers/video/fbmem.c12
-rw-r--r--kernel/signal.c3
19 files changed, 452 insertions, 36 deletions
diff --git a/Makefile b/Makefile
index 4467dccdb39..4467dccdb39 100755..100644
--- a/Makefile
+++ b/Makefile
diff --git a/arch/arm/configs/m0_00_defconfig b/arch/arm/configs/m0_00_defconfig
index fb9dea62357..26d9bc6853b 100644
--- a/arch/arm/configs/m0_00_defconfig
+++ b/arch/arm/configs/m0_00_defconfig
@@ -1388,8 +1388,6 @@ CONFIG_WIFI_CONTROL_FUNC=y
# CONFIG_BCM4330 is not set
CONFIG_BCM4334=y
# CONFIG_BCM43241 is not set
-CONFIG_BCMDHD_FW_PATH="/system/etc/firmware/fw_bcmdhd.bin"
-CONFIG_BCMDHD_NVRAM_PATH="/system/etc/wifi/bcmdhd.cal"
CONFIG_BROADCOM_WIFI_RESERVED_MEM=y
CONFIG_WLAN_REGION_CODE=100
# CONFIG_HOSTAP is not set
diff --git a/arch/arm/mach-exynos/board-grande.c b/arch/arm/mach-exynos/board-grande.c
index 79c0fa83492..ede257038d5 100755
--- a/arch/arm/mach-exynos/board-grande.c
+++ b/arch/arm/mach-exynos/board-grande.c
@@ -1553,7 +1553,7 @@ static void __init exynos4_reserve_mem(void)
#endif
static const char map[] __initconst =
- "s3cfb.0=fimd;exynos4-fb.0=fimd;"
+ "s3cfb.0=fimd;exynos4-fb.0=fimd;samsung-pd.1=fimd;"
"s3c-fimc.0=fimc0;s3c-fimc.1=fimc1;s3c-fimc.2=fimc2;s3c-fimc.3=fimc3;"
"exynos4210-fimc.0=fimc0;exynos4210-fimc.1=fimc1;exynos4210-fimc.2=fimc2;exynos4210-fimc.3=fimc3;"
#ifdef CONFIG_ION_EXYNOS
diff --git a/arch/arm/mach-exynos/charger-slp.c b/arch/arm/mach-exynos/charger-slp.c
new file mode 100644
index 00000000000..c8bdefeb879
--- /dev/null
+++ b/arch/arm/mach-exynos/charger-slp.c
@@ -0,0 +1,271 @@
+/*
+ * linux/arch/arm/mach-exynos/charger-slp.c
+ * COPYRIGHT(C) 2011
+ * MyungJoo Ham <myungjoo.ham@samsung.com>
+ *
+ * Charger Support with Charger-Manager Framework
+ *
+ */
+
+#include <linux/io.h>
+#include <linux/err.h>
+#include <linux/platform_device.h>
+#include <linux/regulator/consumer.h>
+#include <linux/power/charger-manager.h>
+#include <linux/hwmon.h>
+#include <linux/platform_data/ntc_thermistor.h>
+
+#include <plat/adc.h>
+#include <plat/pm.h>
+
+#include <mach/regs-pmu.h>
+#include <mach/irqs.h>
+
+#include "board-mobile.h"
+
+#define S5P_WAKEUP_STAT_WKSRC_MASK 0x000ffe3f
+#define ADC_SAMPLING_CNT 7
+#define SDI_2100MA_BATT 4350000
+
+/* Temperatures in milli-centigrade */
+#define SECBATTSPEC_TEMP_HIGH (65 * 1000)
+#define SECBATTSPEC_TEMP_HIGH_REC (43 * 1000)
+#define SECBATTSPEC_TEMP_LOW (-5 * 1000)
+#define SECBATTSPEC_TEMP_LOW_REC (0 * 1000)
+
+#ifdef CONFIG_SENSORS_NTC_THERMISTOR
+struct platform_device midas_ncp15wb473_thermistor;
+static int ntc_adc_num = -EINVAL; /* Uninitialized */
+static struct s3c_adc_client *ntc_adc;
+
+int __init adc_ntc_init(int port)
+{
+ int err = 0;
+
+ if (port < 0 || port > 9)
+ return -EINVAL;
+ ntc_adc_num = port;
+
+ ntc_adc = s3c_adc_register(&midas_ncp15wb473_thermistor,
+ NULL, NULL, 0);
+ if (IS_ERR(ntc_adc)) {
+ err = PTR_ERR(ntc_adc);
+ ntc_adc = NULL;
+ return err;
+ }
+
+ return 0;
+}
+
+static int read_thermistor_uV(void)
+{
+ int val, i;
+ int adc_min = 0;
+ int adc_max = 0;
+ int adc_total = 0;
+
+ s64 converted;
+
+ WARN(ntc_adc == NULL || ntc_adc_num < 0,
+ "NTC-ADC is not initialized for %s.\n", __func__);
+
+ for (i = 0; i < ADC_SAMPLING_CNT; i++) {
+ val = s3c_adc_read(ntc_adc, ntc_adc_num);
+ if (val < 0) {
+ pr_err("%s : read failed.(%d).\n", __func__, val);
+ return -EAGAIN;
+ }
+
+ if (i != 0) {
+ if (val > adc_max)
+ adc_max = val;
+ else if (val < adc_min)
+ adc_min = val;
+ } else {
+ adc_max = val;
+ adc_min = val;
+ }
+
+ adc_total += val;
+ }
+
+ val = (adc_total - (adc_max + adc_min)) / (ADC_SAMPLING_CNT - 2);
+
+ /* Multiplied by maximum input voltage */
+ converted = 1800000LL * (s64) val;
+ /* Divided by resolution */
+ converted >>= 12;
+
+ return converted;
+}
+
+static struct ntc_thermistor_platform_data ncp15wb473_pdata = {
+ .read_uV = read_thermistor_uV,
+ .pullup_uV = 1800000, /* VCC_1.8V_AP */
+ .pullup_ohm = 100000, /* 100K */
+ .pulldown_ohm = 100000, /* 100K */
+ .connect = NTC_CONNECTED_GROUND,
+};
+
+static int __read_thermistor_mC(int *mC)
+{
+ int ret;
+ static struct device *hwmon;
+ static struct hwmon_property *entry;
+
+ if (ntc_adc_num == -EINVAL)
+ return -ENODEV;
+
+ if (hwmon == NULL)
+ hwmon = hwmon_find_device(&midas_ncp15wb473_thermistor.dev);
+
+ if (IS_ERR_OR_NULL(hwmon)) {
+ hwmon = NULL;
+ return -ENODEV;
+ }
+
+ if (entry == NULL)
+ entry = hwmon_get_property(hwmon, "temp1_input");
+ if (IS_ERR_OR_NULL(entry)) {
+ entry = NULL;
+ return -ENODEV;
+ }
+
+ ret = hwmon_get_value(hwmon, entry, mC);
+ if (ret < 0) {
+ entry = NULL;
+ return ret;
+ }
+
+ return 0;
+}
+#else
+static int __read_thermistor_mC(int *mC)
+{
+ *mC = 25000;
+ return 0;
+}
+#endif
+
+enum temp_stat { TEMP_OK = 0, TEMP_HOT = 1, TEMP_COLD = -1 };
+
+static int midas_thermistor_ck(int *mC)
+{
+ static enum temp_stat state = TEMP_OK;
+
+ __read_thermistor_mC(mC);
+
+ switch (state) {
+ case TEMP_OK:
+ if (*mC >= SECBATTSPEC_TEMP_HIGH)
+ state = TEMP_HOT;
+ else if (*mC <= SECBATTSPEC_TEMP_LOW)
+ state = TEMP_COLD;
+ break;
+ case TEMP_HOT:
+ if (*mC <= SECBATTSPEC_TEMP_LOW)
+ state = TEMP_COLD;
+ else if (*mC < SECBATTSPEC_TEMP_HIGH_REC)
+ state = TEMP_OK;
+ break;
+ case TEMP_COLD:
+ if (*mC >= SECBATTSPEC_TEMP_HIGH)
+ state = TEMP_HOT;
+ else if (*mC > SECBATTSPEC_TEMP_LOW_REC)
+ state = TEMP_OK;
+ default:
+ pr_err("%s has invalid state %d\n", __func__, state);
+ }
+
+ return state;
+}
+
+static bool s3c_wksrc_rtc_alarm(void)
+{
+ u32 reg = s3c_suspend_wakeup_stat & S5P_WAKEUP_STAT_WKSRC_MASK;
+
+ if ((reg & S5P_WAKEUP_STAT_RTCALARM) &&
+ !(reg & ~S5P_WAKEUP_STAT_RTCALARM))
+ return true; /* yes, it is */
+
+ return false;
+}
+
+static char *midas_charger_stats[] = {
+#if defined(CONFIG_BATTERY_MAX77693_CHARGER)
+ "max77693-charger",
+#endif
+ NULL };
+
+struct charger_cable charger_cable_vinchg1[] = {
+ {
+ .extcon_name = "max77693-muic",
+ .name = "USB",
+ .min_uA = 475000,
+ .max_uA = 475000 + 25000,
+ }, {
+ .extcon_name = "max77693-muic",
+ .name = "TA",
+ .min_uA = 650000,
+ .max_uA = 650000 + 25000,
+ }, {
+ .extcon_name = "max77693-muic",
+ .name = "MHL",
+ },
+};
+
+static struct charger_regulator midas_regulators[] = {
+ {
+ .regulator_name = "vinchg1",
+ .cables = charger_cable_vinchg1,
+ .num_cables = ARRAY_SIZE(charger_cable_vinchg1),
+ },
+};
+
+static struct charger_desc midas_charger_desc = {
+ .psy_name = "battery",
+ .polling_interval_ms = 30000,
+ .polling_mode = CM_POLL_EXTERNAL_POWER_ONLY,
+ .fullbatt_vchkdrop_ms = 30000,
+ .fullbatt_vchkdrop_uV = 50000,
+ .fullbatt_uV = 4200000,
+ .battery_present = CM_CHARGER_STAT,
+ .psy_charger_stat = midas_charger_stats,
+ .psy_fuel_gauge = "max17047-fuelgauge",
+ .is_temperature_error = midas_thermistor_ck,
+ .measure_ambient_temp = true,
+ .measure_battery_temp = false,
+ .soc_margin = 0,
+
+ .charger_regulators = midas_regulators,
+ .num_charger_regulators = ARRAY_SIZE(midas_regulators),
+};
+
+struct charger_global_desc midas_charger_g_desc = {
+ .rtc = "rtc0",
+ .is_rtc_only_wakeup_reason = s3c_wksrc_rtc_alarm,
+ .assume_timer_stops_in_suspend = false,
+};
+
+struct platform_device midas_charger_manager = {
+ .name = "charger-manager",
+ .dev = {
+ .platform_data = &midas_charger_desc,
+ },
+};
+
+#ifdef CONFIG_SENSORS_NTC_THERMISTOR
+struct platform_device midas_ncp15wb473_thermistor = {
+ .name = "ncp15wb473",
+ .dev = {
+ .platform_data = &ncp15wb473_pdata,
+ },
+};
+#endif
+
+void cm_change_fullbatt_uV(void)
+{
+ midas_charger_desc.fullbatt_uV = SDI_2100MA_BATT;
+}
+EXPORT_SYMBOL(cm_change_fullbatt_uV);
+
diff --git a/arch/arm/mach-exynos/cpuidle-exynos4.c b/arch/arm/mach-exynos/cpuidle-exynos4.c
index 3bfc3fbf5cb..3c77fed4093 100644
--- a/arch/arm/mach-exynos/cpuidle-exynos4.c
+++ b/arch/arm/mach-exynos/cpuidle-exynos4.c
@@ -741,7 +741,7 @@ early_wakeup:
ARRAY_SIZE(exynos4_lpa_save));
#ifdef CONFIG_EXYNOS4_CPUFREQ
- if ((exynos_result_of_asv > 1) && !soc_is_exynos4210()) {
+ if (!soc_is_exynos4210()) {
exynos4x12_set_abb_member(ABB_ARM, abb_val);
exynos4x12_set_abb_member(ABB_INT, abb_val_int);
}
diff --git a/arch/arm/mach-exynos/mach-midas.c b/arch/arm/mach-exynos/mach-midas.c
index c2de56be4b4..46161be0909 100644
--- a/arch/arm/mach-exynos/mach-midas.c
+++ b/arch/arm/mach-exynos/mach-midas.c
@@ -2675,7 +2675,7 @@ static void __init exynos4_reserve_mem(void)
#ifdef CONFIG_EXYNOS_C2C
"samsung-c2c=c2c_shdmem;"
#endif
- "s3cfb.0=fimd;exynos4-fb.0=fimd;"
+ "s3cfb.0=fimd;exynos4-fb.0=fimd;samsung-pd.1=fimd;"
"s3c-fimc.0=fimc0;s3c-fimc.1=fimc1;s3c-fimc.2=fimc2;s3c-fimc.3=fimc3;"
"exynos4210-fimc.0=fimc0;exynos4210-fimc.1=fimc1;exynos4210-fimc.2=fimc2;exynos4210-fimc.3=fimc3;"
#ifdef CONFIG_ION_EXYNOS
diff --git a/arch/arm/mach-exynos/mach-p4notepq.c b/arch/arm/mach-exynos/mach-p4notepq.c
index eafb3b9d5a1..15025568cf6 100644
--- a/arch/arm/mach-exynos/mach-p4notepq.c
+++ b/arch/arm/mach-exynos/mach-p4notepq.c
@@ -2259,7 +2259,7 @@ static void __init exynos4_reserve_mem(void)
#ifdef CONFIG_EXYNOS_C2C
"samsung-c2c=c2c_shdmem;"
#endif
- "s3cfb.0=fimd;exynos4-fb.0=fimd;"
+ "s3cfb.0=fimd;exynos4-fb.0=fimd;samsung-pd.1=fimd;"
"s3c-fimc.0=fimc0;s3c-fimc.1=fimc1;s3c-fimc.2=fimc2;s3c-fimc.3=fimc3;"
"exynos4210-fimc.0=fimc0;exynos4210-fimc.1=fimc1;exynos4210-fimc.2=fimc2;exynos4210-fimc.3=fimc3;"
#ifdef CONFIG_ION_EXYNOS
diff --git a/arch/arm/mach-exynos/mach-px.c b/arch/arm/mach-exynos/mach-px.c
index c5c4cc81d1f..eaec80f6632 100644
--- a/arch/arm/mach-exynos/mach-px.c
+++ b/arch/arm/mach-exynos/mach-px.c
@@ -7246,9 +7246,9 @@ static void __init exynos4_reserve_mem(void)
static const char map[] __initconst =
"android_pmem.0=pmem;android_pmem.1=pmem_gpu1;"
- "s3cfb.0=fimd;exynos4-fb.0=fimd;"
- "s3c-fimc.0=fimc0;s3c-fimc.1=fimc1;s3c-fimc.2=fimc2;"
- "exynos4210-fimc.0=fimc0;exynos4210-fimc.1=fimc1;exynos4210-fimc.2=fimc2;exynos4210-fimc3=fimc3;"
+ "s3cfb.0=fimd;exynos4-fb.0=fimd;samsung-pd.1=fimd;"
+ "s3c-fimc.0=fimc0;s3c-fimc.1=fimc1;s3c-fimc.2=fimc2;s3c-fimc.3=fimc3;"
+ "exynos4210-fimc.0=fimc0;exynos4210-fimc.1=fimc1;exynos4210-fimc.2=fimc2;exynos4210-fimc.3=fimc3;"
#ifdef CONFIG_VIDEO_MFC5X
"s3c-mfc/A=mfc0,mfc-secure;"
"s3c-mfc/B=mfc1,mfc-normal;"
diff --git a/arch/arm/mach-exynos/mach-smdk4x12.c b/arch/arm/mach-exynos/mach-smdk4x12.c
index 97daba27b13..da004f34f4e 100644
--- a/arch/arm/mach-exynos/mach-smdk4x12.c
+++ b/arch/arm/mach-exynos/mach-smdk4x12.c
@@ -3693,7 +3693,7 @@ static void __init exynos4_reserve_mem(void)
#ifdef CONFIG_EXYNOS_C2C
"samsung-c2c=c2c_shdmem;"
#endif
- "s3cfb.0/fimd=fimd;exynos4-fb.0/fimd=fimd;"
+ "s3cfb.0/fimd=fimd;exynos4-fb.0/fimd=fimd;samsung-pd.1=fimd;"
#ifdef CONFIG_EXYNOS_CONTENT_PATH_PROTECTION
"s3cfb.0/video=video;exynos4-fb.0/video=video;"
#endif
diff --git a/arch/arm/mach-exynos/mach-u1.c b/arch/arm/mach-exynos/mach-u1.c
index 59cb0bc587f..ab756ab5d1d 100644
--- a/arch/arm/mach-exynos/mach-u1.c
+++ b/arch/arm/mach-exynos/mach-u1.c
@@ -7767,10 +7767,10 @@ static void __init exynos4_reserve_mem(void)
static const char map[] __initconst =
"android_pmem.0=pmem;android_pmem.1=pmem_gpu1;"
- "s3cfb.0=fimd;exynos4-fb.0=fimd;"
- "s3c-fimc.0=fimc0;s3c-fimc.1=fimc1;s3c-fimc.2=fimc2;"
+ "s3cfb.0=fimd;exynos4-fb.0=fimd;samsung-pd.1=fimd;"
+ "s3c-fimc.0=fimc0;s3c-fimc.1=fimc1;s3c-fimc.2=fimc2;s3c-fimc.3=fimc3;"
"exynos4210-fimc.0=fimc0;exynos4210-fimc.1=fimc1;"
- "exynos4210-fimc.2=fimc2;exynos4210-fimc3=fimc3;"
+ "exynos4210-fimc.2=fimc2;exynos4210-fimc.3=fimc3;"
#ifdef CONFIG_ION_EXYNOS
"ion-exynos=ion;"
#endif
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 94f9ec1ca83..d11f4f33b71 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -40,7 +40,6 @@ obj-$(CONFIG_DRM_VMWGFX)+= vmwgfx/
obj-$(CONFIG_DRM_VIA) +=via/
obj-$(CONFIG_DRM_NOUVEAU) +=nouveau/
ifeq ($(CONFIG_NAPLES_COMMON),y)
-obj-$(CONFIG_DRM_EXYNOS) +=exynos_tmp/
else
obj-$(CONFIG_DRM_EXYNOS) +=exynos/
endif
diff --git a/drivers/media/video/samsung/fimc/fimc_dev.c b/drivers/media/video/samsung/fimc/fimc_dev.c
index 1ed79dd9abd..4822587b031 100644
--- a/drivers/media/video/samsung/fimc/fimc_dev.c
+++ b/drivers/media/video/samsung/fimc/fimc_dev.c
@@ -898,6 +898,50 @@ static struct vm_operations_struct fimc_mmap_ops = {
};
static inline
+int fimc_mmap_own_mem(struct file *filp, struct vm_area_struct *vma)
+{
+ struct fimc_prv_data *prv_data =
+ (struct fimc_prv_data *)filp->private_data;
+ struct fimc_control *ctrl = prv_data->ctrl;
+ u32 start_phy_addr = 0;
+ u32 size = vma->vm_end - vma->vm_start;
+ u32 pfn, idx = vma->vm_pgoff;
+ u32 buf_length = 0;
+
+ buf_length = ctrl->mem.size;
+ if (size > PAGE_ALIGN(buf_length)) {
+ fimc_err("Requested mmap size is too big\n");
+ return -EINVAL;
+ }
+
+ start_phy_addr = ctrl->mem.base + (vma->vm_pgoff << PAGE_SHIFT);
+
+ if (!cma_is_registered_region(start_phy_addr, size)) {
+ pr_err("[%s] handling non-cma region (%#x@%#x)is prohibited\n",
+ __func__, buf_length, start_phy_addr);
+ return -EINVAL;
+ }
+
+ /* only supports non-cached mmap */
+ vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
+ vma->vm_flags |= VM_RESERVED;
+
+ if ((vma->vm_flags & VM_WRITE) && !(vma->vm_flags & VM_SHARED)) {
+ fimc_err("writable mapping must be shared\n");
+ return -EINVAL;
+ }
+
+ pfn = __phys_to_pfn(start_phy_addr);
+
+ if (remap_pfn_range(vma, vma->vm_start, pfn, size, vma->vm_page_prot)) {
+ fimc_err("mmap fail\n");
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+static inline
int fimc_mmap_out_src(struct file *filp, struct vm_area_struct *vma)
{
struct fimc_prv_data *prv_data =
@@ -981,10 +1025,14 @@ static inline int fimc_mmap_out(struct file *filp, struct vm_area_struct *vma)
int idx = ctrl->out->ctx[ctx_id].overlay.req_idx;
int ret = -1;
+#if 0
if (idx >= 0)
ret = fimc_mmap_out_dst(filp, vma, idx);
else if (idx == FIMC_MMAP_IDX)
ret = fimc_mmap_out_src(filp, vma);
+#else
+ ret = fimc_mmap_own_mem(filp, vma);
+#endif
return ret;
}
@@ -1002,6 +1050,12 @@ static inline int fimc_mmap_cap(struct file *filp, struct vm_area_struct *vma)
vma->vm_flags |= VM_RESERVED;
+ if (!cma_is_registered_region(ctrl->cap->bufs[idx].base[0], size)) {
+ pr_err("[%s] handling non-cma region (%#x@%#x)is prohibited\n",
+ __func__, size, ctrl->cap->bufs[idx].base[0]);
+ return -EINVAL;
+ }
+
/*
* page frame number of the address for a source frame
* to be stored at.
diff --git a/drivers/media/video/samsung/fimc/fimc_dev_u1.c b/drivers/media/video/samsung/fimc/fimc_dev_u1.c
index 811ac96c167..52246a1436c 100644
--- a/drivers/media/video/samsung/fimc/fimc_dev_u1.c
+++ b/drivers/media/video/samsung/fimc/fimc_dev_u1.c
@@ -745,6 +745,50 @@ static struct vm_operations_struct fimc_mmap_ops = {
};
static inline
+int fimc_mmap_own_mem(struct file *filp, struct vm_area_struct *vma)
+{
+ struct fimc_prv_data *prv_data =
+ (struct fimc_prv_data *)filp->private_data;
+ struct fimc_control *ctrl = prv_data->ctrl;
+ u32 start_phy_addr = 0;
+ u32 size = vma->vm_end - vma->vm_start;
+ u32 pfn, idx = vma->vm_pgoff;
+ u32 buf_length = 0;
+
+ buf_length = ctrl->mem.size;
+ if (size > PAGE_ALIGN(buf_length)) {
+ fimc_err("Requested mmap size is too big\n");
+ return -EINVAL;
+ }
+
+ start_phy_addr = ctrl->mem.base + (vma->vm_pgoff << PAGE_SHIFT);
+
+ if (!cma_is_registered_region(start_phy_addr, size)) {
+ pr_err("[%s] handling non-cma region (%#x@%#x)is prohibited\n",
+ __func__, buf_length, start_phy_addr);
+ return -EINVAL;
+ }
+
+ /* only supports non-cached mmap */
+ vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
+ vma->vm_flags |= VM_RESERVED;
+
+ if ((vma->vm_flags & VM_WRITE) && !(vma->vm_flags & VM_SHARED)) {
+ fimc_err("writable mapping must be shared\n");
+ return -EINVAL;
+ }
+
+ pfn = __phys_to_pfn(start_phy_addr);
+
+ if (remap_pfn_range(vma, vma->vm_start, pfn, size, vma->vm_page_prot)) {
+ fimc_err("mmap fail\n");
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+static inline
int fimc_mmap_out_src(struct file *filp, struct vm_area_struct *vma)
{
struct fimc_prv_data *prv_data =
@@ -829,10 +873,14 @@ static inline int fimc_mmap_out(struct file *filp, struct vm_area_struct *vma)
int idx = ctrl->out->ctx[ctx_id].overlay.req_idx;
int ret = -1;
+#if 0
if (idx >= 0)
ret = fimc_mmap_out_dst(filp, vma, idx);
else if (idx == FIMC_MMAP_IDX)
ret = fimc_mmap_out_src(filp, vma);
+#else
+ ret = fimc_mmap_own_mem(filp, vma);
+#endif
return ret;
}
@@ -849,6 +897,12 @@ static inline int fimc_mmap_cap(struct file *filp, struct vm_area_struct *vma)
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
vma->vm_flags |= VM_RESERVED;
+ if (!cma_is_registered_region(ctrl->cap->bufs[idx].base[0], size)) {
+ pr_err("[%s] handling non-cma region (%#x@%#x)is prohibited\n",
+ __func__, size, ctrl->cap->bufs[idx].base[0]);
+ return -EINVAL;
+ }
+
/*
* page frame number of the address for a source frame
* to be stored at.
diff --git a/drivers/media/video/samsung/jpeg/jpeg_dev.c b/drivers/media/video/samsung/jpeg/jpeg_dev.c
index 4038fd22ab4..6ebcfb6c48a 100644
--- a/drivers/media/video/samsung/jpeg/jpeg_dev.c
+++ b/drivers/media/video/samsung/jpeg/jpeg_dev.c
@@ -31,6 +31,7 @@
#include <linux/clk.h>
#include <linux/semaphore.h>
#include <linux/vmalloc.h>
+#include <linux/cma.h>
#include <asm/page.h>
#include <linux/sched.h>
@@ -247,6 +248,12 @@ int jpeg_mmap(struct file *filp, struct vm_area_struct *vma)
size = vma->vm_end - vma->vm_start;
+ if (!cma_is_registered_region(jpeg_ctrl->mem.base, size)) {
+ pr_err("[%s] handling non-cma region (%#x@%#x)is prohibited\n",
+ __func__, (unsigned int)size, jpeg_ctrl->mem.base);
+ return -EINVAL;
+ }
+
vma->vm_flags |= VM_RESERVED | VM_IO;
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
diff --git a/drivers/media/video/samsung/mali/arch-orion-m400/config.h b/drivers/media/video/samsung/mali/arch-orion-m400/config.h
index 5c4d79df028..73502a204aa 100644
--- a/drivers/media/video/samsung/mali/arch-orion-m400/config.h
+++ b/drivers/media/video/samsung/mali/arch-orion-m400/config.h
@@ -130,7 +130,7 @@ static _mali_osk_resource_t arch_configuration [] =
#endif/* if USING_OS_MEMORY*/
{
.type = MEM_VALIDATION,
- .description = "memory validation",
+ .description = "Framebuffer Memory",
.base = MEM_BASE_ADDR,
.size = MEM_TOTAL_SIZE,
.flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_READABLE | _MALI_PP_WRITEABLE | _MALI_GP_READABLE | _MALI_GP_WRITEABLE | _MALI_MMU_READABLE | _MALI_MMU_WRITEABLE
diff --git a/drivers/media/video/samsung/tvout/s5p_tvout_v4l2.c b/drivers/media/video/samsung/tvout/s5p_tvout_v4l2.c
index 3fa6e558292..228be02db4f 100644
--- a/drivers/media/video/samsung/tvout/s5p_tvout_v4l2.c
+++ b/drivers/media/video/samsung/tvout/s5p_tvout_v4l2.c
@@ -27,6 +27,8 @@
#include <plat/sysmmu.h>
#endif
+#include <linux/cma.h>
+
#ifdef CONFIG_UMP_VCM_ALLOC
#include "ump_kernel_interface.h"
#endif
@@ -881,13 +883,24 @@ long s5p_tvout_tvif_ioctl(
goto end_tvif_ioctl;
}
for (i = 0; i < S5PTV_VP_BUFF_CNT; i++) {
- s5ptv_vp_buff.vp_buffs[i].phy_base = buffs[i].phy_base;
- s5ptv_vp_buff.vp_buffs[i].vir_base =
- (unsigned int)phys_to_virt(buffs[i].phy_base);
- s5ptv_vp_buff.vp_buffs[i].size = buffs[i].size;
- tvout_dbg("s5ptv_vp_buff phy_base = 0x%x, vir_base = 0x%8x\n",
- s5ptv_vp_buff.vp_buffs[i].phy_base,
- s5ptv_vp_buff.vp_buffs[i].vir_base);
+ if (cma_is_registered_region(buffs[i].phy_base,
+ buffs[i].size)) {
+ s5ptv_vp_buff.vp_buffs[i].phy_base =
+ buffs[i].phy_base;
+ s5ptv_vp_buff.vp_buffs[i].vir_base =
+ (unsigned int)phys_to_virt(buffs[i].phy_base);
+ s5ptv_vp_buff.vp_buffs[i].size = buffs[i].size;
+ tvout_dbg("s5ptv_vp_buff phy_base = 0x%x, "
+ "vir_base = 0x%8x\n",
+ s5ptv_vp_buff.vp_buffs[i].phy_base,
+ s5ptv_vp_buff.vp_buffs[i].vir_base);
+ } else {
+ s5ptv_vp_buff.vp_buffs[i].phy_base = 0;
+ s5ptv_vp_buff.vp_buffs[i].vir_base = 0;
+ printk(KERN_ERR "Buffer for VP is not CMA region\n");
+ ret = -EINVAL;
+ goto end_tvif_ioctl;
+ }
}
goto end_tvif_ioctl;
}
@@ -1134,6 +1147,25 @@ static int s5p_tvout_vo_s_fmt_type_private(
pix_fmt->height, color, field);
#else
if (pix_fmt->priv) {
+ if (pix_fmt->pixelformat == V4L2_PIX_FMT_NV12T
+ || pix_fmt->pixelformat == V4L2_PIX_FMT_NV21T) {
+ y_size = ALIGN(ALIGN(pix_fmt->width, 128) *
+ ALIGN(pix_fmt->height, 32), SZ_8K);
+ cbcr_size = ALIGN(ALIGN(pix_fmt->width, 128) *
+ ALIGN(pix_fmt->height >> 1, 32), SZ_8K);
+ } else {
+ y_size = pix_fmt->width * pix_fmt->height;
+ cbcr_size = pix_fmt->width * (pix_fmt->height >> 1);
+ }
+ if (!cma_is_registered_region((unsigned int)vparam.base_y,
+ y_size) ||
+ !cma_is_registered_region((unsigned int)vparam.base_c,
+ cbcr_size)) {
+ printk(KERN_ERR "Source image for VP is not"
+ "CMA region\n");
+ goto error_on_s_fmt_type_private;
+ }
+
copy_buff_idx =
s5ptv_vp_buff.
copy_buff_idxs[s5ptv_vp_buff.curr_copy_idx];
@@ -1144,19 +1176,6 @@ static int s5p_tvout_vo_s_fmt_type_private(
(u32) vparam.base_y, (u32) vparam.base_c,
pix_fmt->width, pix_fmt->height, color, field);
} else {
- if (pix_fmt->pixelformat ==
- V4L2_PIX_FMT_NV12T
- || pix_fmt->pixelformat == V4L2_PIX_FMT_NV21T) {
- y_size = ALIGN(ALIGN(pix_fmt->width, 128) *
- ALIGN(pix_fmt->height, 32), SZ_8K);
- cbcr_size = ALIGN(ALIGN(pix_fmt->width, 128) *
- ALIGN(pix_fmt->height >> 1, 32), SZ_8K);
- } else {
- y_size = pix_fmt->width * pix_fmt->height;
- cbcr_size =
- pix_fmt->width * (pix_fmt->height >> 1);
- }
-
src_vir_y_addr = (unsigned int)phys_to_virt(
(unsigned long)vparam.base_y);
src_vir_cb_addr = (unsigned int)phys_to_virt(
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index ff3c7b2f615..12618661d3a 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -182,4 +182,3 @@ obj-$(CONFIG_FB_VIRTUAL) += vfb.o
#video output switch sysfs driver
obj-$(CONFIG_VIDEO_OUTPUT_CONTROL) += output.o
-
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index b585a382953..1ca9b202228 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -34,6 +34,7 @@
#include <linux/fb.h>
#include <asm/fb.h>
+#include <linux/cma.h>
/*
@@ -1380,6 +1381,17 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)
/* frame buffer memory */
start = info->fix.smem_start;
len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.smem_len);
+
+#if defined(CONFIG_CPU_EXYNOS4212) || defined(CONFIG_CPU_EXYNOS4412)
+ if (!cma_is_registered_region(start, len)) {
+ pr_err("%s: %x@%x is allowed to map\n",
+ __func__, (unsigned int)start,
+ (unsigned int)len);
+ mutex_unlock(&info->mm_lock);
+ return -EINVAL;
+ }
+#endif
+
if (off >= len) {
/* memory mapped io */
off -= len;
diff --git a/kernel/signal.c b/kernel/signal.c
index 43fee1cf50d..81ff97af709 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -437,6 +437,9 @@ flush_signal_handlers(struct task_struct *t, int force_default)
if (force_default || ka->sa.sa_handler != SIG_IGN)
ka->sa.sa_handler = SIG_DFL;
ka->sa.sa_flags = 0;
+#ifdef SA_RESTORER
+ ka->sa.sa_restorer = NULL;
+#endif
sigemptyset(&ka->sa.sa_mask);
ka++;
}