Skip to content

Commit

Permalink
powerpc: Move memory size print into common show_cpuinfo for 32-bit
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Becky Bruce authored and Benjamin Herrenschmidt committed Oct 22, 2008
1 parent 934752d commit f465df8
Show file tree
Hide file tree
Showing 13 changed files with 7 additions and 40 deletions.
7 changes: 7 additions & 0 deletions arch/powerpc/kernel/setup-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
#include <asm/mmu.h>
#include <asm/xmon.h>
#include <asm/cputhreads.h>
#include <mm/mmu_decl.h>

#include "setup.h"

Expand Down Expand Up @@ -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;
}

Expand Down
4 changes: 0 additions & 4 deletions arch/powerpc/platforms/85xx/ksi8560.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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[] = {
Expand Down
4 changes: 0 additions & 4 deletions arch/powerpc/platforms/85xx/mpc85xx_ads.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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[] = {
Expand Down
4 changes: 0 additions & 4 deletions arch/powerpc/platforms/85xx/mpc85xx_cds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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));
}


Expand Down
4 changes: 0 additions & 4 deletions arch/powerpc/platforms/85xx/sbc8548.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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[] = {
Expand Down
4 changes: 0 additions & 4 deletions arch/powerpc/platforms/85xx/sbc8560.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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[] = {
Expand Down
4 changes: 0 additions & 4 deletions arch/powerpc/platforms/85xx/stx_gp3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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[] = {
Expand Down
4 changes: 0 additions & 4 deletions arch/powerpc/platforms/85xx/tqm85xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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[] = {
Expand Down
2 changes: 0 additions & 2 deletions arch/powerpc/platforms/86xx/gef_sbc610.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}


Expand Down
2 changes: 0 additions & 2 deletions arch/powerpc/platforms/86xx/sbc8641d.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}


Expand Down
3 changes: 0 additions & 3 deletions arch/powerpc/platforms/embedded6xx/c2k.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
3 changes: 0 additions & 3 deletions arch/powerpc/platforms/embedded6xx/prpmc2800.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit f465df8

Please sign in to comment.