Misc fixes for Tegra
Subsystems (2)
cover Misc fixes for Tegra
From: Tom Warren <[email protected]>
These fixes originated on our downstream L4T U-Boot, and include fdt, pll and code relocation changes.
Stephen Warren (1):
ARM: tegra: p2371-2180: add I2C nodes to DT
Tom Warren (1):
fdt: Fix 'system' command
Vishruth (1):
ARM: tegra: p2771-0000: enable PIE relocation
arch/arm/dts/tegra210-p2371-2180.dts | 18 ++++++++++++++++++ cmd/fdt.c | 2 +- configs/p2771-0000-000_defconfig | 1 + configs/p2771-0000-500_defconfig | 1 + 4 files changed, 21 insertions(+), 1 deletion(-)
Signature · 9 lines
1.8.2.1.610.g562af5b ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. -----------------------------------------------------------------------------------
PATCH 1/3 ARM: tegra: p2771-0000: enable PIE relocation
From: Vishruth <[email protected]>
U-Boot is configured to build as position independent executable. Enable relocation of RELA section required to work with different load addresses.
--- configs/p2771-0000-000_defconfig | 1 + configs/p2771-0000-500_defconfig | 1 + 2 files changed, 2 insertions(+)
configs/p2771-0000-000_defconfig +1 -0
@@ -36,3 +36,4 @@ CONFIG_TEGRA186_POWER_DOMAIN=y CONFIG_SYS_NS16550=y CONFIG_USB=y CONFIG_DM_USB=y +CONFIG_POSITION_INDEPENDENT=y
configs/p2771-0000-500_defconfig +1 -0
@@ -36,3 +36,4 @@ CONFIG_TEGRA186_POWER_DOMAIN=y CONFIG_SYS_NS16550=y CONFIG_USB=y CONFIG_DM_USB=y +CONFIG_POSITION_INDEPENDENT=y
Signature · 9 lines
1.8.2.1.610.g562af5b ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. -----------------------------------------------------------------------------------
PATCH 1/3 ARM: tegra: p2771-0000: enable PIE relocation
Quoted 8 lines
From: Vishruth <[email protected]>
U-Boot is configured to build as position independent executable. Enable relocation of RELA section required to work with different load addresses.
Signed-off-by Vishruth <[email protected]>Signed-off-by Tom Warren <[email protected]>
Tested on TX1
Quoted 33 lines
--- configs/p2771-0000-000_defconfig | 1 + configs/p2771-0000-500_defconfig | 1 + 2 files changed, 2 insertions(+)configs/p2771-0000-000_defconfig +1
-0@@ -36,3 +36,4 @@ CONFIG_TEGRA186_POWER_DOMAIN=y CONFIG_SYS_NS16550=y CONFIG_USB=y CONFIG_DM_USB=y +CONFIG_POSITION_INDEPENDENT=yconfigs/p2771-0000-500_defconfig +1
-1@@ -36,3 +36,4 @@ CONFIG_TEGRA186_POWER_DOMAIN=y CONFIG_SYS_NS16550=y CONFIG_USB=y CONFIG_DM_USB=y +CONFIG_POSITION_INDEPENDENT=y --1.8.2.1.610.g562af5b
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
PATCH 2/3 fdt: Fix 'system' command
In reply to tomcwarren3959 at gmail.comFrom: Tom Warren <[email protected]>
'fdt systemsetup' wasn't working, due to the fact that the 'set' command was being parsed in do_fdt() by only testing for the leading 's' instead of "se", which kept the "sys" test further down from executing. Changed to test for "se" instead, now 'fdt systemsetup' works (to test the ft_system_setup proc w/o having to boot a kernel).
--- cmd/fdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/fdt.c +1 -1
@@ -286,7 +286,7 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])/* * Set the value of a property in the working_fdt. */ - }else if (argv[1 ][0 ] =='s' ) { + }else if (strncmp (argv[1 ],"se" ,2 ) ==0 ) {char *pathp;/* path */ char *prop;/* property */ int nodeoffset;/* node offset from libfdt */
Signature · 9 lines
1.8.2.1.610.g562af5b ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. -----------------------------------------------------------------------------------
PATCH 2/3 fdt: Fix 'system' command
From: Tom Warren <[email protected]>
'fdt systemsetup' wasn't working, due to the fact that the 'set' command was being parsed in do_fdt() by only testing for the leading 's' instead of "se", which kept the "sys" test further down from executing. Changed to test for "se" instead, now 'fdt systemsetup' works (to test the ft_system_setup proc w/o having to boot a kernel).
--- cmd/fdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to u-boot-dm/next, thanks!
PATCH 3/3 ARM: tegra: p2371-2180: add I2C nodes to DT
In reply to tomcwarren3959 at gmail.comFrom: Stephen Warren <[email protected]>
This adds to the DT the I2C controllers that connect to the board ID EEPROM, camera board EEPROM, etc. With this change, you can now probe all I2C devices on a TX1 board.
--- arch/arm/dts/tegra210-p2371-2180.dts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
arch/arm/dts/tegra210-p2371-2180.dts +18 -0
@@ -12,6 +12,9 @@ aliases { i2c0 = "/i2c at 7000d000"; + i2c2 = "/i2c at 7000c400"; + i2c3 = "/i2c at 7000c500"; + i2c5 = "/i2c at 546c0c00"; mmc0 = "/sdhci at 700b0600"; mmc1 = "/sdhci at 700b0000"; usb0 = "/usb at 7d000000";
@@ -33,6 +36,11 @@ }; }; + i2c at 546c0c00 { + status = "okay"; + clock-frequency = <400000>; + }; + padctl at 7009f000 { pinctrl-0 = <&padctl_default>; pinctrl-names = "default";
@@ -85,6 +93,16 @@ non-removable; }; + i2c at 7000c400 { + status = "okay"; + clock-frequency = <400000>; + }; + + i2c at 7000c500 { + status = "okay"; + clock-frequency = <400000>; + }; + i2c at 7000d000 { status = "okay"; clock-frequency = <400000>;
Signature · 9 lines
1.8.2.1.610.g562af5b ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. -----------------------------------------------------------------------------------
PATCH 3/3 ARM: tegra: p2371-2180: add I2C nodes to DT
Quoted 16 lines
From: Stephen Warren <[email protected]>
This adds to the DT the I2C controllers that connect to the board ID EEPROM, camera board EEPROM, etc. With this change, you can now probe all I2C devices on a TX1 board.
Signed-off-by Tom Warren <[email protected]>--- arch/arm/dts/tegra210-p2371-2180.dts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)arch/arm/dts/tegra210-p2371-2180.dts +0
-0
arch/arm/dts/tegra210-p2371-2180.dts line 17
Quoted 6 lines
arch/arm/dts/tegra210-p2371-2180.dts +3
-0@@ -12,6 +12,9 @@ aliases { i2c0 = "/i2c at 7000d000"; + i2c2 = "/i2c at 7000c400"; + i2c3 = "/i2c at 7000c500"; + i2c5 = "/i2c at 546c0c00";
I don't think this is correct, it doesn't show up in U-Boot with the "i2c bus" command where the others do, looking in the tegra210.dtsi it looks like it should be i2c at 546c0000?
Quoted 42 lines
arch/arm/dts/tegra210-p2371-2180.dts +15
-1mmc0 = "/sdhci at 700b0600"; mmc1 = "/sdhci at 700b0000"; usb0 = "/usb at 7d000000";@@ -33,6 +36,11 @@ }; }; + i2c at 546c0c00 { + status = "okay"; + clock-frequency = <400000>; + }; + padctl at 7009f000 { pinctrl-0 = <&padctl_default>; pinctrl-names = "default";@@ -85,6 +93,16 @@ non-removable; }; + i2c at 7000c400 { + status = "okay"; + clock-frequency = <400000>; + }; + + i2c at 7000c500 { + status = "okay"; + clock-frequency = <400000>; + }; + i2c at 7000d000 { status = "okay"; clock-frequency = <400000>; --1.8.2.1.610.g562af5b
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
PATCH 3/3 ARM: tegra: p2371-2180: add I2C nodes to DT
-----Original Message-----
From: Peter Robinson <[email protected]>
Sent: Tuesday, March 31, 2020 3:54 AM
To: tomcwarren3959 at gmail.com
Cc: u-boot at lists.denx.de; Stephen Warren <[email protected]>; Thierry Reding <[email protected]>; Jonathan Hunter <[email protected]>; Tom Warren <[email protected]>; Vishruth Jain <[email protected]>
Subject: Re: [PATCH 3/3] ARM: tegra: p2371-2180: add I2C nodes to DT
External email: Use caution opening links or attachments
Quoted 17 lines
From: Stephen Warren <[email protected]>
This adds to the DT the I2C controllers that connect to the board ID EEPROM, camera board EEPROM, etc. With this change, you can now probe all I2C devices on a TX1 board.
Signed-off-by Tom Warren <[email protected]>--- arch/arm/dts/tegra210-p2371-2180.dts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)arch/arm/dts/tegra210-p2371-2180.dts +0
-0
arch/arm/dts/tegra210-p2371-2180.dts line 17
Quoted 6 lines
arch/arm/dts/tegra210-p2371-2180.dts +3
-0@@ -12,6 +12,9 @@ aliases { i2c0 = "/i2c at 7000d000"; + i2c2 = "/i2c at 7000c400"; + i2c3 = "/i2c at 7000c500"; + i2c5 = "/i2c at 546c0c00";
I don't think this is correct, it doesn't show up in U-Boot with the "i2c bus" command where the others do, looking in the tegra210.dtsi it looks like it should be i2c at 546c0000?
[Tom] That I2C address is working in downstream (L4T) TX1 U-Boot. The VI_I2C controller is a little weird, it's normal I2C registers are offset from base by 0xC00. A different driver is needed, but I haven't posted it yet upstream. I should probably drop if from the DTS for now until I post the VI_I2C driver.
--nvpublic
Quoted 42 lines
arch/arm/dts/tegra210-p2371-2180.dts +0
-0mmc0 = "/sdhci at 700b0600"; mmc1 = "/sdhci at 700b0000"; usb0 = "/usb at 7d000000"; @@ -33,6 +36,11 @@}; };arch/arm/dts/tegra210-p2371-2180.dts +15
-1+ i2c at 546c0c00 { + status = "okay"; + clock-frequency = <400000>; + }; + padctl at 7009f000 { pinctrl-0 = <&padctl_default>; pinctrl-names = "default"; @@ -85,6 +93,16 @@ non-removable; }; + i2c at 7000c400 { + status = "okay"; + clock-frequency = <400000>; + }; + + i2c at 7000c500 { + status = "okay"; + clock-frequency = <400000>; + }; + i2c at 7000d000 { status = "okay"; clock-frequency = <400000>; --1.8.2.1.610.g562af5b
----------------------------------------------------------------------
------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
----------------------------------------------------------------------
-------------
PATCH 3/3 ARM: tegra: p2371-2180: add I2C nodes to DT
Quoted 28 lines · Tom Warren
-----Original Message-----
From: Peter Robinson <[email protected]>
Sent: Tuesday, March 31, 2020 3:54 AM
To: tomcwarren3959 at gmail.com
Cc: u-boot at lists.denx.de; Stephen Warren <[email protected]>; Thierry Reding <[email protected]>; Jonathan Hunter <[email protected]>; Tom Warren <[email protected]>; Vishruth Jain <[email protected]>
Subject: Re: [PATCH 3/3] ARM: tegra: p2371-2180: add I2C nodes to DTExternal email: Use caution opening links or attachments
Quoted 18 lines
From: Stephen Warren <[email protected]>
This adds to the DT the I2C controllers that connect to the board ID EEPROM, camera board EEPROM, etc. With this change, you can now probe all I2C devices on a TX1 board.
Signed-off-by Tom Warren <[email protected]>--- arch/arm/dts/tegra210-p2371-2180.dts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)arch/arm/dts/tegra210-p2371-2180.dts +0
-0@@ -12,6 +12,9 @@
Quoted 14 lines
arch/arm/dts/tegra210-p2371-2180.dts line 17
Quoted 5 lines
arch/arm/dts/tegra210-p2371-2180.dts +3
-0aliases { i2c0 = "/i2c at 7000d000"; + i2c2 = "/i2c at 7000c400"; + i2c3 = "/i2c at 7000c500"; + i2c5 = "/i2c at 546c0c00";I don't think this is correct, it doesn't show up in U-Boot with the "i2c bus" command where the others do, looking in the
tegra210.dtsiit looks like it should be i2c at546c0000?
[Tom] That I2C address is working in downstream (L4T) TX1 U-Boot. TheVI_I2Ccontroller is a little weird, it's normal I2C registers are offset from base by0xC00. A different driver is needed, but I haven't posted it yet upstream. I should probably drop if from the DTS for now until I post theVI_I2Cdriver.
I think the problem here is that the upstream U-Boot device tree doesn't contain an i2c at 546c0c00 node. Instead it has i2c at 546c0000, which we also have in the upstream kernel. My recollection is that that's also the address listed in the Tegra210 system address map of the TRM and there are some registers before the regular I2C interface at offset 0xc00.
I've been carrying a patch against the upstream Linux I2C controller driver to special-case the VI/I2C to always add that 0xc00 offset when accessing registers, which allows us to reuse the existing driver and at the same time keeps all registers mapped so we can also access the VI/I2C specific registers.
My recollection is that the U-Boot driver is fairly similar to the Linux driver, so I suspect something similar could be done.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200401/99870cfa/attachment.sig>
PATCH 3/3 ARM: tegra: p2371-2180: add I2C nodes to DT
-----Original Message-----
From: Thierry Reding <[email protected]>
Sent: Wednesday, April 1, 2020 8:20 AM
To: Tom Warren <[email protected]>
Cc: Peter Robinson <[email protected]>; tomcwarren3959 at gmail.com; u-boot at lists.denx.de; Stephen Warren <[email protected]>; Jonathan Hunter <[email protected]>; Vishruth Jain <[email protected]>
Subject: Re: [PATCH 3/3] ARM: tegra: p2371-2180: add I2C nodes to DT
Quoted 30 lines · Tom Warren
-----Original Message-----
From: Peter Robinson <[email protected]>
Sent: Tuesday, March 31, 2020 3:54 AM
To: tomcwarren3959 at gmail.com
Cc: u-boot at lists.denx.de; Stephen Warren <[email protected]>; Thierry Reding <[email protected]>; Jonathan Hunter <[email protected]>; Tom Warren <[email protected]>; Vishruth Jain <[email protected]>
Subject: Re: [PATCH 3/3] ARM: tegra: p2371-2180: add I2C nodes to DTExternal email: Use caution opening links or attachments
Quoted 18 lines
From: Stephen Warren <[email protected]>
This adds to the DT the I2C controllers that connect to the board ID EEPROM, camera board EEPROM, etc. With this change, you can now probe all I2C devices on a TX1 board.
Signed-off-by Tom Warren <[email protected]>--- arch/arm/dts/tegra210-p2371-2180.dts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)arch/arm/dts/tegra210-p2371-2180.dts +0
-0@@ -12,6 +12,9 @@
Quoted 14 lines
arch/arm/dts/tegra210-p2371-2180.dts line 17
Quoted 5 lines
arch/arm/dts/tegra210-p2371-2180.dts +3
-0aliases { i2c0 = "/i2c at 7000d000"; + i2c2 = "/i2c at 7000c400"; + i2c3 = "/i2c at 7000c500"; + i2c5 = "/i2c at 546c0c00";I don't think this is correct, it doesn't show up in U-Boot with the "i2c bus" command where the others do, looking in the
tegra210.dtsiit looks like it should be i2c at546c0000?
[Tom] That I2C address is working in downstream (L4T) TX1 U-Boot. TheVI_I2Ccontroller is a little weird, it's normal I2C registers are offset from base by0xC00. A different driver is needed, but I haven't posted it yet upstream. I should probably drop if from the DTS for now until I post theVI_I2Cdriver.
I think the problem here is that the upstream U-Boot device tree doesn't contain an i2c at 546c0c00 node. Instead it has i2c at 546c0000, which we also have in the upstream kernel. My recollection is that that's also the address listed in the Tegra210 system address map of the TRM and there are some registers before the regular I2C interface at offset 0xc00.
I've been carrying a patch against the upstream Linux I2C controller driver to special-case the VI/I2C to always add that 0xc00 offset when accessing registers, which allows us to reuse the existing driver and at the same time keeps all registers mapped so we can also access the VI/I2C specific registers.
My recollection is that the U-Boot driver is fairly similar to the Linux driver, so I suspect something similar could be done.
Thierry
[Tom] Thanks, Thierry. That's my recollection, too, about the VI_I2C 0xC00 offset. I'll take a look at what we have in L4T U-Boot for T210 and address it in a set of patches for upstream soon. That I2C controller isn't used for anything on any Jetson board except on TX1, I believe, where it allows U-Boot to talk to the camera add-in board to read the board ID. But we've moved all that out to CBoot (board ID EEPROM reading), so there isn't a pressing need for it in U-Boot anymore, IIRC.
--nvpublic
PATCH 3/3 ARM: tegra: p2371-2180: add I2C nodes to DT
Quoted 69 lines · Tom Warren
-----Original Message-----
From: Thierry Reding <[email protected]>
Sent: Wednesday, April 1, 2020 8:20 AM
To: Tom Warren <[email protected]>
Cc: Peter Robinson <[email protected]>; tomcwarren3959 at gmail.com; u-boot at lists.denx.de; Stephen Warren <[email protected]>; Jonathan Hunter <[email protected]>; Vishruth Jain <[email protected]>
Subject: Re: [PATCH 3/3] ARM: tegra: p2371-2180: add I2C nodes to DTQuoted 30 lines · Tom Warren
-----Original Message-----
From: Peter Robinson <[email protected]>
Sent: Tuesday, March 31, 2020 3:54 AM
To: tomcwarren3959 at gmail.com
Cc: u-boot at lists.denx.de; Stephen Warren <[email protected]>; Thierry Reding <[email protected]>; Jonathan Hunter <[email protected]>; Tom Warren <[email protected]>; Vishruth Jain <[email protected]>
Subject: Re: [PATCH 3/3] ARM: tegra: p2371-2180: add I2C nodes to DTExternal email: Use caution opening links or attachments
Quoted 18 lines
From: Stephen Warren <[email protected]>
This adds to the DT the I2C controllers that connect to the board ID EEPROM, camera board EEPROM, etc. With this change, you can now probe all I2C devices on a TX1 board.
Signed-off-by Tom Warren <[email protected]>--- arch/arm/dts/tegra210-p2371-2180.dts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)arch/arm/dts/tegra210-p2371-2180.dts +0
-0@@ -12,6 +12,9 @@Quoted 14 lines
arch/arm/dts/tegra210-p2371-2180.dts line 17
Quoted 5 lines
arch/arm/dts/tegra210-p2371-2180.dts +3
-0aliases { i2c0 = "/i2c at 7000d000"; + i2c2 = "/i2c at 7000c400"; + i2c3 = "/i2c at 7000c500"; + i2c5 = "/i2c at 546c0c00";I don't think this is correct, it doesn't show up in U-Boot with the "i2c bus" command where the others do, looking in the
tegra210.dtsiit looks like it should be i2c at546c0000?
[Tom] That I2C address is working in downstream (L4T) TX1 U-Boot. TheVI_I2Ccontroller is a little weird, it's normal I2C registers are offset from base by0xC00. A different driver is needed, but I haven't posted it yet upstream. I should probably drop if from the DTS for now until I post theVI_I2Cdriver.I think the problem here is that the upstream U-Boot device tree doesn't contain an i2c at
546c0c00node. Instead it has i2c at546c0000, which we also have in the upstream kernel. My recollection is that that's also the address listed in the Tegra210 system address map of the TRM and there are some registers before the regular I2C interface at offset0xc00.I've been carrying a patch against the upstream Linux I2C controller driver to special-case the VI/I2C to always add that
0xc00offset when accessing registers, which allows us to reuse the existing driver and at the same time keeps all registers mapped so we can also access the VI/I2C specific registers.My recollection is that the U-Boot driver is fairly similar to the Linux driver, so I suspect something similar could be done.
Quoted 9 lines
Thierry
[Tom] Thanks, Thierry. That's my recollection, too, about theVI_I2C0xC00offset. I'll take a look at what we have in L4T U-Boot for T210 and address it in a set of patches for upstream soon. That I2C controller isn't used for anything on any Jetson board except on TX1, I believe, where it allows U-Boot to talk to the camera add-in board to read the board ID. But we've moved all that out to CBoot (board ID EEPROM reading), so there isn't a pressing need for it in U-Boot anymore, IIRC.
We've had internal discussions about potentially using the ID EEPROMs to dynamically modify the kernel DTB at runtime (possibly from U-Boot) in order to support things like different add-in boards.
For example, we currently enable the DSI output in Linux for Jetson TX1. However, the Jetson TX1 developer kits don't actually ship with that DSI display (I don't think they even come with the display add-in card), so this can lead to confusion. The idea was to have U-Boot probe ID EEPROMs from several sources to determine what to add to the device tree, so that the kernel DT *source* would only contain the standard developer kit hardware, but U-Boot (or something else perhaps) could add in extra nodes for a display module, or camera add-in board, etc.
Note that this is just a vague idea at this time and nothing concrete has been done to implement this, yet.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200401/ee03a755/attachment.sig>