cpu.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * (C) Copyright 2010-2011
  3. * NVIDIA Corporation <www.nvidia.com>
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #include <asm/types.h>
  24. /* Stabilization delays, in usec */
  25. #define PLL_STABILIZATION_DELAY (300)
  26. #define IO_STABILIZATION_DELAY (1000)
  27. #if defined(CONFIG_TEGRA20)
  28. #define NVBL_PLLP_KHZ (216000)
  29. #elif defined(CONFIG_TEGRA30) || defined(CONFIG_TEGRA114)
  30. #define NVBL_PLLP_KHZ (408000)
  31. #else
  32. #error "Unknown Tegra chip!"
  33. #endif
  34. #define PLLX_ENABLED (1 << 30)
  35. #define CCLK_BURST_POLICY 0x20008888
  36. #define SUPER_CCLK_DIVIDER 0x80000000
  37. /* Calculate clock fractional divider value from ref and target frequencies */
  38. #define CLK_DIVIDER(REF, FREQ) ((((REF) * 2) / FREQ) - 2)
  39. /* Calculate clock frequency value from reference and clock divider value */
  40. #define CLK_FREQUENCY(REF, REG) (((REF) * 2) / (REG + 2))
  41. /* AVP/CPU ID */
  42. #define PG_UP_TAG_0_PID_CPU 0x55555555 /* CPU aka "a9" aka "mpcore" */
  43. #define PG_UP_TAG_0 0x0
  44. #define CORESIGHT_UNLOCK 0xC5ACCE55;
  45. #define EXCEP_VECTOR_CPU_RESET_VECTOR (NV_PA_EVP_BASE + 0x100)
  46. #define CSITE_CPU_DBG0_LAR (NV_PA_CSITE_BASE + 0x10FB0)
  47. #define CSITE_CPU_DBG1_LAR (NV_PA_CSITE_BASE + 0x12FB0)
  48. #define CSITE_CPU_DBG2_LAR (NV_PA_CSITE_BASE + 0x14FB0)
  49. #define CSITE_CPU_DBG3_LAR (NV_PA_CSITE_BASE + 0x16FB0)
  50. #define FLOW_CTLR_HALT_COP_EVENTS (NV_PA_FLOW_BASE + 4)
  51. #define FLOW_MODE_STOP 2
  52. #define HALT_COP_EVENT_JTAG (1 << 28)
  53. #define HALT_COP_EVENT_IRQ_1 (1 << 11)
  54. #define HALT_COP_EVENT_FIQ_1 (1 << 9)
  55. #define FLOW_MODE_NONE 0
  56. #define SIMPLE_PLLX (CLOCK_ID_XCPU - CLOCK_ID_FIRST_SIMPLE)
  57. struct clk_pll_table {
  58. u16 n;
  59. u16 m;
  60. u8 p;
  61. u8 cpcon;
  62. };
  63. void clock_enable_coresight(int enable);
  64. void enable_cpu_clock(int enable);
  65. void halt_avp(void) __attribute__ ((noreturn));
  66. void init_pllx(void);
  67. void powerup_cpu(void);
  68. void reset_A9_cpu(int reset);
  69. void start_cpu(u32 reset_vector);
  70. int tegra_get_chip_type(void);
  71. void adjust_pllp_out_freqs(void);