-----BEGIN PGP SIGNATURE-----

Version: GnuPG v1
 
 iQIcBAABAgAGBQJVu/WGAAoJEH3vgQaq/DkOWCcP/AnTuFcatf30pvHeniLxokLa
 t+6dLGo+KC6qPz4TpYcjQ9sA7pwZhk0/KSUTUnbZGQ8P0+uoxQ66OcL0UGvjZck1
 0da261meUWWyNzVhZK1JHZggfpn/H/EaXBM0OQojnhe0xmtrVR4RJqaqW1ZjNFL/
 jsw4HcA6BENokU8+wwYnX4HodX5ej2mh4GZpaPKh8gk7ryyeB1SermLcL7kvFvyZ
 1DFVPcmsxBXm93gVIaOP0u4lhAWFKzN6/0N2PSxUkdcvtTTbxxx78SOkVP74BICI
 q+IrwGGckfNoF2KIImKK2i09lsBqdW0GSK39RCPt2GBWWuThgJOjITGvGTD5PMz1
 uKBJJ2syO4MlmRhTbwM+slhSPiC5SCi0mWqE0y+RSpbbix12tTZ6FGkVTdgxH4L3
 f55LQz+u7jJiqNlY/K146nfbHbvKOvamupWvG112QabFSXotq0Iy2Q2py2rLJ6Ud
 GbSlAGSQ7KykD3NSu+UHV893lb/dZUb2cozER2qMXvO1md5643hsYvw+t5a6UYCV
 YsOM6nt+C575WUJfz/TNyVpRPgPU7hDYDEUKg7Qjn4MdMv50d+Zc+HG8BfvCXE3D
 UH+4kGDjCc9Ibgk5zmuc60Nka2xFKMq01615S7fVr5jRNgG8z+PcvkGuh+wIXXuJ
 rU5zBlPRozqqwOm256v9
 =76Uv
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into staging

# gpg: Signature made Fri Jul 31 23:24:06 2015 BST using RSA key ID AAFC390E
# gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: FAEB 9711 A12C F475 812F  18F2 88A9 064D 1835 61EB
#      Subkey fingerprint: F9B7 ABDB BCAC DF95 BE76  CBD0 7DEF 8106 AAFC 390E

* remotes/jnsnow/tags/ide-pull-request:
  ahci: fix ICC mask definition
  macio: re-add TRIM support

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2015-08-03 10:44:23 +01:00
commit ff90f84e74
2 changed files with 29 additions and 1 deletions

View File

@ -127,7 +127,7 @@
#define PORT_CMD_SPIN_UP (1 << 1) /* Spin up device */
#define PORT_CMD_START (1 << 0) /* Enable port DMA engine */
#define PORT_CMD_ICC_MASK (0xf << 28) /* i/f ICC state mask */
#define PORT_CMD_ICC_MASK (0xfU << 28) /* i/f ICC state mask */
#define PORT_CMD_ICC_ACTIVE (0x1 << 28) /* Put i/f in active state */
#define PORT_CMD_ICC_PARTIAL (0x2 << 28) /* Put i/f in partial state */
#define PORT_CMD_ICC_SLUMBER (0x6 << 28) /* Put i/f in slumber state */

View File

@ -208,6 +208,33 @@ static void pmac_dma_write(BlockBackend *blk,
cb, io);
}
static void pmac_dma_trim(BlockBackend *blk,
int64_t offset, int bytes,
void (*cb)(void *opaque, int ret), void *opaque)
{
DBDMA_io *io = opaque;
MACIOIDEState *m = io->opaque;
IDEState *s = idebus_active_if(&m->bus);
dma_addr_t dma_addr, dma_len;
void *mem;
qemu_iovec_destroy(&io->iov);
qemu_iovec_init(&io->iov, io->len / MACIO_PAGE_SIZE + 1);
dma_addr = io->addr;
dma_len = io->len;
mem = dma_memory_map(&address_space_memory, dma_addr, &dma_len,
DMA_DIRECTION_TO_DEVICE);
qemu_iovec_add(&io->iov, mem, io->len);
s->io_buffer_size -= io->len;
s->io_buffer_index += io->len;
io->len = 0;
m->aiocb = ide_issue_trim(blk, (offset >> 9), &io->iov, (bytes >> 9),
cb, io);
}
static void pmac_ide_atapi_transfer_cb(void *opaque, int ret)
{
DBDMA_io *io = opaque;
@ -313,6 +340,7 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
pmac_dma_write(s->blk, offset, io->len, pmac_ide_transfer_cb, io);
break;
case IDE_DMA_TRIM:
pmac_dma_trim(s->blk, offset, io->len, pmac_ide_transfer_cb, io);
break;
}