I'm trying to enable wake from GPIO on a LS1046AFRWY board.
I modified the config files to enable GPIO driver using make menuconfig:
I went to /build_ls1046afrwy/tmp/work-shared/ls1046afrwy/kernel-source/drivers/gpio and modified gpio-mpc8xxx.c to add these lines at the end of the static int mpc8xxx_probe function:
device_init_wakeup(&pdev->dev, true);
enable_irq_wake(mpc8xxx_gc->irqn);
Then I modified arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi to this line to the end of gpio3: gpio@2320000:
fsl,rcpm-wakeup = <&rcpm 0x40>;
Then I ran:
$ make
$ make modules
$ make mrproper
I copied the generated images onto the boot folder of the SD card that already had the basic ls-image-main deployed and working on it. Then I copied the generated "modules" folder from the "module-ls1046afrwy.tgz" archive onto the "modules" folder on the SD card.
It looks like there are GPIO modules in there:
I booted the LS1046AFRWY board from the SD card. I get not errors and the board boots up, but I don't see the GPIO drivers being installed. The /sys/class/gpio directory does not exist on the target and I can't run any GPIO commands that reference it.
Am I doing something wrong in the process?
You have configured GPIO as built-in driver not module, please rebuild and update Linux Kernel "Image".
Under Linux Kernel, please check whether "CONFIG_GPIO_MPC8XXX" has been enabled.
~# zcat /proc/config.gz | grep GPIO_MPC8XXX
You could refer to https://community.nxp.com/t5/Layerscape-Knowledge-Base/Sleep-and-Wake-up-by-GPIO-on-LS1028/ta-p/1498...
The "CONFIG_GPIO_MPC8XXX" has been enabled. This is what I get if run:
~# zcat /proc/config.gz | grep GPIO_MPC8XXX
CONFIG_GPIO_MPC8XXX=y
But I don't see the /sys/class/gpio directory on the target and I can't run any GPIO commands that reference it.
This is the RCW file that the build uses as far as I can tell:
>/build_ls1046afrwy/tmp/deploy/images/ls1046afrwy/rcw/ls1046afrwy/NN_NNQNNPNP_3040_0506/rcw_1600_sdboot.bin
Under Code Warrior, I see no option to enable/disable GPIO as a whole. The white paper you shared earlier about enabling wake from GPIO on LS1028 implies the same thing. The only relevant option is to select the correct pin muxing for the pin I plan to use. In my case that's pin EC1, which has to be muxed as GPIO3, which I did, in the RCW:
Reset Configuration Word > SoC Specific Configuration > EC1 [416-418]
Which was already set to:
0b001 - GPIO 3
Please refer to this document to configure GPIO support in Linux Kernel first.
https://community.nxp.com/t5/Layerscape-Knowledge-Base/LS1043-GPIO-support-in-Linux-SDK/ta-p/1103689