Add emulation of MEN Chameleon Hardware
v2 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 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 | 297 ++++++++++++++++++++++++++++++++++++++++ hw/mcb/mcb.c | 182 ++++++++++++++++++++++++ hw/mcb/meson.build | 2 + hw/mcb/trace-events | 3 + hw/mcb/trace.h | 1 + hw/meson.build | 1 + hw/watchdog/Kconfig | 5 + hw/watchdog/meson.build | 1 + hw/watchdog/wdt_z069.c | 218 +++++++++++++++++++++++++++++ include/hw/mcb/mcb.h | 106 ++++++++++++++ meson.build | 1 + 17 files changed, 954 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
base-commit: 652737c8090eb3792f8b4c4b22ab12d7cc32073f
Signature · 1 line
2.39.2
PATCH v2 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 | 182 +++++++++++++++++++++++++++++++++++++++++++ hw/mcb/meson.build | 1 + hw/meson.build | 1 + include/hw/mcb/mcb.h | 106 +++++++++++++++++++++++++ 7 files changed, 299 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
@@ -1947,6 +1947,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 +182 -0
182 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
Re: [PATCH v2 1/4] Add MEN Chameleon Bus emulation
Quoted 7 lines · Johannes Thumshirn
The MEN Chameleon Bus (MCB) is an on-chip bus system exposing IP Cores of an FPGA to a outside bus system like PCIe.
Acked-by Alistair Francis <[email protected]>Signed-off-by Johannes Thumshirn <[email protected]>
hw/mcb/mcb.c line 8
Quoted 8 lines
hw/mcb/mcb.c new file +8
-0@@ -0,0 +1,182 @@ +/* +* QEMU MEN Chameleon Bus emulation +* +* Copyright (C) 2023 Johannes Thumshirn <[email protected]> +* +* This work is licensed under the terms of the GNU GPL, version 2. See +* the COPYING file in the top-level directory. +*/
Really version-2-only? We prefer 2-or-later, as noted in LICENSE...
thanks
-- PMM
Re: [PATCH v2 1/4] Add MEN Chameleon Bus emulation
Quoted 19 lines · Peter Maydell
Quoted 7 lines · Johannes Thumshirn
The MEN Chameleon Bus (MCB) is an on-chip bus system exposing IP Cores of an FPGA to a outside bus system like PCIe.
Acked-by Alistair Francis <[email protected]>Signed-off-by Johannes Thumshirn <[email protected]>hw/mcb/mcb.c line 8
Quoted 8 lines
hw/mcb/mcb.c new file +8
-0@@ -0,0 +1,182 @@ +/* +* QEMU MEN Chameleon Bus emulation +* +* Copyright (C) 2023 Johannes Thumshirn <[email protected]> +* +* This work is licensed under the terms of the GNU GPL, version 2. See +* the COPYING file in the top-level directory. +*/ Really version-2-only? We prefer 2-or-later, as noted in LICENSE...
Quoted 2 lines
thanks
-- PMM
Sure will do.
PATCH v2 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 | 297 ++++++++++++++++++++++++++++++++++++++++++++ hw/mcb/meson.build | 1 + hw/mcb/trace-events | 3 + hw/mcb/trace.h | 1 + meson.build | 1 + 6 files changed, 309 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 +297 -0
297 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 +3 -0
@@ -0,0 +1,3 @@ +# 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
hw/mcb/trace.h new file +1 -0
@@ -0,0 +1 @@ +#include "trace/trace-hw_mcb.h"
meson.build +1 -0
@@ -2986,6 +2986,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 v2 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 v2 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/wdt_z069.c | 218 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 224 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/wdt_z069.c new file +218 -0
218 lines not on this page · raw message
Signature · 1 line
2.39.2