aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHao Wu <wuhaotsh@google.com>2021-03-11 10:08:54 -0800
committerPeter Maydell <peter.maydell@linaro.org>2021-03-12 12:50:36 +0000
commita9d3d7b17e5a3c246ecf4e420d2d4bb089a8d7c3 (patch)
tree381f44068835ea6639de67c10124e7f8316979a7 /include
parentfc11115f74b4355b38eeebc118e347cd74f35845 (diff)
downloadqemu-a9d3d7b17e5a3c246ecf4e420d2d4bb089a8d7c3.zip
qemu-a9d3d7b17e5a3c246ecf4e420d2d4bb089a8d7c3.tar.gz
qemu-a9d3d7b17e5a3c246ecf4e420d2d4bb089a8d7c3.tar.bz2
hw/arm: Connect PWM fans in NPCM7XX boards
This patch adds fan_splitters (split IRQs) in NPCM7XX boards. Each fan splitter corresponds to 1 PWM output and can connect to multiple fan inputs (MFT devices). In NPCM7XX boards(NPCM750 EVB and Quanta GSJ boards), we initializes these splitters and connect them to their corresponding modules according their specific device trees. Reviewed-by: Doug Evans <dje@google.com> Reviewed-by: Tyrone Ting <kfting@nuvoton.com> Signed-off-by: Hao Wu <wuhaotsh@google.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20210311180855.149764-5-wuhaotsh@google.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/hw/arm/npcm7xx.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/hw/arm/npcm7xx.h b/include/hw/arm/npcm7xx.h
index 3f70554..61ecc57 100644
--- a/include/hw/arm/npcm7xx.h
+++ b/include/hw/arm/npcm7xx.h
@@ -18,6 +18,7 @@
#include "hw/boards.h"
#include "hw/adc/npcm7xx_adc.h"
+#include "hw/core/split-irq.h"
#include "hw/cpu/a9mpcore.h"
#include "hw/gpio/npcm7xx_gpio.h"
#include "hw/i2c/npcm7xx_smbus.h"
@@ -48,8 +49,16 @@
#define NPCM7XX_GIC_CPU_IF_ADDR (0xf03fe100) /* GIC within A9 */
#define NPCM7XX_BOARD_SETUP_ADDR (0xffff1000) /* Boot ROM */
+#define NPCM7XX_NR_PWM_MODULES 2
+
typedef struct NPCM7xxMachine {
MachineState parent;
+ /*
+ * PWM fan splitter. each splitter connects to one PWM output and
+ * multiple MFT inputs.
+ */
+ SplitIRQ fan_splitter[NPCM7XX_NR_PWM_MODULES *
+ NPCM7XX_PWM_PER_MODULE];
} NPCM7xxMachine;
#define TYPE_NPCM7XX_MACHINE MACHINE_TYPE_NAME("npcm7xx")
@@ -82,7 +91,7 @@ typedef struct NPCM7xxState {
NPCM7xxCLKState clk;
NPCM7xxTimerCtrlState tim[3];
NPCM7xxADCState adc;
- NPCM7xxPWMState pwm[2];
+ NPCM7xxPWMState pwm[NPCM7XX_NR_PWM_MODULES];
NPCM7xxMFTState mft[8];
NPCM7xxOTPState key_storage;
NPCM7xxOTPState fuse_array;