mpc8313_rdb.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. char *model = of_get_flat_dt_prop(of_get_flat_dt_root(),
  64. "model", NULL);
  65. if (model == NULL)
  66. return 0;
  67. if (strcmp(model, "MPC8313ERDB"))
  68. return 0;
  69. DBG("MPC8313 RDB found\n");
  70. return 1;
  71. }
  72. define_machine(mpc8313_rdb) {
  73. .name = "MPC8313 RDB",
  74. .probe = mpc8313_rdb_probe,
  75. .setup_arch = mpc8313_rdb_setup_arch,
  76. .init_IRQ = mpc8313_rdb_init_IRQ,
  77. .get_irq = ipic_get_irq,
  78. .restart = mpc83xx_restart,
  79. .time_init = mpc83xx_time_init,
  80. .calibrate_decr = generic_calibrate_decr,
  81. .progress = udbg_progress,
  82. };