mpc512x_shared.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (C) 2007,2008 Freescale Semiconductor, Inc. All rights reserved.
  3. *
  4. * Author: John Rigby <jrigby@freescale.com>
  5. *
  6. * Description:
  7. * MPC512x Shared code
  8. *
  9. * This is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. */
  14. #include <linux/kernel.h>
  15. #include <linux/io.h>
  16. #include <linux/irq.h>
  17. #include <linux/of_platform.h>
  18. #include <asm/machdep.h>
  19. #include <asm/ipic.h>
  20. #include <asm/prom.h>
  21. #include <asm/time.h>
  22. #include "mpc512x.h"
  23. void __init mpc512x_init_IRQ(void)
  24. {
  25. struct device_node *np;
  26. np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-ipic");
  27. if (!np)
  28. return;
  29. ipic_init(np, 0);
  30. of_node_put(np);
  31. /*
  32. * Initialize the default interrupt mapping priorities,
  33. * in case the boot rom changed something on us.
  34. */
  35. ipic_set_default_priority();
  36. }
  37. /*
  38. * Nodes to do bus probe on, soc and localbus
  39. */
  40. static struct of_device_id __initdata of_bus_ids[] = {
  41. { .compatible = "fsl,mpc5121-immr", },
  42. { .compatible = "fsl,mpc5121-localbus", },
  43. {},
  44. };
  45. void __init mpc512x_declare_of_platform_devices(void)
  46. {
  47. if (of_platform_bus_probe(NULL, of_bus_ids, NULL))
  48. printk(KERN_ERR __FILE__ ": "
  49. "Error while probing of_platform bus\n");
  50. }