cpu.c 1.1 KB

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