public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
* [cbootimage PATCH] Implement --soc command-line option
@ 2013-08-27 18:32 Stephen Warren
       [not found] ` <1377628344-24984-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Warren @ 2013-08-27 18:32 UTC (permalink / raw)
  To: linux-tegra-u79uwXL29TY76Z2rM5mHXA; +Cc: Stephen Warren

From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

Implement command-line option "-s tegra20" and "--soc tegra20". These
mirror the existing -t/--tegra option, but require the full chip name
(tegra20) rather than an abbreviated name (-t20). This is more consistent
with just about everything else upstream.

Suggested-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 src/cbootimage.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/src/cbootimage.c b/src/cbootimage.c
index 336b169..259e6e7 100644
--- a/src/cbootimage.c
+++ b/src/cbootimage.c
@@ -48,6 +48,7 @@ struct option cbootcmd[] = {
 	{"generate", 1, NULL, 'g'},
 	{"tegra", 1, NULL, 't'},
 	{"odmdata", 1, NULL, 'o'},
+	{"soc", 1, NULL, 's'},
 	{0, 0, 0, 0},
 };
 
@@ -68,9 +69,12 @@ usage(void)
 	printf("    -d, --debug           Output debugging information.\n");
 	printf("    -gbct                 Generate the new bct file.\n");
 	printf("    -o<ODM_DATA>          Specify the odm_data(in hex).\n");
-	printf("    [-t20|-t30|-t114|-t124]\n");
-	printf("                          Select one of the possible target devices,\n");
-	printf("                          -t20 if unspecified.\n");
+	printf("    -t|--tegra NN         Select target device. Must be one of:\n");
+	printf("                          20, 30, 114, 124.\n");
+	printf("                          Default: 20. This option is deprecated\n");
+	printf("    -s|--soc tegraNN      Select target device. Must be one of:\n");
+	printf("                          tegra20, tegra30, tegra114, tegra124.\n");
+	printf("                          Default: tegra20.\n");
 	printf("    configfile            File with configuration information\n");
 	printf("    imagename             Output image name\n");
 }
@@ -82,7 +86,7 @@ process_command_line(int argc, char *argv[], build_image_context *context)
 
 	context->generate_bct = 0;
 
-	while ((c = getopt_long(argc, argv, "hdg:t:o:", cbootcmd, NULL)) != -1) {
+	while ((c = getopt_long(argc, argv, "hdg:t:o:s:", cbootcmd, NULL)) != -1) {
 		switch (c) {
 		case 'h':
 			help_only = 1;
@@ -100,6 +104,14 @@ process_command_line(int argc, char *argv[], build_image_context *context)
 				return -EINVAL;
 			}
 			break;
+		case 's':
+			if (strncmp("tegra", optarg, 5)) {
+				printf("Unsupported chipname!\n");
+				usage();
+				return -EINVAL;
+			}
+			optarg += 5;
+			/* Deliberate all-through */
 		case 't':
 			/* Assign the soc_config based on the chip. */
 			if (!strcasecmp("20", optarg)) {
-- 
1.8.1.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [cbootimage PATCH] Implement --soc command-line option
       [not found] ` <1377628344-24984-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2013-08-28  6:35   ` Thierry Reding
  2013-08-28 14:54     ` Stephen Warren
  0 siblings, 1 reply; 3+ messages in thread
From: Thierry Reding @ 2013-08-28  6:35 UTC (permalink / raw)
  To: Stephen Warren; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren

[-- Attachment #1: Type: text/plain, Size: 2915 bytes --]

On Tue, Aug 27, 2013 at 12:32:24PM -0600, Stephen Warren wrote:
> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> 
> Implement command-line option "-s tegra20" and "--soc tegra20". These
> mirror the existing -t/--tegra option, but require the full chip name
> (tegra20) rather than an abbreviated name (-t20). This is more consistent
> with just about everything else upstream.
> 
> Suggested-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> ---
>  src/cbootimage.c | 20 ++++++++++++++++----
>  1 file changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/src/cbootimage.c b/src/cbootimage.c
> index 336b169..259e6e7 100644
> --- a/src/cbootimage.c
> +++ b/src/cbootimage.c
> @@ -48,6 +48,7 @@ struct option cbootcmd[] = {
>  	{"generate", 1, NULL, 'g'},
>  	{"tegra", 1, NULL, 't'},
>  	{"odmdata", 1, NULL, 'o'},
> +	{"soc", 1, NULL, 's'},
>  	{0, 0, 0, 0},
>  };
>  
> @@ -68,9 +69,12 @@ usage(void)
>  	printf("    -d, --debug           Output debugging information.\n");
>  	printf("    -gbct                 Generate the new bct file.\n");
>  	printf("    -o<ODM_DATA>          Specify the odm_data(in hex).\n");
> -	printf("    [-t20|-t30|-t114|-t124]\n");
> -	printf("                          Select one of the possible target devices,\n");
> -	printf("                          -t20 if unspecified.\n");
> +	printf("    -t|--tegra NN         Select target device. Must be one of:\n");
> +	printf("                          20, 30, 114, 124.\n");
> +	printf("                          Default: 20. This option is deprecated\n");
> +	printf("    -s|--soc tegraNN      Select target device. Must be one of:\n");
> +	printf("                          tegra20, tegra30, tegra114, tegra124.\n");
> +	printf("                          Default: tegra20.\n");
>  	printf("    configfile            File with configuration information\n");
>  	printf("    imagename             Output image name\n");
>  }
> @@ -82,7 +86,7 @@ process_command_line(int argc, char *argv[], build_image_context *context)
>  
>  	context->generate_bct = 0;
>  
> -	while ((c = getopt_long(argc, argv, "hdg:t:o:", cbootcmd, NULL)) != -1) {
> +	while ((c = getopt_long(argc, argv, "hdg:t:o:s:", cbootcmd, NULL)) != -1) {
>  		switch (c) {
>  		case 'h':
>  			help_only = 1;
> @@ -100,6 +104,14 @@ process_command_line(int argc, char *argv[], build_image_context *context)
>  				return -EINVAL;
>  			}
>  			break;
> +		case 's':
> +			if (strncmp("tegra", optarg, 5)) {
> +				printf("Unsupported chipname!\n");
> +				usage();
> +				return -EINVAL;
> +			}
> +			optarg += 5;
> +			/* Deliberate all-through */

"fall-through"? =)

Other than that:

Reviewed-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [cbootimage PATCH] Implement --soc command-line option
  2013-08-28  6:35   ` Thierry Reding
@ 2013-08-28 14:54     ` Stephen Warren
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Warren @ 2013-08-28 14:54 UTC (permalink / raw)
  To: Thierry Reding; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren

On 08/28/2013 12:35 AM, Thierry Reding wrote:
> On Tue, Aug 27, 2013 at 12:32:24PM -0600, Stephen Warren wrote:
>> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>>
>> Implement command-line option "-s tegra20" and "--soc tegra20". These
>> mirror the existing -t/--tegra option, but require the full chip name
>> (tegra20) rather than an abbreviated name (-t20). This is more consistent
>> with just about everything else upstream.
...
> Other than that:
> 
> Reviewed-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

Thanks, applied and pushed.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-28 14:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-27 18:32 [cbootimage PATCH] Implement --soc command-line option Stephen Warren
     [not found] ` <1377628344-24984-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-08-28  6:35   ` Thierry Reding
2013-08-28 14:54     ` Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox