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" 18e056c522SSteven Lee #define TYPE_ASPEED_AST1030_HACE TYPE_ASPEED_HACE "-ast1030" 19e056c522SSteven Lee 20c5475b3fSJoel Stanley OBJECT_DECLARE_TYPE(AspeedHACEState, AspeedHACEClass, ASPEED_HACE) 21c5475b3fSJoel Stanley 22c5475b3fSJoel Stanley #define ASPEED_HACE_NR_REGS (0x64 >> 2) 235cd7d856SSteven Lee #define ASPEED_HACE_MAX_SG 256 /* max number of entries */ 24c5475b3fSJoel Stanley 25c5475b3fSJoel Stanley struct AspeedHACEState { 26c5475b3fSJoel Stanley SysBusDevice parent; 27c5475b3fSJoel Stanley 28c5475b3fSJoel Stanley MemoryRegion iomem; 29c5475b3fSJoel Stanley qemu_irq irq; 30c5475b3fSJoel Stanley 315cd7d856SSteven Lee struct iovec iov_cache[ASPEED_HACE_MAX_SG]; 32c5475b3fSJoel Stanley uint32_t regs[ASPEED_HACE_NR_REGS]; 335cd7d856SSteven Lee uint32_t total_req_len; 345cd7d856SSteven Lee uint32_t iov_count; 35c5475b3fSJoel Stanley 36c5475b3fSJoel Stanley MemoryRegion *dram_mr; 37c5475b3fSJoel Stanley AddressSpace dram_as; 38c5475b3fSJoel Stanley }; 39c5475b3fSJoel Stanley 40c5475b3fSJoel Stanley 41c5475b3fSJoel Stanley struct AspeedHACEClass { 42c5475b3fSJoel Stanley SysBusDeviceClass parent_class; 43c5475b3fSJoel Stanley 44c5475b3fSJoel Stanley uint32_t src_mask; 45c5475b3fSJoel Stanley uint32_t dest_mask; 461877069cSSteven Lee uint32_t key_mask; 47c5475b3fSJoel Stanley uint32_t hash_mask; 48c5475b3fSJoel Stanley }; 49c5475b3fSJoel Stanley 50*ea9cea93SMarkus Armbruster #endif /* ASPEED_HACE_H */ 51