sam440ep.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * Sam440ep board specific routines based off bamboo.c code
  3. * original copyrights below
  4. *
  5. * Wade Farnsworth <wfarnsworth@mvista.com>
  6. * Copyright 2004 MontaVista Software Inc.
  7. *
  8. * Rewritten and ported to the merged powerpc tree:
  9. * Josh Boyer <jwboyer@linux.vnet.ibm.com>
  10. * Copyright 2007 IBM Corporation
  11. *
  12. * Modified from bamboo.c for sam440ep:
  13. * Copyright 2008 Giuseppe Coviello <gicoviello@gmail.com>
  14. *
  15. * This program is free software; you can redistribute it and/or modify it
  16. * under the terms of the GNU General Public License as published by the
  17. * Free Software Foundation; either version 2 of the License, or (at your
  18. * option) any later version.
  19. */
  20. #include <linux/init.h>
  21. #include <linux/of_platform.h>
  22. #include <asm/machdep.h>
  23. #include <asm/prom.h>
  24. #include <asm/udbg.h>
  25. #include <asm/time.h>
  26. #include <asm/uic.h>
  27. #include <asm/pci-bridge.h>
  28. #include <asm/ppc4xx.h>
  29. #include <linux/i2c.h>
  30. static const struct of_device_id sam440ep_of_bus[] __initconst = {
  31. { .compatible = "ibm,plb4", },
  32. { .compatible = "ibm,opb", },
  33. { .compatible = "ibm,ebc", },
  34. {},
  35. };
  36. static int __init sam440ep_device_probe(void)
  37. {
  38. of_platform_bus_probe(NULL, sam440ep_of_bus, NULL);
  39. return 0;
  40. }
  41. machine_device_initcall(sam440ep, sam440ep_device_probe);
  42. static int __init sam440ep_probe(void)
  43. {
  44. unsigned long root = of_get_flat_dt_root();
  45. if (!of_flat_dt_is_compatible(root, "acube,sam440ep"))
  46. return 0;
  47. pci_set_flags(PCI_REASSIGN_ALL_RSRC);
  48. return 1;
  49. }
  50. define_machine(sam440ep) {
  51. .name = "Sam440ep",
  52. .probe = sam440ep_probe,
  53. .progress = udbg_progress,
  54. .init_IRQ = uic_init_tree,
  55. .get_irq = uic_get_irq,
  56. .restart = ppc4xx_reset_system,
  57. .calibrate_decr = generic_calibrate_decr,
  58. };
  59. static struct i2c_board_info sam440ep_rtc_info = {
  60. .type = "m41st85",
  61. .addr = 0x68,
  62. .irq = -1,
  63. };
  64. static int sam440ep_setup_rtc(void)
  65. {
  66. return i2c_register_board_info(0, &sam440ep_rtc_info, 1);
  67. }
  68. machine_device_initcall(sam440ep, sam440ep_setup_rtc);