1/*
2 * Copyright 2017, Data61
3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO)
4 * ABN 41 687 119 230.
5 *
6 * This software may be distributed and modified according to the terms of
7 * the BSD 2-Clause license. Note that NO WARRANTY is provided.
8 * See "LICENSE_BSD2.txt" for details.
9 *
10 * @TAG(DATA61_BSD)
11 */
12
13#pragma once
14
15#define MDMA0_PADDR 0x10800000
16#define MDMA1_PADDR 0x11C10000
17#define PDMA0_PADDR 0x121A0000
18#define PDMA1_PADDR 0x121B0000
19
20#define DMA330_SIZE 0x1000
21#define MDMA0_SIZE  DMA330_SIZE
22#define MDMA1_SIZE  DMA330_SIZE
23#define PDMA0_SIZE  DMA330_SIZE
24#define PDMA1_SIZE  DMA330_SIZE
25
26#define MDMA0_IRQ       65
27#define MDMA1_IRQ      156
28#define MDMA0_ABORT_IRQ 47
29#define MDMA1_ABORT_IRQ 45
30#define PDMA0_IRQ       66
31#define PDMA1_IRQ       67
32
33enum dma330_id {
34    PL330_MDMA0,
35    PL330_MDMA1,
36    PL330_PDMA0,
37    PL330_PDMA1,
38    NPL330
39};
40
41static const uint32_t dma330_paddr[] = {
42    [PL330_MDMA0] = MDMA0_PADDR,
43    [PL330_MDMA1] = MDMA1_PADDR,
44    [PL330_PDMA0] = PDMA0_PADDR,
45    [PL330_PDMA1] = PDMA1_PADDR
46};
47
48static const uint32_t dma330_size[] = {
49    [PL330_MDMA0] = MDMA0_SIZE,
50    [PL330_MDMA1] = MDMA1_SIZE,
51    [PL330_PDMA0] = PDMA0_SIZE,
52    [PL330_PDMA1] = PDMA1_SIZE
53};
54
55static const int dma330_irq[] = {
56    [PL330_MDMA0] = MDMA0_IRQ,
57    [PL330_MDMA1] = MDMA1_IRQ,
58    [PL330_PDMA0] = PDMA0_IRQ,
59    [PL330_PDMA1] = PDMA1_IRQ
60};
61
62static const int dma330_abort_irq[] = {
63    [PL330_MDMA0] = MDMA0_ABORT_IRQ,
64    [PL330_MDMA1] = MDMA1_ABORT_IRQ,
65    [PL330_PDMA0] = -1,
66    [PL330_PDMA1] = -1
67};
68
69