mirror of
https://github.com/LibreELEC/LibreELEC.tv
synced 2025-09-24 19:46:01 +07:00
13720 lines
418 KiB
Diff
13720 lines
418 KiB
Diff
From 759857904aff8804d86fde25a80d11764c9c0dd7 Mon Sep 17 00:00:00 2001
|
|
From: Boris Brezillon <boris.brezillon@collabora.com>
|
|
Date: Mon, 26 Aug 2019 17:26:29 +0200
|
|
Subject: [PATCH] drm: Stop including drm_bridge.h from drm_crtc.h
|
|
|
|
We are about to add a drm_bridge_state that inherits from
|
|
drm_private_state which is defined in drm_atomic.h. Problem is,
|
|
drm_atomic.h includes drm_crtc.h which in turn includes drm_bridge.h,
|
|
leading to "drm_private_state has incomplete type" error.
|
|
|
|
Let's force all users of the drm_bridge API to explicitly include
|
|
drm_bridge.h.
|
|
|
|
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
|
|
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/20190826152649.13820-2-boris.brezillon@collabora.com
|
|
(cherry picked from commit ee68c743f8d0747585b4c0c171c039d6635bda7c)
|
|
---
|
|
drivers/gpu/drm/arc/arcpgu_hdmi.c | 1 +
|
|
drivers/gpu/drm/bridge/analogix-anx78xx.c | 1 +
|
|
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 1 +
|
|
drivers/gpu/drm/bridge/dumb-vga-dac.c | 1 +
|
|
drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c | 1 +
|
|
drivers/gpu/drm/bridge/nxp-ptn3460.c | 1 +
|
|
drivers/gpu/drm/bridge/panel.c | 1 +
|
|
drivers/gpu/drm/bridge/parade-ps8622.c | 1 +
|
|
drivers/gpu/drm/bridge/sii902x.c | 1 +
|
|
drivers/gpu/drm/bridge/sii9234.c | 1 +
|
|
drivers/gpu/drm/bridge/sil-sii8620.c | 1 +
|
|
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 1 +
|
|
drivers/gpu/drm/bridge/tc358764.c | 1 +
|
|
drivers/gpu/drm/bridge/tc358767.c | 1 +
|
|
drivers/gpu/drm/bridge/ti-sn65dsi86.c | 1 +
|
|
drivers/gpu/drm/bridge/ti-tfp410.c | 1 +
|
|
drivers/gpu/drm/drm_atomic_helper.c | 1 +
|
|
drivers/gpu/drm/drm_crtc_helper.c | 1 +
|
|
drivers/gpu/drm/drm_encoder.c | 1 +
|
|
drivers/gpu/drm/drm_probe_helper.c | 1 +
|
|
drivers/gpu/drm/drm_simple_kms_helper.c | 1 +
|
|
drivers/gpu/drm/exynos/exynos_dp.c | 1 +
|
|
drivers/gpu/drm/exynos/exynos_drm_dsi.c | 1 +
|
|
drivers/gpu/drm/exynos/exynos_drm_mic.c | 1 +
|
|
drivers/gpu/drm/exynos/exynos_hdmi.c | 1 +
|
|
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 1 +
|
|
drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c | 1 +
|
|
drivers/gpu/drm/i2c/tda998x_drv.c | 1 +
|
|
drivers/gpu/drm/imx/imx-ldb.c | 1 +
|
|
drivers/gpu/drm/imx/parallel-display.c | 1 +
|
|
drivers/gpu/drm/ingenic/ingenic-drm.c | 1 +
|
|
drivers/gpu/drm/mediatek/mtk_dpi.c | 1 +
|
|
drivers/gpu/drm/mediatek/mtk_dsi.c | 1 +
|
|
drivers/gpu/drm/mediatek/mtk_hdmi.c | 1 +
|
|
drivers/gpu/drm/msm/dsi/dsi.h | 1 +
|
|
drivers/gpu/drm/msm/edp/edp.h | 1 +
|
|
drivers/gpu/drm/msm/hdmi/hdmi.h | 2 ++
|
|
drivers/gpu/drm/omapdrm/dss/output.c | 1 +
|
|
drivers/gpu/drm/omapdrm/omap_drv.c | 1 +
|
|
drivers/gpu/drm/omapdrm/omap_encoder.c | 1 +
|
|
drivers/gpu/drm/rcar-du/rcar_du_encoder.c | 1 +
|
|
drivers/gpu/drm/rockchip/rockchip_lvds.c | 1 +
|
|
drivers/gpu/drm/rockchip/rockchip_rgb.c | 1 +
|
|
drivers/gpu/drm/sti/sti_dvo.c | 1 +
|
|
drivers/gpu/drm/sti/sti_hda.c | 1 +
|
|
drivers/gpu/drm/sti/sti_hdmi.c | 1 +
|
|
drivers/gpu/drm/sun4i/sun4i_lvds.c | 1 +
|
|
drivers/gpu/drm/sun4i/sun4i_rgb.c | 1 +
|
|
drivers/gpu/drm/sun4i/sun4i_tcon.c | 1 +
|
|
drivers/gpu/drm/tilcdc/tilcdc_external.c | 1 +
|
|
drivers/gpu/drm/vc4/vc4_dsi.c | 1 +
|
|
include/drm/drm_crtc.h | 1 -
|
|
52 files changed, 52 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/drivers/gpu/drm/arc/arcpgu_hdmi.c b/drivers/gpu/drm/arc/arcpgu_hdmi.c
|
|
index 98aac743cc26..8fd7094beece 100644
|
|
--- a/drivers/gpu/drm/arc/arcpgu_hdmi.c
|
|
+++ b/drivers/gpu/drm/arc/arcpgu_hdmi.c
|
|
@@ -5,6 +5,7 @@
|
|
* Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
|
|
*/
|
|
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_crtc.h>
|
|
#include <drm/drm_encoder.h>
|
|
#include <drm/drm_device.h>
|
|
diff --git a/drivers/gpu/drm/bridge/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix-anx78xx.c
|
|
index 3c7cc5af735c..e3f4fd2a5ad4 100644
|
|
--- a/drivers/gpu/drm/bridge/analogix-anx78xx.c
|
|
+++ b/drivers/gpu/drm/bridge/analogix-anx78xx.c
|
|
@@ -19,6 +19,7 @@
|
|
#include <linux/types.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_crtc.h>
|
|
#include <drm/drm_dp_helper.h>
|
|
#include <drm/drm_edid.h>
|
|
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
|
|
index 22885dceaa17..bb411fe52ae8 100644
|
|
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
|
|
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
|
|
@@ -21,6 +21,7 @@
|
|
#include <drm/bridge/analogix_dp.h>
|
|
#include <drm/drm_atomic.h>
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_crtc.h>
|
|
#include <drm/drm_device.h>
|
|
#include <drm/drm_panel.h>
|
|
diff --git a/drivers/gpu/drm/bridge/dumb-vga-dac.c b/drivers/gpu/drm/bridge/dumb-vga-dac.c
|
|
index 7aa789c35882..cc33dc411b9e 100644
|
|
--- a/drivers/gpu/drm/bridge/dumb-vga-dac.c
|
|
+++ b/drivers/gpu/drm/bridge/dumb-vga-dac.c
|
|
@@ -12,6 +12,7 @@
|
|
#include <linux/regulator/consumer.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_crtc.h>
|
|
#include <drm/drm_print.h>
|
|
#include <drm/drm_probe_helper.h>
|
|
diff --git a/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c b/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c
|
|
index 6e81e5db57f2..e8a49f6146c6 100644
|
|
--- a/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c
|
|
+++ b/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c
|
|
@@ -25,6 +25,7 @@
|
|
|
|
#include <drm/drm_atomic.h>
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_edid.h>
|
|
#include <drm/drm_print.h>
|
|
#include <drm/drm_probe_helper.h>
|
|
diff --git a/drivers/gpu/drm/bridge/nxp-ptn3460.c b/drivers/gpu/drm/bridge/nxp-ptn3460.c
|
|
index d4a1cc5052c3..57ff01339559 100644
|
|
--- a/drivers/gpu/drm/bridge/nxp-ptn3460.c
|
|
+++ b/drivers/gpu/drm/bridge/nxp-ptn3460.c
|
|
@@ -11,6 +11,7 @@
|
|
#include <linux/module.h>
|
|
#include <linux/of.h>
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_crtc.h>
|
|
#include <drm/drm_edid.h>
|
|
#include <drm/drm_of.h>
|
|
diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c
|
|
index b12ae3a4c5f1..6cffeb4a42f2 100644
|
|
--- a/drivers/gpu/drm/bridge/panel.c
|
|
+++ b/drivers/gpu/drm/bridge/panel.c
|
|
@@ -5,6 +5,7 @@
|
|
*/
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_connector.h>
|
|
#include <drm/drm_encoder.h>
|
|
#include <drm/drm_modeset_helper_vtables.h>
|
|
diff --git a/drivers/gpu/drm/bridge/parade-ps8622.c b/drivers/gpu/drm/bridge/parade-ps8622.c
|
|
index 93c68e2e9484..b7a72dfdcac3 100644
|
|
--- a/drivers/gpu/drm/bridge/parade-ps8622.c
|
|
+++ b/drivers/gpu/drm/bridge/parade-ps8622.c
|
|
@@ -17,6 +17,7 @@
|
|
#include <linux/regulator/consumer.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_crtc.h>
|
|
#include <drm/drm_of.h>
|
|
#include <drm/drm_panel.h>
|
|
diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
|
|
index 38f75ac580df..b70e8c5cf2e1 100644
|
|
--- a/drivers/gpu/drm/bridge/sii902x.c
|
|
+++ b/drivers/gpu/drm/bridge/sii902x.c
|
|
@@ -20,6 +20,7 @@
|
|
#include <linux/clk.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_drv.h>
|
|
#include <drm/drm_edid.h>
|
|
#include <drm/drm_print.h>
|
|
diff --git a/drivers/gpu/drm/bridge/sii9234.c b/drivers/gpu/drm/bridge/sii9234.c
|
|
index 25d4ad8c7ad6..ad00d841ed9e 100644
|
|
--- a/drivers/gpu/drm/bridge/sii9234.c
|
|
+++ b/drivers/gpu/drm/bridge/sii9234.c
|
|
@@ -13,6 +13,7 @@
|
|
* Dharam Kumar <dharam.kr@samsung.com>
|
|
*/
|
|
#include <drm/bridge/mhl.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_crtc.h>
|
|
#include <drm/drm_edid.h>
|
|
|
|
diff --git a/drivers/gpu/drm/bridge/sil-sii8620.c b/drivers/gpu/drm/bridge/sil-sii8620.c
|
|
index bd3165ee5354..14643923a721 100644
|
|
--- a/drivers/gpu/drm/bridge/sil-sii8620.c
|
|
+++ b/drivers/gpu/drm/bridge/sil-sii8620.c
|
|
@@ -9,6 +9,7 @@
|
|
#include <asm/unaligned.h>
|
|
|
|
#include <drm/bridge/mhl.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_crtc.h>
|
|
#include <drm/drm_edid.h>
|
|
#include <drm/drm_encoder.h>
|
|
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
|
index 521d689413c8..16a21460f481 100644
|
|
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
|
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
|
@@ -26,6 +26,7 @@
|
|
|
|
#include <drm/bridge/dw_hdmi.h>
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_edid.h>
|
|
#include <drm/drm_of.h>
|
|
#include <drm/drm_print.h>
|
|
diff --git a/drivers/gpu/drm/bridge/tc358764.c b/drivers/gpu/drm/bridge/tc358764.c
|
|
index 170f162ffa55..db298f550a5a 100644
|
|
--- a/drivers/gpu/drm/bridge/tc358764.c
|
|
+++ b/drivers/gpu/drm/bridge/tc358764.c
|
|
@@ -16,6 +16,7 @@
|
|
#include <video/mipi_display.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_crtc.h>
|
|
#include <drm/drm_fb_helper.h>
|
|
#include <drm/drm_mipi_dsi.h>
|
|
diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
|
|
index 8a8d605021f0..da7e35b0893d 100644
|
|
--- a/drivers/gpu/drm/bridge/tc358767.c
|
|
+++ b/drivers/gpu/drm/bridge/tc358767.c
|
|
@@ -26,6 +26,7 @@
|
|
#include <linux/slab.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_dp_helper.h>
|
|
#include <drm/drm_edid.h>
|
|
#include <drm/drm_of.h>
|
|
diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
|
|
index 0a580957c8cf..43abf01ebd4c 100644
|
|
--- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
|
|
+++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
|
|
@@ -17,6 +17,7 @@
|
|
|
|
#include <drm/drm_atomic.h>
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_dp_helper.h>
|
|
#include <drm/drm_mipi_dsi.h>
|
|
#include <drm/drm_of.h>
|
|
diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c
|
|
index 61cc2354ef1b..aa3198dc9903 100644
|
|
--- a/drivers/gpu/drm/bridge/ti-tfp410.c
|
|
+++ b/drivers/gpu/drm/bridge/ti-tfp410.c
|
|
@@ -14,6 +14,7 @@
|
|
#include <linux/platform_device.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_crtc.h>
|
|
#include <drm/drm_print.h>
|
|
#include <drm/drm_probe_helper.h>
|
|
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
|
|
index 2dd2cd87cdbb..b4d10b62b01a 100644
|
|
--- a/drivers/gpu/drm/drm_atomic_helper.c
|
|
+++ b/drivers/gpu/drm/drm_atomic_helper.c
|
|
@@ -31,6 +31,7 @@
|
|
#include <drm/drm_atomic.h>
|
|
#include <drm/drm_atomic_helper.h>
|
|
#include <drm/drm_atomic_uapi.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_damage_helper.h>
|
|
#include <drm/drm_device.h>
|
|
#include <drm/drm_plane_helper.h>
|
|
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
|
|
index 80ddf13ad996..a51824a7e7c1 100644
|
|
--- a/drivers/gpu/drm/drm_crtc_helper.c
|
|
+++ b/drivers/gpu/drm/drm_crtc_helper.c
|
|
@@ -36,6 +36,7 @@
|
|
#include <drm/drm_atomic.h>
|
|
#include <drm/drm_atomic_helper.h>
|
|
#include <drm/drm_atomic_uapi.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_crtc.h>
|
|
#include <drm/drm_crtc_helper.h>
|
|
#include <drm/drm_drv.h>
|
|
diff --git a/drivers/gpu/drm/drm_encoder.c b/drivers/gpu/drm/drm_encoder.c
|
|
index 7fb47b7b8b44..80d88a55302e 100644
|
|
--- a/drivers/gpu/drm/drm_encoder.c
|
|
+++ b/drivers/gpu/drm/drm_encoder.c
|
|
@@ -22,6 +22,7 @@
|
|
|
|
#include <linux/export.h>
|
|
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_device.h>
|
|
#include <drm/drm_drv.h>
|
|
#include <drm/drm_encoder.h>
|
|
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
|
|
index ef2c468205a2..351cbc40f0f8 100644
|
|
--- a/drivers/gpu/drm/drm_probe_helper.c
|
|
+++ b/drivers/gpu/drm/drm_probe_helper.c
|
|
@@ -32,6 +32,7 @@
|
|
#include <linux/export.h>
|
|
#include <linux/moduleparam.h>
|
|
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_client.h>
|
|
#include <drm/drm_crtc.h>
|
|
#include <drm/drm_edid.h>
|
|
diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/drm_simple_kms_helper.c
|
|
index b11910f14c46..046055719245 100644
|
|
--- a/drivers/gpu/drm/drm_simple_kms_helper.c
|
|
+++ b/drivers/gpu/drm/drm_simple_kms_helper.c
|
|
@@ -8,6 +8,7 @@
|
|
|
|
#include <drm/drm_atomic.h>
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_plane_helper.h>
|
|
#include <drm/drm_probe_helper.h>
|
|
#include <drm/drm_simple_kms_helper.h>
|
|
diff --git a/drivers/gpu/drm/exynos/exynos_dp.c b/drivers/gpu/drm/exynos/exynos_dp.c
|
|
index 3a0f0ba8c63a..1e6aa24bf45e 100644
|
|
--- a/drivers/gpu/drm/exynos/exynos_dp.c
|
|
+++ b/drivers/gpu/drm/exynos/exynos_dp.c
|
|
@@ -19,6 +19,7 @@
|
|
|
|
#include <drm/bridge/analogix_dp.h>
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_crtc.h>
|
|
#include <drm/drm_of.h>
|
|
#include <drm/drm_panel.h>
|
|
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
|
|
index 6926cee91b36..72726f2c7a9f 100644
|
|
--- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
|
|
+++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
|
|
@@ -24,6 +24,7 @@
|
|
#include <video/videomode.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_fb_helper.h>
|
|
#include <drm/drm_mipi_dsi.h>
|
|
#include <drm/drm_panel.h>
|
|
diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c
|
|
index b78e8c5ba553..f41d75923557 100644
|
|
--- a/drivers/gpu/drm/exynos/exynos_drm_mic.c
|
|
+++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c
|
|
@@ -21,6 +21,7 @@
|
|
#include <video/of_videomode.h>
|
|
#include <video/videomode.h>
|
|
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_encoder.h>
|
|
#include <drm/drm_print.h>
|
|
|
|
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
|
|
index bc1565f1822a..2e3795c2c794 100644
|
|
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
|
|
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
|
|
@@ -34,6 +34,7 @@
|
|
#include <media/cec-notifier.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_edid.h>
|
|
#include <drm/drm_print.h>
|
|
#include <drm/drm_probe_helper.h>
|
|
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c
|
|
index a92fd6c70b09..82c972e9c024 100644
|
|
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c
|
|
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c
|
|
@@ -9,6 +9,7 @@
|
|
#include <linux/of_graph.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_of.h>
|
|
#include <drm/drm_panel.h>
|
|
#include <drm/drm_probe_helper.h>
|
|
diff --git a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c
|
|
index 5bf8138941de..bdcf9c6ae9e9 100644
|
|
--- a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c
|
|
+++ b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c
|
|
@@ -18,6 +18,7 @@
|
|
#include <linux/platform_device.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_device.h>
|
|
#include <drm/drm_encoder_slave.h>
|
|
#include <drm/drm_mipi_dsi.h>
|
|
diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c
|
|
index 84c6d4c91c65..6c218bace2ce 100644
|
|
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
|
|
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
|
|
@@ -14,6 +14,7 @@
|
|
#include <sound/hdmi-codec.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_edid.h>
|
|
#include <drm/drm_of.h>
|
|
#include <drm/drm_print.h>
|
|
diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
|
|
index 695f307f36b2..208069faf183 100644
|
|
--- a/drivers/gpu/drm/imx/imx-ldb.c
|
|
+++ b/drivers/gpu/drm/imx/imx-ldb.c
|
|
@@ -20,6 +20,7 @@
|
|
|
|
#include <drm/drm_atomic.h>
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_fb_helper.h>
|
|
#include <drm/drm_of.h>
|
|
#include <drm/drm_panel.h>
|
|
diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c
|
|
index e7ce17503ae1..35518e5de356 100644
|
|
--- a/drivers/gpu/drm/imx/parallel-display.c
|
|
+++ b/drivers/gpu/drm/imx/parallel-display.c
|
|
@@ -13,6 +13,7 @@
|
|
#include <video/of_display_timing.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_fb_helper.h>
|
|
#include <drm/drm_of.h>
|
|
#include <drm/drm_panel.h>
|
|
diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c b/drivers/gpu/drm/ingenic/ingenic-drm.c
|
|
index 2e2ed653e9c6..d60f23fd69be 100644
|
|
--- a/drivers/gpu/drm/ingenic/ingenic-drm.c
|
|
+++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
|
|
@@ -13,6 +13,7 @@
|
|
|
|
#include <drm/drm_atomic.h>
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_crtc.h>
|
|
#include <drm/drm_crtc_helper.h>
|
|
#include <drm/drm_drv.h>
|
|
diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c
|
|
index be6d95c5ff25..01fa8b8d763d 100644
|
|
--- a/drivers/gpu/drm/mediatek/mtk_dpi.c
|
|
+++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
|
|
@@ -17,6 +17,7 @@
|
|
#include <video/videomode.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_crtc.h>
|
|
#include <drm/drm_of.h>
|
|
|
|
diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
|
|
index 224afb666881..a413f5ff442d 100644
|
|
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
|
|
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
|
|
@@ -16,6 +16,7 @@
|
|
#include <video/videomode.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_mipi_dsi.h>
|
|
#include <drm/drm_of.h>
|
|
#include <drm/drm_panel.h>
|
|
diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c
|
|
index ce91b61364eb..c79b1f855d89 100644
|
|
--- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
|
|
+++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
|
|
@@ -23,6 +23,7 @@
|
|
#include <sound/hdmi-codec.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_crtc.h>
|
|
#include <drm/drm_edid.h>
|
|
#include <drm/drm_print.h>
|
|
diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h
|
|
index 0da8a4e428ad..eff1a4c61258 100644
|
|
--- a/drivers/gpu/drm/msm/dsi/dsi.h
|
|
+++ b/drivers/gpu/drm/msm/dsi/dsi.h
|
|
@@ -9,6 +9,7 @@
|
|
#include <linux/of_platform.h>
|
|
#include <linux/platform_device.h>
|
|
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_crtc.h>
|
|
#include <drm/drm_mipi_dsi.h>
|
|
#include <drm/drm_panel.h>
|
|
diff --git a/drivers/gpu/drm/msm/edp/edp.h b/drivers/gpu/drm/msm/edp/edp.h
|
|
index f2c17858a703..eb34243dad53 100644
|
|
--- a/drivers/gpu/drm/msm/edp/edp.h
|
|
+++ b/drivers/gpu/drm/msm/edp/edp.h
|
|
@@ -10,6 +10,7 @@
|
|
#include <linux/interrupt.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/platform_device.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_crtc.h>
|
|
#include <drm/drm_dp_helper.h>
|
|
|
|
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdmi.h
|
|
index bdac452b00fb..d0b84f0abee1 100644
|
|
--- a/drivers/gpu/drm/msm/hdmi/hdmi.h
|
|
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.h
|
|
@@ -14,6 +14,8 @@
|
|
#include <linux/gpio/consumer.h>
|
|
#include <linux/hdmi.h>
|
|
|
|
+#include <drm/drm_bridge.h>
|
|
+
|
|
#include "msm_drv.h"
|
|
#include "hdmi.xml.h"
|
|
|
|
diff --git a/drivers/gpu/drm/omapdrm/dss/output.c b/drivers/gpu/drm/omapdrm/dss/output.c
|
|
index 14b41de44ebc..0693d34fca1b 100644
|
|
--- a/drivers/gpu/drm/omapdrm/dss/output.c
|
|
+++ b/drivers/gpu/drm/omapdrm/dss/output.c
|
|
@@ -12,6 +12,7 @@
|
|
#include <linux/of.h>
|
|
#include <linux/of_graph.h>
|
|
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_panel.h>
|
|
|
|
#include "dss.h"
|
|
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
|
|
index 2983c003698e..b3e22c890c51 100644
|
|
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
|
|
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
|
|
@@ -11,6 +11,7 @@
|
|
|
|
#include <drm/drm_atomic.h>
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_drv.h>
|
|
#include <drm/drm_fb_helper.h>
|
|
#include <drm/drm_file.h>
|
|
diff --git a/drivers/gpu/drm/omapdrm/omap_encoder.c b/drivers/gpu/drm/omapdrm/omap_encoder.c
|
|
index 6fe14111cd95..24bbe9f2a32e 100644
|
|
--- a/drivers/gpu/drm/omapdrm/omap_encoder.c
|
|
+++ b/drivers/gpu/drm/omapdrm/omap_encoder.c
|
|
@@ -6,6 +6,7 @@
|
|
|
|
#include <linux/list.h>
|
|
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_crtc.h>
|
|
#include <drm/drm_modeset_helper_vtables.h>
|
|
#include <drm/drm_edid.h>
|
|
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
|
|
index 0f00bdfe2366..3a1139b725c0 100644
|
|
--- a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
|
|
+++ b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
|
|
@@ -9,6 +9,7 @@
|
|
|
|
#include <linux/export.h>
|
|
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_crtc.h>
|
|
#include <drm/drm_modeset_helper_vtables.h>
|
|
#include <drm/drm_panel.h>
|
|
diff --git a/drivers/gpu/drm/rockchip/rockchip_lvds.c b/drivers/gpu/drm/rockchip/rockchip_lvds.c
|
|
index 64aefa856896..8a4c9af0ba73 100644
|
|
--- a/drivers/gpu/drm/rockchip/rockchip_lvds.c
|
|
+++ b/drivers/gpu/drm/rockchip/rockchip_lvds.c
|
|
@@ -16,6 +16,7 @@
|
|
#include <linux/regmap.h>
|
|
#include <linux/reset.h>
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
|
|
#include <drm/drm_dp_helper.h>
|
|
#include <drm/drm_of.h>
|
|
diff --git a/drivers/gpu/drm/rockchip/rockchip_rgb.c b/drivers/gpu/drm/rockchip/rockchip_rgb.c
|
|
index 89e0bb0fe0ab..db1be1f3925c 100644
|
|
--- a/drivers/gpu/drm/rockchip/rockchip_rgb.c
|
|
+++ b/drivers/gpu/drm/rockchip/rockchip_rgb.c
|
|
@@ -9,6 +9,7 @@
|
|
#include <linux/of_graph.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_dp_helper.h>
|
|
#include <drm/drm_of.h>
|
|
#include <drm/drm_panel.h>
|
|
diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c
|
|
index e55870190bf5..0a4f00253f39 100644
|
|
--- a/drivers/gpu/drm/sti/sti_dvo.c
|
|
+++ b/drivers/gpu/drm/sti/sti_dvo.c
|
|
@@ -12,6 +12,7 @@
|
|
#include <linux/platform_device.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_device.h>
|
|
#include <drm/drm_panel.h>
|
|
#include <drm/drm_print.h>
|
|
diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c
|
|
index 94e404f13234..9d3fd6370a29 100644
|
|
--- a/drivers/gpu/drm/sti/sti_hda.c
|
|
+++ b/drivers/gpu/drm/sti/sti_hda.c
|
|
@@ -12,6 +12,7 @@
|
|
#include <linux/seq_file.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_debugfs.h>
|
|
#include <drm/drm_device.h>
|
|
#include <drm/drm_file.h>
|
|
diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
|
|
index 9862c322f0c4..84318d0832a0 100644
|
|
--- a/drivers/gpu/drm/sti/sti_hdmi.c
|
|
+++ b/drivers/gpu/drm/sti/sti_hdmi.c
|
|
@@ -14,6 +14,7 @@
|
|
#include <linux/reset.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_debugfs.h>
|
|
#include <drm/drm_drv.h>
|
|
#include <drm/drm_edid.h>
|
|
diff --git a/drivers/gpu/drm/sun4i/sun4i_lvds.c b/drivers/gpu/drm/sun4i/sun4i_lvds.c
|
|
index 7fbf425acb55..25ab2ef6d545 100644
|
|
--- a/drivers/gpu/drm/sun4i/sun4i_lvds.c
|
|
+++ b/drivers/gpu/drm/sun4i/sun4i_lvds.c
|
|
@@ -7,6 +7,7 @@
|
|
#include <linux/clk.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_of.h>
|
|
#include <drm/drm_panel.h>
|
|
#include <drm/drm_print.h>
|
|
diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c b/drivers/gpu/drm/sun4i/sun4i_rgb.c
|
|
index aac56983f208..e74b9eddca01 100644
|
|
--- a/drivers/gpu/drm/sun4i/sun4i_rgb.c
|
|
+++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c
|
|
@@ -9,6 +9,7 @@
|
|
#include <linux/clk.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_of.h>
|
|
#include <drm/drm_panel.h>
|
|
#include <drm/drm_print.h>
|
|
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
|
|
index b89439ed210d..42651d737c55 100644
|
|
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
|
|
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
|
|
@@ -16,6 +16,7 @@
|
|
#include <linux/reset.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_connector.h>
|
|
#include <drm/drm_crtc.h>
|
|
#include <drm/drm_encoder.h>
|
|
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_external.c b/drivers/gpu/drm/tilcdc/tilcdc_external.c
|
|
index 43d756b7810e..4fc10838de80 100644
|
|
--- a/drivers/gpu/drm/tilcdc/tilcdc_external.c
|
|
+++ b/drivers/gpu/drm/tilcdc/tilcdc_external.c
|
|
@@ -8,6 +8,7 @@
|
|
#include <linux/of_graph.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_of.h>
|
|
|
|
#include "tilcdc_drv.h"
|
|
diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c
|
|
index c78fa8144776..3f63943e5472 100644
|
|
--- a/drivers/gpu/drm/vc4/vc4_dsi.c
|
|
+++ b/drivers/gpu/drm/vc4/vc4_dsi.c
|
|
@@ -31,6 +31,7 @@
|
|
#include <linux/pm_runtime.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
|
+#include <drm/drm_bridge.h>
|
|
#include <drm/drm_edid.h>
|
|
#include <drm/drm_mipi_dsi.h>
|
|
#include <drm/drm_of.h>
|
|
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
|
|
index 408b6f4e63c0..5e9b15a0e8c5 100644
|
|
--- a/include/drm/drm_crtc.h
|
|
+++ b/include/drm/drm_crtc.h
|
|
@@ -41,7 +41,6 @@
|
|
#include <drm/drm_connector.h>
|
|
#include <drm/drm_device.h>
|
|
#include <drm/drm_property.h>
|
|
-#include <drm/drm_bridge.h>
|
|
#include <drm/drm_edid.h>
|
|
#include <drm/drm_plane.h>
|
|
#include <drm/drm_blend.h>
|
|
|
|
From 115cb532388ee6980401548af0083c22b49b0f83 Mon Sep 17 00:00:00 2001
|
|
From: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
Date: Mon, 2 Sep 2019 11:54:35 +0800
|
|
Subject: [PATCH] drm: dw-hdmi-i2s: enable audio clock in audio_startup
|
|
|
|
In the designware databook, the sequence of enabling audio clock and
|
|
setting format is not clearly specified.
|
|
Currently, audio clock is enabled in the end of hw_param ops after
|
|
setting format.
|
|
|
|
On some monitors, there is a possibility that audio does not come out.
|
|
Fix this by enabling audio clock in audio_startup ops
|
|
before hw_param ops setting format.
|
|
|
|
Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
Reviewed-by: Douglas Anderson <dianders@chromium.org>
|
|
Reviewed-by: Jonas Karlman <jonas@kwiboo.se>
|
|
Tested-by: Douglas Anderson <dianders@chromium.org>
|
|
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/20190902035435.44463-1-cychiang@chromium.org
|
|
(cherry picked from commit c41784b042ac9cf97f2e871aceef3e06eff14140)
|
|
---
|
|
drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 9 +++++++++
|
|
1 file changed, 9 insertions(+)
|
|
|
|
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
|
|
index 1d15cf9b6821..34d8e837555f 100644
|
|
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
|
|
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
|
|
@@ -109,6 +109,14 @@ static int dw_hdmi_i2s_hw_params(struct device *dev, void *data,
|
|
hdmi_write(audio, conf0, HDMI_AUD_CONF0);
|
|
hdmi_write(audio, conf1, HDMI_AUD_CONF1);
|
|
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+static int dw_hdmi_i2s_audio_startup(struct device *dev, void *data)
|
|
+{
|
|
+ struct dw_hdmi_i2s_audio_data *audio = data;
|
|
+ struct dw_hdmi *hdmi = audio->hdmi;
|
|
+
|
|
dw_hdmi_audio_enable(hdmi);
|
|
|
|
return 0;
|
|
@@ -153,6 +161,7 @@ static int dw_hdmi_i2s_get_dai_id(struct snd_soc_component *component,
|
|
|
|
static struct hdmi_codec_ops dw_hdmi_i2s_ops = {
|
|
.hw_params = dw_hdmi_i2s_hw_params,
|
|
+ .audio_startup = dw_hdmi_i2s_audio_startup,
|
|
.audio_shutdown = dw_hdmi_i2s_audio_shutdown,
|
|
.get_eld = dw_hdmi_i2s_get_eld,
|
|
.get_dai_id = dw_hdmi_i2s_get_dai_id,
|
|
|
|
From 63eb6fa0ebb0a7b347028e3446e983ed0a81498b Mon Sep 17 00:00:00 2001
|
|
From: Dariusz Marcinkiewicz <darekm@google.com>
|
|
Date: Wed, 14 Aug 2019 12:45:02 +0200
|
|
Subject: [PATCH] tda9950: use cec_notifier_cec_adap_(un)register
|
|
|
|
Use the new cec_notifier_cec_adap_(un)register() functions to
|
|
(un)register the notifier for the CEC adapter.
|
|
|
|
Signed-off-by: Dariusz Marcinkiewicz <darekm@google.com>
|
|
Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/20190814104520.6001-5-darekm@google.com
|
|
(cherry picked from commit e5ef909cb42ced1a842c4fda1597cd8841f78b84)
|
|
---
|
|
drivers/gpu/drm/i2c/tda9950.c | 12 ++++++------
|
|
1 file changed, 6 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/drivers/gpu/drm/i2c/tda9950.c b/drivers/gpu/drm/i2c/tda9950.c
|
|
index 8039fc0d83db..a5a75bdeb7a5 100644
|
|
--- a/drivers/gpu/drm/i2c/tda9950.c
|
|
+++ b/drivers/gpu/drm/i2c/tda9950.c
|
|
@@ -420,7 +420,8 @@ static int tda9950_probe(struct i2c_client *client,
|
|
priv->hdmi = glue->parent;
|
|
|
|
priv->adap = cec_allocate_adapter(&tda9950_cec_ops, priv, "tda9950",
|
|
- CEC_CAP_DEFAULTS,
|
|
+ CEC_CAP_DEFAULTS |
|
|
+ CEC_CAP_CONNECTOR_INFO,
|
|
CEC_MAX_LOG_ADDRS);
|
|
if (IS_ERR(priv->adap))
|
|
return PTR_ERR(priv->adap);
|
|
@@ -457,13 +458,14 @@ static int tda9950_probe(struct i2c_client *client,
|
|
if (ret < 0)
|
|
return ret;
|
|
|
|
- priv->notify = cec_notifier_get(priv->hdmi);
|
|
+ priv->notify = cec_notifier_cec_adap_register(priv->hdmi, NULL,
|
|
+ priv->adap);
|
|
if (!priv->notify)
|
|
return -ENOMEM;
|
|
|
|
ret = cec_register_adapter(priv->adap, priv->hdmi);
|
|
if (ret < 0) {
|
|
- cec_notifier_put(priv->notify);
|
|
+ cec_notifier_cec_adap_unregister(priv->notify);
|
|
return ret;
|
|
}
|
|
|
|
@@ -473,8 +475,6 @@ static int tda9950_probe(struct i2c_client *client,
|
|
*/
|
|
devm_remove_action(dev, tda9950_cec_del, priv);
|
|
|
|
- cec_register_cec_notifier(priv->adap, priv->notify);
|
|
-
|
|
return 0;
|
|
}
|
|
|
|
@@ -482,8 +482,8 @@ static int tda9950_remove(struct i2c_client *client)
|
|
{
|
|
struct tda9950_priv *priv = i2c_get_clientdata(client);
|
|
|
|
+ cec_notifier_cec_adap_unregister(priv->notify);
|
|
cec_unregister_adapter(priv->adap);
|
|
- cec_notifier_put(priv->notify);
|
|
|
|
return 0;
|
|
}
|
|
|
|
From 245aa369e7b9b7aa50b7defc069a12fb138b0326 Mon Sep 17 00:00:00 2001
|
|
From: Yakir Yang <ykk@rock-chips.com>
|
|
Date: Wed, 11 Sep 2019 16:26:46 +0800
|
|
Subject: [PATCH] drm: bridge/dw_hdmi: add audio sample channel status setting
|
|
|
|
When transmitting IEC60985 linear PCM audio, we configure the
|
|
Aduio Sample Channel Status information in the IEC60958 frame.
|
|
The status bit is already available in iec.status of hdmi_codec_params.
|
|
|
|
This fix the issue that audio does not come out on some monitors
|
|
(e.g. LG 22CV241)
|
|
|
|
Note that these registers are only for interfaces:
|
|
I2S audio interface, General Purpose Audio (GPA), or AHB audio DMA
|
|
(AHBAUDDMA).
|
|
For S/PDIF interface this information comes from the stream.
|
|
|
|
Currently this function dw_hdmi_set_channel_status is only called
|
|
from dw-hdmi-i2s-audio in I2S setup.
|
|
|
|
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
|
|
Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
Reviewed-by: Jonas Karlman <jonas@kwiboo.se>
|
|
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/20190911082646.134347-1-cychiang@chromium.org
|
|
(cherry picked from commit 3250cdf938dce5447cf4f895bb3ec3b929a95e09)
|
|
---
|
|
drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 1 +
|
|
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 20 ++++++++++++++++++++
|
|
drivers/gpu/drm/bridge/synopsys/dw-hdmi.h | 2 ++
|
|
include/drm/bridge/dw_hdmi.h | 1 +
|
|
4 files changed, 24 insertions(+)
|
|
|
|
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
|
|
index 34d8e837555f..20f4f92dd866 100644
|
|
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
|
|
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
|
|
@@ -102,6 +102,7 @@ static int dw_hdmi_i2s_hw_params(struct device *dev, void *data,
|
|
}
|
|
|
|
dw_hdmi_set_sample_rate(hdmi, hparms->sample_rate);
|
|
+ dw_hdmi_set_channel_status(hdmi, hparms->iec.status);
|
|
dw_hdmi_set_channel_count(hdmi, hparms->channels);
|
|
dw_hdmi_set_channel_allocation(hdmi, hparms->cea.channel_allocation);
|
|
|
|
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
|
index 16a21460f481..d77fb8af61b8 100644
|
|
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
|
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
|
@@ -581,6 +581,26 @@ static unsigned int hdmi_compute_n(unsigned int freq, unsigned long pixel_clk)
|
|
return n;
|
|
}
|
|
|
|
+/*
|
|
+ * When transmitting IEC60958 linear PCM audio, these registers allow to
|
|
+ * configure the channel status information of all the channel status
|
|
+ * bits in the IEC60958 frame. For the moment this configuration is only
|
|
+ * used when the I2S audio interface, General Purpose Audio (GPA),
|
|
+ * or AHB audio DMA (AHBAUDDMA) interface is active
|
|
+ * (for S/PDIF interface this information comes from the stream).
|
|
+ */
|
|
+void dw_hdmi_set_channel_status(struct dw_hdmi *hdmi,
|
|
+ u8 *channel_status)
|
|
+{
|
|
+ /*
|
|
+ * Set channel status register for frequency and word length.
|
|
+ * Use default values for other registers.
|
|
+ */
|
|
+ hdmi_writeb(hdmi, channel_status[3], HDMI_FC_AUDSCHNLS7);
|
|
+ hdmi_writeb(hdmi, channel_status[4], HDMI_FC_AUDSCHNLS8);
|
|
+}
|
|
+EXPORT_SYMBOL_GPL(dw_hdmi_set_channel_status);
|
|
+
|
|
static void hdmi_set_clk_regenerator(struct dw_hdmi *hdmi,
|
|
unsigned long pixel_clk, unsigned int sample_rate)
|
|
{
|
|
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h
|
|
index 6988f12d89d9..fcff5059db24 100644
|
|
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h
|
|
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h
|
|
@@ -158,6 +158,8 @@
|
|
#define HDMI_FC_SPDDEVICEINF 0x1062
|
|
#define HDMI_FC_AUDSCONF 0x1063
|
|
#define HDMI_FC_AUDSSTAT 0x1064
|
|
+#define HDMI_FC_AUDSCHNLS7 0x106e
|
|
+#define HDMI_FC_AUDSCHNLS8 0x106f
|
|
#define HDMI_FC_DATACH0FILL 0x1070
|
|
#define HDMI_FC_DATACH1FILL 0x1071
|
|
#define HDMI_FC_DATACH2FILL 0x1072
|
|
diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
|
|
index cf528c289857..4b3e863c4f8a 100644
|
|
--- a/include/drm/bridge/dw_hdmi.h
|
|
+++ b/include/drm/bridge/dw_hdmi.h
|
|
@@ -156,6 +156,7 @@ void dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense);
|
|
|
|
void dw_hdmi_set_sample_rate(struct dw_hdmi *hdmi, unsigned int rate);
|
|
void dw_hdmi_set_channel_count(struct dw_hdmi *hdmi, unsigned int cnt);
|
|
+void dw_hdmi_set_channel_status(struct dw_hdmi *hdmi, u8 *channel_status);
|
|
void dw_hdmi_set_channel_allocation(struct dw_hdmi *hdmi, unsigned int ca);
|
|
void dw_hdmi_audio_enable(struct dw_hdmi *hdmi);
|
|
void dw_hdmi_audio_disable(struct dw_hdmi *hdmi);
|
|
|
|
From 6c447b4b583fb6ed3b6cbb898193b01e6d11d19f Mon Sep 17 00:00:00 2001
|
|
From: Markus Elfring <elfring@users.sourceforge.net>
|
|
Date: Sat, 21 Sep 2019 20:04:08 +0200
|
|
Subject: [PATCH] drm/bridge/synopsys: dsi: Use
|
|
devm_platform_ioremap_resource() in __dw_mipi_dsi_probe()
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Simplify this function implementation by using a known wrapper function.
|
|
|
|
This issue was detected by using the Coccinelle software.
|
|
|
|
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
|
|
Reviewed-by: Yannick Fertré <yannick.fertre@st.com>
|
|
Tested-by: Yannick Fertré <yannick.fertre@st.com>
|
|
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/e0d7b7d7-3e89-8b3f-04ed-0b14806e66f7@web.de
|
|
(cherry picked from commit 46872098077157758546b54a54868909c296af1c)
|
|
---
|
|
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 7 +------
|
|
1 file changed, 1 insertion(+), 6 deletions(-)
|
|
|
|
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
|
|
index 675442bfc1bd..6ada149af9ef 100644
|
|
--- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
|
|
+++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
|
|
@@ -981,7 +981,6 @@ __dw_mipi_dsi_probe(struct platform_device *pdev,
|
|
struct device *dev = &pdev->dev;
|
|
struct reset_control *apb_rst;
|
|
struct dw_mipi_dsi *dsi;
|
|
- struct resource *res;
|
|
int ret;
|
|
|
|
dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL);
|
|
@@ -997,11 +996,7 @@ __dw_mipi_dsi_probe(struct platform_device *pdev,
|
|
}
|
|
|
|
if (!plat_data->base) {
|
|
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
|
- if (!res)
|
|
- return ERR_PTR(-ENODEV);
|
|
-
|
|
- dsi->base = devm_ioremap_resource(dev, res);
|
|
+ dsi->base = devm_platform_ioremap_resource(pdev, 0);
|
|
if (IS_ERR(dsi->base))
|
|
return ERR_PTR(-ENODEV);
|
|
|
|
|
|
From 9fc774b7f03df3a1b725c6b31fe76afcdeba974e Mon Sep 17 00:00:00 2001
|
|
From: Douglas Anderson <dianders@chromium.org>
|
|
Date: Thu, 19 Sep 2019 14:26:41 -0700
|
|
Subject: [PATCH] ARM: dts: rockchip: Add cpu id to rk3288 efuse node
|
|
|
|
This just adds in another field of what's stored in the e-fuse on
|
|
rk3288. Though I can't personally promise that every rk3288 out there
|
|
has the CPU ID stored in the eFuse at this location, there is some
|
|
evidence that it is correct:
|
|
- This matches what was in the Chrome OS 3.14 branch (see
|
|
EFUSE_CHIP_UID_OFFSET and EFUSE_CHIP_UID_LEN) for rk3288.
|
|
- The upstream rk3399 dts file has this same data at the same offset
|
|
and with the same length, indiciating that this is likely common for
|
|
several modern Rockchip SoCs.
|
|
|
|
Signed-off-by: Douglas Anderson <dianders@chromium.org>
|
|
Link: https://lore.kernel.org/r/20190919142611.1.I309434f00a2a9be71e4437991fe08abc12f06e2e@changeid
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit cee0534a08d0ccc07b4e4405d77c5c9da78a4fa9)
|
|
---
|
|
arch/arm/boot/dts/rk3288.dtsi | 3 +++
|
|
1 file changed, 3 insertions(+)
|
|
|
|
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
|
|
index cc893e154fe5..415b48fc3ce8 100644
|
|
--- a/arch/arm/boot/dts/rk3288.dtsi
|
|
+++ b/arch/arm/boot/dts/rk3288.dtsi
|
|
@@ -1391,6 +1391,9 @@
|
|
clocks = <&cru PCLK_EFUSE256>;
|
|
clock-names = "pclk_efuse";
|
|
|
|
+ cpu_id: cpu-id@7 {
|
|
+ reg = <0x07 0x10>;
|
|
+ };
|
|
cpu_leakage: cpu_leakage@17 {
|
|
reg = <0x17 0x1>;
|
|
};
|
|
|
|
From a158919ab17f8162c271c85553b0cd0f42bc2a2c Mon Sep 17 00:00:00 2001
|
|
From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Date: Thu, 5 Sep 2019 04:33:40 -0300
|
|
Subject: [PATCH] media: cec/cec-adap.c: use new UI_CMD defines
|
|
|
|
Instead of hardcoding the UI Command key values, use the new
|
|
defines.
|
|
|
|
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
|
|
(cherry picked from commit b52c2ed31332ad446156626e20c226e6bcea8d2b)
|
|
---
|
|
drivers/media/cec/cec-adap.c | 10 +++++++---
|
|
1 file changed, 7 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/drivers/media/cec/cec-adap.c b/drivers/media/cec/cec-adap.c
|
|
index 5ef7daeb8cbd..284f9b845161 100644
|
|
--- a/drivers/media/cec/cec-adap.c
|
|
+++ b/drivers/media/cec/cec-adap.c
|
|
@@ -1976,7 +1976,7 @@ static int cec_receive_notify(struct cec_adapter *adap, struct cec_msg *msg,
|
|
* Play function, this message can have variable length
|
|
* depending on the specific play function that is used.
|
|
*/
|
|
- case 0x60:
|
|
+ case CEC_OP_UI_CMD_PLAY_FUNCTION:
|
|
if (msg->len == 2)
|
|
rc_keydown(adap->rc, RC_PROTO_CEC,
|
|
msg->msg[2], 0);
|
|
@@ -1993,8 +1993,12 @@ static int cec_receive_notify(struct cec_adapter *adap, struct cec_msg *msg,
|
|
* For the time being these messages are not processed by the
|
|
* framework and are simply forwarded to the user space.
|
|
*/
|
|
- case 0x56: case 0x57:
|
|
- case 0x67: case 0x68: case 0x69: case 0x6a:
|
|
+ case CEC_OP_UI_CMD_SELECT_BROADCAST_TYPE:
|
|
+ case CEC_OP_UI_CMD_SELECT_SOUND_PRESENTATION:
|
|
+ case CEC_OP_UI_CMD_TUNE_FUNCTION:
|
|
+ case CEC_OP_UI_CMD_SELECT_MEDIA_FUNCTION:
|
|
+ case CEC_OP_UI_CMD_SELECT_AV_INPUT_FUNCTION:
|
|
+ case CEC_OP_UI_CMD_SELECT_AUDIO_INPUT_FUNCTION:
|
|
break;
|
|
default:
|
|
rc_keydown(adap->rc, RC_PROTO_CEC, msg->msg[2], 0);
|
|
|
|
From 6141ee29ad5a8c7e3e99a713e6b0ce6b019c9ea6 Mon Sep 17 00:00:00 2001
|
|
From: Dariusz Marcinkiewicz <darekm@google.com>
|
|
Date: Fri, 23 Aug 2019 09:20:58 -0300
|
|
Subject: [PATCH] media: cec: expose the new connector info API
|
|
|
|
Until now the connector info API was a kernel-internal API only.
|
|
This moves it to the public API and adds the new ioctl to retrieve
|
|
this information.
|
|
|
|
Signed-off-by: Dariusz Marcinkiewicz <darekm@google.com>
|
|
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
|
|
(cherry picked from commit 9098c1c251ff0e6a4cea3a60486d9f40e7fdcea2)
|
|
---
|
|
drivers/media/cec/cec-adap.c | 2 ++
|
|
drivers/media/cec/cec-api.c | 20 ++++++++++++++++++++
|
|
drivers/media/cec/cec-core.c | 5 -----
|
|
include/media/cec.h | 31 -------------------------------
|
|
include/uapi/linux/cec.h | 40 ++++++++++++++++++++++++++++++++++++++++
|
|
5 files changed, 62 insertions(+), 36 deletions(-)
|
|
|
|
diff --git a/drivers/media/cec/cec-adap.c b/drivers/media/cec/cec-adap.c
|
|
index 284f9b845161..9340435a94a0 100644
|
|
--- a/drivers/media/cec/cec-adap.c
|
|
+++ b/drivers/media/cec/cec-adap.c
|
|
@@ -319,6 +319,8 @@ static void cec_post_state_event(struct cec_adapter *adap)
|
|
|
|
ev.state_change.phys_addr = adap->phys_addr;
|
|
ev.state_change.log_addr_mask = adap->log_addrs.log_addr_mask;
|
|
+ ev.state_change.have_conn_info =
|
|
+ adap->conn_info.type != CEC_CONNECTOR_TYPE_NO_CONNECTOR;
|
|
cec_queue_event(adap, &ev);
|
|
}
|
|
|
|
diff --git a/drivers/media/cec/cec-api.c b/drivers/media/cec/cec-api.c
|
|
index 12d676484472..17d1cb2e5f97 100644
|
|
--- a/drivers/media/cec/cec-api.c
|
|
+++ b/drivers/media/cec/cec-api.c
|
|
@@ -187,6 +187,21 @@ static long cec_adap_s_log_addrs(struct cec_adapter *adap, struct cec_fh *fh,
|
|
return 0;
|
|
}
|
|
|
|
+static long cec_adap_g_connector_info(struct cec_adapter *adap,
|
|
+ struct cec_log_addrs __user *parg)
|
|
+{
|
|
+ int ret = 0;
|
|
+
|
|
+ if (!(adap->capabilities & CEC_CAP_CONNECTOR_INFO))
|
|
+ return -ENOTTY;
|
|
+
|
|
+ mutex_lock(&adap->lock);
|
|
+ if (copy_to_user(parg, &adap->conn_info, sizeof(adap->conn_info)))
|
|
+ ret = -EFAULT;
|
|
+ mutex_unlock(&adap->lock);
|
|
+ return ret;
|
|
+}
|
|
+
|
|
static long cec_transmit(struct cec_adapter *adap, struct cec_fh *fh,
|
|
bool block, struct cec_msg __user *parg)
|
|
{
|
|
@@ -506,6 +521,9 @@ static long cec_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
|
case CEC_ADAP_S_LOG_ADDRS:
|
|
return cec_adap_s_log_addrs(adap, fh, block, parg);
|
|
|
|
+ case CEC_ADAP_G_CONNECTOR_INFO:
|
|
+ return cec_adap_g_connector_info(adap, parg);
|
|
+
|
|
case CEC_TRANSMIT:
|
|
return cec_transmit(adap, fh, block, parg);
|
|
|
|
@@ -578,6 +596,8 @@ static int cec_open(struct inode *inode, struct file *filp)
|
|
/* Queue up initial state events */
|
|
ev.state_change.phys_addr = adap->phys_addr;
|
|
ev.state_change.log_addr_mask = adap->log_addrs.log_addr_mask;
|
|
+ ev.state_change.have_conn_info =
|
|
+ adap->conn_info.type != CEC_CONNECTOR_TYPE_NO_CONNECTOR;
|
|
cec_queue_event_fh(fh, &ev, 0);
|
|
#ifdef CONFIG_CEC_PIN
|
|
if (adap->pin && adap->pin->ops->read_hpd) {
|
|
diff --git a/drivers/media/cec/cec-core.c b/drivers/media/cec/cec-core.c
|
|
index 9c610e1e99b8..db7adffcdc76 100644
|
|
--- a/drivers/media/cec/cec-core.c
|
|
+++ b/drivers/media/cec/cec-core.c
|
|
@@ -257,11 +257,6 @@ struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
|
|
struct cec_adapter *adap;
|
|
int res;
|
|
|
|
- /*
|
|
- * Disable this capability until the connector info public API
|
|
- * is ready.
|
|
- */
|
|
- caps &= ~CEC_CAP_CONNECTOR_INFO;
|
|
#ifndef CONFIG_MEDIA_CEC_RC
|
|
caps &= ~CEC_CAP_RC;
|
|
#endif
|
|
diff --git a/include/media/cec.h b/include/media/cec.h
|
|
index 4d59387bc61b..0a4f69cc9dd4 100644
|
|
--- a/include/media/cec.h
|
|
+++ b/include/media/cec.h
|
|
@@ -18,9 +18,6 @@
|
|
#include <linux/cec-funcs.h>
|
|
#include <media/rc-core.h>
|
|
|
|
-/* CEC_ADAP_G_CONNECTOR_INFO is available */
|
|
-#define CEC_CAP_CONNECTOR_INFO (1 << 8)
|
|
-
|
|
#define CEC_CAP_DEFAULTS (CEC_CAP_LOG_ADDRS | CEC_CAP_TRANSMIT | \
|
|
CEC_CAP_PASSTHROUGH | CEC_CAP_RC)
|
|
|
|
@@ -147,34 +144,6 @@ struct cec_adap_ops {
|
|
*/
|
|
#define CEC_MAX_MSG_TX_QUEUE_SZ (18 * 1)
|
|
|
|
-/**
|
|
- * struct cec_drm_connector_info - tells which drm connector is
|
|
- * associated with the CEC adapter.
|
|
- * @card_no: drm card number
|
|
- * @connector_id: drm connector ID
|
|
- */
|
|
-struct cec_drm_connector_info {
|
|
- __u32 card_no;
|
|
- __u32 connector_id;
|
|
-};
|
|
-
|
|
-#define CEC_CONNECTOR_TYPE_NO_CONNECTOR 0
|
|
-#define CEC_CONNECTOR_TYPE_DRM 1
|
|
-
|
|
-/**
|
|
- * struct cec_connector_info - tells if and which connector is
|
|
- * associated with the CEC adapter.
|
|
- * @type: connector type (if any)
|
|
- * @drm: drm connector info
|
|
- */
|
|
-struct cec_connector_info {
|
|
- __u32 type;
|
|
- union {
|
|
- struct cec_drm_connector_info drm;
|
|
- __u32 raw[16];
|
|
- };
|
|
-};
|
|
-
|
|
struct cec_adapter {
|
|
struct module *owner;
|
|
char name[32];
|
|
diff --git a/include/uapi/linux/cec.h b/include/uapi/linux/cec.h
|
|
index 5704fa0292b5..0115c5aa0d36 100644
|
|
--- a/include/uapi/linux/cec.h
|
|
+++ b/include/uapi/linux/cec.h
|
|
@@ -317,6 +317,8 @@ static inline int cec_is_unconfigured(__u16 log_addr_mask)
|
|
#define CEC_CAP_NEEDS_HPD (1 << 6)
|
|
/* Hardware can monitor CEC pin transitions */
|
|
#define CEC_CAP_MONITOR_PIN (1 << 7)
|
|
+/* CEC_ADAP_G_CONNECTOR_INFO is available */
|
|
+#define CEC_CAP_CONNECTOR_INFO (1 << 8)
|
|
|
|
/**
|
|
* struct cec_caps - CEC capabilities structure.
|
|
@@ -375,6 +377,34 @@ struct cec_log_addrs {
|
|
/* CDC-Only device: supports only CDC messages */
|
|
#define CEC_LOG_ADDRS_FL_CDC_ONLY (1 << 2)
|
|
|
|
+/**
|
|
+ * struct cec_drm_connector_info - tells which drm connector is
|
|
+ * associated with the CEC adapter.
|
|
+ * @card_no: drm card number
|
|
+ * @connector_id: drm connector ID
|
|
+ */
|
|
+struct cec_drm_connector_info {
|
|
+ __u32 card_no;
|
|
+ __u32 connector_id;
|
|
+};
|
|
+
|
|
+#define CEC_CONNECTOR_TYPE_NO_CONNECTOR 0
|
|
+#define CEC_CONNECTOR_TYPE_DRM 1
|
|
+
|
|
+/**
|
|
+ * struct cec_connector_info - tells if and which connector is
|
|
+ * associated with the CEC adapter.
|
|
+ * @type: connector type (if any)
|
|
+ * @drm: drm connector info
|
|
+ */
|
|
+struct cec_connector_info {
|
|
+ __u32 type;
|
|
+ union {
|
|
+ struct cec_drm_connector_info drm;
|
|
+ __u32 raw[16];
|
|
+ };
|
|
+};
|
|
+
|
|
/* Events */
|
|
|
|
/* Event that occurs when the adapter state changes */
|
|
@@ -398,10 +428,17 @@ struct cec_log_addrs {
|
|
* struct cec_event_state_change - used when the CEC adapter changes state.
|
|
* @phys_addr: the current physical address
|
|
* @log_addr_mask: the current logical address mask
|
|
+ * @have_conn_info: if non-zero, then HDMI connector information is available.
|
|
+ * This field is only valid if CEC_CAP_CONNECTOR_INFO is set. If that
|
|
+ * capability is set and @have_conn_info is zero, then that indicates
|
|
+ * that the HDMI connector device is not instantiated, either because
|
|
+ * the HDMI driver is still configuring the device or because the HDMI
|
|
+ * device was unbound.
|
|
*/
|
|
struct cec_event_state_change {
|
|
__u16 phys_addr;
|
|
__u16 log_addr_mask;
|
|
+ __u16 have_conn_info;
|
|
};
|
|
|
|
/**
|
|
@@ -476,6 +513,9 @@ struct cec_event {
|
|
#define CEC_G_MODE _IOR('a', 8, __u32)
|
|
#define CEC_S_MODE _IOW('a', 9, __u32)
|
|
|
|
+/* Get the connector info */
|
|
+#define CEC_ADAP_G_CONNECTOR_INFO _IOR('a', 10, struct cec_connector_info)
|
|
+
|
|
/*
|
|
* The remainder of this header defines all CEC messages and operands.
|
|
* The format matters since it the cec-ctl utility parses it to generate
|
|
|
|
From 77f43e1e944ca878ad5f7b3cf62d2b777c397f17 Mon Sep 17 00:00:00 2001
|
|
From: Heiko Stuebner <heiko@sntech.de>
|
|
Date: Tue, 17 Sep 2019 10:26:47 +0200
|
|
Subject: [PATCH] arm64: dts: rockchip: fix iface clock-name on px30 iommus
|
|
|
|
The iommu clock names are aclk+iface not aclk+hclk as in the vendor kernel,
|
|
so fix that in the px30.dtsi
|
|
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Link: https://lore.kernel.org/r/20190917082659.25549-1-heiko@sntech.de
|
|
(cherry picked from commit 8e57eed2047b9361deb8c5dc4cc3d4e679c5ce50)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/px30.dtsi | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/px30.dtsi b/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
index eb992d60e6ba..1fd12bd09e83 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
+++ b/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
@@ -831,7 +831,7 @@
|
|
interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
|
|
interrupt-names = "vopb_mmu";
|
|
clocks = <&cru ACLK_VOPB>, <&cru HCLK_VOPB>;
|
|
- clock-names = "aclk", "hclk";
|
|
+ clock-names = "aclk", "iface";
|
|
power-domains = <&power PX30_PD_VO>;
|
|
#iommu-cells = <0>;
|
|
status = "disabled";
|
|
@@ -863,7 +863,7 @@
|
|
interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
|
|
interrupt-names = "vopl_mmu";
|
|
clocks = <&cru ACLK_VOPL>, <&cru HCLK_VOPL>;
|
|
- clock-names = "aclk", "hclk";
|
|
+ clock-names = "aclk", "iface";
|
|
power-domains = <&power PX30_PD_VO>;
|
|
#iommu-cells = <0>;
|
|
status = "disabled";
|
|
|
|
From de3f41dacb7984b70797c9a8822952d0d5c12d88 Mon Sep 17 00:00:00 2001
|
|
From: Heiko Stuebner <heiko@sntech.de>
|
|
Date: Tue, 17 Sep 2019 10:26:48 +0200
|
|
Subject: [PATCH] arm64: dts: rockchip: remove static xin32k from px30
|
|
|
|
Similar to all other Rockchip SoCs the px30 does not have a static
|
|
32kHz clock. Instead it again gets supplied from an external component
|
|
like the pmic.
|
|
|
|
So drop the static clock, so that we can hook up the right one.
|
|
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Link: https://lore.kernel.org/r/20190917082659.25549-2-heiko@sntech.de
|
|
(cherry picked from commit 00519137f7d4fc19ff27f3d3f4fc45b5b222ae82)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/px30.dtsi | 7 -------
|
|
1 file changed, 7 deletions(-)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/px30.dtsi b/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
index 1fd12bd09e83..06328f1b05e8 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
+++ b/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
@@ -195,13 +195,6 @@
|
|
clock-output-names = "xin24m";
|
|
};
|
|
|
|
- xin32k: xin32k {
|
|
- compatible = "fixed-clock";
|
|
- #clock-cells = <0>;
|
|
- clock-frequency = <32768>;
|
|
- clock-output-names = "xin32k";
|
|
- };
|
|
-
|
|
pmu: power-management@ff000000 {
|
|
compatible = "rockchip,px30-pmu", "syscon", "simple-mfd";
|
|
reg = <0x0 0xff000000 0x0 0x1000>;
|
|
|
|
From 15ae103163241c9512aa0cedadd3b2267f846fa2 Mon Sep 17 00:00:00 2001
|
|
From: Heiko Stuebner <heiko@sntech.de>
|
|
Date: Tue, 17 Sep 2019 10:26:49 +0200
|
|
Subject: [PATCH] arm64: dts: rockchip: remove px30 emmc_pwren pinctrl
|
|
|
|
That gpio1-b0 can only be flash_cs apart from a regular gpio,
|
|
so there is no power-related pinmux for the emmc for this pin.
|
|
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Link: https://lore.kernel.org/r/20190917082659.25549-3-heiko@sntech.de
|
|
(cherry picked from commit f77ccf399e3b5d9adeed6bff43f684f7200cbb0c)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/px30.dtsi | 5 -----
|
|
1 file changed, 5 deletions(-)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/px30.dtsi b/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
index 06328f1b05e8..a178d6e2c279 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
+++ b/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
@@ -1648,11 +1648,6 @@
|
|
<1 RK_PB2 2 &pcfg_pull_up_8ma>;
|
|
};
|
|
|
|
- emmc_pwren: emmc-pwren {
|
|
- rockchip,pins =
|
|
- <1 RK_PB0 2 &pcfg_pull_none>;
|
|
- };
|
|
-
|
|
emmc_rstnout: emmc-rstnout {
|
|
rockchip,pins =
|
|
<1 RK_PB3 2 &pcfg_pull_none>;
|
|
|
|
From 53d295bbdaac32276f708884ed922e834f6e3708 Mon Sep 17 00:00:00 2001
|
|
From: Heiko Stuebner <heiko@sntech.de>
|
|
Date: Tue, 17 Sep 2019 10:26:50 +0200
|
|
Subject: [PATCH] arm64: dts: rockchip: add default px30 emmc pinctrl
|
|
|
|
emmc chips are normally hooked up in standard ways using the full 8bit
|
|
bus connection, so there should be no need for all future boards to define
|
|
this on their own. So add default pin setups for 8bit busses and special
|
|
boards really only needing 4 or 1 bit connections can override.
|
|
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Link: https://lore.kernel.org/r/20190917082659.25549-4-heiko@sntech.de
|
|
(cherry picked from commit cdfebb27892a66580d770f6c57f3deb5024b4d08)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/px30.dtsi | 2 ++
|
|
1 file changed, 2 insertions(+)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/px30.dtsi b/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
index a178d6e2c279..f2bbdfa0e4aa 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
+++ b/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
@@ -794,6 +794,8 @@
|
|
clock-names = "biu", "ciu", "ciu-drv", "ciu-sample";
|
|
fifo-depth = <0x100>;
|
|
max-frequency = <150000000>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
|
|
power-domains = <&power PX30_PD_MMC_NAND>;
|
|
status = "disabled";
|
|
};
|
|
|
|
From 72f23a25f91d9f7a4293952d06586a7c8a469e66 Mon Sep 17 00:00:00 2001
|
|
From: Heiko Stuebner <heiko@sntech.de>
|
|
Date: Tue, 17 Sep 2019 10:26:51 +0200
|
|
Subject: [PATCH] arm64: dts: rockchip: fix the px30-evb power tree
|
|
|
|
Add the board's pmic (rk809) and hook up the real supplies to their
|
|
consumers. This is especially important as cpufreq would otherwise hang
|
|
the system when scaling the frequency without adjusting the voltage.
|
|
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Link: https://lore.kernel.org/r/20190917082659.25549-5-heiko@sntech.de
|
|
(cherry picked from commit 915b6a8b54a6d436885a458867e59fb20fc6356d)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/px30-evb.dts | 254 +++++++++++++++++++++++++++++-
|
|
1 file changed, 246 insertions(+), 8 deletions(-)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/px30-evb.dts b/arch/arm64/boot/dts/rockchip/px30-evb.dts
|
|
index 6eb7407a84aa..d78fb172a66f 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/px30-evb.dts
|
|
+++ b/arch/arm64/boot/dts/rockchip/px30-evb.dts
|
|
@@ -58,6 +58,7 @@
|
|
backlight: backlight {
|
|
compatible = "pwm-backlight";
|
|
pwms = <&pwm1 0 25000 0>;
|
|
+ power-supply = <&vcc3v3_lcd>;
|
|
};
|
|
|
|
sdio_pwrseq: sdio-pwrseq {
|
|
@@ -74,13 +75,6 @@
|
|
reset-gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>; /* GPIO3_A4 */
|
|
};
|
|
|
|
- vcc_phy: vcc-phy-regulator {
|
|
- compatible = "regulator-fixed";
|
|
- regulator-name = "vcc_phy";
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- };
|
|
-
|
|
vcc5v0_sys: vccsys {
|
|
compatible = "regulator-fixed";
|
|
regulator-name = "vcc5v0_sys";
|
|
@@ -91,6 +85,22 @@
|
|
};
|
|
};
|
|
|
|
+&cpu0 {
|
|
+ cpu-supply = <&vdd_arm>;
|
|
+};
|
|
+
|
|
+&cpu1 {
|
|
+ cpu-supply = <&vdd_arm>;
|
|
+};
|
|
+
|
|
+&cpu2 {
|
|
+ cpu-supply = <&vdd_arm>;
|
|
+};
|
|
+
|
|
+&cpu3 {
|
|
+ cpu-supply = <&vdd_arm>;
|
|
+};
|
|
+
|
|
&display_subsystem {
|
|
status = "okay";
|
|
};
|
|
@@ -100,12 +110,14 @@
|
|
cap-mmc-highspeed;
|
|
mmc-hs200-1_8v;
|
|
non-removable;
|
|
+ vmmc-supply = <&vcc_3v0>;
|
|
+ vqmmc-supply = <&vccio_flash>;
|
|
status = "okay";
|
|
};
|
|
|
|
&gmac {
|
|
clock_in_out = "output";
|
|
- phy-supply = <&vcc_phy>;
|
|
+ phy-supply = <&vcc_rmii>;
|
|
snps,reset-gpio = <&gpio2 13 GPIO_ACTIVE_LOW>;
|
|
snps,reset-active-low;
|
|
snps,reset-delays-us = <0 50000 50000>;
|
|
@@ -114,6 +126,219 @@
|
|
|
|
&i2c0 {
|
|
status = "okay";
|
|
+
|
|
+ rk809: pmic@20 {
|
|
+ compatible = "rockchip,rk809";
|
|
+ reg = <0x20>;
|
|
+ interrupt-parent = <&gpio0>;
|
|
+ interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&pmic_int>;
|
|
+ rockchip,system-power-controller;
|
|
+ wakeup-source;
|
|
+ #clock-cells = <0>;
|
|
+ clock-output-names = "xin32k";
|
|
+
|
|
+ vcc1-supply = <&vcc5v0_sys>;
|
|
+ vcc2-supply = <&vcc5v0_sys>;
|
|
+ vcc3-supply = <&vcc5v0_sys>;
|
|
+ vcc4-supply = <&vcc5v0_sys>;
|
|
+ vcc5-supply = <&vcc3v3_sys>;
|
|
+ vcc6-supply = <&vcc3v3_sys>;
|
|
+ vcc7-supply = <&vcc3v3_sys>;
|
|
+ vcc8-supply = <&vcc3v3_sys>;
|
|
+ vcc9-supply = <&vcc5v0_sys>;
|
|
+
|
|
+ regulators {
|
|
+ vdd_log: DCDC_REG1 {
|
|
+ regulator-name = "vdd_log";
|
|
+ regulator-min-microvolt = <950000>;
|
|
+ regulator-max-microvolt = <1350000>;
|
|
+ regulator-ramp-delay = <6001>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ regulator-suspend-microvolt = <950000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vdd_arm: DCDC_REG2 {
|
|
+ regulator-name = "vdd_arm";
|
|
+ regulator-min-microvolt = <950000>;
|
|
+ regulator-max-microvolt = <1350000>;
|
|
+ regulator-ramp-delay = <6001>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+
|
|
+ regulator-state-mem {
|
|
+ regulator-off-in-suspend;
|
|
+ regulator-suspend-microvolt = <950000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc_ddr: DCDC_REG3 {
|
|
+ regulator-name = "vcc_ddr";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc_3v0: vcc_rmii: DCDC_REG4 {
|
|
+ regulator-name = "vcc_3v0";
|
|
+ regulator-min-microvolt = <3000000>;
|
|
+ regulator-max-microvolt = <3000000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ regulator-suspend-microvolt = <3000000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc3v3_sys: DCDC_REG5 {
|
|
+ regulator-name = "vcc3v3_sys";
|
|
+ regulator-min-microvolt = <3300000>;
|
|
+ regulator-max-microvolt = <3300000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ regulator-suspend-microvolt = <3300000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc_1v0: LDO_REG1 {
|
|
+ regulator-name = "vcc_1v0";
|
|
+ regulator-min-microvolt = <1000000>;
|
|
+ regulator-max-microvolt = <1000000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ regulator-suspend-microvolt = <1000000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc_1v8: vccio_flash: vccio_sdio: LDO_REG2 {
|
|
+ regulator-name = "vcc_1v8";
|
|
+ regulator-min-microvolt = <1800000>;
|
|
+ regulator-max-microvolt = <1800000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ regulator-suspend-microvolt = <1800000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vdd_1v0: LDO_REG3 {
|
|
+ regulator-name = "vdd_1v0";
|
|
+ regulator-min-microvolt = <1000000>;
|
|
+ regulator-max-microvolt = <1000000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ regulator-suspend-microvolt = <1000000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc3v0_pmu: LDO_REG4 {
|
|
+ regulator-name = "vcc3v0_pmu";
|
|
+ regulator-min-microvolt = <3000000>;
|
|
+ regulator-max-microvolt = <3000000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ regulator-suspend-microvolt = <3000000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vccio_sd: LDO_REG5 {
|
|
+ regulator-name = "vccio_sd";
|
|
+ regulator-min-microvolt = <1800000>;
|
|
+ regulator-max-microvolt = <3300000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ regulator-suspend-microvolt = <3300000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc_sd: LDO_REG6 {
|
|
+ regulator-name = "vcc_sd";
|
|
+ regulator-min-microvolt = <3300000>;
|
|
+ regulator-max-microvolt = <3300000>;
|
|
+ regulator-boot-on;
|
|
+
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ regulator-suspend-microvolt = <3300000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc2v8_dvp: LDO_REG7 {
|
|
+ regulator-name = "vcc2v8_dvp";
|
|
+ regulator-min-microvolt = <2800000>;
|
|
+ regulator-max-microvolt = <2800000>;
|
|
+ regulator-boot-on;
|
|
+
|
|
+ regulator-state-mem {
|
|
+ regulator-off-in-suspend;
|
|
+ regulator-suspend-microvolt = <2800000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc1v8_dvp: LDO_REG8 {
|
|
+ regulator-name = "vcc1v8_dvp";
|
|
+ regulator-min-microvolt = <1800000>;
|
|
+ regulator-max-microvolt = <1800000>;
|
|
+ regulator-boot-on;
|
|
+
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ regulator-suspend-microvolt = <1800000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc1v5_dvp: LDO_REG9 {
|
|
+ regulator-name = "vcc1v5_dvp";
|
|
+ regulator-min-microvolt = <1500000>;
|
|
+ regulator-max-microvolt = <1500000>;
|
|
+ regulator-boot-on;
|
|
+
|
|
+ regulator-state-mem {
|
|
+ regulator-off-in-suspend;
|
|
+ regulator-suspend-microvolt = <1500000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc3v3_lcd: SWITCH_REG1 {
|
|
+ regulator-name = "vcc3v3_lcd";
|
|
+ regulator-boot-on;
|
|
+ };
|
|
+
|
|
+ vcc5v0_host: SWITCH_REG2 {
|
|
+ regulator-name = "vcc5v0_host";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ };
|
|
+ };
|
|
+ };
|
|
};
|
|
|
|
&i2s1_2ch {
|
|
@@ -122,6 +347,13 @@
|
|
|
|
&io_domains {
|
|
status = "okay";
|
|
+
|
|
+ vccio1-supply = <&vccio_sdio>;
|
|
+ vccio2-supply = <&vccio_sd>;
|
|
+ vccio3-supply = <&vcc_3v0>;
|
|
+ vccio4-supply = <&vcc3v0_pmu>;
|
|
+ vccio5-supply = <&vcc_3v0>;
|
|
+ vccio6-supply = <&vccio_flash>;
|
|
};
|
|
|
|
&pinctrl {
|
|
@@ -164,6 +396,9 @@
|
|
|
|
&pmu_io_domains {
|
|
status = "okay";
|
|
+
|
|
+ pmuio1-supply = <&vcc3v0_pmu>;
|
|
+ pmuio2-supply = <&vcc3v0_pmu>;
|
|
};
|
|
|
|
&pwm1 {
|
|
@@ -171,6 +406,7 @@
|
|
};
|
|
|
|
&saradc {
|
|
+ vref-supply = <&vcc_1v8>;
|
|
status = "okay";
|
|
};
|
|
|
|
@@ -183,6 +419,8 @@
|
|
sd-uhs-sdr25;
|
|
sd-uhs-sdr50;
|
|
sd-uhs-sdr104;
|
|
+ vmmc-supply = <&vcc_sd>;
|
|
+ vqmmc-supply = <&vccio_sd>;
|
|
status = "okay";
|
|
};
|
|
|
|
|
|
From 461c72e54c3613aaec74b1fc0c830505b109931a Mon Sep 17 00:00:00 2001
|
|
From: Heiko Stuebner <heiko@sntech.de>
|
|
Date: Tue, 17 Sep 2019 10:26:52 +0200
|
|
Subject: [PATCH] arm64: dts: rockchip: add emmc-powersequence to px30-evb
|
|
|
|
Hook the reset line into an emmc-pwrseq for it to get initialized nicely.
|
|
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Link: https://lore.kernel.org/r/20190917082659.25549-6-heiko@sntech.de
|
|
(cherry picked from commit 79fd8ba2fd2c64858253796abc2d9cc6c26d1e6d)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/px30-evb.dts | 14 ++++++++++++++
|
|
1 file changed, 14 insertions(+)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/px30-evb.dts b/arch/arm64/boot/dts/rockchip/px30-evb.dts
|
|
index d78fb172a66f..6d50f6abcb48 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/px30-evb.dts
|
|
+++ b/arch/arm64/boot/dts/rockchip/px30-evb.dts
|
|
@@ -61,6 +61,13 @@
|
|
power-supply = <&vcc3v3_lcd>;
|
|
};
|
|
|
|
+ emmc_pwrseq: emmc-pwrseq {
|
|
+ compatible = "mmc-pwrseq-emmc";
|
|
+ pinctrl-0 = <&emmc_reset>;
|
|
+ pinctrl-names = "default";
|
|
+ reset-gpios = <&gpio1 RK_PB3 GPIO_ACTIVE_HIGH>;
|
|
+ };
|
|
+
|
|
sdio_pwrseq: sdio-pwrseq {
|
|
compatible = "mmc-pwrseq-simple";
|
|
pinctrl-names = "default";
|
|
@@ -110,6 +117,7 @@
|
|
cap-mmc-highspeed;
|
|
mmc-hs200-1_8v;
|
|
non-removable;
|
|
+ mmc-pwrseq = <&emmc_pwrseq>;
|
|
vmmc-supply = <&vcc_3v0>;
|
|
vqmmc-supply = <&vccio_flash>;
|
|
status = "okay";
|
|
@@ -364,6 +372,12 @@
|
|
};
|
|
};
|
|
|
|
+ emmc {
|
|
+ emmc_reset: emmc-reset {
|
|
+ rockchip,pins = <1 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
pmic {
|
|
pmic_int: pmic_int {
|
|
rockchip,pins =
|
|
|
|
From 754fe54401ede9b6252b6053d81539dc554278c8 Mon Sep 17 00:00:00 2001
|
|
From: Heiko Stuebner <heiko@sntech.de>
|
|
Date: Tue, 17 Sep 2019 10:26:53 +0200
|
|
Subject: [PATCH] arm64: dts: rockchip: move px30-evb console output to uart 5
|
|
|
|
The px30-evb exposes uart2 through a uart-to-usb converter on the board
|
|
but these pins are shared with the sdmmc controller. With both activated
|
|
this results in a race condition depending in the probe order.
|
|
Whichever of the two probes first will break the other peripheral.
|
|
|
|
The px30-evb also exposes uart5 through pin its pin headers, so it's way
|
|
saner to use these pins for serial output and keep the sdmmc working in
|
|
all cases.
|
|
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Link: https://lore.kernel.org/r/20190917082659.25549-7-heiko@sntech.de
|
|
(cherry picked from commit 9003aacb9cc3496947534b57f95913b147a9102c)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/px30-evb.dts | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/px30-evb.dts b/arch/arm64/boot/dts/rockchip/px30-evb.dts
|
|
index 6d50f6abcb48..80524afe94da 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/px30-evb.dts
|
|
+++ b/arch/arm64/boot/dts/rockchip/px30-evb.dts
|
|
@@ -14,7 +14,7 @@
|
|
compatible = "rockchip,px30-evb", "rockchip,px30";
|
|
|
|
chosen {
|
|
- stdout-path = "serial2:1500000n8";
|
|
+ stdout-path = "serial5:115200n8";
|
|
};
|
|
|
|
adc-keys {
|
|
@@ -454,7 +454,7 @@
|
|
status = "okay";
|
|
};
|
|
|
|
-&uart2 {
|
|
+&uart5 {
|
|
status = "okay";
|
|
};
|
|
|
|
|
|
From ebc44ffbe47736e643483e4b10f810f8f2a87263 Mon Sep 17 00:00:00 2001
|
|
From: Heiko Stuebner <heiko@sntech.de>
|
|
Date: Tue, 17 Sep 2019 10:26:54 +0200
|
|
Subject: [PATCH] arm64: dts: rockchip: remove unused pin settings from px30
|
|
|
|
These are unused gpio-settings for specific function pins, that
|
|
are not used by anything and only clutter up the dtsi.
|
|
They can be re-added when a relevant user is added.
|
|
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Link: https://lore.kernel.org/r/20190917082659.25549-8-heiko@sntech.de
|
|
(cherry picked from commit 689c7dc73c26834bc70aa06065ff44df991cd975)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/px30.dtsi | 40 ----------------------------------
|
|
1 file changed, 40 deletions(-)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/px30.dtsi b/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
index f2bbdfa0e4aa..63499d27994c 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
+++ b/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
@@ -1159,11 +1159,6 @@
|
|
rockchip,pins =
|
|
<0 RK_PB5 1 &pcfg_pull_none>;
|
|
};
|
|
-
|
|
- uart0_rts_gpio: uart0-rts-gpio {
|
|
- rockchip,pins =
|
|
- <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
- };
|
|
};
|
|
|
|
uart1 {
|
|
@@ -1182,11 +1177,6 @@
|
|
rockchip,pins =
|
|
<1 RK_PC3 1 &pcfg_pull_none>;
|
|
};
|
|
-
|
|
- uart1_rts_gpio: uart1-rts-gpio {
|
|
- rockchip,pins =
|
|
- <1 RK_PC3 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
- };
|
|
};
|
|
|
|
uart2-m0 {
|
|
@@ -1221,11 +1211,6 @@
|
|
rockchip,pins =
|
|
<0 RK_PC3 2 &pcfg_pull_none>;
|
|
};
|
|
-
|
|
- uart3m0_rts_gpio: uart3m0-rts-gpio {
|
|
- rockchip,pins =
|
|
- <0 RK_PC3 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
- };
|
|
};
|
|
|
|
uart3-m1 {
|
|
@@ -1244,11 +1229,6 @@
|
|
rockchip,pins =
|
|
<1 RK_PB5 2 &pcfg_pull_none>;
|
|
};
|
|
-
|
|
- uart3m1_rts_gpio: uart3m1-rts-gpio {
|
|
- rockchip,pins =
|
|
- <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
- };
|
|
};
|
|
|
|
uart4 {
|
|
@@ -1597,16 +1577,6 @@
|
|
<1 RK_PD4 1 &pcfg_pull_up_8ma>,
|
|
<1 RK_PD5 1 &pcfg_pull_up_8ma>;
|
|
};
|
|
-
|
|
- sdmmc_gpio: sdmmc-gpio {
|
|
- rockchip,pins =
|
|
- <1 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
|
|
- <1 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
|
|
- <1 RK_PD4 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
|
|
- <1 RK_PD5 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
|
|
- <1 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
|
|
- <1 RK_PD7 RK_FUNC_GPIO &pcfg_pull_up_4ma>;
|
|
- };
|
|
};
|
|
|
|
sdio {
|
|
@@ -1627,16 +1597,6 @@
|
|
<1 RK_PD0 1 &pcfg_pull_up>,
|
|
<1 RK_PD1 1 &pcfg_pull_up>;
|
|
};
|
|
-
|
|
- sdio_gpio: sdio-gpio {
|
|
- rockchip,pins =
|
|
- <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>,
|
|
- <1 RK_PC7 RK_FUNC_GPIO &pcfg_pull_up>,
|
|
- <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>,
|
|
- <1 RK_PD1 RK_FUNC_GPIO &pcfg_pull_up>,
|
|
- <1 RK_PC4 RK_FUNC_GPIO &pcfg_pull_up>,
|
|
- <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
|
|
- };
|
|
};
|
|
|
|
emmc {
|
|
|
|
From 2caba9b745c94b5b0b5fe548156fa62f52437d70 Mon Sep 17 00:00:00 2001
|
|
From: Heiko Stuebner <heiko@sntech.de>
|
|
Date: Tue, 17 Sep 2019 10:26:55 +0200
|
|
Subject: [PATCH] arm64: dts: rockchip: document explicit px30 cru dependencies
|
|
|
|
The px30 contains 2 separate clock controllers the regular cru creating
|
|
most clocks as well as the pmucru managing the GPLL and some other clocks.
|
|
|
|
The gpll of course also is needed by the cru, so while we normally do rely
|
|
on clock names to associate clocks getting probed later on (for example
|
|
xin32k coming from an i2c device in most cases) it is safer to declare the
|
|
explicit dependency between the two crus. This makes sure that for example
|
|
the clock-framework probes them in the correct order from the start.
|
|
|
|
The assigned-clocks properties were simply working by chance in the past
|
|
so split them accordingly to the 2 crus to honor the loading direction.
|
|
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Reviewed-by: Rob Herring <robh@kernel.org>
|
|
Link: https://lore.kernel.org/r/20190917082659.25549-9-heiko@sntech.de
|
|
(cherry picked from commit 45cb61b4f3bf991ac2011dbc4a155bd5f3b29ebe)
|
|
---
|
|
.../bindings/clock/rockchip,px30-cru.txt | 5 +++++
|
|
arch/arm64/boot/dts/rockchip/px30.dtsi | 25 +++++++++++++---------
|
|
2 files changed, 20 insertions(+), 10 deletions(-)
|
|
|
|
diff --git a/Documentation/devicetree/bindings/clock/rockchip,px30-cru.txt b/Documentation/devicetree/bindings/clock/rockchip,px30-cru.txt
|
|
index 39f0c1ac84ee..55e78cddec8c 100644
|
|
--- a/Documentation/devicetree/bindings/clock/rockchip,px30-cru.txt
|
|
+++ b/Documentation/devicetree/bindings/clock/rockchip,px30-cru.txt
|
|
@@ -10,6 +10,11 @@ Required Properties:
|
|
- compatible: CRU should be "rockchip,px30-cru"
|
|
- reg: physical base address of the controller and length of memory mapped
|
|
region.
|
|
+- clocks: A list of phandle + clock-specifier pairs for the clocks listed
|
|
+ in clock-names
|
|
+- clock-names: Should contain the following:
|
|
+ - "xin24m" for both PMUCRU and CRU
|
|
+ - "gpll" for CRU (sourced from PMUCRU)
|
|
- #clock-cells: should be 1.
|
|
- #reset-cells: should be 1.
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/px30.dtsi b/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
index 63499d27994c..9ad1c2f04ea9 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
+++ b/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
@@ -667,33 +667,38 @@
|
|
cru: clock-controller@ff2b0000 {
|
|
compatible = "rockchip,px30-cru";
|
|
reg = <0x0 0xff2b0000 0x0 0x1000>;
|
|
+ clocks = <&xin24m>, <&pmucru PLL_GPLL>;
|
|
+ clock-names = "xin24m", "gpll";
|
|
rockchip,grf = <&grf>;
|
|
#clock-cells = <1>;
|
|
#reset-cells = <1>;
|
|
|
|
- assigned-clocks = <&cru PLL_NPLL>;
|
|
- assigned-clock-rates = <1188000000>;
|
|
+ assigned-clocks = <&cru PLL_NPLL>,
|
|
+ <&cru ACLK_BUS_PRE>, <&cru ACLK_PERI_PRE>,
|
|
+ <&cru HCLK_BUS_PRE>, <&cru HCLK_PERI_PRE>,
|
|
+ <&cru PCLK_BUS_PRE>, <&cru SCLK_GPU>;
|
|
+
|
|
+ assigned-clock-rates = <1188000000>,
|
|
+ <200000000>, <200000000>,
|
|
+ <150000000>, <150000000>,
|
|
+ <100000000>, <200000000>;
|
|
};
|
|
|
|
pmucru: clock-controller@ff2bc000 {
|
|
compatible = "rockchip,px30-pmucru";
|
|
reg = <0x0 0xff2bc000 0x0 0x1000>;
|
|
+ clocks = <&xin24m>;
|
|
+ clock-names = "xin24m";
|
|
rockchip,grf = <&grf>;
|
|
#clock-cells = <1>;
|
|
#reset-cells = <1>;
|
|
|
|
assigned-clocks =
|
|
<&pmucru PLL_GPLL>, <&pmucru PCLK_PMU_PRE>,
|
|
- <&pmucru SCLK_WIFI_PMU>, <&cru ARMCLK>,
|
|
- <&cru ACLK_BUS_PRE>, <&cru ACLK_PERI_PRE>,
|
|
- <&cru HCLK_BUS_PRE>, <&cru HCLK_PERI_PRE>,
|
|
- <&cru PCLK_BUS_PRE>, <&cru SCLK_GPU>;
|
|
+ <&pmucru SCLK_WIFI_PMU>;
|
|
assigned-clock-rates =
|
|
<1200000000>, <100000000>,
|
|
- <26000000>, <600000000>,
|
|
- <200000000>, <200000000>,
|
|
- <150000000>, <150000000>,
|
|
- <100000000>, <200000000>;
|
|
+ <26000000>;
|
|
};
|
|
|
|
usb20_otg: usb@ff300000 {
|
|
|
|
From 55960dbd35cbfed7ae4a91df6341fb1d25b9a13d Mon Sep 17 00:00:00 2001
|
|
From: Heiko Stuebner <heiko@sntech.de>
|
|
Date: Tue, 17 Sep 2019 10:26:56 +0200
|
|
Subject: [PATCH] arm64: dts: rockchip: add px30-evb i2c1 devices
|
|
|
|
Enable i2c1 and adds the devices connected to it.
|
|
This includes a magnetometer, goodix-touchscreen and accelerometer.
|
|
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Link: https://lore.kernel.org/r/20190917082659.25549-10-heiko@sntech.de
|
|
(cherry picked from commit 52462ac6277fa30ba3829975d0745fd0b740e433)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/px30-evb.dts | 37 +++++++++++++++++++++++++++++++
|
|
1 file changed, 37 insertions(+)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/px30-evb.dts b/arch/arm64/boot/dts/rockchip/px30-evb.dts
|
|
index 80524afe94da..1185a314ba4a 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/px30-evb.dts
|
|
+++ b/arch/arm64/boot/dts/rockchip/px30-evb.dts
|
|
@@ -349,6 +349,43 @@
|
|
};
|
|
};
|
|
|
|
+&i2c1 {
|
|
+ status = "okay";
|
|
+
|
|
+ sensor@d {
|
|
+ compatible = "asahi-kasei,ak8963";
|
|
+ reg = <0x0d>;
|
|
+ gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>;
|
|
+ vdd-supply = <&vcc3v0_pmu>;
|
|
+ mount-matrix = "1", /* x0 */
|
|
+ "0", /* y0 */
|
|
+ "0", /* z0 */
|
|
+ "0", /* x1 */
|
|
+ "1", /* y1 */
|
|
+ "0", /* z1 */
|
|
+ "0", /* x2 */
|
|
+ "0", /* y2 */
|
|
+ "1"; /* z2 */
|
|
+ };
|
|
+
|
|
+ touchscreen@14 {
|
|
+ compatible = "goodix,gt1151";
|
|
+ reg = <0x14>;
|
|
+ interrupt-parent = <&gpio0>;
|
|
+ interrupts = <RK_PA5 IRQ_TYPE_LEVEL_LOW>;
|
|
+ irq-gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
|
|
+ reset-gpios = <&gpio0 RK_PB4 GPIO_ACTIVE_HIGH>;
|
|
+ VDDIO-supply = <&vcc3v3_lcd>;
|
|
+ };
|
|
+
|
|
+ sensor@4c {
|
|
+ compatible = "fsl,mma7660";
|
|
+ reg = <0x4c>;
|
|
+ interrupt-parent = <&gpio0>;
|
|
+ interrupts = <RK_PB7 IRQ_TYPE_LEVEL_LOW>;
|
|
+ };
|
|
+};
|
|
+
|
|
&i2s1_2ch {
|
|
status = "okay";
|
|
};
|
|
|
|
From d9be15252b1b72711807f5941d4e606cfdd4a620 Mon Sep 17 00:00:00 2001
|
|
From: Heiko Stuebner <heiko@sntech.de>
|
|
Date: Tue, 17 Sep 2019 10:26:57 +0200
|
|
Subject: [PATCH] dt-bindings: document PX30 usb2phy General Register Files
|
|
|
|
One of the separate General Register Files contains the registers for
|
|
controlling the usb2phy, so add the necessary binding compatible for it.
|
|
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Acked-by: Rob Herring <robh@kernel.org>
|
|
Link: https://lore.kernel.org/r/20190917082659.25549-11-heiko@sntech.de
|
|
(cherry picked from commit c595826faa9705e04ef6ec4de2b1c6775815482b)
|
|
---
|
|
Documentation/devicetree/bindings/soc/rockchip/grf.txt | 1 +
|
|
1 file changed, 1 insertion(+)
|
|
|
|
diff --git a/Documentation/devicetree/bindings/soc/rockchip/grf.txt b/Documentation/devicetree/bindings/soc/rockchip/grf.txt
|
|
index 46e27cd69f18..d7debec26ba4 100644
|
|
--- a/Documentation/devicetree/bindings/soc/rockchip/grf.txt
|
|
+++ b/Documentation/devicetree/bindings/soc/rockchip/grf.txt
|
|
@@ -30,6 +30,7 @@ Required Properties:
|
|
- compatible: SGRF should be one of the following
|
|
- "rockchip,rk3288-sgrf", "syscon": for rk3288
|
|
- compatible: USB2PHYGRF should be one of the followings
|
|
+ - "rockchip,px30-usb2phy-grf", "syscon": for px30
|
|
- "rockchip,rk3328-usb2phy-grf", "syscon": for rk3328
|
|
- compatible: USBGRF should be one of the following
|
|
- "rockchip,rv1108-usbgrf", "syscon": for rv1108
|
|
|
|
From f1970d025ffa06ad4426eeab1cb613cfb2163eca Mon Sep 17 00:00:00 2001
|
|
From: Jagan Teki <jagan@amarulasolutions.com>
|
|
Date: Thu, 19 Sep 2019 10:58:21 +0530
|
|
Subject: [PATCH] arm64: dts: rockchip: Rename vcc12v_sys into dc_12v for
|
|
roc-rk3399-pc
|
|
|
|
It is always better practice to follow regulator naming conventions
|
|
as per the schematics for future references.
|
|
|
|
This would indeed helpful to review and check the naming convention
|
|
directly on schematics, both for the code reviewers and the developers.
|
|
|
|
So, rename vcc12v_sys into dc_12v as per rk3399 power tree as per
|
|
roc-rk3399-pc schematics.
|
|
|
|
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
|
|
Link: https://lore.kernel.org/r/20190919052822.10403-6-jagan@amarulasolutions.com
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit f1b3b7077b40b4890c5efed82f5b06854fed4811)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts | 8 ++++----
|
|
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
|
|
index 19f7732d728c..603c4d7274b8 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
|
|
@@ -57,9 +57,9 @@
|
|
* should be placed inside mp8859, but not until mp8859 has
|
|
* its own dt-binding.
|
|
*/
|
|
- vcc12v_sys: mp8859-dcdc1 {
|
|
+ dc_12v: mp8859-dcdc1 {
|
|
compatible = "regulator-fixed";
|
|
- regulator-name = "vcc12v_sys";
|
|
+ regulator-name = "dc_12v";
|
|
regulator-always-on;
|
|
regulator-boot-on;
|
|
regulator-min-microvolt = <12000000>;
|
|
@@ -85,7 +85,7 @@
|
|
regulator-boot-on;
|
|
regulator-min-microvolt = <3300000>;
|
|
regulator-max-microvolt = <3300000>;
|
|
- vin-supply = <&vcc12v_sys>;
|
|
+ vin-supply = <&dc_12v>;
|
|
};
|
|
|
|
/* Actually 3 regulators (host0, 1, 2) controlled by the same gpio */
|
|
@@ -118,7 +118,7 @@
|
|
regulator-boot-on;
|
|
regulator-min-microvolt = <5000000>;
|
|
regulator-max-microvolt = <5000000>;
|
|
- vin-supply = <&vcc12v_sys>;
|
|
+ vin-supply = <&dc_12v>;
|
|
};
|
|
|
|
vdd_log: vdd-log {
|
|
|
|
From ed1ba1d04e75653411b7de05ce6230fccec84cf6 Mon Sep 17 00:00:00 2001
|
|
From: Jagan Teki <jagan@amarulasolutions.com>
|
|
Date: Thu, 19 Sep 2019 10:58:22 +0530
|
|
Subject: [PATCH] arm64: dts: rockchip: Fix roc-rk3399-pc regulator input rails
|
|
|
|
Few, know rk808 pmic regulators VCC[1-4], VCC[6-7], VCC[9-11],
|
|
VDD_LOG, VDD_GPU, VDD_CPU_B, VCC3V3_SYS are inputting with vcc_sys
|
|
which is 5V power rail from dc_12v.
|
|
|
|
So, replace the vin-supply of above mentioned regulators
|
|
with vcc_sys as per the PMIC-RK808-D page of roc-rk3399-pc
|
|
schematics.
|
|
|
|
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
|
|
Link: https://lore.kernel.org/r/20190919052822.10403-7-jagan@amarulasolutions.com
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit 9f7f9b610e1b7d2dc86c543ab0dfcf781bd42326)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts | 26 +++++++++++++-------------
|
|
1 file changed, 13 insertions(+), 13 deletions(-)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
|
|
index 603c4d7274b8..257543d069d8 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
|
|
@@ -85,7 +85,7 @@
|
|
regulator-boot-on;
|
|
regulator-min-microvolt = <3300000>;
|
|
regulator-max-microvolt = <3300000>;
|
|
- vin-supply = <&dc_12v>;
|
|
+ vin-supply = <&vcc_sys>;
|
|
};
|
|
|
|
/* Actually 3 regulators (host0, 1, 2) controlled by the same gpio */
|
|
@@ -129,7 +129,7 @@
|
|
regulator-boot-on;
|
|
regulator-min-microvolt = <800000>;
|
|
regulator-max-microvolt = <1400000>;
|
|
- vin-supply = <&vcc3v3_sys>;
|
|
+ vin-supply = <&vcc_sys>;
|
|
};
|
|
};
|
|
|
|
@@ -202,16 +202,16 @@
|
|
rockchip,system-power-controller;
|
|
wakeup-source;
|
|
|
|
- vcc1-supply = <&vcc3v3_sys>;
|
|
- vcc2-supply = <&vcc3v3_sys>;
|
|
- vcc3-supply = <&vcc3v3_sys>;
|
|
- vcc4-supply = <&vcc3v3_sys>;
|
|
- vcc6-supply = <&vcc3v3_sys>;
|
|
- vcc7-supply = <&vcc3v3_sys>;
|
|
+ vcc1-supply = <&vcc_sys>;
|
|
+ vcc2-supply = <&vcc_sys>;
|
|
+ vcc3-supply = <&vcc_sys>;
|
|
+ vcc4-supply = <&vcc_sys>;
|
|
+ vcc6-supply = <&vcc_sys>;
|
|
+ vcc7-supply = <&vcc_sys>;
|
|
vcc8-supply = <&vcc3v3_sys>;
|
|
- vcc9-supply = <&vcc3v3_sys>;
|
|
- vcc10-supply = <&vcc3v3_sys>;
|
|
- vcc11-supply = <&vcc3v3_sys>;
|
|
+ vcc9-supply = <&vcc_sys>;
|
|
+ vcc10-supply = <&vcc_sys>;
|
|
+ vcc11-supply = <&vcc_sys>;
|
|
vcc12-supply = <&vcc3v3_sys>;
|
|
vddio-supply = <&vcc1v8_pmu>;
|
|
|
|
@@ -385,7 +385,7 @@
|
|
regulator-ramp-delay = <1000>;
|
|
regulator-always-on;
|
|
regulator-boot-on;
|
|
- vin-supply = <&vcc3v3_sys>;
|
|
+ vin-supply = <&vcc_sys>;
|
|
|
|
regulator-state-mem {
|
|
regulator-off-in-suspend;
|
|
@@ -404,7 +404,7 @@
|
|
regulator-ramp-delay = <1000>;
|
|
regulator-always-on;
|
|
regulator-boot-on;
|
|
- vin-supply = <&vcc3v3_sys>;
|
|
+ vin-supply = <&vcc_sys>;
|
|
|
|
regulator-state-mem {
|
|
regulator-off-in-suspend;
|
|
|
|
From 3263ff051ef26516ef7670d6238e0e95c6027407 Mon Sep 17 00:00:00 2001
|
|
From: Heiko Stuebner <heiko@sntech.de>
|
|
Date: Tue, 17 Sep 2019 10:36:25 +0200
|
|
Subject: [PATCH] arm64: dts: rockchip: add missing #msi-cells to rk3399
|
|
|
|
The rk3399 gic-its was missing the #msi-cells property as found by
|
|
dt-schema checks, so add it.
|
|
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Link: https://lore.kernel.org/r/20190917083625.25818-1-heiko@sntech.de
|
|
(cherry picked from commit 85dd7638505823f38d491ab6b4e52b3ab9349149)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/rk3399.dtsi | 1 +
|
|
1 file changed, 1 insertion(+)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
|
|
index cede1ad81be2..e62ea0e2b657 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
|
|
@@ -520,6 +520,7 @@
|
|
its: interrupt-controller@fee20000 {
|
|
compatible = "arm,gic-v3-its";
|
|
msi-controller;
|
|
+ #msi-cells = <1>;
|
|
reg = <0x0 0xfee20000 0x0 0x20000>;
|
|
};
|
|
|
|
|
|
From 0d2c5493f8a7f5e1ad24757aeda4827242a618e6 Mon Sep 17 00:00:00 2001
|
|
From: Katsuhiro Suzuki <katsuhiro@katsuster.net>
|
|
Date: Sun, 8 Sep 2019 02:48:33 +0900
|
|
Subject: [PATCH] arm64: dts: rockchip: add analog audio nodes on
|
|
rk3399-rockpro64
|
|
|
|
This patch adds audio codec (Everest ES8316) and I2S audio nodes for
|
|
RK3399 RockPro64.
|
|
|
|
Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
|
|
Link: https://lore.kernel.org/r/20190907174833.19957-1-katsuhiro@katsuster.net
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit 6860769ea771cf7fdb77c0f1333096c9700be141)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts | 28 +++++++++++++++++++++++
|
|
1 file changed, 28 insertions(+)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
|
|
index e544deb61d28..7f4b2eba31d4 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
|
|
@@ -81,6 +81,12 @@
|
|
reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
|
|
};
|
|
|
|
+ sound {
|
|
+ compatible = "audio-graph-card";
|
|
+ label = "rockchip,rk3399";
|
|
+ dais = <&i2s1_p0>;
|
|
+ };
|
|
+
|
|
vcc12v_dcin: vcc12v-dcin {
|
|
compatible = "regulator-fixed";
|
|
regulator-name = "vcc12v_dcin";
|
|
@@ -470,6 +476,20 @@
|
|
i2c-scl-rising-time-ns = <300>;
|
|
i2c-scl-falling-time-ns = <15>;
|
|
status = "okay";
|
|
+
|
|
+ es8316: codec@11 {
|
|
+ compatible = "everest,es8316";
|
|
+ reg = <0x11>;
|
|
+ clocks = <&cru SCLK_I2S_8CH_OUT>;
|
|
+ clock-names = "mclk";
|
|
+ #sound-dai-cells = <0>;
|
|
+
|
|
+ port {
|
|
+ es8316_p0_0: endpoint {
|
|
+ remote-endpoint = <&i2s1_p0_0>;
|
|
+ };
|
|
+ };
|
|
+ };
|
|
};
|
|
|
|
&i2c3 {
|
|
@@ -505,6 +525,14 @@
|
|
rockchip,playback-channels = <2>;
|
|
rockchip,capture-channels = <2>;
|
|
status = "okay";
|
|
+
|
|
+ i2s1_p0: port {
|
|
+ i2s1_p0_0: endpoint {
|
|
+ dai-format = "i2s";
|
|
+ mclk-fs = <256>;
|
|
+ remote-endpoint = <&es8316_p0_0>;
|
|
+ };
|
|
+ };
|
|
};
|
|
|
|
&i2s2 {
|
|
|
|
From f2c2236c7befe635dea57d740f51567fe6a421b4 Mon Sep 17 00:00:00 2001
|
|
From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Date: Fri, 4 Oct 2019 13:04:24 +0200
|
|
Subject: [PATCH] cec: add cec_adapter to cec_notifier_cec_adap_unregister()
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
It is possible for one HDMI connector to have multiple CEC adapters. The
|
|
typical real-world scenario is that where one adapter is used when the
|
|
device is in standby, and one that's better/smarter when the device is
|
|
powered up.
|
|
|
|
The cec-notifier changes were made with that in mind, but I missed that in
|
|
order to support this you need to tell cec_notifier_cec_adap_unregister()
|
|
which adapter you are unregistering from the notifier.
|
|
|
|
Add this additional argument. It is currently unused, but once all drivers
|
|
use this, the CEC core will be adapted for these use-cases.
|
|
|
|
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
|
|
Acked-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/e9fc8740-6be6-43a7-beee-ce2d7b54936e@xs4all.nl
|
|
(cherry picked from commit 10d8f308ba3e4d2c8753dd7a143af6f4a96cc29b)
|
|
---
|
|
drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c | 4 ++--
|
|
drivers/gpu/drm/i2c/tda9950.c | 4 ++--
|
|
drivers/media/cec/cec-notifier.c | 5 +++--
|
|
drivers/media/platform/cros-ec-cec/cros-ec-cec.c | 6 ++++--
|
|
drivers/media/platform/meson/ao-cec-g12a.c | 4 ++--
|
|
drivers/media/platform/meson/ao-cec.c | 4 ++--
|
|
drivers/media/platform/s5p-cec/s5p_cec.c | 4 ++--
|
|
drivers/media/platform/seco-cec/seco-cec.c | 4 ++--
|
|
drivers/media/platform/sti/cec/stih-cec.c | 4 ++--
|
|
drivers/media/platform/tegra-cec/tegra_cec.c | 4 ++--
|
|
include/media/cec-notifier.h | 7 +++++--
|
|
11 files changed, 28 insertions(+), 22 deletions(-)
|
|
|
|
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c
|
|
index ac1e001d0882..70ab4fbdc23e 100644
|
|
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c
|
|
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c
|
|
@@ -285,7 +285,7 @@ static int dw_hdmi_cec_probe(struct platform_device *pdev)
|
|
|
|
ret = cec_register_adapter(cec->adap, pdev->dev.parent);
|
|
if (ret < 0) {
|
|
- cec_notifier_cec_adap_unregister(cec->notify);
|
|
+ cec_notifier_cec_adap_unregister(cec->notify, cec->adap);
|
|
return ret;
|
|
}
|
|
|
|
@@ -302,7 +302,7 @@ static int dw_hdmi_cec_remove(struct platform_device *pdev)
|
|
{
|
|
struct dw_hdmi_cec *cec = platform_get_drvdata(pdev);
|
|
|
|
- cec_notifier_cec_adap_unregister(cec->notify);
|
|
+ cec_notifier_cec_adap_unregister(cec->notify, cec->adap);
|
|
cec_unregister_adapter(cec->adap);
|
|
|
|
return 0;
|
|
diff --git a/drivers/gpu/drm/i2c/tda9950.c b/drivers/gpu/drm/i2c/tda9950.c
|
|
index a5a75bdeb7a5..5b03fdd1eaa4 100644
|
|
--- a/drivers/gpu/drm/i2c/tda9950.c
|
|
+++ b/drivers/gpu/drm/i2c/tda9950.c
|
|
@@ -465,7 +465,7 @@ static int tda9950_probe(struct i2c_client *client,
|
|
|
|
ret = cec_register_adapter(priv->adap, priv->hdmi);
|
|
if (ret < 0) {
|
|
- cec_notifier_cec_adap_unregister(priv->notify);
|
|
+ cec_notifier_cec_adap_unregister(priv->notify, priv->adap);
|
|
return ret;
|
|
}
|
|
|
|
@@ -482,7 +482,7 @@ static int tda9950_remove(struct i2c_client *client)
|
|
{
|
|
struct tda9950_priv *priv = i2c_get_clientdata(client);
|
|
|
|
- cec_notifier_cec_adap_unregister(priv->notify);
|
|
+ cec_notifier_cec_adap_unregister(priv->notify, priv->adap);
|
|
cec_unregister_adapter(priv->adap);
|
|
|
|
return 0;
|
|
diff --git a/drivers/media/cec/cec-notifier.c b/drivers/media/cec/cec-notifier.c
|
|
index 4d82a5522072..7cf42b133dbc 100644
|
|
--- a/drivers/media/cec/cec-notifier.c
|
|
+++ b/drivers/media/cec/cec-notifier.c
|
|
@@ -153,13 +153,14 @@ cec_notifier_cec_adap_register(struct device *hdmi_dev, const char *conn_name,
|
|
}
|
|
EXPORT_SYMBOL_GPL(cec_notifier_cec_adap_register);
|
|
|
|
-void cec_notifier_cec_adap_unregister(struct cec_notifier *n)
|
|
+void cec_notifier_cec_adap_unregister(struct cec_notifier *n,
|
|
+ struct cec_adapter *adap)
|
|
{
|
|
if (!n)
|
|
return;
|
|
|
|
mutex_lock(&n->lock);
|
|
- n->cec_adap->notifier = NULL;
|
|
+ adap->notifier = NULL;
|
|
n->cec_adap = NULL;
|
|
n->callback = NULL;
|
|
mutex_unlock(&n->lock);
|
|
diff --git a/drivers/media/platform/cros-ec-cec/cros-ec-cec.c b/drivers/media/platform/cros-ec-cec/cros-ec-cec.c
|
|
index 4a3b3810fd89..f048e8994785 100644
|
|
--- a/drivers/media/platform/cros-ec-cec/cros-ec-cec.c
|
|
+++ b/drivers/media/platform/cros-ec-cec/cros-ec-cec.c
|
|
@@ -314,7 +314,8 @@ static int cros_ec_cec_probe(struct platform_device *pdev)
|
|
return 0;
|
|
|
|
out_probe_notify:
|
|
- cec_notifier_cec_adap_unregister(cros_ec_cec->notify);
|
|
+ cec_notifier_cec_adap_unregister(cros_ec_cec->notify,
|
|
+ cros_ec_cec->adap);
|
|
out_probe_adapter:
|
|
cec_delete_adapter(cros_ec_cec->adap);
|
|
return ret;
|
|
@@ -335,7 +336,8 @@ static int cros_ec_cec_remove(struct platform_device *pdev)
|
|
return ret;
|
|
}
|
|
|
|
- cec_notifier_cec_adap_unregister(cros_ec_cec->notify);
|
|
+ cec_notifier_cec_adap_unregister(cros_ec_cec->notify,
|
|
+ cros_ec_cec->adap);
|
|
cec_unregister_adapter(cros_ec_cec->adap);
|
|
|
|
return 0;
|
|
diff --git a/drivers/media/platform/meson/ao-cec-g12a.c b/drivers/media/platform/meson/ao-cec-g12a.c
|
|
index 3b39e875292e..70f875b4a01e 100644
|
|
--- a/drivers/media/platform/meson/ao-cec-g12a.c
|
|
+++ b/drivers/media/platform/meson/ao-cec-g12a.c
|
|
@@ -736,7 +736,7 @@ static int meson_ao_cec_g12a_probe(struct platform_device *pdev)
|
|
clk_disable_unprepare(ao_cec->core);
|
|
|
|
out_probe_notify:
|
|
- cec_notifier_cec_adap_unregister(ao_cec->notify);
|
|
+ cec_notifier_cec_adap_unregister(ao_cec->notify, ao_cec->adap);
|
|
|
|
out_probe_adapter:
|
|
cec_delete_adapter(ao_cec->adap);
|
|
@@ -752,7 +752,7 @@ static int meson_ao_cec_g12a_remove(struct platform_device *pdev)
|
|
|
|
clk_disable_unprepare(ao_cec->core);
|
|
|
|
- cec_notifier_cec_adap_unregister(ao_cec->notify);
|
|
+ cec_notifier_cec_adap_unregister(ao_cec->notify, ao_cec->adap);
|
|
|
|
cec_unregister_adapter(ao_cec->adap);
|
|
|
|
diff --git a/drivers/media/platform/meson/ao-cec.c b/drivers/media/platform/meson/ao-cec.c
|
|
index 64ed549bf012..92859a6d006f 100644
|
|
--- a/drivers/media/platform/meson/ao-cec.c
|
|
+++ b/drivers/media/platform/meson/ao-cec.c
|
|
@@ -688,7 +688,7 @@ static int meson_ao_cec_probe(struct platform_device *pdev)
|
|
clk_disable_unprepare(ao_cec->core);
|
|
|
|
out_probe_notify:
|
|
- cec_notifier_cec_adap_unregister(ao_cec->notify);
|
|
+ cec_notifier_cec_adap_unregister(ao_cec->notify, ao_cec->adap);
|
|
|
|
out_probe_adapter:
|
|
cec_delete_adapter(ao_cec->adap);
|
|
@@ -704,7 +704,7 @@ static int meson_ao_cec_remove(struct platform_device *pdev)
|
|
|
|
clk_disable_unprepare(ao_cec->core);
|
|
|
|
- cec_notifier_cec_adap_unregister(ao_cec->notify);
|
|
+ cec_notifier_cec_adap_unregister(ao_cec->notify, ao_cec->adap);
|
|
cec_unregister_adapter(ao_cec->adap);
|
|
|
|
return 0;
|
|
diff --git a/drivers/media/platform/s5p-cec/s5p_cec.c b/drivers/media/platform/s5p-cec/s5p_cec.c
|
|
index 6ddcc35b0bbd..2a3e7ffefe0a 100644
|
|
--- a/drivers/media/platform/s5p-cec/s5p_cec.c
|
|
+++ b/drivers/media/platform/s5p-cec/s5p_cec.c
|
|
@@ -239,7 +239,7 @@ static int s5p_cec_probe(struct platform_device *pdev)
|
|
return 0;
|
|
|
|
err_notifier:
|
|
- cec_notifier_cec_adap_unregister(cec->notifier);
|
|
+ cec_notifier_cec_adap_unregister(cec->notifier, cec->adap);
|
|
|
|
err_delete_adapter:
|
|
cec_delete_adapter(cec->adap);
|
|
@@ -250,7 +250,7 @@ static int s5p_cec_remove(struct platform_device *pdev)
|
|
{
|
|
struct s5p_cec_dev *cec = platform_get_drvdata(pdev);
|
|
|
|
- cec_notifier_cec_adap_unregister(cec->notifier);
|
|
+ cec_notifier_cec_adap_unregister(cec->notifier, cec->adap);
|
|
cec_unregister_adapter(cec->adap);
|
|
pm_runtime_disable(&pdev->dev);
|
|
return 0;
|
|
diff --git a/drivers/media/platform/seco-cec/seco-cec.c b/drivers/media/platform/seco-cec/seco-cec.c
|
|
index 9cd60fe1867c..54b0d51e9c55 100644
|
|
--- a/drivers/media/platform/seco-cec/seco-cec.c
|
|
+++ b/drivers/media/platform/seco-cec/seco-cec.c
|
|
@@ -671,7 +671,7 @@ static int secocec_probe(struct platform_device *pdev)
|
|
return ret;
|
|
|
|
err_notifier:
|
|
- cec_notifier_cec_adap_unregister(secocec->notifier);
|
|
+ cec_notifier_cec_adap_unregister(secocec->notifier, secocec->cec_adap);
|
|
err_delete_adapter:
|
|
cec_delete_adapter(secocec->cec_adap);
|
|
err:
|
|
@@ -692,7 +692,7 @@ static int secocec_remove(struct platform_device *pdev)
|
|
|
|
dev_dbg(&pdev->dev, "IR disabled");
|
|
}
|
|
- cec_notifier_cec_adap_unregister(secocec->notifier);
|
|
+ cec_notifier_cec_adap_unregister(secocec->notifier, secocec->cec_adap);
|
|
cec_unregister_adapter(secocec->cec_adap);
|
|
|
|
release_region(BRA_SMB_BASE_ADDR, 7);
|
|
diff --git a/drivers/media/platform/sti/cec/stih-cec.c b/drivers/media/platform/sti/cec/stih-cec.c
|
|
index 8118c7365d3f..f0c73e64b586 100644
|
|
--- a/drivers/media/platform/sti/cec/stih-cec.c
|
|
+++ b/drivers/media/platform/sti/cec/stih-cec.c
|
|
@@ -359,7 +359,7 @@ static int stih_cec_probe(struct platform_device *pdev)
|
|
return 0;
|
|
|
|
err_notifier:
|
|
- cec_notifier_cec_adap_unregister(cec->notifier);
|
|
+ cec_notifier_cec_adap_unregister(cec->notifier, cec->adap);
|
|
|
|
err_delete_adapter:
|
|
cec_delete_adapter(cec->adap);
|
|
@@ -370,7 +370,7 @@ static int stih_cec_remove(struct platform_device *pdev)
|
|
{
|
|
struct stih_cec *cec = platform_get_drvdata(pdev);
|
|
|
|
- cec_notifier_cec_adap_unregister(cec->notifier);
|
|
+ cec_notifier_cec_adap_unregister(cec->notifier, cec->adap);
|
|
cec_unregister_adapter(cec->adap);
|
|
|
|
return 0;
|
|
diff --git a/drivers/media/platform/tegra-cec/tegra_cec.c b/drivers/media/platform/tegra-cec/tegra_cec.c
|
|
index a632602131f2..a99caac59f44 100644
|
|
--- a/drivers/media/platform/tegra-cec/tegra_cec.c
|
|
+++ b/drivers/media/platform/tegra-cec/tegra_cec.c
|
|
@@ -409,7 +409,7 @@ static int tegra_cec_probe(struct platform_device *pdev)
|
|
return 0;
|
|
|
|
err_notifier:
|
|
- cec_notifier_cec_adap_unregister(cec->notifier);
|
|
+ cec_notifier_cec_adap_unregister(cec->notifier, cec->adap);
|
|
err_adapter:
|
|
cec_delete_adapter(cec->adap);
|
|
err_clk:
|
|
@@ -423,7 +423,7 @@ static int tegra_cec_remove(struct platform_device *pdev)
|
|
|
|
clk_disable_unprepare(cec->clk);
|
|
|
|
- cec_notifier_cec_adap_unregister(cec->notifier);
|
|
+ cec_notifier_cec_adap_unregister(cec->notifier, cec->adap);
|
|
cec_unregister_adapter(cec->adap);
|
|
|
|
return 0;
|
|
diff --git a/include/media/cec-notifier.h b/include/media/cec-notifier.h
|
|
index f161f8a493ac..985afea1ee36 100644
|
|
--- a/include/media/cec-notifier.h
|
|
+++ b/include/media/cec-notifier.h
|
|
@@ -93,8 +93,10 @@ cec_notifier_cec_adap_register(struct device *hdmi_dev, const char *conn_name,
|
|
* cec_notifier_cec_adap_unregister - decrease refcount and delete when the
|
|
* refcount reaches 0.
|
|
* @n: notifier. If NULL, then this function does nothing.
|
|
+ * @adap: the cec adapter that registered this notifier.
|
|
*/
|
|
-void cec_notifier_cec_adap_unregister(struct cec_notifier *n);
|
|
+void cec_notifier_cec_adap_unregister(struct cec_notifier *n,
|
|
+ struct cec_adapter *adap);
|
|
|
|
/**
|
|
* cec_notifier_set_phys_addr - set a new physical address.
|
|
@@ -160,7 +162,8 @@ cec_notifier_cec_adap_register(struct device *hdmi_dev, const char *conn_name,
|
|
return (struct cec_notifier *)0xdeadfeed;
|
|
}
|
|
|
|
-static inline void cec_notifier_cec_adap_unregister(struct cec_notifier *n)
|
|
+static inline void cec_notifier_cec_adap_unregister(struct cec_notifier *n,
|
|
+ struct cec_adapter *adap)
|
|
{
|
|
}
|
|
|
|
|
|
From 52f95b4aeeb11cedfba0705a005106b0cfd4785f Mon Sep 17 00:00:00 2001
|
|
From: Matthias Kaehlcke <mka@chromium.org>
|
|
Date: Wed, 2 Oct 2019 12:44:06 -0700
|
|
Subject: [PATCH] drm/bridge: dw-hdmi: Refuse DDC/CI transfers on the internal
|
|
I2C controller
|
|
|
|
The DDC/CI protocol involves sending a multi-byte request to the
|
|
display via I2C, which is typically followed by a multi-byte
|
|
response. The internal I2C controller only allows single byte
|
|
reads/writes or reads of 8 sequential bytes, hence DDC/CI is not
|
|
supported when the internal I2C controller is used. The I2C
|
|
transfers complete without errors, however the data in the response
|
|
is garbage. Abort transfers to/from slave address 0x37 (DDC) with
|
|
-EOPNOTSUPP, to make it evident that the communication is failing.
|
|
|
|
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
|
|
Reviewed-by: Douglas Anderson <dianders@chromium.org>
|
|
Reviewed-by: Sean Paul <sean@poorly.run>
|
|
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
|
|
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/20191002124354.v2.1.I709dfec496f5f0b44a7b61dcd4937924da8d8382@changeid
|
|
(cherry picked from commit bee447e224b2645911c5d06e35dc90d8433fcef6)
|
|
---
|
|
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 10 ++++++++++
|
|
1 file changed, 10 insertions(+)
|
|
|
|
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
|
index d77fb8af61b8..a15fbf71b9d7 100644
|
|
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
|
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
|
@@ -37,6 +37,7 @@
|
|
#include "dw-hdmi-cec.h"
|
|
#include "dw-hdmi.h"
|
|
|
|
+#define DDC_CI_ADDR 0x37
|
|
#define DDC_SEGMENT_ADDR 0x30
|
|
|
|
#define HDMI_EDID_LEN 512
|
|
@@ -399,6 +400,15 @@ static int dw_hdmi_i2c_xfer(struct i2c_adapter *adap,
|
|
u8 addr = msgs[0].addr;
|
|
int i, ret = 0;
|
|
|
|
+ if (addr == DDC_CI_ADDR)
|
|
+ /*
|
|
+ * The internal I2C controller does not support the multi-byte
|
|
+ * read and write operations needed for DDC/CI.
|
|
+ * TOFIX: Blacklist the DDC/CI address until we filter out
|
|
+ * unsupported I2C operations.
|
|
+ */
|
|
+ return -EOPNOTSUPP;
|
|
+
|
|
dev_dbg(hdmi->dev, "xfer: num: %d, addr: %#x\n", num, addr);
|
|
|
|
for (i = 0; i < num; i++) {
|
|
|
|
From 70c8f3b12f466b6a53e88f43f7da12ef04cb4ad2 Mon Sep 17 00:00:00 2001
|
|
From: Douglas Anderson <dianders@chromium.org>
|
|
Date: Thu, 3 Oct 2019 11:47:30 -0700
|
|
Subject: [PATCH] drm/rockchip: Round up _before_ giving to the clock framework
|
|
|
|
I'm embarassed to say that even though I've touched
|
|
vop_crtc_mode_fixup() twice and I swear I tested it, there's still a
|
|
stupid glaring bug in it. Specifically, on veyron_minnie (with all
|
|
the latest display timings) we want to be setting our pixel clock to
|
|
66,666,666.67 Hz and we tell userspace that's what we set, but we're
|
|
actually choosing 66,000,000 Hz. This is confirmed by looking at the
|
|
clock tree.
|
|
|
|
The problem is that in drm_display_mode_from_videomode() we convert
|
|
from Hz to kHz with:
|
|
|
|
dmode->clock = vm->pixelclock / 1000;
|
|
|
|
...and drm_display_mode_from_videomode() is called from panel-simple
|
|
when we have an "override_mode" like we do on veyron_minnie. See
|
|
commit 123643e5c40a ("ARM: dts: rockchip: Specify
|
|
rk3288-veyron-minnie's display timings").
|
|
|
|
...so when the device tree specifies a clock of 66666667 for the panel
|
|
then DRM translates that to 66666000. The clock framework will always
|
|
pick a clock that is _lower_ than the one requested, so it will refuse
|
|
to pick 66666667 and we'll end up at 66000000.
|
|
|
|
While we could try to fix drm_display_mode_from_videomode() to round
|
|
to the nearest kHz and it would fix our problem, it wouldn't help if
|
|
the clock we actually needed was 60,000,001 Hz. We could
|
|
alternatively have DRM always round up, but maybe this would break
|
|
someone else who already baked in the assumption that DRM rounds down.
|
|
Specifically note that clock drivers are not consistent about whether
|
|
they round up or round down when you call clk_set_rate(). We know how
|
|
Rockchip's clock driver works, but (for instance) you can see that on
|
|
most Qualcomm clocks the default is clk_rcg2_ops which rounds up.
|
|
|
|
Let's solve this by just adding 999 Hz before calling
|
|
clk_round_rate(). This should be safe and work everywhere. As
|
|
discussed in more detail in comments in the commit, Rockchip's PLLs
|
|
are configured in a way that there shouldn't be another PLL setting
|
|
that is only a few kHz off so we won't get mixed up.
|
|
|
|
NOTE: if this is picked to stable, it's probably easiest to first pick
|
|
commit 527e4ca3b6d1 ("drm/rockchip: Base adjustments of the mode based
|
|
on prev adjustments") which shouldn't hurt in stable.
|
|
|
|
Fixes: b59b8de31497 ("drm/rockchip: return a true clock rate to adjusted_mode")
|
|
Signed-off-by: Douglas Anderson <dianders@chromium.org>
|
|
Reviewed-by: Sean Paul <seanpaul@chromium.org>
|
|
Signed-off-by: Sean Paul <seanpaul@chromium.org>
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/20191003114726.v2.1.Ib233b3e706cf6317858384264d5b0ed35657456e@changeid
|
|
(cherry picked from commit 287422a95fe28e05c1952de0472e0dfdffa6caae)
|
|
---
|
|
drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 37 ++++++++++++++++++++++++++---
|
|
1 file changed, 34 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
|
|
index 613404f86668..84e3decb17b1 100644
|
|
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
|
|
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
|
|
@@ -1040,10 +1040,41 @@ static bool vop_crtc_mode_fixup(struct drm_crtc *crtc,
|
|
struct drm_display_mode *adjusted_mode)
|
|
{
|
|
struct vop *vop = to_vop(crtc);
|
|
+ unsigned long rate;
|
|
|
|
- adjusted_mode->clock =
|
|
- DIV_ROUND_UP(clk_round_rate(vop->dclk,
|
|
- adjusted_mode->clock * 1000), 1000);
|
|
+ /*
|
|
+ * Clock craziness.
|
|
+ *
|
|
+ * Key points:
|
|
+ *
|
|
+ * - DRM works in in kHz.
|
|
+ * - Clock framework works in Hz.
|
|
+ * - Rockchip's clock driver picks the clock rate that is the
|
|
+ * same _OR LOWER_ than the one requested.
|
|
+ *
|
|
+ * Action plan:
|
|
+ *
|
|
+ * 1. When DRM gives us a mode, we should add 999 Hz to it. That way
|
|
+ * if the clock we need is 60000001 Hz (~60 MHz) and DRM tells us to
|
|
+ * make 60000 kHz then the clock framework will actually give us
|
|
+ * the right clock.
|
|
+ *
|
|
+ * NOTE: if the PLL (maybe through a divider) could actually make
|
|
+ * a clock rate 999 Hz higher instead of the one we want then this
|
|
+ * could be a problem. Unfortunately there's not much we can do
|
|
+ * since it's baked into DRM to use kHz. It shouldn't matter in
|
|
+ * practice since Rockchip PLLs are controlled by tables and
|
|
+ * even if there is a divider in the middle I wouldn't expect PLL
|
|
+ * rates in the table that are just a few kHz different.
|
|
+ *
|
|
+ * 2. Get the clock framework to round the rate for us to tell us
|
|
+ * what it will actually make.
|
|
+ *
|
|
+ * 3. Store the rounded up rate so that we don't need to worry about
|
|
+ * this in the actual clk_set_rate().
|
|
+ */
|
|
+ rate = clk_round_rate(vop->dclk, adjusted_mode->clock * 1000 + 999);
|
|
+ adjusted_mode->clock = DIV_ROUND_UP(rate, 1000);
|
|
|
|
return true;
|
|
}
|
|
|
|
From 437d3acd3fdb554710583675d5103f0faf64da28 Mon Sep 17 00:00:00 2001
|
|
From: Jonas Karlman <jonas@kwiboo.se>
|
|
Date: Mon, 7 Oct 2019 19:21:48 +0000
|
|
Subject: [PATCH] drm/bridge: dw-hdmi: Add Dynamic Range and Mastering
|
|
InfoFrame support
|
|
|
|
Add support for configuring Dynamic Range and Mastering InfoFrame from
|
|
the hdr_output_metadata connector property.
|
|
|
|
This patch adds a use_drm_infoframe flag to dw_hdmi_plat_data that platform
|
|
drivers use to signal when Dynamic Range and Mastering infoframes is supported.
|
|
This flag is needed because Amlogic GXBB and GXL report same DW-HDMI version,
|
|
and only GXL support DRM InfoFrame.
|
|
|
|
These changes were based on work done by Zheng Yang <zhengyang@rock-chips.com>
|
|
to support DRM InfoFrame on the Rockchip 4.4 BSP kernel at [1] and [2]
|
|
|
|
[1] https://github.com/rockchip-linux/kernel/tree/develop-4.4
|
|
[2] https://github.com/rockchip-linux/kernel/commit/d1943fde81ff41d7cca87f4a42f03992e90bddd5
|
|
|
|
Cc: Zheng Yang <zhengyang@rock-chips.com>
|
|
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
|
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
|
|
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
|
|
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/HE1PR06MB4011D7B916CBF8B740ACC45FAC9B0@HE1PR06MB4011.eurprd06.prod.outlook.com
|
|
(cherry picked from commit 7cea855922cb6a84d56ee8f12783f5b5e14c6129)
|
|
---
|
|
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 81 +++++++++++++++++++++++++++++++
|
|
drivers/gpu/drm/bridge/synopsys/dw-hdmi.h | 37 ++++++++++++++
|
|
include/drm/bridge/dw_hdmi.h | 1 +
|
|
3 files changed, 119 insertions(+)
|
|
|
|
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
|
index a15fbf71b9d7..fdc29869d75a 100644
|
|
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
|
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
|
@@ -25,6 +25,7 @@
|
|
#include <uapi/linux/videodev2.h>
|
|
|
|
#include <drm/bridge/dw_hdmi.h>
|
|
+#include <drm/drm_atomic.h>
|
|
#include <drm/drm_atomic_helper.h>
|
|
#include <drm/drm_bridge.h>
|
|
#include <drm/drm_edid.h>
|
|
@@ -1743,6 +1744,41 @@ static void hdmi_config_vendor_specific_infoframe(struct dw_hdmi *hdmi,
|
|
HDMI_FC_DATAUTO0_VSD_MASK);
|
|
}
|
|
|
|
+static void hdmi_config_drm_infoframe(struct dw_hdmi *hdmi)
|
|
+{
|
|
+ const struct drm_connector_state *conn_state = hdmi->connector.state;
|
|
+ struct hdmi_drm_infoframe frame;
|
|
+ u8 buffer[30];
|
|
+ ssize_t err;
|
|
+ int i;
|
|
+
|
|
+ if (!hdmi->plat_data->use_drm_infoframe)
|
|
+ return;
|
|
+
|
|
+ hdmi_modb(hdmi, HDMI_FC_PACKET_TX_EN_DRM_DISABLE,
|
|
+ HDMI_FC_PACKET_TX_EN_DRM_MASK, HDMI_FC_PACKET_TX_EN);
|
|
+
|
|
+ err = drm_hdmi_infoframe_set_hdr_metadata(&frame, conn_state);
|
|
+ if (err < 0)
|
|
+ return;
|
|
+
|
|
+ err = hdmi_drm_infoframe_pack(&frame, buffer, sizeof(buffer));
|
|
+ if (err < 0) {
|
|
+ dev_err(hdmi->dev, "Failed to pack drm infoframe: %zd\n", err);
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ hdmi_writeb(hdmi, frame.version, HDMI_FC_DRM_HB0);
|
|
+ hdmi_writeb(hdmi, frame.length, HDMI_FC_DRM_HB1);
|
|
+
|
|
+ for (i = 0; i < frame.length; i++)
|
|
+ hdmi_writeb(hdmi, buffer[4 + i], HDMI_FC_DRM_PB0 + i);
|
|
+
|
|
+ hdmi_writeb(hdmi, 1, HDMI_FC_DRM_UP);
|
|
+ hdmi_modb(hdmi, HDMI_FC_PACKET_TX_EN_DRM_ENABLE,
|
|
+ HDMI_FC_PACKET_TX_EN_DRM_MASK, HDMI_FC_PACKET_TX_EN);
|
|
+}
|
|
+
|
|
static void hdmi_av_composer(struct dw_hdmi *hdmi,
|
|
const struct drm_display_mode *mode)
|
|
{
|
|
@@ -2064,6 +2100,7 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode)
|
|
/* HDMI Initialization Step F - Configure AVI InfoFrame */
|
|
hdmi_config_AVI(hdmi, mode);
|
|
hdmi_config_vendor_specific_infoframe(hdmi, mode);
|
|
+ hdmi_config_drm_infoframe(hdmi);
|
|
} else {
|
|
dev_dbg(hdmi->dev, "%s DVI mode\n", __func__);
|
|
}
|
|
@@ -2230,6 +2267,45 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
|
|
return ret;
|
|
}
|
|
|
|
+static bool hdr_metadata_equal(const struct drm_connector_state *old_state,
|
|
+ const struct drm_connector_state *new_state)
|
|
+{
|
|
+ struct drm_property_blob *old_blob = old_state->hdr_output_metadata;
|
|
+ struct drm_property_blob *new_blob = new_state->hdr_output_metadata;
|
|
+
|
|
+ if (!old_blob || !new_blob)
|
|
+ return old_blob == new_blob;
|
|
+
|
|
+ if (old_blob->length != new_blob->length)
|
|
+ return false;
|
|
+
|
|
+ return !memcmp(old_blob->data, new_blob->data, old_blob->length);
|
|
+}
|
|
+
|
|
+static int dw_hdmi_connector_atomic_check(struct drm_connector *connector,
|
|
+ struct drm_atomic_state *state)
|
|
+{
|
|
+ struct drm_connector_state *old_state =
|
|
+ drm_atomic_get_old_connector_state(state, connector);
|
|
+ struct drm_connector_state *new_state =
|
|
+ drm_atomic_get_new_connector_state(state, connector);
|
|
+ struct drm_crtc *crtc = new_state->crtc;
|
|
+ struct drm_crtc_state *crtc_state;
|
|
+
|
|
+ if (!crtc)
|
|
+ return 0;
|
|
+
|
|
+ if (!hdr_metadata_equal(old_state, new_state)) {
|
|
+ crtc_state = drm_atomic_get_crtc_state(state, crtc);
|
|
+ if (IS_ERR(crtc_state))
|
|
+ return PTR_ERR(crtc_state);
|
|
+
|
|
+ crtc_state->mode_changed = true;
|
|
+ }
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
static void dw_hdmi_connector_force(struct drm_connector *connector)
|
|
{
|
|
struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi,
|
|
@@ -2254,6 +2330,7 @@ static const struct drm_connector_funcs dw_hdmi_connector_funcs = {
|
|
|
|
static const struct drm_connector_helper_funcs dw_hdmi_connector_helper_funcs = {
|
|
.get_modes = dw_hdmi_connector_get_modes,
|
|
+ .atomic_check = dw_hdmi_connector_atomic_check,
|
|
};
|
|
|
|
static int dw_hdmi_bridge_attach(struct drm_bridge *bridge)
|
|
@@ -2274,6 +2351,10 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge)
|
|
DRM_MODE_CONNECTOR_HDMIA,
|
|
hdmi->ddc);
|
|
|
|
+ if (hdmi->version >= 0x200a && hdmi->plat_data->use_drm_infoframe)
|
|
+ drm_object_attach_property(&connector->base,
|
|
+ connector->dev->mode_config.hdr_output_metadata_property, 0);
|
|
+
|
|
drm_connector_attach_encoder(connector, encoder);
|
|
|
|
cec_fill_conn_info_from_drm(&conn_info, connector);
|
|
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h
|
|
index fcff5059db24..1999db05bc3b 100644
|
|
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h
|
|
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h
|
|
@@ -254,6 +254,7 @@
|
|
#define HDMI_FC_POL2 0x10DB
|
|
#define HDMI_FC_PRCONF 0x10E0
|
|
#define HDMI_FC_SCRAMBLER_CTRL 0x10E1
|
|
+#define HDMI_FC_PACKET_TX_EN 0x10E3
|
|
|
|
#define HDMI_FC_GMD_STAT 0x1100
|
|
#define HDMI_FC_GMD_EN 0x1101
|
|
@@ -289,6 +290,37 @@
|
|
#define HDMI_FC_GMD_PB26 0x111F
|
|
#define HDMI_FC_GMD_PB27 0x1120
|
|
|
|
+#define HDMI_FC_DRM_UP 0x1167
|
|
+#define HDMI_FC_DRM_HB0 0x1168
|
|
+#define HDMI_FC_DRM_HB1 0x1169
|
|
+#define HDMI_FC_DRM_PB0 0x116A
|
|
+#define HDMI_FC_DRM_PB1 0x116B
|
|
+#define HDMI_FC_DRM_PB2 0x116C
|
|
+#define HDMI_FC_DRM_PB3 0x116D
|
|
+#define HDMI_FC_DRM_PB4 0x116E
|
|
+#define HDMI_FC_DRM_PB5 0x116F
|
|
+#define HDMI_FC_DRM_PB6 0x1170
|
|
+#define HDMI_FC_DRM_PB7 0x1171
|
|
+#define HDMI_FC_DRM_PB8 0x1172
|
|
+#define HDMI_FC_DRM_PB9 0x1173
|
|
+#define HDMI_FC_DRM_PB10 0x1174
|
|
+#define HDMI_FC_DRM_PB11 0x1175
|
|
+#define HDMI_FC_DRM_PB12 0x1176
|
|
+#define HDMI_FC_DRM_PB13 0x1177
|
|
+#define HDMI_FC_DRM_PB14 0x1178
|
|
+#define HDMI_FC_DRM_PB15 0x1179
|
|
+#define HDMI_FC_DRM_PB16 0x117A
|
|
+#define HDMI_FC_DRM_PB17 0x117B
|
|
+#define HDMI_FC_DRM_PB18 0x117C
|
|
+#define HDMI_FC_DRM_PB19 0x117D
|
|
+#define HDMI_FC_DRM_PB20 0x117E
|
|
+#define HDMI_FC_DRM_PB21 0x117F
|
|
+#define HDMI_FC_DRM_PB22 0x1180
|
|
+#define HDMI_FC_DRM_PB23 0x1181
|
|
+#define HDMI_FC_DRM_PB24 0x1182
|
|
+#define HDMI_FC_DRM_PB25 0x1183
|
|
+#define HDMI_FC_DRM_PB26 0x1184
|
|
+
|
|
#define HDMI_FC_DBGFORCE 0x1200
|
|
#define HDMI_FC_DBGAUD0CH0 0x1201
|
|
#define HDMI_FC_DBGAUD1CH0 0x1202
|
|
@@ -744,6 +776,11 @@ enum {
|
|
HDMI_FC_PRCONF_OUTPUT_PR_FACTOR_MASK = 0x0F,
|
|
HDMI_FC_PRCONF_OUTPUT_PR_FACTOR_OFFSET = 0,
|
|
|
|
+/* FC_PACKET_TX_EN field values */
|
|
+ HDMI_FC_PACKET_TX_EN_DRM_MASK = 0x80,
|
|
+ HDMI_FC_PACKET_TX_EN_DRM_ENABLE = 0x80,
|
|
+ HDMI_FC_PACKET_TX_EN_DRM_DISABLE = 0x00,
|
|
+
|
|
/* FC_AVICONF0-FC_AVICONF3 field values */
|
|
HDMI_FC_AVICONF0_PIX_FMT_MASK = 0x03,
|
|
HDMI_FC_AVICONF0_PIX_FMT_RGB = 0x00,
|
|
diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
|
|
index 4b3e863c4f8a..fbf3812c4326 100644
|
|
--- a/include/drm/bridge/dw_hdmi.h
|
|
+++ b/include/drm/bridge/dw_hdmi.h
|
|
@@ -126,6 +126,7 @@ struct dw_hdmi_plat_data {
|
|
const struct drm_display_mode *mode);
|
|
unsigned long input_bus_format;
|
|
unsigned long input_bus_encoding;
|
|
+ bool use_drm_infoframe;
|
|
|
|
/* Vendor PHY support */
|
|
const struct dw_hdmi_phy_ops *phy_ops;
|
|
|
|
From d0a3c7039d1c5dde1a928506936dad4cac412d55 Mon Sep 17 00:00:00 2001
|
|
From: Jonas Karlman <jonas@kwiboo.se>
|
|
Date: Mon, 7 Oct 2019 19:21:49 +0000
|
|
Subject: [PATCH] drm/rockchip: Enable DRM InfoFrame support on RK3328 and
|
|
RK3399
|
|
|
|
This patch enables Dynamic Range and Mastering InfoFrame on RK3328 and RK3399.
|
|
|
|
Cc: Sandy Huang <hjc@rock-chips.com>
|
|
Cc: Heiko Stuebner <heiko@sntech.de>
|
|
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
|
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
|
|
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
|
|
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/HE1PR06MB4011C9579CA6BBCD96C87810AC9B0@HE1PR06MB4011.eurprd06.prod.outlook.com
|
|
(cherry picked from commit 1bf95915a878b7041aa915558d76c579f61e2a0f)
|
|
---
|
|
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 2 ++
|
|
1 file changed, 2 insertions(+)
|
|
|
|
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
|
|
index 906891b03a38..7f56d8c3491d 100644
|
|
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
|
|
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
|
|
@@ -450,6 +450,7 @@ static const struct dw_hdmi_plat_data rk3328_hdmi_drv_data = {
|
|
.phy_ops = &rk3328_hdmi_phy_ops,
|
|
.phy_name = "inno_dw_hdmi_phy2",
|
|
.phy_force_vendor = true,
|
|
+ .use_drm_infoframe = true,
|
|
};
|
|
|
|
static struct rockchip_hdmi_chip_data rk3399_chip_data = {
|
|
@@ -464,6 +465,7 @@ static const struct dw_hdmi_plat_data rk3399_hdmi_drv_data = {
|
|
.cur_ctr = rockchip_cur_ctr,
|
|
.phy_config = rockchip_phy_config,
|
|
.phy_data = &rk3399_chip_data,
|
|
+ .use_drm_infoframe = true,
|
|
};
|
|
|
|
static const struct of_device_id dw_hdmi_rockchip_dt_ids[] = {
|
|
|
|
From d2d4d7a4779465c7ddd655b31cdf86bfb13b01a9 Mon Sep 17 00:00:00 2001
|
|
From: Heiko Stuebner <heiko@sntech.de>
|
|
Date: Wed, 22 Aug 2018 14:09:25 +0200
|
|
Subject: [PATCH] arm64: dts: rockchip: add cr50 tpm to rk3399-gru scarlet and
|
|
bob
|
|
|
|
Scarlet and Bob use the Google-developed cr50 chip to do things
|
|
like TPM and closed-case-debugging.
|
|
|
|
Add the nodes describing the cr50 and its spi-connection.
|
|
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Link: https://lore.kernel.org/r/20180822120925.12388-1-heiko@sntech.de
|
|
(cherry picked from commit 87d8ae980e1944331f93e0488e16bd3bec4554c7)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/rk3399-gru-bob.dts | 10 ++++++++++
|
|
arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet.dtsi | 10 ++++++++++
|
|
2 files changed, 20 insertions(+)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru-bob.dts b/arch/arm64/boot/dts/rockchip/rk3399-gru-bob.dts
|
|
index a9f4d6d7d2b7..9dd3b171e91d 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru-bob.dts
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru-bob.dts
|
|
@@ -68,6 +68,16 @@
|
|
|
|
&spi0 {
|
|
status = "okay";
|
|
+
|
|
+ cr50@0 {
|
|
+ compatible = "google,cr50";
|
|
+ reg = <0>;
|
|
+ interrupt-parent = <&gpio0>;
|
|
+ interrupts = <5 IRQ_TYPE_EDGE_RISING>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&h1_int_od_l>;
|
|
+ spi-max-frequency = <800000>;
|
|
+ };
|
|
};
|
|
|
|
&pinctrl {
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet.dtsi
|
|
index 50dfab51f175..4373ed732af7 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet.dtsi
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet.dtsi
|
|
@@ -436,6 +436,16 @@ camera: &i2c7 {
|
|
|
|
&spi2 {
|
|
status = "okay";
|
|
+
|
|
+ cr50@0 {
|
|
+ compatible = "google,cr50";
|
|
+ reg = <0>;
|
|
+ interrupt-parent = <&gpio1>;
|
|
+ interrupts = <17 IRQ_TYPE_EDGE_RISING>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&h1_int_od_l>;
|
|
+ spi-max-frequency = <800000>;
|
|
+ };
|
|
};
|
|
|
|
&usb_host0_ohci {
|
|
|
|
From a6f02ccfe0df3768471f55eda4a8c173315008ad Mon Sep 17 00:00:00 2001
|
|
From: Matthias Kaehlcke <mka@chromium.org>
|
|
Date: Thu, 3 Oct 2019 09:41:52 -0700
|
|
Subject: [PATCH] ARM: dts: rockchip: Use interpolated brightness tables for
|
|
veyron
|
|
|
|
Use interpolated brightness tables (added by commit 573fe6d1c25
|
|
("backlight: pwm_bl: Linear interpolation between
|
|
brightness-levels") for veyron, instead of specifying every single
|
|
step. Some devices/panels have intervals that are smaller than
|
|
the specified 'num-interpolated-steps', the driver interprets
|
|
these intervals as a single step.
|
|
|
|
Another option would be to switch to a perceptual brightness curve
|
|
(CIE 1931), with the caveat that it would change the behavior of
|
|
the backlight. Also the concept of a minimum brightness level is
|
|
currently not supported for CIE 1931 curves.
|
|
|
|
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
|
|
Reviewed-by: Douglas Anderson <dianders@chromium.org>
|
|
Link: https://lore.kernel.org/r/20191003094137.v2.1.Ic9fd698810ea569c465350154da40b85d24f805b@changeid
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit 6233269bce47bd450196a671ab28eb1ec5eb88d9)
|
|
---
|
|
arch/arm/boot/dts/rk3288-veyron-edp.dtsi | 35 ++----------------------------
|
|
arch/arm/boot/dts/rk3288-veyron-jaq.dts | 35 ++----------------------------
|
|
arch/arm/boot/dts/rk3288-veyron-minnie.dts | 35 ++----------------------------
|
|
arch/arm/boot/dts/rk3288-veyron-tiger.dts | 35 ++----------------------------
|
|
4 files changed, 8 insertions(+), 132 deletions(-)
|
|
|
|
diff --git a/arch/arm/boot/dts/rk3288-veyron-edp.dtsi b/arch/arm/boot/dts/rk3288-veyron-edp.dtsi
|
|
index b12e061c5f7f..300a7e32c978 100644
|
|
--- a/arch/arm/boot/dts/rk3288-veyron-edp.dtsi
|
|
+++ b/arch/arm/boot/dts/rk3288-veyron-edp.dtsi
|
|
@@ -41,39 +41,8 @@
|
|
|
|
backlight: backlight {
|
|
compatible = "pwm-backlight";
|
|
- brightness-levels = <
|
|
- 0 1 2 3 4 5 6 7
|
|
- 8 9 10 11 12 13 14 15
|
|
- 16 17 18 19 20 21 22 23
|
|
- 24 25 26 27 28 29 30 31
|
|
- 32 33 34 35 36 37 38 39
|
|
- 40 41 42 43 44 45 46 47
|
|
- 48 49 50 51 52 53 54 55
|
|
- 56 57 58 59 60 61 62 63
|
|
- 64 65 66 67 68 69 70 71
|
|
- 72 73 74 75 76 77 78 79
|
|
- 80 81 82 83 84 85 86 87
|
|
- 88 89 90 91 92 93 94 95
|
|
- 96 97 98 99 100 101 102 103
|
|
- 104 105 106 107 108 109 110 111
|
|
- 112 113 114 115 116 117 118 119
|
|
- 120 121 122 123 124 125 126 127
|
|
- 128 129 130 131 132 133 134 135
|
|
- 136 137 138 139 140 141 142 143
|
|
- 144 145 146 147 148 149 150 151
|
|
- 152 153 154 155 156 157 158 159
|
|
- 160 161 162 163 164 165 166 167
|
|
- 168 169 170 171 172 173 174 175
|
|
- 176 177 178 179 180 181 182 183
|
|
- 184 185 186 187 188 189 190 191
|
|
- 192 193 194 195 196 197 198 199
|
|
- 200 201 202 203 204 205 206 207
|
|
- 208 209 210 211 212 213 214 215
|
|
- 216 217 218 219 220 221 222 223
|
|
- 224 225 226 227 228 229 230 231
|
|
- 232 233 234 235 236 237 238 239
|
|
- 240 241 242 243 244 245 246 247
|
|
- 248 249 250 251 252 253 254 255>;
|
|
+ brightness-levels = <0 255>;
|
|
+ num-interpolated-steps = <255>;
|
|
default-brightness-level = <128>;
|
|
enable-gpios = <&gpio7 RK_PA2 GPIO_ACTIVE_HIGH>;
|
|
pinctrl-names = "default";
|
|
diff --git a/arch/arm/boot/dts/rk3288-veyron-jaq.dts b/arch/arm/boot/dts/rk3288-veyron-jaq.dts
|
|
index 80386203e85b..a4966e505a2f 100644
|
|
--- a/arch/arm/boot/dts/rk3288-veyron-jaq.dts
|
|
+++ b/arch/arm/boot/dts/rk3288-veyron-jaq.dts
|
|
@@ -20,39 +20,8 @@
|
|
|
|
&backlight {
|
|
/* Jaq panel PWM must be >= 3%, so start non-zero brightness at 8 */
|
|
- brightness-levels = <
|
|
- 0
|
|
- 8 9 10 11 12 13 14 15
|
|
- 16 17 18 19 20 21 22 23
|
|
- 24 25 26 27 28 29 30 31
|
|
- 32 33 34 35 36 37 38 39
|
|
- 40 41 42 43 44 45 46 47
|
|
- 48 49 50 51 52 53 54 55
|
|
- 56 57 58 59 60 61 62 63
|
|
- 64 65 66 67 68 69 70 71
|
|
- 72 73 74 75 76 77 78 79
|
|
- 80 81 82 83 84 85 86 87
|
|
- 88 89 90 91 92 93 94 95
|
|
- 96 97 98 99 100 101 102 103
|
|
- 104 105 106 107 108 109 110 111
|
|
- 112 113 114 115 116 117 118 119
|
|
- 120 121 122 123 124 125 126 127
|
|
- 128 129 130 131 132 133 134 135
|
|
- 136 137 138 139 140 141 142 143
|
|
- 144 145 146 147 148 149 150 151
|
|
- 152 153 154 155 156 157 158 159
|
|
- 160 161 162 163 164 165 166 167
|
|
- 168 169 170 171 172 173 174 175
|
|
- 176 177 178 179 180 181 182 183
|
|
- 184 185 186 187 188 189 190 191
|
|
- 192 193 194 195 196 197 198 199
|
|
- 200 201 202 203 204 205 206 207
|
|
- 208 209 210 211 212 213 214 215
|
|
- 216 217 218 219 220 221 222 223
|
|
- 224 225 226 227 228 229 230 231
|
|
- 232 233 234 235 236 237 238 239
|
|
- 240 241 242 243 244 245 246 247
|
|
- 248 249 250 251 252 253 254 255>;
|
|
+ brightness-levels = <0 8 255>;
|
|
+ num-interpolated-steps = <247>;
|
|
};
|
|
|
|
&rk808 {
|
|
diff --git a/arch/arm/boot/dts/rk3288-veyron-minnie.dts b/arch/arm/boot/dts/rk3288-veyron-minnie.dts
|
|
index 55955b082501..c833716dbe48 100644
|
|
--- a/arch/arm/boot/dts/rk3288-veyron-minnie.dts
|
|
+++ b/arch/arm/boot/dts/rk3288-veyron-minnie.dts
|
|
@@ -38,39 +38,8 @@
|
|
|
|
&backlight {
|
|
/* Minnie panel PWM must be >= 1%, so start non-zero brightness at 3 */
|
|
- brightness-levels = <
|
|
- 0 3 4 5 6 7
|
|
- 8 9 10 11 12 13 14 15
|
|
- 16 17 18 19 20 21 22 23
|
|
- 24 25 26 27 28 29 30 31
|
|
- 32 33 34 35 36 37 38 39
|
|
- 40 41 42 43 44 45 46 47
|
|
- 48 49 50 51 52 53 54 55
|
|
- 56 57 58 59 60 61 62 63
|
|
- 64 65 66 67 68 69 70 71
|
|
- 72 73 74 75 76 77 78 79
|
|
- 80 81 82 83 84 85 86 87
|
|
- 88 89 90 91 92 93 94 95
|
|
- 96 97 98 99 100 101 102 103
|
|
- 104 105 106 107 108 109 110 111
|
|
- 112 113 114 115 116 117 118 119
|
|
- 120 121 122 123 124 125 126 127
|
|
- 128 129 130 131 132 133 134 135
|
|
- 136 137 138 139 140 141 142 143
|
|
- 144 145 146 147 148 149 150 151
|
|
- 152 153 154 155 156 157 158 159
|
|
- 160 161 162 163 164 165 166 167
|
|
- 168 169 170 171 172 173 174 175
|
|
- 176 177 178 179 180 181 182 183
|
|
- 184 185 186 187 188 189 190 191
|
|
- 192 193 194 195 196 197 198 199
|
|
- 200 201 202 203 204 205 206 207
|
|
- 208 209 210 211 212 213 214 215
|
|
- 216 217 218 219 220 221 222 223
|
|
- 224 225 226 227 228 229 230 231
|
|
- 232 233 234 235 236 237 238 239
|
|
- 240 241 242 243 244 245 246 247
|
|
- 248 249 250 251 252 253 254 255>;
|
|
+ brightness-levels = <0 3 255>;
|
|
+ num-interpolated-steps = <252>;
|
|
};
|
|
|
|
&i2c_tunnel {
|
|
diff --git a/arch/arm/boot/dts/rk3288-veyron-tiger.dts b/arch/arm/boot/dts/rk3288-veyron-tiger.dts
|
|
index 27557203ae33..bebb230e592f 100644
|
|
--- a/arch/arm/boot/dts/rk3288-veyron-tiger.dts
|
|
+++ b/arch/arm/boot/dts/rk3288-veyron-tiger.dts
|
|
@@ -23,39 +23,8 @@
|
|
|
|
&backlight {
|
|
/* Tiger panel PWM must be >= 1%, so start non-zero brightness at 3 */
|
|
- brightness-levels = <
|
|
- 0 3 4 5 6 7
|
|
- 8 9 10 11 12 13 14 15
|
|
- 16 17 18 19 20 21 22 23
|
|
- 24 25 26 27 28 29 30 31
|
|
- 32 33 34 35 36 37 38 39
|
|
- 40 41 42 43 44 45 46 47
|
|
- 48 49 50 51 52 53 54 55
|
|
- 56 57 58 59 60 61 62 63
|
|
- 64 65 66 67 68 69 70 71
|
|
- 72 73 74 75 76 77 78 79
|
|
- 80 81 82 83 84 85 86 87
|
|
- 88 89 90 91 92 93 94 95
|
|
- 96 97 98 99 100 101 102 103
|
|
- 104 105 106 107 108 109 110 111
|
|
- 112 113 114 115 116 117 118 119
|
|
- 120 121 122 123 124 125 126 127
|
|
- 128 129 130 131 132 133 134 135
|
|
- 136 137 138 139 140 141 142 143
|
|
- 144 145 146 147 148 149 150 151
|
|
- 152 153 154 155 156 157 158 159
|
|
- 160 161 162 163 164 165 166 167
|
|
- 168 169 170 171 172 173 174 175
|
|
- 176 177 178 179 180 181 182 183
|
|
- 184 185 186 187 188 189 190 191
|
|
- 192 193 194 195 196 197 198 199
|
|
- 200 201 202 203 204 205 206 207
|
|
- 208 209 210 211 212 213 214 215
|
|
- 216 217 218 219 220 221 222 223
|
|
- 224 225 226 227 228 229 230 231
|
|
- 232 233 234 235 236 237 238 239
|
|
- 240 241 242 243 244 245 246 247
|
|
- 248 249 250 251 252 253 254 255>;
|
|
+ brightness-levels = <0 3 255>;
|
|
+ num-interpolated-steps = <252>;
|
|
};
|
|
|
|
&backlight_regulator {
|
|
|
|
From 680c187b3fc4d25d40d1bdee7d0565017adf3fbb Mon Sep 17 00:00:00 2001
|
|
From: Robin Murphy <robin.murphy@arm.com>
|
|
Date: Mon, 7 Oct 2019 12:33:25 +0100
|
|
Subject: [PATCH] arm64: dts: rockchip: Enable nanopi4 HDMI audio
|
|
|
|
All the nanopi4 boards have HDMI, so let them make noise on it.
|
|
|
|
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
|
|
Link: https://lore.kernel.org/r/7fe6e94e4b9f5986f19f2637b7b716f0cb54de1b.1570444701.git.robin.murphy@arm.com
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit f94ffd95cb7699ec424e856d42f03b12d67f71a4)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi | 8 ++++++++
|
|
1 file changed, 8 insertions(+)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi
|
|
index dd16c80d923e..3bd4cbf9cf4a 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi
|
|
@@ -184,6 +184,10 @@
|
|
status = "okay";
|
|
};
|
|
|
|
+&hdmi_sound {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
&i2c0 {
|
|
clock-frequency = <400000>;
|
|
i2c-scl-rising-time-ns = <160>;
|
|
@@ -459,6 +463,10 @@
|
|
status = "okay";
|
|
};
|
|
|
|
+&i2s2 {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
&io_domains {
|
|
bt656-supply = <&vcc_1v8>;
|
|
audio-supply = <&vcca1v8_codec>;
|
|
|
|
From ccee421a922425245fd2276deb59f3d9acb30db1 Mon Sep 17 00:00:00 2001
|
|
From: Robin Murphy <robin.murphy@arm.com>
|
|
Date: Mon, 7 Oct 2019 12:33:26 +0100
|
|
Subject: [PATCH] arm64: dts: rockchip: Update nanopi4 phy reset properties
|
|
|
|
Use the now-preferred generic phy reset properties instead of the
|
|
dwmac-specific ones.
|
|
|
|
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
|
|
Link: https://lore.kernel.org/r/4d16c24ae3651a2119cf5bb1213f46a9fce4b39a.1570444773.git.robin.murphy@arm.com
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit bc43cee88aa128c32239a87c523af7c531589f6d)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi | 6 +++---
|
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi
|
|
index 3bd4cbf9cf4a..b788ae4f47f0 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi
|
|
@@ -152,9 +152,6 @@
|
|
phy-handle = <&rtl8211e>;
|
|
phy-mode = "rgmii";
|
|
phy-supply = <&vcc3v3_s3>;
|
|
- snps,reset-active-low;
|
|
- snps,reset-delays-us = <0 10000 30000>;
|
|
- snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
|
|
tx_delay = <0x28>;
|
|
rx_delay = <0x11>;
|
|
status = "okay";
|
|
@@ -168,6 +165,9 @@
|
|
reg = <1>;
|
|
interrupt-parent = <&gpio3>;
|
|
interrupts = <RK_PB2 IRQ_TYPE_LEVEL_LOW>;
|
|
+ reset-assert-us = <10000>;
|
|
+ reset-deassert-us = <30000>;
|
|
+ reset-gpios = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
|
|
};
|
|
};
|
|
};
|
|
|
|
From 3acc3f8f5dc166c722e0898c73acc83c2e391374 Mon Sep 17 00:00:00 2001
|
|
From: Ezequiel Garcia <ezequiel@collabora.com>
|
|
Date: Thu, 10 Oct 2019 16:43:49 -0300
|
|
Subject: [PATCH] dt-bindings: display: rockchip: document VOP gamma LUT
|
|
address
|
|
|
|
Add the register specifier description for an
|
|
optional gamma LUT address.
|
|
|
|
Reviewed-by: Douglas Anderson <dianders@chromium.org>
|
|
Reviewed-by: Rob Herring <robh@kernel.org>
|
|
Tested-by: Heiko Stuebner <heiko@sntech.de>
|
|
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
|
|
Signed-off-by: Sean Paul <seanpaul@chromium.org>
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/20191010194351.17940-2-ezequiel@collabora.com
|
|
(cherry picked from commit 2804b799c35272031088abc6b0f74238e61f8afd)
|
|
---
|
|
Documentation/devicetree/bindings/display/rockchip/rockchip-vop.txt | 6 +++++-
|
|
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/Documentation/devicetree/bindings/display/rockchip/rockchip-vop.txt b/Documentation/devicetree/bindings/display/rockchip/rockchip-vop.txt
|
|
index 4f58c5a2d195..8b3a5f514205 100644
|
|
--- a/Documentation/devicetree/bindings/display/rockchip/rockchip-vop.txt
|
|
+++ b/Documentation/devicetree/bindings/display/rockchip/rockchip-vop.txt
|
|
@@ -20,6 +20,10 @@ Required properties:
|
|
"rockchip,rk3228-vop";
|
|
"rockchip,rk3328-vop";
|
|
|
|
+- reg: Must contain one entry corresponding to the base address and length
|
|
+ of the register space. Can optionally contain a second entry
|
|
+ corresponding to the CRTC gamma LUT address.
|
|
+
|
|
- interrupts: should contain a list of all VOP IP block interrupts in the
|
|
order: VSYNC, LCD_SYSTEM. The interrupt specifier
|
|
format depends on the interrupt controller used.
|
|
@@ -48,7 +52,7 @@ Example:
|
|
SoC specific DT entry:
|
|
vopb: vopb@ff930000 {
|
|
compatible = "rockchip,rk3288-vop";
|
|
- reg = <0xff930000 0x19c>;
|
|
+ reg = <0x0 0xff930000 0x0 0x19c>, <0x0 0xff931000 0x0 0x1000>;
|
|
interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
|
|
clocks = <&cru ACLK_VOP0>, <&cru DCLK_VOP0>, <&cru HCLK_VOP0>;
|
|
clock-names = "aclk_vop", "dclk_vop", "hclk_vop";
|
|
|
|
From 09bb879683a5f531837aa6381d3034b9e1d7c39e Mon Sep 17 00:00:00 2001
|
|
From: Ezequiel Garcia <ezequiel@collabora.com>
|
|
Date: Thu, 10 Oct 2019 16:43:50 -0300
|
|
Subject: [PATCH] drm/rockchip: Add optional support for CRTC gamma LUT
|
|
|
|
Add an optional CRTC gamma LUT support, and enable it on RK3288.
|
|
This is currently enabled via a separate address resource,
|
|
which needs to be specified in the devicetree.
|
|
|
|
The address resource is required because on some SoCs, such as
|
|
RK3288, the LUT address is after the MMU address, and the latter
|
|
is supported by a different driver. This prevents the DRM driver
|
|
from requesting an entire register space.
|
|
|
|
The current implementation works for RGB 10-bit tables, as that
|
|
is what seems to work on RK3288.
|
|
|
|
Tested-by: Heiko Stuebner <heiko@sntech.de>
|
|
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
|
|
Signed-off-by: Sean Paul <seanpaul@chromium.org>
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/20191010194351.17940-3-ezequiel@collabora.com
|
|
(cherry picked from commit b23ab6ac6d768f9d5b03b5a67bf48a6be6e1dcce)
|
|
---
|
|
drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 120 ++++++++++++++++++++++++++++
|
|
drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 2 +
|
|
drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 2 +
|
|
3 files changed, 124 insertions(+)
|
|
|
|
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
|
|
index 84e3decb17b1..65eb4a1ddbfa 100644
|
|
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
|
|
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
|
|
@@ -139,6 +139,7 @@ struct vop {
|
|
|
|
uint32_t *regsbak;
|
|
void __iomem *regs;
|
|
+ void __iomem *lut_regs;
|
|
|
|
/* physical map length of vop register */
|
|
uint32_t len;
|
|
@@ -1079,6 +1080,79 @@ static bool vop_crtc_mode_fixup(struct drm_crtc *crtc,
|
|
return true;
|
|
}
|
|
|
|
+static bool vop_dsp_lut_is_enabled(struct vop *vop)
|
|
+{
|
|
+ return vop_read_reg(vop, 0, &vop->data->common->dsp_lut_en);
|
|
+}
|
|
+
|
|
+static void vop_crtc_write_gamma_lut(struct vop *vop, struct drm_crtc *crtc)
|
|
+{
|
|
+ struct drm_color_lut *lut = crtc->state->gamma_lut->data;
|
|
+ unsigned int i;
|
|
+
|
|
+ for (i = 0; i < crtc->gamma_size; i++) {
|
|
+ u32 word;
|
|
+
|
|
+ word = (drm_color_lut_extract(lut[i].red, 10) << 20) |
|
|
+ (drm_color_lut_extract(lut[i].green, 10) << 10) |
|
|
+ drm_color_lut_extract(lut[i].blue, 10);
|
|
+ writel(word, vop->lut_regs + i * 4);
|
|
+ }
|
|
+}
|
|
+
|
|
+static void vop_crtc_gamma_set(struct vop *vop, struct drm_crtc *crtc,
|
|
+ struct drm_crtc_state *old_state)
|
|
+{
|
|
+ struct drm_crtc_state *state = crtc->state;
|
|
+ unsigned int idle;
|
|
+ int ret;
|
|
+
|
|
+ if (!vop->lut_regs)
|
|
+ return;
|
|
+ /*
|
|
+ * To disable gamma (gamma_lut is null) or to write
|
|
+ * an update to the LUT, clear dsp_lut_en.
|
|
+ */
|
|
+ spin_lock(&vop->reg_lock);
|
|
+ VOP_REG_SET(vop, common, dsp_lut_en, 0);
|
|
+ vop_cfg_done(vop);
|
|
+ spin_unlock(&vop->reg_lock);
|
|
+
|
|
+ /*
|
|
+ * In order to write the LUT to the internal memory,
|
|
+ * we need to first make sure the dsp_lut_en bit is cleared.
|
|
+ */
|
|
+ ret = readx_poll_timeout(vop_dsp_lut_is_enabled, vop,
|
|
+ idle, !idle, 5, 30 * 1000);
|
|
+ if (ret) {
|
|
+ DRM_DEV_ERROR(vop->dev, "display LUT RAM enable timeout!\n");
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ if (!state->gamma_lut)
|
|
+ return;
|
|
+
|
|
+ spin_lock(&vop->reg_lock);
|
|
+ vop_crtc_write_gamma_lut(vop, crtc);
|
|
+ VOP_REG_SET(vop, common, dsp_lut_en, 1);
|
|
+ vop_cfg_done(vop);
|
|
+ spin_unlock(&vop->reg_lock);
|
|
+}
|
|
+
|
|
+static void vop_crtc_atomic_begin(struct drm_crtc *crtc,
|
|
+ struct drm_crtc_state *old_crtc_state)
|
|
+{
|
|
+ struct vop *vop = to_vop(crtc);
|
|
+
|
|
+ /*
|
|
+ * Only update GAMMA if the 'active' flag is not changed,
|
|
+ * otherwise it's updated by .atomic_enable.
|
|
+ */
|
|
+ if (crtc->state->color_mgmt_changed &&
|
|
+ !crtc->state->active_changed)
|
|
+ vop_crtc_gamma_set(vop, crtc, old_crtc_state);
|
|
+}
|
|
+
|
|
static void vop_crtc_atomic_enable(struct drm_crtc *crtc,
|
|
struct drm_crtc_state *old_state)
|
|
{
|
|
@@ -1106,6 +1180,14 @@ static void vop_crtc_atomic_enable(struct drm_crtc *crtc,
|
|
return;
|
|
}
|
|
|
|
+ /*
|
|
+ * If we have a GAMMA LUT in the state, then let's make sure
|
|
+ * it's updated. We might be coming out of suspend,
|
|
+ * which means the LUT internal memory needs to be re-written.
|
|
+ */
|
|
+ if (crtc->state->gamma_lut)
|
|
+ vop_crtc_gamma_set(vop, crtc, old_state);
|
|
+
|
|
mutex_lock(&vop->vop_lock);
|
|
|
|
WARN_ON(vop->event);
|
|
@@ -1222,6 +1304,26 @@ static void vop_wait_for_irq_handler(struct vop *vop)
|
|
synchronize_irq(vop->irq);
|
|
}
|
|
|
|
+static int vop_crtc_atomic_check(struct drm_crtc *crtc,
|
|
+ struct drm_crtc_state *crtc_state)
|
|
+{
|
|
+ struct vop *vop = to_vop(crtc);
|
|
+
|
|
+ if (vop->lut_regs && crtc_state->color_mgmt_changed &&
|
|
+ crtc_state->gamma_lut) {
|
|
+ unsigned int len;
|
|
+
|
|
+ len = drm_color_lut_size(crtc_state->gamma_lut);
|
|
+ if (len != crtc->gamma_size) {
|
|
+ DRM_DEBUG_KMS("Invalid LUT size; got %d, expected %d\n",
|
|
+ len, crtc->gamma_size);
|
|
+ return -EINVAL;
|
|
+ }
|
|
+ }
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
static void vop_crtc_atomic_flush(struct drm_crtc *crtc,
|
|
struct drm_crtc_state *old_crtc_state)
|
|
{
|
|
@@ -1274,6 +1376,8 @@ static void vop_crtc_atomic_flush(struct drm_crtc *crtc,
|
|
|
|
static const struct drm_crtc_helper_funcs vop_crtc_helper_funcs = {
|
|
.mode_fixup = vop_crtc_mode_fixup,
|
|
+ .atomic_check = vop_crtc_atomic_check,
|
|
+ .atomic_begin = vop_crtc_atomic_begin,
|
|
.atomic_flush = vop_crtc_atomic_flush,
|
|
.atomic_enable = vop_crtc_atomic_enable,
|
|
.atomic_disable = vop_crtc_atomic_disable,
|
|
@@ -1392,6 +1496,7 @@ static const struct drm_crtc_funcs vop_crtc_funcs = {
|
|
.disable_vblank = vop_crtc_disable_vblank,
|
|
.set_crc_source = vop_crtc_set_crc_source,
|
|
.verify_crc_source = vop_crtc_verify_crc_source,
|
|
+ .gamma_set = drm_atomic_helper_legacy_gamma_set,
|
|
};
|
|
|
|
static void vop_fb_unref_worker(struct drm_flip_work *work, void *val)
|
|
@@ -1549,6 +1654,10 @@ static int vop_create_crtc(struct vop *vop)
|
|
goto err_cleanup_planes;
|
|
|
|
drm_crtc_helper_add(crtc, &vop_crtc_helper_funcs);
|
|
+ if (vop->lut_regs) {
|
|
+ drm_mode_crtc_set_gamma_size(crtc, vop_data->lut_size);
|
|
+ drm_crtc_enable_color_mgmt(crtc, 0, false, vop_data->lut_size);
|
|
+ }
|
|
|
|
/*
|
|
* Create drm_planes for overlay windows with possible_crtcs restricted
|
|
@@ -1853,6 +1962,17 @@ static int vop_bind(struct device *dev, struct device *master, void *data)
|
|
if (IS_ERR(vop->regs))
|
|
return PTR_ERR(vop->regs);
|
|
|
|
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
|
|
+ if (res) {
|
|
+ if (!vop_data->lut_size) {
|
|
+ DRM_DEV_ERROR(dev, "no gamma LUT size defined\n");
|
|
+ return -EINVAL;
|
|
+ }
|
|
+ vop->lut_regs = devm_ioremap_resource(dev, res);
|
|
+ if (IS_ERR(vop->lut_regs))
|
|
+ return PTR_ERR(vop->lut_regs);
|
|
+ }
|
|
+
|
|
vop->regsbak = devm_kzalloc(dev, vop->len, GFP_KERNEL);
|
|
if (!vop->regsbak)
|
|
return -ENOMEM;
|
|
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.h b/drivers/gpu/drm/rockchip/rockchip_drm_vop.h
|
|
index 2149a889c29d..487d1709b039 100644
|
|
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.h
|
|
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.h
|
|
@@ -67,6 +67,7 @@ struct vop_common {
|
|
struct vop_reg dither_down_mode;
|
|
struct vop_reg dither_down_en;
|
|
struct vop_reg dither_up;
|
|
+ struct vop_reg dsp_lut_en;
|
|
struct vop_reg gate_en;
|
|
struct vop_reg mmu_en;
|
|
struct vop_reg out_mode;
|
|
@@ -170,6 +171,7 @@ struct vop_data {
|
|
const struct vop_win_yuv2yuv_data *win_yuv2yuv;
|
|
const struct vop_win_data *win;
|
|
unsigned int win_size;
|
|
+ unsigned int lut_size;
|
|
|
|
#define VOP_FEATURE_OUTPUT_RGB10 BIT(0)
|
|
#define VOP_FEATURE_INTERNAL_RGB BIT(1)
|
|
diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
|
|
index d1494be14471..42ddcb698c82 100644
|
|
--- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
|
|
+++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
|
|
@@ -598,6 +598,7 @@ static const struct vop_common rk3288_common = {
|
|
.dither_down_en = VOP_REG(RK3288_DSP_CTRL1, 0x1, 2),
|
|
.pre_dither_down = VOP_REG(RK3288_DSP_CTRL1, 0x1, 1),
|
|
.dither_up = VOP_REG(RK3288_DSP_CTRL1, 0x1, 6),
|
|
+ .dsp_lut_en = VOP_REG(RK3288_DSP_CTRL1, 0x1, 0),
|
|
.data_blank = VOP_REG(RK3288_DSP_CTRL0, 0x1, 19),
|
|
.dsp_blank = VOP_REG(RK3288_DSP_CTRL0, 0x3, 18),
|
|
.out_mode = VOP_REG(RK3288_DSP_CTRL0, 0xf, 0),
|
|
@@ -646,6 +647,7 @@ static const struct vop_data rk3288_vop = {
|
|
.output = &rk3288_output,
|
|
.win = rk3288_vop_win_data,
|
|
.win_size = ARRAY_SIZE(rk3288_vop_win_data),
|
|
+ .lut_size = 1024,
|
|
};
|
|
|
|
static const int rk3368_vop_intrs[] = {
|
|
|
|
From 0218a69bb2f9f4758498813cb5e55b45c716cc0d Mon Sep 17 00:00:00 2001
|
|
From: Ezequiel Garcia <ezequiel@collabora.com>
|
|
Date: Thu, 10 Oct 2019 16:43:51 -0300
|
|
Subject: [PATCH] ARM: dts: rockchip: Add RK3288 VOP gamma LUT address
|
|
|
|
RK3288 SoC VOPs have optional support Gamma LUT setting,
|
|
which requires specifying the Gamma LUT address in the devicetree.
|
|
|
|
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
|
|
Reviewed-by: Douglas Anderson <dianders@chromium.org>
|
|
Link: https://lore.kernel.org/r/20191010194351.17940-4-ezequiel@collabora.com
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit 463c5ac0300ad4a85982cfc0b40585b07df01fc7)
|
|
---
|
|
arch/arm/boot/dts/rk3288.dtsi | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
|
|
index 415b48fc3ce8..415c75f5783c 100644
|
|
--- a/arch/arm/boot/dts/rk3288.dtsi
|
|
+++ b/arch/arm/boot/dts/rk3288.dtsi
|
|
@@ -1023,7 +1023,7 @@
|
|
|
|
vopb: vop@ff930000 {
|
|
compatible = "rockchip,rk3288-vop";
|
|
- reg = <0x0 0xff930000 0x0 0x19c>;
|
|
+ reg = <0x0 0xff930000 0x0 0x19c>, <0x0 0xff931000 0x0 0x1000>;
|
|
interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
|
|
clocks = <&cru ACLK_VOP0>, <&cru DCLK_VOP0>, <&cru HCLK_VOP0>;
|
|
clock-names = "aclk_vop", "dclk_vop", "hclk_vop";
|
|
@@ -1073,7 +1073,7 @@
|
|
|
|
vopl: vop@ff940000 {
|
|
compatible = "rockchip,rk3288-vop";
|
|
- reg = <0x0 0xff940000 0x0 0x19c>;
|
|
+ reg = <0x0 0xff940000 0x0 0x19c>, <0x0 0xff941000 0x0 0x1000>;
|
|
interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
|
|
clocks = <&cru ACLK_VOP1>, <&cru DCLK_VOP1>, <&cru HCLK_VOP1>;
|
|
clock-names = "aclk_vop", "dclk_vop", "hclk_vop";
|
|
|
|
From 37c246df9b9fb8cd1ce5f38745ac7bafe0696c8c Mon Sep 17 00:00:00 2001
|
|
From: Markus Elfring <elfring@users.sourceforge.net>
|
|
Date: Sat, 21 Sep 2019 20:32:25 +0200
|
|
Subject: [PATCH] drm/rockchip: rk3066_hdmi: Use
|
|
devm_platform_ioremap_resource() in rk3066_hdmi_bind()
|
|
|
|
Simplify this function implementation by using a known wrapper function.
|
|
|
|
This issue was detected by using the Coccinelle software.
|
|
|
|
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/0666bc0b-6624-21a0-47c4-b78e2a3b3ad5@web.de
|
|
(cherry picked from commit 9abdcff7205899d38213e69287fb63e6c87e2fc8)
|
|
---
|
|
drivers/gpu/drm/rockchip/rk3066_hdmi.c | 8 +-------
|
|
1 file changed, 1 insertion(+), 7 deletions(-)
|
|
|
|
diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
|
|
index 85fc5f01f761..cdb401f4283d 100644
|
|
--- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
|
|
+++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
|
|
@@ -743,7 +743,6 @@ static int rk3066_hdmi_bind(struct device *dev, struct device *master,
|
|
struct platform_device *pdev = to_platform_device(dev);
|
|
struct drm_device *drm = data;
|
|
struct rk3066_hdmi *hdmi;
|
|
- struct resource *iores;
|
|
int irq;
|
|
int ret;
|
|
|
|
@@ -753,12 +752,7 @@ static int rk3066_hdmi_bind(struct device *dev, struct device *master,
|
|
|
|
hdmi->dev = dev;
|
|
hdmi->drm_dev = drm;
|
|
-
|
|
- iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
|
- if (!iores)
|
|
- return -ENXIO;
|
|
-
|
|
- hdmi->regs = devm_ioremap_resource(dev, iores);
|
|
+ hdmi->regs = devm_platform_ioremap_resource(pdev, 0);
|
|
if (IS_ERR(hdmi->regs))
|
|
return PTR_ERR(hdmi->regs);
|
|
|
|
|
|
From 21c7a3ee5d9de21ed93ae788414fbf451fae944d Mon Sep 17 00:00:00 2001
|
|
From: Ben Dooks <ben.dooks@codethink.co.uk>
|
|
Date: Wed, 9 Oct 2019 14:21:34 +0100
|
|
Subject: [PATCH] drm/rockchip: include rockchip_drm_drv.h
|
|
|
|
Include rockchip_drm_drv.h for definition of vop_platform_driver
|
|
to avoid the following sparse warning:
|
|
|
|
drivers/gpu/drm/rockchip/rockchip_vop_reg.c:982:24: warning: symbol 'vop_platform_driver' was not declared. Should it be static?
|
|
|
|
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/20191009132134.18384-1-ben.dooks@codethink.co.uk
|
|
(cherry picked from commit b02516b6cde7aae89df58e33e091f5ce90a1b118)
|
|
---
|
|
drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 1 +
|
|
1 file changed, 1 insertion(+)
|
|
|
|
diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
|
|
index 42ddcb698c82..efbdff6a2484 100644
|
|
--- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
|
|
+++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
|
|
@@ -16,6 +16,7 @@
|
|
|
|
#include "rockchip_drm_vop.h"
|
|
#include "rockchip_vop_reg.h"
|
|
+#include "rockchip_drm_drv.h"
|
|
|
|
#define _VOP_REG(off, _mask, _shift, _write_mask, _relaxed) \
|
|
{ \
|
|
|
|
From e15f4664edb809ec488d33201afe643090a630f8 Mon Sep 17 00:00:00 2001
|
|
From: Ben Dooks <ben.dooks@codethink.co.uk>
|
|
Date: Wed, 9 Oct 2019 13:10:22 +0100
|
|
Subject: [PATCH] drm/rockchip: make rockchip_gem_alloc_object static
|
|
|
|
The rockchip_gem_alloc_object function is not exported so
|
|
make it static to avoid the following sparse warning:
|
|
|
|
drivers/gpu/drm/rockchip/rockchip_drm_gem.c:297:28: warning: symbol 'rockchip_gem_alloc_object' was not declared. Should it be static?
|
|
|
|
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/20191009121022.17478-1-ben.dooks@codethink.co.uk
|
|
(cherry picked from commit c7337670ef2a681c40711de6e90511e6b926ab3d)
|
|
---
|
|
drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
|
|
index 291e89b4045f..7582d0e6a60a 100644
|
|
--- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
|
|
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
|
|
@@ -294,7 +294,7 @@ static void rockchip_gem_release_object(struct rockchip_gem_object *rk_obj)
|
|
kfree(rk_obj);
|
|
}
|
|
|
|
-struct rockchip_gem_object *
|
|
+static struct rockchip_gem_object *
|
|
rockchip_gem_alloc_object(struct drm_device *drm, unsigned int size)
|
|
{
|
|
struct rockchip_gem_object *rk_obj;
|
|
|
|
From 1b429e731cef9614289bb66f7dfe86a59266519b Mon Sep 17 00:00:00 2001
|
|
From: Nickey Yang <nickey.yang@rock-chips.com>
|
|
Date: Thu, 10 Oct 2019 11:44:52 +0800
|
|
Subject: [PATCH] drm/rockchip: vop: add the definition of dclk_pol
|
|
|
|
Some VOP's (such as px30) dclk_pol bit is at the last.
|
|
So it is necessary to distinguish dclk_pol and pin_pol.
|
|
|
|
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
|
|
Reviewed-by: Sandy Huang <hjc@rock-chips.com>
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/20191010034452.20260-2-nickey.yang@rock-chips.com
|
|
(cherry picked from commit 1f6c62ca8f8d7b2b4c9f9a13dc1be1be37555688)
|
|
---
|
|
drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 12 ++++----
|
|
drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 8 +++--
|
|
drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 45 +++++++++++++++++++----------
|
|
3 files changed, 43 insertions(+), 22 deletions(-)
|
|
|
|
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
|
|
index 65eb4a1ddbfa..d04b3492bdac 100644
|
|
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
|
|
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
|
|
@@ -1198,9 +1198,7 @@ static void vop_crtc_atomic_enable(struct drm_crtc *crtc,
|
|
DRM_DEV_ERROR(vop->dev, "Failed to enable vop (%d)\n", ret);
|
|
return;
|
|
}
|
|
-
|
|
- pin_pol = BIT(DCLK_INVERT);
|
|
- pin_pol |= (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) ?
|
|
+ pin_pol = (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) ?
|
|
BIT(HSYNC_POSITIVE) : 0;
|
|
pin_pol |= (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC) ?
|
|
BIT(VSYNC_POSITIVE) : 0;
|
|
@@ -1209,25 +1207,29 @@ static void vop_crtc_atomic_enable(struct drm_crtc *crtc,
|
|
|
|
switch (s->output_type) {
|
|
case DRM_MODE_CONNECTOR_LVDS:
|
|
- VOP_REG_SET(vop, output, rgb_en, 1);
|
|
+ VOP_REG_SET(vop, output, rgb_dclk_pol, 1);
|
|
VOP_REG_SET(vop, output, rgb_pin_pol, pin_pol);
|
|
+ VOP_REG_SET(vop, output, rgb_en, 1);
|
|
break;
|
|
case DRM_MODE_CONNECTOR_eDP:
|
|
+ VOP_REG_SET(vop, output, edp_dclk_pol, 1);
|
|
VOP_REG_SET(vop, output, edp_pin_pol, pin_pol);
|
|
VOP_REG_SET(vop, output, edp_en, 1);
|
|
break;
|
|
case DRM_MODE_CONNECTOR_HDMIA:
|
|
+ VOP_REG_SET(vop, output, hdmi_dclk_pol, 1);
|
|
VOP_REG_SET(vop, output, hdmi_pin_pol, pin_pol);
|
|
VOP_REG_SET(vop, output, hdmi_en, 1);
|
|
break;
|
|
case DRM_MODE_CONNECTOR_DSI:
|
|
+ VOP_REG_SET(vop, output, mipi_dclk_pol, 1);
|
|
VOP_REG_SET(vop, output, mipi_pin_pol, pin_pol);
|
|
VOP_REG_SET(vop, output, mipi_en, 1);
|
|
VOP_REG_SET(vop, output, mipi_dual_channel_en,
|
|
!!(s->output_flags & ROCKCHIP_OUTPUT_DSI_DUAL));
|
|
break;
|
|
case DRM_MODE_CONNECTOR_DisplayPort:
|
|
- pin_pol &= ~BIT(DCLK_INVERT);
|
|
+ VOP_REG_SET(vop, output, dp_dclk_pol, 0);
|
|
VOP_REG_SET(vop, output, dp_pin_pol, pin_pol);
|
|
VOP_REG_SET(vop, output, dp_en, 1);
|
|
break;
|
|
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.h b/drivers/gpu/drm/rockchip/rockchip_drm_vop.h
|
|
index 487d1709b039..0b3d18c457b2 100644
|
|
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.h
|
|
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.h
|
|
@@ -46,10 +46,15 @@ struct vop_modeset {
|
|
struct vop_output {
|
|
struct vop_reg pin_pol;
|
|
struct vop_reg dp_pin_pol;
|
|
+ struct vop_reg dp_dclk_pol;
|
|
struct vop_reg edp_pin_pol;
|
|
+ struct vop_reg edp_dclk_pol;
|
|
struct vop_reg hdmi_pin_pol;
|
|
+ struct vop_reg hdmi_dclk_pol;
|
|
struct vop_reg mipi_pin_pol;
|
|
+ struct vop_reg mipi_dclk_pol;
|
|
struct vop_reg rgb_pin_pol;
|
|
+ struct vop_reg rgb_dclk_pol;
|
|
struct vop_reg dp_en;
|
|
struct vop_reg edp_en;
|
|
struct vop_reg hdmi_en;
|
|
@@ -296,8 +301,7 @@ enum dither_down_mode_sel {
|
|
enum vop_pol {
|
|
HSYNC_POSITIVE = 0,
|
|
VSYNC_POSITIVE = 1,
|
|
- DEN_NEGATIVE = 2,
|
|
- DCLK_INVERT = 3
|
|
+ DEN_NEGATIVE = 2
|
|
};
|
|
|
|
#define FRAC_16_16(mult, div) (((mult) << 16) / (div))
|
|
diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
|
|
index efbdff6a2484..7a9d979c8d5d 100644
|
|
--- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
|
|
+++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
|
|
@@ -215,9 +215,11 @@ static const struct vop_modeset px30_modeset = {
|
|
};
|
|
|
|
static const struct vop_output px30_output = {
|
|
- .rgb_pin_pol = VOP_REG(PX30_DSP_CTRL0, 0xf, 1),
|
|
- .mipi_pin_pol = VOP_REG(PX30_DSP_CTRL0, 0xf, 25),
|
|
+ .rgb_dclk_pol = VOP_REG(PX30_DSP_CTRL0, 0x1, 1),
|
|
+ .rgb_pin_pol = VOP_REG(PX30_DSP_CTRL0, 0x7, 2),
|
|
.rgb_en = VOP_REG(PX30_DSP_CTRL0, 0x1, 0),
|
|
+ .mipi_dclk_pol = VOP_REG(PX30_DSP_CTRL0, 0x1, 25),
|
|
+ .mipi_pin_pol = VOP_REG(PX30_DSP_CTRL0, 0x7, 26),
|
|
.mipi_en = VOP_REG(PX30_DSP_CTRL0, 0x1, 24),
|
|
};
|
|
|
|
@@ -720,10 +722,14 @@ static const struct vop_win_data rk3368_vop_win_data[] = {
|
|
};
|
|
|
|
static const struct vop_output rk3368_output = {
|
|
- .rgb_pin_pol = VOP_REG(RK3368_DSP_CTRL1, 0xf, 16),
|
|
- .hdmi_pin_pol = VOP_REG(RK3368_DSP_CTRL1, 0xf, 20),
|
|
- .edp_pin_pol = VOP_REG(RK3368_DSP_CTRL1, 0xf, 24),
|
|
- .mipi_pin_pol = VOP_REG(RK3368_DSP_CTRL1, 0xf, 28),
|
|
+ .rgb_dclk_pol = VOP_REG(RK3368_DSP_CTRL1, 0x1, 19),
|
|
+ .hdmi_dclk_pol = VOP_REG(RK3368_DSP_CTRL1, 0x1, 23),
|
|
+ .edp_dclk_pol = VOP_REG(RK3368_DSP_CTRL1, 0x1, 27),
|
|
+ .mipi_dclk_pol = VOP_REG(RK3368_DSP_CTRL1, 0x1, 31),
|
|
+ .rgb_pin_pol = VOP_REG(RK3368_DSP_CTRL1, 0x7, 16),
|
|
+ .hdmi_pin_pol = VOP_REG(RK3368_DSP_CTRL1, 0x7, 20),
|
|
+ .edp_pin_pol = VOP_REG(RK3368_DSP_CTRL1, 0x7, 24),
|
|
+ .mipi_pin_pol = VOP_REG(RK3368_DSP_CTRL1, 0x7, 28),
|
|
.rgb_en = VOP_REG(RK3288_SYS_CTRL, 0x1, 12),
|
|
.hdmi_en = VOP_REG(RK3288_SYS_CTRL, 0x1, 13),
|
|
.edp_en = VOP_REG(RK3288_SYS_CTRL, 0x1, 14),
|
|
@@ -767,11 +773,16 @@ static const struct vop_data rk3366_vop = {
|
|
};
|
|
|
|
static const struct vop_output rk3399_output = {
|
|
- .dp_pin_pol = VOP_REG(RK3399_DSP_CTRL1, 0xf, 16),
|
|
- .rgb_pin_pol = VOP_REG(RK3368_DSP_CTRL1, 0xf, 16),
|
|
- .hdmi_pin_pol = VOP_REG(RK3368_DSP_CTRL1, 0xf, 20),
|
|
- .edp_pin_pol = VOP_REG(RK3368_DSP_CTRL1, 0xf, 24),
|
|
- .mipi_pin_pol = VOP_REG(RK3368_DSP_CTRL1, 0xf, 28),
|
|
+ .dp_dclk_pol = VOP_REG(RK3399_DSP_CTRL1, 0x1, 19),
|
|
+ .rgb_dclk_pol = VOP_REG(RK3368_DSP_CTRL1, 0x1, 19),
|
|
+ .hdmi_dclk_pol = VOP_REG(RK3368_DSP_CTRL1, 0x1, 23),
|
|
+ .edp_dclk_pol = VOP_REG(RK3368_DSP_CTRL1, 0x1, 27),
|
|
+ .mipi_dclk_pol = VOP_REG(RK3368_DSP_CTRL1, 0x1, 31),
|
|
+ .dp_pin_pol = VOP_REG(RK3399_DSP_CTRL1, 0x7, 16),
|
|
+ .rgb_pin_pol = VOP_REG(RK3368_DSP_CTRL1, 0x7, 16),
|
|
+ .hdmi_pin_pol = VOP_REG(RK3368_DSP_CTRL1, 0x7, 20),
|
|
+ .edp_pin_pol = VOP_REG(RK3368_DSP_CTRL1, 0x7, 24),
|
|
+ .mipi_pin_pol = VOP_REG(RK3368_DSP_CTRL1, 0x7, 28),
|
|
.dp_en = VOP_REG(RK3399_SYS_CTRL, 0x1, 11),
|
|
.rgb_en = VOP_REG(RK3288_SYS_CTRL, 0x1, 12),
|
|
.hdmi_en = VOP_REG(RK3288_SYS_CTRL, 0x1, 13),
|
|
@@ -875,14 +886,18 @@ static const struct vop_modeset rk3328_modeset = {
|
|
};
|
|
|
|
static const struct vop_output rk3328_output = {
|
|
+ .rgb_dclk_pol = VOP_REG(RK3328_DSP_CTRL1, 0x1, 19),
|
|
+ .hdmi_dclk_pol = VOP_REG(RK3328_DSP_CTRL1, 0x1, 23),
|
|
+ .edp_dclk_pol = VOP_REG(RK3328_DSP_CTRL1, 0x1, 27),
|
|
+ .mipi_dclk_pol = VOP_REG(RK3328_DSP_CTRL1, 0x1, 31),
|
|
.rgb_en = VOP_REG(RK3328_SYS_CTRL, 0x1, 12),
|
|
.hdmi_en = VOP_REG(RK3328_SYS_CTRL, 0x1, 13),
|
|
.edp_en = VOP_REG(RK3328_SYS_CTRL, 0x1, 14),
|
|
.mipi_en = VOP_REG(RK3328_SYS_CTRL, 0x1, 15),
|
|
- .rgb_pin_pol = VOP_REG(RK3328_DSP_CTRL1, 0xf, 16),
|
|
- .hdmi_pin_pol = VOP_REG(RK3328_DSP_CTRL1, 0xf, 20),
|
|
- .edp_pin_pol = VOP_REG(RK3328_DSP_CTRL1, 0xf, 24),
|
|
- .mipi_pin_pol = VOP_REG(RK3328_DSP_CTRL1, 0xf, 28),
|
|
+ .rgb_pin_pol = VOP_REG(RK3328_DSP_CTRL1, 0x7, 16),
|
|
+ .hdmi_pin_pol = VOP_REG(RK3328_DSP_CTRL1, 0x7, 20),
|
|
+ .edp_pin_pol = VOP_REG(RK3328_DSP_CTRL1, 0x7, 24),
|
|
+ .mipi_pin_pol = VOP_REG(RK3328_DSP_CTRL1, 0x7, 28),
|
|
};
|
|
|
|
static const struct vop_misc rk3328_misc = {
|
|
|
|
From 25f6e77b2033ba8f0af8c547d6ace6ec70b8482b Mon Sep 17 00:00:00 2001
|
|
From: Daniel Kurtz <djkurtz@chromium.org>
|
|
Date: Tue, 8 Oct 2019 18:21:45 +0800
|
|
Subject: [PATCH] drm/bridge: dw-hdmi: Restore audio when setting a mode
|
|
|
|
When setting a new display mode, dw_hdmi_setup() calls
|
|
dw_hdmi_enable_video_path(), which disables all hdmi clocks, including
|
|
the audio clock.
|
|
|
|
We should only (re-)enable the audio clock if audio was already enabled
|
|
when setting the new mode.
|
|
|
|
Without this patch, on RK3288, there will be HDMI audio on some monitors
|
|
if i2s was played to headphone when the monitor was plugged.
|
|
ACER H277HU and ASUS PB278 are two of the monitors showing this issue.
|
|
|
|
Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
|
|
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
|
|
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
|
|
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/20191008102145.55134-1-cychiang@chromium.org
|
|
(cherry picked from commit fadfee3f9d8f114435a8a3e9f83a227600d89de7)
|
|
---
|
|
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
|
index fdc29869d75a..dbe38a54870b 100644
|
|
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
|
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
|
@@ -2090,7 +2090,7 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode)
|
|
|
|
/* HDMI Initialization Step E - Configure audio */
|
|
hdmi_clk_regenerator_update_pixel_clock(hdmi);
|
|
- hdmi_enable_audio_clk(hdmi, true);
|
|
+ hdmi_enable_audio_clk(hdmi, hdmi->audio_enable);
|
|
}
|
|
|
|
/* not for DVI mode */
|
|
|
|
From a5b2731ba8ddaa259c55eed691ca68f2f21fb2f9 Mon Sep 17 00:00:00 2001
|
|
From: Johan Jonker <jbx6244@gmail.com>
|
|
Date: Mon, 14 Oct 2019 23:06:19 +0200
|
|
Subject: [PATCH] ARM: dts: rockchip: remove some tabs and spaces from dtsi
|
|
files
|
|
|
|
Cleanup the Rockchip dtsi files a little bit
|
|
by removing some tabs and spaces.
|
|
|
|
Signed-off-by: Johan Jonker <jbx6244@gmail.com>
|
|
Link: https://lore.kernel.org/r/20191014210619.12778-1-jbx6244@gmail.com
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit a562a8acccb3070155aad3db5ac97a80aed2a24b)
|
|
---
|
|
arch/arm/boot/dts/rk3036.dtsi | 4 ++--
|
|
arch/arm/boot/dts/rk3288-rock2-som.dtsi | 8 ++++----
|
|
arch/arm/boot/dts/rk3288-tinker.dtsi | 14 +++++---------
|
|
3 files changed, 11 insertions(+), 15 deletions(-)
|
|
|
|
diff --git a/arch/arm/boot/dts/rk3036.dtsi b/arch/arm/boot/dts/rk3036.dtsi
|
|
index c776321b2cc4..c70182c5aeb1 100644
|
|
--- a/arch/arm/boot/dts/rk3036.dtsi
|
|
+++ b/arch/arm/boot/dts/rk3036.dtsi
|
|
@@ -696,8 +696,8 @@
|
|
|
|
hdmi {
|
|
hdmi_ctl: hdmi-ctl {
|
|
- rockchip,pins = <1 RK_PB0 1 &pcfg_pull_none>,
|
|
- <1 RK_PB1 1 &pcfg_pull_none>,
|
|
+ rockchip,pins = <1 RK_PB0 1 &pcfg_pull_none>,
|
|
+ <1 RK_PB1 1 &pcfg_pull_none>,
|
|
<1 RK_PB2 1 &pcfg_pull_none>,
|
|
<1 RK_PB3 1 &pcfg_pull_none>;
|
|
};
|
|
diff --git a/arch/arm/boot/dts/rk3288-rock2-som.dtsi b/arch/arm/boot/dts/rk3288-rock2-som.dtsi
|
|
index 9f9e2bfd1295..44bb5e6f83b1 100644
|
|
--- a/arch/arm/boot/dts/rk3288-rock2-som.dtsi
|
|
+++ b/arch/arm/boot/dts/rk3288-rock2-som.dtsi
|
|
@@ -230,14 +230,14 @@
|
|
};
|
|
|
|
emmc {
|
|
- emmc_reset: emmc-reset {
|
|
- rockchip,pins = <3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
- };
|
|
+ emmc_reset: emmc-reset {
|
|
+ rockchip,pins = <3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
+ };
|
|
};
|
|
|
|
gmac {
|
|
phy_rst: phy-rst {
|
|
- rockchip,pins = <4 RK_PB0 RK_FUNC_GPIO &pcfg_output_high>;
|
|
+ rockchip,pins = <4 RK_PB0 RK_FUNC_GPIO &pcfg_output_high>;
|
|
};
|
|
};
|
|
};
|
|
diff --git a/arch/arm/boot/dts/rk3288-tinker.dtsi b/arch/arm/boot/dts/rk3288-tinker.dtsi
|
|
index 81e4e953d4a4..0aeef23ca3db 100644
|
|
--- a/arch/arm/boot/dts/rk3288-tinker.dtsi
|
|
+++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
|
|
@@ -382,18 +382,15 @@
|
|
|
|
pmic {
|
|
pmic_int: pmic-int {
|
|
- rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO \
|
|
- &pcfg_pull_up>;
|
|
+ rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>;
|
|
};
|
|
|
|
dvs_1: dvs-1 {
|
|
- rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO \
|
|
- &pcfg_pull_down>;
|
|
+ rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_down>;
|
|
};
|
|
|
|
dvs_2: dvs-2 {
|
|
- rockchip,pins = <0 RK_PB4 RK_FUNC_GPIO \
|
|
- &pcfg_pull_down>;
|
|
+ rockchip,pins = <0 RK_PB4 RK_FUNC_GPIO &pcfg_pull_down>;
|
|
};
|
|
};
|
|
|
|
@@ -406,8 +403,7 @@
|
|
};
|
|
|
|
sdmmc_clk: sdmmc-clk {
|
|
- rockchip,pins = <6 RK_PC4 1 \
|
|
- &pcfg_pull_none_drv_8ma>;
|
|
+ rockchip,pins = <6 RK_PC4 1 &pcfg_pull_none_drv_8ma>;
|
|
};
|
|
|
|
sdmmc_cmd: sdmmc-cmd {
|
|
@@ -432,7 +428,7 @@
|
|
sdio {
|
|
wifi_enable: wifi-enable {
|
|
rockchip,pins = <4 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>,
|
|
- <4 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
+ <4 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
};
|
|
};
|
|
};
|
|
|
|
From 45bdfc0e37ca4ae4183badce431cf2824f6e0e4f Mon Sep 17 00:00:00 2001
|
|
From: Johan Jonker <jbx6244@gmail.com>
|
|
Date: Tue, 15 Oct 2019 22:58:51 +0200
|
|
Subject: [PATCH] arm64: dts: rockchip: restyle rockchip,pins on
|
|
rk3399-rock-pi-4
|
|
|
|
The define RK_FUNC_1 is no longer used,
|
|
so restyle the rockchip,pins definitions.
|
|
|
|
Signed-off-by: Johan Jonker <jbx6244@gmail.com>
|
|
Link: https://lore.kernel.org/r/20191015205852.4200-1-jbx6244@gmail.com
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit 4ff75253719cfae945ffb7d0f91293b236d7c717)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts | 18 +++++++-----------
|
|
1 file changed, 7 insertions(+), 11 deletions(-)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts
|
|
index 1ae1ebd4efdd..188d9dfc297b 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts
|
|
@@ -486,21 +486,18 @@
|
|
|
|
sdio0 {
|
|
sdio0_bus4: sdio0-bus4 {
|
|
- rockchip,pins =
|
|
- <2 20 RK_FUNC_1 &pcfg_pull_up_20ma>,
|
|
- <2 21 RK_FUNC_1 &pcfg_pull_up_20ma>,
|
|
- <2 22 RK_FUNC_1 &pcfg_pull_up_20ma>,
|
|
- <2 23 RK_FUNC_1 &pcfg_pull_up_20ma>;
|
|
+ rockchip,pins = <2 RK_PC4 1 &pcfg_pull_up_20ma>,
|
|
+ <2 RK_PC5 1 &pcfg_pull_up_20ma>,
|
|
+ <2 RK_PC6 1 &pcfg_pull_up_20ma>,
|
|
+ <2 RK_PC7 1 &pcfg_pull_up_20ma>;
|
|
};
|
|
|
|
sdio0_cmd: sdio0-cmd {
|
|
- rockchip,pins =
|
|
- <2 24 RK_FUNC_1 &pcfg_pull_up_20ma>;
|
|
+ rockchip,pins = <2 RK_PD0 1 &pcfg_pull_up_20ma>;
|
|
};
|
|
|
|
sdio0_clk: sdio0-clk {
|
|
- rockchip,pins =
|
|
- <2 25 RK_FUNC_1 &pcfg_pull_none_20ma>;
|
|
+ rockchip,pins = <2 RK_PD1 1 &pcfg_pull_none_20ma>;
|
|
};
|
|
};
|
|
|
|
@@ -532,8 +529,7 @@
|
|
|
|
wifi {
|
|
wifi_enable_h: wifi-enable-h {
|
|
- rockchip,pins =
|
|
- <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
+ rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
};
|
|
|
|
wifi_host_wake_l: wifi-host-wake-l {
|
|
|
|
From 8984d5f414ba37a13e5ef493f01ac9ded8920f72 Mon Sep 17 00:00:00 2001
|
|
From: Thierry Reding <treding@nvidia.com>
|
|
Date: Mon, 21 Oct 2019 16:34:36 +0200
|
|
Subject: [PATCH] drm/rockchip: Avoid drm_dp_link helpers
|
|
|
|
During the discussion of patches that enhance the drm_dp_link helpers it
|
|
was concluded that these helpers aren't very useful to begin with. Start
|
|
pushing the equivalent code into individual drivers to ultimately remove
|
|
them.
|
|
|
|
Signed-off-by: Thierry Reding <treding@nvidia.com>
|
|
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/20191021143437.1477719-13-thierry.reding@gmail.com
|
|
(cherry picked from commit 2589c4025f1301ccf7421d9c2f0001a4f87380ea)
|
|
---
|
|
drivers/gpu/drm/rockchip/cdn-dp-core.c | 12 ++++++------
|
|
drivers/gpu/drm/rockchip/cdn-dp-core.h | 3 ++-
|
|
drivers/gpu/drm/rockchip/cdn-dp-reg.c | 19 +++++++++----------
|
|
3 files changed, 17 insertions(+), 17 deletions(-)
|
|
|
|
diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
|
|
index d505ea7d5384..eed594bd38d3 100644
|
|
--- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
|
|
+++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
|
|
@@ -477,8 +477,8 @@ static int cdn_dp_disable(struct cdn_dp_device *dp)
|
|
cdn_dp_set_firmware_active(dp, false);
|
|
cdn_dp_clk_disable(dp);
|
|
dp->active = false;
|
|
- dp->link.rate = 0;
|
|
- dp->link.num_lanes = 0;
|
|
+ dp->max_lanes = 0;
|
|
+ dp->max_rate = 0;
|
|
if (!dp->connected) {
|
|
kfree(dp->edid);
|
|
dp->edid = NULL;
|
|
@@ -570,7 +570,7 @@ static bool cdn_dp_check_link_status(struct cdn_dp_device *dp)
|
|
struct cdn_dp_port *port = cdn_dp_connected_port(dp);
|
|
u8 sink_lanes = drm_dp_max_lane_count(dp->dpcd);
|
|
|
|
- if (!port || !dp->link.rate || !dp->link.num_lanes)
|
|
+ if (!port || !dp->max_rate || !dp->max_lanes)
|
|
return false;
|
|
|
|
if (cdn_dp_dpcd_read(dp, DP_LANE0_1_STATUS, link_status,
|
|
@@ -952,8 +952,8 @@ static void cdn_dp_pd_event_work(struct work_struct *work)
|
|
|
|
/* Enabled and connected with a sink, re-train if requested */
|
|
} else if (!cdn_dp_check_link_status(dp)) {
|
|
- unsigned int rate = dp->link.rate;
|
|
- unsigned int lanes = dp->link.num_lanes;
|
|
+ unsigned int rate = dp->max_rate;
|
|
+ unsigned int lanes = dp->max_lanes;
|
|
struct drm_display_mode *mode = &dp->mode;
|
|
|
|
DRM_DEV_INFO(dp->dev, "Connected with sink. Re-train link\n");
|
|
@@ -966,7 +966,7 @@ static void cdn_dp_pd_event_work(struct work_struct *work)
|
|
|
|
/* If training result is changed, update the video config */
|
|
if (mode->clock &&
|
|
- (rate != dp->link.rate || lanes != dp->link.num_lanes)) {
|
|
+ (rate != dp->max_rate || lanes != dp->max_lanes)) {
|
|
ret = cdn_dp_config_video(dp);
|
|
if (ret) {
|
|
dp->connected = false;
|
|
diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.h b/drivers/gpu/drm/rockchip/cdn-dp-core.h
|
|
index b85ea89eb60b..83c4586665b4 100644
|
|
--- a/drivers/gpu/drm/rockchip/cdn-dp-core.h
|
|
+++ b/drivers/gpu/drm/rockchip/cdn-dp-core.h
|
|
@@ -92,9 +92,10 @@ struct cdn_dp_device {
|
|
struct reset_control *core_rst;
|
|
struct audio_info audio_info;
|
|
struct video_info video_info;
|
|
- struct drm_dp_link link;
|
|
struct cdn_dp_port *port[MAX_PHY];
|
|
u8 ports;
|
|
+ u8 max_lanes;
|
|
+ u8 max_rate;
|
|
u8 lanes;
|
|
int active_port;
|
|
|
|
diff --git a/drivers/gpu/drm/rockchip/cdn-dp-reg.c b/drivers/gpu/drm/rockchip/cdn-dp-reg.c
|
|
index 077c87021908..7361c07cb4a7 100644
|
|
--- a/drivers/gpu/drm/rockchip/cdn-dp-reg.c
|
|
+++ b/drivers/gpu/drm/rockchip/cdn-dp-reg.c
|
|
@@ -535,8 +535,8 @@ static int cdn_dp_get_training_status(struct cdn_dp_device *dp)
|
|
if (ret)
|
|
goto err_get_training_status;
|
|
|
|
- dp->link.rate = drm_dp_bw_code_to_link_rate(status[0]);
|
|
- dp->link.num_lanes = status[1];
|
|
+ dp->max_rate = drm_dp_bw_code_to_link_rate(status[0]);
|
|
+ dp->max_lanes = status[1];
|
|
|
|
err_get_training_status:
|
|
if (ret)
|
|
@@ -560,8 +560,8 @@ int cdn_dp_train_link(struct cdn_dp_device *dp)
|
|
return ret;
|
|
}
|
|
|
|
- DRM_DEV_DEBUG_KMS(dp->dev, "rate:0x%x, lanes:%d\n", dp->link.rate,
|
|
- dp->link.num_lanes);
|
|
+ DRM_DEV_DEBUG_KMS(dp->dev, "rate:0x%x, lanes:%d\n", dp->max_rate,
|
|
+ dp->max_lanes);
|
|
return ret;
|
|
}
|
|
|
|
@@ -639,7 +639,7 @@ int cdn_dp_config_video(struct cdn_dp_device *dp)
|
|
bit_per_pix = (video->color_fmt == YCBCR_4_2_2) ?
|
|
(video->color_depth * 2) : (video->color_depth * 3);
|
|
|
|
- link_rate = dp->link.rate / 1000;
|
|
+ link_rate = dp->max_rate / 1000;
|
|
|
|
ret = cdn_dp_reg_write(dp, BND_HSYNC2VSYNC, VIF_BYPASS_INTERLACE);
|
|
if (ret)
|
|
@@ -659,14 +659,13 @@ int cdn_dp_config_video(struct cdn_dp_device *dp)
|
|
do {
|
|
tu_size_reg += 2;
|
|
symbol = tu_size_reg * mode->clock * bit_per_pix;
|
|
- do_div(symbol, dp->link.num_lanes * link_rate * 8);
|
|
+ do_div(symbol, dp->max_lanes * link_rate * 8);
|
|
rem = do_div(symbol, 1000);
|
|
if (tu_size_reg > 64) {
|
|
ret = -EINVAL;
|
|
DRM_DEV_ERROR(dp->dev,
|
|
"tu error, clk:%d, lanes:%d, rate:%d\n",
|
|
- mode->clock, dp->link.num_lanes,
|
|
- link_rate);
|
|
+ mode->clock, dp->max_lanes, link_rate);
|
|
goto err_config_video;
|
|
}
|
|
} while ((symbol <= 1) || (tu_size_reg - symbol < 4) ||
|
|
@@ -680,7 +679,7 @@ int cdn_dp_config_video(struct cdn_dp_device *dp)
|
|
|
|
/* set the FIFO Buffer size */
|
|
val = div_u64(mode->clock * (symbol + 1), 1000) + link_rate;
|
|
- val /= (dp->link.num_lanes * link_rate);
|
|
+ val /= (dp->max_lanes * link_rate);
|
|
val = div_u64(8 * (symbol + 1), bit_per_pix) - val;
|
|
val += 2;
|
|
ret = cdn_dp_reg_write(dp, DP_VC_TABLE(15), val);
|
|
@@ -833,7 +832,7 @@ static void cdn_dp_audio_config_i2s(struct cdn_dp_device *dp,
|
|
u32 val;
|
|
|
|
if (audio->channels == 2) {
|
|
- if (dp->link.num_lanes == 1)
|
|
+ if (dp->max_lanes == 1)
|
|
sub_pckt_num = 2;
|
|
else
|
|
sub_pckt_num = 4;
|
|
|
|
From 489b10706b4e317f21ea961b5926d46609005cc2 Mon Sep 17 00:00:00 2001
|
|
From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Date: Wed, 9 Oct 2019 11:49:19 -0300
|
|
Subject: [PATCH] media: cec-pin: add 'received' callback
|
|
|
|
Drivers that use the CEC pin framework have no way of processing messages
|
|
themselves by providing the 'received' callback. This is present in
|
|
cec_ops, but not in cec_pin_ops.
|
|
|
|
Add support for this callback.
|
|
|
|
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
|
|
(cherry picked from commit 69e3235d58260d3d03570271da314829f9486237)
|
|
---
|
|
drivers/media/cec/cec-pin.c | 10 ++++++++++
|
|
include/media/cec-pin.h | 10 ++++++++--
|
|
2 files changed, 18 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/drivers/media/cec/cec-pin.c b/drivers/media/cec/cec-pin.c
|
|
index 8f987bc0dd88..660fe111f540 100644
|
|
--- a/drivers/media/cec/cec-pin.c
|
|
+++ b/drivers/media/cec/cec-pin.c
|
|
@@ -1279,6 +1279,15 @@ static void cec_pin_adap_free(struct cec_adapter *adap)
|
|
kfree(pin);
|
|
}
|
|
|
|
+static int cec_pin_received(struct cec_adapter *adap, struct cec_msg *msg)
|
|
+{
|
|
+ struct cec_pin *pin = adap->pin;
|
|
+
|
|
+ if (pin->ops->received)
|
|
+ return pin->ops->received(adap, msg);
|
|
+ return -ENOMSG;
|
|
+}
|
|
+
|
|
void cec_pin_changed(struct cec_adapter *adap, bool value)
|
|
{
|
|
struct cec_pin *pin = adap->pin;
|
|
@@ -1301,6 +1310,7 @@ static const struct cec_adap_ops cec_pin_adap_ops = {
|
|
.error_inj_parse_line = cec_pin_error_inj_parse_line,
|
|
.error_inj_show = cec_pin_error_inj_show,
|
|
#endif
|
|
+ .received = cec_pin_received,
|
|
};
|
|
|
|
struct cec_adapter *cec_pin_allocate_adapter(const struct cec_pin_ops *pin_ops,
|
|
diff --git a/include/media/cec-pin.h b/include/media/cec-pin.h
|
|
index 604e79cb6cbf..88c8b016eb09 100644
|
|
--- a/include/media/cec-pin.h
|
|
+++ b/include/media/cec-pin.h
|
|
@@ -29,8 +29,11 @@
|
|
* an error if negative. If NULL or -ENOTTY is returned,
|
|
* then this is not supported.
|
|
*
|
|
- * These operations are used by the cec pin framework to manipulate
|
|
- * the CEC pin.
|
|
+ * @received: optional. High-level CEC message callback. Allows the driver
|
|
+ * to process CEC messages.
|
|
+ *
|
|
+ * These operations (except for the @received op) are used by the
|
|
+ * cec pin framework to manipulate the CEC pin.
|
|
*/
|
|
struct cec_pin_ops {
|
|
bool (*read)(struct cec_adapter *adap);
|
|
@@ -42,6 +45,9 @@ struct cec_pin_ops {
|
|
void (*status)(struct cec_adapter *adap, struct seq_file *file);
|
|
int (*read_hpd)(struct cec_adapter *adap);
|
|
int (*read_5v)(struct cec_adapter *adap);
|
|
+
|
|
+ /* High-level CEC message callback */
|
|
+ int (*received)(struct cec_adapter *adap, struct cec_msg *msg);
|
|
};
|
|
|
|
/**
|
|
|
|
From a47d04a098c316a24acf412673f4aba2b30edfd0 Mon Sep 17 00:00:00 2001
|
|
From: Andy Yan <andy.yan@rock-chips.com>
|
|
Date: Mon, 21 Oct 2019 16:45:55 +0800
|
|
Subject: [PATCH] dt-bindings: Add doc about rk3308 General Register Files
|
|
|
|
RK3308 GRF is divided into four sections: GRF, SGRF,
|
|
DETECTGRF, COREGRF. This patch add documentation for
|
|
it.
|
|
|
|
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
|
|
Reviewed-by: Rob Herring <robh@kernel.org>
|
|
Link: https://lore.kernel.org/r/20191021084555.28356-1-andy.yan@rock-chips.com
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit 085d610c501638cc8310086ad33920f7fbf78c51)
|
|
---
|
|
Documentation/devicetree/bindings/soc/rockchip/grf.txt | 11 +++++++++++
|
|
1 file changed, 11 insertions(+)
|
|
|
|
diff --git a/Documentation/devicetree/bindings/soc/rockchip/grf.txt b/Documentation/devicetree/bindings/soc/rockchip/grf.txt
|
|
index d7debec26ba4..61d89749918a 100644
|
|
--- a/Documentation/devicetree/bindings/soc/rockchip/grf.txt
|
|
+++ b/Documentation/devicetree/bindings/soc/rockchip/grf.txt
|
|
@@ -10,6 +10,12 @@ From RK3368 SoCs, the GRF is divided into two sections,
|
|
|
|
On RK3328 SoCs, the GRF adds a section for USB2PHYGRF,
|
|
|
|
+ON RK3308 SoC, the GRF is divided into four sections:
|
|
+- GRF, used for general non-secure system,
|
|
+- SGRF, used for general secure system,
|
|
+- DETECTGRF, used for audio codec system,
|
|
+- COREGRF, used for pvtm,
|
|
+
|
|
Required Properties:
|
|
|
|
- compatible: GRF should be one of the following:
|
|
@@ -19,10 +25,15 @@ Required Properties:
|
|
- "rockchip,rk3188-grf", "syscon": for rk3188
|
|
- "rockchip,rk3228-grf", "syscon": for rk3228
|
|
- "rockchip,rk3288-grf", "syscon": for rk3288
|
|
+ - "rockchip,rk3308-grf", "syscon": for rk3308
|
|
- "rockchip,rk3328-grf", "syscon": for rk3328
|
|
- "rockchip,rk3368-grf", "syscon": for rk3368
|
|
- "rockchip,rk3399-grf", "syscon": for rk3399
|
|
- "rockchip,rv1108-grf", "syscon": for rv1108
|
|
+- compatible: DETECTGRF should be one of the following:
|
|
+ - "rockchip,rk3308-detect-grf", "syscon": for rk3308
|
|
+- compatilbe: COREGRF should be one of the following:
|
|
+ - "rockchip,rk3308-core-grf", "syscon": for rk3308
|
|
- compatible: PMUGRF should be one of the following:
|
|
- "rockchip,px30-pmugrf", "syscon": for px30
|
|
- "rockchip,rk3368-pmugrf", "syscon": for rk3368
|
|
|
|
From 102ef5ec2a234512d621bc75d601da6f5bfc9cd1 Mon Sep 17 00:00:00 2001
|
|
From: Andy Yan <andy.yan@rock-chips.com>
|
|
Date: Mon, 21 Oct 2019 16:46:16 +0800
|
|
Subject: [PATCH] arm64: dts: rockchip: Add core dts for RK3308 SOC
|
|
|
|
RK3308 is a quad Cortex A35 based SOC with rich audio
|
|
interfaces(I2S/PCM/TDM/PDM/SPDIF/VAD/HDMI ARC), which
|
|
designed for intelligent voice interaction and audio
|
|
input/output processing.
|
|
|
|
This patch add basic core dtsi file for it.
|
|
|
|
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
|
|
Link: https://lore.kernel.org/r/20191021084616.28431-1-andy.yan@rock-chips.com
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit 6913c45239fd26a2fab9a30e4a9207de914d98d8)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/rk3308.dtsi | 1739 ++++++++++++++++++++++++++++++
|
|
1 file changed, 1739 insertions(+)
|
|
create mode 100644 arch/arm64/boot/dts/rockchip/rk3308.dtsi
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3308.dtsi b/arch/arm64/boot/dts/rockchip/rk3308.dtsi
|
|
new file mode 100644
|
|
index 000000000000..8bdc66c62975
|
|
--- /dev/null
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3308.dtsi
|
|
@@ -0,0 +1,1739 @@
|
|
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
|
+/*
|
|
+ * Copyright (c) 2019 Fuzhou Rockchip Electronics Co., Ltd
|
|
+ *
|
|
+ */
|
|
+
|
|
+#include <dt-bindings/clock/rk3308-cru.h>
|
|
+#include <dt-bindings/gpio/gpio.h>
|
|
+#include <dt-bindings/interrupt-controller/arm-gic.h>
|
|
+#include <dt-bindings/interrupt-controller/irq.h>
|
|
+#include <dt-bindings/pinctrl/rockchip.h>
|
|
+#include <dt-bindings/soc/rockchip,boot-mode.h>
|
|
+#include <dt-bindings/thermal/thermal.h>
|
|
+
|
|
+/ {
|
|
+ compatible = "rockchip,rk3308";
|
|
+
|
|
+ interrupt-parent = <&gic>;
|
|
+ #address-cells = <2>;
|
|
+ #size-cells = <2>;
|
|
+
|
|
+ aliases {
|
|
+ i2c0 = &i2c0;
|
|
+ i2c1 = &i2c1;
|
|
+ i2c2 = &i2c2;
|
|
+ i2c3 = &i2c3;
|
|
+ serial0 = &uart0;
|
|
+ serial1 = &uart1;
|
|
+ serial2 = &uart2;
|
|
+ serial3 = &uart3;
|
|
+ serial4 = &uart4;
|
|
+ spi0 = &spi0;
|
|
+ spi1 = &spi1;
|
|
+ spi2 = &spi2;
|
|
+ };
|
|
+
|
|
+ cpus {
|
|
+ #address-cells = <2>;
|
|
+ #size-cells = <0>;
|
|
+
|
|
+ cpu0: cpu@0 {
|
|
+ device_type = "cpu";
|
|
+ compatible = "arm,cortex-a35", "arm,armv8";
|
|
+ reg = <0x0 0x0>;
|
|
+ enable-method = "psci";
|
|
+ clocks = <&cru ARMCLK>;
|
|
+ #cooling-cells = <2>;
|
|
+ dynamic-power-coefficient = <90>;
|
|
+ operating-points-v2 = <&cpu0_opp_table>;
|
|
+ cpu-idle-states = <&CPU_SLEEP>;
|
|
+ next-level-cache = <&l2>;
|
|
+ };
|
|
+
|
|
+ cpu1: cpu@1 {
|
|
+ device_type = "cpu";
|
|
+ compatible = "arm,cortex-a35", "arm,armv8";
|
|
+ reg = <0x0 0x1>;
|
|
+ enable-method = "psci";
|
|
+ operating-points-v2 = <&cpu0_opp_table>;
|
|
+ cpu-idle-states = <&CPU_SLEEP>;
|
|
+ next-level-cache = <&l2>;
|
|
+ };
|
|
+
|
|
+ cpu2: cpu@2 {
|
|
+ device_type = "cpu";
|
|
+ compatible = "arm,cortex-a35", "arm,armv8";
|
|
+ reg = <0x0 0x2>;
|
|
+ enable-method = "psci";
|
|
+ operating-points-v2 = <&cpu0_opp_table>;
|
|
+ cpu-idle-states = <&CPU_SLEEP>;
|
|
+ next-level-cache = <&l2>;
|
|
+ };
|
|
+
|
|
+ cpu3: cpu@3 {
|
|
+ device_type = "cpu";
|
|
+ compatible = "arm,cortex-a35", "arm,armv8";
|
|
+ reg = <0x0 0x3>;
|
|
+ enable-method = "psci";
|
|
+ operating-points-v2 = <&cpu0_opp_table>;
|
|
+ cpu-idle-states = <&CPU_SLEEP>;
|
|
+ next-level-cache = <&l2>;
|
|
+ };
|
|
+
|
|
+ idle-states {
|
|
+ entry-method = "psci";
|
|
+
|
|
+ CPU_SLEEP: cpu-sleep {
|
|
+ compatible = "arm,idle-state";
|
|
+ local-timer-stop;
|
|
+ arm,psci-suspend-param = <0x0010000>;
|
|
+ entry-latency-us = <120>;
|
|
+ exit-latency-us = <250>;
|
|
+ min-residency-us = <900>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ l2: l2-cache {
|
|
+ compatible = "cache";
|
|
+ };
|
|
+ };
|
|
+
|
|
+ cpu0_opp_table: cpu0-opp-table {
|
|
+ compatible = "operating-points-v2";
|
|
+ opp-shared;
|
|
+
|
|
+ opp-408000000 {
|
|
+ opp-hz = /bits/ 64 <408000000>;
|
|
+ opp-microvolt = <950000 950000 1340000>;
|
|
+ clock-latency-ns = <40000>;
|
|
+ opp-suspend;
|
|
+ };
|
|
+ opp-600000000 {
|
|
+ opp-hz = /bits/ 64 <600000000>;
|
|
+ opp-microvolt = <950000 950000 1340000>;
|
|
+ clock-latency-ns = <40000>;
|
|
+ };
|
|
+ opp-816000000 {
|
|
+ opp-hz = /bits/ 64 <816000000>;
|
|
+ opp-microvolt = <1025000 1025000 1340000>;
|
|
+ clock-latency-ns = <40000>;
|
|
+ };
|
|
+ opp-1008000000 {
|
|
+ opp-hz = /bits/ 64 <1008000000>;
|
|
+ opp-microvolt = <1125000 1125000 1340000>;
|
|
+ clock-latency-ns = <40000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ arm-pmu {
|
|
+ compatible = "arm,cortex-a53-pmu";
|
|
+ interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>,
|
|
+ <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>,
|
|
+ <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>,
|
|
+ <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>;
|
|
+ };
|
|
+
|
|
+ mac_clkin: external-mac-clock {
|
|
+ compatible = "fixed-clock";
|
|
+ clock-frequency = <50000000>;
|
|
+ clock-output-names = "mac_clkin";
|
|
+ #clock-cells = <0>;
|
|
+ };
|
|
+
|
|
+ psci {
|
|
+ compatible = "arm,psci-1.0";
|
|
+ method = "smc";
|
|
+ };
|
|
+
|
|
+ timer {
|
|
+ compatible = "arm,armv8-timer";
|
|
+ interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>,
|
|
+ <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>,
|
|
+ <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>,
|
|
+ <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
|
|
+ };
|
|
+
|
|
+ xin24m: xin24m {
|
|
+ compatible = "fixed-clock";
|
|
+ #clock-cells = <0>;
|
|
+ clock-frequency = <24000000>;
|
|
+ clock-output-names = "xin24m";
|
|
+ };
|
|
+
|
|
+ grf: grf@ff000000 {
|
|
+ compatible = "rockchip,rk3308-grf", "syscon", "simple-mfd";
|
|
+ reg = <0x0 0xff000000 0x0 0x10000>;
|
|
+
|
|
+ reboot-mode {
|
|
+ compatible = "syscon-reboot-mode";
|
|
+ offset = <0x500>;
|
|
+ mode-bootloader = <BOOT_BL_DOWNLOAD>;
|
|
+ mode-loader = <BOOT_BL_DOWNLOAD>;
|
|
+ mode-normal = <BOOT_NORMAL>;
|
|
+ mode-recovery = <BOOT_RECOVERY>;
|
|
+ mode-fastboot = <BOOT_FASTBOOT>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ detect_grf: syscon@ff00b000 {
|
|
+ compatible = "rockchip,rk3308-detect-grf", "syscon", "simple-mfd";
|
|
+ reg = <0x0 0xff00b000 0x0 0x1000>;
|
|
+ #address-cells = <1>;
|
|
+ #size-cells = <1>;
|
|
+ };
|
|
+
|
|
+ core_grf: syscon@ff00c000 {
|
|
+ compatible = "rockchip,rk3308-core-grf", "syscon", "simple-mfd";
|
|
+ reg = <0x0 0xff00c000 0x0 0x1000>;
|
|
+ #address-cells = <1>;
|
|
+ #size-cells = <1>;
|
|
+ };
|
|
+
|
|
+ i2c0: i2c@ff040000 {
|
|
+ compatible = "rockchip,rk3308-i2c", "rockchip,rk3399-i2c";
|
|
+ reg = <0x0 0xff040000 0x0 0x1000>;
|
|
+ clocks = <&cru SCLK_I2C0>, <&cru PCLK_I2C0>;
|
|
+ clock-names = "i2c", "pclk";
|
|
+ interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&i2c0_xfer>;
|
|
+ #address-cells = <1>;
|
|
+ #size-cells = <0>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ i2c1: i2c@ff050000 {
|
|
+ compatible = "rockchip,rk3308-i2c", "rockchip,rk3399-i2c";
|
|
+ reg = <0x0 0xff050000 0x0 0x1000>;
|
|
+ clocks = <&cru SCLK_I2C1>, <&cru PCLK_I2C1>;
|
|
+ clock-names = "i2c", "pclk";
|
|
+ interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&i2c1_xfer>;
|
|
+ #address-cells = <1>;
|
|
+ #size-cells = <0>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ i2c2: i2c@ff060000 {
|
|
+ compatible = "rockchip,rk3308-i2c", "rockchip,rk3399-i2c";
|
|
+ reg = <0x0 0xff060000 0x0 0x1000>;
|
|
+ clocks = <&cru SCLK_I2C2>, <&cru PCLK_I2C2>;
|
|
+ clock-names = "i2c", "pclk";
|
|
+ interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&i2c2_xfer>;
|
|
+ #address-cells = <1>;
|
|
+ #size-cells = <0>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ i2c3: i2c@ff070000 {
|
|
+ compatible = "rockchip,rk3308-i2c", "rockchip,rk3399-i2c";
|
|
+ reg = <0x0 0xff070000 0x0 0x1000>;
|
|
+ clocks = <&cru SCLK_I2C3>, <&cru PCLK_I2C3>;
|
|
+ clock-names = "i2c", "pclk";
|
|
+ interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&i2c3m0_xfer>;
|
|
+ #address-cells = <1>;
|
|
+ #size-cells = <0>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ wdt: watchdog@ff080000 {
|
|
+ compatible = "snps,dw-wdt";
|
|
+ reg = <0x0 0xff080000 0x0 0x100>;
|
|
+ clocks = <&cru PCLK_WDT>;
|
|
+ interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ uart0: serial@ff0a0000 {
|
|
+ compatible = "rockchip,rk3308-uart", "snps,dw-apb-uart";
|
|
+ reg = <0x0 0xff0a0000 0x0 0x100>;
|
|
+ interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ clocks = <&cru SCLK_UART0>, <&cru PCLK_UART0>;
|
|
+ clock-names = "baudclk", "apb_pclk";
|
|
+ reg-shift = <2>;
|
|
+ reg-io-width = <4>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ uart1: serial@ff0b0000 {
|
|
+ compatible = "rockchip,rk3308-uart", "snps,dw-apb-uart";
|
|
+ reg = <0x0 0xff0b0000 0x0 0x100>;
|
|
+ interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ clocks = <&cru SCLK_UART1>, <&cru PCLK_UART1>;
|
|
+ clock-names = "baudclk", "apb_pclk";
|
|
+ reg-shift = <2>;
|
|
+ reg-io-width = <4>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&uart1_xfer &uart1_cts &uart1_rts>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ uart2: serial@ff0c0000 {
|
|
+ compatible = "rockchip,rk3308-uart", "snps,dw-apb-uart";
|
|
+ reg = <0x0 0xff0c0000 0x0 0x100>;
|
|
+ interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ clocks = <&cru SCLK_UART2>, <&cru PCLK_UART2>;
|
|
+ clock-names = "baudclk", "apb_pclk";
|
|
+ reg-shift = <2>;
|
|
+ reg-io-width = <4>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&uart2m0_xfer>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ uart3: serial@ff0d0000 {
|
|
+ compatible = "rockchip,rk3308-uart", "snps,dw-apb-uart";
|
|
+ reg = <0x0 0xff0d0000 0x0 0x100>;
|
|
+ interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ clocks = <&cru SCLK_UART3>, <&cru PCLK_UART3>;
|
|
+ clock-names = "baudclk", "apb_pclk";
|
|
+ reg-shift = <2>;
|
|
+ reg-io-width = <4>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&uart3_xfer>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ uart4: serial@ff0e0000 {
|
|
+ compatible = "rockchip,rk3308-uart", "snps,dw-apb-uart";
|
|
+ reg = <0x0 0xff0e0000 0x0 0x100>;
|
|
+ interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ clocks = <&cru SCLK_UART4>, <&cru PCLK_UART4>;
|
|
+ clock-names = "baudclk", "apb_pclk";
|
|
+ reg-shift = <2>;
|
|
+ reg-io-width = <4>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&uart4_xfer &uart4_cts &uart4_rts>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ spi0: spi@ff120000 {
|
|
+ compatible = "rockchip,rk3308-spi", "rockchip,rk3066-spi";
|
|
+ reg = <0x0 0xff120000 0x0 0x1000>;
|
|
+ interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ #address-cells = <1>;
|
|
+ #size-cells = <0>;
|
|
+ clocks = <&cru SCLK_SPI0>, <&cru PCLK_SPI0>;
|
|
+ clock-names = "spiclk", "apb_pclk";
|
|
+ dmas = <&dmac0 0>, <&dmac0 1>;
|
|
+ dma-names = "tx", "rx";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&spi0_clk &spi0_csn0 &spi0_miso &spi0_mosi>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ spi1: spi@ff130000 {
|
|
+ compatible = "rockchip,rk3308-spi", "rockchip,rk3066-spi";
|
|
+ reg = <0x0 0xff130000 0x0 0x1000>;
|
|
+ interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ #address-cells = <1>;
|
|
+ #size-cells = <0>;
|
|
+ clocks = <&cru SCLK_SPI1>, <&cru PCLK_SPI1>;
|
|
+ clock-names = "spiclk", "apb_pclk";
|
|
+ dmas = <&dmac0 2>, <&dmac0 3>;
|
|
+ dma-names = "tx", "rx";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&spi1_clk &spi1_csn0 &spi1_miso &spi1_mosi>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ spi2: spi@ff140000 {
|
|
+ compatible = "rockchip,rk3308-spi", "rockchip,rk3066-spi";
|
|
+ reg = <0x0 0xff140000 0x0 0x1000>;
|
|
+ interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ #address-cells = <1>;
|
|
+ #size-cells = <0>;
|
|
+ clocks = <&cru SCLK_SPI2>, <&cru PCLK_SPI2>;
|
|
+ clock-names = "spiclk", "apb_pclk";
|
|
+ dmas = <&dmac1 16>, <&dmac1 17>;
|
|
+ dma-names = "tx", "rx";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&spi2_clk &spi2_csn0 &spi2_miso &spi2_mosi>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ pwm8: pwm@ff160000 {
|
|
+ compatible = "rockchip,rk3308-pwm", "rockchip,rk3328-pwm";
|
|
+ reg = <0x0 0xff160000 0x0 0x10>;
|
|
+ clocks = <&cru SCLK_PWM2>, <&cru PCLK_PWM2>;
|
|
+ clock-names = "pwm", "pclk";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&pwm8_pin>;
|
|
+ #pwm-cells = <3>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ pwm9: pwm@ff160010 {
|
|
+ compatible = "rockchip,rk3308-pwm", "rockchip,rk3328-pwm";
|
|
+ reg = <0x0 0xff160010 0x0 0x10>;
|
|
+ clocks = <&cru SCLK_PWM2>, <&cru PCLK_PWM2>;
|
|
+ clock-names = "pwm", "pclk";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&pwm9_pin>;
|
|
+ #pwm-cells = <3>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ pwm10: pwm@ff160020 {
|
|
+ compatible = "rockchip,rk3308-pwm", "rockchip,rk3328-pwm";
|
|
+ reg = <0x0 0xff160020 0x0 0x10>;
|
|
+ clocks = <&cru SCLK_PWM2>, <&cru PCLK_PWM2>;
|
|
+ clock-names = "pwm", "pclk";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&pwm10_pin>;
|
|
+ #pwm-cells = <3>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ pwm11: pwm@ff160030 {
|
|
+ compatible = "rockchip,rk3308-pwm", "rockchip,rk3328-pwm";
|
|
+ reg = <0x0 0xff160030 0x0 0x10>;
|
|
+ clocks = <&cru SCLK_PWM2>, <&cru PCLK_PWM2>;
|
|
+ clock-names = "pwm", "pclk";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&pwm11_pin>;
|
|
+ #pwm-cells = <3>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ pwm4: pwm@ff170000 {
|
|
+ compatible = "rockchip,rk3308-pwm", "rockchip,rk3328-pwm";
|
|
+ reg = <0x0 0xff170000 0x0 0x10>;
|
|
+ clocks = <&cru SCLK_PWM1>, <&cru PCLK_PWM1>;
|
|
+ clock-names = "pwm", "pclk";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&pwm4_pin>;
|
|
+ #pwm-cells = <3>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ pwm5: pwm@ff170010 {
|
|
+ compatible = "rockchip,rk3308-pwm", "rockchip,rk3328-pwm";
|
|
+ reg = <0x0 0xff170010 0x0 0x10>;
|
|
+ clocks = <&cru SCLK_PWM1>, <&cru PCLK_PWM1>;
|
|
+ clock-names = "pwm", "pclk";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&pwm5_pin>;
|
|
+ #pwm-cells = <3>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ pwm6: pwm@ff170020 {
|
|
+ compatible = "rockchip,rk3308-pwm", "rockchip,rk3328-pwm";
|
|
+ reg = <0x0 0xff170020 0x0 0x10>;
|
|
+ clocks = <&cru SCLK_PWM1>, <&cru PCLK_PWM1>;
|
|
+ clock-names = "pwm", "pclk";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&pwm6_pin>;
|
|
+ #pwm-cells = <3>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ pwm7: pwm@ff170030 {
|
|
+ compatible = "rockchip,rk3308-pwm", "rockchip,rk3328-pwm";
|
|
+ reg = <0x0 0xff170030 0x0 0x10>;
|
|
+ clocks = <&cru SCLK_PWM1>, <&cru PCLK_PWM1>;
|
|
+ clock-names = "pwm", "pclk";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&pwm7_pin>;
|
|
+ #pwm-cells = <3>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ pwm0: pwm@ff180000 {
|
|
+ compatible = "rockchip,rk3308-pwm", "rockchip,rk3328-pwm";
|
|
+ reg = <0x0 0xff180000 0x0 0x10>;
|
|
+ clocks = <&cru SCLK_PWM0>, <&cru PCLK_PWM0>;
|
|
+ clock-names = "pwm", "pclk";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&pwm0_pin>;
|
|
+ #pwm-cells = <3>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ pwm1: pwm@ff180010 {
|
|
+ compatible = "rockchip,rk3308-pwm", "rockchip,rk3328-pwm";
|
|
+ reg = <0x0 0xff180010 0x0 0x10>;
|
|
+ clocks = <&cru SCLK_PWM0>, <&cru PCLK_PWM0>;
|
|
+ clock-names = "pwm", "pclk";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&pwm1_pin>;
|
|
+ #pwm-cells = <3>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ pwm2: pwm@ff180020 {
|
|
+ compatible = "rockchip,rk3308-pwm", "rockchip,rk3328-pwm";
|
|
+ reg = <0x0 0xff180020 0x0 0x10>;
|
|
+ clocks = <&cru SCLK_PWM0>, <&cru PCLK_PWM0>;
|
|
+ clock-names = "pwm", "pclk";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&pwm2_pin>;
|
|
+ #pwm-cells = <3>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ pwm3: pwm@ff180030 {
|
|
+ compatible = "rockchip,rk3308-pwm", "rockchip,rk3328-pwm";
|
|
+ reg = <0x0 0xff180030 0x0 0x10>;
|
|
+ clocks = <&cru SCLK_PWM0>, <&cru PCLK_PWM0>;
|
|
+ clock-names = "pwm", "pclk";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&pwm3_pin>;
|
|
+ #pwm-cells = <3>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ rktimer: rktimer@ff1a0000 {
|
|
+ compatible = "rockchip,rk3288-timer";
|
|
+ reg = <0x0 0xff1a0000 0x0 0x20>;
|
|
+ interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ clocks = <&cru PCLK_TIMER>, <&cru SCLK_TIMER0>;
|
|
+ clock-names = "pclk", "timer";
|
|
+ };
|
|
+
|
|
+ saradc: saradc@ff1e0000 {
|
|
+ compatible = "rockchip,rk3308-saradc", "rockchip,rk3399-saradc";
|
|
+ reg = <0x0 0xff1e0000 0x0 0x100>;
|
|
+ interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ clocks = <&cru SCLK_SARADC>, <&cru PCLK_SARADC>;
|
|
+ clock-names = "saradc", "apb_pclk";
|
|
+ #io-channel-cells = <1>;
|
|
+ resets = <&cru SRST_SARADC_P>;
|
|
+ reset-names = "saradc-apb";
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ amba {
|
|
+ compatible = "simple-bus";
|
|
+ #address-cells = <2>;
|
|
+ #size-cells = <2>;
|
|
+ ranges;
|
|
+
|
|
+ dmac0: dma-controller@ff2c0000 {
|
|
+ compatible = "arm,pl330", "arm,primecell";
|
|
+ reg = <0x0 0xff2c0000 0x0 0x4000>;
|
|
+ interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
|
|
+ <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ clocks = <&cru ACLK_DMAC0>;
|
|
+ clock-names = "apb_pclk";
|
|
+ #dma-cells = <1>;
|
|
+ };
|
|
+
|
|
+ dmac1: dma-controller@ff2d0000 {
|
|
+ compatible = "arm,pl330", "arm,primecell";
|
|
+ reg = <0x0 0xff2d0000 0x0 0x4000>;
|
|
+ interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
|
|
+ <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ clocks = <&cru ACLK_DMAC1>;
|
|
+ clock-names = "apb_pclk";
|
|
+ #dma-cells = <1>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ i2s_2ch_0: i2s@ff350000 {
|
|
+ compatible = "rockchip,rk3308-i2s", "rockchip,rk3066-i2s";
|
|
+ reg = <0x0 0xff350000 0x0 0x1000>;
|
|
+ interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ clocks = <&cru SCLK_I2S0_2CH>, <&cru HCLK_I2S0_2CH>;
|
|
+ clock-names = "i2s_clk", "i2s_hclk";
|
|
+ dmas = <&dmac1 8>, <&dmac1 9>;
|
|
+ dma-names = "tx", "rx";
|
|
+ resets = <&cru SRST_I2S0_2CH_M>, <&cru SRST_I2S0_2CH_H>;
|
|
+ reset-names = "reset-m", "reset-h";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&i2s_2ch_0_sclk
|
|
+ &i2s_2ch_0_lrck
|
|
+ &i2s_2ch_0_sdi
|
|
+ &i2s_2ch_0_sdo>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ i2s_2ch_1: i2s@ff360000 {
|
|
+ compatible = "rockchip,rk3308-i2s", "rockchip,rk3066-i2s";
|
|
+ reg = <0x0 0xff360000 0x0 0x1000>;
|
|
+ interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ clocks = <&cru SCLK_I2S1_2CH>, <&cru HCLK_I2S1_2CH>;
|
|
+ clock-names = "i2s_clk", "i2s_hclk";
|
|
+ dmas = <&dmac1 11>;
|
|
+ dma-names = "rx";
|
|
+ resets = <&cru SRST_I2S1_2CH_M>, <&cru SRST_I2S1_2CH_H>;
|
|
+ reset-names = "reset-m", "reset-h";
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ spdif_tx: spdif-tx@ff3a0000 {
|
|
+ compatible = "rockchip,rk3308-spdif", "rockchip,rk3328-spdif";
|
|
+ reg = <0x0 0xff3a0000 0x0 0x1000>;
|
|
+ interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ clocks = <&cru SCLK_SPDIF_TX>, <&cru HCLK_SPDIFTX>;
|
|
+ clock-names = "mclk", "hclk";
|
|
+ dmas = <&dmac1 13>;
|
|
+ dma-names = "tx";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&spdif_out>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ sdmmc: dwmmc@ff480000 {
|
|
+ compatible = "rockchip,rk3308-dw-mshc", "rockchip,rk3288-dw-mshc";
|
|
+ reg = <0x0 0xff480000 0x0 0x4000>;
|
|
+ interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ bus-width = <4>;
|
|
+ clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>,
|
|
+ <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>;
|
|
+ clock-names = "biu", "ciu", "ciu-drv", "ciu-sample";
|
|
+ fifo-depth = <0x100>;
|
|
+ max-frequency = <150000000>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_det &sdmmc_bus4>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ emmc: dwmmc@ff490000 {
|
|
+ compatible = "rockchip,rk3308-dw-mshc", "rockchip,rk3288-dw-mshc";
|
|
+ reg = <0x0 0xff490000 0x0 0x4000>;
|
|
+ interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ bus-width = <8>;
|
|
+ clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>,
|
|
+ <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>;
|
|
+ clock-names = "biu", "ciu", "ciu-drv", "ciu-sample";
|
|
+ fifo-depth = <0x100>;
|
|
+ max-frequency = <150000000>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ sdio: dwmmc@ff4a0000 {
|
|
+ compatible = "rockchip,rk3308-dw-mshc", "rockchip,rk3288-dw-mshc";
|
|
+ reg = <0x0 0xff4a0000 0x0 0x4000>;
|
|
+ interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ bus-width = <4>;
|
|
+ clocks = <&cru HCLK_SDIO>, <&cru SCLK_SDIO>,
|
|
+ <&cru SCLK_SDIO_DRV>, <&cru SCLK_SDIO_SAMPLE>;
|
|
+ clock-names = "biu", "ciu", "ciu-drv", "ciu-sample";
|
|
+ fifo-depth = <0x100>;
|
|
+ max-frequency = <150000000>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&sdio_bus4 &sdio_cmd &sdio_clk>;
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ cru: clock-controller@ff500000 {
|
|
+ compatible = "rockchip,rk3308-cru";
|
|
+ reg = <0x0 0xff500000 0x0 0x1000>;
|
|
+ #clock-cells = <1>;
|
|
+ #reset-cells = <1>;
|
|
+ rockchip,grf = <&grf>;
|
|
+
|
|
+ assigned-clocks = <&cru SCLK_RTC32K>;
|
|
+ assigned-clock-rates = <32768>;
|
|
+ };
|
|
+
|
|
+ gic: interrupt-controller@ff580000 {
|
|
+ compatible = "arm,gic-400";
|
|
+ reg = <0x0 0xff581000 0x0 0x1000>,
|
|
+ <0x0 0xff582000 0x0 0x2000>,
|
|
+ <0x0 0xff584000 0x0 0x2000>,
|
|
+ <0x0 0xff586000 0x0 0x2000>;
|
|
+ interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ #interrupt-cells = <3>;
|
|
+ interrupt-controller;
|
|
+ #address-cells = <0>;
|
|
+ };
|
|
+
|
|
+ sram: sram@fff80000 {
|
|
+ compatible = "mmio-sram";
|
|
+ reg = <0x0 0xfff80000 0x0 0x40000>;
|
|
+ ranges = <0 0x0 0xfff80000 0x40000>;
|
|
+ #address-cells = <1>;
|
|
+ #size-cells = <1>;
|
|
+
|
|
+ /* reserved for ddr dvfs and system suspend/resume */
|
|
+ ddr-sram@0 {
|
|
+ reg = <0x0 0x8000>;
|
|
+ };
|
|
+
|
|
+ /* reserved for vad audio buffer */
|
|
+ vad_sram: vad-sram@8000 {
|
|
+ reg = <0x8000 0x38000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ pinctrl: pinctrl {
|
|
+ compatible = "rockchip,rk3308-pinctrl";
|
|
+ rockchip,grf = <&grf>;
|
|
+ #address-cells = <2>;
|
|
+ #size-cells = <2>;
|
|
+ ranges;
|
|
+
|
|
+ gpio0: gpio0@ff220000 {
|
|
+ compatible = "rockchip,gpio-bank";
|
|
+ reg = <0x0 0xff220000 0x0 0x100>;
|
|
+ interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ clocks = <&cru PCLK_GPIO0>;
|
|
+ gpio-controller;
|
|
+ #gpio-cells = <2>;
|
|
+ interrupt-controller;
|
|
+ #interrupt-cells = <2>;
|
|
+ };
|
|
+
|
|
+ gpio1: gpio1@ff230000 {
|
|
+ compatible = "rockchip,gpio-bank";
|
|
+ reg = <0x0 0xff230000 0x0 0x100>;
|
|
+ interrupts = <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ clocks = <&cru PCLK_GPIO1>;
|
|
+ gpio-controller;
|
|
+ #gpio-cells = <2>;
|
|
+ interrupt-controller;
|
|
+ #interrupt-cells = <2>;
|
|
+ };
|
|
+
|
|
+ gpio2: gpio2@ff240000 {
|
|
+ compatible = "rockchip,gpio-bank";
|
|
+ reg = <0x0 0xff240000 0x0 0x100>;
|
|
+ interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ clocks = <&cru PCLK_GPIO2>;
|
|
+ gpio-controller;
|
|
+ #gpio-cells = <2>;
|
|
+ interrupt-controller;
|
|
+ #interrupt-cells = <2>;
|
|
+ };
|
|
+
|
|
+ gpio3: gpio3@ff250000 {
|
|
+ compatible = "rockchip,gpio-bank";
|
|
+ reg = <0x0 0xff250000 0x0 0x100>;
|
|
+ interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ clocks = <&cru PCLK_GPIO3>;
|
|
+ gpio-controller;
|
|
+ #gpio-cells = <2>;
|
|
+ interrupt-controller;
|
|
+ #interrupt-cells = <2>;
|
|
+ };
|
|
+
|
|
+ gpio4: gpio4@ff260000 {
|
|
+ compatible = "rockchip,gpio-bank";
|
|
+ reg = <0x0 0xff260000 0x0 0x100>;
|
|
+ interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ clocks = <&cru PCLK_GPIO4>;
|
|
+ gpio-controller;
|
|
+ #gpio-cells = <2>;
|
|
+ interrupt-controller;
|
|
+ #interrupt-cells = <2>;
|
|
+ };
|
|
+
|
|
+ pcfg_pull_up: pcfg-pull-up {
|
|
+ bias-pull-up;
|
|
+ };
|
|
+
|
|
+ pcfg_pull_down: pcfg-pull-down {
|
|
+ bias-pull-down;
|
|
+ };
|
|
+
|
|
+ pcfg_pull_none: pcfg-pull-none {
|
|
+ bias-disable;
|
|
+ };
|
|
+
|
|
+ pcfg_pull_none_2ma: pcfg-pull-none-2ma {
|
|
+ bias-disable;
|
|
+ drive-strength = <2>;
|
|
+ };
|
|
+
|
|
+ pcfg_pull_up_2ma: pcfg-pull-up-2ma {
|
|
+ bias-pull-up;
|
|
+ drive-strength = <2>;
|
|
+ };
|
|
+
|
|
+ pcfg_pull_up_4ma: pcfg-pull-up-4ma {
|
|
+ bias-pull-up;
|
|
+ drive-strength = <4>;
|
|
+ };
|
|
+
|
|
+ pcfg_pull_none_4ma: pcfg-pull-none-4ma {
|
|
+ bias-disable;
|
|
+ drive-strength = <4>;
|
|
+ };
|
|
+
|
|
+ pcfg_pull_down_4ma: pcfg-pull-down-4ma {
|
|
+ bias-pull-down;
|
|
+ drive-strength = <4>;
|
|
+ };
|
|
+
|
|
+ pcfg_pull_none_8ma: pcfg-pull-none-8ma {
|
|
+ bias-disable;
|
|
+ drive-strength = <8>;
|
|
+ };
|
|
+
|
|
+ pcfg_pull_up_8ma: pcfg-pull-up-8ma {
|
|
+ bias-pull-up;
|
|
+ drive-strength = <8>;
|
|
+ };
|
|
+
|
|
+ pcfg_pull_none_12ma: pcfg-pull-none-12ma {
|
|
+ bias-disable;
|
|
+ drive-strength = <12>;
|
|
+ };
|
|
+
|
|
+ pcfg_pull_up_12ma: pcfg-pull-up-12ma {
|
|
+ bias-pull-up;
|
|
+ drive-strength = <12>;
|
|
+ };
|
|
+
|
|
+ pcfg_pull_none_smt: pcfg-pull-none-smt {
|
|
+ bias-disable;
|
|
+ input-schmitt-enable;
|
|
+ };
|
|
+
|
|
+ pcfg_output_high: pcfg-output-high {
|
|
+ output-high;
|
|
+ };
|
|
+
|
|
+ pcfg_output_low: pcfg-output-low {
|
|
+ output-low;
|
|
+ };
|
|
+
|
|
+ pcfg_input_high: pcfg-input-high {
|
|
+ bias-pull-up;
|
|
+ input-enable;
|
|
+ };
|
|
+
|
|
+ pcfg_input: pcfg-input {
|
|
+ input-enable;
|
|
+ };
|
|
+
|
|
+ emmc {
|
|
+ emmc_clk: emmc-clk {
|
|
+ rockchip,pins =
|
|
+ <3 RK_PB1 2 &pcfg_pull_none_8ma>;
|
|
+ };
|
|
+
|
|
+ emmc_cmd: emmc-cmd {
|
|
+ rockchip,pins =
|
|
+ <3 RK_PB0 2 &pcfg_pull_up_8ma>;
|
|
+ };
|
|
+
|
|
+ emmc_pwren: emmc-pwren {
|
|
+ rockchip,pins =
|
|
+ <3 RK_PB3 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ emmc_rstn: emmc-rstn {
|
|
+ rockchip,pins =
|
|
+ <3 RK_PB2 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ emmc_bus1: emmc-bus1 {
|
|
+ rockchip,pins =
|
|
+ <3 RK_PA0 2 &pcfg_pull_up_8ma>;
|
|
+ };
|
|
+
|
|
+ emmc_bus4: emmc-bus4 {
|
|
+ rockchip,pins =
|
|
+ <3 RK_PA0 2 &pcfg_pull_up_8ma>,
|
|
+ <3 RK_PA1 2 &pcfg_pull_up_8ma>,
|
|
+ <3 RK_PA2 2 &pcfg_pull_up_8ma>,
|
|
+ <3 RK_PA3 2 &pcfg_pull_up_8ma>;
|
|
+ };
|
|
+
|
|
+ emmc_bus8: emmc-bus8 {
|
|
+ rockchip,pins =
|
|
+ <3 RK_PA0 2 &pcfg_pull_up_8ma>,
|
|
+ <3 RK_PA1 2 &pcfg_pull_up_8ma>,
|
|
+ <3 RK_PA2 2 &pcfg_pull_up_8ma>,
|
|
+ <3 RK_PA3 2 &pcfg_pull_up_8ma>,
|
|
+ <3 RK_PA4 2 &pcfg_pull_up_8ma>,
|
|
+ <3 RK_PA5 2 &pcfg_pull_up_8ma>,
|
|
+ <3 RK_PA6 2 &pcfg_pull_up_8ma>,
|
|
+ <3 RK_PA7 2 &pcfg_pull_up_8ma>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ flash {
|
|
+ flash_csn0: flash-csn0 {
|
|
+ rockchip,pins =
|
|
+ <3 RK_PB5 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ flash_rdy: flash-rdy {
|
|
+ rockchip,pins =
|
|
+ <3 RK_PB4 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ flash_ale: flash-ale {
|
|
+ rockchip,pins =
|
|
+ <3 RK_PB3 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ flash_cle: flash-cle {
|
|
+ rockchip,pins =
|
|
+ <3 RK_PB1 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ flash_wrn: flash-wrn {
|
|
+ rockchip,pins =
|
|
+ <3 RK_PB0 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ flash_rdn: flash-rdn {
|
|
+ rockchip,pins =
|
|
+ <3 RK_PB2 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ flash_bus8: flash-bus8 {
|
|
+ rockchip,pins =
|
|
+ <3 RK_PA0 1 &pcfg_pull_up_12ma>,
|
|
+ <3 RK_PA1 1 &pcfg_pull_up_12ma>,
|
|
+ <3 RK_PA2 1 &pcfg_pull_up_12ma>,
|
|
+ <3 RK_PA3 1 &pcfg_pull_up_12ma>,
|
|
+ <3 RK_PA4 1 &pcfg_pull_up_12ma>,
|
|
+ <3 RK_PA5 1 &pcfg_pull_up_12ma>,
|
|
+ <3 RK_PA6 1 &pcfg_pull_up_12ma>,
|
|
+ <3 RK_PA7 1 &pcfg_pull_up_12ma>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ gmac {
|
|
+ rmii_pins: rmii-pins {
|
|
+ rockchip,pins =
|
|
+ /* mac_txen */
|
|
+ <1 RK_PC1 3 &pcfg_pull_none_12ma>,
|
|
+ /* mac_txd1 */
|
|
+ <1 RK_PC3 3 &pcfg_pull_none_12ma>,
|
|
+ /* mac_txd0 */
|
|
+ <1 RK_PC2 3 &pcfg_pull_none_12ma>,
|
|
+ /* mac_rxd0 */
|
|
+ <1 RK_PC4 3 &pcfg_pull_none>,
|
|
+ /* mac_rxd1 */
|
|
+ <1 RK_PC5 3 &pcfg_pull_none>,
|
|
+ /* mac_rxer */
|
|
+ <1 RK_PB7 3 &pcfg_pull_none>,
|
|
+ /* mac_rxdv */
|
|
+ <1 RK_PC0 3 &pcfg_pull_none>,
|
|
+ /* mac_mdio */
|
|
+ <1 RK_PB6 3 &pcfg_pull_none>,
|
|
+ /* mac_mdc */
|
|
+ <1 RK_PB5 3 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ mac_refclk_12ma: mac-refclk-12ma {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PB4 3 &pcfg_pull_none_12ma>;
|
|
+ };
|
|
+
|
|
+ mac_refclk: mac-refclk {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PB4 3 &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ gmac-m1 {
|
|
+ rmiim1_pins: rmiim1-pins {
|
|
+ rockchip,pins =
|
|
+ /* mac_txen */
|
|
+ <4 RK_PB7 2 &pcfg_pull_none_12ma>,
|
|
+ /* mac_txd1 */
|
|
+ <4 RK_PA5 2 &pcfg_pull_none_12ma>,
|
|
+ /* mac_txd0 */
|
|
+ <4 RK_PA4 2 &pcfg_pull_none_12ma>,
|
|
+ /* mac_rxd0 */
|
|
+ <4 RK_PA2 2 &pcfg_pull_none>,
|
|
+ /* mac_rxd1 */
|
|
+ <4 RK_PA3 2 &pcfg_pull_none>,
|
|
+ /* mac_rxer */
|
|
+ <4 RK_PA0 2 &pcfg_pull_none>,
|
|
+ /* mac_rxdv */
|
|
+ <4 RK_PA1 2 &pcfg_pull_none>,
|
|
+ /* mac_mdio */
|
|
+ <4 RK_PB6 2 &pcfg_pull_none>,
|
|
+ /* mac_mdc */
|
|
+ <4 RK_PB5 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ macm1_refclk_12ma: macm1-refclk-12ma {
|
|
+ rockchip,pins =
|
|
+ <4 RK_PB4 2 &pcfg_pull_none_12ma>;
|
|
+ };
|
|
+
|
|
+ macm1_refclk: macm1-refclk {
|
|
+ rockchip,pins =
|
|
+ <4 RK_PB4 2 &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ i2c0 {
|
|
+ i2c0_xfer: i2c0-xfer {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PD0 2 &pcfg_pull_none_smt>,
|
|
+ <1 RK_PD1 2 &pcfg_pull_none_smt>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ i2c1 {
|
|
+ i2c1_xfer: i2c1-xfer {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PB3 1 &pcfg_pull_none_smt>,
|
|
+ <0 RK_PB4 1 &pcfg_pull_none_smt>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ i2c2 {
|
|
+ i2c2_xfer: i2c2-xfer {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PA2 3 &pcfg_pull_none_smt>,
|
|
+ <2 RK_PA3 3 &pcfg_pull_none_smt>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ i2c3-m0 {
|
|
+ i2c3m0_xfer: i2c3m0-xfer {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PB7 2 &pcfg_pull_none_smt>,
|
|
+ <0 RK_PC0 2 &pcfg_pull_none_smt>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ i2c3-m1 {
|
|
+ i2c3m1_xfer: i2c3m1-xfer {
|
|
+ rockchip,pins =
|
|
+ <3 RK_PB4 2 &pcfg_pull_none_smt>,
|
|
+ <3 RK_PB5 2 &pcfg_pull_none_smt>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ i2c3-m2 {
|
|
+ i2c3m2_xfer: i2c3m2-xfer {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PA1 3 &pcfg_pull_none_smt>,
|
|
+ <2 RK_PA0 3 &pcfg_pull_none_smt>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ i2s_2ch_0 {
|
|
+ i2s_2ch_0_mclk: i2s-2ch-0-mclk {
|
|
+ rockchip,pins =
|
|
+ <4 RK_PB4 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_2ch_0_sclk: i2s-2ch-0-sclk {
|
|
+ rockchip,pins =
|
|
+ <4 RK_PB5 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_2ch_0_lrck: i2s-2ch-0-lrck {
|
|
+ rockchip,pins =
|
|
+ <4 RK_PB6 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_2ch_0_sdo: i2s-2ch-0-sdo {
|
|
+ rockchip,pins =
|
|
+ <4 RK_PB7 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_2ch_0_sdi: i2s-2ch-0-sdi {
|
|
+ rockchip,pins =
|
|
+ <4 RK_PC0 1 &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ i2s_8ch_0 {
|
|
+ i2s_8ch_0_mclk: i2s-8ch-0-mclk {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PA4 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_0_sclktx: i2s-8ch-0-sclktx {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PA5 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_0_sclkrx: i2s-8ch-0-sclkrx {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PA6 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_0_lrcktx: i2s-8ch-0-lrcktx {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PA7 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_0_lrckrx: i2s-8ch-0-lrckrx {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PB0 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_0_sdo0: i2s-8ch-0-sdo0 {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PB1 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_0_sdo1: i2s-8ch-0-sdo1 {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PB2 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_0_sdo2: i2s-8ch-0-sdo2 {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PB3 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_0_sdo3: i2s-8ch-0-sdo3 {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PB4 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_0_sdi0: i2s-8ch-0-sdi0 {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PB5 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_0_sdi1: i2s-8ch-0-sdi1 {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PB6 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_0_sdi2: i2s-8ch-0-sdi2 {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PB7 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_0_sdi3: i2s-8ch-0-sdi3 {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PC0 1 &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ i2s_8ch_1_m0 {
|
|
+ i2s_8ch_1_m0_mclk: i2s-8ch-1-m0-mclk {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PA2 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_1_m0_sclktx: i2s-8ch-1-m0-sclktx {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PA3 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_1_m0_sclkrx: i2s-8ch-1-m0-sclkrx {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PA4 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_1_m0_lrcktx: i2s-8ch-1-m0-lrcktx {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PA5 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_1_m0_lrckrx: i2s-8ch-1-m0-lrckrx {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PA6 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_1_m0_sdo0: i2s-8ch-1-m0-sdo0 {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PA7 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_1_m0_sdo1_sdi3: i2s-8ch-1-m0-sdo1-sdi3 {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PB0 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_1_m0_sdo2_sdi2: i2s-8ch-1-m0-sdo2-sdi2 {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PB1 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_1_m0_sdo3_sdi1: i2s-8ch-1-m0-sdo3_sdi1 {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PB2 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_1_m0_sdi0: i2s-8ch-1-m0-sdi0 {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PB3 2 &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ i2s_8ch_1_m1 {
|
|
+ i2s_8ch_1_m1_mclk: i2s-8ch-1-m1-mclk {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PB4 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_1_m1_sclktx: i2s-8ch-1-m1-sclktx {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PB5 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_1_m1_sclkrx: i2s-8ch-1-m1-sclkrx {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PB6 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_1_m1_lrcktx: i2s-8ch-1-m1-lrcktx {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PB7 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_1_m1_lrckrx: i2s-8ch-1-m1-lrckrx {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PC0 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_1_m1_sdo0: i2s-8ch-1-m1-sdo0 {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PC1 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_1_m1_sdo1_sdi3: i2s-8ch-1-m1-sdo1-sdi3 {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PC2 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_1_m1_sdo2_sdi2: i2s-8ch-1-m1-sdo2-sdi2 {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PC3 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_1_m1_sdo3_sdi1: i2s-8ch-1-m1-sdo3_sdi1 {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PC4 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ i2s_8ch_1_m1_sdi0: i2s-8ch-1-m1-sdi0 {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PC5 2 &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ pdm_m0 {
|
|
+ pdm_m0_clk: pdm-m0-clk {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PA4 3 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pdm_m0_sdi0: pdm-m0-sdi0 {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PB3 3 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pdm_m0_sdi1: pdm-m0-sdi1 {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PB2 3 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pdm_m0_sdi2: pdm-m0-sdi2 {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PB1 3 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pdm_m0_sdi3: pdm-m0-sdi3 {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PB0 3 &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ pdm_m1 {
|
|
+ pdm_m1_clk: pdm-m1-clk {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PB6 4 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pdm_m1_sdi0: pdm-m1-sdi0 {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PC5 4 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pdm_m1_sdi1: pdm-m1-sdi1 {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PC4 4 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pdm_m1_sdi2: pdm-m1-sdi2 {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PC3 4 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pdm_m1_sdi3: pdm-m1-sdi3 {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PC2 4 &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ pdm_m2 {
|
|
+ pdm_m2_clkm: pdm-m2-clkm {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PA4 3 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pdm_m2_clk: pdm-m2-clk {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PA6 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pdm_m2_sdi0: pdm-m2-sdi0 {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PB5 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pdm_m2_sdi1: pdm-m2-sdi1 {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PB6 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pdm_m2_sdi2: pdm-m2-sdi2 {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PB7 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pdm_m2_sdi3: pdm-m2-sdi3 {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PC0 2 &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ pwm0 {
|
|
+ pwm0_pin: pwm0-pin {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PB5 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pwm0_pin_pull_down: pwm0-pin-pull-down {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PB5 1 &pcfg_pull_down>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ pwm1 {
|
|
+ pwm1_pin: pwm1-pin {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PB6 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pwm1_pin_pull_down: pwm1-pin-pull-down {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PB6 1 &pcfg_pull_down>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ pwm2 {
|
|
+ pwm2_pin: pwm2-pin {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PB7 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pwm2_pin_pull_down: pwm2-pin-pull-down {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PB7 1 &pcfg_pull_down>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ pwm3 {
|
|
+ pwm3_pin: pwm3-pin {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PC0 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pwm3_pin_pull_down: pwm3-pin-pull-down {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PC0 1 &pcfg_pull_down>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ pwm4 {
|
|
+ pwm4_pin: pwm4-pin {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PA1 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pwm4_pin_pull_down: pwm4-pin-pull-down {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PA1 2 &pcfg_pull_down>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ pwm5 {
|
|
+ pwm5_pin: pwm5-pin {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PC1 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pwm5_pin_pull_down: pwm5-pin-pull-down {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PC1 2 &pcfg_pull_down>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ pwm6 {
|
|
+ pwm6_pin: pwm6-pin {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PC2 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pwm6_pin_pull_down: pwm6-pin-pull-down {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PC2 2 &pcfg_pull_down>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ pwm7 {
|
|
+ pwm7_pin: pwm7-pin {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PB0 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pwm7_pin_pull_down: pwm7-pin-pull-down {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PB0 2 &pcfg_pull_down>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ pwm8 {
|
|
+ pwm8_pin: pwm8-pin {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PB2 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pwm8_pin_pull_down: pwm8-pin-pull-down {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PB2 2 &pcfg_pull_down>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ pwm9 {
|
|
+ pwm9_pin: pwm9-pin {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PB3 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pwm9_pin_pull_down: pwm9-pin-pull-down {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PB3 2 &pcfg_pull_down>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ pwm10 {
|
|
+ pwm10_pin: pwm10-pin {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PB4 2 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pwm10_pin_pull_down: pwm10-pin-pull-down {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PB4 2 &pcfg_pull_down>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ pwm11 {
|
|
+ pwm11_pin: pwm11-pin {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PC0 4 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pwm11_pin_pull_down: pwm11-pin-pull-down {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PC0 4 &pcfg_pull_down>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ rtc {
|
|
+ rtc_32k: rtc-32k {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PC3 1 &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ sdmmc {
|
|
+ sdmmc_clk: sdmmc-clk {
|
|
+ rockchip,pins =
|
|
+ <4 RK_PD5 1 &pcfg_pull_none_4ma>;
|
|
+ };
|
|
+
|
|
+ sdmmc_cmd: sdmmc-cmd {
|
|
+ rockchip,pins =
|
|
+ <4 RK_PD4 1 &pcfg_pull_up_4ma>;
|
|
+ };
|
|
+
|
|
+ sdmmc_det: sdmmc-det {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PA3 1 &pcfg_pull_up_4ma>;
|
|
+ };
|
|
+
|
|
+ sdmmc_pwren: sdmmc-pwren {
|
|
+ rockchip,pins =
|
|
+ <4 RK_PD6 1 &pcfg_pull_none_4ma>;
|
|
+ };
|
|
+
|
|
+ sdmmc_bus1: sdmmc-bus1 {
|
|
+ rockchip,pins =
|
|
+ <4 RK_PD0 1 &pcfg_pull_up_4ma>;
|
|
+ };
|
|
+
|
|
+ sdmmc_bus4: sdmmc-bus4 {
|
|
+ rockchip,pins =
|
|
+ <4 RK_PD0 1 &pcfg_pull_up_4ma>,
|
|
+ <4 RK_PD1 1 &pcfg_pull_up_4ma>,
|
|
+ <4 RK_PD2 1 &pcfg_pull_up_4ma>,
|
|
+ <4 RK_PD3 1 &pcfg_pull_up_4ma>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ sdio {
|
|
+ sdio_clk: sdio-clk {
|
|
+ rockchip,pins =
|
|
+ <4 RK_PA5 1 &pcfg_pull_none_8ma>;
|
|
+ };
|
|
+
|
|
+ sdio_cmd: sdio-cmd {
|
|
+ rockchip,pins =
|
|
+ <4 RK_PA4 1 &pcfg_pull_up_8ma>;
|
|
+ };
|
|
+
|
|
+ sdio_pwren: sdio-pwren {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PA2 1 &pcfg_pull_none_8ma>;
|
|
+ };
|
|
+
|
|
+ sdio_wrpt: sdio-wrpt {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PA1 1 &pcfg_pull_none_8ma>;
|
|
+ };
|
|
+
|
|
+ sdio_intn: sdio-intn {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PA0 1 &pcfg_pull_none_8ma>;
|
|
+ };
|
|
+
|
|
+ sdio_bus1: sdio-bus1 {
|
|
+ rockchip,pins =
|
|
+ <4 RK_PA0 1 &pcfg_pull_up_8ma>;
|
|
+ };
|
|
+
|
|
+ sdio_bus4: sdio-bus4 {
|
|
+ rockchip,pins =
|
|
+ <4 RK_PA0 1 &pcfg_pull_up_8ma>,
|
|
+ <4 RK_PA1 1 &pcfg_pull_up_8ma>,
|
|
+ <4 RK_PA2 1 &pcfg_pull_up_8ma>,
|
|
+ <4 RK_PA3 1 &pcfg_pull_up_8ma>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ spdif_in {
|
|
+ spdif_in: spdif-in {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PC2 1 &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ spdif_out {
|
|
+ spdif_out: spdif-out {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PC1 1 &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ spi0 {
|
|
+ spi0_clk: spi0-clk {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PA2 2 &pcfg_pull_up_4ma>;
|
|
+ };
|
|
+
|
|
+ spi0_csn0: spi0-csn0 {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PA3 2 &pcfg_pull_up_4ma>;
|
|
+ };
|
|
+
|
|
+ spi0_miso: spi0-miso {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PA0 2 &pcfg_pull_up_4ma>;
|
|
+ };
|
|
+
|
|
+ spi0_mosi: spi0-mosi {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PA1 2 &pcfg_pull_up_4ma>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ spi1 {
|
|
+ spi1_clk: spi1-clk {
|
|
+ rockchip,pins =
|
|
+ <3 RK_PB3 3 &pcfg_pull_up_4ma>;
|
|
+ };
|
|
+
|
|
+ spi1_csn0: spi1-csn0 {
|
|
+ rockchip,pins =
|
|
+ <3 RK_PB5 3 &pcfg_pull_up_4ma>;
|
|
+ };
|
|
+
|
|
+ spi1_miso: spi1-miso {
|
|
+ rockchip,pins =
|
|
+ <3 RK_PB2 3 &pcfg_pull_up_4ma>;
|
|
+ };
|
|
+
|
|
+ spi1_mosi: spi1-mosi {
|
|
+ rockchip,pins =
|
|
+ <3 RK_PB4 3 &pcfg_pull_up_4ma>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ spi1-m1 {
|
|
+ spi1m1_miso: spi1m1-miso {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PA4 2 &pcfg_pull_up_4ma>;
|
|
+ };
|
|
+
|
|
+ spi1m1_mosi: spi1m1-mosi {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PA5 2 &pcfg_pull_up_4ma>;
|
|
+ };
|
|
+
|
|
+ spi1m1_clk: spi1m1-clk {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PA7 2 &pcfg_pull_up_4ma>;
|
|
+ };
|
|
+
|
|
+ spi1m1_csn0: spi1m1-csn0 {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PB1 2 &pcfg_pull_up_4ma>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ spi2 {
|
|
+ spi2_clk: spi2-clk {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PD0 3 &pcfg_pull_up_4ma>;
|
|
+ };
|
|
+
|
|
+ spi2_csn0: spi2-csn0 {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PD1 3 &pcfg_pull_up_4ma>;
|
|
+ };
|
|
+
|
|
+ spi2_miso: spi2-miso {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PC6 3 &pcfg_pull_up_4ma>;
|
|
+ };
|
|
+
|
|
+ spi2_mosi: spi2-mosi {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PC7 3 &pcfg_pull_up_4ma>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ tsadc {
|
|
+ tsadc_otp_gpio: tsadc-otp-gpio {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PB2 0 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ tsadc_otp_out: tsadc-otp-out {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PB2 1 &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ uart0 {
|
|
+ uart0_xfer: uart0-xfer {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PA1 1 &pcfg_pull_up>,
|
|
+ <2 RK_PA0 1 &pcfg_pull_up>;
|
|
+ };
|
|
+
|
|
+ uart0_cts: uart0-cts {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PA2 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ uart0_rts: uart0-rts {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PA3 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ uart0_rts_gpio: uart0-rts-gpio {
|
|
+ rockchip,pins =
|
|
+ <2 RK_PA3 0 &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ uart1 {
|
|
+ uart1_xfer: uart1-xfer {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PD1 1 &pcfg_pull_up>,
|
|
+ <1 RK_PD0 1 &pcfg_pull_up>;
|
|
+ };
|
|
+
|
|
+ uart1_cts: uart1-cts {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PC6 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ uart1_rts: uart1-rts {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PC7 1 &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ uart2-m0 {
|
|
+ uart2m0_xfer: uart2m0-xfer {
|
|
+ rockchip,pins =
|
|
+ <1 RK_PC7 2 &pcfg_pull_up>,
|
|
+ <1 RK_PC6 2 &pcfg_pull_up>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ uart2-m1 {
|
|
+ uart2m1_xfer: uart2m1-xfer {
|
|
+ rockchip,pins =
|
|
+ <4 RK_PD3 2 &pcfg_pull_up>,
|
|
+ <4 RK_PD2 2 &pcfg_pull_up>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ uart3 {
|
|
+ uart3_xfer: uart3-xfer {
|
|
+ rockchip,pins =
|
|
+ <3 RK_PB5 4 &pcfg_pull_up>,
|
|
+ <3 RK_PB4 4 &pcfg_pull_up>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ uart3-m1 {
|
|
+ uart3m1_xfer: uart3m1-xfer {
|
|
+ rockchip,pins =
|
|
+ <0 RK_PC2 3 &pcfg_pull_up>,
|
|
+ <0 RK_PC1 3 &pcfg_pull_up>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ uart4 {
|
|
+ uart4_xfer: uart4-xfer {
|
|
+ rockchip,pins =
|
|
+ <4 RK_PB1 1 &pcfg_pull_up>,
|
|
+ <4 RK_PB0 1 &pcfg_pull_up>;
|
|
+ };
|
|
+
|
|
+ uart4_cts: uart4-cts {
|
|
+ rockchip,pins =
|
|
+ <4 RK_PA6 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ uart4_rts: uart4-rts {
|
|
+ rockchip,pins =
|
|
+ <4 RK_PA7 1 &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ uart4_rts_gpio: uart4-rts-gpio {
|
|
+ rockchip,pins =
|
|
+ <4 RK_PA7 0 &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+ };
|
|
+};
|
|
|
|
From dbf563cca4ad28595772340d4da97afe99c5ca98 Mon Sep 17 00:00:00 2001
|
|
From: Andy Yan <andy.yan@rock-chips.com>
|
|
Date: Mon, 21 Oct 2019 16:46:42 +0800
|
|
Subject: [PATCH] dt-bindings: Add doc for rk3308-evb
|
|
|
|
Add compatible for RK3308 Evaluation board
|
|
|
|
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
|
|
Reviewed-by: Rob Herring <robh@kernel.org>
|
|
Link: https://lore.kernel.org/r/20191021084642.28562-1-andy.yan@rock-chips.com
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit 1ebed0392519dc69078e7593517c0b970d3c4448)
|
|
---
|
|
Documentation/devicetree/bindings/arm/rockchip.yaml | 5 +++++
|
|
1 file changed, 5 insertions(+)
|
|
|
|
diff --git a/Documentation/devicetree/bindings/arm/rockchip.yaml b/Documentation/devicetree/bindings/arm/rockchip.yaml
|
|
index 9c7e70335ac0..bf86e8237363 100644
|
|
--- a/Documentation/devicetree/bindings/arm/rockchip.yaml
|
|
+++ b/Documentation/devicetree/bindings/arm/rockchip.yaml
|
|
@@ -464,6 +464,11 @@ properties:
|
|
- rockchip,rk3288-evb-rk808
|
|
- const: rockchip,rk3288
|
|
|
|
+ - description: Rockchip RK3308 Evaluation board
|
|
+ items:
|
|
+ - const: rockchip,rk3308-evb
|
|
+ - const: rockchip,rk3308
|
|
+
|
|
- description: Rockchip RK3328 Evaluation board
|
|
items:
|
|
- const: rockchip,rk3328-evb
|
|
|
|
From b1a1118be116c02a282d6876c52bfd5e4ab5b12c Mon Sep 17 00:00:00 2001
|
|
From: Andy Yan <andy.yan@rock-chips.com>
|
|
Date: Mon, 21 Oct 2019 16:46:57 +0800
|
|
Subject: [PATCH] arm64: dts: rockchip: Add basic dts for RK3308 EVB
|
|
|
|
This board use uart4 as debug port and arm core voltage
|
|
is modulated by pwm, logic voltage is fixed to 1.05V.
|
|
|
|
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
|
|
Link: https://lore.kernel.org/r/20191021084657.28629-1-andy.yan@rock-chips.com
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit b92880e4d719b9f63e61be6a3e6f0e1b747de22f)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/Makefile | 1 +
|
|
arch/arm64/boot/dts/rockchip/rk3308-evb.dts | 230 ++++++++++++++++++++++++++++
|
|
2 files changed, 231 insertions(+)
|
|
create mode 100644 arch/arm64/boot/dts/rockchip/rk3308-evb.dts
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile
|
|
index 1f18a9392d15..a959434ad46e 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/Makefile
|
|
+++ b/arch/arm64/boot/dts/rockchip/Makefile
|
|
@@ -1,5 +1,6 @@
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += px30-evb.dtb
|
|
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3308-evb.dtb
|
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-evb.dtb
|
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-rock64.dtb
|
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-roc-cc.dtb
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3308-evb.dts b/arch/arm64/boot/dts/rockchip/rk3308-evb.dts
|
|
new file mode 100644
|
|
index 000000000000..9b4f855ea5d4
|
|
--- /dev/null
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3308-evb.dts
|
|
@@ -0,0 +1,230 @@
|
|
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
|
+/*
|
|
+ * Copyright (c) 2019 Fuzhou Rockchip Electronics Co., Ltd
|
|
+ *
|
|
+ */
|
|
+
|
|
+/dts-v1/;
|
|
+#include <dt-bindings/input/input.h>
|
|
+#include "rk3308.dtsi"
|
|
+
|
|
+/ {
|
|
+ model = "Rockchip RK3308 EVB";
|
|
+ compatible = "rockchip,rk3308-evb", "rockchip,rk3308";
|
|
+
|
|
+ chosen {
|
|
+ stdout-path = "serial4:1500000n8";
|
|
+ };
|
|
+
|
|
+ adc-keys0 {
|
|
+ compatible = "adc-keys";
|
|
+ io-channels = <&saradc 0>;
|
|
+ io-channel-names = "buttons";
|
|
+ poll-interval = <100>;
|
|
+ keyup-threshold-microvolt = <1800000>;
|
|
+
|
|
+ func-key {
|
|
+ linux,code = <KEY_FN>;
|
|
+ label = "function";
|
|
+ press-threshold-microvolt = <18000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ adc-keys1 {
|
|
+ compatible = "adc-keys";
|
|
+ io-channels = <&saradc 1>;
|
|
+ io-channel-names = "buttons";
|
|
+ poll-interval = <100>;
|
|
+ keyup-threshold-microvolt = <1800000>;
|
|
+
|
|
+ esc-key {
|
|
+ linux,code = <KEY_MICMUTE>;
|
|
+ label = "micmute";
|
|
+ press-threshold-microvolt = <1130000>;
|
|
+ };
|
|
+
|
|
+ home-key {
|
|
+ linux,code = <KEY_MODE>;
|
|
+ label = "mode";
|
|
+ press-threshold-microvolt = <901000>;
|
|
+ };
|
|
+
|
|
+ menu-key {
|
|
+ linux,code = <KEY_PLAY>;
|
|
+ label = "play";
|
|
+ press-threshold-microvolt = <624000>;
|
|
+ };
|
|
+
|
|
+ vol-down-key {
|
|
+ linux,code = <KEY_VOLUMEDOWN>;
|
|
+ label = "volume down";
|
|
+ press-threshold-microvolt = <300000>;
|
|
+ };
|
|
+
|
|
+ vol-up-key {
|
|
+ linux,code = <KEY_VOLUMEUP>;
|
|
+ label = "volume up";
|
|
+ press-threshold-microvolt = <18000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ gpio-keys {
|
|
+ compatible = "gpio-keys";
|
|
+ autorepeat;
|
|
+
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&pwr_key>;
|
|
+
|
|
+ power {
|
|
+ gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_LOW>;
|
|
+ linux,code = <KEY_POWER>;
|
|
+ label = "GPIO Key Power";
|
|
+ debounce-interval = <100>;
|
|
+ wakeup-source;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc12v_dcin: vcc12v-dcin {
|
|
+ compatible = "regulator-fixed";
|
|
+ regulator-name = "vcc12v_dcin";
|
|
+ regulator-min-microvolt = <12000000>;
|
|
+ regulator-max-microvolt = <12000000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ };
|
|
+
|
|
+ vcc5v0_sys: vcc5v0-sys {
|
|
+ compatible = "regulator-fixed";
|
|
+ regulator-name = "vcc5v0_sys";
|
|
+ regulator-min-microvolt = <5000000>;
|
|
+ regulator-max-microvolt = <5000000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ vin-supply = <&vcc12v_dcin>;
|
|
+ };
|
|
+
|
|
+ vccio_sdio: vcc_1v8: vcc-1v8 {
|
|
+ compatible = "regulator-fixed";
|
|
+ regulator-name = "vcc_1v8";
|
|
+ regulator-min-microvolt = <1800000>;
|
|
+ regulator-max-microvolt = <1800000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ vin-supply = <&vcc_io>;
|
|
+ };
|
|
+
|
|
+ vcc_ddr: vcc-ddr {
|
|
+ compatible = "regulator-fixed";
|
|
+ regulator-name = "vcc_ddr";
|
|
+ regulator-min-microvolt = <1500000>;
|
|
+ regulator-max-microvolt = <1500000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ vin-supply = <&vcc5v0_sys>;
|
|
+ };
|
|
+
|
|
+ vcc_io: vcc-io {
|
|
+ compatible = "regulator-fixed";
|
|
+ regulator-name = "vcc_io";
|
|
+ regulator-min-microvolt = <3300000>;
|
|
+ regulator-max-microvolt = <3300000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ vin-supply = <&vcc5v0_sys>;
|
|
+ };
|
|
+
|
|
+ vccio_flash: vccio-flash {
|
|
+ compatible = "regulator-fixed";
|
|
+ regulator-name = "vccio_flash";
|
|
+ regulator-min-microvolt = <3300000>;
|
|
+ regulator-max-microvolt = <3300000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ vin-supply = <&vcc_io>;
|
|
+ };
|
|
+
|
|
+ vcc5v0_host: vcc5v0-host {
|
|
+ compatible = "regulator-fixed";
|
|
+ gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
|
|
+ enable-active-high;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&usb_drv>;
|
|
+ regulator-name = "vbus_host";
|
|
+ vin-supply = <&vcc5v0_sys>;
|
|
+ };
|
|
+
|
|
+ vdd_core: vdd-core {
|
|
+ compatible = "pwm-regulator";
|
|
+ pwms = <&pwm0 0 5000 1>;
|
|
+ regulator-name = "vdd_core";
|
|
+ regulator-min-microvolt = <827000>;
|
|
+ regulator-max-microvolt = <1340000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-settling-time-up-us = <250>;
|
|
+ pwm-supply = <&vcc5v0_sys>;
|
|
+ };
|
|
+
|
|
+ vdd_log: vdd-log {
|
|
+ compatible = "regulator-fixed";
|
|
+ regulator-name = "vdd_log";
|
|
+ regulator-min-microvolt = <1050000>;
|
|
+ regulator-max-microvolt = <1050000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ vin-supply = <&vcc5v0_sys>;
|
|
+ };
|
|
+
|
|
+ vdd_1v0: vdd-1v0 {
|
|
+ compatible = "regulator-fixed";
|
|
+ regulator-name = "vdd_1v0";
|
|
+ regulator-min-microvolt = <1000000>;
|
|
+ regulator-max-microvolt = <1000000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ vin-supply = <&vcc5v0_sys>;
|
|
+ };
|
|
+};
|
|
+
|
|
+&cpu0 {
|
|
+ cpu-supply = <&vdd_core>;
|
|
+};
|
|
+
|
|
+&saradc {
|
|
+ status = "okay";
|
|
+ vref-supply = <&vcc_1v8>;
|
|
+};
|
|
+
|
|
+&pinctrl {
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&rtc_32k>;
|
|
+
|
|
+ buttons {
|
|
+ pwr_key: pwr-key {
|
|
+ rockchip,pins = <0 RK_PA6 0 &pcfg_pull_up>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ usb {
|
|
+ usb_drv: usb-drv {
|
|
+ rockchip,pins = <0 RK_PC5 0 &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ sdio-pwrseq {
|
|
+ wifi_enable_h: wifi-enable-h {
|
|
+ rockchip,pins = <0 RK_PA2 0 &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+};
|
|
+
|
|
+&pwm0 {
|
|
+ status = "okay";
|
|
+ pinctrl-0 = <&pwm0_pin_pull_down>;
|
|
+};
|
|
+
|
|
+&uart4 {
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&uart4_xfer>;
|
|
+ status = "okay";
|
|
+};
|
|
|
|
From e0b4a024876af34b95c1712ed733b3ea43f623ac Mon Sep 17 00:00:00 2001
|
|
From: Markus Reichl <m.reichl@fivetechno.de>
|
|
Date: Sun, 27 Oct 2019 19:06:19 +0100
|
|
Subject: [PATCH] arm64: dts: rockchip: Add LED nodes on rk3399-roc-pc
|
|
|
|
rk3399-roc-pc has three gpio LEDs, enable them.
|
|
|
|
Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
|
|
Link: https://lore.kernel.org/r/7d8d85c9-5fde-7943-a6b6-639bca38bdc1@fivetechno.de
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit cec0e350ca13b489acb829ef4bab5ddcef03dd75)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts | 41 ++++++++++++++++++++++++++
|
|
1 file changed, 41 insertions(+)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
|
|
index 257543d069d8..12d38f6e00ac 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
|
|
@@ -28,6 +28,33 @@
|
|
#clock-cells = <0>;
|
|
};
|
|
|
|
+ leds {
|
|
+ compatible = "gpio-leds";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&work_led_gpio>, <&diy_led_gpio>, <&yellow_led_gpio>;
|
|
+
|
|
+ work-led {
|
|
+ label = "green:work";
|
|
+ gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>;
|
|
+ default-state = "on";
|
|
+ linux,default-trigger = "heartbeat";
|
|
+ };
|
|
+
|
|
+ diy-led {
|
|
+ label = "red:diy";
|
|
+ gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
|
|
+ default-state = "off";
|
|
+ linux,default-trigger = "mmc1";
|
|
+ };
|
|
+
|
|
+ yellow-led {
|
|
+ label = "yellow:yellow-led";
|
|
+ gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
|
|
+ default-state = "off";
|
|
+ linux,default-trigger = "mmc0";
|
|
+ };
|
|
+ };
|
|
+
|
|
sdio_pwrseq: sdio-pwrseq {
|
|
compatible = "mmc-pwrseq-simple";
|
|
clocks = <&rk808 1>;
|
|
@@ -494,6 +521,20 @@
|
|
};
|
|
};
|
|
|
|
+ leds {
|
|
+ diy_led_gpio: diy_led-gpio {
|
|
+ rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ work_led_gpio: work_led-gpio {
|
|
+ rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ yellow_led_gpio: yellow_led-gpio {
|
|
+ rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
pmic {
|
|
vsel1_gpio: vsel1-gpio {
|
|
rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>;
|
|
|
|
From 47c09db6e6714cf95436f9521d4c667a6e1fefdd Mon Sep 17 00:00:00 2001
|
|
From: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
Date: Mon, 28 Oct 2019 15:19:25 +0800
|
|
Subject: [PATCH] drm: bridge: dw-hdmi: Report connector status using callback
|
|
|
|
Allow codec driver register callback function for plug event.
|
|
|
|
The callback registration flow:
|
|
dw-hdmi <--- hw-hdmi-i2s-audio <--- hdmi-codec
|
|
|
|
dw-hdmi-i2s-audio implements hook_plugged_cb op
|
|
so codec driver can register the callback.
|
|
|
|
dw-hdmi exports a function dw_hdmi_set_plugged_cb so platform device
|
|
can register the callback.
|
|
|
|
When connector plug/unplug event happens, report this event using the
|
|
callback.
|
|
|
|
Make sure that audio and drm are using the single source of truth for
|
|
connector status.
|
|
|
|
Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
Link: https://lore.kernel.org/r/20191028071930.145899-2-cychiang@chromium.org
|
|
Signed-off-by: Mark Brown <broonie@kernel.org>
|
|
(cherry picked from commit a9c82d63ca4819d3d03964dbf4aa427b36c5a67f)
|
|
---
|
|
.../gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 11 ++++++
|
|
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 41 +++++++++++++++++++++-
|
|
include/drm/bridge/dw_hdmi.h | 4 +++
|
|
3 files changed, 55 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
|
|
index 20f4f92dd866..d7e65c869415 100644
|
|
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
|
|
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
|
|
@@ -160,12 +160,23 @@ static int dw_hdmi_i2s_get_dai_id(struct snd_soc_component *component,
|
|
return -EINVAL;
|
|
}
|
|
|
|
+static int dw_hdmi_i2s_hook_plugged_cb(struct device *dev, void *data,
|
|
+ hdmi_codec_plugged_cb fn,
|
|
+ struct device *codec_dev)
|
|
+{
|
|
+ struct dw_hdmi_i2s_audio_data *audio = data;
|
|
+ struct dw_hdmi *hdmi = audio->hdmi;
|
|
+
|
|
+ return dw_hdmi_set_plugged_cb(hdmi, fn, codec_dev);
|
|
+}
|
|
+
|
|
static struct hdmi_codec_ops dw_hdmi_i2s_ops = {
|
|
.hw_params = dw_hdmi_i2s_hw_params,
|
|
.audio_startup = dw_hdmi_i2s_audio_startup,
|
|
.audio_shutdown = dw_hdmi_i2s_audio_shutdown,
|
|
.get_eld = dw_hdmi_i2s_get_eld,
|
|
.get_dai_id = dw_hdmi_i2s_get_dai_id,
|
|
+ .hook_plugged_cb = dw_hdmi_i2s_hook_plugged_cb,
|
|
};
|
|
|
|
static int snd_dw_hdmi_probe(struct platform_device *pdev)
|
|
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
|
index dbe38a54870b..67fca439bbfb 100644
|
|
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
|
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
|
@@ -194,6 +194,10 @@ struct dw_hdmi {
|
|
|
|
struct mutex cec_notifier_mutex;
|
|
struct cec_notifier *cec_notifier;
|
|
+
|
|
+ hdmi_codec_plugged_cb plugged_cb;
|
|
+ struct device *codec_dev;
|
|
+ enum drm_connector_status last_connector_result;
|
|
};
|
|
|
|
#define HDMI_IH_PHY_STAT0_RX_SENSE \
|
|
@@ -218,6 +222,28 @@ static inline u8 hdmi_readb(struct dw_hdmi *hdmi, int offset)
|
|
return val;
|
|
}
|
|
|
|
+static void handle_plugged_change(struct dw_hdmi *hdmi, bool plugged)
|
|
+{
|
|
+ if (hdmi->plugged_cb && hdmi->codec_dev)
|
|
+ hdmi->plugged_cb(hdmi->codec_dev, plugged);
|
|
+}
|
|
+
|
|
+int dw_hdmi_set_plugged_cb(struct dw_hdmi *hdmi, hdmi_codec_plugged_cb fn,
|
|
+ struct device *codec_dev)
|
|
+{
|
|
+ bool plugged;
|
|
+
|
|
+ mutex_lock(&hdmi->mutex);
|
|
+ hdmi->plugged_cb = fn;
|
|
+ hdmi->codec_dev = codec_dev;
|
|
+ plugged = hdmi->last_connector_result == connector_status_connected;
|
|
+ handle_plugged_change(hdmi, plugged);
|
|
+ mutex_unlock(&hdmi->mutex);
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+EXPORT_SYMBOL_GPL(dw_hdmi_set_plugged_cb);
|
|
+
|
|
static void hdmi_modb(struct dw_hdmi *hdmi, u8 data, u8 mask, unsigned reg)
|
|
{
|
|
regmap_update_bits(hdmi->regm, reg << hdmi->reg_shift, mask, data);
|
|
@@ -2229,6 +2255,7 @@ dw_hdmi_connector_detect(struct drm_connector *connector, bool force)
|
|
{
|
|
struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi,
|
|
connector);
|
|
+ enum drm_connector_status result;
|
|
|
|
mutex_lock(&hdmi->mutex);
|
|
hdmi->force = DRM_FORCE_UNSPECIFIED;
|
|
@@ -2236,7 +2263,18 @@ dw_hdmi_connector_detect(struct drm_connector *connector, bool force)
|
|
dw_hdmi_update_phy_mask(hdmi);
|
|
mutex_unlock(&hdmi->mutex);
|
|
|
|
- return hdmi->phy.ops->read_hpd(hdmi, hdmi->phy.data);
|
|
+ result = hdmi->phy.ops->read_hpd(hdmi, hdmi->phy.data);
|
|
+
|
|
+ mutex_lock(&hdmi->mutex);
|
|
+ if (result != hdmi->last_connector_result) {
|
|
+ dev_dbg(hdmi->dev, "read_hpd result: %d", result);
|
|
+ handle_plugged_change(hdmi,
|
|
+ result == connector_status_connected);
|
|
+ hdmi->last_connector_result = result;
|
|
+ }
|
|
+ mutex_unlock(&hdmi->mutex);
|
|
+
|
|
+ return result;
|
|
}
|
|
|
|
static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
|
|
@@ -2731,6 +2769,7 @@ __dw_hdmi_probe(struct platform_device *pdev,
|
|
hdmi->rxsense = true;
|
|
hdmi->phy_mask = (u8)~(HDMI_PHY_HPD | HDMI_PHY_RX_SENSE);
|
|
hdmi->mc_clkdis = 0x7f;
|
|
+ hdmi->last_connector_result = connector_status_disconnected;
|
|
|
|
mutex_init(&hdmi->mutex);
|
|
mutex_init(&hdmi->audio_mutex);
|
|
diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
|
|
index fbf3812c4326..9d4d5cc47969 100644
|
|
--- a/include/drm/bridge/dw_hdmi.h
|
|
+++ b/include/drm/bridge/dw_hdmi.h
|
|
@@ -6,6 +6,8 @@
|
|
#ifndef __DW_HDMI__
|
|
#define __DW_HDMI__
|
|
|
|
+#include <sound/hdmi-codec.h>
|
|
+
|
|
struct drm_connector;
|
|
struct drm_display_mode;
|
|
struct drm_encoder;
|
|
@@ -155,6 +157,8 @@ void dw_hdmi_resume(struct dw_hdmi *hdmi);
|
|
|
|
void dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense);
|
|
|
|
+int dw_hdmi_set_plugged_cb(struct dw_hdmi *hdmi, hdmi_codec_plugged_cb fn,
|
|
+ struct device *codec_dev);
|
|
void dw_hdmi_set_sample_rate(struct dw_hdmi *hdmi, unsigned int rate);
|
|
void dw_hdmi_set_channel_count(struct dw_hdmi *hdmi, unsigned int cnt);
|
|
void dw_hdmi_set_channel_status(struct dw_hdmi *hdmi, u8 *channel_status);
|
|
|
|
From ff8ecaf2bf7250bb27b519d2c960f55307a9cfbc Mon Sep 17 00:00:00 2001
|
|
From: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
Date: Mon, 28 Oct 2019 15:19:27 +0800
|
|
Subject: [PATCH] ASoC: rockchip_max98090: Optionally support HDMI use case
|
|
|
|
Support three different use cases with rockchip_max98090 driver.
|
|
|
|
The three use cases:
|
|
- max98090 only: Current usage, where HDMI link is missing.
|
|
- HDMI only: Needed use case for veyron_mickey board.
|
|
- max98090 + HDMI: Ideal use case for veyron_jerry, veyron_minnie..etc.
|
|
|
|
The presence of max98090 is determined by the presence of
|
|
rockchip,audio-codec device property.
|
|
|
|
The presence of HDMI is determined by the presence of
|
|
rockchip,hdmi-codec device property.
|
|
|
|
Create different sound card based on the configuration.
|
|
Note that we keep max98090 only usage for backward compatibility.
|
|
|
|
Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
Link: https://lore.kernel.org/r/20191028071930.145899-4-cychiang@chromium.org
|
|
Signed-off-by: Mark Brown <broonie@kernel.org>
|
|
(cherry picked from commit 05b754f5f41c1ea5366c37c8f0ee04c4b4899ff9)
|
|
---
|
|
sound/soc/rockchip/rockchip_max98090.c | 291 +++++++++++++++++++++++++--------
|
|
1 file changed, 226 insertions(+), 65 deletions(-)
|
|
|
|
diff --git a/sound/soc/rockchip/rockchip_max98090.c b/sound/soc/rockchip/rockchip_max98090.c
|
|
index e80b09143b63..e7688bdeb295 100644
|
|
--- a/sound/soc/rockchip/rockchip_max98090.c
|
|
+++ b/sound/soc/rockchip/rockchip_max98090.c
|
|
@@ -6,6 +6,7 @@
|
|
*/
|
|
|
|
#include <linux/module.h>
|
|
+#include <linux/of_device.h>
|
|
#include <linux/platform_device.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/gpio.h>
|
|
@@ -36,28 +37,73 @@ static struct snd_soc_jack_pin headset_jack_pins[] = {
|
|
|
|
};
|
|
|
|
-static const struct snd_soc_dapm_widget rk_dapm_widgets[] = {
|
|
- SND_SOC_DAPM_HP("Headphone", NULL),
|
|
- SND_SOC_DAPM_MIC("Headset Mic", NULL),
|
|
- SND_SOC_DAPM_MIC("Int Mic", NULL),
|
|
- SND_SOC_DAPM_SPK("Speaker", NULL),
|
|
+#define RK_MAX98090_WIDGETS \
|
|
+ SND_SOC_DAPM_HP("Headphone", NULL), \
|
|
+ SND_SOC_DAPM_MIC("Headset Mic", NULL), \
|
|
+ SND_SOC_DAPM_MIC("Int Mic", NULL), \
|
|
+ SND_SOC_DAPM_SPK("Speaker", NULL)
|
|
+
|
|
+#define RK_HDMI_WIDGETS \
|
|
+ SND_SOC_DAPM_LINE("HDMI", NULL)
|
|
+
|
|
+static const struct snd_soc_dapm_widget rk_max98090_dapm_widgets[] = {
|
|
+ RK_MAX98090_WIDGETS,
|
|
+};
|
|
+
|
|
+static const struct snd_soc_dapm_widget rk_hdmi_dapm_widgets[] = {
|
|
+ RK_HDMI_WIDGETS,
|
|
+};
|
|
+
|
|
+static const struct snd_soc_dapm_widget rk_max98090_hdmi_dapm_widgets[] = {
|
|
+ RK_MAX98090_WIDGETS,
|
|
+ RK_HDMI_WIDGETS,
|
|
+};
|
|
+
|
|
+#define RK_MAX98090_AUDIO_MAP \
|
|
+ {"IN34", NULL, "Headset Mic"}, \
|
|
+ {"Headset Mic", NULL, "MICBIAS"}, \
|
|
+ {"DMICL", NULL, "Int Mic"}, \
|
|
+ {"Headphone", NULL, "HPL"}, \
|
|
+ {"Headphone", NULL, "HPR"}, \
|
|
+ {"Speaker", NULL, "SPKL"}, \
|
|
+ {"Speaker", NULL, "SPKR"}
|
|
+
|
|
+#define RK_HDMI_AUDIO_MAP \
|
|
+ {"HDMI", NULL, "TX"}
|
|
+
|
|
+static const struct snd_soc_dapm_route rk_max98090_audio_map[] = {
|
|
+ RK_MAX98090_AUDIO_MAP,
|
|
+};
|
|
+
|
|
+static const struct snd_soc_dapm_route rk_hdmi_audio_map[] = {
|
|
+ RK_HDMI_AUDIO_MAP,
|
|
};
|
|
|
|
-static const struct snd_soc_dapm_route rk_audio_map[] = {
|
|
- {"IN34", NULL, "Headset Mic"},
|
|
- {"Headset Mic", NULL, "MICBIAS"},
|
|
- {"DMICL", NULL, "Int Mic"},
|
|
- {"Headphone", NULL, "HPL"},
|
|
- {"Headphone", NULL, "HPR"},
|
|
- {"Speaker", NULL, "SPKL"},
|
|
- {"Speaker", NULL, "SPKR"},
|
|
+static const struct snd_soc_dapm_route rk_max98090_hdmi_audio_map[] = {
|
|
+ RK_MAX98090_AUDIO_MAP,
|
|
+ RK_HDMI_AUDIO_MAP,
|
|
+};
|
|
+
|
|
+#define RK_MAX98090_CONTROLS \
|
|
+ SOC_DAPM_PIN_SWITCH("Headphone"), \
|
|
+ SOC_DAPM_PIN_SWITCH("Headset Mic"), \
|
|
+ SOC_DAPM_PIN_SWITCH("Int Mic"), \
|
|
+ SOC_DAPM_PIN_SWITCH("Speaker")
|
|
+
|
|
+#define RK_HDMI_CONTROLS \
|
|
+ SOC_DAPM_PIN_SWITCH("HDMI")
|
|
+
|
|
+static const struct snd_kcontrol_new rk_max98090_controls[] = {
|
|
+ RK_MAX98090_CONTROLS,
|
|
};
|
|
|
|
-static const struct snd_kcontrol_new rk_mc_controls[] = {
|
|
- SOC_DAPM_PIN_SWITCH("Headphone"),
|
|
- SOC_DAPM_PIN_SWITCH("Headset Mic"),
|
|
- SOC_DAPM_PIN_SWITCH("Int Mic"),
|
|
- SOC_DAPM_PIN_SWITCH("Speaker"),
|
|
+static const struct snd_kcontrol_new rk_hdmi_controls[] = {
|
|
+ RK_HDMI_CONTROLS,
|
|
+};
|
|
+
|
|
+static const struct snd_kcontrol_new rk_max98090_hdmi_controls[] = {
|
|
+ RK_MAX98090_CONTROLS,
|
|
+ RK_HDMI_CONTROLS,
|
|
};
|
|
|
|
static int rk_jack_event(struct notifier_block *nb, unsigned long event,
|
|
@@ -125,15 +171,20 @@ static int rk_aif1_hw_params(struct snd_pcm_substream *substream,
|
|
|
|
ret = snd_soc_dai_set_sysclk(cpu_dai, 0, mclk,
|
|
SND_SOC_CLOCK_OUT);
|
|
- if (ret < 0) {
|
|
- dev_err(codec_dai->dev, "Can't set codec clock %d\n", ret);
|
|
+ if (ret) {
|
|
+ dev_err(cpu_dai->dev, "Can't set cpu dai clock %d\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
ret = snd_soc_dai_set_sysclk(codec_dai, 0, mclk,
|
|
SND_SOC_CLOCK_IN);
|
|
- if (ret < 0) {
|
|
- dev_err(codec_dai->dev, "Can't set codec clock %d\n", ret);
|
|
+
|
|
+ /* HDMI codec dai does not need to set sysclk. */
|
|
+ if (!strcmp(rtd->dai_link->name, "HDMI"))
|
|
+ return 0;
|
|
+
|
|
+ if (ret) {
|
|
+ dev_err(codec_dai->dev, "Can't set codec dai clock %d\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
@@ -155,20 +206,67 @@ static const struct snd_soc_ops rk_aif1_ops = {
|
|
.startup = rk_aif1_startup,
|
|
};
|
|
|
|
-SND_SOC_DAILINK_DEFS(hifi,
|
|
- DAILINK_COMP_ARRAY(COMP_EMPTY()),
|
|
- DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "HiFi")),
|
|
- DAILINK_COMP_ARRAY(COMP_EMPTY()));
|
|
-
|
|
-static struct snd_soc_dai_link rk_dailink = {
|
|
- .name = "max98090",
|
|
- .stream_name = "Audio",
|
|
- .init = rk_init,
|
|
- .ops = &rk_aif1_ops,
|
|
- /* set max98090 as slave */
|
|
- .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
|
|
- SND_SOC_DAIFMT_CBS_CFS,
|
|
- SND_SOC_DAILINK_REG(hifi),
|
|
+SND_SOC_DAILINK_DEFS(analog,
|
|
+ DAILINK_COMP_ARRAY(COMP_EMPTY()),
|
|
+ DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "HiFi")),
|
|
+ DAILINK_COMP_ARRAY(COMP_EMPTY()));
|
|
+
|
|
+SND_SOC_DAILINK_DEFS(hdmi,
|
|
+ DAILINK_COMP_ARRAY(COMP_EMPTY()),
|
|
+ DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "i2s-hifi")),
|
|
+ DAILINK_COMP_ARRAY(COMP_EMPTY()));
|
|
+
|
|
+enum {
|
|
+ DAILINK_MAX98090,
|
|
+ DAILINK_HDMI,
|
|
+};
|
|
+
|
|
+/* max98090 dai_link */
|
|
+static struct snd_soc_dai_link rk_max98090_dailinks[] = {
|
|
+ {
|
|
+ .name = "max98090",
|
|
+ .stream_name = "Analog",
|
|
+ .init = rk_init,
|
|
+ .ops = &rk_aif1_ops,
|
|
+ /* set max98090 as slave */
|
|
+ .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
|
|
+ SND_SOC_DAIFMT_CBS_CFS,
|
|
+ SND_SOC_DAILINK_REG(analog),
|
|
+ },
|
|
+};
|
|
+
|
|
+/* HDMI codec dai_link */
|
|
+static struct snd_soc_dai_link rk_hdmi_dailinks[] = {
|
|
+ {
|
|
+ .name = "HDMI",
|
|
+ .stream_name = "HDMI",
|
|
+ .ops = &rk_aif1_ops,
|
|
+ .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
|
|
+ SND_SOC_DAIFMT_CBS_CFS,
|
|
+ SND_SOC_DAILINK_REG(hdmi),
|
|
+ }
|
|
+};
|
|
+
|
|
+/* max98090 and HDMI codec dai_link */
|
|
+static struct snd_soc_dai_link rk_max98090_hdmi_dailinks[] = {
|
|
+ [DAILINK_MAX98090] = {
|
|
+ .name = "max98090",
|
|
+ .stream_name = "Analog",
|
|
+ .init = rk_init,
|
|
+ .ops = &rk_aif1_ops,
|
|
+ /* set max98090 as slave */
|
|
+ .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
|
|
+ SND_SOC_DAIFMT_CBS_CFS,
|
|
+ SND_SOC_DAILINK_REG(analog),
|
|
+ },
|
|
+ [DAILINK_HDMI] = {
|
|
+ .name = "HDMI",
|
|
+ .stream_name = "HDMI",
|
|
+ .ops = &rk_aif1_ops,
|
|
+ .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
|
|
+ SND_SOC_DAIFMT_CBS_CFS,
|
|
+ SND_SOC_DAILINK_REG(hdmi),
|
|
+ }
|
|
};
|
|
|
|
static int rk_98090_headset_init(struct snd_soc_component *component);
|
|
@@ -178,19 +276,47 @@ static struct snd_soc_aux_dev rk_98090_headset_dev = {
|
|
.init = rk_98090_headset_init,
|
|
};
|
|
|
|
-static struct snd_soc_card snd_soc_card_rk = {
|
|
+static struct snd_soc_card rockchip_max98090_card = {
|
|
.name = "ROCKCHIP-I2S",
|
|
.owner = THIS_MODULE,
|
|
- .dai_link = &rk_dailink,
|
|
- .num_links = 1,
|
|
+ .dai_link = rk_max98090_dailinks,
|
|
+ .num_links = ARRAY_SIZE(rk_max98090_dailinks),
|
|
+ .aux_dev = &rk_98090_headset_dev,
|
|
+ .num_aux_devs = 1,
|
|
+ .dapm_widgets = rk_max98090_dapm_widgets,
|
|
+ .num_dapm_widgets = ARRAY_SIZE(rk_max98090_dapm_widgets),
|
|
+ .dapm_routes = rk_max98090_audio_map,
|
|
+ .num_dapm_routes = ARRAY_SIZE(rk_max98090_audio_map),
|
|
+ .controls = rk_max98090_controls,
|
|
+ .num_controls = ARRAY_SIZE(rk_max98090_controls),
|
|
+};
|
|
+
|
|
+static struct snd_soc_card rockchip_hdmi_card = {
|
|
+ .name = "ROCKCHIP-HDMI",
|
|
+ .owner = THIS_MODULE,
|
|
+ .dai_link = rk_hdmi_dailinks,
|
|
+ .num_links = ARRAY_SIZE(rk_hdmi_dailinks),
|
|
+ .dapm_widgets = rk_hdmi_dapm_widgets,
|
|
+ .num_dapm_widgets = ARRAY_SIZE(rk_hdmi_dapm_widgets),
|
|
+ .dapm_routes = rk_hdmi_audio_map,
|
|
+ .num_dapm_routes = ARRAY_SIZE(rk_hdmi_audio_map),
|
|
+ .controls = rk_hdmi_controls,
|
|
+ .num_controls = ARRAY_SIZE(rk_hdmi_controls),
|
|
+};
|
|
+
|
|
+static struct snd_soc_card rockchip_max98090_hdmi_card = {
|
|
+ .name = "ROCKCHIP-MAX98090-HDMI",
|
|
+ .owner = THIS_MODULE,
|
|
+ .dai_link = rk_max98090_hdmi_dailinks,
|
|
+ .num_links = ARRAY_SIZE(rk_max98090_hdmi_dailinks),
|
|
.aux_dev = &rk_98090_headset_dev,
|
|
.num_aux_devs = 1,
|
|
- .dapm_widgets = rk_dapm_widgets,
|
|
- .num_dapm_widgets = ARRAY_SIZE(rk_dapm_widgets),
|
|
- .dapm_routes = rk_audio_map,
|
|
- .num_dapm_routes = ARRAY_SIZE(rk_audio_map),
|
|
- .controls = rk_mc_controls,
|
|
- .num_controls = ARRAY_SIZE(rk_mc_controls),
|
|
+ .dapm_widgets = rk_max98090_hdmi_dapm_widgets,
|
|
+ .num_dapm_widgets = ARRAY_SIZE(rk_max98090_hdmi_dapm_widgets),
|
|
+ .dapm_routes = rk_max98090_hdmi_audio_map,
|
|
+ .num_dapm_routes = ARRAY_SIZE(rk_max98090_hdmi_audio_map),
|
|
+ .controls = rk_max98090_hdmi_controls,
|
|
+ .num_controls = ARRAY_SIZE(rk_max98090_hdmi_controls),
|
|
};
|
|
|
|
static int rk_98090_headset_init(struct snd_soc_component *component)
|
|
@@ -198,7 +324,7 @@ static int rk_98090_headset_init(struct snd_soc_component *component)
|
|
int ret;
|
|
|
|
/* Enable Headset and 4 Buttons Jack detection */
|
|
- ret = snd_soc_card_jack_new(&snd_soc_card_rk, "Headset Jack",
|
|
+ ret = snd_soc_card_jack_new(component->card, "Headset Jack",
|
|
SND_JACK_HEADSET |
|
|
SND_JACK_BTN_0 | SND_JACK_BTN_1 |
|
|
SND_JACK_BTN_2 | SND_JACK_BTN_3,
|
|
@@ -213,41 +339,75 @@ static int rk_98090_headset_init(struct snd_soc_component *component)
|
|
return ret;
|
|
}
|
|
|
|
+static int rk_parse_headset_from_of(struct device *dev, struct device_node *np)
|
|
+{
|
|
+ rk_98090_headset_dev.dlc.of_node = of_parse_phandle(
|
|
+ np, "rockchip,headset-codec", 0);
|
|
+ if (!rk_98090_headset_dev.dlc.of_node) {
|
|
+ dev_err(dev,
|
|
+ "Property 'rockchip,headset-codec' missing/invalid\n");
|
|
+ return -EINVAL;
|
|
+ }
|
|
+ return 0;
|
|
+}
|
|
+
|
|
static int snd_rk_mc_probe(struct platform_device *pdev)
|
|
{
|
|
int ret = 0;
|
|
- struct snd_soc_card *card = &snd_soc_card_rk;
|
|
+ struct snd_soc_card *card;
|
|
+ struct device *dev = &pdev->dev;
|
|
struct device_node *np = pdev->dev.of_node;
|
|
+ struct device_node *np_cpu;
|
|
+ struct device_node *np_audio, *np_hdmi;
|
|
|
|
- /* register the soc card */
|
|
- card->dev = &pdev->dev;
|
|
+ /* Parse DTS for I2S controller. */
|
|
+ np_cpu = of_parse_phandle(np, "rockchip,i2s-controller", 0);
|
|
|
|
- rk_dailink.codecs->of_node = of_parse_phandle(np,
|
|
- "rockchip,audio-codec", 0);
|
|
- if (!rk_dailink.codecs->of_node) {
|
|
+ if (!np_cpu) {
|
|
dev_err(&pdev->dev,
|
|
- "Property 'rockchip,audio-codec' missing or invalid\n");
|
|
+ "Property 'rockchip,i2s-controller missing or invalid\n");
|
|
return -EINVAL;
|
|
}
|
|
|
|
- rk_dailink.cpus->of_node = of_parse_phandle(np,
|
|
- "rockchip,i2s-controller", 0);
|
|
- if (!rk_dailink.cpus->of_node) {
|
|
- dev_err(&pdev->dev,
|
|
- "Property 'rockchip,i2s-controller' missing or invalid\n");
|
|
+ /*
|
|
+ * Find the card to use based on the presences of audio codec
|
|
+ * and hdmi codec in device property. Set their of_node accordingly.
|
|
+ */
|
|
+ np_audio = of_parse_phandle(np, "rockchip,audio-codec", 0);
|
|
+ np_hdmi = of_parse_phandle(np, "rockchip,hdmi-codec", 0);
|
|
+ if (np_audio && np_hdmi) {
|
|
+ card = &rockchip_max98090_hdmi_card;
|
|
+ card->dai_link[DAILINK_MAX98090].codecs->of_node = np_audio;
|
|
+ card->dai_link[DAILINK_HDMI].codecs->of_node = np_hdmi;
|
|
+ card->dai_link[DAILINK_MAX98090].cpus->of_node = np_cpu;
|
|
+ card->dai_link[DAILINK_MAX98090].platforms->of_node = np_cpu;
|
|
+ card->dai_link[DAILINK_HDMI].cpus->of_node = np_cpu;
|
|
+ card->dai_link[DAILINK_HDMI].platforms->of_node = np_cpu;
|
|
+ } else if (np_audio) {
|
|
+ card = &rockchip_max98090_card;
|
|
+ card->dai_link[0].codecs->of_node = np_audio;
|
|
+ card->dai_link[0].cpus->of_node = np_cpu;
|
|
+ card->dai_link[0].platforms->of_node = np_cpu;
|
|
+ } else if (np_hdmi) {
|
|
+ card = &rockchip_hdmi_card;
|
|
+ card->dai_link[0].codecs->of_node = np_hdmi;
|
|
+ card->dai_link[0].cpus->of_node = np_cpu;
|
|
+ card->dai_link[0].platforms->of_node = np_cpu;
|
|
+ } else {
|
|
+ dev_err(dev, "At least one of codecs should be specified\n");
|
|
return -EINVAL;
|
|
}
|
|
|
|
- rk_dailink.platforms->of_node = rk_dailink.cpus->of_node;
|
|
+ card->dev = dev;
|
|
|
|
- rk_98090_headset_dev.dlc.of_node = of_parse_phandle(np,
|
|
- "rockchip,headset-codec", 0);
|
|
- if (!rk_98090_headset_dev.dlc.of_node) {
|
|
- dev_err(&pdev->dev,
|
|
- "Property 'rockchip,headset-codec' missing/invalid\n");
|
|
- return -EINVAL;
|
|
+ /* Parse headset detection codec. */
|
|
+ if (np_audio) {
|
|
+ ret = rk_parse_headset_from_of(dev, np);
|
|
+ if (ret)
|
|
+ return ret;
|
|
}
|
|
|
|
+ /* Parse card name. */
|
|
ret = snd_soc_of_parse_card_name(card, "rockchip,model");
|
|
if (ret) {
|
|
dev_err(&pdev->dev,
|
|
@@ -255,6 +415,7 @@ static int snd_rk_mc_probe(struct platform_device *pdev)
|
|
return ret;
|
|
}
|
|
|
|
+ /* register the soc card */
|
|
ret = devm_snd_soc_register_card(&pdev->dev, card);
|
|
if (ret) {
|
|
dev_err(&pdev->dev,
|
|
|
|
From 09c3067c2e9cf43d70072f9a7a001fcd3ac11045 Mon Sep 17 00:00:00 2001
|
|
From: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
Date: Mon, 28 Oct 2019 15:19:28 +0800
|
|
Subject: [PATCH] ASoC: rockchip_max98090: Add HDMI jack support
|
|
|
|
In machine driver, create a jack and let hdmi-codec report jack status.
|
|
|
|
Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
Link: https://lore.kernel.org/r/20191028071930.145899-5-cychiang@chromium.org
|
|
Signed-off-by: Mark Brown <broonie@kernel.org>
|
|
(cherry picked from commit bf2f64ea6594066081b0d30b128fa4947e83e737)
|
|
---
|
|
sound/soc/rockchip/Kconfig | 3 ++-
|
|
sound/soc/rockchip/rockchip_max98090.c | 22 ++++++++++++++++++++++
|
|
2 files changed, 24 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/sound/soc/rockchip/Kconfig b/sound/soc/rockchip/Kconfig
|
|
index b43657e6e655..d610b553ea3b 100644
|
|
--- a/sound/soc/rockchip/Kconfig
|
|
+++ b/sound/soc/rockchip/Kconfig
|
|
@@ -40,9 +40,10 @@ config SND_SOC_ROCKCHIP_MAX98090
|
|
select SND_SOC_ROCKCHIP_I2S
|
|
select SND_SOC_MAX98090
|
|
select SND_SOC_TS3A227E
|
|
+ select SND_SOC_HDMI_CODEC
|
|
help
|
|
Say Y or M here if you want to add support for SoC audio on Rockchip
|
|
- boards using the MAX98090 codec, such as Veyron.
|
|
+ boards using the MAX98090 codec and HDMI codec, such as Veyron.
|
|
|
|
config SND_SOC_ROCKCHIP_RT5645
|
|
tristate "ASoC support for Rockchip boards using a RT5645/RT5650 codec"
|
|
diff --git a/sound/soc/rockchip/rockchip_max98090.c b/sound/soc/rockchip/rockchip_max98090.c
|
|
index e7688bdeb295..60930fa85aa4 100644
|
|
--- a/sound/soc/rockchip/rockchip_max98090.c
|
|
+++ b/sound/soc/rockchip/rockchip_max98090.c
|
|
@@ -12,6 +12,7 @@
|
|
#include <linux/gpio.h>
|
|
#include <linux/of_gpio.h>
|
|
#include <sound/core.h>
|
|
+#include <sound/hdmi-codec.h>
|
|
#include <sound/jack.h>
|
|
#include <sound/pcm.h>
|
|
#include <sound/pcm_params.h>
|
|
@@ -221,6 +222,25 @@ enum {
|
|
DAILINK_HDMI,
|
|
};
|
|
|
|
+static struct snd_soc_jack rk_hdmi_jack;
|
|
+
|
|
+static int rk_hdmi_init(struct snd_soc_pcm_runtime *runtime)
|
|
+{
|
|
+ struct snd_soc_card *card = runtime->card;
|
|
+ struct snd_soc_component *component = runtime->codec_dai->component;
|
|
+ int ret;
|
|
+
|
|
+ /* enable jack detection */
|
|
+ ret = snd_soc_card_jack_new(card, "HDMI Jack", SND_JACK_LINEOUT,
|
|
+ &rk_hdmi_jack, NULL, 0);
|
|
+ if (ret) {
|
|
+ dev_err(card->dev, "Can't new HDMI Jack %d\n", ret);
|
|
+ return ret;
|
|
+ }
|
|
+
|
|
+ return hdmi_codec_set_jack_detect(component, &rk_hdmi_jack);
|
|
+}
|
|
+
|
|
/* max98090 dai_link */
|
|
static struct snd_soc_dai_link rk_max98090_dailinks[] = {
|
|
{
|
|
@@ -240,6 +260,7 @@ static struct snd_soc_dai_link rk_hdmi_dailinks[] = {
|
|
{
|
|
.name = "HDMI",
|
|
.stream_name = "HDMI",
|
|
+ .init = rk_hdmi_init,
|
|
.ops = &rk_aif1_ops,
|
|
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
|
|
SND_SOC_DAIFMT_CBS_CFS,
|
|
@@ -262,6 +283,7 @@ static struct snd_soc_dai_link rk_max98090_hdmi_dailinks[] = {
|
|
[DAILINK_HDMI] = {
|
|
.name = "HDMI",
|
|
.stream_name = "HDMI",
|
|
+ .init = rk_hdmi_init,
|
|
.ops = &rk_aif1_ops,
|
|
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
|
|
SND_SOC_DAIFMT_CBS_CFS,
|
|
|
|
From 985d6d6f1a67fbd15c7dffe4e2671be922d55360 Mon Sep 17 00:00:00 2001
|
|
From: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
Date: Mon, 28 Oct 2019 15:19:29 +0800
|
|
Subject: [PATCH] ARM: dts: rockchip: Add HDMI support to
|
|
rk3288-veyron-analog-audio
|
|
|
|
All boards using rk3288-veyron-analog-audio.dtsi have HDMI audio.
|
|
Specify the support of HDMI audio on machine driver using
|
|
rockchip,hdmi-codec property so machine driver creates HDMI audio device.
|
|
|
|
Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
Link: https://lore.kernel.org/r/20191028071930.145899-6-cychiang@chromium.org
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit d6707fb710b64154ab928892bfc9046614f95307)
|
|
---
|
|
arch/arm/boot/dts/rk3288-veyron-analog-audio.dtsi | 1 +
|
|
1 file changed, 1 insertion(+)
|
|
|
|
diff --git a/arch/arm/boot/dts/rk3288-veyron-analog-audio.dtsi b/arch/arm/boot/dts/rk3288-veyron-analog-audio.dtsi
|
|
index 445270aa136e..51208d161d65 100644
|
|
--- a/arch/arm/boot/dts/rk3288-veyron-analog-audio.dtsi
|
|
+++ b/arch/arm/boot/dts/rk3288-veyron-analog-audio.dtsi
|
|
@@ -17,6 +17,7 @@
|
|
rockchip,hp-det-gpios = <&gpio6 RK_PA5 GPIO_ACTIVE_HIGH>;
|
|
rockchip,mic-det-gpios = <&gpio6 RK_PB3 GPIO_ACTIVE_LOW>;
|
|
rockchip,headset-codec = <&headsetcodec>;
|
|
+ rockchip,hdmi-codec = <&hdmi>;
|
|
};
|
|
};
|
|
|
|
|
|
From 6bfec703d60b8cd9ebd02ea3d35c99ed7e6fb387 Mon Sep 17 00:00:00 2001
|
|
From: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
Date: Mon, 28 Oct 2019 15:19:30 +0800
|
|
Subject: [PATCH] ARM: dts: rockchip: Add HDMI audio support to
|
|
rk3288-veyron-mickey
|
|
|
|
Add HDMI audio support to veyron-mickey. The sound card should expose
|
|
one audio device for HDMI.
|
|
|
|
Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
Link: https://lore.kernel.org/r/20191028071930.145899-7-cychiang@chromium.org
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit bbf8f6fef71a02b297de532364b5217d34f01582)
|
|
---
|
|
arch/arm/boot/dts/rk3288-veyron-mickey.dts | 7 +++++++
|
|
1 file changed, 7 insertions(+)
|
|
|
|
diff --git a/arch/arm/boot/dts/rk3288-veyron-mickey.dts b/arch/arm/boot/dts/rk3288-veyron-mickey.dts
|
|
index aa352d40c991..06a6a9554c48 100644
|
|
--- a/arch/arm/boot/dts/rk3288-veyron-mickey.dts
|
|
+++ b/arch/arm/boot/dts/rk3288-veyron-mickey.dts
|
|
@@ -28,6 +28,13 @@
|
|
regulator-boot-on;
|
|
vin-supply = <&vcc33_sys>;
|
|
};
|
|
+
|
|
+ sound {
|
|
+ compatible = "rockchip,rockchip-audio-max98090";
|
|
+ rockchip,model = "VEYRON-HDMI";
|
|
+ rockchip,hdmi-codec = <&hdmi>;
|
|
+ rockchip,i2s-controller = <&i2s>;
|
|
+ };
|
|
};
|
|
|
|
&cpu_thermal {
|
|
|
|
From 6c1201b0f96803d0cfb1c467d085e941abb5476b Mon Sep 17 00:00:00 2001
|
|
From: "Ben Dooks (Codethink)" <ben.dooks@codethink.co.uk>
|
|
Date: Thu, 17 Oct 2019 11:53:48 +0100
|
|
Subject: [PATCH] clk: rockchip: make clk_half_divider_ops static
|
|
|
|
The clk_half_divider_ops is not used outside or declared
|
|
outside of drivers/clk/rockchip/clk-half-divider.c so make
|
|
it static to avoid the following warning:
|
|
|
|
drivers/clk/rockchip/clk-half-divider.c:142:22: warning: symbol 'clk_half_divider_ops' was not declared. Should it be static?
|
|
|
|
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
|
|
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
|
|
Link: https://lore.kernel.org/r/20191017105348.8061-1-ben.dooks@codethink.co.uk
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit bbbbd246ee12f5d41aeac3d1b470f7b5b735574c)
|
|
---
|
|
drivers/clk/rockchip/clk-half-divider.c | 3 +--
|
|
1 file changed, 1 insertion(+), 2 deletions(-)
|
|
|
|
diff --git a/drivers/clk/rockchip/clk-half-divider.c b/drivers/clk/rockchip/clk-half-divider.c
|
|
index ba9f00dc9740..b333fc28c94b 100644
|
|
--- a/drivers/clk/rockchip/clk-half-divider.c
|
|
+++ b/drivers/clk/rockchip/clk-half-divider.c
|
|
@@ -139,12 +139,11 @@ static int clk_half_divider_set_rate(struct clk_hw *hw, unsigned long rate,
|
|
return 0;
|
|
}
|
|
|
|
-const struct clk_ops clk_half_divider_ops = {
|
|
+static const struct clk_ops clk_half_divider_ops = {
|
|
.recalc_rate = clk_half_divider_recalc_rate,
|
|
.round_rate = clk_half_divider_round_rate,
|
|
.set_rate = clk_half_divider_set_rate,
|
|
};
|
|
-EXPORT_SYMBOL_GPL(clk_half_divider_ops);
|
|
|
|
/**
|
|
* Register a clock branch.
|
|
|
|
From 65814754524a4bbff71df31d0fc352d9e1e1936e Mon Sep 17 00:00:00 2001
|
|
From: Wyon Bi <bivvy.bi@rock-chips.com>
|
|
Date: Thu, 24 Oct 2019 00:38:51 +0200
|
|
Subject: [PATCH] phy/rockchip: Add support for Innosilicon MIPI/LVDS/TTL PHY
|
|
|
|
The Innosilicon Video Combo PHY not only supports MIPI DSI,
|
|
but also LVDS and TTL functions with small die size and low
|
|
pin count. Customers can choose according to their own applications.
|
|
|
|
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
|
|
[removed TTL mode for now, as it required a hook back into the dsi host]
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
|
|
(cherry picked from commit b7535a3bc0bac70e9644fb35cdeffabb59f578ee)
|
|
---
|
|
drivers/phy/rockchip/Kconfig | 8 +
|
|
drivers/phy/rockchip/Makefile | 1 +
|
|
drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c | 805 +++++++++++++++++++++++
|
|
3 files changed, 814 insertions(+)
|
|
create mode 100644 drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c
|
|
|
|
diff --git a/drivers/phy/rockchip/Kconfig b/drivers/phy/rockchip/Kconfig
|
|
index c454c90cd99e..dbd2de4d28b1 100644
|
|
--- a/drivers/phy/rockchip/Kconfig
|
|
+++ b/drivers/phy/rockchip/Kconfig
|
|
@@ -35,6 +35,14 @@ config PHY_ROCKCHIP_INNO_USB2
|
|
help
|
|
Support for Rockchip USB2.0 PHY with Innosilicon IP block.
|
|
|
|
+config PHY_ROCKCHIP_INNO_DSIDPHY
|
|
+ tristate "Rockchip Innosilicon MIPI/LVDS/TTL PHY driver"
|
|
+ depends on (ARCH_ROCKCHIP || COMPILE_TEST) && OF
|
|
+ select GENERIC_PHY
|
|
+ help
|
|
+ Enable this to support the Rockchip MIPI/LVDS/TTL PHY with
|
|
+ Innosilicon IP block.
|
|
+
|
|
config PHY_ROCKCHIP_PCIE
|
|
tristate "Rockchip PCIe PHY Driver"
|
|
depends on (ARCH_ROCKCHIP && OF) || COMPILE_TEST
|
|
diff --git a/drivers/phy/rockchip/Makefile b/drivers/phy/rockchip/Makefile
|
|
index fd21cbaf40dd..9f59a81e4e0d 100644
|
|
--- a/drivers/phy/rockchip/Makefile
|
|
+++ b/drivers/phy/rockchip/Makefile
|
|
@@ -1,6 +1,7 @@
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
obj-$(CONFIG_PHY_ROCKCHIP_DP) += phy-rockchip-dp.o
|
|
obj-$(CONFIG_PHY_ROCKCHIP_EMMC) += phy-rockchip-emmc.o
|
|
+obj-$(CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY) += phy-rockchip-inno-dsidphy.o
|
|
obj-$(CONFIG_PHY_ROCKCHIP_INNO_HDMI) += phy-rockchip-inno-hdmi.o
|
|
obj-$(CONFIG_PHY_ROCKCHIP_INNO_USB2) += phy-rockchip-inno-usb2.o
|
|
obj-$(CONFIG_PHY_ROCKCHIP_PCIE) += phy-rockchip-pcie.o
|
|
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c b/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c
|
|
new file mode 100644
|
|
index 000000000000..fc729ecd3fe9
|
|
--- /dev/null
|
|
+++ b/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c
|
|
@@ -0,0 +1,805 @@
|
|
+// SPDX-License-Identifier: GPL-2.0
|
|
+/*
|
|
+ * Copyright (c) 2018 Rockchip Electronics Co. Ltd.
|
|
+ *
|
|
+ * Author: Wyon Bi <bivvy.bi@rock-chips.com>
|
|
+ */
|
|
+
|
|
+#include <linux/kernel.h>
|
|
+#include <linux/clk.h>
|
|
+#include <linux/iopoll.h>
|
|
+#include <linux/clk-provider.h>
|
|
+#include <linux/delay.h>
|
|
+#include <linux/init.h>
|
|
+#include <linux/module.h>
|
|
+#include <linux/of_device.h>
|
|
+#include <linux/platform_device.h>
|
|
+#include <linux/reset.h>
|
|
+#include <linux/phy/phy.h>
|
|
+#include <linux/pm_runtime.h>
|
|
+#include <linux/mfd/syscon.h>
|
|
+
|
|
+#define PSEC_PER_SEC 1000000000000LL
|
|
+
|
|
+#define UPDATE(x, h, l) (((x) << (l)) & GENMASK((h), (l)))
|
|
+
|
|
+/*
|
|
+ * The offset address[7:0] is distributed two parts, one from the bit7 to bit5
|
|
+ * is the first address, the other from the bit4 to bit0 is the second address.
|
|
+ * when you configure the registers, you must set both of them. The Clock Lane
|
|
+ * and Data Lane use the same registers with the same second address, but the
|
|
+ * first address is different.
|
|
+ */
|
|
+#define FIRST_ADDRESS(x) (((x) & 0x7) << 5)
|
|
+#define SECOND_ADDRESS(x) (((x) & 0x1f) << 0)
|
|
+#define PHY_REG(first, second) (FIRST_ADDRESS(first) | \
|
|
+ SECOND_ADDRESS(second))
|
|
+
|
|
+/* Analog Register Part: reg00 */
|
|
+#define BANDGAP_POWER_MASK BIT(7)
|
|
+#define BANDGAP_POWER_DOWN BIT(7)
|
|
+#define BANDGAP_POWER_ON 0
|
|
+#define LANE_EN_MASK GENMASK(6, 2)
|
|
+#define LANE_EN_CK BIT(6)
|
|
+#define LANE_EN_3 BIT(5)
|
|
+#define LANE_EN_2 BIT(4)
|
|
+#define LANE_EN_1 BIT(3)
|
|
+#define LANE_EN_0 BIT(2)
|
|
+#define POWER_WORK_MASK GENMASK(1, 0)
|
|
+#define POWER_WORK_ENABLE UPDATE(1, 1, 0)
|
|
+#define POWER_WORK_DISABLE UPDATE(2, 1, 0)
|
|
+/* Analog Register Part: reg01 */
|
|
+#define REG_SYNCRST_MASK BIT(2)
|
|
+#define REG_SYNCRST_RESET BIT(2)
|
|
+#define REG_SYNCRST_NORMAL 0
|
|
+#define REG_LDOPD_MASK BIT(1)
|
|
+#define REG_LDOPD_POWER_DOWN BIT(1)
|
|
+#define REG_LDOPD_POWER_ON 0
|
|
+#define REG_PLLPD_MASK BIT(0)
|
|
+#define REG_PLLPD_POWER_DOWN BIT(0)
|
|
+#define REG_PLLPD_POWER_ON 0
|
|
+/* Analog Register Part: reg03 */
|
|
+#define REG_FBDIV_HI_MASK BIT(5)
|
|
+#define REG_FBDIV_HI(x) UPDATE((x >> 8), 5, 5)
|
|
+#define REG_PREDIV_MASK GENMASK(4, 0)
|
|
+#define REG_PREDIV(x) UPDATE(x, 4, 0)
|
|
+/* Analog Register Part: reg04 */
|
|
+#define REG_FBDIV_LO_MASK GENMASK(7, 0)
|
|
+#define REG_FBDIV_LO(x) UPDATE(x, 7, 0)
|
|
+/* Analog Register Part: reg05 */
|
|
+#define SAMPLE_CLOCK_PHASE_MASK GENMASK(6, 4)
|
|
+#define SAMPLE_CLOCK_PHASE(x) UPDATE(x, 6, 4)
|
|
+#define CLOCK_LANE_SKEW_PHASE_MASK GENMASK(2, 0)
|
|
+#define CLOCK_LANE_SKEW_PHASE(x) UPDATE(x, 2, 0)
|
|
+/* Analog Register Part: reg06 */
|
|
+#define DATA_LANE_3_SKEW_PHASE_MASK GENMASK(6, 4)
|
|
+#define DATA_LANE_3_SKEW_PHASE(x) UPDATE(x, 6, 4)
|
|
+#define DATA_LANE_2_SKEW_PHASE_MASK GENMASK(2, 0)
|
|
+#define DATA_LANE_2_SKEW_PHASE(x) UPDATE(x, 2, 0)
|
|
+/* Analog Register Part: reg07 */
|
|
+#define DATA_LANE_1_SKEW_PHASE_MASK GENMASK(6, 4)
|
|
+#define DATA_LANE_1_SKEW_PHASE(x) UPDATE(x, 6, 4)
|
|
+#define DATA_LANE_0_SKEW_PHASE_MASK GENMASK(2, 0)
|
|
+#define DATA_LANE_0_SKEW_PHASE(x) UPDATE(x, 2, 0)
|
|
+/* Analog Register Part: reg08 */
|
|
+#define SAMPLE_CLOCK_DIRECTION_MASK BIT(4)
|
|
+#define SAMPLE_CLOCK_DIRECTION_REVERSE BIT(4)
|
|
+#define SAMPLE_CLOCK_DIRECTION_FORWARD 0
|
|
+/* Digital Register Part: reg00 */
|
|
+#define REG_DIG_RSTN_MASK BIT(0)
|
|
+#define REG_DIG_RSTN_NORMAL BIT(0)
|
|
+#define REG_DIG_RSTN_RESET 0
|
|
+/* Digital Register Part: reg01 */
|
|
+#define INVERT_TXCLKESC_MASK BIT(1)
|
|
+#define INVERT_TXCLKESC_ENABLE BIT(1)
|
|
+#define INVERT_TXCLKESC_DISABLE 0
|
|
+#define INVERT_TXBYTECLKHS_MASK BIT(0)
|
|
+#define INVERT_TXBYTECLKHS_ENABLE BIT(0)
|
|
+#define INVERT_TXBYTECLKHS_DISABLE 0
|
|
+/* Clock/Data0/Data1/Data2/Data3 Lane Register Part: reg05 */
|
|
+#define T_LPX_CNT_MASK GENMASK(5, 0)
|
|
+#define T_LPX_CNT(x) UPDATE(x, 5, 0)
|
|
+/* Clock/Data0/Data1/Data2/Data3 Lane Register Part: reg06 */
|
|
+#define T_HS_PREPARE_CNT_MASK GENMASK(6, 0)
|
|
+#define T_HS_PREPARE_CNT(x) UPDATE(x, 6, 0)
|
|
+/* Clock/Data0/Data1/Data2/Data3 Lane Register Part: reg07 */
|
|
+#define T_HS_ZERO_CNT_MASK GENMASK(5, 0)
|
|
+#define T_HS_ZERO_CNT(x) UPDATE(x, 5, 0)
|
|
+/* Clock/Data0/Data1/Data2/Data3 Lane Register Part: reg08 */
|
|
+#define T_HS_TRAIL_CNT_MASK GENMASK(6, 0)
|
|
+#define T_HS_TRAIL_CNT(x) UPDATE(x, 6, 0)
|
|
+/* Clock/Data0/Data1/Data2/Data3 Lane Register Part: reg09 */
|
|
+#define T_HS_EXIT_CNT_MASK GENMASK(4, 0)
|
|
+#define T_HS_EXIT_CNT(x) UPDATE(x, 4, 0)
|
|
+/* Clock/Data0/Data1/Data2/Data3 Lane Register Part: reg0a */
|
|
+#define T_CLK_POST_CNT_MASK GENMASK(3, 0)
|
|
+#define T_CLK_POST_CNT(x) UPDATE(x, 3, 0)
|
|
+/* Clock/Data0/Data1/Data2/Data3 Lane Register Part: reg0c */
|
|
+#define LPDT_TX_PPI_SYNC_MASK BIT(2)
|
|
+#define LPDT_TX_PPI_SYNC_ENABLE BIT(2)
|
|
+#define LPDT_TX_PPI_SYNC_DISABLE 0
|
|
+#define T_WAKEUP_CNT_HI_MASK GENMASK(1, 0)
|
|
+#define T_WAKEUP_CNT_HI(x) UPDATE(x, 1, 0)
|
|
+/* Clock/Data0/Data1/Data2/Data3 Lane Register Part: reg0d */
|
|
+#define T_WAKEUP_CNT_LO_MASK GENMASK(7, 0)
|
|
+#define T_WAKEUP_CNT_LO(x) UPDATE(x, 7, 0)
|
|
+/* Clock/Data0/Data1/Data2/Data3 Lane Register Part: reg0e */
|
|
+#define T_CLK_PRE_CNT_MASK GENMASK(3, 0)
|
|
+#define T_CLK_PRE_CNT(x) UPDATE(x, 3, 0)
|
|
+/* Clock/Data0/Data1/Data2/Data3 Lane Register Part: reg10 */
|
|
+#define T_TA_GO_CNT_MASK GENMASK(5, 0)
|
|
+#define T_TA_GO_CNT(x) UPDATE(x, 5, 0)
|
|
+/* Clock/Data0/Data1/Data2/Data3 Lane Register Part: reg11 */
|
|
+#define T_TA_SURE_CNT_MASK GENMASK(5, 0)
|
|
+#define T_TA_SURE_CNT(x) UPDATE(x, 5, 0)
|
|
+/* Clock/Data0/Data1/Data2/Data3 Lane Register Part: reg12 */
|
|
+#define T_TA_WAIT_CNT_MASK GENMASK(5, 0)
|
|
+#define T_TA_WAIT_CNT(x) UPDATE(x, 5, 0)
|
|
+/* LVDS Register Part: reg00 */
|
|
+#define LVDS_DIGITAL_INTERNAL_RESET_MASK BIT(2)
|
|
+#define LVDS_DIGITAL_INTERNAL_RESET_DISABLE BIT(2)
|
|
+#define LVDS_DIGITAL_INTERNAL_RESET_ENABLE 0
|
|
+/* LVDS Register Part: reg01 */
|
|
+#define LVDS_DIGITAL_INTERNAL_ENABLE_MASK BIT(7)
|
|
+#define LVDS_DIGITAL_INTERNAL_ENABLE BIT(7)
|
|
+#define LVDS_DIGITAL_INTERNAL_DISABLE 0
|
|
+/* LVDS Register Part: reg03 */
|
|
+#define MODE_ENABLE_MASK GENMASK(2, 0)
|
|
+#define TTL_MODE_ENABLE BIT(2)
|
|
+#define LVDS_MODE_ENABLE BIT(1)
|
|
+#define MIPI_MODE_ENABLE BIT(0)
|
|
+/* LVDS Register Part: reg0b */
|
|
+#define LVDS_LANE_EN_MASK GENMASK(7, 3)
|
|
+#define LVDS_DATA_LANE0_EN BIT(7)
|
|
+#define LVDS_DATA_LANE1_EN BIT(6)
|
|
+#define LVDS_DATA_LANE2_EN BIT(5)
|
|
+#define LVDS_DATA_LANE3_EN BIT(4)
|
|
+#define LVDS_CLK_LANE_EN BIT(3)
|
|
+#define LVDS_PLL_POWER_MASK BIT(2)
|
|
+#define LVDS_PLL_POWER_OFF BIT(2)
|
|
+#define LVDS_PLL_POWER_ON 0
|
|
+#define LVDS_BANDGAP_POWER_MASK BIT(0)
|
|
+#define LVDS_BANDGAP_POWER_DOWN BIT(0)
|
|
+#define LVDS_BANDGAP_POWER_ON 0
|
|
+
|
|
+#define DSI_PHY_RSTZ 0xa0
|
|
+#define PHY_ENABLECLK BIT(2)
|
|
+#define DSI_PHY_STATUS 0xb0
|
|
+#define PHY_LOCK BIT(0)
|
|
+
|
|
+struct mipi_dphy_timing {
|
|
+ unsigned int clkmiss;
|
|
+ unsigned int clkpost;
|
|
+ unsigned int clkpre;
|
|
+ unsigned int clkprepare;
|
|
+ unsigned int clksettle;
|
|
+ unsigned int clktermen;
|
|
+ unsigned int clktrail;
|
|
+ unsigned int clkzero;
|
|
+ unsigned int dtermen;
|
|
+ unsigned int eot;
|
|
+ unsigned int hsexit;
|
|
+ unsigned int hsprepare;
|
|
+ unsigned int hszero;
|
|
+ unsigned int hssettle;
|
|
+ unsigned int hsskip;
|
|
+ unsigned int hstrail;
|
|
+ unsigned int init;
|
|
+ unsigned int lpx;
|
|
+ unsigned int taget;
|
|
+ unsigned int tago;
|
|
+ unsigned int tasure;
|
|
+ unsigned int wakeup;
|
|
+};
|
|
+
|
|
+struct inno_dsidphy {
|
|
+ struct device *dev;
|
|
+ struct clk *ref_clk;
|
|
+ struct clk *pclk_phy;
|
|
+ struct clk *pclk_host;
|
|
+ void __iomem *phy_base;
|
|
+ void __iomem *host_base;
|
|
+ struct reset_control *rst;
|
|
+ enum phy_mode mode;
|
|
+
|
|
+ struct {
|
|
+ struct clk_hw hw;
|
|
+ u8 prediv;
|
|
+ u16 fbdiv;
|
|
+ unsigned long rate;
|
|
+ } pll;
|
|
+};
|
|
+
|
|
+enum {
|
|
+ REGISTER_PART_ANALOG,
|
|
+ REGISTER_PART_DIGITAL,
|
|
+ REGISTER_PART_CLOCK_LANE,
|
|
+ REGISTER_PART_DATA0_LANE,
|
|
+ REGISTER_PART_DATA1_LANE,
|
|
+ REGISTER_PART_DATA2_LANE,
|
|
+ REGISTER_PART_DATA3_LANE,
|
|
+ REGISTER_PART_LVDS,
|
|
+};
|
|
+
|
|
+static inline struct inno_dsidphy *hw_to_inno(struct clk_hw *hw)
|
|
+{
|
|
+ return container_of(hw, struct inno_dsidphy, pll.hw);
|
|
+}
|
|
+
|
|
+static void phy_update_bits(struct inno_dsidphy *inno,
|
|
+ u8 first, u8 second, u8 mask, u8 val)
|
|
+{
|
|
+ u32 reg = PHY_REG(first, second) << 2;
|
|
+ unsigned int tmp, orig;
|
|
+
|
|
+ orig = readl(inno->phy_base + reg);
|
|
+ tmp = orig & ~mask;
|
|
+ tmp |= val & mask;
|
|
+ writel(tmp, inno->phy_base + reg);
|
|
+}
|
|
+
|
|
+static void mipi_dphy_timing_get_default(struct mipi_dphy_timing *timing,
|
|
+ unsigned long period)
|
|
+{
|
|
+ /* Global Operation Timing Parameters */
|
|
+ timing->clkmiss = 0;
|
|
+ timing->clkpost = 70000 + 52 * period;
|
|
+ timing->clkpre = 8 * period;
|
|
+ timing->clkprepare = 65000;
|
|
+ timing->clksettle = 95000;
|
|
+ timing->clktermen = 0;
|
|
+ timing->clktrail = 80000;
|
|
+ timing->clkzero = 260000;
|
|
+ timing->dtermen = 0;
|
|
+ timing->eot = 0;
|
|
+ timing->hsexit = 120000;
|
|
+ timing->hsprepare = 65000 + 4 * period;
|
|
+ timing->hszero = 145000 + 6 * period;
|
|
+ timing->hssettle = 85000 + 6 * period;
|
|
+ timing->hsskip = 40000;
|
|
+ timing->hstrail = max(8 * period, 60000 + 4 * period);
|
|
+ timing->init = 100000000;
|
|
+ timing->lpx = 60000;
|
|
+ timing->taget = 5 * timing->lpx;
|
|
+ timing->tago = 4 * timing->lpx;
|
|
+ timing->tasure = 2 * timing->lpx;
|
|
+ timing->wakeup = 1000000000;
|
|
+}
|
|
+
|
|
+static void inno_dsidphy_mipi_mode_enable(struct inno_dsidphy *inno)
|
|
+{
|
|
+ struct mipi_dphy_timing gotp;
|
|
+ const struct {
|
|
+ unsigned long rate;
|
|
+ u8 hs_prepare;
|
|
+ u8 clk_lane_hs_zero;
|
|
+ u8 data_lane_hs_zero;
|
|
+ u8 hs_trail;
|
|
+ } timings[] = {
|
|
+ { 110000000, 0x20, 0x16, 0x02, 0x22},
|
|
+ { 150000000, 0x06, 0x16, 0x03, 0x45},
|
|
+ { 200000000, 0x18, 0x17, 0x04, 0x0b},
|
|
+ { 250000000, 0x05, 0x17, 0x05, 0x16},
|
|
+ { 300000000, 0x51, 0x18, 0x06, 0x2c},
|
|
+ { 400000000, 0x64, 0x19, 0x07, 0x33},
|
|
+ { 500000000, 0x20, 0x1b, 0x07, 0x4e},
|
|
+ { 600000000, 0x6a, 0x1d, 0x08, 0x3a},
|
|
+ { 700000000, 0x3e, 0x1e, 0x08, 0x6a},
|
|
+ { 800000000, 0x21, 0x1f, 0x09, 0x29},
|
|
+ {1000000000, 0x09, 0x20, 0x09, 0x27},
|
|
+ };
|
|
+ u32 t_txbyteclkhs, t_txclkesc, ui;
|
|
+ u32 txbyteclkhs, txclkesc, esc_clk_div;
|
|
+ u32 hs_exit, clk_post, clk_pre, wakeup, lpx, ta_go, ta_sure, ta_wait;
|
|
+ u32 hs_prepare, hs_trail, hs_zero, clk_lane_hs_zero, data_lane_hs_zero;
|
|
+ unsigned int i;
|
|
+
|
|
+ /* Select MIPI mode */
|
|
+ phy_update_bits(inno, REGISTER_PART_LVDS, 0x03,
|
|
+ MODE_ENABLE_MASK, MIPI_MODE_ENABLE);
|
|
+ /* Configure PLL */
|
|
+ phy_update_bits(inno, REGISTER_PART_ANALOG, 0x03,
|
|
+ REG_PREDIV_MASK, REG_PREDIV(inno->pll.prediv));
|
|
+ phy_update_bits(inno, REGISTER_PART_ANALOG, 0x03,
|
|
+ REG_FBDIV_HI_MASK, REG_FBDIV_HI(inno->pll.fbdiv));
|
|
+ phy_update_bits(inno, REGISTER_PART_ANALOG, 0x04,
|
|
+ REG_FBDIV_LO_MASK, REG_FBDIV_LO(inno->pll.fbdiv));
|
|
+ /* Enable PLL and LDO */
|
|
+ phy_update_bits(inno, REGISTER_PART_ANALOG, 0x01,
|
|
+ REG_LDOPD_MASK | REG_PLLPD_MASK,
|
|
+ REG_LDOPD_POWER_ON | REG_PLLPD_POWER_ON);
|
|
+ /* Reset analog */
|
|
+ phy_update_bits(inno, REGISTER_PART_ANALOG, 0x01,
|
|
+ REG_SYNCRST_MASK, REG_SYNCRST_RESET);
|
|
+ udelay(1);
|
|
+ phy_update_bits(inno, REGISTER_PART_ANALOG, 0x01,
|
|
+ REG_SYNCRST_MASK, REG_SYNCRST_NORMAL);
|
|
+ /* Reset digital */
|
|
+ phy_update_bits(inno, REGISTER_PART_DIGITAL, 0x00,
|
|
+ REG_DIG_RSTN_MASK, REG_DIG_RSTN_RESET);
|
|
+ udelay(1);
|
|
+ phy_update_bits(inno, REGISTER_PART_DIGITAL, 0x00,
|
|
+ REG_DIG_RSTN_MASK, REG_DIG_RSTN_NORMAL);
|
|
+
|
|
+ txbyteclkhs = inno->pll.rate / 8;
|
|
+ t_txbyteclkhs = div_u64(PSEC_PER_SEC, txbyteclkhs);
|
|
+
|
|
+ esc_clk_div = DIV_ROUND_UP(txbyteclkhs, 20000000);
|
|
+ txclkesc = txbyteclkhs / esc_clk_div;
|
|
+ t_txclkesc = div_u64(PSEC_PER_SEC, txclkesc);
|
|
+
|
|
+ ui = div_u64(PSEC_PER_SEC, inno->pll.rate);
|
|
+
|
|
+ memset(&gotp, 0, sizeof(gotp));
|
|
+ mipi_dphy_timing_get_default(&gotp, ui);
|
|
+
|
|
+ /*
|
|
+ * The value of counter for HS Ths-exit
|
|
+ * Ths-exit = Tpin_txbyteclkhs * value
|
|
+ */
|
|
+ hs_exit = DIV_ROUND_UP(gotp.hsexit, t_txbyteclkhs);
|
|
+ /*
|
|
+ * The value of counter for HS Tclk-post
|
|
+ * Tclk-post = Tpin_txbyteclkhs * value
|
|
+ */
|
|
+ clk_post = DIV_ROUND_UP(gotp.clkpost, t_txbyteclkhs);
|
|
+ /*
|
|
+ * The value of counter for HS Tclk-pre
|
|
+ * Tclk-pre = Tpin_txbyteclkhs * value
|
|
+ */
|
|
+ clk_pre = DIV_ROUND_UP(gotp.clkpre, t_txbyteclkhs);
|
|
+
|
|
+ /*
|
|
+ * The value of counter for HS Tlpx Time
|
|
+ * Tlpx = Tpin_txbyteclkhs * (2 + value)
|
|
+ */
|
|
+ lpx = DIV_ROUND_UP(gotp.lpx, t_txbyteclkhs);
|
|
+ if (lpx >= 2)
|
|
+ lpx -= 2;
|
|
+
|
|
+ /*
|
|
+ * The value of counter for HS Tta-go
|
|
+ * Tta-go for turnaround
|
|
+ * Tta-go = Ttxclkesc * value
|
|
+ */
|
|
+ ta_go = DIV_ROUND_UP(gotp.tago, t_txclkesc);
|
|
+ /*
|
|
+ * The value of counter for HS Tta-sure
|
|
+ * Tta-sure for turnaround
|
|
+ * Tta-sure = Ttxclkesc * value
|
|
+ */
|
|
+ ta_sure = DIV_ROUND_UP(gotp.tasure, t_txclkesc);
|
|
+ /*
|
|
+ * The value of counter for HS Tta-wait
|
|
+ * Tta-wait for turnaround
|
|
+ * Tta-wait = Ttxclkesc * value
|
|
+ */
|
|
+ ta_wait = DIV_ROUND_UP(gotp.taget, t_txclkesc);
|
|
+
|
|
+ for (i = 0; i < ARRAY_SIZE(timings); i++)
|
|
+ if (inno->pll.rate <= timings[i].rate)
|
|
+ break;
|
|
+
|
|
+ if (i == ARRAY_SIZE(timings))
|
|
+ --i;
|
|
+
|
|
+ hs_prepare = timings[i].hs_prepare;
|
|
+ hs_trail = timings[i].hs_trail;
|
|
+ clk_lane_hs_zero = timings[i].clk_lane_hs_zero;
|
|
+ data_lane_hs_zero = timings[i].data_lane_hs_zero;
|
|
+ wakeup = 0x3ff;
|
|
+
|
|
+ for (i = REGISTER_PART_CLOCK_LANE; i <= REGISTER_PART_DATA3_LANE; i++) {
|
|
+ if (i == REGISTER_PART_CLOCK_LANE)
|
|
+ hs_zero = clk_lane_hs_zero;
|
|
+ else
|
|
+ hs_zero = data_lane_hs_zero;
|
|
+
|
|
+ phy_update_bits(inno, i, 0x05, T_LPX_CNT_MASK,
|
|
+ T_LPX_CNT(lpx));
|
|
+ phy_update_bits(inno, i, 0x06, T_HS_PREPARE_CNT_MASK,
|
|
+ T_HS_PREPARE_CNT(hs_prepare));
|
|
+ phy_update_bits(inno, i, 0x07, T_HS_ZERO_CNT_MASK,
|
|
+ T_HS_ZERO_CNT(hs_zero));
|
|
+ phy_update_bits(inno, i, 0x08, T_HS_TRAIL_CNT_MASK,
|
|
+ T_HS_TRAIL_CNT(hs_trail));
|
|
+ phy_update_bits(inno, i, 0x09, T_HS_EXIT_CNT_MASK,
|
|
+ T_HS_EXIT_CNT(hs_exit));
|
|
+ phy_update_bits(inno, i, 0x0a, T_CLK_POST_CNT_MASK,
|
|
+ T_CLK_POST_CNT(clk_post));
|
|
+ phy_update_bits(inno, i, 0x0e, T_CLK_PRE_CNT_MASK,
|
|
+ T_CLK_PRE_CNT(clk_pre));
|
|
+ phy_update_bits(inno, i, 0x0c, T_WAKEUP_CNT_HI_MASK,
|
|
+ T_WAKEUP_CNT_HI(wakeup >> 8));
|
|
+ phy_update_bits(inno, i, 0x0d, T_WAKEUP_CNT_LO_MASK,
|
|
+ T_WAKEUP_CNT_LO(wakeup));
|
|
+ phy_update_bits(inno, i, 0x10, T_TA_GO_CNT_MASK,
|
|
+ T_TA_GO_CNT(ta_go));
|
|
+ phy_update_bits(inno, i, 0x11, T_TA_SURE_CNT_MASK,
|
|
+ T_TA_SURE_CNT(ta_sure));
|
|
+ phy_update_bits(inno, i, 0x12, T_TA_WAIT_CNT_MASK,
|
|
+ T_TA_WAIT_CNT(ta_wait));
|
|
+ }
|
|
+
|
|
+ /* Enable all lanes on analog part */
|
|
+ phy_update_bits(inno, REGISTER_PART_ANALOG, 0x00,
|
|
+ LANE_EN_MASK, LANE_EN_CK | LANE_EN_3 | LANE_EN_2 |
|
|
+ LANE_EN_1 | LANE_EN_0);
|
|
+}
|
|
+
|
|
+static void inno_dsidphy_lvds_mode_enable(struct inno_dsidphy *inno)
|
|
+{
|
|
+ u8 prediv = 2;
|
|
+ u16 fbdiv = 28;
|
|
+
|
|
+ /* Sample clock reverse direction */
|
|
+ phy_update_bits(inno, REGISTER_PART_ANALOG, 0x08,
|
|
+ SAMPLE_CLOCK_DIRECTION_MASK,
|
|
+ SAMPLE_CLOCK_DIRECTION_REVERSE);
|
|
+
|
|
+ /* Select LVDS mode */
|
|
+ phy_update_bits(inno, REGISTER_PART_LVDS, 0x03,
|
|
+ MODE_ENABLE_MASK, LVDS_MODE_ENABLE);
|
|
+ /* Configure PLL */
|
|
+ phy_update_bits(inno, REGISTER_PART_ANALOG, 0x03,
|
|
+ REG_PREDIV_MASK, REG_PREDIV(prediv));
|
|
+ phy_update_bits(inno, REGISTER_PART_ANALOG, 0x03,
|
|
+ REG_FBDIV_HI_MASK, REG_FBDIV_HI(fbdiv));
|
|
+ phy_update_bits(inno, REGISTER_PART_ANALOG, 0x04,
|
|
+ REG_FBDIV_LO_MASK, REG_FBDIV_LO(fbdiv));
|
|
+ phy_update_bits(inno, REGISTER_PART_LVDS, 0x08, 0xff, 0xfc);
|
|
+ /* Enable PLL and Bandgap */
|
|
+ phy_update_bits(inno, REGISTER_PART_LVDS, 0x0b,
|
|
+ LVDS_PLL_POWER_MASK | LVDS_BANDGAP_POWER_MASK,
|
|
+ LVDS_PLL_POWER_ON | LVDS_BANDGAP_POWER_ON);
|
|
+
|
|
+ msleep(20);
|
|
+
|
|
+ /* Reset LVDS digital logic */
|
|
+ phy_update_bits(inno, REGISTER_PART_LVDS, 0x00,
|
|
+ LVDS_DIGITAL_INTERNAL_RESET_MASK,
|
|
+ LVDS_DIGITAL_INTERNAL_RESET_ENABLE);
|
|
+ udelay(1);
|
|
+ phy_update_bits(inno, REGISTER_PART_LVDS, 0x00,
|
|
+ LVDS_DIGITAL_INTERNAL_RESET_MASK,
|
|
+ LVDS_DIGITAL_INTERNAL_RESET_DISABLE);
|
|
+ /* Enable LVDS digital logic */
|
|
+ phy_update_bits(inno, REGISTER_PART_LVDS, 0x01,
|
|
+ LVDS_DIGITAL_INTERNAL_ENABLE_MASK,
|
|
+ LVDS_DIGITAL_INTERNAL_ENABLE);
|
|
+ /* Enable LVDS analog driver */
|
|
+ phy_update_bits(inno, REGISTER_PART_LVDS, 0x0b,
|
|
+ LVDS_LANE_EN_MASK, LVDS_CLK_LANE_EN |
|
|
+ LVDS_DATA_LANE0_EN | LVDS_DATA_LANE1_EN |
|
|
+ LVDS_DATA_LANE2_EN | LVDS_DATA_LANE3_EN);
|
|
+}
|
|
+
|
|
+static int inno_dsidphy_power_on(struct phy *phy)
|
|
+{
|
|
+ struct inno_dsidphy *inno = phy_get_drvdata(phy);
|
|
+
|
|
+ clk_prepare_enable(inno->pclk_phy);
|
|
+ pm_runtime_get_sync(inno->dev);
|
|
+
|
|
+ /* Bandgap power on */
|
|
+ phy_update_bits(inno, REGISTER_PART_ANALOG, 0x00,
|
|
+ BANDGAP_POWER_MASK, BANDGAP_POWER_ON);
|
|
+ /* Enable power work */
|
|
+ phy_update_bits(inno, REGISTER_PART_ANALOG, 0x00,
|
|
+ POWER_WORK_MASK, POWER_WORK_ENABLE);
|
|
+
|
|
+ switch (inno->mode) {
|
|
+ case PHY_MODE_MIPI_DPHY:
|
|
+ inno_dsidphy_mipi_mode_enable(inno);
|
|
+ break;
|
|
+ case PHY_MODE_LVDS:
|
|
+ inno_dsidphy_lvds_mode_enable(inno);
|
|
+ break;
|
|
+ default:
|
|
+ return -EINVAL;
|
|
+ }
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+static int inno_dsidphy_power_off(struct phy *phy)
|
|
+{
|
|
+ struct inno_dsidphy *inno = phy_get_drvdata(phy);
|
|
+
|
|
+ phy_update_bits(inno, REGISTER_PART_ANALOG, 0x00, LANE_EN_MASK, 0);
|
|
+ phy_update_bits(inno, REGISTER_PART_ANALOG, 0x01,
|
|
+ REG_LDOPD_MASK | REG_PLLPD_MASK,
|
|
+ REG_LDOPD_POWER_DOWN | REG_PLLPD_POWER_DOWN);
|
|
+ phy_update_bits(inno, REGISTER_PART_ANALOG, 0x00,
|
|
+ POWER_WORK_MASK, POWER_WORK_DISABLE);
|
|
+ phy_update_bits(inno, REGISTER_PART_ANALOG, 0x00,
|
|
+ BANDGAP_POWER_MASK, BANDGAP_POWER_DOWN);
|
|
+
|
|
+ phy_update_bits(inno, REGISTER_PART_LVDS, 0x0b, LVDS_LANE_EN_MASK, 0);
|
|
+ phy_update_bits(inno, REGISTER_PART_LVDS, 0x01,
|
|
+ LVDS_DIGITAL_INTERNAL_ENABLE_MASK,
|
|
+ LVDS_DIGITAL_INTERNAL_DISABLE);
|
|
+ phy_update_bits(inno, REGISTER_PART_LVDS, 0x0b,
|
|
+ LVDS_PLL_POWER_MASK | LVDS_BANDGAP_POWER_MASK,
|
|
+ LVDS_PLL_POWER_OFF | LVDS_BANDGAP_POWER_DOWN);
|
|
+
|
|
+ pm_runtime_put(inno->dev);
|
|
+ clk_disable_unprepare(inno->pclk_phy);
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+static int inno_dsidphy_set_mode(struct phy *phy, enum phy_mode mode,
|
|
+ int submode)
|
|
+{
|
|
+ struct inno_dsidphy *inno = phy_get_drvdata(phy);
|
|
+
|
|
+ switch (mode) {
|
|
+ case PHY_MODE_MIPI_DPHY:
|
|
+ case PHY_MODE_LVDS:
|
|
+ inno->mode = mode;
|
|
+ break;
|
|
+ default:
|
|
+ return -EINVAL;
|
|
+ }
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+static const struct phy_ops inno_dsidphy_ops = {
|
|
+ .set_mode = inno_dsidphy_set_mode,
|
|
+ .power_on = inno_dsidphy_power_on,
|
|
+ .power_off = inno_dsidphy_power_off,
|
|
+ .owner = THIS_MODULE,
|
|
+};
|
|
+
|
|
+static unsigned long inno_dsidphy_pll_round_rate(struct inno_dsidphy *inno,
|
|
+ unsigned long prate,
|
|
+ unsigned long rate,
|
|
+ u8 *prediv, u16 *fbdiv)
|
|
+{
|
|
+ unsigned long best_freq = 0;
|
|
+ unsigned long fref, fout;
|
|
+ u8 min_prediv, max_prediv;
|
|
+ u8 _prediv, best_prediv = 1;
|
|
+ u16 _fbdiv, best_fbdiv = 1;
|
|
+ u32 min_delta = UINT_MAX;
|
|
+
|
|
+ /*
|
|
+ * The PLL output frequency can be calculated using a simple formula:
|
|
+ * PLL_Output_Frequency = (FREF / PREDIV * FBDIV) / 2
|
|
+ * PLL_Output_Frequency: it is equal to DDR-Clock-Frequency * 2
|
|
+ */
|
|
+ fref = prate / 2;
|
|
+ if (rate > 1000000000UL)
|
|
+ fout = 1000000000UL;
|
|
+ else
|
|
+ fout = rate;
|
|
+
|
|
+ /* 5Mhz < Fref / prediv < 40MHz */
|
|
+ min_prediv = DIV_ROUND_UP(fref, 40000000);
|
|
+ max_prediv = fref / 5000000;
|
|
+
|
|
+ for (_prediv = min_prediv; _prediv <= max_prediv; _prediv++) {
|
|
+ u64 tmp;
|
|
+ u32 delta;
|
|
+
|
|
+ tmp = (u64)fout * _prediv;
|
|
+ do_div(tmp, fref);
|
|
+ _fbdiv = tmp;
|
|
+
|
|
+ /*
|
|
+ * The possible settings of feedback divider are
|
|
+ * 12, 13, 14, 16, ~ 511
|
|
+ */
|
|
+ if (_fbdiv == 15)
|
|
+ continue;
|
|
+
|
|
+ if (_fbdiv < 12 || _fbdiv > 511)
|
|
+ continue;
|
|
+
|
|
+ tmp = (u64)_fbdiv * fref;
|
|
+ do_div(tmp, _prediv);
|
|
+
|
|
+ delta = abs(fout - tmp);
|
|
+ if (!delta) {
|
|
+ best_prediv = _prediv;
|
|
+ best_fbdiv = _fbdiv;
|
|
+ best_freq = tmp;
|
|
+ break;
|
|
+ } else if (delta < min_delta) {
|
|
+ best_prediv = _prediv;
|
|
+ best_fbdiv = _fbdiv;
|
|
+ best_freq = tmp;
|
|
+ min_delta = delta;
|
|
+ }
|
|
+ }
|
|
+
|
|
+ if (best_freq) {
|
|
+ *prediv = best_prediv;
|
|
+ *fbdiv = best_fbdiv;
|
|
+ }
|
|
+
|
|
+ return best_freq;
|
|
+}
|
|
+
|
|
+static long inno_dsidphy_pll_clk_round_rate(struct clk_hw *hw,
|
|
+ unsigned long rate,
|
|
+ unsigned long *prate)
|
|
+{
|
|
+ struct inno_dsidphy *inno = hw_to_inno(hw);
|
|
+ unsigned long fout;
|
|
+ u16 fbdiv = 1;
|
|
+ u8 prediv = 1;
|
|
+
|
|
+ fout = inno_dsidphy_pll_round_rate(inno, *prate, rate,
|
|
+ &prediv, &fbdiv);
|
|
+
|
|
+ return fout;
|
|
+}
|
|
+
|
|
+static int inno_dsidphy_pll_clk_set_rate(struct clk_hw *hw,
|
|
+ unsigned long rate,
|
|
+ unsigned long parent_rate)
|
|
+{
|
|
+ struct inno_dsidphy *inno = hw_to_inno(hw);
|
|
+ unsigned long fout;
|
|
+ u16 fbdiv = 1;
|
|
+ u8 prediv = 1;
|
|
+
|
|
+ fout = inno_dsidphy_pll_round_rate(inno, parent_rate, rate,
|
|
+ &prediv, &fbdiv);
|
|
+
|
|
+ dev_dbg(inno->dev, "fin=%lu, fout=%lu, prediv=%u, fbdiv=%u\n",
|
|
+ parent_rate, fout, prediv, fbdiv);
|
|
+
|
|
+ inno->pll.prediv = prediv;
|
|
+ inno->pll.fbdiv = fbdiv;
|
|
+ inno->pll.rate = fout;
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+static unsigned long
|
|
+inno_dsidphy_pll_clk_recalc_rate(struct clk_hw *hw, unsigned long prate)
|
|
+{
|
|
+ struct inno_dsidphy *inno = hw_to_inno(hw);
|
|
+
|
|
+ /* PLL_Output_Frequency = (FREF / PREDIV * FBDIV) / 2 */
|
|
+ return (prate / inno->pll.prediv * inno->pll.fbdiv) / 2;
|
|
+}
|
|
+
|
|
+static const struct clk_ops inno_dsidphy_pll_clk_ops = {
|
|
+ .round_rate = inno_dsidphy_pll_clk_round_rate,
|
|
+ .set_rate = inno_dsidphy_pll_clk_set_rate,
|
|
+ .recalc_rate = inno_dsidphy_pll_clk_recalc_rate,
|
|
+};
|
|
+
|
|
+static int inno_dsidphy_pll_register(struct inno_dsidphy *inno)
|
|
+{
|
|
+ struct device *dev = inno->dev;
|
|
+ struct clk *clk;
|
|
+ const char *parent_name;
|
|
+ struct clk_init_data init;
|
|
+ int ret;
|
|
+
|
|
+ parent_name = __clk_get_name(inno->ref_clk);
|
|
+
|
|
+ init.name = "mipi_dphy_pll";
|
|
+ ret = of_property_read_string(dev->of_node, "clock-output-names",
|
|
+ &init.name);
|
|
+ if (ret < 0)
|
|
+ dev_dbg(dev, "phy should set clock-output-names property\n");
|
|
+
|
|
+ init.ops = &inno_dsidphy_pll_clk_ops;
|
|
+ init.parent_names = &parent_name;
|
|
+ init.num_parents = 1;
|
|
+ init.flags = 0;
|
|
+
|
|
+ inno->pll.hw.init = &init;
|
|
+ clk = devm_clk_register(dev, &inno->pll.hw);
|
|
+ if (IS_ERR(clk)) {
|
|
+ ret = PTR_ERR(clk);
|
|
+ dev_err(dev, "failed to register PLL: %d\n", ret);
|
|
+ return ret;
|
|
+ }
|
|
+
|
|
+ return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get,
|
|
+ &inno->pll.hw);
|
|
+}
|
|
+
|
|
+static int inno_dsidphy_probe(struct platform_device *pdev)
|
|
+{
|
|
+ struct device *dev = &pdev->dev;
|
|
+ struct inno_dsidphy *inno;
|
|
+ struct phy_provider *phy_provider;
|
|
+ struct phy *phy;
|
|
+ int ret;
|
|
+
|
|
+ inno = devm_kzalloc(dev, sizeof(*inno), GFP_KERNEL);
|
|
+ if (!inno)
|
|
+ return -ENOMEM;
|
|
+
|
|
+ inno->dev = dev;
|
|
+ platform_set_drvdata(pdev, inno);
|
|
+
|
|
+ inno->phy_base = devm_platform_ioremap_resource(pdev, 0);
|
|
+ if (!inno->phy_base)
|
|
+ return -ENOMEM;
|
|
+
|
|
+ inno->ref_clk = devm_clk_get(dev, "ref");
|
|
+ if (IS_ERR(inno->ref_clk)) {
|
|
+ ret = PTR_ERR(inno->ref_clk);
|
|
+ dev_err(dev, "failed to get ref clock: %d\n", ret);
|
|
+ return ret;
|
|
+ }
|
|
+
|
|
+ inno->pclk_phy = devm_clk_get(dev, "pclk");
|
|
+ if (IS_ERR(inno->pclk_phy)) {
|
|
+ ret = PTR_ERR(inno->pclk_phy);
|
|
+ dev_err(dev, "failed to get phy pclk: %d\n", ret);
|
|
+ return ret;
|
|
+ }
|
|
+
|
|
+ inno->rst = devm_reset_control_get(dev, "apb");
|
|
+ if (IS_ERR(inno->rst)) {
|
|
+ ret = PTR_ERR(inno->rst);
|
|
+ dev_err(dev, "failed to get system reset control: %d\n", ret);
|
|
+ return ret;
|
|
+ }
|
|
+
|
|
+ phy = devm_phy_create(dev, NULL, &inno_dsidphy_ops);
|
|
+ if (IS_ERR(phy)) {
|
|
+ ret = PTR_ERR(phy);
|
|
+ dev_err(dev, "failed to create phy: %d\n", ret);
|
|
+ return ret;
|
|
+ }
|
|
+
|
|
+ phy_set_drvdata(phy, inno);
|
|
+
|
|
+ phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
|
|
+ if (IS_ERR(phy_provider)) {
|
|
+ ret = PTR_ERR(phy_provider);
|
|
+ dev_err(dev, "failed to register phy provider: %d\n", ret);
|
|
+ return ret;
|
|
+ }
|
|
+
|
|
+ ret = inno_dsidphy_pll_register(inno);
|
|
+ if (ret)
|
|
+ return ret;
|
|
+
|
|
+ pm_runtime_enable(dev);
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+static int inno_dsidphy_remove(struct platform_device *pdev)
|
|
+{
|
|
+ struct inno_dsidphy *inno = platform_get_drvdata(pdev);
|
|
+
|
|
+ pm_runtime_disable(inno->dev);
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+static const struct of_device_id inno_dsidphy_of_match[] = {
|
|
+ { .compatible = "rockchip,px30-dsi-dphy", },
|
|
+ { .compatible = "rockchip,rk3128-dsi-dphy", },
|
|
+ { .compatible = "rockchip,rk3368-dsi-dphy", },
|
|
+ {}
|
|
+};
|
|
+MODULE_DEVICE_TABLE(of, inno_dsidphy_of_match);
|
|
+
|
|
+static struct platform_driver inno_dsidphy_driver = {
|
|
+ .driver = {
|
|
+ .name = "inno-dsidphy",
|
|
+ .of_match_table = of_match_ptr(inno_dsidphy_of_match),
|
|
+ },
|
|
+ .probe = inno_dsidphy_probe,
|
|
+ .remove = inno_dsidphy_remove,
|
|
+};
|
|
+module_platform_driver(inno_dsidphy_driver);
|
|
+
|
|
+MODULE_AUTHOR("Wyon Bi <bivvy.bi@rock-chips.com>");
|
|
+MODULE_DESCRIPTION("Innosilicon MIPI/LVDS/TTL Video Combo PHY driver");
|
|
+MODULE_LICENSE("GPL v2");
|
|
|
|
From 39536608a57d4750fe7cfe6318e269b26ed6d1f2 Mon Sep 17 00:00:00 2001
|
|
From: Heiko Stuebner <heiko@sntech.de>
|
|
Date: Tue, 17 Sep 2019 10:25:32 +0200
|
|
Subject: [PATCH] phy: phy-rockchip-inno-usb2: add phy description for px30
|
|
|
|
The px30 soc from Rockchip shares the same register description as
|
|
the rk3328, so can re-use its definitions.
|
|
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Acked-by: Rob Herring <robh@kernel.org>
|
|
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
|
|
(cherry picked from commit 4569e64ab6a590dec418f2cd98fbe907a08fd452)
|
|
---
|
|
Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt | 1 +
|
|
drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 1 +
|
|
2 files changed, 2 insertions(+)
|
|
|
|
diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
|
|
index 00639baae74a..541f5298827c 100644
|
|
--- a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
|
|
+++ b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
|
|
@@ -2,6 +2,7 @@ ROCKCHIP USB2.0 PHY WITH INNO IP BLOCK
|
|
|
|
Required properties (phy (parent) node):
|
|
- compatible : should be one of the listed compatibles:
|
|
+ * "rockchip,px30-usb2phy"
|
|
* "rockchip,rk3228-usb2phy"
|
|
* "rockchip,rk3328-usb2phy"
|
|
* "rockchip,rk3366-usb2phy"
|
|
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
|
|
index eae865ff312c..680cc0c8825c 100644
|
|
--- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
|
|
+++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
|
|
@@ -1423,6 +1423,7 @@ static const struct rockchip_usb2phy_cfg rv1108_phy_cfgs[] = {
|
|
};
|
|
|
|
static const struct of_device_id rockchip_usb2phy_dt_match[] = {
|
|
+ { .compatible = "rockchip,px30-usb2phy", .data = &rk3328_phy_cfgs },
|
|
{ .compatible = "rockchip,rk3228-usb2phy", .data = &rk3228_phy_cfgs },
|
|
{ .compatible = "rockchip,rk3328-usb2phy", .data = &rk3328_phy_cfgs },
|
|
{ .compatible = "rockchip,rk3366-usb2phy", .data = &rk3366_phy_cfgs },
|
|
|
|
From ca6b69d5fd28225e8835ec2713870bbc549ae13a Mon Sep 17 00:00:00 2001
|
|
From: Heiko Stuebner <heiko@sntech.de>
|
|
Date: Thu, 24 Oct 2019 00:41:13 +0200
|
|
Subject: [PATCH] arm64: dts: rockchip: add px30 otp controller
|
|
|
|
The px30 soc contains a controller for one-time-programmable memory,
|
|
so add the necessary node for it and the fields defined in it by default.
|
|
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Link: https://lore.kernel.org/r/20191023224113.3268-1-heiko@sntech.de
|
|
(cherry picked from commit fbb78418c870c6d43d1bebfc59aa8062b7175f4d)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/px30.dtsi | 24 ++++++++++++++++++++++++
|
|
1 file changed, 24 insertions(+)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/px30.dtsi b/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
index 9ad1c2f04ea9..76ddef72e516 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
+++ b/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
@@ -664,6 +664,30 @@
|
|
status = "disabled";
|
|
};
|
|
|
|
+ otp: nvmem@ff290000 {
|
|
+ compatible = "rockchip,px30-otp";
|
|
+ reg = <0x0 0xff290000 0x0 0x4000>;
|
|
+ clocks = <&cru SCLK_OTP_USR>, <&cru PCLK_OTP_NS>,
|
|
+ <&cru PCLK_OTP_PHY>;
|
|
+ clock-names = "otp", "apb_pclk", "phy";
|
|
+ resets = <&cru SRST_OTP_PHY>;
|
|
+ reset-names = "phy";
|
|
+ #address-cells = <1>;
|
|
+ #size-cells = <1>;
|
|
+
|
|
+ /* Data cells */
|
|
+ cpu_id: id@7 {
|
|
+ reg = <0x07 0x10>;
|
|
+ };
|
|
+ cpu_leakage: cpu-leakage@17 {
|
|
+ reg = <0x17 0x1>;
|
|
+ };
|
|
+ performance: performance@1e {
|
|
+ reg = <0x1e 0x1>;
|
|
+ bits = <4 3>;
|
|
+ };
|
|
+ };
|
|
+
|
|
cru: clock-controller@ff2b0000 {
|
|
compatible = "rockchip,px30-cru";
|
|
reg = <0x0 0xff2b0000 0x0 0x1000>;
|
|
|
|
From db509d28eacfb9afb3ba2bc2aeb4aa8bc61a83a4 Mon Sep 17 00:00:00 2001
|
|
From: Heiko Stuebner <heiko@sntech.de>
|
|
Date: Thu, 24 Oct 2019 00:39:54 +0200
|
|
Subject: [PATCH] arm64: dts: rockchip: enable gpu on rk3399-puma
|
|
|
|
Set the supplying regulator and enable the gpu node on the rk3399-puma som.
|
|
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Link: https://lore.kernel.org/r/20191023223954.3139-1-heiko@sntech.de
|
|
(cherry picked from commit 2e7f8764dcb19a514d72eb5420194eae5cd6b480)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi | 5 +++++
|
|
1 file changed, 5 insertions(+)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
|
|
index 62ea288a1a70..c1edca3872c7 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
|
|
@@ -165,6 +165,11 @@
|
|
status = "okay";
|
|
};
|
|
|
|
+&gpu {
|
|
+ mali-supply = <&vdd_gpu>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
&i2c0 {
|
|
status = "okay";
|
|
i2c-scl-rising-time-ns = <168>;
|
|
|
|
From b005731892f5fcffcd46aaccfbbcce14755f2f32 Mon Sep 17 00:00:00 2001
|
|
From: Heiko Stuebner <heiko@sntech.de>
|
|
Date: Thu, 24 Oct 2019 00:44:09 +0200
|
|
Subject: [PATCH] arm64: dts: rockchip: remove px30 default optee node
|
|
|
|
Having a default optee node in a soc devicetree is not really good.
|
|
For one there is no guarantee that any tee got loaded and there's even
|
|
the possibility that a completely different TEE got loaded.
|
|
|
|
OP-Tee however will insert relevant nodes to the devicetree (firmware
|
|
+reserved memory sections) during its own startup, so there really is
|
|
no need to provide a default node.
|
|
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Link: https://lore.kernel.org/r/20191023224409.3550-1-heiko@sntech.de
|
|
(cherry picked from commit 7272d6e03d11f3510c28cef081ad01c08d1f2001)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/px30.dtsi | 7 -------
|
|
1 file changed, 7 deletions(-)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/px30.dtsi b/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
index 76ddef72e516..763ef9bbac21 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
+++ b/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
@@ -161,13 +161,6 @@
|
|
status = "disabled";
|
|
};
|
|
|
|
- firmware {
|
|
- optee {
|
|
- compatible = "linaro,optee-tz";
|
|
- method = "smc";
|
|
- };
|
|
- };
|
|
-
|
|
gmac_clkin: external-gmac-clock {
|
|
compatible = "fixed-clock";
|
|
clock-frequency = <50000000>;
|
|
|
|
From c1bc25278be8336e18e40eaf65d8ae1b17d82f3a Mon Sep 17 00:00:00 2001
|
|
From: Heiko Stuebner <heiko@sntech.de>
|
|
Date: Tue, 17 Sep 2019 10:26:58 +0200
|
|
Subject: [PATCH] arm64: dts: rockchip: add usb2phy for px30
|
|
|
|
Add the usb2phy node on the px30 and hook it up to the usb controllers
|
|
it supplies.
|
|
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Link: https://lore.kernel.org/r/20190917082659.25549-12-heiko@sntech.de
|
|
(cherry picked from commit f952b45bf37076675f4225d472451373ad5158b7)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/px30.dtsi | 43 ++++++++++++++++++++++++++++++++++
|
|
1 file changed, 43 insertions(+)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/px30.dtsi b/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
index 763ef9bbac21..8812b70f3911 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
+++ b/arch/arm64/boot/dts/rockchip/px30.dtsi
|
|
@@ -718,6 +718,43 @@
|
|
<26000000>;
|
|
};
|
|
|
|
+ usb2phy_grf: syscon@ff2c0000 {
|
|
+ compatible = "rockchip,px30-usb2phy-grf", "syscon",
|
|
+ "simple-mfd";
|
|
+ reg = <0x0 0xff2c0000 0x0 0x10000>;
|
|
+ #address-cells = <1>;
|
|
+ #size-cells = <1>;
|
|
+
|
|
+ u2phy: usb2-phy@100 {
|
|
+ compatible = "rockchip,px30-usb2phy";
|
|
+ reg = <0x100 0x20>;
|
|
+ clocks = <&pmucru SCLK_USBPHY_REF>;
|
|
+ clock-names = "phyclk";
|
|
+ #clock-cells = <0>;
|
|
+ assigned-clocks = <&cru USB480M>;
|
|
+ assigned-clock-parents = <&u2phy>;
|
|
+ clock-output-names = "usb480m_phy";
|
|
+ status = "disabled";
|
|
+
|
|
+ u2phy_host: host-port {
|
|
+ #phy-cells = <0>;
|
|
+ interrupts = <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ interrupt-names = "linestate";
|
|
+ status = "disabled";
|
|
+ };
|
|
+
|
|
+ u2phy_otg: otg-port {
|
|
+ #phy-cells = <0>;
|
|
+ interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>,
|
|
+ <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>,
|
|
+ <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ interrupt-names = "otg-bvalid", "otg-id",
|
|
+ "linestate";
|
|
+ status = "disabled";
|
|
+ };
|
|
+ };
|
|
+ };
|
|
+
|
|
usb20_otg: usb@ff300000 {
|
|
compatible = "rockchip,px30-usb", "rockchip,rk3066-usb",
|
|
"snps,dwc2";
|
|
@@ -730,6 +767,8 @@
|
|
g-rx-fifo-size = <280>;
|
|
g-tx-fifo-size = <256 128 128 64 32 16>;
|
|
g-use-dma;
|
|
+ phys = <&u2phy_otg>;
|
|
+ phy-names = "usb2-phy";
|
|
power-domains = <&power PX30_PD_USB>;
|
|
status = "disabled";
|
|
};
|
|
@@ -740,6 +779,8 @@
|
|
interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
|
|
clocks = <&cru HCLK_HOST>;
|
|
clock-names = "usbhost";
|
|
+ phys = <&u2phy_host>;
|
|
+ phy-names = "usb";
|
|
power-domains = <&power PX30_PD_USB>;
|
|
status = "disabled";
|
|
};
|
|
@@ -750,6 +791,8 @@
|
|
interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
|
|
clocks = <&cru HCLK_HOST>;
|
|
clock-names = "usbhost";
|
|
+ phys = <&u2phy_host>;
|
|
+ phy-names = "usb";
|
|
power-domains = <&power PX30_PD_USB>;
|
|
status = "disabled";
|
|
};
|
|
|
|
From 8a9b0df50dfa671b226012b8a66736824588712f Mon Sep 17 00:00:00 2001
|
|
From: Heiko Stuebner <heiko@sntech.de>
|
|
Date: Tue, 17 Sep 2019 10:26:59 +0200
|
|
Subject: [PATCH] arm64: dts: rockchip: enable usb2phy on px30-evb
|
|
|
|
Enable the phy node ion the px30 evb board.
|
|
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Link: https://lore.kernel.org/r/20190917082659.25549-13-heiko@sntech.de
|
|
(cherry picked from commit 0815dc22c2387ae681203a98dceef339408b8412)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/px30-evb.dts | 12 ++++++++++++
|
|
1 file changed, 12 insertions(+)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/px30-evb.dts b/arch/arm64/boot/dts/rockchip/px30-evb.dts
|
|
index 1185a314ba4a..936ed7d71ffc 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/px30-evb.dts
|
|
+++ b/arch/arm64/boot/dts/rockchip/px30-evb.dts
|
|
@@ -485,6 +485,18 @@
|
|
status = "okay";
|
|
};
|
|
|
|
+&u2phy {
|
|
+ status = "okay";
|
|
+
|
|
+ u2phy_host: host-port {
|
|
+ status = "okay";
|
|
+ };
|
|
+
|
|
+ u2phy_otg: otg-port {
|
|
+ status = "okay";
|
|
+ };
|
|
+};
|
|
+
|
|
&uart1 {
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&uart1_xfer &uart1_cts>;
|
|
|
|
From 9d3f8ed69798dda18b632853febc023d36fb966d Mon Sep 17 00:00:00 2001
|
|
From: Markus Reichl <m.reichl@fivetechno.de>
|
|
Date: Thu, 31 Oct 2019 12:04:29 +0100
|
|
Subject: [PATCH] arm64: dts: rockchip: Add nodes for buttons on rk3399-roc-pc
|
|
|
|
rk3399-roc-pc has a power and a recovery button, enable them.
|
|
|
|
Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
|
|
Link: https://lore.kernel.org/r/1ce152cc-bd6b-63af-7892-221e084d087f@fivetechno.de
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit 389989270e5fef7782e168e102f81e3ceb1ac7db)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts | 36 ++++++++++++++++++++++++++
|
|
1 file changed, 36 insertions(+)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
|
|
index 12d38f6e00ac..e1a595a86b98 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
|
|
@@ -4,6 +4,7 @@
|
|
*/
|
|
|
|
/dts-v1/;
|
|
+#include <dt-bindings/input/linux-event-codes.h>
|
|
#include <dt-bindings/pwm/pwm.h>
|
|
#include "rk3399.dtsi"
|
|
#include "rk3399-opp.dtsi"
|
|
@@ -28,6 +29,35 @@
|
|
#clock-cells = <0>;
|
|
};
|
|
|
|
+ adc-keys {
|
|
+ compatible = "adc-keys";
|
|
+ io-channels = <&saradc 1>;
|
|
+ io-channel-names = "buttons";
|
|
+ keyup-threshold-microvolt = <1500000>;
|
|
+ poll-interval = <100>;
|
|
+
|
|
+ recovery {
|
|
+ label = "Recovery";
|
|
+ linux,code = <KEY_VENDOR>;
|
|
+ press-threshold-microvolt = <18000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ gpio-keys {
|
|
+ compatible = "gpio-keys";
|
|
+ autorepeat;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&pwr_key_l>;
|
|
+
|
|
+ power {
|
|
+ label = "GPIO Key Power";
|
|
+ debounce-interval = <100>;
|
|
+ gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
|
|
+ linux,code = <KEY_POWER>;
|
|
+ wakeup-source;
|
|
+ };
|
|
+ };
|
|
+
|
|
leds {
|
|
compatible = "gpio-leds";
|
|
pinctrl-names = "default";
|
|
@@ -515,6 +545,12 @@
|
|
};
|
|
|
|
&pinctrl {
|
|
+ buttons {
|
|
+ pwr_key_l: pwr-key-l {
|
|
+ rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
|
|
+ };
|
|
+ };
|
|
+
|
|
lcd-panel {
|
|
lcd_panel_reset: lcd-panel-reset {
|
|
rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>;
|
|
|
|
From 03f59f17a2626921bdb580483b0bee449ed16efe Mon Sep 17 00:00:00 2001
|
|
From: Markus Reichl <m.reichl@fivetechno.de>
|
|
Date: Thu, 31 Oct 2019 09:51:56 +0100
|
|
Subject: [PATCH] arm64: dts: rockchip: Add vcc_sys enable pin on rk3399-roc-pc
|
|
|
|
rk3399-roc-pc has vcc_sys 5V supply for USB and other peripherals.
|
|
Add the GPIO pin to enable the regulator.
|
|
|
|
Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
|
|
Link: https://lore.kernel.org/r/c72db0ad-c261-af4f-efe6-22bbcf4a0b7b@fivetechno.de
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit 88e0b7822d2d4e8b5acb1e8372087045ef190304)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts | 8 ++++++++
|
|
1 file changed, 8 insertions(+)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
|
|
index e1a595a86b98..c845fa532fc1 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
|
|
@@ -170,6 +170,10 @@
|
|
|
|
vcc_sys: vcc-sys {
|
|
compatible = "regulator-fixed";
|
|
+ enable-active-high;
|
|
+ gpio = <&gpio2 RK_PA6 GPIO_ACTIVE_HIGH>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&vcc_sys_en>;
|
|
regulator-name = "vcc_sys";
|
|
regulator-always-on;
|
|
regulator-boot-on;
|
|
@@ -598,6 +602,10 @@
|
|
rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
};
|
|
|
|
+ vcc_sys_en: vcc-sys-en {
|
|
+ rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
hub_rst: hub-rst {
|
|
rockchip,pins = <2 RK_PA4 RK_FUNC_GPIO &pcfg_output_high>;
|
|
};
|
|
|
|
From caf2c5b192fa4d846f1aa4f2055b37c49b2553fd Mon Sep 17 00:00:00 2001
|
|
From: Markus Reichl <m.reichl@fivetechno.de>
|
|
Date: Thu, 31 Oct 2019 14:30:06 +0100
|
|
Subject: [PATCH] arm64: dts: rockchip: Rework voltage supplies for regulators
|
|
on rk3399-roc-pc
|
|
|
|
Correct the voltage supplies according to the board schematics
|
|
ROC-3399-PC-V10-A-20180804.
|
|
|
|
Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
|
|
Link: https://lore.kernel.org/r/22b56700-3c9e-0f60-cd74-7ff24d4f1a23@fivetechno.de
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit f00736e38e98a6e7afd4637f33cc77280e2fb6df)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts | 30 ++++++++++++++------------
|
|
1 file changed, 16 insertions(+), 14 deletions(-)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
|
|
index c845fa532fc1..07ae4b1d53d4 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
|
|
@@ -142,7 +142,7 @@
|
|
regulator-boot-on;
|
|
regulator-min-microvolt = <3300000>;
|
|
regulator-max-microvolt = <3300000>;
|
|
- vin-supply = <&vcc_sys>;
|
|
+ vin-supply = <&dc_12v>;
|
|
};
|
|
|
|
/* Actually 3 regulators (host0, 1, 2) controlled by the same gpio */
|
|
@@ -190,7 +190,7 @@
|
|
regulator-boot-on;
|
|
regulator-min-microvolt = <800000>;
|
|
regulator-max-microvolt = <1400000>;
|
|
- vin-supply = <&vcc_sys>;
|
|
+ vin-supply = <&vcc3v3_sys>;
|
|
};
|
|
};
|
|
|
|
@@ -263,18 +263,20 @@
|
|
rockchip,system-power-controller;
|
|
wakeup-source;
|
|
|
|
- vcc1-supply = <&vcc_sys>;
|
|
- vcc2-supply = <&vcc_sys>;
|
|
- vcc3-supply = <&vcc_sys>;
|
|
- vcc4-supply = <&vcc_sys>;
|
|
- vcc6-supply = <&vcc_sys>;
|
|
- vcc7-supply = <&vcc_sys>;
|
|
+ vcc1-supply = <&vcc3v3_sys>;
|
|
+ vcc2-supply = <&vcc3v3_sys>;
|
|
+ vcc3-supply = <&vcc3v3_sys>;
|
|
+ vcc4-supply = <&vcc3v3_sys>;
|
|
+ vcc6-supply = <&vcc3v3_sys>;
|
|
+ vcc7-supply = <&vcc3v3_sys>;
|
|
vcc8-supply = <&vcc3v3_sys>;
|
|
- vcc9-supply = <&vcc_sys>;
|
|
- vcc10-supply = <&vcc_sys>;
|
|
- vcc11-supply = <&vcc_sys>;
|
|
+ vcc9-supply = <&vcc3v3_sys>;
|
|
+ vcc10-supply = <&vcc3v3_sys>;
|
|
+ vcc11-supply = <&vcc3v3_sys>;
|
|
vcc12-supply = <&vcc3v3_sys>;
|
|
- vddio-supply = <&vcc1v8_pmu>;
|
|
+ vcc13-supply = <&vcc3v3_sys>;
|
|
+ vcc14-supply = <&vcc3v3_sys>;
|
|
+ vddio-supply = <&vcc_3v0>;
|
|
|
|
regulators {
|
|
vdd_center: DCDC_REG1 {
|
|
@@ -446,7 +448,7 @@
|
|
regulator-ramp-delay = <1000>;
|
|
regulator-always-on;
|
|
regulator-boot-on;
|
|
- vin-supply = <&vcc_sys>;
|
|
+ vin-supply = <&vcc3v3_sys>;
|
|
|
|
regulator-state-mem {
|
|
regulator-off-in-suspend;
|
|
@@ -465,7 +467,7 @@
|
|
regulator-ramp-delay = <1000>;
|
|
regulator-always-on;
|
|
regulator-boot-on;
|
|
- vin-supply = <&vcc_sys>;
|
|
+ vin-supply = <&vcc3v3_sys>;
|
|
|
|
regulator-state-mem {
|
|
regulator-off-in-suspend;
|
|
|
|
From a24d0fbb7e3b050d7d5ea5108b9cb61f05a46f7d Mon Sep 17 00:00:00 2001
|
|
From: Peter Geis <pgwipeout@gmail.com>
|
|
Date: Mon, 28 Oct 2019 18:22:51 +0000
|
|
Subject: [PATCH] dt-bindings: clean up rockchip grf binding document
|
|
|
|
Fixup some typos and inconsistencies in the grf binding.
|
|
|
|
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
|
|
Link: https://lore.kernel.org/r/20191028182254.30739-3-pgwipeout@gmail.com
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit 21e3311a6a15cce30d6903d3bd4870c16f4672a2)
|
|
---
|
|
Documentation/devicetree/bindings/soc/rockchip/grf.txt | 6 +++---
|
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/Documentation/devicetree/bindings/soc/rockchip/grf.txt b/Documentation/devicetree/bindings/soc/rockchip/grf.txt
|
|
index 61d89749918a..f96511aa3897 100644
|
|
--- a/Documentation/devicetree/bindings/soc/rockchip/grf.txt
|
|
+++ b/Documentation/devicetree/bindings/soc/rockchip/grf.txt
|
|
@@ -38,12 +38,12 @@ Required Properties:
|
|
- "rockchip,px30-pmugrf", "syscon": for px30
|
|
- "rockchip,rk3368-pmugrf", "syscon": for rk3368
|
|
- "rockchip,rk3399-pmugrf", "syscon": for rk3399
|
|
-- compatible: SGRF should be one of the following
|
|
+- compatible: SGRF should be one of the following:
|
|
- "rockchip,rk3288-sgrf", "syscon": for rk3288
|
|
-- compatible: USB2PHYGRF should be one of the followings
|
|
+- compatible: USB2PHYGRF should be one of the following:
|
|
- "rockchip,px30-usb2phy-grf", "syscon": for px30
|
|
- "rockchip,rk3328-usb2phy-grf", "syscon": for rk3328
|
|
-- compatible: USBGRF should be one of the following
|
|
+- compatible: USBGRF should be one of the following:
|
|
- "rockchip,rv1108-usbgrf", "syscon": for rv1108
|
|
- reg: physical base address of the controller and length of memory mapped
|
|
region.
|
|
|
|
From d7c7242731aae3505cf0984546b48057f7e8df4a Mon Sep 17 00:00:00 2001
|
|
From: Andy Yan <andy.yan@rock-chips.com>
|
|
Date: Wed, 30 Oct 2019 15:26:48 +0800
|
|
Subject: [PATCH] dt-bindings: Add doc for Firefly ROC-RK3308-CC board
|
|
|
|
Add compatible for Firefly ROC-RK3308-CC board.
|
|
|
|
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
|
|
Link: https://lore.kernel.org/r/20191030072648.29738-1-andy.yan@rock-chips.com
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit ab14c422a1d1877676a001d27f8c64a916ec077e)
|
|
---
|
|
Documentation/devicetree/bindings/arm/rockchip.yaml | 5 +++++
|
|
1 file changed, 5 insertions(+)
|
|
|
|
diff --git a/Documentation/devicetree/bindings/arm/rockchip.yaml b/Documentation/devicetree/bindings/arm/rockchip.yaml
|
|
index bf86e8237363..4ae93edc74ff 100644
|
|
--- a/Documentation/devicetree/bindings/arm/rockchip.yaml
|
|
+++ b/Documentation/devicetree/bindings/arm/rockchip.yaml
|
|
@@ -82,6 +82,11 @@ properties:
|
|
- const: firefly,firefly-rk3399
|
|
- const: rockchip,rk3399
|
|
|
|
+ - description: Firefly ROC-RK3308-CC
|
|
+ items:
|
|
+ - const: firefly,roc-rk3308-cc
|
|
+ - const: rockchip,rk3308
|
|
+
|
|
- description: Firefly roc-rk3328-cc
|
|
items:
|
|
- const: firefly,roc-rk3328-cc
|
|
|
|
From 3c4a555125a0a772a7cc947887c002d04582feaf Mon Sep 17 00:00:00 2001
|
|
From: Andy Yan <andy.yan@rock-chips.com>
|
|
Date: Wed, 30 Oct 2019 15:28:11 +0800
|
|
Subject: [PATCH] arm64: dts: rockchip: Add devicetree for board roc-rk3308-cc
|
|
|
|
ROC-RK3308-CC is a rk3308 based board designed by Firelfy,
|
|
with eMMC and 256MB DDR3 and RTL8188 Wifi on board.
|
|
|
|
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
|
|
Link: https://lore.kernel.org/r/20191030072811.29882-1-andy.yan@rock-chips.com
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit 4403e1237be3af0977aa23ef399e3496316317a0)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/Makefile | 1 +
|
|
arch/arm64/boot/dts/rockchip/rk3308-roc-cc.dts | 188 +++++++++++++++++++++++++
|
|
2 files changed, 189 insertions(+)
|
|
create mode 100644 arch/arm64/boot/dts/rockchip/rk3308-roc-cc.dts
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile
|
|
index a959434ad46e..cf69b0f33ecb 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/Makefile
|
|
+++ b/arch/arm64/boot/dts/rockchip/Makefile
|
|
@@ -1,6 +1,7 @@
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += px30-evb.dtb
|
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3308-evb.dtb
|
|
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3308-roc-cc.dtb
|
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-evb.dtb
|
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-rock64.dtb
|
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-roc-cc.dtb
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3308-roc-cc.dts b/arch/arm64/boot/dts/rockchip/rk3308-roc-cc.dts
|
|
new file mode 100644
|
|
index 000000000000..aa256350b18f
|
|
--- /dev/null
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3308-roc-cc.dts
|
|
@@ -0,0 +1,188 @@
|
|
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
|
+/*
|
|
+ * Copyright (c) 2019 Fuzhou Rockchip Electronics Co., Ltd
|
|
+ */
|
|
+
|
|
+/dts-v1/;
|
|
+#include "rk3308.dtsi"
|
|
+
|
|
+/ {
|
|
+ model = "Firefly ROC-RK3308-CC board";
|
|
+ compatible = "firefly,roc-rk3308-cc", "rockchip,rk3308";
|
|
+ chosen {
|
|
+ stdout-path = "serial2:1500000n8";
|
|
+ };
|
|
+
|
|
+ ir_rx {
|
|
+ compatible = "gpio-ir-receiver";
|
|
+ gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&ir_recv_pin>;
|
|
+ };
|
|
+
|
|
+ ir_tx {
|
|
+ compatible = "pwm-ir-tx";
|
|
+ pwms = <&pwm5 0 25000 0>;
|
|
+ };
|
|
+
|
|
+ leds {
|
|
+ compatible = "gpio-leds";
|
|
+
|
|
+ power {
|
|
+ label = "firefly:red:power";
|
|
+ linux,default-trigger = "ir-power-click";
|
|
+ default-state = "on";
|
|
+ gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
|
|
+ };
|
|
+
|
|
+ user {
|
|
+ label = "firefly:blue:user";
|
|
+ linux,default-trigger = "ir-user-click";
|
|
+ default-state = "off";
|
|
+ gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_HIGH>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ typec_vcc5v: typec-vcc5v {
|
|
+ compatible = "regulator-fixed";
|
|
+ regulator-name = "typec_vcc5v";
|
|
+ regulator-min-microvolt = <5000000>;
|
|
+ regulator-max-microvolt = <5000000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ };
|
|
+
|
|
+ vcc5v0_sys: vcc5v0-sys {
|
|
+ compatible = "regulator-fixed";
|
|
+ regulator-name = "vcc5v0_sys";
|
|
+ regulator-min-microvolt = <5000000>;
|
|
+ regulator-max-microvolt = <5000000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ vin-supply = <&typec_vcc5v>;
|
|
+ };
|
|
+
|
|
+ vcc_io: vcc-io {
|
|
+ compatible = "regulator-fixed";
|
|
+ regulator-name = "vcc_io";
|
|
+ regulator-min-microvolt = <3300000>;
|
|
+ regulator-max-microvolt = <3300000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ vin-supply = <&vcc5v0_sys>;
|
|
+ };
|
|
+
|
|
+ vcc_sdmmc: vcc-sdmmc {
|
|
+ compatible = "regulator-gpio";
|
|
+ regulator-name = "vcc_sdmmc";
|
|
+ regulator-min-microvolt = <1800000>;
|
|
+ regulator-max-microvolt = <3300000>;
|
|
+ gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_HIGH>;
|
|
+ states = <1800000 0x0
|
|
+ 3300000 0x1>;
|
|
+ vin-supply = <&vcc5v0_sys>;
|
|
+ };
|
|
+
|
|
+ vcc_sd: vcc-sd {
|
|
+ compatible = "regulator-fixed";
|
|
+ gpio = <&gpio4 RK_PD6 GPIO_ACTIVE_LOW>;
|
|
+ regulator-name = "vcc_sd";
|
|
+ regulator-min-microvolt = <3300000>;
|
|
+ regulator-max-microvolt = <3300000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ vim-supply = <&vcc_io>;
|
|
+ };
|
|
+
|
|
+ vdd_core: vdd-core {
|
|
+ compatible = "pwm-regulator";
|
|
+ pwms = <&pwm0 0 5000 1>;
|
|
+ regulator-name = "vdd_core";
|
|
+ regulator-min-microvolt = <827000>;
|
|
+ regulator-max-microvolt = <1340000>;
|
|
+ regulator-init-microvolt = <1015000>;
|
|
+ regulator-settling-time-up-us = <250>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ pwm-supply = <&vcc5v0_sys>;
|
|
+ };
|
|
+
|
|
+ vdd_log: vdd-log {
|
|
+ compatible = "regulator-fixed";
|
|
+ regulator-name = "vdd_log";
|
|
+ regulator-min-microvolt = <1050000>;
|
|
+ regulator-max-microvolt = <1050000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ vin-supply = <&vcc5v0_sys>;
|
|
+ };
|
|
+};
|
|
+
|
|
+&cpu0 {
|
|
+ cpu-supply = <&vdd_core>;
|
|
+};
|
|
+
|
|
+&emmc {
|
|
+ bus-width = <8>;
|
|
+ cap-mmc-highspeed;
|
|
+ disable-wp;
|
|
+ mmc-hs200-1_8v;
|
|
+ non-removable;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&i2c1 {
|
|
+ clock-frequency = <400000>;
|
|
+ status = "okay";
|
|
+
|
|
+ rtc: rtc@51 {
|
|
+ compatible = "nxp,pcf8563";
|
|
+ reg = <0x51>;
|
|
+ #clock-cells = <0>;
|
|
+ };
|
|
+};
|
|
+
|
|
+&pwm5 {
|
|
+ status = "okay";
|
|
+ pinctrl-names = "active";
|
|
+ pinctrl-0 = <&pwm5_pin_pull_down>;
|
|
+};
|
|
+
|
|
+&pinctrl {
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&rtc_32k>;
|
|
+
|
|
+ ir-receiver {
|
|
+ ir_recv_pin: ir-recv-pin {
|
|
+ rockchip,pins = <0 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ buttons {
|
|
+ pwr_key: pwr-key {
|
|
+ rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
|
|
+ };
|
|
+ };
|
|
+};
|
|
+
|
|
+&pwm0 {
|
|
+ status = "okay";
|
|
+ pinctrl-0 = <&pwm0_pin_pull_down>;
|
|
+};
|
|
+
|
|
+&sdmmc {
|
|
+ bus-width = <4>;
|
|
+ cap-mmc-highspeed;
|
|
+ cap-sd-highspeed;
|
|
+ card-detect-delay = <300>;
|
|
+ sd-uhs-sdr25;
|
|
+ sd-uhs-sdr50;
|
|
+ sd-uhs-sdr104;
|
|
+ vmmc-supply = <&vcc_sd>;
|
|
+ vqmmc-supply = <&vcc_sdmmc>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&uart2 {
|
|
+ status = "okay";
|
|
+};
|
|
|
|
From e98f97f50b9a734f09a5f5bce464e56d031759e1 Mon Sep 17 00:00:00 2001
|
|
From: Finley Xiao <finley.xiao@rock-chips.com>
|
|
Date: Tue, 17 Sep 2019 10:18:59 +0200
|
|
Subject: [PATCH] clk: rockchip: Add div50 clock-ids for sdmmc on px30 and
|
|
nandc
|
|
|
|
EMMC and SDIO already have these clock-ids (still unused) only sdmmc is
|
|
missing them, so fix that.
|
|
|
|
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Link: https://lore.kernel.org/r/20190917081903.25139-1-heiko@sntech.de
|
|
(cherry picked from commit 762539d6999caa1d9a916a4ce72004977b2433cf)
|
|
---
|
|
include/dt-bindings/clock/px30-cru.h | 2 ++
|
|
1 file changed, 2 insertions(+)
|
|
|
|
diff --git a/include/dt-bindings/clock/px30-cru.h b/include/dt-bindings/clock/px30-cru.h
|
|
index 00101479f7c4..5b1416fcde6f 100644
|
|
--- a/include/dt-bindings/clock/px30-cru.h
|
|
+++ b/include/dt-bindings/clock/px30-cru.h
|
|
@@ -85,6 +85,8 @@
|
|
#define SCLK_EMMC_DIV50 83
|
|
#define SCLK_DDRCLK 84
|
|
#define SCLK_UART1_SRC 85
|
|
+#define SCLK_SDMMC_DIV 86
|
|
+#define SCLK_SDMMC_DIV50 87
|
|
|
|
/* dclk gates */
|
|
#define DCLK_VOPB 150
|
|
|
|
From b5592442af17cd7f9dc86e26a0a36c930eaa6457 Mon Sep 17 00:00:00 2001
|
|
From: Finley Xiao <finley.xiao@rock-chips.com>
|
|
Date: Tue, 17 Sep 2019 10:19:00 +0200
|
|
Subject: [PATCH] clk: rockchip: Add div50 clocks for px30 sdmmc, emmc, sdio
|
|
and nandc
|
|
|
|
Some IPs, such as NAND, EMMC, SDIO and SDMMC need clock of 50% duty
|
|
cycle, divfree50 can generate clock of 50% duty cycle even in odd
|
|
value divisor.
|
|
|
|
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
Link: https://lore.kernel.org/r/20190917081903.25139-2-heiko@sntech.de
|
|
(cherry picked from commit e40781098f56dab52e92b7651d87b38805536d28)
|
|
---
|
|
drivers/clk/rockchip/clk-px30.c | 44 +++++++++++++++++++++++++++++++++++++----
|
|
1 file changed, 40 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/drivers/clk/rockchip/clk-px30.c b/drivers/clk/rockchip/clk-px30.c
|
|
index 3a501896b280..a973394f3d65 100644
|
|
--- a/drivers/clk/rockchip/clk-px30.c
|
|
+++ b/drivers/clk/rockchip/clk-px30.c
|
|
@@ -167,6 +167,10 @@ PNAME(mux_uart5_p) = { "clk_uart5_src", "clk_uart5_np5", "clk_uart5_frac" };
|
|
PNAME(mux_cif_out_p) = { "xin24m", "dummy_cpll", "npll", "usb480m" };
|
|
PNAME(mux_dclk_vopb_p) = { "dclk_vopb_src", "dclk_vopb_frac", "xin24m" };
|
|
PNAME(mux_dclk_vopl_p) = { "dclk_vopl_src", "dclk_vopl_frac", "xin24m" };
|
|
+PNAME(mux_nandc_p) = { "clk_nandc_div", "clk_nandc_div50" };
|
|
+PNAME(mux_sdio_p) = { "clk_sdio_div", "clk_sdio_div50" };
|
|
+PNAME(mux_emmc_p) = { "clk_emmc_div", "clk_emmc_div50" };
|
|
+PNAME(mux_sdmmc_p) = { "clk_sdmmc_div", "clk_sdmmc_div50" };
|
|
PNAME(mux_gmac_p) = { "clk_gmac_src", "gmac_clkin" };
|
|
PNAME(mux_gmac_rmii_sel_p) = { "clk_gmac_rx_tx_div20", "clk_gmac_rx_tx_div2" };
|
|
PNAME(mux_rtc32k_pmu_p) = { "xin32k", "pmu_pvtm_32k", "clk_rtc32k_frac", };
|
|
@@ -460,16 +464,40 @@ static struct rockchip_clk_branch px30_clk_branches[] __initdata = {
|
|
/* PD_MMC_NAND */
|
|
GATE(HCLK_MMC_NAND, "hclk_mmc_nand", "hclk_peri_pre", 0,
|
|
PX30_CLKGATE_CON(6), 0, GFLAGS),
|
|
- COMPOSITE(SCLK_NANDC, "clk_nandc", mux_gpll_cpll_npll_p, 0,
|
|
+ COMPOSITE(SCLK_NANDC_DIV, "clk_nandc_div", mux_gpll_cpll_npll_p, 0,
|
|
PX30_CLKSEL_CON(15), 6, 2, MFLAGS, 0, 5, DFLAGS,
|
|
+ PX30_CLKGATE_CON(5), 11, GFLAGS),
|
|
+ COMPOSITE(SCLK_NANDC_DIV50, "clk_nandc_div50", mux_gpll_cpll_npll_p, 0,
|
|
+ PX30_CLKSEL_CON(15), 6, 2, MFLAGS, 8, 5, DFLAGS,
|
|
+ PX30_CLKGATE_CON(5), 12, GFLAGS),
|
|
+ COMPOSITE_NODIV(SCLK_NANDC, "clk_nandc", mux_nandc_p,
|
|
+ CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
|
|
+ PX30_CLKSEL_CON(15), 15, 1, MFLAGS,
|
|
PX30_CLKGATE_CON(5), 13, GFLAGS),
|
|
|
|
- COMPOSITE(SCLK_SDIO, "clk_sdio", mux_gpll_cpll_npll_xin24m_p, 0,
|
|
+ COMPOSITE(SCLK_SDIO_DIV, "clk_sdio_div", mux_gpll_cpll_npll_xin24m_p, 0,
|
|
PX30_CLKSEL_CON(18), 14, 2, MFLAGS, 0, 8, DFLAGS,
|
|
+ PX30_CLKGATE_CON(6), 1, GFLAGS),
|
|
+ COMPOSITE_DIV_OFFSET(SCLK_SDIO_DIV50, "clk_sdio_div50",
|
|
+ mux_gpll_cpll_npll_xin24m_p, 0,
|
|
+ PX30_CLKSEL_CON(18), 14, 2, MFLAGS,
|
|
+ PX30_CLKSEL_CON(19), 0, 8, DFLAGS,
|
|
+ PX30_CLKGATE_CON(6), 2, GFLAGS),
|
|
+ COMPOSITE_NODIV(SCLK_SDIO, "clk_sdio", mux_sdio_p,
|
|
+ CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
|
|
+ PX30_CLKSEL_CON(19), 15, 1, MFLAGS,
|
|
PX30_CLKGATE_CON(6), 3, GFLAGS),
|
|
|
|
- COMPOSITE(SCLK_EMMC, "clk_emmc", mux_gpll_cpll_npll_xin24m_p, 0,
|
|
+ COMPOSITE(SCLK_EMMC_DIV, "clk_emmc_div", mux_gpll_cpll_npll_xin24m_p, 0,
|
|
PX30_CLKSEL_CON(20), 14, 2, MFLAGS, 0, 8, DFLAGS,
|
|
+ PX30_CLKGATE_CON(6), 4, GFLAGS),
|
|
+ COMPOSITE_DIV_OFFSET(SCLK_EMMC_DIV50, "clk_emmc_div50", mux_gpll_cpll_npll_xin24m_p, 0,
|
|
+ PX30_CLKSEL_CON(20), 14, 2, MFLAGS,
|
|
+ PX30_CLKSEL_CON(21), 0, 8, DFLAGS,
|
|
+ PX30_CLKGATE_CON(6), 5, GFLAGS),
|
|
+ COMPOSITE_NODIV(SCLK_EMMC, "clk_emmc", mux_emmc_p,
|
|
+ CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
|
|
+ PX30_CLKSEL_CON(21), 15, 1, MFLAGS,
|
|
PX30_CLKGATE_CON(6), 6, GFLAGS),
|
|
|
|
COMPOSITE(SCLK_SFC, "clk_sfc", mux_gpll_cpll_p, 0,
|
|
@@ -494,8 +522,16 @@ static struct rockchip_clk_branch px30_clk_branches[] __initdata = {
|
|
/* PD_SDCARD */
|
|
GATE(0, "hclk_sdmmc_pre", "hclk_peri_pre", 0,
|
|
PX30_CLKGATE_CON(6), 12, GFLAGS),
|
|
- COMPOSITE(SCLK_SDMMC, "clk_sdmmc", mux_gpll_cpll_npll_xin24m_p, 0,
|
|
+ COMPOSITE(SCLK_SDMMC_DIV, "clk_sdmmc_div", mux_gpll_cpll_npll_xin24m_p, 0,
|
|
PX30_CLKSEL_CON(16), 14, 2, MFLAGS, 0, 8, DFLAGS,
|
|
+ PX30_CLKGATE_CON(6), 13, GFLAGS),
|
|
+ COMPOSITE_DIV_OFFSET(SCLK_SDMMC_DIV50, "clk_sdmmc_div50", mux_gpll_cpll_npll_xin24m_p, 0,
|
|
+ PX30_CLKSEL_CON(16), 14, 2, MFLAGS,
|
|
+ PX30_CLKSEL_CON(17), 0, 8, DFLAGS,
|
|
+ PX30_CLKGATE_CON(6), 14, GFLAGS),
|
|
+ COMPOSITE_NODIV(SCLK_SDMMC, "clk_sdmmc", mux_sdmmc_p,
|
|
+ CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
|
|
+ PX30_CLKSEL_CON(17), 15, 1, MFLAGS,
|
|
PX30_CLKGATE_CON(6), 15, GFLAGS),
|
|
|
|
/* PD_USB */
|
|
|
|
From b16dacb3154040007a90e69aa8e72d7741e4a3a7 Mon Sep 17 00:00:00 2001
|
|
From: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
|
|
Date: Tue, 17 Sep 2019 10:19:01 +0200
|
|
Subject: [PATCH] clk: rockchip: move px30 critical clocks to correct clock
|
|
controller
|
|
|
|
The clocks in the px30 critical clock section are from the regular cru not
|
|
the pmucru, so move them to the correct place.
|
|
|
|
Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
|
|
Link: https://lore.kernel.org/r/20190917081903.25139-3-heiko@sntech.de
|
|
(cherry picked from commit 7990660f36bea5fc2d610e0b0b73dd57ce1682b0)
|
|
---
|
|
drivers/clk/rockchip/clk-px30.c | 8 ++++----
|
|
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/drivers/clk/rockchip/clk-px30.c b/drivers/clk/rockchip/clk-px30.c
|
|
index a973394f3d65..5c77da1e3abc 100644
|
|
--- a/drivers/clk/rockchip/clk-px30.c
|
|
+++ b/drivers/clk/rockchip/clk-px30.c
|
|
@@ -976,7 +976,7 @@ static struct rockchip_clk_branch px30_clk_pmu_branches[] __initdata = {
|
|
GATE(0, "pclk_cru_pmu", "pclk_pmu_pre", CLK_IGNORE_UNUSED, PX30_PMU_CLKGATE_CON(0), 8, GFLAGS),
|
|
};
|
|
|
|
-static const char *const px30_pmucru_critical_clocks[] __initconst = {
|
|
+static const char *const px30_cru_critical_clocks[] __initconst = {
|
|
"aclk_bus_pre",
|
|
"pclk_bus_pre",
|
|
"hclk_bus_pre",
|
|
@@ -1021,6 +1021,9 @@ static void __init px30_clk_init(struct device_node *np)
|
|
&px30_cpuclk_data, px30_cpuclk_rates,
|
|
ARRAY_SIZE(px30_cpuclk_rates));
|
|
|
|
+ rockchip_clk_protect_critical(px30_cru_critical_clocks,
|
|
+ ARRAY_SIZE(px30_cru_critical_clocks));
|
|
+
|
|
rockchip_register_softrst(np, 12, reg_base + PX30_SOFTRST_CON(0),
|
|
ROCKCHIP_SOFTRST_HIWORD_MASK);
|
|
|
|
@@ -1053,9 +1056,6 @@ static void __init px30_pmu_clk_init(struct device_node *np)
|
|
rockchip_clk_register_branches(ctx, px30_clk_pmu_branches,
|
|
ARRAY_SIZE(px30_clk_pmu_branches));
|
|
|
|
- rockchip_clk_protect_critical(px30_pmucru_critical_clocks,
|
|
- ARRAY_SIZE(px30_pmucru_critical_clocks));
|
|
-
|
|
rockchip_clk_of_add_provider(np, ctx);
|
|
}
|
|
CLK_OF_DECLARE(px30_cru_pmu, "rockchip,px30-pmucru", px30_pmu_clk_init);
|
|
|
|
From f94e39259982da6a35aff73ec3100cbd2712bdad Mon Sep 17 00:00:00 2001
|
|
From: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
|
|
Date: Tue, 17 Sep 2019 10:19:02 +0200
|
|
Subject: [PATCH] clk: rockchip: add video-related niu clocks as critical on
|
|
px30
|
|
|
|
Video-In and -Out interconnect clocks need to stay on all the
|
|
time for the peripheral to work and we do not model the actual
|
|
interconnect at this point. So mark them as critical for now.
|
|
|
|
Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
|
|
Link: https://lore.kernel.org/r/20190917081903.25139-4-heiko@sntech.de
|
|
(cherry picked from commit 8a88550fe7bb9c3cf051ceb3b130b1014fd5dcb4)
|
|
---
|
|
drivers/clk/rockchip/clk-px30.c | 15 ++++++++++-----
|
|
1 file changed, 10 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/drivers/clk/rockchip/clk-px30.c b/drivers/clk/rockchip/clk-px30.c
|
|
index 5c77da1e3abc..7a8bc416c947 100644
|
|
--- a/drivers/clk/rockchip/clk-px30.c
|
|
+++ b/drivers/clk/rockchip/clk-px30.c
|
|
@@ -803,25 +803,25 @@ static struct rockchip_clk_branch px30_clk_branches[] __initdata = {
|
|
GATE(0, "pclk_cpu_hoost", "pclk_top_pre", CLK_IGNORE_UNUSED, PX30_CLKGATE_CON(16), 7, GFLAGS),
|
|
|
|
/* PD_VI */
|
|
- GATE(0, "aclk_vi_niu", "aclk_vi_pre", CLK_IGNORE_UNUSED, PX30_CLKGATE_CON(4), 15, GFLAGS),
|
|
+ GATE(0, "aclk_vi_niu", "aclk_vi_pre", 0, PX30_CLKGATE_CON(4), 15, GFLAGS),
|
|
GATE(ACLK_CIF, "aclk_cif", "aclk_vi_pre", 0, PX30_CLKGATE_CON(5), 1, GFLAGS),
|
|
GATE(ACLK_ISP, "aclk_isp", "aclk_vi_pre", 0, PX30_CLKGATE_CON(5), 3, GFLAGS),
|
|
- GATE(0, "hclk_vi_niu", "hclk_vi_pre", CLK_IGNORE_UNUSED, PX30_CLKGATE_CON(5), 0, GFLAGS),
|
|
+ GATE(0, "hclk_vi_niu", "hclk_vi_pre", 0, PX30_CLKGATE_CON(5), 0, GFLAGS),
|
|
GATE(HCLK_CIF, "hclk_cif", "hclk_vi_pre", 0, PX30_CLKGATE_CON(5), 2, GFLAGS),
|
|
GATE(HCLK_ISP, "hclk_isp", "hclk_vi_pre", 0, PX30_CLKGATE_CON(5), 4, GFLAGS),
|
|
|
|
/* PD_VO */
|
|
- GATE(0, "aclk_vo_niu", "aclk_vo_pre", CLK_IGNORE_UNUSED, PX30_CLKGATE_CON(3), 0, GFLAGS),
|
|
+ GATE(0, "aclk_vo_niu", "aclk_vo_pre", 0, PX30_CLKGATE_CON(3), 0, GFLAGS),
|
|
GATE(ACLK_VOPB, "aclk_vopb", "aclk_vo_pre", 0, PX30_CLKGATE_CON(3), 3, GFLAGS),
|
|
GATE(ACLK_RGA, "aclk_rga", "aclk_vo_pre", 0, PX30_CLKGATE_CON(3), 7, GFLAGS),
|
|
GATE(ACLK_VOPL, "aclk_vopl", "aclk_vo_pre", 0, PX30_CLKGATE_CON(3), 5, GFLAGS),
|
|
|
|
- GATE(0, "hclk_vo_niu", "hclk_vo_pre", CLK_IGNORE_UNUSED, PX30_CLKGATE_CON(3), 1, GFLAGS),
|
|
+ GATE(0, "hclk_vo_niu", "hclk_vo_pre", 0, PX30_CLKGATE_CON(3), 1, GFLAGS),
|
|
GATE(HCLK_VOPB, "hclk_vopb", "hclk_vo_pre", 0, PX30_CLKGATE_CON(3), 4, GFLAGS),
|
|
GATE(HCLK_RGA, "hclk_rga", "hclk_vo_pre", 0, PX30_CLKGATE_CON(3), 8, GFLAGS),
|
|
GATE(HCLK_VOPL, "hclk_vopl", "hclk_vo_pre", 0, PX30_CLKGATE_CON(3), 6, GFLAGS),
|
|
|
|
- GATE(0, "pclk_vo_niu", "pclk_vo_pre", CLK_IGNORE_UNUSED, PX30_CLKGATE_CON(3), 2, GFLAGS),
|
|
+ GATE(0, "pclk_vo_niu", "pclk_vo_pre", 0, PX30_CLKGATE_CON(3), 2, GFLAGS),
|
|
GATE(PCLK_MIPI_DSI, "pclk_mipi_dsi", "pclk_vo_pre", 0, PX30_CLKGATE_CON(3), 9, GFLAGS),
|
|
|
|
/* PD_BUS */
|
|
@@ -986,6 +986,11 @@ static const char *const px30_cru_critical_clocks[] __initconst = {
|
|
"pclk_top_pre",
|
|
"pclk_pmu_pre",
|
|
"hclk_usb_niu",
|
|
+ "pclk_vo_niu",
|
|
+ "aclk_vo_niu",
|
|
+ "hclk_vo_niu",
|
|
+ "aclk_vi_niu",
|
|
+ "hclk_vi_niu",
|
|
"pll_npll",
|
|
"usb480m",
|
|
"clk_uart2",
|
|
|
|
From 971baf136bc24a9b3c3ca8cbab23c51d394a78d5 Mon Sep 17 00:00:00 2001
|
|
From: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
|
|
Date: Tue, 17 Sep 2019 10:19:03 +0200
|
|
Subject: [PATCH] clk: rockchip: protect the pclk_usb_grf as critical on px30
|
|
|
|
Make this clock a real critical clock, so that writes to the usbphy grf
|
|
always succeed.
|
|
|
|
Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
|
|
Link: https://lore.kernel.org/r/20190917081903.25139-5-heiko@sntech.de
|
|
(cherry picked from commit 3b0b4ebfd761943179fe03b107f66c72c3b5c8d4)
|
|
---
|
|
drivers/clk/rockchip/clk-px30.c | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/drivers/clk/rockchip/clk-px30.c b/drivers/clk/rockchip/clk-px30.c
|
|
index 7a8bc416c947..6fb9c98b7d24 100644
|
|
--- a/drivers/clk/rockchip/clk-px30.c
|
|
+++ b/drivers/clk/rockchip/clk-px30.c
|
|
@@ -799,7 +799,7 @@ static struct rockchip_clk_branch px30_clk_branches[] __initdata = {
|
|
GATE(0, "pclk_ddrphy", "pclk_top_pre", CLK_IGNORE_UNUSED, PX30_CLKGATE_CON(16), 3, GFLAGS),
|
|
GATE(PCLK_MIPIDSIPHY, "pclk_mipidsiphy", "pclk_top_pre", 0, PX30_CLKGATE_CON(16), 4, GFLAGS),
|
|
GATE(PCLK_MIPICSIPHY, "pclk_mipicsiphy", "pclk_top_pre", 0, PX30_CLKGATE_CON(16), 5, GFLAGS),
|
|
- GATE(PCLK_USB_GRF, "pclk_usb_grf", "pclk_top_pre", CLK_IGNORE_UNUSED, PX30_CLKGATE_CON(16), 6, GFLAGS),
|
|
+ GATE(PCLK_USB_GRF, "pclk_usb_grf", "pclk_top_pre", 0, PX30_CLKGATE_CON(16), 6, GFLAGS),
|
|
GATE(0, "pclk_cpu_hoost", "pclk_top_pre", CLK_IGNORE_UNUSED, PX30_CLKGATE_CON(16), 7, GFLAGS),
|
|
|
|
/* PD_VI */
|
|
@@ -995,6 +995,7 @@ static const char *const px30_cru_critical_clocks[] __initconst = {
|
|
"usb480m",
|
|
"clk_uart2",
|
|
"pclk_uart2",
|
|
+ "pclk_usb_grf",
|
|
};
|
|
|
|
static void __init px30_clk_init(struct device_node *np)
|
|
|
|
From 7d26034625c6fdd9a86043e5684f43f0c5cc6b01 Mon Sep 17 00:00:00 2001
|
|
From: Robin Murphy <robin.murphy@arm.com>
|
|
Date: Mon, 14 Oct 2019 23:19:05 +0100
|
|
Subject: [PATCH] arm64: dts: rockchip: Add RK3328 audio pipelines
|
|
|
|
The audio pipelines for HDMI and the analog codec are internal to the
|
|
SoC, so it makes sense to describe them at that level such that boards
|
|
need only enable the respective nodes for outputs they implement.
|
|
|
|
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
|
|
Link: https://lore.kernel.org/r/a09c8d795e7a66fb7bc47af2b6580f6e8dbec91e.1571090991.git.robin.murphy@arm.com
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit 29e8976e604f15838a71959ab853a802617113f9)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/rk3328.dtsi | 32 ++++++++++++++++++++++++++++++++
|
|
1 file changed, 32 insertions(+)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
|
|
index 31cc1541f1f5..91306ebed4da 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
|
|
@@ -142,6 +142,22 @@
|
|
};
|
|
};
|
|
|
|
+ analog_sound: analog-sound {
|
|
+ compatible = "simple-audio-card";
|
|
+ simple-audio-card,format = "i2s";
|
|
+ simple-audio-card,mclk-fs = <256>;
|
|
+ simple-audio-card,name = "Analog";
|
|
+ status = "disabled";
|
|
+
|
|
+ simple-audio-card,cpu {
|
|
+ sound-dai = <&i2s1>;
|
|
+ };
|
|
+
|
|
+ simple-audio-card,codec {
|
|
+ sound-dai = <&codec>;
|
|
+ };
|
|
+ };
|
|
+
|
|
arm-pmu {
|
|
compatible = "arm,cortex-a53-pmu";
|
|
interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
|
|
@@ -156,6 +172,22 @@
|
|
ports = <&vop_out>;
|
|
};
|
|
|
|
+ hdmi_sound: hdmi-sound {
|
|
+ compatible = "simple-audio-card";
|
|
+ simple-audio-card,format = "i2s";
|
|
+ simple-audio-card,mclk-fs = <128>;
|
|
+ simple-audio-card,name = "HDMI";
|
|
+ status = "disabled";
|
|
+
|
|
+ simple-audio-card,cpu {
|
|
+ sound-dai = <&i2s0>;
|
|
+ };
|
|
+
|
|
+ simple-audio-card,codec {
|
|
+ sound-dai = <&hdmi>;
|
|
+ };
|
|
+ };
|
|
+
|
|
psci {
|
|
compatible = "arm,psci-1.0", "arm,psci-0.2";
|
|
method = "smc";
|
|
|
|
From f0b1fd04c307d2471840bee849634039c5416e5b Mon Sep 17 00:00:00 2001
|
|
From: Robin Murphy <robin.murphy@arm.com>
|
|
Date: Mon, 14 Oct 2019 23:19:04 +0100
|
|
Subject: [PATCH] dt-bindings: ARM: rockchip: Add Beelink A1
|
|
|
|
Add a binding for the RK3328-based Beelink A1 TV box.
|
|
|
|
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
|
|
Reviewed-by: Rob Herring <robh@kernel.org>
|
|
Link: https://lore.kernel.org/r/82324d17b770fa8ea189fa708490d2c8c0c9290e.1571090991.git.robin.murphy@arm.com
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit e09a17df35c4d2185befd4e6db0f8e035aa86e57)
|
|
---
|
|
Documentation/devicetree/bindings/arm/rockchip.yaml | 5 +++++
|
|
1 file changed, 5 insertions(+)
|
|
|
|
diff --git a/Documentation/devicetree/bindings/arm/rockchip.yaml b/Documentation/devicetree/bindings/arm/rockchip.yaml
|
|
index 4ae93edc74ff..2fcd91e7bc18 100644
|
|
--- a/Documentation/devicetree/bindings/arm/rockchip.yaml
|
|
+++ b/Documentation/devicetree/bindings/arm/rockchip.yaml
|
|
@@ -40,6 +40,11 @@ properties:
|
|
- const: asus,rk3288-tinker-s
|
|
- const: rockchip,rk3288
|
|
|
|
+ - description: Beelink A1
|
|
+ items:
|
|
+ - const: azw,beelink-a1
|
|
+ - const: rockchip,rk3328
|
|
+
|
|
- description: bq Curie 2 tablet
|
|
items:
|
|
- const: mundoreader,bq-curie2
|
|
|
|
From 9ae87c1af91491391f52712de0837b6009e2c8a5 Mon Sep 17 00:00:00 2001
|
|
From: Robin Murphy <robin.murphy@arm.com>
|
|
Date: Mon, 14 Oct 2019 23:19:06 +0100
|
|
Subject: [PATCH] arm64: dts: rockchip: Add Beelink A1
|
|
|
|
Beelink A1 is a TV box implementing the higher-end options of the
|
|
RK3328 reference design - the DTB from the stock Android firmware is
|
|
clearly the "rk3328-box-plus" variant from the Rockchip 3.10 BSP with
|
|
minor modifications to accommodate the USB WiFi module and additional
|
|
VFD-style LED driver. It features:
|
|
|
|
- 4GB of 32-bit LPDDR3
|
|
- 16GB of HS200 eMMC (newer models with 32GB also exist)
|
|
- Realtek RTL8211F phy for gigabit ethernet
|
|
- Fn-Link 6221E-UUC module (RealTek RTL8821CU) for 11ac WiFi
|
|
and Bluetooth 4.2
|
|
- HDMI and analog A/V
|
|
- 1x USB 3.0 type A host, 1x USB 2.0 type A OTG, 1x micro SD
|
|
- IR receiver and a neat little LED clock display.
|
|
|
|
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
|
|
Link: https://lore.kernel.org/r/2aa21c5f3020062cf6a47057bdf3c01f0ec863ea.1571090991.git.robin.murphy@arm.com
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit 79702ded8c2fa233fa2e05b82c8cbf0d0a5aaea0)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/Makefile | 1 +
|
|
arch/arm64/boot/dts/rockchip/rk3328-a1.dts | 359 +++++++++++++++++++++++++++++
|
|
2 files changed, 360 insertions(+)
|
|
create mode 100644 arch/arm64/boot/dts/rockchip/rk3328-a1.dts
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile
|
|
index cf69b0f33ecb..1f03f36559aa 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/Makefile
|
|
+++ b/arch/arm64/boot/dts/rockchip/Makefile
|
|
@@ -2,6 +2,7 @@
|
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += px30-evb.dtb
|
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3308-evb.dtb
|
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3308-roc-cc.dtb
|
|
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-a1.dtb
|
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-evb.dtb
|
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-rock64.dtb
|
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-roc-cc.dtb
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3328-a1.dts b/arch/arm64/boot/dts/rockchip/rk3328-a1.dts
|
|
new file mode 100644
|
|
index 000000000000..76b49f573101
|
|
--- /dev/null
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3328-a1.dts
|
|
@@ -0,0 +1,359 @@
|
|
+// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
|
|
+// Copyright (c) 2017-2019 Arm Ltd.
|
|
+
|
|
+/dts-v1/;
|
|
+#include "rk3328.dtsi"
|
|
+
|
|
+/ {
|
|
+ model = "Beelink A1";
|
|
+ compatible = "azw,beelink-a1", "rockchip,rk3328";
|
|
+
|
|
+ /*
|
|
+ * UART pins, as viewed with bottom of case removed:
|
|
+ *
|
|
+ * Front
|
|
+ * /-------
|
|
+ * L / o <- Gnd
|
|
+ * e / o <-- Rx
|
|
+ * f / o <--- Tx
|
|
+ * t / o <---- +3.3v
|
|
+ * |
|
|
+ */
|
|
+ chosen {
|
|
+ stdout-path = "serial2:1500000n8";
|
|
+ };
|
|
+
|
|
+ gmac_clkin: external-gmac-clock {
|
|
+ compatible = "fixed-clock";
|
|
+ clock-frequency = <125000000>;
|
|
+ clock-output-names = "gmac_clkin";
|
|
+ #clock-cells = <0>;
|
|
+ };
|
|
+
|
|
+ vcc_host_5v: usb3-current-switch {
|
|
+ compatible = "regulator-fixed";
|
|
+ enable-active-high;
|
|
+ gpio = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&usb30_host_drv>;
|
|
+ regulator-name = "vcc_host_5v";
|
|
+ vin-supply = <&vcc_sys>;
|
|
+ };
|
|
+
|
|
+ vcc_sys: vcc-sys {
|
|
+ compatible = "regulator-fixed";
|
|
+ regulator-name = "vcc_sys";
|
|
+ regulator-min-microvolt = <5000000>;
|
|
+ regulator-max-microvolt = <5000000>;
|
|
+ };
|
|
+
|
|
+ ir-receiver {
|
|
+ compatible = "gpio-ir-receiver";
|
|
+ gpios = <&gpio2 RK_PA2 GPIO_ACTIVE_HIGH>;
|
|
+ };
|
|
+};
|
|
+
|
|
+&analog_sound {
|
|
+ simple-audio-card,name = "Analog A/V";
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&codec {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&cpu0 {
|
|
+ cpu-supply = <&vdd_arm>;
|
|
+};
|
|
+
|
|
+&cpu1 {
|
|
+ cpu-supply = <&vdd_arm>;
|
|
+};
|
|
+
|
|
+&cpu2 {
|
|
+ cpu-supply = <&vdd_arm>;
|
|
+};
|
|
+
|
|
+&cpu3 {
|
|
+ cpu-supply = <&vdd_arm>;
|
|
+};
|
|
+
|
|
+&emmc {
|
|
+ bus-width = <8>;
|
|
+ cap-mmc-highspeed;
|
|
+ mmc-ddr-1_8v;
|
|
+ mmc-hs200-1_8v;
|
|
+ no-sd;
|
|
+ no-sdio;
|
|
+ non-removable;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
|
|
+ vmmc-supply = <&vcc_io>;
|
|
+ vqmmc-supply = <&vcc18_emmc>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&gmac2io {
|
|
+ assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
|
|
+ assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>;
|
|
+ clock_in_out = "input";
|
|
+ phy-handle = <&rtl8211f>;
|
|
+ phy-mode = "rgmii";
|
|
+ phy-supply = <&vcc_io>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&rgmiim1_pins>;
|
|
+ snps,aal;
|
|
+ snps,pbl = <0x4>;
|
|
+ tx_delay = <0x26>;
|
|
+ rx_delay = <0x11>;
|
|
+ status = "okay";
|
|
+
|
|
+ mdio {
|
|
+ compatible = "snps,dwmac-mdio";
|
|
+ #address-cells = <1>;
|
|
+ #size-cells = <0>;
|
|
+
|
|
+ rtl8211f: phy@0 {
|
|
+ reg = <0>;
|
|
+ reset-assert-us = <10000>;
|
|
+ reset-deassert-us = <30000>;
|
|
+ reset-gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_LOW>;
|
|
+ };
|
|
+ };
|
|
+};
|
|
+
|
|
+&gpu {
|
|
+ mali-supply = <&vdd_logic>;
|
|
+};
|
|
+
|
|
+&hdmi {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&hdmiphy {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&hdmi_sound {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&i2c1 {
|
|
+ clock-frequency = <1000000>;
|
|
+ i2c-scl-falling-time-ns = <5>;
|
|
+ i2c-scl-rising-time-ns = <83>;
|
|
+ status = "okay";
|
|
+
|
|
+ pmic@18 {
|
|
+ compatible = "rockchip,rk805";
|
|
+ reg = <0x18>;
|
|
+ interrupt-parent = <&gpio2>;
|
|
+ interrupts = <RK_PA6 IRQ_TYPE_LEVEL_LOW>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&pmic_int_l>;
|
|
+ rockchip,system-power-controller;
|
|
+ wakeup-source;
|
|
+
|
|
+ vcc1-supply = <&vcc_sys>;
|
|
+ vcc2-supply = <&vcc_sys>;
|
|
+ vcc3-supply = <&vcc_sys>;
|
|
+ vcc4-supply = <&vcc_sys>;
|
|
+ vcc5-supply = <&vcc_io>;
|
|
+ vcc6-supply = <&vcc_io>;
|
|
+
|
|
+ regulators {
|
|
+ vdd_logic: DCDC_REG1 {
|
|
+ regulator-name = "vdd_logic";
|
|
+ regulator-min-microvolt = <700000>;
|
|
+ regulator-max-microvolt = <1350000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ regulator-suspend-microvolt = <1000000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vdd_arm: DCDC_REG2 {
|
|
+ regulator-name = "vdd_arm";
|
|
+ regulator-min-microvolt = <700000>;
|
|
+ regulator-max-microvolt = <1350000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ regulator-suspend-microvolt = <950000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc_ddr: DCDC_REG3 {
|
|
+ regulator-name = "vcc_ddr";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc_io: DCDC_REG4 {
|
|
+ regulator-name = "vcc_io";
|
|
+ regulator-min-microvolt = <3300000>;
|
|
+ regulator-max-microvolt = <3300000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ regulator-suspend-microvolt = <3300000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vdd_18: LDO_REG1 {
|
|
+ regulator-name = "vdd_18";
|
|
+ regulator-min-microvolt = <1800000>;
|
|
+ regulator-max-microvolt = <1800000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ regulator-suspend-microvolt = <1800000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc18_emmc: LDO_REG2 {
|
|
+ regulator-name = "vcc_18emmc";
|
|
+ regulator-min-microvolt = <1800000>;
|
|
+ regulator-max-microvolt = <1800000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ regulator-suspend-microvolt = <1800000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vdd_11: LDO_REG3 {
|
|
+ regulator-name = "vdd_11";
|
|
+ regulator-min-microvolt = <1100000>;
|
|
+ regulator-max-microvolt = <1100000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ regulator-suspend-microvolt = <1100000>;
|
|
+ };
|
|
+ };
|
|
+ };
|
|
+ };
|
|
+};
|
|
+
|
|
+&i2s0 {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&i2s1 {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&io_domains {
|
|
+ vccio1-supply = <&vcc_io>;
|
|
+ vccio2-supply = <&vcc18_emmc>;
|
|
+ vccio3-supply = <&vcc_io>;
|
|
+ vccio4-supply = <&vdd_18>;
|
|
+ vccio5-supply = <&vcc_io>;
|
|
+ vccio6-supply = <&vdd_18>;
|
|
+ pmuio-supply = <&vcc_io>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&pinctrl {
|
|
+ pmic {
|
|
+ pmic_int_l: pmic-int-l {
|
|
+ rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ usb3 {
|
|
+ usb30_host_drv: usb30-host-drv {
|
|
+ rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ wifi {
|
|
+ bt_dis: bt-dis {
|
|
+ rockchip,pins = <2 RK_PC5 RK_FUNC_GPIO &pcfg_output_low>;
|
|
+ };
|
|
+
|
|
+ bt_wake_host: bt-wake-host {
|
|
+ rockchip,pins = <2 RK_PC0 RK_FUNC_GPIO &pcfg_pull_up>;
|
|
+ };
|
|
+
|
|
+ chip_en: chip-en {
|
|
+ rockchip,pins = <2 RK_PC3 RK_FUNC_GPIO &pcfg_output_low>;
|
|
+ };
|
|
+
|
|
+ host_wake_bt: host-wake-bt {
|
|
+ rockchip,pins = <2 RK_PB7 RK_FUNC_GPIO &pcfg_output_high>;
|
|
+ };
|
|
+
|
|
+ wl_dis: wl-dis {
|
|
+ rockchip,pins = <3 RK_PB0 RK_FUNC_GPIO &pcfg_output_low>;
|
|
+ };
|
|
+
|
|
+ wl_wake_host: wl-wake-host {
|
|
+ rockchip,pins = <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
|
|
+ };
|
|
+ };
|
|
+};
|
|
+
|
|
+&sdmmc {
|
|
+ bus-width = <4>;
|
|
+ cap-mmc-highspeed;
|
|
+ cap-sd-highspeed;
|
|
+ disable-wp;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_dectn &sdmmc0_bus4>;
|
|
+ vmmc-supply = <&vcc_io>;
|
|
+ vqmmc-supply = <&vcc_io>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&tsadc {
|
|
+ rockchip,hw-tshut-mode = <0>;
|
|
+ rockchip,hw-tshut-polarity = <0>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&uart2 {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&u2phy {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&u2phy_host {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&u2phy_otg {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&usb20_otg {
|
|
+ dr_mode = "host";
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&usb_host0_ehci {
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&bt_dis &bt_wake_host &chip_en &host_wake_bt &wl_dis &wl_wake_host>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&vop {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&vop_mmu {
|
|
+ status = "okay";
|
|
+};
|
|
|
|
From f6807e4aa8ee48612ef390de5f46f6abb5d14ee3 Mon Sep 17 00:00:00 2001
|
|
From: Markus Reichl <m.reichl@fivetechno.de>
|
|
Date: Fri, 8 Nov 2019 22:04:33 +0100
|
|
Subject: [PATCH] arm64: dts: rockchip: Split rk3399-roc-pc for with and
|
|
without mezzanine board.
|
|
|
|
For rk3399-roc-pc is a mezzanine board available that carries M.2 and
|
|
POE interfaces. Use it with a separate dts.
|
|
|
|
Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
|
|
Acked-by: Rob Herring <robh@kernel.org>
|
|
Link: https://lore.kernel.org/r/0fb4e21a-fe78-00aa-6142-ca8682a913eb@fivetechno.de
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit f9010b0edcd5a3112ab3d4fc79c296c5a1c5ee16)
|
|
---
|
|
.../devicetree/bindings/arm/rockchip.yaml | 4 +-
|
|
arch/arm64/boot/dts/rockchip/Makefile | 1 +
|
|
.../boot/dts/rockchip/rk3399-roc-pc-mezzanine.dts | 72 ++
|
|
arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts | 757 +-------------------
|
|
arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi | 767 +++++++++++++++++++++
|
|
5 files changed, 844 insertions(+), 757 deletions(-)
|
|
create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-roc-pc-mezzanine.dts
|
|
create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
|
|
|
|
diff --git a/Documentation/devicetree/bindings/arm/rockchip.yaml b/Documentation/devicetree/bindings/arm/rockchip.yaml
|
|
index 2fcd91e7bc18..d9847b306b83 100644
|
|
--- a/Documentation/devicetree/bindings/arm/rockchip.yaml
|
|
+++ b/Documentation/devicetree/bindings/arm/rockchip.yaml
|
|
@@ -99,7 +99,9 @@ properties:
|
|
|
|
- description: Firefly ROC-RK3399-PC
|
|
items:
|
|
- - const: firefly,roc-rk3399-pc
|
|
+ - enum:
|
|
+ - firefly,roc-rk3399-pc
|
|
+ - firefly,roc-rk3399-pc-mezzanine
|
|
- const: rockchip,rk3399
|
|
|
|
- description: FriendlyElec NanoPi4 series boards
|
|
diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile
|
|
index 1f03f36559aa..48fb631d5451 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/Makefile
|
|
+++ b/arch/arm64/boot/dts/rockchip/Makefile
|
|
@@ -30,6 +30,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-neo4.dtb
|
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-orangepi.dtb
|
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-puma-haikou.dtb
|
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-roc-pc.dtb
|
|
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-roc-pc-mezzanine.dtb
|
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock-pi-4.dtb
|
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock960.dtb
|
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rockpro64.dtb
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc-mezzanine.dts b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc-mezzanine.dts
|
|
new file mode 100644
|
|
index 000000000000..d6b3042cffa9
|
|
--- /dev/null
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc-mezzanine.dts
|
|
@@ -0,0 +1,72 @@
|
|
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
|
+/*
|
|
+ * Copyright (c) 2017 T-Chip Intelligent Technology Co., Ltd
|
|
+ * Copyright (c) 2019 Markus Reichl <m.reichl@fivetechno.de>
|
|
+ */
|
|
+
|
|
+/dts-v1/;
|
|
+#include "rk3399-roc-pc.dtsi"
|
|
+
|
|
+/ {
|
|
+ model = "Firefly ROC-RK3399-PC Mezzanine Board";
|
|
+ compatible = "firefly,roc-rk3399-pc-mezzanine", "rockchip,rk3399";
|
|
+
|
|
+ vcc3v3_ngff: vcc3v3-ngff {
|
|
+ compatible = "regulator-fixed";
|
|
+ regulator-name = "vcc3v3_ngff";
|
|
+ enable-active-high;
|
|
+ gpio = <&gpio4 RK_PD3 GPIO_ACTIVE_HIGH>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&vcc3v3_ngff_en>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-min-microvolt = <3300000>;
|
|
+ regulator-max-microvolt = <3300000>;
|
|
+ vin-supply = <&dc_12v>;
|
|
+ };
|
|
+
|
|
+ vcc3v3_pcie: vcc3v3-pcie {
|
|
+ compatible = "regulator-fixed";
|
|
+ regulator-name = "vcc3v3_pcie";
|
|
+ enable-active-high;
|
|
+ gpio = <&gpio1 RK_PC1 GPIO_ACTIVE_HIGH>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&vcc3v3_pcie_en>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-min-microvolt = <3300000>;
|
|
+ regulator-max-microvolt = <3300000>;
|
|
+ vin-supply = <&dc_12v>;
|
|
+ };
|
|
+};
|
|
+
|
|
+&pcie_phy {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&pcie0 {
|
|
+ ep-gpios = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>;
|
|
+ num-lanes = <4>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&pcie_perst>;
|
|
+ vpcie3v3-supply = <&vcc3v3_pcie>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&pinctrl {
|
|
+ ngff {
|
|
+ vcc3v3_ngff_en: vcc3v3-ngff-en {
|
|
+ rockchip,pins = <4 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ pcie {
|
|
+ vcc3v3_pcie_en: vcc3v3-pcie-en {
|
|
+ rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ pcie_perst: pcie-perst {
|
|
+ rockchip,pins = <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+};
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
|
|
index 07ae4b1d53d4..cd4195425309 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
|
|
@@ -4,764 +4,9 @@
|
|
*/
|
|
|
|
/dts-v1/;
|
|
-#include <dt-bindings/input/linux-event-codes.h>
|
|
-#include <dt-bindings/pwm/pwm.h>
|
|
-#include "rk3399.dtsi"
|
|
-#include "rk3399-opp.dtsi"
|
|
+#include "rk3399-roc-pc.dtsi"
|
|
|
|
/ {
|
|
model = "Firefly ROC-RK3399-PC Board";
|
|
compatible = "firefly,roc-rk3399-pc", "rockchip,rk3399";
|
|
-
|
|
- chosen {
|
|
- stdout-path = "serial2:1500000n8";
|
|
- };
|
|
-
|
|
- backlight: backlight {
|
|
- compatible = "pwm-backlight";
|
|
- pwms = <&pwm0 0 25000 0>;
|
|
- };
|
|
-
|
|
- clkin_gmac: external-gmac-clock {
|
|
- compatible = "fixed-clock";
|
|
- clock-frequency = <125000000>;
|
|
- clock-output-names = "clkin_gmac";
|
|
- #clock-cells = <0>;
|
|
- };
|
|
-
|
|
- adc-keys {
|
|
- compatible = "adc-keys";
|
|
- io-channels = <&saradc 1>;
|
|
- io-channel-names = "buttons";
|
|
- keyup-threshold-microvolt = <1500000>;
|
|
- poll-interval = <100>;
|
|
-
|
|
- recovery {
|
|
- label = "Recovery";
|
|
- linux,code = <KEY_VENDOR>;
|
|
- press-threshold-microvolt = <18000>;
|
|
- };
|
|
- };
|
|
-
|
|
- gpio-keys {
|
|
- compatible = "gpio-keys";
|
|
- autorepeat;
|
|
- pinctrl-names = "default";
|
|
- pinctrl-0 = <&pwr_key_l>;
|
|
-
|
|
- power {
|
|
- label = "GPIO Key Power";
|
|
- debounce-interval = <100>;
|
|
- gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
|
|
- linux,code = <KEY_POWER>;
|
|
- wakeup-source;
|
|
- };
|
|
- };
|
|
-
|
|
- leds {
|
|
- compatible = "gpio-leds";
|
|
- pinctrl-names = "default";
|
|
- pinctrl-0 = <&work_led_gpio>, <&diy_led_gpio>, <&yellow_led_gpio>;
|
|
-
|
|
- work-led {
|
|
- label = "green:work";
|
|
- gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>;
|
|
- default-state = "on";
|
|
- linux,default-trigger = "heartbeat";
|
|
- };
|
|
-
|
|
- diy-led {
|
|
- label = "red:diy";
|
|
- gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
|
|
- default-state = "off";
|
|
- linux,default-trigger = "mmc1";
|
|
- };
|
|
-
|
|
- yellow-led {
|
|
- label = "yellow:yellow-led";
|
|
- gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
|
|
- default-state = "off";
|
|
- linux,default-trigger = "mmc0";
|
|
- };
|
|
- };
|
|
-
|
|
- sdio_pwrseq: sdio-pwrseq {
|
|
- compatible = "mmc-pwrseq-simple";
|
|
- clocks = <&rk808 1>;
|
|
- clock-names = "ext_clock";
|
|
- pinctrl-names = "default";
|
|
- pinctrl-0 = <&wifi_enable_h>;
|
|
-
|
|
- /*
|
|
- * On the module itself this is one of these (depending
|
|
- * on the actual card populated):
|
|
- * - SDIO_RESET_L_WL_REG_ON
|
|
- * - PDN (power down when low)
|
|
- */
|
|
- reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
|
|
- };
|
|
-
|
|
- vcc_vbus_typec0: vcc-vbus-typec0 {
|
|
- compatible = "regulator-fixed";
|
|
- regulator-name = "vcc_vbus_typec0";
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- regulator-min-microvolt = <5000000>;
|
|
- regulator-max-microvolt = <5000000>;
|
|
- };
|
|
-
|
|
- /*
|
|
- * should be placed inside mp8859, but not until mp8859 has
|
|
- * its own dt-binding.
|
|
- */
|
|
- dc_12v: mp8859-dcdc1 {
|
|
- compatible = "regulator-fixed";
|
|
- regulator-name = "dc_12v";
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- regulator-min-microvolt = <12000000>;
|
|
- regulator-max-microvolt = <12000000>;
|
|
- vin-supply = <&vcc_vbus_typec0>;
|
|
- };
|
|
-
|
|
- /* switched by pmic_sleep */
|
|
- vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
|
|
- compatible = "regulator-fixed";
|
|
- regulator-name = "vcc1v8_s3";
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- regulator-min-microvolt = <1800000>;
|
|
- regulator-max-microvolt = <1800000>;
|
|
- vin-supply = <&vcc_1v8>;
|
|
- };
|
|
-
|
|
- vcc3v3_sys: vcc3v3-sys {
|
|
- compatible = "regulator-fixed";
|
|
- regulator-name = "vcc3v3_sys";
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- regulator-min-microvolt = <3300000>;
|
|
- regulator-max-microvolt = <3300000>;
|
|
- vin-supply = <&dc_12v>;
|
|
- };
|
|
-
|
|
- /* Actually 3 regulators (host0, 1, 2) controlled by the same gpio */
|
|
- vcc5v0_host: vcc5v0-host-regulator {
|
|
- compatible = "regulator-fixed";
|
|
- enable-active-high;
|
|
- gpio = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
|
|
- pinctrl-names = "default";
|
|
- pinctrl-0 = <&vcc5v0_host_en &hub_rst>;
|
|
- regulator-name = "vcc5v0_host";
|
|
- regulator-always-on;
|
|
- vin-supply = <&vcc_sys>;
|
|
- };
|
|
-
|
|
- vcc_vbus_typec1: vcc-vbus-typec1 {
|
|
- compatible = "regulator-fixed";
|
|
- enable-active-high;
|
|
- gpio = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>;
|
|
- pinctrl-names = "default";
|
|
- pinctrl-0 = <&vcc_vbus_typec1_en>;
|
|
- regulator-name = "vcc_vbus_typec1";
|
|
- regulator-always-on;
|
|
- vin-supply = <&vcc_sys>;
|
|
- };
|
|
-
|
|
- vcc_sys: vcc-sys {
|
|
- compatible = "regulator-fixed";
|
|
- enable-active-high;
|
|
- gpio = <&gpio2 RK_PA6 GPIO_ACTIVE_HIGH>;
|
|
- pinctrl-names = "default";
|
|
- pinctrl-0 = <&vcc_sys_en>;
|
|
- regulator-name = "vcc_sys";
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- regulator-min-microvolt = <5000000>;
|
|
- regulator-max-microvolt = <5000000>;
|
|
- vin-supply = <&dc_12v>;
|
|
- };
|
|
-
|
|
- vdd_log: vdd-log {
|
|
- compatible = "pwm-regulator";
|
|
- pwms = <&pwm2 0 25000 1>;
|
|
- regulator-name = "vdd_log";
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- regulator-min-microvolt = <800000>;
|
|
- regulator-max-microvolt = <1400000>;
|
|
- vin-supply = <&vcc3v3_sys>;
|
|
- };
|
|
-};
|
|
-
|
|
-&cpu_l0 {
|
|
- cpu-supply = <&vdd_cpu_l>;
|
|
-};
|
|
-
|
|
-&cpu_l1 {
|
|
- cpu-supply = <&vdd_cpu_l>;
|
|
-};
|
|
-
|
|
-&cpu_l2 {
|
|
- cpu-supply = <&vdd_cpu_l>;
|
|
-};
|
|
-
|
|
-&cpu_l3 {
|
|
- cpu-supply = <&vdd_cpu_l>;
|
|
-};
|
|
-
|
|
-&cpu_b0 {
|
|
- cpu-supply = <&vdd_cpu_b>;
|
|
-};
|
|
-
|
|
-&cpu_b1 {
|
|
- cpu-supply = <&vdd_cpu_b>;
|
|
-};
|
|
-
|
|
-&emmc_phy {
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&gmac {
|
|
- assigned-clocks = <&cru SCLK_RMII_SRC>;
|
|
- assigned-clock-parents = <&clkin_gmac>;
|
|
- clock_in_out = "input";
|
|
- phy-supply = <&vcc_lan>;
|
|
- phy-mode = "rgmii";
|
|
- pinctrl-names = "default";
|
|
- pinctrl-0 = <&rgmii_pins>;
|
|
- snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
|
|
- snps,reset-active-low;
|
|
- snps,reset-delays-us = <0 10000 50000>;
|
|
- tx_delay = <0x28>;
|
|
- rx_delay = <0x11>;
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&hdmi {
|
|
- ddc-i2c-bus = <&i2c3>;
|
|
- pinctrl-names = "default";
|
|
- pinctrl-0 = <&hdmi_cec>;
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&i2c0 {
|
|
- clock-frequency = <400000>;
|
|
- i2c-scl-rising-time-ns = <168>;
|
|
- i2c-scl-falling-time-ns = <4>;
|
|
- status = "okay";
|
|
-
|
|
- rk808: pmic@1b {
|
|
- compatible = "rockchip,rk808";
|
|
- reg = <0x1b>;
|
|
- interrupt-parent = <&gpio1>;
|
|
- interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
|
|
- #clock-cells = <1>;
|
|
- clock-output-names = "xin32k", "rk808-clkout2";
|
|
- pinctrl-names = "default";
|
|
- pinctrl-0 = <&pmic_int_l>;
|
|
- rockchip,system-power-controller;
|
|
- wakeup-source;
|
|
-
|
|
- vcc1-supply = <&vcc3v3_sys>;
|
|
- vcc2-supply = <&vcc3v3_sys>;
|
|
- vcc3-supply = <&vcc3v3_sys>;
|
|
- vcc4-supply = <&vcc3v3_sys>;
|
|
- vcc6-supply = <&vcc3v3_sys>;
|
|
- vcc7-supply = <&vcc3v3_sys>;
|
|
- vcc8-supply = <&vcc3v3_sys>;
|
|
- vcc9-supply = <&vcc3v3_sys>;
|
|
- vcc10-supply = <&vcc3v3_sys>;
|
|
- vcc11-supply = <&vcc3v3_sys>;
|
|
- vcc12-supply = <&vcc3v3_sys>;
|
|
- vcc13-supply = <&vcc3v3_sys>;
|
|
- vcc14-supply = <&vcc3v3_sys>;
|
|
- vddio-supply = <&vcc_3v0>;
|
|
-
|
|
- regulators {
|
|
- vdd_center: DCDC_REG1 {
|
|
- regulator-name = "vdd_center";
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- regulator-min-microvolt = <750000>;
|
|
- regulator-max-microvolt = <1350000>;
|
|
- regulator-ramp-delay = <6001>;
|
|
- regulator-state-mem {
|
|
- regulator-off-in-suspend;
|
|
- };
|
|
- };
|
|
-
|
|
- vdd_cpu_l: DCDC_REG2 {
|
|
- regulator-name = "vdd_cpu_l";
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- regulator-min-microvolt = <750000>;
|
|
- regulator-max-microvolt = <1350000>;
|
|
- regulator-ramp-delay = <6001>;
|
|
- regulator-state-mem {
|
|
- regulator-off-in-suspend;
|
|
- };
|
|
- };
|
|
-
|
|
- vcc_ddr: DCDC_REG3 {
|
|
- regulator-name = "vcc_ddr";
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- regulator-state-mem {
|
|
- regulator-on-in-suspend;
|
|
- };
|
|
- };
|
|
-
|
|
- vcc_1v8: DCDC_REG4 {
|
|
- regulator-name = "vcc_1v8";
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- regulator-min-microvolt = <1800000>;
|
|
- regulator-max-microvolt = <1800000>;
|
|
- regulator-state-mem {
|
|
- regulator-on-in-suspend;
|
|
- regulator-suspend-microvolt = <1800000>;
|
|
- };
|
|
- };
|
|
-
|
|
- vcca1v8_codec: LDO_REG1 {
|
|
- regulator-name = "vcca1v8_codec";
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- regulator-min-microvolt = <1800000>;
|
|
- regulator-max-microvolt = <1800000>;
|
|
- regulator-state-mem {
|
|
- regulator-off-in-suspend;
|
|
- };
|
|
- };
|
|
-
|
|
- vcc1v8_hdmi: LDO_REG2 {
|
|
- regulator-name = "vcc1v8_hdmi";
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- regulator-min-microvolt = <1800000>;
|
|
- regulator-max-microvolt = <1800000>;
|
|
- regulator-state-mem {
|
|
- regulator-off-in-suspend;
|
|
- };
|
|
- };
|
|
-
|
|
- vcc1v8_pmu: LDO_REG3 {
|
|
- regulator-name = "vcc1v8_pmu";
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- regulator-min-microvolt = <1800000>;
|
|
- regulator-max-microvolt = <1800000>;
|
|
- regulator-state-mem {
|
|
- regulator-on-in-suspend;
|
|
- regulator-suspend-microvolt = <1800000>;
|
|
- };
|
|
- };
|
|
-
|
|
- vcc_sdio: LDO_REG4 {
|
|
- regulator-name = "vcc_sdio";
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- regulator-min-microvolt = <1800000>;
|
|
- regulator-max-microvolt = <3000000>;
|
|
- regulator-state-mem {
|
|
- regulator-on-in-suspend;
|
|
- regulator-suspend-microvolt = <3000000>;
|
|
- };
|
|
- };
|
|
-
|
|
- vcca3v0_codec: LDO_REG5 {
|
|
- regulator-name = "vcca3v0_codec";
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- regulator-min-microvolt = <3000000>;
|
|
- regulator-max-microvolt = <3000000>;
|
|
- regulator-state-mem {
|
|
- regulator-off-in-suspend;
|
|
- };
|
|
- };
|
|
-
|
|
- vcc_1v5: LDO_REG6 {
|
|
- regulator-name = "vcc_1v5";
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- regulator-min-microvolt = <1500000>;
|
|
- regulator-max-microvolt = <1500000>;
|
|
- regulator-state-mem {
|
|
- regulator-on-in-suspend;
|
|
- regulator-suspend-microvolt = <1500000>;
|
|
- };
|
|
- };
|
|
-
|
|
- vcca0v9_hdmi: LDO_REG7 {
|
|
- regulator-name = "vcca0v9_hdmi";
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- regulator-min-microvolt = <900000>;
|
|
- regulator-max-microvolt = <900000>;
|
|
- regulator-state-mem {
|
|
- regulator-off-in-suspend;
|
|
- };
|
|
- };
|
|
-
|
|
- vcc_3v0: LDO_REG8 {
|
|
- regulator-name = "vcc_3v0";
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- regulator-min-microvolt = <3000000>;
|
|
- regulator-max-microvolt = <3000000>;
|
|
- regulator-state-mem {
|
|
- regulator-on-in-suspend;
|
|
- regulator-suspend-microvolt = <3000000>;
|
|
- };
|
|
- };
|
|
-
|
|
- vcc3v3_s3: vcc_lan: SWITCH_REG1 {
|
|
- regulator-name = "vcc3v3_s3";
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- regulator-state-mem {
|
|
- regulator-off-in-suspend;
|
|
- };
|
|
- };
|
|
-
|
|
- vcc3v3_s0: SWITCH_REG2 {
|
|
- regulator-name = "vcc3v3_s0";
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- regulator-state-mem {
|
|
- regulator-off-in-suspend;
|
|
- };
|
|
- };
|
|
- };
|
|
- };
|
|
-
|
|
- vdd_cpu_b: regulator@40 {
|
|
- compatible = "silergy,syr827";
|
|
- reg = <0x40>;
|
|
- fcs,suspend-voltage-selector = <1>;
|
|
- pinctrl-names = "default";
|
|
- pinctrl-0 = <&vsel1_gpio>;
|
|
- regulator-name = "vdd_cpu_b";
|
|
- regulator-min-microvolt = <712500>;
|
|
- regulator-max-microvolt = <1500000>;
|
|
- regulator-ramp-delay = <1000>;
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- vin-supply = <&vcc3v3_sys>;
|
|
-
|
|
- regulator-state-mem {
|
|
- regulator-off-in-suspend;
|
|
- };
|
|
- };
|
|
-
|
|
- vdd_gpu: regulator@41 {
|
|
- compatible = "silergy,syr828";
|
|
- reg = <0x41>;
|
|
- fcs,suspend-voltage-selector = <1>;
|
|
- pinctrl-names = "default";
|
|
- pinctrl-0 = <&vsel2_gpio>;
|
|
- regulator-name = "vdd_gpu";
|
|
- regulator-min-microvolt = <712500>;
|
|
- regulator-max-microvolt = <1500000>;
|
|
- regulator-ramp-delay = <1000>;
|
|
- regulator-always-on;
|
|
- regulator-boot-on;
|
|
- vin-supply = <&vcc3v3_sys>;
|
|
-
|
|
- regulator-state-mem {
|
|
- regulator-off-in-suspend;
|
|
- };
|
|
- };
|
|
-};
|
|
-
|
|
-&i2c1 {
|
|
- i2c-scl-rising-time-ns = <300>;
|
|
- i2c-scl-falling-time-ns = <15>;
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&i2c3 {
|
|
- i2c-scl-rising-time-ns = <450>;
|
|
- i2c-scl-falling-time-ns = <15>;
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&i2c4 {
|
|
- i2c-scl-rising-time-ns = <600>;
|
|
- i2c-scl-falling-time-ns = <20>;
|
|
- status = "okay";
|
|
-
|
|
- fusb1: usb-typec@22 {
|
|
- compatible = "fcs,fusb302";
|
|
- reg = <0x22>;
|
|
- interrupt-parent = <&gpio1>;
|
|
- interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
|
|
- pinctrl-names = "default";
|
|
- pinctrl-0 = <&fusb1_int>;
|
|
- vbus-supply = <&vcc_vbus_typec1>;
|
|
- status = "okay";
|
|
- };
|
|
-};
|
|
-
|
|
-&i2c7 {
|
|
- i2c-scl-rising-time-ns = <600>;
|
|
- i2c-scl-falling-time-ns = <20>;
|
|
- status = "okay";
|
|
-
|
|
- fusb0: usb-typec@22 {
|
|
- compatible = "fcs,fusb302";
|
|
- reg = <0x22>;
|
|
- interrupt-parent = <&gpio1>;
|
|
- interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
|
|
- pinctrl-names = "default";
|
|
- pinctrl-0 = <&fusb0_int>;
|
|
- vbus-supply = <&vcc_vbus_typec0>;
|
|
- status = "okay";
|
|
- };
|
|
-};
|
|
-
|
|
-&i2s0 {
|
|
- rockchip,playback-channels = <8>;
|
|
- rockchip,capture-channels = <8>;
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&i2s1 {
|
|
- rockchip,playback-channels = <2>;
|
|
- rockchip,capture-channels = <2>;
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&i2s2 {
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&io_domains {
|
|
- audio-supply = <&vcca1v8_codec>;
|
|
- bt656-supply = <&vcc_3v0>;
|
|
- gpio1830-supply = <&vcc_3v0>;
|
|
- sdmmc-supply = <&vcc_sdio>;
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&pmu_io_domains {
|
|
- pmu1830-supply = <&vcc_3v0>;
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&pinctrl {
|
|
- buttons {
|
|
- pwr_key_l: pwr-key-l {
|
|
- rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
|
|
- };
|
|
- };
|
|
-
|
|
- lcd-panel {
|
|
- lcd_panel_reset: lcd-panel-reset {
|
|
- rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>;
|
|
- };
|
|
- };
|
|
-
|
|
- leds {
|
|
- diy_led_gpio: diy_led-gpio {
|
|
- rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
- };
|
|
-
|
|
- work_led_gpio: work_led-gpio {
|
|
- rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
- };
|
|
-
|
|
- yellow_led_gpio: yellow_led-gpio {
|
|
- rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
- };
|
|
- };
|
|
-
|
|
- pmic {
|
|
- vsel1_gpio: vsel1-gpio {
|
|
- rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>;
|
|
- };
|
|
-
|
|
- vsel2_gpio: vsel2-gpio {
|
|
- rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
|
|
- };
|
|
- };
|
|
-
|
|
- sdio-pwrseq {
|
|
- wifi_enable_h: wifi-enable-h {
|
|
- rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
- };
|
|
- };
|
|
-
|
|
- pmic {
|
|
- pmic_int_l: pmic-int-l {
|
|
- rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
|
|
- };
|
|
- };
|
|
-
|
|
- usb2 {
|
|
- vcc5v0_host_en: vcc5v0-host-en {
|
|
- rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
- };
|
|
-
|
|
- vcc_sys_en: vcc-sys-en {
|
|
- rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
- };
|
|
-
|
|
- hub_rst: hub-rst {
|
|
- rockchip,pins = <2 RK_PA4 RK_FUNC_GPIO &pcfg_output_high>;
|
|
- };
|
|
- };
|
|
-
|
|
- usb-typec {
|
|
- vcc_vbus_typec1_en: vcc-vbus-typec1-en {
|
|
- rockchip,pins = <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
- };
|
|
- };
|
|
-
|
|
- fusb30x {
|
|
- fusb0_int: fusb0-int {
|
|
- rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
|
|
- };
|
|
-
|
|
- fusb1_int: fusb1-int {
|
|
- rockchip,pins = <1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
|
|
- };
|
|
- };
|
|
-};
|
|
-
|
|
-&pwm0 {
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&pwm2 {
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&saradc {
|
|
- vref-supply = <&vcca1v8_s3>;
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&sdmmc {
|
|
- bus-width = <4>;
|
|
- cap-mmc-highspeed;
|
|
- cap-sd-highspeed;
|
|
- cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
|
|
- disable-wp;
|
|
- max-frequency = <150000000>;
|
|
- pinctrl-names = "default";
|
|
- pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>;
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&sdhci {
|
|
- bus-width = <8>;
|
|
- mmc-hs400-1_8v;
|
|
- mmc-hs400-enhanced-strobe;
|
|
- non-removable;
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&tcphy0 {
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&tcphy1 {
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&tsadc {
|
|
- /* tshut mode 0:CRU 1:GPIO */
|
|
- rockchip,hw-tshut-mode = <1>;
|
|
- /* tshut polarity 0:LOW 1:HIGH */
|
|
- rockchip,hw-tshut-polarity = <1>;
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&u2phy0 {
|
|
- status = "okay";
|
|
-
|
|
- u2phy0_otg: otg-port {
|
|
- phy-supply = <&vcc_vbus_typec0>;
|
|
- status = "okay";
|
|
- };
|
|
-
|
|
- u2phy0_host: host-port {
|
|
- phy-supply = <&vcc5v0_host>;
|
|
- status = "okay";
|
|
- };
|
|
-};
|
|
-
|
|
-&u2phy1 {
|
|
- status = "okay";
|
|
-
|
|
- u2phy1_otg: otg-port {
|
|
- phy-supply = <&vcc_vbus_typec1>;
|
|
- status = "okay";
|
|
- };
|
|
-
|
|
- u2phy1_host: host-port {
|
|
- phy-supply = <&vcc5v0_host>;
|
|
- status = "okay";
|
|
- };
|
|
-};
|
|
-
|
|
-&uart0 {
|
|
- pinctrl-names = "default";
|
|
- pinctrl-0 = <&uart0_xfer &uart0_cts>;
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&uart2 {
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&usb_host0_ehci {
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&usb_host0_ohci {
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&usb_host1_ehci {
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&usb_host1_ohci {
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&usbdrd3_0 {
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&usbdrd_dwc3_0 {
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&usbdrd3_1 {
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&usbdrd_dwc3_1 {
|
|
- status = "okay";
|
|
- dr_mode = "host";
|
|
-};
|
|
-
|
|
-&vopb {
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&vopb_mmu {
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&vopl {
|
|
- status = "okay";
|
|
-};
|
|
-
|
|
-&vopl_mmu {
|
|
- status = "okay";
|
|
};
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
|
|
new file mode 100644
|
|
index 000000000000..7e07dae33d0f
|
|
--- /dev/null
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
|
|
@@ -0,0 +1,767 @@
|
|
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
|
+/*
|
|
+ * Copyright (c) 2017 T-Chip Intelligent Technology Co., Ltd
|
|
+ */
|
|
+
|
|
+/dts-v1/;
|
|
+#include <dt-bindings/input/linux-event-codes.h>
|
|
+#include <dt-bindings/pwm/pwm.h>
|
|
+#include "rk3399.dtsi"
|
|
+#include "rk3399-opp.dtsi"
|
|
+
|
|
+/ {
|
|
+ model = "Firefly ROC-RK3399-PC Board";
|
|
+ compatible = "firefly,roc-rk3399-pc", "rockchip,rk3399";
|
|
+
|
|
+ chosen {
|
|
+ stdout-path = "serial2:1500000n8";
|
|
+ };
|
|
+
|
|
+ backlight: backlight {
|
|
+ compatible = "pwm-backlight";
|
|
+ pwms = <&pwm0 0 25000 0>;
|
|
+ };
|
|
+
|
|
+ clkin_gmac: external-gmac-clock {
|
|
+ compatible = "fixed-clock";
|
|
+ clock-frequency = <125000000>;
|
|
+ clock-output-names = "clkin_gmac";
|
|
+ #clock-cells = <0>;
|
|
+ };
|
|
+
|
|
+ adc-keys {
|
|
+ compatible = "adc-keys";
|
|
+ io-channels = <&saradc 1>;
|
|
+ io-channel-names = "buttons";
|
|
+ keyup-threshold-microvolt = <1500000>;
|
|
+ poll-interval = <100>;
|
|
+
|
|
+ recovery {
|
|
+ label = "Recovery";
|
|
+ linux,code = <KEY_VENDOR>;
|
|
+ press-threshold-microvolt = <18000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ gpio-keys {
|
|
+ compatible = "gpio-keys";
|
|
+ autorepeat;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&pwr_key_l>;
|
|
+
|
|
+ power {
|
|
+ debounce-interval = <100>;
|
|
+ gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
|
|
+ label = "GPIO Key Power";
|
|
+ linux,code = <KEY_POWER>;
|
|
+ wakeup-source;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ leds {
|
|
+ compatible = "gpio-leds";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&work_led_gpio>, <&diy_led_gpio>, <&yellow_led_gpio>;
|
|
+
|
|
+ work-led {
|
|
+ label = "green:work";
|
|
+ gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>;
|
|
+ default-state = "on";
|
|
+ linux,default-trigger = "heartbeat";
|
|
+ };
|
|
+
|
|
+ diy-led {
|
|
+ label = "red:diy";
|
|
+ gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
|
|
+ default-state = "off";
|
|
+ linux,default-trigger = "mmc1";
|
|
+ };
|
|
+
|
|
+ yellow-led {
|
|
+ label = "yellow:yellow-led";
|
|
+ gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
|
|
+ default-state = "off";
|
|
+ linux,default-trigger = "mmc0";
|
|
+ };
|
|
+ };
|
|
+
|
|
+ sdio_pwrseq: sdio-pwrseq {
|
|
+ compatible = "mmc-pwrseq-simple";
|
|
+ clocks = <&rk808 1>;
|
|
+ clock-names = "ext_clock";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&wifi_enable_h>;
|
|
+
|
|
+ /*
|
|
+ * On the module itself this is one of these (depending
|
|
+ * on the actual card populated):
|
|
+ * - SDIO_RESET_L_WL_REG_ON
|
|
+ * - PDN (power down when low)
|
|
+ */
|
|
+ reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
|
|
+ };
|
|
+
|
|
+ vcc_vbus_typec0: vcc-vbus-typec0 {
|
|
+ compatible = "regulator-fixed";
|
|
+ regulator-name = "vcc_vbus_typec0";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-min-microvolt = <5000000>;
|
|
+ regulator-max-microvolt = <5000000>;
|
|
+ };
|
|
+
|
|
+ /*
|
|
+ * should be placed inside mp8859, but not until mp8859 has
|
|
+ * its own dt-binding.
|
|
+ */
|
|
+ dc_12v: mp8859-dcdc1 {
|
|
+ compatible = "regulator-fixed";
|
|
+ regulator-name = "dc_12v";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-min-microvolt = <12000000>;
|
|
+ regulator-max-microvolt = <12000000>;
|
|
+ vin-supply = <&vcc_vbus_typec0>;
|
|
+ };
|
|
+
|
|
+ /* switched by pmic_sleep */
|
|
+ vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
|
|
+ compatible = "regulator-fixed";
|
|
+ regulator-name = "vcc1v8_s3";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-min-microvolt = <1800000>;
|
|
+ regulator-max-microvolt = <1800000>;
|
|
+ vin-supply = <&vcc_1v8>;
|
|
+ };
|
|
+
|
|
+ vcc3v3_sys: vcc3v3-sys {
|
|
+ compatible = "regulator-fixed";
|
|
+ regulator-name = "vcc3v3_sys";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-min-microvolt = <3300000>;
|
|
+ regulator-max-microvolt = <3300000>;
|
|
+ vin-supply = <&dc_12v>;
|
|
+ };
|
|
+
|
|
+ /* Actually 3 regulators (host0, 1, 2) controlled by the same gpio */
|
|
+ vcc5v0_host: vcc5v0-host-regulator {
|
|
+ compatible = "regulator-fixed";
|
|
+ enable-active-high;
|
|
+ gpio = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&vcc5v0_host_en &hub_rst>;
|
|
+ regulator-name = "vcc5v0_host";
|
|
+ regulator-always-on;
|
|
+ vin-supply = <&vcc_sys>;
|
|
+ };
|
|
+
|
|
+ vcc_vbus_typec1: vcc-vbus-typec1 {
|
|
+ compatible = "regulator-fixed";
|
|
+ enable-active-high;
|
|
+ gpio = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&vcc_vbus_typec1_en>;
|
|
+ regulator-name = "vcc_vbus_typec1";
|
|
+ regulator-always-on;
|
|
+ vin-supply = <&vcc_sys>;
|
|
+ };
|
|
+
|
|
+ vcc_sys: vcc-sys {
|
|
+ compatible = "regulator-fixed";
|
|
+ enable-active-high;
|
|
+ gpio = <&gpio2 RK_PA6 GPIO_ACTIVE_HIGH>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&vcc_sys_en>;
|
|
+ regulator-name = "vcc_sys";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-min-microvolt = <5000000>;
|
|
+ regulator-max-microvolt = <5000000>;
|
|
+ vin-supply = <&dc_12v>;
|
|
+ };
|
|
+
|
|
+ vdd_log: vdd-log {
|
|
+ compatible = "pwm-regulator";
|
|
+ pwms = <&pwm2 0 25000 1>;
|
|
+ regulator-name = "vdd_log";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-min-microvolt = <800000>;
|
|
+ regulator-max-microvolt = <1400000>;
|
|
+ vin-supply = <&vcc3v3_sys>;
|
|
+ };
|
|
+};
|
|
+
|
|
+&cpu_l0 {
|
|
+ cpu-supply = <&vdd_cpu_l>;
|
|
+};
|
|
+
|
|
+&cpu_l1 {
|
|
+ cpu-supply = <&vdd_cpu_l>;
|
|
+};
|
|
+
|
|
+&cpu_l2 {
|
|
+ cpu-supply = <&vdd_cpu_l>;
|
|
+};
|
|
+
|
|
+&cpu_l3 {
|
|
+ cpu-supply = <&vdd_cpu_l>;
|
|
+};
|
|
+
|
|
+&cpu_b0 {
|
|
+ cpu-supply = <&vdd_cpu_b>;
|
|
+};
|
|
+
|
|
+&cpu_b1 {
|
|
+ cpu-supply = <&vdd_cpu_b>;
|
|
+};
|
|
+
|
|
+&emmc_phy {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&gmac {
|
|
+ assigned-clocks = <&cru SCLK_RMII_SRC>;
|
|
+ assigned-clock-parents = <&clkin_gmac>;
|
|
+ clock_in_out = "input";
|
|
+ phy-supply = <&vcc_lan>;
|
|
+ phy-mode = "rgmii";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&rgmii_pins>;
|
|
+ snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
|
|
+ snps,reset-active-low;
|
|
+ snps,reset-delays-us = <0 10000 50000>;
|
|
+ tx_delay = <0x28>;
|
|
+ rx_delay = <0x11>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&hdmi {
|
|
+ ddc-i2c-bus = <&i2c3>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&hdmi_cec>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&i2c0 {
|
|
+ clock-frequency = <400000>;
|
|
+ i2c-scl-rising-time-ns = <168>;
|
|
+ i2c-scl-falling-time-ns = <4>;
|
|
+ status = "okay";
|
|
+
|
|
+ rk808: pmic@1b {
|
|
+ compatible = "rockchip,rk808";
|
|
+ reg = <0x1b>;
|
|
+ interrupt-parent = <&gpio1>;
|
|
+ interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
|
|
+ #clock-cells = <1>;
|
|
+ clock-output-names = "xin32k", "rk808-clkout2";
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&pmic_int_l>;
|
|
+ rockchip,system-power-controller;
|
|
+ wakeup-source;
|
|
+
|
|
+ vcc1-supply = <&vcc3v3_sys>;
|
|
+ vcc2-supply = <&vcc3v3_sys>;
|
|
+ vcc3-supply = <&vcc3v3_sys>;
|
|
+ vcc4-supply = <&vcc3v3_sys>;
|
|
+ vcc6-supply = <&vcc3v3_sys>;
|
|
+ vcc7-supply = <&vcc3v3_sys>;
|
|
+ vcc8-supply = <&vcc3v3_sys>;
|
|
+ vcc9-supply = <&vcc3v3_sys>;
|
|
+ vcc10-supply = <&vcc3v3_sys>;
|
|
+ vcc11-supply = <&vcc3v3_sys>;
|
|
+ vcc12-supply = <&vcc3v3_sys>;
|
|
+ vcc13-supply = <&vcc3v3_sys>;
|
|
+ vcc14-supply = <&vcc3v3_sys>;
|
|
+ vddio-supply = <&vcc_3v0>;
|
|
+
|
|
+ regulators {
|
|
+ vdd_center: DCDC_REG1 {
|
|
+ regulator-name = "vdd_center";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-min-microvolt = <750000>;
|
|
+ regulator-max-microvolt = <1350000>;
|
|
+ regulator-ramp-delay = <6001>;
|
|
+ regulator-state-mem {
|
|
+ regulator-off-in-suspend;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vdd_cpu_l: DCDC_REG2 {
|
|
+ regulator-name = "vdd_cpu_l";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-min-microvolt = <750000>;
|
|
+ regulator-max-microvolt = <1350000>;
|
|
+ regulator-ramp-delay = <6001>;
|
|
+ regulator-state-mem {
|
|
+ regulator-off-in-suspend;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc_ddr: DCDC_REG3 {
|
|
+ regulator-name = "vcc_ddr";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc_1v8: DCDC_REG4 {
|
|
+ regulator-name = "vcc_1v8";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-min-microvolt = <1800000>;
|
|
+ regulator-max-microvolt = <1800000>;
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ regulator-suspend-microvolt = <1800000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcca1v8_codec: LDO_REG1 {
|
|
+ regulator-name = "vcca1v8_codec";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-min-microvolt = <1800000>;
|
|
+ regulator-max-microvolt = <1800000>;
|
|
+ regulator-state-mem {
|
|
+ regulator-off-in-suspend;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc1v8_hdmi: LDO_REG2 {
|
|
+ regulator-name = "vcc1v8_hdmi";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-min-microvolt = <1800000>;
|
|
+ regulator-max-microvolt = <1800000>;
|
|
+ regulator-state-mem {
|
|
+ regulator-off-in-suspend;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc1v8_pmu: LDO_REG3 {
|
|
+ regulator-name = "vcc1v8_pmu";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-min-microvolt = <1800000>;
|
|
+ regulator-max-microvolt = <1800000>;
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ regulator-suspend-microvolt = <1800000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc_sdio: LDO_REG4 {
|
|
+ regulator-name = "vcc_sdio";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-min-microvolt = <1800000>;
|
|
+ regulator-max-microvolt = <3000000>;
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ regulator-suspend-microvolt = <3000000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcca3v0_codec: LDO_REG5 {
|
|
+ regulator-name = "vcca3v0_codec";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-min-microvolt = <3000000>;
|
|
+ regulator-max-microvolt = <3000000>;
|
|
+ regulator-state-mem {
|
|
+ regulator-off-in-suspend;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc_1v5: LDO_REG6 {
|
|
+ regulator-name = "vcc_1v5";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-min-microvolt = <1500000>;
|
|
+ regulator-max-microvolt = <1500000>;
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ regulator-suspend-microvolt = <1500000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcca0v9_hdmi: LDO_REG7 {
|
|
+ regulator-name = "vcca0v9_hdmi";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-min-microvolt = <900000>;
|
|
+ regulator-max-microvolt = <900000>;
|
|
+ regulator-state-mem {
|
|
+ regulator-off-in-suspend;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc_3v0: LDO_REG8 {
|
|
+ regulator-name = "vcc_3v0";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-min-microvolt = <3000000>;
|
|
+ regulator-max-microvolt = <3000000>;
|
|
+ regulator-state-mem {
|
|
+ regulator-on-in-suspend;
|
|
+ regulator-suspend-microvolt = <3000000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc3v3_s3: vcc_lan: SWITCH_REG1 {
|
|
+ regulator-name = "vcc3v3_s3";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-state-mem {
|
|
+ regulator-off-in-suspend;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vcc3v3_s0: SWITCH_REG2 {
|
|
+ regulator-name = "vcc3v3_s0";
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ regulator-state-mem {
|
|
+ regulator-off-in-suspend;
|
|
+ };
|
|
+ };
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vdd_cpu_b: regulator@40 {
|
|
+ compatible = "silergy,syr827";
|
|
+ reg = <0x40>;
|
|
+ fcs,suspend-voltage-selector = <1>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&vsel1_gpio>;
|
|
+ regulator-name = "vdd_cpu_b";
|
|
+ regulator-min-microvolt = <712500>;
|
|
+ regulator-max-microvolt = <1500000>;
|
|
+ regulator-ramp-delay = <1000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ vin-supply = <&vcc3v3_sys>;
|
|
+
|
|
+ regulator-state-mem {
|
|
+ regulator-off-in-suspend;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ vdd_gpu: regulator@41 {
|
|
+ compatible = "silergy,syr828";
|
|
+ reg = <0x41>;
|
|
+ fcs,suspend-voltage-selector = <1>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&vsel2_gpio>;
|
|
+ regulator-name = "vdd_gpu";
|
|
+ regulator-min-microvolt = <712500>;
|
|
+ regulator-max-microvolt = <1500000>;
|
|
+ regulator-ramp-delay = <1000>;
|
|
+ regulator-always-on;
|
|
+ regulator-boot-on;
|
|
+ vin-supply = <&vcc3v3_sys>;
|
|
+
|
|
+ regulator-state-mem {
|
|
+ regulator-off-in-suspend;
|
|
+ };
|
|
+ };
|
|
+};
|
|
+
|
|
+&i2c1 {
|
|
+ i2c-scl-rising-time-ns = <300>;
|
|
+ i2c-scl-falling-time-ns = <15>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&i2c3 {
|
|
+ i2c-scl-rising-time-ns = <450>;
|
|
+ i2c-scl-falling-time-ns = <15>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&i2c4 {
|
|
+ i2c-scl-rising-time-ns = <600>;
|
|
+ i2c-scl-falling-time-ns = <20>;
|
|
+ status = "okay";
|
|
+
|
|
+ fusb1: usb-typec@22 {
|
|
+ compatible = "fcs,fusb302";
|
|
+ reg = <0x22>;
|
|
+ interrupt-parent = <&gpio1>;
|
|
+ interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&fusb1_int>;
|
|
+ vbus-supply = <&vcc_vbus_typec1>;
|
|
+ status = "okay";
|
|
+ };
|
|
+};
|
|
+
|
|
+&i2c7 {
|
|
+ i2c-scl-rising-time-ns = <600>;
|
|
+ i2c-scl-falling-time-ns = <20>;
|
|
+ status = "okay";
|
|
+
|
|
+ fusb0: usb-typec@22 {
|
|
+ compatible = "fcs,fusb302";
|
|
+ reg = <0x22>;
|
|
+ interrupt-parent = <&gpio1>;
|
|
+ interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&fusb0_int>;
|
|
+ vbus-supply = <&vcc_vbus_typec0>;
|
|
+ status = "okay";
|
|
+ };
|
|
+};
|
|
+
|
|
+&i2s0 {
|
|
+ rockchip,playback-channels = <8>;
|
|
+ rockchip,capture-channels = <8>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&i2s1 {
|
|
+ rockchip,playback-channels = <2>;
|
|
+ rockchip,capture-channels = <2>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&i2s2 {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&io_domains {
|
|
+ audio-supply = <&vcca1v8_codec>;
|
|
+ bt656-supply = <&vcc_3v0>;
|
|
+ gpio1830-supply = <&vcc_3v0>;
|
|
+ sdmmc-supply = <&vcc_sdio>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&pmu_io_domains {
|
|
+ pmu1830-supply = <&vcc_3v0>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&pinctrl {
|
|
+ buttons {
|
|
+ pwr_key_l: pwr-key-l {
|
|
+ rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ lcd-panel {
|
|
+ lcd_panel_reset: lcd-panel-reset {
|
|
+ rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ leds {
|
|
+ diy_led_gpio: diy_led-gpio {
|
|
+ rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ work_led_gpio: work_led-gpio {
|
|
+ rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ yellow_led_gpio: yellow_led-gpio {
|
|
+ rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ pmic {
|
|
+ vsel1_gpio: vsel1-gpio {
|
|
+ rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>;
|
|
+ };
|
|
+
|
|
+ vsel2_gpio: vsel2-gpio {
|
|
+ rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ sdio-pwrseq {
|
|
+ wifi_enable_h: wifi-enable-h {
|
|
+ rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ pmic {
|
|
+ pmic_int_l: pmic-int-l {
|
|
+ rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ usb2 {
|
|
+ vcc5v0_host_en: vcc5v0-host-en {
|
|
+ rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ vcc_sys_en: vcc-sys-en {
|
|
+ rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
+ };
|
|
+
|
|
+ hub_rst: hub-rst {
|
|
+ rockchip,pins = <2 RK_PA4 RK_FUNC_GPIO &pcfg_output_high>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ usb-typec {
|
|
+ vcc_vbus_typec1_en: vcc-vbus-typec1-en {
|
|
+ rockchip,pins = <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ fusb30x {
|
|
+ fusb0_int: fusb0-int {
|
|
+ rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
|
|
+ };
|
|
+
|
|
+ fusb1_int: fusb1-int {
|
|
+ rockchip,pins = <1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
|
|
+ };
|
|
+ };
|
|
+};
|
|
+
|
|
+&pwm0 {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&pwm2 {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&saradc {
|
|
+ vref-supply = <&vcca1v8_s3>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&sdmmc {
|
|
+ bus-width = <4>;
|
|
+ cap-mmc-highspeed;
|
|
+ cap-sd-highspeed;
|
|
+ cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
|
|
+ disable-wp;
|
|
+ max-frequency = <150000000>;
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&sdhci {
|
|
+ bus-width = <8>;
|
|
+ mmc-hs400-1_8v;
|
|
+ mmc-hs400-enhanced-strobe;
|
|
+ non-removable;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&tcphy0 {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&tcphy1 {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&tsadc {
|
|
+ /* tshut mode 0:CRU 1:GPIO */
|
|
+ rockchip,hw-tshut-mode = <1>;
|
|
+ /* tshut polarity 0:LOW 1:HIGH */
|
|
+ rockchip,hw-tshut-polarity = <1>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&u2phy0 {
|
|
+ status = "okay";
|
|
+
|
|
+ u2phy0_otg: otg-port {
|
|
+ phy-supply = <&vcc_vbus_typec0>;
|
|
+ status = "okay";
|
|
+ };
|
|
+
|
|
+ u2phy0_host: host-port {
|
|
+ phy-supply = <&vcc5v0_host>;
|
|
+ status = "okay";
|
|
+ };
|
|
+};
|
|
+
|
|
+&u2phy1 {
|
|
+ status = "okay";
|
|
+
|
|
+ u2phy1_otg: otg-port {
|
|
+ phy-supply = <&vcc_vbus_typec1>;
|
|
+ status = "okay";
|
|
+ };
|
|
+
|
|
+ u2phy1_host: host-port {
|
|
+ phy-supply = <&vcc5v0_host>;
|
|
+ status = "okay";
|
|
+ };
|
|
+};
|
|
+
|
|
+&uart0 {
|
|
+ pinctrl-names = "default";
|
|
+ pinctrl-0 = <&uart0_xfer &uart0_cts>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&uart2 {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&usb_host0_ehci {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&usb_host0_ohci {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&usb_host1_ehci {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&usb_host1_ohci {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&usbdrd3_0 {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&usbdrd_dwc3_0 {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&usbdrd3_1 {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&usbdrd_dwc3_1 {
|
|
+ status = "okay";
|
|
+ dr_mode = "host";
|
|
+};
|
|
+
|
|
+&vopb {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&vopb_mmu {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&vopl {
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
+&vopl_mmu {
|
|
+ status = "okay";
|
|
+};
|
|
|
|
From 5c232c7612c94ad7e650e64e5d51a15d27fbff59 Mon Sep 17 00:00:00 2001
|
|
From: Peter Geis <pgwipeout@gmail.com>
|
|
Date: Wed, 16 Oct 2019 18:59:46 +0000
|
|
Subject: [PATCH] arm64: dts: rockchip: fix sdmmc detection on boot on
|
|
rk3328-roc-cc
|
|
|
|
With working GPIO, during init the GPIO state s reset.
|
|
This causes the sdmmc regulator to shut down, preventing detection.
|
|
Removing and replacing the card will allow it to be detected, but that should not be necessary.
|
|
Fix this by setting the regulator on at boot.
|
|
|
|
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
|
|
Link: https://lore.kernel.org/r/20191016185945.1962-1-pgwipeout@gmail.com
|
|
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
|
(cherry picked from commit 75aa567803b15e679432655badf95cd30b66b930)
|
|
---
|
|
arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts | 1 +
|
|
1 file changed, 1 insertion(+)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts
|
|
index bb40c163b05d..8d553c92182a 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts
|
|
@@ -35,6 +35,7 @@
|
|
gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_LOW>;
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&sdmmc0m1_gpio>;
|
|
+ regulator-boot-on;
|
|
regulator-name = "vcc_sd";
|
|
regulator-min-microvolt = <3300000>;
|
|
regulator-max-microvolt = <3300000>;
|
|
|
|
From d0db2c2c32a980edb128a16a780ef42d8a23b4d1 Mon Sep 17 00:00:00 2001
|
|
From: Ard Biesheuvel <ardb@kernel.org>
|
|
Date: Sat, 9 Nov 2019 18:09:48 +0100
|
|
Subject: [PATCH] crypto: rockchip - switch to skcipher API
|
|
|
|
Commit 7a7ffe65c8c5 ("crypto: skcipher - Add top-level skcipher interface")
|
|
dated 20 august 2015 introduced the new skcipher API which is supposed to
|
|
replace both blkcipher and ablkcipher. While all consumers of the API have
|
|
been converted long ago, some producers of the ablkcipher remain, forcing
|
|
us to keep the ablkcipher support routines alive, along with the matching
|
|
code to expose [a]blkciphers via the skcipher API.
|
|
|
|
So switch this driver to the skcipher API, allowing us to finally drop the
|
|
ablkcipher code in the near future.
|
|
|
|
Cc: Heiko Stuebner <heiko@sntech.de>
|
|
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
|
|
(cherry picked from commit ce0183cb6464bacc170ccfddb4d93bbe10d1045b)
|
|
---
|
|
drivers/crypto/rockchip/Makefile | 2 +-
|
|
drivers/crypto/rockchip/rk3288_crypto.c | 8 +-
|
|
drivers/crypto/rockchip/rk3288_crypto.h | 3 +-
|
|
drivers/crypto/rockchip/rk3288_crypto_ablkcipher.c | 556 ---------------------
|
|
drivers/crypto/rockchip/rk3288_crypto_skcipher.c | 538 ++++++++++++++++++++
|
|
5 files changed, 545 insertions(+), 562 deletions(-)
|
|
delete mode 100644 drivers/crypto/rockchip/rk3288_crypto_ablkcipher.c
|
|
create mode 100644 drivers/crypto/rockchip/rk3288_crypto_skcipher.c
|
|
|
|
diff --git a/drivers/crypto/rockchip/Makefile b/drivers/crypto/rockchip/Makefile
|
|
index 6e23764e6c8a..785277aca71e 100644
|
|
--- a/drivers/crypto/rockchip/Makefile
|
|
+++ b/drivers/crypto/rockchip/Makefile
|
|
@@ -1,5 +1,5 @@
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
|
obj-$(CONFIG_CRYPTO_DEV_ROCKCHIP) += rk_crypto.o
|
|
rk_crypto-objs := rk3288_crypto.o \
|
|
- rk3288_crypto_ablkcipher.o \
|
|
+ rk3288_crypto_skcipher.o \
|
|
rk3288_crypto_ahash.o
|
|
diff --git a/drivers/crypto/rockchip/rk3288_crypto.c b/drivers/crypto/rockchip/rk3288_crypto.c
|
|
index e5714ef24bf2..f385587f99af 100644
|
|
--- a/drivers/crypto/rockchip/rk3288_crypto.c
|
|
+++ b/drivers/crypto/rockchip/rk3288_crypto.c
|
|
@@ -264,8 +264,8 @@ static int rk_crypto_register(struct rk_crypto_info *crypto_info)
|
|
for (i = 0; i < ARRAY_SIZE(rk_cipher_algs); i++) {
|
|
rk_cipher_algs[i]->dev = crypto_info;
|
|
if (rk_cipher_algs[i]->type == ALG_TYPE_CIPHER)
|
|
- err = crypto_register_alg(
|
|
- &rk_cipher_algs[i]->alg.crypto);
|
|
+ err = crypto_register_skcipher(
|
|
+ &rk_cipher_algs[i]->alg.skcipher);
|
|
else
|
|
err = crypto_register_ahash(
|
|
&rk_cipher_algs[i]->alg.hash);
|
|
@@ -277,7 +277,7 @@ static int rk_crypto_register(struct rk_crypto_info *crypto_info)
|
|
err_cipher_algs:
|
|
for (k = 0; k < i; k++) {
|
|
if (rk_cipher_algs[i]->type == ALG_TYPE_CIPHER)
|
|
- crypto_unregister_alg(&rk_cipher_algs[k]->alg.crypto);
|
|
+ crypto_unregister_skcipher(&rk_cipher_algs[k]->alg.skcipher);
|
|
else
|
|
crypto_unregister_ahash(&rk_cipher_algs[i]->alg.hash);
|
|
}
|
|
@@ -290,7 +290,7 @@ static void rk_crypto_unregister(void)
|
|
|
|
for (i = 0; i < ARRAY_SIZE(rk_cipher_algs); i++) {
|
|
if (rk_cipher_algs[i]->type == ALG_TYPE_CIPHER)
|
|
- crypto_unregister_alg(&rk_cipher_algs[i]->alg.crypto);
|
|
+ crypto_unregister_skcipher(&rk_cipher_algs[i]->alg.skcipher);
|
|
else
|
|
crypto_unregister_ahash(&rk_cipher_algs[i]->alg.hash);
|
|
}
|
|
diff --git a/drivers/crypto/rockchip/rk3288_crypto.h b/drivers/crypto/rockchip/rk3288_crypto.h
|
|
index 18e2b3f29336..2b49c677afdb 100644
|
|
--- a/drivers/crypto/rockchip/rk3288_crypto.h
|
|
+++ b/drivers/crypto/rockchip/rk3288_crypto.h
|
|
@@ -8,6 +8,7 @@
|
|
#include <linux/interrupt.h>
|
|
#include <linux/delay.h>
|
|
#include <crypto/internal/hash.h>
|
|
+#include <crypto/internal/skcipher.h>
|
|
|
|
#include <crypto/md5.h>
|
|
#include <crypto/sha.h>
|
|
@@ -256,7 +257,7 @@ enum alg_type {
|
|
struct rk_crypto_tmp {
|
|
struct rk_crypto_info *dev;
|
|
union {
|
|
- struct crypto_alg crypto;
|
|
+ struct skcipher_alg skcipher;
|
|
struct ahash_alg hash;
|
|
} alg;
|
|
enum alg_type type;
|
|
diff --git a/drivers/crypto/rockchip/rk3288_crypto_ablkcipher.c b/drivers/crypto/rockchip/rk3288_crypto_ablkcipher.c
|
|
deleted file mode 100644
|
|
index d0f4b2d18059..000000000000
|
|
--- a/drivers/crypto/rockchip/rk3288_crypto_ablkcipher.c
|
|
+++ /dev/null
|
|
@@ -1,556 +0,0 @@
|
|
-// SPDX-License-Identifier: GPL-2.0-only
|
|
-/*
|
|
- * Crypto acceleration support for Rockchip RK3288
|
|
- *
|
|
- * Copyright (c) 2015, Fuzhou Rockchip Electronics Co., Ltd
|
|
- *
|
|
- * Author: Zain Wang <zain.wang@rock-chips.com>
|
|
- *
|
|
- * Some ideas are from marvell-cesa.c and s5p-sss.c driver.
|
|
- */
|
|
-#include "rk3288_crypto.h"
|
|
-
|
|
-#define RK_CRYPTO_DEC BIT(0)
|
|
-
|
|
-static void rk_crypto_complete(struct crypto_async_request *base, int err)
|
|
-{
|
|
- if (base->complete)
|
|
- base->complete(base, err);
|
|
-}
|
|
-
|
|
-static int rk_handle_req(struct rk_crypto_info *dev,
|
|
- struct ablkcipher_request *req)
|
|
-{
|
|
- if (!IS_ALIGNED(req->nbytes, dev->align_size))
|
|
- return -EINVAL;
|
|
- else
|
|
- return dev->enqueue(dev, &req->base);
|
|
-}
|
|
-
|
|
-static int rk_aes_setkey(struct crypto_ablkcipher *cipher,
|
|
- const u8 *key, unsigned int keylen)
|
|
-{
|
|
- struct crypto_tfm *tfm = crypto_ablkcipher_tfm(cipher);
|
|
- struct rk_cipher_ctx *ctx = crypto_tfm_ctx(tfm);
|
|
-
|
|
- if (keylen != AES_KEYSIZE_128 && keylen != AES_KEYSIZE_192 &&
|
|
- keylen != AES_KEYSIZE_256) {
|
|
- crypto_ablkcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
|
- return -EINVAL;
|
|
- }
|
|
- ctx->keylen = keylen;
|
|
- memcpy_toio(ctx->dev->reg + RK_CRYPTO_AES_KEY_0, key, keylen);
|
|
- return 0;
|
|
-}
|
|
-
|
|
-static int rk_des_setkey(struct crypto_ablkcipher *cipher,
|
|
- const u8 *key, unsigned int keylen)
|
|
-{
|
|
- struct rk_cipher_ctx *ctx = crypto_ablkcipher_ctx(cipher);
|
|
- int err;
|
|
-
|
|
- err = verify_ablkcipher_des_key(cipher, key);
|
|
- if (err)
|
|
- return err;
|
|
-
|
|
- ctx->keylen = keylen;
|
|
- memcpy_toio(ctx->dev->reg + RK_CRYPTO_TDES_KEY1_0, key, keylen);
|
|
- return 0;
|
|
-}
|
|
-
|
|
-static int rk_tdes_setkey(struct crypto_ablkcipher *cipher,
|
|
- const u8 *key, unsigned int keylen)
|
|
-{
|
|
- struct rk_cipher_ctx *ctx = crypto_ablkcipher_ctx(cipher);
|
|
- int err;
|
|
-
|
|
- err = verify_ablkcipher_des3_key(cipher, key);
|
|
- if (err)
|
|
- return err;
|
|
-
|
|
- ctx->keylen = keylen;
|
|
- memcpy_toio(ctx->dev->reg + RK_CRYPTO_TDES_KEY1_0, key, keylen);
|
|
- return 0;
|
|
-}
|
|
-
|
|
-static int rk_aes_ecb_encrypt(struct ablkcipher_request *req)
|
|
-{
|
|
- struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
|
|
- struct rk_cipher_ctx *ctx = crypto_ablkcipher_ctx(tfm);
|
|
- struct rk_crypto_info *dev = ctx->dev;
|
|
-
|
|
- ctx->mode = RK_CRYPTO_AES_ECB_MODE;
|
|
- return rk_handle_req(dev, req);
|
|
-}
|
|
-
|
|
-static int rk_aes_ecb_decrypt(struct ablkcipher_request *req)
|
|
-{
|
|
- struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
|
|
- struct rk_cipher_ctx *ctx = crypto_ablkcipher_ctx(tfm);
|
|
- struct rk_crypto_info *dev = ctx->dev;
|
|
-
|
|
- ctx->mode = RK_CRYPTO_AES_ECB_MODE | RK_CRYPTO_DEC;
|
|
- return rk_handle_req(dev, req);
|
|
-}
|
|
-
|
|
-static int rk_aes_cbc_encrypt(struct ablkcipher_request *req)
|
|
-{
|
|
- struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
|
|
- struct rk_cipher_ctx *ctx = crypto_ablkcipher_ctx(tfm);
|
|
- struct rk_crypto_info *dev = ctx->dev;
|
|
-
|
|
- ctx->mode = RK_CRYPTO_AES_CBC_MODE;
|
|
- return rk_handle_req(dev, req);
|
|
-}
|
|
-
|
|
-static int rk_aes_cbc_decrypt(struct ablkcipher_request *req)
|
|
-{
|
|
- struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
|
|
- struct rk_cipher_ctx *ctx = crypto_ablkcipher_ctx(tfm);
|
|
- struct rk_crypto_info *dev = ctx->dev;
|
|
-
|
|
- ctx->mode = RK_CRYPTO_AES_CBC_MODE | RK_CRYPTO_DEC;
|
|
- return rk_handle_req(dev, req);
|
|
-}
|
|
-
|
|
-static int rk_des_ecb_encrypt(struct ablkcipher_request *req)
|
|
-{
|
|
- struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
|
|
- struct rk_cipher_ctx *ctx = crypto_ablkcipher_ctx(tfm);
|
|
- struct rk_crypto_info *dev = ctx->dev;
|
|
-
|
|
- ctx->mode = 0;
|
|
- return rk_handle_req(dev, req);
|
|
-}
|
|
-
|
|
-static int rk_des_ecb_decrypt(struct ablkcipher_request *req)
|
|
-{
|
|
- struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
|
|
- struct rk_cipher_ctx *ctx = crypto_ablkcipher_ctx(tfm);
|
|
- struct rk_crypto_info *dev = ctx->dev;
|
|
-
|
|
- ctx->mode = RK_CRYPTO_DEC;
|
|
- return rk_handle_req(dev, req);
|
|
-}
|
|
-
|
|
-static int rk_des_cbc_encrypt(struct ablkcipher_request *req)
|
|
-{
|
|
- struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
|
|
- struct rk_cipher_ctx *ctx = crypto_ablkcipher_ctx(tfm);
|
|
- struct rk_crypto_info *dev = ctx->dev;
|
|
-
|
|
- ctx->mode = RK_CRYPTO_TDES_CHAINMODE_CBC;
|
|
- return rk_handle_req(dev, req);
|
|
-}
|
|
-
|
|
-static int rk_des_cbc_decrypt(struct ablkcipher_request *req)
|
|
-{
|
|
- struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
|
|
- struct rk_cipher_ctx *ctx = crypto_ablkcipher_ctx(tfm);
|
|
- struct rk_crypto_info *dev = ctx->dev;
|
|
-
|
|
- ctx->mode = RK_CRYPTO_TDES_CHAINMODE_CBC | RK_CRYPTO_DEC;
|
|
- return rk_handle_req(dev, req);
|
|
-}
|
|
-
|
|
-static int rk_des3_ede_ecb_encrypt(struct ablkcipher_request *req)
|
|
-{
|
|
- struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
|
|
- struct rk_cipher_ctx *ctx = crypto_ablkcipher_ctx(tfm);
|
|
- struct rk_crypto_info *dev = ctx->dev;
|
|
-
|
|
- ctx->mode = RK_CRYPTO_TDES_SELECT;
|
|
- return rk_handle_req(dev, req);
|
|
-}
|
|
-
|
|
-static int rk_des3_ede_ecb_decrypt(struct ablkcipher_request *req)
|
|
-{
|
|
- struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
|
|
- struct rk_cipher_ctx *ctx = crypto_ablkcipher_ctx(tfm);
|
|
- struct rk_crypto_info *dev = ctx->dev;
|
|
-
|
|
- ctx->mode = RK_CRYPTO_TDES_SELECT | RK_CRYPTO_DEC;
|
|
- return rk_handle_req(dev, req);
|
|
-}
|
|
-
|
|
-static int rk_des3_ede_cbc_encrypt(struct ablkcipher_request *req)
|
|
-{
|
|
- struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
|
|
- struct rk_cipher_ctx *ctx = crypto_ablkcipher_ctx(tfm);
|
|
- struct rk_crypto_info *dev = ctx->dev;
|
|
-
|
|
- ctx->mode = RK_CRYPTO_TDES_SELECT | RK_CRYPTO_TDES_CHAINMODE_CBC;
|
|
- return rk_handle_req(dev, req);
|
|
-}
|
|
-
|
|
-static int rk_des3_ede_cbc_decrypt(struct ablkcipher_request *req)
|
|
-{
|
|
- struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
|
|
- struct rk_cipher_ctx *ctx = crypto_ablkcipher_ctx(tfm);
|
|
- struct rk_crypto_info *dev = ctx->dev;
|
|
-
|
|
- ctx->mode = RK_CRYPTO_TDES_SELECT | RK_CRYPTO_TDES_CHAINMODE_CBC |
|
|
- RK_CRYPTO_DEC;
|
|
- return rk_handle_req(dev, req);
|
|
-}
|
|
-
|
|
-static void rk_ablk_hw_init(struct rk_crypto_info *dev)
|
|
-{
|
|
- struct ablkcipher_request *req =
|
|
- ablkcipher_request_cast(dev->async_req);
|
|
- struct crypto_ablkcipher *cipher = crypto_ablkcipher_reqtfm(req);
|
|
- struct crypto_tfm *tfm = crypto_ablkcipher_tfm(cipher);
|
|
- struct rk_cipher_ctx *ctx = crypto_ablkcipher_ctx(cipher);
|
|
- u32 ivsize, block, conf_reg = 0;
|
|
-
|
|
- block = crypto_tfm_alg_blocksize(tfm);
|
|
- ivsize = crypto_ablkcipher_ivsize(cipher);
|
|
-
|
|
- if (block == DES_BLOCK_SIZE) {
|
|
- ctx->mode |= RK_CRYPTO_TDES_FIFO_MODE |
|
|
- RK_CRYPTO_TDES_BYTESWAP_KEY |
|
|
- RK_CRYPTO_TDES_BYTESWAP_IV;
|
|
- CRYPTO_WRITE(dev, RK_CRYPTO_TDES_CTRL, ctx->mode);
|
|
- memcpy_toio(dev->reg + RK_CRYPTO_TDES_IV_0, req->info, ivsize);
|
|
- conf_reg = RK_CRYPTO_DESSEL;
|
|
- } else {
|
|
- ctx->mode |= RK_CRYPTO_AES_FIFO_MODE |
|
|
- RK_CRYPTO_AES_KEY_CHANGE |
|
|
- RK_CRYPTO_AES_BYTESWAP_KEY |
|
|
- RK_CRYPTO_AES_BYTESWAP_IV;
|
|
- if (ctx->keylen == AES_KEYSIZE_192)
|
|
- ctx->mode |= RK_CRYPTO_AES_192BIT_key;
|
|
- else if (ctx->keylen == AES_KEYSIZE_256)
|
|
- ctx->mode |= RK_CRYPTO_AES_256BIT_key;
|
|
- CRYPTO_WRITE(dev, RK_CRYPTO_AES_CTRL, ctx->mode);
|
|
- memcpy_toio(dev->reg + RK_CRYPTO_AES_IV_0, req->info, ivsize);
|
|
- }
|
|
- conf_reg |= RK_CRYPTO_BYTESWAP_BTFIFO |
|
|
- RK_CRYPTO_BYTESWAP_BRFIFO;
|
|
- CRYPTO_WRITE(dev, RK_CRYPTO_CONF, conf_reg);
|
|
- CRYPTO_WRITE(dev, RK_CRYPTO_INTENA,
|
|
- RK_CRYPTO_BCDMA_ERR_ENA | RK_CRYPTO_BCDMA_DONE_ENA);
|
|
-}
|
|
-
|
|
-static void crypto_dma_start(struct rk_crypto_info *dev)
|
|
-{
|
|
- CRYPTO_WRITE(dev, RK_CRYPTO_BRDMAS, dev->addr_in);
|
|
- CRYPTO_WRITE(dev, RK_CRYPTO_BRDMAL, dev->count / 4);
|
|
- CRYPTO_WRITE(dev, RK_CRYPTO_BTDMAS, dev->addr_out);
|
|
- CRYPTO_WRITE(dev, RK_CRYPTO_CTRL, RK_CRYPTO_BLOCK_START |
|
|
- _SBF(RK_CRYPTO_BLOCK_START, 16));
|
|
-}
|
|
-
|
|
-static int rk_set_data_start(struct rk_crypto_info *dev)
|
|
-{
|
|
- int err;
|
|
- struct ablkcipher_request *req =
|
|
- ablkcipher_request_cast(dev->async_req);
|
|
- struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
|
|
- struct rk_cipher_ctx *ctx = crypto_ablkcipher_ctx(tfm);
|
|
- u32 ivsize = crypto_ablkcipher_ivsize(tfm);
|
|
- u8 *src_last_blk = page_address(sg_page(dev->sg_src)) +
|
|
- dev->sg_src->offset + dev->sg_src->length - ivsize;
|
|
-
|
|
- /* Store the iv that need to be updated in chain mode.
|
|
- * And update the IV buffer to contain the next IV for decryption mode.
|
|
- */
|
|
- if (ctx->mode & RK_CRYPTO_DEC) {
|
|
- memcpy(ctx->iv, src_last_blk, ivsize);
|
|
- sg_pcopy_to_buffer(dev->first, dev->src_nents, req->info,
|
|
- ivsize, dev->total - ivsize);
|
|
- }
|
|
-
|
|
- err = dev->load_data(dev, dev->sg_src, dev->sg_dst);
|
|
- if (!err)
|
|
- crypto_dma_start(dev);
|
|
- return err;
|
|
-}
|
|
-
|
|
-static int rk_ablk_start(struct rk_crypto_info *dev)
|
|
-{
|
|
- struct ablkcipher_request *req =
|
|
- ablkcipher_request_cast(dev->async_req);
|
|
- unsigned long flags;
|
|
- int err = 0;
|
|
-
|
|
- dev->left_bytes = req->nbytes;
|
|
- dev->total = req->nbytes;
|
|
- dev->sg_src = req->src;
|
|
- dev->first = req->src;
|
|
- dev->src_nents = sg_nents(req->src);
|
|
- dev->sg_dst = req->dst;
|
|
- dev->dst_nents = sg_nents(req->dst);
|
|
- dev->aligned = 1;
|
|
-
|
|
- spin_lock_irqsave(&dev->lock, flags);
|
|
- rk_ablk_hw_init(dev);
|
|
- err = rk_set_data_start(dev);
|
|
- spin_unlock_irqrestore(&dev->lock, flags);
|
|
- return err;
|
|
-}
|
|
-
|
|
-static void rk_iv_copyback(struct rk_crypto_info *dev)
|
|
-{
|
|
- struct ablkcipher_request *req =
|
|
- ablkcipher_request_cast(dev->async_req);
|
|
- struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
|
|
- struct rk_cipher_ctx *ctx = crypto_ablkcipher_ctx(tfm);
|
|
- u32 ivsize = crypto_ablkcipher_ivsize(tfm);
|
|
-
|
|
- /* Update the IV buffer to contain the next IV for encryption mode. */
|
|
- if (!(ctx->mode & RK_CRYPTO_DEC)) {
|
|
- if (dev->aligned) {
|
|
- memcpy(req->info, sg_virt(dev->sg_dst) +
|
|
- dev->sg_dst->length - ivsize, ivsize);
|
|
- } else {
|
|
- memcpy(req->info, dev->addr_vir +
|
|
- dev->count - ivsize, ivsize);
|
|
- }
|
|
- }
|
|
-}
|
|
-
|
|
-static void rk_update_iv(struct rk_crypto_info *dev)
|
|
-{
|
|
- struct ablkcipher_request *req =
|
|
- ablkcipher_request_cast(dev->async_req);
|
|
- struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
|
|
- struct rk_cipher_ctx *ctx = crypto_ablkcipher_ctx(tfm);
|
|
- u32 ivsize = crypto_ablkcipher_ivsize(tfm);
|
|
- u8 *new_iv = NULL;
|
|
-
|
|
- if (ctx->mode & RK_CRYPTO_DEC) {
|
|
- new_iv = ctx->iv;
|
|
- } else {
|
|
- new_iv = page_address(sg_page(dev->sg_dst)) +
|
|
- dev->sg_dst->offset + dev->sg_dst->length - ivsize;
|
|
- }
|
|
-
|
|
- if (ivsize == DES_BLOCK_SIZE)
|
|
- memcpy_toio(dev->reg + RK_CRYPTO_TDES_IV_0, new_iv, ivsize);
|
|
- else if (ivsize == AES_BLOCK_SIZE)
|
|
- memcpy_toio(dev->reg + RK_CRYPTO_AES_IV_0, new_iv, ivsize);
|
|
-}
|
|
-
|
|
-/* return:
|
|
- * true some err was occurred
|
|
- * fault no err, continue
|
|
- */
|
|
-static int rk_ablk_rx(struct rk_crypto_info *dev)
|
|
-{
|
|
- int err = 0;
|
|
- struct ablkcipher_request *req =
|
|
- ablkcipher_request_cast(dev->async_req);
|
|
-
|
|
- dev->unload_data(dev);
|
|
- if (!dev->aligned) {
|
|
- if (!sg_pcopy_from_buffer(req->dst, dev->dst_nents,
|
|
- dev->addr_vir, dev->count,
|
|
- dev->total - dev->left_bytes -
|
|
- dev->count)) {
|
|
- err = -EINVAL;
|
|
- goto out_rx;
|
|
- }
|
|
- }
|
|
- if (dev->left_bytes) {
|
|
- rk_update_iv(dev);
|
|
- if (dev->aligned) {
|
|
- if (sg_is_last(dev->sg_src)) {
|
|
- dev_err(dev->dev, "[%s:%d] Lack of data\n",
|
|
- __func__, __LINE__);
|
|
- err = -ENOMEM;
|
|
- goto out_rx;
|
|
- }
|
|
- dev->sg_src = sg_next(dev->sg_src);
|
|
- dev->sg_dst = sg_next(dev->sg_dst);
|
|
- }
|
|
- err = rk_set_data_start(dev);
|
|
- } else {
|
|
- rk_iv_copyback(dev);
|
|
- /* here show the calculation is over without any err */
|
|
- dev->complete(dev->async_req, 0);
|
|
- tasklet_schedule(&dev->queue_task);
|
|
- }
|
|
-out_rx:
|
|
- return err;
|
|
-}
|
|
-
|
|
-static int rk_ablk_cra_init(struct crypto_tfm *tfm)
|
|
-{
|
|
- struct rk_cipher_ctx *ctx = crypto_tfm_ctx(tfm);
|
|
- struct crypto_alg *alg = tfm->__crt_alg;
|
|
- struct rk_crypto_tmp *algt;
|
|
-
|
|
- algt = container_of(alg, struct rk_crypto_tmp, alg.crypto);
|
|
-
|
|
- ctx->dev = algt->dev;
|
|
- ctx->dev->align_size = crypto_tfm_alg_alignmask(tfm) + 1;
|
|
- ctx->dev->start = rk_ablk_start;
|
|
- ctx->dev->update = rk_ablk_rx;
|
|
- ctx->dev->complete = rk_crypto_complete;
|
|
- ctx->dev->addr_vir = (char *)__get_free_page(GFP_KERNEL);
|
|
-
|
|
- return ctx->dev->addr_vir ? ctx->dev->enable_clk(ctx->dev) : -ENOMEM;
|
|
-}
|
|
-
|
|
-static void rk_ablk_cra_exit(struct crypto_tfm *tfm)
|
|
-{
|
|
- struct rk_cipher_ctx *ctx = crypto_tfm_ctx(tfm);
|
|
-
|
|
- free_page((unsigned long)ctx->dev->addr_vir);
|
|
- ctx->dev->disable_clk(ctx->dev);
|
|
-}
|
|
-
|
|
-struct rk_crypto_tmp rk_ecb_aes_alg = {
|
|
- .type = ALG_TYPE_CIPHER,
|
|
- .alg.crypto = {
|
|
- .cra_name = "ecb(aes)",
|
|
- .cra_driver_name = "ecb-aes-rk",
|
|
- .cra_priority = 300,
|
|
- .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER |
|
|
- CRYPTO_ALG_ASYNC,
|
|
- .cra_blocksize = AES_BLOCK_SIZE,
|
|
- .cra_ctxsize = sizeof(struct rk_cipher_ctx),
|
|
- .cra_alignmask = 0x0f,
|
|
- .cra_type = &crypto_ablkcipher_type,
|
|
- .cra_module = THIS_MODULE,
|
|
- .cra_init = rk_ablk_cra_init,
|
|
- .cra_exit = rk_ablk_cra_exit,
|
|
- .cra_u.ablkcipher = {
|
|
- .min_keysize = AES_MIN_KEY_SIZE,
|
|
- .max_keysize = AES_MAX_KEY_SIZE,
|
|
- .setkey = rk_aes_setkey,
|
|
- .encrypt = rk_aes_ecb_encrypt,
|
|
- .decrypt = rk_aes_ecb_decrypt,
|
|
- }
|
|
- }
|
|
-};
|
|
-
|
|
-struct rk_crypto_tmp rk_cbc_aes_alg = {
|
|
- .type = ALG_TYPE_CIPHER,
|
|
- .alg.crypto = {
|
|
- .cra_name = "cbc(aes)",
|
|
- .cra_driver_name = "cbc-aes-rk",
|
|
- .cra_priority = 300,
|
|
- .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER |
|
|
- CRYPTO_ALG_ASYNC,
|
|
- .cra_blocksize = AES_BLOCK_SIZE,
|
|
- .cra_ctxsize = sizeof(struct rk_cipher_ctx),
|
|
- .cra_alignmask = 0x0f,
|
|
- .cra_type = &crypto_ablkcipher_type,
|
|
- .cra_module = THIS_MODULE,
|
|
- .cra_init = rk_ablk_cra_init,
|
|
- .cra_exit = rk_ablk_cra_exit,
|
|
- .cra_u.ablkcipher = {
|
|
- .min_keysize = AES_MIN_KEY_SIZE,
|
|
- .max_keysize = AES_MAX_KEY_SIZE,
|
|
- .ivsize = AES_BLOCK_SIZE,
|
|
- .setkey = rk_aes_setkey,
|
|
- .encrypt = rk_aes_cbc_encrypt,
|
|
- .decrypt = rk_aes_cbc_decrypt,
|
|
- }
|
|
- }
|
|
-};
|
|
-
|
|
-struct rk_crypto_tmp rk_ecb_des_alg = {
|
|
- .type = ALG_TYPE_CIPHER,
|
|
- .alg.crypto = {
|
|
- .cra_name = "ecb(des)",
|
|
- .cra_driver_name = "ecb-des-rk",
|
|
- .cra_priority = 300,
|
|
- .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER |
|
|
- CRYPTO_ALG_ASYNC,
|
|
- .cra_blocksize = DES_BLOCK_SIZE,
|
|
- .cra_ctxsize = sizeof(struct rk_cipher_ctx),
|
|
- .cra_alignmask = 0x07,
|
|
- .cra_type = &crypto_ablkcipher_type,
|
|
- .cra_module = THIS_MODULE,
|
|
- .cra_init = rk_ablk_cra_init,
|
|
- .cra_exit = rk_ablk_cra_exit,
|
|
- .cra_u.ablkcipher = {
|
|
- .min_keysize = DES_KEY_SIZE,
|
|
- .max_keysize = DES_KEY_SIZE,
|
|
- .setkey = rk_des_setkey,
|
|
- .encrypt = rk_des_ecb_encrypt,
|
|
- .decrypt = rk_des_ecb_decrypt,
|
|
- }
|
|
- }
|
|
-};
|
|
-
|
|
-struct rk_crypto_tmp rk_cbc_des_alg = {
|
|
- .type = ALG_TYPE_CIPHER,
|
|
- .alg.crypto = {
|
|
- .cra_name = "cbc(des)",
|
|
- .cra_driver_name = "cbc-des-rk",
|
|
- .cra_priority = 300,
|
|
- .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER |
|
|
- CRYPTO_ALG_ASYNC,
|
|
- .cra_blocksize = DES_BLOCK_SIZE,
|
|
- .cra_ctxsize = sizeof(struct rk_cipher_ctx),
|
|
- .cra_alignmask = 0x07,
|
|
- .cra_type = &crypto_ablkcipher_type,
|
|
- .cra_module = THIS_MODULE,
|
|
- .cra_init = rk_ablk_cra_init,
|
|
- .cra_exit = rk_ablk_cra_exit,
|
|
- .cra_u.ablkcipher = {
|
|
- .min_keysize = DES_KEY_SIZE,
|
|
- .max_keysize = DES_KEY_SIZE,
|
|
- .ivsize = DES_BLOCK_SIZE,
|
|
- .setkey = rk_des_setkey,
|
|
- .encrypt = rk_des_cbc_encrypt,
|
|
- .decrypt = rk_des_cbc_decrypt,
|
|
- }
|
|
- }
|
|
-};
|
|
-
|
|
-struct rk_crypto_tmp rk_ecb_des3_ede_alg = {
|
|
- .type = ALG_TYPE_CIPHER,
|
|
- .alg.crypto = {
|
|
- .cra_name = "ecb(des3_ede)",
|
|
- .cra_driver_name = "ecb-des3-ede-rk",
|
|
- .cra_priority = 300,
|
|
- .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER |
|
|
- CRYPTO_ALG_ASYNC,
|
|
- .cra_blocksize = DES_BLOCK_SIZE,
|
|
- .cra_ctxsize = sizeof(struct rk_cipher_ctx),
|
|
- .cra_alignmask = 0x07,
|
|
- .cra_type = &crypto_ablkcipher_type,
|
|
- .cra_module = THIS_MODULE,
|
|
- .cra_init = rk_ablk_cra_init,
|
|
- .cra_exit = rk_ablk_cra_exit,
|
|
- .cra_u.ablkcipher = {
|
|
- .min_keysize = DES3_EDE_KEY_SIZE,
|
|
- .max_keysize = DES3_EDE_KEY_SIZE,
|
|
- .ivsize = DES_BLOCK_SIZE,
|
|
- .setkey = rk_tdes_setkey,
|
|
- .encrypt = rk_des3_ede_ecb_encrypt,
|
|
- .decrypt = rk_des3_ede_ecb_decrypt,
|
|
- }
|
|
- }
|
|
-};
|
|
-
|
|
-struct rk_crypto_tmp rk_cbc_des3_ede_alg = {
|
|
- .type = ALG_TYPE_CIPHER,
|
|
- .alg.crypto = {
|
|
- .cra_name = "cbc(des3_ede)",
|
|
- .cra_driver_name = "cbc-des3-ede-rk",
|
|
- .cra_priority = 300,
|
|
- .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER |
|
|
- CRYPTO_ALG_ASYNC,
|
|
- .cra_blocksize = DES_BLOCK_SIZE,
|
|
- .cra_ctxsize = sizeof(struct rk_cipher_ctx),
|
|
- .cra_alignmask = 0x07,
|
|
- .cra_type = &crypto_ablkcipher_type,
|
|
- .cra_module = THIS_MODULE,
|
|
- .cra_init = rk_ablk_cra_init,
|
|
- .cra_exit = rk_ablk_cra_exit,
|
|
- .cra_u.ablkcipher = {
|
|
- .min_keysize = DES3_EDE_KEY_SIZE,
|
|
- .max_keysize = DES3_EDE_KEY_SIZE,
|
|
- .ivsize = DES_BLOCK_SIZE,
|
|
- .setkey = rk_tdes_setkey,
|
|
- .encrypt = rk_des3_ede_cbc_encrypt,
|
|
- .decrypt = rk_des3_ede_cbc_decrypt,
|
|
- }
|
|
- }
|
|
-};
|
|
diff --git a/drivers/crypto/rockchip/rk3288_crypto_skcipher.c b/drivers/crypto/rockchip/rk3288_crypto_skcipher.c
|
|
new file mode 100644
|
|
index 000000000000..ca4de4ddfe1f
|
|
--- /dev/null
|
|
+++ b/drivers/crypto/rockchip/rk3288_crypto_skcipher.c
|
|
@@ -0,0 +1,538 @@
|
|
+// SPDX-License-Identifier: GPL-2.0-only
|
|
+/*
|
|
+ * Crypto acceleration support for Rockchip RK3288
|
|
+ *
|
|
+ * Copyright (c) 2015, Fuzhou Rockchip Electronics Co., Ltd
|
|
+ *
|
|
+ * Author: Zain Wang <zain.wang@rock-chips.com>
|
|
+ *
|
|
+ * Some ideas are from marvell-cesa.c and s5p-sss.c driver.
|
|
+ */
|
|
+#include "rk3288_crypto.h"
|
|
+
|
|
+#define RK_CRYPTO_DEC BIT(0)
|
|
+
|
|
+static void rk_crypto_complete(struct crypto_async_request *base, int err)
|
|
+{
|
|
+ if (base->complete)
|
|
+ base->complete(base, err);
|
|
+}
|
|
+
|
|
+static int rk_handle_req(struct rk_crypto_info *dev,
|
|
+ struct skcipher_request *req)
|
|
+{
|
|
+ if (!IS_ALIGNED(req->cryptlen, dev->align_size))
|
|
+ return -EINVAL;
|
|
+ else
|
|
+ return dev->enqueue(dev, &req->base);
|
|
+}
|
|
+
|
|
+static int rk_aes_setkey(struct crypto_skcipher *cipher,
|
|
+ const u8 *key, unsigned int keylen)
|
|
+{
|
|
+ struct crypto_tfm *tfm = crypto_skcipher_tfm(cipher);
|
|
+ struct rk_cipher_ctx *ctx = crypto_tfm_ctx(tfm);
|
|
+
|
|
+ if (keylen != AES_KEYSIZE_128 && keylen != AES_KEYSIZE_192 &&
|
|
+ keylen != AES_KEYSIZE_256) {
|
|
+ crypto_skcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
|
+ return -EINVAL;
|
|
+ }
|
|
+ ctx->keylen = keylen;
|
|
+ memcpy_toio(ctx->dev->reg + RK_CRYPTO_AES_KEY_0, key, keylen);
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+static int rk_des_setkey(struct crypto_skcipher *cipher,
|
|
+ const u8 *key, unsigned int keylen)
|
|
+{
|
|
+ struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(cipher);
|
|
+ int err;
|
|
+
|
|
+ err = verify_skcipher_des_key(cipher, key);
|
|
+ if (err)
|
|
+ return err;
|
|
+
|
|
+ ctx->keylen = keylen;
|
|
+ memcpy_toio(ctx->dev->reg + RK_CRYPTO_TDES_KEY1_0, key, keylen);
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+static int rk_tdes_setkey(struct crypto_skcipher *cipher,
|
|
+ const u8 *key, unsigned int keylen)
|
|
+{
|
|
+ struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(cipher);
|
|
+ int err;
|
|
+
|
|
+ err = verify_skcipher_des3_key(cipher, key);
|
|
+ if (err)
|
|
+ return err;
|
|
+
|
|
+ ctx->keylen = keylen;
|
|
+ memcpy_toio(ctx->dev->reg + RK_CRYPTO_TDES_KEY1_0, key, keylen);
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+static int rk_aes_ecb_encrypt(struct skcipher_request *req)
|
|
+{
|
|
+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
|
+ struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(tfm);
|
|
+ struct rk_crypto_info *dev = ctx->dev;
|
|
+
|
|
+ ctx->mode = RK_CRYPTO_AES_ECB_MODE;
|
|
+ return rk_handle_req(dev, req);
|
|
+}
|
|
+
|
|
+static int rk_aes_ecb_decrypt(struct skcipher_request *req)
|
|
+{
|
|
+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
|
+ struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(tfm);
|
|
+ struct rk_crypto_info *dev = ctx->dev;
|
|
+
|
|
+ ctx->mode = RK_CRYPTO_AES_ECB_MODE | RK_CRYPTO_DEC;
|
|
+ return rk_handle_req(dev, req);
|
|
+}
|
|
+
|
|
+static int rk_aes_cbc_encrypt(struct skcipher_request *req)
|
|
+{
|
|
+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
|
+ struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(tfm);
|
|
+ struct rk_crypto_info *dev = ctx->dev;
|
|
+
|
|
+ ctx->mode = RK_CRYPTO_AES_CBC_MODE;
|
|
+ return rk_handle_req(dev, req);
|
|
+}
|
|
+
|
|
+static int rk_aes_cbc_decrypt(struct skcipher_request *req)
|
|
+{
|
|
+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
|
+ struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(tfm);
|
|
+ struct rk_crypto_info *dev = ctx->dev;
|
|
+
|
|
+ ctx->mode = RK_CRYPTO_AES_CBC_MODE | RK_CRYPTO_DEC;
|
|
+ return rk_handle_req(dev, req);
|
|
+}
|
|
+
|
|
+static int rk_des_ecb_encrypt(struct skcipher_request *req)
|
|
+{
|
|
+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
|
+ struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(tfm);
|
|
+ struct rk_crypto_info *dev = ctx->dev;
|
|
+
|
|
+ ctx->mode = 0;
|
|
+ return rk_handle_req(dev, req);
|
|
+}
|
|
+
|
|
+static int rk_des_ecb_decrypt(struct skcipher_request *req)
|
|
+{
|
|
+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
|
+ struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(tfm);
|
|
+ struct rk_crypto_info *dev = ctx->dev;
|
|
+
|
|
+ ctx->mode = RK_CRYPTO_DEC;
|
|
+ return rk_handle_req(dev, req);
|
|
+}
|
|
+
|
|
+static int rk_des_cbc_encrypt(struct skcipher_request *req)
|
|
+{
|
|
+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
|
+ struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(tfm);
|
|
+ struct rk_crypto_info *dev = ctx->dev;
|
|
+
|
|
+ ctx->mode = RK_CRYPTO_TDES_CHAINMODE_CBC;
|
|
+ return rk_handle_req(dev, req);
|
|
+}
|
|
+
|
|
+static int rk_des_cbc_decrypt(struct skcipher_request *req)
|
|
+{
|
|
+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
|
+ struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(tfm);
|
|
+ struct rk_crypto_info *dev = ctx->dev;
|
|
+
|
|
+ ctx->mode = RK_CRYPTO_TDES_CHAINMODE_CBC | RK_CRYPTO_DEC;
|
|
+ return rk_handle_req(dev, req);
|
|
+}
|
|
+
|
|
+static int rk_des3_ede_ecb_encrypt(struct skcipher_request *req)
|
|
+{
|
|
+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
|
+ struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(tfm);
|
|
+ struct rk_crypto_info *dev = ctx->dev;
|
|
+
|
|
+ ctx->mode = RK_CRYPTO_TDES_SELECT;
|
|
+ return rk_handle_req(dev, req);
|
|
+}
|
|
+
|
|
+static int rk_des3_ede_ecb_decrypt(struct skcipher_request *req)
|
|
+{
|
|
+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
|
+ struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(tfm);
|
|
+ struct rk_crypto_info *dev = ctx->dev;
|
|
+
|
|
+ ctx->mode = RK_CRYPTO_TDES_SELECT | RK_CRYPTO_DEC;
|
|
+ return rk_handle_req(dev, req);
|
|
+}
|
|
+
|
|
+static int rk_des3_ede_cbc_encrypt(struct skcipher_request *req)
|
|
+{
|
|
+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
|
+ struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(tfm);
|
|
+ struct rk_crypto_info *dev = ctx->dev;
|
|
+
|
|
+ ctx->mode = RK_CRYPTO_TDES_SELECT | RK_CRYPTO_TDES_CHAINMODE_CBC;
|
|
+ return rk_handle_req(dev, req);
|
|
+}
|
|
+
|
|
+static int rk_des3_ede_cbc_decrypt(struct skcipher_request *req)
|
|
+{
|
|
+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
|
+ struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(tfm);
|
|
+ struct rk_crypto_info *dev = ctx->dev;
|
|
+
|
|
+ ctx->mode = RK_CRYPTO_TDES_SELECT | RK_CRYPTO_TDES_CHAINMODE_CBC |
|
|
+ RK_CRYPTO_DEC;
|
|
+ return rk_handle_req(dev, req);
|
|
+}
|
|
+
|
|
+static void rk_ablk_hw_init(struct rk_crypto_info *dev)
|
|
+{
|
|
+ struct skcipher_request *req =
|
|
+ skcipher_request_cast(dev->async_req);
|
|
+ struct crypto_skcipher *cipher = crypto_skcipher_reqtfm(req);
|
|
+ struct crypto_tfm *tfm = crypto_skcipher_tfm(cipher);
|
|
+ struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(cipher);
|
|
+ u32 ivsize, block, conf_reg = 0;
|
|
+
|
|
+ block = crypto_tfm_alg_blocksize(tfm);
|
|
+ ivsize = crypto_skcipher_ivsize(cipher);
|
|
+
|
|
+ if (block == DES_BLOCK_SIZE) {
|
|
+ ctx->mode |= RK_CRYPTO_TDES_FIFO_MODE |
|
|
+ RK_CRYPTO_TDES_BYTESWAP_KEY |
|
|
+ RK_CRYPTO_TDES_BYTESWAP_IV;
|
|
+ CRYPTO_WRITE(dev, RK_CRYPTO_TDES_CTRL, ctx->mode);
|
|
+ memcpy_toio(dev->reg + RK_CRYPTO_TDES_IV_0, req->iv, ivsize);
|
|
+ conf_reg = RK_CRYPTO_DESSEL;
|
|
+ } else {
|
|
+ ctx->mode |= RK_CRYPTO_AES_FIFO_MODE |
|
|
+ RK_CRYPTO_AES_KEY_CHANGE |
|
|
+ RK_CRYPTO_AES_BYTESWAP_KEY |
|
|
+ RK_CRYPTO_AES_BYTESWAP_IV;
|
|
+ if (ctx->keylen == AES_KEYSIZE_192)
|
|
+ ctx->mode |= RK_CRYPTO_AES_192BIT_key;
|
|
+ else if (ctx->keylen == AES_KEYSIZE_256)
|
|
+ ctx->mode |= RK_CRYPTO_AES_256BIT_key;
|
|
+ CRYPTO_WRITE(dev, RK_CRYPTO_AES_CTRL, ctx->mode);
|
|
+ memcpy_toio(dev->reg + RK_CRYPTO_AES_IV_0, req->iv, ivsize);
|
|
+ }
|
|
+ conf_reg |= RK_CRYPTO_BYTESWAP_BTFIFO |
|
|
+ RK_CRYPTO_BYTESWAP_BRFIFO;
|
|
+ CRYPTO_WRITE(dev, RK_CRYPTO_CONF, conf_reg);
|
|
+ CRYPTO_WRITE(dev, RK_CRYPTO_INTENA,
|
|
+ RK_CRYPTO_BCDMA_ERR_ENA | RK_CRYPTO_BCDMA_DONE_ENA);
|
|
+}
|
|
+
|
|
+static void crypto_dma_start(struct rk_crypto_info *dev)
|
|
+{
|
|
+ CRYPTO_WRITE(dev, RK_CRYPTO_BRDMAS, dev->addr_in);
|
|
+ CRYPTO_WRITE(dev, RK_CRYPTO_BRDMAL, dev->count / 4);
|
|
+ CRYPTO_WRITE(dev, RK_CRYPTO_BTDMAS, dev->addr_out);
|
|
+ CRYPTO_WRITE(dev, RK_CRYPTO_CTRL, RK_CRYPTO_BLOCK_START |
|
|
+ _SBF(RK_CRYPTO_BLOCK_START, 16));
|
|
+}
|
|
+
|
|
+static int rk_set_data_start(struct rk_crypto_info *dev)
|
|
+{
|
|
+ int err;
|
|
+ struct skcipher_request *req =
|
|
+ skcipher_request_cast(dev->async_req);
|
|
+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
|
+ struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(tfm);
|
|
+ u32 ivsize = crypto_skcipher_ivsize(tfm);
|
|
+ u8 *src_last_blk = page_address(sg_page(dev->sg_src)) +
|
|
+ dev->sg_src->offset + dev->sg_src->length - ivsize;
|
|
+
|
|
+ /* Store the iv that need to be updated in chain mode.
|
|
+ * And update the IV buffer to contain the next IV for decryption mode.
|
|
+ */
|
|
+ if (ctx->mode & RK_CRYPTO_DEC) {
|
|
+ memcpy(ctx->iv, src_last_blk, ivsize);
|
|
+ sg_pcopy_to_buffer(dev->first, dev->src_nents, req->iv,
|
|
+ ivsize, dev->total - ivsize);
|
|
+ }
|
|
+
|
|
+ err = dev->load_data(dev, dev->sg_src, dev->sg_dst);
|
|
+ if (!err)
|
|
+ crypto_dma_start(dev);
|
|
+ return err;
|
|
+}
|
|
+
|
|
+static int rk_ablk_start(struct rk_crypto_info *dev)
|
|
+{
|
|
+ struct skcipher_request *req =
|
|
+ skcipher_request_cast(dev->async_req);
|
|
+ unsigned long flags;
|
|
+ int err = 0;
|
|
+
|
|
+ dev->left_bytes = req->cryptlen;
|
|
+ dev->total = req->cryptlen;
|
|
+ dev->sg_src = req->src;
|
|
+ dev->first = req->src;
|
|
+ dev->src_nents = sg_nents(req->src);
|
|
+ dev->sg_dst = req->dst;
|
|
+ dev->dst_nents = sg_nents(req->dst);
|
|
+ dev->aligned = 1;
|
|
+
|
|
+ spin_lock_irqsave(&dev->lock, flags);
|
|
+ rk_ablk_hw_init(dev);
|
|
+ err = rk_set_data_start(dev);
|
|
+ spin_unlock_irqrestore(&dev->lock, flags);
|
|
+ return err;
|
|
+}
|
|
+
|
|
+static void rk_iv_copyback(struct rk_crypto_info *dev)
|
|
+{
|
|
+ struct skcipher_request *req =
|
|
+ skcipher_request_cast(dev->async_req);
|
|
+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
|
+ struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(tfm);
|
|
+ u32 ivsize = crypto_skcipher_ivsize(tfm);
|
|
+
|
|
+ /* Update the IV buffer to contain the next IV for encryption mode. */
|
|
+ if (!(ctx->mode & RK_CRYPTO_DEC)) {
|
|
+ if (dev->aligned) {
|
|
+ memcpy(req->iv, sg_virt(dev->sg_dst) +
|
|
+ dev->sg_dst->length - ivsize, ivsize);
|
|
+ } else {
|
|
+ memcpy(req->iv, dev->addr_vir +
|
|
+ dev->count - ivsize, ivsize);
|
|
+ }
|
|
+ }
|
|
+}
|
|
+
|
|
+static void rk_update_iv(struct rk_crypto_info *dev)
|
|
+{
|
|
+ struct skcipher_request *req =
|
|
+ skcipher_request_cast(dev->async_req);
|
|
+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
|
+ struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(tfm);
|
|
+ u32 ivsize = crypto_skcipher_ivsize(tfm);
|
|
+ u8 *new_iv = NULL;
|
|
+
|
|
+ if (ctx->mode & RK_CRYPTO_DEC) {
|
|
+ new_iv = ctx->iv;
|
|
+ } else {
|
|
+ new_iv = page_address(sg_page(dev->sg_dst)) +
|
|
+ dev->sg_dst->offset + dev->sg_dst->length - ivsize;
|
|
+ }
|
|
+
|
|
+ if (ivsize == DES_BLOCK_SIZE)
|
|
+ memcpy_toio(dev->reg + RK_CRYPTO_TDES_IV_0, new_iv, ivsize);
|
|
+ else if (ivsize == AES_BLOCK_SIZE)
|
|
+ memcpy_toio(dev->reg + RK_CRYPTO_AES_IV_0, new_iv, ivsize);
|
|
+}
|
|
+
|
|
+/* return:
|
|
+ * true some err was occurred
|
|
+ * fault no err, continue
|
|
+ */
|
|
+static int rk_ablk_rx(struct rk_crypto_info *dev)
|
|
+{
|
|
+ int err = 0;
|
|
+ struct skcipher_request *req =
|
|
+ skcipher_request_cast(dev->async_req);
|
|
+
|
|
+ dev->unload_data(dev);
|
|
+ if (!dev->aligned) {
|
|
+ if (!sg_pcopy_from_buffer(req->dst, dev->dst_nents,
|
|
+ dev->addr_vir, dev->count,
|
|
+ dev->total - dev->left_bytes -
|
|
+ dev->count)) {
|
|
+ err = -EINVAL;
|
|
+ goto out_rx;
|
|
+ }
|
|
+ }
|
|
+ if (dev->left_bytes) {
|
|
+ rk_update_iv(dev);
|
|
+ if (dev->aligned) {
|
|
+ if (sg_is_last(dev->sg_src)) {
|
|
+ dev_err(dev->dev, "[%s:%d] Lack of data\n",
|
|
+ __func__, __LINE__);
|
|
+ err = -ENOMEM;
|
|
+ goto out_rx;
|
|
+ }
|
|
+ dev->sg_src = sg_next(dev->sg_src);
|
|
+ dev->sg_dst = sg_next(dev->sg_dst);
|
|
+ }
|
|
+ err = rk_set_data_start(dev);
|
|
+ } else {
|
|
+ rk_iv_copyback(dev);
|
|
+ /* here show the calculation is over without any err */
|
|
+ dev->complete(dev->async_req, 0);
|
|
+ tasklet_schedule(&dev->queue_task);
|
|
+ }
|
|
+out_rx:
|
|
+ return err;
|
|
+}
|
|
+
|
|
+static int rk_ablk_init_tfm(struct crypto_skcipher *tfm)
|
|
+{
|
|
+ struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(tfm);
|
|
+ struct skcipher_alg *alg = crypto_skcipher_alg(tfm);
|
|
+ struct rk_crypto_tmp *algt;
|
|
+
|
|
+ algt = container_of(alg, struct rk_crypto_tmp, alg.skcipher);
|
|
+
|
|
+ ctx->dev = algt->dev;
|
|
+ ctx->dev->align_size = crypto_tfm_alg_alignmask(crypto_skcipher_tfm(tfm)) + 1;
|
|
+ ctx->dev->start = rk_ablk_start;
|
|
+ ctx->dev->update = rk_ablk_rx;
|
|
+ ctx->dev->complete = rk_crypto_complete;
|
|
+ ctx->dev->addr_vir = (char *)__get_free_page(GFP_KERNEL);
|
|
+
|
|
+ return ctx->dev->addr_vir ? ctx->dev->enable_clk(ctx->dev) : -ENOMEM;
|
|
+}
|
|
+
|
|
+static void rk_ablk_exit_tfm(struct crypto_skcipher *tfm)
|
|
+{
|
|
+ struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(tfm);
|
|
+
|
|
+ free_page((unsigned long)ctx->dev->addr_vir);
|
|
+ ctx->dev->disable_clk(ctx->dev);
|
|
+}
|
|
+
|
|
+struct rk_crypto_tmp rk_ecb_aes_alg = {
|
|
+ .type = ALG_TYPE_CIPHER,
|
|
+ .alg.skcipher = {
|
|
+ .base.cra_name = "ecb(aes)",
|
|
+ .base.cra_driver_name = "ecb-aes-rk",
|
|
+ .base.cra_priority = 300,
|
|
+ .base.cra_flags = CRYPTO_ALG_ASYNC,
|
|
+ .base.cra_blocksize = AES_BLOCK_SIZE,
|
|
+ .base.cra_ctxsize = sizeof(struct rk_cipher_ctx),
|
|
+ .base.cra_alignmask = 0x0f,
|
|
+ .base.cra_module = THIS_MODULE,
|
|
+
|
|
+ .init = rk_ablk_init_tfm,
|
|
+ .exit = rk_ablk_exit_tfm,
|
|
+ .min_keysize = AES_MIN_KEY_SIZE,
|
|
+ .max_keysize = AES_MAX_KEY_SIZE,
|
|
+ .setkey = rk_aes_setkey,
|
|
+ .encrypt = rk_aes_ecb_encrypt,
|
|
+ .decrypt = rk_aes_ecb_decrypt,
|
|
+ }
|
|
+};
|
|
+
|
|
+struct rk_crypto_tmp rk_cbc_aes_alg = {
|
|
+ .type = ALG_TYPE_CIPHER,
|
|
+ .alg.skcipher = {
|
|
+ .base.cra_name = "cbc(aes)",
|
|
+ .base.cra_driver_name = "cbc-aes-rk",
|
|
+ .base.cra_priority = 300,
|
|
+ .base.cra_flags = CRYPTO_ALG_ASYNC,
|
|
+ .base.cra_blocksize = AES_BLOCK_SIZE,
|
|
+ .base.cra_ctxsize = sizeof(struct rk_cipher_ctx),
|
|
+ .base.cra_alignmask = 0x0f,
|
|
+ .base.cra_module = THIS_MODULE,
|
|
+
|
|
+ .init = rk_ablk_init_tfm,
|
|
+ .exit = rk_ablk_exit_tfm,
|
|
+ .min_keysize = AES_MIN_KEY_SIZE,
|
|
+ .max_keysize = AES_MAX_KEY_SIZE,
|
|
+ .ivsize = AES_BLOCK_SIZE,
|
|
+ .setkey = rk_aes_setkey,
|
|
+ .encrypt = rk_aes_cbc_encrypt,
|
|
+ .decrypt = rk_aes_cbc_decrypt,
|
|
+ }
|
|
+};
|
|
+
|
|
+struct rk_crypto_tmp rk_ecb_des_alg = {
|
|
+ .type = ALG_TYPE_CIPHER,
|
|
+ .alg.skcipher = {
|
|
+ .base.cra_name = "ecb(des)",
|
|
+ .base.cra_driver_name = "ecb-des-rk",
|
|
+ .base.cra_priority = 300,
|
|
+ .base.cra_flags = CRYPTO_ALG_ASYNC,
|
|
+ .base.cra_blocksize = DES_BLOCK_SIZE,
|
|
+ .base.cra_ctxsize = sizeof(struct rk_cipher_ctx),
|
|
+ .base.cra_alignmask = 0x07,
|
|
+ .base.cra_module = THIS_MODULE,
|
|
+
|
|
+ .init = rk_ablk_init_tfm,
|
|
+ .exit = rk_ablk_exit_tfm,
|
|
+ .min_keysize = DES_KEY_SIZE,
|
|
+ .max_keysize = DES_KEY_SIZE,
|
|
+ .setkey = rk_des_setkey,
|
|
+ .encrypt = rk_des_ecb_encrypt,
|
|
+ .decrypt = rk_des_ecb_decrypt,
|
|
+ }
|
|
+};
|
|
+
|
|
+struct rk_crypto_tmp rk_cbc_des_alg = {
|
|
+ .type = ALG_TYPE_CIPHER,
|
|
+ .alg.skcipher = {
|
|
+ .base.cra_name = "cbc(des)",
|
|
+ .base.cra_driver_name = "cbc-des-rk",
|
|
+ .base.cra_priority = 300,
|
|
+ .base.cra_flags = CRYPTO_ALG_ASYNC,
|
|
+ .base.cra_blocksize = DES_BLOCK_SIZE,
|
|
+ .base.cra_ctxsize = sizeof(struct rk_cipher_ctx),
|
|
+ .base.cra_alignmask = 0x07,
|
|
+ .base.cra_module = THIS_MODULE,
|
|
+
|
|
+ .init = rk_ablk_init_tfm,
|
|
+ .exit = rk_ablk_exit_tfm,
|
|
+ .min_keysize = DES_KEY_SIZE,
|
|
+ .max_keysize = DES_KEY_SIZE,
|
|
+ .ivsize = DES_BLOCK_SIZE,
|
|
+ .setkey = rk_des_setkey,
|
|
+ .encrypt = rk_des_cbc_encrypt,
|
|
+ .decrypt = rk_des_cbc_decrypt,
|
|
+ }
|
|
+};
|
|
+
|
|
+struct rk_crypto_tmp rk_ecb_des3_ede_alg = {
|
|
+ .type = ALG_TYPE_CIPHER,
|
|
+ .alg.skcipher = {
|
|
+ .base.cra_name = "ecb(des3_ede)",
|
|
+ .base.cra_driver_name = "ecb-des3-ede-rk",
|
|
+ .base.cra_priority = 300,
|
|
+ .base.cra_flags = CRYPTO_ALG_ASYNC,
|
|
+ .base.cra_blocksize = DES_BLOCK_SIZE,
|
|
+ .base.cra_ctxsize = sizeof(struct rk_cipher_ctx),
|
|
+ .base.cra_alignmask = 0x07,
|
|
+ .base.cra_module = THIS_MODULE,
|
|
+
|
|
+ .init = rk_ablk_init_tfm,
|
|
+ .exit = rk_ablk_exit_tfm,
|
|
+ .min_keysize = DES3_EDE_KEY_SIZE,
|
|
+ .max_keysize = DES3_EDE_KEY_SIZE,
|
|
+ .ivsize = DES_BLOCK_SIZE,
|
|
+ .setkey = rk_tdes_setkey,
|
|
+ .encrypt = rk_des3_ede_ecb_encrypt,
|
|
+ .decrypt = rk_des3_ede_ecb_decrypt,
|
|
+ }
|
|
+};
|
|
+
|
|
+struct rk_crypto_tmp rk_cbc_des3_ede_alg = {
|
|
+ .type = ALG_TYPE_CIPHER,
|
|
+ .alg.skcipher = {
|
|
+ .base.cra_name = "cbc(des3_ede)",
|
|
+ .base.cra_driver_name = "cbc-des3-ede-rk",
|
|
+ .base.cra_priority = 300,
|
|
+ .base.cra_flags = CRYPTO_ALG_ASYNC,
|
|
+ .base.cra_blocksize = DES_BLOCK_SIZE,
|
|
+ .base.cra_ctxsize = sizeof(struct rk_cipher_ctx),
|
|
+ .base.cra_alignmask = 0x07,
|
|
+ .base.cra_module = THIS_MODULE,
|
|
+
|
|
+ .init = rk_ablk_init_tfm,
|
|
+ .exit = rk_ablk_exit_tfm,
|
|
+ .min_keysize = DES3_EDE_KEY_SIZE,
|
|
+ .max_keysize = DES3_EDE_KEY_SIZE,
|
|
+ .ivsize = DES_BLOCK_SIZE,
|
|
+ .setkey = rk_tdes_setkey,
|
|
+ .encrypt = rk_des3_ede_cbc_encrypt,
|
|
+ .decrypt = rk_des3_ede_cbc_decrypt,
|
|
+ }
|
|
+};
|
|
|
|
From bbb54eff59ec94a079999deed1e3c8521b043cc5 Mon Sep 17 00:00:00 2001
|
|
From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
|
|
Date: Thu, 22 Aug 2019 02:55:02 +0300
|
|
Subject: [PATCH] drm/bridge: Fix references to drm_bridge_funcs in
|
|
documentation
|
|
|
|
The documentation for most of the bridge atomic operations incorrectly
|
|
reference the non-atomic version when stating the operations are
|
|
optional. Fix them, and make sure that all references to bridge
|
|
operations are correctly marked with @.
|
|
|
|
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
|
|
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/20190821235502.15475-1-laurent.pinchart+renesas@ideasonboard.com
|
|
(cherry picked from commit fe9e557dfb485c8f875288537e919d946fbc368a)
|
|
---
|
|
include/drm/drm_bridge.h | 22 +++++++++++-----------
|
|
1 file changed, 11 insertions(+), 11 deletions(-)
|
|
|
|
diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
|
|
index 7616f6562fe4..6d76c67fb819 100644
|
|
--- a/include/drm/drm_bridge.h
|
|
+++ b/include/drm/drm_bridge.h
|
|
@@ -42,7 +42,7 @@ struct drm_bridge_funcs {
|
|
* This callback is invoked whenever our bridge is being attached to a
|
|
* &drm_encoder.
|
|
*
|
|
- * The attach callback is optional.
|
|
+ * The @attach callback is optional.
|
|
*
|
|
* RETURNS:
|
|
*
|
|
@@ -56,7 +56,7 @@ struct drm_bridge_funcs {
|
|
* This callback is invoked whenever our bridge is being detached from a
|
|
* &drm_encoder.
|
|
*
|
|
- * The detach callback is optional.
|
|
+ * The @detach callback is optional.
|
|
*/
|
|
void (*detach)(struct drm_bridge *bridge);
|
|
|
|
@@ -76,7 +76,7 @@ struct drm_bridge_funcs {
|
|
* atomic helpers to validate modes supplied by userspace in
|
|
* drm_atomic_helper_check_modeset().
|
|
*
|
|
- * This function is optional.
|
|
+ * The @mode_valid callback is optional.
|
|
*
|
|
* NOTE:
|
|
*
|
|
@@ -108,7 +108,7 @@ struct drm_bridge_funcs {
|
|
* this function passes all other callbacks must succeed for this
|
|
* configuration.
|
|
*
|
|
- * The mode_fixup callback is optional.
|
|
+ * The @mode_fixup callback is optional.
|
|
*
|
|
* NOTE:
|
|
*
|
|
@@ -146,7 +146,7 @@ struct drm_bridge_funcs {
|
|
* The bridge can assume that the display pipe (i.e. clocks and timing
|
|
* signals) feeding it is still running when this callback is called.
|
|
*
|
|
- * The disable callback is optional.
|
|
+ * The @disable callback is optional.
|
|
*/
|
|
void (*disable)(struct drm_bridge *bridge);
|
|
|
|
@@ -165,7 +165,7 @@ struct drm_bridge_funcs {
|
|
* singals) feeding it is no longer running when this callback is
|
|
* called.
|
|
*
|
|
- * The post_disable callback is optional.
|
|
+ * The @post_disable callback is optional.
|
|
*/
|
|
void (*post_disable)(struct drm_bridge *bridge);
|
|
|
|
@@ -214,7 +214,7 @@ struct drm_bridge_funcs {
|
|
* not enable the display link feeding the next bridge in the chain (if
|
|
* there is one) when this callback is called.
|
|
*
|
|
- * The pre_enable callback is optional.
|
|
+ * The @pre_enable callback is optional.
|
|
*/
|
|
void (*pre_enable)(struct drm_bridge *bridge);
|
|
|
|
@@ -234,7 +234,7 @@ struct drm_bridge_funcs {
|
|
* callback must enable the display link feeding the next bridge in the
|
|
* chain if there is one.
|
|
*
|
|
- * The enable callback is optional.
|
|
+ * The @enable callback is optional.
|
|
*/
|
|
void (*enable)(struct drm_bridge *bridge);
|
|
|
|
@@ -283,7 +283,7 @@ struct drm_bridge_funcs {
|
|
* would be prudent to also provide an implementation of @enable if
|
|
* you are expecting driver calls into &drm_bridge_enable.
|
|
*
|
|
- * The enable callback is optional.
|
|
+ * The @atomic_enable callback is optional.
|
|
*/
|
|
void (*atomic_enable)(struct drm_bridge *bridge,
|
|
struct drm_atomic_state *state);
|
|
@@ -305,7 +305,7 @@ struct drm_bridge_funcs {
|
|
* would be prudent to also provide an implementation of @disable if
|
|
* you are expecting driver calls into &drm_bridge_disable.
|
|
*
|
|
- * The disable callback is optional.
|
|
+ * The @atomic_disable callback is optional.
|
|
*/
|
|
void (*atomic_disable)(struct drm_bridge *bridge,
|
|
struct drm_atomic_state *state);
|
|
@@ -330,7 +330,7 @@ struct drm_bridge_funcs {
|
|
* @post_disable if you are expecting driver calls into
|
|
* &drm_bridge_post_disable.
|
|
*
|
|
- * The post_disable callback is optional.
|
|
+ * The @atomic_post_disable callback is optional.
|
|
*/
|
|
void (*atomic_post_disable)(struct drm_bridge *bridge,
|
|
struct drm_atomic_state *state);
|
|
|
|
From ae667b462b6ecd8b155eea0bec67708df1ba20b1 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= <jose.souza@intel.com>
|
|
Date: Fri, 13 Sep 2019 16:28:56 -0700
|
|
Subject: [PATCH] drm/connector: Share with non-atomic drivers the function to
|
|
get the single encoder
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
This 3 non-atomic drivers all have the same function getting the
|
|
only encoder available in the connector, also atomic drivers have
|
|
this fallback. So moving it a common place and sharing between atomic
|
|
and non-atomic drivers.
|
|
|
|
While at it I also removed the mention of
|
|
drm_atomic_helper_best_encoder() that was renamed in
|
|
commit 297e30b5d9b6 ("drm/atomic-helper: Unexport
|
|
drm_atomic_helper_best_encoder").
|
|
|
|
v3: moving drm_connector_get_single_encoder to drm_kms_helper module
|
|
|
|
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
|
|
Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
|
|
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
|
|
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Cc: dri-devel@lists.freedesktop.org
|
|
Cc: intel-gfx@lists.freedesktop.org
|
|
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
|
|
Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/20190913232857.389834-1-jose.souza@intel.com
|
|
(cherry picked from commit a92462d6bf493c4c96b6d0517b8357fc0a1746d0)
|
|
---
|
|
drivers/gpu/drm/ast/ast_mode.c | 12 ------------
|
|
drivers/gpu/drm/drm_atomic_helper.c | 15 ++-------------
|
|
drivers/gpu/drm/drm_crtc_helper.c | 17 ++++++++++++++++-
|
|
drivers/gpu/drm/drm_crtc_helper_internal.h | 3 +++
|
|
drivers/gpu/drm/mgag200/mgag200_mode.c | 11 -----------
|
|
drivers/gpu/drm/udl/udl_connector.c | 8 --------
|
|
include/drm/drm_modeset_helper_vtables.h | 7 +++----
|
|
7 files changed, 24 insertions(+), 49 deletions(-)
|
|
|
|
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
|
|
index d349c721501c..eef95e1af06b 100644
|
|
--- a/drivers/gpu/drm/ast/ast_mode.c
|
|
+++ b/drivers/gpu/drm/ast/ast_mode.c
|
|
@@ -687,17 +687,6 @@ static void ast_encoder_destroy(struct drm_encoder *encoder)
|
|
kfree(encoder);
|
|
}
|
|
|
|
-
|
|
-static struct drm_encoder *ast_best_single_encoder(struct drm_connector *connector)
|
|
-{
|
|
- int enc_id = connector->encoder_ids[0];
|
|
- /* pick the encoder ids */
|
|
- if (enc_id)
|
|
- return drm_encoder_find(connector->dev, NULL, enc_id);
|
|
- return NULL;
|
|
-}
|
|
-
|
|
-
|
|
static const struct drm_encoder_funcs ast_enc_funcs = {
|
|
.destroy = ast_encoder_destroy,
|
|
};
|
|
@@ -847,7 +836,6 @@ static void ast_connector_destroy(struct drm_connector *connector)
|
|
static const struct drm_connector_helper_funcs ast_connector_helper_funcs = {
|
|
.mode_valid = ast_mode_valid,
|
|
.get_modes = ast_get_modes,
|
|
- .best_encoder = ast_best_single_encoder,
|
|
};
|
|
|
|
static const struct drm_connector_funcs ast_connector_funcs = {
|
|
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
|
|
index b4d10b62b01a..47936e3a506c 100644
|
|
--- a/drivers/gpu/drm/drm_atomic_helper.c
|
|
+++ b/drivers/gpu/drm/drm_atomic_helper.c
|
|
@@ -98,17 +98,6 @@ drm_atomic_helper_plane_changed(struct drm_atomic_state *state,
|
|
}
|
|
}
|
|
|
|
-/*
|
|
- * For connectors that support multiple encoders, either the
|
|
- * .atomic_best_encoder() or .best_encoder() operation must be implemented.
|
|
- */
|
|
-static struct drm_encoder *
|
|
-pick_single_encoder_for_connector(struct drm_connector *connector)
|
|
-{
|
|
- WARN_ON(connector->encoder_ids[1]);
|
|
- return drm_encoder_find(connector->dev, NULL, connector->encoder_ids[0]);
|
|
-}
|
|
-
|
|
static int handle_conflicting_encoders(struct drm_atomic_state *state,
|
|
bool disable_conflicting_encoders)
|
|
{
|
|
@@ -136,7 +125,7 @@ static int handle_conflicting_encoders(struct drm_atomic_state *state,
|
|
else if (funcs->best_encoder)
|
|
new_encoder = funcs->best_encoder(connector);
|
|
else
|
|
- new_encoder = pick_single_encoder_for_connector(connector);
|
|
+ new_encoder = drm_connector_get_single_encoder(connector);
|
|
|
|
if (new_encoder) {
|
|
if (encoder_mask & drm_encoder_mask(new_encoder)) {
|
|
@@ -360,7 +349,7 @@ update_connector_routing(struct drm_atomic_state *state,
|
|
else if (funcs->best_encoder)
|
|
new_encoder = funcs->best_encoder(connector);
|
|
else
|
|
- new_encoder = pick_single_encoder_for_connector(connector);
|
|
+ new_encoder = drm_connector_get_single_encoder(connector);
|
|
|
|
if (!new_encoder) {
|
|
DRM_DEBUG_ATOMIC("No suitable encoder found for [CONNECTOR:%d:%s]\n",
|
|
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
|
|
index a51824a7e7c1..4a7447a53cea 100644
|
|
--- a/drivers/gpu/drm/drm_crtc_helper.c
|
|
+++ b/drivers/gpu/drm/drm_crtc_helper.c
|
|
@@ -460,6 +460,17 @@ drm_crtc_helper_disable(struct drm_crtc *crtc)
|
|
__drm_helper_disable_unused_functions(dev);
|
|
}
|
|
|
|
+/*
|
|
+ * For connectors that support multiple encoders, either the
|
|
+ * .atomic_best_encoder() or .best_encoder() operation must be implemented.
|
|
+ */
|
|
+struct drm_encoder *
|
|
+drm_connector_get_single_encoder(struct drm_connector *connector)
|
|
+{
|
|
+ WARN_ON(connector->encoder_ids[1]);
|
|
+ return drm_encoder_find(connector->dev, NULL, connector->encoder_ids[0]);
|
|
+}
|
|
+
|
|
/**
|
|
* drm_crtc_helper_set_config - set a new config from userspace
|
|
* @set: mode set configuration
|
|
@@ -625,7 +636,11 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set,
|
|
new_encoder = connector->encoder;
|
|
for (ro = 0; ro < set->num_connectors; ro++) {
|
|
if (set->connectors[ro] == connector) {
|
|
- new_encoder = connector_funcs->best_encoder(connector);
|
|
+ if (connector_funcs->best_encoder)
|
|
+ new_encoder = connector_funcs->best_encoder(connector);
|
|
+ else
|
|
+ new_encoder = drm_connector_get_single_encoder(connector);
|
|
+
|
|
/* if we can't get an encoder for a connector
|
|
we are setting now - then fail */
|
|
if (new_encoder == NULL)
|
|
diff --git a/drivers/gpu/drm/drm_crtc_helper_internal.h b/drivers/gpu/drm/drm_crtc_helper_internal.h
|
|
index b5ac1581e623..f0a66ef47e5a 100644
|
|
--- a/drivers/gpu/drm/drm_crtc_helper_internal.h
|
|
+++ b/drivers/gpu/drm/drm_crtc_helper_internal.h
|
|
@@ -75,3 +75,6 @@ enum drm_mode_status drm_encoder_mode_valid(struct drm_encoder *encoder,
|
|
const struct drm_display_mode *mode);
|
|
enum drm_mode_status drm_connector_mode_valid(struct drm_connector *connector,
|
|
struct drm_display_mode *mode);
|
|
+
|
|
+struct drm_encoder *
|
|
+drm_connector_get_single_encoder(struct drm_connector *connector);
|
|
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
|
|
index 5e778b5f1a10..68226556044b 100644
|
|
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
|
|
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
|
|
@@ -1638,16 +1638,6 @@ static enum drm_mode_status mga_vga_mode_valid(struct drm_connector *connector,
|
|
return MODE_OK;
|
|
}
|
|
|
|
-static struct drm_encoder *mga_connector_best_encoder(struct drm_connector
|
|
- *connector)
|
|
-{
|
|
- int enc_id = connector->encoder_ids[0];
|
|
- /* pick the encoder ids */
|
|
- if (enc_id)
|
|
- return drm_encoder_find(connector->dev, NULL, enc_id);
|
|
- return NULL;
|
|
-}
|
|
-
|
|
static void mga_connector_destroy(struct drm_connector *connector)
|
|
{
|
|
struct mga_connector *mga_connector = to_mga_connector(connector);
|
|
@@ -1659,7 +1649,6 @@ static void mga_connector_destroy(struct drm_connector *connector)
|
|
static const struct drm_connector_helper_funcs mga_vga_connector_helper_funcs = {
|
|
.get_modes = mga_vga_get_modes,
|
|
.mode_valid = mga_vga_mode_valid,
|
|
- .best_encoder = mga_connector_best_encoder,
|
|
};
|
|
|
|
static const struct drm_connector_funcs mga_vga_connector_funcs = {
|
|
diff --git a/drivers/gpu/drm/udl/udl_connector.c b/drivers/gpu/drm/udl/udl_connector.c
|
|
index ddb61a60c610..b4ae3e89a7b4 100644
|
|
--- a/drivers/gpu/drm/udl/udl_connector.c
|
|
+++ b/drivers/gpu/drm/udl/udl_connector.c
|
|
@@ -90,13 +90,6 @@ udl_detect(struct drm_connector *connector, bool force)
|
|
return connector_status_connected;
|
|
}
|
|
|
|
-static struct drm_encoder*
|
|
-udl_best_single_encoder(struct drm_connector *connector)
|
|
-{
|
|
- int enc_id = connector->encoder_ids[0];
|
|
- return drm_encoder_find(connector->dev, NULL, enc_id);
|
|
-}
|
|
-
|
|
static int udl_connector_set_property(struct drm_connector *connector,
|
|
struct drm_property *property,
|
|
uint64_t val)
|
|
@@ -120,7 +113,6 @@ static void udl_connector_destroy(struct drm_connector *connector)
|
|
static const struct drm_connector_helper_funcs udl_connector_helper_funcs = {
|
|
.get_modes = udl_get_modes,
|
|
.mode_valid = udl_mode_valid,
|
|
- .best_encoder = udl_best_single_encoder,
|
|
};
|
|
|
|
static const struct drm_connector_funcs udl_connector_funcs = {
|
|
diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h
|
|
index 6b18c8adfe9d..5a87f1bd7a3f 100644
|
|
--- a/include/drm/drm_modeset_helper_vtables.h
|
|
+++ b/include/drm/drm_modeset_helper_vtables.h
|
|
@@ -955,9 +955,8 @@ struct drm_connector_helper_funcs {
|
|
* @atomic_best_encoder.
|
|
*
|
|
* You can leave this function to NULL if the connector is only
|
|
- * attached to a single encoder and you are using the atomic helpers.
|
|
- * In this case, the core will call drm_atomic_helper_best_encoder()
|
|
- * for you.
|
|
+ * attached to a single encoder. In this case, the core will call
|
|
+ * drm_connector_get_single_encoder() for you.
|
|
*
|
|
* RETURNS:
|
|
*
|
|
@@ -977,7 +976,7 @@ struct drm_connector_helper_funcs {
|
|
*
|
|
* This function is used by drm_atomic_helper_check_modeset().
|
|
* If it is not implemented, the core will fallback to @best_encoder
|
|
- * (or drm_atomic_helper_best_encoder() if @best_encoder is NULL).
|
|
+ * (or drm_connector_get_single_encoder() if @best_encoder is NULL).
|
|
*
|
|
* NOTE:
|
|
*
|
|
|
|
From e5f340c24c8ca803882b2b4f20bcb3df151807f2 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= <jose.souza@intel.com>
|
|
Date: Fri, 13 Sep 2019 16:28:57 -0700
|
|
Subject: [PATCH] drm/connector: Allow max possible encoders to attach to a
|
|
connector
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Currently we restrict the number of encoders that can be linked to
|
|
a connector to 3, increase it to match the maximum number of encoders
|
|
that can be initialized(32).
|
|
|
|
To more effiently do that lets switch from an array of encoder ids to
|
|
bitmask.
|
|
|
|
v2: Fixing missed return on amdgpu_dm_connector_to_encoder()
|
|
|
|
Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
|
|
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
|
|
Cc: Alex Deucher <alexander.deucher@amd.com>
|
|
Cc: dri-devel@lists.freedesktop.org
|
|
Cc: intel-gfx@lists.freedesktop.org
|
|
Cc: nouveau@lists.freedesktop.org
|
|
Cc: amd-gfx@lists.freedesktop.org
|
|
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
|
|
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
|
|
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
|
|
Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/20190913232857.389834-2-jose.souza@intel.com
|
|
(cherry picked from commit 62afb4ad425af2bc6ac6ff6d697825ae47c25211)
|
|
---
|
|
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 23 ++++++-----------
|
|
drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 5 ++--
|
|
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 +++++-
|
|
drivers/gpu/drm/drm_client_modeset.c | 3 +--
|
|
drivers/gpu/drm/drm_connector.c | 31 ++++++-----------------
|
|
drivers/gpu/drm/drm_crtc_helper.c | 9 +++++--
|
|
drivers/gpu/drm/drm_probe_helper.c | 3 +--
|
|
drivers/gpu/drm/nouveau/dispnv04/disp.c | 2 +-
|
|
drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +-
|
|
drivers/gpu/drm/nouveau/nouveau_connector.c | 7 +++--
|
|
drivers/gpu/drm/radeon/radeon_connectors.c | 27 +++++++-------------
|
|
include/drm/drm_connector.h | 18 +++++--------
|
|
12 files changed, 55 insertions(+), 83 deletions(-)
|
|
|
|
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
|
|
index ece55c8fa673..d8729285f731 100644
|
|
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
|
|
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
|
|
@@ -217,11 +217,10 @@ amdgpu_connector_update_scratch_regs(struct drm_connector *connector,
|
|
struct drm_encoder *encoder;
|
|
const struct drm_connector_helper_funcs *connector_funcs = connector->helper_private;
|
|
bool connected;
|
|
- int i;
|
|
|
|
best_encoder = connector_funcs->best_encoder(connector);
|
|
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i) {
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder) {
|
|
if ((encoder == best_encoder) && (status == connector_status_connected))
|
|
connected = true;
|
|
else
|
|
@@ -236,9 +235,8 @@ amdgpu_connector_find_encoder(struct drm_connector *connector,
|
|
int encoder_type)
|
|
{
|
|
struct drm_encoder *encoder;
|
|
- int i;
|
|
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i) {
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder) {
|
|
if (encoder->encoder_type == encoder_type)
|
|
return encoder;
|
|
}
|
|
@@ -347,10 +345,9 @@ static struct drm_encoder *
|
|
amdgpu_connector_best_single_encoder(struct drm_connector *connector)
|
|
{
|
|
struct drm_encoder *encoder;
|
|
- int i;
|
|
|
|
/* pick the first one */
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i)
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder)
|
|
return encoder;
|
|
|
|
return NULL;
|
|
@@ -1065,9 +1062,8 @@ amdgpu_connector_dvi_detect(struct drm_connector *connector, bool force)
|
|
/* find analog encoder */
|
|
if (amdgpu_connector->dac_load_detect) {
|
|
struct drm_encoder *encoder;
|
|
- int i;
|
|
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i) {
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder) {
|
|
if (encoder->encoder_type != DRM_MODE_ENCODER_DAC &&
|
|
encoder->encoder_type != DRM_MODE_ENCODER_TVDAC)
|
|
continue;
|
|
@@ -1117,9 +1113,8 @@ amdgpu_connector_dvi_encoder(struct drm_connector *connector)
|
|
{
|
|
struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector);
|
|
struct drm_encoder *encoder;
|
|
- int i;
|
|
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i) {
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder) {
|
|
if (amdgpu_connector->use_digital == true) {
|
|
if (encoder->encoder_type == DRM_MODE_ENCODER_TMDS)
|
|
return encoder;
|
|
@@ -1134,7 +1129,7 @@ amdgpu_connector_dvi_encoder(struct drm_connector *connector)
|
|
|
|
/* then check use digitial */
|
|
/* pick the first one */
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i)
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder)
|
|
return encoder;
|
|
|
|
return NULL;
|
|
@@ -1271,9 +1266,8 @@ u16 amdgpu_connector_encoder_get_dp_bridge_encoder_id(struct drm_connector *conn
|
|
{
|
|
struct drm_encoder *encoder;
|
|
struct amdgpu_encoder *amdgpu_encoder;
|
|
- int i;
|
|
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i) {
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder) {
|
|
amdgpu_encoder = to_amdgpu_encoder(encoder);
|
|
|
|
switch (amdgpu_encoder->encoder_id) {
|
|
@@ -1292,10 +1286,9 @@ static bool amdgpu_connector_encoder_is_hbr2(struct drm_connector *connector)
|
|
{
|
|
struct drm_encoder *encoder;
|
|
struct amdgpu_encoder *amdgpu_encoder;
|
|
- int i;
|
|
bool found = false;
|
|
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i) {
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder) {
|
|
amdgpu_encoder = to_amdgpu_encoder(encoder);
|
|
if (amdgpu_encoder->caps & ATOM_ENCODER_CAP_RECORD_HBR2)
|
|
found = true;
|
|
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
|
|
index c9608ae8643b..e4f94863332c 100644
|
|
--- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
|
|
+++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
|
|
@@ -260,15 +260,14 @@ static struct drm_encoder *
|
|
dce_virtual_encoder(struct drm_connector *connector)
|
|
{
|
|
struct drm_encoder *encoder;
|
|
- int i;
|
|
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i) {
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder) {
|
|
if (encoder->encoder_type == DRM_MODE_ENCODER_VIRTUAL)
|
|
return encoder;
|
|
}
|
|
|
|
/* pick the first one */
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i)
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder)
|
|
return encoder;
|
|
|
|
return NULL;
|
|
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
|
|
index 4139f129eafb..0bdf2e1e889c 100644
|
|
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
|
|
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
|
|
@@ -4837,7 +4837,13 @@ static int to_drm_connector_type(enum signal_type st)
|
|
|
|
static struct drm_encoder *amdgpu_dm_connector_to_encoder(struct drm_connector *connector)
|
|
{
|
|
- return drm_encoder_find(connector->dev, NULL, connector->encoder_ids[0]);
|
|
+ struct drm_encoder *encoder;
|
|
+
|
|
+ /* There is only one encoder per connector */
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder)
|
|
+ return encoder;
|
|
+
|
|
+ return NULL;
|
|
}
|
|
|
|
static void amdgpu_dm_get_native_mode(struct drm_connector *connector)
|
|
diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c
|
|
index c8922b7cac09..895b73f23079 100644
|
|
--- a/drivers/gpu/drm/drm_client_modeset.c
|
|
+++ b/drivers/gpu/drm/drm_client_modeset.c
|
|
@@ -415,9 +415,8 @@ static bool connector_has_possible_crtc(struct drm_connector *connector,
|
|
struct drm_crtc *crtc)
|
|
{
|
|
struct drm_encoder *encoder;
|
|
- int i;
|
|
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i) {
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder) {
|
|
if (encoder->possible_crtcs & drm_crtc_mask(crtc))
|
|
return true;
|
|
}
|
|
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
|
|
index 4c766624b20d..43896c711b50 100644
|
|
--- a/drivers/gpu/drm/drm_connector.c
|
|
+++ b/drivers/gpu/drm/drm_connector.c
|
|
@@ -365,8 +365,6 @@ EXPORT_SYMBOL(drm_connector_attach_edid_property);
|
|
int drm_connector_attach_encoder(struct drm_connector *connector,
|
|
struct drm_encoder *encoder)
|
|
{
|
|
- int i;
|
|
-
|
|
/*
|
|
* In the past, drivers have attempted to model the static association
|
|
* of connector to encoder in simple connector/encoder devices using a
|
|
@@ -381,18 +379,15 @@ int drm_connector_attach_encoder(struct drm_connector *connector,
|
|
if (WARN_ON(connector->encoder))
|
|
return -EINVAL;
|
|
|
|
- for (i = 0; i < ARRAY_SIZE(connector->encoder_ids); i++) {
|
|
- if (connector->encoder_ids[i] == 0) {
|
|
- connector->encoder_ids[i] = encoder->base.id;
|
|
- return 0;
|
|
- }
|
|
- }
|
|
- return -ENOMEM;
|
|
+ connector->possible_encoders |= drm_encoder_mask(encoder);
|
|
+
|
|
+ return 0;
|
|
}
|
|
EXPORT_SYMBOL(drm_connector_attach_encoder);
|
|
|
|
/**
|
|
- * drm_connector_has_possible_encoder - check if the connector and encoder are assosicated with each other
|
|
+ * drm_connector_has_possible_encoder - check if the connector and encoder are
|
|
+ * associated with each other
|
|
* @connector: the connector
|
|
* @encoder: the encoder
|
|
*
|
|
@@ -402,15 +397,7 @@ EXPORT_SYMBOL(drm_connector_attach_encoder);
|
|
bool drm_connector_has_possible_encoder(struct drm_connector *connector,
|
|
struct drm_encoder *encoder)
|
|
{
|
|
- struct drm_encoder *enc;
|
|
- int i;
|
|
-
|
|
- drm_connector_for_each_possible_encoder(connector, enc, i) {
|
|
- if (enc == encoder)
|
|
- return true;
|
|
- }
|
|
-
|
|
- return false;
|
|
+ return connector->possible_encoders & drm_encoder_mask(encoder);
|
|
}
|
|
EXPORT_SYMBOL(drm_connector_has_possible_encoder);
|
|
|
|
@@ -2121,7 +2108,6 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
|
|
int encoders_count = 0;
|
|
int ret = 0;
|
|
int copied = 0;
|
|
- int i;
|
|
struct drm_mode_modeinfo u_mode;
|
|
struct drm_mode_modeinfo __user *mode_ptr;
|
|
uint32_t __user *encoder_ptr;
|
|
@@ -2136,14 +2122,13 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
|
|
if (!connector)
|
|
return -ENOENT;
|
|
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i)
|
|
- encoders_count++;
|
|
+ encoders_count = hweight32(connector->possible_encoders);
|
|
|
|
if ((out_resp->count_encoders >= encoders_count) && encoders_count) {
|
|
copied = 0;
|
|
encoder_ptr = (uint32_t __user *)(unsigned long)(out_resp->encoders_ptr);
|
|
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i) {
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder) {
|
|
if (put_user(encoder->base.id, encoder_ptr + copied)) {
|
|
ret = -EFAULT;
|
|
goto out;
|
|
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
|
|
index 4a7447a53cea..499b05aaccfc 100644
|
|
--- a/drivers/gpu/drm/drm_crtc_helper.c
|
|
+++ b/drivers/gpu/drm/drm_crtc_helper.c
|
|
@@ -467,8 +467,13 @@ drm_crtc_helper_disable(struct drm_crtc *crtc)
|
|
struct drm_encoder *
|
|
drm_connector_get_single_encoder(struct drm_connector *connector)
|
|
{
|
|
- WARN_ON(connector->encoder_ids[1]);
|
|
- return drm_encoder_find(connector->dev, NULL, connector->encoder_ids[0]);
|
|
+ struct drm_encoder *encoder;
|
|
+
|
|
+ WARN_ON(hweight32(connector->possible_encoders) > 1);
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder)
|
|
+ return encoder;
|
|
+
|
|
+ return NULL;
|
|
}
|
|
|
|
/**
|
|
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
|
|
index 351cbc40f0f8..a7c87abe88d0 100644
|
|
--- a/drivers/gpu/drm/drm_probe_helper.c
|
|
+++ b/drivers/gpu/drm/drm_probe_helper.c
|
|
@@ -93,7 +93,6 @@ drm_mode_validate_pipeline(struct drm_display_mode *mode,
|
|
struct drm_device *dev = connector->dev;
|
|
enum drm_mode_status ret = MODE_OK;
|
|
struct drm_encoder *encoder;
|
|
- int i;
|
|
|
|
/* Step 1: Validate against connector */
|
|
ret = drm_connector_mode_valid(connector, mode);
|
|
@@ -101,7 +100,7 @@ drm_mode_validate_pipeline(struct drm_display_mode *mode,
|
|
return ret;
|
|
|
|
/* Step 2: Validate against encoders and crtcs */
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i) {
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder) {
|
|
struct drm_crtc *crtc;
|
|
|
|
ret = drm_encoder_mode_valid(encoder, mode);
|
|
diff --git a/drivers/gpu/drm/nouveau/dispnv04/disp.c b/drivers/gpu/drm/nouveau/dispnv04/disp.c
|
|
index dc64863b5fd8..44ee82d0c9b6 100644
|
|
--- a/drivers/gpu/drm/nouveau/dispnv04/disp.c
|
|
+++ b/drivers/gpu/drm/nouveau/dispnv04/disp.c
|
|
@@ -256,7 +256,7 @@ nv04_display_create(struct drm_device *dev)
|
|
|
|
list_for_each_entry_safe(connector, ct,
|
|
&dev->mode_config.connector_list, head) {
|
|
- if (!connector->encoder_ids[0]) {
|
|
+ if (!connector->possible_encoders) {
|
|
NV_WARN(drm, "%s has no encoders, removing\n",
|
|
connector->name);
|
|
connector->funcs->destroy(connector);
|
|
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
|
|
index b46be8a091e9..a13924ae1992 100644
|
|
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
|
|
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
|
|
@@ -2392,7 +2392,7 @@ nv50_display_create(struct drm_device *dev)
|
|
|
|
/* cull any connectors we created that don't have an encoder */
|
|
list_for_each_entry_safe(connector, tmp, &dev->mode_config.connector_list, head) {
|
|
- if (connector->encoder_ids[0])
|
|
+ if (connector->possible_encoders)
|
|
continue;
|
|
|
|
NV_WARN(drm, "%s has no encoders, removing\n",
|
|
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
|
|
index 94dfa2e5a9ab..2f6090fb5a00 100644
|
|
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
|
|
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
|
|
@@ -365,9 +365,8 @@ find_encoder(struct drm_connector *connector, int type)
|
|
{
|
|
struct nouveau_encoder *nv_encoder;
|
|
struct drm_encoder *enc;
|
|
- int i;
|
|
|
|
- drm_connector_for_each_possible_encoder(connector, enc, i) {
|
|
+ drm_connector_for_each_possible_encoder(connector, enc) {
|
|
nv_encoder = nouveau_encoder(enc);
|
|
|
|
if (type == DCB_OUTPUT_ANY ||
|
|
@@ -414,10 +413,10 @@ nouveau_connector_ddc_detect(struct drm_connector *connector)
|
|
struct drm_device *dev = connector->dev;
|
|
struct nouveau_encoder *nv_encoder = NULL, *found = NULL;
|
|
struct drm_encoder *encoder;
|
|
- int i, ret;
|
|
+ int ret;
|
|
bool switcheroo_ddc = false;
|
|
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i) {
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder) {
|
|
nv_encoder = nouveau_encoder(encoder);
|
|
|
|
switch (nv_encoder->dcb->type) {
|
|
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
|
|
index b684cd719612..c07427d3c199 100644
|
|
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
|
|
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
|
|
@@ -249,11 +249,10 @@ radeon_connector_update_scratch_regs(struct drm_connector *connector, enum drm_c
|
|
struct drm_encoder *encoder;
|
|
const struct drm_connector_helper_funcs *connector_funcs = connector->helper_private;
|
|
bool connected;
|
|
- int i;
|
|
|
|
best_encoder = connector_funcs->best_encoder(connector);
|
|
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i) {
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder) {
|
|
if ((encoder == best_encoder) && (status == connector_status_connected))
|
|
connected = true;
|
|
else
|
|
@@ -269,9 +268,8 @@ radeon_connector_update_scratch_regs(struct drm_connector *connector, enum drm_c
|
|
static struct drm_encoder *radeon_find_encoder(struct drm_connector *connector, int encoder_type)
|
|
{
|
|
struct drm_encoder *encoder;
|
|
- int i;
|
|
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i) {
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder) {
|
|
if (encoder->encoder_type == encoder_type)
|
|
return encoder;
|
|
}
|
|
@@ -380,10 +378,9 @@ static int radeon_ddc_get_modes(struct drm_connector *connector)
|
|
static struct drm_encoder *radeon_best_single_encoder(struct drm_connector *connector)
|
|
{
|
|
struct drm_encoder *encoder;
|
|
- int i;
|
|
|
|
/* pick the first one */
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i)
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder)
|
|
return encoder;
|
|
|
|
return NULL;
|
|
@@ -428,14 +425,13 @@ radeon_connector_analog_encoder_conflict_solve(struct drm_connector *connector,
|
|
|
|
list_for_each_entry(conflict, &dev->mode_config.connector_list, head) {
|
|
struct drm_encoder *enc;
|
|
- int i;
|
|
|
|
if (conflict == connector)
|
|
continue;
|
|
|
|
radeon_conflict = to_radeon_connector(conflict);
|
|
|
|
- drm_connector_for_each_possible_encoder(conflict, enc, i) {
|
|
+ drm_connector_for_each_possible_encoder(conflict, enc) {
|
|
/* if the IDs match */
|
|
if (enc == encoder) {
|
|
if (conflict->status != connector_status_connected)
|
|
@@ -1363,9 +1359,7 @@ radeon_dvi_detect(struct drm_connector *connector, bool force)
|
|
|
|
/* find analog encoder */
|
|
if (radeon_connector->dac_load_detect) {
|
|
- int i;
|
|
-
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i) {
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder) {
|
|
if (encoder->encoder_type != DRM_MODE_ENCODER_DAC &&
|
|
encoder->encoder_type != DRM_MODE_ENCODER_TVDAC)
|
|
continue;
|
|
@@ -1443,9 +1437,8 @@ static struct drm_encoder *radeon_dvi_encoder(struct drm_connector *connector)
|
|
{
|
|
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
|
|
struct drm_encoder *encoder;
|
|
- int i;
|
|
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i) {
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder) {
|
|
if (radeon_connector->use_digital == true) {
|
|
if (encoder->encoder_type == DRM_MODE_ENCODER_TMDS)
|
|
return encoder;
|
|
@@ -1460,7 +1453,7 @@ static struct drm_encoder *radeon_dvi_encoder(struct drm_connector *connector)
|
|
|
|
/* then check use digitial */
|
|
/* pick the first one */
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i)
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder)
|
|
return encoder;
|
|
|
|
return NULL;
|
|
@@ -1603,9 +1596,8 @@ u16 radeon_connector_encoder_get_dp_bridge_encoder_id(struct drm_connector *conn
|
|
{
|
|
struct drm_encoder *encoder;
|
|
struct radeon_encoder *radeon_encoder;
|
|
- int i;
|
|
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i) {
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder) {
|
|
radeon_encoder = to_radeon_encoder(encoder);
|
|
|
|
switch (radeon_encoder->encoder_id) {
|
|
@@ -1624,10 +1616,9 @@ static bool radeon_connector_encoder_is_hbr2(struct drm_connector *connector)
|
|
{
|
|
struct drm_encoder *encoder;
|
|
struct radeon_encoder *radeon_encoder;
|
|
- int i;
|
|
bool found = false;
|
|
|
|
- drm_connector_for_each_possible_encoder(connector, encoder, i) {
|
|
+ drm_connector_for_each_possible_encoder(connector, encoder) {
|
|
radeon_encoder = to_radeon_encoder(encoder);
|
|
if (radeon_encoder->caps & ATOM_ENCODER_CAP_RECORD_HBR2)
|
|
found = true;
|
|
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
|
|
index 681cb590f952..c6e993e78dbd 100644
|
|
--- a/include/drm/drm_connector.h
|
|
+++ b/include/drm/drm_connector.h
|
|
@@ -1288,12 +1288,12 @@ struct drm_connector {
|
|
/** @override_edid: has the EDID been overwritten through debugfs for testing? */
|
|
bool override_edid;
|
|
|
|
-#define DRM_CONNECTOR_MAX_ENCODER 3
|
|
/**
|
|
- * @encoder_ids: Valid encoders for this connector. Please only use
|
|
- * drm_connector_for_each_possible_encoder() to enumerate these.
|
|
+ * @possible_encoders: Bit mask of encoders that can drive this
|
|
+ * connector, drm_encoder_index() determines the index into the bitfield
|
|
+ * and the bits are set with drm_connector_attach_encoder().
|
|
*/
|
|
- uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER];
|
|
+ u32 possible_encoders;
|
|
|
|
/**
|
|
* @encoder: Currently bound encoder driving this connector, if any.
|
|
@@ -1608,13 +1608,9 @@ bool drm_connector_has_possible_encoder(struct drm_connector *connector,
|
|
* drm_connector_for_each_possible_encoder - iterate connector's possible encoders
|
|
* @connector: &struct drm_connector pointer
|
|
* @encoder: &struct drm_encoder pointer used as cursor
|
|
- * @__i: int iteration cursor, for macro-internal use
|
|
*/
|
|
-#define drm_connector_for_each_possible_encoder(connector, encoder, __i) \
|
|
- for ((__i) = 0; (__i) < ARRAY_SIZE((connector)->encoder_ids) && \
|
|
- (connector)->encoder_ids[(__i)] != 0; (__i)++) \
|
|
- for_each_if((encoder) = \
|
|
- drm_encoder_find((connector)->dev, NULL, \
|
|
- (connector)->encoder_ids[(__i)])) \
|
|
+#define drm_connector_for_each_possible_encoder(connector, encoder) \
|
|
+ drm_for_each_encoder_mask(encoder, (connector)->dev, \
|
|
+ (connector)->possible_encoders)
|
|
|
|
#endif
|