From 04b86dd335e0f11908a5470d6a4135f16b1a9b9d Mon Sep 17 00:00:00 2001 From: msiddare <84937930+msiddare@users.noreply.github.com> Date: Wed, 1 Sep 2021 09:23:45 -0700 Subject: [PATCH] Configurable GPIO option ARCH_NR_GPIO for x86 architecture (#232) The x86 platform did not allow configuring the maximum number of GPIOs supported, although the ARM platform did. For cisco-8000 platform, each FPGA gpio IP block can support 1K pins. Distributed chassis with Route processor and Fabric card can have 10 such IP blocks, along with additional pins through i2c gpio extenders. This patch supports configurable number of GPIO's at kernel config time similar to ARM platform. Signed-off-by: Madhava Reddy Siddareddygari --- patch/cisco-x86-gpio-config.patch | 42 +++++++++++++++++++++++++++++++ patch/series | 4 +++ 2 files changed, 46 insertions(+) create mode 100644 patch/cisco-x86-gpio-config.patch diff --git a/patch/cisco-x86-gpio-config.patch b/patch/cisco-x86-gpio-config.patch new file mode 100644 index 000000000000..402c41406470 --- /dev/null +++ b/patch/cisco-x86-gpio-config.patch @@ -0,0 +1,42 @@ +From 7106f3961be1dc0d921efe5c719ada6096307227 Mon Sep 17 00:00:00 2001 +From: Madhava Reddy Siddareddygari +Date: Tue, 10 Aug 2021 12:51:47 -0700 +Subject: [PATCH] x86/Kconfig: Introduce ARCH_NR_GPIO + +The x86 platform did not allow configuring the maximum number of GPIOs +supported, although the ARM platform did. For cisco-8000 platform, +each FPGA gpio IP block can support 1K pins. Distributed chassis with +Route Processor and Fabric cards can have 10 such IP blocks, along with +additional pins through i2c gpio extenders. + +This patch supports configurable number of GPIO's at kernel config time +similar to ARM platform. + +Signed-off-by: Madhava Reddy Siddareddygari +--- + arch/x86/Kconfig | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig +index d2453b251..e894cd71d 100644 +--- a/arch/x86/Kconfig ++++ b/arch/x86/Kconfig +@@ -1033,6 +1033,15 @@ config SCHED_MC_PRIO + + If unsure say Y here. + ++config ARCH_NR_GPIO ++ int ++ prompt "Maximum number of GPIO's" ++ default 512 ++ help ++ Maximum number of GPIOs in the system. ++ ++ If unsure, leave the default value. ++ + config UP_LATE_INIT + def_bool y + depends on !SMP && X86_LOCAL_APIC +-- +2.26.2 + diff --git a/patch/series b/patch/series index 442f05e31c10..704b73000641 100755 --- a/patch/series +++ b/patch/series @@ -85,11 +85,15 @@ net-sch_generic-fix-the-missing-new-qdisc-assignment.patch 0031-backport-nvme-Add-hardware-monitoring-support.patch 0032-platform-mellanox-mlxreg-hotplug-Use-capability-regi.patch + # Cisco patches for 4.19 kernel cisco-mtd-part.patch +cisco-x86-gpio-config.patch # # Marvell platform patches for 4.19 armhf_secondary_boot_online.patch +# +# ############################################################ # # Internal patches will be added below (placeholder)