Skip to main content
Visitor II
March 25, 2022
Question

disable and enable all interrupt in stm32mp1

  • March 25, 2022
  • 1 reply
  • 947 views

Is there any way to disable and enable all interrupts in a assembly way, because i need to manually switch on and OFF particular GPIO before UBOOT SPL start

uboot-source/board/st/stm32mp1/board.c

void board_debug_uart_init(void)

{

// disable interrupts ---- need support here

//PWM self logic written

// enable interrupts ---- need support here

}

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    April 15, 2022

    Hi @Ara.1​ 

    is that you asked for ?

    void Enable_Irq(void)
    {
     unsigned long temp;
     __asm__ __volatile__("mrs %0, cpsr\n"
     "bic %0, %0, #0x80\n"
     "msr cpsr_c, %0"
     : "=r" (temp)
     :
     : "memory");
    }
     
    void Disable_Irq(void)
    {
     unsigned long temp;
     __asm__ __volatile__("mrs %0, cpsr\n"
     "orr	%0, %0, #0x80\n"
     "msr cpsr_c, %0"
     : "=r" (temp)
     :
     : "memory");
    }
     
    void Enable_Fiq(void)
    {
     unsigned long temp;
     __asm__ __volatile__("mrs %0, cpsr\n"
     "bic %0, %0, #0x40\n"
     "msr cpsr_c, %0"
     : "=r" (temp)
     :
     : "memory");
     
    }
     
    void Disable_Fiq(void)
    {
     unsigned long temp;
     __asm__ __volatile__("mrs %0, cpsr\n"
     "orr	%0, %0, #0x40\n"
     "msr cpsr_c, %0"
     : "=r" (temp)
     :
     : "memory");
    }

    Regards

    In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'