hw: aspeed_gpio: MMIO region fix and cleanups
Joel Stanley
maintainerv2 cover hw: aspeed_gpio: MMIO region fix and cleanups
This fixes the MMIO region so that the rtc works again on the ast2600. The two patches after that are cleanups.
Joel Stanley (3):
hw: aspeed_gpio: Fix memory size
hw: aspeed_gpio: Simplify 1.8V defines
hw: aspeed_gpio: Clarify GPIO controller name
hw/gpio/aspeed_gpio.c | 100 +++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 51 deletions(-)
Signature · 1 line
2.32.0
Joel Stanley
maintainerPATCH v2 1/3 hw: aspeed_gpio: Fix memory size
The macro used to calculate the maximum memory size of the MMIO region had a mistake, causing all GPIO models to create a mapping of 0x9D8. The intent was to have it be 0x9D8 - 0x800.
This extra size doesn't matter on ast2400 and ast2500, which have a 4KB region set aside for the GPIO controller.
On the ast2600 the 3.3V and 1.8V GPIO controllers are 2KB apart, so the regions would overlap. Worse was the 1.8V controller would map over the top of the following perianal, which happens to be the RTC.
The mmio region used by each device is a maximum of 2KB, so avoid the calculations and hard code this as the maximum.
--- hw/gpio/aspeed_gpio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
hw/gpio/aspeed_gpio.c +1 -2
@@ -207,7 +207,6 @@#define GPIO_1_8V_MEM_SIZE 0x9D8#define GPIO_1_8V_REG_ARRAY_SIZE ((GPIO_1_8V_MEM_SIZE - \ GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_MAX_MEM_SIZE MAX(GPIO_3_6V_MEM_SIZE, GPIO_1_8V_MEM_SIZE)static int aspeed_evaluate_irq (GPIOSets *regs,int gpio_prev_high,int gpio) {
@@ -849,7 +848,7 @@ static void aspeed_gpio_realize(DeviceState *dev, Error **errp) }memory_region_init_io (&s->iomem,OBJECT (s), &aspeed_gpio_ops, s, -TYPE_ASPEED_GPIO ,GPIO_MAX_MEM_SIZE ); +TYPE_ASPEED_GPIO ,0x800 );sysbus_init_mmio (sbd, &s->iomem); }
Signature · 1 line
2.32.0
Re: [PATCH v2 1/3] hw: aspeed_gpio: Fix memory size
Quoted 15 lines · Joel Stanley
The macro used to calculate the maximum memory size of the MMIO region
had a mistake, causing all GPIO models to create a mapping of0x9D8. The intent was to have it be0x9D8-0x800.This extra size doesn't matter on ast2400 and ast2500, which have a 4KB
region set aside for the GPIO controller.On the ast2600 the 3.3V and 1.8V GPIO controllers are 2KB apart, so the
regions would overlap. Worse was the 1.8V controller would map over the
top of the following perianal, which happens to be the RTC.
Quoted 6 lines
The mmio region used by each device is a maximum of 2KB, so avoid the calculations and hard code this as the maximum.
Fixes 36d737ee82b2 ("hw/gpio: Add in AST2600 specificimplementation")
Signed-off-by Joel Stanley <[email protected]>
derp. Sorry about that. This looks correct.
Quoted 28 lines
---
hw/gpio/aspeed_gpio.c | 3 +--1 file changed, 1 insertion(+), 2 deletions(-)hw/gpio/aspeed_gpio.c +0
-1@@ -207,7 +207,6 @@ #define GPIO_1_8V_MEM_SIZE 0x9D8 #define GPIO_1_8V_REG_ARRAY_SIZE ((GPIO_1_8V_MEM_SIZE - \ GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_MAX_MEM_SIZE MAX(GPIO_3_6V_MEM_SIZE, GPIO_1_8V_MEM_SIZE)
static intaspeed_evaluate_irq(GPIOSets *regs, int gpio_prev_high, int gpio)
{hw/gpio/aspeed_gpio.c +0
-0@@ -849,7 +848,7 @@ static void aspeed_gpio_realize(DeviceState *dev, Error **errp) }
memory_region_init_io(&s->iomem, OBJECT(s),&aspeed_gpio_ops, s, -TYPE_ASPEED_GPIO,GPIO_MAX_MEM_SIZE);
+TYPE_ASPEED_GPIO,0x800);
sysbus_init_mmio(sbd, &s->iomem);
}
Re: [SPAM] [PATCH v2 1/3] hw: aspeed_gpio: Fix memory size
In reply to Joel StanleyQuoted 11 lines · Joel Stanley
The macro used to calculate the maximum memory size of the MMIO region had a mistake, causing all GPIO models to create a mapping of
0x9D8. The intent was to have it be0x9D8-0x800.This extra size doesn't matter on ast2400 and ast2500, which have a 4KB region set aside for the GPIO controller.
On the ast2600 the 3.3V and 1.8V GPIO controllers are 2KB apart, so the regions would overlap. Worse was the 1.8V controller would map over the top of the following perianal, which happens to be the RTC.
Quoted 5 lines
The mmio region used by each device is a maximum of 2KB, so avoid the calculations and hard code this as the maximum.
Fixes 36d737ee82b2 ("hw/gpio: Add in AST2600 specific implementation")Signed-off-by Joel Stanley <[email protected]>
Quoted 26 lines
--- hw/gpio/aspeed_gpio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)hw/gpio/aspeed_gpio.c +1
-2@@ -207,7 +207,6 @@#define GPIO_1_8V_MEM_SIZE 0x9D8#define GPIO_1_8V_REG_ARRAY_SIZE ((GPIO_1_8V_MEM_SIZE - \ GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_MAX_MEM_SIZE MAX(GPIO_3_6V_MEM_SIZE, GPIO_1_8V_MEM_SIZE)static int aspeed_evaluate_irq (GPIOSets *regs,int gpio_prev_high,int gpio) {@@ -849,7 +848,7 @@ static void aspeed_gpio_realize(DeviceState *dev, Error **errp) }memory_region_init_io (&s->iomem,OBJECT (s), &aspeed_gpio_ops, s, -TYPE_ASPEED_GPIO ,GPIO_MAX_MEM_SIZE ); +TYPE_ASPEED_GPIO ,0x800 );sysbus_init_mmio (sbd, &s->iomem); }
Joel Stanley
maintainerRe: [SPAM] [PATCH v2 1/3] hw: aspeed_gpio: Fix memory size
Quoted 13 lines · Cédric Le Goater
Quoted 11 lines · Joel Stanley
The macro used to calculate the maximum memory size of the MMIO region had a mistake, causing all GPIO models to create a mapping of
0x9D8. The intent was to have it be0x9D8-0x800.This extra size doesn't matter on ast2400 and ast2500, which have a 4KB region set aside for the GPIO controller.
On the ast2600 the 3.3V and 1.8V GPIO controllers are 2KB apart, so the regions would overlap. Worse was the 1.8V controller would map over the top of the following perianal, which happens to be the RTC.
Quoted 7 lines
Quoted 5 lines
The mmio region used by each device is a maximum of 2KB, so avoid the calculations and hard code this as the maximum.
Fixes 36d737ee82b2 ("hw/gpio: Add in AST2600 specific implementation")Signed-off-by Joel Stanley <[email protected]>Reviewed-by Cédric Le Goater <[email protected]>
Cedric, Peter; can we please get this merged for 6.1? Without it the RTC model is not functional on the ast2500.
The other patches in this series are cleanups that can wait for future releases.
Cheers,
Joel
Quoted 28 lines
Quoted 27 lines
--- hw/gpio/aspeed_gpio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)hw/gpio/aspeed_gpio.c +1
-2@@ -207,7 +207,6 @@#define GPIO_1_8V_MEM_SIZE 0x9D8#define GPIO_1_8V_REG_ARRAY_SIZE ((GPIO_1_8V_MEM_SIZE - \ GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_MAX_MEM_SIZE MAX(GPIO_3_6V_MEM_SIZE, GPIO_1_8V_MEM_SIZE)static int aspeed_evaluate_irq (GPIOSets *regs,int gpio_prev_high,int gpio) {@@ -849,7 +848,7 @@ static void aspeed_gpio_realize(DeviceState *dev, Error **errp) }memory_region_init_io (&s->iomem,OBJECT (s), &aspeed_gpio_ops, s, -TYPE_ASPEED_GPIO ,GPIO_MAX_MEM_SIZE ); +TYPE_ASPEED_GPIO ,0x800 );sysbus_init_mmio (sbd, &s->iomem); }
Re: [SPAM] [PATCH v2 1/3] hw: aspeed_gpio: Fix memory size
Quoted 8 lines · Joel Stanley
Quoted 6 lines · Cédric Le Goater
Quoted 4 lines · Joel Stanley
The macro used to calculate the maximum memory size of the MMIO region had a mistake, causing all GPIO models to create a mapping of
0x9D8. The intent was to have it be0x9D8-0x800.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
This extra size doesn't matter on ast2400 and ast2500, which have a 4KB region set aside for the GPIO controller.
On the ast2600 the 3.3V and 1.8V GPIO controllers are 2KB apart, so the regions would overlap. Worse was the 1.8V controller would map over the top of the following perianal, which happens to be the RTC.
I'm going to assume this is an unfortunate autocorrect for "following peripheral", and will tweak the commit message...
Quoted 11 lines
Quoted 8 lines
Quoted 6 lines
The mmio region used by each device is a maximum of 2KB, so avoid the calculations and hard code this as the maximum.
Fixes 36d737ee82b2 ("hw/gpio: Add in AST2600 specific implementation")Signed-off-by Joel Stanley <[email protected]>Reviewed-by Cédric Le Goater <[email protected]>Cedric, Peter; can we please get this merged for 6.1? Without it the RTC model is not functional on the ast2500.
I'm doing an arm pullreq today so I'll put it into that.
thanks
-- PMM
Joel Stanley
maintainerPATCH v2 2/3 hw: aspeed_gpio: Simplify 1.8V defines
In reply to Joel StanleyThere's no need to define the registers relative to the 0x800 offset where the controller is mapped, as the device is instantiated as it's own model at the correct memory address.
Simplify the defines and remove the offset to save future confusion.
--- hw/gpio/aspeed_gpio.c | 73 +++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 37 deletions(-)
hw/gpio/aspeed_gpio.c +36 -37
@@ -169,44 +169,43 @@/* AST2600 only - 1.8V gpios */ /* -* The AST2600 has same 3.6V gpios as the AST2400 (memory offsets 0x0-0x198) -* and additional 1.8V gpios (memory offsets 0x800-0x9D4). +* The AST2600 two copies of the GPIO controller: the same 3.6V gpios as the +* AST2400 (memory offsets 0x0-0x198) and a second controller with 1.8V gpios +* (memory offsets 0x800-0x9D4). */ -#define GPIO_1_8V_REG_OFFSET 0x800 -#define GPIO_1_8V_ABCD_DATA_VALUE ((0x800 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_DIRECTION ((0x804 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_INT_ENABLE ((0x808 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_INT_SENS_0 ((0x80C - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_INT_SENS_1 ((0x810 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_INT_SENS_2 ((0x814 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_INT_STATUS ((0x818 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_RESET_TOLERANT ((0x81C - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_DATA_VALUE ((0x820 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_DIRECTION ((0x824 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_INT_ENABLE ((0x828 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_INT_SENS_0 ((0x82C - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_INT_SENS_1 ((0x830 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_INT_SENS_2 ((0x834 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_INT_STATUS ((0x838 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_RESET_TOLERANT ((0x83C - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_DEBOUNCE_1 ((0x840 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_DEBOUNCE_2 ((0x844 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_DEBOUNCE_1 ((0x848 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_DEBOUNCE_2 ((0x84C - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_DEBOUNCE_TIME_1 ((0x850 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_DEBOUNCE_TIME_2 ((0x854 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_DEBOUNCE_TIME_3 ((0x858 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_COMMAND_SRC_0 ((0x860 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_COMMAND_SRC_1 ((0x864 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_COMMAND_SRC_0 ((0x868 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_COMMAND_SRC_1 ((0x86C - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_DATA_READ ((0x8C0 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_DATA_READ ((0x8C4 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_INPUT_MASK ((0x9D0 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_INPUT_MASK ((0x9D4 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_MEM_SIZE 0x9D8 -#define GPIO_1_8V_REG_ARRAY_SIZE ((GPIO_1_8V_MEM_SIZE - \ - GPIO_1_8V_REG_OFFSET) >> 2) +#define GPIO_1_8V_ABCD_DATA_VALUE (0x000 >> 2) +#define GPIO_1_8V_ABCD_DIRECTION (0x004 >> 2) +#define GPIO_1_8V_ABCD_INT_ENABLE (0x008 >> 2) +#define GPIO_1_8V_ABCD_INT_SENS_0 (0x00C >> 2) +#define GPIO_1_8V_ABCD_INT_SENS_1 (0x010 >> 2) +#define GPIO_1_8V_ABCD_INT_SENS_2 (0x014 >> 2) +#define GPIO_1_8V_ABCD_INT_STATUS (0x018 >> 2) +#define GPIO_1_8V_ABCD_RESET_TOLERANT (0x01C >> 2) +#define GPIO_1_8V_E_DATA_VALUE (0x020 >> 2) +#define GPIO_1_8V_E_DIRECTION (0x024 >> 2) +#define GPIO_1_8V_E_INT_ENABLE (0x028 >> 2) +#define GPIO_1_8V_E_INT_SENS_0 (0x02C >> 2) +#define GPIO_1_8V_E_INT_SENS_1 (0x030 >> 2) +#define GPIO_1_8V_E_INT_SENS_2 (0x034 >> 2) +#define GPIO_1_8V_E_INT_STATUS (0x038 >> 2) +#define GPIO_1_8V_E_RESET_TOLERANT (0x03C >> 2) +#define GPIO_1_8V_ABCD_DEBOUNCE_1 (0x040 >> 2) +#define GPIO_1_8V_ABCD_DEBOUNCE_2 (0x044 >> 2) +#define GPIO_1_8V_E_DEBOUNCE_1 (0x048 >> 2) +#define GPIO_1_8V_E_DEBOUNCE_2 (0x04C >> 2) +#define GPIO_1_8V_DEBOUNCE_TIME_1 (0x050 >> 2) +#define GPIO_1_8V_DEBOUNCE_TIME_2 (0x054 >> 2) +#define GPIO_1_8V_DEBOUNCE_TIME_3 (0x058 >> 2) +#define GPIO_1_8V_ABCD_COMMAND_SRC_0 (0x060 >> 2) +#define GPIO_1_8V_ABCD_COMMAND_SRC_1 (0x064 >> 2) +#define GPIO_1_8V_E_COMMAND_SRC_0 (0x068 >> 2) +#define GPIO_1_8V_E_COMMAND_SRC_1 (0x06C >> 2) +#define GPIO_1_8V_ABCD_DATA_READ (0x0C0 >> 2) +#define GPIO_1_8V_E_DATA_READ (0x0C4 >> 2) +#define GPIO_1_8V_ABCD_INPUT_MASK (0x1D0 >> 2) +#define GPIO_1_8V_E_INPUT_MASK (0x1D4 >> 2) +#define GPIO_1_8V_MEM_SIZE 0x1D8 +#define GPIO_1_8V_REG_ARRAY_SIZE (GPIO_1_8V_MEM_SIZE >> 2)static int aspeed_evaluate_irq (GPIOSets *regs,int gpio_prev_high,int gpio) {
Signature · 1 line
2.32.0
Re: [PATCH v2 2/3] hw: aspeed_gpio: Simplify 1.8V defines
Quoted 7 lines · Joel Stanley
There's no need to define the registers relative to the
0x800offset where the controller is mapped, as the device is instantiated as it's own model at the correct memory address.Simplify the defines and remove the offset to save future confusion.
Signed-off-by Joel Stanley <[email protected]>
Makes sense, and it is cleaner.
Quoted 125 lines
---
hw/gpio/aspeed_gpio.c | 73 +++++++++++++++++++++-------------------- --1 file changed, 36 insertions(+), 37 deletions(-)hw/gpio/aspeed_gpio.c +0
-0@@ -169,44 +169,43 @@
/* AST2600 only - 1.8V gpios */
/*
- * The AST2600 has same 3.6V gpios as the AST2400 (memory offsets 0x0-0x198)
- * and additional 1.8V gpios (memory offsets 0x800-0x9D4).
+ * The AST2600 two copies of the GPIO controller: the same 3.6V gpios as the
+ * AST2400 (memory offsets 0x0-0x198) and a second controller with 1.8V gpios
+ * (memory offsets 0x800-0x9D4).
*/hw/gpio/aspeed_gpio.c +0
-2-#define GPIO_1_8V_REG_OFFSET 0x800 -#define GPIO_1_8V_ABCD_DATA_VALUE ((0x800 -
GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_ABCD_DIRECTION ((0x804-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_ABCD_INT_ENABLE ((0x808-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_ABCD_INT_SENS_0 ((0x80C-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_ABCD_INT_SENS_1 ((0x810-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_ABCD_INT_SENS_2 ((0x814-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_ABCD_INT_STATUS ((0x818-GPIO_1_8V_REG_OFFSET) >> 2)
-#defineGPIO_1_8V_ABCD_RESET_TOLERANT((0x81C-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_E_DATA_VALUE ((0x820-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_E_DIRECTION ((0x824-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_E_INT_ENABLE ((0x828-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_E_INT_SENS_0 ((0x82C-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_E_INT_SENS_1 ((0x830-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_E_INT_SENS_2 ((0x834-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_E_INT_STATUS ((0x838-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_E_RESET_TOLERANT ((0x83C-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_ABCD_DEBOUNCE_1 ((0x840-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_ABCD_DEBOUNCE_2 ((0x844-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_E_DEBOUNCE_1 ((0x848-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_E_DEBOUNCE_2 ((0x84C-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_DEBOUNCE_TIME_1 ((0x850-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_DEBOUNCE_TIME_2 ((0x854-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_DEBOUNCE_TIME_3 ((0x858-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_ABCD_COMMAND_SRC_0 ((0x860-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_ABCD_COMMAND_SRC_1 ((0x864-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_E_COMMAND_SRC_0 ((0x868-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_E_COMMAND_SRC_1 ((0x86C-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_ABCD_DATA_READ ((0x8C0-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_E_DATA_READ ((0x8C4-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_ABCD_INPUT_MASK ((0x9D0-GPIO_1_8V_REG_OFFSET) >> 2)
-#define GPIO_1_8V_E_INPUT_MASK ((0x9D4-GPIO_1_8V_REG_OFFSET) >> 2)hw/gpio/aspeed_gpio.c +33
-3-#define GPIO_1_8V_MEM_SIZE 0x9D8 -#define GPIO_1_8V_REG_ARRAY_SIZE ((GPIO_1_8V_MEM_SIZE - \ - GPIO_1_8V_REG_OFFSET) >> 2) +#define GPIO_1_8V_ABCD_DATA_VALUE (0x000 >> 2) +#define GPIO_1_8V_ABCD_DIRECTION (0x004 >> 2) +#define GPIO_1_8V_ABCD_INT_ENABLE (0x008 >> 2) +#define GPIO_1_8V_ABCD_INT_SENS_0 (0x00C >> 2) +#define GPIO_1_8V_ABCD_INT_SENS_1 (0x010 >> 2) +#define GPIO_1_8V_ABCD_INT_SENS_2 (0x014 >> 2) +#define GPIO_1_8V_ABCD_INT_STATUS (0x018 >> 2) +#define GPIO_1_8V_ABCD_RESET_TOLERANT (0x01C >> 2) +#define GPIO_1_8V_E_DATA_VALUE (0x020 >> 2) +#define GPIO_1_8V_E_DIRECTION (0x024 >> 2) +#define GPIO_1_8V_E_INT_ENABLE (0x028 >> 2) +#define GPIO_1_8V_E_INT_SENS_0 (0x02C >> 2) +#define GPIO_1_8V_E_INT_SENS_1 (0x030 >> 2) +#define GPIO_1_8V_E_INT_SENS_2 (0x034 >> 2) +#define GPIO_1_8V_E_INT_STATUS (0x038 >> 2) +#define GPIO_1_8V_E_RESET_TOLERANT (0x03C >> 2) +#define GPIO_1_8V_ABCD_DEBOUNCE_1 (0x040 >> 2) +#define GPIO_1_8V_ABCD_DEBOUNCE_2 (0x044 >> 2) +#define GPIO_1_8V_E_DEBOUNCE_1 (0x048 >> 2) +#define GPIO_1_8V_E_DEBOUNCE_2 (0x04C >> 2) +#define GPIO_1_8V_DEBOUNCE_TIME_1 (0x050 >> 2) +#define GPIO_1_8V_DEBOUNCE_TIME_2 (0x054 >> 2) +#define GPIO_1_8V_DEBOUNCE_TIME_3 (0x058 >> 2) +#define GPIO_1_8V_ABCD_COMMAND_SRC_0 (0x060 >> 2) +#define GPIO_1_8V_ABCD_COMMAND_SRC_1 (0x064 >> 2) +#define GPIO_1_8V_E_COMMAND_SRC_0 (0x068 >> 2) +#define GPIO_1_8V_E_COMMAND_SRC_1 (0x06C >> 2) +#define GPIO_1_8V_ABCD_DATA_READ (0x0C0 >> 2) +#define GPIO_1_8V_E_DATA_READ (0x0C4 >> 2) +#define GPIO_1_8V_ABCD_INPUT_MASK (0x1D0 >> 2) +#define GPIO_1_8V_E_INPUT_MASK (0x1D4 >> 2) +#define GPIO_1_8V_MEM_SIZE 0x1D8 +#define GPIO_1_8V_REG_ARRAY_SIZE (GPIO_1_8V_MEM_SIZE >> 2)
static intaspeed_evaluate_irq(GPIOSets *regs, int gpio_prev_high, int gpio)
{
Re: [SPAM] [PATCH v2 2/3] hw: aspeed_gpio: Simplify 1.8V defines
In reply to Joel StanleyQuoted 7 lines · Joel Stanley
There's no need to define the registers relative to the
0x800offset where the controller is mapped, as the device is instantiated as it's own model at the correct memory address.Simplify the defines and remove the offset to save future confusion.
Signed-off-by Joel Stanley <[email protected]>
Quoted 90 lines
--- hw/gpio/aspeed_gpio.c | 73 +++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 37 deletions(-)hw/gpio/aspeed_gpio.c +36
-37@@ -169,44 +169,43 @@/* AST2600 only - 1.8V gpios */ /* -* The AST2600 has same 3.6V gpios as the AST2400 (memory offsets 0x0-0x198) -* and additional 1.8V gpios (memory offsets 0x800-0x9D4). +* The AST2600 two copies of the GPIO controller: the same 3.6V gpios as the +* AST2400 (memory offsets 0x0-0x198) and a second controller with 1.8V gpios +* (memory offsets 0x800-0x9D4). */ -#define GPIO_1_8V_REG_OFFSET 0x800 -#define GPIO_1_8V_ABCD_DATA_VALUE ((0x800 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_DIRECTION ((0x804 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_INT_ENABLE ((0x808 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_INT_SENS_0 ((0x80C - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_INT_SENS_1 ((0x810 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_INT_SENS_2 ((0x814 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_INT_STATUS ((0x818 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_RESET_TOLERANT ((0x81C - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_DATA_VALUE ((0x820 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_DIRECTION ((0x824 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_INT_ENABLE ((0x828 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_INT_SENS_0 ((0x82C - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_INT_SENS_1 ((0x830 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_INT_SENS_2 ((0x834 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_INT_STATUS ((0x838 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_RESET_TOLERANT ((0x83C - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_DEBOUNCE_1 ((0x840 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_DEBOUNCE_2 ((0x844 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_DEBOUNCE_1 ((0x848 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_DEBOUNCE_2 ((0x84C - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_DEBOUNCE_TIME_1 ((0x850 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_DEBOUNCE_TIME_2 ((0x854 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_DEBOUNCE_TIME_3 ((0x858 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_COMMAND_SRC_0 ((0x860 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_COMMAND_SRC_1 ((0x864 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_COMMAND_SRC_0 ((0x868 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_COMMAND_SRC_1 ((0x86C - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_DATA_READ ((0x8C0 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_DATA_READ ((0x8C4 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_ABCD_INPUT_MASK ((0x9D0 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_E_INPUT_MASK ((0x9D4 - GPIO_1_8V_REG_OFFSET) >> 2) -#define GPIO_1_8V_MEM_SIZE 0x9D8 -#define GPIO_1_8V_REG_ARRAY_SIZE ((GPIO_1_8V_MEM_SIZE - \ - GPIO_1_8V_REG_OFFSET) >> 2) +#define GPIO_1_8V_ABCD_DATA_VALUE (0x000 >> 2) +#define GPIO_1_8V_ABCD_DIRECTION (0x004 >> 2) +#define GPIO_1_8V_ABCD_INT_ENABLE (0x008 >> 2) +#define GPIO_1_8V_ABCD_INT_SENS_0 (0x00C >> 2) +#define GPIO_1_8V_ABCD_INT_SENS_1 (0x010 >> 2) +#define GPIO_1_8V_ABCD_INT_SENS_2 (0x014 >> 2) +#define GPIO_1_8V_ABCD_INT_STATUS (0x018 >> 2) +#define GPIO_1_8V_ABCD_RESET_TOLERANT (0x01C >> 2) +#define GPIO_1_8V_E_DATA_VALUE (0x020 >> 2) +#define GPIO_1_8V_E_DIRECTION (0x024 >> 2) +#define GPIO_1_8V_E_INT_ENABLE (0x028 >> 2) +#define GPIO_1_8V_E_INT_SENS_0 (0x02C >> 2) +#define GPIO_1_8V_E_INT_SENS_1 (0x030 >> 2) +#define GPIO_1_8V_E_INT_SENS_2 (0x034 >> 2) +#define GPIO_1_8V_E_INT_STATUS (0x038 >> 2) +#define GPIO_1_8V_E_RESET_TOLERANT (0x03C >> 2) +#define GPIO_1_8V_ABCD_DEBOUNCE_1 (0x040 >> 2) +#define GPIO_1_8V_ABCD_DEBOUNCE_2 (0x044 >> 2) +#define GPIO_1_8V_E_DEBOUNCE_1 (0x048 >> 2) +#define GPIO_1_8V_E_DEBOUNCE_2 (0x04C >> 2) +#define GPIO_1_8V_DEBOUNCE_TIME_1 (0x050 >> 2) +#define GPIO_1_8V_DEBOUNCE_TIME_2 (0x054 >> 2) +#define GPIO_1_8V_DEBOUNCE_TIME_3 (0x058 >> 2) +#define GPIO_1_8V_ABCD_COMMAND_SRC_0 (0x060 >> 2) +#define GPIO_1_8V_ABCD_COMMAND_SRC_1 (0x064 >> 2) +#define GPIO_1_8V_E_COMMAND_SRC_0 (0x068 >> 2) +#define GPIO_1_8V_E_COMMAND_SRC_1 (0x06C >> 2) +#define GPIO_1_8V_ABCD_DATA_READ (0x0C0 >> 2) +#define GPIO_1_8V_E_DATA_READ (0x0C4 >> 2) +#define GPIO_1_8V_ABCD_INPUT_MASK (0x1D0 >> 2) +#define GPIO_1_8V_E_INPUT_MASK (0x1D4 >> 2) +#define GPIO_1_8V_MEM_SIZE 0x1D8 +#define GPIO_1_8V_REG_ARRAY_SIZE (GPIO_1_8V_MEM_SIZE >> 2)static int aspeed_evaluate_irq (GPIOSets *regs,int gpio_prev_high,int gpio) {
Re: [PATCH v2 2/3] hw: aspeed_gpio: Simplify 1.8V defines
In reply to Joel StanleyQuoted 10 lines · Joel Stanley
There's no need to define the registers relative to the
0x800offset where the controller is mapped, as the device is instantiated as it's own model at the correct memory address.Simplify the defines and remove the offset to save future confusion.
Signed-off-by Joel Stanley <[email protected]>--- hw/gpio/aspeed_gpio.c | 73 +++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 37 deletions(-)
Joel Stanley
maintainerPATCH v2 3/3 hw: aspeed_gpio: Clarify GPIO controller name
In reply to Joel StanleyThere are two GPIO controllers in the ast2600; one is 3.3V and the other is 1.8V.
--- hw/gpio/aspeed_gpio.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
hw/gpio/aspeed_gpio.c +13 -13
@@ -164,12 +164,12 @@#define GPIO_YZAAAB_DIRECTION (0x1E4 >> 2)#define GPIO_AC_DATA_VALUE (0x1E8 >> 2)#define GPIO_AC_DIRECTION (0x1EC >> 2) -#define GPIO_3_6V_MEM_SIZE 0x1F0 -#define GPIO_3_6V_REG_ARRAY_SIZE (GPIO_3_6V_MEM_SIZE >> 2) +#define GPIO_3_3V_MEM_SIZE 0x1F0 +#define GPIO_3_3V_REG_ARRAY_SIZE (GPIO_3_3V_MEM_SIZE >> 2)/* AST2600 only - 1.8V gpios */ /* -* The AST2600 two copies of the GPIO controller: the same 3.6V gpios as the +* The AST2600 two copies of the GPIO controller: the same 3.3V gpios as the * AST2400 (memory offsets 0x0-0x198) and a second controller with 1.8V gpios * (memory offsets 0x800-0x9D4). */
@@ -380,7 +380,7 @@ static uint32_t update_value_control_source(GPIOSets *regs, uint32_t old_value,return new_value; } -static const AspeedGPIOReg aspeed_3_6v_gpios[GPIO_3_6V_REG_ARRAY_SIZE ] = { +static const AspeedGPIOReg aspeed_3_3v_gpios[GPIO_3_3V_REG_ARRAY_SIZE ] = {/* Set ABCD */ [GPIO_ABCD_DATA_VALUE ] = {0 , gpio_reg_data_value }, [GPIO_ABCD_DIRECTION ] = {0 , gpio_reg_direction },
@@ -800,7 +800,7 @@ static const GPIOSetProperties ast2500_set_props[] = { [7] = {0x000000ff, 0x000000ff, {"AC"} }, }; -static GPIOSetProperties ast2600_3_6v_set_props[] = { +static GPIOSetProperties ast2600_3_3v_set_props[] = { [0 ] = {0xffffffff ,0xffffffff , {"A" ,"B" ,"C" ,"D" } }, [1 ] = {0xffffffff ,0xffffffff , {"E" ,"F" ,"G" ,"H" } }, [2 ] = {0xffffffff ,0xffffffff , {"I" ,"J" ,"K" ,"L" } },
@@ -927,7 +927,7 @@ static void aspeed_gpio_ast2400_class_init(ObjectClass *klass, void *data) agc->nr_gpio_pins =216 ; agc->nr_gpio_sets =7 ; agc->gap =196 ; - agc->reg_table = aspeed_3_6v_gpios; + agc->reg_table = aspeed_3_3v_gpios; }static void aspeed_gpio_2500_class_init (ObjectClass *klass,void *data)
@@ -938,17 +938,17 @@ static void aspeed_gpio_2500_class_init(ObjectClass *klass, void *data) agc->nr_gpio_pins =228 ; agc->nr_gpio_sets =8 ; agc->gap =220 ; - agc->reg_table = aspeed_3_6v_gpios; + agc->reg_table = aspeed_3_3v_gpios; } -static void aspeed_gpio_ast2600_3_6v_class_init (ObjectClass *klass,void *data) +static void aspeed_gpio_ast2600_3_3v_class_init (ObjectClass *klass,void *data) {AspeedGPIOClass *agc =ASPEED_GPIO_CLASS (klass); - agc->props = ast2600_3_6v_set_props; + agc->props = ast2600_3_3v_set_props; agc->nr_gpio_pins =208 ; agc->nr_gpio_sets =7 ; - agc->reg_table = aspeed_3_6v_gpios; + agc->reg_table = aspeed_3_3v_gpios; }static void aspeed_gpio_ast2600_1_8v_class_init (ObjectClass *klass,void *data)
@@ -984,10 +984,10 @@ static const TypeInfo aspeed_gpio_ast2500_info = { .instance_init = aspeed_gpio_init, }; -static const TypeInfo aspeed_gpio_ast2600_3_6v_info = { +static const TypeInfo aspeed_gpio_ast2600_3_3v_info = { .name =TYPE_ASPEED_GPIO "-ast2600" , .parent =TYPE_ASPEED_GPIO , - .class_init = aspeed_gpio_ast2600_3_6v_class_init, + .class_init = aspeed_gpio_ast2600_3_3v_class_init, .instance_init = aspeed_gpio_init, };
@@ -1003,7 +1003,7 @@ static void aspeed_gpio_register_types(void)type_register_static (&aspeed_gpio_info);type_register_static (&aspeed_gpio_ast2400_info);type_register_static (&aspeed_gpio_ast2500_info); -type_register_static (&aspeed_gpio_ast2600_3_6v_info); +type_register_static (&aspeed_gpio_ast2600_3_3v_info);type_register_static (&aspeed_gpio_ast2600_1_8v_info); }
Signature · 1 line
2.32.0
Re: [PATCH v2 3/3] hw: aspeed_gpio: Clarify GPIO controller name
Quoted 5 lines · Joel Stanley
There are two GPIO controllers in the ast2600; one is 3.3V and the other
is 1.8V.Signed-off-by Joel Stanley <[email protected]>
Thanks for picking this up.
Quoted 109 lines
---
hw/gpio/aspeed_gpio.c | 26 +++++++++++++-------------1 file changed, 13 insertions(+), 13 deletions(-)hw/gpio/aspeed_gpio.c +2
-2@@ -164,12 +164,12 @@ #define GPIO_YZAAAB_DIRECTION (0x1E4 >> 2) #define GPIO_AC_DATA_VALUE (0x1E8 >> 2) #define GPIO_AC_DIRECTION (0x1EC >> 2) -#define GPIO_3_6V_MEM_SIZE 0x1F0 -#define GPIO_3_6V_REG_ARRAY_SIZE (GPIO_3_6V_MEM_SIZE >> 2) +#define GPIO_3_3V_MEM_SIZE 0x1F0 +#define GPIO_3_3V_REG_ARRAY_SIZE (GPIO_3_3V_MEM_SIZE >> 2)
/* AST2600 only - 1.8V gpios */
/*
- * The AST2600 two copies of the GPIO controller: the same 3.6V gpios as the
+ * The AST2600 two copies of the GPIO controller: the same 3.3V gpios as the
* AST2400 (memory offsets 0x0-0x198) and a second controller with 1.8V gpios
* (memory offsets 0x800-0x9D4).
*/hw/gpio/aspeed_gpio.c +0
-0@@ -380,7 +380,7 @@ static uint32_t update_value_control_source(GPIOSets *regs, uint32_t old_value, return new_value; }
-static const AspeedGPIOReg aspeed_3_6v_gpios[GPIO_3_6V_REG_ARRAY_SIZE] = { +static const AspeedGPIOReg aspeed_3_3v_gpios[GPIO_3_3V_REG_ARRAY_SIZE] = {
/* Set ABCD */
[GPIO_ABCD_DATA_VALUE] = { 0,gpio_reg_data_value}, [GPIO_ABCD_DIRECTION] = { 0,gpio_reg_direction},hw/gpio/aspeed_gpio.c +0
-0@@ -800,7 +800,7 @@ static const GPIOSetProperties ast2500_set_props[] = { [7] = {0x000000ff, 0x000000ff, {"AC"} }, };hw/gpio/aspeed_gpio.c +1
-1-static GPIOSetProperties ast2600_3_6v_set_props[] = { +static GPIOSetProperties ast2600_3_3v_set_props[] = {[0] = {0xffffffff, 0xffffffff, {"A", "B", "C", "D"} },
[1] = {0xffffffff, 0xffffffff, {"E", "F", "G", "H"} },
[2] = {0xffffffff, 0xffffffff, {"I", "J", "K", "L"} },hw/gpio/aspeed_gpio.c +1
-1@@ -927,7 +927,7 @@ static voidaspeed_gpio_ast2400_class_init (ObjectClass *klass, void *data) agc->nr_gpio_pins = 216; agc->nr_gpio_sets = 7; agc->gap = 196; - agc->reg_table = aspeed_3_6v_gpios; + agc->reg_table = aspeed_3_3v_gpios; }
static voidaspeed_gpio_2500_class_init(ObjectClass *klass, void *data)hw/gpio/aspeed_gpio.c +1
-1@@ -938,17 +938,17 @@ static voidaspeed_gpio_2500_class_init (ObjectClass *klass, void *data) agc->nr_gpio_pins = 228; agc->nr_gpio_sets = 8; agc->gap = 220; - agc->reg_table = aspeed_3_6v_gpios; + agc->reg_table = aspeed_3_3v_gpios; }
-static voidaspeed_gpio_ast2600_3_6v_class_init(ObjectClass *klass, void *data)
+static voidaspeed_gpio_ast2600_3_3v_class_init(ObjectClass *klass, void *data)
{
AspeedGPIOClass *agc =ASPEED_GPIO_CLASS(klass);
-agc->props=ast2600_3_6v_set_props;
+agc->props=ast2600_3_3v_set_props;agc->nr_gpio_pins= 208;
agc->nr_gpio_sets= 7;
-agc->reg_table=aspeed_3_6v_gpios;
+agc->reg_table=aspeed_3_3v_gpios;
}
static voidaspeed_gpio_ast2600_1_8v_class_init(ObjectClass *klass, void *data)hw/gpio/aspeed_gpio.c +0
-0@@ -984,10 +984,10 @@ static const TypeInfo aspeed_gpio_ast2500_info = { .instance_init = aspeed_gpio_init, };hw/gpio/aspeed_gpio.c +1
-1-static const TypeInfo aspeed_gpio_ast2600_3_6v_info = { +static const TypeInfo aspeed_gpio_ast2600_3_3v_info = {.name =
TYPE_ASPEED_GPIO"-ast2600", .parent =TYPE_ASPEED_GPIO,
- .class_init =aspeed_gpio_ast2600_3_6v_class_init, + .class_init =aspeed_gpio_ast2600_3_3v_class_init, .instance_init =aspeed_gpio_init,
};hw/gpio/aspeed_gpio.c +1
-1@@ -1003,7 +1003,7 @@ static void aspeed_gpio_register_types(void) type_register_static(&aspeed_gpio_info); type_register_static(&aspeed_gpio_ast2400_info); type_register_static(&aspeed_gpio_ast2500_info); - type_register_static(&aspeed_gpio_ast2600_3_6v_info); + type_register_static(&aspeed_gpio_ast2600_3_3v_info); type_register_static(&aspeed_gpio_ast2600_1_8v_info); }
Re: [SPAM] [PATCH v2 3/3] hw: aspeed_gpio: Clarify GPIO controller name
In reply to Joel StanleyQuoted 4 lines · Joel Stanley
There are two GPIO controllers in the ast2600; one is 3.3V and the other is 1.8V.
Signed-off-by Joel Stanley <[email protected]>
Quoted 96 lines
--- hw/gpio/aspeed_gpio.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)hw/gpio/aspeed_gpio.c +13
-13@@ -164,12 +164,12 @@#define GPIO_YZAAAB_DIRECTION (0x1E4 >> 2)#define GPIO_AC_DATA_VALUE (0x1E8 >> 2)#define GPIO_AC_DIRECTION (0x1EC >> 2) -#define GPIO_3_6V_MEM_SIZE 0x1F0 -#define GPIO_3_6V_REG_ARRAY_SIZE (GPIO_3_6V_MEM_SIZE >> 2) +#define GPIO_3_3V_MEM_SIZE 0x1F0 +#define GPIO_3_3V_REG_ARRAY_SIZE (GPIO_3_3V_MEM_SIZE >> 2)/* AST2600 only - 1.8V gpios */ /* -* The AST2600 two copies of the GPIO controller: the same 3.6V gpios as the +* The AST2600 two copies of the GPIO controller: the same 3.3V gpios as the * AST2400 (memory offsets 0x0-0x198) and a second controller with 1.8V gpios * (memory offsets 0x800-0x9D4). */ @@ -380,7 +380,7 @@ static uint32_t update_value_control_source(GPIOSets *regs, uint32_t old_value,return new_value; } -static const AspeedGPIOReg aspeed_3_6v_gpios[GPIO_3_6V_REG_ARRAY_SIZE ] = { +static const AspeedGPIOReg aspeed_3_3v_gpios[GPIO_3_3V_REG_ARRAY_SIZE ] = {/* Set ABCD */ [GPIO_ABCD_DATA_VALUE ] = {0 , gpio_reg_data_value }, [GPIO_ABCD_DIRECTION ] = {0 , gpio_reg_direction },@@ -800,7 +800,7 @@ static const GPIOSetProperties ast2500_set_props[] = { [7] = {0x000000ff, 0x000000ff, {"AC"} }, }; -static GPIOSetProperties ast2600_3_6v_set_props[] = { +static GPIOSetProperties ast2600_3_3v_set_props[] = { [0 ] = {0xffffffff ,0xffffffff , {"A" ,"B" ,"C" ,"D" } }, [1 ] = {0xffffffff ,0xffffffff , {"E" ,"F" ,"G" ,"H" } }, [2 ] = {0xffffffff ,0xffffffff , {"I" ,"J" ,"K" ,"L" } },@@ -927,7 +927,7 @@ static void aspeed_gpio_ast2400_class_init(ObjectClass *klass, void *data) agc->nr_gpio_pins =216 ; agc->nr_gpio_sets =7 ; agc->gap =196 ; - agc->reg_table = aspeed_3_6v_gpios; + agc->reg_table = aspeed_3_3v_gpios; }static void aspeed_gpio_2500_class_init (ObjectClass *klass,void *data)@@ -938,17 +938,17 @@ static void aspeed_gpio_2500_class_init(ObjectClass *klass, void *data) agc->nr_gpio_pins =228 ; agc->nr_gpio_sets =8 ; agc->gap =220 ; - agc->reg_table = aspeed_3_6v_gpios; + agc->reg_table = aspeed_3_3v_gpios; } -static void aspeed_gpio_ast2600_3_6v_class_init (ObjectClass *klass,void *data) +static void aspeed_gpio_ast2600_3_3v_class_init (ObjectClass *klass,void *data) {AspeedGPIOClass *agc =ASPEED_GPIO_CLASS (klass); - agc->props = ast2600_3_6v_set_props; + agc->props = ast2600_3_3v_set_props; agc->nr_gpio_pins =208 ; agc->nr_gpio_sets =7 ; - agc->reg_table = aspeed_3_6v_gpios; + agc->reg_table = aspeed_3_3v_gpios; }static void aspeed_gpio_ast2600_1_8v_class_init (ObjectClass *klass,void *data)@@ -984,10 +984,10 @@ static const TypeInfo aspeed_gpio_ast2500_info = { .instance_init = aspeed_gpio_init, }; -static const TypeInfo aspeed_gpio_ast2600_3_6v_info = { +static const TypeInfo aspeed_gpio_ast2600_3_3v_info = { .name =TYPE_ASPEED_GPIO "-ast2600" , .parent =TYPE_ASPEED_GPIO , - .class_init = aspeed_gpio_ast2600_3_6v_class_init, + .class_init = aspeed_gpio_ast2600_3_3v_class_init, .instance_init = aspeed_gpio_init, };@@ -1003,7 +1003,7 @@ static void aspeed_gpio_register_types(void)type_register_static (&aspeed_gpio_info);type_register_static (&aspeed_gpio_ast2400_info);type_register_static (&aspeed_gpio_ast2500_info); -type_register_static (&aspeed_gpio_ast2600_3_6v_info); +type_register_static (&aspeed_gpio_ast2600_3_3v_info);type_register_static (&aspeed_gpio_ast2600_1_8v_info); }