reset.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * arch/arm/mach-tegra/reset.h
  3. *
  4. * CPU reset dispatcher.
  5. *
  6. * Copyright (c) 2011, NVIDIA Corporation.
  7. *
  8. * This software is licensed under the terms of the GNU General Public
  9. * License version 2, as published by the Free Software Foundation, and
  10. * may be copied, distributed, and modified under those terms.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. */
  18. #ifndef __MACH_TEGRA_RESET_H
  19. #define __MACH_TEGRA_RESET_H
  20. #define TEGRA_RESET_MASK_PRESENT 0
  21. #define TEGRA_RESET_MASK_LP1 1
  22. #define TEGRA_RESET_MASK_LP2 2
  23. #define TEGRA_RESET_STARTUP_SECONDARY 3
  24. #define TEGRA_RESET_STARTUP_LP2 4
  25. #define TEGRA_RESET_STARTUP_LP1 5
  26. #define TEGRA_RESET_DATA_SIZE 6
  27. #ifndef __ASSEMBLY__
  28. #include "irammap.h"
  29. extern unsigned long __tegra_cpu_reset_handler_data[TEGRA_RESET_DATA_SIZE];
  30. void __tegra_cpu_reset_handler_start(void);
  31. void __tegra_cpu_reset_handler(void);
  32. void __tegra20_cpu1_resettable_status_offset(void);
  33. void __tegra_cpu_reset_handler_end(void);
  34. #ifdef CONFIG_PM_SLEEP
  35. #define tegra_cpu_lp1_mask \
  36. (IO_ADDRESS(TEGRA_IRAM_BASE + TEGRA_IRAM_RESET_HANDLER_OFFSET + \
  37. ((u32)&__tegra_cpu_reset_handler_data[TEGRA_RESET_MASK_LP1] - \
  38. (u32)__tegra_cpu_reset_handler_start)))
  39. #define tegra_cpu_lp2_mask \
  40. (IO_ADDRESS(TEGRA_IRAM_BASE + TEGRA_IRAM_RESET_HANDLER_OFFSET + \
  41. ((u32)&__tegra_cpu_reset_handler_data[TEGRA_RESET_MASK_LP2] - \
  42. (u32)__tegra_cpu_reset_handler_start)))
  43. #define tegra20_cpu1_resettable_status \
  44. (IO_ADDRESS(TEGRA_IRAM_BASE + TEGRA_IRAM_RESET_HANDLER_OFFSET + \
  45. (u32)__tegra20_cpu1_resettable_status_offset))
  46. #endif
  47. #define tegra_cpu_reset_handler_offset \
  48. ((u32)__tegra_cpu_reset_handler - \
  49. (u32)__tegra_cpu_reset_handler_start)
  50. #define tegra_cpu_reset_handler_size \
  51. (__tegra_cpu_reset_handler_end - \
  52. __tegra_cpu_reset_handler_start)
  53. void __init tegra_cpu_reset_handler_init(void);
  54. #endif
  55. #endif