Revision c8b153d7 hw/pflash_cfi01.c
b/hw/pflash_cfi01.c | ||
---|---|---|
111 | 111 |
else if (pfl->width == 4) |
112 | 112 |
boff = boff >> 2; |
113 | 113 |
|
114 |
DPRINTF("%s: reading offset %08x under cmd %02x\n",
|
|
115 |
__func__, boff, pfl->cmd);
|
|
114 |
DPRINTF("%s: reading offset " TARGET_FMT_lx " under cmd %02x\n",
|
|
115 |
__func__, boff, pfl->cmd); |
|
116 | 116 |
|
117 | 117 |
switch (pfl->cmd) { |
118 | 118 |
case 0x00: |
... | ... | |
121 | 121 |
switch (width) { |
122 | 122 |
case 1: |
123 | 123 |
ret = p[offset]; |
124 |
DPRINTF("%s: data offset %08x %02x\n", __func__, offset, ret); |
|
124 |
DPRINTF("%s: data offset " TARGET_FMT_lx " %02x\n", |
|
125 |
__func__, offset, ret); |
|
125 | 126 |
break; |
126 | 127 |
case 2: |
127 | 128 |
#if defined(TARGET_WORDS_BIGENDIAN) |
... | ... | |
131 | 132 |
ret = p[offset]; |
132 | 133 |
ret |= p[offset + 1] << 8; |
133 | 134 |
#endif |
134 |
DPRINTF("%s: data offset %08x %04x\n", __func__, offset, ret); |
|
135 |
DPRINTF("%s: data offset " TARGET_FMT_lx " %04x\n", |
|
136 |
__func__, offset, ret); |
|
135 | 137 |
break; |
136 | 138 |
case 4: |
137 | 139 |
#if defined(TARGET_WORDS_BIGENDIAN) |
... | ... | |
146 | 148 |
ret |= p[offset + 2] << 16; |
147 | 149 |
ret |= p[offset + 3] << 24; |
148 | 150 |
#endif |
149 |
DPRINTF("%s: data offset %08x %08x\n", __func__, offset, ret); |
|
151 |
DPRINTF("%s: data offset " TARGET_FMT_lx " %08x\n", |
|
152 |
__func__, offset, ret); |
|
150 | 153 |
break; |
151 | 154 |
default: |
152 | 155 |
DPRINTF("BUG in %s\n", __func__); |
... | ... | |
208 | 211 |
else |
209 | 212 |
offset -= pfl->base; |
210 | 213 |
|
211 |
DPRINTF("%s: offset %08x %08x %d wcycle 0x%x\n",
|
|
212 |
__func__, offset, value, width, pfl->wcycle);
|
|
214 |
DPRINTF("%s: offset " TARGET_FMT_lx " %08x %d wcycle 0x%x\n",
|
|
215 |
__func__, offset, value, width, pfl->wcycle); |
|
213 | 216 |
|
214 | 217 |
/* Set the device in I/O access mode */ |
215 | 218 |
cpu_register_physical_memory(pfl->base, pfl->total_len, pfl->fl_mem); |
... | ... | |
230 | 233 |
p = pfl->storage; |
231 | 234 |
offset &= ~(pfl->sector_len - 1); |
232 | 235 |
|
233 |
DPRINTF("%s: block erase at 0x%x bytes 0x%x\n", __func__, |
|
234 |
offset, pfl->sector_len); |
|
236 |
DPRINTF("%s: block erase at " TARGET_FMT_lx " bytes " |
|
237 |
TARGET_FMT_lx "\n", |
|
238 |
__func__, offset, pfl->sector_len); |
|
235 | 239 |
|
236 | 240 |
memset(p + offset, 0xff, pfl->sector_len); |
237 | 241 |
pflash_update(pfl, offset, pfl->sector_len); |
... | ... | |
278 | 282 |
|
279 | 283 |
break; |
280 | 284 |
case 0xe8: |
281 |
DPRINTF("%s: block write of 0x%x bytes\n", __func__, cmd);
|
|
285 |
DPRINTF("%s: block write of %x bytes\n", __func__, cmd); |
|
282 | 286 |
pfl->counter = cmd; |
283 | 287 |
pfl->wcycle++; |
284 | 288 |
break; |
... | ... | |
311 | 315 |
switch (pfl->cmd) { |
312 | 316 |
case 0xe8: /* Block write */ |
313 | 317 |
p = pfl->storage; |
314 |
DPRINTF("%s: block write offset 0x%x value 0x%x counter 0x%x\n", |
|
315 |
__func__, offset, value, pfl->counter); |
|
318 |
DPRINTF("%s: block write offset " TARGET_FMT_lx |
|
319 |
" value %x counter " TARGET_FMT_lx "\n", |
|
320 |
__func__, offset, value, pfl->counter); |
|
316 | 321 |
switch (width) { |
317 | 322 |
case 1: |
318 | 323 |
p[offset] = value; |
... | ... | |
382 | 387 |
|
383 | 388 |
error_flash: |
384 | 389 |
printf("%s: Unimplemented flash cmd sequence " |
385 |
"(offset 0x%x, wcycle 0x%x cmd 0x%x value 0x%x\n",
|
|
386 |
__func__, offset, pfl->wcycle, pfl->cmd, value);
|
|
390 |
"(offset " TARGET_FMT_lx ", wcycle 0x%x cmd 0x%x value 0x%x\n",
|
|
391 |
__func__, offset, pfl->wcycle, pfl->cmd, value); |
|
387 | 392 |
|
388 | 393 |
reset_flash: |
389 | 394 |
cpu_register_physical_memory(pfl->base, pfl->total_len, |
... | ... | |
484 | 489 |
} |
485 | 490 |
|
486 | 491 |
pflash_t *pflash_cfi01_register(target_phys_addr_t base, ram_addr_t off, |
487 |
BlockDriverState *bs, target_ulong sector_len,
|
|
492 |
BlockDriverState *bs, uint32_t sector_len,
|
|
488 | 493 |
int nb_blocs, int width, |
489 | 494 |
uint16_t id0, uint16_t id1, |
490 | 495 |
uint16_t id2, uint16_t id3) |
... | ... | |
495 | 500 |
total_len = sector_len * nb_blocs; |
496 | 501 |
|
497 | 502 |
/* XXX: to be fixed */ |
503 |
#if 0 |
|
498 | 504 |
if (total_len != (8 * 1024 * 1024) && total_len != (16 * 1024 * 1024) && |
499 | 505 |
total_len != (32 * 1024 * 1024) && total_len != (64 * 1024 * 1024)) |
500 | 506 |
return NULL; |
507 |
#endif |
|
501 | 508 |
|
502 | 509 |
pfl = qemu_mallocz(sizeof(pflash_t)); |
503 | 510 |
|
Also available in: Unified diff