walnut.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Architecture- / platform-specific boot-time initialization code for
  3. * IBM PowerPC 4xx based boards. Adapted from original
  4. * code by Gary Thomas, Cort Dougan <cort@fsmlabs.com>, and Dan Malek
  5. * <dan@net4x.com>.
  6. *
  7. * Copyright(c) 1999-2000 Grant Erickson <grant@lcse.umn.edu>
  8. *
  9. * Rewritten and ported to the merged powerpc tree:
  10. * Copyright 2007 IBM Corporation
  11. * Josh Boyer <jwboyer@linux.vnet.ibm.com>
  12. *
  13. * 2002 (c) MontaVista, Software, Inc. This file is licensed under
  14. * the terms of the GNU General Public License version 2. This program
  15. * is licensed "as is" without any warranty of any kind, whether express
  16. * or implied.
  17. */
  18. #include <linux/init.h>
  19. #include <linux/of_platform.h>
  20. #include <linux/rtc.h>
  21. #include <asm/machdep.h>
  22. #include <asm/prom.h>
  23. #include <asm/udbg.h>
  24. #include <asm/time.h>
  25. #include <asm/uic.h>
  26. #include <asm/pci-bridge.h>
  27. #include <asm/ppc4xx.h>
  28. static const struct of_device_id walnut_of_bus[] __initconst = {
  29. { .compatible = "ibm,plb3", },
  30. { .compatible = "ibm,opb", },
  31. { .compatible = "ibm,ebc", },
  32. {},
  33. };
  34. static int __init walnut_device_probe(void)
  35. {
  36. of_platform_bus_probe(NULL, walnut_of_bus, NULL);
  37. of_instantiate_rtc();
  38. return 0;
  39. }
  40. machine_device_initcall(walnut, walnut_device_probe);
  41. static int __init walnut_probe(void)
  42. {
  43. unsigned long root = of_get_flat_dt_root();
  44. if (!of_flat_dt_is_compatible(root, "ibm,walnut"))
  45. return 0;
  46. pci_set_flags(PCI_REASSIGN_ALL_RSRC);
  47. return 1;
  48. }
  49. define_machine(walnut) {
  50. .name = "Walnut",
  51. .probe = walnut_probe,
  52. .progress = udbg_progress,
  53. .init_IRQ = uic_init_tree,
  54. .get_irq = uic_get_irq,
  55. .restart = ppc4xx_reset_system,
  56. .calibrate_decr = generic_calibrate_decr,
  57. };