Re: [PATCH v3 11/11] tests/qtest: Adding PCS Module test to GMAC Qtest

2023-10-17 Thread Hao Wu
On Tue, Oct 17, 2023 at 4:04 PM Nabih Estefan wrote: > From: Nabih Estefan Diaz > > - Add PCS Register check to npcm_gmac-test > > Signed-off-by: Nabih Estefan Diaz > Reviewed-by: Hao Wu > --- > tests/qtest/npcm_gmac-test.c | 134 ++

Re: [PATCH v3 09/11] hw/net: GMAC Rx Implementation

2023-10-17 Thread Hao Wu
> can be received by the GMAC device. Without this it won't work > with TAP NIC device. > > Signed-off-by: Hao Wu > > hw/net: Handle RX desc full in NPCM GMAC > > When RX descriptor list is full, it returns a DMA_STATUS for software to > handle it. But there's no way to indi

Re: [PATCH v3 08/11] hw/net: General GMAC Implementation

2023-10-17 Thread Hao Wu
On Tue, Oct 17, 2023 at 4:04 PM Nabih Estefan wrote: > From: Nabih Estefan Diaz > > - General GMAC Register handling > - GMAC IRQ Handling > - Added traces in some methods for debugging > - Lots of declarations for accessing information on GMAC Descriptors > (npcm_gmac.h file) > > NOTE: With

Re: [PATCH v3 07/11] include/hw/net: Implemented Classes and Masks for GMAC Descriptors

2023-10-17 Thread Hao Wu
On Tue, Oct 17, 2023 at 4:04 PM Nabih Estefan wrote: > From: Nabih Estefan Diaz > > - Implemeted classes for GMAC Receive and Transmit Descriptors > - Implemented Masks for said descriptors > > Signed-off-by: Nabih Estefan Diaz > Reviewed-by: Hao Wu > -

Re: [PATCH v3 06/11] \tests/qtest: Creating qtest for GMAC Module

2023-10-17 Thread Hao Wu
You have an extra "\" in the title. On Tue, Oct 17, 2023 at 4:04 PM Nabih Estefan wrote: > From: Nabih Estefan Diaz > > - Created qtest to check initialization of registers in GMAC Module. > - Implemented test into Build File. > > Signed-off-by: Nabih Estefan Diaz > --- >

Re: [PATCH] hw/timer/npcm7xx_timer: Prevent timer from counting down past zero

2023-09-22 Thread Hao Wu
Is this related to this error? https://lists.gnu.org/archive/html/qemu-devel/2023-09/msg04903.html On Fri, Sep 22, 2023 at 11:14 AM Chris Rauer wrote: > The counter register is only 24-bits and counts down. If the timer is > running but the qtimer to reset it hasn't fired off yet, there is a

Re: npcm7xx_timer-test.c is unreliable

2023-09-19 Thread Hao Wu
> > Let me take a look at that. I suspect the timer is off by 1 tick due to > some rounding errors.

Re: [PATCH v2 2/7] docs/specs: IPMI device emulation: main processor

2023-03-27 Thread Hao Wu
Thank you. I'll include the change in the next patch set when I refactor patch v4 (which might take a while.) On Sat, Mar 25, 2023 at 4:56 PM Corey Minyard wrote: > On Fri, Mar 24, 2023 at 04:08:59PM -0700, Hao Wu wrote: > > From: Havard Skinnemoen > > > > This d

Re: [PATCH v2 4/7] hw/ipmi: Refactor IPMI interface

2023-03-27 Thread Hao Wu
best here. Maybe Corey can shed some light on this one? Thank you! Best Regards, On Mon, Mar 27, 2023 at 5:34 AM Cédric Le Goater wrote: > Hello Hao, > > On 3/25/23 00:09, Hao Wu wrote: > > This patch refactors the IPMI interface so that it can be used by both > > the BM

[PATCH v2 7/7] hw/ipmi: Add a KCS Module for NPCM7XX

2023-03-24 Thread Hao Wu
, in READ_STATE, ipmi_kcs.c (core side emulation) reads a message from BMC while npcm7xx_kcs.c (BMC-side emulation) sends a message to the core. Signed-off-by: Hao Wu Reviewed-by: Tyrone Ting --- docs/system/arm/nuvoton.rst | 1 - hw/arm/npcm7xx.c | 10 +- hw/ipmi/meson.build

[PATCH v2 5/7] hw/ipmi: Take out common from ipmi_bmc_extern.c

2023-03-24 Thread Hao Wu
. Basically most of the message transaction are moved. The stuff remained are basically hardware operations like handle_reset and handle_hw_op. These stuff have different behaviors in core-side and BMC-side emulation. Signed-off-by: Hao Wu --- hw/ipmi/ipmi_bmc_extern.c | 420

[PATCH v2 4/7] hw/ipmi: Refactor IPMI interface

2023-03-24 Thread Hao Wu
ent representing BMC side simulation. (6) Appy the changes to the entire IPMI library. Signed-off-by: Hao Wu --- hw/acpi/ipmi.c | 4 +- hw/ipmi/ipmi.c | 60 + hw/ipmi/ipmi_bmc_extern.c | 67 ++ hw/ipmi/ipmi_bmc_sim.c |

[PATCH v2 6/7] hw/ipmi: Add an IPMI external host device

2023-03-24 Thread Hao Wu
with device ipmi-bmc-extern. For more details of IPMI host device in BMC emulation, see docs/specs/ipmi.rst. Signed-off-by: Hao Wu --- configs/devices/arm-softmmu/default.mak | 2 + hw/ipmi/Kconfig | 4 + hw/ipmi/ipmi_extern.c | 18 ++- hw/ipmi

[PATCH v2 3/7] docs/specs: IPMI device emulation: BMC

2023-03-24 Thread Hao Wu
-by: Havard Skinnemoen Signed-off-by: Hao Wu --- docs/specs/ipmi.rst | 70 + 1 file changed, 70 insertions(+) diff --git a/docs/specs/ipmi.rst b/docs/specs/ipmi.rst index e0badc7f15..b06ad74728 100644 --- a/docs/specs/ipmi.rst +++ b/docs/specs/ipmi.rst

[PATCH v2 0/7] Handling IPMI for emulated BMC

2023-03-24 Thread Hao Wu
other comments from Corey in the original patch set. Hao Wu (4): hw/ipmi: Refactor IPMI interface hw/ipmi: Take out common from ipmi_bmc_extern.c hw/ipmi: Add an IPMI external host device hw/ipmi: Add a KCS Module for NPCM7XX Havard Skinnemoen (3): docs: enable sphinx blockdiag

[PATCH v2 2/7] docs/specs: IPMI device emulation: main processor

2023-03-24 Thread Hao Wu
From: Havard Skinnemoen 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 Signed-off-by: Hao Wu --- docs

[PATCH v2 1/7] docs: enable sphinx blockdiag extension

2023-03-24 Thread Hao Wu
From: Havard Skinnemoen This allows use to add block diagrams in documentations, such as the block diagram in docs/specs/impi.rst. Signed-off-by: Havard Skinnemoen Signed-off-by: Hao Wu --- docs/conf.py | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b

[PATCH v3 2/3] hw/ssi: Add Nuvoton PSPI Module

2023-02-08 Thread Hao Wu
Nuvoton's PSPI is a general purpose SPI module which enables connections to SPI-based peripheral devices. Signed-off-by: Hao Wu Reviewed-by: Chris Rauer Reviewed-by: Philippe Mathieu-Daude --- MAINTAINERS| 6 +- hw/ssi/meson.build | 2 +- hw/ssi/npcm_pspi.c

[PATCH v3 3/3] hw/arm: Attach PSPI module to NPCM7XX SoC

2023-02-08 Thread Hao Wu
Signed-off-by: Hao Wu Reviewed-by: Titus Rwantare Reviewed-by: Philippe Mathieu-Daude --- docs/system/arm/nuvoton.rst | 2 +- hw/arm/npcm7xx.c| 25 +++-- include/hw/arm/npcm7xx.h| 2 ++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/docs

[PATCH v3 1/3] MAINTAINERS: Add myself to maintainers and remove Havard

2023-02-08 Thread Hao Wu
Havard is no longer working on the Nuvoton systems for a while and won't be able to do any work on it in the future. So I'll take over maintaining the Nuvoton system from him. Signed-off-by: Hao Wu Acked-by: Havard Skinnemoen Reviewed-by: Philippe Mathieu-Daude --- MAINTAINERS | 2 +- 1 file

[PATCH v3 0/3] Nuvoton Peripheral SPI (PSPI) Module

2023-02-08 Thread Hao Wu
to match the datasheet. -- Changes from v1 -- A few minor updates for npcm-pspi.c according to Phillipe Mathieu-Daude's review. Thanks! Hao Wu (3): MAINTAINERS: Add myself to maintainers and remove Havard hw/ssi: Add Nuvoton PSPI Module hw/arm: Attach PSPI module to NPCM7XX SoC MAINTAINERS

Re: [PATCH v2 2/3] hw/ssi: Add Nuvoton PSPI Module

2023-02-08 Thread Hao Wu
Thanks for pointing that out. I'll send another version to fix that. On Tue, Feb 7, 2023 at 11:48 PM Philippe Mathieu-Daudé wrote: > On 7/2/23 20:45, Hao Wu wrote: > > Nuvoton's PSPI is a general purpose SPI module which enables > > connections to SPI-based peripheral devices.

[PATCH v2 1/3] MAINTAINERS: Add myself to maintainers and remove Havard

2023-02-07 Thread Hao Wu
Havard is no longer working on the Nuvoton systems for a while and won't be able to do any work on it in the future. So I'll take over maintaining the Nuvoton system from him. Signed-off-by: Hao Wu Acked-by: Havard Skinnemoen Reviewed-by: Philippe Mathieu-Daude --- MAINTAINERS | 2 +- 1 file

[PATCH v2 3/3] hw/arm: Attach PSPI module to NPCM7XX SoC

2023-02-07 Thread Hao Wu
Signed-off-by: Hao Wu Reviewed-by: Titus Rwantare Reviewed-by: Philippe Mathieu-Daude --- docs/system/arm/nuvoton.rst | 2 +- hw/arm/npcm7xx.c| 25 +++-- include/hw/arm/npcm7xx.h| 2 ++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/docs

[PATCH v2 0/3] Nuvoton Peripheral SPI (PSPI) Module

2023-02-07 Thread Hao Wu
-pspi.c according to Phillipe Mathieu-Daude's review. Thanks! Hao Wu (3): MAINTAINERS: Add myself to maintainers and remove Havard hw/ssi: Add Nuvoton PSPI Module hw/arm: Attach PSPI module to NPCM7XX SoC MAINTAINERS | 8 +- docs/system/arm/nuvoton.rst | 2 +- hw/arm

[PATCH v2 2/3] hw/ssi: Add Nuvoton PSPI Module

2023-02-07 Thread Hao Wu
Nuvoton's PSPI is a general purpose SPI module which enables connections to SPI-based peripheral devices. Signed-off-by: Hao Wu Reviewed-by: Chris Rauer Reviewed-by: Philippe Mathieu-Daude --- MAINTAINERS| 6 +- hw/ssi/meson.build | 2 +- hw/ssi/npcm_pspi.c

Re: [PATCH 2/3] hw/ssi: Add Nuvoton PSPI Module

2023-02-07 Thread Hao Wu
On Tue, Feb 7, 2023 at 10:46 AM Hao Wu wrote: > Thanks for your review! > > On Mon, Feb 6, 2023 at 11:13 PM Philippe Mathieu-Daudé > wrote: > >> On 7/2/23 00:34, Hao Wu wrote: >> > Nuvoton's PSPI is a general purpose SPI module which enables >> > conn

Re: [PATCH 2/3] hw/ssi: Add Nuvoton PSPI Module

2023-02-07 Thread Hao Wu
Thanks for your review! On Mon, Feb 6, 2023 at 11:13 PM Philippe Mathieu-Daudé wrote: > On 7/2/23 00:34, Hao Wu wrote: > > Nuvoton's PSPI is a general purpose SPI module which enables > > connections to SPI-based peripheral devices. > > > > Signed-off-by: Hao Wu &

[PATCH 0/3] Nuvoton Peripheral SPI (PSPI) Module

2023-02-06 Thread Hao Wu
This patch set adds peripheral SPI (PSPI) modules to NPCM7XX SoCs. These modules can be used to connect any SPI peripheral devices to the SoC. This module will also be used in the next generation NPCM8XX SoCs which haven't been merged yet. Thanks! Hao Wu (3): MAINTAINERS: Add myself

[PATCH 3/3] hw/arm: Attach PSPI module to NPCM7XX SoC

2023-02-06 Thread Hao Wu
Signed-off-by: Hao Wu Reviewed-by: Titus Rwantare --- docs/system/arm/nuvoton.rst | 2 +- hw/arm/npcm7xx.c| 25 +++-- include/hw/arm/npcm7xx.h| 2 ++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/docs/system/arm/nuvoton.rst b/docs/system

[PATCH 2/3] hw/ssi: Add Nuvoton PSPI Module

2023-02-06 Thread Hao Wu
Nuvoton's PSPI is a general purpose SPI module which enables connections to SPI-based peripheral devices. Signed-off-by: Hao Wu Reviewed-by: Chris Rauer --- MAINTAINERS| 6 +- hw/ssi/meson.build | 2 +- hw/ssi/npcm_pspi.c | 216

[PATCH 1/3] MAINTAINERS: Add myself to maintainers and remove Havard

2023-02-06 Thread Hao Wu
Havard is no longer working on the Nuvoton systems for a while and won't be able to do any work on it in the future. So I'll take over maintaining the Nuvoton system from him. Signed-off-by: Hao Wu --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b

Re: [PATCH v4 1/2] hw/sensor: Add SB-TSI Temperature Sensor Interface

2023-02-06 Thread Hao Wu
Hi, It seems like this patch set is reviewed but never merged. Who should take this patch set? What are our next steps for them? Thanks! On Mon, Jan 31, 2022 at 2:29 PM Patrick Venture wrote: > From: Hao Wu > > SB Temperature Sensor Interface (SB-TSI) is an SMBus compatible &g

Re: [PATCH] docs/nuvoton: Update URL for images

2022-10-04 Thread Hao Wu
On Mon, Oct 3, 2022 at 10:01 PM Joel Stanley wrote: > openpower.xyz was retired some time ago. The OpenBMC Jenkins is where > images can be found these days. > > Signed-off-by: Joel Stanley > Reviewed-by: Hao Wu > --- > docs/system/arm/nuvoton.rst | 4 ++-- > 1 fi

Re: [PATCH 43/51] tests/qtest: npcm7xx_emc-test: Skip running test_{tx, rx} on win32

2022-08-25 Thread Hao Wu
On Wed, Aug 24, 2022 at 3:35 AM Bin Meng wrote: > From: Bin Meng > > The test cases 'test_{tx,rx}' call socketpair() which does not exist > on win32. Exclude them. > > Signed-off-by: Bin Meng > Reviewed-by: Hao Wu > --- > > tests/qtest/npcm7xx_emc-test.c | 8

[PATCH v2] target/arm: Add cortex-a35

2022-08-18 Thread Hao Wu
Add cortex A35 core and enable it for virt board. Signed-off-by: Hao Wu Reviewed-by: Joe Komlodi --- docs/system/arm/virt.rst | 1 + hw/arm/virt.c| 1 + target/arm/cpu64.c | 80 3 files changed, 82 insertions(+) diff --git a/docs

Re: [PATCH] target/arm: Add cortex-a35

2022-08-18 Thread Hao Wu
Hi, This is used by a new series of Nuvoton SoC (NPCM8XX) which contains 4 Cortex A-35 cores. I'll update the missing fields in a follow-up patch set. On Thu, Aug 18, 2022 at 7:59 AM Peter Maydell wrote: > On Mon, 15 Aug 2022 at 22:35, Hao Wu wrote: > > > > Add cortex A35

[PATCH] target/arm: Add cortex-a35

2022-08-15 Thread Hao Wu
Add cortex A35 core and enable it for virt board. Signed-off-by: Hao Wu Reviewed-by: Joe Komlodi --- docs/system/arm/virt.rst | 1 + hw/arm/virt.c| 1 + target/arm/cpu64.c | 69 3 files changed, 71 insertions(+) diff --git a/docs

[PATCH v5 7/8] hw/arm: Set drive property for at24c eeprom

2022-07-14 Thread Hao Wu
This patch allows the user to attach an external drive as a property for an onboard at24c eeprom device. It uses an unit number to distinguish different devices. Signed-off-by: Hao Wu --- hw/arm/npcm7xx_boards.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git

[PATCH v5 6/8] hw/arm: npcm8xx_boards: EEPROMs can take bus as parameter

2022-07-14 Thread Hao Wu
We allow at24c_eeprom_init to take a I2CBus* as parameter. This allows us to attach an EEPROM device behind an I2C mux which is not possible with the old method. Signed-off-by: Hao Wu --- hw/arm/npcm7xx_boards.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git

[PATCH v5 4/8] hw/adc: Make adci[*] R/W in NPCM7XX ADC

2022-07-14 Thread Hao Wu
Our sensor test requires both reading and writing from a sensor's QOM property. So we need to make the input of ADC module R/W instead of write only for that to work. Signed-off-by: Hao Wu Reviewed-by: Titus Rwantare Reviewed-by: Peter Maydell --- hw/adc/npcm7xx_adc.c | 2 +- 1 file changed

[PATCH v5 2/8] hw/i2c: Read FIFO during RXF_CTL change in NPCM7XX SMBus

2022-07-14 Thread Hao Wu
Originally we read in from SMBus when RXF_STS is cleared. However, the driver clears RXF_STS before setting RXF_CTL, causing the SM bus module to read incorrect amount of bytes in FIFO mode when the number of bytes read changed. This patch fixes this issue. Signed-off-by: Hao Wu Reviewed

[PATCH v5 3/8] hw/adc: Fix CONV bit in NPCM7XX ADC CON register

2022-07-14 Thread Hao Wu
The correct bit for the CONV bit in NPCM7XX ADC is bit 13. This patch fixes that in the module, and also lower the IRQ when the guest is done handling an interrupt event from the ADC module. Signed-off-by: Hao Wu Reviewed-by: Patrick Venture Reviewed-by: Peter Maydell --- hw/adc/npcm7xx_adc.c

[PATCH v5 8/8] hw/arm: quanta-gbs-bmc add i2c devices

2022-07-14 Thread Hao Wu
From: Patrick Venture Adds supported i2c devices to the quanta-gbc-bmc board. Signed-off-by: Patrick Venture Reviewed-by: Hao Wu --- hw/arm/npcm7xx_boards.c | 82 - 1 file changed, 49 insertions(+), 33 deletions(-) diff --git a/hw/arm/npcm7xx_boards.c

[PATCH v5 1/8] hw/i2c: Clear ACK bit in NPCM7xx SMBus module

2022-07-14 Thread Hao Wu
The ACK bit in NPCM7XX SMBus module should be cleared each time it sends out a NACK signal. This patch fixes the bug that it fails to do so. Signed-off-by: Hao Wu Reviewed-by: Titus Rwantare Reviewed-by: Peter Maydell --- hw/i2c/npcm7xx_smbus.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v5 5/8] blockdev: Add a new IF type IF_OTHER

2022-07-14 Thread Hao Wu
This type is used to represent block devs that are not suitable to be represented by other existing types. A sample use is to represent an at24c eeprom device defined in hw/nvram/eeprom_at24c.c. The block device can be used to contain the content of the said eeprom device. Signed-off-by: Hao Wu

[PATCH v5 0/8] Misc NPCM7XX patches

2022-07-14 Thread Hao Wu
variable in patch 5. -- Changes since v1: 1. Rewrote patch 5 to implement the function in NPCM7xx board file instead of the EEPROM device file. 2. Slightly modify patch 6 to adapt to the changes and QEMU comment style. 3. Squash patch 7 into patch 5 to make it compile. 4. Add a new patch 7. Hao

[PATCH 3/8] hw/adc: Fix CONV bit in NPCM7XX ADC CON register

2022-07-14 Thread Hao Wu
The correct bit for the CONV bit in NPCM7XX ADC is bit 13. This patch fixes that in the module, and also lower the IRQ when the guest is done handling an interrupt event from the ADC module. Signed-off-by: Hao Wu Reviewed-by: Patrick Venture Reviewed-by: Peter Maydell --- hw/adc/npcm7xx_adc.c

[PATCH 1/8] hw/i2c: Clear ACK bit in NPCM7xx SMBus module

2022-07-14 Thread Hao Wu
The ACK bit in NPCM7XX SMBus module should be cleared each time it sends out a NACK signal. This patch fixes the bug that it fails to do so. Signed-off-by: Hao Wu Reviewed-by: Titus Rwantare Reviewed-by: Peter Maydell --- hw/i2c/npcm7xx_smbus.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 5/8] blockdev: Add a new IF type IF_OTHER

2022-07-14 Thread Hao Wu
This type is used to represent block devs that are not suitable to be represented by other existing types. A sample use is to represent an at24c eeprom device defined in hw/nvram/eeprom_at24c.c. The block device can be used to contain the content of the said eeprom device. Signed-off-by: Hao Wu

[PATCH 4/8] hw/adc: Make adci[*] R/W in NPCM7XX ADC

2022-07-14 Thread Hao Wu
Our sensor test requires both reading and writing from a sensor's QOM property. So we need to make the input of ADC module R/W instead of write only for that to work. Signed-off-by: Hao Wu Reviewed-by: Titus Rwantare Reviewed-by: Peter Maydell --- hw/adc/npcm7xx_adc.c | 2 +- 1 file changed

[PATCH 2/8] hw/i2c: Read FIFO during RXF_CTL change in NPCM7XX SMBus

2022-07-14 Thread Hao Wu
Originally we read in from SMBus when RXF_STS is cleared. However, the driver clears RXF_STS before setting RXF_CTL, causing the SM bus module to read incorrect amount of bytes in FIFO mode when the number of bytes read changed. This patch fixes this issue. Signed-off-by: Hao Wu Reviewed

[PATCH 0/8] Misc NPCM7XX patches

2022-07-14 Thread Hao Wu
variable in patch 5. -- Changes since v1: 1. Rewrote patch 5 to implement the function in NPCM7xx board file instead of the EEPROM device file. 2. Slightly modify patch 6 to adapt to the changes and QEMU comment style. 3. Squash patch 7 into patch 5 to make it compile. 4. Add a new patch 7. Hao

[PATCH 8/8] hw/arm: quanta-gbs-bmc add i2c devices

2022-07-14 Thread Hao Wu
From: Patrick Venture Adds supported i2c devices to the quanta-gbc-bmc board. Signed-off-by: Patrick Venture Reviewed-by: Hao Wu --- hw/arm/npcm7xx_boards.c | 82 - 1 file changed, 49 insertions(+), 33 deletions(-) diff --git a/hw/arm/npcm7xx_boards.c

[PATCH 3/8] hw/adc: Fix CONV bit in NPCM7XX ADC CON register

2022-07-14 Thread Hao Wu
The correct bit for the CONV bit in NPCM7XX ADC is bit 13. This patch fixes that in the module, and also lower the IRQ when the guest is done handling an interrupt event from the ADC module. Signed-off-by: Hao Wu Reviewed-by: Patrick Venture Reviewed-by: Peter Maydell --- hw/adc/npcm7xx_adc.c

[PATCH 7/8] hw/arm: Set drive property for at24c eeprom

2022-07-14 Thread Hao Wu
This patch allows the user to attach an external drive as a property for an onboard at24c eeprom device. It uses an unit number to distinguish different devices. Signed-off-by: Hao Wu --- hw/arm/npcm7xx_boards.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git

[PATCH 1/8] hw/i2c: Clear ACK bit in NPCM7xx SMBus module

2022-07-14 Thread Hao Wu
The ACK bit in NPCM7XX SMBus module should be cleared each time it sends out a NACK signal. This patch fixes the bug that it fails to do so. Signed-off-by: Hao Wu Reviewed-by: Titus Rwantare Reviewed-by: Peter Maydell --- hw/i2c/npcm7xx_smbus.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 4/8] hw/adc: Make adci[*] R/W in NPCM7XX ADC

2022-07-14 Thread Hao Wu
Our sensor test requires both reading and writing from a sensor's QOM property. So we need to make the input of ADC module R/W instead of write only for that to work. Signed-off-by: Hao Wu Reviewed-by: Titus Rwantare Reviewed-by: Peter Maydell --- hw/adc/npcm7xx_adc.c | 2 +- 1 file changed

[PATCH 6/8] hw/arm: npcm8xx_boards: EEPROMs can take bus as parameter

2022-07-14 Thread Hao Wu
We allow at24c_eeprom_init to take a I2CBus* as parameter. This allows us to attach an EEPROM device behind an I2C mux which is not possible with the old method. Signed-off-by: Hao Wu --- hw/arm/npcm7xx_boards.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git

[PATCH 2/8] hw/i2c: Read FIFO during RXF_CTL change in NPCM7XX SMBus

2022-07-14 Thread Hao Wu
Originally we read in from SMBus when RXF_STS is cleared. However, the driver clears RXF_STS before setting RXF_CTL, causing the SM bus module to read incorrect amount of bytes in FIFO mode when the number of bytes read changed. This patch fixes this issue. Signed-off-by: Hao Wu Reviewed

[PATCH 5/8] blockdev: Add a new IF type IF_OTHER

2022-07-14 Thread Hao Wu
This type is used to represent block devs that are not suitable to be represented by other existing types. A sample use is to represent an at24c eeprom device defined in hw/nvram/eeprom_at24c.c. The block device can be used to contain the content of the said eeprom device. Signed-off-by: Hao Wu

[PATCH 0/8] Misc NPCM7XX patches

2022-07-14 Thread Hao Wu
variable in patch 5. -- Changes since v1: 1. Rewrote patch 5 to implement the function in NPCM7xx board file instead of the EEPROM device file. 2. Slightly modify patch 6 to adapt to the changes and QEMU comment style. 3. Squash patch 7 into patch 5 to make it compile. 4. Add a new patch 7. Hao

[PATCH] tests/qtest: Reduce npcm7xx_sdhci test image size

2022-06-09 Thread Hao Wu
Creating 1GB image for a simple qtest is unnecessary and could lead to failures. We reduce the image size to 1MB to reduce the test overhead. Signed-off-by: Hao Wu --- tests/qtest/npcm7xx_sdhci-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/npcm7xx_sdhci

Re: [PATCH v5] tests/qtest: add qtests for npcm7xx sdhci

2022-06-09 Thread Hao Wu
: > > > On Thu, May 26, 2022 at 8:54 AM Peter Maydell > wrote: > >> On Fri, 25 Feb 2022 at 17:45, Hao Wu wrote: >> > >> > From: Shengtan Mao >> > >> > Reviewed-by: Hao Wu >> > Reviewed-by: Chris Rauer >> > Signed-off-by: Shen

Re: [PATCH] qtest/npcm7xx_pwm-test: Fix memory leak in mft_qom_set

2022-05-31 Thread Hao Wu
On Tue, May 31, 2022 at 6:18 AM Miaoqian Lin wrote: > g_strdup_printf() allocated memory for path, we should free it with > g_free() when no longer needed. > > Signed-off-by: Miaoqian Lin > Reviewed-by: Hao Wu > --- > tests/qtest/npcm7xx_pwm-test.c | 3 +++ > 1 fi

Re: [PATCH for-7.1 00/11] hw/arm: Add NPCM8XX support

2022-04-21 Thread Hao Wu
Thu, 21 Apr 2022 at 17:29, Hao Wu wrote: > > > > Thanks for all the comments you gave! I'll go over and address them > recently. > > > > For this question, The actual CPU should be cortex A35. However, I don't > see > > them supported in QEMU. If I inserted CPU

Re: [PATCH for-7.1 00/11] hw/arm: Add NPCM8XX support

2022-04-21 Thread Hao Wu
35-arm-cpu' What should I do here? On Thu, Apr 21, 2022 at 3:45 AM Peter Maydell wrote: > On Tue, 5 Apr 2022 at 23:37, Hao Wu wrote: > > > > NPCM8XX BMCs are the successors of the NPCM7XX BMCs. They feature > > quad-core ARM Cortex A35 that supports both 32 bits and 6

[PATCH v2 1/2] hw/misc: Add PWRON STRAP bit fields in GCR module

2022-04-11 Thread Hao Wu
Similar to the Aspeed code in include/misc/aspeed_scu.h, we define the PWRON STRAP fields in their corresponding module for NPCM7XX. Signed-off-by: Hao Wu Reviewed-by: Patrick Venture --- include/hw/misc/npcm7xx_gcr.h | 30 ++ 1 file changed, 30 insertions(+) diff

[PATCH v2 2/2] hw/arm: Use bit fields for NPCM7XX PWRON STRAPs

2022-04-11 Thread Hao Wu
This patch uses the defined fields to describe PWRON STRAPs for better readability. Signed-off-by: Hao Wu Reviewed-by: Patrick Venture --- hw/arm/npcm7xx_boards.c | 24 +++- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm

[PATCH v2 0/2] Define NPCM7XX PWRON bit fields

2022-04-11 Thread Hao Wu
. -- Changes since v1 * Fix errors and apply suggestions Peter made on v1. Hao Wu (2): hw/misc: Add PWRON STRAP bit fields in GCR module hw/arm: Use bit fields for NPCM7XX PWRON STRAPs hw/arm/npcm7xx_boards.c | 24 +++- include/hw/misc/npcm7xx_gcr.h | 30

[PATCH 1/2] hw/misc: Add PWRON STRAP bit fields in GCR module

2022-04-06 Thread Hao Wu
Similar to the Aspeed code in include/misc/aspeed_scu.h, we define the PWRON STRAP fields in their corresponding module for NPCM7XX. Signed-off-by: Hao Wu Reviewed-by: Patrick Venture --- include/hw/misc/npcm7xx_gcr.h | 30 ++ 1 file changed, 30 insertions(+) diff

[PATCH 2/2] hw/arm: Use bit fields for NPCM7XX PWRON STRAPs

2022-04-06 Thread Hao Wu
This patch uses the defined fields to describe PWRON STRAPs for better readability. Signed-off-by: Hao Wu Reviewed-by: Patrick Venture --- hw/arm/npcm7xx_boards.c | 24 +++- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm

[PATCH 0/2] Define NPCM7XX PWRON bit fields

2022-04-06 Thread Hao Wu
. Hao Wu (2): hw/misc: Add PWRON STRAP bit fields in GCR module hw/arm: Use bit fields for NPCM7XX PWRON STRAPs hw/arm/npcm7xx_boards.c | 24 +++- include/hw/misc/npcm7xx_gcr.h | 30 ++ 2 files changed, 49 insertions(+), 5 deletions

[PATCH for-7.1 09/11] pc-bios: Add NPCM8xx Bootrom

2022-04-05 Thread Hao Wu
The bootrom is a minimal bootrom that can be used to bring up an NPCM845 Linux kernel. Its source code can be found at github.com/google/vbootrom/tree/master/npcm8xx Signed-off-by: Hao Wu Reviwed-by: Titus Rwantare --- pc-bios/npcm8xx_bootrom.bin | Bin 0 -> 608 bytes 1 file changed

[PATCH for-7.1 11/11] hw/arm: Add NPCM845 Evaluation board

2022-04-05 Thread Hao Wu
Signed-off-by: Hao Wu Reviwed-by: Patrick Venture --- hw/arm/meson.build | 2 +- hw/arm/npcm8xx_boards.c | 257 +++ include/hw/arm/npcm8xx.h | 20 +++ 3 files changed, 278 insertions(+), 1 deletion(-) create mode 100644 hw/arm/npcm8xx_boards.c

[PATCH for-7.1 05/11] hw/misc: Store DRAM size in NPCM8XX GCR Module

2022-04-05 Thread Hao Wu
NPCM8XX boot block stores the DRAM size in SCRPAD_B register in GCR module. Since we don't simulate a detailed memory controller, we need to store this information directly similar to the NPCM7XX's INCTR3 register. Signed-off-by: Hao Wu Reviwed-by: Titus Rwantare --- hw/misc/npcm_gcr.c

[PATCH for-7.1 08/11] hw/net: Add NPCM8XX PCS Module

2022-04-05 Thread Hao Wu
The PCS exists in NPCM8XX's GMAC1 and is used to control the SGMII PHY. This implementation contains all the default registers and the soft reset feature that are required to load the Linux kernel driver. Further features have not been implemented yet. Signed-off-by: Hao Wu Reviewed-by: Titus

[PATCH for-7.1 07/11] hw/misc: Support 8-bytes memop in NPCM GCR module

2022-04-05 Thread Hao Wu
The NPCM8xx GCR device can be accessed with 64-bit memory operations. This patch supports that. Signed-off-by: Hao Wu Reviewed-by: Patrick Venture --- hw/misc/npcm_gcr.c | 98 +--- hw/misc/trace-events | 4 +- 2 files changed, 77 insertions(+), 25

[PATCH for-7.1 06/11] hw/intc: Add a property to allow GIC to reset into non secure mode

2022-04-05 Thread Hao Wu
This property allows certain boards like NPCM8xx to boot the kernel directly into non-secure mode. This is necessary since we do not support secure boot features for NPCM8xx now. Signed-off-by: Hao Wu Reviewed-by: Patrick Venture --- hw/intc/arm_gic_common.c | 2 ++ 1 file changed, 2

[PATCH for-7.1 03/11] hw/misc: Support NPCM8XX GCR module

2022-04-05 Thread Hao Wu
NPCM8XX has a different set of global control registers than 7XX. This patch supports that. Signed-off-by: Hao Wu Reviwed-by: Titus Rwantare --- MAINTAINERS | 9 +- hw/misc/meson.build | 2 +- hw/misc/npcm7xx_gcr.c

[PATCH for-7.1 01/11] docs/system/arm: Add Description for NPCM8XX SoC

2022-04-05 Thread Hao Wu
NPCM8XX SoC is the successor of the NPCM7XX. It features quad-core Cortex-A35 (Armv8, 64-bit) CPUs and some additional peripherals. Signed-off-by: Hao Wu Reviewed-by: Patrick Venture --- docs/system/arm/nuvoton.rst | 20 +++- 1 file changed, 15 insertions(+), 5 deletions

[PATCH for-7.1 04/11] hw/misc: Support NPCM8XX CLK Module Registers

2022-04-05 Thread Hao Wu
. Implementation of these clocks might be required when implementing these modules. Signed-off-by: Hao Wu Reviewed-by: Titus Rwantare --- hw/misc/meson.build | 2 +- hw/misc/{npcm7xx_clk.c => npcm_clk.c} | 238 ++ hw/misc/trace-eve

[PATCH for-7.1 10/11] hw/arm: Add NPCM8XX SoC

2022-04-05 Thread Hao Wu
The file contains a basic NPCM8XX SOC file. It's forked from the NPCM7XX SOC with some changes. Signed-off-by: Hao Wu Reviwed-by: Patrick Venture Reviwed-by: Titus Rwantare --- configs/devices/aarch64-softmmu/default.mak | 1 + hw/arm/Kconfig | 11 + hw/arm

[PATCH for-7.1 02/11] hw/ssi: Make flash size a property in NPCM7XX FIU

2022-04-05 Thread Hao Wu
This allows different FIUs to have different flash sizes, useful in NPCM8XX which has multiple different sized FIU modules. Signed-off-by: Hao Wu Reviewed-by: Patrick Venture --- hw/arm/npcm7xx.c | 6 ++ hw/ssi/npcm7xx_fiu.c | 6 ++ include/hw/ssi/npcm7xx_fiu.h | 1

[PATCH for-7.1 00/11] hw/arm: Add NPCM8XX support

2022-04-05 Thread Hao Wu
be found at: https://github.com/Nuvoton-Israel/openbmc/tree/npcm-v2.10/meta-evb/meta-evb-nuvoton/meta-evb-npcm845 The patch set can boot the evaluation board image built from the source above to login prompt. Hao Wu (11): docs/system/arm: Add Description for NPCM8XX SoC hw/ssi: Make flash size

Re: [PATCH] hw/misc/npcm7xx_clk: Don't leak string in npcm7xx_clk_sel_init()

2022-03-08 Thread Hao Wu
gt; > (Detected with the clang leak sanitizer.) > > > > Signed-off-by: Peter Maydell > > --- > > hw/misc/npcm7xx_clk.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > Reviewed-by: Richard Henderson > > Reviewed-by: Hao Wu > r~ > >

[PATCH v5] tests/qtest: add qtests for npcm7xx sdhci

2022-02-25 Thread Hao Wu
From: Shengtan Mao Reviewed-by: Hao Wu Reviewed-by: Chris Rauer Signed-off-by: Shengtan Mao Signed-off-by: Patrick Venture --- v5 * use memcmp to compare whether strings are expected v4 * use strncmp instead of strcmp v3: * fixup compilation from missing macro value v2: * update

Re: [PATCH v4] tests/qtest: add qtests for npcm7xx sdhci

2022-02-25 Thread Hao Wu
I have sent an updated version that uses memcmp() On Fri, Feb 25, 2022 at 3:44 AM Peter Maydell wrote: > On Thu, 24 Feb 2022 at 19:03, Hao Wu wrote: > > > > From: Shengtan Mao > > > > Reviewed-by: Hao Wu > > Reviewed-by: Chris Rauer > > Sign

[PATCH v4] tests/qtest: add qtests for npcm7xx sdhci

2022-02-24 Thread Hao Wu
From: Shengtan Mao Reviewed-by: Hao Wu Reviewed-by: Chris Rauer Signed-off-by: Shengtan Mao Signed-off-by: Patrick Venture Signed-off-by: Hao Wu --- v4: * use strncmp to compare fixed length strings v3: * fixup compilation from missing macro value v2: * update copyright year * check

Re: [PATCH v3] tests/qtest: add qtests for npcm7xx sdhci

2022-02-24 Thread Hao Wu
issue. On Tue, Feb 22, 2022 at 5:28 PM Patrick Venture wrote: > > > On Mon, Feb 21, 2022 at 5:30 AM Peter Maydell > wrote: > >> On Wed, 16 Feb 2022 at 17:30, Peter Maydell >> wrote: >> > >> > On Tue, 8 Feb 2022 at 18:18, Patrick Venture >> wro

Re: [PATCH 2/2] Kconfig: Add 'imply I2C_DEVICES' on boards with available i2c bus

2022-02-08 Thread Hao Wu
On Tue, Feb 8, 2022 at 9:23 AM Peter Maydell wrote: > For arm boards with an i2c bus which a user could reasonably > want to plug arbitrary devices, add 'imply I2C_DEVICES' to the > Kconfig stanza. > > Signed-off-by: Peter Maydell > Reviewed-by: Hao Wu > --- > A

Re: [PATCH 1/2] Kconfig: Add I2C_DEVICES device group

2022-02-08 Thread Hao Wu
ing PMBus devices or devices which need GPIO lines to be > connected). > > Signed-off-by: Peter Maydell > Reviewed-by: Hao Wu > --- > Feel free to suggest other i2c devices that should be marked > as in the group; as I say, I erred on the side of not putting > devi

Re: [PATCH] hw/sensor: Add SB-TSI Temperature Sensor Interface

2022-01-27 Thread Hao Wu
On Thu, Jan 27, 2022 at 6:55 AM Corey Minyard wrote: > On Wed, Jan 26, 2022 at 04:09:03PM -0800, Hao Wu wrote: > > Hi, > > > > Sorry for the late reply. I'm not sure what "auto-increment" means here. > > The question is: When a value is read, does the ad

Re: [PATCH] hw/sensor: Add SB-TSI Temperature Sensor Interface

2022-01-26 Thread Hao Wu
AM Patrick Venture wrote: > > > On Mon, Jan 17, 2022 at 6:05 AM Corey Minyard wrote: > >> On Sun, Jan 09, 2022 at 06:17:34PM -0800, Patrick Venture wrote: >> > On Fri, Jan 7, 2022 at 7:04 PM Patrick Venture >> wrote: >> > >> > > From: Hao Wu &g

Re: [PATCH v2 03/13] hw/arm/npcm7xx_boards: Replace drive_get_next() by drive_get()

2021-11-17 Thread Hao Wu
_abort); > > } > > > > -static void sdhci_attach_drive(SDHCIState *sdhci) > > +static void sdhci_attach_drive(SDHCIState *sdhci, int unit) > > { > > -DriveInfo *di = drive_get_next(IF_SD); > > +DriveInfo *di =

[PATCH v4 5/7] blockdev: Add a new IF type IF_OTHER

2021-11-03 Thread Hao Wu
This type is used to represent block devs that are not suitable to be represented by other existing types. Signed-of-by: Hao Wu --- blockdev.c| 3 ++- include/sysemu/blockdev.h | 1 + meson | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git

[PATCH v4 4/7] hw/adc: Make adci[*] R/W in NPCM7XX ADC

2021-11-03 Thread Hao Wu
Our sensor test requires both reading and writing from a sensor's QOM property. So we need to make the input of ADC module R/W instead of write only for that to work. Signed-off-by: Hao Wu Reviewed-by: Titus Rwantare Reviewed-by: Peter Maydell --- hw/adc/npcm7xx_adc.c | 2 +- 1 file changed

[PATCH v4 7/7] hw/arm: quanta-gbs-bmc add i2c devices

2021-11-03 Thread Hao Wu
From: Patrick Venture Adds supported i2c devices to the quanta-gbc-bmc board. Signed-off-by: Patrick Venture Reviewed-by: Hao Wu --- hw/arm/npcm7xx_boards.c | 82 - 1 file changed, 49 insertions(+), 33 deletions(-) diff --git a/hw/arm/npcm7xx_boards.c

[PATCH v4 6/7] hw/nvram: Update at24c EEPROM init function in NPCM7xx boards

2021-11-03 Thread Hao Wu
with the same unit number, the following error will occur: `Device with id 'none85' exists`. Signed-off-by: Hao Wu --- hw/arm/npcm7xx_boards.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm/npcm7xx_boards.c index dec7d16ae5

[PATCH v4 1/7] hw/i2c: Clear ACK bit in NPCM7xx SMBus module

2021-11-03 Thread Hao Wu
The ACK bit in NPCM7XX SMBus module should be cleared each time it sends out a NACK signal. This patch fixes the bug that it fails to do so. Signed-off-by: Hao Wu Reviewed-by: Titus Rwantare Reviewed-by: Peter Maydell --- hw/i2c/npcm7xx_smbus.c | 2 +- 1 file changed, 1 insertion(+), 1

  1   2   3   >