diff options
author | Paul Mackerras <paulus@samba.org> | 2005-10-20 06:48:19 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-10-20 06:48:19 -0400 |
commit | 0dd194d02d2584c34e06ddd26c7a7896a5fa1974 (patch) | |
tree | f5441cf5497d78d0c3ed5ce9d9ae47328426f4f8 /arch/powerpc/platforms | |
parent | a9c59264690aea9d0df2d2d76683bc39ec6b7288 (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>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/powermac/setup.c | 66 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/setup.c | 4 |
2 files changed, 21 insertions, 49 deletions
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; | |||
104 | extern struct smp_ops_t core99_smp_ops; | 104 | extern struct smp_ops_t core99_smp_ops; |
105 | #endif /* CONFIG_SMP */ | 105 | #endif /* CONFIG_SMP */ |
106 | 106 | ||
107 | static int | 107 | static void pmac_show_cpuinfo(struct seq_file *m) |
108 | pmac_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 | ||
211 | static int | 184 | static void pmac_show_percpuinfo(struct seq_file *m, int i) |
212 | pmac_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 | ||
225 | static volatile u32 *sysctrl_regs; | 197 | static 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); | |||
90 | static volatile void __iomem * chrp_int_ack_special; | 90 | static volatile void __iomem * chrp_int_ack_special; |
91 | struct mpic *pSeries_mpic; | 91 | struct mpic *pSeries_mpic; |
92 | 92 | ||
93 | void pSeries_get_cpuinfo(struct seq_file *m) | 93 | void 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, |