i.MX8M SNVS ONOFF key handling (secure system)
Dear NXP team,
we do have the following situation:
- A verified boot (locked-down) system based on i.MX8MM and i.MX8MP
- The ONOFF pin is connected to an ext. MCU to initiate a shutdown
- The NPSWA_EN bit in HPCOMR is _not_ set
According the datasheet NXP introduced a new interrupt called "ipi_snvs_btn_int_b (button) interrupt" which can be enabled via HPCR register BTN_MASK bit. The interrupt level/edge trigger can be configured via the HPCR register BTN_CONFIG bit field. This interrupt can be cleared by _non_ privileged software e.g. Linux by writting an '1' to the BI bit (HPSR register).
Unfortunately I don't see how this interrupt is connected to the GIC. I can only see the snvs_lp_wrapper and snvs_hp_wrapper which do share the same IRQ number 4. According "Table 7-1. ARM Domain Interrupt Summary" IRQ 4 is triggered if: "ON-OFF button press shorter than 5 secs (pulse event)". It seems like this IRQ is controlled by the set_pwr_off_irq (SPOF) but to clear this IRQ from Linux we need to set the NPSWA_EN bit.
Now my question is how the ipi_snvs_btn_int_b irq is supposed to work?
Regards,
Marco
Hi Marco
Quoted 26 lines
Subject: i.MX8M SNVS ONOFF key handling (secure system)
Dear NXP team,
we do have the following situation:
- A verified boot (locked-down) system based on i.MX8MM and
i.MX8MP
- The ONOFF pin is connected to an ext. MCU to initiate a shutdown
- TheNPSWA_ENbit in HPCOMR is _not_ setAccording the datasheet NXP introduced a new interrupt called "
ipi_snvs_btn_int_b(button) interrupt" which can be enabled via HPCR registerBTN_MASKbit. The interrupt level/edge trigger can be configured via the HPCR registerBTN_CONFIGbit field. This interrupt can be cleared by _non_ privileged software e.g. Linux by writting an '1' to the BI bit (HPSR register).Unfortunately I don't see how this interrupt is connected to the GIC. I can only see the
snvs_lp_wrapperandsnvs_hp_wrapperwhich do share the same IRQ number 4. According "Table 7-1. ARM Domain Interrupt Summary"
IRQ 4 is triggered if: "ON-OFF button press shorter than 5 secs (pulse event)". It seems like this IRQ is controlled by theset_pwr_off_irq(SPOF) but to clear this IRQ from Linux we need to set theNPSWA_ENbit.
Quoted 2 lines
Now my question is how the
ipi_snvs_btn_int_birq is supposed to work?
My understanding is (set_pwr_off_irq | ipi_snvs_btn_int_b) connects to IRQ 4.
For more details, I need check with our Design team. Will update if I have more information.
Regards,
Peng.
Quoted 3 lines
Regards,
Marco
Hi Peng,
Quoted 28 lines · Peng Fan
Hi Marco
Quoted 26 lines
Subject: i.MX8M SNVS ONOFF key handling (secure system)
Dear NXP team,
we do have the following situation:
- A verified boot (locked-down) system based on i.MX8MM and
i.MX8MP
- The ONOFF pin is connected to an ext. MCU to initiate a shutdown
- TheNPSWA_ENbit in HPCOMR is _not_ setAccording the datasheet NXP introduced a new interrupt called "
ipi_snvs_btn_int_b(button) interrupt" which can be enabled via HPCR registerBTN_MASKbit. The interrupt level/edge trigger can be configured via the HPCR registerBTN_CONFIGbit field. This interrupt can be cleared by _non_ privileged software e.g. Linux by writting an '1' to the BI bit (HPSR register).Unfortunately I don't see how this interrupt is connected to the GIC. I can only see the
snvs_lp_wrapperandsnvs_hp_wrapperwhich do share the same IRQ number 4. According "Table 7-1. ARM Domain Interrupt Summary"
IRQ 4 is triggered if: "ON-OFF button press shorter than 5 secs (pulse event)". It seems like this IRQ is controlled by theset_pwr_off_irq(SPOF) but to clear this IRQ from Linux we need to set theNPSWA_ENbit.
Quoted 5 lines
Quoted 2 lines
Now my question is how the
ipi_snvs_btn_int_birq is supposed to work?My understanding is (
set_pwr_off_irq|ipi_snvs_btn_int_b) connects to IRQ 4.
That was my assumption too.
Quoted 2 lines
For more details, I need check with our Design team. Will update if I have more information.
Thank you!
Regards,
Marco
Quoted 38 lines
Subject: Re: i.MX8M SNVS ONOFF key handling (secure system)
Hi Peng,
Quoted 8 lines · Peng Fan
Hi Marco
Quoted 6 lines
Subject: i.MX8M SNVS ONOFF key handling (secure system)
Dear NXP team,
we do have the following situation:
- A verified boot (locked-down) system based on i.MX8MM andi.MX8MP
Quoted 1 line
Quoted 1 line
- The ONOFF pin is connected to an ext. MCU to initiate a
shutdown
Quoted 5 lines
Quoted 5 lines
- The
NPSWA_ENbit in HPCOMR is _not_ setAccording the datasheet NXP introduced a new interrupt called "
ipi_snvs_btn_int_b(button) interrupt" which can be enabled via HPCR registerBTN_MASKbit. The interrupt level/edge trigger canbe
Quoted 6 lines
Quoted 6 lines
configured via the HPCR register
BTN_CONFIGbit field. This interrupt can be cleared by _non_ privileged software e.g. Linux by writting an '1' to the BI bit (HPSR register).Unfortunately I don't see how this interrupt is connected to the GIC. I can only see the
snvs_lp_wrapperandsnvs_hp_wrapperwhich do
Quoted 6 lines
Quoted 6 lines
share the same IRQ number 4. According "Table 7-1. ARM Domain Interrupt Summary"
IRQ 4 is triggered if: "ON-OFF button press shorter than 5 secs (pulse event)". It seems like this IRQ is controlled by theset_pwr_off_irq
(SPOF) but to clear this IRQ from Linux we need to set the
NPSWA_ENQuoted 2 lines
Quoted 2 lines
bit.
Quoted 11 lines
Quoted 4 lines
Quoted 2 lines
Now my question is how the
ipi_snvs_btn_int_birq is supposed to work?My understanding is (
set_pwr_off_irq|ipi_snvs_btn_int_b) connectsto
Quoted 1 line
IRQ 4.
That was my assumption too.
Quoted 2 lines
For more details, I need check with our Design team. Will update if I have more information.
Sorry for late reply.
There is no debounce for ipi_snvs_btn_int_b, so if interrupt detected on PAD, the interrupt will be triggered immediately.
And this interrupt has different trigger types. Level or edge
There is debounce for set_pwr_off_irq. And this should be level trigger.
So there is possibility that ipi_snvs_btn_int_b could be triggered before set_pwr_off_irq. Then there is a short window for user to do some action, but my understanding is this not make much sense, unless needs edge trigger interrupt using btn.
Regards,
Peng.
Quoted 5 lines
Thank you!
Regards,
Marco