pflash_cfi02.c (dab59ce031228066eb95a9c518846fcacfb0dbbf) pflash_cfi02.c (a9262f551eba44d4d0f9e396d7124c059a93e204)
1/*
2 * CFI parallel flash with AMD command set emulation
3 *
4 * Copyright (c) 2005 Jocelyn Mayer
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either

--- 386 unchanged lines hidden (view full) ---

395{
396 int offset_end;
397 int ret;
398 if (pfl->blk) {
399 offset_end = offset + size;
400 /* widen to sector boundaries */
401 offset = QEMU_ALIGN_DOWN(offset, BDRV_SECTOR_SIZE);
402 offset_end = QEMU_ALIGN_UP(offset_end, BDRV_SECTOR_SIZE);
1/*
2 * CFI parallel flash with AMD command set emulation
3 *
4 * Copyright (c) 2005 Jocelyn Mayer
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either

--- 386 unchanged lines hidden (view full) ---

395{
396 int offset_end;
397 int ret;
398 if (pfl->blk) {
399 offset_end = offset + size;
400 /* widen to sector boundaries */
401 offset = QEMU_ALIGN_DOWN(offset, BDRV_SECTOR_SIZE);
402 offset_end = QEMU_ALIGN_UP(offset_end, BDRV_SECTOR_SIZE);
403 ret = blk_pwrite(pfl->blk, offset, pfl->storage + offset,
404 offset_end - offset, 0);
403 ret = blk_pwrite(pfl->blk, offset, offset_end - offset,
404 pfl->storage + offset, 0);
405 if (ret < 0) {
406 /* TODO set error bit in status */
407 error_report("Could not update PFLASH: %s", strerror(-ret));
408 }
409 }
410}
411
412static void pflash_sector_erase(PFlashCFI02 *pfl, hwaddr offset)

--- 619 unchanged lines hidden ---
405 if (ret < 0) {
406 /* TODO set error bit in status */
407 error_report("Could not update PFLASH: %s", strerror(-ret));
408 }
409 }
410}
411
412static void pflash_sector_erase(PFlashCFI02 *pfl, hwaddr offset)

--- 619 unchanged lines hidden ---