// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 1999-2000 Russell King * * ISA DMA primitives * Taken from various sources, including: * linux/include/asm/dma.h: Defines for using and allocating dma channels. * Written by Hennus Bergman, 1992. * High DMA channel support & info by Hannu Savolainen and John Boyd, * Nov. 1992. * arch/arm/kernel/dma-ebsa285.c * Copyright (C) 1998 Phil Blundell
*/ #include <linux/dma-map-ops.h> #include <linux/ioport.h> #include <linux/init.h> #include <linux/dma-mapping.h> #include <linux/io.h>
/* * ISA DMA always starts at channel 0
*/ staticint __init isa_dma_init(void)
{ /* * Try to autodetect presence of an ISA DMA controller. * We do some minimal initialisation, and check that * channel 0's DMA address registers are writeable.
*/
outb(0xff, 0x0d);
outb(0xff, 0xda);
/* * Write high and low address, and then read them back * in the same order.
*/
outb(0x55, 0x00);
outb(0xaa, 0x00);
/* * Is this correct? According to my documentation, it * doesn't appear to be. It should be: * outb(0x3f, 0x40b); outb(0x3f, 0x4d6);
*/
outb(0x30, 0x40b);
outb(0x31, 0x40b);
outb(0x32, 0x40b);
outb(0x33, 0x40b);
outb(0x31, 0x4d6);
outb(0x32, 0x4d6);
outb(0x33, 0x4d6);
for (i = 0; i < ARRAY_SIZE(dma_resources); i++)
request_resource(&ioport_resource, dma_resources + i);
for (chan = 0; chan < 8; chan++) { int ret = isa_dma_add(chan, &isa_dma[chan]); if (ret)
pr_err("ISADMA%u: unable to register: %d\n",
chan, ret);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.