Dear all,
I want to enable TPM4,7,8 on iMX8ULP,but the dts doesn't have device note.
So, I add TPM8 device node by myself.
But during probe, the kernel crashes.
Therefore, how to configure the clock source of TPM?
log and dts are as below.
解決済! 解決策の投稿を見る。
Hello,
Thank you for the update, please try by not commenting the assigned-clock-rates & clock-names properties in the tpm node.
Also, please enable the clock to be configured early on ATF:
https://github.com/nxp-imx/imx-atf/blob/lf-6.6.36-2.1.0/plat/imx/imx8ulp/imx8ulp_bl31_setup.c#L68
void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
u_register_t arg2, u_register_t arg3)
{
static console_t console;
+ /* config the TPM7 clock */
+ mmio_write_32(IMX_CGC1_BASE + 0x908, 0x300);
+
/* config the TPM5 clock */
mmio_write_32(IMX_PCC3_BASE + 0xd0, 0x92000000);
mmio_write_32(IMX_PCC3_BASE + 0xd0, 0xd2000000);
Please try it and let me know of your results.
Best regards/Saludos,
Aldo.
Hello!
Here are some updates I'd like to share with you.
Fortunately, I enable TPM7 CH5(PTF25) successfully, but there is no output waveform.
my device node :
+tpm7: tpm@29830000 {
+ //compatible = "fsl,imx8ulp-tpm", "fsl,imx7ulp-tpm";
+ compatible = "fsl,imx7ulp-pwm";
+ reg = <0x29830000 0x10000>;
+ //interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&pcc4 IMX8ULP_CLK_TPM7>, <&pcc4 IMX8ULP_CLK_TPM7>;
+ assigned-clocks = <&pcc4 IMX8ULP_CLK_TPM7>;
+ assigned-clock-parents = <&cgc1 IMX8ULP_CLK_FROSC_DIV2>;
+ //assigned-clock-rates = <48000000>;
+ //clock-names = "ipg", "per";
+ status = "okay";
+};
+&tpm7 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_tpm7>;
+ #pwm-cells = <3>;
+};
Hello,
Thank you for the update, please try by not commenting the assigned-clock-rates & clock-names properties in the tpm node.
Also, please enable the clock to be configured early on ATF:
https://github.com/nxp-imx/imx-atf/blob/lf-6.6.36-2.1.0/plat/imx/imx8ulp/imx8ulp_bl31_setup.c#L68
void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
u_register_t arg2, u_register_t arg3)
{
static console_t console;
+ /* config the TPM7 clock */
+ mmio_write_32(IMX_CGC1_BASE + 0x908, 0x300);
+
/* config the TPM5 clock */
mmio_write_32(IMX_PCC3_BASE + 0xd0, 0x92000000);
mmio_write_32(IMX_PCC3_BASE + 0xd0, 0xd2000000);
Please try it and let me know of your results.
Best regards/Saludos,
Aldo.
Thanks a lot !!! It works well!
Hello,
Could you share the full device tree that you are using?
Also, the node you have added seems to be incomplete that may be part of the reason as to why it does fail to boot correctly.
Best regards/Saludos,
Aldo.
I successfully enable pwm signal of TPM7 CH5(PTF25), but there is no output waveform
tpm7: tpm@29830000 {
//compatible = "fsl,imx8ulp-tpm", "fsl,imx7ulp-tpm";
compatible = "fsl,imx7ulp-pwm";
reg = <0x29830000 0x10000>;
//interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&pcc4 IMX8ULP_CLK_TPM7>, <&pcc4 IMX8ULP_CLK_TPM7>;
assigned-clocks = <&pcc4 IMX8ULP_CLK_TPM7>;
assigned-clock-parents = <&cgc1 IMX8ULP_CLK_FROSC_DIV2>;
//assigned-clock-rates = <48000000>;
//clock-names = "ipg", "per";
status = "okay";
};
&tpm7 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_tpm7>;
#pwm-cells = <3>;
};
pinctrl_tpm7: tpm7grp {
fsl,pins = <
MX8ULP_PAD_PTF25__TPM7_CH5 0x2
>;
};
root@imx8ulp-lpddr4-evk:/sys/class/pwm/pwmchip8/pwm5# echo 400000 > period
root@imx8ulp-lpddr4-evk:/sys/class/pwm/pwmchip8/pwm5# echo 200000 > duty_cycle
root@imx8ulp-lpddr4-evk:/sys/class/pwm/pwmchip8/pwm5# echo 1 > enable
Now, the kernel starts normally.But when I enable PWM channal, it will report an error!
root@imx8ulp-lpddr4-evk:/sys/class/pwm/pwmchip8/pwm5# echo 100000 > period
root@imx8ulp-lpddr4-evk:/sys/class/pwm/pwmchip8/pwm5# echo 50000 > duty_cycle
root@imx8ulp-lpddr4-evk:/sys/class/pwm/pwmchip8/pwm5# echo 1 > enable
-sh: echo: write error: Timer expired