pmc.h 1.75 KB
Newer Older
1
/*
2
 * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
3
 *
dp-arm's avatar
dp-arm committed
4
 * SPDX-License-Identifier: BSD-3-Clause
5
6
 */

7
8
#ifndef PMC_H
#define PMC_H
9

10
11
#include <lib/mmio.h>
#include <lib/utils_def.h>
12
#include <stdbool.h>
13

14
15
#include <tegra_def.h>

16
#define PMC_CONFIG				U(0x0)
17
#define PMC_IO_DPD_SAMPLE			U(0x20)
18
#define PMC_DPD_ENABLE_0			U(0x24)
19
20
#define PMC_PWRGATE_STATUS			U(0x38)
#define PMC_PWRGATE_TOGGLE			U(0x30)
21
22
23
#define PMC_SECURE_SCRATCH0			U(0xb0)
#define PMC_SECURE_SCRATCH5			U(0xc4)
#define PMC_CRYPTO_OP_0				U(0xf4)
24
25
#define  PMC_TOGGLE_START			U(0x100)
#define PMC_SCRATCH39				U(0x138)
26
#define PMC_SCRATCH41 				U(0x140)
27
28
#define PMC_SECURE_SCRATCH6			U(0x224)
#define PMC_SECURE_SCRATCH7			U(0x228)
29
30
#define PMC_SECURE_DISABLE2			U(0x2c4)
#define  PMC_SECURE_DISABLE2_WRITE22_ON		(U(1) << 28)
31
32
33
#define PMC_SECURE_SCRATCH8			U(0x300)
#define PMC_SECURE_SCRATCH79			U(0x41c)
#define PMC_FUSE_CONTROL_0			U(0x450)
34
35
36
37
38
39
#define PMC_SECURE_SCRATCH22			U(0x338)
#define PMC_SECURE_DISABLE3			U(0x2d8)
#define  PMC_SECURE_DISABLE3_WRITE34_ON		(U(1) << 20)
#define  PMC_SECURE_DISABLE3_WRITE35_ON		(U(1) << 22)
#define PMC_SECURE_SCRATCH34			U(0x368)
#define PMC_SECURE_SCRATCH35			U(0x36c)
40
41
#define PMC_SECURE_SCRATCH80			U(0xa98)
#define PMC_SECURE_SCRATCH119			U(0xb34)
42
#define PMC_SCRATCH201				U(0x844)
43
44
45
46
47
48
49
50
51
52
53

static inline uint32_t tegra_pmc_read_32(uint32_t off)
{
	return mmio_read_32(TEGRA_PMC_BASE + off);
}

static inline void tegra_pmc_write_32(uint32_t off, uint32_t val)
{
	mmio_write_32(TEGRA_PMC_BASE + off, val);
}

54
void tegra_pmc_cpu_on(int32_t cpu);
55
void tegra_pmc_cpu_setup(uint64_t reset_addr);
56
bool tegra_pmc_is_last_on_cpu(void);
57
void tegra_pmc_lock_cpu_vectors(void);
58
void tegra_pmc_resume(void);
59
60
__dead2 void tegra_pmc_system_reset(void);

61
#endif /* PMC_H */