summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/shared/include/b1553brm_pci.h
blob: 22b4d7838506170ee134693542ab59d16e5cecfd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**
 * @file
 * @ingroup 1553
 * @brief Macros used for brm controller via PCI
 */

/*
 *  COPYRIGHT (c) 2006.
 *  Gaisler Research
 *
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.rtems.com/license/LICENSE.
 *
 */

#ifndef __B1553BRM_PCI_H__
#define __B1553BRM_PCI_H__

#include <b1553brm.h>

#ifdef __cplusplus
extern "C" {
#endif

/* Register BRM driver
 * See (struct brm_reg).w_ctrl for clksel and clkdiv.
 * See Enhanced register (the least signinficant 2 bits) in BRM Core for brm_freq
 * bus = &ambapp_plb for LEON3. (LEON2 not yet supported for this driver)
 *
 * Memory setup:
 * memarea = 128k aligned pointer to memory (if zero malloc will be used) (as the CPU sees it)
 * hw_address = address that HW must use to access memarea. (used in the translation process)
 */

int b1553brm_pci_register(
 struct ambapp_bus *bus,
 unsigned int clksel,
 unsigned int clkdiv,
 unsigned int brm_freq,
 unsigned int memarea,
 unsigned int hw_address
 );


/* This function must be called on BRM interrupt. Called from the
 * PCI interrupt handler. irq = AMBA IRQ MASK assigned to the BRM device,
 * is found by reading pending register on IRQMP connected to BRM
 * device.
 *
 * Return 0=not handled. nono-zero=handled
 */
int b1553brm_pci_interrupt_handler(int irq, void *arg);

extern void (*b1553brm_pci_int_reg)(void *handler, int irq, void *arg);

#ifdef __cplusplus
}
#endif

#endif /* __B1553BRM_PCI_H__ */