1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright 2006 Freescale Semiconductor, Inc. All rights reserved.
6 * MPC832xE MDS board specific routines.
9 #include <linux/stddef.h>
10 #include <linux/kernel.h>
11 #include <linux/init.h>
12 #include <linux/errno.h>
13 #include <linux/reboot.h>
14 #include <linux/pci.h>
15 #include <linux/kdev_t.h>
16 #include <linux/major.h>
17 #include <linux/console.h>
18 #include <linux/delay.h>
19 #include <linux/seq_file.h>
20 #include <linux/root_dev.h>
21 #include <linux/initrd.h>
22 #include <linux/of_platform.h>
23 #include <linux/of_device.h>
25 #include <linux/atomic.h>
28 #include <asm/machdep.h>
33 #include <sysdev/fsl_soc.h>
34 #include <sysdev/fsl_pci.h>
35 #include <soc/fsl/qe/qe.h>
41 #define DBG(fmt...) udbg_printf(fmt)
46 /* ************************************************************************
48 * Setup the architecture
51 static void __init mpc832x_sys_setup_arch(void)
53 struct device_node *np;
54 u8 __iomem *bcsr_regs = NULL;
59 np = of_find_node_by_name(NULL, "bcsr");
63 of_address_to_resource(np, 0, &res);
64 bcsr_regs = ioremap(res.start, resource_size(&res));
68 #ifdef CONFIG_QUICC_ENGINE
69 if ((np = of_find_node_by_name(NULL, "par_io")) != NULL) {
73 for_each_node_by_name(np, "ucc")
77 if ((np = of_find_compatible_node(NULL, "network", "ucc_geth"))
79 /* Reset the Ethernet PHYs */
80 #define BCSR8_FETH_RST 0x50
81 clrbits8(&bcsr_regs[8], BCSR8_FETH_RST);
83 setbits8(&bcsr_regs[8], BCSR8_FETH_RST);
87 #endif /* CONFIG_QUICC_ENGINE */
90 machine_device_initcall(mpc832x_mds, mpc83xx_declare_of_platform_devices);
93 * Called very early, MMU is off, device-tree isn't unflattened
95 static int __init mpc832x_sys_probe(void)
97 return of_machine_is_compatible("MPC832xMDS");
100 define_machine(mpc832x_mds) {
101 .name = "MPC832x MDS",
102 .probe = mpc832x_sys_probe,
103 .setup_arch = mpc832x_sys_setup_arch,
104 .discover_phbs = mpc83xx_setup_pci,
105 .init_IRQ = mpc83xx_ipic_init_IRQ,
106 .get_irq = ipic_get_irq,
107 .restart = mpc83xx_restart,
108 .time_init = mpc83xx_time_init,
109 .calibrate_decr = generic_calibrate_decr,
110 .progress = udbg_progress,