ap20.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. #define NVBL_PLLP_KHZ (216000)
  28. #define PLLX_ENABLED (1 << 30)
  29. #define CCLK_BURST_POLICY 0x20008888
  30. #define SUPER_CCLK_DIVIDER 0x80000000
  31. /* Calculate clock fractional divider value from ref and target frequencies */
  32. #define CLK_DIVIDER(REF, FREQ) ((((REF) * 2) / FREQ) - 2)
  33. /* Calculate clock frequency value from reference and clock divider value */
  34. #define CLK_FREQUENCY(REF, REG) (((REF) * 2) / (REG + 2))
  35. /* AVP/CPU ID */
  36. #define PG_UP_TAG_0_PID_CPU 0x55555555 /* CPU aka "a9" aka "mpcore" */
  37. #define PG_UP_TAG_0 0x0
  38. #define CORESIGHT_UNLOCK 0xC5ACCE55;
  39. /* AP20-Specific Base Addresses */
  40. /* AP20 Base physical address of SDRAM. */
  41. #define AP20_BASE_PA_SDRAM 0x00000000
  42. /* AP20 Base physical address of internal SRAM. */
  43. #define AP20_BASE_PA_SRAM 0x40000000
  44. /* AP20 Size of internal SRAM (256KB). */
  45. #define AP20_BASE_PA_SRAM_SIZE 0x00040000
  46. /* AP20 Base physical address of flash. */
  47. #define AP20_BASE_PA_NOR_FLASH 0xD0000000
  48. /* AP20 Base physical address of boot information table. */
  49. #define AP20_BASE_PA_BOOT_INFO AP20_BASE_PA_SRAM
  50. /*
  51. * Super-temporary stacks for EXTREMELY early startup. The values chosen for
  52. * these addresses must be valid on ALL SOCs because this value is used before
  53. * we are able to differentiate between the SOC types.
  54. *
  55. * NOTE: The since CPU's stack will eventually be moved from IRAM to SDRAM, its
  56. * stack is placed below the AVP stack. Once the CPU stack has been moved,
  57. * the AVP is free to use the IRAM the CPU stack previously occupied if
  58. * it should need to do so.
  59. *
  60. * NOTE: In multi-processor CPU complex configurations, each processor will have
  61. * its own stack of size CPU_EARLY_BOOT_STACK_SIZE. CPU 0 will have a
  62. * limit of CPU_EARLY_BOOT_STACK_LIMIT. Each successive CPU will have a
  63. * stack limit that is CPU_EARLY_BOOT_STACK_SIZE less then the previous
  64. * CPU.
  65. */
  66. /* Common AVP early boot stack limit */
  67. #define AVP_EARLY_BOOT_STACK_LIMIT \
  68. (AP20_BASE_PA_SRAM + (AP20_BASE_PA_SRAM_SIZE/2))
  69. /* Common AVP early boot stack size */
  70. #define AVP_EARLY_BOOT_STACK_SIZE 0x1000
  71. /* Common CPU early boot stack limit */
  72. #define CPU_EARLY_BOOT_STACK_LIMIT \
  73. (AVP_EARLY_BOOT_STACK_LIMIT - AVP_EARLY_BOOT_STACK_SIZE)
  74. /* Common CPU early boot stack size */
  75. #define CPU_EARLY_BOOT_STACK_SIZE 0x1000
  76. #define EXCEP_VECTOR_CPU_RESET_VECTOR (NV_PA_EVP_BASE + 0x100)
  77. #define CSITE_CPU_DBG0_LAR (NV_PA_CSITE_BASE + 0x10FB0)
  78. #define CSITE_CPU_DBG1_LAR (NV_PA_CSITE_BASE + 0x12FB0)
  79. #define FLOW_CTLR_HALT_COP_EVENTS (NV_PA_FLOW_BASE + 4)
  80. #define FLOW_MODE_STOP 2
  81. #define HALT_COP_EVENT_JTAG (1 << 28)
  82. #define HALT_COP_EVENT_IRQ_1 (1 << 11)
  83. #define HALT_COP_EVENT_FIQ_1 (1 << 9)
  84. /* Prototypes */
  85. void tegra2_start(void);
  86. void uart_init(void);
  87. void udelay(unsigned long);
  88. void cold_boot(void);
  89. void cache_configure(void);