Skip to contentSkip to conversation

gpio: designware gpio driver

PATCH In review Ben Dooks 2 participants 5 messages Jul 13, 2022 – Jul 18, 2022 Arm/Amlogic Meson SoC support

lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

PATCH 1/1 gpio: designware gpio driver

A model for the DesignWare GPIO (v1) block.

---
 hw/gpio/Kconfig                   |   3 +
 hw/gpio/designware_gpio.c         | 327 ++++++++++++++++++++++++++++++
 hw/gpio/meson.build               |   1 +
 hw/gpio/trace-events              |   7 +
 include/hw/gpio/designware_gpio.h |  89 ++++++++
 5 files changed, 427 insertions(+)
 create mode 100644 hw/gpio/designware_gpio.c
 create mode 100644 include/hw/gpio/designware_gpio.h
hw/gpio/Kconfig +3 -0
index f0e7405f6e..e5883d9763 100644
@@ -13,3 +13,6 @@ config GPIO_PWR
 
 config SIFIVE_GPIO
     bool
+
+config DESIGNWARE_GPIO
+    bool
\ No newline at end of file
hw/gpio/designware_gpio.c new file +327 -0

327 lines not on this page · raw message

hw/gpio/meson.build +1 -0
index 7bd6a57264..66959c33de 100644
@@ -5,6 +5,7 @@ softmmu_ss.add(when: 'CONFIG_MAX7310', if_true: files('max7310.c'))
 softmmu_ss.add(when: 'CONFIG_PL061', if_true: files('pl061.c'))
 softmmu_ss.add(when: 'CONFIG_ZAURUS', if_true: files('zaurus.c'))
 
+softmmu_ss.add(when: 'CONFIG_DESIGNWARE_GPIO', if_true: files('designware_gpio.c'))
 softmmu_ss.add(when: 'CONFIG_IMX', if_true: files('imx_gpio.c'))
 softmmu_ss.add(when: 'CONFIG_NPCM7XX', if_true: files('npcm7xx_gpio.c'))
 softmmu_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_gpio.c'))
hw/gpio/trace-events +7 -0
index 9736b362ac..45dac8b706 100644
@@ -31,3 +31,10 @@ sifive_gpio_update_output_irq(int64_t line, int64_t value) "line %" PRIi64 " val
 # aspeed_gpio.c
 aspeed_gpio_read(uint64_t offset, uint64_t value) "offset: 0x%" PRIx64 " value 0x%" PRIx64
 aspeed_gpio_write(uint64_t offset, uint64_t value) "offset: 0x%" PRIx64 " value 0x%" PRIx64
+
+# designware_gpio
+designware_gpio_read(uint64_t offset, uint64_t r) "offset 0x%" PRIx64 " value 0x%" PRIx64
+designware_gpio_write(uint64_t offset, uint64_t value) "offset 0x%" PRIx64 " value 0x%" PRIx64
+designware_gpio_set(int64_t line, int64_t value) "line %" PRIi64 " value %" PRIi64
+designware_gpio_update_output_irq(int64_t value) " value %" PRIi64
+
include/hw/gpio/designware_gpio.h new file +89 -0

89 lines not on this page · raw message

Signature · 1 line
2.35.1
author
#1 lore raw
Quoted 1 line · Ben Dooks

A model for the DesignWare GPIO (v1) block.

Is there anyone else who should be reviewing these that was missed off the original list? I'd like to get an idea if there is any work to do. I've got a couple more drivers to submit and was waiting on feedback from this before getting these submitted.

Signature · 1 line
Ben
#2 lore raw
Quoted 9 lines · Ben Dooks
Quoted 1 line · Ben Dooks

A model for the DesignWare GPIO (v1) block.

Is there anyone else who should be reviewing these that was missed off the original list? I'd like to get an idea if there is any work to do. I've got a couple more drivers to submit and was waiting on feedback from this before getting these submitted.

My overall feedback is: this isn't a pluggable device (PCI, etc), so what's it intended to be used by? Generally we don't take device models except when there's a board model that's using them.

thanks
-- PMM

author
#3 lore raw
Quoted 12 lines · Peter Maydell
Quoted 9 lines · Ben Dooks
Quoted 1 line · Ben Dooks

A model for the DesignWare GPIO (v1) block.

Is there anyone else who should be reviewing these that was missed off the original list? I'd like to get an idea if there is any work to do. I've got a couple more drivers to submit and was waiting on feedback from this before getting these submitted.

Quoted 3 lines

My overall feedback is: this isn't a pluggable device (PCI, etc), so what's it intended to be used by? Generally we don't take device models except when there's a board model that's using them.

I have a board file, but that's currently under NDA, so we're not allowed to release it at the moment. However we've done a few drivers which we'd like to get out of our development tree which other people might find useful (GPIO, SPI, I2C).

Signature · 1 line
Ben
#4 lore raw
Quoted 14 lines · Ben Dooks
Quoted 12 lines · Peter Maydell
Quoted 9 lines · Ben Dooks
Quoted 1 line · Ben Dooks

A model for the DesignWare GPIO (v1) block.

Is there anyone else who should be reviewing these that was missed off the original list? I'd like to get an idea if there is any work to do. I've got a couple more drivers to submit and was waiting on feedback from this before getting these submitted.

Quoted 8 lines
Quoted 3 lines

My overall feedback is: this isn't a pluggable device (PCI, etc), so what's it intended to be used by? Generally we don't take device models except when there's a board model that's using them.

I have a board file, but that's currently under NDA, so we're not allowed to release it at the moment. However we've done a few drivers which we'd like to get out of our development tree which other people might find useful (GPIO, SPI, I2C).

As I say, we don't really accept those, because we have no way of testing them upstream unless they're used in a board file:
they're dead code from our point of view. When you have a board model you're ready to submit you can send them in the same patchseries as the board model.

thanks
-- PMM