1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Based on MPC8560 ADS and arch/ppc tqm85xx ports
5 * Maintained by Kumar Gala (see MAINTAINERS for contact information)
7 * Copyright 2008 Freescale Semiconductor Inc.
9 * Copyright (c) 2005-2006 DENX Software Engineering
10 * Stefan Roese <sr@denx.de>
12 * Based on original work by
13 * Kumar Gala <kumar.gala@freescale.com>
14 * Copyright 2004 Freescale Semiconductor Inc.
17 #include <linux/stddef.h>
18 #include <linux/kernel.h>
19 #include <linux/pci.h>
20 #include <linux/kdev_t.h>
21 #include <linux/delay.h>
22 #include <linux/seq_file.h>
23 #include <linux/of_platform.h>
26 #include <asm/machdep.h>
27 #include <asm/pci-bridge.h>
30 #include <mm/mmu_decl.h>
33 #include <sysdev/fsl_soc.h>
34 #include <sysdev/fsl_pci.h>
40 #endif /* CONFIG_CPM2 */
42 static void __init
tqm85xx_pic_init(void)
44 struct mpic
*mpic
= mpic_alloc(NULL
, 0,
50 mpc85xx_cpm2_pic_init();
54 * Setup the architecture
56 static void __init
tqm85xx_setup_arch(void)
59 ppc_md
.progress("tqm85xx_setup_arch()", 0);
65 fsl_pci_assign_primary();
68 static void tqm85xx_show_cpuinfo(struct seq_file
*m
)
70 uint pvid
, svid
, phid1
;
72 pvid
= mfspr(SPRN_PVR
);
73 svid
= mfspr(SPRN_SVR
);
75 seq_printf(m
, "Vendor\t\t: TQ Components\n");
76 seq_printf(m
, "PVR\t\t: 0x%x\n", pvid
);
77 seq_printf(m
, "SVR\t\t: 0x%x\n", svid
);
79 /* Display cpu Pll setting */
80 phid1
= mfspr(SPRN_HID1
);
81 seq_printf(m
, "PLL setting\t: 0x%x\n", ((phid1
>> 24) & 0x3f));
84 static void tqm85xx_ti1520_fixup(struct pci_dev
*pdev
)
88 /* Do not do the fixup on other platforms! */
89 if (!machine_is(tqm85xx
))
92 dev_info(&pdev
->dev
, "Using TI 1520 fixup on TQM85xx\n");
95 * Enable P2CCLK bit in system control register
96 * to enable CLOCK output to power chip
98 pci_read_config_dword(pdev
, 0x80, &val
);
99 pci_write_config_dword(pdev
, 0x80, val
| (1 << 27));
102 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI
, PCI_DEVICE_ID_TI_1520
,
103 tqm85xx_ti1520_fixup
);
105 machine_arch_initcall(tqm85xx
, mpc85xx_common_publish_devices
);
107 static const char * const board
[] __initconst
= {
117 * Called very early, device-tree isn't unflattened
119 static int __init
tqm85xx_probe(void)
121 return of_device_compatible_match(of_root
, board
);
124 define_machine(tqm85xx
) {
126 .probe
= tqm85xx_probe
,
127 .setup_arch
= tqm85xx_setup_arch
,
128 .init_IRQ
= tqm85xx_pic_init
,
129 .show_cpuinfo
= tqm85xx_show_cpuinfo
,
130 .get_irq
= mpic_get_irq
,
131 .calibrate_decr
= generic_calibrate_decr
,
132 .progress
= udbg_progress
,