From 0163a2dc80b52553a478fa6e60f09cef4b338d42 Mon Sep 17 00:00:00 2001 From: Roy Franz Date: Tue, 17 Dec 2013 19:42:27 +0000 Subject: Fix NOR flash device ID reading Fix NOR flash manufacturer and device ID reading. This now properly takes into account device widths and device max widths as required. The reading of these IDs uses the same max_width dependent addressing as CFI queries. The old code remains for chips that don't specify a device width, as the new code relies on a device width being set in order to properly operate. The existing code seems very broken. Only ident0 and ident1 are used in the new code, as other fields relate to the lock state of blocks in flash. The VExpress flash configuration has been updated to match the new code, as the existing definition was 'wrong' in order to return the expected results with the broken device ID code. Signed-off-by: Roy Franz Message-id: 1386279359-32286-8-git-send-email-roy.franz@linaro.org Signed-off-by: Peter Maydell --- hw/arm/vexpress.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'hw/arm/vexpress.c') diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 939b468bc8..aaa863e481 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -499,10 +499,10 @@ static pflash_t *ve_pflash_cfi01_register(hwaddr base, const char *name, qdev_prop_set_uint8(dev, "width", 4); qdev_prop_set_uint8(dev, "device-width", 2); qdev_prop_set_uint8(dev, "big-endian", 0); - qdev_prop_set_uint16(dev, "id0", 0x00); - qdev_prop_set_uint16(dev, "id1", 0x89); + qdev_prop_set_uint16(dev, "id0", 0x89); + qdev_prop_set_uint16(dev, "id1", 0x18); qdev_prop_set_uint16(dev, "id2", 0x00); - qdev_prop_set_uint16(dev, "id3", 0x18); + qdev_prop_set_uint16(dev, "id3", 0x00); qdev_prop_set_string(dev, "name", name); qdev_init_nofail(dev); -- cgit v1.2.3