sam440ep.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * Sam440ep board specific routines based off bamboo.c code
  4. * original copyrights below
  5. *
  6. * Wade Farnsworth <[email protected]>
  7. * Copyright 2004 MontaVista Software Inc.
  8. *
  9. * Rewritten and ported to the merged powerpc tree:
  10. * Josh Boyer <[email protected]>
  11. * Copyright 2007 IBM Corporation
  12. *
  13. * Modified from bamboo.c for sam440ep:
  14. * Copyright 2008 Giuseppe Coviello <[email protected]>
  15. */
  16. #include <linux/init.h>
  17. #include <linux/of_platform.h>
  18. #include <asm/machdep.h>
  19. #include <asm/udbg.h>
  20. #include <asm/time.h>
  21. #include <asm/uic.h>
  22. #include <asm/pci-bridge.h>
  23. #include <asm/ppc4xx.h>
  24. #include <linux/i2c.h>
  25. static const struct of_device_id sam440ep_of_bus[] __initconst = {
  26. { .compatible = "ibm,plb4", },
  27. { .compatible = "ibm,opb", },
  28. { .compatible = "ibm,ebc", },
  29. {},
  30. };
  31. static int __init sam440ep_device_probe(void)
  32. {
  33. of_platform_bus_probe(NULL, sam440ep_of_bus, NULL);
  34. return 0;
  35. }
  36. machine_device_initcall(sam440ep, sam440ep_device_probe);
  37. static int __init sam440ep_probe(void)
  38. {
  39. if (!of_machine_is_compatible("acube,sam440ep"))
  40. return 0;
  41. pci_set_flags(PCI_REASSIGN_ALL_RSRC);
  42. return 1;
  43. }
  44. define_machine(sam440ep) {
  45. .name = "Sam440ep",
  46. .probe = sam440ep_probe,
  47. .progress = udbg_progress,
  48. .init_IRQ = uic_init_tree,
  49. .get_irq = uic_get_irq,
  50. .restart = ppc4xx_reset_system,
  51. .calibrate_decr = generic_calibrate_decr,
  52. };
  53. static struct i2c_board_info sam440ep_rtc_info = {
  54. .type = "m41st85",
  55. .addr = 0x68,
  56. .irq = -1,
  57. };
  58. static int __init sam440ep_setup_rtc(void)
  59. {
  60. return i2c_register_board_info(0, &sam440ep_rtc_info, 1);
  61. }
  62. machine_device_initcall(sam440ep, sam440ep_setup_rtc);