aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2007-08-27 17:56:43 -0400
committerKumar Gala <galak@kernel.crashing.org>2007-10-04 12:02:24 -0400
commit4ff62e1c7f5263427e742069235d94ba1336960d (patch)
treeb1fd9ca3c09b04fd1c00e8dbfc4ac86589592f48 /arch
parent11af1192b75307e4099dd962b3b97b255d5ab023 (diff)
[POWERPC] mpc82xx: Remove a bunch of cruft that duplicates generic functionality.
m82xx_calibrate_decr(), mpc82xx_ads_show_cpuinfo(), and mpc82xx_halt() do anything useful beyond what the generic code does. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/82xx/Makefile1
-rw-r--r--arch/powerpc/platforms/82xx/mpc82xx.c109
-rw-r--r--arch/powerpc/platforms/82xx/mpc82xx_ads.c11
-rw-r--r--arch/powerpc/platforms/82xx/pq2ads.h6
4 files changed, 2 insertions, 125 deletions
diff --git a/arch/powerpc/platforms/82xx/Makefile b/arch/powerpc/platforms/82xx/Makefile
index d9fd4c84d2e0..534c35375b73 100644
--- a/arch/powerpc/platforms/82xx/Makefile
+++ b/arch/powerpc/platforms/82xx/Makefile
@@ -1,5 +1,4 @@
1# 1#
2# Makefile for the PowerPC 82xx linux kernel. 2# Makefile for the PowerPC 82xx linux kernel.
3# 3#
4obj-$(CONFIG_PPC_82xx) += mpc82xx.o
5obj-$(CONFIG_MPC82xx_ADS) += mpc82xx_ads.o 4obj-$(CONFIG_MPC82xx_ADS) += mpc82xx_ads.o
diff --git a/arch/powerpc/platforms/82xx/mpc82xx.c b/arch/powerpc/platforms/82xx/mpc82xx.c
deleted file mode 100644
index c706871aec1a..000000000000
--- a/arch/powerpc/platforms/82xx/mpc82xx.c
+++ /dev/null
@@ -1,109 +0,0 @@
1/*
2 * MPC82xx setup and early boot code plus other random bits.
3 *
4 * Author: Vitaly Bordug <vbordug@ru.mvista.com>
5 *
6 * Copyright (c) 2006 MontaVista Software, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
14#include <linux/stddef.h>
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/errno.h>
18#include <linux/reboot.h>
19#include <linux/pci.h>
20#include <linux/interrupt.h>
21#include <linux/kdev_t.h>
22#include <linux/major.h>
23#include <linux/console.h>
24#include <linux/delay.h>
25#include <linux/seq_file.h>
26#include <linux/root_dev.h>
27#include <linux/initrd.h>
28#include <linux/module.h>
29#include <linux/fsl_devices.h>
30#include <linux/fs_uart_pd.h>
31
32#include <asm/system.h>
33#include <asm/pgtable.h>
34#include <asm/page.h>
35#include <asm/atomic.h>
36#include <asm/time.h>
37#include <asm/io.h>
38#include <asm/machdep.h>
39#include <asm/pci-bridge.h>
40#include <asm/mpc8260.h>
41#include <asm/irq.h>
42#include <mm/mmu_decl.h>
43#include <asm/prom.h>
44#include <asm/cpm2.h>
45#include <asm/udbg.h>
46#include <asm/i8259.h>
47#include <linux/fs_enet_pd.h>
48
49#include <sysdev/fsl_soc.h>
50#include <sysdev/cpm2_pic.h>
51
52#include "pq2ads.h"
53
54static int __init get_freq(char *name, unsigned long *val)
55{
56 struct device_node *cpu;
57 const unsigned int *fp;
58 int found = 0;
59
60 /* The cpu node should have timebase and clock frequency properties */
61 cpu = of_find_node_by_type(NULL, "cpu");
62
63 if (cpu) {
64 fp = of_get_property(cpu, name, NULL);
65 if (fp) {
66 found = 1;
67 *val = *fp;
68 }
69
70 of_node_put(cpu);
71 }
72
73 return found;
74}
75
76void __init m82xx_calibrate_decr(void)
77{
78 ppc_tb_freq = 125000000;
79 if (!get_freq("bus-frequency", &ppc_tb_freq)) {
80 printk(KERN_ERR "WARNING: Estimating decrementer frequency "
81 "(not found)\n");
82 }
83 ppc_tb_freq /= 4;
84 ppc_proc_freq = 1000000000;
85 if (!get_freq("clock-frequency", &ppc_proc_freq))
86 printk(KERN_ERR "WARNING: Estimating processor frequency"
87 "(not found)\n");
88}
89
90void mpc82xx_ads_show_cpuinfo(struct seq_file *m)
91{
92 uint pvid, svid, phid1;
93 uint memsize = total_memory;
94
95 pvid = mfspr(SPRN_PVR);
96 svid = mfspr(SPRN_SVR);
97
98 seq_printf(m, "Vendor\t\t: Freescale Semiconductor\n");
99 seq_printf(m, "Machine\t\t: %s\n", CPUINFO_MACHINE);
100 seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
101 seq_printf(m, "SVR\t\t: 0x%x\n", svid);
102
103 /* Display cpu Pll setting */
104 phid1 = mfspr(SPRN_HID1);
105 seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
106
107 /* Display the amount of memory */
108 seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
109}
diff --git a/arch/powerpc/platforms/82xx/mpc82xx_ads.c b/arch/powerpc/platforms/82xx/mpc82xx_ads.c
index 40087952935a..5f538d5e7fdb 100644
--- a/arch/powerpc/platforms/82xx/mpc82xx_ads.c
+++ b/arch/powerpc/platforms/82xx/mpc82xx_ads.c
@@ -612,20 +612,13 @@ static void m82xx_restart(char *cmd)
612 while (1) ; 612 while (1) ;
613} 613}
614 614
615static void m82xx_halt(void)
616{
617 local_irq_disable();
618 while (1) ;
619}
620
621define_machine(mpc82xx_ads) 615define_machine(mpc82xx_ads)
622{ 616{
623 .name = "MPC82xx ADS", 617 .name = "MPC82xx ADS",
624 .probe = mpc82xx_ads_probe, 618 .probe = mpc82xx_ads_probe,
625 .setup_arch = mpc82xx_ads_setup_arch, 619 .setup_arch = mpc82xx_ads_setup_arch,
626 .init_IRQ = mpc82xx_ads_pic_init, 620 .init_IRQ = mpc82xx_ads_pic_init,
627 .show_cpuinfo = mpc82xx_ads_show_cpuinfo,
628 .get_irq = cpm2_get_irq, 621 .get_irq = cpm2_get_irq,
629 .calibrate_decr = m82xx_calibrate_decr, 622 .calibrate_decr = generic_calibrate_decr,
630 .restart = m82xx_restart,.halt = m82xx_halt, 623 .restart = m82xx_restart,
631}; 624};
diff --git a/arch/powerpc/platforms/82xx/pq2ads.h b/arch/powerpc/platforms/82xx/pq2ads.h
index 6f749b76dd8f..8b67048e6f22 100644
--- a/arch/powerpc/platforms/82xx/pq2ads.h
+++ b/arch/powerpc/platforms/82xx/pq2ads.h
@@ -24,10 +24,6 @@
24 24
25#include <linux/seq_file.h> 25#include <linux/seq_file.h>
26 26
27/* For our show_cpuinfo hooks. */
28#define CPUINFO_VENDOR "Freescale Semiconductor"
29#define CPUINFO_MACHINE "PQ2 ADS PowerPC"
30
31/* Backword-compatibility stuff for the drivers */ 27/* Backword-compatibility stuff for the drivers */
32#define CPM_MAP_ADDR ((uint)0xf0000000) 28#define CPM_MAP_ADDR ((uint)0xf0000000)
33#define CPM_IRQ_OFFSET 0 29#define CPM_IRQ_OFFSET 0
@@ -58,8 +54,6 @@
58#define SIU_INT_SCC4 ((uint)0x2b+CPM_IRQ_OFFSET) 54#define SIU_INT_SCC4 ((uint)0x2b+CPM_IRQ_OFFSET)
59 55
60void m82xx_pci_init_irq(void); 56void m82xx_pci_init_irq(void);
61void mpc82xx_ads_show_cpuinfo(struct seq_file*);
62void m82xx_calibrate_decr(void);
63 57
64#endif /* __MACH_ADS8260_DEFS */ 58#endif /* __MACH_ADS8260_DEFS */
65#endif /* __KERNEL__ */ 59#endif /* __KERNEL__ */