cpu.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * (C) Copyright 2010-2015
  3. * NVIDIA Corporation <www.nvidia.com>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <asm/types.h>
  8. /* Stabilization delays, in usec */
  9. #define PLL_STABILIZATION_DELAY (300)
  10. #define IO_STABILIZATION_DELAY (1000)
  11. #if defined(CONFIG_TEGRA20)
  12. #define NVBL_PLLP_KHZ 216000
  13. #define CSITE_KHZ 144000
  14. #elif defined(CONFIG_TEGRA30) || defined(CONFIG_TEGRA114) || \
  15. defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA210)
  16. #define NVBL_PLLP_KHZ 408000
  17. #define CSITE_KHZ 136000
  18. #else
  19. #error "Unknown Tegra chip!"
  20. #endif
  21. #define PLLX_ENABLED (1 << 30)
  22. #define CCLK_BURST_POLICY 0x20008888
  23. #define SUPER_CCLK_DIVIDER 0x80000000
  24. /* Calculate clock fractional divider value from ref and target frequencies */
  25. #define CLK_DIVIDER(REF, FREQ) ((((REF) * 2) / FREQ) - 2)
  26. /* Calculate clock frequency value from reference and clock divider value */
  27. #define CLK_FREQUENCY(REF, REG) (((REF) * 2) / (REG + 2))
  28. /* AVP/CPU ID */
  29. #define PG_UP_TAG_0_PID_CPU 0x55555555 /* CPU aka "a9" aka "mpcore" */
  30. #define PG_UP_TAG_0 0x0
  31. #define CORESIGHT_UNLOCK 0xC5ACCE55
  32. #define EXCEP_VECTOR_CPU_RESET_VECTOR (NV_PA_EVP_BASE + 0x100)
  33. #define CSITE_CPU_DBG0_LAR (NV_PA_CSITE_BASE + 0x10FB0)
  34. #define CSITE_CPU_DBG1_LAR (NV_PA_CSITE_BASE + 0x12FB0)
  35. #define CSITE_CPU_DBG2_LAR (NV_PA_CSITE_BASE + 0x14FB0)
  36. #define CSITE_CPU_DBG3_LAR (NV_PA_CSITE_BASE + 0x16FB0)
  37. #define FLOW_CTLR_HALT_COP_EVENTS (NV_PA_FLOW_BASE + 4)
  38. #define FLOW_MODE_STOP 2
  39. #define HALT_COP_EVENT_JTAG (1 << 28)
  40. #define HALT_COP_EVENT_IRQ_1 (1 << 11)
  41. #define HALT_COP_EVENT_FIQ_1 (1 << 9)
  42. #define FLOW_MODE_NONE 0
  43. #define SIMPLE_PLLX (CLOCK_ID_XCPU - CLOCK_ID_FIRST_SIMPLE)
  44. /* SB_AA64_RESET_LOW and _HIGH defines for CPU reset vector */
  45. #define SB_AA64_RESET_LOW 0x6000C230
  46. #define SB_AA64_RESET_HIGH 0x6000C234
  47. struct clk_pll_table {
  48. u16 n;
  49. u16 m;
  50. u8 p;
  51. u8 cpcon;
  52. };
  53. void clock_enable_coresight(int enable);
  54. void enable_cpu_clock(int enable);
  55. void halt_avp(void) __attribute__ ((noreturn));
  56. void init_pllx(void);
  57. void powerup_cpu(void);
  58. void reset_A9_cpu(int reset);
  59. void start_cpu(u32 reset_vector);
  60. int tegra_get_chip(void);
  61. int tegra_get_sku_info(void);
  62. int tegra_get_chip_sku(void);
  63. void adjust_pllp_out_freqs(void);
  64. void pmic_enable_cpu_vdd(void);