diff options
author | Alexandre Bounine <alexandre.bounine@idt.com> | 2013-05-24 18:55:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-24 19:22:50 -0400 |
commit | a11650e11093ed57dca78bf16e7836517c599098 (patch) | |
tree | 9823799d4c54337971b4654ea9e5510131dae9c5 /include | |
parent | 585dc0c2f68981c02a0bb6fc8fe191a3f513959c (diff) |
rapidio: make enumeration/discovery configurable
Systems that use RapidIO fabric may need to implement their own
enumeration and discovery methods which are better suitable for needs of
a target application.
The following set of patches is intended to simplify process of
introduction of new RapidIO fabric enumeration/discovery methods.
The first patch offers ability to add new RapidIO enumeration/discovery
methods using kernel configuration options. This new configuration
option mechanism allows to select statically linked or modular
enumeration/discovery method(s) from the list of existing methods or use
external module(s).
This patch also updates the currently existing enumeration/discovery
code to be used as a statically linked or modular method.
The corresponding configuration option is named "Basic
enumeration/discovery" method. This is the only one configuration
option available today but new methods are expected to be introduced
after adoption of provided patches.
The second patch address a long time complaint of RapidIO subsystem
users regarding fabric enumeration/discovery start sequence. Existing
implementation offers only a boot-time enumeration/discovery start which
requires synchronized boot of all endpoints in RapidIO network. While
it works for small closed configurations with limited number of
endpoints, using this approach in systems with large number of endpoints
is quite challenging.
To eliminate requirement for synchronized start the second patch
introduces RapidIO enumeration/discovery start from user space.
For compatibility with the existing RapidIO subsystem implementation,
automatic boot time enumeration/discovery start can be configured in by
specifying "rio-scan.scan=1" command line parameter if statically linked
basic enumeration method is selected.
This patch:
Rework to implement RapidIO enumeration/discovery method selection
combined with ability to use enumeration/discovery as a kernel module.
This patch adds ability to introduce new RapidIO enumeration/discovery
methods using kernel configuration options. Configuration option
mechanism allows to select statically linked or modular
enumeration/discovery method from the list of existing methods or use
external modules. If a modular enumeration/discovery is selected each
RapidIO mport device can have its own method attached to it.
The existing enumeration/discovery code was updated to be used as
statically linked or modular method. This configuration option is named
"Basic enumeration/discovery" method.
Several common routines have been moved from rio-scan.c to make them
available to other enumeration methods and reduce number of exported
symbols.
Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Li Yang <leoli@freescale.com>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Andre van Herk <andre.van.herk@Prodrive.nl>
Cc: Micha Nelissen <micha.nelissen@Prodrive.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/rio.h | 13 | ||||
-rw-r--r-- | include/linux/rio_drv.h | 1 |
2 files changed, 13 insertions, 1 deletions
diff --git a/include/linux/rio.h b/include/linux/rio.h index a3e784278667..cd3796ee7410 100644 --- a/include/linux/rio.h +++ b/include/linux/rio.h | |||
@@ -83,7 +83,6 @@ | |||
83 | 83 | ||
84 | extern struct bus_type rio_bus_type; | 84 | extern struct bus_type rio_bus_type; |
85 | extern struct device rio_bus; | 85 | extern struct device rio_bus; |
86 | extern struct list_head rio_devices; /* list of all devices */ | ||
87 | 86 | ||
88 | struct rio_mport; | 87 | struct rio_mport; |
89 | struct rio_dev; | 88 | struct rio_dev; |
@@ -237,6 +236,7 @@ enum rio_phy_type { | |||
237 | * @name: Port name string | 236 | * @name: Port name string |
238 | * @priv: Master port private data | 237 | * @priv: Master port private data |
239 | * @dma: DMA device associated with mport | 238 | * @dma: DMA device associated with mport |
239 | * @nscan: RapidIO network enumeration/discovery operations | ||
240 | */ | 240 | */ |
241 | struct rio_mport { | 241 | struct rio_mport { |
242 | struct list_head dbells; /* list of doorbell events */ | 242 | struct list_head dbells; /* list of doorbell events */ |
@@ -262,6 +262,7 @@ struct rio_mport { | |||
262 | #ifdef CONFIG_RAPIDIO_DMA_ENGINE | 262 | #ifdef CONFIG_RAPIDIO_DMA_ENGINE |
263 | struct dma_device dma; | 263 | struct dma_device dma; |
264 | #endif | 264 | #endif |
265 | struct rio_scan *nscan; | ||
265 | }; | 266 | }; |
266 | 267 | ||
267 | struct rio_id_table { | 268 | struct rio_id_table { |
@@ -460,6 +461,16 @@ static inline struct rio_mport *dma_to_mport(struct dma_device *ddev) | |||
460 | } | 461 | } |
461 | #endif /* CONFIG_RAPIDIO_DMA_ENGINE */ | 462 | #endif /* CONFIG_RAPIDIO_DMA_ENGINE */ |
462 | 463 | ||
464 | /** | ||
465 | * struct rio_scan - RIO enumeration and discovery operations | ||
466 | * @enumerate: Callback to perform RapidIO fabric enumeration. | ||
467 | * @discover: Callback to perform RapidIO fabric discovery. | ||
468 | */ | ||
469 | struct rio_scan { | ||
470 | int (*enumerate)(struct rio_mport *mport); | ||
471 | int (*discover)(struct rio_mport *mport); | ||
472 | }; | ||
473 | |||
463 | /* Architecture and hardware-specific functions */ | 474 | /* Architecture and hardware-specific functions */ |
464 | extern int rio_register_mport(struct rio_mport *); | 475 | extern int rio_register_mport(struct rio_mport *); |
465 | extern int rio_open_inb_mbox(struct rio_mport *, void *, int, int); | 476 | extern int rio_open_inb_mbox(struct rio_mport *, void *, int, int); |
diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h index b75c05920ab5..5059994fe297 100644 --- a/include/linux/rio_drv.h +++ b/include/linux/rio_drv.h | |||
@@ -433,5 +433,6 @@ extern u16 rio_local_get_device_id(struct rio_mport *port); | |||
433 | extern struct rio_dev *rio_get_device(u16 vid, u16 did, struct rio_dev *from); | 433 | extern struct rio_dev *rio_get_device(u16 vid, u16 did, struct rio_dev *from); |
434 | extern struct rio_dev *rio_get_asm(u16 vid, u16 did, u16 asm_vid, u16 asm_did, | 434 | extern struct rio_dev *rio_get_asm(u16 vid, u16 did, u16 asm_vid, u16 asm_did, |
435 | struct rio_dev *from); | 435 | struct rio_dev *from); |
436 | extern int rio_init_mports(void); | ||
436 | 437 | ||
437 | #endif /* LINUX_RIO_DRV_H */ | 438 | #endif /* LINUX_RIO_DRV_H */ |