Revision a66e360f hw/pflash_cfi01.c

b/hw/pflash_cfi01.c
239 239
static void pflash_write(pflash_t *pfl, target_phys_addr_t offset,
240 240
                         uint32_t value, int width)
241 241
{
242
    target_phys_addr_t boff;
243 242
    uint8_t *p;
244 243
    uint8_t cmd;
245 244

  
......
250 249

  
251 250
    /* Set the device in I/O access mode */
252 251
    cpu_register_physical_memory(pfl->base, pfl->total_len, pfl->fl_mem);
253
    boff = offset & (pfl->sector_len - 1);
254

  
255
    if (pfl->width == 2)
256
        boff = boff >> 1;
257
    else if (pfl->width == 4)
258
        boff = boff >> 2;
259 252

  
260 253
    switch (pfl->wcycle) {
261 254
    case 0:

Also available in: Unified diff