Hi NXP,
I am currently working on the IMX8ULP EVK Board with the Android Kernel running on the A35 core. My goal is to configure the TPM module to control the RGB LED on the baseboard.
Steps Taken:
Device Tree Configuration:
- The device tree already included a node for backlight control of the display on the daughter card.
- I added a new node for PWM control (referencing the Config Tools) to manage the RGB LED.
Issues Faced:
- The new PWM node appears under /sys/firmware/devicetree/base/ but not under /sys/class/.
- The entries under /sys/firmware/devicetree/base/pwmbacklight are read-only. Attempts to change permissions (using chmod -R 777) or write to these entries (even with superuser privileges) result in a "Permission denied" error.
Driver Selection:
- The backlight driver uses pwm-rpmsg, and I added the same driver for the RGB LED as a reference. However, I suspect this is causing the issue because:
- The backlight PWM on PTA03 is controlled by RTD peripherals.
- The RGB LEDs on Ports E and F are controlled by APD peripherals.
- The driver I need (pwm-imx27.c) is present in the SDK but is missing in the current image.
Questions:
- How can I build and include the pwm-imx27.c driver in the image to control the PWM for the RGB LED?
- Could you provide guidance on resolving the read-only issue for the new PWM node?
Relevant Device Tree Changes:
Device Tree Node for PWM RGB LED:
/ {
pwm_rgbLed: pwmbacklight {
compatible = "pwm-backlight";
pinctrl-0 = <&pinctrl_pwm>;
pwms = <&tpm7 2 50000 0>;
#pwm-cells = <3>;
brightness-levels = <0 1 2 3 4 ... 100>;
default-brightness-level = <100>;
};
};Pin Configuration:
&iomuxc1 {
pinctrl_pwm: pinctrlpwm {
fsl,pins = <
MX8ULP_PAD_PTF29__TPM7_CH2 0x00000002
>;
};
};TPM Node in imx8ulp.dtsi:
tpm7: tpm@29830000 {
#pwm-cells = <3>;
compatible = "fsl,imx8ulp-tpm", "fsl,imx7ulp-tpm";
fsl,pwm-channel-number = <6>;
reg = <0x29830000 0x1000>;
interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&sosc>, <&sosc>;
clock-names = "ipg", "per";
status = "okay";
};Observations:
- The /sys/class/ directory contains the following entries but not pwmbacklight:
android_usb gpu_class misc pwm spidev
arvo graphics mmc_host pxp_device thermal
backlight hidraw mtd pyra trusty_ipc
bdi hwmon mux rc tty
block i2c-dev nd regulator typec
bsg ieee80211 net remoteproc typec_mux
devcoredump input nvme retimer ublk-char
devfreq iommu nvme-generic rfkill udc
devfreq-event isku nvme-subsystem rpmsg uio
devlink kone pci_bus rtc usb_power_delivery
dma koneplus pci_epc ryos usb_role
dma_heap konepure phy savu video4linux
dmabuf_imx kovaplus pmsg scsi_device wakeup
drm leds power_supply scsi_disk watchdog
extcon lirc powercap scsi_host xt_idletimer
firmware mdio_bus pps sound zram-control
gnss mem ptp spi_master
- The PWM node for RGB LED (pwmbacklight) is visible under /sys/firmware/devicetree/base/ with the following structure:
/sys/firmware/devicetree/base/pwmbacklight/
├── #pwm-cells
├── brightness-levels
├── compatible
├── default-brightness-level
├── name
├── pinctrl-0
├── pwms
- Attempting to modify values results in:
echo 50 > default-brightness-level
/system/bin/sh: can't create default-brightness-level: Permission denied
Could you please provide guidance on how to properly configure and include the pwm-imx27 driver or resolve the above issues?
Thanks in advance!