driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
From: Rahul Gottipati <rahul.blr97@gmail.com>
To: gregkh@linuxfoundation.org, insop.song@gainspeed.com
Cc: devel@driverdev.osuosl.org
Subject: [PATCH] staging: gs_fpgaboot: get bus width input
Date: Tue, 21 Jul 2020 23:32:03 +0530	[thread overview]
Message-ID: <20200721180203.GA16154@rahulg-ThinkPad-T450> (raw)

This adds a module parameter to get the program bus width as an
input rather than hardcoding it, and checks off a TODO item.

Signed-off-by: Rahul Gottipati <rahul.blr97@gmail.com>
---
 drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
index 3e154562c64d..3d79e046c060 100644
--- a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
+++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
@@ -32,6 +32,10 @@ static char	*file = "xlinx_fpga_firmware.bit";
 module_param(file, charp, 0444);
 MODULE_PARM_DESC(file, "Xilinx FPGA firmware file.");
 
+static unsigned int bus_width_bytes = 2;
+module_param(bus_width_bytes, uint, 0444);
+MODULE_PARM_DESC(bus_width_bytes, "Program bus width in bytes.");
+
 static void read_bitstream(u8 *bitdata, u8 *buf, int *offset, int rdsize)
 {
 	memcpy(buf, bitdata + *offset, rdsize);
@@ -319,7 +323,15 @@ static int gs_fpgaboot(void)
 		goto err_out2;
 	}
 
-	err = gs_download_image(fimage, bus_2byte);
+	if (bus_width_bytes == 2) {
+		err = gs_download_image(fimage, bus_2byte);
+	} else if (bus_width_bytes == 1) {
+		err = gs_download_image(fimage, bus_1byte);
+	} else {
+		pr_err("unsupported program bus width\n");
+		goto err_out2;
+	}
+
 	if (err) {
 		pr_err("gs_download_image error\n");
 		goto err_out2;
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

             reply	other threads:[~2020-07-21 18:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21 18:02 Rahul Gottipati [this message]
2020-07-21 18:05 ` [PATCH] staging: gs_fpgaboot: get bus width input Greg KH
2020-07-22  6:27   ` Rahul Gottipati
2020-07-22  6:32     ` Greg KH
2020-07-22  6:41       ` Rahul Gottipati
2020-07-22  6:53         ` Greg KH

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=20200721180203.GA16154@rahulg-ThinkPad-T450 \
    --to=rahul.blr97@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=insop.song@gainspeed.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;
as well as URLs for NNTP newsgroup(s).