[Cbe-oss-dev] [patch 6/6] spufs: platform ops

Geoff Levand geoffrey.levand at am.sony.com
Thu Apr 27 07:52:52 EST 2006


Hooks a second platform into spu multi-platform support.

Signed-off-by: Geoff Levand <geoffrey.levand at am.sony.com>

--
Index: cell--alp--1/arch/powerpc/platforms/ps3/Makefile
===================================================================
--- cell--alp--1.orig/arch/powerpc/platforms/ps3/Makefile	2006-04-26 13:00:01.000000000 -0700
+++ cell--alp--1/arch/powerpc/platforms/ps3/Makefile	2006-04-26 13:19:26.000000000 -0700
@@ -1 +1,5 @@
-obj-n += setup.o
+obj-y += setup.o
+
+ifdef CONFIG_SPU_FS
+obj-y += spu_priv1.o
+endif
Index: cell--alp--1/arch/powerpc/platforms/ps3/setup.c
===================================================================
--- cell--alp--1.orig/arch/powerpc/platforms/ps3/setup.c	2006-04-21 13:04:41.284693750 -0700
+++ cell--alp--1/arch/powerpc/platforms/ps3/setup.c	2006-04-26 13:09:36.000000000 -0700
@@ -0,0 +1,38 @@
+/*
+ * setup.c - This file contains the platform setup routines for the
+ * Sony PS3 game console.
+ *
+ *  Copyright 2006 Sony Corp.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; version 2 of the License.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+
+#include <asm/spu.h>
+#include <asm/spu_priv1.h>
+#include <asm/machdep.h>
+
+extern const struct spu_priv1_ops spu_sony_hv_priv1_ops;
+
+static void __init
+ps3_setup_arch (void)
+{
+	spu_priv1_ops = &spu_sony_hv_priv1_ops;
+}
+
+struct machdep_calls __initdata ps3_md = {
+	.setup_arch = ps3_setup_arch,
+};
Index: cell--alp--1/arch/powerpc/platforms/ps3/spu_priv1.c
===================================================================
--- cell--alp--1.orig/arch/powerpc/platforms/ps3/spu_priv1.c	2006-04-21 13:04:41.284693750 -0700
+++ cell--alp--1/arch/powerpc/platforms/ps3/spu_priv1.c	2006-04-26 13:00:01.000000000 -0700
@@ -0,0 +1,176 @@
+/*
+ * spu_priv1.c - This file implements the spu hypervisor abstractions
+ * for running on a Sony PS3 game console.
+ *
+ *  Copyright 2006 Sony Corp.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; version 2 of the License.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/module.h>
+
+#include <asm/io.h>
+#include <asm/spu.h>
+#include <asm/spu_priv1.h>
+
+static void
+int_mask_and (struct spu *spu, int class, u64 mask)
+{
+	return;
+}
+
+static void
+int_mask_or (struct spu *spu, int class, u64 mask)
+{
+	return;
+}
+
+static void
+int_mask_set (struct spu *spu, int class, u64 mask)
+{
+	return;
+}
+
+static u64
+int_mask_get (struct spu *spu, int class)
+{
+	return 0;
+}
+
+static void
+int_stat_clear (struct spu *spu, int class, u64 stat)
+{
+	return;
+}
+
+static u64
+int_stat_get (struct spu *spu, int class)
+{
+	return 0;
+}
+
+static void
+set_cpu_affinity (struct spu *spu, int cpu)
+{
+	return;
+}
+
+static u64
+mfc_dar_get (struct spu *spu)
+{
+	return 0;
+}
+
+static u64
+mfc_dsisr_get (struct spu *spu)
+{
+	return 0;
+}
+
+static void
+mfc_dsisr_set (struct spu *spu, u64 dsisr)
+{
+	return;
+}
+
+static void
+mfc_sdr_set (struct spu *spu, u64 sdr)
+{
+	return;
+}
+
+static void
+mfc_sr1_set (struct spu *spu, u64 sr1)
+{
+	return;
+}
+
+static u64
+mfc_sr1_get (struct spu *spu)
+{
+	return 0;
+}
+
+static void
+mfc_tclass_id_set (struct spu *spu, u64 tclass_id)
+{
+	return;
+}
+
+static u64
+mfc_tclass_id_get (struct spu *spu)
+{
+	return 0;
+}
+
+static void
+smm_pgsz_set (struct spu *spu, u64 pgsz)
+{
+	return;
+}
+
+static void
+tlb_invalidate (struct spu *spu)
+{
+	return;
+}
+
+static void
+resource_allocation_groupID_set (struct spu *spu, u64 id)
+{
+	return;
+}
+
+static u64
+resource_allocation_groupID_get (struct spu *spu)
+{
+	return 0;
+}
+
+static void
+resource_allocation_enable_set (struct spu *spu, u64 enable)
+{
+	return;
+}
+
+static u64
+resource_allocation_enable_get (struct spu *spu)
+{
+	return 0;
+}
+
+const struct spu_priv1_ops spu_sony_hv_priv1_ops =
+{
+	.int_mask_and = int_mask_and,
+	.int_mask_or = int_mask_or,
+	.int_mask_set = int_mask_set,
+	.int_mask_get = int_mask_get,
+	.int_stat_clear = int_stat_clear,
+	.int_stat_get = int_stat_get,
+	.set_cpu_affinity = set_cpu_affinity,
+	.mfc_dar_get = mfc_dar_get,
+	.mfc_dsisr_get = mfc_dsisr_get,
+	.mfc_dsisr_set = mfc_dsisr_set,
+	.mfc_sdr_set = mfc_sdr_set,
+	.mfc_sr1_set = mfc_sr1_set,
+	.mfc_sr1_get = mfc_sr1_get,
+	.mfc_tclass_id_set = mfc_tclass_id_set,
+	.mfc_tclass_id_get = mfc_tclass_id_get,
+	.smm_pgsz_set = smm_pgsz_set,
+	.tlb_invalidate = tlb_invalidate,
+	.resource_allocation_groupID_set = resource_allocation_groupID_set,
+	.resource_allocation_groupID_get = resource_allocation_groupID_get,
+	.resource_allocation_enable_set = resource_allocation_enable_set,
+	.resource_allocation_enable_get = resource_allocation_enable_get,
+};




More information about the cbe-oss-dev mailing list