cancel
Showing results for 
Search instead for 
Did you mean: 

disable and enable all interrupt in stm32mp1

Ara.1
Senior

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

}

1 REPLY 1
PatrickF
ST Employee

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'

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.