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

TOMOYO Linux Cross Reference
Linux/arch/powerpc/platforms/embedded6xx/storcenter.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 /*
  2  * Board setup routines for the storcenter
  3  *
  4  * Copyright 2007 (C) Oyvind Repvik (nail@nslu2-linux.org)
  5  * Copyright 2007 Andy Wilcox, Jon Loeliger
  6  *
  7  * Based on linkstation.c by G. Liakhovetski
  8  *
  9  * This file is licensed under the terms of the GNU General Public License
 10  * version 2.  This program is licensed "as is" without any warranty of
 11  * any kind, whether express or implied.
 12  */
 13 
 14 #include <linux/kernel.h>
 15 #include <linux/pci.h>
 16 #include <linux/initrd.h>
 17 #include <linux/of_platform.h>
 18 
 19 #include <asm/time.h>
 20 #include <asm/mpic.h>
 21 #include <asm/pci-bridge.h>
 22 
 23 #include "mpc10x.h"
 24 
 25 
 26 static const struct of_device_id storcenter_of_bus[] __initconst = {
 27         { .name = "soc", },
 28         {},
 29 };
 30 
 31 static int __init storcenter_device_probe(void)
 32 {
 33         of_platform_bus_probe(NULL, storcenter_of_bus, NULL);
 34         return 0;
 35 }
 36 machine_device_initcall(storcenter, storcenter_device_probe);
 37 
 38 
 39 static int __init storcenter_add_bridge(struct device_node *dev)
 40 {
 41 #ifdef CONFIG_PCI
 42         int len;
 43         struct pci_controller *hose;
 44         const int *bus_range;
 45 
 46         printk("Adding PCI host bridge %pOF\n", dev);
 47 
 48         hose = pcibios_alloc_controller(dev);
 49         if (hose == NULL)
 50                 return -ENOMEM;
 51 
 52         bus_range = of_get_property(dev, "bus-range", &len);
 53         hose->first_busno = bus_range ? bus_range[0] : 0;
 54         hose->last_busno = bus_range ? bus_range[1] : 0xff;
 55 
 56         setup_indirect_pci(hose, MPC10X_MAPB_CNFG_ADDR, MPC10X_MAPB_CNFG_DATA, 0);
 57 
 58         /* Interpret the "ranges" property */
 59         /* This also maps the I/O region and sets isa_io/mem_base */
 60         pci_process_bridge_OF_ranges(hose, dev, 1);
 61 #endif
 62 
 63         return 0;
 64 }
 65 
 66 static void __init storcenter_setup_arch(void)
 67 {
 68         printk(KERN_INFO "IOMEGA StorCenter\n");
 69 }
 70 
 71 static void __init storcenter_setup_pci(void)
 72 {
 73         struct device_node *np;
 74 
 75         /* Lookup PCI host bridges */
 76         for_each_compatible_node(np, "pci", "mpc10x-pci")
 77                 storcenter_add_bridge(np);
 78 }
 79 
 80 /*
 81  * Interrupt setup and service.  Interrupts on the turbostation come
 82  * from the four PCI slots plus onboard 8241 devices: I2C, DUART.
 83  */
 84 static void __init storcenter_init_IRQ(void)
 85 {
 86         struct mpic *mpic;
 87 
 88         mpic = mpic_alloc(NULL, 0, 0, 16, 0, " OpenPIC  ");
 89         BUG_ON(mpic == NULL);
 90 
 91         /*
 92          * 16 Serial Interrupts followed by 16 Internal Interrupts.
 93          * I2C is the second internal, so it is at 17, 0x11020.
 94          */
 95         mpic_assign_isu(mpic, 0, mpic->paddr + 0x10200);
 96         mpic_assign_isu(mpic, 1, mpic->paddr + 0x11000);
 97 
 98         mpic_init(mpic);
 99 }
100 
101 static void __noreturn storcenter_restart(char *cmd)
102 {
103         local_irq_disable();
104 
105         /* Set exception prefix high - to the firmware */
106         mtmsr(mfmsr() | MSR_IP);
107         isync();
108 
109         /* Wait for reset to happen */
110         for (;;) ;
111 }
112 
113 define_machine(storcenter){
114         .name                   = "IOMEGA StorCenter",
115         .compatible             = "iomega,storcenter",
116         .setup_arch             = storcenter_setup_arch,
117         .discover_phbs          = storcenter_setup_pci,
118         .init_IRQ               = storcenter_init_IRQ,
119         .get_irq                = mpic_get_irq,
120         .restart                = storcenter_restart,
121 };
122 

~ [ 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