]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/gpio/aspeed: Support different memory region ops
authorJamin Lin <jamin_lin@aspeedtech.com>
Tue, 1 Oct 2024 02:43:29 +0000 (10:43 +0800)
committerCédric Le Goater <clg@redhat.com>
Thu, 24 Oct 2024 05:57:47 +0000 (07:57 +0200)
commit404e75343c3faef7d8e042dd3ad3153a9815ade1
tree43e33e2107e262c32fdffb8ab4572de42d0da198
parent9422dbd10b759a558de8b620ade4686d407fc63f
hw/gpio/aspeed: Support different memory region ops

It set "aspeed_gpio_ops" struct which containing read and write callbacks
to be used when I/O is performed on the GPIO region.

Besides, in the previous design of ASPEED SOCs, one register is used for
setting one function for 32 GPIO pins.
ex: GPIO000 is used for setting data value for GPIO A, B, C and D in AST2600.
ex: GPIO004 is used for setting direction for GPIO A, B, C and D in AST2600.

However, the register set have a significant change in AST2700.
Each GPIO pin has their own control register. In other words, users are able to
set one GPIO pin’s direction, interrupt enable, input mask and so on
in one register. The aspeed_gpio_read/aspeed_gpio_write callback functions
are not compatible AST2700.

Introduce a new "const MemoryRegionOps *" attribute in AspeedGPIOClass and
use it in aspeed_gpio_realize function.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
hw/gpio/aspeed_gpio.c
include/hw/gpio/aspeed_gpio.h