Message ID | 20210713065854.134634-4-joel@jms.id.au (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | hw: aspeed_gpio: MMIO region fix and cleanups | expand |
On Tue, 2021-07-13 at 16:28 +0930, Joel Stanley wrote: > There are two GPIO controllers in the ast2600; one is 3.3V and the > other > is 1.8V. > > Signed-off-by: Joel Stanley <joel@jms.id.au> Thanks for picking this up. Reviewed-by: Rashmica Gupta <rashmica.g@gmail.com> > --- > hw/gpio/aspeed_gpio.c | 26 +++++++++++++------------- > 1 file changed, 13 insertions(+), 13 deletions(-) > > diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c > index dc721aec5da7..dfa6d6cb40a9 100644 > --- a/hw/gpio/aspeed_gpio.c > +++ b/hw/gpio/aspeed_gpio.c > @@ -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); > } >
On 7/13/21 8:58 AM, Joel Stanley wrote: > There are two GPIO controllers in the ast2600; one is 3.3V and the other > is 1.8V. > > Signed-off-by: Joel Stanley <joel@jms.id.au> Reviewed-by: Cédric Le Goater <clg@kaod.org> > --- > hw/gpio/aspeed_gpio.c | 26 +++++++++++++------------- > 1 file changed, 13 insertions(+), 13 deletions(-) > > diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c > index dc721aec5da7..dfa6d6cb40a9 100644 > --- a/hw/gpio/aspeed_gpio.c > +++ b/hw/gpio/aspeed_gpio.c > @@ -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); > } > >
diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c index dc721aec5da7..dfa6d6cb40a9 100644 --- a/hw/gpio/aspeed_gpio.c +++ b/hw/gpio/aspeed_gpio.c @@ -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); }
There are two GPIO controllers in the ast2600; one is 3.3V and the other is 1.8V. Signed-off-by: Joel Stanley <joel@jms.id.au> --- hw/gpio/aspeed_gpio.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)