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

TOMOYO Linux Cross Reference
Linux/arch/powerpc/platforms/44x/canyonlands.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  * This contain platform specific code for APM PPC460EX based Canyonlands
  4  * board.
  5  *
  6  * Copyright (c) 2010, Applied Micro Circuits Corporation
  7  * Author: Rupjyoti Sarmah <rsarmah@apm.com>
  8  */
  9 #include <linux/kernel.h>
 10 #include <linux/init.h>
 11 #include <asm/pci-bridge.h>
 12 #include <asm/ppc4xx.h>
 13 #include <asm/udbg.h>
 14 #include <asm/uic.h>
 15 #include <linux/of_address.h>
 16 #include <linux/of_platform.h>
 17 #include <linux/delay.h>
 18 #include "44x.h"
 19 
 20 #define BCSR_USB_EN     0x11
 21 
 22 static const struct of_device_id ppc460ex_of_bus[] __initconst = {
 23         { .compatible = "ibm,plb4", },
 24         { .compatible = "ibm,opb", },
 25         { .compatible = "ibm,ebc", },
 26         { .compatible = "simple-bus", },
 27         {},
 28 };
 29 
 30 static int __init ppc460ex_device_probe(void)
 31 {
 32         of_platform_bus_probe(NULL, ppc460ex_of_bus, NULL);
 33 
 34         return 0;
 35 }
 36 machine_device_initcall(canyonlands, ppc460ex_device_probe);
 37 
 38 /* Using this code only for the Canyonlands board.  */
 39 
 40 static int __init ppc460ex_probe(void)
 41 {
 42         pci_set_flags(PCI_REASSIGN_ALL_RSRC);
 43 
 44         return 1;
 45 }
 46 
 47 /* USB PHY fixup code on Canyonlands kit. */
 48 
 49 static int __init ppc460ex_canyonlands_fixup(void)
 50 {
 51         u8 __iomem *bcsr ;
 52         void __iomem *vaddr;
 53         struct device_node *np;
 54         int ret = 0;
 55 
 56         np = of_find_compatible_node(NULL, NULL, "amcc,ppc460ex-bcsr");
 57         if (!np) {
 58                 printk(KERN_ERR "failed did not find amcc, ppc460ex bcsr node\n");
 59                 return -ENODEV;
 60         }
 61 
 62         bcsr = of_iomap(np, 0);
 63         of_node_put(np);
 64 
 65         if (!bcsr) {
 66                 printk(KERN_CRIT "Could not remap bcsr\n");
 67                 ret = -ENODEV;
 68                 goto err_bcsr;
 69         }
 70 
 71         np = of_find_compatible_node(NULL, NULL, "ibm,ppc4xx-gpio");
 72         if (!np) {
 73                 printk(KERN_ERR "failed did not find ibm,ppc4xx-gpio node\n");
 74                 return -ENODEV;
 75         }
 76 
 77         vaddr = of_iomap(np, 0);
 78         of_node_put(np);
 79 
 80         if (!vaddr) {
 81                 printk(KERN_CRIT "Could not get gpio node address\n");
 82                 ret = -ENODEV;
 83                 goto err_gpio;
 84         }
 85         /* Disable USB, through the BCSR7 bits */
 86         setbits8(&bcsr[7], BCSR_USB_EN);
 87 
 88         /* Wait for a while after reset */
 89         msleep(100);
 90 
 91         /* Enable USB here */
 92         clrbits8(&bcsr[7], BCSR_USB_EN);
 93 
 94         /*
 95          * Configure multiplexed gpio16 and gpio19 as alternate1 output
 96          * source after USB reset. In this configuration gpio16 will be
 97          * USB2HStop and gpio19 will be USB2DStop. For more details refer to
 98          * table 34-7 of PPC460EX user manual.
 99          */
100         setbits32((vaddr + GPIO0_OSRH), 0x42000000);
101         setbits32((vaddr + GPIO0_TSRH), 0x42000000);
102 err_gpio:
103         iounmap(vaddr);
104 err_bcsr:
105         iounmap(bcsr);
106         return ret;
107 }
108 machine_device_initcall(canyonlands, ppc460ex_canyonlands_fixup);
109 define_machine(canyonlands) {
110         .name = "Canyonlands",
111         .compatible = "amcc,canyonlands",
112         .probe = ppc460ex_probe,
113         .progress = udbg_progress,
114         .init_IRQ = uic_init_tree,
115         .get_irq = uic_get_irq,
116         .restart = ppc4xx_reset_system,
117 };
118 

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