[PATCH] soc: imx: imx8m-blk-ctrl: set LCDIF panic read hurry level

From: Peng Fan (OSS)
Date: Fri Mar 31 2023 - 05:33:10 EST


From: Peng Fan <peng.fan@xxxxxxx>

The ISI block could signal a panic condition to use hurry level
priority. When the bandwidth is low for ISI, the hurry level priority
could be used to avoid FIFO overflow. The NXP downstream ATF/Linux
Kernel sets the hurry level as 7.

Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
---

V1:
If anyone has setup to help test, that would be appreciated.

drivers/soc/imx/imx8m-blk-ctrl.c | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/drivers/soc/imx/imx8m-blk-ctrl.c b/drivers/soc/imx/imx8m-blk-ctrl.c
index 7c4045068804..eb13829e5dc1 100644
--- a/drivers/soc/imx/imx8m-blk-ctrl.c
+++ b/drivers/soc/imx/imx8m-blk-ctrl.c
@@ -690,6 +690,10 @@ static const struct imx8m_blk_ctrl_data imx8mn_disp_blk_ctl_dev_data = {
#define LCDIF_ARCACHE_CTRL 0x4c
#define LCDIF_1_RD_HURRY GENMASK(15, 13)
#define LCDIF_0_RD_HURRY GENMASK(12, 10)
+#define ISI_CACHE_CTRL 0x50
+#define ISI_V_WR_HURRY GENMASK(28, 26)
+#define ISI_U_WR_HURRY GENMASK(25, 23)
+#define ISI_Y_WR_HURRY GENMASK(22, 20)

static int imx8mp_media_power_notifier(struct notifier_block *nb,
unsigned long action, void *data)
@@ -720,6 +724,15 @@ static int imx8mp_media_power_notifier(struct notifier_block *nb,
regmap_set_bits(bc->regmap, LCDIF_ARCACHE_CTRL,
FIELD_PREP(LCDIF_1_RD_HURRY, 7) |
FIELD_PREP(LCDIF_0_RD_HURRY, 7));
+
+ /*
+ * Set panic write hurry level for ISI interfaces to
+ * maximum priority to avoid bandwidth issue.
+ */
+ regmap_set_bits(bc->regmap, ISI_CACHE_CTRL,
+ FIELD_PREP(ISI_V_WR_HURRY, 7) |
+ FIELD_PREP(ISI_U_WR_HURRY, 7) |
+ FIELD_PREP(ISI_Y_WR_HURRY, 7));
}

return NOTIFY_OK;
--
2.37.1