mpc8313_rdb.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * arch/powerpc/platforms/83xx/mpc8313_rdb.c
  3. *
  4. * Description: MPC8313x RDB board specific routines.
  5. * This file is based on mpc834x_sys.c
  6. * Author: Lo Wlison <r43300@freescale.com>
  7. *
  8. * Copyright (C) Freescale Semiconductor, Inc. 2006. All rights reserved.
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License as published by the
  12. * Free Software Foundation; either version 2 of the License, or (at your
  13. * option) any later version.
  14. */
  15. #include <linux/pci.h>
  16. #include <asm/time.h>
  17. #include <asm/ipic.h>
  18. #include <asm/udbg.h>
  19. #include "mpc83xx.h"
  20. #undef DEBUG
  21. #ifdef DEBUG
  22. #define DBG(fmt...) udbg_printf(fmt)
  23. #else
  24. #define DBG(fmt...)
  25. #endif
  26. #ifndef CONFIG_PCI
  27. unsigned long isa_io_base = 0;
  28. unsigned long isa_mem_base = 0;
  29. #endif
  30. /* ************************************************************************
  31. *
  32. * Setup the architecture
  33. *
  34. */
  35. static void __init mpc8313_rdb_setup_arch(void)
  36. {
  37. struct device_node *np;
  38. if (ppc_md.progress)
  39. ppc_md.progress("mpc8313_rdb_setup_arch()", 0);
  40. #ifdef CONFIG_PCI
  41. for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
  42. add_bridge(np);
  43. ppc_md.pci_exclude_device = mpc83xx_exclude_device;
  44. #endif
  45. }
  46. void __init mpc8313_rdb_init_IRQ(void)
  47. {
  48. struct device_node *np;
  49. np = of_find_node_by_type(NULL, "ipic");
  50. if (!np)
  51. return;
  52. ipic_init(np, 0);
  53. /* Initialize the default interrupt mapping priorities,
  54. * in case the boot rom changed something on us.
  55. */
  56. ipic_set_default_priority();
  57. }
  58. /*
  59. * Called very early, MMU is off, device-tree isn't unflattened
  60. */
  61. static int __init mpc8313_rdb_probe(void)
  62. {
  63. unsigned long root = of_get_flat_dt_root();
  64. return of_flat_dt_is_compatible(root, "MPC8313ERDB");
  65. }
  66. define_machine(mpc8313_rdb) {
  67. .name = "MPC8313 RDB",
  68. .probe = mpc8313_rdb_probe,
  69. .setup_arch = mpc8313_rdb_setup_arch,
  70. .init_IRQ = mpc8313_rdb_init_IRQ,
  71. .get_irq = ipic_get_irq,
  72. .restart = mpc83xx_restart,
  73. .time_init = mpc83xx_time_init,
  74. .calibrate_decr = generic_calibrate_decr,
  75. .progress = udbg_progress,
  76. };