[PATCH v2 0/6] hw/i2c: Add NPCM7XX SMBus Device

wuhaotsh--- via posted 6 patches 3 years, 3 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210129005845.416272-1-wuhaotsh@google.com
Maintainers: Thomas Huth <thuth@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Tyrone Ting <kfting@nuvoton.com>, Havard Skinnemoen <hskinnemoen@google.com>, Peter Maydell <peter.maydell@linaro.org>
There is a newer version of this series
default-configs/devices/arm-softmmu.mak |    1 +
docs/system/arm/nuvoton.rst             |    2 +-
hw/arm/npcm7xx.c                        |   76 +-
hw/arm/npcm7xx_boards.c                 |   46 +
hw/i2c/meson.build                      |    1 +
hw/i2c/npcm7xx_smbus.c                  | 1097 +++++++++++++++++++++++
hw/i2c/trace-events                     |   12 +
include/hw/arm/npcm7xx.h                |    2 +
include/hw/i2c/npcm7xx_smbus.h          |  113 +++
tests/qtest/meson.build                 |    1 +
tests/qtest/npcm7xx_smbus-test.c        |  495 ++++++++++
11 files changed, 1821 insertions(+), 25 deletions(-)
create mode 100644 hw/i2c/npcm7xx_smbus.c
create mode 100644 include/hw/i2c/npcm7xx_smbus.h
create mode 100644 tests/qtest/npcm7xx_smbus-test.c
[PATCH v2 0/6] hw/i2c: Add NPCM7XX SMBus Device
Posted by wuhaotsh--- via 3 years, 3 months ago
This patch set implements the System manager bus (SMBus) module in NPCM7XX
SoC. Basically, it emulates the data transactions of the module, not the
SDA/SCL levels. We have also added a QTest which contains read and write
operations for both single-byte and FIFO mode, and added basic I2C devices
for npcm750-evb and quanta-gsj boards.

We also cleaned up the unimplemented GPIO devices in npcm7xx.c since they
are already implemented.

Changes since v1:
- Fix errors for i2c device addresses for temperature sensors in GSJ machine
- Use at24c device to emulate GSJ EEPROM. It supports more than 256 bytes.
- Fill in VMState in npcm7xx_smbus.c
- Change commit message in patch 3 and 4
- Fix order in npcm7xx.c IRQ list
- Add a few extra comments to make things clearer

Hao Wu (6):
  hw/arm: Remove GPIO from unimplemented NPCM7XX
  hw/i2c: Implement NPCM7XX SMBus Module Single Mode
  hw/arm: Add I2C sensors for NPCM750 eval board
  hw/arm: Add I2C sensors and EEPROM for GSJ machine
  hw/i2c: Add a QTest for NPCM7XX SMBus Device
  hw/i2c: Implement NPCM7XX SMBus Module FIFO Mode

 default-configs/devices/arm-softmmu.mak |    1 +
 docs/system/arm/nuvoton.rst             |    2 +-
 hw/arm/npcm7xx.c                        |   76 +-
 hw/arm/npcm7xx_boards.c                 |   46 +
 hw/i2c/meson.build                      |    1 +
 hw/i2c/npcm7xx_smbus.c                  | 1097 +++++++++++++++++++++++
 hw/i2c/trace-events                     |   12 +
 include/hw/arm/npcm7xx.h                |    2 +
 include/hw/i2c/npcm7xx_smbus.h          |  113 +++
 tests/qtest/meson.build                 |    1 +
 tests/qtest/npcm7xx_smbus-test.c        |  495 ++++++++++
 11 files changed, 1821 insertions(+), 25 deletions(-)
 create mode 100644 hw/i2c/npcm7xx_smbus.c
 create mode 100644 include/hw/i2c/npcm7xx_smbus.h
 create mode 100644 tests/qtest/npcm7xx_smbus-test.c

-- 
2.30.0.365.g02bc693789-goog


Re: [PATCH v2 0/6] hw/i2c: Add NPCM7XX SMBus Device
Posted by Peter Maydell 3 years, 2 months ago
On Fri, 29 Jan 2021 at 01:04, Hao Wu <wuhaotsh@google.com> wrote:
>
> This patch set implements the System manager bus (SMBus) module in NPCM7XX
> SoC. Basically, it emulates the data transactions of the module, not the
> SDA/SCL levels. We have also added a QTest which contains read and write
> operations for both single-byte and FIFO mode, and added basic I2C devices
> for npcm750-evb and quanta-gsj boards.
>
> We also cleaned up the unimplemented GPIO devices in npcm7xx.c since they
> are already implemented.
>
> Changes since v1:
> - Fix errors for i2c device addresses for temperature sensors in GSJ machine
> - Use at24c device to emulate GSJ EEPROM. It supports more than 256 bytes.
> - Fill in VMState in npcm7xx_smbus.c
> - Change commit message in patch 3 and 4
> - Fix order in npcm7xx.c IRQ list
> - Add a few extra comments to make things clearer
>
> Hao Wu (6):
>   hw/arm: Remove GPIO from unimplemented NPCM7XX
>   hw/i2c: Implement NPCM7XX SMBus Module Single Mode
>   hw/arm: Add I2C sensors for NPCM750 eval board
>   hw/arm: Add I2C sensors and EEPROM for GSJ machine
>   hw/i2c: Add a QTest for NPCM7XX SMBus Device
>   hw/i2c: Implement NPCM7XX SMBus Module FIFO Mode

Hi; I'm going to apply patch 1 to target-arm.next because it's not
really related to the others in the series. For the rest, I left
a couple of review comments but they're pretty minor.

thanks
-- PMM

Re: [PATCH v2 0/6] hw/i2c: Add NPCM7XX SMBus Device
Posted by Hao Wu 3 years, 2 months ago
Thanks. I'll take patch 1 out of the next version.

On Mon, Feb 8, 2021 at 9:01 AM Peter Maydell <peter.maydell@linaro.org>
wrote:

> On Fri, 29 Jan 2021 at 01:04, Hao Wu <wuhaotsh@google.com> wrote:
> >
> > This patch set implements the System manager bus (SMBus) module in
> NPCM7XX
> > SoC. Basically, it emulates the data transactions of the module, not the
> > SDA/SCL levels. We have also added a QTest which contains read and write
> > operations for both single-byte and FIFO mode, and added basic I2C
> devices
> > for npcm750-evb and quanta-gsj boards.
> >
> > We also cleaned up the unimplemented GPIO devices in npcm7xx.c since they
> > are already implemented.
> >
> > Changes since v1:
> > - Fix errors for i2c device addresses for temperature sensors in GSJ
> machine
> > - Use at24c device to emulate GSJ EEPROM. It supports more than 256
> bytes.
> > - Fill in VMState in npcm7xx_smbus.c
> > - Change commit message in patch 3 and 4
> > - Fix order in npcm7xx.c IRQ list
> > - Add a few extra comments to make things clearer
> >
> > Hao Wu (6):
> >   hw/arm: Remove GPIO from unimplemented NPCM7XX
> >   hw/i2c: Implement NPCM7XX SMBus Module Single Mode
> >   hw/arm: Add I2C sensors for NPCM750 eval board
> >   hw/arm: Add I2C sensors and EEPROM for GSJ machine
> >   hw/i2c: Add a QTest for NPCM7XX SMBus Device
> >   hw/i2c: Implement NPCM7XX SMBus Module FIFO Mode
>
> Hi; I'm going to apply patch 1 to target-arm.next because it's not
> really related to the others in the series. For the rest, I left
> a couple of review comments but they're pretty minor.
>
> thanks
> -- PMM
>