prcm.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * linux/arch/arm/mach-omap2/prcm.c
  3. *
  4. * OMAP 24xx Power Reset and Clock Management (PRCM) functions
  5. *
  6. * Copyright (C) 2005 Nokia Corporation
  7. *
  8. * Written by Tony Lindgren <tony.lindgren@nokia.com>
  9. *
  10. * Some pieces of code Copyright (C) 2005 Texas Instruments, Inc.
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License version 2 as
  14. * published by the Free Software Foundation.
  15. */
  16. #include <linux/module.h>
  17. #include <linux/init.h>
  18. #include <linux/clk.h>
  19. #include <asm/io.h>
  20. #include "prm.h"
  21. #include "prm-regbits-24xx.h"
  22. extern void omap2_clk_prepare_for_reboot(void);
  23. u32 omap_prcm_get_reset_sources(void)
  24. {
  25. return prm_read_mod_reg(WKUP_MOD, RM_RSTST) & 0x7f;
  26. }
  27. EXPORT_SYMBOL(omap_prcm_get_reset_sources);
  28. /* Resets clock rates and reboots the system. Only called from system.h */
  29. void omap_prcm_arch_reset(char mode)
  30. {
  31. u32 wkup;
  32. omap2_clk_prepare_for_reboot();
  33. if (cpu_is_omap24xx()) {
  34. wkup = prm_read_mod_reg(WKUP_MOD, RM_RSTCTRL) | OMAP_RST_DPLL3;
  35. prm_write_mod_reg(wkup, WKUP_MOD, RM_RSTCTRL);
  36. }
  37. }