2022-03-25 09:46 AM
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
}
2022-04-15 05:47 AM
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'