aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2005-10-20 06:48:19 -0400
committerPaul Mackerras <paulus@samba.org>2005-10-20 06:48:19 -0400
commit0dd194d02d2584c34e06ddd26c7a7896a5fa1974 (patch)
treef5441cf5497d78d0c3ed5ce9d9ae47328426f4f8
parenta9c59264690aea9d0df2d2d76683bc39ec6b7288 (diff)
powerpc: Fix places where ppc_md.show_[per]cpuinfo was treated as int
I missed a few places where ppc code was still assuming that the ppc_md.show_[per]cpuinfo functions returned int. Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/kernel/setup_32.c14
-rw-r--r--arch/powerpc/platforms/powermac/setup.c66
-rw-r--r--arch/powerpc/platforms/pseries/setup.c4
3 files changed, 26 insertions, 58 deletions
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index b95f7cf693e6..b9269c038af3 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -150,7 +150,6 @@ extern u32 cpu_temp_both(unsigned long cpu);
150int show_cpuinfo(struct seq_file *m, void *v) 150int show_cpuinfo(struct seq_file *m, void *v)
151{ 151{
152 int i = (int) v - 1; 152 int i = (int) v - 1;
153 int err = 0;
154 unsigned int pvr; 153 unsigned int pvr;
155 unsigned short maj, min; 154 unsigned short maj, min;
156 unsigned long lpj; 155 unsigned long lpj;
@@ -167,8 +166,8 @@ int show_cpuinfo(struct seq_file *m, void *v)
167#endif /* CONFIG_SMP */ 166#endif /* CONFIG_SMP */
168 167
169 if (ppc_md.show_cpuinfo != NULL) 168 if (ppc_md.show_cpuinfo != NULL)
170 err = ppc_md.show_cpuinfo(m); 169 ppc_md.show_cpuinfo(m);
171 return err; 170 return 0;
172 } 171 }
173 172
174#ifdef CONFIG_SMP 173#ifdef CONFIG_SMP
@@ -210,15 +209,12 @@ int show_cpuinfo(struct seq_file *m, void *v)
210 } 209 }
211#endif /* CONFIG_TAU */ 210#endif /* CONFIG_TAU */
212 211
213 if (ppc_md.show_percpuinfo != NULL) { 212 if (ppc_md.show_percpuinfo != NULL)
214 err = ppc_md.show_percpuinfo(m, i); 213 ppc_md.show_percpuinfo(m, i);
215 if (err)
216 return err;
217 }
218 214
219 /* If we are a Freescale core do a simple check so 215 /* If we are a Freescale core do a simple check so
220 * we dont have to keep adding cases in the future */ 216 * we dont have to keep adding cases in the future */
221 if ((PVR_VER(pvr) & 0x8000) == 0x8000) { 217 if (PVR_VER(pvr) & 0x8000) {
222 maj = PVR_MAJ(pvr); 218 maj = PVR_MAJ(pvr);
223 min = PVR_MIN(pvr); 219 min = PVR_MIN(pvr);
224 } else { 220 } else {
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index b6414e7c37d4..0bad53fa36ef 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -104,24 +104,26 @@ extern struct smp_ops_t psurge_smp_ops;
104extern struct smp_ops_t core99_smp_ops; 104extern struct smp_ops_t core99_smp_ops;
105#endif /* CONFIG_SMP */ 105#endif /* CONFIG_SMP */
106 106
107static int 107static void pmac_show_cpuinfo(struct seq_file *m)
108pmac_show_cpuinfo(struct seq_file *m)
109{ 108{
110 struct device_node *np; 109 struct device_node *np;
111 char *pp; 110 char *pp;
112 int plen; 111 int plen;
113 int mbmodel = pmac_call_feature(PMAC_FTR_GET_MB_INFO, 112 int mbmodel;
114 NULL, PMAC_MB_INFO_MODEL, 0); 113 unsigned int mbflags;
115 unsigned int mbflags = (unsigned int)pmac_call_feature(PMAC_FTR_GET_MB_INFO,
116 NULL, PMAC_MB_INFO_FLAGS, 0);
117 char* mbname; 114 char* mbname;
118 115
119 if (pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL, PMAC_MB_INFO_NAME, (int)&mbname) != 0) 116 mbmodel = pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL,
117 PMAC_MB_INFO_MODEL, 0);
118 mbflags = pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL,
119 PMAC_MB_INFO_FLAGS, 0);
120 if (pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL, PMAC_MB_INFO_NAME,
121 (long) &mbname) != 0)
120 mbname = "Unknown"; 122 mbname = "Unknown";
121 123
122 /* find motherboard type */ 124 /* find motherboard type */
123 seq_printf(m, "machine\t\t: "); 125 seq_printf(m, "machine\t\t: ");
124 np = find_devices("device-tree"); 126 np = of_find_node_by_path("/");
125 if (np != NULL) { 127 if (np != NULL) {
126 pp = (char *) get_property(np, "model", NULL); 128 pp = (char *) get_property(np, "model", NULL);
127 if (pp != NULL) 129 if (pp != NULL)
@@ -139,6 +141,7 @@ pmac_show_cpuinfo(struct seq_file *m)
139 } 141 }
140 seq_printf(m, "\n"); 142 seq_printf(m, "\n");
141 } 143 }
144 of_node_put(np);
142 } else 145 } else
143 seq_printf(m, "PowerMac\n"); 146 seq_printf(m, "PowerMac\n");
144 147
@@ -147,10 +150,10 @@ pmac_show_cpuinfo(struct seq_file *m)
147 seq_printf(m, "pmac flags\t: %08x\n", mbflags); 150 seq_printf(m, "pmac flags\t: %08x\n", mbflags);
148 151
149 /* find l2 cache info */ 152 /* find l2 cache info */
150 np = find_devices("l2-cache"); 153 np = of_find_node_by_name(NULL, "l2-cache");
151 if (np == 0) 154 if (np == NULL)
152 np = find_type_devices("cache"); 155 np = of_find_node_by_type(NULL, "cache");
153 if (np != 0) { 156 if (np != NULL) {
154 unsigned int *ic = (unsigned int *) 157 unsigned int *ic = (unsigned int *)
155 get_property(np, "i-cache-size", NULL); 158 get_property(np, "i-cache-size", NULL);
156 unsigned int *dc = (unsigned int *) 159 unsigned int *dc = (unsigned int *)
@@ -170,56 +173,25 @@ pmac_show_cpuinfo(struct seq_file *m)
170 if (pp) 173 if (pp)
171 seq_printf(m, " %s", pp); 174 seq_printf(m, " %s", pp);
172 seq_printf(m, "\n"); 175 seq_printf(m, "\n");
173 } 176 of_node_put(np);
174
175 /* find ram info */
176 np = find_devices("memory");
177 if (np != 0) {
178 int n;
179 struct reg_property *reg = (struct reg_property *)
180 get_property(np, "reg", &n);
181
182 if (reg != 0) {
183 unsigned long total = 0;
184
185 for (n /= sizeof(struct reg_property); n > 0; --n)
186 total += (reg++)->size;
187 seq_printf(m, "memory\t\t: %luMB\n", total >> 20);
188 }
189 }
190
191 /* Checks "l2cr-value" property in the registry */
192 np = find_devices("cpus");
193 if (np == 0)
194 np = find_type_devices("cpu");
195 if (np != 0) {
196 unsigned int *l2cr = (unsigned int *)
197 get_property(np, "l2cr-value", NULL);
198 if (l2cr != 0) {
199 seq_printf(m, "l2cr override\t: 0x%x\n", *l2cr);
200 }
201 } 177 }
202 178
203 /* Indicate newworld/oldworld */ 179 /* Indicate newworld/oldworld */
204 seq_printf(m, "pmac-generation\t: %s\n", 180 seq_printf(m, "pmac-generation\t: %s\n",
205 pmac_newworld ? "NewWorld" : "OldWorld"); 181 pmac_newworld ? "NewWorld" : "OldWorld");
206
207
208 return 0;
209} 182}
210 183
211static int 184static void pmac_show_percpuinfo(struct seq_file *m, int i)
212pmac_show_percpuinfo(struct seq_file *m, int i)
213{ 185{
214#ifdef CONFIG_CPU_FREQ_PMAC 186#ifdef CONFIG_CPU_FREQ_PMAC
215 extern unsigned int pmac_get_one_cpufreq(int i); 187 extern unsigned int pmac_get_one_cpufreq(int i);
216 unsigned int freq = pmac_get_one_cpufreq(i); 188 unsigned int freq = pmac_get_one_cpufreq(i);
217 if (freq != 0) { 189 if (freq != 0) {
218 seq_printf(m, "clock\t\t: %dMHz\n", freq/1000); 190 seq_printf(m, "clock\t\t: %dMHz\n", freq/1000);
219 return 0; 191 return;
220 } 192 }
221#endif /* CONFIG_CPU_FREQ_PMAC */ 193#endif /* CONFIG_CPU_FREQ_PMAC */
222 return of_show_percpuinfo(m, i); 194 of_show_percpuinfo(m, i);
223} 195}
224 196
225static volatile u32 *sysctrl_regs; 197static volatile u32 *sysctrl_regs;
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 0c84a44b43b4..c53dbbb4490a 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -90,7 +90,7 @@ static void pseries_dedicated_idle(void);
90static volatile void __iomem * chrp_int_ack_special; 90static volatile void __iomem * chrp_int_ack_special;
91struct mpic *pSeries_mpic; 91struct mpic *pSeries_mpic;
92 92
93void pSeries_get_cpuinfo(struct seq_file *m) 93void pSeries_show_cpuinfo(struct seq_file *m)
94{ 94{
95 struct device_node *root; 95 struct device_node *root;
96 const char *model = ""; 96 const char *model = "";
@@ -599,7 +599,7 @@ struct machdep_calls __initdata pSeries_md = {
599 .probe = pSeries_probe, 599 .probe = pSeries_probe,
600 .setup_arch = pSeries_setup_arch, 600 .setup_arch = pSeries_setup_arch,
601 .init_early = pSeries_init_early, 601 .init_early = pSeries_init_early,
602 .get_cpuinfo = pSeries_get_cpuinfo, 602 .show_cpuinfo = pSeries_show_cpuinfo,
603 .log_error = pSeries_log_error, 603 .log_error = pSeries_log_error,
604 .pcibios_fixup = pSeries_final_fixup, 604 .pcibios_fixup = pSeries_final_fixup,
605 .pci_probe_mode = pSeries_pci_probe_mode, 605 .pci_probe_mode = pSeries_pci_probe_mode,