mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00

This fixes the intended protection of read-only values in the configuration register. They were being always set to zero by mistake. The read-only fields depend on the configured memory size of the system, so they cannot be fixed at compile time. The most straight forward option was to store them in the state structure. Signed-off-by: Joel Stanley <joel@jms.id.au> Reviewed-by: Cédric Le Goater <clg@kaod.org> Tested-by: Cédric Le Goater <clg@kaod.org> Message-id: 20180807075757.7242-3-joel@jms.id.au Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
34 lines
733 B
C
34 lines
733 B
C
/*
|
|
* ASPEED SDRAM Memory Controller
|
|
*
|
|
* Copyright (C) 2016 IBM Corp.
|
|
*
|
|
* This code is licensed under the GPL version 2 or later. See the
|
|
* COPYING file in the top-level directory.
|
|
*/
|
|
#ifndef ASPEED_SDMC_H
|
|
#define ASPEED_SDMC_H
|
|
|
|
#include "hw/sysbus.h"
|
|
|
|
#define TYPE_ASPEED_SDMC "aspeed.sdmc"
|
|
#define ASPEED_SDMC(obj) OBJECT_CHECK(AspeedSDMCState, (obj), TYPE_ASPEED_SDMC)
|
|
|
|
#define ASPEED_SDMC_NR_REGS (0x174 >> 2)
|
|
|
|
typedef struct AspeedSDMCState {
|
|
/*< private >*/
|
|
SysBusDevice parent_obj;
|
|
|
|
/*< public >*/
|
|
MemoryRegion iomem;
|
|
|
|
uint32_t regs[ASPEED_SDMC_NR_REGS];
|
|
uint32_t silicon_rev;
|
|
uint32_t ram_bits;
|
|
uint64_t ram_size;
|
|
uint32_t fixed_conf;
|
|
|
|
} AspeedSDMCState;
|
|
|
|
#endif /* ASPEED_SDMC_H */
|