linux/arch/powerpc/platforms/85xx/p5020_ds.c
<<
>>
Prefs
   1/*
   2 * P5020 DS Setup
   3 *
   4 * Maintained by Kumar Gala (see MAINTAINERS for contact information)
   5 *
   6 * Copyright 2009-2010 Freescale Semiconductor Inc.
   7 *
   8 * This program is free software; you can redistribute  it and/or modify it
   9 * under  the terms of  the GNU General  Public License as published by the
  10 * Free Software Foundation;  either version 2 of the  License, or (at your
  11 * option) any later version.
  12 */
  13
  14#include <linux/kernel.h>
  15#include <linux/pci.h>
  16#include <linux/kdev_t.h>
  17#include <linux/delay.h>
  18#include <linux/interrupt.h>
  19#include <linux/phy.h>
  20
  21#include <asm/system.h>
  22#include <asm/time.h>
  23#include <asm/machdep.h>
  24#include <asm/pci-bridge.h>
  25#include <mm/mmu_decl.h>
  26#include <asm/prom.h>
  27#include <asm/udbg.h>
  28#include <asm/mpic.h>
  29
  30#include <linux/of_platform.h>
  31#include <sysdev/fsl_soc.h>
  32#include <sysdev/fsl_pci.h>
  33#include <asm/ehv_pic.h>
  34
  35#include "corenet_ds.h"
  36
  37/*
  38 * Called very early, device-tree isn't unflattened
  39 */
  40static int __init p5020_ds_probe(void)
  41{
  42        unsigned long root = of_get_flat_dt_root();
  43#ifdef CONFIG_SMP
  44        extern struct smp_ops_t smp_85xx_ops;
  45#endif
  46
  47        if (of_flat_dt_is_compatible(root, "fsl,P5020DS"))
  48                return 1;
  49
  50        /* Check if we're running under the Freescale hypervisor */
  51        if (of_flat_dt_is_compatible(root, "fsl,P5020DS-hv")) {
  52                ppc_md.init_IRQ = ehv_pic_init;
  53                ppc_md.get_irq = ehv_pic_get_irq;
  54                ppc_md.restart = fsl_hv_restart;
  55                ppc_md.power_off = fsl_hv_halt;
  56                ppc_md.halt = fsl_hv_halt;
  57#ifdef CONFIG_SMP
  58                /*
  59                 * Disable the timebase sync operations because we can't write
  60                 * to the timebase registers under the hypervisor.
  61                  */
  62                smp_85xx_ops.give_timebase = NULL;
  63                smp_85xx_ops.take_timebase = NULL;
  64#endif
  65                return 1;
  66        }
  67
  68        return 0;
  69}
  70
  71define_machine(p5020_ds) {
  72        .name                   = "P5020 DS",
  73        .probe                  = p5020_ds_probe,
  74        .setup_arch             = corenet_ds_setup_arch,
  75        .init_IRQ               = corenet_ds_pic_init,
  76#ifdef CONFIG_PCI
  77        .pcibios_fixup_bus      = fsl_pcibios_fixup_bus,
  78#endif
  79/* coreint doesn't play nice with lazy EE, use legacy mpic for now */
  80#ifdef CONFIG_PPC64
  81        .get_irq                = mpic_get_irq,
  82#else
  83        .get_irq                = mpic_get_coreint_irq,
  84#endif
  85        .restart                = fsl_rstcr_restart,
  86        .calibrate_decr         = generic_calibrate_decr,
  87        .progress               = udbg_progress,
  88#ifdef CONFIG_PPC64
  89        .power_save             = book3e_idle,
  90#else
  91        .power_save             = e500_idle,
  92#endif
  93};
  94
  95machine_device_initcall(p5020_ds, corenet_ds_publish_devices);
  96
  97#ifdef CONFIG_SWIOTLB
  98machine_arch_initcall(p5020_ds, swiotlb_setup_bus_notifier);
  99#endif
 100