aboutsummaryrefslogtreecommitdiff
path: root/include/hw/misc/aspeed_sbc.h
blob: 405e6782b97a0c2018fc52f5ea1bb1c389c3603a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
 * ASPEED Secure Boot Controller
 *
 * Copyright (C) 2021-2022 IBM Corp.
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef ASPEED_SBC_H
#define ASPEED_SBC_H

#include "hw/sysbus.h"

#define TYPE_ASPEED_SBC "aspeed.sbc"
#define TYPE_ASPEED_AST2600_SBC TYPE_ASPEED_SBC "-ast2600"
OBJECT_DECLARE_TYPE(AspeedSBCState, AspeedSBCClass, ASPEED_SBC)

#define ASPEED_SBC_NR_REGS (0x93c >> 2)

#define QSR_AES                     BIT(27)
#define QSR_RSA1024                 (0x0 << 12)
#define QSR_RSA2048                 (0x1 << 12)
#define QSR_RSA3072                 (0x2 << 12)
#define QSR_RSA4096                 (0x3 << 12)
#define QSR_SHA224                  (0x0 << 10)
#define QSR_SHA256                  (0x1 << 10)
#define QSR_SHA384                  (0x2 << 10)
#define QSR_SHA512                  (0x3 << 10)

struct AspeedSBCState {
    SysBusDevice parent;

    bool emmc_abr;
    uint32_t signing_settings;

    MemoryRegion iomem;

    uint32_t regs[ASPEED_SBC_NR_REGS];
};

struct AspeedSBCClass {
    SysBusDeviceClass parent_class;
};

#endif /* ASPEED_SBC_H */