Let spu_management_ops.enumerate_spus() return the number of found SPEs
and use that information to draw some little helper penguin logos.
Signed-off-by: Geert Uytterhoeven <redacted>
Signed-off-by: Geoff Levand <redacted>
---
arch/powerpc/platforms/cell/spu_base.c | 11 +++++++++--
arch/powerpc/platforms/cell/spu_priv1_mmio.c | 4 +++-
arch/powerpc/platforms/ps3/spu.c | 6 ++++--
3 files changed, 16 insertions(+), 5 deletions(-)
--- geert-linux-src.orig/arch/powerpc/platforms/cell/spu_base.c
+++ geert-linux-src/arch/powerpc/platforms/cell/spu_base.c
@@ -31,6 +31,7 @@
#include <linux/mm.h>
#include <linux/io.h>
#include <linux/mutex.h>
+#include <linux/linux_logo.h>
#include <asm/spu.h>
#include <asm/spu_priv1.h>
#include <asm/xmon.h>
@@ -676,16 +677,22 @@ static int __init init_spu_base(void)
ret = spu_enumerate_spus(create_spu);
- if (ret) {
+ if (ret < 0) {
printk(KERN_WARNING "%s: Error initializing spus\n",
__FUNCTION__);
cleanup_spu_base();
return ret;
}
+#ifdef CONFIG_LOGO
+ if (ret > 0) {
+ extern const struct linux_logo logo_spe_clut224;
+ fb_append_extra_logo(&logo_spe_clut224, ret);
+ }
+#endif
xmon_register_spus(&spu_full_list);
- return ret;
+ return 0;
}
module_init(init_spu_base);
--- geert-linux-src.orig/arch/powerpc/platforms/cell/spu_priv1_mmio.c
+++ geert-linux-src/arch/powerpc/platforms/cell/spu_priv1_mmio.c@@ -331,6 +331,7 @@ static int __init of_enumerate_spus(int
{
int ret;
struct device_node *node;
+ unsigned int n = 0;
ret = -ENODEV;
for (node = of_find_node_by_type(NULL, "spe");@@ -341,8 +342,9 @@ static int __init of_enumerate_spus(int
__FUNCTION__, node->name);
break;
}
+ n++;
}
- return ret;
+ return ret ? ret : n;
}
static int __init of_create_spu(struct spu *spu, void *data)
--- geert-linux-src.orig/arch/powerpc/platforms/ps3/spu.c
+++ geert-linux-src/arch/powerpc/platforms/ps3/spu.c
@@ -437,11 +437,13 @@ static int __init ps3_enumerate_spus(int
}
}
- if (result)
+ if (result) {
printk(KERN_WARNING "%s:%d: Error initializing spus\n",
__func__, __LINE__);
+ return result;
+ }
- return result;
+ return num_resource_id;
}
const struct spu_management_ops spu_management_ps3_ops = {
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV