The following steps allow you to add a pad Wakeup on i.MX 8QuadMax MEK CPU Board.
On the Host.
Cloning the Linux kernel repository.
Clone the i.MX Linux Kernel repo to the home directory.
cd ~
git clone -b lf-5.10.72-2.2.0 https://source.codeaurora.org/external/imx/linux-imx
cd linux-imx/
Patching the device tree.
Open the imx8qm-mek.dts file:
vim arch/arm64/boot/dts/freescale/imx8qm-mek.dts
Add the following lines:
&lsio_gpio2{ pad-wakeup-num = <1>; pad-wakeup = <81 4 1>; };
In the line pad-wakeup-num = <1>; , the number "1" corresponds to the number of pads that you want to add.
The line pad-wakeup = <81 4 1>; has three parameters:
The first parameter corresponds to the "pin_id", you can find it in include/dt-bindings/pinctrl/pads-imx8qm.h , in this example we are using "IMX8QM_MIPI_CSI1_I2C0_SDA".
The second parameter corresponds to the "'type'", you can find it in the i.MX 8QuadMax Applications Processor Reference Manual, in the page 802:
For this example we are using "LOW".
The third parameter corresponds to the "line", the number of bit in 32bit gpio group, you can find it in include/dt-bindings/pinctrl/pads-imx8qm.h
In this example, "IMX8QM_MIPI_CSI1_I2C0_SDA" belongs to gpio group 2, line 1.
Build the device tree.
Setup your toolchain, for example:
source /opt/fsl-imx-wayland/5.10-hardknott/environment-setup-cortexa53-crypto-poky-linux
Generate config file.
make imx_v8_defconfig
Compile the device tree.
make freescale/imx8qm-mek.dtb
Copy the .dtb file to the MEK CPU Board, for example with scp:
scp imx8qm-mek.dtb root@<MEK_CPU_Board_IP>:/home/root
Alternatively, you may copy the .dtb file directly to the FAT32 partition where the Kernel and Device Tree files are located.
On the MEK CPU Board.
Switching the device tree.
To copy the updated device tree to the corresponding partition, first create a directory.
mkdir Partition_1
Mount the partition one.
mount /dev/mmcblk1p1 Partition_1/
Copy or move the device tree into partition one.
cp imx8qm-mek.dtb Partition_1/
Reboot the board.
reboot
How to wake up the i.MX 8QuadMax MEK CPU Board.
In this example a wire was soldered on "R204":
Run the following command on the MEK CPU Board:
echo mem > /sys/power/state
And you will see something like:
[ 53.769266] PM: suspend entry (deep) [ 53.902130] Filesystems sync: 0.129 seconds [ 53.908068] Freezing user space processes ... (elapsed 0.002 seconds) done. [ 53.917189] OOM killer disabled. [ 53.920420] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done. [ 53.929626] printk: Suspending console(s) (use no_console_suspend to debug)
Connect the wire that was soldered on "R204" to ground, the MEK CPU Board will wake up and you will see something like:
[ 54.687125] fec 5b040000.ethernet eth0: Link is Down [ 54.689876] PM: suspend devices took 0.756 seconds [ 54.709570] Disabling non-boot CPUs ... [ 54.710562] CPU1: shutdown [ 54.711582] psci: CPU1 killed (polled 0 ms) [ 54.714360] CPU2: shutdown [ 54.715376] psci: CPU2 killed (polled 0 ms) [ 54.717365] CPU3: shutdown [ 54.718382] psci: CPU3 killed (polled 0 ms) [ 54.719887] CPU4: shutdown [ 54.720884] psci: CPU4 killed (polled 4 ms) [ 54.722213] CPU5: shutdown [ 54.723229] psci: CPU5 killed (polled 0 ms) [ 54.724731] Enabling non-boot CPUs ... [ 54.725388] Detected VIPT I-cache on CPU1 [ 54.725423] GICv3: CPU1: found redistributor 1 region 0:0x0000000051b20000 [ 54.725486] CPU1: Booted secondary processor 0x0000000001 [0x410fd034] [ 54.726455] CPU1 is up [ 54.726930] Detected VIPT I-cache on CPU2 [ 54.726947] GICv3: CPU2: found redistributor 2 region 0:0x0000000051b40000 [ 54.726976] CPU2: Booted secondary processor 0x0000000002 [0x410fd034] [ 54.727478] CPU2 is up [ 54.727955] Detected VIPT I-cache on CPU3 [ 54.727971] GICv3: CPU3: found redistributor 3 region 0:0x0000000051b60000 [ 54.728001] CPU3: Booted secondary processor 0x0000000003 [0x410fd034] [ 54.728497] CPU3 is up [ 54.729806] Detected PIPT I-cache on CPU4 [ 54.729825] GICv3: CPU4: found redistributor 100 region 0:0x0000000051b80000 [ 54.729857] CPU4: Booted secondary processor 0x0000000100 [0x410fd082] [ 54.730490] CPU4 is up [ 54.730985] Detected PIPT I-cache on CPU5 [ 54.730999] GICv3: CPU5: found redistributor 101 region 0:0x0000000051ba0000 [ 54.731021] CPU5: Booted secondary processor 0x0000000101 [0x410fd082] [ 54.731679] CPU5 is up [ 54.756440] hdmi_rx_hd_core_clk: failed to set clock parent -16 [ 54.765828] gpio-mxc 5d0a0000.gpio: wakeup by pad, line 1 [ 54.844242] ahci-imx 5f020000.sata: external osc is used. [ 54.913582] caam 31400000.crypto: registering rng-caam [ 54.918358] PM: resume devices took 0.148 seconds [ 55.096663] OOM killer enabled. [ 55.099814] Restarting tasks ... done. [ 55.111833] PM: suspend exit
記事全体を表示