ppc40x_simple.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * Generic PowerPC 40x platform support
  3. *
  4. * Copyright 2008 IBM Corporation
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation; version 2 of the License.
  9. *
  10. * This implements simple platform support for PowerPC 44x chips. This is
  11. * mostly used for eval boards or other simple and "generic" 44x boards. If
  12. * your board has custom functions or hardware, then you will likely want to
  13. * implement your own board.c file to accommodate it.
  14. */
  15. #include <asm/machdep.h>
  16. #include <asm/pci-bridge.h>
  17. #include <asm/ppc4xx.h>
  18. #include <asm/prom.h>
  19. #include <asm/time.h>
  20. #include <asm/udbg.h>
  21. #include <asm/uic.h>
  22. #include <linux/init.h>
  23. #include <linux/of_platform.h>
  24. static const struct of_device_id ppc40x_of_bus[] __initconst = {
  25. { .compatible = "ibm,plb3", },
  26. { .compatible = "ibm,plb4", },
  27. { .compatible = "ibm,opb", },
  28. { .compatible = "ibm,ebc", },
  29. { .compatible = "simple-bus", },
  30. {},
  31. };
  32. static int __init ppc40x_device_probe(void)
  33. {
  34. of_platform_bus_probe(NULL, ppc40x_of_bus, NULL);
  35. return 0;
  36. }
  37. machine_device_initcall(ppc40x_simple, ppc40x_device_probe);
  38. /* This is the list of boards that can be supported by this simple
  39. * platform code. This does _not_ mean the boards are compatible,
  40. * as they most certainly are not from a device tree perspective.
  41. * However, their differences are handled by the device tree and the
  42. * drivers and therefore they don't need custom board support files.
  43. *
  44. * Again, if your board needs to do things differently then create a
  45. * board.c file for it rather than adding it to this list.
  46. */
  47. static const char * const board[] __initconst = {
  48. "amcc,acadia",
  49. "amcc,haleakala",
  50. "amcc,kilauea",
  51. "amcc,makalu",
  52. "apm,klondike",
  53. "est,hotfoot",
  54. "plathome,obs600",
  55. NULL
  56. };
  57. static int __init ppc40x_probe(void)
  58. {
  59. if (of_flat_dt_match(of_get_flat_dt_root(), board)) {
  60. pci_set_flags(PCI_REASSIGN_ALL_RSRC);
  61. return 1;
  62. }
  63. return 0;
  64. }
  65. define_machine(ppc40x_simple) {
  66. .name = "PowerPC 40x Platform",
  67. .probe = ppc40x_probe,
  68. .progress = udbg_progress,
  69. .init_IRQ = uic_init_tree,
  70. .get_irq = uic_get_irq,
  71. .restart = ppc4xx_reset_system,
  72. .calibrate_decr = generic_calibrate_decr,
  73. };