Writing to peripheral register from uboot using 'mw' command fails in TX2


I was trying to configure several setting from uboot by writing directly to registers
from uboot(from L4T 27.1) using mw command in Jetson TX2.

Write did not give any error prints, but read back shows some invalid value.[/i]

The below logs shows, how I tried to write to a padctrl register after a coldboot from uboot.[/i]

Tegra186 (P2771-0000-500) # md.l 0x3520084 1
03520084: dead1009 …
Tegra186 (P2771-0000-500) # mw.l 0x3520084 0x0 0x1
Tegra186 (P2771-0000-500) # md.l 0x3520084 1
03520084: dead1009 …
Tegra186 (P2771-0000-500) #

[i]I was getting same result after writing to SPI and I2C (0x3190004) controllers as well.

Is there any special settings to be done before accessing those registers.
anything like enabling power gating, or clocks or something like that?

Thanks in advance :-)

Yes, the HW requires that to access the registers for a particular module:

  • The module not be powergated
  • The module’s clock be enabled
  • The module not be held in reset

These requirements aren’t specific to U-Boot or mr/mw, but are generally applicable to any SW that directly accesses registers.

It’s worth following up to this answer to mention that the registers associated with clocking and reset (TRM Chapter 4.6) are not accessible from the CCPLEX. You need to communicate with the BPMP to enable the clock and to deassert reset to whatever device you want to use, be it SPI or I2C. I found a reference implementation for the BPMP communication protocol (called IVC) in the latest U-Boot source for TX2.