Path: blob/master/arch/powerpc/platforms/85xx/tqm85xx.c
26481 views
// SPDX-License-Identifier: GPL-2.0-or-later1/*2* Based on MPC8560 ADS and arch/ppc tqm85xx ports3*4* Maintained by Kumar Gala (see MAINTAINERS for contact information)5*6* Copyright 2008 Freescale Semiconductor Inc.7*8* Copyright (c) 2005-2006 DENX Software Engineering9* Stefan Roese <[email protected]>10*11* Based on original work by12* Kumar Gala <[email protected]>13* Copyright 2004 Freescale Semiconductor Inc.14*/1516#include <linux/stddef.h>17#include <linux/kernel.h>18#include <linux/pci.h>19#include <linux/kdev_t.h>20#include <linux/delay.h>21#include <linux/seq_file.h>22#include <linux/of.h>2324#include <asm/time.h>25#include <asm/machdep.h>26#include <asm/pci-bridge.h>27#include <asm/mpic.h>28#include <mm/mmu_decl.h>29#include <asm/udbg.h>3031#include <sysdev/fsl_soc.h>32#include <sysdev/fsl_pci.h>3334#include "mpc85xx.h"3536#ifdef CONFIG_CPM237#include <asm/cpm2.h>38#endif /* CONFIG_CPM2 */3940static void __init tqm85xx_pic_init(void)41{42struct mpic *mpic = mpic_alloc(NULL, 0,43MPIC_BIG_ENDIAN,440, 256, " OpenPIC ");45BUG_ON(mpic == NULL);46mpic_init(mpic);4748mpc85xx_cpm2_pic_init();49}5051/*52* Setup the architecture53*/54static void __init tqm85xx_setup_arch(void)55{56if (ppc_md.progress)57ppc_md.progress("tqm85xx_setup_arch()", 0);5859#ifdef CONFIG_CPM260cpm2_reset();61#endif6263fsl_pci_assign_primary();64}6566static void tqm85xx_show_cpuinfo(struct seq_file *m)67{68uint pvid, svid, phid1;6970pvid = mfspr(SPRN_PVR);71svid = mfspr(SPRN_SVR);7273seq_printf(m, "Vendor\t\t: TQ Components\n");74seq_printf(m, "PVR\t\t: 0x%x\n", pvid);75seq_printf(m, "SVR\t\t: 0x%x\n", svid);7677/* Display cpu Pll setting */78phid1 = mfspr(SPRN_HID1);79seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));80}8182static void tqm85xx_ti1520_fixup(struct pci_dev *pdev)83{84unsigned int val;8586/* Do not do the fixup on other platforms! */87if (!machine_is(tqm85xx))88return;8990dev_info(&pdev->dev, "Using TI 1520 fixup on TQM85xx\n");9192/*93* Enable P2CCLK bit in system control register94* to enable CLOCK output to power chip95*/96pci_read_config_dword(pdev, 0x80, &val);97pci_write_config_dword(pdev, 0x80, val | (1 << 27));9899}100DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1520,101tqm85xx_ti1520_fixup);102103machine_arch_initcall(tqm85xx, mpc85xx_common_publish_devices);104105static const char * const board[] __initconst = {106"tqc,tqm8540",107"tqc,tqm8541",108"tqc,tqm8548",109"tqc,tqm8555",110"tqc,tqm8560",111NULL112};113114define_machine(tqm85xx) {115.name = "TQM85xx",116.compatibles = board,117.setup_arch = tqm85xx_setup_arch,118.init_IRQ = tqm85xx_pic_init,119.show_cpuinfo = tqm85xx_show_cpuinfo,120.get_irq = mpic_get_irq,121.progress = udbg_progress,122};123124125