From: Yongbang Shi <shiyongbang@huawei.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: <xinliang.liu@linaro.org>, <tiantao6@hisilicon.com>,
<maarten.lankhorst@linux.intel.com>, <mripard@kernel.org>,
<tzimmermann@suse.de>, <airlied@gmail.com>, <daniel@ffwll.ch>,
<kong.kongxinwei@hisilicon.com>, <liangjian010@huawei.com>,
<chenjianmin@huawei.com>, <lidongming5@huawei.com>,
<libaihan@huawei.com>, <shenjian15@huawei.com>,
<shaojijie@huawei.com>, <dri-devel@lists.freedesktop.org>,
<linux-kernel@vger.kernel.org>, <shiyongbang@huawei.com>
Subject: Re: [PATCH v3 drm-dp 3/8] drm/hisilicon/hibmc: Add dp serdes cfg in dp process
Date: Sat, 22 Feb 2025 18:32:35 +0800 [thread overview]
Message-ID: <c9d59963-2ebd-4a6f-bdff-1616ed8afec0@huawei.com> (raw)
In-Reply-To: <d77bfuqor2rsd5tg4abywkckiqwy7j5xr43p73to2ofwpirws3@4m4g7hkvji2a>
> On Sat, Feb 22, 2025 at 10:50:56AM +0800, Yongbang Shi wrote:
>> From: Baihan Li <libaihan@huawei.com>
>>
>> Add dp serdes cfg in link training process, and related adapting
>> and modificating. Change some init values about training,
>> because we want completely to negotiation process, so we start with
>> the maximum rate and the electrical characteristic level is 0.
>>
>> Signed-off-by: Baihan Li <libaihan@huawei.com>
>> Signed-off-by: Yongbang Shi <shiyongbang@huawei.com>
>> ---
>> ChangeLog:
>> v2 -> v3:
>> - change commit to an imperative sentence, suggested by Dmitry Baryshkov.
>> - put HIBMC_DP_HOST_SERDES_CTRL in dp_serdes.h, suggested by Dmitry Baryshkov.
>> v1 -> v2:
>> - splittting the patch and add more detailed the changes in the commit message, suggested by Dmitry Baryshkov.
>> ---
>> .../gpu/drm/hisilicon/hibmc/dp/dp_config.h | 1 +
>> drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.c | 5 ++-
>> drivers/gpu/drm/hisilicon/hibmc/dp/dp_link.c | 33 ++++++++++++++++---
>> drivers/gpu/drm/hisilicon/hibmc/dp/dp_reg.h | 1 +
>> .../gpu/drm/hisilicon/hibmc/dp/dp_serdes.h | 6 ++++
>> .../gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 8 ++---
>> 6 files changed, 43 insertions(+), 11 deletions(-)
>>
> Mostly LGTM.
>
>> diff --git a/drivers/gpu/drm/hisilicon/hibmc/dp/dp_serdes.h b/drivers/gpu/drm/hisilicon/hibmc/dp/dp_serdes.h
>> index 812d0794543c..e0537cc9af41 100644
>> --- a/drivers/gpu/drm/hisilicon/hibmc/dp/dp_serdes.h
>> +++ b/drivers/gpu/drm/hisilicon/hibmc/dp/dp_serdes.h
>> @@ -4,12 +4,15 @@
>> #ifndef DP_SERDES_H
>> #define DP_SERDES_H
>>
>> +#include "dp_comm.h"
> No, please include it directly, where required. This simplifies possible
> inter-header dependencies.
Okay.
>> +
>> #define HIBMC_DP_HOST_OFFSET 0x10000
>> #define HIBMC_DP_LANE0_RATE_OFFSET 0x4
>> #define HIBMC_DP_LANE1_RATE_OFFSET 0xc
>> #define HIBMC_DP_LANE_STATUS_OFFSET 0x10
>> #define HIBMC_DP_PMA_LANE0_OFFSET 0x18
>> #define HIBMC_DP_PMA_LANE1_OFFSET 0x1c
>> +#define HIBMC_DP_HOST_SERDES_CTRL 0x1f001c
>> #define HIBMC_DP_PMA_TXDEEMPH GENMASK(18, 1)
>>
>> /* dp serdes TX-Deempth Configuration */
>> @@ -24,6 +27,9 @@
>> #define DP_SERDES_VOL2_PRE1 0x4500
>> #define DP_SERDES_VOL3_PRE0 0x600
>> #define DP_SERDES_BW_8_1 0x3
>> +#define DP_SERDES_BW_5_4 0x2
>> +#define DP_SERDES_BW_2_7 0x1
>> +#define DP_SERDES_BW_1_62 0x0
>>
>> #define DP_SERDES_DONE 0x3
>>
>> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
>> index e6de6d5edf6b..67d39e258cac 100644
>> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
>> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
>> @@ -28,9 +28,7 @@
>> #include "hibmc_drm_drv.h"
>> #include "hibmc_drm_regs.h"
>>
>> -#define HIBMC_DP_HOST_SERDES_CTRL 0x1f001c
>> -#define HIBMC_DP_HOST_SERDES_CTRL_VAL 0x8a00
>> -#define HIBMC_DP_HOST_SERDES_CTRL_MASK 0x7ffff
>> +#include "dp/dp_serdes.h"
>>
>> DEFINE_DRM_GEM_FOPS(hibmc_fops);
>>
>> @@ -122,8 +120,8 @@ static int hibmc_kms_init(struct hibmc_drm_private *priv)
>> }
>>
>> /* if DP existed, init DP */
>> - if ((readl(priv->mmio + HIBMC_DP_HOST_SERDES_CTRL) &
>> - HIBMC_DP_HOST_SERDES_CTRL_MASK) == HIBMC_DP_HOST_SERDES_CTRL_VAL) {
>> + ret = readl(priv->mmio + HIBMC_DP_HOST_SERDES_CTRL);
>> + if (ret) {
> Why?
Becuase this is a serdes deempth configuration which is changed if we start cfg serdes.
The HIBMC_DP_HOST_SERDES_CTRL_VAL is default value, but we may change it. We can just
check if it is not zero. If it's not zero, it has dp block and we can init it.
>> ret = hibmc_dp_init(priv);
>> if (ret)
>> drm_err(dev, "failed to init dp: %d\n", ret);
>> --
>> 2.33.0
>>
next prev parent reply other threads:[~2025-02-22 10:32 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-22 2:50 [PATCH v3 drm-dp 0/8] Add HPD, getting EDID, colorbar features in DP function Yongbang Shi
2025-02-22 2:50 ` [PATCH v3 drm-dp 1/8] drm/hisilicon/hibmc: Restructuring the header dp_reg.h Yongbang Shi
2025-02-22 5:16 ` Dmitry Baryshkov
2025-02-22 2:50 ` [PATCH v3 drm-dp 2/8] drm/hisilicon/hibmc: Add dp serdes cfg to adjust serdes rate, voltage and pre-emphasis Yongbang Shi
2025-02-22 5:25 ` Dmitry Baryshkov
2025-02-22 10:31 ` Yongbang Shi
2025-02-22 2:50 ` [PATCH v3 drm-dp 3/8] drm/hisilicon/hibmc: Add dp serdes cfg in dp process Yongbang Shi
2025-02-22 5:31 ` Dmitry Baryshkov
2025-02-22 10:32 ` Yongbang Shi [this message]
2025-02-24 2:15 ` Dmitry Baryshkov
2025-02-22 2:50 ` [PATCH v3 drm-dp 4/8] drm/hisilicon/hibmc: Refactor the member of drm_aux in struct hibmc_dp Yongbang Shi
2025-02-22 5:32 ` Dmitry Baryshkov
2025-02-22 2:50 ` [PATCH v3 drm-dp 5/8] drm/hisilicon/hibmc: Getting connector info and EDID by using AUX channel Yongbang Shi
2025-02-22 5:41 ` Dmitry Baryshkov
2025-02-22 2:50 ` [PATCH v3 drm-dp 6/8] drm/hisilicon/hibmc: Add colorbar-cfg feature and its debugfs file Yongbang Shi
2025-02-22 5:50 ` Dmitry Baryshkov
2025-02-22 10:33 ` Yongbang Shi
2025-02-22 2:51 ` [PATCH v3 drm-dp 7/8] drm/hisilicon/hibmc: Enable this hot plug detect of irq feature Yongbang Shi
2025-02-22 5:56 ` Dmitry Baryshkov
2025-02-22 10:33 ` Yongbang Shi
2025-02-22 10:35 ` Yongbang Shi
2025-02-24 2:52 ` Dmitry Baryshkov
2025-02-24 14:03 ` Yongbang Shi
2025-02-24 16:16 ` Dmitry Baryshkov
2025-02-25 13:57 ` Yongbang Shi
2025-02-26 6:51 ` Dmitry Baryshkov
2025-02-27 13:46 ` Yongbang Shi
2025-02-27 15:38 ` Dmitry Baryshkov
2025-03-01 8:45 ` Yongbang Shi
2025-03-01 9:11 ` Dmitry Baryshkov
2025-03-01 9:54 ` Yongbang Shi
2025-03-01 11:45 ` Dmitry Baryshkov
2025-03-03 5:02 ` Yongbang Shi
2025-03-03 5:57 ` Dmitry Baryshkov
2025-03-04 2:23 ` Yongbang Shi
2025-03-04 5:43 ` Dmitry Baryshkov
2025-03-05 7:29 ` Yongbang Shi
2025-03-05 8:27 ` Dmitry Baryshkov
2025-03-05 11:21 ` Yongbang Shi
2025-02-24 2:43 ` Yongbang Shi
2025-02-23 5:26 ` kernel test robot
2025-02-22 2:51 ` [PATCH v3 drm-dp 8/8] drm/hisilicon/hibmc: Add MSI irq getting and requesting for HPD Yongbang Shi
2025-02-22 5:57 ` 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=c9d59963-2ebd-4a6f-bdff-1616ed8afec0@huawei.com \
--to=shiyongbang@huawei.com \
--cc=airlied@gmail.com \
--cc=chenjianmin@huawei.com \
--cc=daniel@ffwll.ch \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=kong.kongxinwei@hisilicon.com \
--cc=liangjian010@huawei.com \
--cc=libaihan@huawei.com \
--cc=lidongming5@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=shaojijie@huawei.com \
--cc=shenjian15@huawei.com \
--cc=tiantao6@hisilicon.com \
--cc=tzimmermann@suse.de \
--cc=xinliang.liu@linaro.org \
/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®