2021-05-01 11:03:51 +03:00
|
|
|
/*
|
|
|
|
* ASPEED Hash and Crypto Engine
|
|
|
|
*
|
|
|
|
* Copyright (C) 2021 IBM Corp.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ASPEED_HACE_H
|
|
|
|
#define ASPEED_HACE_H
|
|
|
|
|
|
|
|
#include "hw/sysbus.h"
|
|
|
|
|
|
|
|
#define TYPE_ASPEED_HACE "aspeed.hace"
|
|
|
|
#define TYPE_ASPEED_AST2400_HACE TYPE_ASPEED_HACE "-ast2400"
|
|
|
|
#define TYPE_ASPEED_AST2500_HACE TYPE_ASPEED_HACE "-ast2500"
|
|
|
|
#define TYPE_ASPEED_AST2600_HACE TYPE_ASPEED_HACE "-ast2600"
|
2022-05-03 05:27:10 +03:00
|
|
|
#define TYPE_ASPEED_AST1030_HACE TYPE_ASPEED_HACE "-ast1030"
|
|
|
|
|
2021-05-01 11:03:51 +03:00
|
|
|
OBJECT_DECLARE_TYPE(AspeedHACEState, AspeedHACEClass, ASPEED_HACE)
|
|
|
|
|
|
|
|
#define ASPEED_HACE_NR_REGS (0x64 >> 2)
|
2022-05-02 18:03:04 +03:00
|
|
|
#define ASPEED_HACE_MAX_SG 256 /* max number of entries */
|
2021-05-01 11:03:51 +03:00
|
|
|
|
|
|
|
struct AspeedHACEState {
|
|
|
|
SysBusDevice parent;
|
|
|
|
|
|
|
|
MemoryRegion iomem;
|
|
|
|
qemu_irq irq;
|
|
|
|
|
2022-05-02 18:03:04 +03:00
|
|
|
struct iovec iov_cache[ASPEED_HACE_MAX_SG];
|
2021-05-01 11:03:51 +03:00
|
|
|
uint32_t regs[ASPEED_HACE_NR_REGS];
|
2022-05-02 18:03:04 +03:00
|
|
|
uint32_t total_req_len;
|
|
|
|
uint32_t iov_count;
|
2021-05-01 11:03:51 +03:00
|
|
|
|
|
|
|
MemoryRegion *dram_mr;
|
|
|
|
AddressSpace dram_as;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct AspeedHACEClass {
|
|
|
|
SysBusDeviceClass parent_class;
|
|
|
|
|
|
|
|
uint32_t src_mask;
|
|
|
|
uint32_t dest_mask;
|
2022-05-02 18:03:04 +03:00
|
|
|
uint32_t key_mask;
|
2021-05-01 11:03:51 +03:00
|
|
|
uint32_t hash_mask;
|
|
|
|
};
|
|
|
|
|
2022-05-06 16:49:11 +03:00
|
|
|
#endif /* ASPEED_HACE_H */
|