walnut.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 <asm/machdep.h>
  20. #include <asm/prom.h>
  21. #include <asm/udbg.h>
  22. #include <asm/time.h>
  23. #include <asm/uic.h>
  24. #include <asm/of_platform.h>
  25. static struct of_device_id walnut_of_bus[] = {
  26. { .compatible = "ibm,plb3", },
  27. { .compatible = "ibm,opb", },
  28. { .compatible = "ibm,ebc", },
  29. {},
  30. };
  31. static int __init walnut_device_probe(void)
  32. {
  33. if (!machine_is(walnut))
  34. return 0;
  35. /* FIXME: do bus probe here */
  36. of_platform_bus_probe(NULL, walnut_of_bus, NULL);
  37. return 0;
  38. }
  39. device_initcall(walnut_device_probe);
  40. static int __init walnut_probe(void)
  41. {
  42. unsigned long root = of_get_flat_dt_root();
  43. if (!of_flat_dt_is_compatible(root, "ibm,walnut"))
  44. return 0;
  45. return 1;
  46. }
  47. static void __init walnut_setup_arch(void)
  48. {
  49. }
  50. define_machine(walnut) {
  51. .name = "Walnut",
  52. .probe = walnut_probe,
  53. .setup_arch = walnut_setup_arch,
  54. .progress = udbg_progress,
  55. .init_IRQ = uic_init_tree,
  56. .get_irq = uic_get_irq,
  57. .calibrate_decr = generic_calibrate_decr,
  58. };