From: Hermes Wu via B4 Relay <devnull+Hermes.wu.ite.corp-partner.google.com@kernel.org>
To: Andrzej Hajda <andrzej.hajda@intel.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Robert Foss <rfoss@kernel.org>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Jonas Karlman <jonas@kwiboo.se>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>,
Simona Vetter <simona@ffwll.ch>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Hermes Wu <hermes.wu@ite.com.tw>,
Allen Chen <allen.chen@ite.com.tw>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Pin-yen Lin <treapking@chromium.org>,
Kenneth Hung <Kenneth.Hung@ite.com.tw>,
Pet Weng <Pet.Weng@ite.com.tw>, Hermes Wu <Hermes.wu@ite.com.tw>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Subject: [PATCH RESEND v7 03/10] drm/bridge: it6505: add AUX operation for HDCP KSV list read
Date: Mon, 30 Dec 2024 18:51:21 +0800 [thread overview]
Message-ID: <20241230-v7-upstream-v7-3-e0fdd4844703@ite.corp-partner.google.com> (raw)
In-Reply-To: <20241230-v7-upstream-v7-0-e0fdd4844703@ite.corp-partner.google.com>
From: Hermes Wu <hermes.wu@ite.com.tw>
HDCP KSV list readback can choose to use AUX FIFO or
general data register.
For some DisplayPort devices, the KSV list must be read
in 5 byte boundaries.
The original AUX read command does not support these devices.
The AUX command operation control register "REG_AUX_CMD_REQ" uses b[3:0]
as AUX operacion control, and b[7:4] are status bits and read only.
To change KSV read operation uses "CMD_AUX_NATIVE_READ" from using
the data registers to using AUX FIFO.
The extended command "CMD_AUX_GET_KSV_LIST" is added as
"CMD_AUX_NATIVE_READ" with the 0x10 flag which selects AUX FIFO mode.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Hermes Wu <hermes.wu@ite.com.tw>
---
drivers/gpu/drm/bridge/ite-it6505.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c
index 9747d7ccf435d536da55c6a3ff79e504b7c724f0..ba37974967767a17b7025595f6864f057174efb9 100644
--- a/drivers/gpu/drm/bridge/ite-it6505.c
+++ b/drivers/gpu/drm/bridge/ite-it6505.c
@@ -19,6 +19,7 @@
#include <linux/regulator/consumer.h>
#include <linux/types.h>
#include <linux/wait.h>
+#include <linux/bitfield.h>
#include <crypto/hash.h>
@@ -126,6 +127,7 @@
#define REG_AUX_OUT_DATA0 0x27
#define REG_AUX_CMD_REQ 0x2B
+#define M_AUX_REQ_CMD 0x0F
#define AUX_BUSY BIT(5)
#define REG_AUX_DATA_0_7 0x2C
@@ -324,6 +326,9 @@ enum aux_cmd_type {
CMD_AUX_NATIVE_READ = 0x0,
CMD_AUX_NATIVE_WRITE = 0x5,
CMD_AUX_I2C_EDID_READ = 0xB,
+
+ /* KSV read with AUX FIFO extend from CMD_AUX_NATIVE_READ*/
+ CMD_AUX_GET_KSV_LIST = 0x10,
};
enum aux_cmd_reply {
@@ -965,7 +970,8 @@ static ssize_t it6505_aux_operation(struct it6505 *it6505,
it6505_set_bits(it6505, REG_AUX_CTRL, AUX_USER_MODE, AUX_USER_MODE);
aux_op_start:
- if (cmd == CMD_AUX_I2C_EDID_READ) {
+ /* HW AUX FIFO supports only EDID and DCPD KSV FIFO area */
+ if (cmd == CMD_AUX_I2C_EDID_READ || cmd == CMD_AUX_GET_KSV_LIST) {
/* AUX EDID FIFO has max length of AUX_FIFO_MAX_SIZE bytes. */
size = min_t(size_t, size, AUX_FIFO_MAX_SIZE);
/* Enable AUX FIFO read back and clear FIFO */
@@ -996,7 +1002,7 @@ static ssize_t it6505_aux_operation(struct it6505 *it6505,
size);
/* Aux Fire */
- it6505_write(it6505, REG_AUX_CMD_REQ, cmd);
+ it6505_write(it6505, REG_AUX_CMD_REQ, FIELD_GET(M_AUX_REQ_CMD, cmd));
ret = it6505_aux_wait(it6505);
if (ret < 0)
@@ -1030,7 +1036,7 @@ static ssize_t it6505_aux_operation(struct it6505 *it6505,
goto aux_op_start;
}
- if (cmd == CMD_AUX_I2C_EDID_READ) {
+ if (cmd == CMD_AUX_I2C_EDID_READ || cmd == CMD_AUX_GET_KSV_LIST) {
for (i = 0; i < size; i++) {
ret = it6505_read(it6505, REG_AUX_DATA_FIFO);
if (ret < 0)
@@ -1055,7 +1061,7 @@ static ssize_t it6505_aux_operation(struct it6505 *it6505,
ret = i;
aux_op_err:
- if (cmd == CMD_AUX_I2C_EDID_READ) {
+ if (cmd == CMD_AUX_I2C_EDID_READ || cmd == CMD_AUX_GET_KSV_LIST) {
/* clear AUX FIFO */
it6505_set_bits(it6505, REG_AUX_CTRL,
AUX_EN_FIFO_READ | CLR_EDID_FIFO,
@@ -1076,7 +1082,8 @@ static ssize_t it6505_aux_do_transfer(struct it6505 *it6505,
size_t size, enum aux_cmd_reply *reply)
{
int i, ret_size, ret = 0, request_size;
- int fifo_max_size = (cmd == CMD_AUX_I2C_EDID_READ) ? AUX_FIFO_MAX_SIZE : 4;
+ int fifo_max_size = (cmd == CMD_AUX_I2C_EDID_READ || cmd == CMD_AUX_GET_KSV_LIST) ?
+ AUX_FIFO_MAX_SIZE : 4;
mutex_lock(&it6505->aux_lock);
i = 0;
--
2.34.1
next prev parent reply other threads:[~2024-12-30 10:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-30 10:51 [PATCH RESEND v7 00/10] drm/bridge: it6505: fix HDCP CTS fail items and add MCCS support Hermes Wu via B4 Relay
2024-12-30 10:51 ` [PATCH RESEND v7 01/10] drm/bridge: it6505: Change definition of AUX_FIFO_MAX_SIZE Hermes Wu via B4 Relay
2024-12-30 10:51 ` [PATCH RESEND v7 02/10] drm/bridge: it6505: improve AUX operation for edid read Hermes Wu via B4 Relay
2024-12-30 10:51 ` Hermes Wu via B4 Relay [this message]
2024-12-30 10:51 ` [PATCH RESEND v7 04/10] drm/bridge: it6505: Change definition MAX_HDCP_DOWN_STREAM_COUNT Hermes Wu via B4 Relay
2024-12-30 10:51 ` [PATCH RESEND v7 05/10] drm/bridge: it6505: fix HDCP Bstatus check Hermes Wu via B4 Relay
2024-12-30 10:51 ` [PATCH RESEND v7 06/10] drm/bridge: it6505: fix HDCP encryption when R0 ready Hermes Wu via B4 Relay
2024-12-30 10:51 ` [PATCH RESEND v7 07/10] drm/bridge: it6505: fix HDCP CTS KSV list read with UNIGRAF DPR-100 Hermes Wu via B4 Relay
2024-12-30 10:51 ` [PATCH RESEND v7 08/10] drm/bridge: it6505: fix HDCP CTS compare V matching Hermes Wu via B4 Relay
2024-12-30 10:51 ` [PATCH RESEND v7 09/10] drm/bridge: it6505: fix HDCP CTS KSV list wait timer Hermes Wu via B4 Relay
2024-12-30 10:51 ` [PATCH RESEND v7 10/10] drm/bridge: it6505: add I2C functionality on AUX Hermes Wu via B4 Relay
2025-01-02 12:34 ` [PATCH RESEND v7 00/10] drm/bridge: it6505: fix HDCP CTS fail items and add MCCS support AngeloGioacchino Del Regno
2025-01-03 18:42 ` Dmitry Baryshkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241230-v7-upstream-v7-3-e0fdd4844703@ite.corp-partner.google.com \
--to=devnull+hermes.wu.ite.corp-partner.google.com@kernel.org \
--cc=Hermes.wu@ite.corp-partner.google.com \
--cc=Kenneth.Hung@ite.com.tw \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=Pet.Weng@ite.com.tw \
--cc=airlied@gmail.com \
--cc=allen.chen@ite.com.tw \
--cc=andrzej.hajda@intel.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=hermes.wu@ite.com.tw \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rfoss@kernel.org \
--cc=simona@ffwll.ch \
--cc=treapking@chromium.org \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®