RFC: Add board support for Colorado Engineering TK1-SOM
Subsystems (3)
This patch adds support for the TK1-SOM board, which is almost the same as the Jetson TK1. Board info at
https://tk1som.com/products/tk1-som
Query: Is this the best way to support this board? Or is there an easy way to merge the necessary changes into the Jetson-TK1 board? The main differences are in the pinmux and device tree. And the device tree is maybe 10 lines different.
--- arch/arm/dts/Makefile | 1 + arch/arm/dts/tegra124-tk1-som.dts | 477 +++++++++++++++++++++++++++ arch/arm/mach-tegra/tegra124/Kconfig | 11 + board/nvidia/tk1-som/Kconfig | 12 + board/nvidia/tk1-som/MAINTAINERS | 6 + board/nvidia/tk1-som/Makefile | 9 + board/nvidia/tk1-som/pinmux-config-tk1-som.h | 289 ++++++++++++++++ board/nvidia/tk1-som/tk1-som.c | 76 +++++ board/nvidia/venice2/as3722_init.h | 4 +- configs/tk1-som_defconfig | 55 +++ include/configs/tk1-som.h | 69 ++++ 11 files changed, 1007 insertions(+), 2 deletions(-) create mode 100644 arch/arm/dts/tegra124-tk1-som.dts create mode 100644 board/nvidia/tk1-som/Kconfig create mode 100644 board/nvidia/tk1-som/MAINTAINERS create mode 100644 board/nvidia/tk1-som/Makefile create mode 100644 board/nvidia/tk1-som/pinmux-config-tk1-som.h create mode 100644 board/nvidia/tk1-som/tk1-som.c create mode 100644 configs/tk1-som_defconfig create mode 100644 include/configs/tk1-som.h
arch/arm/dts/Makefile +1 -0
@@ -57,6 +57,7 @@ dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \ tegra114-dalmore.dtb \ tegra124-jetson-tk1.dtb \ tegra124-nyan-big.dtb \ + tegra124-tk1-som.dtb \ tegra124-venice2.dtb \ tegra186-p2771-0000-a02.dtb \ tegra186-p2771-0000-b00.dtb \
arch/arm/dts/tegra124-tk1-som.dts new file +477 -0
477 lines not on this page · raw message
arch/arm/mach-tegra/tegra124/Kconfig +11 -0
@@ -9,6 +9,16 @@ config TARGET_JETSON_TK1 select CPU_V7_HAS_NONSEC if !SPL_BUILD select CPU_V7_HAS_VIRT if !SPL_BUILD +config TARGET_TK1_SOM + bool "Colorado/NVIDIA Tegra124 TK1-som board" + select CPU_V7_HAS_NONSEC if !SPL_BUILD + select CPU_V7_HAS_VIRT if !SPL_BUILD + help + The Tegra TK1-SOM is a very compact (51mmx58mm) board that + is functionally almost the same as the Jetson TK1. The main + differences are in which balls on the SoC are assigned to + which functions. + config TARGET_NYAN_BIG bool "Google/NVIDIA Nyan-big Chromebook" help
@@ -27,6 +37,7 @@ config SYS_SOC default "tegra124" source "board/nvidia/jetson-tk1/Kconfig" +source "board/nvidia/tk1-som/Kconfig" source "board/nvidia/nyan-big/Kconfig" source "board/nvidia/venice2/Kconfig"
board/nvidia/tk1-som/Kconfig new file +12 -0
@@ -0,0 +1,12 @@ +if TARGET_TK1_SOM + +config SYS_BOARD + default "tk1-som" + +config SYS_VENDOR + default "nvidia" + +config SYS_CONFIG_NAME + default "tk1-som" + +endif
board/nvidia/tk1-som/MAINTAINERS new file +6 -0
@@ -0,0 +1,6 @@ +TK1-SOM BOARD +M: Peter.Chubb at data61.csiro.au +S: Maintained +F: board/nvidia/tk1-som/ +F: include/configs/tk1=som.h +F: configs/tk1-som_defconfig
board/nvidia/tk1-som/Makefile new file +9 -0
@@ -0,0 +1,9 @@ +# +# (C) Copyright 2014 +# NVIDIA Corporation <www.nvidia.com> +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += ../venice2/as3722_init.o +obj-y += tk1-som.o
board/nvidia/tk1-som/pinmux-config-tk1-som.h new file +289 -0
289 lines not on this page · raw message
board/nvidia/tk1-som/tk1-som.c new file +76 -0
76 lines not on this page · raw message
board/nvidia/venice2/as3722_init.h +2 -2
@@ -18,14 +18,14 @@#define AS3722_LDO6VOLTAGE_REG 0x16/* VDD_SDMMC */ #define AS3722_LDCONTROL_REG 0x4E -#if defined(CONFIG_TARGET_JETSON_TK1 ) || defined(CONFIG_TARGET_NYAN_BIG ) +#if defined(CONFIG_TARGET_JETSON_TK1 ) || defined(CONFIG_TARGET_NYAN_BIG ) || defined(CONFIG_TARGET_TK1_SOM )#define AS3722_SD0VOLTAGE_DATA (0x3C00 | AS3722_SD0VOLTAGE_REG)#else #define AS3722_SD0VOLTAGE_DATA (0x2800 | AS3722_SD0VOLTAGE_REG)#endif #define AS3722_SD0CONTROL_DATA (0x0100 | AS3722_SDCONTROL_REG) -#ifdef CONFIG_TARGET_JETSON_TK1 +#if defined(CONFIG_TARGET_JETSON_TK1 ) || defined(CONFIG_TARGET_TK1_SOM )#define AS3722_SD1VOLTAGE_DATA (0x2800 | AS3722_SD1VOLTAGE_REG)#define AS3722_SD1CONTROL_DATA (0x0200 | AS3722_SDCONTROL_REG)#endif
configs/tk1-som_defconfig new file +55 -0
55 lines not on this page · raw message
include/configs/tk1-som.h new file +69 -0
69 lines not on this page · raw message
Signature · 6 lines
2.9.3 -- Dr Peter Chubb Tel: +61 2 9490 5852 http://www.data61.csiro.au http://ts.data61.csiro.au Software Systems Research Group/NICTA/Data61
Quoted 2 lines · Peter Chubb
This patch adds support for the TK1-SOM board, which is almost the
Nit: That blank line at start of the commit description should be removed.
Quoted 2 lines
same as the Jetson TK1. Board info at
https://tk1som.com/products/tk1-som
tk1-som sounds like a rather generic name. I'm sure there are many boards that could be called that. Can we add the company name to the U-Boot board name? They seem to abbreviate themselves to CEI on their website, so cei-tk1-som seems like a reasonable name.
Quoted 4 lines
Query: Is this the best way to support this board? Or is there an easy way to merge the necessary changes into the Jetson-TK1 board? The main differences are in the pinmux and device tree. And the device tree is maybe 10 lines different.
Having a separate top-level board identity seems reasonable if the HW is different. Judging by a diff between the files in this patch and the existing Jetson TK1 support, there are some differences, so I think this is all fine.
Quoted 1 line
board/nvidia/tk1-som/Kconfig | 12 +
This isn't an NVIDIA board. I think that should be board/cei/tk1-som/Kconfig. Similar comment for most of the other files.
arch/arm/mach-tegra/tegra124/Kconfig config TARGET_JETSON_TK1 · line 13
Quoted 4 lines
arch/arm/mach-tegra/tegra124/Kconfig +2
-0+config TARGET_TK1_SOM + bool "Colorado/NVIDIA Tegra124 TK1-som board"
I'd say "Colorado Engineering Inc. TK1-SOM"
Quoted 5 lines
board/nvidia/tk1-som/pinmux-config-tk1-som.h +3
-0+/* +* Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. +*
board/nvidia/tk1-som/pinmux-config-tk1-som.h line 13
Quoted 10 lines
board/nvidia/tk1-som/pinmux-config-tk1-som.h +10
-0+* SPDX-License-Identifier: GPL-2.0+ +*/ + +/* +* THIS FILE IS AUTO-GENERATED - DO NOT EDIT! +* +* To generate this file, use the tegra-pinmux-scripts tool available from +* https://github.com/NVIDIA/tegra-pinmux-scripts +* Run "board-to-uboot.py tk1-som". +*/
Did you generate this yourself, or extract it from some CEI U-Boot source tree? I ask because the file is obviously based on an old version of the pinmux spreadsheet and pinmux scripts (e.g. the unsupported OWR pin is configured, there's no tk1_som_mipipadctrlgrps variable, etc. If you generated this yourself, if you could update it based on the latest spreadsheet that'd be great. If you're just taking this from some CEI U-Boot source tree, then the commit description should mention this, and you likely need to preserve the original CEI authorship and Signed-off-by lines.
Quoted 6 lines
board/nvidia/tk1-som/tk1-som.c +3
-0+int tegra_pcie_board_init (void ) + err =as3722_gpio_configure (pmic,1 ,AS3722_GPIO_OUTPUT_VDDH | +AS3722_GPIO_INVERT );
board/nvidia/tk1-som/tk1-som.c line 71
Quoted 10 lines
board/nvidia/tk1-som/tk1-som.c +10
-0+if (err <0 ) { +error ("failed to configure GPIO#1 as output: %d\n" , err); +return err; + } + + err =as3722_gpio_direction_output (pmic,2 ,1 ); +if (err <0 ) { +error ("failed to set GPIO#2 high: %d\n" , err); +return err; + }
Perhaps you could add a comment describing what that PMIC GPIO is used for, and hence why it's necessary to do this.
Actually, if you look at the history of jetson-tk1.c, you'll find commit 7fb82986be62 "ARM: tegra: rm Jetson TK1 PMIC GPIO programming" which implies that such PMIC GPIO programming should not be performed.
board/nvidia/tk1-som/tk1-som.c line 74
Quoted 3 lines
board/nvidia/tk1-som/tk1-som.c +3
-0+ + +return 0 ;
Nit: Two blank lines?
board/nvidia/venice2/as3722_init.h line 25
Quoted 8 lines
board/nvidia/venice2/as3722_init.h +1
-1-#if defined(CONFIG_TARGET_JETSON_TK1 ) || defined(CONFIG_TARGET_NYAN_BIG ) +#if defined(CONFIG_TARGET_JETSON_TK1 ) || defined(CONFIG_TARGET_NYAN_BIG ) || defined(CONFIG_TARGET_TK1_SOM )#define AS3722_SD0VOLTAGE_DATA (0x3C00 | AS3722_SD0VOLTAGE_REG)#else #define AS3722_SD0VOLTAGE_DATA (0x2800 | AS3722_SD0VOLTAGE_REG)#endif
Hmm. Considering we have 3 boards taking the "if" path and I think just one taking the "else" path, I think it would be better to do the following instead:
#if defined(CONFIG_TARGET_VENICE2)
// existing else value
#else
// existing if value
#endif
... since Venice2 is an odd-ball board that likely few people have, and almost any new board we support will be derived from Jetson TK1 and hence also take the "if" path in the existing code.
configs/tk1-som_defconfig line 55
Quoted 11 lines
configs/tk1-som_defconfig +9
-0+CONFIG_USE_PRIVATE_LIBGCC=y +CONFIG_CPU_V7_HAS_NONSEC=y +CONFIG_CPU_V7_HAS_VIRT=y +CONFIG_ARMV7_NONSEC=y +CONFIG_ARMV7_VIRT=y +CONFIG_SUPPORT_SPL=y +CONFIG_SPL=y +CONFIG_SPL_BUILD=y +CONFIG_ARMV7_PSCI=y
None of those are in jetson-tk1_defconfig. Was this addition deliberate?
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Stephen" == Stephen Warren <[email protected]> writes:
Quoted 2 lines · Peter Chubb
Quoted 2 lines
This patch adds support for the TK1-SOM board, which is almost the
Stephen> Nit: That blank line at start of the commit description Stephen> should be removed.
OK.
Quoted 2 lines
Quoted 2 lines
same as the Jetson TK1. Board info at
https://tk1som.com/products/tk1-som
Stephen> tk1-som sounds like a rather generic name. I'm sure there are Stephen> many boards that could be called that. Can we add the company Stephen> name to the U-Boot board name? They seem to abbreviate Stephen> themselves to CEI on their website, so cei-tk1-som seems like Stephen> a reasonable name.
OK, will do.
Quoted 4 lines
Quoted 4 lines
Query: Is this the best way to support this board? Or is there an easy way to merge the necessary changes into the Jetson-TK1 board? The main differences are in the pinmux and device tree. And the device tree is maybe 10 lines different.
Stephen> Having a separate top-level board identity seems reasonable Stephen> if the HW is different. Judging by a diff between the files Stephen> in this patch and the existing Jetson TK1 support, there are Stephen> some differences, so I think this is all fine.
Quoted 1 line
Quoted 1 line
board/nvidia/tk1-som/Kconfig | 12 +
Stephen> This isn't an NVIDIA board. I think that should be Stephen> board/cei/tk1-som/Kconfig. Similar comment for most of the Stephen> other files.
OK.
Quoted 5 lines
Quoted 5 lines
arch/arm/mach-tegra/tegra124/Kconfig +1
-0+config TARGET_TK1_SOM + bool "Colorado/NVIDIA Tegra124 TK1-somboard"
Stephen> I'd say "Colorado Engineering Inc. TK1-SOM"
OK.
Quoted 9 lines
Quoted 9 lines
board/nvidia/tk1-som/pinmux-config-tk1-som.h +1
-0+/* + * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/* + * THIS FILE IS AUTO-GENERATED - DO NOT EDIT! + * + * To generate this file, use the tegra-pinmux-scripts tool available from + *
https://github.com/NVIDIA/tegra-pinmux-scripts + * Run "board-to-uboot.pytk1-som". + */
Stephen> Did you generate this yourself, or extract it from some CEI Stephen> U-Boot source tree? I ask because the file is obviously based Stephen> on an old version of the pinmux spreadsheet and pinmux Stephen> scripts (e.g. the unsupported OWR pin is configured, there's Stephen> no tk1_som_mipipadctrlgrps variable, etc. If you generated Stephen> this yourself, if you could update it based on the latest Stephen> spreadsheet that'd be great. If you're just taking this from Stephen> some CEI U-Boot source tree, then the commit description Stephen> should mention this, and you likely need to preserve the Stephen> original CEI authorship and Signed-off-by lines.
I generated this myself from a spreadsheet provided by Colorado
Engineering and the current tegra-pinmux-scripts. Is there any
easy way to see the differences in versions between the one this was based on (v09 of the upstream NVIDIA sheet) and the current v11 one to be able to transform the spreadsheet?
Quoted 2 lines
board/nvidia/tk1-som/tk1-som.c
Quoted 2 lines
board/nvidia/tk1-som/tk1-som.c +0
-0
Stephen> Perhaps you could add a comment describing what that PMIC Stephen> GPIO is used for, and hence why it's necessary to do this.
Stephen> Actually, if you look at the history of jetson-tk1.c, you'll Stephen> find commit 7fb82986be62 "ARM: tegra: rm Jetson TK1 PMIC GPIO Stephen> programming" which implies that such PMIC GPIO programming Stephen> should not be performed.
It was in the upstream Colorado-supplied U-Boot; I'll test without it.
Quoted 1 line
Quoted 1 line
+ + + return 0;
Stephen> Nit: Two blank lines?
OK.
Quoted 10 lines
Quoted 10 lines
board/nvidia/venice2/as3722_init.h +0
-1-#if defined(CONFIG_TARGET_JETSON_TK1) ||
defined(CONFIG_TARGET_NYAN_BIG)+#ifdefined(CONFIG_TARGET_JETSON_TK1)||defined(CONFIG_TARGET_NYAN_BIG)||defined(CONFIG_TARGET_TK1_SOM)#defineAS3722_SD0VOLTAGE_DATA(0x3C00|AS3722_SD0VOLTAGE_REG) #else #defineAS3722_SD0VOLTAGE_DATA(0x2800|AS3722_SD0VOLTAGE_REG) #endif
Stephen> Hmm. Considering we have 3 boards taking the "if" path and I Stephen> think just one taking the "else" path, I think it would be Stephen> better to do the following instead:
Stephen> #if defined(CONFIG_TARGET_VENICE2) // existing else value Stephen> #else // existing if value #endif
OK. The alternative is to have a third symbol to test on, a feature-test macro rather than a board macro.
Quoted 4 lines
board/nvidia/venice2/as3722_init.h
Quoted 4 lines
board/nvidia/venice2/as3722_init.h +4
-0+CONFIG_USE_PRIVATE_LIBGCC=y +CONFIG_CPU_V7_HAS_NONSEC=y +CONFIG_CPU_V7_HAS_VIRT=y +CONFIG_ARMV7_NONSEC=y +CONFIG_ARMV7_VIRT=y +CONFIG_SUPPORT_SPL=y +CONFIG_SPL=y +CONFIG_SPL_BUILD =y +CONFIG_ARMV7_PSCI =y
Stephen> None of those are in jetson-tk1_defconfig. Was this addition Stephen> deliberate?
Yes, except the USE_PRIVATE_LIBGCC which I think is an error. The main use-case I have for the board is for virtualisation; enabling booting in nonsec mode is essential for this. And it's harmless, as the feature has to be enabled via an environment variable.
Peter C
Signature · 2 lines
Dr Peter Chubb Tel: +61 2 9490 5852 http://www.data61.csiro.au http://ts.data61.csiro.au Software Systems Research Group/NICTA/Data61
Quoted 25 lines · Peter Chubb
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Stephen" == Stephen Warren <[email protected]> writes:
Quoted 9 lines · Peter Chubb
Quoted 9 lines
board/nvidia/tk1-som/pinmux-config-tk1-som.h +1
-0+/* + * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/* + * THIS FILE IS AUTO-GENERATED - DO NOT EDIT! + * + * To generate this file, use the tegra-pinmux-scripts tool available from + *
https://github.com/NVIDIA/tegra-pinmux-scripts + * Run "board-to-uboot.pytk1-som". + */Stephen> Did you generate this yourself, or extract it from some CEI Stephen> U-Boot source tree? I ask because the file is obviously based Stephen> on an old version of the pinmux spreadsheet and pinmux Stephen> scripts (e.g. the unsupported OWR pin is configured, there's Stephen> no
tk1_som_mipipadctrlgrpsvariable, etc. If you generated Stephen> this yourself, if you could update it based on the latest Stephen> spreadsheet that'd be great. If you're just taking this from Stephen> some CEI U-Boot source tree, then the commit description Stephen> should mention this, and you likely need to preserve the Stephen> original CEI authorship and Signed-off-by lines.
Quoted 5 lines
I generated this myself from a spreadsheet provided by Colorado
Engineering and the current tegra-pinmux-scripts. Is there any
easy way to see the differences in versions between the one this was based on (v09 of the upstream NVIDIA sheet) and the current v11 one to be able to transform the spreadsheet?
Probably the easiest way is to save the v9 and v11 versions of the Jetson TK1 spreadsheet as CSV, and then diff that. There are tons of columns in the spreadsheet that aren't terribly relevant though, so the lines will be long and hard to interpret. It might be better to go through the whole process of importing v9 and v11 into tegra-pinmux-scripts, which will extract just the useful information, and then diff the data files there. That should give a list of changes you can use to bring the v9-based TK1 SOM spreadsheet up to match the v11 spreadsheet.
BTW, I meant to mention: can you also send a patch to tegra-pinmux-scripts to add support for this board there too?
Quoted 8 lines
Quoted 4 lines
board/nvidia/tk1-som/pinmux-config-tk1-som.h
Quoted 4 lines
board/nvidia/tk1-som/pinmux-config-tk1-som.h +4
-0+CONFIG_USE_PRIVATE_LIBGCC=y +CONFIG_CPU_V7_HAS_NONSEC=y +CONFIG_CPU_V7_HAS_VIRT=y +CONFIG_ARMV7_NONSEC=y +CONFIG_ARMV7_VIRT=y +CONFIG_SUPPORT_SPL=y +CONFIG_SPL=y +CONFIG_SPL_BUILD =y +CONFIG_ARMV7_PSCI =yStephen> None of those are in jetson-tk1_defconfig. Was this addition Stephen> deliberate?
Quoted 4 lines
Yes, except the
USE_PRIVATE_LIBGCCwhich I think is an error. The main use-case I have for the board is for virtualisation; enabling booting in nonsec mode is essential for this. And it's harmless, as the feature has to be enabled via an environment variable.
Yes, looks like that's in the original Jetson TK1 spreadsheet too. I assume the mistake you're referring to is that I mentioned that config option in my mail as being added by you? Having that option enabled is necessary for the U-Boot SPL to work, unless your toolchain's libc is built for a very old instruction set, and we don't want to require people to use only such toolchains.