rpms/kernel/devel linux-2.6-cell-spu-device-tree.patch,1.6,1.7

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Apr 24 21:57:00 UTC 2007


Author: dwmw2

Update of /cvs/dist/rpms/kernel/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv17708

Modified Files:
	linux-2.6-cell-spu-device-tree.patch 
Log Message:
fix spu patch harder

linux-2.6-cell-spu-device-tree.patch:
 linux-2.6.20.ppc64.spustuff/arch/powerpc/platforms/cell/cbe_regs.c |  168 +++++++---
 linux-2.6.20.ppc64/arch/powerpc/oprofile/op_model_cell.c           |    1 
 linux-2.6.20.ppc64/arch/powerpc/platforms/cell/cbe_regs.h          |    5 
 linux-2.6.20.ppc64/include/asm-powerpc/cell-pmu.h                  |    5 
 4 files changed, 131 insertions(+), 48 deletions(-)

Index: linux-2.6-cell-spu-device-tree.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/linux-2.6-cell-spu-device-tree.patch,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- linux-2.6-cell-spu-device-tree.patch	24 Apr 2007 21:54:11 -0000	1.6
+++ linux-2.6-cell-spu-device-tree.patch	24 Apr 2007 21:56:57 -0000	1.7
@@ -67,15 +67,21 @@
  	struct cbe_pmd_regs __iomem *pmd_regs;
  	struct cbe_iic_regs __iomem *iic_regs;
  	struct cbe_mic_tm_regs __iomem *mic_tm_regs;
-@@ -37,6 +40,7 @@ static int cbe_regs_map_count;
+@@ -37,30 +40,43 @@ static int cbe_regs_map_count;
  static struct cbe_thread_map
  {
  	struct device_node *cpu_node;
 +	struct device_node *be_node;
  	struct cbe_regs_map *regs;
- 	unsigned int thread_id;
- 	unsigned int cbe_id;
-@@ -50,22 +54,29 @@ static struct cbe_regs_map *cbe_find_map
++	unsigned int thread_id;
++	unsigned int cbe_id;
+ } cbe_thread_map[NR_CPUS];
+ 
++static cpumask_t cbe_local_mask[MAX_CBE] = { [0 ... MAX_CBE-1] = CPU_MASK_NONE };
++static cpumask_t cbe_first_online_cpu = CPU_MASK_NONE;
++
+ static struct cbe_regs_map *cbe_find_map(struct device_node *np)
+ {
  	int i;
  	struct device_node *tmp_np;
  
@@ -118,42 +124,60 @@
  }
  
  struct cbe_pmd_regs __iomem *cbe_get_pmd_regs(struct device_node *np)
-@@ -137,6 +148,7 @@ EXPORT_SYMBOL_GPL(cbe_get_cpu_mic_tm_reg
+@@ -130,49 +146,69 @@ struct cbe_mic_tm_regs __iomem *cbe_get_
+ }
+ EXPORT_SYMBOL_GPL(cbe_get_cpu_mic_tm_regs);
  
+-/* FIXME
+- * This is little more than a stub at the moment.  It should be
+- * fleshed out so that it works for both SMT and non-SMT, no
+- * matter if the passed cpu is odd or even.
+- * For SMT enabled, returns 0 for even-numbered cpu; otherwise 1.
+- * For SMT disabled, returns 0 for all cpus.
+- */
  u32 cbe_get_hw_thread_id(int cpu)
  {
+-	return (cpu & 1);
 +	return cbe_thread_map[cpu].thread_id;
  }
  EXPORT_SYMBOL_GPL(cbe_get_hw_thread_id);
  
-@@ -152,36 +164,51 @@ u32 cbe_node_to_cpu(int node)
- }
- EXPORT_SYMBOL_GPL(cbe_node_to_cpu);
- 
 -void __init cbe_regs_init(void)
-+static struct device_node *cbe_get_be_node(int cpu_id)
++u32 cbe_cpu_to_node(int cpu)
  {
 -	int i;
 -	struct device_node *cpu;
-+	struct device_node *np;
++	return cbe_thread_map[cpu].cbe_id;
++}
++EXPORT_SYMBOL_GPL(cbe_cpu_to_node);
  
 -	/* Build local fast map of CPUs */
 -	for_each_possible_cpu(i)
 -		cbe_thread_map[i].cpu_node = of_get_cpu_node(i, NULL);
-+	for_each_node_by_type (np, "be") {
-+		int len,i;
-+		const phandle *cpu_handle;
++u32 cbe_node_to_cpu(int node)
++{
++	return find_first_bit( (unsigned long *) &cbe_local_mask[node], sizeof(cpumask_t));
++}
++EXPORT_SYMBOL_GPL(cbe_node_to_cpu);
  
 -	/* Find maps for each device tree CPU */
 -	for_each_node_by_type(cpu, "cpu") {
 -		struct cbe_regs_map *map = &cbe_regs_maps[cbe_regs_map_count++];
++static struct device_node *cbe_get_be_node(int cpu_id)
++{
++	struct device_node *np;
++
++	for_each_node_by_type (np, "be") {
++		int len,i;
++		const phandle *cpu_handle;
++
 +		cpu_handle = get_property(np, "cpus", &len);
 +
 +		for (i=0; i<len; i++)
 +			if (of_find_node_by_phandle(cpu_handle[i]) == of_get_cpu_node(cpu_id, NULL))
 +				return np;
 +	}
- 
++
 +	return NULL;
 +}
 +
@@ -161,7 +185,7 @@
 +{
 +	if(map->be_node) {
 +		struct device_node *be, *np;
-+
+ 
 +		be = map->be_node;
 +
 +		for_each_node_by_type(np, "pervasive")
@@ -198,7 +222,7 @@
  
  		prop = get_property(cpu, "pervasive", NULL);
  		if (prop != NULL)
-@@ -191,10 +218,56 @@ void __init cbe_regs_init(void)
+@@ -182,10 +218,56 @@ void __init cbe_regs_init(void)
  		if (prop != NULL)
  			map->iic_regs = ioremap(prop->address, prop->len);
  




More information about the fedora-cvs-commits mailing list