cpu.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * (C) Copyright 2000-2003
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #include <common.h>
  24. #include <watchdog.h>
  25. #include <command.h>
  26. #ifdef CONFIG_M5272
  27. #include <asm/m5272.h>
  28. #endif
  29. #ifdef CONFIG_M5282
  30. #include <asm/m5282.h>
  31. #endif
  32. #include <asm/cache.h>
  33. int do_reset (cmd_tbl_t * cmdtp, bd_t * bd, int flag, int argc, char *argv[])
  34. {
  35. return 0;
  36. }
  37. unsigned long get_tbclk (void)
  38. {
  39. return CFG_HZ;
  40. }
  41. int checkcpu (void)
  42. {
  43. #ifdef CONFIG_M5272
  44. puts ("MOTOROLA Coldfire MCF5272\n");
  45. #endif
  46. #ifdef CONFIG_M5282
  47. puts ("MOTOROLA Coldfire MCF5282\n");
  48. #endif
  49. return 0;
  50. }
  51. void do_exception (void)
  52. {
  53. printf ("\n\n*** Unexpected exception ... Reset Board! ***\n");
  54. for (;;);
  55. }
  56. void do_buserror (void)
  57. {
  58. printf ("\n\n*** Bus error ... Reset Board! ***\n");
  59. for (;;);
  60. }
  61. void do_addresserror (void)
  62. {
  63. printf ("\n\n*** Address error ... Reset Board! ***\n");
  64. for (;;);
  65. }
  66. void trap_init (ulong value)
  67. {
  68. extern void buserror_handler (void);
  69. extern void addresserror_handler (void);
  70. extern void exception_handler (void);
  71. unsigned long *vec = 0;
  72. int i;
  73. vec[2] = buserror_handler;
  74. vec[3] = addresserror_handler;
  75. for (i = 4; i < 256; i++) {
  76. vec[i] = exception_handler;
  77. }
  78. }