Page MenuHomeFreeBSD

bcm2835_sdhci.c: save block registers to avoid controller bug

Authored by bz on May 8 2019, 9:45 AM.


Extending what the initial revision, r273264, r276985, r277346 have
started for the transfer mode and command registers, another pair of
16bit registers written in sequence are block size and block count,
which fall together onto the same 32bit line and hence the same
register(s) would be written twice in sequence for those as well.

Use a similar approach to transfer mode and command and save the writes
to either of the block regiters and then only execute a write once.
We can do this as with transfer mode their values are meaningless until
a command is issued so we can use that write to command as a trigger
to also write out the block registers.
Compared to transfer mode and command the value of block count can
change, so we need to keep state and actually read the block registers
back the first time after a write.

MFC after:      6 weeks

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

bz created this revision.May 8 2019, 9:45 AM
emaste added a comment.May 8 2019, 2:06 PM

Handy Phabricator links: rS273264, rS276985, rS277346

bz added a comment.Jun 1 2019, 5:46 PM

I'd like to commit this the next days. Can someone please review? If not it'll go in by Sat 8 June.

This revision was not accepted when it landed; it landed in state Needs Review.Jun 8 2019, 4:05 PM
This revision was automatically updated to reflect the committed changes.