All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Allen Martin <amartin-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 08/11] tegrarcm: Add rip support
Date: Mon, 09 Sep 2013 15:50:30 -0600	[thread overview]
Message-ID: <522E42A6.6090104@wwwdotorg.org> (raw)
In-Reply-To: <1378757761-20939-9-git-send-email-amartin-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

On 09/09/2013 02:15 PM, Allen Martin wrote:
> Add a new command "--ripbct" which will rip the BCT from the target
> system and write it to bctfile.

Bikeshed: s/rip/read/ or get or download? rip sounds a bit like a CD.

> diff --git a/src/main.c b/src/main.c

> @@ -97,6 +99,8 @@ static void usage(char *progname)
>  	fprintf(stderr, "\t\tPrint this help information\n");
>  	fprintf(stderr, "\t--version\n");
>  	fprintf(stderr, "\t\tPrint version information and exit\n");
> +	fprintf(stderr, "\t--ripbct\n");
> +	fprintf(stderr, "\t\tRead the BCT from the target device and write to bctfile\n");
>  	fprintf(stderr, "\n");
>  }

It might be nice to try and make it more explicit that there are now 2
modes of operation, and have separate sections in the usage text to
detail both. That would also help point out that e.g. --bootloader is
now only required in non-(--rip)-mode.

I wonder if we should make this a sub-command rather than an option
("rip" rather than "--rip").

> +static int rip_bct(nv3p_handle_t h3p, char *filename)

> +	printf("bct: 0x%02x 0x%02x 0x%02x 0x%02x\n", bct_data[0], bct_data[1], bct_data[2], bct_data[3]);

Left-over debugging?

> +	if (write(fd, bct_data, bct_info.length) != bct_info.length) {
> +		dprintf("short write on %s\n", filename);
> +		return errno;
> +	}

What if a signal gets delivered here; don't you need to loop until the
whole buffer has been written? I don't recall whether fwrite() would do
that automatically.

> diff --git a/src/tegrarcm.1.in b/src/tegrarcm.1.in

> +.TP
> +.B \-\-ripbct
> +Read the BCT from the target device and write it to \fIbctfile\fP.  If
> +this option is specified, the --bootloader, --loadaddr, and
> +--entryaddr options are ignored.

Same comment here as for the usage text above.

  parent reply	other threads:[~2013-09-09 21:50 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-09 20:15 [PATCH 00/11] tegrarcm: T124 and new command support Allen Martin
     [not found] ` <1378757761-20939-1-git-send-email-amartin-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-09-09 20:15   ` [PATCH 01/11] tegrarcm: Change NVIDIA license to apply to all miniloader files Allen Martin
2013-09-09 20:15   ` [PATCH 02/11] tegrarcm: Add support for RCM protocol version 40 Allen Martin
2013-09-09 20:15   ` [PATCH 04/11] tegrarcm: Add Tegra124 support Allen Martin
     [not found]     ` <1378757761-20939-5-git-send-email-amartin-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-09-09 21:38       ` Stephen Warren
     [not found]         ` <522E3FE7.8020503-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-09-11 20:49           ` Allen Martin
2013-09-11 21:12             ` Stephen Warren
2013-09-09 20:15   ` [PATCH 05/11] tegrarcm: Add timeout to USB xfers Allen Martin
2013-09-09 20:15   ` [PATCH 06/11] tegrarcm: Assume nv3p server is running if RCM doesn't respond Allen Martin
     [not found]     ` <1378757761-20939-7-git-send-email-amartin-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-09-09 21:42       ` Stephen Warren
2013-09-09 20:15   ` [PATCH 07/11] tegrarcm: Clean up usage info Allen Martin
2013-09-09 20:15   ` [PATCH 08/11] tegrarcm: Add rip support Allen Martin
     [not found]     ` <1378757761-20939-9-git-send-email-amartin-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-09-09 21:50       ` Stephen Warren [this message]
2013-09-09 20:15   ` [PATCH 09/11] tegrarcm: Add support for odmdata command Allen Martin
     [not found]     ` <1378757761-20939-10-git-send-email-amartin-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-09-09 21:53       ` Stephen Warren
     [not found]         ` <522E436F.90402-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-09-11 21:12           ` Allen Martin
2013-09-11 21:15             ` Stephen Warren
     [not found]               ` <5230DD8F.4030703-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-09-16 20:28                 ` Allen Martin
2013-09-16 21:26                   ` Stephen Warren
2013-09-09 20:16   ` [PATCH 10/11] tegrarcm: Add command to pass miniloader in from file Allen Martin
     [not found]     ` <1378757761-20939-11-git-send-email-amartin-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-09-09 21:56       ` Stephen Warren
2013-09-09 20:16   ` [PATCH 11/11] tegrarcm: Bump version to 1.5 Allen Martin
     [not found]     ` <1378757761-20939-12-git-send-email-amartin-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-09-09 21:57       ` Stephen Warren
     [not found]         ` <522E4441.8060906-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-09-11 20:42           ` Allen Martin
2013-09-09 21:57   ` [PATCH 00/11] tegrarcm: T124 and new command support Stephen Warren

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=522E42A6.6090104@wwwdotorg.org \
    --to=swarren-3lzwwm7+weoh9zmkesr00q@public.gmane.org \
    --cc=amartin-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /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.