~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/powerpc/platforms/86xx/mvme7100.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0-or-later
  2 /*
  3  * Board setup routines for the Emerson/Artesyn MVME7100
  4  *
  5  * Copyright 2016 Elettra-Sincrotrone Trieste S.C.p.A.
  6  *
  7  * Author: Alessio Igor Bogani <alessio.bogani@elettra.eu>
  8  *
  9  * Based on earlier code by:
 10  *
 11  *      Ajit Prem <ajit.prem@emerson.com>
 12  *      Copyright 2008 Emerson
 13  *
 14  * USB host fixup is borrowed by:
 15  *
 16  *      Martyn Welch <martyn.welch@ge.com>
 17  *      Copyright 2008 GE Intelligent Platforms Embedded Systems, Inc.
 18  */
 19 
 20 #include <linux/pci.h>
 21 #include <linux/of.h>
 22 #include <linux/of_fdt.h>
 23 #include <linux/of_address.h>
 24 #include <asm/udbg.h>
 25 #include <asm/mpic.h>
 26 #include <sysdev/fsl_soc.h>
 27 #include <sysdev/fsl_pci.h>
 28 
 29 #include "mpc86xx.h"
 30 
 31 #define MVME7100_INTERRUPT_REG_2_OFFSET 0x05
 32 #define MVME7100_DS1375_MASK            0x40
 33 #define MVME7100_MAX6649_MASK           0x20
 34 #define MVME7100_ABORT_MASK             0x10
 35 
 36 /*
 37  * Setup the architecture
 38  */
 39 static void __init mvme7100_setup_arch(void)
 40 {
 41         struct device_node *bcsr_node;
 42         void __iomem *mvme7100_regs = NULL;
 43         u8 reg;
 44 
 45         if (ppc_md.progress)
 46                 ppc_md.progress("mvme7100_setup_arch()", 0);
 47 
 48 #ifdef CONFIG_SMP
 49         mpc86xx_smp_init();
 50 #endif
 51 
 52         fsl_pci_assign_primary();
 53 
 54         /* Remap BCSR registers */
 55         bcsr_node = of_find_compatible_node(NULL, NULL,
 56                         "artesyn,mvme7100-bcsr");
 57         if (bcsr_node) {
 58                 mvme7100_regs = of_iomap(bcsr_node, 0);
 59                 of_node_put(bcsr_node);
 60         }
 61 
 62         if (mvme7100_regs) {
 63                 /* Disable ds1375, max6649, and abort interrupts */
 64                 reg = readb(mvme7100_regs + MVME7100_INTERRUPT_REG_2_OFFSET);
 65                 reg |= MVME7100_DS1375_MASK | MVME7100_MAX6649_MASK
 66                         | MVME7100_ABORT_MASK;
 67                 writeb(reg, mvme7100_regs + MVME7100_INTERRUPT_REG_2_OFFSET);
 68         } else
 69                 pr_warn("Unable to map board registers\n");
 70 
 71         pr_info("MVME7100 board from Artesyn\n");
 72 }
 73 
 74 /*
 75  * Called very early, device-tree isn't unflattened
 76  */
 77 static int __init mvme7100_probe(void)
 78 {
 79         unsigned long root = of_get_flat_dt_root();
 80 
 81         return of_flat_dt_is_compatible(root, "artesyn,MVME7100");
 82 }
 83 
 84 static void mvme7100_usb_host_fixup(struct pci_dev *pdev)
 85 {
 86         unsigned int val;
 87 
 88         if (!machine_is(mvme7100))
 89                 return;
 90 
 91         /* Ensure only ports 1 & 2 are enabled */
 92         pci_read_config_dword(pdev, 0xe0, &val);
 93         pci_write_config_dword(pdev, 0xe0, (val & ~7) | 0x2);
 94 
 95         /* System clock is 48-MHz Oscillator and EHCI Enabled. */
 96         pci_write_config_dword(pdev, 0xe4, 1 << 5);
 97 }
 98 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_USB,
 99         mvme7100_usb_host_fixup);
100 
101 machine_arch_initcall(mvme7100, mpc86xx_common_publish_devices);
102 
103 define_machine(mvme7100) {
104         .name                   = "MVME7100",
105         .probe                  = mvme7100_probe,
106         .setup_arch             = mvme7100_setup_arch,
107         .init_IRQ               = mpc86xx_init_irq,
108         .get_irq                = mpic_get_irq,
109         .time_init              = mpc86xx_time_init,
110         .progress               = udbg_progress,
111 #ifdef CONFIG_PCI
112         .pcibios_fixup_bus      = fsl_pcibios_fixup_bus,
113 #endif
114 };
115 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php