xref: /rk3399_rockchip-uboot/arch/arm/include/asm/arch-tegra/ap.h (revision b2871037d2c4c5f55b8de8ac593babbdab6624cb)
1150c2493STom Warren /*
2150c2493STom Warren  * (C) Copyright 2010-2011
3150c2493STom Warren  * NVIDIA Corporation <www.nvidia.com>
4150c2493STom Warren  *
5150c2493STom Warren  * See file CREDITS for list of people who contributed to this
6150c2493STom Warren  * project.
7150c2493STom Warren  *
8150c2493STom Warren  * This program is free software; you can redistribute it and/or
9150c2493STom Warren  * modify it under the terms of the GNU General Public License as
10150c2493STom Warren  * published by the Free Software Foundation; either version 2 of
11150c2493STom Warren  * the License, or (at your option) any later version.
12150c2493STom Warren  *
13150c2493STom Warren  * This program is distributed in the hope that it will be useful,
14150c2493STom Warren  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15150c2493STom Warren  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16150c2493STom Warren  * GNU General Public License for more details.
17150c2493STom Warren  *
18150c2493STom Warren  * You should have received a copy of the GNU General Public License
19150c2493STom Warren  * along with this program; if not, write to the Free Software
20150c2493STom Warren  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21150c2493STom Warren  * MA 02111-1307 USA
22150c2493STom Warren  */
23150c2493STom Warren #include <asm/types.h>
24150c2493STom Warren 
25150c2493STom Warren /* Stabilization delays, in usec */
26150c2493STom Warren #define PLL_STABILIZATION_DELAY	(300)
27150c2493STom Warren #define IO_STABILIZATION_DELAY	(1000)
28150c2493STom Warren 
29150c2493STom Warren #define PLLX_ENABLED		(1 << 30)
30150c2493STom Warren #define CCLK_BURST_POLICY	0x20008888
31150c2493STom Warren #define SUPER_CCLK_DIVIDER	0x80000000
32150c2493STom Warren 
33150c2493STom Warren /* Calculate clock fractional divider value from ref and target frequencies */
34150c2493STom Warren #define CLK_DIVIDER(REF, FREQ)	((((REF) * 2) / FREQ) - 2)
35150c2493STom Warren 
36150c2493STom Warren /* Calculate clock frequency value from reference and clock divider value */
37150c2493STom Warren #define CLK_FREQUENCY(REF, REG)	(((REF) * 2) / (REG + 2))
38150c2493STom Warren 
39150c2493STom Warren /* AVP/CPU ID */
40150c2493STom Warren #define PG_UP_TAG_0_PID_CPU	0x55555555	/* CPU aka "a9" aka "mpcore" */
41150c2493STom Warren #define PG_UP_TAG_0		0x0
42150c2493STom Warren 
43150c2493STom Warren #define CORESIGHT_UNLOCK	0xC5ACCE55;
44150c2493STom Warren 
45*b2871037STom Warren /* AP base physical address of internal SRAM */
46*b2871037STom Warren #define NV_PA_BASE_SRAM		0x40000000
47150c2493STom Warren 
48150c2493STom Warren #define EXCEP_VECTOR_CPU_RESET_VECTOR	(NV_PA_EVP_BASE + 0x100)
49150c2493STom Warren #define CSITE_CPU_DBG0_LAR		(NV_PA_CSITE_BASE + 0x10FB0)
50150c2493STom Warren #define CSITE_CPU_DBG1_LAR		(NV_PA_CSITE_BASE + 0x12FB0)
51150c2493STom Warren 
52150c2493STom Warren #define FLOW_CTLR_HALT_COP_EVENTS	(NV_PA_FLOW_BASE + 4)
53150c2493STom Warren #define FLOW_MODE_STOP			2
54150c2493STom Warren #define HALT_COP_EVENT_JTAG		(1 << 28)
55150c2493STom Warren #define HALT_COP_EVENT_IRQ_1		(1 << 11)
56150c2493STom Warren #define HALT_COP_EVENT_FIQ_1		(1 << 9)
57150c2493STom Warren 
58150c2493STom Warren /* This is the main entry into U-Boot, used by the Cortex-A9 */
59150c2493STom Warren extern void _start(void);
60150c2493STom Warren 
61150c2493STom Warren /**
62150c2493STom Warren  * Works out the SOC type used for clocks settings
63150c2493STom Warren  *
64150c2493STom Warren  * @return	SOC type - see TEGRA_SOC...
65150c2493STom Warren  */
66150c2493STom Warren int tegra_get_chip_type(void);
67