diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2008-09-27 15:41:16 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2008-09-27 15:41:16 +0000 |
commit | e873cabccd956a8738db1ee6d04dc32c1614c9e3 (patch) | |
tree | 0c72c5408fd08c24fca5f4bd5fbe09226eaa9862 /sys/powerpc/powermac | |
parent | 3177393070971da5219f5f2ef9b2e19b00821465 (diff) | |
download | FreeBSD-src-e873cabccd956a8738db1ee6d04dc32c1614c9e3.zip FreeBSD-src-e873cabccd956a8738db1ee6d04dc32c1614c9e3.tar.gz |
Expand the DBDMA API to allow setting device-dependent control bits. While
here, clean up and document this a little.
Submitted by: Marco Trillo
MFC after: 1 week
Diffstat (limited to 'sys/powerpc/powermac')
-rw-r--r-- | sys/powerpc/powermac/dbdma.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/sys/powerpc/powermac/dbdma.c b/sys/powerpc/powermac/dbdma.c index edae6e2..ebc0122 100644 --- a/sys/powerpc/powermac/dbdma.c +++ b/sys/powerpc/powermac/dbdma.c @@ -127,6 +127,13 @@ dbdma_get_cmd_status(dbdma_channel_t *chan, int slot) return (le16toh(chan->sc_slots[slot].resCount)); } +void +dbdma_clear_cmd_status(dbdma_channel_t *chan, int slot) +{ + /* See endian note above */ + chan->sc_slots[slot].resCount = 0; +} + uint16_t dbdma_get_residuals(dbdma_channel_t *chan, int slot) { @@ -212,13 +219,24 @@ dbdma_get_chan_status(dbdma_channel_t *chan) } uint8_t -dbdma_get_chan_device_status(dbdma_channel_t *chan) +dbdma_get_device_status(dbdma_channel_t *chan) { - return (dbdma_get_chan_status(chan) & 0x00ff); } void +dbdma_set_device_status(dbdma_channel_t *chan, uint8_t mask, uint8_t value) +{ + uint32_t control_reg; + + control_reg = mask; + control_reg <<= 16; + control_reg |= value; + + dbdma_write_reg(chan, CHAN_CONTROL_REG, control_reg); +} + +void dbdma_set_interrupt_selector(dbdma_channel_t *chan, uint8_t mask, uint8_t val) { uint32_t intr_select; |