Re: [PATCH] qtest/npcm7xx_pwm-test: Fix memleak in pwm_qom_get

2021-01-15 Thread Havard Skinnemoen via
+Hao Wu On Fri, Jan 15, 2021 at 1:15 AM Philippe Mathieu-Daudé wrote: > > On 1/15/21 8:56 AM, Gan Qixin wrote: > > The pwm_qom_get function didn't free "response", which caused an indirect > > memory leak. So use qobject_unref() to fix it. > > > > ASAN shows memory leak stack: > > > > Indirect le

Re: [PATCH 0/9] hw/block: m25p80: Fix the mess of dummy bytes needed for fast read commands

2021-01-14 Thread Havard Skinnemoen via
Hi Bin, On Thu, Jan 14, 2021 at 6:08 PM Bin Meng wrote: > > Hi Francisco, > > On Fri, Jan 15, 2021 at 2:13 AM Francisco Iglesias > wrote: > > > > Hi Bin, > > > > On [2021 Jan 14] Thu 23:08:53, Bin Meng wrote: > > > From: Bin Meng > > > > > > The m25p80 model uses s->needed_bytes to indicate how

Re: [PATCH 9/9] hw/ssi: npcm7xx_fiu: Correct the dummy cycle emulation logic

2021-01-14 Thread Havard Skinnemoen via
On Thu, Jan 14, 2021 at 7:10 AM Bin Meng wrote: > > From: Bin Meng > > I believe send_dummy_bits() should also be fixed, but I really don't > know how based on my pure read/guess of the codes since there is no > public datasheet available for this NPCM7xx SoC. > > Signed-off-by: Bin Meng Just a

Re: [PATCH 0/7] Additional NPCM7xx devices and IPMI BMC emulation support

2020-12-11 Thread Havard Skinnemoen via
On Fri, Dec 11, 2020 at 4:16 PM Corey Minyard wrote: > On Fri, Dec 11, 2020 at 12:56:07PM -0800, Hao Wu wrote: > > Tl,dr: We'll remove the IPMI changes from the current patch set and > > refactor > > them in a separate patch set. > > > > Thank you for your review! On high level, we are

[PATCH 3/3] tests/qtest/npcm7xx_rng-test: dump random data on failure

2020-11-02 Thread Havard Skinnemoen via
Dump the collected random data after a randomness test failure. Note that you won't actually see this unless you add g_test_set_nonfatal_assertions() back in. Signed-off-by: Havard Skinnemoen --- tests/qtest/npcm7xx_rng-test.c | 12 1 file changed, 12 insertions(+) diff --git a/te

[PATCH 2/3] tests/qtest/npcm7xx: Don't call g_test_set_nonfatal_assertions

2020-11-02 Thread Havard Skinnemoen via
Even though g_test_set_nonfatal_assertions() makes test failure reporting a lot better, no other tests currently do this so we'll turn it off as well. Signed-off-by: Havard Skinnemoen --- tests/qtest/npcm7xx_gpio-test.c | 1 - tests/qtest/npcm7xx_rng-test.c| 1 - tests/qtes

[PATCH 0/3] tests/qtest: npcm7xx test fixes

2020-11-02 Thread Havard Skinnemoen via
This series contains a fix for the randomness calculation in npcm7xx_rng-test. It also makes test failures fatal. The last patch would have dumped the random data to stderr if the randomness test fails, except now that failures are fatal, it never actually gets a chance to do that. It may not make

[PATCH 1/3] tests/qtest/npcm7xx_rng-test: count runs properly

2020-11-02 Thread Havard Skinnemoen via
The number of runs is equal to the number of 0-1 and 1-0 transitions, plus one. Currently, it's counting the number of times these transitions do _not_ happen, plus one. Source: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-22r1a.pdf section 2.3.4 point (3). Signed-off-by:

[PATCH v3 6/6] hw/gpio: Add GPIO model for Nuvoton NPCM7xx

2020-10-23 Thread Havard Skinnemoen via
The NPCM7xx chips have multiple GPIO controllers that are mostly identical except for some minor differences like the reset values of some registers. Each controller controls up to 32 pins. Each individual pin is modeled as a pair of unnamed GPIOs -- one for emitting the actual pin state, and one

[PATCH v3 3/6] hw/timer: Adding watchdog for NPCM7XX Timer.

2020-10-23 Thread Havard Skinnemoen via
From: Hao Wu The watchdog is part of NPCM7XX's timer module. Its behavior is controlled by the WTCR register in the timer. When enabled, the watchdog issues an interrupt signal after a pre-set amount of cycles, and issues a reset signal shortly after that. Reviewed-by: Tyrone Ting Signed-off-b

[PATCH v3 5/6] hw/arm/npcm7xx: Add EHCI and OHCI controllers

2020-10-23 Thread Havard Skinnemoen via
The NPCM730 and NPCM750 chips have a single USB host port shared between a USB 2.0 EHCI host controller and a USB 1.1 OHCI host controller. This adds support for both of them. Testing notes: * With -device usb-kbd, qemu will automatically insert a full-speed hub, and the keyboard becomes con

[PATCH v3 0/6] Additional NPCM7xx features, devices and tests

2020-10-23 Thread Havard Skinnemoen via
This is an update to the initial NPCM7xx patch series adding - Watchdog timer support. This makes the reboot command work. - Random Number Generator device. - USB Host Controllers. - GPIO Controllers. The watchdog was implemented by my new teammate Hao Wu. Expect to see more patches from

[PATCH v3 4/6] hw/misc: Add npcm7xx random number generator

2020-10-23 Thread Havard Skinnemoen via
The RNG module returns a byte of randomness when the Data Valid bit is set. This implementation ignores the prescaler setting, and loads a new value into RNGD every time RNGCS is read while the RNG is enabled and random data is available. A qtest featuring some simple randomness tests is included

[PATCH v3 1/6] tests/qtest: Make npcm7xx_timer-test conditional on CONFIG_NPCM7XX

2020-10-23 Thread Havard Skinnemoen via
This test won't work if qemu was compiled without CONFIG_NPCM7XX, as pointed out by Thomas Huth on a different patch. Signed-off-by: Havard Skinnemoen --- tests/qtest/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.bui

[PATCH v3 2/6] Move npcm7xx_timer_reached_zero call out of npcm7xx_timer_pause

2020-10-23 Thread Havard Skinnemoen via
This allows us to reuse npcm7xx_timer_pause for the watchdog timer. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Havard Skinnemoen --- hw/timer/npcm7xx_timer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/timer/npcm7xx_timer.c b/hw/timer/npcm7xx_timer.c ind

[PATCH v2 4/5] hw/arm/npcm7xx: Add EHCI and OHCI controllers

2020-10-21 Thread Havard Skinnemoen via
The NPCM730 and NPCM750 chips have a single USB host port shared between a USB 2.0 EHCI host controller and a USB 1.1 OHCI host controller. This adds support for both of them. Testing notes: * With -device usb-kbd, qemu will automatically insert a full-speed hub, and the keyboard becomes con

[PATCH v2 5/5] hw/gpio: Add GPIO model for Nuvoton NPCM7xx

2020-10-21 Thread Havard Skinnemoen via
The NPCM7xx chips have multiple GPIO controllers that are mostly identical except for some minor differences like the reset values of some registers. Each controller controls up to 32 pins. Each individual pin is modeled as a pair of unnamed GPIOs -- one for emitting the actual pin state, and one

[PATCH v2 3/5] hw/misc: Add npcm7xx random number generator

2020-10-21 Thread Havard Skinnemoen via
The RNG module returns a byte of randomness when the Data Valid bit is set. This implementation ignores the prescaler setting, and loads a new value into RNGD every time RNGCS is read while the RNG is enabled and random data is available. A qtest featuring some simple randomness tests is included

[PATCH v2 1/5] Move npcm7xx_timer_reached_zero call out of npcm7xx_timer_pause

2020-10-21 Thread Havard Skinnemoen via
This allows us to reuse npcm7xx_timer_pause for the watchdog timer. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Havard Skinnemoen --- hw/timer/npcm7xx_timer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/timer/npcm7xx_timer.c b/hw/timer/npcm7xx_timer.c ind

[PATCH v2 2/5] hw/timer: Adding watchdog for NPCM7XX Timer.

2020-10-21 Thread Havard Skinnemoen via
From: Hao Wu The watchdog is part of NPCM7XX's timer module. Its behavior is controlled by the WTCR register in the timer. When enabled, the watchdog issues an interrupt signal after a pre-set amount of cycles, and issues a reset signal shortly after that. Reviewed-by: Tyrone Ting Signed-off-b

[PATCH v2 0/5] Additional NPCM7xx features, devices and tests

2020-10-21 Thread Havard Skinnemoen via
This is an update to the initial NPCM7xx patch series adding - Watchdog timer support. This makes the reboot command work. - Random Number Generator device. - USB Host Controllers. - GPIO Controllers. The watchdog was implemented by my new teammate Hao Wu. Expect to see more patches from

[PATCH 6/6] hw/gpio: Add GPIO model for Nuvoton NPCM7xx

2020-10-08 Thread Havard Skinnemoen via
The NPCM7xx chips have multiple GPIO controllers that are mostly identical except for some minor differences like the reset values of some registers. Each controller controls up to 32 pins. Each individual pin is modeled as a pair of unnamed GPIOs -- one for emitting the actual pin state, and one

[PATCH 5/6] hw/arm/npcm7xx: Add EHCI and OHCI controllers

2020-10-08 Thread Havard Skinnemoen via
The NPCM730 and NPCM750 chips have a single USB host port shared between a USB 2.0 EHCI host controller and a USB 1.1 OHCI host controller. This adds support for both of them. Testing notes: * With -device usb-kbd, qemu will automatically insert a full-speed hub, and the keyboard becomes con

[PATCH 2/6] Move npcm7xx_timer_reached_zero call out of npcm7xx_timer_pause

2020-10-08 Thread Havard Skinnemoen via
This allows us to reuse npcm7xx_timer_pause for the watchdog timer. Signed-off-by: Havard Skinnemoen --- hw/timer/npcm7xx_timer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/timer/npcm7xx_timer.c b/hw/timer/npcm7xx_timer.c index 5703e43d40..2df9e3e496 100644 ---

[PATCH 4/6] hw/misc: Add npcm7xx random number generator

2020-10-08 Thread Havard Skinnemoen via
The RNG module returns a byte of randomness when the Data Valid bit is set. This implementation ignores the prescaler setting, and loads a new value into RNGD every time RNGCS is read while the RNG is enabled and random data is available. A qtest featuring some simple randomness tests is included

[PATCH 1/6] tests/qtest: Add npcm7xx timer test

2020-10-08 Thread Havard Skinnemoen via
This test exercises the various modes of the npcm7xx timer. In particular, it triggers the bug found by the fuzzer, as reported here: https://lists.gnu.org/archive/html/qemu-devel/2020-09/msg02992.html It also found several other bugs, especially related to interrupt handling. The test exercises

[PATCH 3/6] hw/timer: Adding watchdog for NPCM7XX Timer.

2020-10-08 Thread Havard Skinnemoen via
From: Hao Wu The watchdog is part of NPCM7XX's timer module. Its behavior is controlled by the WTCR register in the timer. When enabled, the watchdog issues an interrupt signal after a pre-set amount of cycles, and issues a reset signal shortly after that. Reviewed-by: Tyrone Ting Signed-off-b

[PATCH 0/6] Additional NPCM7xx features, devices and tests

2020-10-08 Thread Havard Skinnemoen via
This is an update to the initial NPCM7xx patch series adding - A timer test that found several issues that were fixed in the final version of the series (see https://www.mail-archive.com/qemu-devel@nongnu.org/msg739516.html). - Watchdog timer support. This makes the reboot command work

[RFC 3/3] docs/specs: IPMI device emulation: BMC

2020-09-28 Thread Havard Skinnemoen via
The IPMI document is expanded with a proposal to emulate BMC-side IPMI devices. This allows a QEMU instance running server software to interact with a different QEMU instance running BMC firmware, which should closely model how a real server system works. The document as rendered by "make sphinxdo

[RFC 2/3] docs/specs: IPMI device emulation: main processor

2020-09-28 Thread Havard Skinnemoen via
This document is an attempt to briefly document the existing IPMI emulation support on the main processor. It provides the necessary background for the BMC-side IPMI emulation proposed by the next patch. Signed-off-by: Havard Skinnemoen --- docs/specs/index.rst | 1 + docs/specs/ipmi.rst | 10

[RFC 1/3] docs: enable sphinx blockdiag extension

2020-09-28 Thread Havard Skinnemoen via
Signed-off-by: Havard Skinnemoen --- docs/conf.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 0dbd90dc11..7c72f1a074 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -67,7 +67,10 @@ needs_sphinx = '1.6' # Add any Sphinx extension modul

[RFC 0/3] QEMU as IPMI BMC emulator

2020-09-28 Thread Havard Skinnemoen via
This series briefly documents the existing IPMI device support for main processor emulation, and goes on to propose a similar device structure to emulate IPMI responder devices in BMC machines. This would allow a qemu instance running BMC firmware to serve as an external BMC for a qemu instance run

[PATCH v9 14/14] tests/acceptance: console boot tests for quanta-gsj

2020-09-10 Thread Havard Skinnemoen via
This adds two acceptance tests for the quanta-gsj machine. One test downloads a lightly patched openbmc flash image from github and verifies that it boots all the way to the login prompt. The other test downloads a kernel, initrd and dtb built from the same openbmc source and verifies that the ke

[PATCH v9 11/14] hw/arm: Wire up BMC boot flash for npcm750-evb and quanta-gsj

2020-09-10 Thread Havard Skinnemoen via
This allows these NPCM7xx-based boards to boot from a flash image, e.g. one built with OpenBMC. For example like this: IMAGE=${OPENBMC}/build/tmp/deploy/images/gsj/image-bmc qemu-system-arm -machine quanta-gsj -nographic \ -drive file=${IMAGE},if=mtd,bus=0,unit=0,format=raw,snapshot=on Re

[PATCH v9 10/14] hw/ssi: NPCM7xx Flash Interface Unit device model

2020-09-10 Thread Havard Skinnemoen via
This implements a device model for the NPCM7xx SPI flash controller. Direct reads and writes, and user-mode transactions have been tested in various modes. Protection features are not implemented yet. All the FIU instances are available in the SoC's address space, regardless of whether or not the

[PATCH v9 08/14] hw/nvram: NPCM7xx OTP device model

2020-09-10 Thread Havard Skinnemoen via
This supports reading and writing OTP fuses and keys. Only fuse reading has been tested. Protection is not implemented. Reviewed-by: Avi Fishman Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Tested-by: Alexander Bulekov Signed-off-by: Havard Skinnemoen --- include/hw/

[PATCH v9 05/14] hw/arm: Add two NPCM7xx-based machines

2020-09-10 Thread Havard Skinnemoen via
This adds two new machines, both supported by OpenBMC: - npcm750-evb: Nuvoton NPCM750 Evaluation Board. - quanta-gsj: A board with a NPCM730 chip. They rely on the NPCM7xx SoC device to do the heavy lifting. They are almost completely identical at the moment, apart from the SoC type, which cu

[PATCH v9 07/14] hw/arm: Load -bios image as a boot ROM for npcm7xx

2020-09-10 Thread Havard Skinnemoen via
If a -bios option is specified on the command line, load the image into the internal ROM memory region, which contains the first instructions run by the CPU after reset. If -bios is not specified, the vbootrom included with qemu is loaded by default. Reviewed-by: Tyrone Ting Reviewed-by: Cédric

[PATCH v9 12/14] hw/arm/npcm7xx: add board setup stub for CPU and UART clocks

2020-09-10 Thread Havard Skinnemoen via
When booting directly into a kernel, bypassing the boot loader, the CPU and UART clocks are not set up correctly. This makes the system appear very slow, and causes the initrd boot test to fail when optimization is off. The UART clock must run at 24 MHz. The default 25 MHz reference clock cannot a

[PATCH v9 13/14] docs/system: Add Nuvoton machine documentation

2020-09-10 Thread Havard Skinnemoen via
Reviewed-by: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Havard Skinnemoen --- docs/system/arm/nuvoton.rst | 92 + docs/system/target-arm.rst | 1 + 2 files changed, 93 insertions(+) create mode 100644 docs/system/arm/nuvoton.rst d

[PATCH v9 09/14] hw/mem: Stubbed out NPCM7xx Memory Controller model

2020-09-10 Thread Havard Skinnemoen via
This just implements the bare minimum to cause the boot block to skip memory initialization. Reviewed-by: Tyrone Ting Reviewed-by: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Tested-by: Alexander Bulekov Signed-off-by: Havard Skinnemoen --- include

[PATCH v9 04/14] hw/arm: Add NPCM730 and NPCM750 SoC models

2020-09-10 Thread Havard Skinnemoen via
The Nuvoton NPCM7xx SoC family are used to implement Baseboard Management Controllers in servers. While the family includes four SoCs, this patch implements limited support for two of them: NPCM730 (targeted for Data Center applications) and NPCM750 (targeted for Enterprise applications). This pat

[PATCH v9 03/14] hw/timer: Add NPCM7xx Timer device model

2020-09-10 Thread Havard Skinnemoen via
The NPCM730 and NPCM750 SoCs have three timer modules each holding five timers and some shared registers (e.g. interrupt status). Each timer runs at 25 MHz divided by a prescaler, and counts down from a configurable initial value to zero. When zero is reached, the interrupt flag for the timer is s

[PATCH v9 06/14] roms: Add virtual Boot ROM for NPCM7xx SoCs

2020-09-10 Thread Havard Skinnemoen via
This is a minimalistic boot ROM written specifically for use with QEMU. It supports loading the second-stage loader from SPI flash into RAM, SMP boot, and not much else. Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Havard Skinnemoen --- .gitmodules

[PATCH v9 00/14] Add Nuvoton NPCM730/NPCM750 SoCs and two BMC machines

2020-09-10 Thread Havard Skinnemoen via
This should be fully reviewed now, but the Timer patch may deserve another look, as I fixed a few bugs in it. Huge thanks to everyone who reviewed and/or tested this patchset, it has clearly improved a lot since I started. I also pushed this and the previous patchsets to my qemu fork on github. T

[PATCH v9 02/14] hw/misc: Add NPCM7xx Clock Controller device model

2020-09-10 Thread Havard Skinnemoen via
Enough functionality to boot the Linux kernel has been implemented. This includes: - Correct power-on reset values so the various clock rates can be accurately calculated. - Clock enables stick around when written. In addition, a best effort attempt to implement SECCNT and CNTR25M was mad

[PATCH v9 01/14] hw/misc: Add NPCM7xx System Global Control Registers device model

2020-09-10 Thread Havard Skinnemoen via
Implement a device model for the System Global Control Registers in the NPCM730 and NPCM750 BMC SoCs. This is primarily used to enable SMP boot (the boot ROM spins reading the SCRPAD register) and DDR memory initialization; other registers are best effort for now. The reset values of the MDLR and

[PATCH v8 11/14] hw/arm: Wire up BMC boot flash for npcm750-evb and quanta-gsj

2020-08-24 Thread Havard Skinnemoen via
This allows these NPCM7xx-based boards to boot from a flash image, e.g. one built with OpenBMC. For example like this: IMAGE=${OPENBMC}/build/tmp/deploy/images/gsj/image-bmc qemu-system-arm -machine quanta-gsj -nographic \ -drive file=${IMAGE},if=mtd,bus=0,unit=0,format=raw,snapshot=on Re

[PATCH v8 08/14] hw/nvram: NPCM7xx OTP device model

2020-08-24 Thread Havard Skinnemoen via
This supports reading and writing OTP fuses and keys. Only fuse reading has been tested. Protection is not implemented. Reviewed-by: Avi Fishman Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Havard Skinnemoen --- include/hw/arm/npcm7xx.h | 3 + include/hw/nvram/npcm7xx_otp.h | 79

[PATCH v8 14/14] tests/acceptance: console boot tests for quanta-gsj

2020-08-24 Thread Havard Skinnemoen via
This adds two acceptance tests for the quanta-gsj machine. One test downloads a lightly patched openbmc flash image from github and verifies that it boots all the way to the login prompt. The other test downloads a kernel, initrd and dtb built from the same openbmc source and verifies that the ke

[PATCH v8 12/14] hw/arm/npcm7xx: add board setup stub for CPU and UART clocks

2020-08-24 Thread Havard Skinnemoen via
When booting directly into a kernel, bypassing the boot loader, the CPU and UART clocks are not set up correctly. This makes the system appear very slow, and causes the initrd boot test to fail when optimization is off. The UART clock must run at 24 MHz. The default 25 MHz reference clock cannot a

[PATCH v8 06/14] roms: Add virtual Boot ROM for NPCM7xx SoCs

2020-08-24 Thread Havard Skinnemoen via
This is a minimalistic boot ROM written specifically for use with QEMU. It supports loading the second-stage loader from SPI flash into RAM, SMP boot, and not much else. Signed-off-by: Havard Skinnemoen --- Makefile| 1 + .gitmodules | 3 +++ MAINTAINERS

[PATCH v8 07/14] hw/arm: Load -bios image as a boot ROM for npcm7xx

2020-08-24 Thread Havard Skinnemoen via
If a -bios option is specified on the command line, load the image into the internal ROM memory region, which contains the first instructions run by the CPU after reset. If -bios is not specified, the vbootrom included with qemu is loaded by default. Reviewed-by: Tyrone Ting Reviewed-by: Cédric

[PATCH v8 04/14] hw/arm: Add NPCM730 and NPCM750 SoC models

2020-08-24 Thread Havard Skinnemoen via
The Nuvoton NPCM7xx SoC family are used to implement Baseboard Management Controllers in servers. While the family includes four SoCs, this patch implements limited support for two of them: NPCM730 (targeted for Data Center applications) and NPCM750 (targeted for Enterprise applications). This pat

[PATCH v8 13/14] docs/system: Add Nuvoton machine documentation

2020-08-24 Thread Havard Skinnemoen via
Reviewed-by: Cédric Le Goater Signed-off-by: Havard Skinnemoen --- docs/system/arm/nuvoton.rst | 90 + docs/system/target-arm.rst | 1 + 2 files changed, 91 insertions(+) create mode 100644 docs/system/arm/nuvoton.rst diff --git a/docs/system/arm/nuvoton.r

[PATCH v8 09/14] hw/mem: Stubbed out NPCM7xx Memory Controller model

2020-08-24 Thread Havard Skinnemoen via
This just implements the bare minimum to cause the boot block to skip memory initialization. Reviewed-by: Tyrone Ting Reviewed-by: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Havard Skinnemoen --- include/hw/arm/npcm7xx.h| 2 + include/hw/mem/npcm7xx_mc.h | 36 +++

[PATCH v8 05/14] hw/arm: Add two NPCM7xx-based machines

2020-08-24 Thread Havard Skinnemoen via
This adds two new machines, both supported by OpenBMC: - npcm750-evb: Nuvoton NPCM750 Evaluation Board. - quanta-gsj: A board with a NPCM730 chip. They rely on the NPCM7xx SoC device to do the heavy lifting. They are almost completely identical at the moment, apart from the SoC type, which cu

[PATCH v8 02/14] hw/misc: Add NPCM7xx Clock Controller device model

2020-08-24 Thread Havard Skinnemoen via
Enough functionality to boot the Linux kernel has been implemented. This includes: - Correct power-on reset values so the various clock rates can be accurately calculated. - Clock enables stick around when written. In addition, a best effort attempt to implement SECCNT and CNTR25M was mad

[PATCH v8 10/14] hw/ssi: NPCM7xx Flash Interface Unit device model

2020-08-24 Thread Havard Skinnemoen via
This implements a device model for the NPCM7xx SPI flash controller. Direct reads and writes, and user-mode transactions have been tested in various modes. Protection features are not implemented yet. All the FIU instances are available in the SoC's address space, regardless of whether or not the

[PATCH v8 01/14] hw/misc: Add NPCM7xx System Global Control Registers device model

2020-08-24 Thread Havard Skinnemoen via
Implement a device model for the System Global Control Registers in the NPCM730 and NPCM750 BMC SoCs. This is primarily used to enable SMP boot (the boot ROM spins reading the SCRPAD register) and DDR memory initialization; other registers are best effort for now. The reset values of the MDLR and

[PATCH v8 03/14] hw/timer: Add NPCM7xx Timer device model

2020-08-24 Thread Havard Skinnemoen via
The NPCM730 and NPCM750 SoCs have three timer modules each holding five timers and some shared registers (e.g. interrupt status). Each timer runs at 25 MHz divided by a prescaler, and counts down from a configurable initial value to zero. When zero is reached, the interrupt flag for the timer is s

[PATCH v8 00/14] Add Nuvoton NPCM730/NPCM750 SoCs and two BMC machines

2020-08-24 Thread Havard Skinnemoen via
I also pushed this and the previous patchsets to my qemu fork on github. The branches are named npcm7xx-v[1-8]. https://github.com/hskinnemoen/qemu This patch series models enough of the Nuvoton NPCM730 and NPCM750 SoCs to boot an OpenBMC image built for quanta-gsj. This includes device models