diff options
author | Peter Maydell | 2021-02-15 12:51:19 +0100 |
---|---|---|
committer | Peter Maydell | 2021-03-06 14:30:38 +0100 |
commit | e8556f435eee97d508b58c06c156990d537823ab (patch) | |
tree | cc136f29cedb83c9181aac191e0939f73155a1ed /include/hw/misc/mps2-fpgaio.h | |
parent | hw/arm/mps2-tz: Make the OSCCLK settings be configurable per-board (diff) | |
download | qemu-e8556f435eee97d508b58c06c156990d537823ab.tar.gz qemu-e8556f435eee97d508b58c06c156990d537823ab.tar.xz qemu-e8556f435eee97d508b58c06c156990d537823ab.zip |
hw/misc/mps2-fpgaio: Make number of LEDs configurable by board
The MPS2 board has 2 LEDs, but the MPS3 board has 10 LEDs. The
FPGAIO device is similar on both sets of boards, but the LED0
register has correspondingly more bits that have an effect. Add a
device property for number of LEDs.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20210215115138.20465-6-peter.maydell@linaro.org
Diffstat (limited to 'include/hw/misc/mps2-fpgaio.h')
-rw-r--r-- | include/hw/misc/mps2-fpgaio.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/hw/misc/mps2-fpgaio.h b/include/hw/misc/mps2-fpgaio.h index a010fdb2b6..bfe73134e7 100644 --- a/include/hw/misc/mps2-fpgaio.h +++ b/include/hw/misc/mps2-fpgaio.h @@ -28,13 +28,16 @@ #define TYPE_MPS2_FPGAIO "mps2-fpgaio" OBJECT_DECLARE_SIMPLE_TYPE(MPS2FPGAIO, MPS2_FPGAIO) +#define MPS2FPGAIO_MAX_LEDS 32 + struct MPS2FPGAIO { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ MemoryRegion iomem; - LEDState *led[2]; + LEDState *led[MPS2FPGAIO_MAX_LEDS]; + uint32_t num_leds; uint32_t led0; uint32_t prescale; |