cpu_info-sh73a0.c 751 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2012 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
  4. * (C) Copyright 2012 Renesas Solutions Corp.
  5. */
  6. #include <common.h>
  7. #include <asm/io.h>
  8. u32 rmobile_get_cpu_type(void)
  9. {
  10. u32 id;
  11. u32 type;
  12. struct sh73a0_hpb *hpb = (struct sh73a0_hpb *)HPB_BASE;
  13. id = readl(&hpb->cccr);
  14. type = (id >> 8) & 0xFF;
  15. return type;
  16. }
  17. u32 rmobile_get_cpu_rev_integer(void)
  18. {
  19. u32 id;
  20. u32 rev;
  21. struct sh73a0_hpb *hpb = (struct sh73a0_hpb *)HPB_BASE;
  22. id = readl(&hpb->cccr);
  23. rev = ((id >> 4) & 0xF) + 1;
  24. return rev;
  25. }
  26. u32 rmobile_get_cpu_rev_fraction(void)
  27. {
  28. u32 id;
  29. u32 rev;
  30. struct sh73a0_hpb *hpb = (struct sh73a0_hpb *)HPB_BASE;
  31. id = readl(&hpb->cccr);
  32. rev = id & 0xF;
  33. return rev;
  34. }