cpu.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved.
  3. *
  4. * The code contained herein is licensed under the GNU General Public
  5. * License. You may obtain a copy of the GNU General Public License
  6. * Version 2 or later at the following locations:
  7. *
  8. * http://www.opensource.org/licenses/gpl-license.html
  9. * http://www.gnu.org/copyleft/gpl.html
  10. *
  11. * This file contains the CPU initialization code.
  12. */
  13. #include <linux/types.h>
  14. #include <linux/kernel.h>
  15. #include <linux/init.h>
  16. #include <mach/hardware.h>
  17. #include <asm/io.h>
  18. static int __init post_cpu_init(void)
  19. {
  20. unsigned int reg;
  21. void __iomem *base;
  22. if (!cpu_is_mx51())
  23. return 0;
  24. base = MX51_IO_ADDRESS(MX51_AIPS1_BASE_ADDR);
  25. __raw_writel(0x0, base + 0x40);
  26. __raw_writel(0x0, base + 0x44);
  27. __raw_writel(0x0, base + 0x48);
  28. __raw_writel(0x0, base + 0x4C);
  29. reg = __raw_readl(base + 0x50) & 0x00FFFFFF;
  30. __raw_writel(reg, base + 0x50);
  31. base = MX51_IO_ADDRESS(MX51_AIPS2_BASE_ADDR);
  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. return 0;
  39. }
  40. postcore_initcall(post_cpu_init);