1
2
3
4
5
6
7
8 #ifndef __BRCMSTB_AON_DEFS_H__
9 #define __BRCMSTB_AON_DEFS_H__
10
11 #include <linux/compiler.h>
12
13
14 #define BRCMSTB_S3_MAGIC_MASK 0xffff0000
15 #define BRCMSTB_S3_MAGIC_SHORT 0x5AFE0000
16
17 enum {
18
19 S3_FLAG_LOAD_RANDKEY = (1 << 0),
20
21
22 S3_FLAG_SCRATCH_BUFFER_TABLE = (1 << 1),
23
24
25 S3_FLAG_NO_MEM_VERIFY = (1 << 2),
26
27
28
29
30
31 S3_FLAG_PSCI_BOOT = (1 << 3),
32
33
34
35
36
37 S3_FLAG_BOOTED64 = (1 << 4),
38 };
39
40 #define BRCMSTB_HASH_LEN (128 / 8)
41
42 #define AON_REG_MAGIC_FLAGS 0x00
43 #define AON_REG_CONTROL_LOW 0x04
44 #define AON_REG_CONTROL_HIGH 0x08
45 #define AON_REG_S3_HASH 0x0c
46 #define AON_REG_CONTROL_HASH_LEN 0x1c
47 #define AON_REG_PANIC 0x20
48
49 #define BRCMSTB_S3_MAGIC 0x5AFEB007
50 #define BRCMSTB_PANIC_MAGIC 0x512E115E
51 #define BOOTLOADER_SCRATCH_SIZE 64
52 #define BRCMSTB_DTU_STATE_MAP_ENTRIES (8*1024)
53 #define BRCMSTB_DTU_CONFIG_ENTRIES (512)
54 #define BRCMSTB_DTU_COUNT (2)
55
56 #define IMAGE_DESCRIPTORS_BUFSIZE (2 * 1024)
57 #define S3_BOOTLOADER_RESERVED (S3_FLAG_PSCI_BOOT | S3_FLAG_BOOTED64)
58
59 struct brcmstb_bootloader_dtu_table {
60 uint32_t dtu_state_map[BRCMSTB_DTU_STATE_MAP_ENTRIES];
61 uint32_t dtu_config[BRCMSTB_DTU_CONFIG_ENTRIES];
62 };
63
64
65
66
67
68 struct brcmstb_s3_params {
69
70 uint8_t scratch[BOOTLOADER_SCRATCH_SIZE];
71
72 uint32_t magic;
73 uint64_t reentry;
74
75
76 uint32_t hash[BRCMSTB_HASH_LEN / 4];
77
78
79
80
81
82
83
84
85
86
87
88 uint32_t desc_offset_2;
89
90
91
92
93
94 uint64_t buffer_table;
95
96 uint32_t spare[70];
97
98 uint8_t descriptors[IMAGE_DESCRIPTORS_BUFSIZE];
99
100
101
102 struct brcmstb_bootloader_dtu_table dtu[BRCMSTB_DTU_COUNT];
103 } __packed;
104
105 #endif