X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fvideo%2Fipu_common.c;h=ad4af5283a97d2985f39443c0e5053000fb7bca2;hb=f9c1456cf632175afb7d6b27f42f1aab8432be0f;hp=0f2d113a6f18d0e2ecc32eb00b2f13ad6d7454a1;hpb=bd23b22badadcdc414a900828253961fc5ec6c39;p=u-boot diff --git a/drivers/video/ipu_common.c b/drivers/video/ipu_common.c index 0f2d113a6f..ad4af5283a 100644 --- a/drivers/video/ipu_common.c +++ b/drivers/video/ipu_common.c @@ -94,6 +94,7 @@ struct ipu_ch_param { temp1; \ }) +#define IPU_SW_RST_TOUT_USEC (10000) void clk_enable(struct clk *clk) { @@ -398,11 +399,20 @@ void ipu_reset(void) { u32 *reg; u32 value; + int timeout = IPU_SW_RST_TOUT_USEC; reg = (u32 *)SRC_BASE_ADDR; value = __raw_readl(reg); value = value | SW_IPU_RST; __raw_writel(value, reg); + + while (__raw_readl(reg) & SW_IPU_RST) { + udelay(1); + if (!(timeout--)) { + printf("ipu software reset timeout\n"); + break; + } + }; } /*