diff options
author | Zhang Wei <wei.zhang@freescale.com> | 2008-04-18 16:33:38 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-04-29 05:40:27 -0400 |
commit | d02443a6f89dbd7ff868db30ad18f90bb633f716 (patch) | |
tree | 0dc3926150cb70902bd1714645412a70adf86d2f /arch | |
parent | 9d88a2eb6e05c07aa0d484b8fa1372722fa921d0 (diff) |
[RAPIDIO] Change RIO function mpc85xx_ to fsl_
The driver is suitable for the Freescale MPC8641 processor as well as
85xx processors, so this changes the mpc85xx prefix to fsl.
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 'arch')
-rw-r--r-- | arch/powerpc/sysdev/fsl_rio.c | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c index af2425e4655f..659a5609d2db 100644 --- a/arch/powerpc/sysdev/fsl_rio.c +++ b/arch/powerpc/sysdev/fsl_rio.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * MPC85xx RapidIO support | 2 | * Freescale MPC85xx/MPC86xx RapidIO support |
3 | * | 3 | * |
4 | * Copyright 2005 MontaVista Software, Inc. | 4 | * Copyright 2005 MontaVista Software, Inc. |
5 | * Matt Porter <mporter@kernel.crashing.org> | 5 | * Matt Porter <mporter@kernel.crashing.org> |
@@ -145,7 +145,7 @@ static struct rio_msg_rx_ring { | |||
145 | } msg_rx_ring; | 145 | } msg_rx_ring; |
146 | 146 | ||
147 | /** | 147 | /** |
148 | * mpc85xx_rio_doorbell_send - Send a MPC85xx doorbell message | 148 | * fsl_rio_doorbell_send - Send a MPC85xx doorbell message |
149 | * @index: ID of RapidIO interface | 149 | * @index: ID of RapidIO interface |
150 | * @destid: Destination ID of target device | 150 | * @destid: Destination ID of target device |
151 | * @data: 16-bit info field of RapidIO doorbell message | 151 | * @data: 16-bit info field of RapidIO doorbell message |
@@ -153,9 +153,9 @@ static struct rio_msg_rx_ring { | |||
153 | * Sends a MPC85xx doorbell message. Returns %0 on success or | 153 | * Sends a MPC85xx doorbell message. Returns %0 on success or |
154 | * %-EINVAL on failure. | 154 | * %-EINVAL on failure. |
155 | */ | 155 | */ |
156 | static int mpc85xx_rio_doorbell_send(int index, u16 destid, u16 data) | 156 | static int fsl_rio_doorbell_send(int index, u16 destid, u16 data) |
157 | { | 157 | { |
158 | pr_debug("mpc85xx_doorbell_send: index %d destid %4.4x data %4.4x\n", | 158 | pr_debug("fsl_doorbell_send: index %d destid %4.4x data %4.4x\n", |
159 | index, destid, data); | 159 | index, destid, data); |
160 | out_be32((void *)&dbell_atmu_regs->rowtar, destid << 22); | 160 | out_be32((void *)&dbell_atmu_regs->rowtar, destid << 22); |
161 | out_be16((void *)(dbell_win), data); | 161 | out_be16((void *)(dbell_win), data); |
@@ -164,7 +164,7 @@ static int mpc85xx_rio_doorbell_send(int index, u16 destid, u16 data) | |||
164 | } | 164 | } |
165 | 165 | ||
166 | /** | 166 | /** |
167 | * mpc85xx_local_config_read - Generate a MPC85xx local config space read | 167 | * fsl_local_config_read - Generate a MPC85xx local config space read |
168 | * @index: ID of RapdiIO interface | 168 | * @index: ID of RapdiIO interface |
169 | * @offset: Offset into configuration space | 169 | * @offset: Offset into configuration space |
170 | * @len: Length (in bytes) of the maintenance transaction | 170 | * @len: Length (in bytes) of the maintenance transaction |
@@ -173,9 +173,9 @@ static int mpc85xx_rio_doorbell_send(int index, u16 destid, u16 data) | |||
173 | * Generates a MPC85xx local configuration space read. Returns %0 on | 173 | * Generates a MPC85xx local configuration space read. Returns %0 on |
174 | * success or %-EINVAL on failure. | 174 | * success or %-EINVAL on failure. |
175 | */ | 175 | */ |
176 | static int mpc85xx_local_config_read(int index, u32 offset, int len, u32 * data) | 176 | static int fsl_local_config_read(int index, u32 offset, int len, u32 *data) |
177 | { | 177 | { |
178 | pr_debug("mpc85xx_local_config_read: index %d offset %8.8x\n", index, | 178 | pr_debug("fsl_local_config_read: index %d offset %8.8x\n", index, |
179 | offset); | 179 | offset); |
180 | *data = in_be32((void *)(regs_win + offset)); | 180 | *data = in_be32((void *)(regs_win + offset)); |
181 | 181 | ||
@@ -183,7 +183,7 @@ static int mpc85xx_local_config_read(int index, u32 offset, int len, u32 * data) | |||
183 | } | 183 | } |
184 | 184 | ||
185 | /** | 185 | /** |
186 | * mpc85xx_local_config_write - Generate a MPC85xx local config space write | 186 | * fsl_local_config_write - Generate a MPC85xx local config space write |
187 | * @index: ID of RapdiIO interface | 187 | * @index: ID of RapdiIO interface |
188 | * @offset: Offset into configuration space | 188 | * @offset: Offset into configuration space |
189 | * @len: Length (in bytes) of the maintenance transaction | 189 | * @len: Length (in bytes) of the maintenance transaction |
@@ -192,10 +192,10 @@ static int mpc85xx_local_config_read(int index, u32 offset, int len, u32 * data) | |||
192 | * Generates a MPC85xx local configuration space write. Returns %0 on | 192 | * Generates a MPC85xx local configuration space write. Returns %0 on |
193 | * success or %-EINVAL on failure. | 193 | * success or %-EINVAL on failure. |
194 | */ | 194 | */ |
195 | static int mpc85xx_local_config_write(int index, u32 offset, int len, u32 data) | 195 | static int fsl_local_config_write(int index, u32 offset, int len, u32 data) |
196 | { | 196 | { |
197 | pr_debug | 197 | pr_debug |
198 | ("mpc85xx_local_config_write: index %d offset %8.8x data %8.8x\n", | 198 | ("fsl_local_config_write: index %d offset %8.8x data %8.8x\n", |
199 | index, offset, data); | 199 | index, offset, data); |
200 | out_be32((void *)(regs_win + offset), data); | 200 | out_be32((void *)(regs_win + offset), data); |
201 | 201 | ||
@@ -203,7 +203,7 @@ static int mpc85xx_local_config_write(int index, u32 offset, int len, u32 data) | |||
203 | } | 203 | } |
204 | 204 | ||
205 | /** | 205 | /** |
206 | * mpc85xx_rio_config_read - Generate a MPC85xx read maintenance transaction | 206 | * fsl_rio_config_read - Generate a MPC85xx read maintenance transaction |
207 | * @index: ID of RapdiIO interface | 207 | * @index: ID of RapdiIO interface |
208 | * @destid: Destination ID of transaction | 208 | * @destid: Destination ID of transaction |
209 | * @hopcount: Number of hops to target device | 209 | * @hopcount: Number of hops to target device |
@@ -215,13 +215,13 @@ static int mpc85xx_local_config_write(int index, u32 offset, int len, u32 data) | |||
215 | * success or %-EINVAL on failure. | 215 | * success or %-EINVAL on failure. |
216 | */ | 216 | */ |
217 | static int | 217 | static int |
218 | mpc85xx_rio_config_read(int index, u16 destid, u8 hopcount, u32 offset, int len, | 218 | fsl_rio_config_read(int index, u16 destid, u8 hopcount, u32 offset, int len, |
219 | u32 * val) | 219 | u32 * val) |
220 | { | 220 | { |
221 | u8 *data; | 221 | u8 *data; |
222 | 222 | ||
223 | pr_debug | 223 | pr_debug |
224 | ("mpc85xx_rio_config_read: index %d destid %d hopcount %d offset %8.8x len %d\n", | 224 | ("fsl_rio_config_read: index %d destid %d hopcount %d offset %8.8x len %d\n", |
225 | index, destid, hopcount, offset, len); | 225 | index, destid, hopcount, offset, len); |
226 | out_be32((void *)&maint_atmu_regs->rowtar, | 226 | out_be32((void *)&maint_atmu_regs->rowtar, |
227 | (destid << 22) | (hopcount << 12) | ((offset & ~0x3) >> 9)); | 227 | (destid << 22) | (hopcount << 12) | ((offset & ~0x3) >> 9)); |
@@ -243,7 +243,7 @@ mpc85xx_rio_config_read(int index, u16 destid, u8 hopcount, u32 offset, int len, | |||
243 | } | 243 | } |
244 | 244 | ||
245 | /** | 245 | /** |
246 | * mpc85xx_rio_config_write - Generate a MPC85xx write maintenance transaction | 246 | * fsl_rio_config_write - Generate a MPC85xx write maintenance transaction |
247 | * @index: ID of RapdiIO interface | 247 | * @index: ID of RapdiIO interface |
248 | * @destid: Destination ID of transaction | 248 | * @destid: Destination ID of transaction |
249 | * @hopcount: Number of hops to target device | 249 | * @hopcount: Number of hops to target device |
@@ -255,12 +255,12 @@ mpc85xx_rio_config_read(int index, u16 destid, u8 hopcount, u32 offset, int len, | |||
255 | * success or %-EINVAL on failure. | 255 | * success or %-EINVAL on failure. |
256 | */ | 256 | */ |
257 | static int | 257 | static int |
258 | mpc85xx_rio_config_write(int index, u16 destid, u8 hopcount, u32 offset, | 258 | fsl_rio_config_write(int index, u16 destid, u8 hopcount, u32 offset, |
259 | int len, u32 val) | 259 | int len, u32 val) |
260 | { | 260 | { |
261 | u8 *data; | 261 | u8 *data; |
262 | pr_debug | 262 | pr_debug |
263 | ("mpc85xx_rio_config_write: index %d destid %d hopcount %d offset %8.8x len %d val %8.8x\n", | 263 | ("fsl_rio_config_write: index %d destid %d hopcount %d offset %8.8x len %d val %8.8x\n", |
264 | index, destid, hopcount, offset, len, val); | 264 | index, destid, hopcount, offset, len, val); |
265 | out_be32((void *)&maint_atmu_regs->rowtar, | 265 | out_be32((void *)&maint_atmu_regs->rowtar, |
266 | (destid << 22) | (hopcount << 12) | ((offset & ~0x3) >> 9)); | 266 | (destid << 22) | (hopcount << 12) | ((offset & ~0x3) >> 9)); |
@@ -344,7 +344,7 @@ rio_hw_add_outb_message(struct rio_mport *mport, struct rio_dev *rdev, int mbox, | |||
344 | EXPORT_SYMBOL_GPL(rio_hw_add_outb_message); | 344 | EXPORT_SYMBOL_GPL(rio_hw_add_outb_message); |
345 | 345 | ||
346 | /** | 346 | /** |
347 | * mpc85xx_rio_tx_handler - MPC85xx outbound message interrupt handler | 347 | * fsl_rio_tx_handler - MPC85xx outbound message interrupt handler |
348 | * @irq: Linux interrupt number | 348 | * @irq: Linux interrupt number |
349 | * @dev_instance: Pointer to interrupt-specific data | 349 | * @dev_instance: Pointer to interrupt-specific data |
350 | * | 350 | * |
@@ -352,7 +352,7 @@ EXPORT_SYMBOL_GPL(rio_hw_add_outb_message); | |||
352 | * mailbox event handler and acks the interrupt occurrence. | 352 | * mailbox event handler and acks the interrupt occurrence. |
353 | */ | 353 | */ |
354 | static irqreturn_t | 354 | static irqreturn_t |
355 | mpc85xx_rio_tx_handler(int irq, void *dev_instance) | 355 | fsl_rio_tx_handler(int irq, void *dev_instance) |
356 | { | 356 | { |
357 | int osr; | 357 | int osr; |
358 | struct rio_mport *port = (struct rio_mport *)dev_instance; | 358 | struct rio_mport *port = (struct rio_mport *)dev_instance; |
@@ -452,7 +452,7 @@ int rio_open_outb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entr | |||
452 | 452 | ||
453 | /* Hook up outbound message handler */ | 453 | /* Hook up outbound message handler */ |
454 | if ((rc = | 454 | if ((rc = |
455 | request_irq(MPC85xx_IRQ_RIO_TX, mpc85xx_rio_tx_handler, 0, | 455 | request_irq(MPC85xx_IRQ_RIO_TX, fsl_rio_tx_handler, 0, |
456 | "msg_tx", (void *)mport)) < 0) | 456 | "msg_tx", (void *)mport)) < 0) |
457 | goto out_irq; | 457 | goto out_irq; |
458 | 458 | ||
@@ -511,7 +511,7 @@ void rio_close_outb_mbox(struct rio_mport *mport, int mbox) | |||
511 | } | 511 | } |
512 | 512 | ||
513 | /** | 513 | /** |
514 | * mpc85xx_rio_rx_handler - MPC85xx inbound message interrupt handler | 514 | * fsl_rio_rx_handler - MPC85xx inbound message interrupt handler |
515 | * @irq: Linux interrupt number | 515 | * @irq: Linux interrupt number |
516 | * @dev_instance: Pointer to interrupt-specific data | 516 | * @dev_instance: Pointer to interrupt-specific data |
517 | * | 517 | * |
@@ -519,7 +519,7 @@ void rio_close_outb_mbox(struct rio_mport *mport, int mbox) | |||
519 | * mailbox event handler and acks the interrupt occurrence. | 519 | * mailbox event handler and acks the interrupt occurrence. |
520 | */ | 520 | */ |
521 | static irqreturn_t | 521 | static irqreturn_t |
522 | mpc85xx_rio_rx_handler(int irq, void *dev_instance) | 522 | fsl_rio_rx_handler(int irq, void *dev_instance) |
523 | { | 523 | { |
524 | int isr; | 524 | int isr; |
525 | struct rio_mport *port = (struct rio_mport *)dev_instance; | 525 | struct rio_mport *port = (struct rio_mport *)dev_instance; |
@@ -597,7 +597,7 @@ int rio_open_inb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entri | |||
597 | 597 | ||
598 | /* Hook up inbound message handler */ | 598 | /* Hook up inbound message handler */ |
599 | if ((rc = | 599 | if ((rc = |
600 | request_irq(MPC85xx_IRQ_RIO_RX, mpc85xx_rio_rx_handler, 0, | 600 | request_irq(MPC85xx_IRQ_RIO_RX, fsl_rio_rx_handler, 0, |
601 | "msg_rx", (void *)mport)) < 0) { | 601 | "msg_rx", (void *)mport)) < 0) { |
602 | dma_free_coherent(NULL, RIO_MSG_BUFFER_SIZE, | 602 | dma_free_coherent(NULL, RIO_MSG_BUFFER_SIZE, |
603 | msg_tx_ring.virt_buffer[i], | 603 | msg_tx_ring.virt_buffer[i], |
@@ -729,7 +729,7 @@ void *rio_hw_get_inb_message(struct rio_mport *mport, int mbox) | |||
729 | EXPORT_SYMBOL_GPL(rio_hw_get_inb_message); | 729 | EXPORT_SYMBOL_GPL(rio_hw_get_inb_message); |
730 | 730 | ||
731 | /** | 731 | /** |
732 | * mpc85xx_rio_dbell_handler - MPC85xx doorbell interrupt handler | 732 | * fsl_rio_dbell_handler - MPC85xx doorbell interrupt handler |
733 | * @irq: Linux interrupt number | 733 | * @irq: Linux interrupt number |
734 | * @dev_instance: Pointer to interrupt-specific data | 734 | * @dev_instance: Pointer to interrupt-specific data |
735 | * | 735 | * |
@@ -737,7 +737,7 @@ EXPORT_SYMBOL_GPL(rio_hw_get_inb_message); | |||
737 | * doorbell event handlers and executes a matching event handler. | 737 | * doorbell event handlers and executes a matching event handler. |
738 | */ | 738 | */ |
739 | static irqreturn_t | 739 | static irqreturn_t |
740 | mpc85xx_rio_dbell_handler(int irq, void *dev_instance) | 740 | fsl_rio_dbell_handler(int irq, void *dev_instance) |
741 | { | 741 | { |
742 | int dsr; | 742 | int dsr; |
743 | struct rio_mport *port = (struct rio_mport *)dev_instance; | 743 | struct rio_mport *port = (struct rio_mport *)dev_instance; |
@@ -794,14 +794,14 @@ mpc85xx_rio_dbell_handler(int irq, void *dev_instance) | |||
794 | } | 794 | } |
795 | 795 | ||
796 | /** | 796 | /** |
797 | * mpc85xx_rio_doorbell_init - MPC85xx doorbell interface init | 797 | * fsl_rio_doorbell_init - MPC85xx doorbell interface init |
798 | * @mport: Master port implementing the inbound doorbell unit | 798 | * @mport: Master port implementing the inbound doorbell unit |
799 | * | 799 | * |
800 | * Initializes doorbell unit hardware and inbound DMA buffer | 800 | * Initializes doorbell unit hardware and inbound DMA buffer |
801 | * ring. Called from mpc85xx_rio_setup(). Returns %0 on success | 801 | * ring. Called from fsl_rio_setup(). Returns %0 on success |
802 | * or %-ENOMEM on failure. | 802 | * or %-ENOMEM on failure. |
803 | */ | 803 | */ |
804 | static int mpc85xx_rio_doorbell_init(struct rio_mport *mport) | 804 | static int fsl_rio_doorbell_init(struct rio_mport *mport) |
805 | { | 805 | { |
806 | int rc = 0; | 806 | int rc = 0; |
807 | 807 | ||
@@ -835,7 +835,7 @@ static int mpc85xx_rio_doorbell_init(struct rio_mport *mport) | |||
835 | 835 | ||
836 | /* Hook up doorbell handler */ | 836 | /* Hook up doorbell handler */ |
837 | if ((rc = | 837 | if ((rc = |
838 | request_irq(MPC85xx_IRQ_RIO_BELL, mpc85xx_rio_dbell_handler, 0, | 838 | request_irq(MPC85xx_IRQ_RIO_BELL, fsl_rio_dbell_handler, 0, |
839 | "dbell_rx", (void *)mport) < 0)) { | 839 | "dbell_rx", (void *)mport) < 0)) { |
840 | iounmap((void *)dbell_win); | 840 | iounmap((void *)dbell_win); |
841 | dma_free_coherent(NULL, 512 * DOORBELL_MESSAGE_SIZE, | 841 | dma_free_coherent(NULL, 512 * DOORBELL_MESSAGE_SIZE, |
@@ -854,7 +854,7 @@ static int mpc85xx_rio_doorbell_init(struct rio_mport *mport) | |||
854 | 854 | ||
855 | static char *cmdline = NULL; | 855 | static char *cmdline = NULL; |
856 | 856 | ||
857 | static int mpc85xx_rio_get_hdid(int index) | 857 | static int fsl_rio_get_hdid(int index) |
858 | { | 858 | { |
859 | /* XXX Need to parse multiple entries in some format */ | 859 | /* XXX Need to parse multiple entries in some format */ |
860 | if (!cmdline) | 860 | if (!cmdline) |
@@ -863,7 +863,7 @@ static int mpc85xx_rio_get_hdid(int index) | |||
863 | return simple_strtol(cmdline, NULL, 0); | 863 | return simple_strtol(cmdline, NULL, 0); |
864 | } | 864 | } |
865 | 865 | ||
866 | static int mpc85xx_rio_get_cmdline(char *s) | 866 | static int fsl_rio_get_cmdline(char *s) |
867 | { | 867 | { |
868 | if (!s) | 868 | if (!s) |
869 | return 0; | 869 | return 0; |
@@ -872,10 +872,10 @@ static int mpc85xx_rio_get_cmdline(char *s) | |||
872 | return 1; | 872 | return 1; |
873 | } | 873 | } |
874 | 874 | ||
875 | __setup("riohdid=", mpc85xx_rio_get_cmdline); | 875 | __setup("riohdid=", fsl_rio_get_cmdline); |
876 | 876 | ||
877 | /** | 877 | /** |
878 | * mpc85xx_rio_setup - Setup MPC85xx RapidIO interface | 878 | * fsl_rio_setup - Setup MPC85xx RapidIO interface |
879 | * @law_start: Starting physical address of RapidIO LAW | 879 | * @law_start: Starting physical address of RapidIO LAW |
880 | * @law_size: Size of RapidIO LAW | 880 | * @law_size: Size of RapidIO LAW |
881 | * | 881 | * |
@@ -883,17 +883,17 @@ __setup("riohdid=", mpc85xx_rio_get_cmdline); | |||
883 | * master port with system-specific info, and registers the | 883 | * master port with system-specific info, and registers the |
884 | * master port with the RapidIO subsystem. | 884 | * master port with the RapidIO subsystem. |
885 | */ | 885 | */ |
886 | void mpc85xx_rio_setup(int law_start, int law_size) | 886 | void fsl_rio_setup(int law_start, int law_size) |
887 | { | 887 | { |
888 | struct rio_ops *ops; | 888 | struct rio_ops *ops; |
889 | struct rio_mport *port; | 889 | struct rio_mport *port; |
890 | 890 | ||
891 | ops = kmalloc(sizeof(struct rio_ops), GFP_KERNEL); | 891 | ops = kmalloc(sizeof(struct rio_ops), GFP_KERNEL); |
892 | ops->lcread = mpc85xx_local_config_read; | 892 | ops->lcread = fsl_local_config_read; |
893 | ops->lcwrite = mpc85xx_local_config_write; | 893 | ops->lcwrite = fsl_local_config_write; |
894 | ops->cread = mpc85xx_rio_config_read; | 894 | ops->cread = fsl_rio_config_read; |
895 | ops->cwrite = mpc85xx_rio_config_write; | 895 | ops->cwrite = fsl_rio_config_write; |
896 | ops->dsend = mpc85xx_rio_doorbell_send; | 896 | ops->dsend = fsl_rio_doorbell_send; |
897 | 897 | ||
898 | port = kmalloc(sizeof(struct rio_mport), GFP_KERNEL); | 898 | port = kmalloc(sizeof(struct rio_mport), GFP_KERNEL); |
899 | port->id = 0; | 899 | port->id = 0; |
@@ -909,7 +909,7 @@ void mpc85xx_rio_setup(int law_start, int law_size) | |||
909 | strcpy(port->name, "RIO0 mport"); | 909 | strcpy(port->name, "RIO0 mport"); |
910 | 910 | ||
911 | port->ops = ops; | 911 | port->ops = ops; |
912 | port->host_deviceid = mpc85xx_rio_get_hdid(port->id); | 912 | port->host_deviceid = fsl_rio_get_hdid(port->id); |
913 | 913 | ||
914 | rio_register_mport(port); | 914 | rio_register_mport(port); |
915 | 915 | ||
@@ -928,5 +928,5 @@ void mpc85xx_rio_setup(int law_start, int law_size) | |||
928 | /* Configure outbound doorbell window */ | 928 | /* Configure outbound doorbell window */ |
929 | out_be32((void *)&dbell_atmu_regs->rowbar, 0x000c0400); | 929 | out_be32((void *)&dbell_atmu_regs->rowbar, 0x000c0400); |
930 | out_be32((void *)&dbell_atmu_regs->rowar, 0x8004200b); | 930 | out_be32((void *)&dbell_atmu_regs->rowar, 0x8004200b); |
931 | mpc85xx_rio_doorbell_init(port); | 931 | fsl_rio_doorbell_init(port); |
932 | } | 932 | } |