Path: blob/master/arch/powerpc/platforms/83xx/mpc837x_rdb.c
10819 views
/*1* arch/powerpc/platforms/83xx/mpc837x_rdb.c2*3* Copyright (C) 2007 Freescale Semicondutor, Inc. All rights reserved.4*5* MPC837x RDB board specific routines6*7* This program is free software; you can redistribute it and/or modify it8* under the terms of the GNU General Public License as published by the9* Free Software Foundation; either version 2 of the License, or (at your10* option) any later version.11*/1213#include <linux/pci.h>14#include <linux/of_platform.h>1516#include <asm/time.h>17#include <asm/ipic.h>18#include <asm/udbg.h>19#include <sysdev/fsl_soc.h>20#include <sysdev/fsl_pci.h>2122#include "mpc83xx.h"2324static void mpc837x_rdb_sd_cfg(void)25{26void __iomem *im;2728im = ioremap(get_immrbase(), 0x1000);29if (!im) {30WARN_ON(1);31return;32}3334/*35* On RDB boards (in contrast to MDS) USBB pins are used for SD only,36* so we can safely mux them away from the USB block.37*/38clrsetbits_be32(im + MPC83XX_SICRL_OFFS, MPC837X_SICRL_USBB_MASK,39MPC837X_SICRL_SD);40clrsetbits_be32(im + MPC83XX_SICRH_OFFS, MPC837X_SICRH_SPI_MASK,41MPC837X_SICRH_SD);42iounmap(im);43}4445/* ************************************************************************46*47* Setup the architecture48*49*/50static void __init mpc837x_rdb_setup_arch(void)51{52#ifdef CONFIG_PCI53struct device_node *np;54#endif5556if (ppc_md.progress)57ppc_md.progress("mpc837x_rdb_setup_arch()", 0);5859#ifdef CONFIG_PCI60for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")61mpc83xx_add_bridge(np);62for_each_compatible_node(np, "pci", "fsl,mpc8314-pcie")63mpc83xx_add_bridge(np);64#endif65mpc837x_usb_cfg();66mpc837x_rdb_sd_cfg();67}6869static struct of_device_id mpc837x_ids[] = {70{ .type = "soc", },71{ .compatible = "soc", },72{ .compatible = "simple-bus", },73{ .compatible = "gianfar", },74{ .compatible = "gpio-leds", },75{},76};7778static int __init mpc837x_declare_of_platform_devices(void)79{80/* Publish platform_device */81of_platform_bus_probe(NULL, mpc837x_ids, NULL);8283return 0;84}85machine_device_initcall(mpc837x_rdb, mpc837x_declare_of_platform_devices);8687static void __init mpc837x_rdb_init_IRQ(void)88{89struct device_node *np;9091np = of_find_compatible_node(NULL, NULL, "fsl,ipic");92if (!np)93return;9495ipic_init(np, 0);9697/* Initialize the default interrupt mapping priorities,98* in case the boot rom changed something on us.99*/100ipic_set_default_priority();101}102103static const char *board[] __initdata = {104"fsl,mpc8377rdb",105"fsl,mpc8378rdb",106"fsl,mpc8379rdb",107"fsl,mpc8377wlan",108NULL109};110111/*112* Called very early, MMU is off, device-tree isn't unflattened113*/114static int __init mpc837x_rdb_probe(void)115{116return of_flat_dt_match(of_get_flat_dt_root(), board);117}118119define_machine(mpc837x_rdb) {120.name = "MPC837x RDB/WLAN",121.probe = mpc837x_rdb_probe,122.setup_arch = mpc837x_rdb_setup_arch,123.init_IRQ = mpc837x_rdb_init_IRQ,124.get_irq = ipic_get_irq,125.restart = mpc83xx_restart,126.time_init = mpc83xx_time_init,127.calibrate_decr = generic_calibrate_decr,128.progress = udbg_progress,129};130131132