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)
 
(3 intermediate revisions by the same user not shown)
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 @@
+
<br>
* #include "dt-bindings/input/input.h"
+
<pre>
* #include "tegra194-audio-p2822-0000.dtsi"
+
@@ -16,7 +16,7 @@
* #include "tegra194-p2822-disp.dtsi"
+
  #include "dt-bindings/input/input.h"
* -
+
  #include "tegra194-audio-p2822-0000.dtsi"
* +#include <dt-bindings/soc/tegra-pmc.h>
+
  #include "tegra194-p2822-disp.dtsi"
* / {
+
-
* sdhci@3400000 {
+
+#include <dt-bindings/soc/tegra-pmc.h>
* mmc-ocr-mask = <0x0>;
+
  / {
* @@ -43,4 +43,16 @@
+
  sdhci@3400000 {
* gpio-key,wakeup;
+
  mmc-ocr-mask = <0x0>;
* };
+
@@ -43,4 +43,16 @@
* };
+
  gpio-key,wakeup;
* +
+
  };
* + gpio-keys {
+
  };
* +     wakeup_key {
+
+
* + label = "WakeupKey";
+
+ gpio-keys {
* + gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(G, 1) GPIO_ACTIVE_LOW>;
+
+     wakeup_key {
* + linux,code = <KEY_SUSPEND>;
+
+ label = "WakeupKey";
* + gpio-key,wakeup;
+
+ gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(G, 1) GPIO_ACTIVE_LOW>;
* + debounce-interval = <30>;
+
+ linux,code = <KEY_SUSPEND>;
* + nvidia,pmc-wakeup = <&tegra_pmc
+
+ gpio-key,wakeup;
* +     PMC_WAKE_TYPE_GPIO 68 PMC_TRIGGER_TYPE_HIGH>;
+
+ debounce-interval = <30>;
* +     };
+
+ nvidia,pmc-wakeup = <&tegra_pmc
* + };
+
+     PMC_WAKE_TYPE_GPIO 68 PMC_TRIGGER_TYPE_HIGH>;
* };
+
+     };
 
+
+ };
 +
  };<br>
 +
</pre>
 
Note:<br>
 
Note:<br>
  

Latest revision as of 17:48, 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>;
+	    };
+	};
 };<br>

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.