Commit 0dd194d0 authored by Paul Mackerras's avatar Paul Mackerras

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: default avatarPaul Mackerras <paulus@samba.org>
parent a9c59264
...@@ -150,7 +150,6 @@ extern u32 cpu_temp_both(unsigned long cpu); ...@@ -150,7 +150,6 @@ extern u32 cpu_temp_both(unsigned long cpu);
int show_cpuinfo(struct seq_file *m, void *v) int show_cpuinfo(struct seq_file *m, void *v)
{ {
int i = (int) v - 1; int i = (int) v - 1;
int err = 0;
unsigned int pvr; unsigned int pvr;
unsigned short maj, min; unsigned short maj, min;
unsigned long lpj; unsigned long lpj;
...@@ -167,8 +166,8 @@ int show_cpuinfo(struct seq_file *m, void *v) ...@@ -167,8 +166,8 @@ int show_cpuinfo(struct seq_file *m, void *v)
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
if (ppc_md.show_cpuinfo != NULL) if (ppc_md.show_cpuinfo != NULL)
err = ppc_md.show_cpuinfo(m); ppc_md.show_cpuinfo(m);
return err; return 0;
} }
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
...@@ -210,15 +209,12 @@ int show_cpuinfo(struct seq_file *m, void *v) ...@@ -210,15 +209,12 @@ int show_cpuinfo(struct seq_file *m, void *v)
} }
#endif /* CONFIG_TAU */ #endif /* CONFIG_TAU */
if (ppc_md.show_percpuinfo != NULL) { if (ppc_md.show_percpuinfo != NULL)
err = ppc_md.show_percpuinfo(m, i); ppc_md.show_percpuinfo(m, i);
if (err)
return err;
}
/* If we are a Freescale core do a simple check so /* If we are a Freescale core do a simple check so
* we dont have to keep adding cases in the future */ * we dont have to keep adding cases in the future */
if ((PVR_VER(pvr) & 0x8000) == 0x8000) { if (PVR_VER(pvr) & 0x8000) {
maj = PVR_MAJ(pvr); maj = PVR_MAJ(pvr);
min = PVR_MIN(pvr); min = PVR_MIN(pvr);
} else { } else {
......
...@@ -104,24 +104,26 @@ extern struct smp_ops_t psurge_smp_ops; ...@@ -104,24 +104,26 @@ extern struct smp_ops_t psurge_smp_ops;
extern struct smp_ops_t core99_smp_ops; extern struct smp_ops_t core99_smp_ops;
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
static int static void pmac_show_cpuinfo(struct seq_file *m)
pmac_show_cpuinfo(struct seq_file *m)
{ {
struct device_node *np; struct device_node *np;
char *pp; char *pp;
int plen; int plen;
int mbmodel = pmac_call_feature(PMAC_FTR_GET_MB_INFO, int mbmodel;
NULL, PMAC_MB_INFO_MODEL, 0); unsigned int mbflags;
unsigned int mbflags = (unsigned int)pmac_call_feature(PMAC_FTR_GET_MB_INFO,
NULL, PMAC_MB_INFO_FLAGS, 0);
char* mbname; char* mbname;
if (pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL, PMAC_MB_INFO_NAME, (int)&mbname) != 0) mbmodel = pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL,
PMAC_MB_INFO_MODEL, 0);
mbflags = pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL,
PMAC_MB_INFO_FLAGS, 0);
if (pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL, PMAC_MB_INFO_NAME,
(long) &mbname) != 0)
mbname = "Unknown"; mbname = "Unknown";
/* find motherboard type */ /* find motherboard type */
seq_printf(m, "machine\t\t: "); seq_printf(m, "machine\t\t: ");
np = find_devices("device-tree"); np = of_find_node_by_path("/");
if (np != NULL) { if (np != NULL) {
pp = (char *) get_property(np, "model", NULL); pp = (char *) get_property(np, "model", NULL);
if (pp != NULL) if (pp != NULL)
...@@ -139,6 +141,7 @@ pmac_show_cpuinfo(struct seq_file *m) ...@@ -139,6 +141,7 @@ pmac_show_cpuinfo(struct seq_file *m)
} }
seq_printf(m, "\n"); seq_printf(m, "\n");
} }
of_node_put(np);
} else } else
seq_printf(m, "PowerMac\n"); seq_printf(m, "PowerMac\n");
...@@ -147,10 +150,10 @@ pmac_show_cpuinfo(struct seq_file *m) ...@@ -147,10 +150,10 @@ pmac_show_cpuinfo(struct seq_file *m)
seq_printf(m, "pmac flags\t: %08x\n", mbflags); seq_printf(m, "pmac flags\t: %08x\n", mbflags);
/* find l2 cache info */ /* find l2 cache info */
np = find_devices("l2-cache"); np = of_find_node_by_name(NULL, "l2-cache");
if (np == 0) if (np == NULL)
np = find_type_devices("cache"); np = of_find_node_by_type(NULL, "cache");
if (np != 0) { if (np != NULL) {
unsigned int *ic = (unsigned int *) unsigned int *ic = (unsigned int *)
get_property(np, "i-cache-size", NULL); get_property(np, "i-cache-size", NULL);
unsigned int *dc = (unsigned int *) unsigned int *dc = (unsigned int *)
...@@ -170,56 +173,25 @@ pmac_show_cpuinfo(struct seq_file *m) ...@@ -170,56 +173,25 @@ pmac_show_cpuinfo(struct seq_file *m)
if (pp) if (pp)
seq_printf(m, " %s", pp); seq_printf(m, " %s", pp);
seq_printf(m, "\n"); seq_printf(m, "\n");
} of_node_put(np);
/* find ram info */
np = find_devices("memory");
if (np != 0) {
int n;
struct reg_property *reg = (struct reg_property *)
get_property(np, "reg", &n);
if (reg != 0) {
unsigned long total = 0;
for (n /= sizeof(struct reg_property); n > 0; --n)
total += (reg++)->size;
seq_printf(m, "memory\t\t: %luMB\n", total >> 20);
}
}
/* Checks "l2cr-value" property in the registry */
np = find_devices("cpus");
if (np == 0)
np = find_type_devices("cpu");
if (np != 0) {
unsigned int *l2cr = (unsigned int *)
get_property(np, "l2cr-value", NULL);
if (l2cr != 0) {
seq_printf(m, "l2cr override\t: 0x%x\n", *l2cr);
}
} }
/* Indicate newworld/oldworld */ /* Indicate newworld/oldworld */
seq_printf(m, "pmac-generation\t: %s\n", seq_printf(m, "pmac-generation\t: %s\n",
pmac_newworld ? "NewWorld" : "OldWorld"); pmac_newworld ? "NewWorld" : "OldWorld");
return 0;
} }
static int static void pmac_show_percpuinfo(struct seq_file *m, int i)
pmac_show_percpuinfo(struct seq_file *m, int i)
{ {
#ifdef CONFIG_CPU_FREQ_PMAC #ifdef CONFIG_CPU_FREQ_PMAC
extern unsigned int pmac_get_one_cpufreq(int i); extern unsigned int pmac_get_one_cpufreq(int i);
unsigned int freq = pmac_get_one_cpufreq(i); unsigned int freq = pmac_get_one_cpufreq(i);
if (freq != 0) { if (freq != 0) {
seq_printf(m, "clock\t\t: %dMHz\n", freq/1000); seq_printf(m, "clock\t\t: %dMHz\n", freq/1000);
return 0; return;
} }
#endif /* CONFIG_CPU_FREQ_PMAC */ #endif /* CONFIG_CPU_FREQ_PMAC */
return of_show_percpuinfo(m, i); of_show_percpuinfo(m, i);
} }
static volatile u32 *sysctrl_regs; static volatile u32 *sysctrl_regs;
......
...@@ -90,7 +90,7 @@ static void pseries_dedicated_idle(void); ...@@ -90,7 +90,7 @@ static void pseries_dedicated_idle(void);
static volatile void __iomem * chrp_int_ack_special; static volatile void __iomem * chrp_int_ack_special;
struct mpic *pSeries_mpic; struct mpic *pSeries_mpic;
void pSeries_get_cpuinfo(struct seq_file *m) void pSeries_show_cpuinfo(struct seq_file *m)
{ {
struct device_node *root; struct device_node *root;
const char *model = ""; const char *model = "";
...@@ -599,7 +599,7 @@ struct machdep_calls __initdata pSeries_md = { ...@@ -599,7 +599,7 @@ struct machdep_calls __initdata pSeries_md = {
.probe = pSeries_probe, .probe = pSeries_probe,
.setup_arch = pSeries_setup_arch, .setup_arch = pSeries_setup_arch,
.init_early = pSeries_init_early, .init_early = pSeries_init_early,
.get_cpuinfo = pSeries_get_cpuinfo, .show_cpuinfo = pSeries_show_cpuinfo,
.log_error = pSeries_log_error, .log_error = pSeries_log_error,
.pcibios_fixup = pSeries_final_fixup, .pcibios_fixup = pSeries_final_fixup,
.pci_probe_mode = pSeries_pci_probe_mode, .pci_probe_mode = pSeries_pci_probe_mode,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment