summaryrefslogtreecommitdiff
authorYan Wang <yan.wang@amlogic.com>2019-06-12 08:19:17 (GMT)
committer Yan Wang <yan.wang@amlogic.com>2019-08-20 09:33:35 (GMT)
commitb0b77c0408f0f03b30c8a42d33cc91baf814fa1a (patch)
treea46380cb77f5fbef27f613ec38f41cdf5e078d33
parent4905a1043ccff9b0676e9c7bd63c7f158c6e3e35 (diff)
downloadcommon-b0b77c0408f0f03b30c8a42d33cc91baf814fa1a.zip
common-b0b77c0408f0f03b30c8a42d33cc91baf814fa1a.tar.gz
common-b0b77c0408f0f03b30c8a42d33cc91baf814fa1a.tar.bz2
pixel_probe: tl1 add pixel probe control for debug [1/1]
PD#SWPL-9137 Problem: tl1 add APIs to control pixel probe for debug Solution: tl1 add APIs to control pixel probe for debug Verify: X301 this commit MUST not be merged into trunk!!! Change-Id: I3a538ff3afdd80ef5669fac63a3ab5f43b8e1055 Signed-off-by: Yan Wang <yan.wang@amlogic.com>
Diffstat
-rw-r--r--MAINTAINERS5
-rw-r--r--arch/arm/boot/dts/amlogic/mesontl1.dtsi6
-rw-r--r--arch/arm/configs/meson64_a32_defconfig1
-rw-r--r--arch/arm64/boot/dts/amlogic/mesontl1.dtsi6
-rw-r--r--arch/arm64/configs/meson64_defconfig1
-rw-r--r--drivers/amlogic/Kconfig2
-rw-r--r--drivers/amlogic/Makefile2
-rw-r--r--drivers/amlogic/pixel_probe/Kconfig9
-rw-r--r--drivers/amlogic/pixel_probe/Makefile1
-rw-r--r--drivers/amlogic/pixel_probe/pixel_probe.c144
-rw-r--r--drivers/amlogic/secmon/Kconfig2
-rw-r--r--include/linux/amlogic/pixel_probe.h26
12 files changed, 203 insertions, 2 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 2e0f76a..d688667 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -15045,6 +15045,11 @@ M: Pengcheng Chen <pengcheng.chen@amlogic.com>
F: drivers/amlogic/media/osd/osd_virtual.c
F: drivers/amlogic/media/osd/osd_virtual.h
+AMLOGIC TL1 PIXEL PROBE
+M: Yan Wang <yan.wang@amlogic.com>
+F: drivers/amlogic/pixel_probe/*
+F: include/linux/amlogic/pixel_probe.h
+
AMLOGIC ADD HDR10+ TO SDR FUNCTION
M: Cheng Wang <cheng.wang@amlogic.com>
F: drivers/amlogic/media/enhancement/amvecm/hdr/am_hdr10_plus_ootf.c
diff --git a/arch/arm/boot/dts/amlogic/mesontl1.dtsi b/arch/arm/boot/dts/amlogic/mesontl1.dtsi
index 5990fce..af874c6 100644
--- a/arch/arm/boot/dts/amlogic/mesontl1.dtsi
+++ b/arch/arm/boot/dts/amlogic/mesontl1.dtsi
@@ -208,6 +208,12 @@
reserve_mem_size = <0x00300000>;
};
+ pixel_probe {
+ compatible = "amlogic, pixel_probe";
+ vpp_probe_func = <0x820000f1>;
+ vdin_probe_func = <0x820000f2>;
+ };
+
securitykey {
compatible = "amlogic, securitykey";
status = "okay";
diff --git a/arch/arm/configs/meson64_a32_defconfig b/arch/arm/configs/meson64_a32_defconfig
index 3f244c8..9f925b7 100644
--- a/arch/arm/configs/meson64_a32_defconfig
+++ b/arch/arm/configs/meson64_a32_defconfig
@@ -385,6 +385,7 @@ CONFIG_AMLOGIC_DEFENDKEY=y
CONFIG_AMLOGIC_BATTERY_DUMMY=y
CONFIG_AMLOGIC_CHARGER_DUMMY=y
CONFIG_AMLOGIC_HIFI4DSP=y
+CONFIG_AMLOGIC_PIXEL_PROBE=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
diff --git a/arch/arm64/boot/dts/amlogic/mesontl1.dtsi b/arch/arm64/boot/dts/amlogic/mesontl1.dtsi
index a02a7ce..e3c2dfc 100644
--- a/arch/arm64/boot/dts/amlogic/mesontl1.dtsi
+++ b/arch/arm64/boot/dts/amlogic/mesontl1.dtsi
@@ -208,6 +208,12 @@
reserve_mem_size = <0x00300000>;
};
+ pixel_probe {
+ compatible = "amlogic, pixel_probe";
+ vpp_probe_func = <0x820000f1>;
+ vdin_probe_func = <0x820000f2>;
+ };
+
securitykey {
compatible = "amlogic, securitykey";
status = "okay";
diff --git a/arch/arm64/configs/meson64_defconfig b/arch/arm64/configs/meson64_defconfig
index 3f505d1..79a0cc2 100644
--- a/arch/arm64/configs/meson64_defconfig
+++ b/arch/arm64/configs/meson64_defconfig
@@ -381,6 +381,7 @@ CONFIG_AMLOGIC_BATTERY_DUMMY=y
CONFIG_AMLOGIC_CHARGER_DUMMY=y
CONFIG_DOLBY_FW=y
CONFIG_AMLOGIC_HIFI4DSP=y
+CONFIG_AMLOGIC_PIXEL_PROBE=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
diff --git a/drivers/amlogic/Kconfig b/drivers/amlogic/Kconfig
index 52c163e..32493b0 100644
--- a/drivers/amlogic/Kconfig
+++ b/drivers/amlogic/Kconfig
@@ -142,5 +142,7 @@ source "drivers/amlogic/ircut/Kconfig"
source "drivers/amlogic/hifi4dsp/Kconfig"
+source "drivers/amlogic/pixel_probe/Kconfig"
+
endmenu
endif
diff --git a/drivers/amlogic/Makefile b/drivers/amlogic/Makefile
index c8d62eb..885097b 100644
--- a/drivers/amlogic/Makefile
+++ b/drivers/amlogic/Makefile
@@ -139,3 +139,5 @@ obj-$(CONFIG_MTD_SPI_NOR) += spi-nor/
obj-$(CONFIG_DOLBY_FW) += dolby_fw/
obj-$(CONFIG_AMLOGIC_IRCUT) += ircut/
+
+obj-$(CONFIG_AMLOGIC_PIXEL_PROBE) += pixel_probe/
diff --git a/drivers/amlogic/pixel_probe/Kconfig b/drivers/amlogic/pixel_probe/Kconfig
new file mode 100644
index 0000000..4224fc2
--- a/dev/null
+++ b/drivers/amlogic/pixel_probe/Kconfig
@@ -0,0 +1,9 @@
+#
+# Amlogic pixel probe driver
+#
+config AMLOGIC_PIXEL_PROBE
+ bool "Amlogic pixel probe control"
+ default n
+ help
+ This is the Amlogic pixel probe driver
+ this config only ctrl in makefile
diff --git a/drivers/amlogic/pixel_probe/Makefile b/drivers/amlogic/pixel_probe/Makefile
new file mode 100644
index 0000000..901951e
--- a/dev/null
+++ b/drivers/amlogic/pixel_probe/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_AMLOGIC_PIXEL_PROBE) += pixel_probe.o
diff --git a/drivers/amlogic/pixel_probe/pixel_probe.c b/drivers/amlogic/pixel_probe/pixel_probe.c
new file mode 100644
index 0000000..8fba30d
--- a/dev/null
+++ b/drivers/amlogic/pixel_probe/pixel_probe.c
@@ -0,0 +1,144 @@
+/*
+ * drivers/amlogic/pixel_probe/pixel_probe.c
+ *
+ * Copyright (C) 2017 Amlogic, Inc. All rights reserved.
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ */
+
+#include <linux/errno.h>
+#include <linux/err.h>
+#include <linux/of.h>
+#include <linux/module.h>
+#include <linux/of_fdt.h>
+#include <linux/libfdt_env.h>
+#include <linux/io.h>
+#include <linux/platform_device.h>
+#include <linux/dma-contiguous.h>
+#include <asm/compiler.h>
+#include <linux/cma.h>
+#include <linux/arm-smccc.h>
+#undef pr_fmt
+#define pr_fmt(fmt) "pixel_probe: " fmt
+
+
+static DEFINE_MUTEX(pixel_probe_mutex);
+static unsigned int vpp_probe_func;
+static unsigned int vdin_probe_func;
+
+#define PROBE_ENABLE 1
+#define PROBE_DISABLE 0
+
+static int pixel_probe_probe(struct platform_device *pdev)
+{
+ struct device_node *np = pdev->dev.of_node;
+
+ if (of_property_read_u32(np, "vpp_probe_func", &vpp_probe_func)) {
+ pr_err("can't get vpp probe command!\n");
+ return -1;
+ }
+ if (of_property_read_u32(np, "vdin_probe_func", &vdin_probe_func)) {
+ pr_err("can't get vdin probe command!\n");
+ return -1;
+ }
+
+ return 0;
+}
+
+static const struct of_device_id pixel_probe_dt_match[] = {
+ { .compatible = "amlogic, pixel_probe" },
+ { /* sentinel */ },
+};
+
+static struct platform_driver pixel_probe_platform_driver = {
+ .probe = pixel_probe_probe,
+ .driver = {
+ .owner = THIS_MODULE,
+ .name = "pixel",
+ .of_match_table = pixel_probe_dt_match,
+ },
+};
+
+int __init meson_pixel_probe_init(void)
+{
+ int ret;
+
+ ret = platform_driver_register(&pixel_probe_platform_driver);
+ return ret;
+}
+
+subsys_initcall(meson_pixel_probe_init);
+
+
+int vpp_probe_enable(void)
+{
+ struct arm_smccc_res res;
+
+ if (!vpp_probe_func) {
+ pr_err("vpp probe func error!\n");
+ return -1;
+ }
+
+ mutex_lock(&pixel_probe_mutex);
+ arm_smccc_smc(vpp_probe_func, PROBE_ENABLE, 0, 0, 0, 0, 0, 0, &res);
+ mutex_unlock(&pixel_probe_mutex);
+
+ return res.a0;
+}
+
+int vpp_probe_disable(void)
+{
+ struct arm_smccc_res res;
+
+ if (!vpp_probe_func) {
+ pr_err("vpp probe func error!\n");
+ return -1;
+ }
+
+ mutex_lock(&pixel_probe_mutex);
+ arm_smccc_smc(vpp_probe_func, PROBE_DISABLE, 0, 0, 0, 0, 0, 0, &res);
+ mutex_unlock(&pixel_probe_mutex);
+
+ return res.a0;
+}
+
+int vdin_probe_enable(void)
+{
+ struct arm_smccc_res res;
+
+ if (!vdin_probe_func) {
+ pr_err("vdin probe func error!\n");
+ return -1;
+ }
+
+ mutex_lock(&pixel_probe_mutex);
+ arm_smccc_smc(vdin_probe_func, PROBE_ENABLE, 0, 0, 0, 0, 0, 0, &res);
+ mutex_unlock(&pixel_probe_mutex);
+
+ return res.a0;
+}
+
+int vdin_probe_disable(void)
+{
+ struct arm_smccc_res res;
+
+ if (!vdin_probe_func) {
+ pr_err("vdin probe func error!\n");
+ return -1;
+ }
+
+ mutex_lock(&pixel_probe_mutex);
+ arm_smccc_smc(vdin_probe_func, PROBE_DISABLE, 0, 0, 0, 0, 0, 0, &res);
+ mutex_unlock(&pixel_probe_mutex);
+
+ return res.a0;
+}
diff --git a/drivers/amlogic/secmon/Kconfig b/drivers/amlogic/secmon/Kconfig
index ea561f1..43a434e 100644
--- a/drivers/amlogic/secmon/Kconfig
+++ b/drivers/amlogic/secmon/Kconfig
@@ -1,6 +1,5 @@
# Amlogic secure monitor driver
-
config AMLOGIC_SEC
bool "Amlogic secure monitor driver support"
default n
@@ -9,4 +8,3 @@ config AMLOGIC_SEC
this config only ctrl in makefile
prepare share memory
etc
-
diff --git a/include/linux/amlogic/pixel_probe.h b/include/linux/amlogic/pixel_probe.h
new file mode 100644
index 0000000..59ee409
--- a/dev/null
+++ b/include/linux/amlogic/pixel_probe.h
@@ -0,0 +1,26 @@
+/*
+ * include/linux/amlogic/pixel_probe.h
+ *
+ * Copyright (C) 2017 Amlogic, Inc. All rights reserved.
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ */
+
+#ifndef __PIXEL_PROBE_H__
+#define __PIXEL_PROBE_H__
+
+int vpp_probe_enable(void);
+int vpp_probe_disable(void);
+int vdin_probe_enable(void);
+int vdin_probe_disable(void);
+
+#endif