Controlling power sleep/wake-up over GPIO expansion header (or J508 Automation Header)

Hi there,
thanks a lot for your great “Jetson Xavier AGX” platform,
at this time I would like to control :

  • (power) going to sleep mode from a GPIO (could be done also w/ “echo -n mem > /sys/power/state”)
  • (power) wake-up from sleep mode from a GPIO
    Best regards, Xavier.

Please refer to below source code to add extra gpio-keys event.

hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-p2822-0000-a00.dtsi

Thanks @WayneWWW,
to restart with the new “device tree” settings should I just change the DTSI file and restart or do I need to rebuild the kernel with the DTSI file ?

You need to download the kernel source. Build the DTB and put binary back to the flash folder Linux_for_Tegra/kernel/dtb and then reflash your board.

Currently I have a freshly purchased “Jetson Xavier AGX” PC with Ubuntu bionic 18.04.1 LTS with the follow kernel “Linux jetson-04XX 4.9.108-tegra #2 SMP PREEMPT Wed Oct 31 15:11:49 PDT 2018 aarch64 aarch64 aarch64 GNU/Linux”.
Can I just rebuild the DTB and copy it to the existing system ?

I don’t see much obstacles between flash dtb and copy dtb. Why you cannot just flash the dtb?

Do you have a guideline to reflash/copy the newly built DTB to the Jetson Xavier PC ?
My question is more : “do I have to rebuild the whole kernel and reflash over network or other method the whole board” or “just the DTB file to the right location and reboot” ?
Much regards, Xavier.

Hi,

Please refer to l4t development guide on this download center to get familiar with the flash system.

Also, I cannot reply your question directly because it depends on the release you are using.
In some old release, the dtb is in specific partition, so directly copy it to file system would not work.
However, it seems working after rel-32.3.1. But I seldom use such method. You could give it a try too.

Also, there is no need to rebuild the “whole kernel”. Kernel and dtb are different things. Kernel often refers to Image and kernel modules, while dtb means the device tree blob. Also, we could flash dtb only instead of whole rootfs/Image.

Hi @WayneWWW ,
thanks for your reply, yes I am aware of the difference between “kernel/modules” and “dtb” in recent kernels, currently the release (Linux jetson-XXXX 4.9.108-tegra) I am using is giving the following pre-installed dtb files but I dont which one is currently used :
“nvidia@jetson-XXX:~$ sudo find / -iname ‘*dtb’
/dev/disk/by-partlabel/kernel-dtb
/dev/disk/by-partlabel/bootloader-dtb
/dev/disk/by-partlabel/bpmp-fw-dtb
find: ‘/run/user/120/gvfs’: Permission denied
find: ‘/run/user/1001/gvfs’: Permission denied
/run/udev/links/\x2fdisk\x2fby-partlabel\x2fkernel-dtb
/run/udev/links/\x2fdisk\x2fby-partlabel\x2fbootloader-dtb
/run/udev/links/\x2fdisk\x2fby-partlabel\x2fbpmp-fw-dtb
/boot/tegra194-p2888-0001-p2822-0000-maxn.dtb
/boot/tegra194-p2888-0001-p2822-0000.dtb
/boot/dtb
/boot/dtb/tegra194-p2888-0001-p2822-0000.dtb
/boot/tegra186-quill-p3310-1000-c03-00-base.dtb
/boot/tegra186-quill-p3489-1000-a00-00-ucm2.dtb
/boot/tegra186-quill-p3310-1000-a00-00-base.dtb
/boot/tegra186-quill-p3310-1000-c03-00-dsi-hdmi-dp.dtb
/boot/tegra186-quill-p3489-1000-a00-00-ucm1.dtb”
Much regards,
Xavier.

The one under /boot/dtb is what you are using.

Do you beliveve I can just reflash this one with a new built dtb and reboot to use a new hardware configuration ? Regards, Xavier.

That’s depends on what release you are using.
Do you know/are you able to tell what release your board is?

nvidia@jetson-XXX:~$ uname -a
Linux jetson-0420119097873 4.9.108-tegra #2 SMP PREEMPT Wed Oct 31 15:11:49 PDT 2018 aarch64 aarch64 aarch64 GNU/Linux
nvidia@jetson-XXXX:~$ cat /etc/os-release
NAME=“Ubuntu”
VERSION=“18.04.1 LTS (Bionic Beaver)”
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME=“Ubuntu 18.04.1 LTS”
VERSION_ID=“18.04”
HOME_URL=“https://www.ubuntu.com/
SUPPORT_URL=“https://help.ubuntu.com/
BUG_REPORT_URL=“https://bugs.launchpad.net/ubuntu/
PRIVACY_POLICY_URL=“Data privacy | Ubuntu
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

Hi,

I meant something like Jetpack 4.4 or 4.3 or 4.2.1.
Sorry that I really cannot tell what release you are using by just reading the date.

You should at least know what jetpack you flashed on your board, right?

or you could cat /etc/nv_tegra_release

R31 (release), REVISION: 1.0, GCID: 13195123, BOARD: t186ref, EABI: aarch64, DATE: Wed Oct 31 22:14:28 UTC 2018

Hi,

No, then I guess copy it to device will not work. Also, please do not use r31.1 anymore. rel-31.1 is a developer preview and it was released 2 years ago.

Hi,
I will reflash with Jetpack 4.4 and get back to you for the DTB rebuild. In the meantime, I cannot find the l4t kernel souces or source_sync.sh to download the kernel source and prepare a new DTB ? Regards, Xavier.

You will find it after you run Jetpack4.4 on your host. If you don’t find it, you could download source from our download center too.

Please do read the document to get familiar with how to use the flash system.

Dear @WayneWWW
I have installed Jetpack 4.3 (rel-32.3.1) and /etc/nv_tegra_release :
R32 (release), REVISION: 3.1, GCID: 18186506, BOARD: t186ref
At this point can you point me how to rebuild the DTB to make some test with GPIOs ?
Best regards, Xavier.