cpu.c 1.2 KB

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