cpu.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * (C) Copyright 2010-2014
  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)
  16. #define NVBL_PLLP_KHZ 408000
  17. #define CSITE_KHZ 204000
  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. struct clk_pll_table {
  45. u16 n;
  46. u16 m;
  47. u8 p;
  48. u8 cpcon;
  49. };
  50. void clock_enable_coresight(int enable);
  51. void enable_cpu_clock(int enable);
  52. void halt_avp(void) __attribute__ ((noreturn));
  53. void init_pllx(void);
  54. void powerup_cpu(void);
  55. void reset_A9_cpu(int reset);
  56. void start_cpu(u32 reset_vector);
  57. int tegra_get_chip(void);
  58. int tegra_get_sku_info(void);
  59. int tegra_get_chip_sku(void);
  60. void adjust_pllp_out_freqs(void);
  61. void pmic_enable_cpu_vdd(void);