1e332fdc0SNinad Palsule /* 2e332fdc0SNinad Palsule * SPDX-License-Identifier: GPL-2.0-or-later 3e332fdc0SNinad Palsule * Copyright (C) 2024 IBM Corp. 4e332fdc0SNinad Palsule * 5e332fdc0SNinad Palsule * IBM Flexible Service Interface 6e332fdc0SNinad Palsule */ 7e332fdc0SNinad Palsule #ifndef FSI_FSI_H 8e332fdc0SNinad Palsule #define FSI_FSI_H 9e332fdc0SNinad Palsule 10e332fdc0SNinad Palsule #include "exec/memory.h" 11*f5e80be3SNinad Palsule #include "hw/qdev-core.h" 12*f5e80be3SNinad Palsule #include "hw/fsi/lbus.h" 13*f5e80be3SNinad Palsule #include "qemu/bitops.h" 14*f5e80be3SNinad Palsule 15*f5e80be3SNinad Palsule /* Bitwise operations at the word level. */ 16e332fdc0SNinad Palsule #define BE_GENMASK(hb, lb) MAKE_64BIT_MASK((lb), ((hb) - (lb) + 1)) 17e332fdc0SNinad Palsule 18e332fdc0SNinad Palsule #define TYPE_FSI_BUS "fsi.bus" 19e332fdc0SNinad Palsule OBJECT_DECLARE_SIMPLE_TYPE(FSIBus, FSI_BUS) 20e332fdc0SNinad Palsule 21e332fdc0SNinad Palsule typedef struct FSIBus { 22e332fdc0SNinad Palsule BusState bus; 23e332fdc0SNinad Palsule } FSIBus; 24e332fdc0SNinad Palsule 25 #define TYPE_FSI_SLAVE "fsi.slave" 26 OBJECT_DECLARE_SIMPLE_TYPE(FSISlaveState, FSI_SLAVE) 27 28 #define FSI_SLAVE_CONTROL_NR_REGS ((0x40 >> 2) + 1) 29 30 typedef struct FSISlaveState { 31 DeviceState parent; 32 33 MemoryRegion iomem; 34 uint32_t regs[FSI_SLAVE_CONTROL_NR_REGS]; 35 } FSISlaveState; 36 37 #endif /* FSI_FSI_H */ 38