mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/philmd-gitlab/tags/pflash-next-20190701' into staging
Implement the following AMD command-set parallel flash functionality: - nonuniform sector sizes; - erase suspend/resume commands; and - multi-sector erase. # gpg: Signature made Tue 02 Jul 2019 01:54:33 BST # gpg: using RSA key E3E32C2CDEADC0DE # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full] # Primary key fingerprint: FAAB E75E 1291 7221 DCFD 6BB2 E3E3 2C2C DEAD C0DE * remotes/philmd-gitlab/tags/pflash-next-20190701: (27 commits) hw/block/pflash_cfi02: Reduce I/O accesses to 16-bit hw/block/pflash_cfi02: Document commands hw/block/pflash_cfi02: Use chip erase time specified in the CFI table hw/block/pflash_cfi02: Implement erase suspend/resume hw/block/pflash_cfi02: Implement multi-sector erase hw/block/pflash_cfi02: Fix reset command not ignored during erase hw/block/pflash_cfi02: Fix CFI in autoselect mode hw/block/pflash_cfi02: Split if() condition hw/block/pflash_cfi02: Extract pflash_regions_count() hw/block/pflash_cfi02: Implement nonuniform sector sizes hw/block/pflash_cfi02: Document 'Page Mode' operations are not supported hw/block/pflash_cfi02: Hold the PRI table offset in a variable hw/block/pflash_cfi02: Document the current CFI values hw/block/pflash_cfi02: Remove pointless local variable tests/pflash-cfi02: Refactor to support testing multiple configurations hw/block/pflash_cfi02: Fix command address comparison hw/block/pflash_cfi02: Unify the MemoryRegionOps hw/block/pflash_cfi02: Extract the pflash_data_read() function hw/block/pflash_cfi02: Use the ldst API in pflash_read() hw/block/pflash_cfi02: Use the ldst API in pflash_write() ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -248,7 +248,6 @@ static uint32_t pflash_data_read(PFlashCFI01 *pfl, hwaddr offset,
|
||||
switch (width) {
|
||||
case 1:
|
||||
ret = p[offset];
|
||||
trace_pflash_data_read8(offset, ret);
|
||||
break;
|
||||
case 2:
|
||||
if (be) {
|
||||
@@ -258,7 +257,6 @@ static uint32_t pflash_data_read(PFlashCFI01 *pfl, hwaddr offset,
|
||||
ret = p[offset];
|
||||
ret |= p[offset + 1] << 8;
|
||||
}
|
||||
trace_pflash_data_read16(offset, ret);
|
||||
break;
|
||||
case 4:
|
||||
if (be) {
|
||||
@@ -272,12 +270,12 @@ static uint32_t pflash_data_read(PFlashCFI01 *pfl, hwaddr offset,
|
||||
ret |= p[offset + 2] << 16;
|
||||
ret |= p[offset + 3] << 24;
|
||||
}
|
||||
trace_pflash_data_read32(offset, ret);
|
||||
break;
|
||||
default:
|
||||
DPRINTF("BUG in %s\n", __func__);
|
||||
abort();
|
||||
}
|
||||
trace_pflash_data_read(offset, width << 1, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -288,7 +286,6 @@ static uint32_t pflash_read(PFlashCFI01 *pfl, hwaddr offset,
|
||||
uint32_t ret;
|
||||
|
||||
ret = -1;
|
||||
trace_pflash_read(offset, pfl->cmd, width, pfl->wcycle);
|
||||
switch (pfl->cmd) {
|
||||
default:
|
||||
/* This should never happen : reset state & treat it as a read */
|
||||
@@ -391,6 +388,8 @@ static uint32_t pflash_read(PFlashCFI01 *pfl, hwaddr offset,
|
||||
|
||||
break;
|
||||
}
|
||||
trace_pflash_io_read(offset, width, width << 1, ret, pfl->cmd, pfl->wcycle);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -414,7 +413,7 @@ static inline void pflash_data_write(PFlashCFI01 *pfl, hwaddr offset,
|
||||
{
|
||||
uint8_t *p = pfl->storage;
|
||||
|
||||
trace_pflash_data_write(offset, value, width, pfl->counter);
|
||||
trace_pflash_data_write(offset, width << 1, value, pfl->counter);
|
||||
switch (width) {
|
||||
case 1:
|
||||
p[offset] = value;
|
||||
@@ -453,7 +452,7 @@ static void pflash_write(PFlashCFI01 *pfl, hwaddr offset,
|
||||
|
||||
cmd = value;
|
||||
|
||||
trace_pflash_write(offset, value, width, pfl->wcycle);
|
||||
trace_pflash_io_write(offset, width, width << 1, value, pfl->wcycle);
|
||||
if (!pfl->wcycle) {
|
||||
/* Set the device in I/O access mode */
|
||||
memory_region_rom_device_set_romd(&pfl->mem, false);
|
||||
|
||||
+480
-221
File diff suppressed because it is too large
Load Diff
@@ -7,13 +7,11 @@ fdc_ioport_write(uint8_t reg, uint8_t value) "write reg 0x%02x val 0x%02x"
|
||||
# pflash_cfi02.c
|
||||
# pflash_cfi01.c
|
||||
pflash_reset(void) "reset"
|
||||
pflash_read(uint64_t offset, uint8_t cmd, int width, uint8_t wcycle) "offset:0x%04"PRIx64" cmd:0x%02x width:%d wcycle:%u"
|
||||
pflash_write(uint64_t offset, uint32_t value, int width, uint8_t wcycle) "offset:0x%04"PRIx64" value:0x%03x width:%d wcycle:%u"
|
||||
pflash_timer_expired(uint8_t cmd) "command 0x%02x done"
|
||||
pflash_data_read8(uint64_t offset, uint32_t value) "data offset:0x%04"PRIx64" value:0x%02x"
|
||||
pflash_data_read16(uint64_t offset, uint32_t value) "data offset:0x%04"PRIx64" value:0x%04x"
|
||||
pflash_data_read32(uint64_t offset, uint32_t value) "data offset:0x%04"PRIx64" value:0x%08x"
|
||||
pflash_data_write(uint64_t offset, uint32_t value, int width, uint64_t counter) "data offset:0x%04"PRIx64" value:0x%08x width:%d counter:0x%016"PRIx64
|
||||
pflash_io_read(uint64_t offset, int width, int fmt_width, uint32_t value, uint8_t cmd, uint8_t wcycle) "offset:0x%04"PRIx64" width:%d value:0x%0*x cmd:0x%02x wcycle:%u"
|
||||
pflash_io_write(uint64_t offset, int width, int fmt_width, uint32_t value, uint8_t wcycle) "offset:0x%04"PRIx64" width:%d value:0x%0*x wcycle:%u"
|
||||
pflash_data_read(uint64_t offset, int width, uint32_t value) "data offset:0x%04"PRIx64" value:0x%0*x"
|
||||
pflash_data_write(uint64_t offset, int width, uint32_t value, uint64_t counter) "data offset:0x%04"PRIx64" value:0x%0*x counter:0x%016"PRIx64
|
||||
pflash_manufacturer_id(uint16_t id) "Read Manufacturer ID: 0x%04x"
|
||||
pflash_device_id(uint16_t id) "Read Device ID: 0x%04x"
|
||||
pflash_device_info(uint64_t offset) "Read Device Information offset:0x%04"PRIx64
|
||||
|
||||
@@ -260,6 +260,7 @@ check-qtest-arm-y += tests/m25p80-test$(EXESUF)
|
||||
check-qtest-arm-y += tests/test-arm-mptimer$(EXESUF)
|
||||
check-qtest-arm-y += tests/boot-serial-test$(EXESUF)
|
||||
check-qtest-arm-y += tests/hexloader-test$(EXESUF)
|
||||
check-qtest-arm-$(CONFIG_PFLASH_CFI02) += tests/pflash-cfi02-test$(EXESUF)
|
||||
|
||||
check-qtest-aarch64-y = tests/numa-test$(EXESUF)
|
||||
check-qtest-aarch64-y += tests/boot-serial-test$(EXESUF)
|
||||
@@ -767,6 +768,7 @@ tests/device-introspect-test$(EXESUF): tests/device-introspect-test.o
|
||||
tests/rtc-test$(EXESUF): tests/rtc-test.o
|
||||
tests/m48t59-test$(EXESUF): tests/m48t59-test.o
|
||||
tests/hexloader-test$(EXESUF): tests/hexloader-test.o
|
||||
tests/pflash-cfi02$(EXESUF): tests/pflash-cfi02-test.o
|
||||
tests/endianness-test$(EXESUF): tests/endianness-test.o
|
||||
tests/prom-env-test$(EXESUF): tests/prom-env-test.o $(libqos-obj-y)
|
||||
tests/rtas-test$(EXESUF): tests/rtas-test.o $(libqos-spapr-obj-y)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user