From: Ashok Reddy Soma Date: Mon, 16 Sep 2019 09:35:16 +0000 (-0600) Subject: gpio: zynq: Add gpio driver support for Versal X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=982485214f64e02f0eee8dfde05cf4e05aedfb97;p=u-boot.git gpio: zynq: Add gpio driver support for Versal This patch adds support for gpio driver for versal platform Signed-off-by: Ashok Reddy Soma Signed-off-by: Michal Simek --- diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 39f2c7e328..c1ad5d64a3 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -301,7 +301,7 @@ config MVEBU_GPIO config ZYNQ_GPIO bool "Zynq GPIO driver" - depends on DM_GPIO && (ARCH_ZYNQ || ARCH_ZYNQMP) + depends on DM_GPIO && (ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL) default y help Supports GPIO access on Zynq SoC. diff --git a/drivers/gpio/zynq_gpio.c b/drivers/gpio/zynq_gpio.c index a760c5bdda..9febf34896 100644 --- a/drivers/gpio/zynq_gpio.c +++ b/drivers/gpio/zynq_gpio.c @@ -114,6 +114,19 @@ struct zynq_platform_data { u32 bank_max[ZYNQMP_GPIO_MAX_BANK]; }; +#define VERSAL_GPIO_NR_GPIOS 58 +#define VERSAL_GPIO_MAX_BANK 4 + +static const struct zynq_platform_data versal_gpio_def = { + .label = "versal_gpio", + .ngpio = VERSAL_GPIO_NR_GPIOS, + .max_bank = VERSAL_GPIO_MAX_BANK, + .bank_min[0] = 0, + .bank_max[0] = 25, + .bank_min[3] = 26, + .bank_max[3] = 57, +}; + static const struct zynq_platform_data zynqmp_gpio_def = { .label = "zynqmp_gpio", .ngpio = ZYNQMP_GPIO_NR_GPIOS, @@ -329,6 +342,8 @@ static const struct udevice_id zynq_gpio_ids[] = { .data = (ulong)&zynq_gpio_def}, { .compatible = "xlnx,zynqmp-gpio-1.0", .data = (ulong)&zynqmp_gpio_def}, + { .compatible = "xlnx,versal-gpio-1.0", + .data = (ulong)&versal_gpio_def}, { } };