1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Wind River SBC8548 setup and early boot code.
5 * Copyright 2007 Wind River Systems Inc.
7 * By Paul Gortmaker (see MAINTAINERS for contact information)
9 * Based largely on the MPC8548CDS support - Copyright 2005 Freescale Inc.
12 #include <linux/stddef.h>
13 #include <linux/kernel.h>
14 #include <linux/init.h>
15 #include <linux/errno.h>
16 #include <linux/reboot.h>
17 #include <linux/pci.h>
18 #include <linux/kdev_t.h>
19 #include <linux/major.h>
20 #include <linux/console.h>
21 #include <linux/delay.h>
22 #include <linux/seq_file.h>
23 #include <linux/initrd.h>
24 #include <linux/interrupt.h>
25 #include <linux/fsl_devices.h>
26 #include <linux/of_platform.h>
27 #include <linux/pgtable.h>
30 #include <linux/atomic.h>
33 #include <asm/machdep.h>
35 #include <asm/pci-bridge.h>
37 #include <mm/mmu_decl.h>
42 #include <sysdev/fsl_soc.h>
43 #include <sysdev/fsl_pci.h>
49 static void __init
sbc8548_pic_init(void)
51 struct mpic
*mpic
= mpic_alloc(NULL
, 0, MPIC_BIG_ENDIAN
,
57 /* Extract the HW Rev from the EPLD on the board */
58 static int __init
sbc8548_hw_rev(void)
60 struct device_node
*np
;
65 np
= of_find_compatible_node(NULL
, NULL
, "hw-rev");
67 printk("No HW-REV found in DTB.\n");
71 of_address_to_resource(np
, 0, &res
);
74 rev
= ioremap(res
.start
,sizeof(unsigned int));
75 board_rev
= (*rev
) >> 28;
82 * Setup the architecture
84 static void __init
sbc8548_setup_arch(void)
87 ppc_md
.progress("sbc8548_setup_arch()", 0);
89 fsl_pci_assign_primary();
91 sbc_rev
= sbc8548_hw_rev();
94 static void sbc8548_show_cpuinfo(struct seq_file
*m
)
96 uint pvid
, svid
, phid1
;
98 pvid
= mfspr(SPRN_PVR
);
99 svid
= mfspr(SPRN_SVR
);
101 seq_printf(m
, "Vendor\t\t: Wind River\n");
102 seq_printf(m
, "Machine\t\t: SBC8548 v%d\n", sbc_rev
);
103 seq_printf(m
, "PVR\t\t: 0x%x\n", pvid
);
104 seq_printf(m
, "SVR\t\t: 0x%x\n", svid
);
106 /* Display cpu Pll setting */
107 phid1
= mfspr(SPRN_HID1
);
108 seq_printf(m
, "PLL setting\t: 0x%x\n", ((phid1
>> 24) & 0x3f));
111 machine_arch_initcall(sbc8548
, mpc85xx_common_publish_devices
);
114 * Called very early, device-tree isn't unflattened
116 static int __init
sbc8548_probe(void)
118 return of_machine_is_compatible("SBC8548");
121 define_machine(sbc8548
) {
123 .probe
= sbc8548_probe
,
124 .setup_arch
= sbc8548_setup_arch
,
125 .init_IRQ
= sbc8548_pic_init
,
126 .show_cpuinfo
= sbc8548_show_cpuinfo
,
127 .get_irq
= mpic_get_irq
,
129 .pcibios_fixup_bus
= fsl_pcibios_fixup_bus
,
130 .pcibios_fixup_phb
= fsl_pcibios_fixup_phb
,
132 .calibrate_decr
= generic_calibrate_decr
,
133 .progress
= udbg_progress
,