1 From 95f80c44731c46261b0ba334b35ee803f21ef60b Mon Sep 17 00:00:00 2001
2 From: Grant Likely <grant.likely@secretlab.ca>
3 Date: Mon, 4 Dec 2006 23:01:13 -0700
4 Subject: [PATCH] [POWERPC] Misc EFIKA fixups for rtas/chrp
7 arch/powerpc/kernel/proc_ppc64.c | 9 --------
8 arch/powerpc/kernel/rtas-proc.c | 36 +++++++++++++++++++++++++---------
9 arch/powerpc/platforms/chrp/setup.c | 9 ++++++++
10 3 files changed, 35 insertions(+), 19 deletions(-)
12 diff --git a/arch/powerpc/kernel/proc_ppc64.c b/arch/powerpc/kernel/proc_ppc64.c
13 index dd7001c..fa54220 100644
14 --- a/arch/powerpc/kernel/proc_ppc64.c
15 +++ b/arch/powerpc/kernel/proc_ppc64.c
16 @@ -51,15 +51,6 @@ static int __init proc_ppc64_create(void)
20 - if (!of_find_node_by_path("/rtas"))
23 - if (!proc_mkdir("rtas", root))
26 - if (!proc_symlink("rtas", NULL, "ppc64/rtas"))
31 core_initcall(proc_ppc64_create);
32 diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c
33 index 2fe82ab..4c06c32 100644
34 --- a/arch/powerpc/kernel/rtas-proc.c
35 +++ b/arch/powerpc/kernel/rtas-proc.c
36 @@ -253,43 +253,59 @@ static void get_location_code(struct seq_file *m,
37 static void check_location_string(struct seq_file *m, const char *c);
38 static void check_location(struct seq_file *m, const char *c);
40 +static int __init proc_rtas_create(void)
42 + struct proc_dir_entry *root;
44 + root = proc_mkdir("rtas" , NULL);
49 + if (!proc_symlink("rtas", NULL, "ppc64/rtas"))
56 static int __init proc_rtas_init(void)
58 struct proc_dir_entry *entry;
60 - if (!machine_is(pseries))
63 rtas_node = of_find_node_by_name(NULL, "rtas");
64 if (rtas_node == NULL)
67 - entry = create_proc_entry("ppc64/rtas/progress", S_IRUGO|S_IWUSR, NULL);
68 + if (proc_rtas_create() != 0)
71 + entry = create_proc_entry("rtas/progress", S_IRUGO|S_IWUSR, NULL);
73 entry->proc_fops = &ppc_rtas_progress_operations;
75 - entry = create_proc_entry("ppc64/rtas/clock", S_IRUGO|S_IWUSR, NULL);
76 + entry = create_proc_entry("rtas/clock", S_IRUGO|S_IWUSR, NULL);
78 entry->proc_fops = &ppc_rtas_clock_operations;
80 - entry = create_proc_entry("ppc64/rtas/poweron", S_IWUSR|S_IRUGO, NULL);
81 + entry = create_proc_entry("rtas/poweron", S_IWUSR|S_IRUGO, NULL);
83 entry->proc_fops = &ppc_rtas_poweron_operations;
85 - entry = create_proc_entry("ppc64/rtas/sensors", S_IRUGO, NULL);
86 + entry = create_proc_entry("rtas/sensors", S_IRUGO, NULL);
88 entry->proc_fops = &ppc_rtas_sensors_operations;
90 - entry = create_proc_entry("ppc64/rtas/frequency", S_IWUSR|S_IRUGO,
91 + entry = create_proc_entry("rtas/frequency", S_IWUSR|S_IRUGO,
94 entry->proc_fops = &ppc_rtas_tone_freq_operations;
96 - entry = create_proc_entry("ppc64/rtas/volume", S_IWUSR|S_IRUGO, NULL);
97 + entry = create_proc_entry("rtas/volume", S_IWUSR|S_IRUGO, NULL);
99 entry->proc_fops = &ppc_rtas_tone_volume_operations;
101 - entry = create_proc_entry("ppc64/rtas/rmo_buffer", S_IRUSR, NULL);
102 + entry = create_proc_entry("rtas/rmo_buffer", S_IRUSR, NULL);
104 entry->proc_fops = &ppc_rtas_rmo_buf_ops;
106 diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
107 index e1f51d4..ec4515c 100644
108 --- a/arch/powerpc/platforms/chrp/setup.c
109 +++ b/arch/powerpc/platforms/chrp/setup.c
110 @@ -580,11 +580,20 @@ static int __init chrp_probe(void)
112 char *dtype = of_get_flat_dt_prop(of_get_flat_dt_root(),
113 "device_type", NULL);
115 + char *model = of_get_flat_dt_prop(of_get_flat_dt_root(),
119 if (strcmp(dtype, "chrp"))
123 + * Filter out efika because it has its own platform
125 + if (model && (strcmp(model, "EFIKA5K2") == 0) )
128 ISA_DMA_THRESHOLD = ~0L;
129 DMA_MODE_READ = 0x44;
130 DMA_MODE_WRITE = 0x48;