qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-block] [PATCH] pflash_cfi01: fix per device sector length in CFI t


From: David Engraf
Subject: [Qemu-block] [PATCH] pflash_cfi01: fix per device sector length in CFI table
Date: Thu, 12 Jan 2017 11:35:15 +0100

The CFI entry for sector length must be set to sector length per device. This is important for boards using multiple devices like the ARM Vexpress board (width = 4, device-width = 2).

Linux and u-boots calculate the size ratio by dividing both values:

size_ratio = info->portwidth / info->chipwidth;

After that the sector length will be multiplied by the size_ratio, thus the CFI entry for sector length is doubled. When Linux or u-boot send a sector erase, they expect to erase the doubled sector length, but QEMU only erases the board specified sector length.

This patch fixes the sector length in the CFI table to match the length per device, equal to blocks_per_device.

Signed-off-by: David Engraf <address@hidden>

Attachment: fix_pflash_sector_len.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]