Path: blob/master/arch/powerpc/platforms/82xx/pq2.c
10820 views
/*1* Common PowerQUICC II code.2*3* Author: Scott Wood <[email protected]>4* Copyright (c) 2007 Freescale Semiconductor5*6* Based on code by Vitaly Bordug <[email protected]>7* pq2_restart fix by Wade Farnsworth <[email protected]>8* Copyright (c) 2006 MontaVista Software, Inc.9*10* This program is free software; you can redistribute it and/or modify it11* under the terms of the GNU General Public License as published by the12* Free Software Foundation; either version 2 of the License, or (at your13* option) any later version.14*/1516#include <asm/cpm2.h>17#include <asm/io.h>18#include <asm/pci-bridge.h>19#include <asm/system.h>2021#include <platforms/82xx/pq2.h>2223#define RMR_CSRE 0x000000012425void pq2_restart(char *cmd)26{27local_irq_disable();28setbits32(&cpm2_immr->im_clkrst.car_rmr, RMR_CSRE);2930/* Clear the ME,EE,IR & DR bits in MSR to cause checkstop */31mtmsr(mfmsr() & ~(MSR_ME | MSR_EE | MSR_IR | MSR_DR));32in_8(&cpm2_immr->im_clkrst.res[0]);3334panic("Restart failed\n");35}3637#ifdef CONFIG_PCI38static int pq2_pci_exclude_device(struct pci_controller *hose,39u_char bus, u8 devfn)40{41if (bus == 0 && PCI_SLOT(devfn) == 0)42return PCIBIOS_DEVICE_NOT_FOUND;43else44return PCIBIOS_SUCCESSFUL;45}4647static void __init pq2_pci_add_bridge(struct device_node *np)48{49struct pci_controller *hose;50struct resource r;5152if (of_address_to_resource(np, 0, &r) || r.end - r.start < 0x10b)53goto err;5455ppc_pci_add_flags(PPC_PCI_REASSIGN_ALL_BUS);5657hose = pcibios_alloc_controller(np);58if (!hose)59return;6061hose->dn = np;6263setup_indirect_pci(hose, r.start + 0x100, r.start + 0x104, 0);64pci_process_bridge_OF_ranges(hose, np, 1);6566return;6768err:69printk(KERN_ERR "No valid PCI reg property in device tree\n");70}7172void __init pq2_init_pci(void)73{74struct device_node *np = NULL;7576ppc_md.pci_exclude_device = pq2_pci_exclude_device;7778while ((np = of_find_compatible_node(np, NULL, "fsl,pq2-pci")))79pq2_pci_add_bridge(np);80}81#endif828384