cpu.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Copyright (C) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
  3. * Copyright (C) 2008 Renesas Solutions Corp.
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <common.h>
  8. #include <command.h>
  9. #include <asm/processor.h>
  10. #include <asm/io.h>
  11. #define STBCR4 0xFFFE040C
  12. #define cmt_clock_enable() do {\
  13. writeb(readb(STBCR4) & ~0x04, STBCR4);\
  14. } while (0)
  15. #define scif0_enable() do {\
  16. writeb(readb(STBCR4) & ~0x80, STBCR4);\
  17. } while (0)
  18. #define scif3_enable() do {\
  19. writeb(readb(STBCR4) & ~0x10, STBCR4);\
  20. } while (0)
  21. int checkcpu(void)
  22. {
  23. puts("CPU: SH2\n");
  24. return 0;
  25. }
  26. int cpu_init(void)
  27. {
  28. /* SCIF enable */
  29. #if defined(CONFIG_CONS_SCIF3)
  30. scif3_enable();
  31. #else
  32. scif0_enable();
  33. #endif
  34. /* CMT clock enable */
  35. cmt_clock_enable() ;
  36. return 0;
  37. }
  38. int cleanup_before_linux(void)
  39. {
  40. disable_interrupts();
  41. return 0;
  42. }
  43. int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  44. {
  45. disable_interrupts();
  46. reset_cpu(0);
  47. return 0;
  48. }
  49. void flush_cache(unsigned long addr, unsigned long size)
  50. {
  51. }
  52. void icache_enable(void)
  53. {
  54. }
  55. void icache_disable(void)
  56. {
  57. }
  58. int icache_status(void)
  59. {
  60. return 0;
  61. }
  62. void dcache_enable(void)
  63. {
  64. }
  65. void dcache_disable(void)
  66. {
  67. }
  68. int dcache_status(void)
  69. {
  70. return 0;
  71. }