libattr: remove libattr because it is clashing with udev/attr and is not used by...
[openembedded.git] / recipes / linux / linux-efika-2.6.20 / 0025-POWERPC-Misc-EFIKA-fixups-for-rtas-chrp.txt
blob8f39c3a3d620e162609ccc3b5bb49077dfa5e3dc
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
6 ---
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)
17         if (!root)
18                 return 1;
20 -       if (!of_find_node_by_path("/rtas"))
21 -               return 0;
23 -       if (!proc_mkdir("rtas", root))
24 -               return 1;
26 -       if (!proc_symlink("rtas", NULL, "ppc64/rtas"))
27 -               return 1;
29         return 0;
30  }
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);
45 +        if (!root)
46 +                return -1;
48 +#ifdef CONFIG_PPC64
49 +        if (!proc_symlink("rtas", NULL, "ppc64/rtas"))
50 +                return -1;
51 +#endif
53 +        return 0;
56  static int __init proc_rtas_init(void)
57  {
58         struct proc_dir_entry *entry;
60 -       if (!machine_is(pseries))
61 -               return -ENODEV;
63         rtas_node = of_find_node_by_name(NULL, "rtas");
64         if (rtas_node == NULL)
65                 return -ENODEV;
67 -       entry = create_proc_entry("ppc64/rtas/progress", S_IRUGO|S_IWUSR, NULL);
68 +       if (proc_rtas_create() != 0)
69 +               return -ENODEV;
71 +       entry = create_proc_entry("rtas/progress", S_IRUGO|S_IWUSR, NULL);
72         if (entry)
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);
77         if (entry)
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);
82         if (entry)
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);
87         if (entry)
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,
92                                   NULL);
93         if (entry)
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);
98         if (entry)
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);
103         if (entry)
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(),
116 +                                         "model", NULL);
117         if (dtype == NULL)
118                 return 0;
119         if (strcmp(dtype, "chrp"))
120                 return 0;
122 +       /*
123 +        * Filter out efika because it has its own platform
124 +       */
125 +       if (model && (strcmp(model, "EFIKA5K2") == 0) )
126 +               return 0;
128         ISA_DMA_THRESHOLD = ~0L;
129         DMA_MODE_READ = 0x44;
130         DMA_MODE_WRITE = 0x48;
131 -- 
132 1.4.4.2