Skip to contentSkip to conversation

MIPS: DMA support for RC4030 chipset [v5]

PATCH Applied Hervé Poussineau 2 participants 2 messages Dec 31, 2008 – Jan 1, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: DMA support for RC4030 chipset [v5]

Hi,

Attached patch implements DMA support to RC4030 chipset and simplifies jazz IO part (at 0xf0000000), where registers contain 16 bit values. Config register has not a clear meaning (only one value is always valid, and sometimes another one), so use a magic value instead. The patch also wires DMA transfers for the SCSI adapter in the Jazz emulation (Mips Magnum 4000 and Acer Pica 61).

Changes since v1:
- Support reuse of esp callback functions up to DMA engine
- Don't keep in memory the DMA table, but read it when needed

Changes since v2:
- Don't use cpu_single_env in the DMA transfer function, as it is NULL in the aio path
- Multiple improvements to the DMA transfer function: report errors to the caller, support for non contiguous physical pages...

Changes since v3:
- Mask out higher bits of DMA translation table address

Changes since v4:
- Fix warnings on 64 bit hosts
- Document a change on the config register

Hervé

mips.h +5 -1
Index: hw/mips.h
===================================================================
@@ -27,6 +27,10 @@
 extern void cpu_mips_clock_init(CPUState *);
 
 /* rc4030.c */
-qemu_irq *rc4030_init(qemu_irq timer, qemu_irq jazz_bus);
+typedef struct rc4030DMAState *rc4030_dma;
+typedef void (*rc4030_dma_function)(void *dma, uint8_t *buf, int len);
+qemu_irq *rc4030_init(qemu_irq timer, qemu_irq jazz_bus,
+                      rc4030_dma **dmas,
+                      rc4030_dma_function *dma_read, rc4030_dma_function *dma_write);
 
 #endif
mips_jazz.c +32 -14

97 lines not on this page · raw message

rc4030.c +209 -77

469 lines not on this page · raw message

#1 lore raw
Quoted 21 lines · Hervé Poussineau

Hi,

Attached patch implements DMA support to RC4030 chipset and simplifies jazz IO part (at 0xf0000000), where registers contain 16 bit values. Config register has not a clear meaning (only one value is always valid, and sometimes another one), so use a magic value instead. The patch also wires DMA transfers for the SCSI adapter in the Jazz emulation (Mips Magnum 4000 and Acer Pica 61).

Changes since v1:
- Support reuse of esp callback functions up to DMA engine
- Don't keep in memory the DMA table, but read it when needed

Changes since v2:
- Don't use cpu_single_env in the DMA transfer function, as it is NULL in the aio path
- Multiple improvements to the DMA transfer function: report errors to the caller, support for non contiguous physical pages...

Quoted 7 lines

Changes since v3:
- Mask out higher bits of DMA translation table address

Changes since v4:
- Fix warnings on 64 bit hosts
- Document a change on the config register

Thanks, applied.

Signature · 4 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net