All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@xilinx.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 01/17] cmd: fpga: Remove fit image support passed without fpga device
Date: Wed,  8 Aug 2018 13:37:27 +0200	[thread overview]
Message-ID: <b9363bbad93720b7a69ceb4e73ba1ed7afc48dd2.1533728254.git.michal.simek@xilinx.com> (raw)
In-Reply-To: <cover.1533728254.git.michal.simek@xilinx.com>

The patch applied in 2010
"cmd_fpga: cleanup help and check parameters"
(sha1: a790b5b2326be9d7c9ad9e3d9b51a8bfabc62d07"
was adding this checking

+       if (dev == FPGA_INVALID_DEVICE) {
+               puts("FPGA device not specified\n");
+               op = FPGA_NONE;
+       }

which simply broke one command flow which was
setenv fpga <dev>
fpga loadmk <addr> // legacy image
fpga loadmk <addr>:<fit_image_name> //fit image

Also this sequence for FIT image is completely broken
setenv fpga <dev>
setenv fpgadata <addr>:<fit_image_name>
fpga loadmk
(Note: For legacy images this is working fine).

even from code I don't think this has ever worked properly
for fit image (dev = FPGA_INVALID_DEVICE should be rejected
by fpga core). Fit image support was in 2008 added by:
"[new uImage] Add new uImage fromat support to fpga command"
(sha1: c28c4d193dbfb20b2dd3a5447640fd6de7fd0720)

Just a summary of these facts that none found this for pretty long time
it shouldn't be a problem to remove this flow (without fpga dev)
completely to simplify the code.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None
Changes in v1: None

I am rewriting cmd/fpga.c file to use u-boot subcommand and I found
that these flow are not working.

---
 cmd/fpga.c | 25 -------------------------
 1 file changed, 25 deletions(-)

diff --git a/cmd/fpga.c b/cmd/fpga.c
index 74ae80c807e2..791fe5cb7718 100644
--- a/cmd/fpga.c
+++ b/cmd/fpga.c
@@ -127,31 +127,6 @@ int do_fpga(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 	case 3:		/* fpga <op> <dev | data addr> */
 		dev = (int)simple_strtoul(argv[2], NULL, 16);
 		debug("%s: device = %d\n", __func__, dev);
-		/* FIXME - this is a really weak test */
-		if ((argc == 3) && (dev > fpga_count())) {
-			/* must be buffer ptr */
-			debug("%s: Assuming buffer pointer in arg 3\n",
-			      __func__);
-
-#if defined(CONFIG_FIT)
-			if (fit_parse_subimage(argv[2], (ulong)fpga_data,
-					       &fit_addr, &fit_uname)) {
-				fpga_data = (void *)fit_addr;
-				debug("*  fpga: subimage '%s' from FIT image ",
-				      fit_uname);
-				debug("at 0x%08lx\n", fit_addr);
-			} else
-#endif
-			{
-				fpga_data = (void *)(uintptr_t)dev;
-				debug("*  fpga: cmdline image addr = 0x%08lx\n",
-				      (ulong)fpga_data);
-			}
-
-			debug("%s: fpga_data = 0x%lx\n",
-			      __func__, (ulong)fpga_data);
-			dev = FPGA_INVALID_DEVICE;	/* reset device num */
-		}
 	}
 
 	if (dev == FPGA_INVALID_DEVICE) {
-- 
1.9.1

  reply	other threads:[~2018-08-08 11:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-08 11:37 [U-Boot] [PATCH v2 00/17] cmd: fpga: Fix fpga command handling and add some fpga tests Michal Simek
2018-08-08 11:37 ` Michal Simek [this message]
2018-08-08 11:37 ` [U-Boot] [PATCH v2 02/17] test/py: Extend fpga command to test all fpga load types Michal Simek
2018-08-08 11:37 ` [U-Boot] [PATCH v2 03/17] cmd: fpga: Move error handling to do_fpga() Michal Simek
2018-08-08 11:37 ` [U-Boot] [PATCH v2 04/17] cmd: fpga: Move fpga_get_op to avoid local function declaration Michal Simek
2018-08-08 11:37 ` [U-Boot] [PATCH v2 05/17] cmd: fpga: Cleanup error handling in connection to FPGA_NONE Michal Simek
2018-08-08 11:37 ` [U-Boot] [PATCH v2 06/17] cmd: fpga: Move parameter checking for loadfs/loads Michal Simek
2018-08-08 11:37 ` [U-Boot] [PATCH v2 07/17] cmd: fpga: Remove parameter checking from fpga loadfs command Michal Simek
2018-08-08 11:37 ` [U-Boot] [PATCH v2 08/17] cmd: fpga: Clean wrong_parms handling Michal Simek
2018-08-08 11:37 ` [U-Boot] [PATCH v2 09/17] cmd: fpga: Create new do_fpga_wrapper for using u-boot subcommands Michal Simek
2018-08-08 11:37 ` [U-Boot] [PATCH v2 10/17] cmd: fpga: Extract fpga info command to separate function Michal Simek
2018-08-08 11:37 ` [U-Boot] [PATCH v2 11/17] cmd: fpga: Fix dump and all direct fpga load commands Michal Simek
2018-08-08 11:37 ` [U-Boot] [PATCH v2 12/17] cmd: fpga: Fix loadfs command Michal Simek
2018-08-08 11:37 ` [U-Boot] [PATCH v2 13/17] cmd: fpga: Fix loadmk command Michal Simek
2018-08-08 11:37 ` [U-Boot] [PATCH v2 14/17] cmd: fpga: Add support for missing fpga loadmk commands Michal Simek
2018-08-09 11:20   ` Simon Glass
2018-08-08 11:37 ` [U-Boot] [PATCH v2 15/17] cmd: fpga: Use CMD_RET_FAILURE instead of simple 1 Michal Simek
2018-08-08 11:37 ` [U-Boot] [PATCH v2 16/17] cmd: fpga: Fix loads command Michal Simek
2018-08-08 11:37 ` [U-Boot] [PATCH v2 17/17] MAINTAINERS: Add myself as the FPGA maintainer Michal Simek

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=b9363bbad93720b7a69ceb4e73ba1ed7afc48dd2.1533728254.git.michal.simek@xilinx.com \
    --to=michal.simek@xilinx.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.