OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [arch/] [armnommu/] [kernel/] [dma-a5k.c] - Blame information for rev 1765

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1622 jcastillo
/*
2
 * arch/arm/kernel/dma-a5k.c
3
 *
4
 * Copyright (C) 1998 Russell King
5
 *
6
 * DMA functions specific to A5000 architecture
7
 */
8
#include <linux/sched.h>
9
 
10
#include <asm/dma.h>
11
#include <asm/io.h>
12
#include <asm/hardware.h>
13
#include <asm/pgtable.h>
14
 
15
#include "dma.h"
16
 
17
int arch_request_dma(dmach_t channel, dma_t *dma, const char *devname)
18
{
19
        if (channel == DMA_VIRTUAL_FLOPPY)
20
                return 0;
21
        else
22
                return -EINVAL;
23
}
24
 
25
void arch_free_dma(dmach_t channel, dma_t *dma)
26
{
27
        if (channel != DMA_VIRTUAL_FLOPPY)
28
                printk ("arch_free_dma: invalid channel %d\n", channel);
29
}
30
 
31
int arch_get_dma_residue(dmach_t channel, dma_t *dma)
32
{
33
        if (channel != DMA_VIRTUAL_FLOPPY) {
34
                printk ("arch_dma_count: invalid channel %d\n", channel);
35
                return 0;
36
        } else {
37
                extern int floppy_fiqresidual(void);
38
                return floppy_fiqresidual();
39
        }
40
}
41
 
42
void arch_enable_dma(dmach_t channel, dma_t *dma)
43
{
44
        if (channel != DMA_VIRTUAL_FLOPPY)
45
                printk ("arch_enable_dma: invalid channel %d\n", channel);
46
        else {
47
                void *fiqhandler_start;
48
                unsigned int fiqhandler_length;
49
                extern void floppy_fiqsetup (unsigned long len, unsigned long addr,
50
                                             unsigned long port);
51
 
52
                if (dma->dma_mode == DMA_MODE_READ) {
53
                        extern unsigned char floppy_fiqin_start, floppy_fiqin_end;
54
                        fiqhandler_start = &floppy_fiqin_start;
55
                        fiqhandler_length = &floppy_fiqin_end - &floppy_fiqin_start;
56
                } else {
57
                        extern unsigned char floppy_fiqout_start, floppy_fiqout_end;
58
                        fiqhandler_start = &floppy_fiqout_start;
59
                        fiqhandler_length = &floppy_fiqout_end - &floppy_fiqout_start;
60
                }
61
                memcpy ((void *)0x1c, fiqhandler_start, fiqhandler_length);
62
                flush_page_to_ram(0);
63
                floppy_fiqsetup (dma->buf.length, __bus_to_virt(dma->buf.address), (int)PCIO_FLOPPYDMABASE);
64
                enable_irq (dma->dma_irq);
65
        }
66
}
67
 
68
void arch_disable_dma(dmach_t channel, dma_t *dma)
69
{
70
        if (channel != DMA_VIRTUAL_FLOPPY)
71
                printk ("arch_disable_dma: invalid channel %d\n", channel);
72
        else
73
                disable_irq (dma->dma_irq);
74
}
75
 
76
void arch_dma_init(dma_t *dma)
77
{
78
        dma[DMA_VIRTUAL_FLOPPY].dma_irq = 64;
79
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.