powerpc: Move memory size print into common show_cpuinfo for 32-bit
Most of the platforms were printing the size of the memory in their show_cpuinfo implementations. This moves that to the common show_cpuinfo, so that all 32-bit platforms will now print the size of memory. I also update the code to deal with the fact that total_memory is now a phys_addr_t. Signed-off-by: Becky Bruce <becky.bruce@freescale.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
Родитель
934752d8a4
Коммит
f465df81a8
|
@ -59,6 +59,7 @@
|
|||
#include <asm/mmu.h>
|
||||
#include <asm/xmon.h>
|
||||
#include <asm/cputhreads.h>
|
||||
#include <mm/mmu_decl.h>
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
|
@ -190,6 +191,12 @@ static int show_cpuinfo(struct seq_file *m, void *v)
|
|||
if (ppc_md.show_cpuinfo != NULL)
|
||||
ppc_md.show_cpuinfo(m);
|
||||
|
||||
#ifdef CONFIG_PPC32
|
||||
/* Display the amount of memory */
|
||||
seq_printf(m, "Memory\t\t: %d MB\n",
|
||||
(unsigned int)(total_memory / (1024 * 1024)));
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -193,7 +193,6 @@ static void __init ksi8560_setup_arch(void)
|
|||
static void ksi8560_show_cpuinfo(struct seq_file *m)
|
||||
{
|
||||
uint pvid, svid, phid1;
|
||||
uint memsize = total_memory;
|
||||
|
||||
pvid = mfspr(SPRN_PVR);
|
||||
svid = mfspr(SPRN_SVR);
|
||||
|
@ -215,9 +214,6 @@ static void ksi8560_show_cpuinfo(struct seq_file *m)
|
|||
/* Display cpu Pll setting */
|
||||
phid1 = mfspr(SPRN_HID1);
|
||||
seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
|
||||
|
||||
/* Display the amount of memory */
|
||||
seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
|
||||
}
|
||||
|
||||
static struct of_device_id __initdata of_bus_ids[] = {
|
||||
|
|
|
@ -207,7 +207,6 @@ static void __init mpc85xx_ads_setup_arch(void)
|
|||
static void mpc85xx_ads_show_cpuinfo(struct seq_file *m)
|
||||
{
|
||||
uint pvid, svid, phid1;
|
||||
uint memsize = total_memory;
|
||||
|
||||
pvid = mfspr(SPRN_PVR);
|
||||
svid = mfspr(SPRN_SVR);
|
||||
|
@ -219,9 +218,6 @@ static void mpc85xx_ads_show_cpuinfo(struct seq_file *m)
|
|||
/* Display cpu Pll setting */
|
||||
phid1 = mfspr(SPRN_HID1);
|
||||
seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
|
||||
|
||||
/* Display the amount of memory */
|
||||
seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
|
||||
}
|
||||
|
||||
static struct of_device_id __initdata of_bus_ids[] = {
|
||||
|
|
|
@ -307,7 +307,6 @@ static void __init mpc85xx_cds_setup_arch(void)
|
|||
static void mpc85xx_cds_show_cpuinfo(struct seq_file *m)
|
||||
{
|
||||
uint pvid, svid, phid1;
|
||||
uint memsize = total_memory;
|
||||
|
||||
pvid = mfspr(SPRN_PVR);
|
||||
svid = mfspr(SPRN_SVR);
|
||||
|
@ -320,9 +319,6 @@ static void mpc85xx_cds_show_cpuinfo(struct seq_file *m)
|
|||
/* Display cpu Pll setting */
|
||||
phid1 = mfspr(SPRN_HID1);
|
||||
seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
|
||||
|
||||
/* Display the amount of memory */
|
||||
seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -136,7 +136,6 @@ static void __init sbc8548_setup_arch(void)
|
|||
static void sbc8548_show_cpuinfo(struct seq_file *m)
|
||||
{
|
||||
uint pvid, svid, phid1;
|
||||
uint memsize = total_memory;
|
||||
|
||||
pvid = mfspr(SPRN_PVR);
|
||||
svid = mfspr(SPRN_SVR);
|
||||
|
@ -149,9 +148,6 @@ static void sbc8548_show_cpuinfo(struct seq_file *m)
|
|||
/* Display cpu Pll setting */
|
||||
phid1 = mfspr(SPRN_HID1);
|
||||
seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
|
||||
|
||||
/* Display the amount of memory */
|
||||
seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
|
||||
}
|
||||
|
||||
static struct of_device_id __initdata of_bus_ids[] = {
|
||||
|
|
|
@ -194,7 +194,6 @@ static void __init sbc8560_setup_arch(void)
|
|||
static void sbc8560_show_cpuinfo(struct seq_file *m)
|
||||
{
|
||||
uint pvid, svid, phid1;
|
||||
uint memsize = total_memory;
|
||||
|
||||
pvid = mfspr(SPRN_PVR);
|
||||
svid = mfspr(SPRN_SVR);
|
||||
|
@ -206,9 +205,6 @@ static void sbc8560_show_cpuinfo(struct seq_file *m)
|
|||
/* Display cpu Pll setting */
|
||||
phid1 = mfspr(SPRN_HID1);
|
||||
seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
|
||||
|
||||
/* Display the amount of memory */
|
||||
seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
|
||||
}
|
||||
|
||||
static struct of_device_id __initdata of_bus_ids[] = {
|
||||
|
|
|
@ -130,7 +130,6 @@ static void __init stx_gp3_setup_arch(void)
|
|||
static void stx_gp3_show_cpuinfo(struct seq_file *m)
|
||||
{
|
||||
uint pvid, svid, phid1;
|
||||
uint memsize = total_memory;
|
||||
|
||||
pvid = mfspr(SPRN_PVR);
|
||||
svid = mfspr(SPRN_SVR);
|
||||
|
@ -142,9 +141,6 @@ static void stx_gp3_show_cpuinfo(struct seq_file *m)
|
|||
/* Display cpu Pll setting */
|
||||
phid1 = mfspr(SPRN_HID1);
|
||||
seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
|
||||
|
||||
/* Display the amount of memory */
|
||||
seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
|
||||
}
|
||||
|
||||
static struct of_device_id __initdata of_bus_ids[] = {
|
||||
|
|
|
@ -138,7 +138,6 @@ static void __init tqm85xx_setup_arch(void)
|
|||
static void tqm85xx_show_cpuinfo(struct seq_file *m)
|
||||
{
|
||||
uint pvid, svid, phid1;
|
||||
uint memsize = total_memory;
|
||||
|
||||
pvid = mfspr(SPRN_PVR);
|
||||
svid = mfspr(SPRN_SVR);
|
||||
|
@ -150,9 +149,6 @@ static void tqm85xx_show_cpuinfo(struct seq_file *m)
|
|||
/* Display cpu Pll setting */
|
||||
phid1 = mfspr(SPRN_HID1);
|
||||
seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
|
||||
|
||||
/* Display the amount of memory */
|
||||
seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
|
||||
}
|
||||
|
||||
static struct of_device_id __initdata of_bus_ids[] = {
|
||||
|
|
|
@ -127,7 +127,6 @@ static unsigned int gef_sbc610_get_fpga_rev(void)
|
|||
|
||||
static void gef_sbc610_show_cpuinfo(struct seq_file *m)
|
||||
{
|
||||
uint memsize = total_memory;
|
||||
uint svid = mfspr(SPRN_SVR);
|
||||
|
||||
seq_printf(m, "Vendor\t\t: GE Fanuc Intelligent Platforms\n");
|
||||
|
@ -137,7 +136,6 @@ static void gef_sbc610_show_cpuinfo(struct seq_file *m)
|
|||
seq_printf(m, "FPGA Revision\t: %u\n", gef_sbc610_get_fpga_rev());
|
||||
|
||||
seq_printf(m, "SVR\t\t: 0x%x\n", svid);
|
||||
seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
|
||||
}
|
||||
|
||||
static void __init gef_sbc610_nec_fixup(struct pci_dev *pdev)
|
||||
|
|
|
@ -101,13 +101,11 @@ mpc86xx_hpcn_setup_arch(void)
|
|||
static void
|
||||
mpc86xx_hpcn_show_cpuinfo(struct seq_file *m)
|
||||
{
|
||||
uint memsize = total_memory;
|
||||
uint svid = mfspr(SPRN_SVR);
|
||||
|
||||
seq_printf(m, "Vendor\t\t: Freescale Semiconductor\n");
|
||||
|
||||
seq_printf(m, "SVR\t\t: 0x%x\n", svid);
|
||||
seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -63,13 +63,11 @@ sbc8641_setup_arch(void)
|
|||
static void
|
||||
sbc8641_show_cpuinfo(struct seq_file *m)
|
||||
{
|
||||
uint memsize = total_memory;
|
||||
uint svid = mfspr(SPRN_SVR);
|
||||
|
||||
seq_printf(m, "Vendor\t\t: Wind River Systems\n");
|
||||
|
||||
seq_printf(m, "SVR\t\t: 0x%x\n", svid);
|
||||
seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -116,10 +116,7 @@ static void c2k_restart(char *cmd)
|
|||
|
||||
void c2k_show_cpuinfo(struct seq_file *m)
|
||||
{
|
||||
uint memsize = total_memory;
|
||||
|
||||
seq_printf(m, "Vendor\t\t: GEFanuc\n");
|
||||
seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
|
||||
seq_printf(m, "coherency\t: %s\n", COHERENCY_SETTING);
|
||||
}
|
||||
|
||||
|
|
|
@ -119,10 +119,7 @@ static void prpmc2800_restart(char *cmd)
|
|||
|
||||
void prpmc2800_show_cpuinfo(struct seq_file *m)
|
||||
{
|
||||
uint memsize = total_memory;
|
||||
|
||||
seq_printf(m, "Vendor\t\t: Motorola\n");
|
||||
seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
|
||||
seq_printf(m, "coherency\t: %s\n", PPRPM2800_COHERENCY_SETTING);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче