Skip to contentSkip to conversation

Add Tegra124 support

PATCH In review Penny Chiu 3 participants 7 messages Aug 23, 2013 – Aug 27, 2013 3 messages not in the archive Tegra architecture support

lore
Share & tools
lore

Penny Chiu

author
#0 lore raw

PATCH 1/1 Add Tegra124 support

Add the Tegra124 chip support to cbootimage. User can use "-t124" as option to parse .cfg and generate BCT/image for Tegra124.

---
 src/Makefile.am                    |   12 +-
 src/cbootimage.c                   |   18 +-
 src/cbootimage.h                   |    1 +
 src/data_layout.c                  |    2 +
 src/parse.h                        |  104 ++++
 src/t124/nvbctlib_t124.c           | 1104 ++++++++++++++++++++++++++++++++++++
 src/t124/nvboot_bct_t124.h         |  359 ++++++++++++
 src/t124/nvboot_sdram_param_t124.h |  803 ++++++++++++++++++++++++++
 src/t124/parse_t124.c              |  429 ++++++++++++++
 9 files changed, 2822 insertions(+), 10 deletions(-)
 create mode 100644 src/t124/nvbctlib_t124.c
 create mode 100644 src/t124/nvboot_bct_t124.h
 create mode 100644 src/t124/nvboot_sdram_param_t124.h
 create mode 100644 src/t124/parse_t124.c
src/Makefile.am +10 -2
index 6fcc0d8..b1d6bb7 100644
@@ -9,9 +9,11 @@ cbootimage_SOURCES = \
 	aes_ref.c \
 	context.c \
 	parse.c \
+	t124/parse_t124.c \
 	t114/parse_t114.c \
 	t30/parse_t30.c \
 	t20/parse_t20.c \
+	t124/nvbctlib_t124.c \
 	t114/nvbctlib_t114.c \
 	t30/nvbctlib_t30.c \
 	t20/nvbctlib_t20.c \
@@ -27,7 +29,9 @@ cbootimage_SOURCES = \
 	t30/nvboot_bct_t30.h \
 	t30/nvboot_sdram_param_t30.h \
 	t114/nvboot_bct_t114.h \
-	t114/nvboot_sdram_param_t114.h
+	t114/nvboot_sdram_param_t114.h \
+	t124/nvboot_bct_t124.h \
+	t124/nvboot_sdram_param_t124.h
 
 cbootimage_LDADD = -lm
 
@@ -39,9 +43,11 @@ bct_dump_SOURCES = \
 	aes_ref.c \
 	context.c \
 	parse.c \
+	t124/parse_t124.c \
 	t114/parse_t114.c \
 	t30/parse_t30.c \
 	t20/parse_t20.c \
+	t124/nvbctlib_t124.c \
 	t114/nvbctlib_t114.c \
 	t30/nvbctlib_t30.c \
 	t20/nvbctlib_t20.c \
@@ -57,4 +63,6 @@ bct_dump_SOURCES = \
 	t30/nvboot_bct_t30.h \
 	t30/nvboot_sdram_param_t30.h \
 	t114/nvboot_bct_t114.h \
-	t114/nvboot_sdram_param_t114.h
+	t114/nvboot_sdram_param_t114.h \
+	t124/nvboot_bct_t124.h \
+	t124/nvboot_sdram_param_t124.h
src/cbootimage.c +10 -8
index 937bac9..aa6beab 100644
@@ -64,14 +64,14 @@ usage(void)
 {
 	printf("Usage: cbootimage [options] configfile imagename\n");
 	printf("    options:\n");
-	printf("    -h, --help, -?        Display this message.\n");
-	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]     Select one of the possible target devices,\n");
-	printf("                          -t20 if unspecified.\n");
-	printf("    configfile            File with configuration information\n");
-	printf("    imagename             Output image name\n");
+	printf("    -h, --help, -?              Display this message.\n");
+	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]     Select one of the possible target devices,\n");
+	printf("                                -t20 if unspecified.\n");
+	printf("    configfile                  File with configuration information\n");
+	printf("    imagename                   Output image name\n");
 }
 
 static int
@@ -107,6 +107,8 @@ process_command_line(int argc, char *argv[], build_image_context *context)
 				t30_get_soc_config(context, &g_soc_config);
 			} else if (!strcasecmp("114", optarg)) {
 				t114_get_soc_config(context, &g_soc_config);
+			} else if (!strcasecmp("124", optarg)) {
+				t124_get_soc_config(context, &g_soc_config);
 			} else {
 				printf("Unsupported chipname!\n");
 				usage();
src/cbootimage.h +1 -0
index b8f5c57..46e3b8b 100644
@@ -42,6 +42,7 @@
 #define BOOTDATA_VERSION_T20		NVBOOT_BOOTDATA_VERSION(0x2, 0x1)
 #define BOOTDATA_VERSION_T30		NVBOOT_BOOTDATA_VERSION(0x3, 0x1)
 #define BOOTDATA_VERSION_T114		NVBOOT_BOOTDATA_VERSION(0x35, 0x1)
+#define BOOTDATA_VERSION_T124		NVBOOT_BOOTDATA_VERSION(0x40, 0x1)
 
 /*
  * Enumerations
src/data_layout.c +2 -0
index ae62126..a085912 100644
@@ -691,6 +691,8 @@ read_bct_file(struct build_image_context_rec *context)
 		return 0;
 	if (if_bct_is_t114_get_soc_config(context, &g_soc_config))
 		return 0;
+	if (if_bct_is_t124_get_soc_config(context, &g_soc_config))
+		return 0;
 
 	return ENODATA;
 }
src/parse.h +104 -0

270 lines not on this page · raw message

src/t124/nvbctlib_t124.c new file +1104 -0

1,104 lines not on this page · raw message

src/t124/nvboot_bct_t124.h new file +359 -0

359 lines not on this page · raw message

src/t124/nvboot_sdram_param_t124.h new file +803 -0

803 lines not on this page · raw message

src/t124/parse_t124.c new file +429 -0

380 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.8.1.5

Part of the diff is not shown here. View the raw message.

A message that is not in the archive (sent off-list or not yet received): 1377229591-21235-1-git-send-email-pchiu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org

#2 lore raw
Quoted 2 lines · Penny Chiu

Add the Tegra124 chip support to cbootimage. User can use "-t124" as option to parse .cfg and generate BCT/image for Tegra124.

This looks fine to me at a quick glance. Just one small comment below:

Quoted 11 lines
src/cbootimage.c +0 -7
 
 	printf("Usage: cbootimage [options] configfile imagename\n");
 	printf("    options:\n");
-	printf("    -h, --help, -?        Display this message.\n");
-	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]     Select one of the possible target devices,\n");
-	printf("                          -t20 if unspecified.\n");
-	printf("    configfile            File with configuration information\n");

src/cbootimage.c usage(void) · line 75

Quoted 10 lines
src/cbootimage.c +8 -1
-	printf("    imagename             Output image name\n");
+	printf("    -h, --help, -?              Display this message.\n");
+	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]     Select one of the possible target devices,\n");
+	printf("                                -t20 if unspecified.\n");
+	printf("    configfile                  File with configuration information\n");
+	printf("    imagename                   Output image name\n");
 }

To avoid continually re-formatting that text when adding new SoCs, why not start the description of the -tNN options on a separate line, and leave the indentation as-is for all the unmodified lines. i.e.:

Quoted 3 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+	printf("    [-t20|-t30|-t114|-t124]\n");
+	printf("                          Select one of the possible target devices,\n");
+	printf("                          -t20 if unspecified.\n");

I tested this patch, and it has zero effect on any of the generated images in the cbootimage-configs project, as expected, so I think it's safe to accept.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 32 lines · Stephen Warren
Quoted 2 lines · Penny Chiu

Add the Tegra124 chip support to cbootimage. User can use "-t124" as option to parse .cfg and generate BCT/image for Tegra124.

This looks fine to me at a quick glance. Just one small comment below:

Quoted 11 lines
src/cbootimage.c +0 -7
 
 	printf("Usage: cbootimage [options] configfile imagename\n");
 	printf("    options:\n");
-	printf("    -h, --help, -?        Display this message.\n");
-	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]     Select one of the possible target devices,\n");
-	printf("                          -t20 if unspecified.\n");
-	printf("    configfile            File with configuration information\n");

src/cbootimage.c usage(void) · line 75

Quoted 10 lines
src/cbootimage.c +8 -1
-	printf("    imagename             Output image name\n");
+	printf("    -h, --help, -?              Display this message.\n");
+	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]     Select one of the possible target devices,\n");
+	printf("                                -t20 if unspecified.\n");
+	printf("    configfile                  File with configuration information\n");
+	printf("    imagename                   Output image name\n");
 }

To avoid continually re-formatting that text when adding new SoCs, why not start the description of the -tNN options on a separate line, and leave the indentation as-is for all the unmodified lines. i.e.:

Quoted 3 lines
Quoted 3 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+	printf("    [-t20|-t30|-t114|-t124]\n");
+	printf("                          Select one of the possible target devices,\n");
+	printf("                          -t20 if unspecified.\n");

Perhaps in the long run it would be better to turn this into something like:

	printf("    -t, --target SOC      Select target device. Must be one of:\n");
	printf("                          20, 30, 114, 124 (default: 20)\n");

Thierry

#5 lore raw
Quoted 40 lines · Thierry Reding
Quoted 32 lines · Stephen Warren
Quoted 2 lines · Penny Chiu

Add the Tegra124 chip support to cbootimage. User can use "-t124" as option to parse .cfg and generate BCT/image for Tegra124.

This looks fine to me at a quick glance. Just one small comment below:

Quoted 11 lines
src/cbootimage.c +0 -7
 
 	printf("Usage: cbootimage [options] configfile imagename\n");
 	printf("    options:\n");
-	printf("    -h, --help, -?        Display this message.\n");
-	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]     Select one of the possible target devices,\n");
-	printf("                          -t20 if unspecified.\n");
-	printf("    configfile            File with configuration information\n");

src/cbootimage.c usage(void) · line 75

Quoted 10 lines
src/cbootimage.c +8 -1
-	printf("    imagename             Output image name\n");
+	printf("    -h, --help, -?              Display this message.\n");
+	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]     Select one of the possible target devices,\n");
+	printf("                                -t20 if unspecified.\n");
+	printf("    configfile                  File with configuration information\n");
+	printf("    imagename                   Output image name\n");
 }

To avoid continually re-formatting that text when adding new SoCs, why not start the description of the -tNN options on a separate line, and leave the indentation as-is for all the unmodified lines. i.e.:

Quoted 3 lines
Quoted 3 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+	printf("    [-t20|-t30|-t114|-t124]\n");
+	printf("                          Select one of the possible target devices,\n");
+	printf("                          -t20 if unspecified.\n");

Perhaps in the long run it would be better to turn this into something like:

Quoted 2 lines
	printf("    -t, --target SOC      Select target device. Must be one of:\n");
	printf("                          20, 30, 114, 124 (default: 20)\n");

I don't like the idea of "--target 20", since "20" isn't an SoC name; it's "tegra20" or just perhaps "t20".

I'd be fine with a patch that allowed "-SOC" or "--target SOC", with SOC being "t20", "t30", ...

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw
Quoted 41 lines · Stephen Warren
Quoted 40 lines · Thierry Reding
Quoted 32 lines · Stephen Warren
Quoted 2 lines · Penny Chiu

Add the Tegra124 chip support to cbootimage. User can use "-t124" as option to parse .cfg and generate BCT/image for Tegra124.

This looks fine to me at a quick glance. Just one small comment below:

Quoted 11 lines
src/cbootimage.c +0 -7
 
 	printf("Usage: cbootimage [options] configfile imagename\n");
 	printf("    options:\n");
-	printf("    -h, --help, -?        Display this message.\n");
-	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]     Select one of the possible target devices,\n");
-	printf("                          -t20 if unspecified.\n");
-	printf("    configfile            File with configuration information\n");

src/cbootimage.c

Quoted 10 lines
src/cbootimage.c +8 -1
-	printf("    imagename             Output image name\n");
+	printf("    -h, --help, -?              Display this message.\n");
+	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]     Select one of the possible target devices,\n");
+	printf("                                -t20 if unspecified.\n");
+	printf("    configfile                  File with configuration information\n");
+	printf("    imagename                   Output image name\n");
 }

To avoid continually re-formatting that text when adding new SoCs, why not start the description of the -tNN options on a separate line, and leave the indentation as-is for all the unmodified lines. i.e.:

Quoted 3 lines
Quoted 3 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+	printf("    [-t20|-t30|-t114|-t124]\n");
+	printf("                          Select one of the possible target devices,\n");
+	printf("                          -t20 if unspecified.\n");

Perhaps in the long run it would be better to turn this into something like:

Quoted 5 lines
Quoted 2 lines
	printf("    -t, --target SOC      Select target device. Must be one of:\n");
	printf("                          20, 30, 114, 124 (default: 20)\n");

I don't like the idea of "--target 20", since "20" isn't an SoC name; it's "tegra20" or just perhaps "t20".

I'd really like to get some kind of consistency. We've been using the tegra20/tegra30/tegra114 variants pretty consistently within the kernel and U-Boot, but other tools use the abbreviated form (t20/t30/t114). Actually I think this is the only one that uses the abbreviation, so...

Quoted 2 lines

I'd be fine with a patch that allowed "-SOC" or "--target SOC", with SOC being "t20", "t30", ...

... perhaps introducing a --target {tegra20,tegra30,tegra114,tegra124} option that deprecates -t20/-t30/-t114/-t124 would be a good option. I for one sometimes get confused and can't remember the correct form to use for cbootimage. It's mostly scripted these days, so that issue is not that important, but using one variant only will also help to make the various scripts consistent and easier to maintain.

Thierry

#8 lore raw
Quoted 8 lines · Thierry Reding
Quoted 7 lines · Stephen Warren
Quoted 6 lines · Thierry Reding
Quoted 4 lines · Stephen Warren
Quoted 3 lines · Penny Chiu

Add the Tegra124 chip support to cbootimage. User can use "-t124" as option to parse .cfg and generate BCT/image for Tegra124.

...

Quoted 19 lines
Quoted 9 lines
Quoted 6 lines

Perhaps in the long run it would be better to turn this into something like:

printf(" -t, --target SOC Select target device. Must be
one of:\n"); printf(" 20, 30, 114, 124
(default: 20)\n");

I don't like the idea of "--target 20", since "20" isn't an SoC name; it's "tegra20" or just perhaps "t20".

I'd really like to get some kind of consistency. We've been using the tegra20/tegra30/tegra114 variants pretty consistently within the kernel and U-Boot, but other tools use the abbreviated form (t20/t30/t114). Actually I think this is the only one that uses the abbreviation, so...

Quoted 2 lines

I'd be fine with a patch that allowed "-SOC" or "--target SOC", with SOC being "t20", "t30", ...

Quoted 7 lines

... perhaps introducing a --target {tegra20,tegra30,tegra114,tegra124} option that deprecates -t20/-t30/-t114/-t124 would be a good option. I for one sometimes get confused and can't remember the correct form to use for cbootimage. It's mostly scripted these days, so that issue is not that important, but using one variant only will also help to make the various scripts consistent and easier to maintain.

Yes, true. To bikeshed a bit, perhaps "--soc tegra20" would be slightly less typing. I was going to suggest the simpler "--tegra20", but then we run the risk of strange names appearing in the future and not being able to control pollution of the option naming space.

#9 lore raw
In reply to a message not in the archive
Quoted 32 lines · Stephen Warren
Quoted 2 lines · Penny Chiu

Add the Tegra124 chip support to cbootimage. User can use "-t124" as option to parse .cfg and generate BCT/image for Tegra124.

This looks fine to me at a quick glance. Just one small comment below:

Quoted 11 lines
src/cbootimage.c +0 -7
 
 	printf("Usage: cbootimage [options] configfile imagename\n");
 	printf("    options:\n");
-	printf("    -h, --help, -?        Display this message.\n");
-	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]     Select one of the possible target devices,\n");
-	printf("                          -t20 if unspecified.\n");
-	printf("    configfile            File with configuration information\n");

src/cbootimage.c usage(void) · line 75

Quoted 10 lines
src/cbootimage.c +8 -1
-	printf("    imagename             Output image name\n");
+	printf("    -h, --help, -?              Display this message.\n");
+	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]     Select one of the possible target devices,\n");
+	printf("                                -t20 if unspecified.\n");
+	printf("    configfile                  File with configuration information\n");
+	printf("    imagename                   Output image name\n");
 }

To avoid continually re-formatting that text when adding new SoCs, why not start the description of the -tNN options on a separate line, and leave the indentation as-is for all the unmodified lines. i.e.:

Quoted 3 lines
Quoted 3 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+	printf("    [-t20|-t30|-t114|-t124]\n");
+	printf("                          Select one of the possible target devices,\n");
+	printf("                          -t20 if unspecified.\n");

I've pushed out the patch with this change included.