diff options
author | Haiying Wang <Haiying.Wang@freescale.com> | 2009-05-01 15:40:47 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2009-05-19 01:50:22 -0400 |
commit | 06c4435021f4856261edd01e2691071edeb8fa51 (patch) | |
tree | 54e0a8be20b73d328df5aeae874e725ea7bbc80e /arch/powerpc/sysdev/qe_lib | |
parent | ea5130dcb438840d64a168b67dd221e4d46246b8 (diff) |
powerpc/qe: update risc allocation for QE
Change the RISC allocation to macros instead of enum, add function to read
the number of risc engines from the new property "fsl,qe-num-riscs" under
the qe node in dts. Add new property "fsl,qe-num-riscs" description in
qe.txt
Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/sysdev/qe_lib')
-rw-r--r-- | arch/powerpc/sysdev/qe_lib/qe.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c index 01bce3784b0a..2533677ae5eb 100644 --- a/arch/powerpc/sysdev/qe_lib/qe.c +++ b/arch/powerpc/sysdev/qe_lib/qe.c | |||
@@ -575,3 +575,31 @@ struct qe_firmware_info *qe_get_firmware_info(void) | |||
575 | } | 575 | } |
576 | EXPORT_SYMBOL(qe_get_firmware_info); | 576 | EXPORT_SYMBOL(qe_get_firmware_info); |
577 | 577 | ||
578 | unsigned int qe_get_num_of_risc(void) | ||
579 | { | ||
580 | struct device_node *qe; | ||
581 | int size; | ||
582 | unsigned int num_of_risc = 0; | ||
583 | const u32 *prop; | ||
584 | |||
585 | qe = of_find_compatible_node(NULL, NULL, "fsl,qe"); | ||
586 | if (!qe) { | ||
587 | /* Older devices trees did not have an "fsl,qe" | ||
588 | * compatible property, so we need to look for | ||
589 | * the QE node by name. | ||
590 | */ | ||
591 | qe = of_find_node_by_type(NULL, "qe"); | ||
592 | if (!qe) | ||
593 | return num_of_risc; | ||
594 | } | ||
595 | |||
596 | prop = of_get_property(qe, "fsl,qe-num-riscs", &size); | ||
597 | if (prop && size == sizeof(*prop)) | ||
598 | num_of_risc = *prop; | ||
599 | |||
600 | of_node_put(qe); | ||
601 | |||
602 | return num_of_risc; | ||
603 | } | ||
604 | EXPORT_SYMBOL(qe_get_num_of_risc); | ||
605 | |||