ap.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. #define PLLX_ENABLED (1 << 30)
  12. #define CCLK_BURST_POLICY 0x20008888
  13. #define SUPER_CCLK_DIVIDER 0x80000000
  14. /* Calculate clock fractional divider value from ref and target frequencies */
  15. #define CLK_DIVIDER(REF, FREQ) ((((REF) * 2) / FREQ) - 2)
  16. /* Calculate clock frequency value from reference and clock divider value */
  17. #define CLK_FREQUENCY(REF, REG) (((REF) * 2) / (REG + 2))
  18. /* AVP/CPU ID */
  19. #define PG_UP_TAG_0_PID_CPU 0x55555555 /* CPU aka "a9" aka "mpcore" */
  20. #define PG_UP_TAG_0 0x0
  21. /* AP base physical address of internal SRAM */
  22. #define NV_PA_BASE_SRAM 0x40000000
  23. #define EXCEP_VECTOR_CPU_RESET_VECTOR (NV_PA_EVP_BASE + 0x100)
  24. #define CSITE_CPU_DBG0_LAR (NV_PA_CSITE_BASE + 0x10FB0)
  25. #define CSITE_CPU_DBG1_LAR (NV_PA_CSITE_BASE + 0x12FB0)
  26. #define FLOW_CTLR_HALT_COP_EVENTS (NV_PA_FLOW_BASE + 4)
  27. #define FLOW_MODE_STOP 2
  28. #define HALT_COP_EVENT_JTAG (1 << 28)
  29. #define HALT_COP_EVENT_IRQ_1 (1 << 11)
  30. #define HALT_COP_EVENT_FIQ_1 (1 << 9)
  31. /* This is the main entry into U-Boot, used by the Cortex-A9 */
  32. extern void _start(void);
  33. /**
  34. * Works out the SOC/SKU type used for clocks settings
  35. *
  36. * @return SOC type - see TEGRA_SOC...
  37. */
  38. int tegra_get_chip_sku(void);
  39. /**
  40. * Returns the pure SOC (chip ID) from the HIDREV register
  41. *
  42. * @return SOC ID - see CHIPID_TEGRAxx...
  43. */
  44. int tegra_get_chip(void);
  45. /**
  46. * Returns the SKU ID from the sku_info register
  47. *
  48. * @return SKU ID - see SKU_ID_Txx...
  49. */
  50. int tegra_get_sku_info(void);
  51. /* Do any chip-specific cache config */
  52. void config_cache(void);
  53. #if defined(CONFIG_TEGRA_SUPPORT_NON_SECURE)
  54. bool tegra_cpu_is_non_secure(void);
  55. #endif