cpu.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #include <linux/module.h>
  2. #include <linux/io.h>
  3. #include "hardware.h"
  4. #include "common.h"
  5. unsigned int __mxc_cpu_type;
  6. EXPORT_SYMBOL(__mxc_cpu_type);
  7. void mxc_set_cpu_type(unsigned int type)
  8. {
  9. __mxc_cpu_type = type;
  10. }
  11. void imx_print_silicon_rev(const char *cpu, int srev)
  12. {
  13. if (srev == IMX_CHIP_REVISION_UNKNOWN)
  14. pr_info("CPU identified as %s, unknown revision\n", cpu);
  15. else
  16. pr_info("CPU identified as %s, silicon rev %d.%d\n",
  17. cpu, (srev >> 4) & 0xf, srev & 0xf);
  18. }
  19. void __init imx_set_aips(void __iomem *base)
  20. {
  21. unsigned int reg;
  22. /*
  23. * Set all MPROTx to be non-bufferable, trusted for R/W,
  24. * not forced to user-mode.
  25. */
  26. __raw_writel(0x77777777, base + 0x0);
  27. __raw_writel(0x77777777, base + 0x4);
  28. /*
  29. * Set all OPACRx to be non-bufferable, to not require
  30. * supervisor privilege level for access, allow for
  31. * write access and untrusted master access.
  32. */
  33. __raw_writel(0x0, base + 0x40);
  34. __raw_writel(0x0, base + 0x44);
  35. __raw_writel(0x0, base + 0x48);
  36. __raw_writel(0x0, base + 0x4C);
  37. reg = __raw_readl(base + 0x50) & 0x00FFFFFF;
  38. __raw_writel(reg, base + 0x50);
  39. }