cpu_info-rcar.c 719 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * arch/arm/cpu/armv7/rmobile/cpu_info-rcar.c
  3. *
  4. * Copyright (C) 2013,2014 Renesas Electronics Corporation
  5. *
  6. * SPDX-License-Identifier: GPL-2.0
  7. */
  8. #include <common.h>
  9. #include <asm/io.h>
  10. #define PRR 0xFF000044
  11. #define PRR_MASK 0x7fff
  12. #define R8A7796_REV_1_0 0x5200
  13. #define R8A7796_REV_1_1 0x5210
  14. u32 rmobile_get_cpu_type(void)
  15. {
  16. return (readl(PRR) & 0x00007F00) >> 8;
  17. }
  18. u32 rmobile_get_cpu_rev_integer(void)
  19. {
  20. const u32 prr = readl(PRR);
  21. if ((prr & PRR_MASK) == R8A7796_REV_1_1)
  22. return 1;
  23. else
  24. return ((prr & 0x000000F0) >> 4) + 1;
  25. }
  26. u32 rmobile_get_cpu_rev_fraction(void)
  27. {
  28. const u32 prr = readl(PRR);
  29. if ((prr & PRR_MASK) == R8A7796_REV_1_1)
  30. return 1;
  31. else
  32. return prr & 0x0000000F;
  33. }