Difference between revisions of "Jetson/FAQ/BSP/Xavier Wakeup Pin"

From eLinux.org
Jump to: navigation, search
(Create GPIO key to trigger wake up signal)
(Create GPIO key to trigger wake up signal)
Line 11: Line 11:
 
== Create GPIO key to trigger wake up signal ==
 
== Create GPIO key to trigger wake up signal ==
 
Add following node to hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-p2822-0000-a00.dtsi.
 
Add following node to hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-p2822-0000-a00.dtsi.
* @@ -16,7 +16,7 @@
+
<nowiki>@@ -16,7 +16,7 @@
* #include "dt-bindings/input/input.h"
+
  #include "dt-bindings/input/input.h"
* #include "tegra194-audio-p2822-0000.dtsi"
+
  #include "tegra194-audio-p2822-0000.dtsi"
* #include "tegra194-p2822-disp.dtsi"
+
  #include "tegra194-p2822-disp.dtsi"
* -
+
-
* +#include <dt-bindings/soc/tegra-pmc.h>
+
+#include <dt-bindings/soc/tegra-pmc.h>
* / {
+
  / {
* sdhci@3400000 {
+
  sdhci@3400000 {
* mmc-ocr-mask = <0x0>;
+
  mmc-ocr-mask = <0x0>;
* @@ -43,4 +43,16 @@
+
@@ -43,4 +43,16 @@
* gpio-key,wakeup;
+
  gpio-key,wakeup;
* };
+
  };
* };
+
  };
* +
+
+
* + gpio-keys {
+
+ gpio-keys {
* +     wakeup_key {
+
+     wakeup_key {
* + label = "WakeupKey";
+
+ label = "WakeupKey";
* + gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(G, 1) GPIO_ACTIVE_LOW>;
+
+ gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(G, 1) GPIO_ACTIVE_LOW>;
* + linux,code = <KEY_SUSPEND>;
+
+ linux,code = <KEY_SUSPEND>;
* + gpio-key,wakeup;
+
+ gpio-key,wakeup;
* + debounce-interval = <30>;
+
+ debounce-interval = <30>;
* + nvidia,pmc-wakeup = <&tegra_pmc
+
+ nvidia,pmc-wakeup = <&tegra_pmc
* +     PMC_WAKE_TYPE_GPIO 68 PMC_TRIGGER_TYPE_HIGH>;
+
+     PMC_WAKE_TYPE_GPIO 68 PMC_TRIGGER_TYPE_HIGH>;
* +     };
+
+     };
* + };
+
+ };
* };
+
  };</nowiki>
 +
 
  
 
Note:<br>
 
Note:<br>

Revision as of 18:31, 24 January 2021

Environment

Hardware

  • Jetson Xavier

Software

  • JetPack 4.4 (32.4.3)

Use case

Set GPIO(STB_REQ_N/Pin L11) as wake up source to trigger OS resume.

Steps

Note: All changes are in kernel device tree.

Create GPIO key to trigger wake up signal

Add following node to hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-p2822-0000-a00.dtsi. @@ -16,7 +16,7 @@ #include "dt-bindings/input/input.h" #include "tegra194-audio-p2822-0000.dtsi" #include "tegra194-p2822-disp.dtsi" - +#include <dt-bindings/soc/tegra-pmc.h> / { sdhci@3400000 { mmc-ocr-mask = <0x0>; @@ -43,4 +43,16 @@ gpio-key,wakeup; }; }; + + gpio-keys { + wakeup_key { + label = "WakeupKey"; + gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(G, 1) GPIO_ACTIVE_LOW>; + linux,code = <KEY_SUSPEND>; + gpio-key,wakeup; + debounce-interval = <30>; + nvidia,pmc-wakeup = <&tegra_pmc + PMC_WAKE_TYPE_GPIO 68 PMC_TRIGGER_TYPE_HIGH>; + }; + }; };


Note:

(1) Pay attention of nvidia,pmc-wakeup property, the number 68 means wake up ID of Nano. You can find this ID from Column Y of Xavier_Module_Pinmux_Config file which comes from Jetson Download Center.

(2) If you want a key for suspend purpose, please modify linux,code propriety's value as <KEY_SUSPEND>.

Verification

Re-build device tree and re-flash to Xavier. After boot completed, exec "sudo systemctl suspend" to suspend OS. Connect that Pin and debug STB_REQ_N/Pin L11 via Dupont wire to wake up OS.