Linux resets the LTDC on probe. Let's do the same in barebox, so
a chainloaded barebox doesn't attempt reconfiguration of the DSI host
while the LTDC is still streaming to it.

Tested by chainloading the generic BL33 image on an STM32MP157C-DK2 and
observing it doesn't hang when framebuffer support is enabled.

Signed-off-by: Ahmad Fatoum <[email protected]>
---
 drivers/video/stm32_ltdc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/video/stm32_ltdc.c b/drivers/video/stm32_ltdc.c
index 43d443788364..5165bbf01749 100644
--- a/drivers/video/stm32_ltdc.c
+++ b/drivers/video/stm32_ltdc.c
@@ -272,6 +272,10 @@ static int ltdc_probe(struct device *dev)
        if (IS_ERR(hw->pclk))
                return dev_errp_probe(dev, hw->pclk, "peripheral clock get\n");
 
+       ret = device_reset_us(dev, 10);
+       if (ret)
+               return dev_err_probe(dev, ret, "peripheral reset\n");
+
        for_each_available_child_of_node(dev->of_node, np) {
                struct ltdc_fb *priv;
                struct of_endpoint ep;
-- 
2.47.3


Reply via email to