Skip to content

Commit

Permalink
[POWERPC] cell: abstract spu management routines
Browse files Browse the repository at this point in the history
This adds a platform specific spu management abstraction and the coresponding
routines to support the IBM Cell Blade.  It also removes the hypervisor only
resources that were included in struct spu.

Three new platform specific routines are introduced, spu_enumerate_spus(),
spu_create_spu() and spu_destroy_spu().  The underlying design uses a new
type, struct spu_management_ops, to hold function pointers that the platform
setup code is expected to initialize to instances appropriate to that platform.

For the IBM Cell Blade support, I put the hypervisor only resources that were
in struct spu into a platform specific data structure struct spu_pdata.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
  • Loading branch information
Geoff Levand authored and Paul Mackerras committed Dec 4, 2006
1 parent e34226d commit e28b003
Show file tree
Hide file tree
Showing 7 changed files with 490 additions and 347 deletions.
5 changes: 3 additions & 2 deletions arch/powerpc/platforms/cell/cbe_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@
#include <asm/prom.h>

#include "cbe_regs.h"
#include "spu_priv1_mmio.h"

static struct cbe_pmd_regs __iomem *get_pmd_regs(struct sys_device *sysdev)
{
struct spu *spu;

spu = container_of(sysdev, struct spu, sysdev);

return cbe_get_pmd_regs(spu->devnode);
return cbe_get_pmd_regs(spu_devnode(spu));
}

/* returns the value for a given spu in a given register */
Expand All @@ -49,7 +50,7 @@ static u8 spu_read_register_value(struct sys_device *sysdev, union spe_reg __iom
/* getting the id from the reg attribute will not work on future device-tree layouts
* in future we should store the id to the spu struct and use it here */
spu = container_of(sysdev, struct spu, sysdev);
id = (unsigned int *)get_property(spu->devnode, "reg", NULL);
id = (unsigned int *)get_property(spu_devnode(spu), "reg", NULL);
value.val = in_be64(&reg->val);

return value.spe[*id];
Expand Down
3 changes: 2 additions & 1 deletion arch/powerpc/platforms/cell/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ static void __init cell_init_irq(void)
static void __init cell_setup_arch(void)
{
#ifdef CONFIG_SPU_BASE
spu_priv1_ops = &spu_priv1_mmio_ops;
spu_priv1_ops = &spu_priv1_mmio_ops;
spu_management_ops = &spu_management_of_ops;
#endif

cbe_regs_init();
Expand Down
Loading

0 comments on commit e28b003

Please sign in to comment.