Path: blob/master/arch/powerpc/platforms/8xx/adder875.c
10819 views
/* Analogue & Micro Adder MPC875 board support1*2* Author: Scott Wood <[email protected]>3*4* Copyright (c) 2007 Freescale Semiconductor, Inc.5*6* This program is free software; you can redistribute it and/or modify7* it under the terms of the GNU General Public License, version 2, as8* published by the Free Software Foundation.9*/1011#include <linux/init.h>12#include <linux/fs_enet_pd.h>13#include <linux/of_platform.h>1415#include <asm/time.h>16#include <asm/machdep.h>17#include <asm/cpm1.h>18#include <asm/fs_pd.h>19#include <asm/udbg.h>20#include <asm/prom.h>2122#include "mpc8xx.h"2324struct cpm_pin {25int port, pin, flags;26};2728static __initdata struct cpm_pin adder875_pins[] = {29/* SMC1 */30{CPM_PORTB, 24, CPM_PIN_INPUT}, /* RX */31{CPM_PORTB, 25, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TX */3233/* MII1 */34{CPM_PORTA, 0, CPM_PIN_INPUT},35{CPM_PORTA, 1, CPM_PIN_INPUT},36{CPM_PORTA, 2, CPM_PIN_INPUT},37{CPM_PORTA, 3, CPM_PIN_INPUT},38{CPM_PORTA, 4, CPM_PIN_OUTPUT},39{CPM_PORTA, 10, CPM_PIN_OUTPUT},40{CPM_PORTA, 11, CPM_PIN_OUTPUT},41{CPM_PORTB, 19, CPM_PIN_INPUT},42{CPM_PORTB, 31, CPM_PIN_INPUT},43{CPM_PORTC, 12, CPM_PIN_INPUT},44{CPM_PORTC, 13, CPM_PIN_INPUT},45{CPM_PORTE, 30, CPM_PIN_OUTPUT},46{CPM_PORTE, 31, CPM_PIN_OUTPUT},4748/* MII2 */49{CPM_PORTE, 14, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},50{CPM_PORTE, 15, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},51{CPM_PORTE, 16, CPM_PIN_OUTPUT},52{CPM_PORTE, 17, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},53{CPM_PORTE, 18, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},54{CPM_PORTE, 19, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},55{CPM_PORTE, 20, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},56{CPM_PORTE, 21, CPM_PIN_OUTPUT},57{CPM_PORTE, 22, CPM_PIN_OUTPUT},58{CPM_PORTE, 23, CPM_PIN_OUTPUT},59{CPM_PORTE, 24, CPM_PIN_OUTPUT},60{CPM_PORTE, 25, CPM_PIN_OUTPUT},61{CPM_PORTE, 26, CPM_PIN_OUTPUT},62{CPM_PORTE, 27, CPM_PIN_OUTPUT},63{CPM_PORTE, 28, CPM_PIN_OUTPUT},64{CPM_PORTE, 29, CPM_PIN_OUTPUT},65};6667static void __init init_ioports(void)68{69int i;7071for (i = 0; i < ARRAY_SIZE(adder875_pins); i++) {72const struct cpm_pin *pin = &adder875_pins[i];73cpm1_set_pin(pin->port, pin->pin, pin->flags);74}7576cpm1_clk_setup(CPM_CLK_SMC1, CPM_BRG1, CPM_CLK_RTX);7778/* Set FEC1 and FEC2 to MII mode */79clrbits32(&mpc8xx_immr->im_cpm.cp_cptr, 0x00000180);80}8182static void __init adder875_setup(void)83{84cpm_reset();85init_ioports();86}8788static int __init adder875_probe(void)89{90unsigned long root = of_get_flat_dt_root();91return of_flat_dt_is_compatible(root, "analogue-and-micro,adder875");92}9394static __initdata struct of_device_id of_bus_ids[] = {95{ .compatible = "simple-bus", },96{},97};9899static int __init declare_of_platform_devices(void)100{101of_platform_bus_probe(NULL, of_bus_ids, NULL);102return 0;103}104machine_device_initcall(adder875, declare_of_platform_devices);105106define_machine(adder875) {107.name = "Adder MPC875",108.probe = adder875_probe,109.setup_arch = adder875_setup,110.init_IRQ = mpc8xx_pics_init,111.get_irq = mpc8xx_get_irq,112.restart = mpc8xx_restart,113.calibrate_decr = generic_calibrate_decr,114.set_rtc_time = mpc8xx_set_rtc_time,115.get_rtc_time = mpc8xx_get_rtc_time,116.progress = udbg_progress,117};118119120