mpc5121_generic.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright (C) 2007,2008 Freescale Semiconductor, Inc. All rights reserved.
  3. *
  4. * Author: John Rigby, <jrigby@freescale.com>
  5. *
  6. * Description:
  7. * MPC5121 SoC setup
  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. */
  15. #include <linux/kernel.h>
  16. #include <linux/of_platform.h>
  17. #include <asm/machdep.h>
  18. #include <asm/ipic.h>
  19. #include <asm/prom.h>
  20. #include <asm/time.h>
  21. #include "mpc512x.h"
  22. /*
  23. * list of supported boards
  24. */
  25. static char *board[] __initdata = {
  26. "prt,prtlvt",
  27. NULL
  28. };
  29. /*
  30. * Called very early, MMU is off, device-tree isn't unflattened
  31. */
  32. static int __init mpc5121_generic_probe(void)
  33. {
  34. unsigned long node = of_get_flat_dt_root();
  35. int i = 0;
  36. while (board[i]) {
  37. if (of_flat_dt_is_compatible(node, board[i]))
  38. break;
  39. i++;
  40. }
  41. return board[i] != NULL;
  42. }
  43. define_machine(mpc5121_generic) {
  44. .name = "MPC5121 generic",
  45. .probe = mpc5121_generic_probe,
  46. .init = mpc512x_declare_of_platform_devices,
  47. .init_IRQ = mpc512x_init_IRQ,
  48. .get_irq = ipic_get_irq,
  49. .calibrate_decr = generic_calibrate_decr,
  50. };