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.
Device Tree Configuration:
Issues Faced:
Driver Selection:
/ { 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>; }; };
&iomuxc1 { pinctrl_pwm: pinctrlpwm { fsl,pins = < MX8ULP_PAD_PTF29__TPM7_CH2 0x00000002 >; }; };
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"; };
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
/sys/firmware/devicetree/base/pwmbacklight/ ├── #pwm-cells ├── brightness-levels ├── compatible ├── default-brightness-level ├── name ├── pinctrl-0 ├── pwms
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!
Hi @rahul_ms__
1, Which version of Android did you use?
2, Why did you need pwm-imx27.c on 8ulp? I think it's used for soc like 8mp.
3, I'm not sure if pwm-backlight is used like customer did. pwm-backlight is used for display backlight. RGB LED is controlled by 3 PWMs. Did you need to control these 3. not only TPM7_CH2?
B.R
1, Which version of Android did you use? I'm Using Android 14.
2, Why did you need pwm-imx27.c on 8ulp? I think it's used for soc like 8mp. Which driver should I use to control PWM pin for 8ULP?
3, I'm not sure if pwm-backlight is used like customer did. pwm-backlight is used for display backlight. RGB LED is controlled by 3 PWMs. Did you need to control these 3. not only TPM7_CH2? I’ve adjusted the approach for configuring the PWM pins to match the backlight setup. Currently, I need to configure three pins for RGB, but for testing purposes, I’m only setting up TPM2_CH2.
I’ve added the PWM node, but I’m unable to turn on the LED using it. Could you help me identify what might be causing the issue?
Hi @pengyong_zhang ,
We have made some progress after this. We tried using the configuration compatible = "fsl,imx8ulp-tpm", "fsl,imx7ulp-tpm";.
However, since no corresponding driver exists in the SDK, this change did not make any difference.
On a positive note, We successfully accessed the tpm under sysfs. We are able to set the period and duty cycle, and the written values are reflected when read back. However, writing "high" to the enable property does not take effect (cat enable always returns 0). Consequently, We are unable to enable the RGB LED.
To debug further, We used cat /sys/kernel/debug/pinctrl/*/pinmux-pins to verify if the pins were assigned to other activities. The output confirmed that pin 93 (PTF29) is correctly configured as pinctrl_pwm, matching the device tree configuration.
Could you advise on the next steps to resolve this issue?