| // Copyright 2022 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #ifndef SRC_DEVICES_GPIO_DRIVERS_AML_GPIO_A5_BLOCKS_H_ |
| #define SRC_DEVICES_GPIO_DRIVERS_AML_GPIO_A5_BLOCKS_H_ |
| |
| #include <soc/aml-a5/a5-gpio.h> |
| |
| #include "aml-gpio.h" |
| |
| namespace gpio { |
| |
| constexpr AmlGpioBlock a5_gpio_blocks[] = { |
| // GPIO B Block |
| { |
| .start_pin = (A5_GPIOB_START + 0), |
| .pin_block = A5_GPIOB_START, |
| .pin_count = 8, |
| .mux_offset = A5_PERIPHS_PIN_MUX_0, |
| .oen_offset = A5_PREG_PAD_GPIOB_OEN, |
| .input_offset = A5_PREG_PAD_GPIOB_I, |
| .output_offset = A5_PREG_PAD_GPIOB_O, |
| .output_shift = 0, |
| .pull_offset = A5_PREG_PAD_GPIOB_PULL_UP, |
| .pull_en_offset = A5_PREG_PAD_GPIOB_PULL_EN, |
| .mmio_index = 0, |
| .pin_start = A5_GPIOB_PIN_START, |
| .ds_offset = A5_PREG_PAD_GPIOB_DS, |
| }, |
| { |
| .start_pin = (A5_GPIOB_START + 8), |
| .pin_block = A5_GPIOB_START, |
| .pin_count = 6, |
| .mux_offset = A5_PERIPHS_PIN_MUX_1, |
| .oen_offset = A5_PREG_PAD_GPIOB_OEN, |
| .input_offset = A5_PREG_PAD_GPIOB_I, |
| .output_offset = A5_PREG_PAD_GPIOB_O, |
| .output_shift = 0, |
| .pull_offset = A5_PREG_PAD_GPIOB_PULL_UP, |
| .pull_en_offset = A5_PREG_PAD_GPIOB_PULL_EN, |
| .mmio_index = 0, |
| .pin_start = A5_GPIOB_PIN_START, |
| .ds_offset = A5_PREG_PAD_GPIOB_DS, |
| }, |
| // GPIO C Block |
| { |
| .start_pin = (A5_GPIOC_START + 0), |
| .pin_block = A5_GPIOC_START, |
| .pin_count = 8, |
| .mux_offset = A5_PERIPHS_PIN_MUX_9, |
| .oen_offset = A5_PREG_PAD_GPIOC_OEN, |
| .input_offset = A5_PREG_PAD_GPIOC_I, |
| .output_offset = A5_PREG_PAD_GPIOC_O, |
| .output_shift = 0, |
| .pull_offset = A5_PREG_PAD_GPIOC_PULL_UP, |
| .pull_en_offset = A5_PREG_PAD_GPIOC_PULL_EN, |
| .mmio_index = 0, |
| .pin_start = A5_GPIOC_PIN_START, |
| .ds_offset = A5_PREG_PAD_GPIOC_DS, |
| }, |
| { |
| .start_pin = (A5_GPIOC_START + 8), |
| .pin_block = A5_GPIOC_START, |
| .pin_count = 3, |
| .mux_offset = A5_PERIPHS_PIN_MUX_A, |
| .oen_offset = A5_PREG_PAD_GPIOC_OEN, |
| .input_offset = A5_PREG_PAD_GPIOC_I, |
| .output_offset = A5_PREG_PAD_GPIOC_O, |
| .output_shift = 0, |
| .pull_offset = A5_PREG_PAD_GPIOC_PULL_UP, |
| .pull_en_offset = A5_PREG_PAD_GPIOC_PULL_EN, |
| .mmio_index = 0, |
| .pin_start = A5_GPIOC_PIN_START, |
| .ds_offset = A5_PREG_PAD_GPIOC_DS, |
| }, |
| // GPIO E Block |
| { |
| .start_pin = (A5_GPIOE_START + 0), |
| .pin_block = A5_GPIOE_START, |
| .pin_count = 2, |
| .mux_offset = A5_PERIPHS_PIN_MUX_I, |
| .oen_offset = A5_PREG_PAD_GPIOE_OEN, |
| .input_offset = A5_PREG_PAD_GPIOE_I, |
| .output_offset = A5_PREG_PAD_GPIOE_O, |
| .output_shift = 0, |
| .pull_offset = A5_PREG_PAD_GPIOE_PULL_UP, |
| .pull_en_offset = A5_PREG_PAD_GPIOE_PULL_EN, |
| .mmio_index = 0, |
| .pin_start = A5_GPIOE_PIN_START, |
| .ds_offset = A5_PREG_PAD_GPIOE_DS, |
| }, |
| // GPIO H Block |
| { |
| .start_pin = (A5_GPIOH_START + 0), |
| .pin_block = A5_GPIOH_START, |
| .pin_count = 5, |
| .mux_offset = A5_PERIPHS_PIN_MUX_J, |
| .oen_offset = A5_PREG_PAD_GPIOH_OEN, |
| .input_offset = A5_PREG_PAD_GPIOH_I, |
| .output_offset = A5_PREG_PAD_GPIOH_O, |
| .output_shift = 0, |
| .pull_offset = A5_PREG_PAD_GPIOH_PULL_UP, |
| .pull_en_offset = A5_PREG_PAD_GPIOH_PULL_EN, |
| .mmio_index = 0, |
| .pin_start = A5_GPIOH_PIN_START, |
| .ds_offset = A5_PREG_PAD_GPIOH_DS, |
| }, |
| // GPIO D Block |
| { |
| .start_pin = (A5_GPIOD_START + 0), |
| .pin_block = A5_GPIOD_START, |
| .pin_count = 8, |
| .mux_offset = A5_PERIPHS_PIN_MUX_G, |
| .oen_offset = A5_PREG_PAD_GPIOD_OEN, |
| .input_offset = A5_PREG_PAD_GPIOD_I, |
| .output_offset = A5_PREG_PAD_GPIOD_O, |
| .output_shift = 0, |
| .pull_offset = A5_PREG_PAD_GPIOD_PULL_UP, |
| .pull_en_offset = A5_PREG_PAD_GPIOD_PULL_EN, |
| .mmio_index = 0, |
| .pin_start = A5_GPIOD_PIN_START, |
| .ds_offset = A5_PREG_PAD_GPIOD_DS, |
| }, |
| { |
| .start_pin = (A5_GPIOD_START + 8), |
| .pin_block = A5_GPIOD_START, |
| .pin_count = 8, |
| .mux_offset = A5_PERIPHS_PIN_MUX_H, |
| .oen_offset = A5_PREG_PAD_GPIOD_OEN, |
| .input_offset = A5_PREG_PAD_GPIOD_I, |
| .output_offset = A5_PREG_PAD_GPIOD_O, |
| .output_shift = 0, |
| .pull_offset = A5_PREG_PAD_GPIOD_PULL_UP, |
| .pull_en_offset = A5_PREG_PAD_GPIOD_PULL_EN, |
| .mmio_index = 0, |
| .pin_start = A5_GPIOD_PIN_START, |
| .ds_offset = A5_PREG_PAD_GPIOD_DS, |
| }, |
| // GPIO T Block |
| { |
| .start_pin = (A5_GPIOT_START + 0), |
| .pin_block = A5_GPIOT_START, |
| .pin_count = 8, |
| .mux_offset = A5_PERIPHS_PIN_MUX_B, |
| .oen_offset = A5_PREG_PAD_GPIOT_OEN, |
| .input_offset = A5_PREG_PAD_GPIOT_I, |
| .output_offset = A5_PREG_PAD_GPIOT_O, |
| .output_shift = 0, |
| .pull_offset = A5_PREG_PAD_GPIOT_PULL_UP, |
| .pull_en_offset = A5_PREG_PAD_GPIOT_PULL_EN, |
| .mmio_index = 0, |
| .pin_start = A5_GPIOT_PIN_START, |
| .ds_offset = A5_PREG_PAD_GPIOT_DS, |
| }, |
| { |
| .start_pin = (A5_GPIOT_START + 8), |
| .pin_block = A5_GPIOT_START, |
| .pin_count = 6, |
| .mux_offset = A5_PERIPHS_PIN_MUX_C, |
| .oen_offset = A5_PREG_PAD_GPIOT_OEN, |
| .input_offset = A5_PREG_PAD_GPIOT_I, |
| .output_offset = A5_PREG_PAD_GPIOT_O, |
| .output_shift = 0, |
| .pull_offset = A5_PREG_PAD_GPIOT_PULL_UP, |
| .pull_en_offset = A5_PREG_PAD_GPIOT_PULL_EN, |
| .mmio_index = 0, |
| .pin_start = A5_GPIOT_PIN_START, |
| .ds_offset = A5_PREG_PAD_GPIOT_DS, |
| }, |
| // GPIO X Block |
| { |
| .start_pin = (A5_GPIOX_START + 0), |
| .pin_block = A5_GPIOX_START, |
| .pin_count = 8, |
| .mux_offset = A5_PERIPHS_PIN_MUX_3, |
| .oen_offset = A5_PREG_PAD_GPIOX_OEN, |
| .input_offset = A5_PREG_PAD_GPIOX_I, |
| .output_offset = A5_PREG_PAD_GPIOX_O, |
| .output_shift = 0, |
| .pull_offset = A5_PREG_PAD_GPIOX_PULL_UP, |
| .pull_en_offset = A5_PREG_PAD_GPIOX_PULL_EN, |
| .mmio_index = 0, |
| .pin_start = A5_GPIOX_PIN_START, |
| .ds_offset = A5_PREG_PAD_GPIOX_DS, |
| }, |
| { |
| .start_pin = (A5_GPIOX_START + 8), |
| .pin_block = A5_GPIOX_START, |
| .pin_count = 8, |
| .mux_offset = A5_PERIPHS_PIN_MUX_4, |
| .oen_offset = A5_PREG_PAD_GPIOX_OEN, |
| .input_offset = A5_PREG_PAD_GPIOX_I, |
| .output_offset = A5_PREG_PAD_GPIOX_O, |
| .output_shift = 0, |
| .pull_offset = A5_PREG_PAD_GPIOX_PULL_UP, |
| .pull_en_offset = A5_PREG_PAD_GPIOX_PULL_EN, |
| .mmio_index = 0, |
| .pin_start = A5_GPIOX_PIN_START, |
| .ds_offset = A5_PREG_PAD_GPIOX_DS, |
| }, |
| { |
| .start_pin = (A5_GPIOX_START + 16), |
| .pin_block = A5_GPIOX_START, |
| .pin_count = 4, |
| .mux_offset = A5_PERIPHS_PIN_MUX_5, |
| .oen_offset = A5_PREG_PAD_GPIOX_OEN, |
| .input_offset = A5_PREG_PAD_GPIOX_I, |
| .output_offset = A5_PREG_PAD_GPIOX_O, |
| .output_shift = 0, |
| .pull_offset = A5_PREG_PAD_GPIOX_PULL_UP, |
| .pull_en_offset = A5_PREG_PAD_GPIOX_PULL_EN, |
| .mmio_index = 0, |
| .pin_start = A5_GPIOX_PIN_START, |
| .ds_offset = A5_PREG_PAD_GPIOX_DS_EXT, |
| }, |
| // GPIO Z Block |
| { |
| .start_pin = (A5_GPIOZ_START + 0), |
| .pin_block = A5_GPIOZ_START, |
| .pin_count = 8, |
| .mux_offset = A5_PERIPHS_PIN_MUX_6, |
| .oen_offset = A5_PREG_PAD_GPIOZ_OEN, |
| .input_offset = A5_PREG_PAD_GPIOZ_I, |
| .output_offset = A5_PREG_PAD_GPIOZ_O, |
| .output_shift = 0, |
| .pull_offset = A5_PREG_PAD_GPIOZ_PULL_UP, |
| .pull_en_offset = A5_PREG_PAD_GPIOZ_PULL_EN, |
| .mmio_index = 0, |
| .pin_start = A5_GPIOZ_PIN_START, |
| .ds_offset = A5_PREG_PAD_GPIOZ_DS, |
| }, |
| { |
| .start_pin = (A5_GPIOZ_START + 8), |
| .pin_block = A5_GPIOZ_START, |
| .pin_count = 8, |
| .mux_offset = A5_PERIPHS_PIN_MUX_7, |
| .oen_offset = A5_PREG_PAD_GPIOZ_OEN, |
| .input_offset = A5_PREG_PAD_GPIOZ_I, |
| .output_offset = A5_PREG_PAD_GPIOZ_O, |
| .output_shift = 0, |
| .pull_offset = A5_PREG_PAD_GPIOZ_PULL_UP, |
| .pull_en_offset = A5_PREG_PAD_GPIOZ_PULL_EN, |
| .mmio_index = 0, |
| .pin_start = A5_GPIOZ_PIN_START, |
| .ds_offset = A5_PREG_PAD_GPIOZ_DS, |
| }, |
| }; |
| |
| constexpr AmlGpioInterrupt a5_interrupt_block = { |
| .pin_select_offset = A5_GPIO_IRQ_0_1_PIN_FILTER_SELECT, |
| .edge_polarity_offset = A5_GPIO_INT_EDGE_POLARITY, |
| .filter_select_offset = A5_GPIO_IRQ_0_1_PIN_FILTER_SELECT, |
| }; |
| |
| } // namespace gpio |
| |
| #endif // SRC_DEVICES_GPIO_DRIVERS_AML_GPIO_A5_BLOCKS_H_ |