mirror of
https://github.com/qemu/qemu.git
synced 2024-12-17 09:13:44 +08:00
119df56bf0
Aspeed 2600 SDK enables I3C support by default. The I3C driver will try to reset the device controller and set it up through device address table register. This dummy model responds to these registers with default values as listed in the ast2600v10 datasheet chapter 54.2. This avoids a guest machine kernel panic due to referencing an invalid kernel address if the device address table register isn't set correctly. Signed-off-by: Troy Lee <troy_lee@aspeedtech.com> Reviewed-by: Graeme Gregory <quic_ggregory@quicinc.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Tested-by: Graeme Gregory <quic_ggregory@quicinc.com> Message-id: 20220111084546.4145785-2-troy_lee@aspeedtech.com [PMM: tidied commit message; fixed format strings] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
49 lines
1.1 KiB
C
49 lines
1.1 KiB
C
/*
|
|
* ASPEED I3C Controller
|
|
*
|
|
* Copyright (C) 2021 ASPEED Technology Inc.
|
|
*
|
|
* This code is licensed under the GPL version 2 or later. See
|
|
* the COPYING file in the top-level directory.
|
|
*/
|
|
|
|
#ifndef ASPEED_I3C_H
|
|
#define ASPEED_I3C_H
|
|
|
|
#include "hw/sysbus.h"
|
|
|
|
#define TYPE_ASPEED_I3C "aspeed.i3c"
|
|
#define TYPE_ASPEED_I3C_DEVICE "aspeed.i3c.device"
|
|
OBJECT_DECLARE_TYPE(AspeedI3CState, AspeedI3CClass, ASPEED_I3C)
|
|
|
|
#define ASPEED_I3C_NR_REGS (0x70 >> 2)
|
|
#define ASPEED_I3C_DEVICE_NR_REGS (0x300 >> 2)
|
|
#define ASPEED_I3C_NR_DEVICES 6
|
|
|
|
OBJECT_DECLARE_SIMPLE_TYPE(AspeedI3CDevice, ASPEED_I3C_DEVICE)
|
|
typedef struct AspeedI3CDevice {
|
|
/* <private> */
|
|
SysBusDevice parent;
|
|
|
|
/* <public> */
|
|
MemoryRegion mr;
|
|
qemu_irq irq;
|
|
|
|
uint8_t id;
|
|
uint32_t regs[ASPEED_I3C_DEVICE_NR_REGS];
|
|
} AspeedI3CDevice;
|
|
|
|
typedef struct AspeedI3CState {
|
|
/* <private> */
|
|
SysBusDevice parent;
|
|
|
|
/* <public> */
|
|
MemoryRegion iomem;
|
|
MemoryRegion iomem_container;
|
|
qemu_irq irq;
|
|
|
|
uint32_t regs[ASPEED_I3C_NR_REGS];
|
|
AspeedI3CDevice devices[ASPEED_I3C_NR_DEVICES];
|
|
} AspeedI3CState;
|
|
#endif /* ASPEED_I3C_H */
|