This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-J721E: "Unhandled External Abort" when accessing ECAP registers on TDA4VM / J721E

Part Number: PROCESSOR-SDK-J721E
Other Parts Discussed in Thread: TDA4VM

Tool/software:

Hi,

I'm using a board very similar to the J721E EVM board (TDA4VM), and attempting to use the ECAP as APWM (as a fan PWM controller).

1. First I tried to simply access the registers at 0x03100000 using devmem from Linux. It gave me the exception, so I assumed the memory was being protected or not mapped correctly.

2. I then updated the DTS with ECAP and FAN-PWM as done in the compatible AM65x DTS files.
This does give me PWM device in sysfs, that can be exported using:

echo 0 > /sys/devices/platform/bus@100000/3100000.pwm/pwm/pwmchip0/export

However, attempting to write any parameters in /sys/devices/platform/bus@100000/3100000.pwm/pwm/pwmchip0/pwm0/ also causes the same exception, so the same error persists.

Output:

ERROR: Unhandled External Abort received on 0x80000000 from S-EL1
ERROR: exception reason=0 syndrome=0xbf000000
Unhandled Exception from EL1

Followed by a register dump

  • Hi, 

    Ecap is currently not supported even in the latest SDK 10.0.

    This is not validated.

    Best regards,

    Keerthy 

  • Ok, but surely the hardware is validated, and there's a way to access it?

  • If I check the memory mapping using "cat /proc/iomem" I do find it being mapped

    03100000-0310005f : 3100000.pwm pwm@3100000

    I can access the I2C controllers, which also appear in the same way

    02000000-020000ff : 2000000.i2c i2c@2000000

    for cat /proc/vmallocinfo I see similarly:

    0x000000000e66f092-0x00000000f819812e    8192 __devm_ioremap+0x100/0x118 phys=0x0000000003100000 ioremap

    0x00000000a89775ab-0x000000007c091c3d    8192 __devm_ioremap+0x100/0x118 phys=0x0000000002000000 ioremap

  • Hi Andres,

    Can you check if the probe succeeds? Also other thing is if the runtime_pm is enabled in Linux you can try disabling that in the driver.
    I have not tried myself.

    - Keerthy

  • Last night I managed to get it working, it seems to have been related to clock & power.
    The DTS device I copied from a AM654 EVM had the wrong IDs for clock and power domain, which was causing my issue.

    I found the correct IDs here:
    https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/j721e/clocks.html

    My current DTS device in cbass_main:

    ecap0: pwm@3100000 {
        compatible = "ti,am654-ecap", "ti,am3352-ecap";
        #pwm-cells = <3>;
        reg = <0x0 0x03100000 0x0 0x100>;
        power-domains = <&k3_pds 80 TI_SCI_PD_EXCLUSIVE>;
        clocks = <&k3_clks 80 0>;
        clock-names = "fck";
    };

    I also added in thermal threshold alarms that should be controlling the PWM using the FAN-PWM device, but this does not seem to be working.

    But I can control the PWM manually:

    echo 0 > /sys/devices/platform/bus@100000/3100000.pwm/pwm/pwmchip0/export
    echo 100000 > /sys/devices/platform/bus@100000/3100000.pwm/pwm/pwmchip0/pwm0/period
    echo 0 > /sys/devices/platform/bus@100000/3100000.pwm/pwm/pwmchip0/pwm0/duty_cycle
    echo 1 > /sys/devices/platform/bus@100000/3100000.pwm/pwm/pwmchip0/pwm0/enable
    echo 50000 > /sys/devices/platform/bus@100000/3100000.pwm/pwm/pwmchip0/pwm0/duty_cycle

    It seems to require setting the duty cycle to 0 to make it start, then setting the intended duty cycle

  • Okay thanks for sharing this. 

    Best regards,

    Keerthy