cpu.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * (C) Copyright 2007
  3. * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
  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 <command.h>
  25. #include <netdev.h>
  26. #include <asm/processor.h>
  27. #include <asm/cache.h>
  28. int checkcpu(void)
  29. {
  30. #ifdef CONFIG_SH4A
  31. puts("CPU: SH-4A\n");
  32. #else
  33. puts("CPU: SH4\n");
  34. #endif
  35. return 0;
  36. }
  37. int cpu_init (void)
  38. {
  39. return 0;
  40. }
  41. int cleanup_before_linux (void)
  42. {
  43. disable_interrupts();
  44. return 0;
  45. }
  46. int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  47. {
  48. disable_interrupts();
  49. reset_cpu (0);
  50. return 0;
  51. }
  52. void flush_cache (unsigned long addr, unsigned long size)
  53. {
  54. dcache_invalid_range( addr , addr + size );
  55. }
  56. void icache_enable (void)
  57. {
  58. cache_control(0);
  59. }
  60. void icache_disable (void)
  61. {
  62. cache_control(1);
  63. }
  64. int icache_status (void)
  65. {
  66. return 0;
  67. }
  68. void dcache_enable (void)
  69. {
  70. }
  71. void dcache_disable (void)
  72. {
  73. }
  74. int dcache_status (void)
  75. {
  76. return 0;
  77. }
  78. int cpu_eth_init(bd_t *bis)
  79. {
  80. #ifdef CONFIG_SH_ETHER
  81. sh_eth_initialize(bis);
  82. #endif
  83. return 0;
  84. }