[U-Boot] u-boot-dm crashes early on NVIDIA Beaver, Jetson TK1

Simon, the latest commits in u-boot-dm/git master branch (2b64d049a061 "power: pmic/regulator: Add basic support for TPS65910") crash on at least Beaver and Jetson TK1. On TK1, I added debug spew to lib/initcall.c, and the last function called before the crash is initr_serial():
U-Boot SPL 2018.01-rc1-00620-g2b64d049a061-dirty (Dec 11 2017 - 09:50:35) Trying to boot from RAM initcall: 801602c4
U-Boot 2018.01-rc1-00620-g2b64d049a061-dirty (Dec 11 2017 - 09:50:35 -0700)
initcall: 80123814 U-Boot code: 80110000 -> 8017F6E8 BSS: -> 801C3B0C initcall: 80113030 TEGRA124 initcall: 80123dc0 Model: NVIDIA Jetson TK1 Board: NVIDIA Jetson TK1 initcall: 8012394c DRAM: initcall: 80111c78 initcall: 80123ab4 Monitor len: 000B3B0C Ram size: 80000000 Ram top: 00000000 initcall: 80123664 initcall: 80123684 TLB table from ffff0000 to ffff4000 initcall: 8012367c initcall: 801239bc initcall: 801237c8 Reserving 718k for U-Boot at: fff3c000 initcall: 80123798 Reserving 37896k for malloc() at: fda3a000 initcall: 801238f8 Reserving 88 Bytes for Board Info at: fda39fa8 initcall: 801239c4 initcall: 80123764 Reserving 208 Bytes for Global Data at: fda39ed8 initcall: 801236f8 Reserving 30560 Bytes for FDT at: fda32778 initcall: 801239cc initcall: 801239e4 initcall: 80123b20 initcall: 80111e0c initcall: 801239f8
RAM Configuration: Bank #0: 80000000 2 GiB Bank #1: 0 0 Bytes
DRAM: 2 GiB initcall: 801236dc New Stack Pointer is: fda32750 initcall: 801238b4 initcall: 801239d4 initcall: 80123844 Relocation Offset is: 7fe2c000 Relocating to fff3c000, new gd at fda39ed8, sp at fda32750 initcall: fff4fb64 initcall: fff4fb6c initcall: 80123d54 (relocated to fff4fd54) initcall: 80123d1c (relocated to fff4fd1c) initcall: 80123d74 (relocated to fff4fd74) initcall: 80123ce0 (relocated to fff4fce0) Pre-reloc malloc() used 0x130 bytes (0 KB) initcall: 80123634 (relocated to fff4f634) initcall: 80123ccc (relocated to fff4fccc) initcall: 80123d7c (relocated to fff4fd7c) initcall: 80123cbc (relocated to fff4fcbc) initcall: 80123d64 (relocated to fff4fd64) initcall: 80123cb0 (relocated to fff4fcb0) initcall: 80123c9c (relocated to fff4fc9c) initcall: 80111d80 (relocated to fff3dd80) initcall: 8015670c (relocated to fff8270c) initcall: 8012c7f0 (relocated to fff587f0) initcall: 80123c8c (relocated to fff4fc8c)
U-Boot SPL 2016.09-00263-gf50db3a323b1 (Sep 23 2016 - 16:34:07)
80123c70 l F .text 0000001c initr_announce 80123c8c l F .text 00000010 initr_serial 80123c9c l F .text 00000014 initr_dm

On 12/11/2017 09:55 AM, Stephen Warren wrote:
Simon, the latest commits in u-boot-dm/git master branch (2b64d049a061 "power: pmic/regulator: Add basic support for TPS65910") crash on at least Beaver and Jetson TK1. On TK1, I added debug spew to lib/initcall.c, and the last function called before the crash is initr_serial():
Bisect shows this is due to the commit below. If I revert this, U-Boot works correctly again:
0c98340717f69a66acd4156392b6a45cc51042b3 is the first bad commit commit 0c98340717f69a66acd4156392b6a45cc51042b3 Author: Mario Six mario.six@gdsys.cc Date: Fri Nov 24 07:51:40 2017 +0100
drivers: core: Add translation in live tree case The function dev_read_addr calls ofnode_get_addr_index in the live tree case, which does not apply bus translations to the address read from the device tree. This results in illegal addresses on boards that rely on bus translations being applied. Fix this situation by applying bus translations in the live tree case as well. Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Simon Glass <sjg@chromium.org>

Hi Stephen,
On Mon, Dec 11, 2017 at 6:02 PM, Stephen Warren swarren@wwwdotorg.org wrote:
On 12/11/2017 09:55 AM, Stephen Warren wrote:
Simon, the latest commits in u-boot-dm/git master branch (2b64d049a061 "power: pmic/regulator: Add basic support for TPS65910") crash on at least Beaver and Jetson TK1. On TK1, I added debug spew to lib/initcall.c, and the last function called before the crash is initr_serial():
Bisect shows this is due to the commit below. If I revert this, U-Boot works correctly again:
0c98340717f69a66acd4156392b6a45cc51042b3 is the first bad commit commit 0c98340717f69a66acd4156392b6a45cc51042b3 Author: Mario Six mario.six@gdsys.cc Date: Fri Nov 24 07:51:40 2017 +0100
drivers: core: Add translation in live tree case The function dev_read_addr calls ofnode_get_addr_index in the live
tree case, which does not apply bus translations to the address read from the device tree. This results in illegal addresses on boards that rely on bus translations being applied. Fix this situation by applying bus translations in the live tree case as well. Signed-off-by: Mario Six mario.six@gdsys.cc Reviewed-by: Simon Glass sjg@chromium.org
That's what I feared; some boards are already relying on the non-translating behavior. dev_read_addr does bus translations with this patch (which is the correct behavior, since it does that in the non-livetree case as well). But the device tree was probably written with the non-translating behavior in mind.
Check the ranges properties in the device tree; otherwise, check which address you expect dev_read_addr to return, and compare it with what it does return now.
Best regards,
Mario
participants (2)
-
Mario Six
-
Stephen Warren