1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0-or-later
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun * MPC85xx setup and early boot code plus other random bits.
4*4882a593Smuzhiyun *
5*4882a593Smuzhiyun * Maintained by Kumar Gala (see MAINTAINERS for contact information)
6*4882a593Smuzhiyun *
7*4882a593Smuzhiyun * Copyright 2005, 2011-2012 Freescale Semiconductor Inc.
8*4882a593Smuzhiyun */
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun #include <linux/stddef.h>
11*4882a593Smuzhiyun #include <linux/kernel.h>
12*4882a593Smuzhiyun #include <linux/init.h>
13*4882a593Smuzhiyun #include <linux/errno.h>
14*4882a593Smuzhiyun #include <linux/reboot.h>
15*4882a593Smuzhiyun #include <linux/pci.h>
16*4882a593Smuzhiyun #include <linux/kdev_t.h>
17*4882a593Smuzhiyun #include <linux/major.h>
18*4882a593Smuzhiyun #include <linux/console.h>
19*4882a593Smuzhiyun #include <linux/delay.h>
20*4882a593Smuzhiyun #include <linux/seq_file.h>
21*4882a593Smuzhiyun #include <linux/initrd.h>
22*4882a593Smuzhiyun #include <linux/interrupt.h>
23*4882a593Smuzhiyun #include <linux/fsl_devices.h>
24*4882a593Smuzhiyun #include <linux/of_platform.h>
25*4882a593Smuzhiyun #include <linux/pgtable.h>
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun #include <asm/page.h>
28*4882a593Smuzhiyun #include <linux/atomic.h>
29*4882a593Smuzhiyun #include <asm/time.h>
30*4882a593Smuzhiyun #include <asm/io.h>
31*4882a593Smuzhiyun #include <asm/machdep.h>
32*4882a593Smuzhiyun #include <asm/ipic.h>
33*4882a593Smuzhiyun #include <asm/pci-bridge.h>
34*4882a593Smuzhiyun #include <asm/irq.h>
35*4882a593Smuzhiyun #include <mm/mmu_decl.h>
36*4882a593Smuzhiyun #include <asm/prom.h>
37*4882a593Smuzhiyun #include <asm/udbg.h>
38*4882a593Smuzhiyun #include <asm/mpic.h>
39*4882a593Smuzhiyun #include <asm/i8259.h>
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun #include <sysdev/fsl_soc.h>
42*4882a593Smuzhiyun #include <sysdev/fsl_pci.h>
43*4882a593Smuzhiyun
44*4882a593Smuzhiyun #include "mpc85xx.h"
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun /*
47*4882a593Smuzhiyun * The CDS board contains an FPGA/CPLD called "Cadmus", which collects
48*4882a593Smuzhiyun * various logic and performs system control functions.
49*4882a593Smuzhiyun * Here is the FPGA/CPLD register map.
50*4882a593Smuzhiyun */
51*4882a593Smuzhiyun struct cadmus_reg {
52*4882a593Smuzhiyun u8 cm_ver; /* Board version */
53*4882a593Smuzhiyun u8 cm_csr; /* General control/status */
54*4882a593Smuzhiyun u8 cm_rst; /* Reset control */
55*4882a593Smuzhiyun u8 cm_hsclk; /* High speed clock */
56*4882a593Smuzhiyun u8 cm_hsxclk; /* High speed clock extended */
57*4882a593Smuzhiyun u8 cm_led; /* LED data */
58*4882a593Smuzhiyun u8 cm_pci; /* PCI control/status */
59*4882a593Smuzhiyun u8 cm_dma; /* DMA control */
60*4882a593Smuzhiyun u8 res[248]; /* Total 256 bytes */
61*4882a593Smuzhiyun };
62*4882a593Smuzhiyun
63*4882a593Smuzhiyun static struct cadmus_reg *cadmus;
64*4882a593Smuzhiyun
65*4882a593Smuzhiyun #ifdef CONFIG_PCI
66*4882a593Smuzhiyun
67*4882a593Smuzhiyun #define ARCADIA_HOST_BRIDGE_IDSEL 17
68*4882a593Smuzhiyun #define ARCADIA_2ND_BRIDGE_IDSEL 3
69*4882a593Smuzhiyun
mpc85xx_exclude_device(struct pci_controller * hose,u_char bus,u_char devfn)70*4882a593Smuzhiyun static int mpc85xx_exclude_device(struct pci_controller *hose,
71*4882a593Smuzhiyun u_char bus, u_char devfn)
72*4882a593Smuzhiyun {
73*4882a593Smuzhiyun /* We explicitly do not go past the Tundra 320 Bridge */
74*4882a593Smuzhiyun if ((bus == 1) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL))
75*4882a593Smuzhiyun return PCIBIOS_DEVICE_NOT_FOUND;
76*4882a593Smuzhiyun if ((bus == 0) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL))
77*4882a593Smuzhiyun return PCIBIOS_DEVICE_NOT_FOUND;
78*4882a593Smuzhiyun else
79*4882a593Smuzhiyun return PCIBIOS_SUCCESSFUL;
80*4882a593Smuzhiyun }
81*4882a593Smuzhiyun
mpc85xx_cds_restart(struct notifier_block * this,unsigned long mode,void * cmd)82*4882a593Smuzhiyun static int mpc85xx_cds_restart(struct notifier_block *this,
83*4882a593Smuzhiyun unsigned long mode, void *cmd)
84*4882a593Smuzhiyun {
85*4882a593Smuzhiyun struct pci_dev *dev;
86*4882a593Smuzhiyun u_char tmp;
87*4882a593Smuzhiyun
88*4882a593Smuzhiyun if ((dev = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686,
89*4882a593Smuzhiyun NULL))) {
90*4882a593Smuzhiyun
91*4882a593Smuzhiyun /* Use the VIA Super Southbridge to force a PCI reset */
92*4882a593Smuzhiyun pci_read_config_byte(dev, 0x47, &tmp);
93*4882a593Smuzhiyun pci_write_config_byte(dev, 0x47, tmp | 1);
94*4882a593Smuzhiyun
95*4882a593Smuzhiyun /* Flush the outbound PCI write queues */
96*4882a593Smuzhiyun pci_read_config_byte(dev, 0x47, &tmp);
97*4882a593Smuzhiyun
98*4882a593Smuzhiyun /*
99*4882a593Smuzhiyun * At this point, the hardware reset should have triggered.
100*4882a593Smuzhiyun * However, if it doesn't work for some mysterious reason,
101*4882a593Smuzhiyun * just fall through to the default reset below.
102*4882a593Smuzhiyun */
103*4882a593Smuzhiyun
104*4882a593Smuzhiyun pci_dev_put(dev);
105*4882a593Smuzhiyun }
106*4882a593Smuzhiyun
107*4882a593Smuzhiyun /*
108*4882a593Smuzhiyun * If we can't find the VIA chip (maybe the P2P bridge is
109*4882a593Smuzhiyun * disabled) or the VIA chip reset didn't work, just return
110*4882a593Smuzhiyun * and let default reset sequence happen.
111*4882a593Smuzhiyun */
112*4882a593Smuzhiyun return NOTIFY_DONE;
113*4882a593Smuzhiyun }
114*4882a593Smuzhiyun
mpc85xx_cds_restart_register(void)115*4882a593Smuzhiyun static int mpc85xx_cds_restart_register(void)
116*4882a593Smuzhiyun {
117*4882a593Smuzhiyun static struct notifier_block restart_handler;
118*4882a593Smuzhiyun
119*4882a593Smuzhiyun restart_handler.notifier_call = mpc85xx_cds_restart;
120*4882a593Smuzhiyun restart_handler.priority = 192;
121*4882a593Smuzhiyun
122*4882a593Smuzhiyun return register_restart_handler(&restart_handler);
123*4882a593Smuzhiyun }
124*4882a593Smuzhiyun machine_arch_initcall(mpc85xx_cds, mpc85xx_cds_restart_register);
125*4882a593Smuzhiyun
126*4882a593Smuzhiyun
mpc85xx_cds_pci_irq_fixup(struct pci_dev * dev)127*4882a593Smuzhiyun static void __init mpc85xx_cds_pci_irq_fixup(struct pci_dev *dev)
128*4882a593Smuzhiyun {
129*4882a593Smuzhiyun u_char c;
130*4882a593Smuzhiyun if (dev->vendor == PCI_VENDOR_ID_VIA) {
131*4882a593Smuzhiyun switch (dev->device) {
132*4882a593Smuzhiyun case PCI_DEVICE_ID_VIA_82C586_1:
133*4882a593Smuzhiyun /*
134*4882a593Smuzhiyun * U-Boot does not set the enable bits
135*4882a593Smuzhiyun * for the IDE device. Force them on here.
136*4882a593Smuzhiyun */
137*4882a593Smuzhiyun pci_read_config_byte(dev, 0x40, &c);
138*4882a593Smuzhiyun c |= 0x03; /* IDE: Chip Enable Bits */
139*4882a593Smuzhiyun pci_write_config_byte(dev, 0x40, c);
140*4882a593Smuzhiyun
141*4882a593Smuzhiyun /*
142*4882a593Smuzhiyun * Since only primary interface works, force the
143*4882a593Smuzhiyun * IDE function to standard primary IDE interrupt
144*4882a593Smuzhiyun * w/ 8259 offset
145*4882a593Smuzhiyun */
146*4882a593Smuzhiyun dev->irq = 14;
147*4882a593Smuzhiyun pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
148*4882a593Smuzhiyun break;
149*4882a593Smuzhiyun /*
150*4882a593Smuzhiyun * Force legacy USB interrupt routing
151*4882a593Smuzhiyun */
152*4882a593Smuzhiyun case PCI_DEVICE_ID_VIA_82C586_2:
153*4882a593Smuzhiyun /* There are two USB controllers.
154*4882a593Smuzhiyun * Identify them by functon number
155*4882a593Smuzhiyun */
156*4882a593Smuzhiyun if (PCI_FUNC(dev->devfn) == 3)
157*4882a593Smuzhiyun dev->irq = 11;
158*4882a593Smuzhiyun else
159*4882a593Smuzhiyun dev->irq = 10;
160*4882a593Smuzhiyun pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
161*4882a593Smuzhiyun default:
162*4882a593Smuzhiyun break;
163*4882a593Smuzhiyun }
164*4882a593Smuzhiyun }
165*4882a593Smuzhiyun }
166*4882a593Smuzhiyun
skip_fake_bridge(struct pci_dev * dev)167*4882a593Smuzhiyun static void skip_fake_bridge(struct pci_dev *dev)
168*4882a593Smuzhiyun {
169*4882a593Smuzhiyun /* Make it an error to skip the fake bridge
170*4882a593Smuzhiyun * in pci_setup_device() in probe.c */
171*4882a593Smuzhiyun dev->hdr_type = 0x7f;
172*4882a593Smuzhiyun }
173*4882a593Smuzhiyun DECLARE_PCI_FIXUP_EARLY(0x1957, 0x3fff, skip_fake_bridge);
174*4882a593Smuzhiyun DECLARE_PCI_FIXUP_EARLY(0x3fff, 0x1957, skip_fake_bridge);
175*4882a593Smuzhiyun DECLARE_PCI_FIXUP_EARLY(0xff3f, 0x5719, skip_fake_bridge);
176*4882a593Smuzhiyun
177*4882a593Smuzhiyun #define PCI_DEVICE_ID_IDT_TSI310 0x01a7
178*4882a593Smuzhiyun
179*4882a593Smuzhiyun /*
180*4882a593Smuzhiyun * Fix Tsi310 PCI-X bridge resource.
181*4882a593Smuzhiyun * Force the bridge to open a window from 0x0000-0x1fff in PCI I/O space.
182*4882a593Smuzhiyun * This allows legacy I/O(i8259, etc) on the VIA southbridge to be accessed.
183*4882a593Smuzhiyun */
mpc85xx_cds_fixup_bus(struct pci_bus * bus)184*4882a593Smuzhiyun void mpc85xx_cds_fixup_bus(struct pci_bus *bus)
185*4882a593Smuzhiyun {
186*4882a593Smuzhiyun struct pci_dev *dev = bus->self;
187*4882a593Smuzhiyun struct resource *res = bus->resource[0];
188*4882a593Smuzhiyun
189*4882a593Smuzhiyun if (dev != NULL &&
190*4882a593Smuzhiyun dev->vendor == PCI_VENDOR_ID_IBM &&
191*4882a593Smuzhiyun dev->device == PCI_DEVICE_ID_IDT_TSI310) {
192*4882a593Smuzhiyun if (res) {
193*4882a593Smuzhiyun res->start = 0;
194*4882a593Smuzhiyun res->end = 0x1fff;
195*4882a593Smuzhiyun res->flags = IORESOURCE_IO;
196*4882a593Smuzhiyun pr_info("mpc85xx_cds: PCI bridge resource fixup applied\n");
197*4882a593Smuzhiyun pr_info("mpc85xx_cds: %pR\n", res);
198*4882a593Smuzhiyun }
199*4882a593Smuzhiyun }
200*4882a593Smuzhiyun
201*4882a593Smuzhiyun fsl_pcibios_fixup_bus(bus);
202*4882a593Smuzhiyun }
203*4882a593Smuzhiyun
204*4882a593Smuzhiyun #ifdef CONFIG_PPC_I8259
mpc85xx_8259_cascade_handler(struct irq_desc * desc)205*4882a593Smuzhiyun static void mpc85xx_8259_cascade_handler(struct irq_desc *desc)
206*4882a593Smuzhiyun {
207*4882a593Smuzhiyun unsigned int cascade_irq = i8259_irq();
208*4882a593Smuzhiyun
209*4882a593Smuzhiyun if (cascade_irq)
210*4882a593Smuzhiyun /* handle an interrupt from the 8259 */
211*4882a593Smuzhiyun generic_handle_irq(cascade_irq);
212*4882a593Smuzhiyun
213*4882a593Smuzhiyun /* check for any interrupts from the shared IRQ line */
214*4882a593Smuzhiyun handle_fasteoi_irq(desc);
215*4882a593Smuzhiyun }
216*4882a593Smuzhiyun
mpc85xx_8259_cascade_action(int irq,void * dev_id)217*4882a593Smuzhiyun static irqreturn_t mpc85xx_8259_cascade_action(int irq, void *dev_id)
218*4882a593Smuzhiyun {
219*4882a593Smuzhiyun return IRQ_HANDLED;
220*4882a593Smuzhiyun }
221*4882a593Smuzhiyun #endif /* PPC_I8259 */
222*4882a593Smuzhiyun #endif /* CONFIG_PCI */
223*4882a593Smuzhiyun
mpc85xx_cds_pic_init(void)224*4882a593Smuzhiyun static void __init mpc85xx_cds_pic_init(void)
225*4882a593Smuzhiyun {
226*4882a593Smuzhiyun struct mpic *mpic;
227*4882a593Smuzhiyun mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN,
228*4882a593Smuzhiyun 0, 256, " OpenPIC ");
229*4882a593Smuzhiyun BUG_ON(mpic == NULL);
230*4882a593Smuzhiyun mpic_init(mpic);
231*4882a593Smuzhiyun }
232*4882a593Smuzhiyun
233*4882a593Smuzhiyun #if defined(CONFIG_PPC_I8259) && defined(CONFIG_PCI)
mpc85xx_cds_8259_attach(void)234*4882a593Smuzhiyun static int mpc85xx_cds_8259_attach(void)
235*4882a593Smuzhiyun {
236*4882a593Smuzhiyun int ret;
237*4882a593Smuzhiyun struct device_node *np = NULL;
238*4882a593Smuzhiyun struct device_node *cascade_node = NULL;
239*4882a593Smuzhiyun int cascade_irq;
240*4882a593Smuzhiyun
241*4882a593Smuzhiyun /* Initialize the i8259 controller */
242*4882a593Smuzhiyun for_each_node_by_type(np, "interrupt-controller")
243*4882a593Smuzhiyun if (of_device_is_compatible(np, "chrp,iic")) {
244*4882a593Smuzhiyun cascade_node = np;
245*4882a593Smuzhiyun break;
246*4882a593Smuzhiyun }
247*4882a593Smuzhiyun
248*4882a593Smuzhiyun if (cascade_node == NULL) {
249*4882a593Smuzhiyun printk(KERN_DEBUG "Could not find i8259 PIC\n");
250*4882a593Smuzhiyun return -ENODEV;
251*4882a593Smuzhiyun }
252*4882a593Smuzhiyun
253*4882a593Smuzhiyun cascade_irq = irq_of_parse_and_map(cascade_node, 0);
254*4882a593Smuzhiyun if (!cascade_irq) {
255*4882a593Smuzhiyun printk(KERN_ERR "Failed to map cascade interrupt\n");
256*4882a593Smuzhiyun return -ENXIO;
257*4882a593Smuzhiyun }
258*4882a593Smuzhiyun
259*4882a593Smuzhiyun i8259_init(cascade_node, 0);
260*4882a593Smuzhiyun of_node_put(cascade_node);
261*4882a593Smuzhiyun
262*4882a593Smuzhiyun /*
263*4882a593Smuzhiyun * Hook the interrupt to make sure desc->action is never NULL.
264*4882a593Smuzhiyun * This is required to ensure that the interrupt does not get
265*4882a593Smuzhiyun * disabled when the last user of the shared IRQ line frees their
266*4882a593Smuzhiyun * interrupt.
267*4882a593Smuzhiyun */
268*4882a593Smuzhiyun ret = request_irq(cascade_irq, mpc85xx_8259_cascade_action,
269*4882a593Smuzhiyun IRQF_SHARED | IRQF_NO_THREAD, "8259 cascade",
270*4882a593Smuzhiyun cascade_node);
271*4882a593Smuzhiyun if (ret) {
272*4882a593Smuzhiyun printk(KERN_ERR "Failed to setup cascade interrupt\n");
273*4882a593Smuzhiyun return ret;
274*4882a593Smuzhiyun }
275*4882a593Smuzhiyun
276*4882a593Smuzhiyun /* Success. Connect our low-level cascade handler. */
277*4882a593Smuzhiyun irq_set_handler(cascade_irq, mpc85xx_8259_cascade_handler);
278*4882a593Smuzhiyun
279*4882a593Smuzhiyun return 0;
280*4882a593Smuzhiyun }
281*4882a593Smuzhiyun machine_device_initcall(mpc85xx_cds, mpc85xx_cds_8259_attach);
282*4882a593Smuzhiyun
283*4882a593Smuzhiyun #endif /* CONFIG_PPC_I8259 */
284*4882a593Smuzhiyun
mpc85xx_cds_pci_assign_primary(void)285*4882a593Smuzhiyun static void mpc85xx_cds_pci_assign_primary(void)
286*4882a593Smuzhiyun {
287*4882a593Smuzhiyun #ifdef CONFIG_PCI
288*4882a593Smuzhiyun struct device_node *np;
289*4882a593Smuzhiyun
290*4882a593Smuzhiyun if (fsl_pci_primary)
291*4882a593Smuzhiyun return;
292*4882a593Smuzhiyun
293*4882a593Smuzhiyun /*
294*4882a593Smuzhiyun * MPC85xx_CDS has ISA bridge but unfortunately there is no
295*4882a593Smuzhiyun * isa node in device tree. We now looking for i8259 node as
296*4882a593Smuzhiyun * a workaround for such a broken device tree. This routine
297*4882a593Smuzhiyun * is for complying to all device trees.
298*4882a593Smuzhiyun */
299*4882a593Smuzhiyun np = of_find_node_by_name(NULL, "i8259");
300*4882a593Smuzhiyun while ((fsl_pci_primary = of_get_parent(np))) {
301*4882a593Smuzhiyun of_node_put(np);
302*4882a593Smuzhiyun np = fsl_pci_primary;
303*4882a593Smuzhiyun
304*4882a593Smuzhiyun if ((of_device_is_compatible(np, "fsl,mpc8540-pci") ||
305*4882a593Smuzhiyun of_device_is_compatible(np, "fsl,mpc8548-pcie")) &&
306*4882a593Smuzhiyun of_device_is_available(np))
307*4882a593Smuzhiyun return;
308*4882a593Smuzhiyun }
309*4882a593Smuzhiyun #endif
310*4882a593Smuzhiyun }
311*4882a593Smuzhiyun
312*4882a593Smuzhiyun /*
313*4882a593Smuzhiyun * Setup the architecture
314*4882a593Smuzhiyun */
mpc85xx_cds_setup_arch(void)315*4882a593Smuzhiyun static void __init mpc85xx_cds_setup_arch(void)
316*4882a593Smuzhiyun {
317*4882a593Smuzhiyun struct device_node *np;
318*4882a593Smuzhiyun int cds_pci_slot;
319*4882a593Smuzhiyun
320*4882a593Smuzhiyun if (ppc_md.progress)
321*4882a593Smuzhiyun ppc_md.progress("mpc85xx_cds_setup_arch()", 0);
322*4882a593Smuzhiyun
323*4882a593Smuzhiyun np = of_find_compatible_node(NULL, NULL, "fsl,mpc8548cds-fpga");
324*4882a593Smuzhiyun if (!np) {
325*4882a593Smuzhiyun pr_err("Could not find FPGA node.\n");
326*4882a593Smuzhiyun return;
327*4882a593Smuzhiyun }
328*4882a593Smuzhiyun
329*4882a593Smuzhiyun cadmus = of_iomap(np, 0);
330*4882a593Smuzhiyun of_node_put(np);
331*4882a593Smuzhiyun if (!cadmus) {
332*4882a593Smuzhiyun pr_err("Fail to map FPGA area.\n");
333*4882a593Smuzhiyun return;
334*4882a593Smuzhiyun }
335*4882a593Smuzhiyun
336*4882a593Smuzhiyun if (ppc_md.progress) {
337*4882a593Smuzhiyun char buf[40];
338*4882a593Smuzhiyun cds_pci_slot = ((in_8(&cadmus->cm_csr) >> 6) & 0x3) + 1;
339*4882a593Smuzhiyun snprintf(buf, 40, "CDS Version = 0x%x in slot %d\n",
340*4882a593Smuzhiyun in_8(&cadmus->cm_ver), cds_pci_slot);
341*4882a593Smuzhiyun ppc_md.progress(buf, 0);
342*4882a593Smuzhiyun }
343*4882a593Smuzhiyun
344*4882a593Smuzhiyun #ifdef CONFIG_PCI
345*4882a593Smuzhiyun ppc_md.pci_irq_fixup = mpc85xx_cds_pci_irq_fixup;
346*4882a593Smuzhiyun ppc_md.pci_exclude_device = mpc85xx_exclude_device;
347*4882a593Smuzhiyun #endif
348*4882a593Smuzhiyun
349*4882a593Smuzhiyun mpc85xx_cds_pci_assign_primary();
350*4882a593Smuzhiyun fsl_pci_assign_primary();
351*4882a593Smuzhiyun }
352*4882a593Smuzhiyun
mpc85xx_cds_show_cpuinfo(struct seq_file * m)353*4882a593Smuzhiyun static void mpc85xx_cds_show_cpuinfo(struct seq_file *m)
354*4882a593Smuzhiyun {
355*4882a593Smuzhiyun uint pvid, svid, phid1;
356*4882a593Smuzhiyun
357*4882a593Smuzhiyun pvid = mfspr(SPRN_PVR);
358*4882a593Smuzhiyun svid = mfspr(SPRN_SVR);
359*4882a593Smuzhiyun
360*4882a593Smuzhiyun seq_printf(m, "Vendor\t\t: Freescale Semiconductor\n");
361*4882a593Smuzhiyun seq_printf(m, "Machine\t\t: MPC85xx CDS (0x%x)\n",
362*4882a593Smuzhiyun in_8(&cadmus->cm_ver));
363*4882a593Smuzhiyun seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
364*4882a593Smuzhiyun seq_printf(m, "SVR\t\t: 0x%x\n", svid);
365*4882a593Smuzhiyun
366*4882a593Smuzhiyun /* Display cpu Pll setting */
367*4882a593Smuzhiyun phid1 = mfspr(SPRN_HID1);
368*4882a593Smuzhiyun seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
369*4882a593Smuzhiyun }
370*4882a593Smuzhiyun
371*4882a593Smuzhiyun
372*4882a593Smuzhiyun /*
373*4882a593Smuzhiyun * Called very early, device-tree isn't unflattened
374*4882a593Smuzhiyun */
mpc85xx_cds_probe(void)375*4882a593Smuzhiyun static int __init mpc85xx_cds_probe(void)
376*4882a593Smuzhiyun {
377*4882a593Smuzhiyun return of_machine_is_compatible("MPC85xxCDS");
378*4882a593Smuzhiyun }
379*4882a593Smuzhiyun
380*4882a593Smuzhiyun machine_arch_initcall(mpc85xx_cds, mpc85xx_common_publish_devices);
381*4882a593Smuzhiyun
define_machine(mpc85xx_cds)382*4882a593Smuzhiyun define_machine(mpc85xx_cds) {
383*4882a593Smuzhiyun .name = "MPC85xx CDS",
384*4882a593Smuzhiyun .probe = mpc85xx_cds_probe,
385*4882a593Smuzhiyun .setup_arch = mpc85xx_cds_setup_arch,
386*4882a593Smuzhiyun .init_IRQ = mpc85xx_cds_pic_init,
387*4882a593Smuzhiyun .show_cpuinfo = mpc85xx_cds_show_cpuinfo,
388*4882a593Smuzhiyun .get_irq = mpic_get_irq,
389*4882a593Smuzhiyun #ifdef CONFIG_PCI
390*4882a593Smuzhiyun .pcibios_fixup_bus = mpc85xx_cds_fixup_bus,
391*4882a593Smuzhiyun .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
392*4882a593Smuzhiyun #endif
393*4882a593Smuzhiyun .calibrate_decr = generic_calibrate_decr,
394*4882a593Smuzhiyun .progress = udbg_progress,
395*4882a593Smuzhiyun };
396