[PATCH linux dev-5.3 7/7] fsi: aspeed: Special case repeated full word reads
Jeremy Kerr
jk at ozlabs.org
Tue Oct 29 14:16:56 AEDT 2019
Hi Joel,
> The driver can skip doing some of the AHB2OPB setup if the operation is
> of the same type. Experiment with this for full word reads, which could
> be extended to writes if it shows an improvement.
I would have taken a slightly different approach here - to do the "last
value" caching at the OPB register set level, rather than working at the
FSI-operation level. ie, keep a copy of the AHB registers that control
OPB transactions, then only set them when they differ from the intended
writes.
That would give us something like this for opb_read():
if (aspeed->opb0_select != 0x1) {
aspeed->opb0_select = 0x1;
writel(aspeed->opb0_select, base + OPB0_SELECT);
}
if (aspeed->opb0_rw != CMD_READ) {
aspeed->opb0_rw = CMD_READ;
writel(aspeed->opb0_rw, base + OPB0_RW);
}
if (aspeed->opb0_xfer_size != XFER_WORD) {
aspeed->opb0_xfer_size = XFER_WORD;
writel(aspeed->opb0_xfer_size, base + OPB0_XFER_SIZE);
}
if (aspeed->opb0_addr != addr) {
aspeed->opb0_addr = addr;
writel(aspeed->opb0_addr, base + OPB0_FSI_ADDR
}
writel(0x1, base + OPB_IRQ_CLEAR);
writel(0x1, base + OPB_TRIGGER);
[which we could simplify with a helper function for the caching...]
However, if the aim is to just stage this to just the fullword reads for
now, this looks fine for me.
Cheers,
Jeremy
More information about the openbmc
mailing list