[PATCH 1/1] added support for zynq7000-fpga-manager

Ahmad Fatoum a.fatoum at pengutronix.de
Thu Mar 25 08:09:18 GMT 2021


Hello Michael,

On 25.03.21 08:53, Michael Graichen wrote:
> +	reg = readl(mgr->regs + CTRL_OFFSET);
> +	reg &= ~CTRL_PCFG_PROG_B_MASK;
> +	writel(reg, mgr->regs + CTRL_OFFSET);
> +
> +	readl_poll_timeout(mgr->regs + STATUS_OFFSET, reg,
> +			!(reg & STATUS_PCFG_INIT_MASK), 100 * USEC_PER_MSEC);

Perhaps exit if a timeout occurred? Unchecked readx_poll_timeout looks odd.

> +	/* Check for errors */
> +	if(reg & INT_STS_ERROR_FLAGS_MASK) {

Missing space

> +		printf("interrupt status register (0x%04lx)\n", reg);

Better use pr_warn and co here with a suitable pr_fmt at top:

 - Messages will indicate where the error came from
 - Messages can be formatted according to severity
 - Messages will go into the barebox log, which Linux could read out via
   pstore if needed.

Cheers,
Ahmad

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list