aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/csr.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ieee1394/csr.h')
-rw-r--r--drivers/ieee1394/csr.h109
1 files changed, 56 insertions, 53 deletions
diff --git a/drivers/ieee1394/csr.h b/drivers/ieee1394/csr.h
index ea9aa4f53ab6..f11546550d84 100644
--- a/drivers/ieee1394/csr.h
+++ b/drivers/ieee1394/csr.h
@@ -1,75 +1,73 @@
1
2#ifndef _IEEE1394_CSR_H 1#ifndef _IEEE1394_CSR_H
3#define _IEEE1394_CSR_H 2#define _IEEE1394_CSR_H
4 3
5#ifdef CONFIG_PREEMPT 4#include <linux/spinlock_types.h>
6#include <linux/sched.h>
7#endif
8 5
9#include "csr1212.h" 6#include "csr1212.h"
7#include "ieee1394_types.h"
10 8
11#define CSR_REGISTER_BASE 0xfffff0000000ULL 9#define CSR_REGISTER_BASE 0xfffff0000000ULL
12 10
13/* register offsets relative to CSR_REGISTER_BASE */ 11/* register offsets relative to CSR_REGISTER_BASE */
14#define CSR_STATE_CLEAR 0x0 12#define CSR_STATE_CLEAR 0x0
15#define CSR_STATE_SET 0x4 13#define CSR_STATE_SET 0x4
16#define CSR_NODE_IDS 0x8 14#define CSR_NODE_IDS 0x8
17#define CSR_RESET_START 0xc 15#define CSR_RESET_START 0xc
18#define CSR_SPLIT_TIMEOUT_HI 0x18 16#define CSR_SPLIT_TIMEOUT_HI 0x18
19#define CSR_SPLIT_TIMEOUT_LO 0x1c 17#define CSR_SPLIT_TIMEOUT_LO 0x1c
20#define CSR_CYCLE_TIME 0x200 18#define CSR_CYCLE_TIME 0x200
21#define CSR_BUS_TIME 0x204 19#define CSR_BUS_TIME 0x204
22#define CSR_BUSY_TIMEOUT 0x210 20#define CSR_BUSY_TIMEOUT 0x210
23#define CSR_BUS_MANAGER_ID 0x21c 21#define CSR_BUS_MANAGER_ID 0x21c
24#define CSR_BANDWIDTH_AVAILABLE 0x220 22#define CSR_BANDWIDTH_AVAILABLE 0x220
25#define CSR_CHANNELS_AVAILABLE 0x224 23#define CSR_CHANNELS_AVAILABLE 0x224
26#define CSR_CHANNELS_AVAILABLE_HI 0x224 24#define CSR_CHANNELS_AVAILABLE_HI 0x224
27#define CSR_CHANNELS_AVAILABLE_LO 0x228 25#define CSR_CHANNELS_AVAILABLE_LO 0x228
28#define CSR_BROADCAST_CHANNEL 0x234 26#define CSR_BROADCAST_CHANNEL 0x234
29#define CSR_CONFIG_ROM 0x400 27#define CSR_CONFIG_ROM 0x400
30#define CSR_CONFIG_ROM_END 0x800 28#define CSR_CONFIG_ROM_END 0x800
31#define CSR_FCP_COMMAND 0xB00 29#define CSR_FCP_COMMAND 0xB00
32#define CSR_FCP_RESPONSE 0xD00 30#define CSR_FCP_RESPONSE 0xD00
33#define CSR_FCP_END 0xF00 31#define CSR_FCP_END 0xF00
34#define CSR_TOPOLOGY_MAP 0x1000 32#define CSR_TOPOLOGY_MAP 0x1000
35#define CSR_TOPOLOGY_MAP_END 0x1400 33#define CSR_TOPOLOGY_MAP_END 0x1400
36#define CSR_SPEED_MAP 0x2000 34#define CSR_SPEED_MAP 0x2000
37#define CSR_SPEED_MAP_END 0x3000 35#define CSR_SPEED_MAP_END 0x3000
38 36
39/* IEEE 1394 bus specific Configuration ROM Key IDs */ 37/* IEEE 1394 bus specific Configuration ROM Key IDs */
40#define IEEE1394_KV_ID_POWER_REQUIREMENTS (0x30) 38#define IEEE1394_KV_ID_POWER_REQUIREMENTS (0x30)
41 39
42/* IEEE 1394 Bus Inforamation Block specifics */ 40/* IEEE 1394 Bus Information Block specifics */
43#define CSR_BUS_INFO_SIZE (5 * sizeof(quadlet_t)) 41#define CSR_BUS_INFO_SIZE (5 * sizeof(quadlet_t))
44 42
45#define CSR_IRMC_SHIFT 31 43#define CSR_IRMC_SHIFT 31
46#define CSR_CMC_SHIFT 30 44#define CSR_CMC_SHIFT 30
47#define CSR_ISC_SHIFT 29 45#define CSR_ISC_SHIFT 29
48#define CSR_BMC_SHIFT 28 46#define CSR_BMC_SHIFT 28
49#define CSR_PMC_SHIFT 27 47#define CSR_PMC_SHIFT 27
50#define CSR_CYC_CLK_ACC_SHIFT 16 48#define CSR_CYC_CLK_ACC_SHIFT 16
51#define CSR_MAX_REC_SHIFT 12 49#define CSR_MAX_REC_SHIFT 12
52#define CSR_MAX_ROM_SHIFT 8 50#define CSR_MAX_ROM_SHIFT 8
53#define CSR_GENERATION_SHIFT 4 51#define CSR_GENERATION_SHIFT 4
54 52
55#define CSR_SET_BUS_INFO_GENERATION(csr, gen) \ 53#define CSR_SET_BUS_INFO_GENERATION(csr, gen) \
56 ((csr)->bus_info_data[2] = \ 54 ((csr)->bus_info_data[2] = \
57 cpu_to_be32((be32_to_cpu((csr)->bus_info_data[2]) & \ 55 cpu_to_be32((be32_to_cpu((csr)->bus_info_data[2]) & \
58 ~(0xf << CSR_GENERATION_SHIFT)) | \ 56 ~(0xf << CSR_GENERATION_SHIFT)) | \
59 (gen) << CSR_GENERATION_SHIFT)) 57 (gen) << CSR_GENERATION_SHIFT))
60 58
61struct csr_control { 59struct csr_control {
62 spinlock_t lock; 60 spinlock_t lock;
63 61
64 quadlet_t state; 62 quadlet_t state;
65 quadlet_t node_ids; 63 quadlet_t node_ids;
66 quadlet_t split_timeout_hi, split_timeout_lo; 64 quadlet_t split_timeout_hi, split_timeout_lo;
67 unsigned long expire; // Calculated from split_timeout 65 unsigned long expire; /* Calculated from split_timeout */
68 quadlet_t cycle_time; 66 quadlet_t cycle_time;
69 quadlet_t bus_time; 67 quadlet_t bus_time;
70 quadlet_t bus_manager_id; 68 quadlet_t bus_manager_id;
71 quadlet_t bandwidth_available; 69 quadlet_t bandwidth_available;
72 quadlet_t channels_available_hi, channels_available_lo; 70 quadlet_t channels_available_hi, channels_available_lo;
73 quadlet_t broadcast_channel; 71 quadlet_t broadcast_channel;
74 72
75 /* Bus Info */ 73 /* Bus Info */
@@ -84,8 +82,8 @@ struct csr_control {
84 82
85 struct csr1212_csr *rom; 83 struct csr1212_csr *rom;
86 84
87 quadlet_t topology_map[256]; 85 quadlet_t topology_map[256];
88 quadlet_t speed_map[1024]; 86 quadlet_t speed_map[1024];
89}; 87};
90 88
91extern struct csr1212_bus_ops csr_bus_ops; 89extern struct csr1212_bus_ops csr_bus_ops;
@@ -93,4 +91,9 @@ extern struct csr1212_bus_ops csr_bus_ops;
93int init_csr(void); 91int init_csr(void);
94void cleanup_csr(void); 92void cleanup_csr(void);
95 93
94/* hpsb_update_config_rom() is deprecated */
95struct hpsb_host;
96int hpsb_update_config_rom(struct hpsb_host *host, const quadlet_t *new_rom,
97 size_t size, unsigned char rom_version);
98
96#endif /* _IEEE1394_CSR_H */ 99#endif /* _IEEE1394_CSR_H */