Qualcomm GCC/VIDEOCC reset overhaul for Venus
Subsystems (3)
v2 cover Qualcomm GCC/VIDEOCC reset overhaul for Venus
Some resets associated with venus require a larger delay for the hardware on the other end to function properly. These seem to fall into three categories:
- 150us for 8250 and earlier
- 400us for 8350 and friends
- 1000us for >=8450
Make some housecleaning changes and describe these delays in preparation to moving this data out of the venus driver.
---
Changes in v2:
- Wrap the function parameters in patch 2
- Better describe the sources of reset delay values
- Pick up tags, rebase (with no changes)
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Konrad Dybcio (18):
clk: qcom: reset: Increase max reset delay
clk: qcom: reset: Commonize the de/assert functions
clk: qcom: reset: Ensure write completion on reset de/assertion
clk: qcom: gcc-sa8775p: Set delay for Venus CLK resets
clk: qcom: gcc-sc8180x: Set delay for Venus CLK resets
clk: qcom: gcc-sc8280xp: Set delay for Venus CLK resets
clk: qcom: gcc-sm4450: Set delay for Venus CLK resets
clk: qcom: gcc-sm7150: Set delay for Venus CLK resets
clk: qcom: gcc-sm8250: Set delay for Venus CLK resets
clk: qcom: gcc-sm8350: Set delay for Venus CLK resets
clk: qcom: gcc-sm8450: Set delay for Venus CLK resets
clk: qcom: gcc-sm8550: Set delay for Venus CLK resets
clk: qcom: gcc-sm8650: Set delay for Venus CLK resets
clk: qcom: videocc-sm8150: Set delay for Venus CLK resets
clk: qcom: videocc-sm8250: Set delay for Venus CLK resets
clk: qcom: videocc-sm8350: Set delay for Venus CLK resets
clk: qcom: videocc-sm8450: Set delay for Venus CLK resets
clk: qcom: videocc-sm8550: Set delay for Venus CLK resets
drivers/clk/qcom/gcc-sa8775p.c | 4 ++-- drivers/clk/qcom/gcc-sc8180x.c | 6 +++--- drivers/clk/qcom/gcc-sc8280xp.c | 4 ++-- drivers/clk/qcom/gcc-sm4450.c | 4 ++-- drivers/clk/qcom/gcc-sm7150.c | 2 +- drivers/clk/qcom/gcc-sm8250.c | 4 ++-- drivers/clk/qcom/gcc-sm8350.c | 4 ++-- drivers/clk/qcom/gcc-sm8450.c | 4 ++-- drivers/clk/qcom/gcc-sm8550.c | 4 ++-- drivers/clk/qcom/gcc-sm8650.c | 4 ++-- drivers/clk/qcom/reset.c | 27 ++++++++++++++------------- drivers/clk/qcom/reset.h | 2 +- drivers/clk/qcom/videocc-sm8150.c | 2 +- drivers/clk/qcom/videocc-sm8250.c | 4 ++-- drivers/clk/qcom/videocc-sm8350.c | 4 ++-- drivers/clk/qcom/videocc-sm8450.c | 4 ++-- drivers/clk/qcom/videocc-sm8550.c | 4 ++-- 17 files changed, 44 insertions(+), 43 deletions(-)
---
base-commit: ac139fc7db67968e5061715508b5fc4aa7c40c56
change-id: 20240105-topic-venus_reset-b5461bf1a087
Best regards,
Signature · 1 line
Konrad Dybcio <[email protected]>
PATCH v2 1/18 clk: qcom: reset: Increase max reset delay
u8 limits us to 255 microseconds of delay. Promote the delay variable to u16 to hold bigger values.
--- drivers/clk/qcom/reset.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/qcom/reset.h +1 -1
@@ -11,7 +11,7 @@struct qcom_reset_map {unsigned int reg;u8 bit; -u8 udelay; +u16 udelay;u32 bitmask; };
Signature · 1 line
2.43.0
PATCH v2 2/18 clk: qcom: reset: Commonize the de/assert functions
In reply to Konrad DybcioThey do the same thing, except the last argument of the last function call differs. Commonize them.
--- drivers/clk/qcom/reset.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-)
drivers/clk/qcom/reset.c +9 -13
@@ -22,8 +22,8 @@ static int qcom_reset(struct reset_controller_dev *rcdev, unsigned long id)return 0 ; } -static int -qcom_reset_assert (struct reset_controller_dev *rcdev,unsigned long id) +static int qcom_reset_set_assert (struct reset_controller_dev *rcdev, +unsigned long id,bool assert) {struct qcom_reset_controller *rst;const struct qcom_reset_map *map;
@@ -33,21 +33,17 @@ qcom_reset_assert(struct reset_controller_dev *rcdev, unsigned long id) map = &rst->reset_map[id]; mask = map->bitmask ? map->bitmask :BIT (map->bit); -return regmap_update_bits (rst->regmap, map->reg, mask, mask); +return regmap_update_bits (rst->regmap, map->reg, mask, assert ? mask :0 ); } -static int -qcom_reset_deassert (struct reset_controller_dev *rcdev,unsigned long id) +static int qcom_reset_assert (struct reset_controller_dev *rcdev,unsigned long id) { -struct qcom_reset_controller *rst; -const struct qcom_reset_map *map; -u32 mask; - - rst =to_qcom_reset_controller (rcdev); - map = &rst->reset_map[id]; - mask = map->bitmask ? map->bitmask :BIT (map->bit); +return qcom_reset_set_assert (rcdev, id, true); +} -return regmap_update_bits (rst->regmap, map->reg, mask,0 ); +static int qcom_reset_deassert (struct reset_controller_dev *rcdev,unsigned long id) +{ +return qcom_reset_set_assert (rcdev, id, false); }const struct reset_control_ops qcom_reset_ops = {
Signature · 1 line
2.43.0
PATCH v2 3/18 clk: qcom: reset: Ensure write completion on reset de/assertion
In reply to Konrad DybcioTrying to toggle the resets in a rapid fashion can lead to the changes not actually arriving at the clock controller block when we expect them to. This was observed at least on SM8250.
Read back the value after regmap_update_bits to ensure write completion.
--- drivers/clk/qcom/reset.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/clk/qcom/reset.c +6 -1
@@ -33,7 +33,12 @@ static int qcom_reset_set_assert(struct reset_controller_dev *rcdev, map = &rst->reset_map[id]; mask = map->bitmask ? map->bitmask :BIT (map->bit); -return regmap_update_bits (rst->regmap, map->reg, mask, assert ? mask :0 ); +regmap_update_bits (rst->regmap, map->reg, mask, assert ? mask :0 ); + +/* Read back the register to ensure write completion, ignore the value */ +regmap_read (rst->regmap, map->reg, &mask); + +return 0 ; }static int qcom_reset_assert (struct reset_controller_dev *rcdev,unsigned long id)
Signature · 1 line
2.43.0
Re: [PATCH v2 03/18] clk: qcom: reset: Ensure write completion on reset de/assertion
Quoted 7 lines · Konrad Dybcio
Trying to toggle the resets in a rapid fashion can lead to the changes not actually arriving at the clock controller block when we expect them to. This was observed at least on SM8250.
Read back the value after
regmap_update_bitsto ensure write completion.Fixes db1029814f1f ("clk: qcom: reset: Ensure write completion on reset de/assertion")
This commit does not exist in mainline or linux-next it seems.
Johan
Re: [PATCH v2 03/18] clk: qcom: reset: Ensure write completion on reset de/assertion
Quoted 10 lines · Johan Hovold
Quoted 7 lines · Konrad Dybcio
Trying to toggle the resets in a rapid fashion can lead to the changes not actually arriving at the clock controller block when we expect them to. This was observed at least on SM8250.
Read back the value after
regmap_update_bitsto ensure write completion.Fixes db1029814f1f ("clk: qcom: reset: Ensure write completion on reset de/assertion")This commit does not exist in mainline or linux-next it seems.
Yeah, I managed to copy the last and not the first commit hash concerning reset.c :/
Konrad
PATCH v2 4/18 clk: qcom: gcc-sa8775p: Set delay for Venus CLK resets
In reply to Konrad DybcioSome Venus resets may require more time when toggling. Describe that.
The value was obtained on a best-guess basis: msm-5.4 being the base kernel for this SoC and 8775 being generally close to 8350 which is known to require a higher delay [1].
--- drivers/clk/qcom/gcc-sa8775p.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/qcom/gcc-sa8775p.c +2 -2
@@ -4662,8 +4662,8 @@ static const struct qcom_reset_map gcc_sa8775p_resets[] = { [GCC_USB3UNIPHY_PHY_MP0_BCR] = { 0x5c020 }, [GCC_USB3UNIPHY_PHY_MP1_BCR] = { 0x5c024 }, [GCC_USB_PHY_CFG_AHB2PHY_BCR] = { 0x76000 }, - [GCC_VIDEO_AXI0_CLK_ARES] = { 0x34014, 2 }, - [GCC_VIDEO_AXI1_CLK_ARES] = { 0x3401c, 2 }, + [GCC_VIDEO_AXI0_CLK_ARES] = { .reg = 0x34014, .bit = 2, .udelay = 400 }, + [GCC_VIDEO_AXI1_CLK_ARES] = { .reg = 0x3401c, .bit = 2, .udelay = 400 }, [GCC_VIDEO_BCR] = { 0x34000 }, };
Signature · 1 line
2.43.0
PATCH v2 5/18 clk: qcom: gcc-sc8180x: Set delay for Venus CLK resets
In reply to Konrad DybcioSome Venus resets may require more time when toggling. Describe that.
The value was obtained by referencing the msm-4.19 driver, which uses a single value for all platforms [1].
--- drivers/clk/qcom/gcc-sc8180x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/clk/qcom/gcc-sc8180x.c +3 -3
@@ -4528,9 +4528,9 @@ static const struct qcom_reset_map gcc_sc8180x_resets[] = { [GCC_USB30_PRIM_BCR] = { 0xf000 }, [GCC_USB30_SEC_BCR] = { 0x10000 }, [GCC_USB_PHY_CFG_AHB2PHY_BCR] = { 0x6a000 }, - [GCC_VIDEO_AXIC_CLK_BCR] = { 0xb02c, 2 }, - [GCC_VIDEO_AXI0_CLK_BCR] = { 0xb024, 2 }, - [GCC_VIDEO_AXI1_CLK_BCR] = { 0xb028, 2 }, + [GCC_VIDEO_AXIC_CLK_BCR] = { .reg = 0xb02c, .bit = 2, .udelay = 150 }, + [GCC_VIDEO_AXI0_CLK_BCR] = { .reg = 0xb024, .bit = 2, .udelay = 150 }, + [GCC_VIDEO_AXI1_CLK_BCR] = { .reg = 0xb028, .bit = 2, .udelay = 150 }, };static struct gdsc *gcc_sc8180x_gdscs[] = {
Signature · 1 line
2.43.0
PATCH v2 6/18 clk: qcom: gcc-sc8280xp: Set delay for Venus CLK resets
In reply to Konrad DybcioSome Venus resets may require more time when toggling. Describe that.
The value was obtained on a best-guess basis: msm-5.4 being the base kernel for this SoC and 8280 being generally close to 8350 which is known to require a higher delay [1].
--- drivers/clk/qcom/gcc-sc8280xp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/qcom/gcc-sc8280xp.c +2 -2
@@ -7448,8 +7448,8 @@ static const struct qcom_reset_map gcc_sc8280xp_resets[] = { [GCC_USB4PHY_PHY_PRIM_BCR] = { 0x4a004 }, [GCC_USB_PHY_CFG_AHB2PHY_BCR] = { 0x6a000 }, [GCC_VIDEO_BCR] = { 0x28000 }, - [GCC_VIDEO_AXI0_CLK_ARES] = { 0x28010, 2 }, - [GCC_VIDEO_AXI1_CLK_ARES] = { 0x28018, 2 }, + [GCC_VIDEO_AXI0_CLK_ARES] = { .reg = 0x28010, .bit = 2, .udelay = 400 }, + [GCC_VIDEO_AXI1_CLK_ARES] = { .reg = 0x28018, .bit = 2, .udelay = 400 }, };static struct gdsc *gcc_sc8280xp_gdscs[] = {
Signature · 1 line
2.43.0
PATCH v2 7/18 clk: qcom: gcc-sm4450: Set delay for Venus CLK resets
In reply to Konrad DybcioSome Venus resets may require more time when toggling. Describe that.
The value was obtained on a best-guess basis: msm-5.4 being the base kernel for this SoC and 4450 being somewhat close to 8350 which is known to require a higher delay [1].
--- drivers/clk/qcom/gcc-sm4450.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/qcom/gcc-sm4450.c +2 -2
@@ -2791,8 +2791,8 @@ static const struct qcom_reset_map gcc_sm4450_resets[] = { [GCC_VENUS_BCR] = { 0xb601c }, [GCC_VIDEO_BCR] = { 0x42000 }, [GCC_VIDEO_VENUS_BCR] = { 0xb6000 }, - [GCC_VENUS_CTL_AXI_CLK_ARES] = { 0x4201c, 2 }, - [GCC_VIDEO_VENUS_CTL_CLK_ARES] = { 0xb6038, 2 }, + [GCC_VENUS_CTL_AXI_CLK_ARES] = { .reg = 0x4201c, .bit = 2, .udelay = 400 }, + [GCC_VIDEO_VENUS_CTL_CLK_ARES] = { .reg = 0xb6038, .bit = 2, .udelay = 400 }, };static const struct clk_rcg_dfs_data gcc_dfs_clocks[] = {
Signature · 1 line
2.43.0
PATCH v2 8/18 clk: qcom: gcc-sm7150: Set delay for Venus CLK resets
In reply to Konrad DybcioSome Venus resets may require more time when toggling. Describe that.
The value was obtained by referencing the msm-4.14/19 driver, which uses a single value for all platforms [1].
--- drivers/clk/qcom/gcc-sm7150.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/qcom/gcc-sm7150.c +1 -1
@@ -2918,7 +2918,7 @@ static const struct qcom_reset_map gcc_sm7150_resets[] = { [GCC_USB3_PHY_PRIM_BCR] = { 0x50000 }, [GCC_USB3_PHY_SEC_BCR] = { 0x5000c }, [GCC_QUSB2PHY_PRIM_BCR] = { 0x26000 }, - [GCC_VIDEO_AXI_CLK_BCR] = { 0xb01c, 2 }, + [GCC_VIDEO_AXI_CLK_BCR] = { .reg = 0xb01c, .bit = 2, .udelay = 150 }, };static const struct clk_rcg_dfs_data gcc_sm7150_dfs_desc[] = {
Signature · 1 line
2.43.0
PATCH v2 9/18 clk: qcom: gcc-sm8250: Set delay for Venus CLK resets
In reply to Konrad DybcioSome Venus resets may require more time when toggling. Describe that.
The value was obtained by referencing the msm-4.19 driver, which uses a single value for all platforms [1].
--- drivers/clk/qcom/gcc-sm8250.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/qcom/gcc-sm8250.c +2 -2
@@ -3576,8 +3576,8 @@ static const struct qcom_reset_map gcc_sm8250_resets[] = { [GCC_USB3PHY_PHY_PRIM_BCR] = { 0x50004 }, [GCC_USB3PHY_PHY_SEC_BCR] = { 0x50010 }, [GCC_USB_PHY_CFG_AHB2PHY_BCR] = { 0x6a000 }, - [GCC_VIDEO_AXI0_CLK_ARES] = { 0xb024, 2 }, - [GCC_VIDEO_AXI1_CLK_ARES] = { 0xb028, 2 }, + [GCC_VIDEO_AXI0_CLK_ARES] = { 0xb024, .bit = 2, .udelay = 150 }, + [GCC_VIDEO_AXI1_CLK_ARES] = { 0xb028, .bit = 2, .udelay = 150 }, };static const struct clk_rcg_dfs_data gcc_dfs_clocks[] = {
Signature · 1 line
2.43.0
PATCH v2 10/18 clk: qcom: gcc-sm8350: Set delay for Venus CLK resets
In reply to Konrad DybcioSome Venus resets may require more time when toggling. Describe that.
The value is known for SM8350, see [1].
--- drivers/clk/qcom/gcc-sm8350.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/qcom/gcc-sm8350.c +2 -2
@@ -3743,8 +3743,8 @@ static const struct qcom_reset_map gcc_sm8350_resets[] = { [GCC_USB3PHY_PHY_PRIM_BCR] = { 0x50004 }, [GCC_USB3PHY_PHY_SEC_BCR] = { 0x50010 }, [GCC_USB_PHY_CFG_AHB2PHY_BCR] = { 0x6a000 }, - [GCC_VIDEO_AXI0_CLK_ARES] = { 0x28010, 2 }, - [GCC_VIDEO_AXI1_CLK_ARES] = { 0x28018, 2 }, + [GCC_VIDEO_AXI0_CLK_ARES] = { .reg = 0x28010, .bit = 2, .udelay = 400 }, + [GCC_VIDEO_AXI1_CLK_ARES] = { .reg = 0x28018, .bit = 2, .udelay = 400 }, [GCC_VIDEO_BCR] = { 0x28000 }, };
Signature · 1 line
2.43.0
PATCH v2 11/18 clk: qcom: gcc-sm8450: Set delay for Venus CLK resets
In reply to Konrad DybcioSome Venus resets may require more time when toggling. Describe that.
The value is known for SM8450, see [1].
--- drivers/clk/qcom/gcc-sm8450.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/qcom/gcc-sm8450.c +2 -2
@@ -3202,8 +3202,8 @@ static const struct qcom_reset_map gcc_sm8450_resets[] = { [GCC_USB3PHY_PHY_PRIM_BCR] = { 0x60004 }, [GCC_USB3PHY_PHY_SEC_BCR] = { 0x60010 }, [GCC_USB_PHY_CFG_AHB2PHY_BCR] = { 0x7a000 }, - [GCC_VIDEO_AXI0_CLK_ARES] = { 0x42018, 2 }, - [GCC_VIDEO_AXI1_CLK_ARES] = { 0x42020, 2 }, + [GCC_VIDEO_AXI0_CLK_ARES] = { .reg = 0x42018, .bit = 2, .udelay = 1000 }, + [GCC_VIDEO_AXI1_CLK_ARES] = { .reg = 0x42020, .bit = 2, .udelay = 1000 }, [GCC_VIDEO_BCR] = { 0x42000 }, };
Signature · 1 line
2.43.0
PATCH v2 12/18 clk: qcom: gcc-sm8550: Set delay for Venus CLK resets
In reply to Konrad DybcioSome Venus resets may require more time when toggling. Describe that.
The value for SM8550 is known and extracted from the msm-5.15 driver.
--- drivers/clk/qcom/gcc-sm8550.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/qcom/gcc-sm8550.c +2 -2
@@ -3276,8 +3276,8 @@ static const struct qcom_reset_map gcc_sm8550_resets[] = { [GCC_USB3PHY_PHY_PRIM_BCR] = { 0x50004 }, [GCC_USB3PHY_PHY_SEC_BCR] = { 0x50010 }, [GCC_USB_PHY_CFG_AHB2PHY_BCR] = { 0x6a000 }, - [GCC_VIDEO_AXI0_CLK_ARES] = { 0x32018, 2 }, - [GCC_VIDEO_AXI1_CLK_ARES] = { 0x32024, 2 }, + [GCC_VIDEO_AXI0_CLK_ARES] = { .reg = 0x32018, .bit = 2, .udelay = 1000 }, + [GCC_VIDEO_AXI1_CLK_ARES] = { .reg = 0x32024, .bit = 2, .udelay = 1000 }, [GCC_VIDEO_BCR] = { 0x32000 }, };
Signature · 1 line
2.43.0
PATCH v2 13/18 clk: qcom: gcc-sm8650: Set delay for Venus CLK resets
In reply to Konrad DybcioSome Venus resets may require more time when toggling. Describe that.
The Venus hw on 8650 is similar to the one on 8550, follow its requirements.
--- drivers/clk/qcom/gcc-sm8650.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/qcom/gcc-sm8650.c +2 -2
@@ -3734,8 +3734,8 @@ static const struct qcom_reset_map gcc_sm8650_resets[] = { [GCC_USB3_PHY_SEC_BCR] = { 0x5000c }, [GCC_USB3PHY_PHY_PRIM_BCR] = { 0x50004 }, [GCC_USB3PHY_PHY_SEC_BCR] = { 0x50010 }, - [GCC_VIDEO_AXI0_CLK_ARES] = { 0x32018, 2 }, - [GCC_VIDEO_AXI1_CLK_ARES] = { 0x32024, 2 }, + [GCC_VIDEO_AXI0_CLK_ARES] = { .reg = 0x32018, .bit = 2, .udelay = 1000 }, + [GCC_VIDEO_AXI1_CLK_ARES] = { .reg = 0x32024, .bit = 2, .udelay = 1000 }, [GCC_VIDEO_BCR] = { 0x32000 }, };
Signature · 1 line
2.43.0
PATCH v2 14/18 clk: qcom: videocc-sm8150: Set delay for Venus CLK resets
In reply to Konrad DybcioSome Venus resets may require more time when toggling. Describe that.
The value was obtained by referencing the msm-4.14/19 driver, which uses a single value for all platforms [1].
--- drivers/clk/qcom/videocc-sm8150.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/qcom/videocc-sm8150.c +1 -1
@@ -215,7 +215,7 @@ static const struct regmap_config video_cc_sm8150_regmap_config = { };static const struct qcom_reset_map video_cc_sm8150_resets[] = { - [VIDEO_CC_MVSC_CORE_CLK_BCR ] = {0x850 ,2 }, + [VIDEO_CC_MVSC_CORE_CLK_BCR ] = { .reg =0x850 , .bit =2 , .udelay =150 }, [VIDEO_CC_INTERFACE_BCR ] = {0x8f0 }, [VIDEO_CC_MVS0_BCR ] = {0x870 }, [VIDEO_CC_MVS1_BCR ] = {0x8b0 },
Signature · 1 line
2.43.0
PATCH v2 15/18 clk: qcom: videocc-sm8250: Set delay for Venus CLK resets
In reply to Konrad DybcioSome Venus resets may require more time when toggling. Describe that.
The value was obtained by referencing the msm-4.14/19 driver, which uses a single value for all platforms [1].
--- drivers/clk/qcom/videocc-sm8250.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/qcom/videocc-sm8250.c +2 -2
@@ -323,10 +323,10 @@ static struct clk_regmap *video_cc_sm8250_clocks[] = {static const struct qcom_reset_map video_cc_sm8250_resets[] = { [VIDEO_CC_CVP_INTERFACE_BCR ] = {0xe54 }, [VIDEO_CC_CVP_MVS0_BCR ] = {0xd14 }, - [VIDEO_CC_MVS0C_CLK_ARES ] = {0xc34 ,2 }, + [VIDEO_CC_MVS0C_CLK_ARES ] = {0xc34 , .bit =2 , .udelay =150 }, [VIDEO_CC_CVP_MVS0C_BCR ] = {0xbf4 }, [VIDEO_CC_CVP_MVS1_BCR ] = {0xd94 }, - [VIDEO_CC_MVS1C_CLK_ARES ] = {0xcd4 ,2 }, + [VIDEO_CC_MVS1C_CLK_ARES ] = {0xcd4 , .bit =2 , .udelay =150 }, [VIDEO_CC_CVP_MVS1C_BCR ] = {0xc94 }, };
Signature · 1 line
2.43.0
PATCH v2 16/18 clk: qcom: videocc-sm8350: Set delay for Venus CLK resets
In reply to Konrad DybcioSome Venus resets may require more time when toggling. Describe that.
The value is known for SM8350, see [1].
--- drivers/clk/qcom/videocc-sm8350.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/qcom/videocc-sm8350.c +2 -2
@@ -488,10 +488,10 @@ static struct clk_regmap *video_cc_sm8350_clocks[] = {static const struct qcom_reset_map video_cc_sm8350_resets[] = { [VIDEO_CC_CVP_INTERFACE_BCR ] = {0xe54 }, [VIDEO_CC_CVP_MVS0_BCR ] = {0xd14 }, - [VIDEO_CC_MVS0C_CLK_ARES ] = {0xc34 ,2 }, + [VIDEO_CC_MVS0C_CLK_ARES ] = { .reg =0xc34 , .bit =2 , .udelay =400 }, [VIDEO_CC_CVP_MVS0C_BCR ] = {0xbf4 }, [VIDEO_CC_CVP_MVS1_BCR ] = {0xd94 }, - [VIDEO_CC_MVS1C_CLK_ARES ] = {0xcd4 ,2 }, + [VIDEO_CC_MVS1C_CLK_ARES ] = { .reg =0xcd4 , .bit =2 , .udelay =400 }, [VIDEO_CC_CVP_MVS1C_BCR ] = {0xc94 }, };
Signature · 1 line
2.43.0
PATCH v2 17/18 clk: qcom: videocc-sm8450: Set delay for Venus CLK resets
In reply to Konrad DybcioSome Venus resets may require more time when toggling. Describe that.
The value is known for SM8450, see [1].
--- drivers/clk/qcom/videocc-sm8450.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/qcom/videocc-sm8450.c +2 -2
@@ -373,8 +373,8 @@ static const struct qcom_reset_map video_cc_sm8450_resets[] = { [CVP_VIDEO_CC_MVS0C_BCR] = { 0x8048 }, [CVP_VIDEO_CC_MVS1_BCR] = { 0x80bc }, [CVP_VIDEO_CC_MVS1C_BCR] = { 0x8070 }, - [VIDEO_CC_MVS0C_CLK_ARES] = { 0x8064, 2 }, - [VIDEO_CC_MVS1C_CLK_ARES] = { 0x808c, 2 }, + [VIDEO_CC_MVS0C_CLK_ARES] = { .reg = 0x8064, .bit = 2, .udelay = 1000 }, + [VIDEO_CC_MVS1C_CLK_ARES] = { .reg = 0x808c, .bit = 2, .udelay = 1000 }, };static const struct regmap_config video_cc_sm8450_regmap_config = {
Signature · 1 line
2.43.0
PATCH v2 18/18 clk: qcom: videocc-sm8550: Set delay for Venus CLK resets
In reply to Konrad DybcioSome Venus resets may require more time when toggling. Describe that.
The value for SM8550 is known and extracted from the msm-5.15 driver.
--- drivers/clk/qcom/videocc-sm8550.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/qcom/videocc-sm8550.c +2 -2
@@ -378,8 +378,8 @@ static const struct qcom_reset_map video_cc_sm8550_resets[] = { [CVP_VIDEO_CC_MVS0C_BCR] = { 0x8048 }, [CVP_VIDEO_CC_MVS1_BCR] = { 0x80c8 }, [CVP_VIDEO_CC_MVS1C_BCR] = { 0x8074 }, - [VIDEO_CC_MVS0C_CLK_ARES] = { 0x8064, 2 }, - [VIDEO_CC_MVS1C_CLK_ARES] = { 0x8090, 2 }, + [VIDEO_CC_MVS0C_CLK_ARES] = { .reg = 0x8064, .bit = 2, .udelay = 1000 }, + [VIDEO_CC_MVS1C_CLK_ARES] = { .reg = 0x8090, .bit = 2, .udelay = 1000 }, };static const struct regmap_config video_cc_sm8550_regmap_config = {
Signature · 1 line
2.43.0
Quoted 9 lines · Konrad Dybcio
Some resets associated with venus require a larger delay for the hardware on the other end to function properly. These seem to fall into three categories:
- 150us for 8250 and earlier
- 400us for 8350 and friends
- 1000us for >=8450[...]
Applied, thanks!
[01/18] clk: qcom: reset: Increase max reset delay
commit: 316861f383176c6360dcffecceb1f843d860faf0
[02/18] clk: qcom: reset: Commonize the de/assert functions
commit: eda40d9c583e95e0b6ac69d2950eec10f802e0e8
[03/18] clk: qcom: reset: Ensure write completion on reset de/assertion
commit: 1bd8c3ad02b1aaa9163a72fece2c28360a52b345
[04/18] clk: qcom: gcc-sa8775p: Set delay for Venus CLK resets
commit: 6c0530974183709e74c3e809d4f0df386a23465b
[05/18] clk: qcom: gcc-sc8180x: Set delay for Venus CLK resets
commit: 627fcb22966d9e7dcfcc040f3895e5da7f64fb9c
[06/18] clk: qcom: gcc-sc8280xp: Set delay for Venus CLK resets
commit: 446b8e191072b78de4af16f5288dcdbfbda78dd1
[07/18] clk: qcom: gcc-sm4450: Set delay for Venus CLK resets
commit: eff85a0f548e536563d57d42bdd6c215031e8c84
[08/18] clk: qcom: gcc-sm7150: Set delay for Venus CLK resets
commit: b8b2343112083f76a4183aa2acdfe861dcc1bb6b
[09/18] clk: qcom: gcc-sm8250: Set delay for Venus CLK resets
commit: 2013a0bca5679dab16fc0f4b7dde4cf8b15b7621
[10/18] clk: qcom: gcc-sm8350: Set delay for Venus CLK resets
commit: cecdccc3e50924a09411f8f9af760f4d1ef8b5c6
[11/18] clk: qcom: gcc-sm8450: Set delay for Venus CLK resets
commit: 6ad1da7c0f2317ceffdfe50ac913b6123cd6ff71
[12/18] clk: qcom: gcc-sm8550: Set delay for Venus CLK resets
commit: d64c6880c44e3a6d52b97dda1082c17317c82c74
[13/18] clk: qcom: gcc-sm8650: Set delay for Venus CLK resets
commit: 6efbf3e21211ece0b49bb75499398f9f08fb9cd6
[14/18] clk: qcom: videocc-sm8150: Set delay for Venus CLK resets
commit: 23fd517957693846ed279cb86f30f548aed01fda
[15/18] clk: qcom: videocc-sm8250: Set delay for Venus CLK resets
commit: 726184dd7b2f7c41a7007a1c1add301ddf173cf2
[16/18] clk: qcom: videocc-sm8350: Set delay for Venus CLK resets
commit: b68d14f84c2c179d0f56588bda2e3a2675dd6d28
[17/18] clk: qcom: videocc-sm8450: Set delay for Venus CLK resets
commit: ed17763a24f22d04e8da104715eb48ba69989dfa
[18/18] clk: qcom: videocc-sm8550: Set delay for Venus CLK resets
commit: ba4354f6ae160609aea8f7adec22ce1a9d0f586aBest regards,
Signature · 1 line
Bjorn Andersson <[email protected]>