mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-31 06:13:53 -06:00

According to the AST2700 design, the data source address is 64-bit, with R_HASH_SRC_HI storing bits [63:32] and R_HASH_SRC storing bits [31:0]. Similarly, the digest address is 64-bit, with R_HASH_DEST_HI storing bits [63:32] and R_HASH_DEST storing bits [31:0]. To maintain compatibility with older SoCs such as the AST2600, the AST2700 HW automatically set bit 34 of the 64-bit sg_addr. As a result, the firmware only needs to provide a 32-bit sg_addr containing bits [31:0]. This is sufficient for the AST2700, as it uses a DRAM offset rather than a DRAM address. Introduce a has_dma64 class attribute and set it to true for the AST2700. Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Link: https://lore.kernel.org/qemu-devel/20250515081008.583578-15-jamin_lin@aspeedtech.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
59 lines
1.3 KiB
C
59 lines
1.3 KiB
C
/*
|
|
* ASPEED Hash and Crypto Engine
|
|
*
|
|
* Copyright (c) 2024 Seagate Technology LLC and/or its Affiliates
|
|
* 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"
|
|
#include "crypto/hash.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"
|
|
#define TYPE_ASPEED_AST1030_HACE TYPE_ASPEED_HACE "-ast1030"
|
|
#define TYPE_ASPEED_AST2700_HACE TYPE_ASPEED_HACE "-ast2700"
|
|
|
|
OBJECT_DECLARE_TYPE(AspeedHACEState, AspeedHACEClass, ASPEED_HACE)
|
|
|
|
#define ASPEED_HACE_MAX_SG 256 /* max number of entries */
|
|
|
|
struct AspeedHACEState {
|
|
SysBusDevice parent;
|
|
|
|
MemoryRegion iomem;
|
|
qemu_irq irq;
|
|
|
|
uint32_t *regs;
|
|
uint32_t total_req_len;
|
|
|
|
MemoryRegion *dram_mr;
|
|
AddressSpace dram_as;
|
|
|
|
QCryptoHash *hash_ctx;
|
|
};
|
|
|
|
|
|
struct AspeedHACEClass {
|
|
SysBusDeviceClass parent_class;
|
|
|
|
const MemoryRegionOps *reg_ops;
|
|
uint32_t src_mask;
|
|
uint32_t dest_mask;
|
|
uint32_t key_mask;
|
|
uint32_t hash_mask;
|
|
uint64_t nr_regs;
|
|
bool raise_crypt_interrupt_workaround;
|
|
uint32_t src_hi_mask;
|
|
uint32_t dest_hi_mask;
|
|
uint32_t key_hi_mask;
|
|
bool has_dma64;
|
|
};
|
|
|
|
#endif /* ASPEED_HACE_H */
|