aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorZhang Wei <wei.zhang@freescale.com>2008-04-18 16:33:41 -0400
committerPaul Mackerras <paulus@samba.org>2008-04-29 05:40:28 -0400
commitad1e9380b17addf112f89ce5a57d4d0bee129b7a (patch)
tree41bb74c91533f0a2f4a7bfbfb1036ba250cbf50b /drivers
parent5a7b60ed8892756b137496b629f2e7c689fe6d8d (diff)
[RAPIDIO] Add RapidIO multi mport support
The original RapidIO driver suppose there is only one mpc85xx RIO controller in system. So, some data structures are defined as mpc85xx_rio global, such as 'regs_win', 'dbell_ring', 'msg_tx_ring'. Now, I changed them to mport's private members. And you can define multi RIO OF-nodes in dts file for multi RapidIO controller in one processor, such as PCI/PCI-Ex host controllers in Freescale's silicon. And the mport operation function declaration should be changed to know which RapidIO controller is target. Signed-off-by: Zhang Wei <wei.zhang@freescale.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/rapidio/rio-access.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/rapidio/rio-access.c b/drivers/rapidio/rio-access.c
index 8b56bbdd011e..a3824baca2e5 100644
--- a/drivers/rapidio/rio-access.c
+++ b/drivers/rapidio/rio-access.c
@@ -48,7 +48,7 @@ int __rio_local_read_config_##size \
48 u32 data = 0; \ 48 u32 data = 0; \
49 if (RIO_##size##_BAD) return RIO_BAD_SIZE; \ 49 if (RIO_##size##_BAD) return RIO_BAD_SIZE; \
50 spin_lock_irqsave(&rio_config_lock, flags); \ 50 spin_lock_irqsave(&rio_config_lock, flags); \
51 res = mport->ops->lcread(mport->id, offset, len, &data); \ 51 res = mport->ops->lcread(mport, mport->id, offset, len, &data); \
52 *value = (type)data; \ 52 *value = (type)data; \
53 spin_unlock_irqrestore(&rio_config_lock, flags); \ 53 spin_unlock_irqrestore(&rio_config_lock, flags); \
54 return res; \ 54 return res; \
@@ -71,7 +71,7 @@ int __rio_local_write_config_##size \
71 unsigned long flags; \ 71 unsigned long flags; \
72 if (RIO_##size##_BAD) return RIO_BAD_SIZE; \ 72 if (RIO_##size##_BAD) return RIO_BAD_SIZE; \
73 spin_lock_irqsave(&rio_config_lock, flags); \ 73 spin_lock_irqsave(&rio_config_lock, flags); \
74 res = mport->ops->lcwrite(mport->id, offset, len, value); \ 74 res = mport->ops->lcwrite(mport, mport->id, offset, len, value);\
75 spin_unlock_irqrestore(&rio_config_lock, flags); \ 75 spin_unlock_irqrestore(&rio_config_lock, flags); \
76 return res; \ 76 return res; \
77} 77}
@@ -108,7 +108,7 @@ int rio_mport_read_config_##size \
108 u32 data = 0; \ 108 u32 data = 0; \
109 if (RIO_##size##_BAD) return RIO_BAD_SIZE; \ 109 if (RIO_##size##_BAD) return RIO_BAD_SIZE; \
110 spin_lock_irqsave(&rio_config_lock, flags); \ 110 spin_lock_irqsave(&rio_config_lock, flags); \
111 res = mport->ops->cread(mport->id, destid, hopcount, offset, len, &data); \ 111 res = mport->ops->cread(mport, mport->id, destid, hopcount, offset, len, &data); \
112 *value = (type)data; \ 112 *value = (type)data; \
113 spin_unlock_irqrestore(&rio_config_lock, flags); \ 113 spin_unlock_irqrestore(&rio_config_lock, flags); \
114 return res; \ 114 return res; \
@@ -131,7 +131,7 @@ int rio_mport_write_config_##size \
131 unsigned long flags; \ 131 unsigned long flags; \
132 if (RIO_##size##_BAD) return RIO_BAD_SIZE; \ 132 if (RIO_##size##_BAD) return RIO_BAD_SIZE; \
133 spin_lock_irqsave(&rio_config_lock, flags); \ 133 spin_lock_irqsave(&rio_config_lock, flags); \
134 res = mport->ops->cwrite(mport->id, destid, hopcount, offset, len, value); \ 134 res = mport->ops->cwrite(mport, mport->id, destid, hopcount, offset, len, value); \
135 spin_unlock_irqrestore(&rio_config_lock, flags); \ 135 spin_unlock_irqrestore(&rio_config_lock, flags); \
136 return res; \ 136 return res; \
137} 137}
@@ -166,7 +166,7 @@ int rio_mport_send_doorbell(struct rio_mport *mport, u16 destid, u16 data)
166 unsigned long flags; 166 unsigned long flags;
167 167
168 spin_lock_irqsave(&rio_doorbell_lock, flags); 168 spin_lock_irqsave(&rio_doorbell_lock, flags);
169 res = mport->ops->dsend(mport->id, destid, data); 169 res = mport->ops->dsend(mport, mport->id, destid, data);
170 spin_unlock_irqrestore(&rio_doorbell_lock, flags); 170 spin_unlock_irqrestore(&rio_doorbell_lock, flags);
171 171
172 return res; 172 return res;