cregit-Linux how code gets into the kernel

Release 4.14 arch/mips/pci/pci-tx4938.c

Directory: arch/mips/pci
/*
 * Based on linux/arch/mips/txx9/rbtx4938/setup.c,
 *          and RBTX49xx patch from CELF patch archive.
 *
 * Copyright 2001, 2003-2005 MontaVista Software Inc.
 * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org)
 * (C) Copyright TOSHIBA CORPORATION 2000-2001, 2004-2007
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 */
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <asm/txx9/generic.h>
#include <asm/txx9/tx4938.h>


int __init tx4938_report_pciclk(void) { int pciclk = 0; pr_info("PCIC --%s PCICLK:", (__raw_readq(&tx4938_ccfgptr->ccfg) & TX4938_CCFG_PCI66) ? " PCI66" : ""); if (__raw_readq(&tx4938_ccfgptr->pcfg) & TX4938_PCFG_PCICLKEN_ALL) { u64 ccfg = __raw_readq(&tx4938_ccfgptr->ccfg); switch ((unsigned long)ccfg & TX4938_CCFG_PCIDIVMODE_MASK) { case TX4938_CCFG_PCIDIVMODE_4: pciclk = txx9_cpu_clock / 4; break; case TX4938_CCFG_PCIDIVMODE_4_5: pciclk = txx9_cpu_clock * 2 / 9; break; case TX4938_CCFG_PCIDIVMODE_5: pciclk = txx9_cpu_clock / 5; break; case TX4938_CCFG_PCIDIVMODE_5_5: pciclk = txx9_cpu_clock * 2 / 11; break; case TX4938_CCFG_PCIDIVMODE_8: pciclk = txx9_cpu_clock / 8; break; case TX4938_CCFG_PCIDIVMODE_9: pciclk = txx9_cpu_clock / 9; break; case TX4938_CCFG_PCIDIVMODE_10: pciclk = txx9_cpu_clock / 10; break; case TX4938_CCFG_PCIDIVMODE_11: pciclk = txx9_cpu_clock / 11; break; } pr_cont("Internal(%u.%uMHz)", (pciclk + 50000) / 1000000, ((pciclk + 50000) / 100000) % 10); } else { pr_cont("External"); pciclk = -1; } pr_cont("\n"); return pciclk; }

Contributors

PersonTokensPropCommitsCommitProp
Atsushi Nemoto19798.01%150.00%
Geert Uytterhoeven41.99%150.00%
Total201100.00%2100.00%


void __init tx4938_report_pci1clk(void) { __u64 ccfg = __raw_readq(&tx4938_ccfgptr->ccfg); unsigned int pciclk = txx9_gbus_clock / ((ccfg & TX4938_CCFG_PCI1DMD) ? 4 : 2); pr_info("PCIC1 -- %sPCICLK:%u.%uMHz\n", (ccfg & TX4938_CCFG_PCI1_66) ? "PCI66 " : "", (pciclk + 50000) / 1000000, ((pciclk + 50000) / 100000) % 10); }

Contributors

PersonTokensPropCommitsCommitProp
Atsushi Nemoto7198.61%150.00%
Geert Uytterhoeven11.39%150.00%
Total72100.00%2100.00%


int __init tx4938_pciclk66_setup(void) { int pciclk; /* Assert M66EN */ tx4938_ccfg_set(TX4938_CCFG_PCI66); /* Double PCICLK (if possible) */ if (__raw_readq(&tx4938_ccfgptr->pcfg) & TX4938_PCFG_PCICLKEN_ALL) { unsigned int pcidivmode = 0; u64 ccfg = __raw_readq(&tx4938_ccfgptr->ccfg); pcidivmode = (unsigned long)ccfg & TX4938_CCFG_PCIDIVMODE_MASK; switch (pcidivmode) { case TX4938_CCFG_PCIDIVMODE_8: case TX4938_CCFG_PCIDIVMODE_4: pcidivmode = TX4938_CCFG_PCIDIVMODE_4; pciclk = txx9_cpu_clock / 4; break; case TX4938_CCFG_PCIDIVMODE_9: case TX4938_CCFG_PCIDIVMODE_4_5: pcidivmode = TX4938_CCFG_PCIDIVMODE_4_5; pciclk = txx9_cpu_clock * 2 / 9; break; case TX4938_CCFG_PCIDIVMODE_10: case TX4938_CCFG_PCIDIVMODE_5: pcidivmode = TX4938_CCFG_PCIDIVMODE_5; pciclk = txx9_cpu_clock / 5; break; case TX4938_CCFG_PCIDIVMODE_11: case TX4938_CCFG_PCIDIVMODE_5_5: default: pcidivmode = TX4938_CCFG_PCIDIVMODE_5_5; pciclk = txx9_cpu_clock * 2 / 11; break; } tx4938_ccfg_change(TX4938_CCFG_PCIDIVMODE_MASK, pcidivmode); pr_debug("PCICLK: ccfg:%08lx\n", (unsigned long)__raw_readq(&tx4938_ccfgptr->ccfg)); } else pciclk = -1; return pciclk; }

Contributors

PersonTokensPropCommitsCommitProp
Atsushi Nemoto17099.42%150.00%
Geert Uytterhoeven10.58%150.00%
Total171100.00%2100.00%


int tx4938_pcic1_map_irq(const struct pci_dev *dev, u8 slot) { if (get_tx4927_pcicptr(dev->bus->sysdata) == tx4938_pcic1ptr) { switch (slot) { case TX4927_PCIC_IDSEL_AD_TO_SLOT(31): if (__raw_readq(&tx4938_ccfgptr->pcfg) & TX4938_PCFG_ETH0_SEL) return TXX9_IRQ_BASE + TX4938_IR_ETH0; break; case TX4927_PCIC_IDSEL_AD_TO_SLOT(30): if (__raw_readq(&tx4938_ccfgptr->pcfg) & TX4938_PCFG_ETH1_SEL) return TXX9_IRQ_BASE + TX4938_IR_ETH1; break; } return 0; } return -1; }

Contributors

PersonTokensPropCommitsCommitProp
Atsushi Nemoto90100.00%1100.00%
Total90100.00%1100.00%


void __init tx4938_setup_pcierr_irq(void) { if (request_irq(TXX9_IRQ_BASE + TX4938_IR_PCIERR, tx4927_pcierr_interrupt, 0, "PCI error", (void *)TX4927_PCIC_REG)) pr_warn("Failed to request irq for PCIERR\n"); }

Contributors

PersonTokensPropCommitsCommitProp
Atsushi Nemoto3294.12%133.33%
Geert Uytterhoeven12.94%133.33%
Yong Zhang12.94%133.33%
Total34100.00%3100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
Atsushi Nemoto57898.47%240.00%
Geert Uytterhoeven71.19%120.00%
Yong Zhang10.17%120.00%
Ralf Bächle10.17%120.00%
Total587100.00%5100.00%
Directory: arch/mips/pci
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.