Add Aspeed GPIO controller model
v6 cover Add Aspeed GPIO controller model
v6:
- fixed bug in get/set pin
- added error checking that Cédric suggested
v5:
- integrated AspeedGPIOController fields into AspeedGPIOClass
- separated ast2600_3_6v and ast2600_1_8v into two classes
v4:
- proper interupt handling thanks to Andrew
- switch statements for reading and writing suggested by Peter
- some small cleanups suggested by Alexey
v3:
- didn't have each gpio set up as an irq
- now can't access set AC on ast2400 (only exists on ast2500)
- added ast2600 implementation (patch 3)
- renamed a couple of variables for clarity
v2: Addressed Andrew's feedback, added debounce regs, renamed get/set to read/write to minimise confusion with a 'set' of registers.
Rashmica Gupta (3):
hw/gpio: Add basic Aspeed GPIO model for AST2400 and AST2500
aspeed: add a GPIO controller to the SoC
hw/gpio: Add in AST2600 specific implementation
include/hw/arm/aspeed_soc.h | 3 + include/hw/gpio/aspeed_gpio.h | 100 ++++ hw/arm/aspeed_soc.c | 17 + hw/gpio/aspeed_gpio.c | 1014 +++++++++++++++++++++++++++++++++ hw/gpio/Makefile.objs | 1 + 5 files changed, 1135 insertions(+) create mode 100644 include/hw/gpio/aspeed_gpio.h create mode 100644 hw/gpio/aspeed_gpio.c
Signature · 1 line
2.20.1
PATCH v6 1/3 hw/gpio: Add basic Aspeed GPIO model for AST2400 and AST2500
GPIO pins are arranged in groups of 8 pins labeled A,B,..,Y,Z,AA,AB,AC. (Note that the ast2400 controller only goes up to group AB). A set has four groups (except set AC which only has one) and is referred to by the groups it is composed of (eg ABCD,EFGH,...,YZAAAB). Each set is accessed and controlled by a bank of 14 registers.
These registers operate on a per pin level where each bit in the register corresponds to a pin, except for the command source registers. The command source registers operate on a per group level where bits 24, 16, 8 and 0 correspond to each group in the set.
eg. registers for set ABCD:
|D7...D0|C7...C0|B7...B0|A7...A0| <- GPIOs |31...24|23...16|15....8|7.....0| <- bit position
Note that there are a couple of groups that only have 4 pins.
There are two ways that this model deviates from the behaviour of the actual controller:
(1) The only control source driving the GPIO pins in the model is the ARM model (as there currently aren't models for the LPC or Coprocessor).
(2) None of the registers in the model are reset tolerant (needs integration with the watchdog).
--- include/hw/gpio/aspeed_gpio.h | 100 ++++ hw/gpio/aspeed_gpio.c | 882 ++++++++++++++++++++++++++++++++++ hw/gpio/Makefile.objs | 1 + 3 files changed, 983 insertions(+) create mode 100644 include/hw/gpio/aspeed_gpio.h create mode 100644 hw/gpio/aspeed_gpio.c
include/hw/gpio/aspeed_gpio.h new file +100 -0
@@ -0,0 +1,100 @@ +/* +* ASPEED GPIO Controller +* +* Copyright (C) 2017-2018 IBM Corp. +* +* This code is licensed under the GPL version 2 or later. See +* the COPYING file in the top-level directory. +*/ + +#ifndef ASPEED_GPIO_H +#define ASPEED_GPIO_H + +#include "hw/sysbus.h" + +#define TYPE_ASPEED_GPIO "aspeed.gpio" +#define ASPEED_GPIO (obj) OBJECT_CHECK(AspeedGPIOState, (obj), TYPE_ASPEED_GPIO) +#define ASPEED_GPIO_CLASS (klass) \ + OBJECT_CLASS_CHECK(AspeedGPIOClass, (klass), TYPE_ASPEED_GPIO) +#define ASPEED_GPIO_GET_CLASS (obj) \ + OBJECT_GET_CLASS(AspeedGPIOClass, (obj), TYPE_ASPEED_GPIO) + +#define ASPEED_GPIO_MAX_NR_SETS 8 +#define ASPEED_REGS_PER_BANK 14 +#define ASPEED_GPIO_MAX_NR_REGS (ASPEED_REGS_PER_BANK * ASPEED_GPIO_MAX_NR_SETS) +#define ASPEED_GPIO_NR_PINS 228 +#define ASPEED_GROUPS_PER_SET 4 +#define ASPEED_GPIO_NR_DEBOUNCE_REGS 3 +#define ASPEED_CHARS_PER_GROUP_LABEL 4 + +typedef struct GPIOSets GPIOSets ; + +typedef struct GPIOSetProperties { +uint32_t input; +uint32_t output; +char group_label[ASPEED_GROUPS_PER_SET ][ASPEED_CHARS_PER_GROUP_LABEL ]; +}GPIOSetProperties ; + +enum GPIORegType { + gpio_not_a_reg, + gpio_reg_data_value, + gpio_reg_direction, + gpio_reg_int_enable, + gpio_reg_int_sens_0, + gpio_reg_int_sens_1, + gpio_reg_int_sens_2, + gpio_reg_int_status, + gpio_reg_reset_tolerant, + gpio_reg_debounce_1, + gpio_reg_debounce_2, + gpio_reg_cmd_source_0, + gpio_reg_cmd_source_1, + gpio_reg_data_read, + gpio_reg_input_mask, +}; + +typedef struct AspeedGPIOReg { +uint16_t set_idx; +enum GPIORegType type; + }AspeedGPIOReg ; + +typedef struct AspeedGPIOClass { +SysBusDevice parent_obj; +const GPIOSetProperties *props; +uint32_t nr_gpio_pins; +uint32_t nr_gpio_sets; +uint32_t gap; +const AspeedGPIOReg *reg_table; +}AspeedGPIOClass ; + +typedef struct AspeedGPIOState { +/* <private> */ +SysBusDevice parent; + +/*< public >*/ +MemoryRegion iomem; +int pending; +qemu_irq irq; +qemu_irq gpios[ASPEED_GPIO_NR_PINS ]; + +/* Parallel GPIO Registers */ +uint32_t debounce_regs[ASPEED_GPIO_NR_DEBOUNCE_REGS ]; +struct GPIOSets { +uint32_t data_value;/* Reflects pin values */ +uint32_t data_read;/* Contains last value written to data value */ +uint32_t direction; +uint32_t int_enable; +uint32_t int_sens_0; +uint32_t int_sens_1; +uint32_t int_sens_2; +uint32_t int_status; +uint32_t reset_tol; +uint32_t cmd_source_0; +uint32_t cmd_source_1; +uint32_t debounce_1; +uint32_t debounce_2; +uint32_t input_mask; + } sets[ASPEED_GPIO_MAX_NR_SETS ]; +}AspeedGPIOState ; + +#endif /* _ASPEED_GPIO_H_ */
hw/gpio/aspeed_gpio.c new file +882 -0
882 lines not on this page · raw message
hw/gpio/Makefile.objs +1 -0
@@ -9,3 +9,4 @@ obj-$(CONFIG_OMAP) += omap_gpio.o obj-$(CONFIG_IMX) += imx_gpio.o obj-$(CONFIG_RASPI) += bcm2835_gpio.o obj-$(CONFIG_NRF51_SOC) += nrf51_gpio.o +obj-$(CONFIG_ASPEED_SOC) += aspeed_gpio.o
Signature · 1 line
2.20.1
PATCH v6 2/3 aspeed: add a GPIO controller to the SoC
In reply to Rashmica Gupta--- include/hw/arm/aspeed_soc.h | 3 +++ hw/arm/aspeed_soc.c | 17 +++++++++++++++++ 2 files changed, 20 insertions(+)
include/hw/arm/aspeed_soc.h +3 -0
@@ -22,6 +22,7 @@#include "hw/ssi/aspeed_smc.h" #include "hw/watchdog/wdt_aspeed.h" #include "hw/net/ftgmac100.h" +#include "hw/gpio/aspeed_gpio.h" #define ASPEED_SPIS_NUM 2#define ASPEED_WDTS_NUM 3
@@ -47,6 +48,7 @@ typedef struct AspeedSoCState {AspeedSDMCState sdmc;AspeedWDTState wdt[ASPEED_WDTS_NUM ];FTGMAC100State ftgmac100[ASPEED_MACS_NUM ]; +AspeedGPIOState gpio; } AspeedSoCState;#define TYPE_ASPEED_SOC "aspeed-soc"
@@ -60,6 +62,7 @@ typedef struct AspeedSoCInfo {int spis_num;const char *fmc_typename;const char **spi_typename; +const char *gpio_typename;int wdts_num;const int *irqmap;const hwaddr *memmap;
hw/arm/aspeed_soc.c +17 -0
@@ -124,6 +124,7 @@ static const AspeedSoCInfo aspeed_socs[] = { .spis_num = 1, .fmc_typename = "aspeed.smc.fmc", .spi_typename = aspeed_soc_ast2400_typenames, + .gpio_typename = "aspeed.gpio-ast2400", .wdts_num = 2, .irqmap = aspeed_soc_ast2400_irqmap, .memmap = aspeed_soc_ast2400_memmap,
@@ -136,6 +137,7 @@ static const AspeedSoCInfo aspeed_socs[] = { .spis_num = 1, .fmc_typename = "aspeed.smc.fmc", .spi_typename = aspeed_soc_ast2400_typenames, + .gpio_typename = "aspeed.gpio-ast2400", .wdts_num = 2, .irqmap = aspeed_soc_ast2400_irqmap, .memmap = aspeed_soc_ast2400_memmap,
@@ -148,6 +150,7 @@ static const AspeedSoCInfo aspeed_socs[] = { .spis_num = 1, .fmc_typename = "aspeed.smc.fmc", .spi_typename = aspeed_soc_ast2400_typenames, + .gpio_typename = "aspeed.gpio-ast2400", .wdts_num = 2, .irqmap = aspeed_soc_ast2400_irqmap, .memmap = aspeed_soc_ast2400_memmap,
@@ -160,6 +163,7 @@ static const AspeedSoCInfo aspeed_socs[] = { .spis_num = 2, .fmc_typename = "aspeed.smc.ast2500-fmc", .spi_typename = aspeed_soc_ast2500_typenames, + .gpio_typename = "aspeed.gpio-ast2500", .wdts_num = 3, .irqmap = aspeed_soc_ast2500_irqmap, .memmap = aspeed_soc_ast2500_memmap,
@@ -246,6 +250,9 @@ static void aspeed_soc_init(Object *obj)sysbus_init_child_obj (obj,"xdma" ,OBJECT (&s->xdma),sizeof (s->xdma),TYPE_ASPEED_XDMA ); + +sysbus_init_child_obj (obj,"gpio" ,OBJECT (&s->gpio),sizeof (s->gpio), + sc->info->gpio_typename); }static void aspeed_soc_realize (DeviceState *dev,Error **errp)
@@ -425,6 +432,16 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp) sc->info->memmap[ASPEED_XDMA]);sysbus_connect_irq (SYS_BUS_DEVICE (&s->xdma),0 ,aspeed_soc_get_irq (s,ASPEED_XDMA )); + +/* GPIO */ +object_property_set_bool (OBJECT (&s->gpio), true,"realized" , &err); +if (err) { +error_propagate (errp, err); +return ; + } +sysbus_mmio_map (SYS_BUS_DEVICE (&s->gpio),0 , sc->info->memmap[ASPEED_GPIO ]); +sysbus_connect_irq (SYS_BUS_DEVICE (&s->gpio),0 , +aspeed_soc_get_irq (s,ASPEED_GPIO )); }static Property aspeed_soc_properties[] = {DEFINE_PROP_UINT32 ("num-cpus" , AspeedSoCState, num_cpus,0 ),
Signature · 1 line
2.20.1
PATCH v6 3/3 hw/gpio: Add in AST2600 specific implementation
In reply to Rashmica GuptaThe AST2600 has the same sets of 3.6v gpios as the AST2400 plus an addtional two sets of 1.8V gpios.
--- hw/gpio/aspeed_gpio.c | 142 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 137 insertions(+), 5 deletions(-)
hw/gpio/aspeed_gpio.c +137 -5
@@ -167,6 +167,48 @@#define GPIO_3_6V_MEM_SIZE 0x1F0#define GPIO_3_6V_REG_ARRAY_SIZE (GPIO_3_6V_MEM_SIZE >> 2) +/* AST2600 only - 1.8V gpios */ +/* +* The AST2600 has same 3.6V gpios as the AST2400 (memory offsets 0x0-0x198) +* and addtional 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_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) {uint32_t falling_edge =0 , rising_edge =0 ;
@@ -463,6 +505,39 @@ static const AspeedGPIOReg aspeed_3_6v_gpios[GPIO_3_6V_REG_ARRAY_SIZE] = { [GPIO_AC_INPUT_MASK] = { 7, gpio_reg_input_mask }, }; +static const AspeedGPIOReg aspeed_1_8v_gpios[GPIO_1_8V_REG_ARRAY_SIZE ] = { +/* 1.8V Set ABCD */ + [GPIO_1_8V_ABCD_DATA_VALUE ] = {0 , gpio_reg_data_value}, + [GPIO_1_8V_ABCD_DIRECTION ] = {0 , gpio_reg_direction}, + [GPIO_1_8V_ABCD_INT_ENABLE ] = {0 , gpio_reg_int_enable}, + [GPIO_1_8V_ABCD_INT_SENS_0 ] = {0 , gpio_reg_int_sens_0}, + [GPIO_1_8V_ABCD_INT_SENS_1 ] = {0 , gpio_reg_int_sens_1}, + [GPIO_1_8V_ABCD_INT_SENS_2 ] = {0 , gpio_reg_int_sens_2}, + [GPIO_1_8V_ABCD_INT_STATUS ] = {0 , gpio_reg_int_status}, + [GPIO_1_8V_ABCD_RESET_TOLERANT ] = {0 , gpio_reg_reset_tolerant}, + [GPIO_1_8V_ABCD_DEBOUNCE_1 ] = {0 , gpio_reg_debounce_1}, + [GPIO_1_8V_ABCD_DEBOUNCE_2 ] = {0 , gpio_reg_debounce_2}, + [GPIO_1_8V_ABCD_COMMAND_SRC_0 ] = {0 , gpio_reg_cmd_source_0}, + [GPIO_1_8V_ABCD_COMMAND_SRC_1 ] = {0 , gpio_reg_cmd_source_1}, + [GPIO_1_8V_ABCD_DATA_READ ] = {0 , gpio_reg_data_read}, + [GPIO_1_8V_ABCD_INPUT_MASK ] = {0 , gpio_reg_input_mask}, +/* 1.8V Set E */ + [GPIO_1_8V_E_DATA_VALUE ] = {1 , gpio_reg_data_value}, + [GPIO_1_8V_E_DIRECTION ] = {1 , gpio_reg_direction}, + [GPIO_1_8V_E_INT_ENABLE ] = {1 , gpio_reg_int_enable}, + [GPIO_1_8V_E_INT_SENS_0 ] = {1 , gpio_reg_int_sens_0}, + [GPIO_1_8V_E_INT_SENS_1 ] = {1 , gpio_reg_int_sens_1}, + [GPIO_1_8V_E_INT_SENS_2 ] = {1 , gpio_reg_int_sens_2}, + [GPIO_1_8V_E_INT_STATUS ] = {1 , gpio_reg_int_status}, + [GPIO_1_8V_E_RESET_TOLERANT ] = {1 , gpio_reg_reset_tolerant}, + [GPIO_1_8V_E_DEBOUNCE_1 ] = {1 , gpio_reg_debounce_1}, + [GPIO_1_8V_E_DEBOUNCE_2 ] = {1 , gpio_reg_debounce_2}, + [GPIO_1_8V_E_COMMAND_SRC_0 ] = {1 , gpio_reg_cmd_source_0}, + [GPIO_1_8V_E_COMMAND_SRC_1 ] = {1 , gpio_reg_cmd_source_1}, + [GPIO_1_8V_E_DATA_READ ] = {1 , gpio_reg_data_read}, + [GPIO_1_8V_E_INPUT_MASK ] = {1 , gpio_reg_input_mask}, +}; +static uint64_t aspeed_gpio_read (void *opaque,hwaddr offset,uint32_t size) {AspeedGPIOState *s =ASPEED_GPIO (opaque);
@@ -661,8 +736,11 @@ static void aspeed_gpio_get_pin(Object *obj, Visitor *v, const char *name,int set_idx, group_idx =0 ;if (sscanf (name,"gpio%2[A-Z]%1d" , group, &pin) !=2 ) { -error_setg (errp,"%s: error reading %s" , __func__, name); -return ; +/* 1.8V gpio */ +if (sscanf (name,"gpio%3s%1d" , group, &pin) !=2 ) { +error_setg (errp,"%s: error reading %s" , __func__, name); +return ; + } } set_idx =get_set_idx (s, group, &group_idx);if (set_idx ==-1 ) {
@@ -690,8 +768,11 @@ static void aspeed_gpio_set_pin(Object *obj, Visitor *v, const char *name,return ; }if (sscanf (name,"gpio%2[A-Z]%1d" , group, &pin) !=2 ) { -error_setg (errp,"%s: error reading %s" , __func__, name); -return ; +/* 1.8V gpio */ +if (sscanf (name,"gpio%3s%1d" , group, &pin) !=2 ) { +error_setg (errp,"%s: error reading %s" , __func__, name); +return ; + } } set_idx =get_set_idx (s, group, &group_idx);if (set_idx ==-1 ) {
@@ -724,6 +805,21 @@ static const GPIOSetProperties ast2500_set_props[] = { [7] = {0x000000ff, 0x000000ff, {"AC"} }, }; +static GPIOSetProperties ast2600_3_6v_set_props[] = { + [0 ] = {0xffffffff ,0xffffffff , {"A" ,"B" ,"C" ,"D" } }, + [1 ] = {0xffffffff ,0xffffffff , {"E" ,"F" ,"G" ,"H" } }, + [2 ] = {0xffffffff ,0xffffffff , {"I" ,"J" ,"K" ,"L" } }, + [3 ] = {0xffffffff ,0xffffffff , {"M" ,"N" ,"O" ,"P" } }, + [4 ] = {0xffffffff ,0xffffffff , {"Q" ,"R" ,"S" ,"T" } }, + [5 ] = {0xffffffff ,0x0000ffff , {"U" ,"V" ,"W" ,"X" } }, + [6 ] = {0xffff0000 ,0x0fff0000 , {"Y" ,"Z" ,"" ,"" } }, +}; + +static GPIOSetProperties ast2600_1_8v_set_props[] = { + [0 ] = {0xffffffff ,0xffffffff , {"18A" ,"18B" ,"18C" ,"18D" } }, + [1 ] = {0x0000000f ,0x0000000f , {"18E" } }, +}; +static const MemoryRegionOps aspeed_gpio_ops = { .read = aspeed_gpio_read, .write = aspeed_gpio_write,
@@ -756,7 +852,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_3_6V_MEM_SIZE ); +TYPE_ASPEED_GPIO ,GPIO_MAX_MEM_SIZE );sysbus_init_mmio (sbd, &s->iomem); }
@@ -849,6 +945,26 @@ static void aspeed_gpio_2500_class_init(ObjectClass *klass, void *data) agc->reg_table = aspeed_3_6v_gpios; } +static void aspeed_gpio_ast2600_3_6v_class_init (ObjectClass *klass,void *data) +{ +AspeedGPIOClass *agc =ASPEED_GPIO_CLASS (klass); + + agc->props = ast2600_3_6v_set_props; + agc->nr_gpio_pins =208 ; + agc->nr_gpio_sets =7 ; + agc->reg_table = aspeed_3_6v_gpios; +} + +static void aspeed_gpio_ast2600_1_8v_class_init (ObjectClass *klass,void *data) +{ +AspeedGPIOClass *agc =ASPEED_GPIO_CLASS (klass); + + agc->props = ast2600_1_8v_set_props; + agc->nr_gpio_pins =36 ; + agc->nr_gpio_sets =2 ; + agc->reg_table = aspeed_1_8v_gpios; +} +static const TypeInfo aspeed_gpio_info = { .name =TYPE_ASPEED_GPIO , .parent =TYPE_SYS_BUS_DEVICE ,
@@ -872,11 +988,27 @@ static const TypeInfo aspeed_gpio_ast2500_info = { .instance_init = aspeed_gpio_init, }; +static const TypeInfo aspeed_gpio_ast2600_3_6v_info = { + .name =TYPE_ASPEED_GPIO "-ast2600" , + .parent =TYPE_ASPEED_GPIO , + .class_init = aspeed_gpio_ast2600_3_6v_class_init, + .instance_init = aspeed_gpio_init, +}; + +static const TypeInfo aspeed_gpio_ast2600_1_8v_info = { + .name =TYPE_ASPEED_GPIO "-ast2600-1_8v" , + .parent =TYPE_ASPEED_GPIO , + .class_init = aspeed_gpio_ast2600_1_8v_class_init, + .instance_init = aspeed_gpio_init, +}; +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_1_8v_info); }type_init (aspeed_gpio_register_types);
Signature · 1 line
2.20.1