/* This function triggers dummy write to the memory specified by the io_base, thus UPM pattern actually executed. Note that mar usage depends on the pre-programmed AMX bits in the UPM RAM.  */
int fsl_upm_run_pattern(struct fsl_upm *upm, void __iomem *io_base, u32 mar)
/* This function triggers dummy write to the memory specified by the io_base, thus UPM pattern actually executed. Note that mar usage depends on the pre-programmed AMX bits in the UPM RAM.  */
int fsl_upm_run_pattern(struct fsl_upm *upm, void __iomem *io_base, u32 mar)
{
	int ret = 0;
	unsigned long flags;
	spin_lock_irqsave(&fsl_lbc_lock, flags);
	out_be32(&fsl_lbc_regs->mar, mar);
	switch (upm->width) {
	case 8:
		out_8(io_base, 0x0);
		break;
	case 16:
		out_be16(io_base, 0x0);
		break;
	case 32:
		out_be32(io_base, 0x0);
		break;
	default:
		ret = -EINVAL;
		break;
	}
	spin_unlock_irqrestore(&fsl_lbc_lock, flags);
	return ret;
}