2 * MPC82xx setup and early boot code plus other random bits.
4 * Author: Vitaly Bordug <vbordug@ru.mvista.com>
6 * Copyright (c) 2006 MontaVista Software, Inc.
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.
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>
32 #include <asm/system.h>
33 #include <asm/pgtable.h>
35 #include <asm/atomic.h>
38 #include <asm/machdep.h>
39 #include <asm/pci-bridge.h>
40 #include <asm/mpc8260.h>
42 #include <mm/mmu_decl.h>
46 #include <asm/i8259.h>
47 #include <linux/fs_enet_pd.h>
49 #include <sysdev/fsl_soc.h>
50 #include <sysdev/cpm2_pic.h>
54 static int __init
get_freq(char *name
, unsigned long *val
)
56 struct device_node
*cpu
;
57 const unsigned int *fp
;
60 /* The cpu node should have timebase and clock frequency properties */
61 cpu
= of_find_node_by_type(NULL
, "cpu");
64 fp
= of_get_property(cpu
, name
, NULL
);
76 void __init
m82xx_calibrate_decr(void)
78 ppc_tb_freq
= 125000000;
79 if (!get_freq("bus-frequency", &ppc_tb_freq
)) {
80 printk(KERN_ERR
"WARNING: Estimating decrementer frequency "
84 ppc_proc_freq
= 1000000000;
85 if (!get_freq("clock-frequency", &ppc_proc_freq
))
86 printk(KERN_ERR
"WARNING: Estimating processor frequency"
90 void mpc82xx_ads_show_cpuinfo(struct seq_file
*m
)
92 uint pvid
, svid
, phid1
;
93 uint memsize
= total_memory
;
95 pvid
= mfspr(SPRN_PVR
);
96 svid
= mfspr(SPRN_SVR
);
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
);
103 /* Display cpu Pll setting */
104 phid1
= mfspr(SPRN_HID1
);
105 seq_printf(m
, "PLL setting\t: 0x%x\n", ((phid1
>> 24) & 0x3f));
107 /* Display the amount of memory */
108 seq_printf(m
, "Memory\t\t: %d MB\n", memsize
/ (1024 * 1024));