From: Heiko Schocher <hs@nabladev.com>
To: linux-kernel@vger.kernel.org
Cc: linux-fpga@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Heiko Schocher <hs@nabladev.com>,
Michal Simek <michal.simek@amd.com>,
Moritz Fischer <mdf@kernel.org>, Tom Rix <trix@redhat.com>,
Xu Yilun <yilun.xu@intel.com>
Subject: [PATCH v1] driver: fpga: xilinx-selectmap: add csi and rdwr support
Date: Thu, 16 Jul 2026 09:00:12 +0200 [thread overview]
Message-ID: <20260716070020.4113618-1-hs@nabladev.com> (raw)
Add csi_b and rdwr pin support for the xilinx,selectmap driver.
In current driver the pins are configured from DTS and set to
GPIOD_OUT_HIGH. This works in case you have one FPGA.
Extend this to really implement csi_b and rdwr pin function in
driver, so it works with more than one FPGA.
Tested on AM625 based board with 2 FPGAs connected to GPMC.
Signed-off-by: Heiko Schocher <hs@nabladev.com>
---
drivers/fpga/xilinx-selectmap.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/drivers/fpga/xilinx-selectmap.c b/drivers/fpga/xilinx-selectmap.c
index d0cbb5fdfe3a..b5fbdedf8aec 100644
--- a/drivers/fpga/xilinx-selectmap.c
+++ b/drivers/fpga/xilinx-selectmap.c
@@ -19,6 +19,8 @@
struct xilinx_selectmap_conf {
struct xilinx_fpga_core core;
void __iomem *base;
+ struct gpio_desc *csi_b;
+ struct gpio_desc *rdwr_b;
};
#define to_xilinx_selectmap_conf(obj) \
@@ -30,9 +32,21 @@ static int xilinx_selectmap_write(struct xilinx_fpga_core *core,
struct xilinx_selectmap_conf *conf = to_xilinx_selectmap_conf(core);
size_t i;
+ if (conf->csi_b)
+ gpiod_set_value(conf->csi_b, GPIOD_OUT_HIGH);
+
+ if (conf->rdwr_b)
+ gpiod_set_value(conf->rdwr_b, GPIOD_OUT_HIGH);
+
for (i = 0; i < count; ++i)
writeb(buf[i], conf->base);
+ if (conf->rdwr_b)
+ gpiod_set_value(conf->rdwr_b, GPIOD_OUT_LOW);
+
+ if (conf->csi_b)
+ gpiod_set_value(conf->csi_b, GPIOD_OUT_LOW);
+
return 0;
}
@@ -56,16 +70,18 @@ static int xilinx_selectmap_probe(struct platform_device *pdev)
conf->base = base;
/* CSI_B is active low */
- gpio = devm_gpiod_get_optional(&pdev->dev, "csi", GPIOD_OUT_HIGH);
+ gpio = devm_gpiod_get_optional(&pdev->dev, "csi", GPIOD_OUT_LOW);
if (IS_ERR(gpio))
return dev_err_probe(&pdev->dev, PTR_ERR(gpio),
"Failed to get CSI_B gpio\n");
+ conf->csi_b = gpio;
/* RDWR_B is active low */
- gpio = devm_gpiod_get_optional(&pdev->dev, "rdwr", GPIOD_OUT_HIGH);
+ gpio = devm_gpiod_get_optional(&pdev->dev, "rdwr", GPIOD_OUT_LOW);
if (IS_ERR(gpio))
return dev_err_probe(&pdev->dev, PTR_ERR(gpio),
"Failed to get RDWR_B gpio\n");
+ conf->rdwr_b = gpio;
return xilinx_core_probe(&conf->core);
}
---
base-commit: 58717b2a1365d06c8c64b72aa948541b53fe31eb
--
2.55.0
reply other threads:[~2026-07-16 7:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260716070020.4113618-1-hs@nabladev.com \
--to=hs@nabladev.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mdf@kernel.org \
--cc=michal.simek@amd.com \
--cc=trix@redhat.com \
--cc=yilun.xu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox