[U-Boot] [PATCH 1/6] misc: Add JZ47xx efuse driver

Ezequiel Garcia ezequiel at collabora.com
Mon Dec 10 22:02:07 UTC 2018


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.burton at imgtec.com>
> > 
> > Add driver for the efuse block in the JZ47xx SOC.
> > 
> > Cc: Daniel Schwierzeck <daniel.schwierzeck at gmail.com>
> > Signed-off-by: Paul Burton <paul.burton at imgtec.com>
> > Signed-off-by: Marek Vasut <marek.vasut at 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.

Thanks for the review!
Eze



More information about the U-Boot mailing list