]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/sd/sdcard: Document out-of-range addresses for SEND_WRITE_PROT
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Wed, 28 Jul 2021 17:38:05 +0000 (19:38 +0200)
committerMichael Roth <michael.roth@amd.com>
Thu, 14 Oct 2021 22:42:58 +0000 (17:42 -0500)
commit21611dd0a5634946367137a30f52a7677ff75928
tree32adeab8d70c704256da5ea1c6cb2ca8482f3529
parent4d3cfb2f6bb6afa07d0a9629136ae71eb6ab0268
hw/sd/sdcard: Document out-of-range addresses for SEND_WRITE_PROT

Per the 'Physical Layer Simplified Specification Version 3.01',
Table 4-22: 'Block Oriented Write Protection Commands'

  SEND_WRITE_PROT (CMD30)

  If the card provides write protection features, this command asks
  the card to send the status of the write protection bits [1].

  [1] 32 write protection bits (representing 32 write protect groups
  starting at the specified address) [...]
  The last (least significant) bit of the protection bits corresponds
  to the first addressed group. If the addresses of the last groups
  are outside the valid range, then the corresponding write protection
  bits shall be set to 0.

Split the if() statement (without changing the behaviour of the code)
to better position the description comment.

Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210802235524.3417739-2-f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Alexander Bulekov <alxndr@bu.edu>
(cherry picked from commit 2a0396285daa9483459ec1d3791951300b595e85)
*context dependency for 4ac0b72bae ("hw/sd/sdcard: Fix assertion accessing out-of-range addresses with CMD30")
Signed-off-by: Michael Roth <michael.roth@amd.com>
hw/sd/sd.c