Add emulation of MEN Chameleon Hardware
v4 cover Add emulation of MEN Chameleon Hardware
Add emulation of MEN Chameleon Hardware to Qemu.
This emulation is specifically designed to test the upstream Linux kernel drivers when one has no access to the hardware.
The emulation consists of the bus itself, a PCI hardware target creating the bus, MEN Micro Electronic's 8250 based UART via MCB and a watchdog timer.
Changes since v2:
- Converted DPRINTF() to tracing infrastructure again (Alistair)
Changes since v2:
- Adjusted license to GPL 2 or later (Peter)
Changes since v1:
- Converted DPRINTF() to tracing infrastructure (Alistair)
- Fixed style issues (Alistair)
Johannes Thumshirn (4):
Add MEN Chameleon Bus emulation
Add MEN Chameleon Bus via PCI carrier
serial-mcb: Add serial via MEN chameleon bus
wdt_z069: Add support for MEN 16z069 Watchdog
MAINTAINERS | 6 + hw/Kconfig | 1 + hw/char/Kconfig | 6 + hw/char/meson.build | 1 + hw/char/serial-mcb.c | 115 +++++++++++++++ hw/mcb/Kconfig | 8 ++ hw/mcb/mcb-pci.c | 298 +++++++++++++++++++++++++++++++++++++++ hw/mcb/mcb.c | 180 +++++++++++++++++++++++ hw/mcb/meson.build | 2 + hw/mcb/trace-events | 4 + hw/mcb/trace.h | 1 + hw/meson.build | 1 + hw/watchdog/Kconfig | 5 + hw/watchdog/meson.build | 1 + hw/watchdog/trace-events | 6 + hw/watchdog/wdt_z069.c | 207 +++++++++++++++++++++++++++ include/hw/mcb/mcb.h | 106 ++++++++++++++ meson.build | 1 + 18 files changed, 949 insertions(+) create mode 100644 hw/char/serial-mcb.c create mode 100644 hw/mcb/Kconfig create mode 100644 hw/mcb/mcb-pci.c create mode 100644 hw/mcb/mcb.c create mode 100644 hw/mcb/meson.build create mode 100644 hw/mcb/trace-events create mode 100644 hw/mcb/trace.h create mode 100644 hw/watchdog/wdt_z069.c create mode 100644 include/hw/mcb/mcb.h
Signature · 1 line
2.39.2
PATCH v4 1/4 Add MEN Chameleon Bus emulation
The MEN Chameleon Bus (MCB) is an on-chip bus system exposing IP Cores of an FPGA to a outside bus system like PCIe.
--- MAINTAINERS | 6 ++ hw/Kconfig | 1 + hw/mcb/Kconfig | 2 + hw/mcb/mcb.c | 180 +++++++++++++++++++++++++++++++++++++++++++ hw/mcb/meson.build | 1 + hw/meson.build | 1 + include/hw/mcb/mcb.h | 106 +++++++++++++++++++++++++ 7 files changed, 297 insertions(+) create mode 100644 hw/mcb/Kconfig create mode 100644 hw/mcb/mcb.c create mode 100644 hw/mcb/meson.build create mode 100644 include/hw/mcb/mcb.h
MAINTAINERS +6 -0
@@ -1962,6 +1962,12 @@ R: Paolo Bonzini <[email protected]> S: Odd Fixes F: hw/char/ +MEN Chameleon Bus +M: Johannes Thumshirn <[email protected]> +S: Maintained +F: hw/mcb/ +F: include/hw/mcb/ + Network devices M: Jason Wang <[email protected]> S: Odd Fixes
hw/Kconfig +1 -0
@@ -18,6 +18,7 @@ source intc/Kconfig source ipack/Kconfig source ipmi/Kconfig source isa/Kconfig +source mcb/Kconfig source mem/Kconfig source misc/Kconfig source net/Kconfig
hw/mcb/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config MCB + bool
hw/mcb/mcb.c new file +180 -0
180 lines not on this page · raw message
hw/mcb/meson.build new file +1 -0
@@ -0,0 +1 @@ +softmmu_ss.add(when: 'CONFIG_MCB', if_true: files('mcb.c'))
hw/meson.build +1 -0
@@ -18,6 +18,7 @@ subdir('intc') subdir('ipack') subdir('ipmi') subdir('isa') +subdir('mcb') subdir('mem') subdir('misc') subdir('net')
include/hw/mcb/mcb.h new file +106 -0
106 lines not on this page · raw message
Signature · 1 line
2.39.2
PATCH v4 2/4 Add MEN Chameleon Bus via PCI carrier
In reply to Johannes ThumshirnAdd PCI based MEN Chameleon Bus carrier emulation.
--- hw/mcb/Kconfig | 6 + hw/mcb/mcb-pci.c | 298 ++++++++++++++++++++++++++++++++++++++++++++ hw/mcb/meson.build | 1 + hw/mcb/trace-events | 4 + hw/mcb/trace.h | 1 + meson.build | 1 + 6 files changed, 311 insertions(+) create mode 100644 hw/mcb/mcb-pci.c create mode 100644 hw/mcb/trace-events create mode 100644 hw/mcb/trace.h
hw/mcb/Kconfig +6 -0
@@ -1,2 +1,8 @@ config MCB bool + +config MCB_PCI + bool + default y if PCI_DEVICES + depends on PCI + select MCB
hw/mcb/mcb-pci.c new file +298 -0
298 lines not on this page · raw message
hw/mcb/meson.build +1 -0
@@ -1 +1,2 @@ softmmu_ss.add(when: 'CONFIG_MCB', if_true: files('mcb.c')) +softmmu_ss.add(when: 'CONFIG_MCB_PCI', if_true: files('mcb-pci.c'))
hw/mcb/trace-events new file +4 -0
@@ -0,0 +1,4 @@ +# mcb-pci.c +mpci_chamtbl_read(unsigned long addr, unsigned int size) "read from address 0x%lx size %d" +mpci_chamtbl_write(unsigned long addr, uint64_t val) "invalid write to 0x%lx: 0x%" PRIx64 +mpci_set_irq(int intno, int level) "set IRQ #%d (level=%d)"
hw/mcb/trace.h new file +1 -0
@@ -0,0 +1 @@ +#include "trace/trace-hw_mcb.h"
meson.build +1 -0
@@ -2990,6 +2990,7 @@ if have_system 'hw/input', 'hw/intc', 'hw/isa', + 'hw/mcb', 'hw/mem', 'hw/mips', 'hw/misc',
Signature · 1 line
2.39.2
PATCH v4 3/4 serial-mcb: Add serial via MEN chameleon bus
In reply to Johannes ThumshirnAdd MEN z125 UART over MEN Chameleon Bus emulation.
--- hw/char/Kconfig | 6 +++ hw/char/meson.build | 1 + hw/char/serial-mcb.c | 115 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 122 insertions(+) create mode 100644 hw/char/serial-mcb.c
hw/char/Kconfig +6 -0
@@ -71,3 +71,9 @@ config GOLDFISH_TTY config SHAKTI_UART bool + +config SERIAL_MCB + bool + default y if MCB + depends on MCB + select SERIAL
hw/char/meson.build +1 -0
@@ -20,6 +20,7 @@ softmmu_ss.add(when: 'CONFIG_SHAKTI_UART', if_true: files('shakti_uart.c')) softmmu_ss.add(when: 'CONFIG_VIRTIO_SERIAL', if_true: files('virtio-console.c')) softmmu_ss.add(when: 'CONFIG_XEN_BUS', if_true: files('xen_console.c')) softmmu_ss.add(when: 'CONFIG_XILINX', if_true: files('xilinx_uartlite.c')) +softmmu_ss.add(when: 'CONFIG_SERIAL_MCB', if_true: files('serial-mcb.c')) softmmu_ss.add(when: 'CONFIG_AVR_USART', if_true: files('avr_usart.c')) softmmu_ss.add(when: 'CONFIG_COLDFIRE', if_true: files('mcf_uart.c'))
hw/char/serial-mcb.c new file +115 -0
115 lines not on this page · raw message
Signature · 1 line
2.39.2
PATCH v4 4/4 wdt_z069: Add support for MEN 16z069 Watchdog
In reply to Johannes ThumshirnAdd 16z069 Watchdog over MEN Chameleon BUS emulation.
--- hw/watchdog/Kconfig | 5 + hw/watchdog/meson.build | 1 + hw/watchdog/trace-events | 6 ++ hw/watchdog/wdt_z069.c | 207 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 219 insertions(+) create mode 100644 hw/watchdog/wdt_z069.c
hw/watchdog/Kconfig +5 -0
@@ -20,3 +20,8 @@ config WDT_IMX2 config WDT_SBSA bool + +config WDT_Z069 + bool + default y if MCB + depends on MCB
hw/watchdog/meson.build +1 -0
@@ -6,4 +6,5 @@ softmmu_ss.add(when: 'CONFIG_WDT_DIAG288', if_true: files('wdt_diag288.c')) softmmu_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files('wdt_aspeed.c')) softmmu_ss.add(when: 'CONFIG_WDT_IMX2', if_true: files('wdt_imx2.c')) softmmu_ss.add(when: 'CONFIG_WDT_SBSA', if_true: files('sbsa_gwdt.c')) +softmmu_ss.add(when: 'CONFIG_WDT_Z069', if_true: files('wdt_z069.c')) specific_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr_watchdog.c'))
hw/watchdog/trace-events +6 -0
@@ -17,6 +17,12 @@ spapr_watchdog_query(uint64_t caps) "caps=0x%" PRIx64 spapr_watchdog_query_lpm(uint64_t caps) "caps=0x%" PRIx64 spapr_watchdog_expired(uint64_t num, unsigned action) "num=%" PRIu64 " action=%u" +# wdt_z069.c +men_z069_wdt_enable(unsigned int timeout) "next timeout will fire in +%dms" +men_z069_wdt_write_wtr(uint16_t tout, uint16_t t, unsigned int timeout) "new timeout: %u (0x%x) %u" +men_z069_wdt_write_wvr(uint16_t wvr, unsigned int timeout) "watchdog triggered (wvr=0x%x), next timeout will fire in +%dms" +men_z069_wdt_read(unsigned long addr, int size, uint64_t ret) "addr=0x%lx, size=%d, ret=0x%" PRIx64 + # watchdog.c watchdog_perform_action(unsigned int action) "action=%u" watchdog_set_action(unsigned int action) "action=%u"
hw/watchdog/wdt_z069.c new file +207 -0
207 lines not on this page · raw message
Signature · 1 line
2.39.2