Skip to content

block, arm: Fix buffered flash writes on VExpress

Roy Franz qemu-devel 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest posting 2/27 patches 8 repliesIn review
  2. v43 of 4 patches 8 repliesSuperseded
  3. v5 posting 1/21 of 4 patches 4 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v32 patches1 replySuperseded
v22 patches1 replySuperseded

Changes in v5 from the cover letter

* Added device_max_width parameter to enable proper device id and CFI responses.
* Device width now set to 0 to indicate it is not set, and this is used to keep behavior unchanged for platforms not updated.
* Fixed device ID and CFI responses to properly take into account device width. For the VExpress platform this mostly matches the hardware.
* Refactored VExpress flash init code based on feedback.
* now uses helper functions for many bitfield operations.
* Fixed checkpatch problems in v4.
* NOTE: patch 2/4 of v5 was mis-identified in that submission as v5.

Patches in v5 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7rename pflash_t member width to bank_widthhw/block/pflash_cfi01.c+9 -80 replies
2/7Add device-width property to pflash_cfi01hw/block/pflash_cfi01.c+11 -01 reply
3/7return status for each NOR flash devicehw/block/pflash_cfi01.c+13 -21 reply
4/7Set proper device-width for vexpress flashhw/arm/vexpress.c+34 -101 reply
5/7Add max device width parameter for NOR deviceshw/block/pflash_cfi01.c+9 -03 replies
6/7Fix CFI query responses for NOR flashhw/block/pflash_cfi01.c+92 -111 reply
7/7Fix NOR flash device ID readinghw/arm/vexpress.c hw/block/pflash_cfi01.c+90 -231 reply

Reviews trailers per patch

6 of 7 patches have a Reviewed-by or Acked-by.

PatchPeter Maydell
1/7R-b
2/7R-b
3/7R-b
4/7R-b
5/7
6/7R-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [Qemu-devel] [PATCH V5 0/7] block, arm: Fix buffered flash writes on VExpress

This patchset fixes buffered flash writes on the VExpress platform. Buffered writes should now work properly on platforms whose flash interface width is different from the device width. The default is for the device-width to be set to 0, so platforms
that can benefit from this change will need to be updated. This patchset updates the configuration for the VExpress platform which requires it. UEFI firmware uses buffered writes for persistent variable storage, and this patchset enables this usage on QEMU.

The CFI and device ID changes were tested against a real VExpress board by dumping the data. UEFI itself does not use the device ID or CFI information.

I think that the current device ID handling code is broken. I did not remove it in this patchset as I am reluctant to make changes to platforms I can't test, and do not know the actual flash device configuration for.

Changes from v4:
* Added device_max_width parameter to enable proper device id and CFI responses.
* Device width now set to 0 to indicate it is not set, and this is used to keep behavior unchanged for platforms not updated.
* Fixed device ID and CFI responses to properly take into account device width. For the VExpress platform this mostly matches the hardware.
* Refactored VExpress flash init code based on feedback.
* now uses helper functions for many bitfield operations.
* Fixed checkpatch problems in v4.
* NOTE: patch 2/4 of v5 was mis-identified in that submission as v5.

Changes from v3:
* Broke out width->bank_width name change into separate patch.
* Added patch that returns status for each device in bank.
* Reviewed code for other uses of device_width. The one remaining place this should be used is in the handling of returning the device ID. The existing code looks a bit suspect, as it is combining 16 bit values by shifting 8 bits and oring them. I have no good way to test various flash configurations, so I am reluctant to make major changes to that code.
Changes from v2:
(All changes in patch 2/2, 1/1 unchanged.)
* Set flash invariant properties directly in VExpress specific flash init routine rather than passing long argument list.
* Fix typo in comment.

Changes from v1:
* Add device-width property and use this to mask write length instead of devices mas write length
* Update vexpress init code to set device-width to proper value.

Roy Franz (7):
rename pflash_t member width to bank_width
Add device-width property to pflash_cfi01
return status for each NOR flash device
Set proper device-width for vexpress flash
Add max device width parameter for NOR devices
Fix CFI query responses for NOR flash
Fix NOR flash device ID reading

 hw/arm/vexpress.c       |   44 +++++++--
 hw/block/pflash_cfi01.c |  244 ++++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 246 insertions(+), 42 deletions(-)
Signature · 1 line
1.7.10.4