1 /* SPDX-License-Identifier: BSD-2-Clause */ 2 /* 3 * Copyright (C) 2022 Foundries.io Ltd 4 */ 5 6 #ifndef __DRIVERS_VERSAL_GPIO_H 7 #define __DRIVERS_VERSAL_GPIO_H 8 9 #include <gpio.h> 10 #include <stdlib.h> 11 #include <tee_api_types.h> 12 #include <util.h> 13 14 #define VERSAL_GPIO_MAX_BANK 5 15 16 struct versal_gpio_platform_data { 17 const char *label; 18 uint16_t ngpio; 19 uint32_t max_bank; 20 uint32_t bank_min[VERSAL_GPIO_MAX_BANK]; 21 uint32_t bank_max[VERSAL_GPIO_MAX_BANK]; 22 }; 23 24 struct versal_gpio_platdata { 25 paddr_t base; 26 const struct versal_gpio_platform_data *p_data; 27 }; 28 29 struct versal_gpio_chip { 30 struct gpio_chip chip; 31 struct versal_gpio_platdata plat; 32 vaddr_t base; 33 }; 34 35 TEE_Result versal_gpio_pmc_init(struct versal_gpio_chip *chip); 36 TEE_Result versal_gpio_ps_init(struct versal_gpio_chip *chip); 37 38 #endif /* __DRIVERS_VERSAL_GPIO_H */ 39