2 * MPC85xx setup and early boot code plus other random bits.
4 * Maintained by Kumar Gala (see MAINTAINERS for contact information)
6 * Copyright 2005 Freescale Semiconductor 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/config.h>
15 #include <linux/stddef.h>
16 #include <linux/kernel.h>
17 #include <linux/pci.h>
18 #include <linux/kdev_t.h>
19 #include <linux/delay.h>
20 #include <linux/seq_file.h>
21 #include <linux/root_dev.h>
23 #include <asm/system.h>
25 #include <asm/machdep.h>
26 #include <asm/pci-bridge.h>
27 #include <asm/mpc85xx.h>
30 #include <mm/mmu_decl.h>
33 #include <sysdev/fsl_soc.h>
37 unsigned long isa_io_base = 0;
38 unsigned long isa_mem_base = 0;
42 * Internal interrupts are all Level Sensitive, and Positive Polarity
44 * Note: Likely, this table and the following function should be
45 * obtained and derived from the OF Device Tree.
47 static u_char mpc85xx_ads_openpic_initsenses[] __initdata = {
48 MPC85XX_INTERNAL_IRQ_SENSES,
49 0x0, /* External 0: */
50 #if defined(CONFIG_PCI)
51 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext 1: PCI slot 0 */
52 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext 2: PCI slot 1 */
53 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext 3: PCI slot 2 */
54 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext 4: PCI slot 3 */
56 0x0, /* External 1: */
57 0x0, /* External 2: */
58 0x0, /* External 3: */
59 0x0, /* External 4: */
61 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 5: PHY */
62 0x0, /* External 6: */
63 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 7: PHY */
64 0x0, /* External 8: */
65 0x0, /* External 9: */
66 0x0, /* External 10: */
67 0x0, /* External 11: */
70 void __init mpc85xx_ads_pic_init(void)
73 phys_addr_t OpenPIC_PAddr;
75 /* Determine the Physical Address of the OpenPIC regs */
76 OpenPIC_PAddr = get_immrbase() + MPC85xx_OPENPIC_OFFSET;
78 mpic1 = mpic_alloc(OpenPIC_PAddr,
79 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
80 4, MPC85xx_OPENPIC_IRQ_OFFSET, 0, 250,
81 mpc85xx_ads_openpic_initsenses,
82 sizeof(mpc85xx_ads_openpic_initsenses),
84 BUG_ON(mpic1 == NULL);
85 mpic_assign_isu(mpic1, 0, OpenPIC_PAddr + 0x10200);
86 mpic_assign_isu(mpic1, 1, OpenPIC_PAddr + 0x10280);
87 mpic_assign_isu(mpic1, 2, OpenPIC_PAddr + 0x10300);
88 mpic_assign_isu(mpic1, 3, OpenPIC_PAddr + 0x10380);
89 mpic_assign_isu(mpic1, 4, OpenPIC_PAddr + 0x10400);
90 mpic_assign_isu(mpic1, 5, OpenPIC_PAddr + 0x10480);
91 mpic_assign_isu(mpic1, 6, OpenPIC_PAddr + 0x10500);
92 mpic_assign_isu(mpic1, 7, OpenPIC_PAddr + 0x10580);
94 /* dummy mappings to get to 48 */
95 mpic_assign_isu(mpic1, 8, OpenPIC_PAddr + 0x10600);
96 mpic_assign_isu(mpic1, 9, OpenPIC_PAddr + 0x10680);
97 mpic_assign_isu(mpic1, 10, OpenPIC_PAddr + 0x10700);
98 mpic_assign_isu(mpic1, 11, OpenPIC_PAddr + 0x10780);
101 mpic_assign_isu(mpic1, 12, OpenPIC_PAddr + 0x10000);
102 mpic_assign_isu(mpic1, 13, OpenPIC_PAddr + 0x10080);
103 mpic_assign_isu(mpic1, 14, OpenPIC_PAddr + 0x10100);
108 * Setup the architecture
110 static void __init mpc85xx_ads_setup_arch(void)
112 struct device_node *cpu;
115 ppc_md.progress("mpc85xx_ads_setup_arch()", 0);
117 cpu = of_find_node_by_type(NULL, "cpu");
121 fp = (int *)get_property(cpu, "clock-frequency", NULL);
123 loops_per_jiffy = *fp / HZ;
125 loops_per_jiffy = 50000000 / HZ;
128 #ifdef CONFIG_ROOT_NFS
131 ROOT_DEV = Root_HDA1;
135 void mpc85xx_ads_show_cpuinfo(struct seq_file *m)
137 uint pvid, svid, phid1;
138 uint memsize = total_memory;
140 pvid = mfspr(SPRN_PVR);
141 svid = mfspr(SPRN_SVR);
143 seq_printf(m, "Vendor\t\t: Freescale Semiconductor\n");
144 seq_printf(m, "Machine\t\t: mpc85xx\n");
145 seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
146 seq_printf(m, "SVR\t\t: 0x%x\n", svid);
148 /* Display cpu Pll setting */
149 phid1 = mfspr(SPRN_HID1);
150 seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
152 /* Display the amount of memory */
153 seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
156 void __init platform_init(void)
158 ppc_md.setup_arch = mpc85xx_ads_setup_arch;
159 ppc_md.show_cpuinfo = mpc85xx_ads_show_cpuinfo;
161 ppc_md.init_IRQ = mpc85xx_ads_pic_init;
162 ppc_md.get_irq = mpic_get_irq;
164 ppc_md.restart = mpc85xx_restart;
165 ppc_md.power_off = NULL;
168 ppc_md.time_init = NULL;
169 ppc_md.set_rtc_time = NULL;
170 ppc_md.get_rtc_time = NULL;
171 ppc_md.calibrate_decr = generic_calibrate_decr;
173 ppc_md.progress = udbg_progress;
176 ppc_md.progress("mpc85xx_ads platform_init(): exit", 0);