xref: /qemu/include/hw/misc/aspeed_hace.h (revision 5cd7d8564a8b563da724b9e6264c967f0a091afa)
1c5475b3fSJoel Stanley /*
2c5475b3fSJoel Stanley  * ASPEED Hash and Crypto Engine
3c5475b3fSJoel Stanley  *
4c5475b3fSJoel Stanley  * Copyright (C) 2021 IBM Corp.
5c5475b3fSJoel Stanley  *
6c5475b3fSJoel Stanley  * SPDX-License-Identifier: GPL-2.0-or-later
7c5475b3fSJoel Stanley  */
8c5475b3fSJoel Stanley 
9c5475b3fSJoel Stanley #ifndef ASPEED_HACE_H
10c5475b3fSJoel Stanley #define ASPEED_HACE_H
11c5475b3fSJoel Stanley 
12c5475b3fSJoel Stanley #include "hw/sysbus.h"
13c5475b3fSJoel Stanley 
14c5475b3fSJoel Stanley #define TYPE_ASPEED_HACE "aspeed.hace"
15c5475b3fSJoel Stanley #define TYPE_ASPEED_AST2400_HACE TYPE_ASPEED_HACE "-ast2400"
16c5475b3fSJoel Stanley #define TYPE_ASPEED_AST2500_HACE TYPE_ASPEED_HACE "-ast2500"
17c5475b3fSJoel Stanley #define TYPE_ASPEED_AST2600_HACE TYPE_ASPEED_HACE "-ast2600"
18c5475b3fSJoel Stanley OBJECT_DECLARE_TYPE(AspeedHACEState, AspeedHACEClass, ASPEED_HACE)
19c5475b3fSJoel Stanley 
20c5475b3fSJoel Stanley #define ASPEED_HACE_NR_REGS (0x64 >> 2)
21*5cd7d856SSteven Lee #define ASPEED_HACE_MAX_SG  256 /* max number of entries */
22c5475b3fSJoel Stanley 
23c5475b3fSJoel Stanley struct AspeedHACEState {
24c5475b3fSJoel Stanley     SysBusDevice parent;
25c5475b3fSJoel Stanley 
26c5475b3fSJoel Stanley     MemoryRegion iomem;
27c5475b3fSJoel Stanley     qemu_irq irq;
28c5475b3fSJoel Stanley 
29*5cd7d856SSteven Lee     struct iovec iov_cache[ASPEED_HACE_MAX_SG];
30c5475b3fSJoel Stanley     uint32_t regs[ASPEED_HACE_NR_REGS];
31*5cd7d856SSteven Lee     uint32_t total_req_len;
32*5cd7d856SSteven Lee     uint32_t iov_count;
33c5475b3fSJoel Stanley 
34c5475b3fSJoel Stanley     MemoryRegion *dram_mr;
35c5475b3fSJoel Stanley     AddressSpace dram_as;
36c5475b3fSJoel Stanley };
37c5475b3fSJoel Stanley 
38c5475b3fSJoel Stanley 
39c5475b3fSJoel Stanley struct AspeedHACEClass {
40c5475b3fSJoel Stanley     SysBusDeviceClass parent_class;
41c5475b3fSJoel Stanley 
42c5475b3fSJoel Stanley     uint32_t src_mask;
43c5475b3fSJoel Stanley     uint32_t dest_mask;
441877069cSSteven Lee     uint32_t key_mask;
45c5475b3fSJoel Stanley     uint32_t hash_mask;
46c5475b3fSJoel Stanley };
47c5475b3fSJoel Stanley 
48c5475b3fSJoel Stanley #endif /* _ASPEED_HACE_H_ */
49