Closed aidenschoi closed 3 years ago
@nategraff-sifive @keith-packard Can you please review this PR?
@aidenschoi Would you mind making the corresponding PR to example-pwm?
@nategraff-sifive I created https://github.com/sifive/example-pwm/pull/2 in example-pwm, too.
@nategraff-sifive @keith-packard did you complete reviewing this PR and https://github.com/sifive/example-pwm/pull/2 in example-pwm?
Issue Description PWM Interrupt doesn't work well with example-pwm in freedom-metal-next branch on sesame.
Root Cause In sesame core.dts, the number of pwm interrupt channel ID is 4. pwm0 : 35, 36, 37, 38, pwm1 : 39, 40, 41, 42
But, the implement in j2 file considered the index only for the first one instead of all indexes. So there is no API to get which index in PLIC to enable/disable interrupt. Also, there is no code to enable parent interrupt (PLIC) of PWM.
Test example-pwm works well with ENABLE_INTERRUPTS on sesame with vcu-118 fpga. all index interrupts of pwm work well. I checked it with clang-formater.
Additionally, to test this PR, it should change example-pwm code too as below.