rpms/kernel/devel linux-2.6-cell-spu-device-tree.patch,1.1,1.2
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Tue Apr 24 11:26:30 UTC 2007
Author: dwmw2
Update of /cvs/dist/rpms/kernel/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv16470
Modified Files:
linux-2.6-cell-spu-device-tree.patch
Log Message:
fix patch to apply to current kernel
linux-2.6-cell-spu-device-tree.patch:
cbe_regs.c | 126 ++++++++++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 92 insertions(+), 34 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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- linux-2.6-cell-spu-device-tree.patch 24 Apr 2007 10:57:33 -0000 1.1
+++ linux-2.6-cell-spu-device-tree.patch 24 Apr 2007 11:26:28 -0000 1.2
@@ -1,18 +1,5 @@
-From: Christian Krafft <krafft at de.ibm.com>
-
-This patch adds support for a proper device-tree.
-A porper device-tree on cell contains be nodes
-for each CBE containg nodes for SPEs and all the
-other special devices on it.
-Ofcourse oldschool devicetree is still supported.
-
-Signed-off-by: Christian Krafft <krafft at de.ibm.com>
-Signed-off-by: Arnd Bergmann <arnd.bergmann at de.ibm.com>
-
-Index: linux-2.6/arch/powerpc/platforms/cell/cbe_regs.c
-===================================================================
---- linux-2.6.orig/arch/powerpc/platforms/cell/cbe_regs.c
-+++ linux-2.6/arch/powerpc/platforms/cell/cbe_regs.c
+--- arch/powerpc/platforms/cell/cbe_regs.c.spu 2007-02-04 18:44:54.000000000 +0000
++++ arch/powerpc/platforms/cell/cbe_regs.c 2007-04-24 12:24:20.000000000 +0100
@@ -14,6 +14,8 @@
#include <asm/pgtable.h>
#include <asm/prom.h>
@@ -36,9 +23,9 @@
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
+ } cbe_thread_map[NR_CPUS];
+
+@@ -45,22 +49,29 @@ static struct cbe_regs_map *cbe_find_map
int i;
struct device_node *tmp_np;
@@ -81,9 +68,9 @@
}
struct cbe_pmd_regs __iomem *cbe_get_pmd_regs(struct device_node *np)
-@@ -153,6 +164,67 @@ u32 cbe_node_to_cpu(int node)
+@@ -143,26 +154,82 @@ u32 cbe_get_hw_thread_id(int cpu)
}
- EXPORT_SYMBOL_GPL(cbe_node_to_cpu);
+ EXPORT_SYMBOL_GPL(cbe_get_hw_thread_id);
+static struct device_node *cbe_get_be_node(int cpu_id)
+{
@@ -149,17 +136,18 @@
void __init cbe_regs_init(void)
{
int i;
-@@ -162,6 +234,7 @@ void __init cbe_regs_init(void)
+ struct device_node *cpu;
+
/* Build local fast map of CPUs */
- for_each_possible_cpu(i) {
- cbe_thread_map[i].cpu_node = of_get_cpu_node(i, &thread_id);
-+ cbe_thread_map[i].be_node = cbe_get_be_node(i);
- cbe_thread_map[i].thread_id = thread_id;
- }
+- for_each_possible_cpu(i)
++ for_each_possible_cpu(i) {
+ cbe_thread_map[i].cpu_node = of_get_cpu_node(i, NULL);
++ cbe_thread_map[i].be_node = cbe_get_be_node(i);
++ }
-@@ -170,12 +243,6 @@ void __init cbe_regs_init(void)
- struct cbe_regs_map *map;
- unsigned int cbe_id;
+ /* 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++];
- /* That hack must die die die ! */
- const struct address_prop {
@@ -167,39 +155,33 @@
- unsigned int len;
- } __attribute__((packed)) *prop;
-
- cbe_id = cbe_regs_map_count++;
- map = &cbe_regs_maps[cbe_id];
-
-@@ -193,23 +260,14 @@ void __init cbe_regs_init(void)
- if (thread->cpu_node == cpu) {
- thread->regs = map;
- thread->cbe_id = cbe_id;
-+ map->be_node = thread->be_node;
- cpu_set(i, cbe_local_mask[cbe_id]);
- if(thread->thread_id == 0)
- cpu_set(i, cbe_first_online_cpu);
- }
+-
+ if (cbe_regs_map_count > MAX_CBE) {
+ printk(KERN_ERR "cbe_regs: More BE chips than supported"
+ "!\n");
+@@ -171,21 +238,12 @@ void __init cbe_regs_init(void)
}
+ map->cpu_node = cpu;
+ for_each_possible_cpu(i)
+- if (cbe_thread_map[i].cpu_node == cpu)
++ if (cbe_thread_map[i].cpu_node == cpu) {
+ cbe_thread_map[i].regs = map;
++ map->be_node = thread->be_node;
++ }
-- prop = of_get_property(cpu, "pervasive", NULL);
+- prop = get_property(cpu, "pervasive", NULL);
- if (prop != NULL)
- map->pmd_regs = ioremap(prop->address, prop->len);
-
-- prop = of_get_property(cpu, "iic", NULL);
+- prop = get_property(cpu, "iic", NULL);
- if (prop != NULL)
- map->iic_regs = ioremap(prop->address, prop->len);
-
-- prop = of_get_property(cpu, "mic-tm", NULL);
+- prop = (struct address_prop *)get_property(cpu, "mic-tm",
+- NULL);
- if (prop != NULL)
- map->mic_tm_regs = ioremap(prop->address, prop->len);
+ cbe_fill_regs_map(map);
}
}
-
---
-
-_______________________________________________
-Linuxppc-dev mailing list
-Linuxppc-dev at ozlabs.org
-https://ozlabs.org/mailman/listinfo/linuxppc-dev
More information about the fedora-cvs-commits
mailing list