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

TOMOYO Linux Cross Reference
Linux/arch/powerpc/platforms/8xx/adder875.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-only
  2 /* Analogue & Micro Adder MPC875 board support
  3  *
  4  * Author: Scott Wood <scottwood@freescale.com>
  5  *
  6  * Copyright (c) 2007 Freescale Semiconductor, Inc.
  7  */
  8 
  9 #include <linux/init.h>
 10 #include <linux/of_platform.h>
 11 
 12 #include <asm/time.h>
 13 #include <asm/machdep.h>
 14 #include <asm/cpm1.h>
 15 #include <asm/8xx_immap.h>
 16 #include <asm/udbg.h>
 17 
 18 #include "mpc8xx.h"
 19 #include "pic.h"
 20 
 21 struct cpm_pin {
 22         int port, pin, flags;
 23 };
 24 
 25 static __initdata struct cpm_pin adder875_pins[] = {
 26         /* SMC1 */
 27         {CPM_PORTB, 24, CPM_PIN_INPUT}, /* RX */
 28         {CPM_PORTB, 25, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TX */
 29 
 30         /* MII1 */
 31         {CPM_PORTA, 0, CPM_PIN_INPUT},
 32         {CPM_PORTA, 1, CPM_PIN_INPUT},
 33         {CPM_PORTA, 2, CPM_PIN_INPUT},
 34         {CPM_PORTA, 3, CPM_PIN_INPUT},
 35         {CPM_PORTA, 4, CPM_PIN_OUTPUT},
 36         {CPM_PORTA, 10, CPM_PIN_OUTPUT},
 37         {CPM_PORTA, 11, CPM_PIN_OUTPUT},
 38         {CPM_PORTB, 19, CPM_PIN_INPUT},
 39         {CPM_PORTB, 31, CPM_PIN_INPUT},
 40         {CPM_PORTC, 12, CPM_PIN_INPUT},
 41         {CPM_PORTC, 13, CPM_PIN_INPUT},
 42         {CPM_PORTE, 30, CPM_PIN_OUTPUT},
 43         {CPM_PORTE, 31, CPM_PIN_OUTPUT},
 44 
 45         /* MII2 */
 46         {CPM_PORTE, 14, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
 47         {CPM_PORTE, 15, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
 48         {CPM_PORTE, 16, CPM_PIN_OUTPUT},
 49         {CPM_PORTE, 17, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
 50         {CPM_PORTE, 18, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
 51         {CPM_PORTE, 19, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
 52         {CPM_PORTE, 20, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
 53         {CPM_PORTE, 21, CPM_PIN_OUTPUT},
 54         {CPM_PORTE, 22, CPM_PIN_OUTPUT},
 55         {CPM_PORTE, 23, CPM_PIN_OUTPUT},
 56         {CPM_PORTE, 24, CPM_PIN_OUTPUT},
 57         {CPM_PORTE, 25, CPM_PIN_OUTPUT},
 58         {CPM_PORTE, 26, CPM_PIN_OUTPUT},
 59         {CPM_PORTE, 27, CPM_PIN_OUTPUT},
 60         {CPM_PORTE, 28, CPM_PIN_OUTPUT},
 61         {CPM_PORTE, 29, CPM_PIN_OUTPUT},
 62 };
 63 
 64 static void __init init_ioports(void)
 65 {
 66         int i;
 67 
 68         for (i = 0; i < ARRAY_SIZE(adder875_pins); i++) {
 69                 const struct cpm_pin *pin = &adder875_pins[i];
 70                 cpm1_set_pin(pin->port, pin->pin, pin->flags);
 71         }
 72 
 73         cpm1_clk_setup(CPM_CLK_SMC1, CPM_BRG1, CPM_CLK_RTX);
 74 
 75         /* Set FEC1 and FEC2 to MII mode */
 76         clrbits32(&mpc8xx_immr->im_cpm.cp_cptr, 0x00000180);
 77 }
 78 
 79 static void __init adder875_setup(void)
 80 {
 81         cpm_reset();
 82         init_ioports();
 83 }
 84 
 85 static const struct of_device_id of_bus_ids[] __initconst = {
 86         { .compatible = "simple-bus", },
 87         {},
 88 };
 89 
 90 static int __init declare_of_platform_devices(void)
 91 {
 92         of_platform_bus_probe(NULL, of_bus_ids, NULL);
 93         return 0;
 94 }
 95 machine_device_initcall(adder875, declare_of_platform_devices);
 96 
 97 define_machine(adder875) {
 98         .name = "Adder MPC875",
 99         .compatible = "analogue-and-micro,adder875",
100         .setup_arch = adder875_setup,
101         .init_IRQ = mpc8xx_pic_init,
102         .get_irq = mpc8xx_get_irq,
103         .restart = mpc8xx_restart,
104         .progress = udbg_progress,
105 };
106 

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