cpu_info-r8a7740.c 565 B

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