Skip to contentSkip to conversation

gpio: zynq: Add support for Versal

PATCH New Michal Simek 2 participants 5 messages Oct 14, 2019 – Oct 24, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover gpio: zynq: Add support for Versal

Hi,

this patchset is updating existing zynq driver with adding two layout. One for Versal gpio and another one on PMC gpio which is using different layout. And also enabling gpio command for versal.

Thanks,
Michal

Ashok Reddy Soma (1):
gpio: zynq: Add gpio driver support for Versal

Michal Simek (1):
arm64: versal: Enable GPIO command for Versal

Shubhrajyoti Datta (1):
gpio: zynq: Add gpio driver support for PMC gpio

 configs/xilinx_versal_virt_defconfig |  1 +
 drivers/gpio/Kconfig                 |  2 +-
 drivers/gpio/zynq_gpio.c             | 34 ++++++++++++++++++++++++++++
 3 files changed, 36 insertions(+), 1 deletion(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/3 gpio: zynq: Add gpio driver support for Versal

From: Ashok Reddy Soma <[email protected]>

This patch adds support for gpio driver for versal platform

---

 drivers/gpio/Kconfig     |  2 +-
 drivers/gpio/zynq_gpio.c | 15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
drivers/gpio/Kconfig +1 -1
index f2dabb554fa9..7abde0da8f82 100644
@@ -294,7 +294,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.
drivers/gpio/zynq_gpio.c +15 -0
index a760c5bdda68..9febf34896b0 100644
@@ -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},
 	{ }
 };
 
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/3 gpio: zynq: Add gpio driver support for PMC gpio

In reply to Michal Simek

From: Shubhrajyoti Datta <[email protected]>

This patch adds support for gpio driver for pmc gpio.

---

 drivers/gpio/zynq_gpio.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
drivers/gpio/zynq_gpio.c +19 -0
index 9febf34896b0..fe3b2c3b1aa8 100644
@@ -93,6 +93,9 @@
 /* GPIO upper 16 bit mask */
 #define ZYNQ_GPIO_UPPER_MASK 0xFFFF0000
 
+#define PMC_GPIO_NR_GPIOS	116
+#define PMC_GPIO_MAX_BANK	5
+
 struct zynq_gpio_platdata {
 	phys_addr_t base;
 	const struct zynq_platform_data *p_data;
@@ -127,6 +130,20 @@ static const struct zynq_platform_data versal_gpio_def = {
 	.bank_max[3] = 57,
 };
 
+static const struct zynq_platform_data pmc_gpio_def = {
+	.label = "pmc_gpio",
+	.ngpio = PMC_GPIO_NR_GPIOS,
+	.max_bank = PMC_GPIO_MAX_BANK,
+	.bank_min[0] = 0,
+	.bank_max[0] = 25,
+	.bank_min[1] = 26,
+	.bank_max[1] = 51,
+	.bank_min[3] = 52,
+	.bank_max[3] = 83,
+	.bank_min[4] = 84,
+	.bank_max[4] = 115,
+};
+
 static const struct zynq_platform_data zynqmp_gpio_def = {
 	.label = "zynqmp_gpio",
 	.ngpio = ZYNQMP_GPIO_NR_GPIOS,
@@ -344,6 +361,8 @@ static const struct udevice_id zynq_gpio_ids[] = {
 	  .data = (ulong)&zynqmp_gpio_def},
 	{ .compatible = "xlnx,versal-gpio-1.0",
 	  .data = (ulong)&versal_gpio_def},
+	{ .compatible = "xlnx,pmc-gpio-1.0",
+	  .data = (ulong)&pmc_gpio_def },
 	{ }
 };
 
Signature · 1 line
2.17.1
#3 lore raw

PATCH 3/3 arm64: versal: Enable GPIO command for Versal

In reply to Michal Simek

Enable GPIO command for Xilinx Versal platform. Driver is updated that's why it can be used directly. Driver is enabled by default through Kconfig.

---

 configs/xilinx_versal_virt_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/xilinx_versal_virt_defconfig +1 -0
index 3ff23a2b2b62..f5ce8a0a1e88 100644
@@ -19,6 +19,7 @@ CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
 CONFIG_CMD_DM=y
 # CONFIG_CMD_FLASH is not set
+CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
Signature · 1 line
2.17.1
Applied
#4 lore raw

cover gpio: zynq: Add support for Versal

In reply to Michal Simek

po 14. 10. 2019 v 11:05 odesílatel Michal Simek
<[email protected]> napsal:

Quoted 20 lines

Hi,

this patchset is updating existing zynq driver with adding two layout. One for Versal gpio and another one on PMC gpio which is using different layout. And also enabling gpio command for versal.

Thanks,
Michal

Ashok Reddy Soma (1):
gpio: zynq: Add gpio driver support for Versal

Michal Simek (1):
arm64: versal: Enable GPIO command for Versal

Shubhrajyoti Datta (1):
gpio: zynq: Add gpio driver support for PMC gpio

Quoted 8 lines
 configs/xilinx_versal_virt_defconfig |  1 +
 drivers/gpio/Kconfig                 |  2 +-
 drivers/gpio/zynq_gpio.c             | 34 ++++++++++++++++++++++++++++
 3 files changed, 36 insertions(+), 1 deletion(-)

--
2.17.1

Applied.
M

Signature · 5 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs