asp834x.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * arch/powerpc/platforms/83xx/asp834x.c
  3. *
  4. * Analogue & Micro ASP8347 board specific routines
  5. * clone of mpc834x_itx
  6. *
  7. * Copyright 2008 Codehermit
  8. *
  9. * Maintainer: Bryan O'Donoghue <bodonoghue@codhermit.ie>
  10. *
  11. * This program is free software; you can redistribute it and/or modify it
  12. * under the terms of the GNU General Public License as published by the
  13. * Free Software Foundation; either version 2 of the License, or (at your
  14. * option) any later version.
  15. */
  16. #include <linux/pci.h>
  17. #include <linux/of_platform.h>
  18. #include <asm/time.h>
  19. #include <asm/ipic.h>
  20. #include <asm/udbg.h>
  21. #include "mpc83xx.h"
  22. /* ************************************************************************
  23. *
  24. * Setup the architecture
  25. *
  26. */
  27. static void __init asp834x_setup_arch(void)
  28. {
  29. if (ppc_md.progress)
  30. ppc_md.progress("asp834x_setup_arch()", 0);
  31. mpc834x_usb_cfg();
  32. }
  33. static void __init asp834x_init_IRQ(void)
  34. {
  35. struct device_node *np;
  36. np = of_find_node_by_type(NULL, "ipic");
  37. if (!np)
  38. return;
  39. ipic_init(np, 0);
  40. of_node_put(np);
  41. /* Initialize the default interrupt mapping priorities,
  42. * in case the boot rom changed something on us.
  43. */
  44. ipic_set_default_priority();
  45. }
  46. static struct __initdata of_device_id asp8347_ids[] = {
  47. { .type = "soc", },
  48. { .compatible = "soc", },
  49. { .compatible = "simple-bus", },
  50. { .compatible = "gianfar", },
  51. {},
  52. };
  53. static int __init asp8347_declare_of_platform_devices(void)
  54. {
  55. of_platform_bus_probe(NULL, asp8347_ids, NULL);
  56. return 0;
  57. }
  58. machine_device_initcall(asp834x, asp8347_declare_of_platform_devices);
  59. /*
  60. * Called very early, MMU is off, device-tree isn't unflattened
  61. */
  62. static int __init asp834x_probe(void)
  63. {
  64. unsigned long root = of_get_flat_dt_root();
  65. return of_flat_dt_is_compatible(root, "analogue-and-micro,asp8347e");
  66. }
  67. define_machine(asp834x) {
  68. .name = "ASP8347E",
  69. .probe = asp834x_probe,
  70. .setup_arch = asp834x_setup_arch,
  71. .init_IRQ = asp834x_init_IRQ,
  72. .get_irq = ipic_get_irq,
  73. .restart = mpc83xx_restart,
  74. .time_init = mpc83xx_time_init,
  75. .calibrate_decr = generic_calibrate_decr,
  76. .progress = udbg_progress,
  77. };