ppc44x_simple.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Generic PowerPC 44x platform support
  4. *
  5. * Copyright 2008 IBM Corporation
  6. *
  7. * This implements simple platform support for PowerPC 44x chips. This is
  8. * mostly used for eval boards or other simple and "generic" 44x boards. If
  9. * your board has custom functions or hardware, then you will likely want to
  10. * implement your own board.c file to accommodate it.
  11. */
  12. #include <asm/machdep.h>
  13. #include <asm/pci-bridge.h>
  14. #include <asm/ppc4xx.h>
  15. #include <asm/time.h>
  16. #include <asm/udbg.h>
  17. #include <asm/uic.h>
  18. #include <linux/init.h>
  19. #include <linux/of_platform.h>
  20. static const struct of_device_id ppc44x_of_bus[] __initconst = {
  21. { .compatible = "ibm,plb4", },
  22. { .compatible = "ibm,opb", },
  23. { .compatible = "ibm,ebc", },
  24. { .compatible = "simple-bus", },
  25. {},
  26. };
  27. static int __init ppc44x_device_probe(void)
  28. {
  29. of_platform_bus_probe(NULL, ppc44x_of_bus, NULL);
  30. return 0;
  31. }
  32. machine_device_initcall(ppc44x_simple, ppc44x_device_probe);
  33. /* This is the list of boards that can be supported by this simple
  34. * platform code. This does _not_ mean the boards are compatible,
  35. * as they most certainly are not from a device tree perspective.
  36. * However, their differences are handled by the device tree and the
  37. * drivers and therefore they don't need custom board support files.
  38. *
  39. * Again, if your board needs to do things differently then create a
  40. * board.c file for it rather than adding it to this list.
  41. */
  42. static char *board[] __initdata = {
  43. "amcc,arches",
  44. "amcc,bamboo",
  45. "apm,bluestone",
  46. "amcc,glacier",
  47. "ibm,ebony",
  48. "amcc,eiger",
  49. "amcc,katmai",
  50. "amcc,rainier",
  51. "amcc,redwood",
  52. "amcc,sequoia",
  53. "amcc,taishan",
  54. "amcc,yosemite",
  55. "mosaixtech,icon"
  56. };
  57. static int __init ppc44x_probe(void)
  58. {
  59. int i = 0;
  60. for (i = 0; i < ARRAY_SIZE(board); i++) {
  61. if (of_machine_is_compatible(board[i])) {
  62. pci_set_flags(PCI_REASSIGN_ALL_RSRC);
  63. return 1;
  64. }
  65. }
  66. return 0;
  67. }
  68. define_machine(ppc44x_simple) {
  69. .name = "PowerPC 44x Platform",
  70. .probe = ppc44x_probe,
  71. .progress = udbg_progress,
  72. .init_IRQ = uic_init_tree,
  73. .get_irq = uic_get_irq,
  74. .restart = ppc4xx_reset_system,
  75. };