0001
0002
0003
0004
0005
0006
0007
0008 #ifndef __BRCMSTB_AON_DEFS_H__
0009 #define __BRCMSTB_AON_DEFS_H__
0010
0011 #include <linux/compiler.h>
0012
0013
0014 #define BRCMSTB_S3_MAGIC_MASK 0xffff0000
0015 #define BRCMSTB_S3_MAGIC_SHORT 0x5AFE0000
0016
0017 enum {
0018
0019 S3_FLAG_LOAD_RANDKEY = (1 << 0),
0020
0021
0022 S3_FLAG_SCRATCH_BUFFER_TABLE = (1 << 1),
0023
0024
0025 S3_FLAG_NO_MEM_VERIFY = (1 << 2),
0026
0027
0028
0029
0030
0031 S3_FLAG_PSCI_BOOT = (1 << 3),
0032
0033
0034
0035
0036
0037 S3_FLAG_BOOTED64 = (1 << 4),
0038 };
0039
0040 #define BRCMSTB_HASH_LEN (128 / 8)
0041
0042 #define AON_REG_MAGIC_FLAGS 0x00
0043 #define AON_REG_CONTROL_LOW 0x04
0044 #define AON_REG_CONTROL_HIGH 0x08
0045 #define AON_REG_S3_HASH 0x0c
0046 #define AON_REG_CONTROL_HASH_LEN 0x1c
0047 #define AON_REG_PANIC 0x20
0048
0049 #define BRCMSTB_S3_MAGIC 0x5AFEB007
0050 #define BRCMSTB_PANIC_MAGIC 0x512E115E
0051 #define BOOTLOADER_SCRATCH_SIZE 64
0052 #define BRCMSTB_DTU_STATE_MAP_ENTRIES (8*1024)
0053 #define BRCMSTB_DTU_CONFIG_ENTRIES (512)
0054 #define BRCMSTB_DTU_COUNT (2)
0055
0056 #define IMAGE_DESCRIPTORS_BUFSIZE (2 * 1024)
0057 #define S3_BOOTLOADER_RESERVED (S3_FLAG_PSCI_BOOT | S3_FLAG_BOOTED64)
0058
0059 struct brcmstb_bootloader_dtu_table {
0060 uint32_t dtu_state_map[BRCMSTB_DTU_STATE_MAP_ENTRIES];
0061 uint32_t dtu_config[BRCMSTB_DTU_CONFIG_ENTRIES];
0062 };
0063
0064
0065
0066
0067
0068 struct brcmstb_s3_params {
0069
0070 uint8_t scratch[BOOTLOADER_SCRATCH_SIZE];
0071
0072 uint32_t magic;
0073 uint64_t reentry;
0074
0075
0076 uint32_t hash[BRCMSTB_HASH_LEN / 4];
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088 uint32_t desc_offset_2;
0089
0090
0091
0092
0093
0094 uint64_t buffer_table;
0095
0096 uint32_t spare[70];
0097
0098 uint8_t descriptors[IMAGE_DESCRIPTORS_BUFSIZE];
0099
0100
0101
0102 struct brcmstb_bootloader_dtu_table dtu[BRCMSTB_DTU_COUNT];
0103 } __packed;
0104
0105 #endif