On 12/10/2018 11:02 PM, Ezequiel Garcia wrote:
> On Mon, 2018-12-10 at 21:56 +0100, Marek Vasut wrote:
>> On 12/10/2018 09:35 PM, Ezequiel Garcia wrote:
>>> From: Paul Burton <paul.bur...@imgtec.com>
>>>
>>> Add driver for the efuse block in the JZ47xx SOC.
>>>
>>> Cc: Daniel Schwierzeck <daniel.schwierz...@gmail.com>
>>> Signed-off-by: Paul Burton <paul.bur...@imgtec.com>
>>> Signed-off-by: Marek Vasut <marek.va...@gmail.com>
>>
>> [...]
>>
>>> +static void jz4780_efuse_read_chunk(size_t addr, size_t count, u8 *buf)
>>> +{
>>> +   void __iomem *regs = (void __iomem *)NEMC_BASE;
>>> +   size_t i;
>>> +   u32 val;
>>> +
>>> +   val = EFUSE_EFUCTRL_RD_EN |
>>> +         ((count - 1) << EFUSE_EFUCTRL_LEN_BIT) |
>>> +         (addr << EFUSE_EFUCTRL_ADDR_BIT) |
>>> +         ((addr > 0x200) ? EFUSE_EFUCTRL_CS : 0);
>>> +   writel(val, regs + EFUSE_EFUCTRL);
>>> +   /* FIXME -- wait_bit() */
>>> +   while (!(readl(regs + EFUSE_EFUSTATE) & EFUSE_EFUSTATE_RD_DONE))
>>> +           ;
>>
>> Does wait_for_bit_le32() fit into the SPL if you use it here ?
>>
> 
> I literally haven't looked at these (working) drivers. Let's see..
> 
> ...hm, to be honest, I'm more worried about these infinite loops
> than about fancy API uses. An infinite loop in the MMC driver caused
> a freeze during driver-model porting, so these are more serious threats.
> 
> Will try to address the unbounded loop and take a stab at using
> wait_for_bit_le32.

Right, that should fix the infinite loop problem.

-- 
Best regards,
Marek Vasut
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to