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

TOMOYO Linux Cross Reference
Linux/arch/powerpc/platforms/8xx/tqm8xx_setup.c

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ 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  * Platform setup for the MPC8xx based boards from TQM.
  3  *
  4  * Heiko Schocher <hs@denx.de>
  5  * Copyright 2010 DENX Software Engineering GmbH
  6  *
  7  * based on:
  8  * Vitaly Bordug <vbordug@ru.mvista.com>
  9  *
 10  * Copyright 2005 MontaVista Software Inc.
 11  *
 12  * Heavily modified by Scott Wood <scottwood@freescale.com>
 13  * Copyright 2007 Freescale Semiconductor, Inc.
 14  *
 15  * This file is licensed under the terms of the GNU General Public License
 16  * version 2. This program is licensed "as is" without any warranty of any
 17  * kind, whether express or implied.
 18  */
 19 
 20 #include <linux/init.h>
 21 #include <linux/param.h>
 22 #include <linux/string.h>
 23 #include <linux/ioport.h>
 24 #include <linux/device.h>
 25 #include <linux/delay.h>
 26 
 27 #include <linux/fsl_devices.h>
 28 #include <linux/mii.h>
 29 #include <linux/of_fdt.h>
 30 #include <linux/of_platform.h>
 31 
 32 #include <asm/delay.h>
 33 #include <asm/io.h>
 34 #include <asm/machdep.h>
 35 #include <asm/page.h>
 36 #include <asm/processor.h>
 37 #include <asm/time.h>
 38 #include <asm/8xx_immap.h>
 39 #include <asm/cpm1.h>
 40 #include <asm/udbg.h>
 41 
 42 #include "mpc8xx.h"
 43 #include "pic.h"
 44 
 45 struct cpm_pin {
 46         int port, pin, flags;
 47 };
 48 
 49 static struct cpm_pin tqm8xx_pins[] __initdata = {
 50         /* SMC1 */
 51         {CPM_PORTB, 24, CPM_PIN_INPUT}, /* RX */
 52         {CPM_PORTB, 25, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TX */
 53 
 54         /* SCC1 */
 55         {CPM_PORTA, 5, CPM_PIN_INPUT}, /* CLK1 */
 56         {CPM_PORTA, 7, CPM_PIN_INPUT}, /* CLK2 */
 57         {CPM_PORTA, 14, CPM_PIN_INPUT}, /* TX */
 58         {CPM_PORTA, 15, CPM_PIN_INPUT}, /* RX */
 59         {CPM_PORTC, 15, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TENA */
 60         {CPM_PORTC, 10, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_GPIO},
 61         {CPM_PORTC, 11, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_GPIO},
 62 };
 63 
 64 static struct cpm_pin tqm8xx_fec_pins[] __initdata = {
 65         /* MII */
 66         {CPM_PORTD, 3, CPM_PIN_OUTPUT},
 67         {CPM_PORTD, 4, CPM_PIN_OUTPUT},
 68         {CPM_PORTD, 5, CPM_PIN_OUTPUT},
 69         {CPM_PORTD, 6, CPM_PIN_OUTPUT},
 70         {CPM_PORTD, 7, CPM_PIN_OUTPUT},
 71         {CPM_PORTD, 8, CPM_PIN_OUTPUT},
 72         {CPM_PORTD, 9, CPM_PIN_OUTPUT},
 73         {CPM_PORTD, 10, CPM_PIN_OUTPUT},
 74         {CPM_PORTD, 11, CPM_PIN_OUTPUT},
 75         {CPM_PORTD, 12, CPM_PIN_OUTPUT},
 76         {CPM_PORTD, 13, CPM_PIN_OUTPUT},
 77         {CPM_PORTD, 14, CPM_PIN_OUTPUT},
 78         {CPM_PORTD, 15, CPM_PIN_OUTPUT},
 79 };
 80 
 81 static void __init init_pins(int n, struct cpm_pin *pin)
 82 {
 83         int i;
 84 
 85         for (i = 0; i < n; i++) {
 86                 cpm1_set_pin(pin->port, pin->pin, pin->flags);
 87                 pin++;
 88         }
 89 }
 90 
 91 static void __init init_ioports(void)
 92 {
 93         struct device_node *dnode;
 94         struct property *prop;
 95         int     len;
 96 
 97         init_pins(ARRAY_SIZE(tqm8xx_pins), &tqm8xx_pins[0]);
 98 
 99         cpm1_clk_setup(CPM_CLK_SMC1, CPM_BRG1, CPM_CLK_RTX);
100 
101         dnode = of_find_node_by_name(NULL, "aliases");
102         if (dnode == NULL)
103                 return;
104         prop = of_find_property(dnode, "ethernet1", &len);
105 
106         of_node_put(dnode);
107 
108         if (prop == NULL)
109                 return;
110 
111         /* init FEC pins */
112         init_pins(ARRAY_SIZE(tqm8xx_fec_pins), &tqm8xx_fec_pins[0]);
113 }
114 
115 static void __init tqm8xx_setup_arch(void)
116 {
117         cpm_reset();
118         init_ioports();
119 }
120 
121 static const struct of_device_id of_bus_ids[] __initconst = {
122         { .name = "soc", },
123         { .name = "cpm", },
124         { .name = "localbus", },
125         { .compatible = "simple-bus" },
126         {},
127 };
128 
129 static int __init declare_of_platform_devices(void)
130 {
131         of_platform_bus_probe(NULL, of_bus_ids, NULL);
132 
133         return 0;
134 }
135 machine_device_initcall(tqm8xx, declare_of_platform_devices);
136 
137 define_machine(tqm8xx) {
138         .name                   = "TQM8xx",
139         .compatible             = "tqc,tqm8xx",
140         .setup_arch             = tqm8xx_setup_arch,
141         .init_IRQ               = mpc8xx_pic_init,
142         .get_irq                = mpc8xx_get_irq,
143         .restart                = mpc8xx_restart,
144         .calibrate_decr         = mpc8xx_calibrate_decr,
145         .set_rtc_time           = mpc8xx_set_rtc_time,
146         .get_rtc_time           = mpc8xx_get_rtc_time,
147         .progress               = udbg_progress,
148 };
149 

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