Loading...
1/*
2 * Include file for NEC VR4100 series PCI Control Unit.
3 *
4 * Copyright (C) 2004-2005 Yoichi Yuasa <yuasa@linux-mips.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __NEC_VR41XX_PCI_H
21#define __NEC_VR41XX_PCI_H
22
23#define PCI_MASTER_ADDRESS_MASK 0x7fffffffU
24
25struct pci_master_address_conversion {
26 uint32_t bus_base_address;
27 uint32_t address_mask;
28 uint32_t pci_base_address;
29};
30
31struct pci_target_address_conversion {
32 uint32_t address_mask;
33 uint32_t bus_base_address;
34};
35
36typedef enum {
37 CANNOT_LOCK_FROM_DEVICE,
38 CAN_LOCK_FROM_DEVICE,
39} pci_exclusive_access_t;
40
41struct pci_mailbox_address {
42 uint32_t base_address;
43};
44
45struct pci_target_address_window {
46 uint32_t base_address;
47};
48
49typedef enum {
50 PCI_ARBITRATION_MODE_FAIR,
51 PCI_ARBITRATION_MODE_ALTERNATE_0,
52 PCI_ARBITRATION_MODE_ALTERNATE_B,
53} pci_arbiter_priority_control_t;
54
55typedef enum {
56 PCI_TAKE_AWAY_GNT_DISABLE,
57 PCI_TAKE_AWAY_GNT_ENABLE,
58} pci_take_away_gnt_mode_t;
59
60struct pci_controller_unit_setup {
61 struct pci_master_address_conversion *master_memory1;
62 struct pci_master_address_conversion *master_memory2;
63
64 struct pci_target_address_conversion *target_memory1;
65 struct pci_target_address_conversion *target_memory2;
66
67 struct pci_master_address_conversion *master_io;
68
69 pci_exclusive_access_t exclusive_access;
70
71 uint32_t pci_clock_max;
72 uint8_t wait_time_limit_from_irdy_to_trdy; /* Only VR4122 is supported */
73
74 struct pci_mailbox_address *mailbox;
75 struct pci_target_address_window *target_window1;
76 struct pci_target_address_window *target_window2;
77
78 uint8_t master_latency_timer;
79 uint8_t retry_limit;
80
81 pci_arbiter_priority_control_t arbiter_priority_control;
82 pci_take_away_gnt_mode_t take_away_gnt_mode;
83
84 struct resource *mem_resource;
85 struct resource *io_resource;
86};
87
88extern void vr41xx_pciu_setup(struct pci_controller_unit_setup *setup);
89
90#endif /* __NEC_VR41XX_PCI_H */
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * Include file for NEC VR4100 series PCI Control Unit.
4 *
5 * Copyright (C) 2004-2005 Yoichi Yuasa <yuasa@linux-mips.org>
6 */
7#ifndef __NEC_VR41XX_PCI_H
8#define __NEC_VR41XX_PCI_H
9
10#define PCI_MASTER_ADDRESS_MASK 0x7fffffffU
11
12struct pci_master_address_conversion {
13 uint32_t bus_base_address;
14 uint32_t address_mask;
15 uint32_t pci_base_address;
16};
17
18struct pci_target_address_conversion {
19 uint32_t address_mask;
20 uint32_t bus_base_address;
21};
22
23typedef enum {
24 CANNOT_LOCK_FROM_DEVICE,
25 CAN_LOCK_FROM_DEVICE,
26} pci_exclusive_access_t;
27
28struct pci_mailbox_address {
29 uint32_t base_address;
30};
31
32struct pci_target_address_window {
33 uint32_t base_address;
34};
35
36typedef enum {
37 PCI_ARBITRATION_MODE_FAIR,
38 PCI_ARBITRATION_MODE_ALTERNATE_0,
39 PCI_ARBITRATION_MODE_ALTERNATE_B,
40} pci_arbiter_priority_control_t;
41
42typedef enum {
43 PCI_TAKE_AWAY_GNT_DISABLE,
44 PCI_TAKE_AWAY_GNT_ENABLE,
45} pci_take_away_gnt_mode_t;
46
47struct pci_controller_unit_setup {
48 struct pci_master_address_conversion *master_memory1;
49 struct pci_master_address_conversion *master_memory2;
50
51 struct pci_target_address_conversion *target_memory1;
52 struct pci_target_address_conversion *target_memory2;
53
54 struct pci_master_address_conversion *master_io;
55
56 pci_exclusive_access_t exclusive_access;
57
58 uint32_t pci_clock_max;
59 uint8_t wait_time_limit_from_irdy_to_trdy; /* Only VR4122 is supported */
60
61 struct pci_mailbox_address *mailbox;
62 struct pci_target_address_window *target_window1;
63 struct pci_target_address_window *target_window2;
64
65 uint8_t master_latency_timer;
66 uint8_t retry_limit;
67
68 pci_arbiter_priority_control_t arbiter_priority_control;
69 pci_take_away_gnt_mode_t take_away_gnt_mode;
70
71 struct resource *mem_resource;
72 struct resource *io_resource;
73};
74
75extern void vr41xx_pciu_setup(struct pci_controller_unit_setup *setup);
76
77#endif /* __NEC_VR41XX_PCI_H */