bsc913x_rdb.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * BSC913xRDB Board Setup
  3. *
  4. * Author: Priyanka Jain <Priyanka.Jain@freescale.com>
  5. *
  6. * Copyright 2011-2012 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. #include <linux/of_platform.h>
  14. #include <linux/pci.h>
  15. #include <asm/mpic.h>
  16. #include <sysdev/fsl_soc.h>
  17. #include <asm/udbg.h>
  18. #include "mpc85xx.h"
  19. void __init bsc913x_rdb_pic_init(void)
  20. {
  21. struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN |
  22. MPIC_SINGLE_DEST_CPU,
  23. 0, 256, " OpenPIC ");
  24. if (!mpic)
  25. pr_err("bsc913x: Failed to allocate MPIC structure\n");
  26. else
  27. mpic_init(mpic);
  28. }
  29. /*
  30. * Setup the architecture
  31. */
  32. static void __init bsc913x_rdb_setup_arch(void)
  33. {
  34. if (ppc_md.progress)
  35. ppc_md.progress("bsc913x_rdb_setup_arch()", 0);
  36. pr_info("bsc913x board from Freescale Semiconductor\n");
  37. }
  38. machine_device_initcall(bsc9131_rdb, mpc85xx_common_publish_devices);
  39. /*
  40. * Called very early, device-tree isn't unflattened
  41. */
  42. static int __init bsc9131_rdb_probe(void)
  43. {
  44. unsigned long root = of_get_flat_dt_root();
  45. return of_flat_dt_is_compatible(root, "fsl,bsc9131rdb");
  46. }
  47. define_machine(bsc9131_rdb) {
  48. .name = "BSC9131 RDB",
  49. .probe = bsc9131_rdb_probe,
  50. .setup_arch = bsc913x_rdb_setup_arch,
  51. .init_IRQ = bsc913x_rdb_pic_init,
  52. .get_irq = mpic_get_irq,
  53. .restart = fsl_rstcr_restart,
  54. .calibrate_decr = generic_calibrate_decr,
  55. .progress = udbg_progress,
  56. };